Announcement

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

  • Gologit2 with factorial variables interaction: operator # vs xi: prefix for using margins

    Dear Statalisters,

    For my dissertation a have a database of 1575 individuals from a gender attitudes survey. My dependent variable is "Attitudes on maternity leave", with three categories (Too long = 0, Long enough = Too short = 2). My independent variables are also categorical (sociodemographic or attitude scales). The main explanatory variable is sex, which is interacted with a dummy for having had children.

    I'm running a generalized ordinal logit regression since I have evidence from omodel, brant and the autofit option that not all variables satisfy the parallel lines (PL) assumption. However, I'd like to use margins to help interpretation, and this is where I ran into trouble.

    I know margins requires that factor variables be identified by the i. prefix in the regression command, but I am getting different results from estimating the model using the full factorial operator (##) and the xi: prefix to create the interaction between the "sex" and "having children" dummies. I want both the main effects of the two variables and its interaction to be in the model. Here are the results for both options:

    With the xi prefix:

    Code:
    . xi: gologit2 att_maternity_leave i.sex*i.children i.occupation i.agegroup i.educ_lvl ///
    > i.hh_income i.personal_income i.nonwhite i.att_male_breadwinner i.religion_sub, or autofit(0.05)
    i.sex             _Isex_0-1           (naturally coded; _Isex_0 omitted)
    i.children        _Ichildren_0-1      (naturally coded; _Ichildren_0 omitted)
    i.sex*i.child~n   _IsexXchi_#_#       (coded as above)
    i.occupation      _Ioccupatio_1-4     (naturally coded; _Ioccupatio_3 omitted)
    i.agegroup        _Iagegroup_1-4      (naturally coded; _Iagegroup_4 omitted)
    i.educ_lvl        _Ieduc_lvl_1-4      (naturally coded; _Ieduc_lvl_1 omitted)
    i.hh_income       _Ihh_income_0-1     (naturally coded; _Ihh_income_0 omitted)
    i.personal_in~e   _Ipersonal__0-1     (naturally coded; _Ipersonal__0 omitted)
    i.nonwhite        _Inonwhite_0-1      (naturally coded; _Inonwhite_0 omitted)
    i.att_male_br~r   _Iatt_male__0-1     (naturally coded; _Iatt_male__0 omitted)
    i.religion_sub    _Ireligion__0-3     (naturally coded; _Ireligion__0 omitted)
    
    ------------------------------------------------------------------------------
    Testing parallel lines assumption using the .05 level of significance...
    
    [output omitted]
    
    Step  17: Constraints for parallel lines are not imposed for
              _Isex_1 (P Value = 0.03197)
              _Ioccupatio_4 (P Value = 0.00242)
              _Iatt_male__1 (P Value = 0.04947)
    
    Wald test of parallel lines assumption for the final model:
    
    [output omitted]
    
               chi2( 16) =   12.99
             Prob > chi2 =    0.6734
    
    [output omitted]
    
    ------------------------------------------------------------------------------
    
    Generalized Ordered Logit Estimates             Number of obs     =      1,218
                                                    LR chi2(22)       =     127.00
                                                    Prob > chi2       =     0.0000
    Log likelihood = -852.76406                     Pseudo R2         =     0.0693
    
     ( 1)  [Too_long]_Ihh_income_1 - [Long_enough]_Ihh_income_1 = 0
     ( 2)  [Too_long]_Ireligion__1 - [Long_enough]_Ireligion__1 = 0
     ( 3)  [Too_long]_Iagegroup_3 - [Long_enough]_Iagegroup_3 = 0
     ( 4)  [Too_long]_Ioccupatio_1 - [Long_enough]_Ioccupatio_1 = 0
     ( 5)  [Too_long]_Ichildren_1 - [Long_enough]_Ichildren_1 = 0
     ( 6)  [Too_long]_Ireligion__3 - [Long_enough]_Ireligion__3 = 0
     ( 7)  [Too_long]_Ipersonal__1 - [Long_enough]_Ipersonal__1 = 0
     ( 8)  [Too_long]_Ieduc_lvl_4 - [Long_enough]_Ieduc_lvl_4 = 0
     ( 9)  [Too_long]_Ireligion__2 - [Long_enough]_Ireligion__2 = 0
     (10)  [Too_long]_IsexXchi_1_1 - [Long_enough]_IsexXchi_1_1 = 0
     (11)  [Too_long]_Iagegroup_2 - [Long_enough]_Iagegroup_2 = 0
     (12)  [Too_long]_Ieduc_lvl_3 - [Long_enough]_Ieduc_lvl_3 = 0
     (13)  [Too_long]_Ieduc_lvl_2 - [Long_enough]_Ieduc_lvl_2 = 0
     (14)  [Too_long]_Ioccupatio_2 - [Long_enough]_Ioccupatio_2 = 0
     (15)  [Too_long]_Iagegroup_1 - [Long_enough]_Iagegroup_1 = 0
     (16)  [Too_long]_Inonwhite_1 - [Long_enough]_Inonwhite_1 = 0
    -------------------------------------------------------------------------------
    att_materni~e | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
    --------------+----------------------------------------------------------------
    Too_long      |
          _Isex_1 |   1.459372   .6379658     0.86   0.387     .6195301    3.437712
     _Ichildren_1 |   2.220308   .5357684     3.31   0.001     1.383615    3.562963
    _IsexXchi_1_1 |   .4096042   .1231099    -2.97   0.003      .227263     .738244
    _Ioccupatio_1 |   1.590816   .2869034     2.57   0.010     1.117135    2.265343
    _Ioccupatio_2 |   1.216887   .2054963     1.16   0.245     .8739917    1.694311
    _Ioccupatio_4 |   .5414892   .3013457    -1.10   0.270      .181922    1.611738
     _Iagegroup_1 |   2.069052   .4881915     3.08   0.002     1.302959    3.285578
     _Iagegroup_2 |   1.676878   .3346224     2.59   0.010     1.134079    2.479473
     _Iagegroup_3 |   1.405077   .2542377     1.88   0.060     .9855571    2.003172
     _Ieduc_lvl_2 |   .9643911   .1681367    -0.21   0.835     .6852524    1.357237
     _Ieduc_lvl_3 |   1.037131   .1841125     0.21   0.837     .7323649    1.468723
     _Ieduc_lvl_4 |    2.40276   .7288476     2.89   0.004     1.325894    4.354235
    _Ihh_income_1 |   .9410948   .1519851    -0.38   0.707     .6857501    1.291519
    _Ipersonal__1 |   .9216517   .2427805    -0.31   0.757     .5499766    1.544505
     _Inonwhite_1 |   .6563793   .0882331    -3.13   0.002     .5043511    .8542338
    _Iatt_male__1 |   .3365761   .1180777    -3.10   0.002      .169225    .6694251
    _Ireligion__1 |   1.302164   .1958484     1.76   0.079     .9697131    1.748592
    _Ireligion__2 |   1.120148   .2814178     0.45   0.652     .6845823    1.832842
    _Ireligion__3 |   1.629313   .4062187     1.96   0.050     .9995025    2.655983
            _cons |   26.62686   12.11285     7.21   0.000     10.91689    64.94429
    --------------+----------------------------------------------------------------
    Long_enough   |
          _Isex_1 |   3.229216   .8583958     4.41   0.000     1.917915    5.437071
     _Ichildren_1 |   2.220308   .5357684     3.31   0.001     1.383615    3.562963
    _IsexXchi_1_1 |   .4096042   .1231099    -2.97   0.003      .227263     .738244
    _Ioccupatio_1 |   1.590816   .2869034     2.57   0.010     1.117135    2.265343
    _Ioccupatio_2 |   1.216887   .2054963     1.16   0.245     .8739917    1.694311
    _Ioccupatio_4 |   2.430166   .7991999     2.70   0.007      1.27557    4.629856
     _Iagegroup_1 |   2.069052   .4881915     3.08   0.002     1.302959    3.285578
     _Iagegroup_2 |   1.676878   .3346224     2.59   0.010     1.134079    2.479473
     _Iagegroup_3 |   1.405077   .2542377     1.88   0.060     .9855571    2.003172
     _Ieduc_lvl_2 |   .9643911   .1681367    -0.21   0.835     .6852524    1.357237
     _Ieduc_lvl_3 |   1.037131   .1841125     0.21   0.837     .7323649    1.468723
     _Ieduc_lvl_4 |    2.40276   .7288476     2.89   0.004     1.325894    4.354235
    _Ihh_income_1 |   .9410948   .1519851    -0.38   0.707     .6857501    1.291519
    _Ipersonal__1 |   .9216517   .2427805    -0.31   0.757     .5499766    1.544505
     _Inonwhite_1 |   .6563793   .0882331    -3.13   0.002     .5043511    .8542338
    _Iatt_male__1 |   .6608023   .0935378    -2.93   0.003     .5007055    .8720888
    _Ireligion__1 |   1.302164   .1958484     1.76   0.079     .9697131    1.748592
    _Ireligion__2 |   1.120148   .2814178     0.45   0.652     .6845823    1.832842
    _Ireligion__3 |   1.629313   .4062187     1.96   0.050     .9995025    2.655983
            _cons |   .4965651   .1431003    -2.43   0.015     .2822778    .8735257
    -------------------------------------------------------------------------------

    With the ## operator:

    Code:
    . gologit2 att_maternity_leave i.sex##i.children i.occupation i.agegroup i.educ_lvl ///
    > i.hh_income i.personal_income i.nonwhite i.att_male_breadwinner i.religion_sub, or autofit(0.05)
    
    ------------------------------------------------------------------------------
    Testing parallel lines assumption using the .05 level of significance...
    
    [output omitted]
    
    Step  16: Constraints for parallel lines are not imposed for
              4.occupation (P Value = 0.00125)
              1.sex (P Value =       .)
              1.children (P Value =       .)
              1.sex#1.children (P Value =       .)
    
    Wald test of parallel lines assumption for the final model:
    
    [output omitted]
    
               chi2( 18) =   20.37
             Prob > chi2 =    0.3125
    
    [output omitted]
    
    ------------------------------------------------------------------------------
    
    Generalized Ordered Logit Estimates             Number of obs     =      1,218
                                                    LR chi2(20)       =     119.04
                                                    Prob > chi2       =     0.0000
    Log likelihood = -856.74263                     Pseudo R2         =     0.0650
    
     ( 1)  [Too_long]1.hh_income - [Long_enough]1.hh_income = 0
     ( 2)  [Too_long]1.sex - [Long_enough]1.sex = 0
     ( 3)  [Too_long]1.children - [Long_enough]1.children = 0
     ( 4)  [Too_long]1.sex#1.children - [Long_enough]1.sex#1.children = 0
     ( 5)  [Too_long]1.occupation - [Long_enough]1.occupation = 0
     ( 6)  [Too_long]2.occupation - [Long_enough]2.occupation = 0
     ( 7)  [Too_long]1.agegroup - [Long_enough]1.agegroup = 0
     ( 8)  [Too_long]2.agegroup - [Long_enough]2.agegroup = 0
     ( 9)  [Too_long]3.agegroup - [Long_enough]3.agegroup = 0
     (10)  [Too_long]2.educ_lvl - [Long_enough]2.educ_lvl = 0
     (11)  [Too_long]3.educ_lvl - [Long_enough]3.educ_lvl = 0
     (12)  [Too_long]4.educ_lvl - [Long_enough]4.educ_lvl = 0
     (13)  [Too_long]1.personal_income - [Long_enough]1.personal_income = 0
     (14)  [Too_long]1.nonwhite - [Long_enough]1.nonwhite = 0
     (15)  [Too_long]1.att_male_breadwinner - [Long_enough]1.att_male_breadwinner = 0
     (16)  [Too_long]1.religion_sub - [Long_enough]1.religion_sub = 0
     (17)  [Too_long]2.religion_sub - [Long_enough]2.religion_sub = 0
     (18)  [Too_long]3.religion_sub - [Long_enough]3.religion_sub = 0
    ---------------------------------------------------------------------------------------------------------
                        att_maternity_leave | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ----------------------------------------+----------------------------------------------------------------
    Too_long                                |
                                        sex |
                        Female (childless)  |   3.074111   .8091185     4.27   0.000     1.835185    5.149431
                                            |
                                   children |
                       Has children (male)  |   2.181106   .5196852     3.27   0.001     1.367299    3.479283
                                            |
                               sex#children |
    Female (childless)#Has children (male)  |   .4127405   .1233798    -2.96   0.003     .2297359    .7415242
                                            |
                                 occupation |
                             Formal worker  |   1.582103   .2845895     2.55   0.011     1.112039    2.250864
             Informal worker/self-employed  |   1.217552    .205481     1.17   0.243     .8746496    1.694889
                                Unemployed  |   .4785535   .2693825    -1.31   0.190     .1587745    1.442382
                                            |
                                   agegroup |
                        18 to 29 years old  |   2.068957   .4879833     3.08   0.002     1.303129    3.284849
                        30 to 44 years old  |   1.686548   .3369284     2.62   0.009      1.14012    2.494862
                        45 to 59 years old  |   1.413806   .2563532     1.91   0.056     .9909438    2.017116
                                            |
                                   educ_lvl |
                          Schooling: basic  |   .9651876   .1682604    -0.20   0.839     .6858395    1.358317
                    Schooling: high school  |   1.038984   .1843314     0.22   0.829     .7338261    1.471041
                     Schooling: university  |   2.401723   .7281533     2.89   0.004     1.325733    4.351007
                                            |
                                  hh_income |
        Household income up to 3 min wages  |   .9433197   .1520738    -0.36   0.717     .6877579    1.293845
                                            |
                            personal_income |
         Personal income up to 3 min wages  |   .9155759   .2403605    -0.34   0.737     .5473103    1.531634
                                            |
                                   nonwhite |
                                 Non-white  |   .6562465   .0881965    -3.13   0.002     .5042774     .854013
                                            |
                       att_male_breadwinner |
        Agrees with male breadwinner model  |   .6353918   .0888878    -3.24   0.001     .4830179    .8358339
                                            |
                               religion_sub |
                                Protestant  |   1.298127   .1954185     1.73   0.083     .9664476    1.743637
                            Other religion  |   1.113869   .2802215     0.43   0.668     .6802885    1.823791
           No religion but believes in God  |   1.632276   .4058423     1.97   0.049     1.002661    2.657252
                                            |
                                      _cons |    12.5624   4.075055     7.80   0.000     6.652047    23.72409
    ----------------------------------------+----------------------------------------------------------------
    Long_enough                             |
                                        sex |
                        Female (childless)  |   3.074111   .8091185     4.27   0.000     1.835185    5.149431
                                            |
                                   children |
                       Has children (male)  |   2.181106   .5196852     3.27   0.001     1.367299    3.479283
                                            |
                               sex#children |
    Female (childless)#Has children (male)  |   .4127405   .1233798    -2.96   0.003     .2297359    .7415242
                                            |
                                 occupation |
                             Formal worker  |   1.582103   .2845895     2.55   0.011     1.112039    2.250864
             Informal worker/self-employed  |   1.217552    .205481     1.17   0.243     .8746496    1.694889
                                Unemployed  |    2.41457   .7944307     2.68   0.007     1.267014    4.601487
                                            |
                                   agegroup |
                        18 to 29 years old  |   2.068957   .4879833     3.08   0.002     1.303129    3.284849
                        30 to 44 years old  |   1.686548   .3369284     2.62   0.009      1.14012    2.494862
                        45 to 59 years old  |   1.413806   .2563532     1.91   0.056     .9909438    2.017116
                                            |
                                   educ_lvl |
                          Schooling: basic  |   .9651876   .1682604    -0.20   0.839     .6858395    1.358317
                    Schooling: high school  |   1.038984   .1843314     0.22   0.829     .7338261    1.471041
                     Schooling: university  |   2.401723   .7281533     2.89   0.004     1.325733    4.351007
                                            |
                                  hh_income |
        Household income up to 3 min wages  |   .9433197   .1520738    -0.36   0.717     .6877579    1.293845
                                            |
                            personal_income |
         Personal income up to 3 min wages  |   .9155759   .2403605    -0.34   0.737     .5473103    1.531634
                                            |
                                   nonwhite |
                                 Non-white  |   .6562465   .0881965    -3.13   0.002     .5042774     .854013
                                            |
                       att_male_breadwinner |
        Agrees with male breadwinner model  |   .6353918   .0888878    -3.24   0.001     .4830179    .8358339
                                            |
                               religion_sub |
                                Protestant  |   1.298127   .1954185     1.73   0.083     .9664476    1.743637
                            Other religion  |   1.113869   .2802215     0.43   0.668     .6802885    1.823791
           No religion but believes in God  |   1.632276   .4058423     1.97   0.049     1.002661    2.657252
                                            |
                                      _cons |   .5220965   .1488314    -2.28   0.023     .2986091    .9128482
    ---------------------------------------------------------------------------------------------------------
    As you can see, the autofit identifies different variables as violating the PL assumption for what seems to be the same model. What's more, when using the full factorial interaction operator, autofit seems unable to relax the PL assumption for the variables involved in the interaction, as shown by Step 16 of the autofit routine in the code above. Indeed, when explicitly telling what variables don't satisfy the proportional odds assumption with the npl option on gologit (the ones identified by autofit), the coefficients diverge for these variables in the two equations, as it should be:

    Code:
    . gologit2 att_maternity_leave i.sex##i.children i.occupation i.agegroup i.educ_lvl ///
    > i.hh_income i.personal_income i.nonwhite i.att_male_breadwinner i.religion_sub , or npl(1.sex 1.children 1.sex#1.children
    >  4.occupation)
    
    Generalized Ordered Logit Estimates             Number of obs     =      1,218
                                                    LR chi2(23)       =     124.03
                                                    Prob > chi2       =     0.0000
    Log likelihood = -854.24631                     Pseudo R2         =     0.0677
    
    [output omitted]
    
    ---------------------------------------------------------------------------------------------------------
                        att_maternity_leave | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ----------------------------------------+----------------------------------------------------------------
    Too_long                                |
                                        sex |
                        Female (childless)  |   1.126295   .7506986     0.18   0.858     .3050066    4.159061
                                            |
                                   children |
                       Has children (male)  |   2.287915   1.475059     1.28   0.199     .6466296    8.095139
                                            |
                               sex#children |
    Female (childless)#Has children (male)  |   .6197827   .4973397    -0.60   0.551     .1285877    2.987304
                                            |
                                 occupation |
                             Formal worker  |    1.58724   .2864341     2.56   0.010     1.114383    2.260741
             Informal worker/self-employed  |   1.218529   .2061066     1.17   0.243      .874703    1.697506
                                Unemployed  |   .5792418   .3306499    -0.96   0.339     .1892198    1.773182
                                            |
                                   agegroup |
                        18 to 29 years old  |   2.071854   .4893674     3.08   0.002     1.304089    3.291631
                        30 to 44 years old  |    1.68437   .3370393     2.61   0.009     1.137925    2.493225
                        45 to 59 years old  |   1.413854   .2565961     1.91   0.056      .990655    2.017839
                                            |
                                   educ_lvl |
                          Schooling: basic  |    .966153   .1688555    -0.20   0.844     .6859313    1.360853
                    Schooling: high school  |   1.038784   .1848084     0.21   0.831     .7329752    1.472181
                     Schooling: university  |   2.405845    .730765     2.89   0.004     1.326536    4.363314
                                            |
                                  hh_income |
        Household income up to 3 min wages  |   .9406668   .1520812    -0.38   0.705     .6852023    1.291376
                                            |
                            personal_income |
         Personal income up to 3 min wages  |   .9153579   .2415289    -0.34   0.737     .5457459    1.535293
                                            |
                                   nonwhite |
                                 Non-white  |   .6560566     .08834    -3.13   0.002     .5038769    .8541973
                                            |
                       att_male_breadwinner |
        Agrees with male breadwinner model  |   .6314628   .0885609    -3.28   0.001     .4796994    .8312399
                                            |
                               religion_sub |
                                Protestant  |   1.303651   .1966212     1.76   0.079     .9700192    1.752034
                            Other religion  |   1.116723   .2809709     0.44   0.661     .6819945    1.828565
           No religion but believes in God  |   1.638381   .4089523     1.98   0.048     1.004496    2.672275
                                            |
                                      _cons |    18.0539    10.0048     5.22   0.000     6.093501    53.49032
    ----------------------------------------+----------------------------------------------------------------
    Long_enough                             |
                                        sex |
                        Female (childless)  |   3.272128   .8764313     4.43   0.000       1.9357     5.53124
                                            |
                                   children |
                       Has children (male)  |   2.215837   .5428784     3.25   0.001     1.370863    3.581637
                                            |
                               sex#children |
    Female (childless)#Has children (male)  |   .4002188   .1216815    -3.01   0.003     .2205466     .726264
                                            |
                                 occupation |
                             Formal worker  |    1.58724   .2864341     2.56   0.010     1.114383    2.260741
             Informal worker/self-employed  |   1.218529   .2061066     1.17   0.243      .874703    1.697506
                                Unemployed  |     2.3864   .7860174     2.64   0.008     1.251353    4.550998
                                            |
                                   agegroup |
                        18 to 29 years old  |   2.071854   .4893674     3.08   0.002     1.304089    3.291631
                        30 to 44 years old  |    1.68437   .3370393     2.61   0.009     1.137925    2.493225
                        45 to 59 years old  |   1.413854   .2565961     1.91   0.056      .990655    2.017839
                                            |
                                   educ_lvl |
                          Schooling: basic  |    .966153   .1688555    -0.20   0.844     .6859313    1.360853
                    Schooling: high school  |   1.038784   .1848084     0.21   0.831     .7329752    1.472181
                     Schooling: university  |   2.405845    .730765     2.89   0.004     1.326536    4.363314
                                            |
                                  hh_income |
        Household income up to 3 min wages  |   .9406668   .1520812    -0.38   0.705     .6852023    1.291376
                                            |
                            personal_income |
         Personal income up to 3 min wages  |   .9153579   .2415289    -0.34   0.737     .5457459    1.535293
                                            |
                                   nonwhite |
                                 Non-white  |   .6560566     .08834    -3.13   0.002     .5038769    .8541973
                                            |
                       att_male_breadwinner |
        Agrees with male breadwinner model  |   .6314628   .0885609    -3.28   0.001     .4796994    .8312399
                                            |
                               religion_sub |
                                Protestant  |   1.303651   .1966212     1.76   0.079     .9700192    1.752034
                            Other religion  |   1.116723   .2809709     0.44   0.661     .6819945    1.828565
           No religion but believes in God  |   1.638381   .4089523     1.98   0.048     1.004496    2.672275
                                            |
                                      _cons |   .5030049   .1456844    -2.37   0.018     .2851283    .8873689
    ---------------------------------------------------------------------------------------------------------
    The predicted probabilities from margins are different for all three models above. However, I have also noticed that the results from margins are different when run on the xi prefix version of the model and on the version using ## along with npl to relax the same variables autofit identifies for the former model.

    To illustrate, here are the results from margins on the xi prefix model version:

    Code:
    .  margins, at( _Isex_1=(0 1) _Ichildren_1=(0 1))
    
    Predictive margins                              Number of obs     =      1,218
    Model VCE    : OIM
    
    1._predict   : Pr(att_maternity_leave==0), predict(pr outcome(0))
    2._predict   : Pr(att_maternity_leave==1), predict(pr outcome(1))
    3._predict   : Pr(att_maternity_leave==2), predict(pr outcome(2))
    
    1._at        : _Isex_1         =           0
                   _Ichildren_1    =           0
    
    2._at        : _Isex_1         =           0
                   _Ichildren_1    =           1
    
    3._at        : _Isex_1         =           1
                   _Ichildren_1    =           0
    
    4._at        : _Isex_1         =           1
                   _Ichildren_1    =           1
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    _predict#_at |
            1 1  |   .0683289   .0274118     2.49   0.013     .0146028     .122055
            1 2  |   .0332513   .0109025     3.05   0.002     .0118828    .0546197
            1 3  |   .0488709   .0121997     4.01   0.000       .02496    .0727818
            1 4  |   .0232943   .0048849     4.77   0.000     .0137201    .0328684
            2 1  |   .5800066   .0426765    13.59   0.000     .4963622     .663651
            2 2  |   .4460295   .0302051    14.77   0.000     .3868287    .5052304
            2 3  |   .3503337   .0295183    11.87   0.000     .2924788    .4081886
            2 4  |   .2240374   .0195662    11.45   0.000     .1856884    .2623864
            3 1  |   .3516645   .0583139     6.03   0.000     .2373714    .4659576
            3 2  |   .5207192   .0335566    15.52   0.000     .4549495    .5864889
            3 3  |   .6007954   .0359067    16.73   0.000     .5304196    .6711713
            3 4  |   .7526683   .0209214    35.98   0.000     .7116631    .7936736
    ------------------------------------------------------------------------------
    And here is the output from margins on the model using the npl option to relax the PL assumption on the same 3 variables autofit appoints for the xi prefix model as violating said assumption. For the model,

    Code:
    gologit2 att_maternity_leave i.sex##i.children i.occupation i.agegroup i.educ_lvl ///
    > i.hh_income i.personal_income i.nonwhite i.att_male_breadwinner i.religion_sub, or npl(1.sex 4.occupation 1.att_male_brea
    > dwinner)
    This is what margins returns:

    Code:
    .  margins, at(sex=(0 1) children=(0 1))
    
    Predictive margins                              Number of obs     =      1,218
    Model VCE    : OIM
    
    1._predict   : Pr(att_maternity_leave==0), predict(pr outcome(0))
    2._predict   : Pr(att_maternity_leave==1), predict(pr outcome(1))
    3._predict   : Pr(att_maternity_leave==2), predict(pr outcome(2))
    
    1._at        : sex             =           0
                   children        =           0
    
    2._at        : sex             =           0
                   children        =           1
    
    3._at        : sex             =           1
                   children        =           0
    
    4._at        : sex             =           1
                   children        =           1
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    _predict#_at |
            1 1  |   .0418671   .0136235     3.07   0.002     .0151656    .0685686
            1 2  |   .0196605   .0060389     3.26   0.001     .0078244    .0314966
            1 3  |    .029371   .0078227     3.75   0.000     .0140388    .0447032
            1 4  |   .0321284   .0064621     4.97   0.000      .019463    .0447938
            2 1  |   .5181767   .0401801    12.90   0.000     .4394252    .5969282
            2 2  |   .3603127   .0259047    13.91   0.000     .3095404     .411085
            2 3  |   .2730377   .0337376     8.09   0.000     .2069132    .3391622
            2 4  |   .2891611   .0178571    16.19   0.000     .2541619    .3241603
            3 1  |   .4399562   .0449395     9.79   0.000     .3518764     .528036
            3 2  |   .6200268   .0269224    23.03   0.000     .5672598    .6727938
            3 3  |   .6975913   .0385831    18.08   0.000     .6219697    .7732129
            3 4  |   .6787105   .0186828    36.33   0.000     .6420929    .7153281
    ------------------------------------------------------------------------------
    From these diverging results, my questions are:
    1. What is the most appropriate way of creating a factorial interaction in this scenario?
    2. Should I be worried about autofit not relaxing the PL assumption in the model using the full factorial interaction operator? Is running gologit2, npl later to manually do this just as valid?
    3. What do I make of the diverging margin outputs for apparently the same model?
    Thank you for your time,
    Larissa

  • #2
    You cannot, repeat CANNOT, use the -xi:- prefix and then run -margins-. You MUST use factor variable notation, and the ## operator is the best way to do that. Anything you get from -margins- after -xi:- is just plain wrong. Throw it away--don't even waste any time looking at it.

    Comment


    • #3
      Originally posted by Clyde Schechter View Post
      You cannot, repeat CANNOT, use the -xi:- prefix and then run -margins-. You MUST use factor variable notation, and the ## operator is the best way to do that. Anything you get from -margins- after -xi:- is just plain wrong. Throw it away--don't even waste any time looking at it.
      Thank you very much, professor Schechter!

      Comment

      Working...
      X