Hi all!

I want to address the endogeneity issue in my paper.

I have panel data (gvkey and fyear). I create RTW indicator for states that adopted RTW laws.

I also create ChangeRTW to construct a treatment variable, which is a dummy taking the value of one if the firm (gvkey) is located in a certain state which will adopt RTW during my sample period (many states have already adopted this law before my sample period). I then create a dummy, Post, which is one after the adoption year.

For those states that already adopted this law:
gen RTW=state=="AL"|state=="AZ"|state=="AR"|state=="FL "|state=="GA"|state=="ID"|state=="IA"|state=="KS"| state=="LA"|state=="MS"|state=="NE"|state=="NV"|st ate=="NC"|state=="ND"|state=="OK"|state=="SC"|stat e=="SD"|state=="TN"|state=="TX"|state=="UT"|state= ="VA"|state=="WY"

For the states that adopt this law during my sample period:
replace RTW=1 if state=="IN" & fyear>2011
replace RTW=1 if state=="MI" & fyear>2011

gen ChangeRTW=state=="IN"|state=="MI"
gen Post=fyear>2011 if state=="IN"|state=="MI" (##not sure if I should use this instead: Post=fyear>2011)
replace Post=0 if Post==.

What are the best ways to create this difference in difference regression? Should I use something like the following one?

reg DependentVar ChangeRTW*Post*IndependentVar ChangeRTW Post IndependentVar Controls (model 1)

or reg DependentVar RTW*IndependentVar RTW IndependentVar Controls (model 2)


The results using model 1: I have three sets of statistics under ChangeRTW*Post*IndependentVar, 0 0; 1 0 ; 1 1. But the stats for 1 0 is empty. Why do I get this empty stats?

Similarly, the results using model 2: two sets of stats under RTW*IndependentVar, 0 and 1, but empty stats in the 1 group. Anyone can help me understand this issue?


Any advice on how to address the endogeneity issue or how to use difference-in-difference will be greatly appreciated!

See below for my data:

----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input double permno long(gvkey datadate) double fyear float(RTW ChangeRTW Post)
54594 1004 15399 2001 0 0 0
54594 1004 15583 2002 0 0 0
54594 1004 16130 2003 0 0 0
54594 1004 16495 2004 0 0 0
54594 1004 16770 2005 0 0 0
54594 1004 17044 2006 0 0 0
54594 1004 17683 2007 0 0 0
54594 1004 17775 2008 0 0 0
54594 1004 18231 2009 0 0 0
54594 1004 18596 2010 0 0 0
54594 1004 18961 2011 0 0 0
54594 1004 19327 2012 0 0 0
54594 1004 19601 2013 0 0 0
54594 1004 20057 2014 0 0 0
54594 1004 20605 2015 0 0 0
54594 1004 20788 2016 0 0 0
21020 1045 15521 2002 1 0 0
21020 1045 16070 2003 1 0 0
21020 1045 16161 2004 1 0 0
21020 1045 16709 2005 1 0 0
21020 1045 16891 2006 1 0 0
21020 1045 17347 2007 1 0 0
21020 1045 17713 2008 1 0 0
21020 1045 18170 2009 1 0 0
21020 1045 18443 2010 1 0 0
21020 1045 18717 2011 1 0 0
21020 1045 19723 2013 1 0 0
21020 1045 19904 2014 1 0 0
21020 1045 20453 2015 1 0 0
21020 1045 20544 2016 1 0 0
21020 1045 20909 2017 1 0 0
11499 1050 17074 2006 1 0 0
11499 1050 17531 2007 1 0 0
11499 1050 17897 2008 1 0 0
11499 1050 18078 2009 1 0 0
11499 1050 18627 2010 1 0 0
11499 1050 18992 2011 1 0 0
11499 1050 19174 2012 1 0 0
11499 1050 19723 2013 1 0 0
11499 1050 19813 2014 1 0 0
11499 1050 20178 2015 1 0 0
11499 1050 21000 2017 1 0 0
81912 1072 15613 2002 1 0 0
81912 1072 16070 2003 1 0 0
81912 1072 16436 2004 1 0 0
81912 1072 16891 2005 1 0 0
81912 1072 17256 2006 1 0 0
81912 1072 17531 2007 1 0 0
81912 1072 17805 2008 1 0 0
81912 1072 18170 2009 1 0 0
81912 1072 18535 2010 1 0 0
81912 1072 18992 2011 1 0 0
81912 1072 19266 2012 1 0 0
81912 1072 19539 2013 1 0 0
81912 1072 19904 2014 1 0 0
81912 1072 20361 2015 1 0 0
81912 1072 20727 2016 1 0 0
81912 1072 21000 2017 1 0 0
27991 1075 15613 2002 1 0 0
27991 1075 15978 2003 1 0 0
27991 1075 16252 2004 1 0 0
27991 1075 16526 2005 1 0 0
27991 1075 17166 2006 1 0 0
27991 1075 17439 2007 1 0 0
27991 1075 17713 2008 1 0 0
27991 1075 17987 2009 1 0 0
27991 1075 18352 2010 1 0 0
27991 1075 18992 2011 1 0 0
27991 1075 19174 2012 1 0 0
27991 1075 19539 2013 1 0 0
27991 1075 19813 2014 1 0 0
27991 1075 20178 2015 1 0 0
27991 1075 20727 2016 1 0 0
27991 1075 21000 2017 1 0 0
10517 1076 15430 2002 1 0 0
10517 1076 15978 2003 1 0 0
10517 1076 16436 2004 1 0 0
10517 1076 16801 2005 1 0 0
10517 1076 17166 2006 1 0 0
10517 1076 17256 2007 1 0 0
10517 1076 17897 2008 1 0 0
10517 1076 18170 2009 1 0 0
10517 1076 18535 2010 1 0 0
10517 1076 18717 2011 1 0 0
10517 1076 19174 2012 1 0 0
10517 1076 19631 2013 1 0 0
10517 1076 20088 2014 1 0 0
10517 1076 20453 2015 1 0 0
10517 1076 20727 2016 1 0 0
10517 1076 21000 2017 1 0 0
20482 1078 15705 2002 0 0 0
20482 1078 15795 2003 0 0 0
20482 1078 16344 2004 0 0 0
20482 1078 16709 2005 0 0 0
20482 1078 16982 2006 0 0 0
20482 1078 17256 2007 0 0 0
20482 1078 17897 2008 0 0 0
20482 1078 18262 2009 0 0 0
20482 1078 18535 2010 0 0 0
20482 1078 18992 2011 0 0 0
end
format %d datadate
------------------ copy up to and including the previous line ------------------