Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * Kernel density plot
- * realearnings base month is December 2016.
- gen earnings202002 = realearnings/100*115.2
- * now the base month is February 2020.
- gen learnings202002 = asinh(earnings202002)
- label variable learnings202002 "Monthly earnings (Feb 2020 rands)"
- * use bracketweight for earnings analysis (see the PALMS User Guide)
- capture kdens
- if _rc == 199 {
- ssc install moremata
- ssc install kdens
- }
- summ earnings202002 [aw=bracketweight], detail
- scalar MEDIAN = round(r(p50))
- scalar lMEDIAN = log(MEDIAN)
- scalar TOTALMEAN = round(r(mean))
- scalar lTOTMEAN = log(TOTALMEAN)
- kdens learnings202002 if earnings202002 > 40 & earnings202002 < 300000 [pw=bracketweight], ci name("total", replace) xline(`=scalar(lTOTMEAN)', lc(lime) lp(dash)) xline(`=scalar(lMEDIAN)', lc(blue)) note("Dashed light-green line shows mean monthly earnings (R`=scalar(TOTALMEAN)')." "Solid blue line shows median monthly earnings (R`=scalar(MEDIAN)')." "Source: QLFS 2017 Q4") xlabel(4.605 "100" 6.908 "1 000" 9.21 "10 000" 11.513 "100 000") scale(1.1) title("Total earnings distribution in SA (2017 Q4)") // -kdens- uses the optimal bandwidth, and can generate the confidence intervals automatically
- graph export "QLFS2017Q4 total earnings distribution.pdf", replace
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement