Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: labels created from -egen ..., group()-

From   Daniel Egan <[email protected]>
To   [email protected]
Subject   st: labels created from -egen ..., group()-
Date   Mon, 29 Nov 2004 10:44:09 -0500


I have about 10 indicators for medical conditions that I am using. I
used -egen..., group()- to allow myself to track coincidence.

I would like to have the labels of the -egen-ed variable have labels
noting what group it belongs to. I therefore created labels for each
of the indicators akin to
lab def av 1 "a=1" 0 "a=0"
lab def bv 1 "b=1" 0 "b=0"
....which creates groups of
group(1) "a=1 b=0"
group(2) "a=0 b=0"
group(3) "a=1 b=1"

However, since there are >=10 of them, the grouped variable value
label is too large to read.

So finally, my question is how would I go about having the indicator
variable name occur in the group label if it the indicator were 1, but
not otherwise?

If I understand correctly, a consistent -sort- before -egen...,
group()- should allow me to write labels out, but I would still need
to go through and check  if/when groups do/don't occur at all.

Any suggestions are much appreciated
*   For searches and help try:

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