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,
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,
Comment