How does lavPredict compute fitted values for a growth model?

36 views
Skip to first unread message

Ginnie Sawyer-Morris

unread,
Jan 11, 2022, 12:12:53 PM1/11/22
to lavaan
Does anyone know how to manually predict fitted values for a growth model in R?

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 for the help! 

#growth model
socsupp_mean_var_resid <- 'i =~ 1*socsuppavg1 + 1*socsuppavg2 + 1*socsuppavg3 +
              1*socsuppavg4 + 1*socsuppavg5 + 1*socsuppavg6
          s =~ 0*socsuppavg1 + 1*socsuppavg2 + 2*socsuppavg3 +
                  3*socsuppavg4 + 4*socsuppavg5 + 5*socsuppavg6
# freely estimate separate residual variances between group but constrain across time
socsuppavg1 ~~ c("p1", "p2")*socsuppavg1
socsuppavg2 ~~ c("p1", "p2")*socsuppavg2
socsuppavg3 ~~ c("p1", "p2")*socsuppavg3
socsuppavg4 ~~ c("p1", "p2")*socsuppavg4
socsuppavg5 ~~ c("p1", "p2")*socsuppavg5
socsuppavg6 ~~ c("p1", "p2")*socsuppavg6'

#fitted
socsupp.full.fit <- growth(socsupp_mean_var_resid,
                             data = socsupp.wide.full.mis,
                             missing = "fiml",
                             group = "women")

#predict estimated values 
pred_lgm_socsupp <- lavPredict(socsupp.full.fit, type="yhat") 

#replicate estimated values prediction manually 
# ?????




Terrence Jorgensen

unread,
Jan 25, 2022, 5:22:01 PM1/25/22
to lavaan
I posted an answer on StackOverflow:  https://stackoverflow.com/questions/70670682/how-to-manually-compute-fitted-values-to-replicate-those-produced-by-lavpredict

Terrence D. Jorgensen
Assistant Professor, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam

Reply all
Reply to author
Forward
0 new messages