Announcement

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

  • #16
    Hi Clyde,

    Sorry to bother you yesterday with simple questions about collinearity. I've made the level of my analysis more simple with the hope of making sure I'm calculating margins (the original topic of this thread) correctly. The motivation for the regression is that I'd like to use it to calculate predicted values for each state if all RHS covariates are set at the global means. I'd think the following code would accomplish that:

    Code:
    reg deflator_temp c.win_margin unopposed senate president governor i.non_presidential_year i.non_senate_year i.non_gubernatorial_year i.election_cycle#i.state_code, r noconstant
    margins state_code#election_cycle, atmeans
    However, I still have one election_cycle#state_code combination that is collinear and drops. So I thought I'd look at just one state and two years to make sure I am calculating margins as I'd like it to. When I do this, however, I am unable to produce estimates. There's no collinearity, no empty combinations, and an F-stat is reported, so I'm not sure why this is happening. Do you have an idea why? Thanks!

    Code:
    ​
    keep if year>2008
    (2794 observations deleted)
    
    . keep if state_code==5
    (919 observations deleted)
    
    . reg deflator_temp c.win_margin unopposed senate president governor i.non_presidential_year i.ele
    > ction_cycle, noconstant
    
          Source |       SS       df       MS              Number of obs =     110
    -------------+------------------------------           F(  7,   103) =  312.91
           Model |   26.303232     7  3.75760458           Prob > F      =  0.0000
        Residual |  1.23690088   103  .012008746           R-squared     =  0.9551
    -------------+------------------------------           Adj R-squared =  0.9520
           Total |  27.5401329   110  .250364845           Root MSE      =  .10958
    
    -----------------------------------------------------------------------------------------
              deflator_temp |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ------------------------+----------------------------------------------------------------
                 win_margin |   .0808634   .0586245     1.38   0.171    -.0354045    .1971313
                  unopposed |  -.1483611   .0881765    -1.68   0.095    -.3232385    .0265162
                     senate |   .0091408   .0786012     0.12   0.908    -.1467461    .1650277
                  president |    .006913   .1106506     0.06   0.950    -.2125364    .2263623
                   governor |   .0342378    .111239     0.31   0.759    -.1863786    .2548542
    1.non_presidential_year |   .3957682   .0244157    16.21   0.000     .3473454     .444191
          17.election_cycle |   .5264039   .0224857    23.41   0.000     .4818089     .570999
    -----------------------------------------------------------------------------------------
    
    . margins election_cycle, atmeans 
    
    Adjusted predictions                              Number of obs   =        110
    Model VCE    : OLS
    
    Expression   : Linear prediction, predict()
    at           : win_margin      =    .3129933 (mean)
                   unopposed       =    .0181818 (mean)
                   senate          =    .0181818 (mean)
                   president       =    .0090909 (mean)
                   governor        =    .0090909 (mean)
                   0.non_pres~r    =          .5 (mean)
                   1.non_pres~r    =          .5 (mean)
                   16.electio~e    =          .5 (mean)
                   17.electio~e    =          .5 (mean)
    
    --------------------------------------------------------------------------------
                   |            Delta-method
                   |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ---------------+----------------------------------------------------------------
    election_cycle |
               16  |          .  (not estimable)
               17  |          .  (not estimable)
    --------------------------------------------------------------------------------

    Comment


    • #17
      Well, non-estimability results when there are empty cells in the design. So there are some combinations of 16.election_cycle and 17.election_cycle with the other model variables (win_margin unopposed senate president governor non_presidential_year) that simply do not occur in your data. You can run a series of cross-tabs to see what those are. You need to get more data to fill in those cells to truly solve the problem.

      If that isn't possible, there is a work around that may or may not be suitable for your project. If you are willing to assume that the results of the empty cells, were they not empty, would not affect the estimates (a pretty strong assumption, so don't make it just to get an answer), you can specify the -asbalanced emptycells(reweight)- options to the -margins- command. This will reanalyze your margins as if you had a design that was balanced on all variables and will handle the empty cells as if they were like the non-empty cells. But, again, this will give you answers--but they could be very if the underlying assumption is incorrect.

      If that assumption is incorrect, or margins as balanced are not appropriate for your purpose, and you can't get more data to fill in the gaps, then I'm pretty sure you are stuck.

      Comment


      • #18
        If that assumption is incorrect, or margins as balanced are not appropriate for your purpose, and you can't get more data to fill in the gaps, then I'm pretty sure you are stuck.
        Actually, on second thought, there is another option: remove from the model those variables other than election cycle that define the empty cells. Of course, you have to consider whether a model that lacks those variables is scientifically credible.

        Comment

        Working...
        X