Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: RE: how to draw several kdensity curves in one graph


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: how to draw several kdensity curves in one graph
Date   Tue, 2 Mar 2010 22:46:45 +0100

<>

*******
clear*
set obs 5
gen byte year=_n
expand 1000
gen income=rchi2(5)+year
twoway (kdensity income if year==1) (kdensity income if year==2)  /* 
 */ (kdensity income if year==3) (kdensity income if year==4)  /* 
 */ (kdensity income if year==5)
*******


HTH
Martin


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of G. Dai
Sent: Dienstag, 2. März 2010 22:04
To: statalist@hsphsun2.harvard.edu
Subject: st: how to draw several kdensity curves in one graph

dear all,
I have income observation from several different years. For each year, I
can
easily draw a density curve by using kdensity. however, I'd like to have the
distribution
curves for different years on the same graph. how can I achieve that?
regards,
Guang

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


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


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index