Description Usage Arguments Details Examples
Generates data from a simple mediation model.
1 2 3 4 5 6 7 8 9 10 11 12 | gendat_med_simple(
n,
alpha,
tau_prime,
beta,
delta_M,
delta_Y,
sigma2_epsilon_M,
sigma2_epsilon_Y,
rFUN_X,
...
)
|
n |
Sample size. |
alpha |
Path from X to M (α). |
tau_prime |
Path from X to Y (τ^{\prime}). |
beta |
Path from M to Y (β). |
delta_M |
Intercept for the first equation (δ_M). |
delta_Y |
Intercept for the second equation (δ_Y). |
sigma2_epsilon_M |
Variance of ε_M (σ^{2}_{ε_{M}}). |
sigma2_epsilon_Y |
Variance of ε_Y (σ^{2}_{ε_{Y}}). |
rFUN_X |
The distribution function
used to generate values of \mathbf{X}.
The default value is |
... |
Arguments to pass to |
The simple mediation model is defined by
M_i = δ_M + α X_i + ε_{M_i}, and
Y_i = δ_Y + τ^{\prime} X_i + β M_i + ε_{Y_i}.
X is generated using distribution supplied by rFUN_X
(rnorm
is the default).
Additional arguments to rFUN_X
are supplied using the
...
argument.
M and Y are generated using X
and the parameters provided using the regression equations above.
Residuals are assumed to be normaly distribution with means of zero
and provided variances
σ^{2}_{ε_{M}} and
σ^{2}_{ε_{Y}}.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.