Closed TDJorgensen closed 3 months ago
The added 'standard' was due to the use of opt$test <- union("standard", opt$test)
when a standard (non-robust) estimator was provided. If have now removed them, so that "standard"
is no longer added. That seems to be part of the solution, but perhaps more steps are needed?
This is an odd one, that I noticed causing a problem in lavaan.mi when calculating CFI etc.
When the baseline model and target model do not have
all(object@Options$test == fit.indep@Options$test)
, the baseline model is refitted. This might be totally unnecessary if the reason they differ is that one$test
isc("standard", "satorra.bentler")
, whereas the other$test
is merely"satorra.bentler"
.The redundant
"standard"
is sometimes added--e.g., here--under the condition that the estimator is the default (specified explicitly or not at all) while thetest=
argument specifies something besides"standard"
. This was originally needed to assure the standard LRT was provided, even when a residual-based statistic was requested. But when explicitly specifying a scaled (standard) test, the concatenation is unnecessary.Although the concatenation of "standard" doesn't have any apparent negative consequences when fitting the model, it might not match how a baseline model was fitted. I don't have an
update()
method forlavaan.mi
objects, so I do something analogous to this:Again, this isn't really a problem for lavaan users. They get the same results, and refitting the baseline model will usually be instantaneous (like it is here), but it could be more time-consuming in larger or more complex data situations.
In the lavaan.mi situation, refitting the baseline model yields incorrect results (which are NOT immediately apparent because everything seems to run fine) because the results are based on the first imputation (stored in
@Data
) rather than pooled results. I will now check the@call
for the originally requestedtest=
andestimator=
to avoid this, but there might be other scenarios where this yields unexpected problems, so I created the issue to bring it to your attention. I'm not sure what the most efficient solution would be in lavaan, but if you make a suggestion, I could work on a pull request.