Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: inserting a mean in graph twoway kdensity

From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: inserting a mean in graph twoway kdensity
Date   Fri, 31 Oct 2003 16:03:20 -0000

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)) 

[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:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index