size.ci.indirect: Sample size for an indirect effect confidence interval

View source: R/statpsych2.R

size.ci.indirectR Documentation

Sample size for an indirect effect confidence interval

Description

Computes the approximate sample size required to estimate the indirect effect in a simple mediation model. The direct effect of the independent variable on the dependent variable, controlling for the mediator variable, is assumed to be negligible.

Usage

size.ci.indirect(alpha, cor1, cor2, w)

Arguments

alpha

alpha level for 1-alpha confidence

cor1

planning value of correlation between the independent and mediator variables

cor2

planning value of correlation between the mediator and dependent variables

w

desired confidence interval width

Value

Returns the required sample size

Examples

size.ci.indirect(.05, .4, .5, .2)

# Should return:
#      Sample size
# [1,]         106
 


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