Learn R Programming

statpsych (version 1.7.0)

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

Description

Computes the sample size in each group (assuming equal sample sizes) required to test a linear contrast of population proportions with desired power in a between-subjects design. The planning value for the effect size (linear contrast of proportions) could be set equal to the linear contrast of proportion planning values or it could be set equal to a minimally interesting effect size. For a conservatively large sample size, set the proportion planning values to .5 and set the effect size to a minimally interesting value.

Usage

size.test.lc.prop.bs(alpha, pow, p, es, v)

Value

Returns the required sample size for each group

Arguments

alpha

alpha level for hypothesis test

pow

desired power

p

vector of proportion planning values

es

planning value of proportion linear contrast

v

vector of between-subjects contrast coefficients

Examples

Run this code
p <- c(.25, .30, .50, .50)
v <- c(.5, .5, -.5, -.5)
size.test.lc.prop.bs(.05, .9, p, .15, v)

# Should return:
# Sample size per group
#                   105


Run the code above in your browser using DataLab