Announcement

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

  • Mmregress with interaction term in random effects model

    Dear all,

    I am running difference in difference regressions in a panel data set over the years 2004-2010, leaving out 2007.
    I am testing whether some politically 'connected' firms alter their behavior after a political event 'post'.
    Hereby, I am using an interaction term -post##conn-
    Of 78 firms I have data points for leverage, size, capex spending etc for the end of the year 2004, 2005, 2006, 2008, 2009 en 2010.

    First (and for example), I am looking at leverage, using this formula including the following independent variables as controls: size, top30 firms in country-dummy , log(profitability), log(cash/assets), log(capex/assets), fixed industry effects, fixed year effects and standard errors clustered per firmid. As you can see, most are lagged 1 year.

    Code:
    xtreg lev post##conn size_lag1 top_lag1 prof_lag1 lca_lag1 lcapex_lag1 i.sic2 i.year, re cluster(id)
    The thing is now, that when wanting to test for outliers, many people on Statlist refer to -mmregress- as the best option.
    However, when using -mmregress- it is not possible to use an interaction term like -post##conn-
    I have tried to read all the threads and the Stata Journal, but the answer for a random effects model like this seems not there

    Is there somebody who can help me with this? Or knows another way to correctly do this? I would like to note again, not a fixed effects model or an OLS (Hausman and Breusch Pagan drove me in this direction)

    Thank you so much!!





  • #2
    As you point out, mmregress doesn't accept factor variables. To work around this limitation, generate the interaction term by hand:
    Code:
     gen postXconn = post*conn
    However, mmregress doesn't do well with 0-1 variables, because they tend to be collinear (Verardi & Croux, 2009). To overcome this problem, they recommend msregress, another part of the package.

    It's possible that some observations will be designated as outliers because of a large random effect. (predict after xtregress might give you some insight.) However an outlier extreme for another reason might be responsible for the large effect, not the other way around.
    Reference:

    Verardi, V., & Croux, C. (2009). Robust regression in Stata. Stata Journal, 9(3), 439-453.
    Download from: http://www.stata-journal.com/article...article=st0173
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      Thank you very much Steve.
      There is no option for the -cluster(id)- part, and I have searched the internet but didnt find the answer on how to adapt the formula.
      Does this mean I need to change my formula into

      Code:
      msregress leverage size_lag1 prof_lag1 lca_lag1 lcapex_lag1, dummies (post conn postconn top_lag1 i.sic2 i.year i.id)
      or into

      Code:
      msregress leverage size_lag1 prof_lag1 lca_lag1 lcapex_lag1, dummies (post conn postconn top_lag1 i.sic2 i.year)
      Also, when typing any of the two formulas above, I get the error

      Code:
      factor variables and time-series operators not allowed
      (error in option dummies())
      If I run the regression without -i.sic2 i.year i.id- it works fine, but I doubt how much its worth without the fixed effects in my random effects model.

      I really hope someone can help me!!
      Thank you!

      Comment


      • #4
        Create your own 0-1 dummy variables. It's easy with tabulate's generate option:

        Code:
        . syususe auto, clear
        . tab rep78, gen(xrep)
             Repair |
        Record 1978 |      Freq.     Percent        Cum.
        ------------+-----------------------------------
                  1 |          2        2.90        2.90
                  2 |          8       11.59       14.49
                  3 |         30       43.48       57.97
                  4 |         18       26.09       84.06
                  5 |         11       15.94      100.00
        ------------+-----------------------------------
              Total |         69      100.00
        
        . sum xrep*
        
            Variable |        Obs        Mean    Std. Dev.       Min        Max
        -------------+---------------------------------------------------------
               xrep1 |         69    .0289855    .1689948          0          1
               xrep2 |         69     .115942    .3225009          0          1
               xrep3 |         69    .4347826    .4993602          0          1
               xrep4 |         69    .2608696    .4423259          0          1
               xrep5 |         69    .1594203    .3687494          0          1
        You could also run msregress for individual years. The cluster(id) option is irrelevant for the purposes of finding a resistant fit and detecting outliers.
        Steve Samuels
        Statistical Consulting
        [email protected]

        Stata 14.2

        Comment

        Working...
        X