The model was estimated using lavaan; I know I can use lavPredict(fit, type="yhat") but I want to report/explain how these values are computed in my dissertation.
Thank you! I actually have watched that video twice before, but it doesn't address how lavPredict computes the estimated values for growth models. I would like to use the estimated values and their residuals as a feature in a random forest model, but I need to know what additional information the estimated values are introducing... in addition to the latent slope and intercept
Here is a comprehensive explanation from stackoverflow:
Explanation of lavPredict(fit, type="yhat"):
"Note that these are not growth-factor scores, which are the random effects in a MLM, returned by lavPredict(fit, type="lv"). These are expected values for each individual subject (conditional expectations, given factor scores). These are a function of indicator intercepts ($\nu$, which are fixed to zero in a LGCM), factor scores ($\eta_i$), and factor loadings ($\Lambda$); residuals are omitted for expected values, but otherwise the regression equation looks the same.
$$ \hat{y}_i = \nu + eta_i Lambda $$
Note that if anything predicts the growth factors, then those also have a regression model that can get substituted into the equation above:
$$ \eta_i = \alpha + X_i B $$
where B are "Beta" paths, $\alpha$ is a vector of factor intercepts, and $X_i$ is subject i's values of predictors (really, they are also included in $eta$; even observed predictors are internally "promoted" as single-indicator factors).
Alternatively, lavInspect(fit, "mean.ov") gives you the marginal means (expected values) of the observed variables, interpreted as the expected values for people with average factor scores (average latent intercept and slope). Is that what you are after?
The marginal means of any SEM are a function of indicator intercepts ($\nu$, which are fixed to zero in a LGCM), factor intercepts ($\alpha$), factor loadings ($\Lambda$), and latent regressions (Beta, if any). If any observed variables predict growth factors, consider them as single-indicator factors (that is how lavaan treats them in the background). You can save the set of parameter matrices using