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 simultaneously


From   "Maarten Buis" <[email protected]>
To   <[email protected]>
Subject   st: RE: tabulate - displaying value labels and numeric codes simultaneously
Date   Thu, 15 Mar 2007 09:46:33 +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...)

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 ---------
(For more on how to use examples I sent to the Statalist, see 
http://home.fsw.vu.nl/m.buis/stata/exampleFAQ.html )

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology 
Vrije Universiteit Amsterdam 
Boelelaan 1081 
1081 HV Amsterdam 
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room Z434 

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------



*
*   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