6.7.2. Two Samples
The first procedure provided here concerns estimation of the difference between two population means and as such it is different from the last three. The latter are derived from the same equation, each time solving for a different parameter.
6.7.2.1. Sample Size in Estimating Two Population Means
The sample size, which is assumed to be the same for both samples, is computed from:
Here:
· is the pooled sample variance with ν degrees of freedom,
· d is the halfwidth of the desired confidence interval,
· 1 – α is the confidence level,
· 1 – β is the assurance that the confidence interval will not be greater,
· is the twotailed critical value for α from tdistribution with 2(n – 1) degrees of freedom,
If the two sample sizes are not equal, and one of them is given, then the other sample size is estimated according to the following formula, which is derived from their harmonic mean:
Since critical values of t and F on the right hand side of this equation depend on the sample size n, the left hand side cannot be computed directly. Instead, an iterational algorithm is employed and usually the convergence is achieved within a few iterations.
The user is expected to enter:
· Denominator Degrees of Freedom
· Pooled Variance
· HalfWidth of Confidence Interval
· Assurance for Confidence Interval
· Confidence Level
· n_{1} is given when n_{1} n_{2} (optional)
and the program will output the estimated sample size.
In case when the two samples are assumed to be of equal size, the value of the n_{1} field should be zero.
Example
Example 8.3 on p. 147 from Zar, J. H. (2010). Select Statistics 1 → Sample Size and Power Estimation → Two Samples and the Sample Size in Estimating Two Population Means option. Enter the following data at the next dialogue:
Sample Size and Power Estimation: Two Samples
Sample Size in Estimating Two Population Means
Denominator Degrees of Freedom = 
11.0000 
Pooled Variance = 
0.5193 
HalfWidth of Confidence Interval = 
0.5000 
Assurance for Confidence Interval = 
0.9000 
Confidence Level = 
0.9500 
N1 Given (Optional) = 
0.0000 
Estimated Sample Size = 
17.2934 
6.7.2.2. Sample Size in Tests Concerning Two Means
The purpose of the experiment is to test if the two samples are taken from one population “H_{0}: μ_{1} = μ_{2}” or from two distinct populations “H_{0}: μ_{1} μ_{2}”.
The sample size is computed from:
Here:
· is the pooled sample variance with ν degrees of freedom,
· δ is the minimum detectable difference between the two population means at the desired confidence interval,
· α is the probability of committing a Type I error and 1 α is the confidence level, which can be one or twotailed.
· β is the probability of committing a Type II error and 1 – β is the power of the test, which is the probability of detecting a real difference,
· is the (one or) twotailed critical value for α from tdistribution with ν degrees of freedom,
· is the onetailed critical value for β from tdistribution with ν degrees of freedom.
Since critical values on the right hand side of this equation are dependent on the sample size n, an iterational algorithm is employed.
The user is expected to enter:
· Pooled Sample Variance
· Minimum detectable difference
· Power of the test
· Confidence Level
· 1 or 2 tailed test
· n_{1} is given when n_{1} n_{2} (optional)
and the program will output the estimated sample size.
If the two samples are assumed to have the same size, enter 0 into the N1 Given (optional) field. If the size of one of the samples is fixed, then enter the value into this field. In this case the program will calculate the second sample size from the following formula, which is derived from their harmonic mean:
Example
Example 8.4 on p. 149 from Zar, J. H. (2010). Select Statistics 1 → Sample Size and Power Estimation → Two Samples and the Sample Size in Tests Concerning Two Means option. Enter the following data at the next dialogue:
Sample Size and Power Estimation: Two Samples
Sample Size in Tests Concerning Two Means
Pooled Variance = 
0.5200 
Minimum Detectable Difference = 
0.5000 
Power of the Test = 
0.9000 
Confidence Level = 
0.9500 
1 or 2 Tailed Test = 
2.0000 
N1 Given (optional) = 
30.0000 
Estimated Sample Size = 
44.7241 
N2 when N1 Given = 
87.8328 
6.7.2.3. Minimum Detectable Difference for Two Samples
Rearranging the equation in section 6.7.1.2. Sample Size in Tests Concerning the Mean we obtain:
Here, δ can be computed directly, without an iterational algorithm, as all parameters on the right hand side can be computed using the given parameters.
The user is expected to enter:
· Sample Size
· Pooled Sample Variance
· Power of the test
· Confidence Level
· 1 or 2 tailed test
and the program will output the minimum detectable difference for this sample size. For different sample sizes enter their harmonic mean:
Example
Example 8.5 on p. 150 from Zar, J. H. (2010). Select Statistics 1 → Sample Size and Power Estimation → Two Samples and the Minimum Detectable Difference option. Enter the following data at the next dialogue:
Sample Size and Power Estimation: Two Samples
Minimum Detectable Difference
Sample Size = 
20.0000 
Pooled Variance = 
0.5193 
Power of the Test = 
0.9000 
Confidence Level = 
0.9500 
1 or 2 Tailed Test = 
2.0000 
Minimum Detectable Difference = 
0.7585 
6.7.2.4. Power of the Test for Two Samples
Rearranging the equation in section 6.7.1.2. Sample Size in Tests Concerning the Mean we obtain:
Here, can be computed directly and then β is obtained from the tdistribution with ν degrees of freedom.
An alternative method of estimating power of the test is also provided which is based on the noncentral Fdistribution. The phi statistic is calculated from:
and its pvalue is automatically calculated by the program (Pearson and Hartley (1951), pp. 112130).
The user is expected to enter:
· Sample Size
· Pooled Sample Variance
· Minimum Detectable Difference
· Confidence Level
· 1 or 2 tailed test
and the program will output the computed tstatistic and its pvalue, as well as the phi statistic and its and its pvalue.
If the two samples have different sizes then their harmonic mean should be entered:
Example
Example 8.6 on p. 151 from Zar, J. H. (2010). Select Statistics 1 → Sample Size and Power Estimation → Two Samples and the Power of the Test option. Enter the following data at the next dialogue:
Sample Size and Power Estimation: Two Samples
Power of the Test
Sample Size = 
15.0000 
Pooled Variance = 
0.5193 
Minimum Detectable Difference = 
1.0000 
Confidence Level = 
0.9500 
1 or 2 Tailed Test = 
2.0000 
Power of the Test: 

tStatistic = 
1.7519 
2Tail Probability = 
0.9546 
Phi = 
2.6872 
Probability = 
0.9561 