No randomness; -kdensity- by default uses a grid.
Or at least that's what I remember. But how about
su mpg, meanonly
kdensity mpg, xli(`r(mean)', lpa(dash))
Nick
[email protected]
Dimitriy V. Masterov
> Is there a way to insert a line at mean(x) using -twoway
> (kdensity x)-
> without using the kdensity univariate kernel density
> estimation to create
> the variables first? The reason I am asking this question
> is that in my
> understanding the mean of variable x is not necessarily the
> mean of the
> set of points over which the density is estimated, which is
> constructed
> by sampling randomly from the variable x (as defined by the
> n(i) option
> where i is the size of the set).
>
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/