Learn R Programming

statpsych (version 1.7.0)

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

Description

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

Usage

size.test.lc.mean.ws(alpha, pow, var, es, cor, q)

Value

Returns the required sample size

Arguments

alpha

alpha level for hypothesis test

pow

desired power

var

planning value of average variance of measurements

es

planning value of linear contrast of means

cor

planning value of average correlation between measurements

q

vector of with-subjects contrast coefficients

Examples

Run this code
q <- c(.5, .5, -.5, -.5)
size.test.lc.mean.ws(.05, .90, 50.7, 2, .8, q)

# Should return:
# Sample size
#          29
 

Run the code above in your browser using DataLab