Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Tabulate with codes *and* value labels?


From   n j cox <[email protected]>
To   [email protected]
Subject   Re: st: Tabulate with codes *and* value labels?
Date   Fri, 08 Sep 2006 15:01:52 +0100

This is the purpose of -numlabel-, in official Stata for a couple
of versions now.

Nick
[email protected]

Mike Lacy

I often find I would like a simple oneway tabulation that shows both
the numeric codes and the labels for a variable, not just or the
other. This is quite useful before and after a recode, for example.
I'm thinking of something like the following mocked-up trivial
example, in which 0 and 1 as well as "foreign" and "domestic" show up
in the tabulation:

    Car type |      Freq.     Percent
------------+--------------------------
Domestic  0 |         52       70.27
  Foreign  1 |         22       29.73
------------+--------------------------
       Total |         74      100.00


For some time I was convinced an answer to this question must lie
somewhere in the archives, but I must not have hit the right
combination of keywords if it is. Since I gather there is no built-in
solution, could someone at least sketch how to make a program to
obtain the value label associated with a given variable, and display
that info. in a nice way?

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