measurement invariance categorial - warning and unable to see fitmeaures

47 views
Skip to first unread message

Lucas Sempe

unread,
May 29, 2019, 10:08:08 PM5/29/19
to lavaan
Hello Terrence,

First, thanks a lot for your dedicated work with 'measurement invariance' and answers.

I've been trying to assess measurement invariance of a large dataset (PISA). Here are my syntax and results

Ex1Model<- "
Homeposs =~ ST011Q01TA +          ST011Q02TA +         
ST011Q03TA      +     ST011Q04TA  +         ST011Q05TA  +       
ST011Q06TA        +   ST011Q07TA      +     ST011Q08TA +         
ST011Q09TA        +   ST011Q10TA     +      ST011Q11TA  +        
ST011Q12TA        +   ST011Q16NA  +                  ST012Q01TA    +      
ST012Q02TA      +     ST012Q03TA +          ST012Q05NA      +    
ST012Q06NA        +   ST012Q07NA    +       ST012Q08NA     +     
ST012Q09NA       +    ST013Q01TA" 

#### invariance

baseline <- measEq.syntax(configural.model = Ex1Model,
                          data = pisaf3,
                          parameterization = "delta",
                          ID.fac = "std.lv",
                          ID.cat = "Wu.Estabrook.2016",
                          group = "CNT",
                          group.equal = "configural")

cat(as.character(baseline))

# Have to specify as.character to submit to lavaan

model.baseline <- as.character(baseline)
fit.baseline <- cfa(model.baseline, data = pisaf3, 
                    ordered=c("ST011Q01TA", "ST011Q02TA",       
                              "ST011Q03TA", "ST011Q04TA","ST011Q05TA",        
                              "ST011Q06TA", "ST011Q07TA","ST011Q08TA",       
                              "ST011Q09TA", "ST011Q10TA","ST011Q11TA",      
                              "ST011Q12TA", "ST011Q16NA","ST012Q01TA",     
                              "ST012Q02TA", "ST012Q03TA","ST012Q05NA",    
                              "ST012Q06NA", "ST012Q07NA","ST012Q08NA",   
                              "ST012Q09NA", "ST013Q01TA"),   group ="CNT",missing="pairwise")

####

Warning messages:
1: In lav_model_vcov(lavmodel = lavmodel, lavsamplestats = lavsamplestats,  :
  lavaan WARNING:
    Could not compute standard errors! The information matrix could
    not be inverted. This may be a symptom that the model is not
    identified.
2: In lav_test_satorra_bentler(lavobject = NULL, lavsamplestats = lavsamplestats,  :
  lavaan WARNING: could not invert information matrix

> summary(fit.baseline, fit.measures=TRUE)
lavaan 0.6-4.1396 ended normally after 173 iterations

  Optimization method                           NLMINB
  Number of free parameters                       5724

  Number of observations per group         
  AUS                                            11959
  AUT                                             6134
  BEL                                             8129
  BRA                                            14756
  BGR                                             4624
  CAN                                            16899
  CHL                                             5847
  TAP                                             6639
  COL                                             9744
  CRI                                             5499
  HRV                                             5198
  CZE                                             6106
  DNK                                             5337
  DOM                                             3176
  EST                                             5185
  FIN                                             5376
  FRA                                             5198
  DEU                                             4644
  GRC                                             4842
  HKG                                             4554
  HUN                                             4968
  ISL                                             3019
  IRL                                             5129
  ITA                                            10428
..... (additional groups)

Error in TEST[[2]] : subscript out of bounds

However, when I run the CFA directly, I get results...

pisa.g<- cfa(Ex1Model, data = pisaf3, 
                    ordered=c("ST011Q01TA", "ST011Q02TA",       
                              "ST011Q03TA", "ST011Q04TA","ST011Q05TA",        
                              "ST011Q06TA", "ST011Q07TA","ST011Q08TA",       
                              "ST011Q09TA", "ST011Q10TA","ST011Q11TA",      
                              "ST011Q12TA", "ST011Q16NA","ST012Q01TA",     
                              "ST012Q02TA", "ST012Q03TA","ST012Q05NA",    
                              "ST012Q06NA", "ST012Q07NA","ST012Q08NA",   
                              "ST012Q09NA", "ST013Q01TA"),   group ="CNT",missing="pairwise")

all.results[1,]<-round(data.matrix(fitmeasures(pisa.g,
                                               fit.measures = c("chisq.scaled","df.scaled","pvalue.scaled","rmsea.scaled", "cfi.scaled", "tli.scaled"))), digits=3)

all.results

     chisq.scaled df.scaled pvalue.scaled rmsea.scaled cfi.scaled tli.scaled
[1,]     458911.6     11077             0        0.078      0.807      0.787

So, pardon if I´m asking something very stupid or wrong. but shouldn´t be the same?

Best wishes, Lucas

Terrence Jorgensen

unread,
May 31, 2019, 7:19:41 AM5/31/19
to lavaan
However, when I run the CFA directly, I get results...

If you inspect the syntax, you will notice it did not specify any thresholds, because measEq.syntax() has no way to know which variables are ordered unless you tell it using the ordered= argument (as shown in the help-page example) or unless they are already of class c("ordered","factor") in the pisaf3 data.  I am guessing the lack of thresholds (and by implication, the estimation of intercepts and residual variances) causes the error)

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

Reply all
Reply to author
Forward
0 new messages