May 21, 2021

Replicating Economist Chart with Range Plot

In our recent paper, we expected government spending across countries to increase in 2020 as a response to the COVID pandemic, and to also fund programs that protect people, jobs, and businesses during the recession caused by the pandemic. Once economies start to bounce back in 2021, government spending is expected to fall for the next couple of years.

This has been analyzed by the Economist, and below I am replicating one of the charts they presented. For this one, I am using data from IMF's World Economic Outlook.


Codes are as follows:

keep if year>=2019 & year<=2021
keep if country=="Indonesia" | country=="Malaysia" | country=="Philippines" | country=="Vietnam"
egen low=min(debt),by(country)
egen high=max(debt),by(country)
reshape wide debt, i(countrylow high) j(year)
egen cty=group(country)
labmask cty, val(country)

#delimit ;
twoway
(rcapsym high low cty, horizontal lcolor(black) msym(none))
(scatter cty debt2019, msym(S) msize(large) mcolor(ebblue))
(scatter cty debt2020, msym(S) msize(large) mcolor(cranberry))
(scatter cty debt2021, msym(S) msize(large) mcolor(gold))
,
title("{bf:Governments wants to slow debt}" "{bf:expansion after jump in 2020}", justification(left) pos(11) span)
subtitle("(public debt as a % of GDP)", justification(left) pos(11) span)
ylab(1(1)4, valuelabel grid gmin gmax angle(0) noticks nogextend labsize(large))
ysca(lcolor(none) reverse)
ytitle("")
xlab(0(20)80, grid gmin gmax noticks labsize(large))
xsca(lcolor(none) alt)
xline(0, lcolor(black))
xsize(4)
plotregion(lcolor(none))
legend(order(2 "2019" 3 "2020" 4 "2021") row(1) pos(11) size(large) region(lcolor(none)) span)
note(" " "Source: IMF World Economic Outlook.", span size(medium))
;
#delimit cr