Announcement

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

  • sem: Very different fit index values in Stata and Mplus

    I’m trying to run a simple single-factor model with four continuous indicators. Even though the four indicators have very higher (>.9) intercorrelations, the fit indices in Stata are not good and also it's showing df = 6 rather than 2.

    Specifically, in Stata
    Chi-square = 1261.533
    RMSEA=.768
    CFI=.787
    TLI=.646
    df=6

    The sample size is 356.

    If I run the same analysis in MPlus
    Chi-square = 4.956
    RMSEA = .064
    CFI = .999
    TLI=.997
    df=2

    For some reason MPlus shows a sample size of 357, so I think it’s including one value with some missing data. Stata is excluding that.

    I’m using Stata SE version 16.1 and I have installed all the updates. Here’s the code I’m using . Note that I’m running MPlus from Stata using the runmplus command.

    Code:
    sem (PPR -> PPR1 PPR2 PPR3 PPR4), method(ml) nocapslatent
    estat gof, stats(all)
     
    runmplus PPR1 PPR2 PPR3 PPR4, model(PPR by PPR1-PPR4;)
    Has anyone had similar problems with Stata?

    Chris

  • #2
    mPlus defaults to using full information maximum likelihood. In Stata you can say method(mlmv), Or, you CAN tell mplus to use listwise deletion, but check the exact syntax, Or, maybe this would work:

    Code:
    runmplus PPR1 PPR2 PPR3 PPR4 if e(sample), model(PPR by PPR1-PPR4;)
    I don't know if one case can cause such huge discrepancies, but you might as well make the samples identical first and see if discrepancies persist.

    Also, given that you specify a range of variables for mplus, are they actually in the right order? Maybe try

    Code:
     
     runmplus PPR1 PPR2 PPR3 PPR4, model(PPR by PPR1 PPR2 PPR3 PPR4;)
    -------------------------------------------
    Richard Williams, Notre Dame Dept of Sociology
    StataNow Version: 19.5 MP (2 processor)

    EMAIL: [email protected]
    WWW: https://www3.nd.edu/~rwilliam

    Comment


    • #3
      Originally posted by Chris Martin View Post
      I’m trying to run a simple single-factor model with four continuous indicators. Even though the four indicators have very higher (>.9) intercorrelations, the fit indices in Stata are not good and also it's showing df = 6 rather than 2.

      Has anyone had similar problems with Stata?
      No.

      A dataset that matches your description gives results that look a whole lot like what MPlus gave you. (See below.) You might want to take closer look.

      .ÿ
      .ÿversionÿ16.1

      .ÿ
      .ÿclearÿ*

      .ÿ
      .ÿsetÿseedÿ`=strreverse("1555797")'

      .ÿ
      .ÿtempnameÿCorr

      .ÿmatrixÿdefineÿ`Corr'ÿ=ÿJ(4,ÿ4,ÿ0.9)ÿ+ÿI(4)ÿ*ÿ0.1

      .ÿquietlyÿdrawnormÿppr1ÿppr2ÿppr3ÿppr4,ÿdoubleÿcorr(`Corr')ÿn(357)

      .ÿquietlyÿreplaceÿppr4ÿ=ÿ.ÿinÿl

      .ÿ
      .ÿsemÿ(ppr?ÿ<-ÿPpr),ÿmethod(ml)ÿnocnsreportÿnodescribeÿnofootnoteÿnolog
      (1ÿobservationsÿwithÿmissingÿvaluesÿexcluded)

      StructuralÿequationÿmodelÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿÿÿ356
      Estimationÿmethodÿÿ=ÿml
      Logÿlikelihoodÿÿÿÿÿ=ÿ-1013.5894

      ------------------------------------------------------------------------------
      ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿOIM
      ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
      -------------+----------------------------------------------------------------
      Measurementÿÿ|
      ÿÿppr1ÿÿÿÿÿÿÿ|
      ÿÿÿÿÿÿÿÿÿPprÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
      ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.1036677ÿÿÿÿ.053362ÿÿÿÿÿ1.94ÿÿÿ0.052ÿÿÿÿ-.0009199ÿÿÿÿ.2082553
      ÿÿ-----------+----------------------------------------------------------------
      ÿÿppr2ÿÿÿÿÿÿÿ|
      ÿÿÿÿÿÿÿÿÿPprÿ|ÿÿÿ.9780977ÿÿÿ.0254047ÿÿÿÿ38.50ÿÿÿ0.000ÿÿÿÿÿ.9283054ÿÿÿÿÿ1.02789
      ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.1153587ÿÿÿ.0517012ÿÿÿÿÿ2.23ÿÿÿ0.026ÿÿÿÿÿ.0140262ÿÿÿÿ.2166911
      ÿÿ-----------+----------------------------------------------------------------
      ÿÿppr3ÿÿÿÿÿÿÿ|
      ÿÿÿÿÿÿÿÿÿPprÿ|ÿÿÿ.9766735ÿÿÿ.0267324ÿÿÿÿ36.54ÿÿÿ0.000ÿÿÿÿÿÿ.924279ÿÿÿÿ1.029068
      ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.0804812ÿÿÿ.0522193ÿÿÿÿÿ1.54ÿÿÿ0.123ÿÿÿÿ-.0218668ÿÿÿÿ.1828292
      ÿÿ-----------+----------------------------------------------------------------
      ÿÿppr4ÿÿÿÿÿÿÿ|
      ÿÿÿÿÿÿÿÿÿPprÿ|ÿÿÿ1.013662ÿÿÿÿ.025588ÿÿÿÿ39.61ÿÿÿ0.000ÿÿÿÿÿ.9635104ÿÿÿÿ1.063814
      ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ.1128209ÿÿÿ.0532564ÿÿÿÿÿ2.12ÿÿÿ0.034ÿÿÿÿÿ.0084403ÿÿÿÿ.2172015
      -------------+----------------------------------------------------------------
      ÿÿvar(e.ppr1)|ÿÿÿ.1123873ÿÿÿ.0109267ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0928881ÿÿÿÿ.1359796
      ÿÿvar(e.ppr2)|ÿÿÿ.0893187ÿÿÿ.0092992ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0728319ÿÿÿÿ.1095376
      ÿÿvar(e.ppr3)|ÿÿÿ.1109965ÿÿÿ.0106814ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0919172ÿÿÿÿ.1340362
      ÿÿvar(e.ppr4)|ÿÿÿ.0835828ÿÿÿ.0092242ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.0673253ÿÿÿÿ.1037662
      ÿÿÿÿÿvar(Ppr)|ÿÿÿ.9013236ÿÿÿ.0758325ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ.7643025ÿÿÿÿ1.062909
      ------------------------------------------------------------------------------

      .ÿ
      .ÿestatÿgof,ÿstats(chi2ÿrmseaÿindices)

      ----------------------------------------------------------------------------
      Fitÿstatisticÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿValueÿÿÿDescription
      ---------------------+------------------------------------------------------
      Likelihoodÿratioÿÿÿÿÿ|
      ÿÿÿÿÿÿÿÿÿÿchi2_ms(2)ÿ|ÿÿÿÿÿÿ0.750ÿÿÿmodelÿvs.ÿsaturated
      ÿÿÿÿÿÿÿÿÿÿÿÿpÿ>ÿchi2ÿ|ÿÿÿÿÿÿ0.687
      ÿÿÿÿÿÿÿÿÿÿchi2_bs(6)ÿ|ÿÿÿ1994.765ÿÿÿbaselineÿvs.ÿsaturated
      ÿÿÿÿÿÿÿÿÿÿÿÿpÿ>ÿchi2ÿ|ÿÿÿÿÿÿ0.000
      ---------------------+------------------------------------------------------
      Populationÿerrorÿÿÿÿÿ|
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRMSEAÿ|ÿÿÿÿÿÿ0.000ÿÿÿRootÿmeanÿsquaredÿerrorÿofÿapproximation
      ÿ90%ÿCI,ÿlowerÿboundÿ|ÿÿÿÿÿÿ0.000
      ÿÿÿÿÿÿÿÿÿupperÿboundÿ|ÿÿÿÿÿÿ0.079
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿpcloseÿ|ÿÿÿÿÿÿ0.850ÿÿÿProbabilityÿRMSEAÿ<=ÿ0.05
      ---------------------+------------------------------------------------------
      Baselineÿcomparisonÿÿ|
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿCFIÿ|ÿÿÿÿÿÿ1.000ÿÿÿComparativeÿfitÿindex
      ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTLIÿ|ÿÿÿÿÿÿ1.002ÿÿÿTucker-Lewisÿindex
      ----------------------------------------------------------------------------

      .ÿ
      .ÿexit

      endÿofÿdo-file


      .


      P.S.

      . rename *, upper

      . sem (PPR -> PPR1 PPR2 PPR3 PPR4), method(ml) nocapslatent
      variable PPR not found;
      Perhaps you meant 'PPR' to specify a latent variable.
      For 'PPR' to be a valid latent variable specification, 'PPR' must appear in the latent() option.

      r(111);

      .

      Comment


      • #4
        . . . but this postscript gives you something closer to what you got . . .
        Code:
        rename *, upper
        generate double PPR = runiform()
        sem (PPR -> PPR1 PPR2 PPR3 PPR4), method(ml) nocapslatent
        estat gof, stats(chi2 rmsea indices)
        You might want to take closer look at your dataset.

        I recommend sticking to Stata-ish conventions about variable name case, which will allow you to use Stata's defaults for naming latent factors.

        Comment


        • #5
          Thanks, everyone. I realized that I should have specified "latent(PPR)" as well. Once I added that, it worked fine.

          Comment

          Working...
          X