Statalist The Stata Listserver


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

Re: st: using two dataset simultaneously


From   "Elizabeth Allred" <[email protected]>
To   <[email protected]>
Subject   Re: st: using two dataset simultaneously
Date   Mon, 25 Jun 2007 14:59:18 -0400

I think you need to join the "standard" data set to your children/adolsecent data set by age (you may want to code age, e.g., 61, 62, 63...) and sex. 

Then: underwt=1 if bmi < p5

Elizabeth

>>> On 6/25/2007 at 2:44 PM, in message
<[email protected]>, "Visintainer, Paul"
<[email protected]> wrote:
> I have a dataset of about 1000 children and adolescents all of whom have
> BMIs.  I want to generate 3 new variables: underwt < 5th %ile; overwt >
> 85th %ile; obese > 95th %ile, based on their age and sex (I give a
> synopsis of one of the command below). 
> 
>       gen underwt = 1 if sex==[0 or 1]  & agemo== [57.5 mos to 215 mos]
> & bmi < [a specific value]
> 
> 
> My problem is that the unique BMI cutpoints based on age and sex (the
> "specific value" in the command above--more than 400 of them), are in
> another dataset.  The format of the dataset with the BMI standards looks
> like:
> 
> Sex   Agemo P5          P85 		P95
> 1	61.5	13.82664746	16.84600319	17.96602144
> 1	62.5	13.81537489	16.85300198	17.99561523
> 1	63.5	13.8047237	16.86173124	18.02763543
> 1	64.5	13.79469004	16.87216519	18.06201396
> 1	65.5	13.78526882	16.88428085	18.09868317
> 1	66.5	13.77645627	16.89805459	18.13757754
> . . . 
> 
> I don't want to have to type in each unique BMI standard.  Is there a
> way to get Stata to take an observation from one dataset to and evaluate
> it against criteria that exists in another?
> 
> Thanks for any help.
> 
> -p
> ______________________________________
> Paul F. Visintainer, PhD
> 
> 
> 
> *
> *   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/
*
*   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