I wish to draw a histogram with a normal density plot and a line indicating the mean value. I am using Stata 18
I have used the following code (to obtain the mean value) and try to draw the normal density plot (dlwg6 is the continuous variable of interest)
summ dlwg6
local a= r(mean)
hist dlwg6, normal gap(5) xline(`a')
however with the above command I get the plot without the xline
But if I omit the normal density option I get the histogram with the xline at the mean value - it seems I can have one but not both!
I have used the following code (to obtain the mean value) and try to draw the normal density plot (dlwg6 is the continuous variable of interest)
summ dlwg6
local a= r(mean)
hist dlwg6, normal gap(5) xline(`a')
however with the above command I get the plot without the xline
But if I omit the normal density option I get the histogram with the xline at the mean value - it seems I can have one but not both!
Comment