@@ -1340,7 +1340,7 @@ To generate the syntax for a latent change score model, we use the [lcsm](https:
13401340## Model Syntax
13411341
13421342``` {r}
1343- bivariateLCSM_syntax <- specify_bi_lcsm(
1343+ bivariateLCSM_syntax <- lcsm:: specify_bi_lcsm(
13441344 timepoints = 3,
13451345 var_x = "x",
13461346 model_x = list(
@@ -1353,8 +1353,10 @@ bivariateLCSM_syntax <- specify_bi_lcsm(
13531353 beta = TRUE, # beta = proportional change factor (latent true score predicting its change score)
13541354 phi = TRUE), # phi = autoregression of change scores
13551355 coupling = list(
1356- delta_lag_xy = TRUE,
1357- delta_lag_yx = TRUE),
1356+ delta_lag_xy = TRUE, # level of x predicting change in y
1357+ delta_lag_yx = TRUE, # level of y predicting change in x
1358+ xi_lag_xy = TRUE, # change in x predicting change in y
1359+ xi_lag_yx = TRUE), # change in y predicting change in x
13581360 change_letter_x = "g",
13591361 change_letter_y = "j")
13601362
@@ -1364,7 +1366,7 @@ cat(bivariateLCSM_syntax)
13641366## Fit the Model
13651367
13661368``` {r}
1367- bivariateLCSM_fit <- fit_bi_lcsm(
1369+ bivariateLCSM_fit <- lcsm:: fit_bi_lcsm(
13681370 data = data_bi_lcsm,
13691371 var_x = names(data_bi_lcsm)[2:4],
13701372 var_y = names(data_bi_lcsm)[12:14],
@@ -1377,8 +1379,10 @@ bivariateLCSM_fit <- fit_bi_lcsm(
13771379 beta = TRUE, # beta = proportional change factor (latent true score predicting its change score)
13781380 phi = TRUE), # phi = autoregression of change scores
13791381 coupling = list(
1380- delta_lag_xy = TRUE,
1381- xi_lag_yx = TRUE),
1382+ delta_lag_xy = TRUE, # level of x predicting change in y
1383+ delta_lag_yx = TRUE, # level of y predicting change in x
1384+ xi_lag_xy = TRUE, # change in x predicting change in y
1385+ xi_lag_yx = TRUE), # change in y predicting change in x
13821386 fixed.x = FALSE
13831387 )
13841388```
@@ -1432,7 +1436,7 @@ semPaths(
14321436 layout = "tree2",
14331437 edge.label.cex = 1.5)
14341438
1435- plot_lcsm(
1439+ lcsm:: plot_lcsm(
14361440 lavaan_object = bivariateLCSM_fit,
14371441 lcsm = "bivariate",
14381442 lavaan_syntax = bivariateLCSM_syntax,
@@ -1462,7 +1466,7 @@ lavaangui::plot_lavaan(bivariateLCSM_fit)
14621466## Plot Trajectories
14631467
14641468``` {r}
1465- plot_trajectories(
1469+ lcsm:: plot_trajectories(
14661470 data_bi_lcsm,
14671471 id_var = "id",
14681472 var_list = c(
@@ -1472,7 +1476,7 @@ plot_trajectories(
14721476 ylab = "X Score",
14731477 connect_missing = FALSE)
14741478
1475- plot_trajectories(
1479+ lcsm:: plot_trajectories(
14761480 data_bi_lcsm,
14771481 id_var = "id",
14781482 var_list = c(
0 commit comments