Announcement

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

  • Reduced sample size in time trends analysis

    Hi, I have an indicator variable EventIndicator, which takes the value 1 if a firm is headquartered in a state adopts certain regulations in that year and takes the value 0 otherwise.

    gen EventIndicator=state=="AZ" & fyear>2005|state=="AR" & fyear>2004|state=="CA" & fyear>1991|state=="CT" & fyear>2016|state=="DE" & fyear>1991|state=="FL" & fyear>1999|state=="GA" & fyear>1995|state=="HI" & fyear>2001|state=="IL" & fyear>2006|state=="IN" & fyear>1997|state=="KS" & fyear>2015|state=="LA" & fyear>1998|state=="ME" & fyear>1994|state=="MD" & fyear>2003|state=="MA" & fyear>1993|state=="MO" & fyear>2003|state=="NE" & fyear>1993|state=="NV" & fyear>1992|state=="NM" & fyear>2000|state=="NY" & fyear>1991|state=="OK" & fyear>2013|state=="OR" & fyear>2000|state=="PA" & fyear>1999|state=="RI" & fyear>1994|state=="TX" & fyear>2010|state=="TN" & fyear>1996|state=="UT" & fyear>2000|state=="VT" & fyear>2004|state=="WA" & fyear>2009 & fyear<2016|state=="MN" & fyear>1993 & fyear<2018


    I want to include EventIndicator t, EventIndicator t+1, and EventIndicator t+2 all in the same regression. However, I was wondering why the number of observations of EventIndicator at year t, EventIndicator t+1, and EventIndicator t+2 are different. Please see below for the data sample.

    Thank you!



    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input long(gvkey datadate) double fyear str8 state long n_state float EventIndicator
    1004 15126 2000 "IL" 17 0
    1004 15491 2001 "IL" 17 0
    1004 15856 2002 "IL" 17 0
    1004 16222 2003 "IL" 17 0
    1004 16587 2004 "IL" 17 0
    1004 16952 2005 "IL" 17 0
    1004 17317 2006 "IL" 17 0
    1004 17683 2007 "IL" 17 1
    1004 18048 2008 "IL" 17 1
    1004 18413 2009 "IL" 17 1
    1004 18778 2010 "IL" 17 1
    1004 19144 2011 "IL" 17 1
    1004 19509 2012 "IL" 17 1
    1004 19874 2013 "IL" 17 1
    1004 20239 2014 "IL" 17 1
    1004 20605 2015 "IL" 17 1
    1004 20970 2016 "IL" 17 1
    1004 21335 2017 "IL" 17 1
    1004 21700 2018 "IL" 17 1
    1004 22066 2019 "IL" 17 1
    1010 14975 2000 "MO" 28 0
    1010 15340 2001 "MO" 28 0
    1010 15705 2002 "MO" 28 0
    1010 16070 2003 "MO" 28 0
    1013 14914 2000 "MN" 27 1
    1013 15279 2001 "MN" 27 1
    1013 15644 2002 "MN" 27 1
    1013 16009 2003 "MN" 27 1
    1013 16375 2004 "MN" 27 1
    1013 16740 2005 "MN" 27 1
    1013 17105 2006 "MN" 27 1
    1013 17470 2007 "MN" 27 1
    1013 17836 2008 "MN" 27 1
    1013 18170 2009 "MN" 27 1
    1013 18535 2010 "MN" 27 1
    1019 14975 2000 "NY" 41 1
    1019 15340 2001 "NY" 41 1
    1021 14791 2000 "NY" 41 1
    1021 15156 2001 "NY" 41 1
    1021 15521 2002 "NY" 41 1
    1021 15886 2003 "NY" 41 1
    1021 16252 2004 "NY" 41 1
    1021 16617 2005 "NY" 41 1
    1021 16982 2006 "NY" 41 1
    1021 17347 2007 "NY" 41 1
    1021 17713 2008 "NY" 41 1
    1034 14975 2000 "NJ" 37 0
    1034 15340 2001 "NJ" 37 0
    1034 15705 2002 "NJ" 37 0
    1034 16070 2003 "NJ" 37 0
    1034 16436 2004 "NJ" 37 0
    1034 16801 2005 "NJ" 37 0
    1034 17166 2006 "NJ" 37 0
    1034 17531 2007 "NJ" 37 0
    1036 14975 2000 "NC" 32 0
    1037 15065 2000 "PA" 46 1
    1037 15430 2001 "PA" 46 1
    1038 15065 2000 "MO" 28 0
    1038 15430 2001 "MO" 28 0
    1038 15795 2002 "MO" 28 0
    1038 16161 2003 "MO" 28 0
    1045 14975 2000 "TX" 54 0
    1045 15340 2001 "TX" 54 0
    1045 15705 2002 "TX" 54 0
    1045 16070 2003 "TX" 54 0
    1045 16436 2004 "TX" 54 0
    1045 16801 2005 "TX" 54 0
    1045 17166 2006 "TX" 54 0
    1045 17531 2007 "TX" 54 0
    1045 17897 2008 "TX" 54 0
    1045 18262 2009 "TX" 54 0
    1045 18627 2010 "TX" 54 0
    1045 18992 2011 "TX" 54 1
    1045 19358 2012 "TX" 54 1
    1045 19723 2013 "TX" 54 1
    1045 20088 2014 "TX" 54 1
    1045 20453 2015 "TX" 54 1
    1045 20819 2016 "TX" 54 1
    1045 21184 2017 "TX" 54 1
    1045 21549 2018 "TX" 54 1
    1045 21914 2019 "TX" 54 1
    1050 14975 2000 "TX" 54 0
    1050 15340 2001 "TX" 54 0
    1050 15705 2002 "TX" 54 0
    1050 16070 2003 "TX" 54 0
    1050 16436 2004 "TX" 54 0
    1050 16801 2005 "TX" 54 0
    1050 17166 2006 "TX" 54 0
    1050 17531 2007 "TX" 54 0
    1050 17897 2008 "TX" 54 0
    1050 18262 2009 "TX" 54 0
    1050 18627 2010 "TX" 54 0
    1050 18992 2011 "TX" 54 1
    1050 19358 2012 "TX" 54 1
    1050 19723 2013 "TX" 54 1
    1050 20088 2014 "TX" 54 1
    1050 20453 2015 "TX" 54 1
    1050 20819 2016 "TX" 54 1
    1050 21184 2017 "TX" 54 1
    1050 21549 2018 "TX" 54 1
    end
    format %td datadate
    label values n_state n_state
    label def n_state 17 "IL", modify
    label def n_state 27 "MN", modify
    label def n_state 28 "MO", modify
    label def n_state 32 "NC", modify
    label def n_state 37 "NJ", modify
    label def n_state 41 "NY", modify
    label def n_state 46 "PA", modify
    label def n_state 54 "TX", modify

  • #2
    Also, is there any approach to fixed this issue. I want to have the same number of observation for t, t-1, and t+1. Thanks!

    Comment


    • #3
      There's nothing wrong. It isn't broken and it can't be "fixed."

      Here's what's happening. Your variable EventIndicator is defined and non-missing for every observation. So, for example, in your example data, there are 100 observations of that variable.

      Now think about EventIndicator for t-1. For the first fyear for any gvkey, there is no t-1 year. So EventIndicator for t-1 (L1.EventIndicator in Stata syntax) does not exist for the first year for any gvkey. That is why there are only 89 observations for that: there is no observation for the first year in any gvkey, and your example has 11 gvkeys. So we end up with 100 - 11 = 89 observations.

      The same consideration applies to EventIndicator for t+1, except that this time it is the last year for any gvkey which fails to have a t+1 EventIndicator associated with it.

      This is inevitable whenever we deal with lags or leads. Each degree of lag or lead results in that number of missing obeservations at the earliest (resp. later) year(s) of any panel because the preceding (resp. following) year(s) don't exist.

      Comment


      • #4
        Thank you, Clyde, for the explanation! I asked this question because I compared the tables (table 5 and table 6) in the following paper and noticed that they have the same number of observations, "The economic impact of right-to-work laws: Evidence from collective bargaining agreements and corporate policies, Page 461-462." I was wondering what method the authors have adopted.

        Comment


        • #5
          I was wondering what method the authors have adopted.
          Yes, that is a very interesting question. I think you will have to ask them directly.

          Comment

          Working...
          X