Announcement

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

  • RMSEA 90% CI using Satorra-Bentler in sem CFA

    I am running a CFA using sem but am having trouble figuring out the output and possibly whether there is an additional command I need.
    I am running a CFA using the Satorra-Bentler correction and I am not sure how to get the 90% Confidence Intervals around the RMSEA with the Satorra-Bentler correction. I am only provided the 90% confidence interval around the "Population error." Is there a specific command I need to get this output?
    Thanks in advance!

  • #2
    Originally posted by Sarah Purnell View Post
    I am running a CFA using the Satorra-Bentler correction and I am not sure how to get the 90% Confidence Intervals around the RMSEA with the Satorra-Bentler correction. . . . Is there a specific command I need to get this output?
    I'm not sure why Stata doesn't produce it, but you can calculate it manually using formulas shown here (scroll down to the bullet point named "RMSEA index" under the section titled, "Parsimony Indices") in conjunction with Stata's function for the noncentrality parameter of the noncentral chi-square distribution, npnchi2().

    I show how below in a worked example (the manual calculation begins at the "Begin here" comment; the stuff above it is to create a toy dataset and fit a confirmatory factor analysis model to it for illustration).

    Below that, I also show an easy, lazy method that tricks Stata into doing the calculation for you by using Mata in order to spoof the Satorra-Bentler chi-square statistic in for the conventional. See the two lines of code underneath the "Quick-and-dirty" comment. A downside is that the RSMEA and CI are still labeled in the output as "Population error", although you can see that they're for the Satorra-Bentler estimator. **Be careful with this trickster approach, because it does mess up your esimation results!** In order to avoid accidentally using the altered estimation results for anything further, I recommend manually calculating the confidence bounds instead of spoofing Stata.

    .ÿ
    .ÿversionÿ17.0

    .ÿ
    .ÿclearÿ*

    .ÿ
    .ÿ//ÿseedem
    .ÿsetÿseedÿ1357025618

    .ÿ
    .ÿtempnameÿBlockÿOffÿCorrÿMÿS

    .ÿmatrixÿdefineÿ`Block'ÿ=ÿJ(3,ÿ3,ÿ0.5)ÿ+ÿI(3)ÿ*ÿ0.5

    .ÿmatrixÿdefineÿ`Off'ÿ=ÿJ(3,ÿ3,ÿ0.475)

    .ÿmatrixÿdefineÿ`Corr'ÿ=ÿ(`Block',ÿ`Off')ÿ\ÿ(`Off',ÿ`Block')

    .ÿmatrixÿdefineÿ`M'ÿ=ÿJ(1,ÿ6,ÿ100)

    .ÿmatrixÿdefineÿ`S'ÿ=ÿJ(1,ÿ6,ÿ16)

    .ÿquietlyÿdrawnormÿy1ÿy2ÿy3ÿy4ÿy5ÿy6,ÿdoubleÿ///
    >ÿÿÿÿÿÿÿÿÿmeans(`M')ÿsd(`S')ÿcorr(`Corr')ÿn(300)

    .ÿforeachÿvarÿofÿvarlistÿ_allÿ{
    ÿÿ2.ÿÿÿÿÿÿÿÿÿquietlyÿreplaceÿ`var'ÿ=ÿround(`var')
    ÿÿ3.ÿ}

    .ÿ
    .ÿsemÿ(y?ÿ<-ÿF),ÿvce(sbentler)ÿnocnsreportÿnodescribeÿnolog

    StructuralÿequationÿmodelÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿ=ÿ300
    Estimationÿmethod:ÿml

    Logÿpseudolikelihoodÿ=ÿ-7222.9632

    ------------------------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿSatorra–Bentler
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿCoefficientÿÿstd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
    -------------+----------------------------------------------------------------
    Measurementÿÿ|
    ÿÿy1ÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ101.0833ÿÿÿ.9011384ÿÿÿ112.17ÿÿÿ0.000ÿÿÿÿÿ99.31713ÿÿÿÿ102.8495
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿy2ÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿ1.157658ÿÿÿ.1103212ÿÿÿÿ10.49ÿÿÿ0.000ÿÿÿÿÿ.9414325ÿÿÿÿ1.373884
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ100.9867ÿÿÿ.9600838ÿÿÿ105.19ÿÿÿ0.000ÿÿÿÿÿ99.10494ÿÿÿÿ102.8684
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿy3ÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿ.9318024ÿÿÿ.1097256ÿÿÿÿÿ8.49ÿÿÿ0.000ÿÿÿÿÿ.7167442ÿÿÿÿ1.146861
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿÿÿÿ99.83ÿÿÿ.8929448ÿÿÿ111.80ÿÿÿ0.000ÿÿÿÿÿ98.07986ÿÿÿÿ101.5801
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿy4ÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿ1.098116ÿÿÿ.1039892ÿÿÿÿ10.56ÿÿÿ0.000ÿÿÿÿÿ.8943007ÿÿÿÿ1.301931
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ100.7733ÿÿÿ.8981126ÿÿÿ112.21ÿÿÿ0.000ÿÿÿÿÿ99.01306ÿÿÿÿ102.5336
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿy5ÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿ1.006233ÿÿÿ.0999125ÿÿÿÿ10.07ÿÿÿ0.000ÿÿÿÿÿÿ.810408ÿÿÿÿ1.202058
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ100.3033ÿÿÿÿ.899135ÿÿÿ111.56ÿÿÿ0.000ÿÿÿÿÿ98.54106ÿÿÿÿ102.0656
    ÿÿ-----------+----------------------------------------------------------------
    ÿÿy6ÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿ1.063391ÿÿÿ.1039853ÿÿÿÿ10.23ÿÿÿ0.000ÿÿÿÿÿ.8595836ÿÿÿÿ1.267199
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ100.4733ÿÿÿ.9118616ÿÿÿ110.18ÿÿÿ0.000ÿÿÿÿÿ98.68612ÿÿÿÿ102.2605
    -------------+----------------------------------------------------------------
    ÿÿÿÿvar(e.y1)|ÿÿÿ136.6038ÿÿÿ11.81293ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ115.3066ÿÿÿÿ161.8345
    ÿÿÿÿvar(e.y2)|ÿÿÿ133.2811ÿÿÿ13.60011ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ109.1217ÿÿÿÿ162.7893
    ÿÿÿÿvar(e.y3)|ÿÿÿ146.1996ÿÿÿ13.80961ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ121.491ÿÿÿÿ175.9334
    ÿÿÿÿvar(e.y4)|ÿÿÿÿ113.114ÿÿÿ10.92115ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ93.61226ÿÿÿÿ136.6784
    ÿÿÿÿvar(e.y5)|ÿÿÿ134.1973ÿÿÿ12.21223ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ112.2749ÿÿÿÿ160.4002
    ÿÿÿÿvar(e.y6)|ÿÿÿ128.5257ÿÿÿ12.16842ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ106.7581ÿÿÿÿ154.7317
    ÿÿÿÿÿÿÿvar(F)|ÿÿÿ106.1993ÿÿÿ16.77594ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ77.92204ÿÿÿÿ144.7382
    ------------------------------------------------------------------------------
    LRÿtestÿofÿmodelÿvs.ÿsaturated:ÿchi2(9)ÿ=ÿ19.58ÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿ0.0207
    Satorra–Bentlerÿscaledÿtest:ÿÿÿÿchi2(9)ÿ=ÿ20.86ÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿ0.0133

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

    ----------------------------------------------------------------------------
    Fitÿstatisticÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿValueÿÿÿDescription
    ---------------------+------------------------------------------------------
    Populationÿerrorÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRMSEAÿ|ÿÿÿÿÿÿ0.063ÿÿÿRootÿmeanÿsquaredÿerrorÿofÿapproximation
    ÿ90%ÿCI,ÿlowerÿboundÿ|ÿÿÿÿÿÿ0.023
    ÿÿÿÿÿÿÿÿÿupperÿboundÿ|ÿÿÿÿÿÿ0.101
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿpcloseÿ|ÿÿÿÿÿÿ0.254ÿÿÿProbabilityÿRMSEAÿ<=ÿ0.05
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
    ÿÿSatorra–Bentlerÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿÿRMSEA_SBÿ|ÿÿÿÿÿÿ0.066ÿÿÿRootÿmeanÿsquaredÿerrorÿofÿapproximation
    ---------------------+------------------------------------------------------
    Baselineÿcomparisonÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿCFIÿ|ÿÿÿÿÿÿ0.982ÿÿÿComparativeÿfitÿindex
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTLIÿ|ÿÿÿÿÿÿ0.970ÿÿÿTucker–Lewisÿindex
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
    ÿÿSatorra–Bentlerÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿCFI_SBÿ|ÿÿÿÿÿÿ0.980ÿÿÿComparativeÿfitÿindex
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿTLI_SBÿ|ÿÿÿÿÿÿ0.967ÿÿÿTucker–Lewisÿindex
    ----------------------------------------------------------------------------

    .ÿ
    .ÿ*
    .ÿ*ÿBeginÿhere
    .ÿ*
    .ÿdisplayÿinÿsmclÿasÿtextÿ_newline(1)ÿ"Satorra-Bentlerÿ90%ÿCI,ÿlowerÿboundÿ=ÿ"ÿ///
    >ÿÿÿÿÿÿÿÿÿasÿresultÿ%05.3fÿ///
    >ÿÿÿÿÿÿÿÿÿsqrt(npnchi2(e(df_ms),ÿe(chi2sb_ms),ÿ0.95)ÿ/ÿ(e(N)ÿ-ÿ1)ÿ/ÿe(df_ms))

    Satorra-Bentlerÿ90%ÿCI,ÿlowerÿboundÿ=ÿ0.029

    .ÿdisplayÿinÿsmclÿasÿtextÿ_newline(1)ÿ"Satorra-Bentlerÿ90%ÿCI,ÿupperÿboundÿ=ÿ"ÿ///
    >ÿÿÿÿÿÿÿÿÿasÿresultÿ%05.3fÿ///
    >ÿÿÿÿÿÿÿÿÿsqrt(npnchi2(e(df_ms),ÿe(chi2sb_ms),ÿ0.05)ÿ/ÿ(e(N)ÿ-ÿ1)ÿ/ÿe(df_ms))

    Satorra-Bentlerÿ90%ÿCI,ÿupperÿboundÿ=ÿ0.104

    .ÿ
    .ÿ//ÿQuick-and-dirty
    .ÿmata:ÿst_numscalar("e(chi2_ms)",ÿst_numscalar("e(chi2sb_ms)"))

    .ÿestatÿgof,ÿstats(rmsea)

    ----------------------------------------------------------------------------
    Fitÿstatisticÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿValueÿÿÿDescription
    ---------------------+------------------------------------------------------
    Populationÿerrorÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRMSEAÿ|ÿÿÿÿÿÿ0.066ÿÿÿRootÿmeanÿsquaredÿerrorÿofÿapproximation
    ÿ90%ÿCI,ÿlowerÿboundÿ|ÿÿÿÿÿÿ0.029
    ÿÿÿÿÿÿÿÿÿupperÿboundÿ|ÿÿÿÿÿÿ0.104
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿpcloseÿ|ÿÿÿÿÿÿ0.205ÿÿÿProbabilityÿRMSEAÿ<=ÿ0.05
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
    ÿÿSatorra–Bentlerÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿÿRMSEA_SBÿ|ÿÿÿÿÿÿ0.066ÿÿÿRootÿmeanÿsquaredÿerrorÿofÿapproximation
    ----------------------------------------------------------------------------

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .

    Comment


    • #3
      Thank you so much Joseph! This worked great!

      In regard to the Quick-and-dirty code, if I re-run the original sem equation prior to any further calculations, will this fix the issue of messing up estimation results for further commands?

      Comment


      • #4
        Originally posted by Joseph Coveney View Post
        I'm not sure why Stata doesn't produce it, but you can calculate it manually using formulas shown here (scroll down to the bullet point named "RMSEA index" under the section titled, "Parsimony Indices") in conjunction with Stata's function for the noncentrality parameter of the noncentral chi-square distribution, npnchi2().

        I show how below in a worked example (the manual calculation begins at the "Begin here" comment; the stuff above it is to create a toy dataset and fit a confirmatory factor analysis model to it for illustration).

        Below that, I also show an easy, lazy method that tricks Stata into doing the calculation for you by using Mata in order to spoof the Satorra-Bentler chi-square statistic in for the conventional. See the two lines of code underneath the "Quick-and-dirty" comment. A downside is that the RSMEA and CI are still labeled in the output as "Population error", although you can see that they're for the Satorra-Bentler estimator. **Be careful with this trickster approach, because it does mess up your esimation results!** In order to avoid accidentally using the altered estimation results for anything further, I recommend manually calculating the confidence bounds instead of spoofing Stata.

        .ÿ
        .ÿversionÿ17.0

        .ÿ
        .ÿclearÿ*

        .ÿ
        .ÿ//ÿseedem
        .ÿsetÿseedÿ1357025618

        .ÿ
        .ÿtempnameÿBlockÿOffÿCorrÿMÿS

        .ÿmatrixÿdefineÿ`Block'ÿ=ÿJ(3,ÿ3,ÿ0.5)ÿ+ÿI(3)ÿ*ÿ0.5

        .ÿmatrixÿdefineÿ`Off'ÿ=ÿJ(3,ÿ3,ÿ0.475)

        .ÿmatrixÿdefineÿ`Corr'ÿ=ÿ(`Block',ÿ`Off')ÿ\ÿ(`Off',ÿ`Block')

        .ÿmatrixÿdefineÿ`M'ÿ=ÿJ(1,ÿ6,ÿ100)

        .ÿmatrixÿdefineÿ`S'ÿ=ÿJ(1,ÿ6,ÿ16)

        .ÿquietlyÿdrawnormÿy1ÿy2ÿy3ÿy4ÿy5ÿy6,ÿdoubleÿ///
        >ÿÿÿÿÿÿÿÿÿmeans(`M')ÿsd(`S')ÿcorr(`Corr')ÿn(300)

        .ÿforeachÿvarÿofÿvarlistÿ_allÿ{
        ÿÿ2.ÿÿÿÿÿÿÿÿÿquietlyÿreplaceÿ`var'ÿ=ÿround(`var')
        ÿÿ3.ÿ}

        .ÿ
        .ÿsemÿ(y?ÿ<-ÿF),ÿvce(sbentler)ÿnocnsreportÿnodescribeÿnolog

        StructuralÿequationÿmodelÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿ=ÿ300
        Estimationÿmethod:ÿml

        Logÿpseudolikelihoodÿ=ÿ-7222.9632

        ------------------------------------------------------------------------------
        ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿSatorra–Bentler
        ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿCoefficientÿÿstd.ÿerr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿconf.ÿinterval]
        -------------+----------------------------------------------------------------
        Measurementÿÿ|
        ÿÿy1ÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿ(constrained)
        ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ101.0833ÿÿÿ.9011384ÿÿÿ112.17ÿÿÿ0.000ÿÿÿÿÿ99.31713ÿÿÿÿ102.8495
        ÿÿ-----------+----------------------------------------------------------------
        ÿÿy2ÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿ1.157658ÿÿÿ.1103212ÿÿÿÿ10.49ÿÿÿ0.000ÿÿÿÿÿ.9414325ÿÿÿÿ1.373884
        ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ100.9867ÿÿÿ.9600838ÿÿÿ105.19ÿÿÿ0.000ÿÿÿÿÿ99.10494ÿÿÿÿ102.8684
        ÿÿ-----------+----------------------------------------------------------------
        ÿÿy3ÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿ.9318024ÿÿÿ.1097256ÿÿÿÿÿ8.49ÿÿÿ0.000ÿÿÿÿÿ.7167442ÿÿÿÿ1.146861
        ÿÿÿÿÿÿÿ_consÿ|ÿÿÿÿÿÿ99.83ÿÿÿ.8929448ÿÿÿ111.80ÿÿÿ0.000ÿÿÿÿÿ98.07986ÿÿÿÿ101.5801
        ÿÿ-----------+----------------------------------------------------------------
        ÿÿy4ÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿ1.098116ÿÿÿ.1039892ÿÿÿÿ10.56ÿÿÿ0.000ÿÿÿÿÿ.8943007ÿÿÿÿ1.301931
        ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ100.7733ÿÿÿ.8981126ÿÿÿ112.21ÿÿÿ0.000ÿÿÿÿÿ99.01306ÿÿÿÿ102.5336
        ÿÿ-----------+----------------------------------------------------------------
        ÿÿy5ÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿ1.006233ÿÿÿ.0999125ÿÿÿÿ10.07ÿÿÿ0.000ÿÿÿÿÿÿ.810408ÿÿÿÿ1.202058
        ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ100.3033ÿÿÿÿ.899135ÿÿÿ111.56ÿÿÿ0.000ÿÿÿÿÿ98.54106ÿÿÿÿ102.0656
        ÿÿ-----------+----------------------------------------------------------------
        ÿÿy6ÿÿÿÿÿÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿÿÿFÿ|ÿÿÿ1.063391ÿÿÿ.1039853ÿÿÿÿ10.23ÿÿÿ0.000ÿÿÿÿÿ.8595836ÿÿÿÿ1.267199
        ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ100.4733ÿÿÿ.9118616ÿÿÿ110.18ÿÿÿ0.000ÿÿÿÿÿ98.68612ÿÿÿÿ102.2605
        -------------+----------------------------------------------------------------
        ÿÿÿÿvar(e.y1)|ÿÿÿ136.6038ÿÿÿ11.81293ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ115.3066ÿÿÿÿ161.8345
        ÿÿÿÿvar(e.y2)|ÿÿÿ133.2811ÿÿÿ13.60011ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ109.1217ÿÿÿÿ162.7893
        ÿÿÿÿvar(e.y3)|ÿÿÿ146.1996ÿÿÿ13.80961ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ121.491ÿÿÿÿ175.9334
        ÿÿÿÿvar(e.y4)|ÿÿÿÿ113.114ÿÿÿ10.92115ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ93.61226ÿÿÿÿ136.6784
        ÿÿÿÿvar(e.y5)|ÿÿÿ134.1973ÿÿÿ12.21223ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ112.2749ÿÿÿÿ160.4002
        ÿÿÿÿvar(e.y6)|ÿÿÿ128.5257ÿÿÿ12.16842ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ106.7581ÿÿÿÿ154.7317
        ÿÿÿÿÿÿÿvar(F)|ÿÿÿ106.1993ÿÿÿ16.77594ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ77.92204ÿÿÿÿ144.7382
        ------------------------------------------------------------------------------
        LRÿtestÿofÿmodelÿvs.ÿsaturated:ÿchi2(9)ÿ=ÿ19.58ÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿ0.0207
        Satorra–Bentlerÿscaledÿtest:ÿÿÿÿchi2(9)ÿ=ÿ20.86ÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿ0.0133

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

        ----------------------------------------------------------------------------
        Fitÿstatisticÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿValueÿÿÿDescription
        ---------------------+------------------------------------------------------
        Populationÿerrorÿÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRMSEAÿ|ÿÿÿÿÿÿ0.063ÿÿÿRootÿmeanÿsquaredÿerrorÿofÿapproximation
        ÿ90%ÿCI,ÿlowerÿboundÿ|ÿÿÿÿÿÿ0.023
        ÿÿÿÿÿÿÿÿÿupperÿboundÿ|ÿÿÿÿÿÿ0.101
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿpcloseÿ|ÿÿÿÿÿÿ0.254ÿÿÿProbabilityÿRMSEAÿ<=ÿ0.05
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
        ÿÿSatorra–Bentlerÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿÿÿÿRMSEA_SBÿ|ÿÿÿÿÿÿ0.066ÿÿÿRootÿmeanÿsquaredÿerrorÿofÿapproximation
        ---------------------+------------------------------------------------------
        Baselineÿcomparisonÿÿ|
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿCFIÿ|ÿÿÿÿÿÿ0.982ÿÿÿComparativeÿfitÿindex
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿTLIÿ|ÿÿÿÿÿÿ0.970ÿÿÿTucker–Lewisÿindex
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
        ÿÿSatorra–Bentlerÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿCFI_SBÿ|ÿÿÿÿÿÿ0.980ÿÿÿComparativeÿfitÿindex
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿTLI_SBÿ|ÿÿÿÿÿÿ0.967ÿÿÿTucker–Lewisÿindex
        ----------------------------------------------------------------------------

        .ÿ
        .ÿ*
        .ÿ*ÿBeginÿhere
        .ÿ*
        .ÿdisplayÿinÿsmclÿasÿtextÿ_newline(1)ÿ"Satorra-Bentlerÿ90%ÿCI,ÿlowerÿboundÿ=ÿ"ÿ///
        >ÿÿÿÿÿÿÿÿÿasÿresultÿ%05.3fÿ///
        >ÿÿÿÿÿÿÿÿÿsqrt(npnchi2(e(df_ms),ÿe(chi2sb_ms),ÿ0.95)ÿ/ÿ(e(N)ÿ-ÿ1)ÿ/ÿe(df_ms))

        Satorra-Bentlerÿ90%ÿCI,ÿlowerÿboundÿ=ÿ0.029

        .ÿdisplayÿinÿsmclÿasÿtextÿ_newline(1)ÿ"Satorra-Bentlerÿ90%ÿCI,ÿupperÿboundÿ=ÿ"ÿ///
        >ÿÿÿÿÿÿÿÿÿasÿresultÿ%05.3fÿ///
        >ÿÿÿÿÿÿÿÿÿsqrt(npnchi2(e(df_ms),ÿe(chi2sb_ms),ÿ0.05)ÿ/ÿ(e(N)ÿ-ÿ1)ÿ/ÿe(df_ms))

        Satorra-Bentlerÿ90%ÿCI,ÿupperÿboundÿ=ÿ0.104

        .ÿ
        .ÿ//ÿQuick-and-dirty
        .ÿmata:ÿst_numscalar("e(chi2_ms)",ÿst_numscalar("e(chi2sb_ms)"))

        .ÿestatÿgof,ÿstats(rmsea)

        ----------------------------------------------------------------------------
        Fitÿstatisticÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿValueÿÿÿDescription
        ---------------------+------------------------------------------------------
        Populationÿerrorÿÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRMSEAÿ|ÿÿÿÿÿÿ0.066ÿÿÿRootÿmeanÿsquaredÿerrorÿofÿapproximation
        ÿ90%ÿCI,ÿlowerÿboundÿ|ÿÿÿÿÿÿ0.029
        ÿÿÿÿÿÿÿÿÿupperÿboundÿ|ÿÿÿÿÿÿ0.104
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿpcloseÿ|ÿÿÿÿÿÿ0.205ÿÿÿProbabilityÿRMSEAÿ<=ÿ0.05
        ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
        ÿÿSatorra–Bentlerÿÿÿÿ|
        ÿÿÿÿÿÿÿÿÿÿÿÿRMSEA_SBÿ|ÿÿÿÿÿÿ0.066ÿÿÿRootÿmeanÿsquaredÿerrorÿofÿapproximation
        ----------------------------------------------------------------------------

        .ÿ
        .ÿexit

        endÿofÿdo-file


        .


        Thank you so much Joseph! This worked great!

        In regard to the Quick-and-dirty code, if I re-run the original sem equation prior to any further calculations, will this fix the issue of messing up estimation results for further commands?

        Comment


        • #5
          Originally posted by Sarah Purnell View Post
          In regard to the Quick-and-dirty code, if I re-run the original sem equation prior to any further calculations, will this fix the issue of messing up estimation results for further commands?
          It should, yes.

          And after re-fitting the SEM, you can verify that the "Population error" chi-square test statistic is the correct one by re-issuing the estat gof, stats(rmsea) command.

          Comment

          Working...
          X