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. > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '0.35' > par4 = '20' > par3 = '20.2857142857143' > par2 = '13' > par1 = '98' > par1<-as.numeric(par1) > par2<-as.numeric(par2) > par3<-as.numeric(par3) > par4<-as.numeric(par4) > par5<-as.numeric(par5) > c <- 'NA' > csn <- abs(qnorm(par5)) > csn2 <- abs(qnorm(par5/2)) > if (par3 == par4) + { + conclusion <- 'Error: the null hypothesis and sample mean must not be equal.' + conclusion2 <- conclusion + } else { + cleft <- par3 - csn2 * sqrt(par2) / sqrt(par1) + cright <- par3 + csn2 * sqrt(par2) / sqrt(par1) + c2 <- paste('[',cleft) + c2 <- paste(c2,', ') + c2 <- paste(c2,cright) + c2 <- paste(c2,']') + if ((par4 < cleft) | (par4 > cright)) + { + conclusion2 <- 'Reject the null hypothesis' + } else { + conclusion2 <- 'Do not reject the null hypothesis' + } + } > if (par3 > par4) + { + c <- par4 + csn * sqrt(par2) / sqrt(par1) + if (par3 < c) + { + conclusion <- 'Do not reject the null hypothesis.' + } else { + conclusion <- 'Reject the null hypothesis.' + } + } > if (par3 < par4) + { + c <- par4 - csn * sqrt(par2) / sqrt(par1) + if (par3 > c) + { + conclusion <- 'Do not reject the null hypothesis.' + } else { + conclusion <- 'Reject the null hypothesis.' + } + } > c [1] 20.14034 > conclusion [1] "Reject the null hypothesis." > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ht_mean_knownvar.htm','Testing Mean with known Variance','learn more about Statistical Hypothesis Testing about the Mean when the Variance is known'),2,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'sample size',header=TRUE) > a<-table.element(a,par1) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'population variance',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,par3) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'null hypothesis about mean',header=TRUE) > a<-table.element(a,par4) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'type I error',header=TRUE) > a<-table.element(a,par5) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ht_mean_knownvar.htm#overview','critical value (one-tailed)','about the critical value'),header=TRUE) > a<-table.element(a,c) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'confidence interval (two-tailed)
(sample mean)',header=TRUE) > a<-table.element(a,c2) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'conclusion for one-tailed test',2,header=TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,conclusion,2) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'conclusion for two-tailed test',2,header=TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,conclusion2,2) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/15imn1320773828.tab") > > > > proc.time() user system elapsed 0.209 0.026 0.224