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,
  ...,
  var_x = "x",
  var_y = "y",
  change_letter_x = "g",
  change_letter_y = "j",
  return_lavaan_syntax = FALSE
)

Arguments

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_x':

  • gamma_lx1: Mean of latent true scores x (Intercept),

  • sigma2_lx1: Variance of latent true scores x,

  • sigma2_ux: Variance of observed scores x,

  • alpha_g2: Mean of change factor (g2),

  • alpha_g3: Mean of change factor (g3),

  • sigma2_g2: Variance of change factor (g2).

  • sigma2_g3: Variance of change factor (g3),

  • sigma_g2lx1: Covariance of change factor (g2) with the initial true score x (lx1),

  • sigma_g3lx1: Covariance of change factor (g3) with the initial true score x (lx1),

  • sigma_g2g3: Covariance of change factors (g2 and g2),

  • phi_x: Autoregression of change scores x.

model_y

See specify_bi_lcsm

model_y_param

List, specifying parameter estimates for the LCSM that has been specified in the argument 'model_y':

  • gamma_ly1: Mean of latent true scores y (Intercept),

  • sigma2_ly1: Variance of latent true scores y,

  • sigma2_uy: Variance of observed scores y,

  • alpha_j2: Mean of change factor (j2),

  • alpha_j3: Mean of change factor (j3),

  • sigma2_j2: Variance of change factor (j2).

  • sigma2_j3: Variance of change factor (j3),

  • sigma_j2ly1: Covariance of change factor (j2) with the initial true score x (ly1),

  • sigma_j3ly1: Covariance of change factor (j3) with the initial true score x (ly1),

  • sigma_j2j3: Covariance of change factors (j2 and j2),

  • phi_y: Autoregression of change scores y.

coupling

See specify_bi_lcsm

coupling_param

List, specifying parameter estimates coupling parameters that have been specified in the argument 'coupling':

  • sigma_su: Covariance of residuals x and y,

  • sigma_ly1lx1: Covariance of intercepts x and y,

  • sigma_g2ly1: Covariance of change factor x (g2) with the initial true score y (ly1),

  • sigma_g3ly1: Covariance of change factor x (g3) with the initial true score y (ly1),

  • sigma_j2lx1: Covariance of change factor y (j2) with the initial true score x (lx1),

  • sigma_j3lx1: Covariance of change factor y (j3) with the initial true score x (lx1),

  • sigma_j2g2: Covariance of change factors y (j2) and x (g2),

  • sigma_j2g3: Covariance of change factors y (j2) and x (g3),

  • sigma_j3g2: Covariance of change factors y (j3) and x (g2),,

  • delta_con_xy: Change score x (t) determined by true score y (t),

  • delta_con_yx: Change score y (t) determined by true score x (t),

  • delta_lag_xy: Change score x (t) determined by true score y (t-1),

  • delta_lag_yx: Change score y (t) determined by true score x (t-1),

  • xi_con_xy: Change score x (t) determined by change score y (t),

  • xi_con_yx: Change score y (t) determined by change score x (t),

  • xi_lag_xy: Change score x (t) determined by change score y (t-1),

  • xi_lag_yx: Change score y (t) determined by change score x (t-1)

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,1]

na_y_pct

Numeric, percentage of random missing values in the simulated dataset [0,1]

...

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.

Value

tibble

References

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. http://www.jstatsoft.org/v48/i02/.

Examples

# 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)
#> Parameter estimates for the data simulation are taken from the argument 'model_param'.
#> All parameter estimates for the LCSM have been specified in the argument 'model_param'.
#> # A tibble: 500 × 25 #> id x1 x2 x3 x4 x5 x6 x7 x8 x9 x10 x11 #> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> #> 1 1 21.5 18.4 15.9 12.5 9.88 7.28 4.92 2.51 0.636 -1.61 -3.31 #> 2 2 19.9 16.7 13.6 11.1 9.01 5.72 3.06 -0.00365 -1.78 -4.50 -5.39 #> 3 3 20.2 18.2 15.6 14.1 11.5 9.20 6.70 5.55 2.97 0.422 -0.393 #> 4 4 21.2 18.0 16.9 14.2 13.3 11.0 9.44 7.71 5.61 4.41 2.73 #> 5 5 20.5 18.1 17.0 14.0 12.3 11.1 8.30 5.92 4.76 1.67 1.11 #> 6 6 20.7 18.4 17.1 14.9 13.0 11.7 9.10 8.56 5.33 4.89 3.60 #> 7 7 20.3 19.5 18.0 16.1 14.8 13.3 NA 9.89 9.57 7.86 6.40 #> 8 8 22.9 22.4 22.5 22.3 21.0 20.3 20.3 18.9 17.8 16.9 16.9 #> 9 9 21.6 21.0 19.3 17.3 15.7 14.8 12.7 12.0 9.70 8.64 7.29 #> 10 10 20.6 19.2 17.3 16.2 14.1 11.9 10.7 8.51 NA 5.06 4.07 #> # … with 490 more rows, and 13 more variables: x12 <dbl>, y1 <dbl>, y2 <dbl>, #> # y3 <dbl>, y4 <dbl>, y5 <dbl>, y6 <dbl>, y7 <dbl>, y8 <dbl>, y9 <dbl>, #> # y10 <dbl>, y11 <dbl>, y12 <dbl>