Power and Sample Size using Real Statistics

We now show how to calculate the power and sample size of one-sample and two-sample normal hypothesis testing using Real Statistics functions.

Worksheet Functions

Real Statistics Functions: The Real Statistics Resource Pack supplies the following functions for calculating the power and sample size requirements for one-sample and two-sample hypothesis testing of the mean using the normal distribution.

NORM1_POWER(d, n, tails, α) = the power of a one sample normal test when d = Cohen’s effect size, n = the sample size, tails = # of tails: 1 or 2 (default) and α = alpha (default .05).

NORM1_SIZE(d, 1−β, tails, α) = the sample size required to detect an effect of size of d with power 1−β (default .80) when tails = # of tails: 1 or 2 (default) and α = alpha (default .05).

NORM2_POWER(m, s1, s2, n1, n2, tails, α) = the power of a two sample normal test when m = difference between population means, n1 and n2 are the sample sizes, s1 and s2 are the corresponding population standard deviations, tails = # of tails: 1 or 2 (default) and α = alpha (default .05). If n2 is omitted or set to 0, then n2 is considered to be equal to n1.

NORM2_SIZE(ms1, s2, 1−β, tails, α, nratio) = the sample size required to detect a difference between population means of size of m with power 1−β (default .80) wheres1 and s2 are the two population standard deviations, nratio is as described below (default = 1), tails = # of tails: 1 or 2 (default) and α = alpha (default .05).

Arguments

For NORM2_SIZE 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 the 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 NORM2_SIZE function will find the size of the first sample assuming that the second sample has 50 elements.

Examples

Referring to Figure 1 of Power & Sample Size Two-tailed Test, we see that NORM1_POWER(B3,B5,2,B4) = .554768, as expected, and referring to Figure 3 of that webpage, NORM1_SIZE(B23,B21,2,B22) = 196.222.

Referring to Figure 1 of Power & Sample Size Two-Sample Test, we see that NORM2_POWER(J5-I5,I6,J6,I4,,1) = .8429. Referring to Figure 3 of that webpage, we see that NORM2_SIZE(B26,B21,C21) = 71.44.

If in Example 3 of Power & Sample Size Two-Sample Test, we fix the size of the second sample to be 50, then the size of the first sample can be calculated by NORM2_SIZE(B26,B21,C21,,,,-50) = 125.08 for the two-tailed test.

Data Analysis Tool

Real Statistics Data Analysis Tool: You can also use the Real Statistics Statistical Power and Sample Size data analysis tool to determine the power for one-sample or two-sample normal hypothesis testing.  You can also use this tool to determine the minimum sample size required to achieve a specified effect size, power and significance level. See Real Statistics Power and Sample Size Analysis Tool for details.

Examples Workbook

Click here to download the Excel workbook with the examples described on this webpage.

References

Faul, F., Erdfelder, E., Buchner, A., & Lang, A. G. (2009). Statistical power analyses using G*Power 3.1: Tests for correlation and regression analyses. Behavior Research Methods, 41, 1149-1160.
http://link.springer.com/article/10.3758/BRM.41.4.1149

STAT (2015) Power and sample size reference manual, release 13
http://www.stata.com/manuals13/pss.pdf

Bhandari, P. (2021) Statistical power and why it matters | a simple introduction
https://www.scribbr.com/statistics/statistical-power/

8 thoughts on “Power and Sample Size using Real Statistics”

  1. Dear Charles,

    Thank you for your great package!
    I am wondering in case of non parametric tests, how can I perform a power analysis to estimate the minimal required number of subjects in my samples ?
    Thank you for your great work and for your answer,

    Best regards,

    Reply
  2. Dear Charles: Thank you for a wonderful package! Unfortunately some of us need more help in understanding some procedures. I would like to ask you if one can calculate sample size for an in-vitro test with a given Specificity, a given Sensitivity and a prevalence of the disease in the population to be screened with the test. Thank you very much and regards, Ricardo

    Reply
  3. Dear Dr. Charles,

    I have two simple questions for you:
    1) Why the two functions NORM1_SIZE and T1_SIZE return different values with the same input parameters? I was expecting they to give the same result.

    2) As from previous question there should be some difference between the two functions that I don’t understand, which is the most appropriate one to determine the desired sample size for a paired t-test?

    Thank you very much
    Best Regards
    Piero

    Reply
    • Piero,
      1. They are different since the normal distribution is different from the t distribution. Also the two tests are different.
      2. For the paired t test you should use T1_SIZE.
      Charles

      Reply

Leave a Comment