R version 2.6.0 (2007-10-03) Copyright (C) 2007 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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. Natural language support but running in an English locale 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. > par5 = '0.05' > par4 = '0.05' > par3 = '0.152' > par2 = '0.15' > par1 = '0.012' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: Wessa P., (2007), Testing Mean with known Variance (sample size) (v1.0.2) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_hypothesismean4.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description > 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)) > if (par2 == par3) + { + conclusion <- 'Error: the null hypothesis and alternative hypothesis must not be equal.' + } > ua <- abs(qnorm(par4)) > ub <- qnorm(par5) > c <- (par2+ua/ub*(-par3))/(1-(ua/ub)) > sqrtn <- ua*sqrt(par1)/(c - par2) > samplesize <- sqrtn * sqrtn > ua [1] 1.644854 > ub [1] -1.644854 > c [1] 0.151 > sqrtn [1] 180.1847 > samplesize [1] 32466.52 > load(file='/var/www/html/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,'population variance',header=TRUE) > a<-table.element(a,par1) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'null hypothesis about mean',header=TRUE) > a<-table.element(a,par2) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'alternative hypothesis about mean',header=TRUE) > a<-table.element(a,par3) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'type I error',header=TRUE) > a<-table.element(a,par4) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'type II 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#ex4','sample size','example'),header=TRUE) > a<-table.element(a,samplesize) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/1kz851194899178.tab") > > > > proc.time() user system elapsed 0.893 0.026 0.912