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: Multiple density plots, rotated and distributed on x-axis
From
Venable <[email protected]>
To
[email protected]
Subject
st: Multiple density plots, rotated and distributed on x-axis
Date
Mon, 1 Aug 2011 14:26:48 -0400
Dear Statalist,
I would like to create a graph that contains several kernel density
plots, but with the plot rotated 90% right from the usual orientation,
and with each plot aligned to a point on the x axis.
To be more concrete (borrowing an example from Angrist and Pischke,
Mostly Harmless Econometrics, Figure 3.1.1), suppose I wanted to show
the distribution of incomes in the US at different levels of eduction,
e.g. 8 years, 12 years, 14, 16, etc. The x-axis of the graph would be
years of education and the y axis the level of income. Above each
year, there would be a kernel density plot of incomes for that year,
with each rotated to the right, so that the "height" (density) is
horizontal distance.
An additional bonus would be to be able to mark a few quantiles on
each density and connect these between years. For example, mark the
25th, median and 75th percentile for each year and have these points
connected.
Is this possible in Stata?
I fear I may not be explaining this well in words, in spite of the
fact that it is very easy to show as a picture. Unfortunately Figure
3.1.1 is not available in the Google Preview version of Mostly
Harmless Econometrics, so I have posted a simple hand-drawn version
here:
http://dl.dropbox.com/u/2937392/density-plot-sketch.pdf
Many thanks.
*
* 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/