Closed sfcheung closed 2 years ago
True indeed. You need to include the 'main' fit index in the list, if you wish to extract the 'derived' fit indices (in many cases).
I could fix this, but I prefer to first rewrite the fitMeasures() function. In the new version, fitMeasures() will call other functions per family (a function for RMSEA and friends, lavResiduals() for the SRMR, and so on).
The fitMeasures() function has now been rewritten, and all requested fit measures should now be returned in dev 0.6-13.
I am using version in version 0.6-9. I believe this is bug because the argument
fit.measures
of the functionfitMeasures
does not behave as it is documented.This is the example from the help page of
fitMeasures
:This is the output:
However, some fit measures are not returned if requested. For example,
"srmr_bentler"
and"crmr"
:They return a numeric vector of zero length:
This is a minor bug because there is a simple workaround:
I haven't checked other measures. For measures of the SRMR/RMR family, only
"srmr"
and"rmr"
are checked:https://github.com/yrosseel/lavaan/blob/de141af743b37d45c7567d08e72f199e5d8ed882/R/lav_fit_measures.R#L1051
For measures of the SRMR/RMR family, perhaps it can be fixed by changing the above line to:
fit.srms2
is defined here:https://github.com/yrosseel/lavaan/blob/de141af743b37d45c7567d08e72f199e5d8ed882/R/lav_fit_measures.R#L187-L206
I haven't checked other measures but I think only a few other groups of measures are affected, e.g., the RMSEA family, listed in
fit.rmsea
. I believe they can be fixed in a similar way if they have the same problem.My two cents.