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 |
Nick Cox <njcoxstata@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: graphing ratio as a function of a continuous variable |

Date |
Fri, 22 Apr 2011 09:46:01 +0100 |

My interpretation is the same as Maarten's. The ratio 0/1 is not interesting and the ratio 1/0 is not useful, so it seems more likely that you are concerned with how the proportion of something varies. I'll add that Maarten's -proprcspline- (SSC) is a really splendid program for this purpose. If you want something more discrete, there is a worked example in the help for -stripplot- (SSC) which shows how a smooth summary can be superimposed on a strip plot of the indicator variable. Nick Maarten buis > From your describtion it looks like you have a proportion (which > is ofcourse a special case of a ratio) but from your example it > looks like you have a variable that only takes values 0 or 1 > which is typically not called a ratio but rather a indicator or > dummy variable. > > If the former is true I would just show a scatter plot with > your proportion on the y-axis and your continuous variable on > the x-axis. > > If the latter is true I would add a smooth average to the plot, > e.g. using Nick Cox's -rcspline- or my -proprcspline-. Both can > be downloaded from SSC by typing -ssc install rcspline- and > -ssc install proprcspline- respectively. Both commands allow the > -addplot()- option for extra overlaid graphs. Delahanty, Ryan >> In Stata 11 I'm trying to graph how >> the ratio of something (a 1 or a 0--say foreign and domestic >> in the auto dataset) varies as a function of a continuous >> variable (say price). Is there a good way to do this and >> simultaneously generate overlaid graphs? * * 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/

**References**:**st: graphing ratio as a function of a continuous variable***From:*"Delahanty, Ryan" <ryan.delahanty@vanderbilt.edu>

**Re: st: graphing ratio as a function of a continuous variable***From:*Maarten buis <maartenbuis@yahoo.co.uk>

- Prev by Date:
**[no subject]** - Next by Date:
**st: Xtabond2 problems** - Previous by thread:
**Re: st: graphing ratio as a function of a continuous variable** - Next by thread:
**st: midas sroc(pred)** - Index(es):