Learn R Programming

DesignLibrary (version 2.0.0)

mediation_analysis_designer: Create a mediation analysis design

Description

Routes to make_design() with id "mediation_analysis": make_design("mediation_analysis", N = N, a = a, ...).

Usage

mediation_analysis_designer(
  N = 200,
  a = 1,
  b = 0.4,
  c = 0,
  d = 0.5,
  rho = 0,
  args_to_fix = NULL
)

Value

A design object.

Arguments

N

Sample size.

a

Effect of treatment on the latent index for the mediator.

b

Effect of the mediator on the outcome when Z = 0.

c

Interaction of the mediator and treatment in the outcome.

d

Direct effect of treatment on the outcome when M = 0.

rho

Correlation between mediator and outcome shocks (-1 to 1).

args_to_fix

Ignored. Present for compatibility with DesignLibrary 0.1.

See Also

make_design()

Examples

Run this code
mediation_analysis_designer(N = 40, a = 0.5, d = 0.2)

Run the code above in your browser using DataLab