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 at the end of May, and its replacement, is already up and running.

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

st: Multiple density plots, rotated and distributed on x-axis

From   Venable <>
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

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

Many thanks.

*   For searches and help try:

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