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

From |
David Airey <david.airey@Vanderbilt.Edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: -triplot- updated on SSC |

Date |
Wed, 4 Feb 2009 13:57:23 -0600 |

-Dave On Feb 4, 2009, at 1:17 PM, Nick Cox wrote:

Thanks to Kit Baum as usual, the -triplot- package has been updated onSSC. Stata 9 is required. Use -ssc- to install or update ifinterested.-triplot- is for triangular plots suitable for three variables thataddto a constant. Examples are three proportions adding to 1 or equivalently three percents adding to 100%. Given the constraint ofadding to a constant, there are really only two pieces ofinformation ineach observation for those variables and so a projection onto two dimensions loses nothing. Several other names are in use for the same plot, although many programs in different languages use the same name -triplot-, as Google shows. I talked about this kind of plot at the 2008 London meeting, and as mentioned then as an intention, I now have updated it so that it supports -by()-. That raises more general points relevant to some issues discussed last month in a thread on graphics programming started by Timothy Mak.-triplot- shows data within a triangular frame, but to Stata it isjusta -twoway- plot. The explanation is mundane. I use standard options tosuppress the x and y axes and their various decorative ticks andlabels.I then define the triangular axes and their decorations using otherstandard features to put lines, ticks (short lines) and labels(text) atprecisely the right places. All the syntax is documented here andtherein the Stata graphics manual. I really shouldn't explain thisbecause itwill seem all too obvious when made plain.The previous version did not support -by()- because the previousversionput the information for the axes etc. in the first few observations being used. When -by()- was invoked, that information would end uparbitrarily in one or other panel producing a bizarre effect. Youmightsee a side of a triangle here and the other two sides in anotherpanel,and so on. It would not be echoed to every panel as required. Theupshotwas that I trapped calls to -by()- with an error message. It took me a few years to realise that using -scatteri- and its relatives accessible by -recast()- would produce the echoing I needed.So I rewrote the program to do that. The more general program isalmost100 lines shorter, as so often happens.I toyed with the idea that defining axes of triangular plots asclassesin Stata might possibly yield a neater solution to some other small problems, but a few minutes' conversation with Vince Wiggins of StataCorp disabused me of that idea. In short, not only are the undocumented features unnecessary, trying to use them would make the programming problem far more difficult than need be. Naturally, that doesn't rule out classes being vital for other problems.So, the moral is ancient: Almost anything graphical can be plottedas a-twoway- plot if you try hard enough. (However, I wouldn't try to draw pie charts like that.) Nick n.j.cox@durham.ac.uk * * 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: -triplot- updated on SSC***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**References**:**st: -triplot- updated on SSC***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**st: semi/non-parametric estimation - 'sneop' applicable to panel data?** - Next by Date:
**RE: st: time efficient way to choose variables** - Previous by thread:
**st: -triplot- updated on SSC** - Next by thread:
**RE: st: -triplot- updated on SSC** - Index(es):

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