我已经使用R的Lavan包中的growth()函数成功地对一项研究的纵向数据进行了建模。我在任何地方都找不到关于如何提取每个参与者的预测轨迹的文档。我只能找到整个团队的预测轨迹(在摘要输出的"拦截"部分给出)。
使用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