Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Thank you Erik Ruzek accomplish it.

    Wishlist for Stata 17 Erik Ruzek 01 Dec 2020, 09:38
    I would love to see Stata offer the option to use alternative estimators for sem/gsem. Specifically, with categorical data, diagonal weighted least squares (DWLS; WLSMV in Mplus) is often preferable to maximum likelihood (the only option in gsem). When the number of response options is low, maximum likelihood can be problematic, as shown in a number of studies. I am aware that sem offers the ADF estimator, but this is a band aid for categorical items. There are workarounds for EFA but it would be nice to have this baked into sem/gsem.

    Wishlist for Stata 18 Giovanni Russo 23 Sep 2021, 07:30
    I was referring to alternative to ML to estimate SEM models which are less sensitive to deviations from normality assumption, for example Diagonally Weighted Least Squares (DWLS) also referred to as WLSM or WLSMV.

    Wishlist for Stata 20 Erik Reinbergs 10 Apr 2025, 10:22
    Wishlist for sem/gsem:
    • WLSMV estimation similar to lavaan / mplus (with scaled/robust model fit statistics)
    • FIML for categorical data with MML estimation similar to mplus
    I agree with the above ideas that having a built in bayes command with the HMC/NUTS sampler (via Stan backend) would be great. Sure calling Stan from Python from Stata is possible - but that is so complicated compared to using the same user friendly built in bayes stata commands with a different sampler on the backend.
    Last edited by Chen Samulsion; 19 Nov 2026, 20:45.

    Comment


    • #17
      An updated dwlsmv is now available as v0.7.0! Yes, we jumped up two releases.*

      Added in v0.6.1, dwlsmv users can model second-order (sometimes called higher-order) factors in which the latent variables of a multifactor model are themselves determined by a latent variable.

      A higher-order model is illustrated in sem example 15. As an example, say you have a set of items explained by three latent variables that correspond to a person's perceptions of their autonomous agency, relatedness to others, and competence. These are the three components of self-determination theory, and you might therefore model them as being explained by a higher order factor, intrinsic motivation. I'm not saying you should necessarily do this, but these types of models are commonly seen in SEM. In dwlsmv:
      Code:
      * Download newest release
      net install dwlsmv, from("https://raw.githubusercontent.com/bbachilles/dwlsmv/v0.7.0/dist/") replace
      
      * Download new synthetic example datasets
      net get dwlsmv, from("https://raw.githubusercontent.com/bbachilles/dwlsmv/v0.7.0/dist/") replace
      
      use dwlsmv_example_so.dta, clear
      * Second-order factor model
      dwlsmv (F1 -> y1 y2 y3) (F2 -> y4 y5 y6) (F3 -> y7 y8 y9) (F4 -> y10 y11 y12) ///
          (G -> F1 F2 F3 F4), metric(unitvariance)
      dwlsmv, standardized // if you want standardized estimates
      New to v0.7.0 is additional information about model fit as well as residual diagnostics in efacompare.

      First, the standardized root mean square residual (SRMR) fit index is reported for converged single-group dwlsmv fits. Conditional-on-x fits are excluded. SRMR is a single number summary of the differences between observed and model-implied item correlations. It provides a descriptive measure of how closely the fitted model reproduces the polychoric or tetrachoric correlation matrix. Smaller values indicate smaller average correlation discrepancies. No universal cutoffs for ordinal SEM are endorsed.

      On the diagnostic side, efacompare now shows the three item pairs with the largest absolute normalized residuals for each eligible model. The display includes both the signed raw residual and the normalized residual for each pair. Raw residuals show the signed difference between observed and model-implied correlations. A positive residual shows the given model underpredicts the observed correlation whereas a negative residual shows the given model overpredicts it.

      Normalized residuals divide these differences by the asymptotic standard error of the observed sample correlation.They therefore express the discrepancy relative to the estimated sampling variability of that correlation, rather than the variability of the residual itself. This helps identify item pairs whose discrepancies are large relative to the estimated precision of their sample correlations.

      Such discrepancies can point to potentially local misfit. For example, item pairs whose relationships are not adequately reproduced by the fitted factor model. There are several possible reasons, including estimating too few factors, shared wording or method effects among items, and model assumptions about relationships among factors that do not match the data. Residuals are diagnostic clues, however, not proof of any particular cause.

      The distinction between raw and normalized residuals is useful because pairs with the same raw discrepancy can have different normalized residuals when their estimated sampling variability differs. Consider the following example (note that the SEs are not reported by efacompare):

      Item pair Raw
      Residual
      SE Normalized
      Residual
      A-B 0.08 0.01 8.00
      C-D 0.08 0.04 2.00
      E-F 0.03 0.005 6.00

      A–B and C–D have the same raw discrepancy, but C–D has a smaller normalized residual because its estimated sampling variability is larger. E–F has a smaller raw discrepancy than either, but a larger normalized residual than C–D because its estimated standard error is smaller.

      Importantly, normalized residuals are approximate descriptive diagnostics, not formal test statistics. They are not standard-normal statistics, even asymptotically under a correct model, and their accuracy can be limited when sample sizes are small or data are sparse.

      *We are using Semantic Versioning rules for demarcating releases. From https://semver.org/, given a version number MAJOR.MINOR.PATCH, increment the:
      1. MAJOR version when you make incompatible API changes
      2. MINOR version when you add functionality in a backward compatible manner
      3. PATCH version when you make backward compatible bug fixes

      Comment

      Working...
      X