size.ci.slope.gen: Sample size for a slope confidence interval in a general...

View source: R/statpsych2.R

size.ci.slope.genR Documentation

Sample size for a slope confidence interval in a general statistical model

Description

Computes the sample size required to estimate a slope coefficient with desired confidence interval precision in any general statistical model. This function requires a standard error estimate for the slope of interest from a prior or pilot study and the sample size that was used in the prior or pilot study.

Usage

size.ci.slope.gen(alpha, se, n0, w)

Arguments

alpha

alpha level for 1-alpha confidence

se

standard error of slope from prior/pilot study

n0

sample size used in prior/pilot study

w

desired confidence interval width

Value

Returns the required sample size

Examples

size.ci.slope.gen(.05, 3.15, 50, 5)

# Should return:
#  Sample size
#          305
 


statpsych documentation built on April 4, 2025, 3:20 a.m.