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

RE: st: outsheeting highest frequency values


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: outsheeting highest frequency values
Date   Thu, 27 Oct 2005 16:07:44 +0100

I recommend against labelling any questions "quick". 
It is at best superfluous and at worst irritating. 

On the answers: 

-tabsort- lost some, but not all, of its usefulness
when -tabulate- acquired a -sort- option to do 
some of what -tabsort- can do. 

In addition to other solutions, check out -groups-
on SSC. 

Nick 
n.j.cox@durham.ac.uk 

Philip Ryan
 
> You could use Nick Cox'  -tabsort-  command, then select the 
> part of the 
> ordered table  that you want from the Results window, do a Copy Table 
> (Shift-Ctrl-C) from the Edit menu, and paste into Excel.  
> There will be a 
> bit of column deletion to do in Excel, getting rid of the unwanted (I 
> presume) percents and cumulative percents.
> 
> This is a variable by variable solution.  You could automate 
> the first part 
> (the sort-by-frequency tabulations) by using a -foreach- loop 
> on -tabsort-, 
> but the copying and pasting is still manual.  With only 20 
> variables this 
> might be manageable.
> 
> There would be cleverer, more automated, solutions involving a bit of 
> programming and output into a matrix, I expect.

> >I have a quick question: there are 20 variables, and I want to tab
> >each variable's values in frequency from high to low, and exporting
> >each variable's first 10 highest frequency values into a spreadsheet.
> >What commands am I supposed to use?

*
*   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