Diff for "FAQ/Rpowprop" - CBU statistics Wiki
location: Diff for "FAQ/Rpowprop"
Differences between revisions 4 and 5
Revision 4 as of 2008-02-19 16:43:47
Size: 554
Editor: PeterWatson
Comment:
Revision 5 as of 2013-03-08 10:17:15
Size: 554
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Power for a two-tailed one sample binomial test

For testing the (two-tailed) hypothesis that a sample of size, ntot, with proportion, prop, equals a constant, const, with a type I error of alpha copy and paste the below into R and adjust inputs as required:

prop <- 0.45
const <- 0.50
ntot <- 900
alpha <- 0.05

Then copy and paste the below into R. Pow is the power of the test.

chisq <- ( (prop-const)^2 ) / (const*(1-const))
chisq <- ntot*chisq
pow <-  1 - pchisq(abs(qchisq(1-alpha,1)),1,chisq)
print(pow)

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