| generate_data | R Documentation |
Generate one dataset following the Bakk & Kuha (2018) simulation design
generate_data(
n,
separation = c("low", "mid", "high"),
scenario = c("covariate", "distal"),
params = bk2018_params,
seed = NULL
)
n |
Integer. Sample size (paper uses 500, 1000, or 2000). |
separation |
Character. One of |
scenario |
Character. One of:
|
params |
List of population parameters. Defaults to bk2018_params. |
seed |
Integer or |
A data.frame with columns:
Y1 .. Y6Binary indicators (always present).
XTrue latent class, integer 1-3 (not observed in practice).
ZpInteger covariate 1-5 (scenario "covariate" only).
ZoContinuous distal outcome (scenario "distal" only).
# Covariate scenario with high separation
d <- generate_data(n = 200, separation = "high", scenario = "covariate",
seed = 1)
head(d)
colMeans(d)
# Distal outcome scenario
d2 <- generate_data(n = 200, separation = "high", scenario = "distal",
seed = 2)
head(d2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.