As far as I know, in Mplus, WLSMV is used along with the option CATEGORICAL (at least in the examples I found in the manual). I did a quick test and confirmed that, if I fit a model with WLSMV and did not specify and variable as ordered categorical, a warning will be raised:
*** WARNING in ANALYSIS command
Estimator WLSMV is not available for analysis with all continuous variables.
Default estimator will be used.
1 WARNING(S) FOUND IN THE INPUT INSTRUCTIONS
This confirmed that, in Mplus, WLSMV is supposed to be used when some variables are declared ordered categorical, and is not supposed to be used when all variables are treated as continuous.
However, this is not the case for lavaan. I can set estimator to "WLSMV" even if the model has no categorical variables:
``` r
library(lavaan)
#> This is lavaan 0.6-17.1897
#> lavaan is FREE software! Please report any bugs.
HS.model <- ' visual =~ x1 + x2 + x3
textual =~ x4 + x5 + x6
speed =~ x7 + x8 + x9 '
fit <- cfa(HS.model, data = HolzingerSwineford1939, estimator = "WLSMV")
fit
#> lavaan 0.6.17.1897 ended normally after 44 iterations
#>
#> Estimator DWLS
#> Optimization method NLMINB
#> Number of model parameters 21
#>
#> Number of observations 301
#>
#> Model Test User Model:
#> Standard Scaled
#> Test Statistic 43.902 79.342
#> Degrees of freedom 24 24
#> P-value (Chi-square) 0.008 0.000
#> Scaling correction factor 0.598
#> Shift parameter 5.867
#> simple second-order correction
lavInspect(fit, "ordered")
#> character(0)
```
<sup>Created on 2023-10-27 with [reprex v2.0.2](https://reprex.tidyverse.org)</sup>
I asked this question because I noticed that some users set estimator to "WLSMV" to handle ordered categorical variables. They are doing the right thing, but only for the estimator. They did not use "ordered" to specify which variables are ordered categorical, and lavaan faithfully does what it is told to do, using DWLS (as in Mplus). They may not know that ordered categorical variables are not treated as such in lavaan, without using "ordered"
Is this an intended behavior of lavaan?
Users of Mplus may not notice this difference, and believe incorrectly that setting the estimator to "WLSMV" is enough to handle ordered categorical variables.
-- Shu Fai