Statalist


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

st: condensing varlist non-categorical contents to a newvar


From   "b. water" <barleywater@hotmail.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: condensing varlist non-categorical contents to a newvar
Date   Thu, 6 Mar 2008 21:57:05 +0000

dear listers,

stata 8.2,

i have a variable named injurytype

injurytype
.
.
type II
.
.
none sig
.
.
type III
type III
.
type III and IV
.
.
.
type IV
.
.

i want to reclassify contents of variable injurytype in a new variable such that the missing values and none sig will be reported as minimal, type II remain as type II, type III remain as type III, but type III and IV to be combined with type IV and be reported as major. that is the new variable (let's call it newvar) would look something like this:

newvar
minimal
minimal
type II
minimal
minimal
minimal
minimal
minimal
type III
type III
minimal
type IV
minimal
minimal
minimal
type IV
minimal
minimal

i tried to look up [R] gen and egen but could not see any that would help. [R] recode seems to be closest but only applies to categorical variables. would appreciate advice and help on how to achieve what i wanted to do.

regards,
bw


_________________________________________________________________
Connect and share in new ways with Windows Live.
http://www.windowslive.com/share.html?ocid=TXT_TAGHM_Wave2_sharelife_012008
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index