lavaan 0.5-21 released on CRAN

851 views
Skip to first unread message

Yves Rosseel

unread,
Sep 7, 2016, 2:26:22 PM9/7/16
to lav...@googlegroups.com
Dear lavaan users,

lavaan 0.5-21 has been released on CRAN today (7 Sept 2016).

New features and user-visible changes:

- robust RMSEA and CFI values are now computed correctly, following
Brosseau-Liard, P. E., Savalei, V., and Li, L. (2012), and
Brosseau-Liard, P. E. and Savalei, V. (2014); in the output of
fitMeasures(), the 'new' ones are called cfi.robust and rmsea.robust,
while the 'old' ones are called cfi.scaled and rmsea.scaled

- SRMR is now displayed in the summary(, fit.measures = TRUE) output in
the categorical case

- in the summary() output, a dot (.) is added in front of the names of
endogenous intercepts, covariances and variances; this is mostly for
teaching purposes, to distinguish between for example residual and plain
variances; the '.' prefix was the least obtrusive way I could think of;
feedback about this is welcome

- the inspect/lavInspect() function will now always return a nested list
in the multiple group setting

- the inspect/lavInspect() function with the "free" argument will now
show a header with equality constraints (if any)

- GLS/WLS (and friends) now work when fixed.x = TRUE

- a new argument conditional.x (TRUE/FALSE) can be used with all
estimators (ML, GLS, (D)WLS)

- a two-way interaction between observed variables can now be specified
in the model syntax by using a colon, for example: y ~ x1 + x2 + x1:x2
and a product term will be created automatically


Yves.

--
Yves Rosseel -- http://www.da.ugent.be
Department of Data Analysis, Ghent University
http://lavaan.org

김계수

unread,
Sep 11, 2016, 8:56:17 AM9/11/16
to lavaan
Dear Yves Rosseel.
Thanks to your help, All of ours can analyze data very easy.
Thank you for your effort.
Best regards, 

2016년 9월 8일 목요일 오전 3시 26분 22초 UTC+9, Yves Rosseel 님의 말:

Scot McNary

unread,
Sep 14, 2016, 11:57:59 AM9/14/16
to lavaan
Hi,
I think the CI for the new robust RMSEA are not being printed with the RMSEA. Note how the CI does not contain the estimate for the robust RMSEA (second column):

#Root Mean Square Error of Approximation:
#
#  RMSEA                                          0.053       0.031
#  90 Percent Confidence Interval          0.049  0.056       0.056  0.065
#  P-value RMSEA <= 0.05                          0.086       0.000

Also, I can't seem to fix factor correlations to 0:
# latent correlations
posrse ~~ 0*matr
posrse ~~ 0*mati
posrse ~~ 0*mata
negrse ~~ 0*matr
negrse ~~ 0*mati
negrse ~~ 0*mata

Yet all are estimated:

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .posrse ~~                                                             
   .matr              0.072    0.021    3.378    0.001    0.210    0.210
   .mati              0.159    0.025    6.255    0.000    0.419    0.419
   .mata              0.079    0.018    4.378    0.000    0.383    0.383
 .negrse ~~                                                             
   .matr              0.082    0.024    3.472    0.001    0.221    0.221
   .mati              0.220    0.030    7.263    0.000    0.534    0.534
   .mata              0.106    0.023    4.714    0.000    0.476    0.476
 .matr ~~                                                               
   .mati              0.177    0.026    6.819    0.000    0.555    0.555
   .mata              0.094    0.020    4.721    0.000    0.545    0.545
 .mati ~~                                                               
   .mata              0.173    0.033    5.281    0.000    0.905    0.905
 .posrse ~~                                                             
   .negrse            0.370    0.035   10.460    0.000    0.835    0.835

Thanks for any help you can provide.
Scot

Yves Rosseel

unread,
Sep 14, 2016, 2:35:47 PM9/14/16
to lav...@googlegroups.com
On 09/14/2016 05:57 PM, Scot McNary wrote:
> Hi,
> I think the CI for the new robust RMSEA are not being printed with the
> RMSEA. Note how the CI does not contain the estimate for the robust
> RMSEA (second column):

Indeed. That does not look right. It does work in my examples, so there
must be something special here causing the computations to fail. Could
you send me the full script and the data (or a snippet of the data)?

> #Root Mean Square Error of Approximation:
> #
> # RMSEA 0.053 0.031
> # 90 Percent Confidence Interval 0.049 0.056 0.056 0.065
> # P-value RMSEA <= 0.05 0.086 0.000


> Also, I can't seem to fix factor correlations to 0:
> # latent correlations
> posrse ~~ 0*matr
> posrse ~~ 0*mati
> posrse ~~ 0*mata
> negrse ~~ 0*matr
> negrse ~~ 0*mati
> negrse ~~ 0*mata
>
> Yet all are estimated:

Is this since 0.5-21? Could you show us the full R script?

Yves.

Scot McNary

unread,
Sep 15, 2016, 12:02:44 AM9/15/16
to lavaan
Hi,
Yes, lavaan 0.5-21, (R 3.3.1).
Full lavaan call:

planA1brsepart.model <- '
# measurement
posrse =~ feelimapersonofworth + feelihaveanumberofgoodqualities + abletodothingsaswell + 
takeapositiveattitude + satisfiedwithmyself
negrse =~ revinclinedtofeeliamafailure + revdonothavemuchtobeproudof + 
revwishicouldhavemorerespect + revfeeluselessattimes + revthinkiamnogoodatall 
matr =~ whenpeopleneedhelpometome + peopletendtorelyonmeforsupport + revnotsomeonepeoplewouldturnto +
peopletrustme + peoplelooktomeforadviceon + peoplecountonme
mati =~ revnoonereallyneedsme + successessourceofpridetopeople + revnoonewouldnoticeifidisappeared +
revnoonetakesprideinmyaccomplishments + revpeopledonotcarewhathappenstome + revpeopleareindifferenttomyneeds +
peoplewillinconveniencethemselves + peoplereacttowhathappenstome + revpeopleusuallydontwanttohearaboutit +
peoplewhocareenoughtocriticize
mata =~ peopledonotignoreme + revfeelinvisible + revnoonerecognizesme +
peopleusuallyawareofmypresence + revnottoremembermyname + revhardformetogetattention +
revpeopledonotnotice + peoplegenerallyknowwheniamaround
fbi =~ timeonfb.fcd + numfbf.fcd + ntimechkpw.fcd + fbpartofmyeverydayactivity + proudtotellmonFacebook + fbpartofdailyroutine + feeloutoftouch +
feelpartoffbcommunity + sorryiffbshutdown
# latent correlations
posrse ~~ 0*matr
posrse ~~ 0*mati
posrse ~~ 0*mata
negrse ~~ 0*matr
negrse ~~ 0*mati
negrse ~~ 0*mata
matr ~~ 0*mati
matr ~~ 0*mata
mati ~~ 0*mata
  posrse ~~ 0*negrse
# mixed observed/latent regressions
matr ~ gender + age + fbi 
mati ~ gender + age + fbi 
mata ~ gender + age + fbi 
posrse ~ gender + age + fbi 
negrse ~ gender + age + fbi 
  ## modindex specified
  '

planA1brsepart.fit <- sem(planA1b.model, data = fm,
ordered = c(
"fbpartofmyeverydayactivity", "proudtotellmonFacebook", "fbpartofdailyroutine", "feeloutoftouch",
"feelpartoffbcommunity", "sorryiffbshutdown",
"feelimapersonofworth", "feelihaveanumberofgoodqualities", "revinclinedtofeeliamafailure", 
"abletodothingsaswell", "revdonothavemuchtobeproudof", "takeapositiveattitude", "satisfiedwithmyself", 
"revwishicouldhavemorerespect", "revfeeluselessattimes", "revthinkiamnogoodatall",
"whenpeopleneedhelpometome", "peopletendtorelyonmeforsupport", "revnotsomeonepeoplewouldturnto",
"peopletrustme", "peoplelooktomeforadviceon", "peoplecountonme",
"revnoonereallyneedsme", "successessourceofpridetopeople", "revnoonewouldnoticeifidisappeared",
"revnoonetakesprideinmyaccomplishments", "revpeopledonotcarewhathappenstome", "revpeopleareindifferenttomyneeds",
"peoplewillinconveniencethemselves", "peoplereacttowhathappenstome", "revpeopleusuallydontwanttohearaboutit",
"peoplewhocareenoughtocriticize",
"peopledonotignoreme", "revfeelinvisible", "revnoonerecognizesme",
"peopleusuallyawareofmypresence", "revnottoremembermyname",
"revhardformetogetattention", "revpeopledonotnotice",
"peoplegenerallyknowwheniamaround", "ntimechkpw.fcd", "timeonfb.fcd", "numfbf.fcd"), estimator = "WLSMV"
)


summary(planA1brsepart.fit, fit.measures = TRUE, standardized = TRUE)


And the most of the output:

> summary(planA1brsepart.fit, fit.measures = TRUE, standardized = TRUE)
lavaan (0.5-21) converged normally after 115 iterations

                                                  Used       Total
  Number of observations                           384         391

  Estimator                                         ML
  Minimum Function Test Statistic             1928.705
  Degrees of freedom                               921
  P-value (Chi-square)                           0.000

Model test baseline model:

  Minimum Function Test Statistic             8321.388
  Degrees of freedom                               989
  P-value                                        0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.863
  Tucker-Lewis Index (TLI)                       0.852

Loglikelihood and Information Criteria:

  Loglikelihood user model (H0)                     NA
  Loglikelihood unrestricted model (H1)             NA

  Number of free parameters                        111
  Akaike (AIC)                                      NA
  Bayesian (BIC)                                    NA

Root Mean Square Error of Approximation:

  RMSEA                                          0.053
  90 Percent Confidence Interval          0.050  0.057
  P-value RMSEA <= 0.05                          0.048

Standardized Root Mean Square Residual:

  SRMR                                           0.059

Parameter Estimates:

  Information                                 Expected
  Standard Errors                             Standard

Latent Variables:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  posrse =~                                                             
    feelmprsnfwrth    1.000                               0.643    0.866
    flhvnmbrfgdqlt    0.921    0.044   20.888    0.000    0.592    0.838
    abltdthngsswll    0.800    0.049   16.293    0.000    0.515    0.716
    takeapostvtttd    0.986    0.051   19.370    0.000    0.634    0.801
    satsfdwthmyslf    0.981    0.051   19.097    0.000    0.631    0.794
  negrse =~                                                             
    rvnclndtflmflr    1.000                               0.698    0.813
    rvdnthvmchtbpr    0.935    0.059   15.867    0.000    0.653    0.744
    rvwshcldhvmrrs    0.850    0.067   12.660    0.000    0.593    0.620
    revfelslssttms    1.095    0.063   17.331    0.000    0.765    0.795
    revthnkmngdtll    1.085    0.062   17.613    0.000    0.757    0.805
  matr =~                                                               
    whnpplndhlpmtm    1.000                               0.556    0.664
    ppltndtrlynmfr    1.094    0.098   11.166    0.000    0.609    0.694
    rvntsmnpplwldt    0.747    0.087    8.620    0.000    0.416    0.510
    peopletrustme     0.988    0.087   11.417    0.000    0.550    0.715
    pepllktmfrdvcn    1.073    0.111    9.628    0.000    0.597    0.579
    peoplecountonm    0.986    0.092   10.748    0.000    0.548    0.661
  mati =~                                                               
    revnonrllyndsm    1.000                               0.597    0.683
    sccssssrcfprdt    0.690    0.088    7.871    0.000    0.412    0.433
    rvnnwldntcfdsp    0.874    0.077   11.297    0.000    0.522    0.635
    rvnntksprdnmyc    0.804    0.076   10.559    0.000    0.480    0.590
    rvppldntcrwhth    0.904    0.077   11.765    0.000    0.540    0.663
    rvpplrndffrntt    1.083    0.091   11.922    0.000    0.646    0.673
    pplwllncnvnnct    0.722    0.099    7.262    0.000    0.431    0.398
    pplrcttwhthppn    0.847    0.092    9.203    0.000    0.506    0.510
    rvpplsllydntwn    1.052    0.092   11.422    0.000    0.628    0.642
    pplwhcrnghtcrt    0.653    0.079    8.217    0.000    0.389    0.453
  mata =~                                                               
    peopledontgnrm    1.000                               0.324    0.315
    revfeelinvisbl    2.230    0.391    5.698    0.000    0.722    0.636
    revnoonrcgnzsm    1.659    0.296    5.614    0.000    0.537    0.599
    pplsllywrfmypr    1.226    0.260    4.707    0.000    0.397    0.368
    rvnttrmmbrmynm    1.345    0.269    4.992    0.000    0.435    0.420
    rvhrdfrmtgtttn    2.441    0.411    5.942    0.000    0.790    0.787
    revpeopldntntc    2.423    0.406    5.970    0.000    0.784    0.812
    pplgnrllyknwwh    1.726    0.304    5.681    0.000    0.559    0.628
  fbi =~                                                                
    timeonfb.fcd      1.000                               0.204    0.436
    numfbf.fcd        0.296    0.133    2.228    0.026    0.060    0.121
    ntimechkpw.fcd    1.265    0.178    7.117    0.000    0.258    0.521
    fbprtfmyvrydyc    5.717    0.651    8.782    0.000    1.167    0.890
    prodttllmnFcbk    2.728    0.377    7.241    0.000    0.557    0.539
    fbpartofdlyrtn    5.829    0.661    8.821    0.000    1.190    0.908
    feeloutoftouch    4.646    0.584    7.953    0.000    0.948    0.661
    flprtffbcmmnty    3.785    0.482    7.846    0.000    0.773    0.640
    sorryffbshtdwn    3.704    0.492    7.530    0.000    0.756    0.584

Regressions:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
  matr ~                                                                
    gender            0.254    0.080    3.179    0.001    0.457    0.178
    age              -0.026    0.009   -2.894    0.004   -0.046   -0.162
    fbi               0.236    0.159    1.481    0.139    0.086    0.086
  mati ~                                                                
    gender            0.093    0.085    1.096    0.273    0.155    0.061
    age              -0.006    0.009   -0.622    0.534   -0.010   -0.034
    fbi               0.237    0.171    1.387    0.165    0.081    0.081
  mata ~                                                                
    gender            0.018    0.046    0.391    0.696    0.055    0.021
    age              -0.004    0.005   -0.756    0.449   -0.012   -0.042
    fbi               0.165    0.096    1.719    0.086    0.104    0.104
  posrse ~                                                              
    gender           -0.162    0.088   -1.846    0.065   -0.252   -0.099
    age              -0.004    0.010   -0.378    0.706   -0.006   -0.020
    fbi               0.084    0.175    0.480    0.631    0.027    0.027
  negrse ~                                                              
    gender           -0.148    0.097   -1.531    0.126   -0.212   -0.083
    age               0.001    0.011    0.137    0.891    0.002    0.007
    fbi              -0.272    0.195   -1.395    0.163   -0.080   -0.080

Covariances:
                   Estimate  Std.Err  z-value  P(>|z|)   Std.lv  Std.all
 .posrse ~~                                                             
   .matr              0.072    0.021    3.378    0.001    0.210    0.210
   .mati              0.159    0.025    6.255    0.000    0.419    0.419
   .mata              0.079    0.018    4.378    0.000    0.383    0.383
 .negrse ~~                                                             
   .matr              0.082    0.024    3.472    0.001    0.221    0.221
   .mati              0.220    0.030    7.263    0.000    0.534    0.534
   .mata              0.106    0.023    4.714    0.000    0.476    0.476
 .matr ~~                                                               
   .mati              0.177    0.026    6.819    0.000    0.555    0.555
   .mata              0.094    0.020    4.721    0.000    0.545    0.545
 .mati ~~                                                               
   .mata              0.173    0.033    5.281    0.000    0.905    0.905
 .posrse ~~                                                             
   .negrse            0.370    0.035   10.460    0.000    0.835    0.835

A short file with 50 cases (csv file) attached.

Thanks,
Scot
fmshare.csv

Yves Rosseel

unread,
Sep 15, 2016, 3:24:45 AM9/15/16
to lav...@googlegroups.com
Thanks for the script + data.

First, for the non-zero correlations, could it be that you are fitting
the wrong model: the sem() call refers to 'planA1b.model', while the
model with the zero correlations is called 'planA1brsepart.model'. If I
fit this model, I do get zero correlations:

Covariances:
Estimate Std.Err z-value P(>|z|)
.posrse ~~
.matr 0.000
.mati 0.000
.mata 0.000
.negrse ~~
.matr 0.000
.mati 0.000
.mata 0.000
.matr ~~
.mati 0.000
.mata 0.000
.mati ~~
.mata 0.000
.posrse ~~
.negrse 0.000

Second, for the rmsea, I do think something is not quite right. The
'new' robust rmsea (and its confidence interval) seems to work well when
the 'traditional' mean-adjusted satorra-bentler correction is used, but
not if a mean-and-variance, or as in your case, a scaled/shifted
correction is used.

I will investigate this further. For now, I would recommend that when
using estimator = "WLSMV", look at the 'old' scaled rmsea values:

fitMeasures(fit)[c("rmsea.scaled", "rmsea.ci.lower.scaled",
"rmsea.ci.upper.scaled")]

Thanks for reporting this.

Yves.



On 09/15/2016 06:02 AM, Scot McNary wrote:
> Hi,
> Yes, lavaan 0.5-21, (R 3.3.1).
> Full lavaan call:
>
> planA1brsepart.model <- '
> # measurement
> posrse =~ feelimapersonofworth + feelihaveanumberofgoodqualities +
> abletodothingsaswell +
> takeapositiveattitude + satisfiedwithmyself
> negrse =~ revinclinedtofeeliamafailure + revdonothavemuchtobeproudof +
> revwishicouldhavemorerespect + revfeeluselessattimes +
> revthinkiamnogoodatall
> matr =~ whenpeopleneedhelpometome + peopletendtorelyonmeforsupport +
> revnotsomeonepeoplewouldturnto +
> peopletrustme + peoplelooktomeforadviceon + peoplecountonme
> mati =~ revnoonereallyneedsme + successessourceofpridetopeople +
> revnoonewouldnoticeifidisappeared +
> revnoonetakesprideinmyaccomplishments +
> revpeopledonotcarewhathappenstome + revpeopleareindifferenttomyneeds +
> peoplewillinconveniencethemselves + peoplereacttowhathappenstome +
> revpeopleusuallydontwanttohearaboutit +
> peoplewhocareenoughtocriticize
> mata =~ peopledonotignoreme + revfeelinvisible + revnoonerecognizesme +
> peopleusuallyawareofmypresence + revnottoremembermyname
> +revhardformetogetattention +
> --
> 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>.
> Visit this group at https://groups.google.com/group/lavaan.
> For more options, visit https://groups.google.com/d/optout.

Scot McNary

unread,
Sep 15, 2016, 11:17:19 AM9/15/16
to lavaan
Yves,
Awesome! My goof on the model. Thanks so much for your help and for lavaan!
Scot

Yves Rosseel

unread,
Sep 25, 2016, 6:08:31 AM9/25/16
to lav...@googlegroups.com
Dear lavaan users,

lavaan 0.5-22 has been released on CRAN yesterday (24 Sept 2016).

This update mostly addresses some issues related to the 'new' robust
versions of the CFI/TLI/RMSEA fit indices that were introduced in lavaan
0.5-21 (7 sept 2016).

In lavaan 0.5-21, they replaced the 'old' (so-called 'scaled') versions
of the CFI/TLI/RMSEA fit indices in the output of summary(), while in
the output of the fitMeasures(), both *.scaled (=old) and *.robust(=new)
variants are available.

In lavaan 0.5-22, the old versions return back to their normal
positions, while additional lines are printed for the 'new' robust
versions in the output of summary().

*In addition, it turns out that the 'new' robust values were wrong if
(and only if) the test statistic is of the type "mean.var.adjusted" or
"scaled.shifted". The latter is used when estimator = "WLSMV", the
default estimator in the categorical case!*

When the "satorra.bentler" or "yuan.bentler" test statistic is used
(eg estimator MLM or MLR), then the new robust versions are correct, and
to be preferred over the 'old' scaled versions. See

Brosseau-Liard, P. E., Savalei, V., and Li, L. (2012). An investigation
of the sample performance of two nonnormality corrections for RMSEA.
Multivariate behavioral research, 47(6), 904-930.

Brosseau-Liard, P. E., & Savalei, V. (2014). Adjusting incremental fit
indices for nonnormality. Multivariate behavioral research, 49(5), 460-470.

Correct robust versions when the test statistic is "mean.var.adjusted"
or "scaled.shifted" are not yet considered in the literature, and are
currently under development. They will (hopefully) be included in a next
update.

Yves.
Message has been deleted
Message has been deleted

Fabrício Fialho

unread,
Sep 29, 2016, 7:02:22 AM9/29/16
to lavaan
Hi all,

Yves, thanks for lavaan and for the new updates!

I analyzed categorical data and found the same issue initially reported by Scot (now fixed!) when I use robust estimators: the new ".robust" fit measures are not printed.

When I treat variables as continuous and use robust estimators (e.g. estimator="MLR"), lavaan prints the ".robust" fit measures. However, when I treat variables as ordered (e.g. estimator="WLSMV), the new ".robust" measures are not printed and lavaan shows "NA" instead.

Here is a quick example using the HolzingerSwineford1939 dataset. (Please note that I "tweak" the dataset a little to facilitate the use of variables as categorical.)

Just for the records, I use R version 3.3.1 and lavaan 0.5-22.


library(lavaan)

names
(HolzingerSwineford1939)
 
[1] "id"     "sex"    "ageyr"  "agemo"  "school" "grade"
 
[7] "x1"     "x2"     "x3"     "x4"     "x5"     "x6"    
[13] "x7"     "x8"     "x9"  


data
<- HolzingerSwineford1939[,7:15]
for(i in 1:ncol(data)){
 
# 'rounding' is used here just to reduce the number of points in a variable
 
# to make it "more like ordered"
  data
[,i] <- round(data[,i],0)
}


model
<-
'
f1 =~ x1 + x2 + x3 + x4
f2 =~ x5 + x6 + x7 + x8 + x9

f1 ~~ f2
'




test
.mlr <- cfa(data=data,
                model
=model,
                estimator
="MLR")

summary
(test.mlr, standardized=T, fit.measures=T)
lavaan
(0.5-22) converged normally after  37 iterations

 
Number of observations                           301

 
Estimator                                         ML      Robust
 
Minimum Function Test Statistic              259.158     270.048
 
Degrees of freedom                                26          26
  P
-value (Chi-square)                           0.000       0.000
 
Scaling correction factor                                  0.960
   
for the Yuan-Bentler correction

(...)


User model versus baseline model:


 
Comparative Fit Index (CFI)                    0.684       0.666
 
Tucker-Lewis Index (TLI)                       0.563       0.537

 
Robust Comparative Fit Index (CFI)                         0.683
 
Robust Tucker-Lewis Index (TLI)                            0.561

(...)


Root Mean Square Error of Approximation:


  RMSEA                                          
0.173       0.177
 
90 Percent Confidence Interval          0.154  0.192       0.157  0.196
  P
-value RMSEA <= 0.05                          0.000       0.000

 
Robust RMSEA                                               0.173
 
90 Percent Confidence Interval                             0.155  0.192



test
.wlsms <- cfa(data=data,
                  model
=model,
                  estimator
="WLSMV",
                  ordered
=names(data))

summary
(test.wlsms, standardized=T, fit.measures=T)
lavaan
(0.5-22) converged normally after  19 iterations

 
Number of observations                           301

 
Estimator                                       DWLS      Robust
 
Minimum Function Test Statistic              314.093     367.856
 
Degrees of freedom                                26          26
  P
-value (Chi-square)                           0.000       0.000
 
Scaling correction factor                                  0.869
 
Shift parameter                                            6.482
   
for simple second-order correction (Mplus variant)

(...)


User model versus baseline model:


 
Comparative Fit Index (CFI)                    0.886       0.789
 
Tucker-Lewis Index (TLI)                       0.843       0.708

 
Robust Comparative Fit Index (CFI)                            NA
 
Robust Tucker-Lewis Index (TLI)                               NA

Root Mean Square Error of Approximation:


  RMSEA                                          
0.192       0.209
 
90 Percent Confidence Interval          0.173  0.212       0.191  0.229
  P
-value RMSEA <= 0.05                          0.000       0.000

 
Robust RMSEA                                                  NA
 
90 Percent Confidence Interval                                NA     NA

Thanks for your help!

Yves Rosseel

unread,
Sep 29, 2016, 8:48:35 AM9/29/16
to lav...@googlegroups.com
On 09/29/2016 12:56 PM, Fabrício Fialho wrote:
> When I treat variables as continuous and use robust estimators (e.g.
> estimator="MLR"), lavaan prints the ".robust" fit measures. However,
> when I treat variables as ordered (e.g. estimator="WLSMV), the new
> ".robust" measures are not printed and lavaan shows "NA" instead.

True. That is intended (for now) in 0.5-22. We simply do not know yet
how to compute these new 'robust' fit indices when test =
"mean.var.adjusted" or test = "scaled.shifted". The latter is what is
used when estimator = "WLSMV".

Until this has been resolved (and various experts around the world are
working on this right now), lavaan will print 'NA'.

Yves.

Tony Roberson

unread,
Oct 11, 2016, 7:05:46 PM10/11/16
to lavaan
Hello all,

I am currently working on a research project involving a CFA with ordinal data that I have modeled using the "WLSMV" estimator. I understand that the robust indices are still being investigated so I decided to go with the (old) scaled indices for the write-up. However, I noticed that there is an extreme discrepancy between the scaled and unscaled estimates for the CFI and TLI (and a smaller discrepancy for the RMSEA). Could this be correct? Could you please help me understand how the scaled indices are calculated and how to interpret them? Please see below for the code and attached for the data set.

Best,

Tony

## Import split half of data (S2)
S2 <- read.csv(file = "HBSC Bullying Scale_S2_CFA.csv", 
               stringsAsFactors=FALSE)

## Load relevant packages
library(lavaan)
library(data.table)

## Create data frame of only the bullying items in S2
S2.cfa <- as.data.frame(
  S2[,c("Q66A","Q66B","Q66C","Q66D","Q66E","Q66F",
        "Q66G","Q66H","Q66I","Q66J","Q66K",
        "Q68A","Q68B","Q68C","Q68D","Q68E","Q68F",
        "Q68G","Q68H","Q68I","Q68J","Q68K")])
# Give columns meaningful names
setnames(x = S2.cfa, 
         old = c("Q66A","Q66B","Q66C","Q66D","Q66E","Q66F",
                 "Q66G","Q66H","Q66I","Q66J","Q66K",
                 "Q68A","Q68B","Q68C","Q68D","Q68E","Q68F",
                 "Q68G","Q68H","Q68I","Q68J","Q68K"), 
         new = c("vVerbal", "vExclusion", "vPhysical", "vRelational", "vRacial", 
                 "vReligious", "vSexual", "vComp", "vCell", "vCompOut", "vCellOut",
                 "pVerbal", "pExclusion", "pPhysical", "pRelational", "pRacial", 
                 "pReligious", "pSexual", "pComp", "pCell", "pCompOut", "pCellOut"))

## Specify the two factor model
Model.2factor <- '## Latent factor specification
                     Victimization =~ vVerbal + vExclusion + vPhysical + vRelational + vRacial + 
                       vReligious + vSexual + vComp + vCell + vCompOut + vCellOut
                     Perpetration =~ pVerbal + pExclusion + pPhysical + pRelational + pRacial + 
                       pReligious + pSexual + pComp + pCell + pCompOut + pCellOut
                   ## Latent variable covariance
                     Victimization ~~ Perpetration'

# Fit the model as a CFA
fit.2factor <- cfa(model = Model.2factor, 
                    estimator = "WLSMV",
                    data = S2.cfa)
# Print fit summary
summary(object = fit.2factor,
         fit.measures = TRUE,
         standardized = TRUE)


lavaan (0.5-22) converged normally after  42 iterations

  Number of observations                          4990

  Estimator                                       DWLS      Robust
  Minimum Function Test Statistic              714.918    2143.814
  Degrees of freedom                               208         208
  P-value (Chi-square)                           0.000       0.000
  Scaling correction factor                                  0.350
  Shift parameter                                          101.510
    for simple second-order correction (Mplus variant)

Model test baseline model:

  Minimum Function Test Statistic            22388.219    2822.943
  Degrees of freedom                               231         231
  P-value                                        0.000       0.000

User model versus baseline model:

  Comparative Fit Index (CFI)                    0.977       0.253
  Tucker-Lewis Index (TLI)                       0.975       0.171

  Robust Comparative Fit Index (CFI)                            NA
  Robust Tucker-Lewis Index (TLI)                               NA

Root Mean Square Error of Approximation:

  RMSEA                                          0.022       0.043
  90 Percent Confidence Interval          0.020  0.024       0.042  0.045
  P-value RMSEA <= 0.05                          1.000       1.000

  Robust RMSEA                                                  NA
  90 Percent Confidence Interval                                NA     NA

Standardized Root Mean Square Residual:

  SRMR                                           0.067       0.067

Parameter Estimates:

  Information                                 Expected
  Standard Errors                           Robust.sem

HBSC Bullying Scale_S2_CFA.csv
Message has been deleted

Seongho Bae

unread,
Oct 11, 2016, 11:01:16 PM10/11/16
to lavaan
# Fit the model as a CFA
fit.2factor <- cfa(model = Model.2factor, 
                    estimator = "WLSMV", ordered = names(S2.cfa),
                    data = S2.cfa)

Seongho

2016년 10월 12일 수요일 오전 8시 5분 46초 UTC+9, Tony Roberson 님의 말:

Terrence Jorgensen

unread,
Oct 13, 2016, 3:50:27 AM10/13/16
to lavaan
Could you please help me understand how the scaled indices are calculated and how to interpret them?



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

toe...@ohlsen-web.de

unread,
Dec 19, 2016, 5:09:01 AM12/19/16
to lavaan
Hi!
I need to double-check, if i understood the implications of the update correctly.

I´m close to submitting my phd-thesis. I´ve analysed my models with lavaan Version 0.5-20. I used the MLM-estimator, so the fit-indices were computed as Satorra-Bentler scaled. With 0.5-21 a new, more adequate formula for the robust fit-indices was introduced.
How does this affect my results? Only the scaling-factor should be different and as a result also the fit-indices that use it differ, right? But the estimates of my model parameters stay the same?

Should i re-run my analysis? If it only affects the fit-indices, that would be no problem. If there are any further implications for the model estimation (what i don´t expect, but i want to be sure), this would cost me a lot of time i don´t have.

Thank you very much for a short comment!

Yves Rosseel

unread,
Dec 19, 2016, 5:15:34 AM12/19/16
to lav...@googlegroups.com
On 12/19/2016 11:09 AM, toe...@ohlsen-web.de wrote:
> I´m close to submitting my phd-thesis. I´ve analysed my models with
> lavaan Version 0.5-20. I used the MLM-estimator, so the fit-indices were
> computed as Satorra-Bentler scaled. With 0.5-21 a new, more adequate
> formula for the robust fit-indices was introduced.

Yes, only for RMSEA and CFI/TLI.

> How does this affect my results? Only the scaling-factor should be
> different and as a result also the fit-indices that use it differ,
> right? But the estimates of my model parameters stay the same?

Everything is identical, except that we now have 'better' versions of
the robust RMSEA and robust CFI/TLI fit measures.

> Should i re-run my analysis?

No. You can compute the 'new' values for robust RMSEA and robust CFI/TLI
from the 'old' values. See the references:


http://dx.doi.org/10.1080/00273171.2014.933697

http://dx.doi.org/10.1080/00273171.2012.715252


Yves.

toe...@ohlsen-web.de

unread,
Dec 19, 2016, 5:24:58 AM12/19/16
to lavaan
Thank you very much for the fast answer and thank your for developing lavaan, so i didn´t have to buy MPLUS for my dissertation =) I loved working with it!

R McLaren

unread,
Dec 22, 2016, 10:14:30 AM12/22/16
to lavaan
I second that sentiment - hats off to the lavaan developers - I'm really happy I can work with this data, learn about sem and not have to purchase MPLUS.

Rick
Reply all
Reply to author
Forward
0 new messages