yrosseel / lavaan

an R package for structural equation modeling and more
http://lavaan.org
412 stars 99 forks source link

residuals method broken with multiple groups #86

Closed TDJorgensen closed 6 years ago

TDJorgensen commented 6 years ago

Hi Yves,

Sorry I don't have time to try to track down this one myself, but I hope it is easy to resolve. It seems due to the relatively recent addition of blocks.

library(lavaan)
HS.model <- ' 
  visual  =~ x1 + x2 + x3
  textual =~ x4 + x5 + x6
  speed   =~ x7 + x8 + x9 '
fit <- cfa(HS.model, data=HolzingerSwineford1939)
resid(fit) # no problem
fit2 <- cfa(HS.model, data=HolzingerSwineford1939, group = "school")
resid(fit2)

Unfortunately, I don't know which version manifested this problem, but in the current version (0.6-1.1176) I get this error:

Error in unlist(object@Data@block.label) : 
  no slot of name "block.label" for this object of class "lavData"
TDJorgensen commented 6 years ago

Seems fixed, at least as of version 0.6-1.1193