I'm using panel data on public debt from 1980 to 2015. What I would like to do is a xtline overlay graph with attached country names for the highest debt in the first and in the last period.
I did it manualy, and it looks like this:
Array
I did it using the following commands
Code:
* identifying countries with highest debt summarize debt_snde if year==2015 local max = r(max) tabulate countryWDI if debt_snde == r(max) & year ==2015 summarize debt_snde if year==1980 tabulate countryWDI if debt_snde == r(max) & year ==1980 sort country year * plotting the data xtline debt_snde if year>=1980 , overlay legend(off) note("All Countries") ytitle("Debt to GDP ratio") /// tlabel(1980(5)2015) ylabel(,format(%14.0fc)) ttext(`max' 2015 "JPN" 318.93 1980 "GUY", place(n)) graph export "fig1-a.png", as(png) replace
Any help would be appreciated!
Thank you,
Vladimir
0 Response to Panel graph with country names attached
Post a Comment