train.index=sample(32,20)lavaan 0.6-3 ended normally after 11 iterations
train=mtcars[train.index,]# this model use the validation set approach
test=mtcars[-train.index,]
mod='am~vs+wt'
fit=sem(mod,data=train,ordered=c("am"))
summary(fit)
predict(fit,test,type="response")Error in .local(object, ...) : unused argument (type = "response")
predict(fit,data.frame(vs=0,wt=0.5))Error in lav_data_full(data = data, group = group, cluster = cluster, :
Is lavaan compatible with the predict() function in R base?
Is there anyway to do this machine learning predictions?
I expect it will provide what you need.