Date: Wed, 13 Jun 2001 11:29:19 -0500
Reply-To: Mark Fisher <mark.fisher@WOMBAT.STATE.TX.US>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Mark Fisher <mark.fisher@WOMBAT.STATE.TX.US>
Organization: Texas Department of Health
Subject: Recoding many continuous variables into discrete categories
I have several continuous variables I want to recode into discrete
categories, based on their quantiles within each by group. For example, if
it is within the 0-50th percentile for that group, I want to code it as '1';
within the 51-90th percentile, I want to code it as '3' and if it is greater
than the 90th percentile I want to code it as '5'. I have 20 variables with
5 by-groups and 14,000 observations.
I know I can do this with a series of IF statements, but there has to be a
more elegant way.
|