Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

BMI categarization in SPSS

365 views
Skip to first unread message

Kadel

unread,
May 12, 2014, 2:09:10 PM5/12/14
to
I want my BMI data into different categories in the adjacent column of BMI data.

How to categorise BMI according to different classes such as...

. 16 - thinness grade 3
* 17 - thinness grade 2
* 18.5 - thinness grade 1
* 23 - overweight (unofficial Asian cut-off)
* 25 - overweight
* 27 - obesity (unofficial Asian cut-off)
* 30 - obesity
* 35 - morbid obesity


thank you!

Bruce Weaver

unread,
May 12, 2014, 5:02:36 PM5/12/14
to
You could use a DO-IF structure, like this:

DO IF BMI LT 16.
- COMPUTE BMIcat = 1.
ELSE IF BMI LT 17.
- COMPUTE BMIcat = 2.
ELSE IF BMI LT 18.5.
- COMPUTE BMIcat = 1.
ELSE...
- COMPUTE BMIcat = 8.
END IF.

VALUE LABELS BMIcat
1 "[1] Thinness grade 3"
2 "[2] Thinness grade 2"
3 "[3] Thinness grade 1"
etc
8 "[8] Morbidly obese"
.
MEANS BMI by BMIcat / cells = min max.

* --- End of example ---- .

You could possibly use RECODE (with keyword "thru") instead of DO-IF;
but it might be a bit tricky if the actual BMI values are not truncated
or rounded.

HTH.

--
Bruce Weaver
bwe...@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/Home
"When all else fails, RTFM."

David Marso

unread,
May 12, 2014, 6:17:06 PM5/12/14
to
This is a rather poorly formulated question.
OP implies some sort of end points for the categories but doesn't specify
whether the specified value falls within the proposed category.
Here are 2 ways of using RECODE which yield different results dependent upon the order in which the values are specified.
I believe the first will capture what Bruce is doing with that ponderous DO IF.

DATA LIST FREE / BMI.
BEGIN DATA
15 16 17 18.5 23 25 27 30 35 40
END DATA.
RECODE BMI
(35 THRU HI=9) (30 THRU 35=8) (27 THRU 30=7)
(25 THRU 27=6) (23 THRU 25=5) (18.5 THRU 23=4)
(17 THRU 18.5=3) (16 THRU 17=2) (LO THRU 16=1)
INTO CatBMI_1.

RECODE BMI
(LO THRU 16=1) (16 THRU 17=2)(17 THRU 18.5=3)
(18.5 THRU 23=4)(23 THRU 25=5) (25 THRU 27=6)
(27 THRU 30=7)(30 THRU 35=8) (35 THRU HI=9)
INTO CatBMI_2.

LIST.

BMI CatBMI_1 CatBMI_2

15.00 1.00 1.00
16.00 2.00 1.00
17.00 3.00 2.00
18.50 4.00 3.00
23.00 5.00 4.00
25.00 6.00 5.00
27.00 7.00 6.00
30.00 8.00 7.00
35.00 9.00 8.00
40.00 9.00 9.00


Number of cases read: 10 Number of cases listed: 10

Art Kendall

unread,
May 13, 2014, 8:46:41 AM5/13/14
to
Please keep the conversation in the newsgroup.
This accomplishes 2 purposes.
(1) it builds the archives so that people with similar problems can see
replies, etc.
(2) other list members may be able to clarify things, for example David
brought out the first point I made in my reply to much better detail.
I.e., he elaborated on
> a result is set according to the first condition it satisfies.

The menus are a great way to draft syntax. Develop the habit of exiting
the menus via <paste> so you can see the syntax.

The syntax members on this list suggested to you would be pasted into a
syntax window.
<file> <new> <syntax>


Art Kendall
Social Research Consultants

Art Kendall
Social Research Consultants

On 5/13/2014 5:58 AM, Binu Kadel wrote:
> thanx once again
>
> but where do I write this commands.
> Is it in the "compute variables" dialog box ?
>
>
> On Tue, May 13, 2014 at 1:00 AM, Art Kendall <A...@drkendall.org
> <mailto:A...@drkendall.org>> wrote:
>
> a result is set according to the first condition it satisfies.
>
>
> before you try it click<help> <Topics> type "recode" in the edit
> box. Click <go>.
>
> something like this untested syntax would work.
> it copies whatever missing value codes you have for bmi.
> You will need to enter the value labels for values that are
> missing and
> list those in a MISSINg VALUES command.
>
> recode bmi
> (lo thru 16 = 1)
> (16 thru 17 = 2)
> (17 thru 18.5 = 3)
> (18.5 thru 23 = 4)
> (23 thru 25 = 5)
> (25 thru 27 = 6)
> (27 thru 30 = 7)
> (30 thru 35 = 8)
> (35 thru hi = 9)
> (else = copy)
> into mycategory.
> value labels mycategory
> 1 'Thinness grade 3'
> ...
> 9 'morbid obesity'
> -1 '
>
>
> Art Kendall
> Social Research Consultants

Bruce Weaver

unread,
May 13, 2014, 8:58:30 PM5/13/14
to
On 12/05/2014 6:17 PM, David Marso wrote:
> This is a rather poorly formulated question.
> OP implies some sort of end points for the categories but doesn't specify
> whether the specified value falls within the proposed category.
> Here are 2 ways of using RECODE which yield different results dependent upon the order in which the values are specified.
> I believe the first will capture what Bruce is doing with that ponderous DO IF.
>
> DATA LIST FREE / BMI.
> BEGIN DATA
> 15 16 17 18.5 23 25 27 30 35 40
> END DATA.
> RECODE BMI
> (35 THRU HI=9) (30 THRU 35=8) (27 THRU 30=7)
> (25 THRU 27=6) (23 THRU 25=5) (18.5 THRU 23=4)
> (17 THRU 18.5=3) (16 THRU 17=2) (LO THRU 16=1)
> INTO CatBMI_1.

--- snip ---

Yes, that's much tidier than my DO-IF. Thanks for the reminder of how
to make RECODE behave.
0 new messages