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

st: -tabsort- revised on SSC

From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: -tabsort- revised on SSC
Date   Fri, 3 Oct 2003 19:22:11 +0100

Thanks to Kit Baum, my program -tabsort- has 
been updated on SSC. 

For some reason which escapes me -- I think 
it just seemed sensible at the time -- this 
program is deemed part of two packages, 
-tabsort- and -tab_chi-. So you could install
either. (Or both, but there is no point to that.) 

The program -tabsort-

-tabsort- was written originally about 1998 as a 
wrapper for -tabulate- to work around the fact that 
you could not ask for rows or columns to be sorted. 

That is, suppose you want frequencies tabulated. 
You might want rows and/or columns sorted from 
high frequency to low frequency, or possibly vice 

Or suppose you want another variable summarized, 
so that means and/or sds are shown. 
You might want rows and/or columns sorted from 
high summary measure to low summary measure, 
or possibly vice versa. 

Now, in Stata 8, -tabulate- has a -sort- option, 
so it might seem that -tabsort- has lost its
rationale. However, that -sort- option does one thing only, 
produce one-way tables sorted from high frequencies
to low, so -tabsort- is not yet superseded. 

The prompt for this update was a bug fix. 
Lee Sieswerda alerted the list to what looked 
like a bug: the help file said there was 
an option -summarize()-; if you then 
typed that whole option name -summarize()- 
-tabsort- would squawk, as the option 
was implemented as -summari()-. This 
wasn't a bug when the program was written, 
due to a limit on the length of 
local macro names and what Stata then indulged. 
But it's a bug now, so the program has been fixed. 
Thanks to Lee for the report. 

Also, I brought it up-to-date to Stata 8 and 
found and fixed another bug, hitherto unreported. 

So, -tabsort- is now a Stata 8 program. 

In addition, both the -tabsort- package 
and the -tab_chi- package contain -tabsort6- 
which is a fixed version of -tabsort- that 
I hope will work on Stata 6 or Stata 7. 
(I no longer have a copy of Stata 6 
installed, but I'll respond to any problem 

-tabsort- and -tab_chi- packages

The -tabsort- package just contains 
-tabsort- and -tabsort6-. If you 
install on Stata 8, -tabsort- is the 
program to use. If you install on 
Stata 6 or 7, -tabsort6- is the program 
to use. (Stata 5 or below: sorry, no joy.) 

The -tab_chi- package contains other 
stuff as well, in the area of tabulation 
and chi-square tests. Mostly these programs 
all originated around 1998 as work-arounds 
or extras given various gaps in what 
-tabulate- provides. (Other tabulation 
programs which I've written since are in 
other packages. My favourites are 
-extremes-, -majority-, -groups-, 
-makematrix- and -tabcount-.) 

. ssc desc tab_chi 

gives the full picture for -tab_chi-, which is a little 
complicated. Old stuff which still works 
and is relevant to users of Stata 6 or Stata 
7 is maintained while it is not too much pain 
to keep it going; typically that 
means bug fixes, but no enhancements. 

Of the programs in -tab_chi-, -tabchi- and 
its immediate version -tabchii- are the nearest 
to being obsolete -- if you have Stata 8. But 
even -tabchi- can do things which -tabulate- 

(If you're thinking that this whole 
area of tabulation is really messy right now 
in Stata, with all these user-written bits
and pieces, on top of all the official 
commands: you're right.) 

[email protected] 

[email protected] 
*   For searches and help try:

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