I have a latent variable that was measured at 2 time points, and I want to model the growth in this latent variable. I then want to examine how variations in slope and intercept differ by latent and non-latent covariates, allowing for interactions between these covariates as well. What is the best way to do this? I can't do a latent growth model because there are only 2 time points.
1 Answer
$\begingroup$
$\endgroup$
5
You can do a latent growth model with two variables.
Example:
library(dplyr)
library(lavaan)
d <- data.frame(y1 = rnorm(1000)) %>%
dplyr::mutate(y2 = rnorm(1000) * y1 + 1)
model <- "
int =~ 1 * y1 + 1 * y2
slope =~ 1 * y2
int ~~ int
slope ~~ slope
y1 ~ 0
y2 ~ 0
int ~ 1
slope ~ 1
y1 ~~ 0 * y1
y2 ~~ 0 * y2
"
fit <- lavaan::sem(model, d)
summary(fit)
Edit:
Here's the output which shows the slope and intercept variances.
Latent Variables:
Estimate Std.Err z-value P(>|z|)
int =~
y1 1.000
y2 1.000
slope =~
y2 1.000
Covariances:
Estimate Std.Err z-value P(>|z|)
int ~~
slope -1.049 0.059 -17.861 0.000
Intercepts:
Estimate Std.Err z-value P(>|z|)
.y1 0.000
.y2 0.000
int -0.004 0.032 -0.113 0.910
slope 1.022 0.047 21.543 0.000
Variances:
Estimate Std.Err z-value P(>|z|)
int 1.043 0.047 22.361 0.000
slope 2.251 0.101 22.361 0.000
.y1 0.000
.y2 0.000
-
$\begingroup$ Thank you, but in a latent growth model I can't get get an identified model with the variance of the slopes...I end up having a model where individuals differ on intercept but their slopes are all uniform. A plot of the data shows that there is considerable variation in slope, which I want to model somehow, but it's proving to be very difficult with only 2 time points. I'm looking for a different way to model the data that let's me model both variation in intercept and slopes even with just two time points. $\endgroup$– s_suzukiCommented Dec 25, 2020 at 11:26
-
$\begingroup$ The model I posted has variance in slope and intercept. I'll edit the answer, to include the output. $\endgroup$ Commented Dec 25, 2020 at 16:04
-
$\begingroup$ Thank you, I was indeed able to run the model you specified but the model fit is terrible. I am going to keep looking for models specifically designed for two time points. I think some form of latent change score model is what I need. $\endgroup$– s_suzukiCommented Dec 28, 2020 at 6:05
-
$\begingroup$ This is a latent change score model. If you specified it correctly it should have zero degrees of freedom, and the fit will be 0 (the model is just identified, fit is irrelevant). $\endgroup$ Commented Dec 28, 2020 at 17:43
-
$\begingroup$ Thank you I see now how the model you posted and a latent change score model are the same! $\endgroup$– s_suzukiCommented Jan 2, 2021 at 16:10