Announcement

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

  • Why there are omitted variables after I run a regression?

    Dear Stata Users,

    Please, help me with the following issue. I have the following regression:
    Code:
    reghdfe Y  Treated Shock Shock_Treated if inrange(year, 1993, 1998), ab(industry year) vce(cluster firm)
    Y is a continuous variable, “Treated” is a count variable between 1 and 10, which does not change within the years. “Shock” is equal to 1 if year>1995. “Shock_Treated” is multiplication of Shock*Treated. Once I run the regression above the results omit “Shock” variable. I present you a sample of my data. (One you run the above code both “Shock” and “Treated” are dropped, but in the main data only “Shock” is dropped from final results).



    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long firm double year float Y byte(industry Treated) float(Shock Shock_Treated)
    1004 1991 1.2162784 50 4 0 0
    1004 1995 1.2572833 50 4 0 0
    1004 1996  1.363323 50 4 1 4
    1004 1997 1.7276955 50 4 1 4
    1004 1998  1.538592 50 4 1 4
    1004 1999 1.0476477 50 4 1 4
    1004 2000  .7649824 50 4 1 4
    1004 2001  .9150212 50 4 1 4
    1004 2002 1.1913382 50 4 1 4
    1004 2005  1.227632 50 4 1 4
    1004 2006 1.0054921 50 4 1 4
    1004 2007 1.1750593 50 4 1 4
    1004 2008  .6300365 50 4 1 4
    1004 2009   .629995 50 4 1 4
    1004 2010  .8295698 50 4 1 4
    1004 2012 .44032055 50 4 1 4
    1004 2013  .7643967 50 4 1 4
    1004 2014  .8717297 50 4 1 4
    1009 1991 1.3012563 34 . 0 .
    1009 1992   .470591 34 . 0 .
    1009 1993  .8682343 34 . 0 .
    1009 1994  .6791557 34 . 0 .
    1013 1991 2.2695959 36 9 0 0
    1013 1992  3.367003 36 9 0 0
    1013 1993   2.77735 36 9 0 0
    1013 1994  5.796917 36 9 0 0
    1013 1995  3.448212 36 9 0 0
    1013 1996 1.8293723 36 9 1 9
    1013 1997 1.4910988 36 9 1 9
    1013 1998  .3259064 36 9 1 9
    1013 1999 .33928615 36 9 1 9
    1013 2000 .53387076 36 9 1 9
    1013 2001  .1587742 36 9 1 9
    1013 2002  .1671926 36 9 1 9
    1013 2003 .21304762 36 9 1 9
    1013 2004  .7399237 36 9 1 9
    1013 2005  .2417438 36 9 1 9
    1013 2006 1.1855857 36 9 1 9
    1013 2007 1.0501765 36 9 1 9
    1013 2008  1.397972 36 9 1 9
    1013 2009 1.0364065 36 9 1 9
    1013 2010 1.8913915 36 9 1 9
    1034 1991 1.6884944 28 5 0 0
    1034 1992 1.1721294 28 5 0 0
    1034 1993 1.4077696 28 5 0 0
    1034 1994 1.1729547 28 5 0 0
    1034 1995 1.0960381 28 5 0 0
    1034 1996 1.0372037 28 5 1 5
    1034 1997 1.0582129 28 5 1 5
    1034 1998 1.1831522 28 5 1 5
    1034 1999 1.0476207 28 5 1 5
    1034 2000 1.1992847 28 5 1 5
    1034 2001 1.3284056 28 5 1 5
    1034 2002  .8749366 28 5 1 5
    1034 2003  .7831826 28 5 1 5
    1034 2004  .8301051 28 5 1 5
    1034 2005 1.0752139 28 5 1 5
    1034 2006  .7738963 28 5 1 5
    1034 2007  .9605774 28 5 1 5
    1036 1997  .8874638 34 . 1 .
    1036 1998  .9423323 34 . 1 .
    1036 1999 1.0153537 34 . 1 .
    1036 2000  .8182853 34 . 1 .
    1038 1995 1.1803118 78 5 0 0
    1038 1996  1.581189 78 5 1 5
    1038 1997 1.0792153 78 5 1 5
    1038 1998 2.0019813 78 5 1 5
    1038 1999  4.345664 78 5 1 5
    1038 2003 1.5540975 78 5 1 5
    1045 1991 1.1612418 45 6 0 0
    1045 1992  1.326292 45 6 0 0
    1045 1993 1.4623973 45 6 0 0
    1045 1994 1.6677955 45 6 0 0
    1045 1995 1.1966676 45 6 0 0
    1045 1996 1.2245398 45 6 1 6
    1045 1997 1.3347863 45 6 1 6
    1045 1998  1.306764 45 6 1 6
    1045 1999 2.3600025 45 6 1 6
    1045 2000   1.05413 45 6 1 6
    1045 2001 .54234457 45 6 1 6
    1045 2002   .924228 45 6 1 6
    1045 2003 4.5518956 45 6 1 6
    1050 2014  .9655685 35 . 1 .
    1050 2015  .9960567 35 . 1 .
    1054 1992  .9048549 73 . 0 .
    1054 1993  .9987014 73 . 0 .
    1055 1992  .8235564 35 4 0 0
    1055 1993 .57817215 35 4 0 0
    1055 1994  .9342234 35 4 0 0
    1055 1995  .6281301 35 4 0 0
    1056 1999 1.7255015 38 . 1 .
    1056 2000 1.7177165 38 . 1 .
    1056 2001 3.9316046 38 . 1 .
    1056 2002 .54016626 38 . 1 .
    1056 2003 1.5078555 38 . 1 .
    1056 2004 1.4007237 38 . 1 .
    1056 2005 1.4041744 38 . 1 .
    1056 2006 1.1834977 38 . 1 .
    1072 1997 2.2050424 36 . 1 .
    1072 1998 1.6423452 36 . 1 .
    end

  • #2
    Hi Alberto
    The reason is that your treatment variable does not vary within industry, while your shock variable does not vary within years. The interaction, however, does vary within industry or within a year, which is why it is not omitted from your model.
    Fernando

    Comment


    • #3
      Dear Fernando,

      Thank you very much for your reply. I agree with you. However, why running the regression inrange(year, 1992, 1999) does not drop the "Shock"? Should not it be that "Shock" is dropped for all the ranges of years within which the regression is run?

      Comment


      • #4
        for the data you provide with dataex, shock is still dropped.
        Perhaps there is something different for the whole sample compared to the excerpt provided via dataex.

        Comment

        Working...
        X