Announcement

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

  • Comparison between mvreg, sureg, and sem

    When working on some data, I came across the question of comparing mvreg, sureg and gsem. I briefly summarize the comparisons before putting my questions. Please correct if my understanding is wrong. Thank you!
    • mvreg and sureg give the same coefficients but different standard errors. mvreg can only be used for the same set of independent vars while sureg can be used for models with different sets of independent vars.
    • Both mvreg and sureg don't allow robust se or coexistence of linear and nonlinear models, but gsem allows those.
    • The coefficients and se are both different between sureg and gsem (when gsem don't specify robust se or include nonlinear models).
    My questions are:
    1. In the case of a same set of independent vars and different dependent vars, is the difference of se between mvreg and sureg because sureg considers the correlation between the dependent vars when computing se?
    2. I wonder what makes the differences of coefficients and se between sureg and gsem (in the same case as above and gsem doesn't specify robust se or include nonlinear models)? Are those because gsem considers a simultaneous covariance matrix when computing the vector of parameters and the se?

  • #2
    Originally posted by Xiaogeng Xu View Post
    1. . . . is the difference of se between mvreg and sureg because sureg considers the correlation between the dependent vars when computing se?
    I think that if you use the small-sample option for sureg, then you get the same coefficient standard errors. See the first part below where the regression coefficients and their standard errors are compared side-by-side.

    The test statistics might differ, because the latter uses different degrees of freedom, but when the degrees of freedom match, then test statistics, too, match. See the example with the Wald test of the middle age group by both methods. (Beneath the comparison table.)

    2. I wonder what makes the differences of coefficients and se between sureg and gsem . . .?
    Those, too, are the same when large-sample statistics are specified for sureg. See the second part below where again the regression coefficients and their standard errors are compared side-by-side. Again, the test statistics are the same. (Beneath the second comparison table.)

    Are those because gsem considers a simultaneous covariance matrix when computing the vector of parameters and the se?
    I don't know what you mean by "simultaneous covariance matrix", but with gsem, you do need to specify an unstructured covariance structure for the residuals in order to specify a multivariate regression model; I think that the default is independent.

    .ÿ
    .ÿversionÿ17.0

    .ÿ
    .ÿclearÿ*

    .ÿ
    .ÿquietlyÿsysuseÿbpwide

    .ÿ
    .ÿ*
    .ÿ*ÿSmall-sampleÿstatistics
    .ÿ*
    .ÿquietlyÿmvregÿbp_*ÿ=ÿi.(sexÿagegrp),ÿnoheader

    .ÿestimatesÿstoreÿmvreg

    .ÿ
    .ÿquietlyÿsuregÿ(bp_*ÿ=ÿi.(sexÿagegrp)),ÿisureÿsmallÿdfkÿnoheaderÿnolog

    .ÿestimatesÿstoreÿsureg

    .ÿ
    .ÿetable,ÿestimates(mvregÿsureg)ÿshoweqÿcolumn(command)

    --------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmvregÿÿÿsuregÿ
    --------------------------------------
    Beforeÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
    ÿÿSexÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
    ÿÿÿÿFemaleÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-5.633ÿÿ-5.633
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(1.857)ÿ(1.857)
    ÿÿAgeÿgroupÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
    ÿÿÿÿ46-59ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ3.425ÿÿÿ3.425
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(2.274)ÿ(2.274)
    ÿÿÿÿ60+ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ10.900ÿÿ10.900
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(2.274)ÿ(2.274)
    ÿÿInterceptÿÿÿÿÿÿÿÿÿÿÿÿ154.492ÿ154.492
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(1.857)ÿ(1.857)
    Afterÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
    ÿÿSexÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
    ÿÿÿÿFemaleÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-8.317ÿÿ-8.317
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(2.245)ÿ(2.245)
    ÿÿAgeÿgroupÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
    ÿÿÿÿ46-59ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ6.450ÿÿÿ6.450
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(2.749)ÿ(2.749)
    ÿÿÿÿ60+ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ14.650ÿÿ14.650
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(2.749)ÿ(2.749)
    ÿÿInterceptÿÿÿÿÿÿÿÿÿÿÿÿ148.483ÿ148.483
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(2.245)ÿ(2.245)
    Numberÿofÿobservationsÿÿÿÿÿ120ÿÿÿÿÿ120
    --------------------------------------

    .ÿ
    .ÿ//ÿSameÿtestÿstatisticsÿ(whenÿresidualÿdegreesÿofÿfreedomÿmatch)
    .ÿquietlyÿestimatesÿrestoreÿmvreg

    .ÿtestÿ2.agegrp

    ÿ(ÿ1)ÿÿ[bp_before]2.agegrpÿ=ÿ0
    ÿ(ÿ2)ÿÿ[bp_after]2.agegrpÿ=ÿ0

    ÿÿÿÿÿÿÿF(ÿÿ2,ÿÿÿ116)ÿ=ÿÿÿÿ4.33
    ÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿFÿ=ÿÿÿÿ0.0154

    .ÿlocalÿdfÿ=ÿr(df_r)

    .ÿ
    .ÿquietlyÿestimatesÿrestoreÿsureg

    .ÿtestÿ2.agegrp,ÿdf(`df')

    ÿ(ÿ1)ÿÿ[bp_before]2.agegrpÿ=ÿ0
    ÿ(ÿ2)ÿÿ[bp_after]2.agegrpÿ=ÿ0

    ÿÿÿÿÿÿÿF(ÿÿ2,ÿÿÿ116)ÿ=ÿÿÿÿ4.33
    ÿÿÿÿÿÿÿÿÿÿÿÿProbÿ>ÿFÿ=ÿÿÿÿ0.0154

    .ÿ
    .ÿ*
    .ÿ*ÿLarge-sampeÿ(asymptotic)ÿstatistics
    .ÿ*
    .ÿestimatesÿdropÿ_all

    .ÿ
    .ÿquietlyÿsuregÿ(bp_*ÿ=ÿi.(sexÿagegrp)),ÿisureÿnoheaderÿnolog

    .ÿestimatesÿstoreÿsureg

    .ÿ
    .ÿquietlyÿgsemÿ(bp_*ÿ<-ÿi.(sexÿagegrp)),ÿcovstructure(e._OEn,ÿunstructured)ÿ///
    >ÿÿÿÿÿÿÿÿÿnocnsreportÿnoheaderÿnolog

    .ÿestimatesÿstoreÿgsem

    .ÿ
    .ÿetable,ÿestimates(suregÿgsem)ÿshoweqÿcolumn(command)

    ----------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿsuregÿÿÿÿgsemÿÿ
    ----------------------------------------------
    Beforeÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
    ÿÿSexÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
    ÿÿÿÿFemaleÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-5.633ÿÿÿ-5.633
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(1.826)ÿÿ(1.826)
    ÿÿAgeÿgroupÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
    ÿÿÿÿ46-59ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ3.425ÿÿÿÿ3.425
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(2.236)ÿÿ(2.236)
    ÿÿÿÿ60+ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ10.900ÿÿÿ10.900
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(2.236)ÿÿ(2.236)
    ÿÿInterceptÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ154.492ÿÿ154.492
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(1.826)ÿÿ(1.826)
    Afterÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
    ÿÿSexÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
    ÿÿÿÿFemaleÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ-8.317ÿÿÿ-8.317
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(2.207)ÿÿ(2.207)
    ÿÿAgeÿgroupÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
    ÿÿÿÿ46-59ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ6.450ÿÿÿÿ6.450
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(2.703)ÿÿ(2.703)
    ÿÿÿÿ60+ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ14.650ÿÿÿ14.650
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(2.703)ÿÿ(2.703)
    ÿÿInterceptÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ148.483ÿÿ148.483
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(2.207)ÿÿ(2.207)
    /ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ
    ÿÿvar(e.bp_before)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ100.001
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(12.910)
    ÿÿvar(e.bp_after)ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ146.098
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(18.861)
    ÿÿcov(e.bp_before,e.bp_after)ÿÿÿÿÿÿÿÿÿÿ-13.240
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(11.100)
    Numberÿofÿobservationsÿÿÿÿÿÿÿÿÿÿÿÿ120ÿÿÿÿÿÿ120
    ----------------------------------------------

    .ÿ
    .ÿ//ÿSameÿtestÿstatistics
    .ÿquietlyÿestimatesÿrestoreÿsureg

    .ÿtestÿ2.agegrp

    ÿ(ÿ1)ÿÿ[bp_before]2.agegrpÿ=ÿ0
    ÿ(ÿ2)ÿÿ[bp_after]2.agegrpÿ=ÿ0

    ÿÿÿÿÿÿÿÿÿÿÿchi2(ÿÿ2)ÿ=ÿÿÿÿ8.95
    ÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿÿÿÿ0.0114

    .ÿ
    .ÿquietlyÿestimatesÿrestoreÿgsem

    .ÿtestÿ2.agegrp

    ÿ(ÿ1)ÿÿ[bp_before]2.agegrpÿ=ÿ0
    ÿ(ÿ2)ÿÿ[bp_after]2.agegrpÿ=ÿ0

    ÿÿÿÿÿÿÿÿÿÿÿchi2(ÿÿ2)ÿ=ÿÿÿÿ8.95
    ÿÿÿÿÿÿÿÿÿProbÿ>ÿchi2ÿ=ÿÿÿÿ0.0114

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .

    Comment


    • #3
      Joseph Coveney Thanks a lot for the reply! Now I understand better when the three methods are equivalent in Stata.

      Comment

      Working...
      X