Dear All
I am rephrasing a post sent few days ago and had no response. I also attach a paper that shows a similar graph:
I have annual data with firm id(id) and year(yr) , an earnings variable (earnings); and another variable (writeoff) which has a value when the firm records a write off ( a type of expenses) and zero when there is no write off.
I want to have a graph that shows the mean of the earnings variable inter-temporally i.e. before and after the write off event.
Specifically, I want to visualize mean earnings over three years before and after the firm records write-off, using a two-way scatter with connected lines such as :
twoway(scatter mean_writeoff yr, connect(1) sort)
On the Y axis , I should have the mean earnings values , and on the X axis, I should have t-3, t-2, t-1 , t , t+1 , t+2, t+3 , where year t is the yer when the firm recorded a write off.
I calculated the mean value as :
sum writeoff
egen mean_writeoff=mean(writeoff) if writeoff !=0, by(yr)
I am not sure how to proceed to get the results I wanted....
I attach two paper Johnson et al 2011 where graph (3) has the exact idea.
Any help ?
Regards
I am rephrasing a post sent few days ago and had no response. I also attach a paper that shows a similar graph:
I have annual data with firm id(id) and year(yr) , an earnings variable (earnings); and another variable (writeoff) which has a value when the firm records a write off ( a type of expenses) and zero when there is no write off.
I want to have a graph that shows the mean of the earnings variable inter-temporally i.e. before and after the write off event.
Specifically, I want to visualize mean earnings over three years before and after the firm records write-off, using a two-way scatter with connected lines such as :
twoway(scatter mean_writeoff yr, connect(1) sort)
On the Y axis , I should have the mean earnings values , and on the X axis, I should have t-3, t-2, t-1 , t , t+1 , t+2, t+3 , where year t is the yer when the firm recorded a write off.
I calculated the mean value as :
sum writeoff
egen mean_writeoff=mean(writeoff) if writeoff !=0, by(yr)
I am not sure how to proceed to get the results I wanted....
I attach two paper Johnson et al 2011 where graph (3) has the exact idea.
Any help ?
Regards
Comment