Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: -triplot- revised on SSC


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: -triplot- revised on SSC
Date   Fri, 30 Jan 2004 11:36:08 -0000

Thanks to Kit Baum, -triplot- has been revised for Stata 8 on SSC. 

To install, type 

. ssc inst triplot

or 

. ssc inst triplot, replace 

as in the case may be. 

-triplot- produces a triangular plot of three variables with
constant sum, which are plotted on the sides of an equilateral
triangle. Most commonly, three fractions or proportions add to 1,
or three percents add to 100. The constraint that the three
variables have a constant sum means that there are just two
independent pieces of information. Hence it is possible to plot
observations in two dimensions. 

Triangular plots appear under various names in the literature,
including trilinear, triaxial, three-element maps, ternary,
reference triangles, percentage triangles, mixture, facies,
barycentric.  The idea appears to go back at least to the
invention of barycentric coordinates by M�bius (he of the twisted
band with just one side) and is thus, at a minimum, almost two
centuries old. Geologists often use them, while soil scientists
describe soil texture in terms of clay, silt and sand fractions.
Some political scientists appear fond of such plots given the
extent to which elections in many countries can be summarised in
terms of (e.g.) two major parties and a miscellaneous assortment
of others. 

More clearcut are genetic examples with data on the proportions of
three genotypes. David Clayton pointed out to me that for a
diallelic locus, the frequencies of the three genotypes aa, aA and
AA can be so represented, with Hardy-Weinberg equilibrium
 
P(aa) = (1-p)^2 
P(aA) = 2p(1-p) 
P(AA) = p^2
 
defining a parabola within the triangle. And there are naturally
other applications. 

The previous version of -triplot- was based on -gph- and written
for Stata 6. That version, plus a bug fix, is now renamed
-triplot6- and remains available in the -triplot- package for
users of Stata 6 or Stata 7, but it will not be further developed,
at least not by me.

The new -triplot- in contrast is written on top of the new
graphics released in Stata 8. Contrary to any appearances, it is
just a -twoway- plot. In the rewriting, some options of the old
-triplot- were dropped as now irrelevant, and some were dropped as
just a complication too far.  I would like to have kept connection
by arrows, but I'm hoping that eventually StataCorp will support
that directly. 

In total, -triplot6- is almost but not completely superseded by
the new -triplot-. On the whole, however, as the new -triplot- is
linked to the new graphics, users have more handles to tweak their
triangular plots.  -triplot- is a dwarf on the shoulders of a
giant (a hobbit on the shoulders of an ent?).

-triplot- will be further developed. In current work I'm
implementing as an option a transformation described by Graham
Upton in a paper in _The American Statistician_ in 2001.

Nick 
[email protected] 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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