size.test.prop2: Sample size for a test of a 2-group proportion difference

View source: R/statpsych3.R

size.test.prop2R Documentation

Sample size for a test of a 2-group proportion difference

Description

Computes the sample size in each group required to test a difference in population proportions with desired power in a 2-group design. This function requires planning values for both proportions. Set the proportion planning values to .5 for a conservatively large sample size. The planning value for the effect size (proportion difference) could be set equal to the difference of the two proportion planning values or it could be set equal to a minimally interesting effect size.

Usage

size.test.prop2(alpha, pow, p1, p2, es)

Arguments

alpha

alpha level for hypothesis test

pow

desired power

p1

planning value of proportion for group 1

p2

planning value of proportion for group 2

es

planning value of proportion difference

Value

Returns the required sample size per group

Examples

size.test.prop2(.05, .8, .2, .4, .2)

# Should return:
#      Sample size per group
# [1,]                    79



statpsych documentation built on July 9, 2023, 6:50 p.m.