I want to make a density curve, so I'll do this:
Code:
sysuse auto, clear kdensity mpg, gen(x y) at(mpg) nograph // Density curve twoway (line y x, sort)
Code:
// Label density curve
qui sum mpg, detail
local median `r(p50)'
twoway (line y x, sort) ///
(scatteri .015 `median' "`median' is the median") ///
, legend(off)Array
Is there a way to do that not in MS Paint?
Bonus question: I want to add a vertical line to the plot:
Code:
twoway (line y x, sort) ///
(scatteri .015 `median' "`median' is the median") ///
, legend(off) xline(`median', lcolor(gs6))Thanks so much
Go
0 Response to Labeling a density curve
Post a Comment