Hi everyone,
I am trying to do DID with multiple periods.
My dataset is a panel data (from 1960 to 1980) and contains:
- outcome variable ("aue_total_ha")
- geographical scale of my study is local government areas ("lgacodes").
- "dummy_general" that receives the value of 1 in the year that that local government area was treated and 0 if it is not yet treated.
- "treat" that receives the value of 1 if that local government area was ever treated (doesn't matter the year) and 0 if those local government areas was never treated
"first_treat" receives the year (e.g. 1973) that that local government area was first treated, and zero for local government areas that were never treated.
- I also have a climate variable ("sum_precipitation")
My questions are: how do I make a graph and test for parallel trend? Currently I am using:
// Graph
lgraph aue_total_ha year, by(treat),, legend(order(1 "Controls" 2 "Treated") size(small) )
but I would like to control for "sum_precipitation". Is that possible?
// Test parallel trend and DID
csdid aue_total_ha sum_prec, ivar(lgacodes) time (year) gvar(first_treat) method(drimp)
estat pretend
Is there any other way to test for parallel trend? Am I applying csdid command correctly?
Many thanks,
Related Posts with Graph parallel trend for DID with multiple periods and csdid
Allow Stata to continue with do file after invoking shellI am attempting to write a do file that launches several subsidiary do files in the background using…
Creating ordered pairs of smaller datasets based on a larger datasetDear all, Assume that we have a dataset that looks like this: Code: input str10 firm_id int year …
Help! How to combine different observations into one observation?Hi Statalists! So I am currently working on this project about intergenerational income persistence,…
how to change a label value name?Hi Statalists- I wanted to change the name of a label value, but Stata does not allow me to change …
Ordered Probit and IVHi, in my model, my dependent variable is ordered and there is also a problem of endogeneity on it. …
Subscribe to:
Post Comments (Atom)
0 Response to Graph parallel trend for DID with multiple periods and csdid
Post a Comment