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

st: Tabulate in reverse order of row and column values


From   Garry Anderson <g.anderson@unimelb.edu.au>
To   statalist@hsphsun2.harvard.edu
Subject   st: Tabulate in reverse order of row and column values
Date   Fri, 25 Feb 2005 15:58:06 +1100

Hi,

Hi,

I wish to display a 2 x 2 table, but with the rows and columns displayed in
reverse order of the values. There is a sort option, but sort displays the
rows in descending order of frequency (and ascending order of the variable
within equal values of frequency).

If I have two variables (row and column) with values of 0 or 1 and I do
-tab row column-

I obtain
0 1
0 d c
1 b a

I would prefer
1 0
1 a b
0 c d

I could recode, but an option in tab would be the preferred solution to
reverse the ordering on either or both of the rows and columns. This reverse ordering is used by epitab commands such
as csi. It is usual to have exposed coded as 1, and diseased coded as 1.
Any suggestions would be much appreciated

Cheers, Garry

*
* 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index