::Free Statistics and Forecasting Software::

v1.1.20
 
 

:: Minimum Sample Size - Testing Mean - Free Statistics Software (Calculator) ::

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 minimum sample size that is required to test a mean. The computation takes into account: a margin of error (allowable deviation), the percentage of confidence, the population size (use a large number for infinite populations), the population variance, and the power (default is 50%).
In addition, the minimum sample size is computed for the case where the population variance is unknown (the specified population variance is used as a starting value in the t-distribution).

Send output to:
Population size (?)
Margin of Error (?)
Confidence 
Population Variance 
Power (?)
Chart options
Width:
Height:


Cite this software as:
Wessa P., (2006), Minimum Sample Size (Testing Mean) (v1.0.0) in Free Statistics Software (v1.1.20), Office for Research Development and Education, URL http://www.wessa.net/rwasp_samplenorm.wasp/
The R code is based on :
NIST/SEMATECH e-Handbook of Statistical Methods, http://www.itl.nist.gov/div898/handbook/, 2006-11-12.
Source code of R module
1par1 <- as.numeric(par1)
2par2 <- as.numeric(par2)
3par3 <- as.numeric(par3)
4par4 <- as.numeric(par4)
5par5 <- as.numeric(par5)
6(z <- abs(qnorm((1-par3)/2)) + abs(qnorm(1-par5)))
7(z1 <- abs(qnorm(1-par3)) + abs(qnorm(1-par5)))
8z2 <- z*z
9z2one <- z1*z1
10z24 <- z2 * par4
11z24one <- z2one * par4
12npop <- array(NA, 200)
13ppop <- array(NA, 200)
14for (i in 1:200)
15{
16ppop[i] <- i * 100
17npop[i] <- ppop[i] * z24 / (z24 + (ppop[i] - 1) * par2*par2)
18}
19bitmap(file="pic1.png")
20plot(ppop,npop, xlab="population size", ylab="sample size (2 sided test)", main = paste("Confidence",par3))
21dumtext <- paste("Margin of error = ",par2)
22dumtext <- paste(dumtext," Population Var. = ")
23dumtext <- paste(dumtext, par4)
24mtext(dumtext)
25grid()
26dev.off()
27par2sq <- par2 * par2
28num <- par1 * z24
29denom <- z24 + (par1 - 1) * par2sq
30(n <- num/denom)
31num1 <- par1 * z24one
32denom1 <- z24one + (par1 - 1) * par2sq
33(n1 <- num1/denom1)
34load(file="createtable")
35a<-table.start()
36a<-table.row.start(a)
37a<-table.element(a,"Minimum Sample Size",2,TRUE)
38a<-table.row.end(a)
39a<-table.row.start(a)
40a<-table.element(a,"Population Size",header=TRUE)
41a<-table.element(a,par1)
42a<-table.row.end(a)
43a<-table.row.start(a)
44a<-table.element(a,"Margin of Error",header=TRUE)
45a<-table.element(a,par2)
46a<-table.row.end(a)
47a<-table.row.start(a)
48a<-table.element(a,"Confidence",header=TRUE)
49a<-table.element(a,par3)
50a<-table.row.end(a)
51a<-table.row.start(a)
52a<-table.element(a,"Power",header=TRUE)
53a<-table.element(a,par5)
54a<-table.row.end(a)
55a<-table.row.start(a)
56a<-table.element(a,"Population Variance",header=TRUE)
57a<-table.element(a,par4)
58a<-table.row.end(a)
59a<-table.row.start(a)
60a<-table.element(a,"z(alpha/2) + z(beta)",header=TRUE)
61a<-table.element(a,z)
62a<-table.row.end(a)
63a<-table.row.start(a)
64a<-table.element(a,"z(alpha) + z(beta)",header=TRUE)
65a<-table.element(a,z1)
66a<-table.row.end(a)
67a<-table.row.start(a)
68a<-table.element(a,"Minimum Sample Size (2 sided test)",header=TRUE)
69a<-table.element(a,n)
70a<-table.row.end(a)
71a<-table.row.start(a)
72a<-table.element(a,"Minimum Sample Size (1 sided test)",header=TRUE)
73a<-table.element(a,n1)
74a<-table.row.end(a)
75a<-table.end(a)
76table.save(a,file="mytable.tab")
77(ni <- z24 / (par2sq))
78(ni1 <- z24one / (par2sq))
79a<-table.start()
80a<-table.row.start(a)
81a<-table.element(a,"Minimum Sample Size (for Infinite Populations)",2,TRUE)
82a<-table.row.end(a)
83a<-table.row.start(a)
84a<-table.element(a,"Population Size",header=TRUE)
85a<-table.element(a,"infinite")
86a<-table.row.end(a)
87a<-table.row.start(a)
88a<-table.element(a,"Margin of Error",header=TRUE)
89a<-table.element(a,par2)
90a<-table.row.end(a)
91a<-table.row.start(a)
92a<-table.element(a,"Confidence",header=TRUE)
93a<-table.element(a,par3)
94a<-table.row.end(a)
95a<-table.row.start(a)
96a<-table.element(a,"Power",header=TRUE)
97a<-table.element(a,par5)
98a<-table.row.end(a)
99a<-table.row.start(a)
100a<-table.element(a,"Population Variance",header=TRUE)
101a<-table.element(a,par4)
102a<-table.row.end(a)
103a<-table.row.start(a)
104a<-table.element(a,"z(alpha/2) + z(beta)",header=TRUE)
105a<-table.element(a,z)
106a<-table.row.end(a)
107a<-table.row.start(a)
108a<-table.element(a,"z(alpha) + z(beta)",header=TRUE)
109a<-table.element(a,z1)
110a<-table.row.end(a)
111a<-table.row.start(a)
112a<-table.element(a,"Minimum Sample Size (2 sided test)",header=TRUE)
113a<-table.element(a,ni)
114a<-table.row.end(a)
115a<-table.row.start(a)
116a<-table.element(a,"Minimum Sample Size (1 sided test)",header=TRUE)
117a<-table.element(a,ni1)
118a<-table.row.end(a)
119a<-table.end(a)
120table.save(a,file="mytable.tab")
121(z <- abs(qt((1-par3)/2,n-1)) + abs(qt(1-par5,n-1)))
122(z1 <- abs(qt(1-par3,n1-1)) + abs(qt(1-par5,n1-1)))
123z2 <- z*z
124z2one <- z1*z1
125z24 <- z2 * par4
126z24one <- z2one * par4
127par2sq <- par2 * par2
128num <- par1 * z24
129denom <- z24 + (par1 - 1) * par2sq
130(n <- num/denom)
131num1 <- par1 * z24one
132denom1 <- z24one + (par1 - 1) * par2sq
133(n1 <- num1/denom1)
134a<-table.start()
135a<-table.row.start(a)
136a<-table.element(a,"Minimum Sample Size (Unknown Population Variance)",2,TRUE)
137a<-table.row.end(a)
138a<-table.row.start(a)
139a<-table.element(a,"Population Size",header=TRUE)
140a<-table.element(a,par1)
141a<-table.row.end(a)
142a<-table.row.start(a)
143a<-table.element(a,"Margin of Error",header=TRUE)
144a<-table.element(a,par2)
145a<-table.row.end(a)
146a<-table.row.start(a)
147a<-table.element(a,"Confidence",header=TRUE)
148a<-table.element(a,par3)
149a<-table.row.end(a)
150a<-table.row.start(a)
151a<-table.element(a,"Power",header=TRUE)
152a<-table.element(a,par5)
153a<-table.row.end(a)
154a<-table.row.start(a)
155a<-table.element(a,"Population Variance",header=TRUE)
156a<-table.element(a,"unknown")
157a<-table.row.end(a)
158a<-table.row.start(a)
159a<-table.element(a,"t(alpha/2) + t(beta)",header=TRUE)
160a<-table.element(a,z)
161a<-table.row.end(a)
162a<-table.row.start(a)
163a<-table.element(a,"t(alpha) + t(beta)",header=TRUE)
164a<-table.element(a,z1)
165a<-table.row.end(a)
166a<-table.row.start(a)
167a<-table.element(a,"Minimum Sample Size (2 sided test)",header=TRUE)
168a<-table.element(a,n)
169a<-table.row.end(a)
170a<-table.row.start(a)
171a<-table.element(a,"Minimum Sample Size (1 sided test)",header=TRUE)
172a<-table.element(a,n1)
173a<-table.row.end(a)
174a<-table.end(a)
175table.save(a,file="mytable.tab")
176(z <- abs(qt((1-par3)/2,ni-1)) + abs(qt(1-par5,ni-1)))
177(z1 <- abs(qt(1-par3,ni1-1)) + abs(qt(1-par5,ni1-1)))
178z2 <- z*z
179z2one <- z1*z1
180z24 <- z2 * par4
181z24one <- z2one * par4
182(ni <- z24 / (par2sq))
183(ni1 <- z24one / (par2sq))
184a<-table.start()
185a<-table.row.start(a)
186a<-table.element(a,"Minimum Sample Size
(Infinite Population, Unknown Population Variance)",2,TRUE)
187a<-table.row.end(a)
188a<-table.row.start(a)
189a<-table.element(a,"Population Size",header=TRUE)
190a<-table.element(a,"infinite")
191a<-table.row.end(a)
192a<-table.row.start(a)
193a<-table.element(a,"Margin of Error",header=TRUE)
194a<-table.element(a,par2)
195a<-table.row.end(a)
196a<-table.row.start(a)
197a<-table.element(a,"Confidence",header=TRUE)
198a<-table.element(a,par3)
199a<-table.row.end(a)
200a<-table.row.start(a)
201a<-table.element(a,"Power",header=TRUE)
202a<-table.element(a,par5)
203a<-table.row.end(a)
204a<-table.row.start(a)
205a<-table.element(a,"Population Variance",header=TRUE)
206a<-table.element(a,"unknown")
207a<-table.row.end(a)
208a<-table.row.start(a)
209a<-table.element(a,"t(alpha/2) + t(beta)",header=TRUE)
210a<-table.element(a,z)
211a<-table.row.end(a)
212a<-table.row.start(a)
213a<-table.element(a,"t(alpha) + t(beta)",header=TRUE)
214a<-table.element(a,z1)
215a<-table.row.end(a)
216a<-table.row.start(a)
217a<-table.element(a,"Minimum Sample Size (2 sided test)",header=TRUE)
218a<-table.element(a,ni)
219a<-table.row.end(a)
220a<-table.row.start(a)
221a<-table.element(a,"Minimum Sample Size (1 sided test)",header=TRUE)
222a<-table.element(a,ni1)
223a<-table.row.end(a)
224a<-table.end(a)
225table.save(a,file="mytable.tab")

To cite Wessa.net in publications use:
Wessa, P. (2008), Free Statistics Software, Office for Research Development and Education,
version 1.1.20, URL http://www.wessa.net/

© Resa R&D, and the 'Office for Research, Development, and Education' - All rights reserved. This website is an intellectual and physical property of Resa R&D. This includes: html content, graphical illustrations (gif files), computer software, online or electronic documentation, associated media, and printed materials. The free use of the scientific content, services, and applications in this website is granted for non commercial use only. In any case, the source (url) should always be clearly displayed. Under no circumstances are you allowed to reproduce, copy or redistribute the design, layout, or any content of this website (for commercial use) including any materials contained herein without the express written permission of Resa R&D or the Office for Research, Development, and Education.

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, Resa R&D makes no warranties or representations as to the accuracy or completeness of such information (or software), and it assumes no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall Resa R&D be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.

Software Version : 1.1.20
Algorithms & Software : Prof. dr. P. Wessa
Facilities : Resa R&D - Office for Research, Development, and Education
Server : www.wessa.net

Comments, Feedback & Errors | Privacy Policy | Statistics Resources | Wessa.net Home

 © Wessa.Net 2002-2008  
 
 

Home Page
Equation Plotter
Time Series Analysis
Financial Databases
Multiple Regression
Descriptive Statistics
Statistical Distributions
Hypothesis Testing

Academic citations
Latest News
Archive (old versions)
FAQ
About Wessa.net

Black&White
Blue Theme

Google
Web wessa.net

All rights reserved. Academic license for non-commercial use only.

 
This website is kindly sponsored by:
Bandwidth Monitoring | Get a business or technology degree near you