View source: R/generate_all_data.R
generate_all_data | R Documentation |
Simulate data from a directed acyclic graph (DAG) model.
generate_all_data(
n = 200,
alpha_S = 0,
beta_M = 0,
tau_S = 1,
alpha_vec = rep(1, 3),
beta_vec = rep(1, 3),
M.family = stats::gaussian(),
Y.family = stats::gaussian(),
sigma_M = 0.5,
sigma_Y = 0.5
)
n |
a sample size |
alpha_S |
a parameter in mediator model M~S+X for S |
beta_M |
a parameter in outcome model Y~S+M+X for M |
tau_S |
a parameter in outcome model Y~S+M+X for S |
alpha_vec |
a parameter vector in mediator model M~S+X for X |
beta_vec |
a parameter vector in outcome model Y~S+M+X for X |
M.family |
an error distribution and link function to be used in the mediator model. See |
Y.family |
an error distribution and link function to be used in the outcome model. See |
sigma_M |
the variance of the error term in the mediator model M~S+X |
sigma_Y |
the variance of the error term in the outcome model Y~S+M+X |
A list with the following components:
S |
exposure |
M |
mediator |
Y |
outcome |
X |
confounder |
out <- generate_all_data(n = 200)
summary(out$S)
summary(out$M)
summary(out$Y)
summary(out$X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.