size.ci.condmean: Sample size for a conditional mean confidence interval

View source: R/statpsych2.R

size.ci.condmeanR Documentation

Sample size for a conditional mean confidence interval

Description

Computes the total sample size required to estimate a conditional mean of y at x = x* in a fixed-x simple linear regression model with desired confidence interval precision. In an experimental design, the total sample size would be allocated to the levels of the quantitative factor and it might be necessary to increase the total sample size to achieve equal sample sizes. Set the error variance planning value to the largest value within a plausible range for a conservatively large sample size.

Usage

size.ci.condmean(alpha, evar, xvar, diff, w)

Arguments

alpha

alpha level for 1-alpha confidence

evar

planning value of within group (error) variance

xvar

variance of fixed predictor variables

diff

difference between x* and mean of x

w

desired confidence interval width

Value

Returns the required total sample size

Examples

size.ci.condmean(.05, 120, 125, 15, 5)

# Should return:
#      Total sample size
# [1,]               210
 


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