Hello everyone,
I am currently working on an DID analysis of my dataset and require to plot a parallel trend assumption plot.
My data is structured as followed:
The goal is to plot the mean of the variable DivPerShare for the groups where treated == 0 and treated == 1 respectively for the years 2007-200x. I inserted just a few lines of the dataset here.
I found out that I most likely have to use something like -collapse- in order to get something like a mean for each year over all companies in group "treated == 0" before i can plot that.
I went through this thread https://www.statalist.org/forums/for...end-assumption
already but somehow could not understand how to apply this to my specific case.
If you need more information I am happy to provide more details.
Maybe someone here has some experience with that and can help me out.
Thank you in advance for any help!
Best
I am currently working on an DID analysis of my dataset and require to plot a parallel trend assumption plot.
My data is structured as followed:
Code:
. list CompanyName time xDivPerShare treated in 1/40 +-----------------------------------------------------+ | CompanyName time xDivPe~e treated | |-----------------------------------------------------| 1. | Comp1 2007 0.25 1 | 2. | Comp1 2008 0.4 1 | |-----------------------------------------------------| 11. | Comp2 2007 0 1 | 12. | Comp2 2008 0.13 1 | |-----------------------------------------------------| 21. | Comp3 2007 .11 0 | 22. | Comp3 2008 .7 0 | |-----------------------------------------------------|
The goal is to plot the mean of the variable DivPerShare for the groups where treated == 0 and treated == 1 respectively for the years 2007-200x. I inserted just a few lines of the dataset here.
I found out that I most likely have to use something like -collapse- in order to get something like a mean for each year over all companies in group "treated == 0" before i can plot that.
I went through this thread https://www.statalist.org/forums/for...end-assumption
already but somehow could not understand how to apply this to my specific case.
If you need more information I am happy to provide more details.
Maybe someone here has some experience with that and can help me out.
Thank you in advance for any help!
Best
Comment