Menu
Inputs
Compare 2 Means: 2-Sample Non-Inferiority or Superiority
This calculator is useful for the types of tests known as non-inferiority and superiority tests. Whether the null hypothesis represents 'non-inferiority' or 'superiority' depends on the context and whether the non-inferiority/superiority margin, , is positive or negative. In this setting, we wish to test whether the mean in group 'A', , is non-inferior/superior to the mean in group 'B', . We collect a sample from both groups, and thus will conduct a two-sample test. The idea is that statistically significant differences between the means may not be of interest unless the difference is greater than a threshold, . This is particularly popular in clinical studies, where the margin is chosen based on clinical judgement and subject-domain knowledge. The hypotheses to test are
, where is the superiority or non-inferiority margin and the ratio between the sample sizes of the two groups is
Formulas
R Code
1muA=5
2muB=5
3delta=5
4kappa=1
5sd=10
6alpha=0.05
7beta=0.20
8(nB=(1+1/kappa)*(sd*(qnorm(1-alpha)+qnorm(1-beta))/(muA-muB-delta))^2)
9ceiling(nB) # 50
10z=(muA-muB-delta)/(sd*sqrt((1+1/kappa)/nB))
11(Power=pnorm(z-qnorm(1-alpha))+pnorm(-z-qnorm(1-alpha)))References
Chow S, Shao J, Wang H. 2008. Sample Size Calculations in Clinical Research. 2nd Ed. Chapman & Hall/CRC Biostatistics Series. page 61.