5

I have constructed a path model with the R package lavaan (regressions only, no latent variables) using a complete dataset (data1) with values for all variables (x's and y's). The R code I used is as follows:

Specification:

model1 <- 'y1 ~ x1 + x2 + x3 + x4 + y2
y2 ~ x1 + x2 + x4 + x5 + x6'

Fit:

fit1 <- sem(model = model1, data = data1, estimator = "MLR")

I now want to predict/estimate values for y1 and y2 using a new dataset (data2) which includes values for all x variables, but not for the y variables. In other words, I want to predict unknown values for the y variables using the known x variable values and my fitted path model estimates, similar to prediction in regular regression.

However, from my research, the lavPredict() function for lavaan is NOT built to do this (the CRAN description for lavPredict() explicitly states: "the goal of this function is NOT to predict future values of dependent variables as in the regression framework!"; also, here). My understanding is that the regular predict() function will also call lavPredict() for lavaan objects. Though it seems like there were plans to update lavPredict() to be able to conduct regression-style predictions (see here), I cannot find any documentation of these suggested updates being implemented.

Is there any way to predict (in a regression sense) values for my dependent variables given values of my independent variables from a new dataset using my lavaan path model (as described above)?

Apologies in advance if I somehow missed the answer to this question elsewhere. Thank you so much!

L. Aguilar
  • 51
  • 1

0 Answers0