Dear all,
I searched and find other posts (see below) on difference-in-difference topic, I want to ask a general setup question that might be of interests to many.
below I present to data structures that are common for Generalized difference-in-difference, can someone give a one line stata command for testing it
data structure 1: the shock is at industry level, sic is industry code, shock=1 signify industry experience a shock in that year, note, this is not the coded treat variable yet. my unit of analysis is firm year observation
data structure 2: the shock is at state level, shock=1 signify firms in that state experience a shock in that year, note, this is not the coded treat variable yet.
my unit of analysis is firm year observation
for simplicity i did not include other covariates, we can refer to them as xvars if needed.
#1. I would like to know if you code the treat dummy differently in these two scenarios ,
#2. in this discussion https://www.statalist.org/forums/for...reatment-group
Clyde recommended using
regress outcome i.treatment_group##i.pre_post other_covariates margins treatment_group#pre_post margins treatment_group, dydx(pre_post)
question 1: using my data structure 1, 2, would the pre_post dummy be coded differently, for example, if industry 3000 is shocked in 1991, pre_post is set to 1 from 1991 onward, is this a common practice ?
question 2: do we need control for time fixed effect? if so, do we need a
i.year term in the regression ?
if you could post a couple of lines for executing my described data, that will be greatly appreciated.
Rochelle
I searched and find other posts (see below) on difference-in-difference topic, I want to ask a general setup question that might be of interests to many.
below I present to data structures that are common for Generalized difference-in-difference, can someone give a one line stata command for testing it
data structure 1: the shock is at industry level, sic is industry code, shock=1 signify industry experience a shock in that year, note, this is not the coded treat variable yet. my unit of analysis is firm year observation
Code:
clear input int(firmid sic year) byte shock 1000 3000 1990 0 1000 3000 1991 1 1000 3000 1992 0 1000 3000 1993 0 1001 3100 1991 0 1001 3100 1992 0 1001 3100 1993 1 1002 3101 1991 1 1002 3101 1992 0 1002 3101 1993 0 end
my unit of analysis is firm year observation
Code:
clear input int firmid str2 state int year byte shock 1000 "NY" 1990 0 1000 "NY" 1991 1 1000 "NY" 1992 0 1000 "NY" 1993 0 1001 "NY" 1991 1 1001 "NY" 1992 0 1001 "NY" 1993 0 1002 "TN" 1991 0 1002 "TN" 1992 0 1002 "TN" 1993 0 end
#1. I would like to know if you code the treat dummy differently in these two scenarios ,
#2. in this discussion https://www.statalist.org/forums/for...reatment-group
Clyde recommended using
regress outcome i.treatment_group##i.pre_post other_covariates margins treatment_group#pre_post margins treatment_group, dydx(pre_post)
question 1: using my data structure 1, 2, would the pre_post dummy be coded differently, for example, if industry 3000 is shocked in 1991, pre_post is set to 1 from 1991 onward, is this a common practice ?
question 2: do we need control for time fixed effect? if so, do we need a
Code:
i.year
if you could post a couple of lines for executing my described data, that will be greatly appreciated.
Rochelle
Comment