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

Power for a two-tailed one sample binomial test

For testing the (two-tailed) hypothesis that a sample of size, ntot, with proportion, prop, equals a constant, const, with a type I error of alpha copy and paste the below into R and adjust inputs as required:

prop <- 0.45
const <- 0.50
ntot <- 900
alpha <- 0.05

Then copy and paste the below into R. Pow is the power of the test.

chisq <- ( (prop-const)^2 ) / (const*(1-const))
chisq <- ntot*chisq
pow <-  1 - pchisq(abs(qchisq(1-alpha,1)),1,chisq)
print(pow)