size.ci.lc.stdmean.ws: Sample size for a within-subjects standardized linear...

View source: R/statpsych1.R

size.ci.lc.stdmean.wsR Documentation

Sample size for a within-subjects standardized linear contrast of means confidence interval

Description

Computes the sample size required to estimate two types of standardized linear contrasts of population means (unweighted standardizer and single level standardizer) with desired confidence interval precision in a within-subjects design. For a conservatively large sample size, set the standardized linear contrast of means planning value to the largest value within a plausible range, and set the Pearson correlation planning value to the smallest value within a plausible range.

Usage

size.ci.lc.stdmean.ws(alpha, d, cor, w, q)

Arguments

alpha

alpha level for 1-alpha confidence

d

planning value of standardized linear contrast

cor

planning value of average correlation between measurements

w

desired confidence interval width

q

vector of within-subjects contrast coefficients

Value

Returns the required sample size for each standardizer

References

\insertRef

Bonett2009statpsych

Examples

q <- c(.5, .5, -.5, -.5)
size.ci.lc.stdmean.ws(.05, 1, .7, .6, q)

# Should return:
#                            Sample size
# Unweighted standardizer:            26
# Single level standardizer:          35
 


statpsych documentation built on Sept. 11, 2024, 7:42 p.m.