Statalist The Stata Listserver

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

Re: st: RE: tabulate - displaying value labels and numeric codes

From   "Daniel Stegmueller" <>
Subject   Re: st: RE: tabulate - displaying value labels and numeric codes
Date   Thu, 15 Mar 2007 14:43:32 +0100

Svend, Maarten and Ben:
nice, as always!

I do, however, prefer a solution where I don't need to alter the data,
so I will give -tabl- a try...


2007/3/15, Svend Juul <>:
Daniel Stegmueller wrote:
> I invoke the following sequence of commands quite regularly: - tab x-
> followed by -tab x, nolabel-  in orer to see value labels and their
> numeric counterparts.
> Is there a quick way(i.e. has anybody written an ado...) to display
> both simultaneously (without using -codebook- of course...)

Then Maarten wrote:
The easiest way is to add the numeric values to the value labels, which
can be easily done with the -numlabel- command. In the example below I
do that for all variables: -label dir- stores all names of value labels
in r(names) and -numlabel- adds the numeric values to the labels.

*--------- begin example -------
sysuse nlsw88, replace
tab race
label dir
numlabel `r(names)', add
tab race
*--------- end example ---------

It can be made simpler. The single command:
   numlabel , add
adds numbers to all value labels.


Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6
DK-8000  Aarhus C, Denmark
Phone: +45 8942 6090
Home:  +45 8693 7796

*   For searches and help try:

*   For searches and help try:

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