Sample size requirements for t tests

Example 1: What is the minimum sample size needed to obtain power of at least 80% for a two sample, two-tailed t test with null hypothesis μ1 = μto detect an effect size of d = .4 (assumes both samples have the same size)?

We begin by repeating Example 3 of Statistical Power of the t tests, assuming that the two sample sizes are equal (see Figure 4 of Statistical Power of the t tests).

Power two-sample t

Figure 1 – Initialize search for sample size

We now employ Excel’s Goal Seek capability by selecting Data > Data Tools|What-if Analysis > Goak Seek… When a dialog box as in Figure 2 appears, fill in the fields as indicated.

Goal Seek sample size

Figure 2 – Goal Seek dialog box

The results are shown in Figure 3.

Sample size t test

Figure 3 – Sample size needed to achieve 80% power

Rounding up to the nearest integer, we see that a sample size of 99 is required to detect an effect of .4 with power of about 80%. In fact we see that a sample size of 99 still leaves us just short of 80% power. We need a sample of size 100 to achieve 80% power; note that T2_POWER(.4,100) = .803648.

This same result can be achieved using the second of the following supplemental functions.

Real Statistics Functions: The following functions are provided in the Real Statistics Resource Pack:

T1_SIZE(d, 1−β, tails, α, m) = the minimum sample size required to obtain power of at least 1β in a one sample t test when d = Cohen’s effect size, tails = # of tails: 1 or 2 (default), α = alpha (default = .05) and m = upper limit of the infinite sum (1−170, default = 120).

T2_SIZE(d, 1β, tails, α, nratio, m) = the minimum sample size required to obtain power of at least 1β in a two sample t test when d = Cohen’s effect size, tails = # of tails: 1 or 2 (default), α = alpha (default = .05), nratio = the size of the second sample divided by the size of the first sample (default = 1) and m = upper limit of the infinite sum (1−170, default = 120).

In the two sample case, only the size of the first sample is returned. If the two samples don’t have the same size, you can specify the size of the second sample in terms of the size of first sample using the nratio argument. E.g. if the size of the second sample is half of the first, then set nratio = .5.

If you set nratio to be a negative number then the absolute value of this number will be used as the sample size of the second sample. E.g. if nratio = -50, then the T2_SIZE function will find the size of the first sample assuming that the second sample has 50 elements.

For Example 1, T2_SIZE(.4) = T2_SIZE(.4, .8, 2, .05, 10) = 100. Also T2_SIZE(.4, .8, 1, .05, 10) = 78, which is consistent with the fact that a one-tailed test requires a smaller sample. Also T2_SIZE(.4, .8, 1, .025, 10) = 121, which is consistent with the fact that a lower value of α requires a larger sample to achieve the same power.

Finally, T1_SIZE(.4) = 52, which is consistent with the fact that a paired sample test requires a smaller sample to achieve the same power.

2 Responses to Sample size requirements for t tests

  1. Art sergi says:

    Mr. Zaiontz,
    My company is using the Excel t-test unequal variance for a population of 3 and I am doubting that this is large enough to produce valid results.

    What are your thoughts>

Leave a Reply

Your email address will not be published. Required fields are marked *