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(102,112,118,122,106,149,122,86,117,97,132,87,101,115,109,159,131,120,86,105,100,132,105,121,120,126,138,118,130,103,129,150,88,125,112,144,127,117,108,139,97,115,95,91,102,124,106,125,130,79,108,136,108,139,110,114,118,120,108,130,130,112,94) > par2 = '100' > 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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/128461355999240.tab") > > > > proc.time() user system elapsed 0.313 0.104 0.394