measurementInvarianceCat for models with different parameters

29 views
Skip to first unread message

Pedro Ribeiro

unread,
Jun 21, 2018, 5:05:35 AM6/21/18
to lavaan
Hi all,

I'm having a problem and not sure if you'd be able to help me. I set up a MGCFA with models with different items for each group

GROUPcomparison <- '
group: 1
fac1  =~ J1 + J2 + J3 + J14
fac2 =~ J5 + J6 + J7 + J9 + J13


group: 2
fac1  =~ J1 + J2 + J3 + J8 + J11 + J12 + J14
fac2 =~ J6 + J7 + J10 + J13'

When I run

summary(GROUPcomparisonordinal, fit.measure=TRUE, standardized=TRUE, ci=TRUE)

I get good fit and that's fine. But then, when I run

invresults <- measurementInvarianceCat(GROUPcomparisonordinal,
                                       data
= complete,
                                       
group = "Study")

I get the message:

Error in computeTH.LISREL(MLIST = GLIST[mm.in.group], th.idx = th.idx[[g]]) :
  dims
[product 36] do not match the length of object [52]
In addition: Warning messages:
1: In th[th.idx > 0L] <- TAU[, 1L] :
  number of items to replace
is not a multiple of replacement length
2: In th - (K_nu %*% pi0) :
  longer
object length is not a multiple of shorter object length

Can someone help me? Am I missing something here?

Cheers,
Pedro

Terrence Jorgensen

unread,
Jun 24, 2018, 10:37:53 AM6/24/18
to lavaan
Can someone help me? Am I missing something here?

Functions that automate complex process are not usually going to be set up for wild deviations from the typical situation.  You are using a function that is trying to equate all loadings, etc., across groups, but you don't estimate the same loadings across groups because you don't'have all the same indicators across groups.  You will need to test invariance manually by adding constraints directly in the model syntax for the variables that are shared across groups, in the form of using the same label for parameters that should be equal.  For example, to test whether loading invariance fits as well as "configural invariance" (only loosely defined in this context, since you can't possibly fit the same pattern of fixed/free loadings across groups that have different variables), you can compare these two models:

mod.config <- '

group: 1
fac1  =~ J1 + J2 + J3 + J14
fac2 =~ J5 + J6 + J7 + J9 + J13

group: 2
fac1  =~ J1 + J2 + J3 + J8 + J11 + J12 + J14
fac2 =~ J6 + J7 + J10 + J13
'


mod
.loadings <- '
group: 1
fac1  =~ L1*J1 + L2*J2 + L3*J3 + L14*J14
fac2 =~ J5 + L6*J6 + L7*J7 + J9 + L13*J13

group: 2
fac1  =~ L1*J1 + L2*J2 + L3*J3 + J8 + J11 + J12 + L14*J14
fac2 =~ L6*J6 + L7*J7 + J10 + L13*J13
'


fit
.config <- cfa(mod.config, ...)
fit
.loadings <- cfa(mod.loadings, ...)
lavTestLRT
(fit.config, fit.loadings)

Terrence D. Jorgensen
Postdoctoral Researcher, Methods and Statistics
Research Institute for Child Development and Education, the University of Amsterdam


Pedro Ribeiro

unread,
Jun 28, 2018, 11:30:39 PM6/28/18
to lavaan
Hi Dr. Jorgensen,

Thanks for the clarification! And congratulations for your work, I really admire it!

Kind regards,
Pedro

Terrence Jorgensen

unread,
Jun 29, 2018, 11:39:06 AM6/29/18
to lavaan
Thanks for the clarification! And congratulations for your work, I really admire it!

Thanks!
Reply all
Reply to author
Forward
0 new messages