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

st: Kdensity functions on the axes of a scatterplot


From   "Daniel Egan" <heteroskedastic@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Kdensity functions on the axes of a scatterplot
Date   Fri, 2 Apr 2004 14:55:20 -0500

I am interested in creating a scatterplot graph which would include kdensity
functions aligned along the respective variable axes. This could also be
(less functionally done) using scatter points along the axes to indicate
frequency, but this is not optimal.

The command lines below are as close as I have come to what I want, but I
would guess that there is some form of tick rule that could be used to
create these, or at least I hope.
sysuse auto

gen xnought = 130

gen ynought = 30

twoway (scatter turn length, msymbol(circle) msize(medium)) (scatter ynought
length, sort msymbol(circle) msize(vsmall)) (scatter turn xnought,
msymbol(circle) msize(vsmall))



What I would very much like to end up with is a kdensity function on both
axes, similar to the one created for the x-axis using:
twoway (scatter turn length, msize(vsmall)) (kdensity length, yaxis(2) epan
clpat(shortdash) clwidth(vthin)) (scatter turn xnought), yscale(range(0.0
2) axis(2))

Since the above command line uses up the right axes, I would prefer not to
use it if possible.  I am using StateSE 8.



Thanks  in advance,

Daniel Egan
*
*   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