View source: R/sim_lcsm_data.R
| sim_uni_lcsm | R Documentation |
This function simulate data from univariate latent change score model parameter estimates using simulateData.
sim_uni_lcsm( timepoints, model, model_param = NULL, var = "x", change_letter = "g", sample.nobs = 500, na_pct = 0, seed = NULL, ..., return_lavaan_syntax = FALSE )
timepoints |
See specify_uni_lcsm |
model |
See specify_uni_lcsm |
model_param |
List, specifying parameter estimates for the LCSM that has been specified in the argument 'model'
|
var |
See specify_uni_lcsm |
change_letter |
See specify_uni_lcsm |
sample.nobs |
Numeric, number of cases to be simulated, see specify_uni_lcsm |
na_pct |
Numeric, percentage of random missing values in the simulated dataset (0 to 1) |
seed |
Set seed for data simulation, see simulateData |
... |
Arguments to be passed on to simulateData |
return_lavaan_syntax |
Logical, if TRUE return the lavaan syntax used for simulating data. To make it look beautiful use the function cat. |
tibble
# Simulate data from univariate LCSM parameters
sim_uni_lcsm(timepoints = 10,
model = list(alpha_constant = TRUE, beta = FALSE, phi = TRUE),
model_param = list(gamma_lx1 = 21,
sigma2_lx1 = 1.5,
sigma2_ux = .2,
alpha_g2 = -.93,
sigma2_g2 = .1,
sigma_g2lx1 = .2,
phi_x = .2),
return_lavaan_syntax = FALSE,
sample.nobs = 1000,
na_pct = .3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.