R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(26,20,19,20,25,22,26,22,19,24,26,13,22,21,7,17,25,25,19,23,22,21,18,22,18,23,20,15,21,18,19,22,16,18,20,24,24,18,21,17,22,16,21,24,24,16,16,18,20,24,17,19,20,15,22,23,16,19,19,21,24,22,18,24,24,22,23,22,20,18,25,16,20,15,19,19,16,17,28,25,20,16,23,21,23,18,20,9,25,20,21,22,27,18,16,22,20,20) > par2 = '20' > 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/1rseu1324143655.tab") > > > > proc.time() user system elapsed 0.201 0.024 0.218