R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- c(1,1,1,1,1,0,0,1,0,1,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,0,1) > par2 = '0' > par1 = '0.95' > par1 <- as.numeric(par1) > par2 <- as.numeric(par2) > len <- length(x) > df <- len - 1 > sd <- sd(x) > mx <- mean(x) > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > delta2 <- abs(qt((1-par1)/2,df)) * sd / sqrt(len) > delta1 <- abs(qt((1-par1),df)) * sd / sqrt(len) > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Hypothesis Test about the Mean - Confidence Interval',2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Sample size',header=TRUE) > a<-table.element(a,len) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Sample standard deviation',header=TRUE) > a<-table.element(a,sd) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Confidence',header=TRUE) > a<-table.element(a,par1) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Null hypothesis',header=TRUE) > a<-table.element(a,par2) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Sample Mean',header=TRUE) > a<-table.element(a,mx) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'2-sided Confidence Interval',header=TRUE) > dum <- paste('[',mx-delta2) > dum <- paste(dum,',') > dum <- paste(dum,mx+delta2) > dum <- paste(dum,']') > a<-table.element(a,dum) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Left-sided Confidence Interval',header=TRUE) > dum <- paste('[',mx-delta1) > dum <- paste(dum,', +inf ]') > a<-table.element(a,dum) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Right-sided Confidence Interval',header=TRUE) > dum <- paste('[ -inf, ',mx+delta1) > dum <- paste(dum,']') > a<-table.element(a,dum) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/1hhqk1355821369.tab") > > > > proc.time() user system elapsed 0.281 0.085 0.341