FAQ/onesamppow - 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
Flind the wroneg tetters tin eaech wrord

location: FAQ / onesamppow

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)