Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: How to plot cdf after corrected kernel density


From   "Jain, Monica (HarvestPlus)" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: How to plot cdf after corrected kernel density
Date   Thu, 3 Oct 2013 20:45:55 +0000

I am using -kdens- and I do not know how to plot the cumulative distribution function. I am using Stata 13 for Windows.

I am using -kdens- to estimate kernel density correcting for bounded variables using linear combination method. I want to plot the cumulative distribution function for the estimated kernel densities. On one of the statlist threads (http://www.stata.com/statalist/archive/2005-04/msg00798.html), the following method has been suggested to plot them:

sysuse auto
_kdens mpg, g(b a) 
cumul b, g(cb)
line cb b, sort

With the above command, I get the densities on the x-axis, rather than the [x]. I looked all over the web to check if I can find how to do it, but I have not been successful. If I use the following command:

line cb a, sort 

I get weird triangle shaped graph.  

Monica Jain
Postdoctoral Fellow
HarvestPlus, IFPRI



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index