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

Re: st: Labeling values of variables

From   Philipp Rehm <>
Subject   Re: st: Labeling values of variables
Date   Thu, 14 Feb 2008 09:35:40 -0500

This doesn't do exactly what you want, but may be helpful.
I tend to -decode- the variables I use with -xi-. The labels are more informative that way.

In your example, I would do something like:

decode relation, gen(RELATION)
decode sex, gen(SEX)

The automatically assigned labels (in Stata 9.2, Win XP) then become (examples):
RELATION==divorced & SEX==male
RELATION==married & SEX==male
RELATION==single & SEX==male

But again, not exactly the output you are looking for.

HTH anyway,

Peter Dijkstra wrote:

Dear Statalisters,

I like to have sensible value labels of variables, and use
   label define relation 0 "single" 1 "married" 2 "divorced"
   label define sex 0 "female" 1 "male"
in StataSE 8.2. However, when using
   xi i.relation *
the labels automatically become "relation==1 & sex==1", "relation==2 & sex==1". How do I obtain labels which say "married male" and "divorced male"?

@Nick: I know that I have to mention my version of Stata, but sometimes I do forget...sorry.

Cheers, Peter
*   For searches and help try:

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