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

Re: st: outsheeting highest frequency values

From   Philip Ryan <>
Subject   Re: st: outsheeting highest frequency values
Date   Thu, 27 Oct 2005 14:55:02 +0930

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.


At 11:56 PM 26/10/2005 -0500, you wrote:

Dear Statalisters,

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?


Best Regards,


*   For searches and help try:
Philip Ryan
Associate Professor,
Department of Public Health
Associate Dean (Information Technology)
Head, Data Management & Analysis Centre
Faculty of Health Sciences
University of Adelaide 5005
South Australia
tel 61 8 8303 3570
fax 61 8 8223 4075
CRICOS Provider Number 00123M
This email message is intended only for the addressee(s)
and contains information that may be confidential and/or
copyright. If you are not the intended recipient please
notify the sender by reply email and immediately delete
this email. Use, disclosure or reproduction of this email
by anyone other than the intended recipient(s) is strictly
prohibited. No representation is made that this email or
any attachments are free of viruses. Virus scanning is
recommended and is the responsibility of the recipient.

*   For searches and help try:

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