size.ci.lc.mean.ws: Sample size for a within-subjects mean linear contrast...

View source: R/statpsych1.R

size.ci.lc.mean.wsR Documentation

Sample size for a within-subjects mean linear contrast confidence interval

Description

Computes the sample size required to estimate a linear contrast of population means with desired confidence interval precision in a within-subjects design. Set the variance planning value to the largest value within a plausible range for a conservatively large sample size. Set the Pearson correlation planning value to the smallest value within a plausible range for a conservatively large sample size.

Usage

size.ci.lc.mean.ws(alpha, var, cor, w, q)

Arguments

alpha

alpha level for 1-alpha confidence

var

planning value of average variance of the measurements

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

Examples

q <- c(.5, .5, -.5, -.5)
size.ci.lc.mean.ws(.05, 265, .8, 10, q)

# Should return:
# Sample size
#          11
 


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