FAQ/owanovR - 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 / owanovR

One-way AN(C)OVA in R

For type I error, alpha, dfgp-1 groups, with dfc covariates to detect a R-squared of size, rsq, wiuth power, pow requires a total sample size of n.

[COPY AND PASTE INTO R AND ADJUST AS DESIRED]

pow <- 0.9
alpha <- 0.05
dfgp <- 4
dfc <- 1
rsq <- 0.1

[COPY AND PASTE THE BELOW TO OUTPUT N]

n <- 2+dfgp+dfc

fn <- function(n) {
(pow - (1 - pf(abs(qf(1-alpha,dfgp,n-dfgp-dfc-1)),dfgp, 
n-dfgp-dfc-1,ncp=n*rsq/(1-rsq))))
 }

while (fn(n) > 0) n <- n + 1
print(n)