Learn R Programming

statpsych (version 1.7.0)

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

Description

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

Usage

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

Value

Returns the required sample size

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 response variables

w

desired confidence interval width

Examples

Run this code
size.ci.indirect(.05, .4, .5, .2)

# Should return:
# Sample size
#         106
 

Run the code above in your browser using DataLab