Announcement

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

  • Margins command returning "not estimable"

    Hello!

    I am looking for help regarding the margins command. I am running xtreg using state-year panel data and I want to test for different effects for states with high and low birthrates using interaction terms, but when I run the margins command I'm getting a result that is "not estimable." I am trying to estimate margins using the following code:
    Code:
    xtreg birthrate c.simelig##i.highbirthrate i.year c1year-c8year [aweight=populationmean],
    fe vce(cluster fips)
    margins, dydx(simelig) at(highbirthrate=(0 1))
    Note: c1year-c8year are census region time interactions to account for region specific trends.

    In the above case, xtreg returns the following output:
    Code:
    note: 1.highbirthrate omitted because of collinearity
    Fixed-effects (within) regression               Number of obs      =       714
    Group variable: fips                            Number of groups   =        51
    
    R-sq:  within  = 0.9509                         Obs per group: min =        14
           between = 0.3664                                        avg =      14.0
           overall = 0.0326                                        max =        14
    
                                                    F(23,50)           =    280.65
    corr(u_i, Xb)  = -0.3530                        Prob > F           =    0.0000
    
                                         (Std. Err. adjusted for 51 clusters in fips)
    ---------------------------------------------------------------------------------
                    |               Robust
          birthrate |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
    ----------------+----------------------------------------------------------------
            simelig |   .0281689   .0224591     1.25   0.216    -.0169417    .0732794
    1.highbirthrate |          0  (omitted)
                    |
      highbirthrate#|
          c.simelig |
                 1  |  -.1151857   .0282641    -4.08   0.000    -.1719558   -.0584157
                    |
               year |
              1991  |  -1.326654   .2133969    -6.22   0.000    -1.755274   -.8980335
              1992  |  -1.981944   .3023724    -6.55   0.000    -2.589277   -1.374612
              1993  |  -2.707751   .4849461    -5.58   0.000    -3.681794   -1.733708
              1994  |  -4.855094   .6516258    -7.45   0.000    -6.163923   -3.546265
              1995  |  -7.590643   .9927567    -7.65   0.000    -9.584654   -5.596633
              1996  |  -9.993006   1.182542    -8.45   0.000    -12.36821   -7.617801
              1997  |  -11.91885   1.455844    -8.19   0.000      -14.843   -8.994706
              1998  |  -13.71345    1.58068    -8.68   0.000    -16.88833   -10.53856
              1999  |  -15.06773   1.789333    -8.42   0.000    -18.66171   -11.47374
              2000  |  -18.01335   1.937266    -9.30   0.000    -21.90446   -14.12224
              2001  |  -19.85275   2.057514    -9.65   0.000    -23.98539   -15.72011
              2002  |  -21.28267   2.169835    -9.81   0.000    -25.64091   -16.92443
              2003  |  -21.94815   2.259343    -9.71   0.000    -26.48617   -17.41013
                    |
             c1year |   .6410636   .2012706     3.19   0.002     .2367998    1.045327
             c2year |   .5668106   .2027973     2.79   0.007     .1594802     .974141
             c3year |   .5823073   .2162658     2.69   0.010     .1479247     1.01669
             c4year |   .9935927   .1900171     5.23   0.000     .6119321    1.375253
             c5year |   .3884749   .1967836     1.97   0.054    -.0067765    .7837263
             c6year |   .3084339   .2081009     1.48   0.145    -.1095491    .7264169
             c7year |   .6459406   .2272479     2.84   0.006     .1894997    1.102382
             c8year |   .7960811   .2041904     3.90   0.000     .3859526     1.20621
              _cons |   39.29763   .4062755    96.73   0.000      38.4816    40.11366
    ----------------+----------------------------------------------------------------
            sigma_u |  12.173588
            sigma_e |  1.4760461
                rho |  .98551147   (fraction of variance due to u_i)
    ---------------------------------------------------------------------------------
    And the margins command returns the following:
    Code:
    Average marginal effects                          Number of obs   =        714
    Model VCE    : Robust
    
    Expression   : Linear prediction, predict()
    dy/dx w.r.t. : simelig
    
    1._at        : highbirthrate   =           0
    
    2._at        : highbirthrate   =           1
    
    ------------------------------------------------------------------------------
                 |            Delta-method
                 |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    simelig      |
             _at |
              1  |          .  (not estimable)
              2  |          .  (not estimable)
    ------------------------------------------------------------------------------
    In trying to identify the problem I played around with a few other configuration of the model. The following also returns "not estimable:"
    Code:
    xtreg birthrate c.simelig##i.highbirthrate i.year c1year-c8year, fe vce(cluster fips)
    margins, dydx(simelig) at(highbirthrate=(0 1))
    If I don't weight or cluster the margins command works just fine, and the following code returns normal results:
    Code:
    xtreg birthrate c.simelig##i.highbirthrate i.year c1year-c8year
    margins, dydx(simelig) at(highbirthrate=(0 1))
    Meanwhile, this returns an error that says "aweight not allowed:"
    Code:
    xtreg birthrate c.simelig##i.highbirthrate i.year c1year-c8year [aweight=populationmean]
    margins, dydx(simelig) at(highbirthrate=(0 1))
    Does anyone have any thoughts as to why I'm not getting estimates for the original code? Any help would be much appreciated.

    Thanks,
    Lea

  • #2
    Welcome to Statalist!

    The note at the top of your xtreg output tells us that xtreg was unable to estimate an effect for highbirthrate==1, and I expect that this failure is the cause of the problems in margins. I expect that were you to try
    Code:
    margins, dydx(simelig) at(highbirthrate=0)
    you would not get the error message.

    You are running a fixed effects model, and I assume that highbirthrate is constant within each state, so I expect that is the source of the collinearity. You shouldn't include variables in a fixed effect model that are constant within the panels.

    Comment


    • #3
      Thanks for the quick response!

      I tried the code you posted, but I'm still getting the same problem:
      Code:
      Average marginal effects                          Number of obs   =        714
      Model VCE    : Robust
      
      Expression   : Linear prediction, predict()
      dy/dx w.r.t. : simelig
      at           : highbirthrate   =           0
      
      ------------------------------------------------------------------------------
                   |            Delta-method
                   |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
           simelig |          .  (not estimable)
      ------------------------------------------------------------------------------
      highbirthrate is constant within each state - it's coded as 1 if the state is above the national mean and 0 if it's below the national mean. I understand the reason highbirthrate alone is omitted for collinearity, but the interaction between highbirthrate and simelig seems fine. I would like Stata to add the coefficients (and calculate standard errors) on simelig and the simelig-highbirthrate interaction for me for when highbirthrate=1 and when highbirthrate=0. Since the simelig-highbirthrate interaction isn't omitted I don't understand why the margins command isn't giving a result.

      Comment


      • #4
        Ah yes, I see that I didn't look closely enough at your output. My assertion still stands, however.

        When you write
        Code:
        c.simelig##i.highbirthrate
        it is equivalent to the full factorial interaction
        Code:
        c.simelig i.highbirthrate c.simelig#i.highbirthrate
        For your purposes, I think you should only include
        Code:
        c.simelig#i.highbirthrate
        rather than the full factorial interaction.

        Try that in your original formulation and see if it gives you what you want. Anyone following this thread is welcome to jump in with a better explanation!

        Comment


        • #5
          This thread -- in particular Jeff Pitblado's comments -- may be relevant.

          http://www.statalist.org/forums/foru...fe-and-margins

          I think William is on the right track although I suspect you also want to include c.simeliq, i.e.

          Code:
          c.simelig c.simelig#i.highbirthrate
          i.e. do NOT include the main effect of birthrate but do include the main effect of simeliq.
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 18.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #6
            Thank you! Everything worked out using
            Code:
             c.simelig c.simelig#i.highbirthrate
            Thanks again,
            Lea

            Comment

            Working...
            X