Learn R Programming

powerAnalysis (version 0.2.1)

power.proportions: Power calculations for proportion tests (two-sided)

Description

Power calculations for proportion tests (two-sided)

Usage

power.proportions(n = NULL, h = NULL, power = NULL, sig.level = 0.05, type = c("two", "one", "unequal"), ratio = 1)

Arguments

n
Total number of observations
h
Effect size, Cohen's h
power
Power of test
sig.level
Significance level
type
Type of proportion tests, must be one of "one","two" (default), or "unequal". "one" means one sample proportion test. "two"/"unequal" means two sample (equal size/unequal size) proportion test.
ratio
The ratio of sample size 1 to sample size 2. Only will be used when 'type' is "unequal".

Examples

Run this code
## one sample
power.proportions(n=600,h=0.3,type="one")

## two sample with same sample size
power.proportions(h=0.2,n=600)

## two sample with different sample size
power.proportions(h=0.2,n=1200,type="unequal",ratio=2)

Run the code above in your browser using DataLab