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

RE: st: Kdensity


From   dwagner@stata.com (Derek Wagner, StataCorp)
To   statalist@hsphsun2.harvard.edu
Subject   RE: st: Kdensity
Date   Tue, 09 Mar 2004 09:55:46 -0600

R.E. De Hoyos wrote:

> How can I graph two--or more--kdensities (using weights) in the
> same graph?

You can use the -twoway kdensity- command to graph more than one
kdensity in the same graph.  Although the help file for -twoway
kdensity- doesn't show a -weight- option, weights can indeed be
used with the command (the help file will be changed in a future
update).  Since you want more than one kdensity in the same
graph, you'll need to overlay two -twoway kdensity- graphs along
with a weight for each.  For example:

. tw kdensity var1 [w=weight1] || kdensity var2 [w=weight2]

You can find further information on -twoway kdensity- in [G]
-graph twoway kdensity-.

Derek Wagner
<dwagner@stata.com>
*
*   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/



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