Diff for "FAQ/powrsqR" - CBU statistics Wiki
location: Diff for "FAQ/powrsqR"
Differences between revisions 1 and 2
Revision 1 as of 2008-01-29 15:13:43
Size: 515
Editor: PeterWatson
Comment:
Revision 2 as of 2013-03-08 10:17:55
Size: 515
Editor: localhost
Comment: converted to 1.6 markup
No differences found!

Computing power for one-way ANOVA in R

For type I error, alpha, regression degrees of freedom (= k-1 for k groups) and dfc covariates with a total sample size, ntot, a test to detect a R-squared of rsq has power, pow.

[COPY AND PASTE THE BELOW INTO R, ADJUST AS DESIRED]

alpha <- 0.05
dfreg <- 2
dfc <- 1
ntot <- 23
rsq <- 0.2

[COPY AND PASTE THE BELOW INTO R]

pow <- 1 - pf(abs(qf(1-alpha,dfreg,ntot-dfreg-dfc-1)),dfreg,ntot-dfreg-dfc-1,
ntot*rsq/(1-rsq))
print(pow) 

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