| Date: | Fri, 25 Nov 2005 15:13:49 -0600 |
| Reply-To: | "Peck, Jon" <peck@spss.com> |
| Sender: | "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU> |
| From: | "Peck, Jon" <peck@spss.com> |
| Subject: | Re: RECODE glitch? |
|
| Content-Type: | text/plain; charset="iso-8859-1" |
Recode is designed to process the specifications in the order they are given. There is no requirement that they not overlap. In fact overlapping intervals can be quite convenient
(lo - 25)
(lo - 50)
etc.
This is useful in dealing with open/closed intervals.
And, of course, the gui generates syntax according to the order in which the intervals are specified.
Regards,
Jon Peck
-----Original Message-----
From: SPSSX(r) Discussion on behalf of Marta García-Granero
Sent: Fri 11/25/2005 12:46 PM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: [SPSSX-L] RECODE glitch?
Hi everybody
I've been faced recently with the following "SPSS surprise":
My students had recently an exam about SSPSS usage. One of the
exercises consisted in recoding a continuous variable into 3
categories and finding the percentages of every category:
* Part of the dataset they used *.
DATA LIST FREE/height weight (2 F8.0).
BEGIN DATA
167 81 181 82 164 78 179 80 159 60 163 70 167 57
159 54 170 59 154 61 162 49 162 77 173 95 177 63
164 85 175 67 184 116 155 51 156 85 160 86 161 73
171 86 159 76 188 90 185 108 167 62 167 77 176 63
165 69 173 67 159 48 194 86 180 81 170 79 167 59
182 106 187 116 173 63 178 97 170 48 165 85 167 65
164 72 168 73 152 75 150 70 173 63 169 77 158 39
165 75
END DATA.
COMPUTE bmi=weight/((height/100)**2).
* They to recode BMI (Body Mass Index) according to the following
cut-points: =<25; 25-30; >30 *.
* This was the correct way: *.
RECODE bmi
(Lowest thru 25=0) (25 thru 30=1) (30 thru Highest=2) INTO obese .
VALUE LABEL obese 0'No' 1'Overweight' 2'Obese'.
FREQUENCIES
VARIABLES=obese.
* One of my students (they use the GUI), made a mistake in the first
category; she erased it and defined it again. When she hit OK, the
code she actually run was: (see the difference?)*.
RECODE bmi
(25 thru 30=1) (30 thru Highest=2) (Lowest thru 25=0) INTO obese .
VALUE LABEL obese 0'No' 1'Overweight' 2'Obese'.
FREQUENCIES
VARIABLES=obese.
The 2 methods gave different results (check by yourself), at least
on SPSS 11 (& 12, I have just checked). What do you think of that? I'm
careful enought to select the correct order for the categories, but
novice users might have problems (I needed a bit of time to spot the
problem using the GUI), both RECODings look the same...
Awfully tired (what a week I've had!)
Happy week end!
Marta
|