******************************************************************** * File HALCyon body size syntax_Caerphilly.do * BY Rebecca Hardy, MRC Unit for Lifelong Health and Ageing at UCL * FOR HALCyon cross-cohort collaboration (funded by the New Dynamics of Ageing (RES-353-25-0001)) * DATASET Caerphilly Prospective Study * Date Created 12/05/2010 * last modified 03/08/2010 * PURPOSE Recodes and derives body size variables for use in cross-cohort analyses ************************************************************************************* # delimit; set more off; /*body size at wave 1*/ gen wt_w1=c1weight*10 ; label variable wt_w1 "Weight at wave 1 (kg)" ; gen htcm_w1=c1height*100000 ; label variable htcm_w1 "Height at wave 1 (cm)" ; gen bmi_w1=(wt_w1)/((htcm_w1/100)^2) ; label variable bmi_w1 "Body mass index at wave 1 (kg/m2)" ; /*body size at wave 2*/ gen wt_w2=c2weight*10 ; label variable wt_w2 "Weight at wave 2 (kg)" ; gen htcm_w2=c2height*100000 ; label variable htcm_w2 "Height at wave 2 (cm)" ; gen bmi_w2=(wt_w2)/((htcm_w2/100)^2) ; label variable bmi_w2 "Body mass index at wave 2 (kg/m2)" ; /*body size at wave 3 - Don't have wave 3 height*/ /*body size at wave 4*/ mvdecode c4weight c4height, mv(9999) ; gen wt_w4=c4weight/10 ; label variable wt_w4 "Weight at wave 4 (kg)" ; gen htcm_w4=c4height/10 ; label variable htcm_w4 "Height at wave 4 (cm)" ; gen bmi_w4=(wt_w4)/((htcm_w4/100)^2) ; label variable bmi_w4 "Body mass index at wave 4 (kg/m2)" ; /*body size at wave 5*/ mvdecode c5weight, mv(8108 772.6 703.3 179.2) ; summ c5weight c5standingheight, d ; gen wt_w5=c5weight ; label variable wt_w5 "Weight at wave 5 (kg)" ; replace wt_w5=. if wt_w5<10 ; gen htcm_w5=c5standingheight/10 ; label variable htcm_w5 "Height at wave 5 (cm)" ; gen bmi_w5=(wt_w5)/((htcm_w5/100)^2) ; label variable bmi_w5 "Body mass index at wave 5 (kg/m2)" ; gen waist1_w5=c5waist1circumference/10 ; replace waist1_w5=. if c5waist1circumference>5000 |c5waist1circumference<100 ; gen waist2_w5=c5waist2circumference/10 ; replace waist2_w5=. if c5waist2circumference>5000|c5waist2circumference<100 ; gen waist_w5=(waist1_w5+waist2_w5)/2 ; /*body size at age 20 years - need to check*/ /*create z-scores*/ egen bmi_w1z=std(bmi_w1) ; egen bmi_w2z=std(bmi_w2) ; egen bmi_w4z=std(bmi_w4) ; egen bmi_w5z=std(bmi_w5) ; /*change in body size - modelling across the adult life course*/ gen bmivel1=(bmi_w2-bmi_w1)/(age_w2-age_w1) ; gen bmivel2=(bmi_w4-bmi_w2)/(age_w4-age_w2) ; gen bmivel3=(bmi_w5-bmi_w4)/(age_w5-age_w4) ; egen bmivel1z=std(bmivel1) ; egen bmivel2z=std(bmivel2) ; egen bmivel3z=std(bmivel3) ; gen bmivelo=(bmi_w5-bmi_w1)/(age_w5-age_w1) ; egen bmiveloz=std(bmivelo) ; gen agexvel1z=age_w5*bmivel1z ; gen agexvel2z=age_w5*bmivel2z ; gen agexvel3z=age_w5*bmivel3z ; gen agexveloz=age_w5*bmiveloz ;