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

Re: st: body mass index


From   "Sarah A. Mustillo" <[email protected]>
To   [email protected]
Subject   Re: st: body mass index
Date   Tue, 04 Nov 2003 12:15:15 -0500

Mary -

This isn't exactly what you are asking for, but it may be helpful. This is a simple do-file that creates variables for overweight and obese based on the 85th and 95th percentiles on the CDC growth charts by age and sex. This do-file assumes you already have a variable for bmi in your dataset (bmi=wt/(ht*ht)):




#delimit;

*generate overweight for girls;

gen overweight=.;
replace overweight=1 if sex==0&age==9&bmi>=19.1;
replace overweight=1 if sex==0&age==10&bmi>=20;
replace overweight=1 if sex==0&age==11&bmi>=20.9;
replace overweight=1 if sex==0&age==12&bmi>=21.7;
replace overweight=1 if sex==0&age==13&bmi>=22.6;
replace overweight=1 if sex==0&age==14&bmi>=23.4;
replace overweight=1 if sex==0&age==15&bmi>=24.1;
replace overweight=1 if sex==0&age==16&bmi>=24.7;

replace overweight=0 if sex==0&age==9&bmi<19.1;
replace overweight=0 if sex==0&age==10&bmi<20;
replace overweight=0 if sex==0&age==11&bmi<20.9;
replace overweight=0 if sex==0&age==12&bmi<21.7;
replace overweight=0 if sex==0&age==13&bmi<22.6;
replace overweight=0 if sex==0&age==14&bmi<23.4;
replace overweight=0 if sex==0&age==15&bmi<24.1;
replace overweight=0 if sex==0&age==16&bmi<24.7;


*for boys;

replace overweight=1 if sex==1&age==9&bmi>=18.6;
replace overweight=1 if sex==1&age==10&bmi>=19.4;
replace overweight=1 if sex==1&age==11&bmi>=20.2;
replace overweight=1 if sex==1&age==12&bmi>=21;
replace overweight=1 if sex==1&age==13&bmi>=21.9;
replace overweight=1 if sex==1&age==14&bmi>=22.7;
replace overweight=1 if sex==1&age==15&bmi>=23.5;
replace overweight=1 if sex==1&age==16&bmi>=24.2;

replace overweight=0 if sex==1&age==9&bmi<18.6;
replace overweight=0 if sex==1&age==10&bmi<19.4;
replace overweight=0 if sex==1&age==11&bmi<20.2;
replace overweight=0 if sex==1&age==12&bmi<21;
replace overweight=0 if sex==1&age==13&bmi<21.9;
replace overweight=0 if sex==1&age==14&bmi<22.7;
replace overweight=0 if sex==1&age==15&bmi<23.5;
replace overweight=0 if sex==1&age==16&bmi<24.2;

replace overweight=. if bmi==.

*generate obese for girls;
gen obese=.;
replace obese=1 if sex==0&age==9&bmi>=21.8;
replace obese=1 if sex==0&age==10&bmi>=23;
replace obese=1 if sex==0&age==11&bmi>=24.1;
replace obese=1 if sex==0&age==12&bmi>=25.3;
replace obese=1 if sex==0&age==13&bmi>=26.3;
replace obese=1 if sex==0&age==14&bmi>=27.3;
replace obese=1 if sex==0&age==15&bmi>=28.1;
replace obese=1 if sex==0&age==16&bmi>=28.9;

replace obese=0 if sex==0&age==9&bmi<21.8;
replace obese=0 if sex==0&age==10&bmi<23;
replace obese=0 if sex==0&age==11&bmi<24.1;
replace obese=0 if sex==0&age==12&bmi<25.3;
replace obese=0 if sex==0&age==13&bmi<26.3;
replace obese=0 if sex==0&age==14&bmi<27.3;
replace obese=0 if sex==0&age==15&bmi<28.1;
replace obese=0 if sex==0&age==16&bmi<28.9;

*for boys;

replace obese=1 if sex==1&age==9&bmi>=21.1;
replace obese=1 if sex==1&age==10&bmi>=22.2;
replace obese=1 if sex==1&age==11&bmi>=23.2;
replace obese=1 if sex==1&age==12&bmi>=24.2;
replace obese=1 if sex==1&age==13&bmi>=25.2;
replace obese=1 if sex==1&age==14&bmi>=26.1;
replace obese=1 if sex==1&age==15&bmi>=26.8;
replace obese=1 if sex==1&age==16&bmi>=27.6;

replace obese=0 if sex==1&age==9&bmi<21.1;
replace obese=0 if sex==1&age==10&bmi<22.2;
replace obese=0 if sex==1&age==11&bmi<23.2;
replace obese=0 if sex==1&age==12&bmi<24.2;
replace obese=0 if sex==1&age==13&bmi<25.2;
replace obese=0 if sex==1&age==14&bmi<26.1;
replace obese=0 if sex==1&age==15&bmi<26.8;
replace obese=0 if sex==1&age==16&bmi<27.6;

replace obese =. if bmi==.;




--On Tuesday, November 04, 2003 11:46 AM -0500 "Rogge, Mary M" <[email protected]> wrote:


I am attempting to analyze an NIH data set for prenatal factors related
to child overweight status at age 7 years.  Does anyone have a Stata
program that calculates the BMI from height and weight and gives the BMI
percentile for age? Thanks!
Mary Rogge
Indiana University School of Nursing

*
*   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/



Sarah A. Mustillo, Ph.D
Department of Psychiatry and Behavioral Sciences
Duke University School of Medicine
Box 3454
Durham NC 27710

919 687-4686 x231
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index