size.ci.lc.ancova: Sample size for a linear contrast confidence interval in an...

View source: R/statpsych2.R

size.ci.lc.ancovaR Documentation

Sample size for a linear contrast confidence interval in an ANCOVA

Description

Computes the sample size for each group (assuming equal sample sizes) required to estimate a linear contrast of means in an ANCOVA model with desired confidence interval precision. In a nonexperimental design, the sample size is affected by the magnitude of covariate mean differences across groups. The covariate mean differences can be approximated by specifying the largest standardized covariate mean difference across all pairwise group differences and for all covariates. In an experiment, this standardized mean difference should be set to 0. Set the error variance planning value to the largest value within a plausible range for a conservatively large sample size.

Usage

size.ci.lc.ancova(alpha, evar, s, d, w, v)

Arguments

alpha

alpha level for 1-alpha confidence

evar

planning value of within group (error) variance

s

number of covariates

d

largest standardized mean difference for all covariates

w

desired confidence interval width

v

vector of between-subjects contrast coefficients

Value

Returns the required sample size per group

Examples

v <- c(1, -1)
size.ci.lc.ancova(.05, 1.37, 1, 0, 1.5, v)

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


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