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]

From |
"Widerstedt Barbro" <Barbro.Widerstedt@tillvaxtanalys.se> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
RE: st: Several quantile plots in one diagram |

Date |
Wed, 21 Apr 2010 14:11:01 +0200 |

Thank you, that worked very well, but does this mean that the lazy-girl, no-think option is not available then :) ? -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Maarten buis Sent: den 21 april 2010 11:49 To: statalist@hsphsun2.harvard.edu Subject: Re: st: Several quantile plots in one diagram --- On Wed, 21/4/10, Widerstedt Barbro wrote: > I have a panel dataset with 6 years, and I would like to > plot the distribution of a variable in a quantile plot > for each year in this panel. I have installed quantil2, > which causes Stata to shut down when I try to save the > graph. There seems to be upgrades (quantil2 is pretty > old), but because of firewall restrictions on the remote > workstation where Stata resides, I can't search or > install from STATA. I can't find the update qplot or > other updrage mentioned in e.g. Stata Journal > 2006(4) on SSC. Where can I find this functionality? > (I use Stata 10) You can always recreate the graph from first principle. In the example below I assume you want to display these distribution in the same plot. This plot is basically just a scatter plot. All you need to do is create the so called "plotting positions", that is, the values on the x-axis. This is discussed in this Stata FAQ: <http://www.stata.com/support/faqs/stat/pcrank.html> In the example below the rep78 variable takes the place of your year variable. *-------------- begin example --------------------- sysuse auto, clear recode rep78 1/2=3 // create plotting positions gen byte mis = missing(price,rep78) bys rep78 mis (price) : gen int i = _n if mis == 0 bys rep78 mis : gen int n = _N if mis == 0 gen hazen = (i - .5) / n twoway scatter price hazen if rep78 ==3 || /// scatter price hazen if rep78 ==4 || /// scatter price hazen if rep78 ==5, /// legend(order(1 "Average" /// "or worse" /// 2 "Good" /// 3 "Excellent" )) /// xtitle("fraction of the data") /// ytitle("quantiles of price") *--------------- end example ------------------------ (For more on examples I sent to the Statalist see: http://www.maartenbuis.nl/example_faq ) Hope this helps, Maarten -------------------------- Maarten L. Buis Institut fuer Soziologie Universitaet Tuebingen Wilhelmstrasse 36 72074 Tuebingen Germany http://www.maartenbuis.nl -------------------------- * * 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/

**Follow-Ups**:**RE: st: Several quantile plots in one diagram***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**RE: st: Several quantile plots in one diagram***From:*Maarten buis <maartenbuis@yahoo.co.uk>

**References**:**st: Several quantile plots in one diagram***From:*"Widerstedt Barbro" <Barbro.Widerstedt@tillvaxtanalys.se>

**Re: st: Several quantile plots in one diagram***From:*Maarten buis <maartenbuis@yahoo.co.uk>

- Prev by Date:
**st: AW: How to Use Statalist** - Next by Date:
**RE: st: Several quantile plots in one diagram** - Previous by thread:
**Re: st: Several quantile plots in one diagram** - Next by thread:
**RE: st: Several quantile plots in one diagram** - Index(es):