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

View source: R/statpsych3.R

size.ci.lc.prop.bsR Documentation

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 proportions with desired confidence interval precision in a between-subjects design. Set the proportion planning values to .5 for a conservatively large sample size.

Usage

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

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

Value

Returns the required sample size per group

Examples

p <- c(.25, .30, .50, .50)
v <- c(.5, .5, -.5, -.5)
size.ci.lc.prop.bs(.05, p, .2, v)

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



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