I'd like to calculate a statistic, store that statistic, and use it in a graphics command. For example, I calculate the mean, store that mean as a scalar, and would like to plot an xline in a density plot at that mean value.
I see that xline only excepts numlists. Is there a workaround?
A reproducible example:
Returns the following error "invalid line argument, mp"
I see that xline only excepts numlists. Is there a workaround?
A reproducible example:
Code:
sysuse auto.dta, clear sum price scalar mp=r(mean) kdensity price, xline(mp)
Comment