FAQ/powrsqR - CBU statistics Wiki

Upload page content

You can upload content for the page named below. If you change the page name, you can also upload content for another page. If the page name is empty, we derive the page name from the file name.

File to load page content from
Page name
Comment
In thi sntence, what word is mad fro the mising letters?

location: FAQ / powrsqR

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)