Statalist


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

Re: st: Display ValuesLabels and NumericCodes in Tabulate Tables


From   "Eva Poen" <[email protected]>
To   [email protected]
Subject   Re: st: Display ValuesLabels and NumericCodes in Tabulate Tables
Date   Tue, 22 Jul 2008 16:32:52 +0100

Another option is to use -numlabel-.

Example:

sysuse auto
numlabel origin, add mask("[#] ")
tab foreign rep78

-numlabel- adds the corresponding codes to the value label; thus, both
code and label will be displayed whenever you -tabulate- or -list-
(etc.) your data. This is permanent for the session and will be saved
if you save the data.  To undo it, use

numlabel origin, remove mask("[#] ")

Obviously, you can change the brackets [] to your liking.

I personally like to have code and label visible; therefore I tend to
use -numlabel- without a label list at the top of my do-files, in
order to apply it to all of my value labels.

Hope this helps,
Eva


2008/7/22 Richard Williams <[email protected]>:
> At 09:41 AM 7/22/2008, Chao Yawo wrote:
>>
>> Hi,
>>
>> Is it possible for Stata to display both numeric codes and value labels in
>> Tabulate tables. Currently, Tabulate has a "nolabels" option that toggles
>> the codes.
>>
>> I searched the FAQ, but found no pointers.  I would appreciate further
>> leads.
>>
>> thanks - CY
>
> For one-way tabulations, you can use Weesie's -tabl- command.  See
>
> net describe tabl, from(http://www.fss.uu.nl/soc/iscore/stata)
>
> Example:
>
> . sysuse auto
> (1978 Automobile Data)
>
> . tabl foreign
>
> foreign (Car type)     code  |   freq
> -----------------------------+--------
>          Domestic       0   |     52
>           Foreign       1   |     22
> -----------------------------+--------
>                     Total   |     74
>
> .
>
>
>
> -------------------------------------------
> Richard Williams, Notre Dame Dept of Sociology
> OFFICE: (574)631-6668, (574)631-6463
> HOME:   (574)289-5227
> EMAIL:  [email protected]
> WWW:    http://www.nd.edu/~rwilliam
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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