Announcement

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

  • Strange behavior of factor interactions using the 'o().variable' notation

    Hello everyone,

    I ran some regressions with factorized interaction variables using the o().`varname' notation and the output was not what I was expecting. See the following example:
    Code:
    sysuse nlsw88, clear
    reg wage o(1/6).industry o(1/6).industry#i1.union
    with the output being
    Code:
    . reg wage o(1/6).industry o(1/6).industry#i1.union
    note: 2.industry#1.union identifies no observations in the sample.
    
          Source |       SS           df       MS      Number of obs   =     1,865
    -------------+----------------------------------   F(17, 1847)     =     10.25
           Model |    2795.082        17  164.416588   Prob > F        =    0.0000
        Residual |  29616.7744     1,847    16.03507   R-squared       =    0.0862
    -------------+----------------------------------   Adj R-squared   =    0.0778
           Total |  32411.8564     1,864   17.388335   Root MSE        =    4.0044
    
    ------------------------------------------------------------------------------------------------
                              wage | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------------------------+----------------------------------------------------------------
                          industry |
                           Mining  |          0  (omitted)
                     Construction  |          0  (omitted)
                    Manufacturing  |          0  (omitted)
           Transport/Comm/Utility  |          0  (omitted)
           Wholesale/Retail trade  |          0  (omitted)
          Finance/Ins/Real estate  |   2.137433   .3754921     5.69   0.000     1.400999    2.873867
              Business/Repair svc  |   .5740516   .5865602     0.98   0.328    -.5763391    1.724442
                Personal services  |  -2.576622   .5532688    -4.66   0.000     -3.66172   -1.491524
            Entertainment/Rec svc  |   .2301813   1.168715     0.20   0.844    -2.061961    2.522323
            Professional services  |   .5367667   .2484146     2.16   0.031     .0495637     1.02397
            Public administration  |   1.572348   .4340539     3.62   0.000     .7210603    2.423636
                                   |
                    industry#union |
      Ag/Forestry/Fisheries#Union  |  -2.547856   2.836754    -0.90   0.369    -8.111438    3.015726
                     Mining#Union  |          0  (empty)
               Construction#Union  |   2.276353   2.318332     0.98   0.326    -2.270474    6.823179
              Manufacturing#Union  |   .9194405   .4696098     1.96   0.050    -.0015814    1.840462
     Transport/Comm/Utility#Union  |   4.613591   .6030785     7.65   0.000     3.430804    5.796379
     Wholesale/Retail trade#Union  |  -.1158069   .8906259    -0.13   0.897    -1.862546    1.630932
    Finance/Ins/Real estate#Union  |  -1.584109   1.375874    -1.15   0.250    -4.282541    1.114323
        Business/Repair svc#Union  |   -1.29499    1.52276    -0.85   0.395    -4.281501    1.691521
          Personal services#Union  |    -.38632   1.866409    -0.21   0.836    -4.046812    3.274172
      Entertainment/Rec svc#Union  |   3.151908   3.058397     1.03   0.303     -2.84637    9.150186
      Professional services#Union  |    1.19436   .3239704     3.69   0.000      .558973    1.829746
      Public administration#Union  |   1.862847   .6671609     2.79   0.005     .5543782    3.171316
                                   |
                             _cons |   6.786984   .1721618    39.42   0.000     6.449332    7.124636
    ------------------------------------------------------------------------------------------------
    Is there a reason why the interaction coefficients do not omit categories 1/6? Or is this a bug?

    Even more issues occur when using
    Code:
    reg wage o(1/6).industry##i1.union
    Last edited by Jan Kabatek; 03 Oct 2022, 00:28.

  • #2
    See my remark in https://www.statalist.org/forums/for...nuous-variable with the keyword being distribute as in distribute the omission operator.

    Comment


    • #3
      Thanks, Andrew! What a strange syntax...

      Comment

      Working...
      X