View source: R/simulate_data.R
simulate_data | R Documentation |
This is a thin wrapper for the simulateSEM()
function in dagitty
that works with tidied dagitty objects. It treats the input DAG as a
structural equation model, generating random path coefficients and simulating
corresponding data. See dagitty::simulateSEM()
for
details.
simulate_data(
.tdy_dag,
b.default = NULL,
b.lower = -0.6,
b.upper = 0.6,
eps = 1,
N = 500,
standardized = TRUE
)
.tdy_dag |
the input DAG, which can be a |
b.default |
default path coefficient applied to arrows for which no coefficient is defined in the model syntax. |
b.lower |
lower bound for random path coefficients, applied if b.default = NULL. |
b.upper |
upper bound for path coefficients. |
eps |
residual variance (only meaningful if standardized=FALSE). |
N |
number of samples to generate. |
standardized |
whether a standardized output is desired (all variables have variance 1). |
a tbl
with N values for each variable in .tdy_dag
dagify(y ~ z, x ~ z) %>%
tidy_dagitty() %>%
simulate_data()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.