I am trying to save factor scores using the LavPredict function from a multiple-group CFA.
I am able to save the factor scores successfully, but because I have a differing number of males and females in my groups, I am trying to thus save just the male factor scores into its own subset and then same with the female scores. I'm assuming this should be a easy fix, just haven't been able to find much on the topic.
My code is below. Any help would be very much appreciated!
Thanks in advance!
model1<- cfa(bifactormodel, data = main.data, group="Gender",
=TRUE, orthogonal = TRUE,
estimator = "MLR", missing="fiml")
summary(model1, fit.measures = TRUE, standardized = TRUE)
fscores <- lavPredict(model1,type="lv",method="regression")