| sim_bi_lcsm | R Documentation | 
This function simulate data from bivariate latent change score model parameter estimates using simulateData.
sim_bi_lcsm( timepoints, model_x, model_x_param = NULL, model_y, model_y_param = NULL, coupling, coupling_param = NULL, sample.nobs = 500, na_x_pct = 0, na_y_pct = 0, seed = NULL, ..., var_x = "x", var_y = "y", change_letter_x = "g", change_letter_y = "j", return_lavaan_syntax = FALSE )
| timepoints | See specify_bi_lcsm | 
| model_x | See specify_bi_lcsm | 
| model_x_param | List, specifying parameter estimates for the LCSM that has been specified in the argument ' 
 | 
| model_y | See specify_bi_lcsm | 
| model_y_param | List, specifying parameter estimates for the LCSM that has been specified in the argument ' 
 | 
| coupling | See specify_bi_lcsm | 
| coupling_param | List, specifying parameter estimates coupling parameters that have been specified in the argument ' 
 | 
| sample.nobs | Numeric, number of cases to be simulated, see specify_uni_lcsm | 
| na_x_pct | Numeric, percentage of random missing values in the simulated dataset (0 to 1) | 
| na_y_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 | 
| var_x | See specify_bi_lcsm | 
| var_y | See specify_bi_lcsm | 
| change_letter_x | See specify_bi_lcsm | 
| change_letter_y | See specify_bi_lcsm | 
| return_lavaan_syntax | Logical, if TRUE return the lavaan syntax used for simulating data. To make it look beautiful use the function cat. | 
tibble
Ghisletta, P., & McArdle, J. J. (2012). Latent Curve Models and Latent Change Score Models Estimated in R. Structural Equation Modeling: A Multidisciplinary Journal, 19(4), 651–682. doi: 10.1080/10705511.2012.713275.
Grimm, K. J., Ram, N., & Estabrook, R. (2017). Growth Modeling—Structural Equation and Multilevel Modeling Approaches. New York: The Guilford Press.
Kievit, R. A., Brandmaier, A. M., Ziegler, G., van Harmelen, A.-L., de Mooij, S. M. M., Moutoussis, M., … Dolan, R. J. (2018). Developmental cognitive neuroscience using latent change score models: A tutorial and applications. Developmental Cognitive Neuroscience, 33, 99–117. doi: 10.1016/j.dcn.2017.11.007.
McArdle, J. J. (2009). Latent variable modeling of differences and changes with longitudinal data. Annual Review of Psychology, 60(1), 577–605. doi: 10.1146/annurev.psych.60.110707.163612.
Yves Rosseel (2012). lavaan: An R Package for Structural Equation Modeling. Journal of Statistical Software, 48(2), 1-36. doi: 10.18637/jss.v048.i02.
# Simulate data from bivariate LCSM parameters 
sim_bi_lcsm(timepoints = 12, 
            na_x_pct = .05,
            na_y_pct = .1,
            model_x = list(alpha_constant = TRUE, beta = TRUE, phi = FALSE),
            model_x_param = list(gamma_lx1 = 21,
                                 sigma2_lx1 = .5,
                                 sigma2_ux = .2,
                                 alpha_g2 = -.4,
                                 sigma2_g2 = .4,
                                 sigma_g2lx1 = .2,
                                 beta_x = -.1),
            model_y = list(alpha_constant = TRUE, beta = TRUE, phi = TRUE),
            model_y_param = list(gamma_ly1 = 5,
                                 sigma2_ly1 = .2,
                                 sigma2_uy = .2,
                                 alpha_j2 = -.2,
                                 sigma2_j2 = .1,
                                 sigma_j2ly1 = .02,
                                 beta_y = -.2,
                                 phi_y = .1),
            coupling = list(delta_lag_xy = TRUE, 
                            xi_lag_yx = TRUE),
            coupling_param =list(sigma_su = .01,
                                 sigma_ly1lx1 = .2,
                                 sigma_g2ly1 = .1,
                                 sigma_j2lx1 = .1,
                                 sigma_j2g2 = .01,
                                 delta_lag_xy = .13,
                                 xi_lag_yx = .4),
            return_lavaan_syntax = FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.