It’s A Math, Math World (Sample Size Calc)

In our last blog post, we examined the ideas of how sample size and power are interrelated. Today, we are going to look at some examples of power calculations.  The data calculations are from a presentation given by Laura Lee Johnson, Ph.D. who is a Statistician with the National Center for Complementary and Alternative Medicine.

We are going to be looking at the sample size calculations for a study to test a new sleep aid. We will perform various calculations by changing the values of the parameters and seeing what happens to the sample sizes.

  • Study effect of new sleep aid
  • 1 sample test
  • Baseline to sleep time after taking the medication for one week
  • Two-sided test, α = 0.05, power = 90%
  • Difference = 1 (4 hours of sleep to 5)
  • Standard deviation = 2 hr


  • 1 sample test
  • 2-sided test, α = 0.05, 1-β = 90%
  • σ = 2 hr (standard deviation)
  • δ = 1 hr (difference of interest)


  • Change difference of interest from 1 hr to 2 hr
  • n goes from 43 to 11



  • Change power from 90% to 80%
  • n goes from 11 to 8
  • (Small sample: start thinking about using the t distribution)



  • Change the standard deviation from 2 to 3
  • n goes from 8 to 18

We now look at a 2 sample randomized parallel design and compare the sample sizes needed.


  • Original design (2-sided test, α = 0.05, 1-β = 90%, σ = 2hr, δ = 1 hr)
  • Two sample randomized parallel design
  • Needed 43 in the one-sample design
  • In 2-sample need twice that, in each group!
  • 4 times as many people are needed in this design


  • Change difference of interest from 1hr to 2 hr
  • n goes from 170 to 44



  • Change power from 90% to 80%
  • n goes from 44 to 32


  • Change the standard deviation from 2 to 3
  • n goes from 32 to 72



  • Changes in the detectable difference have HUGE impacts on sample size
    • 20 point difference →   25 patients/group
    • 10 point difference → 100 patients/group
    •  5  point difference → 400 patients/group
  • Changes in α, β, σ, number of samples, if it is a 1- or 2-sided test can all have a large impact on your sample size calculation

Next time, we will begin looking at experimental design and clinical trials.

Like what you read? Get blogs delivered right to your inbox as I post them so you can start standing out in your job and career. There is not a better way to learn or review biostatistics than by reading, It’s A Math, Math World

Email Marketing You Can Trust







2 Responses to “It’s A Math, Math World (Sample Size Calc)”

  • Eric Zarahn says:

    Thanks for the post. It would have been helpful if you stated what the statistical model/test was (e.g., t-test, z-test, etc.).

  • Lena Yeap says:

    Thank for sharing your knowledge and I am looking forward for more complicate sample size and power estimation such as Adjusted for covariates vs. unadjusted analysis and etc.