Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Using Value Labels to Label Variables


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Using Value Labels to Label Variables
Date   Tue, 3 Feb 2009 19:46:29 -0000

There are several ways to tackle this. 

1. Don't use -xi:-. Create your dummies upstream, e.g. using -tabulate-. Then their variable labels will be explanatory. 

2. Check out -dummieslab- from SSC by P. van Kerm and another. 

3. Write a loop to map value labels to variable labels. Given 1 and 2, I won't spell that out here. 

4. No doubt others.  

Nick 
[email protected] 

Thomas

Suppose I have this value label assigned to the variable totavmte_q:

totavmte_q_lab:
           1 <=Q1 (43.25)
           2 Q1 to <=Q2 (64.35)
           3 Q2 to <=Q3 (96.54)
           4 >Q3

and I want to regress:

xi: logistic status i.totavmte_q

Stata will nicely create the following dummies:

_Itotavmte__2 
_Itotavmte__3 
_Itotavmte__4

Now I want to label the dummy variables so that they reflect the value
labels

e.g. 
. label variable _Itotavmte__2 "Q1 to <=Q2 (64.35)"

I am wondering if there is a way to label the dummy variables by way of
referencing their associated value labels (these var labels will be used in
the contest of the user-written estout program).


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