130 Equivalence and Noninferiority Tests
–1.2 –1.0 –0.8 –0.6 –0.4 –0.2 0.0 0.2
0.0
0.2
0.4
0.6
0.8
1.0
Delta
Power
Test 2.1, R: power curve.
Test 2.2 Comparison of Two MeansTwo Independent
Samples, Fixed Δ Paradigm (One-Sided)
Input parameters:
D0 = maximum desirable difference between means
mu1 = prior estimate of mean for group 1
n = sample size per group
SAS code:
libname stuff 'H:\Personal Data\Equivalence & Noninferiority\
Programs & Output';
data calc;
set stuff.d20120803_test_2_2_two_means;
mu2 = mu1 - Da;
delta = (D0 - Da)/sigma;
nc = sqrt(n/2) * delta;
tcrit = tinv(0.05,2*n-2);
power = 1 - probt(tcrit,2*n-2,nc);/* Pr{T' > = tcrit} */
run;
131Computer Code—Power Curves
proc print data = calc;/*dataset calc has columns n muL muA
sigma delta nc power */
run;
The SAS System 13:57 Friday, August 3, 2012 2
Obs n mu1 D0 Da sigma mu2 delta nc tcrit power
1 13 100 5 10.00 3.5 90.00 -1.42857 -3.64216 -1.71088 0.02925
2 13 100 5 9.75 3.5 90.25 -1.35714 -3.46005 -1.71088 0.04315
3 13 100 5 9.50 3.5 90.50 -1.28571 -3.27794 -1.71088 0.06195
4 13 100 5 9.25 3.5 90.75 -1.21429 -3.09583 -1.71088 0.08662
5 13 100 5 9.00 3.5 91.00 -1.14286 -2.91373 -1.71088 0.11797
6 13 100 5 8.75 3.5 91.25 -1.07143 -2.73162 -1.71088 0.15661
7 13 100 5 8.50 3.5 91.50 -1.00000 -2.54951 -1.71088 0.20278
8 13 100 5 8.25 3.5 91.75 -0.92857 -2.36740 -1.71088 0.25624
9 13 100 5 8.00 3.5 92.00 -0.85714 -2.18529 -1.71088 0.31626
10 13 100 5 7.75 3.5 92.25 -0.78571 -2.00319 -1.71088 0.38156
11 13 100 5 7.50 3.5 92.50 -0.71429 -1.82108 -1.71088 0.45044
12 13 100 5 7.25 3.5 92.75 -0.64286 -1.63897 -1.71088 0.52085
13 13 100 5 7.00 3.5 93.00 -0.57143 -1.45686 -1.71088 0.59063
14 13 100 5 6.75 3.5 93.25 -0.50000 -1.27475 -1.71088 0.65765
15 13 100 5 6.50 3.5 93.50 -0.42857 -1.09265 -1.71088 0.72004
16 13 100 5 6.25 3.5 93.75 -0.35714 -0.91054 -1.71088 0.77634
17 13 100 5 6.00 3.5 94.00 -0.28571 -0.72843 -1.71088 0.82558
18 13 100 5 5.75 3.5 94.25 -0.21429 -0.54632 -1.71088 0.86732
19 13 100 5 5.50 3.5 94.50 -0.14286 -0.36422 -1.71088 0.90161
20 13 100 5 5.25 3.5 94.75 -0.07143 -0.18211 -1.71088 0.92892
21 13 100 5 5.00 3.5 95.00 0.00000 0.00000 -1.71088 0.95000
132 Equivalence and Noninferiority Tests
JMP Data Table and formulas:
Power for Test 2.2, JMP screen.
R:
> df1 <- read.table("H:\\Personal Data\\Equivalence &
Noninferiority\\Programs & Output\\d20120803_test_2_2_two_
means.csv",header = TRUE,sep = ",")
> df1
n mu1 D0 Da sigma
1 13 100 5 10.00 3.5
2 13 100 5 9.75 3.5
3 13 100 5 9.50 3.5
4 13 100 5 9.25 3.5
5 13 100 5 9.00 3.5
6 13 100 5 8.75 3.5
7 13 100 5 8.50 3.5
8 13 100 5 8.25 3.5
9 13 100 5 8.00 3.5
10 13 100 5 7.75 3.5
11 13 100 5 7.50 3.5
12 13 100 5 7.25 3.5
133Computer Code—Power Curves
13 13 100 5 7.00 3.5
14 13 100 5 6.75 3.5
15 13 100 5 6.50 3.5
16 13 100 5 6.25 3.5
17 13 100 5 6.00 3.5
18 13 100 5 5.75 3.5
19 13 100 5 5.50 3.5
20 13 100 5 5.25 3.5
21 13 100 5 5.00 3.5
> mu2 <- df1$mu1 - df1$Da
> delsig <- (df1$D0 - df1$Da)/df1$sigma
> nc <- delsig*sqrt(df1$n/2)
> tcrit <- qt(.05,2*df1$n-2)
> power <- 1 - pt(tcrit,2*df1$n-2,nc)
> power
[1] 0.02925394 0.04315103 0.06195378 0.08661506 0.11796964
0.15661283
[7] 0.20277933 0.25624291 0.31625815 0.38156107 0.45043685
0.52085077
[13] 0.59062639 0.65764531 0.72003815 0.77633847 0.82557882
0.86731959
[19] 0.90161406 0.92892317 0.95000000
> plot(delsig,power)
–1.4 –1.2 –1.0 –0.8 –0.6 –0.4 –0.2 0.0
0.0
0.2
0.4
0.6
0.8
Delsig
Power
Test 2.2, R: power curve.

Get Equivalence and Noninferiority Tests for Quality, Manufacturing and Test Engineers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.