Diff for "FAQ/ncnpow" - CBU statistics Wiki
location: Diff for "FAQ/ncnpow"
Differences between revisions 1 and 2
Revision 1 as of 2008-02-28 15:09:53
Size: 520
Editor: PeterWatson
Comment:
Revision 2 as of 2008-02-28 15:10:05
Size: 521
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
The power, pow, is produced for McNamr's test comparing mismatch proportions, p12 and p21, in a sample size of ntot with a type I error of alpha. The power, pow, is produced for McNemar's test comparing mismatch proportions, p12 and p21, in a sample size of ntot with a type I error of alpha.

= Power for using McNemar's test=

The power, pow, is produced for McNemar's test comparing mismatch proportions, p12 and p21, in a sample size of ntot with a type I error of alpha.

Copy and Paste the inputs below into R and adjust as required.

alpha <- 0.05
p12 <- 0.5
p21 <- 0.2
ntot <- 23

Copy and paste the below into R to obtain the power.

chisq <- ((p12-p21)^2) / (p12+p21)
pow <- 1 - pchisq(abs(qchisq(1-alpha,1)),1,ntot*chisq)
cat("Power for McNemar's test =")
print(pow)

None: FAQ/ncnpow (last edited 2013-03-08 10:17:39 by localhost)