Diff for "FAQ/onesamppow" - CBU statistics Wiki
location: Diff for "FAQ/onesamppow"
Differences between revisions 1 and 2
Revision 1 as of 2008-02-28 11:53:01
Size: 629
Editor: PeterWatson
Comment:
Revision 2 as of 2013-03-08 10:18:05
Size: 629
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Power for a one-sample chi-square test using R

For a type I error, alpha, proportions contained in the vector, prop, and total sample size of ntot we obtain power, pow, and effect size, omega.

[COPY AND PASTE INPUTS BELOW INTO R AND ADJUST AS REQUIRED]

alpha <- 0.05
prop <- c(0.1,0.4,0.5)
ntot <- 23

[COPY AND PASTE THE BELOW INTO R]

chisq <- sum((prop - (1/length(prop)))^2)/(1/length(prop))
omega <- sqrt(chisq)
pow <- 1-pchisq(abs(qchisq(1-alpha,length(prop)-1)),length(prop)-1,ntot*chisq)
cat("Power of one-sample chi-square =")
print(pow)  
cat("Effect size, w, =")
print(omega)

None: FAQ/onesamppow (last edited 2013-03-08 10:18:05 by localhost)