在 Lavaan 生长曲线模型中提取个体轨迹

Extracting Individual trajectories in Lavaan Growth Curve Models

我已经使用 R 的 Lavaan 包中的 growth() 函数成功地对一项研究的纵向数据进行了建模。我找不到任何关于如何为每个参与者提取预测轨迹的文档。我只能找到整个组的预测轨迹(在摘要输出的 "Intercepts" 部分下给出)。

使用 lavPredict

model.syntax <- '
# intercept and slope with fixed coefficients
i =~ 1*t1 + 1*t2 + 1*t3 + 1*t4
s =~ 0*t1 + 1*t2 + 2*t3 + 3*t4

# regressions
i ~ x1 + x2
s ~ x1 + x2

# time-varying covariates
t1 ~ c1
t2 ~ c2
t3 ~ c3
t4 ~ c4
'

fit <- growth(model.syntax, data=Demo.growth)
summary(fit)

head(lavPredict(fit))

这将为每个人生成预测估计值

              i            s
[1,]  1.1378809  0.676301228
[2,] -2.5421940 -1.425974525
[3,] -0.1279434  0.966734762
[4,]  1.1682777  1.477200679
[5,] -0.5141435  0.006995809
[6,] -1.2646865  0.524024630