Learn R Programming

statpsych (version 2.0.0)

size.ci.lc.prop.bs: Sample size for a between-subjects proportion linear contrast confidence interval

Description

Computes the sample size in each group (assuming equal sample sizes) required to estimate a linear contrast of population proportions with desired confidence interval precision in a between-subjects design. Set the proportion planning values to .5 for a conservatively large sample size.

For more details, see Section 2.22 of Bonett (2021, Volume 3)

Usage

size.ci.lc.prop.bs(alpha, p, w, v)

Value

Returns the required sample size for each group

Arguments

alpha

alpha level for 1-alpha confidence

p

vector of proportion planning values

w

desired confidence interval width

v

vector of between-subjects contrast coefficients

References

Bonett2021statpsych

Examples

Run this code
p <- c(.1, .2, .2, .3)
v <- c(.5, -.5, .5, -.5)
size.ci.lc.prop.bs(.05, p, .2, v)

# Should return:
# Sample size per group
#                    60


Run the code above in your browser using DataLab