Statalist The Stata Listserver

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

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

From   "Svend Juul" <SJ@SOCI.AU.DK>
To   <>
Subject   st: RE: tabulate - displaying value labels and numeric codes
Date   Thu, 15 Mar 2007 12:34:02 +0100

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:

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