[R] lavaan: Modification indices and intercepts
Miksza, Peter John
pmiksza at indiana.edu
Wed Aug 17 18:09:18 CEST 2016
Hello,
I’m examining CFA model invariance using the lavaan package in R. I’ve run an analysis to test “strong” model invariance (e.g., fixing loadings and intercepts to be equivalent across groups) but cannot seem to retrieve modification indices for freeing intercept parameters.
Here is sample code that mirrors the code I’m using with my own data:
library(lavaan)
data("HolzingerSwineford1939")
model <- ' visual =~ x1 + x2 + x3;
textual =~ x4 + x5 + x6;
speed =~ x7 + x8 + x9 '
strong<- cfa(model, data=HolzingerSwineford1939,
group="school", group.equal = c("loadings", "intercepts"))
mod_strong<-modificationIndices(strong)
mod_strong[mod_strong$op == "~1",]
This code should yield modification indices for freeing the intercept parameters (see here for a demonstration: http://pareonline.net/getvn.asp?v=19&n=7)
However, it produces nothing for me. Even if I request all modification indices with a simple call as in the code below, there are no indices for freeing intercept parameters.
modificationIndices(strong)
Is anyone aware of how I can remedy this? Is there something I am doing wrong?
Thanks so much,
Pete
[[alternative HTML version deleted]]
More information about the R-help
mailing list