lavaan() - Mediation model: RMSEA p-value = NA and mod indices 'rows with length 0'

1,839 views
Skip to first unread message

Anna

unread,
May 27, 2017, 2:11:44 AM5/27/17
to lavaan
Dear all, 

I am a little desperate in trying to fit a - I thought it would be - simple mediation model in lavaan.

My problem is that in the output RMSEA is 0.00 (which is actually good since RMSEA < .05 indicates a good fit, if I understood it correctly) but the p-value 'NA'. How do I need to interpret the 'NA' ? 
When asking for the modifications indices R tells me ' <0 rows> (or 0-length row.names) ', which I don't understand. 

I only found one post in this forum related to my problem, advising to either rescale the variables (because they were measured on different scale) or to check whether R processes missing values wrongly . However, I already did the first by using only standardized variables and checked for the second, which did not apply to my data. I would be very happy to get any further help/ advices/ suggestions here, regarding what I could do to solve this problem. 

Thanks in advance, 
Anna

MODEL:

modelLSPCl <- '

Clarity ~ c*LSP

Interference ~ a*LSP

Clarity ~ b*Interference


#indirect effects

# interference mediates LSP to Clarity

m := a*b


#total effects

total := c + (a*b)


#variances

Clarity ~~ Clarity

LSP ~~ LSP

Interference ~~ Interference


#Intercepts

Clarity ~ 1

LSP ~ 1

Interference ~ 1'


modelLSPCl_fit <- lavaan(modelLSPCl, fixed.x =FALSE, data = EEMT)

summary (modelLSPCl_fit, fit.measures=T, standardized = T, rsq=T, modindices = T)


OUTPUT:

lavaan (0.5-23.1097) converged normally after  12 iterations

  Number of observations                           127

  Number of missing patterns                         1

  Estimator                                         ML
  Minimum Function Test Statistic                0.000
  Degrees of freedom                                 0

Model test baseline model:

  Minimum Function Test Statistic               11.639
  Degrees of freedom                                 3
  P-value                                        0.009

User model versus baseline model:

  Comparative Fit Index (CFI)                    1.000
  Tucker-Lewis Index (TLI)                       1.000

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)               -533.290
  Loglikelihood unrestricted model (H1)       -533.290

  Number of free parameters                          9
  Akaike (AIC)                                1084.580
  Bayesian (BIC)                              1110.178
  Sample-size adjusted Bayesian (BIC)         1081.716

Root Mean Square Error of Approximation:

  RMSEA                                          0.000
  90 Percent Confidence Interval          0.000  0.000
  P-value RMSEA <= 0.05                             NA

Standardized Root Mean Square Residual:

  SRMR                                           0.000

Parameter Estimates:

  Information                                 Observed
  Standard Errors                             Standard

Regressions:
                           Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  Clarity ~                                                      
    LPS (c)            0.205    0.086    2.390    0.017    0.205    0.205
  Interference ~                                                        
    LPS (a)           -0.108    0.088   -1.225    0.221   -0.108   -0.108
  Clarity ~                                                      
    Interference (b)           -0.166    0.086   -1.932    0.053   -0.166   -0.166

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .Clarity   -0.000    0.085   -0.000    1.000   -0.000   -0.000
    LPS    0.000    0.088    0.000    1.000    0.000    0.000
   .Interference    0.000    0.088    0.000    1.000    0.000    0.000

Variances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
   .Clarity   0.916    0.115    7.969    0.000    0.916    0.923
    LPS    0.992    0.125    7.969    0.000    0.992    1.000
   .Interference    0.981    0.123    7.969    0.000    0.981    0.988

R-Square:
                   Estimate
    Clarity   0.077
    Interference    0.012

Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
    m                 0.018    0.017    1.035    0.301    0.018    0.018
    total             0.223    0.087    2.576    0.010    0.223    0.223

Modification Indices:

[1] lhs      op       rhs      mi       epc      sepc.lv  sepc.all sepc.nox
<0 rows> (or 0-length row.names)

Yves Rosseel

unread,
May 27, 2017, 4:01:55 AM5/27/17
to 'Anna' via lavaan
On 05/27/2017 08:11 AM, 'Anna' via lavaan wrote:
> My problem is that in the output RMSEA is 0.00 (which is actually good
> since RMSEA < .05 indicates a good fit, if I understood it correctly)
> but the p-value 'NA'. How do I need to interpret the 'NA' ?
> When asking for the modifications indices R tells me ' <0 rows> (or
> 0-length row.names) ', which I don't understand.

All of this has one simple explanation: you have df=0, because you have
fitted a saturated model: there are as many free parameters as sample
statistics.

There is nothing wrong with this. But as your fit is already perfect,
fit indices are useless, and modification indices (suggesting how to
improve your fit) can not be computed.

Yves.


Anna

unread,
May 27, 2017, 5:33:52 AM5/27/17
to lavaan
Ohh I did not expect this.. Thats actually pretty nice, thanks a lot, Yves !! 

Edward Rigdon

unread,
May 27, 2017, 12:49:13 PM5/27/17
to lav...@googlegroups.com
Your model is saturated. DF = 0, no fit assessment possible.

--
You received this message because you are subscribed to the Google Groups "lavaan" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lavaan+unsubscribe@googlegroups.com.
To post to this group, send email to lav...@googlegroups.com.
Visit this group at https://groups.google.com/group/lavaan.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Maria Usacheva

unread,
Dec 19, 2017, 7:36:30 PM12/19/17
to lavaan
Hi,
I see that it's an old thread, but I'll try my luck. I am also running a mediation model in lavaan with bootsrtapped SE, and have the exact same problem: p-value = NA, but my model is not saturated, and I'm also only using z-scores, so it's not the scaling problem either. "mompa" and "momabhx2" are dummy-coded binaries ("mompa" is declared as ordinal), is that the problem?. What would be the right solution here? Thank you!!

set.seed(444)
model5 <- 'zcceadiff ~ b1*mompa + zcdpea + c*momabhx2
mompa ~ zpeadiff + mommhvz + a1*momabhx2 + zcdpea 
zpeadiff ~ momabhx2
zcdpea ~ momabhx2
mommhvz ~ momabhx2
zpeadiff ~~ zcdpea
direct := c
indirect1 := a1 * b1
total    := c + (a1 * b1)'

fit5 <- sem(model = model5, data = dat, estimator= "ULS", optimizer = "objectiveGLS",
            ordered = c("mompa"), missing = "default", se = "boot")
summary(fit5, standardized = TRUE, fit = TRUE, ci = T)

lavaan (0.5-23.1097) converged normally after  13 iterations

                                                  Used       Total
  Number of observations                           216         217

  Estimator                                        ULS
  Minimum Function Test Statistic               21.798
  Degrees of freedom                                 4
  P-value (Unknown)                                 NA

Model test baseline model:

  Minimum Function Test Statistic               84.750
  Degrees of freedom                                15
  P-value                                           NA

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.745
  Tucker-Lewis Index (TLI)                       0.043

Root Mean Square Error of Approximation:

  RMSEA                                          0.144
  90 Percent Confidence Interval          0.088  0.206
  P-value RMSEA <= 0.05                          0.004

Standardized Root Mean Square Residual:

  SRMR                                           0.085

Weighted Root Mean Square Residual:

  WRMR                                           0.953

Parameter Estimates:

  Information                                 Observed
  Standard Errors                            Bootstrap
  Number of requested bootstrap draws             1000
  Number of successful bootstrap draws            1000

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper   Std.lv  Std.all
  zcceadiff ~                                                                             
    mompa     (b1)    0.249    0.093    2.695    0.007    0.060    0.431    0.249    0.256
    zcdpea            0.174    0.103    1.691    0.091   -0.022    0.389    0.174    0.182
    momabhx2   (c)   -0.090    0.091   -0.988    0.323   -0.278    0.080   -0.090   -0.076
  mompa ~                                                                                 
    zpeadiff          0.237    0.097    2.446    0.014   -0.003    0.392    0.237    0.228
    mommhvz          -0.186    0.108   -1.721    0.085   -0.408    0.006   -0.186   -0.150
    momabhx2  (a1)    0.337    0.107    3.138    0.002    0.123    0.551    0.337    0.275
    zcdpea           -0.117    0.093   -1.255    0.209   -0.285    0.069   -0.117   -0.119
  zpeadiff ~                                                                              
    momabhx2         -0.094    0.072   -1.306    0.192   -0.238    0.051   -0.094   -0.080
  zcdpea ~                                                                                
    momabhx2          0.071    0.083    0.856    0.392   -0.081    0.241    0.071    0.057
  mommhvz ~                                                                               
    momabhx2          0.226    0.063    3.567    0.000    0.101    0.347    0.226    0.230

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper   Std.lv  Std.all
 .zpeadiff ~~                                                                             
   .zcdpea            0.192    0.079    2.431    0.015    0.032    0.331    0.192    0.187

Intercepts:
                   Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper   Std.lv  Std.all
   .zcceadiff         0.011    0.083    0.137    0.891   -0.154    0.175    0.011    0.011
   .mompa             0.000                               0.000    0.000    0.000    0.000
   .zpeadiff          0.052    0.091    0.574    0.566   -0.122    0.244    0.052    0.053
   .zcdpea           -0.091    0.093   -0.976    0.329   -0.279    0.091   -0.091   -0.087
   .mommhvz          -0.134    0.065   -2.057    0.040   -0.263    0.002   -0.134   -0.162

Thresholds:
                   Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper   Std.lv  Std.all
    mompa|t1          0.661    0.115    5.777    0.000    0.458    0.901    0.661    0.646

Variances:
                   Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper   Std.lv  Std.all
   .zcceadiff         0.906    0.137    6.624    0.000    0.639    1.158    0.906    0.911
   .mompa             0.919                               0.919    0.919    0.919    0.877
   .zpeadiff          0.964    0.137    7.047    0.000    0.707    1.246    0.964    0.994
   .zcdpea            1.085    0.178    6.099    0.000    0.751    1.445    1.085    0.997
   .mommhvz           0.645    0.063   10.209    0.000    0.522    0.768    0.645    0.947

Scales y*:
                   Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper   Std.lv  Std.all
    mompa             1.000                               1.000    1.000    1.000    1.000

Defined Parameters:
                   Estimate  Std.Err  z-value  P(>|z|) ci.lower ci.upper   Std.lv  Std.all
    direct           -0.090    0.091   -0.990    0.322   -0.278    0.080   -0.090   -0.076
    indirect1         0.084    0.043    1.933    0.053    0.012    0.183    0.084    0.071
    total            -0.006    0.085   -0.074    0.941   -0.182    0.165   -0.006   -0.005

Maria Usacheva

unread,
Dec 19, 2017, 7:46:32 PM12/19/17
to lavaan
I narrowed it down to using "ULS" estimator for bootstrapping, as opposed to using ULSMV estimator without bootstrapping. I wonder why such difference, and what would be appropriate to report or how to interpret p = NA with estimator ULS?


On Friday, May 26, 2017 at 11:11:44 PM UTC-7, Anna wrote:

Yves Rosseel

unread,
Dec 20, 2017, 3:25:03 AM12/20/17
to lav...@googlegroups.com
When estimator is ULS, the test statistic does not follow a chi-square
distribution. Not even asymptotically. Therefore, we have p = NA.

You can use ULSM or ULSMV.

Yves.
> [1] lhs      op       rhs      mi       epc sepc.lv <http://sepc.lv>
>  sepc.all sepc.nox
> <0 rows> (or 0-length row.names)
>
> --
> You received this message because you are subscribed to the Google
> Groups "lavaan" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to lavaan+un...@googlegroups.com
> <mailto:lavaan+un...@googlegroups.com>.
> To post to this group, send email to lav...@googlegroups.com
> <mailto:lav...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages