Comparing Total MEs across models

Example 5.2.e of Mize and Han (2025): mediation/attenuation

Does the total effect of a college degree on self-rated health shrink once family income is in the model? Store the model without income and the model with it, and name both in models(): totalme reports the Total ME from each model and tests the difference.

use "https://tdmize.github.io/data/data/cda_gss", clear
(cda_gss.dta |  GSS 1972-2021 CDA - Categorical Data Analysis | date created 2023)
drop if missing(healthR, college, race4, age, woman, parent, married, faminc)
(22,943 observations deleted)
drop if year < 2000 | year > 2021
(26,611 observations deleted)

. 
mlogit healthR i.college i.race4 c.age i.woman i.parent i.married, vce(robust)
Iteration 0:  Log pseudolikelihood = -22624.777  
Iteration 1:  Log pseudolikelihood = -21801.971  
Iteration 2:  Log pseudolikelihood = -21756.528  
Iteration 3:  Log pseudolikelihood = -21756.104  
Iteration 4:  Log pseudolikelihood = -21756.104  

Multinomial logistic regression                        Number of obs =  19,292
                                                       Wald chi2(24) = 1511.84
                                                       Prob > chi2   =  0.0000
Log pseudolikelihood = -21756.104                      Pseudo R2     =  0.0384

---------------------------------------------------------------------------------
                |               Robust
        healthR | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
----------------+----------------------------------------------------------------
Poor            |
        college |
College Degree  |     -1.345      0.106  -12.732   0.000       -1.552      -1.138
                |
          race4 |
         Black  |      0.037      0.099    0.378   0.706       -0.156       0.231
         Other  |      0.292      0.175    1.664   0.096       -0.052       0.635
      Hispanic  |      0.092      0.115    0.804   0.421       -0.133       0.317
                |
            age |      0.029      0.002   15.258   0.000        0.025       0.033
                |
          woman |
         Women  |      0.065      0.071    0.928   0.353       -0.073       0.204
                |
         parent |
        Parent  |      0.090      0.092    0.976   0.329       -0.090       0.270
                |
        married |
       Married  |     -0.659      0.076   -8.691   0.000       -0.808      -0.511
          _cons |     -3.339      0.120  -27.898   0.000       -3.574      -3.105
----------------+----------------------------------------------------------------
Fair            |
        college |
College Degree  |     -0.745      0.049  -15.208   0.000       -0.842      -0.649
                |
          race4 |
         Black  |      0.255      0.056    4.534   0.000        0.145       0.366
         Other  |      0.223      0.099    2.243   0.025        0.028       0.418
      Hispanic  |      0.397      0.060    6.584   0.000        0.279       0.515
                |
            age |      0.014      0.001   11.088   0.000        0.011       0.016
                |
          woman |
         Women  |      0.010      0.040    0.263   0.793       -0.067       0.088
                |
         parent |
        Parent  |     -0.034      0.050   -0.675   0.499       -0.131       0.064
                |
        married |
       Married  |     -0.296      0.042   -7.042   0.000       -0.379      -0.214
          _cons |     -1.355      0.071  -19.011   0.000       -1.495      -1.215
----------------+----------------------------------------------------------------
Good            |  (base outcome)
----------------+----------------------------------------------------------------
Excellent       |
        college |
College Degree  |      0.450      0.037   12.030   0.000        0.376       0.523
                |
          race4 |
         Black  |     -0.198      0.056   -3.541   0.000       -0.308      -0.089
         Other  |     -0.330      0.091   -3.633   0.000       -0.508      -0.152
      Hispanic  |     -0.172      0.060   -2.863   0.004       -0.289      -0.054
                |
            age |     -0.011      0.001   -9.189   0.000       -0.013      -0.008
                |
          woman |
         Women  |      0.043      0.036    1.214   0.225       -0.027       0.113
                |
         parent |
        Parent  |     -0.134      0.043   -3.103   0.002       -0.219      -0.049
                |
        married |
       Married  |      0.183      0.038    4.810   0.000        0.108       0.257
          _cons |     -0.262      0.062   -4.245   0.000       -0.383      -0.141
---------------------------------------------------------------------------------
est store basemod
. 
mlogit healthR i.college i.race4 c.age i.woman i.parent i.married c.faminc, vce(robust)
Iteration 0:  Log pseudolikelihood = -22624.777  
Iteration 1:  Log pseudolikelihood =  -21613.16  
Iteration 2:  Log pseudolikelihood = -21511.395  
Iteration 3:  Log pseudolikelihood =  -21504.44  
Iteration 4:  Log pseudolikelihood = -21504.414  
Iteration 5:  Log pseudolikelihood = -21504.414  

Multinomial logistic regression                        Number of obs =  19,292
                                                       Wald chi2(27) = 1574.72
                                                       Prob > chi2   =  0.0000
Log pseudolikelihood = -21504.414                      Pseudo R2     =  0.0495

---------------------------------------------------------------------------------
                |               Robust
        healthR | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
----------------+----------------------------------------------------------------
Poor            |
        college |
College Degree  |     -0.906      0.110   -8.257   0.000       -1.121      -0.691
                |
          race4 |
         Black  |     -0.120      0.099   -1.211   0.226       -0.315       0.074
         Other  |      0.237      0.176    1.352   0.176       -0.107       0.581
      Hispanic  |     -0.055      0.115   -0.475   0.635       -0.281       0.171
                |
            age |      0.026      0.002   14.021   0.000        0.022       0.029
                |
          woman |
         Women  |     -0.022      0.071   -0.311   0.756       -0.162       0.118
                |
         parent |
        Parent  |      0.121      0.092    1.313   0.189       -0.060       0.301
                |
        married |
       Married  |     -0.247      0.086   -2.883   0.004       -0.415      -0.079
         faminc |     -0.030      0.004   -7.730   0.000       -0.038      -0.022
          _cons |     -2.646      0.135  -19.648   0.000       -2.910      -2.382
----------------+----------------------------------------------------------------
Fair            |
        college |
College Degree  |     -0.567      0.051  -11.130   0.000       -0.667      -0.467
                |
          race4 |
         Black  |      0.191      0.056    3.385   0.001        0.080       0.301
         Other  |      0.219      0.101    2.176   0.030        0.022       0.416
      Hispanic  |      0.339      0.060    5.607   0.000        0.220       0.457
                |
            age |      0.013      0.001   10.461   0.000        0.010       0.015
                |
          woman |
         Women  |     -0.027      0.040   -0.681   0.496       -0.105       0.051
                |
         parent |
        Parent  |     -0.022      0.050   -0.447   0.655       -0.120       0.075
                |
        married |
       Married  |     -0.141      0.045   -3.146   0.002       -0.228      -0.053
         faminc |     -0.009      0.001   -9.153   0.000       -0.011      -0.007
          _cons |     -1.118      0.074  -15.021   0.000       -1.264      -0.972
----------------+----------------------------------------------------------------
Good            |  (base outcome)
----------------+----------------------------------------------------------------
Excellent       |
        college |
College Degree  |      0.331      0.040    8.318   0.000        0.253       0.409
                |
          race4 |
         Black  |     -0.152      0.056   -2.696   0.007       -0.262      -0.041
         Other  |     -0.340      0.091   -3.719   0.000       -0.519      -0.161
      Hispanic  |     -0.134      0.060   -2.225   0.026       -0.251      -0.016
                |
            age |     -0.011      0.001   -8.967   0.000       -0.013      -0.008
                |
          woman |
         Women  |      0.072      0.036    2.004   0.045        0.002       0.143
                |
         parent |
        Parent  |     -0.148      0.043   -3.407   0.001       -0.233      -0.063
                |
        married |
       Married  |      0.076      0.040    1.925   0.054       -0.001       0.154
         faminc |      0.005      0.000    9.788   0.000        0.004       0.006
          _cons |     -0.376      0.064   -5.915   0.000       -0.501      -0.252
---------------------------------------------------------------------------------
est store medmod
. 
totalme college, models(basemod medmod)
Total ME Estimates (N_basemod = 19292 , N_medmod = 19292)

                         |   Estimate   Std. err.           z       P>|z| 
-------------------------+-----------------------------------------------
college                  |                                               
       Model 1 (basemod) |      0.159       0.006      26.338       0.000 
        Model 2 (medmod) |      0.118       0.007      17.514       0.000 
       Cross-Model Diff. |      0.041       0.003      15.006       0.000 

The Difference row is the part of the total college effect that family income accounts for, with its standard error.

Back to top