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
2SLS with two-way fixed effect and clustered error.Hi, I am a Stata beginner. I want to use xtivreg2 to do a 2SLS estimation with two way fixed effect…
Loop?I want to replicate this code up to stateid==32; from 1 to 32. How can I do this without typing it o…
Include labels after margins pwcompare matrixFirst time poster. Apologies for errors. I'm wondering if there's a way to grab the labels along wit…
Help: Can't format xtline plotDear community, I'm having three simple issues with with an 'xtline' plot. My plot looks as follow…
1-step gmm-sys VS. 2-stepDear all, Estimating a gmm-system model with xtabond2, N=36 T=6, I got results that showed smaller …
Subscribe to:
Post Comments (Atom)
0 Response to Graph parallel trend for DID with multiple periods and csdid
Post a Comment