Sean 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?
Something along the line of
. preserve
. foreach var of varlist v1-v20 {
. gen n = !mi(`var')
. collapse (count) n, by(`var')
. sort n
. outsheet `var' using `var'.tsv in 1/10
. restore, preserve
.}
You might also use some -listtex- instead of -outsheet- to produce the
frequency tables.
Many regards
uli
--
[email protected]
+49 (030) 25491-361
*
* 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/