# ::Free Statistics and Forecasting Software::

v1.2.1

### :: Testing Mean with known Variance - Sample Size - Free Statistics Software (Calculator) ::

All rights reserved. The non-commercial (academic) use of this software is free of charge. The only thing that is asked in return is to cite this software when results are used in publications.

This free online software (calculator) computes the sample size for the one-sided hypothesis test about the mean, given a user-defined type I and II error. In this test it is assumed that the population variance is known.

 Send output to: Browser Blue - Charts White Browser Black/White CSV Population Variance Null Hypothesis about mean Alternative Hypothesis about mean Type I error (alpha) Type II error (beta)

 Source code of R module 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 print(ua) print(ub) print(c) print(sqrtn) print(samplesize) load(file="createtable") a<-table.start() a<-table.row.start(a) a<-table.element(a,"Testing Mean with known Variance",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,"sample size",header=TRUE) a<-table.element(a,samplesize) a<-table.row.end(a) a<-table.end(a) table.save(a,file="mytable.tab")
 Top | Output | Charts | References

 Cite this software as: Wessa P., (2016), Testing Mean with known Variance (sample size) (v1.0.5) in Free Statistics Software (v1.2.1), Office for Research Development and Education, URL http://www.wessa.net/rwasp_hypothesismean4.wasp/ The R code is based on : Xycoon, Statistics - Econometrics - Forecasting, Office for Research Development and Education, http://www.xycoon.com/ht_mean_knownvar.htm#ex4
 Top | Output | Charts | References