# required libraries

library(pwr)

Premise

This is a retrospective cohort study looking at patients who are diagnosed with myocarditis and reduced LV EF. We are interested in studying their outcomes. For the purpose of this sample size calculation, the primary outcome will be improvement in LVEF. Previous studies have been performed assessing LVEF to children with myocarditis and tracking echo improvement after IVIG which was succinctly summarized in a recent meta-analysis by Li et al. 1 I will be using their means and SD summarized in the meta-analysis for assessment of our effect size.

Primary outcome and predefined parameters

  • The primary outcome is improvement in LVEF.
    • We hope to see an improvement in LVEF by 20%.
  • The average LVEF and standard deviation of LVEF calculated in prior studies:
    • who were controls: 42% sd 8.2
    • who were given IVIG: 61% sd 23.1
    • mean difference of: 18.9%
  • The alpha is 0.05
  • The power is 0.8

Sample size calculation

For a two sample t-test comparing means, you need Cohen’s d calculation to estimate size effect.

  • Cohen’s d = mean difference/pooled SD
  • SD pooled = sqrt((SDgroup1^2 + SDgroup2^2)/2)

Using the above known SD for cases and controls you get:

coh_d <- 20/sqrt((8.2^2 + 23.1^2)/2)

coh_d
## [1] 1.153883
  • Applying this to the sample size calculator
# The power calculation for two sample same size is this function: pwr.t.test
pwr.t.test(n = NULL, d = coh_d, sig.level = 0.05, power = 0.8, type = "two.sample")
## 
##      Two-sample t test power calculation 
## 
##               n = 12.82516
##               d = 1.153883
##       sig.level = 0.05
##           power = 0.8
##     alternative = two.sided
## 
## NOTE: n is number in *each* group

Is a sample size of 13 for each group too small?

If I plug in the numbers of the meta-analysis into this website (sample size of IVIG is 25, sample size of controls 43): https://www.socscistatistics.com/effectsize/default3.aspx

I actually get similar numbers for effect size:

Cohen’s d = (61 - 42) ⁄ 17.332772 = 1.096189.

Glass’s delta = (61 - 42) ⁄ 8.2 = 2.317073.

Hedges’ g = (61 - 42) ⁄ 15.389252 = 1.234628.

Let’s try a mean difference of 10% instead

coh_d_10 <- 10/sqrt((8.2^2 + 23.1^2)/2)

coh_d_10
## [1] 0.5769417
pwr.t.test(n = NULL, d = coh_d_10, sig.level = 0.05, power = 0.8, type = "two.sample")
## 
##      Two-sample t test power calculation 
## 
##               n = 48.13934
##               d = 0.5769417
##       sig.level = 0.05
##           power = 0.8
##     alternative = two.sided
## 
## NOTE: n is number in *each* group
  • If you decrease the mean difference to 10%, it looks like the n needs to be more robust at 48 per group. However, a 10% difference in LVEF doesn’t really seem to be clinically significant.

Let me know what you think!


  1. Li Y, Yu Y, Chen S, Liao Y, Du J. Corticosteroids and Intravenous Immunoglobulin in Pediatric Myocarditis: A Meta-Analysis. Front Pediatr. 2019;7:342. doi:10.3389/fped.2019.00342↩︎