Closed bgall closed 2 years ago
Thanks, this was an oversight and should be easy to add. In the meantime, you should be able to get the lv names from blavInspect:
lvsamps <- blavPredict(m_out, type = "lv")
lvnames <- colnames(blavInspect(m_out, "lvmeans"))
## add names to blavPredict output:
lvsamps <- lapply(lvsamps, function(x) colnames(x) <- lvnames)
One additional thing here: in lavaan, lavPredict
gives you a single factor score per person/lv, arranged in a matrix. In contrast, blavPredict
gives you a list where each entry is a matrix representing one posterior sample. If you wanted a single factor score like lavaan (where, in blavaan, the single factor score is the mean of the posterior distribution), see the blavInspect(m_out, "lvmeans")
command.
ls there any way to add variable names to the output of
blavPredict(type = "lv")
? Looks like it's not returning them and it can be unclear which column in the output matrix is which latent variable. The baselavPredict()
doesn't seem to have this issue. Tried looking around the source code, but would need to dig in deep to find out how naming works and (perhaps falsely) assume this is something that would be pretty easy to address if I already knew my way around.