******************************************************************** * File HALCyon PC covariate syntax_HCS.do * BY Rachel Cooper, 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 Hertfordshire Cohort Study (HCS) * Date Created 21/08/2009 * last modified 13/12/2012 * PURPOSE Recodes and derives physical capability variables, basic sociodemographic variables * and covariates (indicators of socioeconomic position, disability, health status, living alone and BMI) for use in cross-cohort analyses ************************************************************************************* # delimit; set more off; /*Creating break between newly recoded variables and variables in existing dataset with a blank variable */ gen recodes_below=. ; /*Taking 1999-2004 assessment to be wave 1 */ /*Taking 2004-2005 assessment (East Herts only) to be wave 2 */ /*********************************************************************************/ /*Standard names and categories for demographic variables */ /* SEX */ gen sex=absex ; label variable sex "Sex of study member" ; label define sexlab 1 "Male" 2 "Female" ; label values sex sexlab ; /*AGE */ gen age_w1h=hage ; gen age_w1c=clinage ; gen age_w2=fqage ; label variable age_w1h "Age at wave 1 (99/04 HHQ)" ; label variable age_w1c "Age at wave 1 (99/04 clinic)" ; label variable age_w2 "Age at wave 2 (04/05 assessment)" ; /*NOTE: age_w1c should be used in relation to physical performance measures from wave 1 */ /*Categories of age at time of wave 1 HHQ assessment (range 59-73) */ /*in 10 year age groups 50-59, 60-69, 70-79 */ gen agecat_w1h=age_w1h ; recode agecat_w1h (min/59.999=0)(60/69.999=1) (70/79.999=2) (80/89.999=3) ; label variable agecat_w1h "Age at wave 1 HHQ (10y cat.)" ; label define agelab 0 "50-59" 1 "60-69" 2 "70-79" 3 "80+" ; label values agecat_w1h agelab ; /*in 5 year age groups 55-59, 60-64, 65-69, 70-74, 75-79, 80-84 years */ gen agecat5_w1h=age_w1h ; recode agecat5_w1h (min/59.999=0)(60/64.999=1) (65/69.999=2) (70/74.999=3) (75/79.999=4) (80/84.999=5) ; label variable agecat5_w1h "Age at wave 1 HHQ (5y cat.)" ; label define age5lab 0 "55-59" 1 "60-64" 2 "65-69" 3 "70-74" 4 "75-79" 5 "80+" ; label values agecat5_w1h age5lab ; /*Categories of age at time of wave 1 clinic assessment (range 59-73) */ /*in 10 year age groups 50-59, 60-69, 70-79 */ gen agecat_w1c=age_w1c ; recode agecat_w1c (min/59.999=0)(60/69.999=1) (70/79.999=2) (80/89.999=3) ; label variable agecat_w1c "Age at wave 1 clinic (10y cat.)" ; label values agecat_w1c agelab ; /*in 5 year age groups 55-59, 60-64, 65-69, 70-74, 75-79, 80-84 years */ gen agecat5_w1c=age_w1c ; recode agecat5_w1c (min/59.999=0)(60/64.999=1) (65/69.999=2) (70/74.999=3) (75/79.999=4) (80/84.999=5) ; label variable agecat5_w1c "Age at wave 1 clinic (5y cat.)" ; label values agecat5_w1c age5lab ; /*Categories of age at time of wave 2 assessment (range 64-74) */ /*in 10 year age groups 60-69, 70-79, 80-89 */ gen agecat_w2=age_w2 ; recode agecat_w2 (min/69.999=1) (70/79.999=2) (80/89.999=3) ; label variable agecat_w2 "Age at wave 2 (10y cat.)" ; label values agecat_w2 agelab ; /*in 5 year age groups 60-64, 65-69, 70-74, 75-79, 80-84 years */ gen agecat5_w2=age_w2 ; recode agecat5_w2 (min/64.999=1) (65/69.999=2) (70/74.999=3) (75/79.999=4) (80/84.999=5) ; label variable agecat5_w2 "Age at wave 2 (5y cat.)" ; label values agecat5_w2 age5lab ; /*********************************************************************************/ /* PHYSICAL CAPABILITY MEASURES */ /* GRIP STRENGTH */ /*6 trials performed at both waves, using a Jamar dynamometer */ /* Wave 1 */ /*provided with measure which is best of 6, also best from each hand and also each individual measure */ /*RH checked and best measure has been derived as expected so no need to derive again */ gen bestgrip_w1=amaxgrip ; label variable bestgrip_w1 "Grip strength (kg), best of 6, wave 1 clinic" ; /*Average grip strength */ egen gripmissing_w1=rmiss(agripr1-agripl3) ; label variable gripmissing_w1 "No. of missing grip values, wave 1" ; egen griptot_w1=rsum(agripr1-agripl3) if gripmissing_w1>=0 & gripmissing_w1<6 ; label variable griptot_w1 "Sum of grip values, wave 1" ; gen avgrip_w1=. ; replace avgrip_w1=griptot_w1/6 if gripmissing_w1==0 ; replace avgrip_w1=griptot_w1/5 if gripmissing_w1==1 ; replace avgrip_w1=griptot_w1/4 if gripmissing_w1==2 ; replace avgrip_w1=griptot_w1/3 if gripmissing_w1==3 ; replace avgrip_w1=griptot_w1/2 if gripmissing_w1==4 ; replace avgrip_w1=griptot_w1 if gripmissing_w1==5 ; label variable avgrip_w1 "Average grip strength (kg), wave 1" ; /* Wave 2 */ /*provided with measure which is best of 6, also best from each hand and all 6 individual measures */ /*RH checked and best measure has been derived as expected so no need to derive again */ gen bestgrip_w2=fmaxgrip ; label variable bestgrip_w2 "Grip strength (kg), best of 6, wave 2" ; /*Average grip strength */ egen gripmissing_w2=rmiss(fgripr1-fgripl3) ; label variable gripmissing_w2 "No. of missing grip values, wave 2" ; egen griptot_w2=rsum(fgripr1-fgripl3) if gripmissing_w2>=0 & gripmissing_w2<6 ; label variable griptot_w2 "Sum of grip values, wave 2" ; gen avgrip_w2=. ; replace avgrip_w2=griptot_w2/6 if gripmissing_w2==0 ; replace avgrip_w2=griptot_w2/5 if gripmissing_w2==1 ; replace avgrip_w2=griptot_w2/4 if gripmissing_w2==2 ; replace avgrip_w2=griptot_w2/3 if gripmissing_w2==3 ; replace avgrip_w2=griptot_w2/2 if gripmissing_w2==4 ; replace avgrip_w2=griptot_w2 if gripmissing_w2==5 ; label variable avgrip_w2 "Average grip strength (kg), wave 2" ; /*With the exception of grip strength all other measures should not be considered as repeat measures */ /*During the 1999-2004 assessment (here called wave 1) not all people underwent physical performance tests */ /*(as they were introduced at different stages throughout the assessment) */ /*During the 2004-2005 assessment (here called wave 2) only those people from E Herts were included */ /*For each physical performance measure (except grip strength), wave 1 and wave 2 measures are generated and */ /*then the measures from the 2 waves are combined */ /*For chair rises and standing balance there is no overlap between the people who undertook the tests at the different waves */ /*For walking speed and TUG time wave 1 measures were taken where available and wave 2 where not (given there was some */ /*(although not complete) overlap for these measures */ /* STANDING BALANCE */ /*1 trial performed at each wave, wave 1 W Herts, wave 2 E Herts */ /*Wave 1 */ gen balance_w1=fstime ; label variable balance_w1 "Balance time(s), wave 1 clinic" ; /*Binary categorisations of balance time variable - including people unable*/ /*Able to balance for 30s or not */ gen balance_30_w1=balance_w1 ; recode balance_30_w1 (min/29.99=0) (30=1) ; replace balance_30_w1=0 if fsdone==0 ; label variable balance_30_w1 "Able to balance for 30s w1?" ; label define yeslab 0 "No" 1 "Yes" ; label values balance_30_w1 yeslab ; /*Able to complete at least 5 seconds */ gen balance_5_w1=balance_w1 ; recode balance_5_w1 (min/4.99=0) (5/30=1) ; replace balance_5_w1=0 if fsdone==0 ; label variable balance_5_w1 "Able to balance for at least 5s w1?" ; label values balance_5_w1 yeslab ; /*Coding balance the alternative way so that inability to balance is the 'positive' outcome */ gen balance_30_w1_opp=. ; replace balance_30_w1_opp=1 if balance_30_w1==0 ; replace balance_30_w1_opp=0 if balance_30_w1==1 ; label variable balance_30_w1_opp "Able to balance for 30s w1?" ; label define nolab 1 "No" 0 "Yes" ; label values balance_30_w1_opp nolab ; gen balance_5_w1_opp=. ; replace balance_5_w1_opp=1 if balance_5_w1==0 ; replace balance_5_w1_opp=0 if balance_5_w1==1 ; label variable balance_5_w1_opp "Able to balance for at least 5s w1?" ; label values balance_5_w1_opp nolab ; /*Creating a categorisation of balance which instead of using a specific time as a cut-point, identifies those in the bottom */ /*20% of performance by sex (including unable)*/ gen balanceun_w1=balance_w1 ; replace balanceun_w1=0 if fsdone==0 ; egen bal20m_w1=cut(balanceun_w1) if sex==1, group(5) ; egen bal20f_w1=cut(balanceun_w1) if sex==2, group(5) ; table bal20m_w1, c(min balanceun_w1 max balanceun_w1) ; table bal20f_w1, c(min balanceun_w1 max balanceun_w1) ; gen balance_b20_w1=. ; replace balance_b20_w1=bal20m_w1 if sex==1 & bal20m_w1!=. ; replace balance_b20_w1=bal20f_w1 if sex==2 & bal20f_w1!=. ; recode balance_b20_w1 1/4=0 0=1 ; label variable balance_b20_w1 "In bottom 20% of balance times, wave 1" ; label define b20lab 0 "Top 80%" 1 "Bottom 20%" ; label values balance_b20_w1 b20lab ; label variable bal20m_w1 "Quintiles of balance time, wave 1, men" ; label variable bal20f_w1 "Quintiles of balance time, wave 1, women" ; /*Creating a categorisation of balance which instead of using a specific time as a cut-point, identifies those in the bottom */ /*20% of performance by sex and age */ egen bal20m_w1a=cut(balanceun_w1) if sex==1 & agecat5_w1c==1, group(5) ; egen bal20m_w1b=cut(balanceun_w1) if sex==1 & agecat5_w1c==2, group(5) ; egen bal20m_w1c=cut(balanceun_w1) if sex==1 & agecat5_w1c==3, group(5) ; egen bal20f_w1a=cut(balanceun_w1) if sex==2 & agecat5_w1c==1, group(5) ; egen bal20f_w1b=cut(balanceun_w1) if sex==2 & agecat5_w1c==2, group(5) ; egen bal20f_w1c=cut(balanceun_w1) if sex==2 & agecat5_w1c==3, group(5) ; table bal20m_w1a, c(min balanceun_w1 max balanceun_w1) ; table bal20m_w1b, c(min balanceun_w1 max balanceun_w1) ; table bal20m_w1c, c(min balanceun_w1 max balanceun_w1) ; table bal20f_w1a, c(min balanceun_w1 max balanceun_w1) ; table bal20f_w1b, c(min balanceun_w1 max balanceun_w1) ; table bal20f_w1c, c(min balanceun_w1 max balanceun_w1) ; drop balanceun_w1 ; gen balance_b20a_w1=. ; replace balance_b20a_w1=bal20m_w1a if sex==1 & bal20m_w1a!=. ; replace balance_b20a_w1=bal20m_w1b if sex==1 & bal20m_w1b!=. ; replace balance_b20a_w1=bal20m_w1c if sex==1 & bal20m_w1c!=. ; replace balance_b20a_w1=bal20f_w1a if sex==2 & bal20f_w1a!=. ; replace balance_b20a_w1=bal20f_w1b if sex==2 & bal20f_w1b!=. ; replace balance_b20a_w1=bal20f_w1c if sex==2 & bal20f_w1c!=. ; label variable bal20m_w1a "Quintiles of balance time, wave 1, men (60-64)" ; label variable bal20f_w1a "Quintiles of balance time, wave 1, women (60-64)" ; label variable bal20m_w1b "Quintiles of balance time, wave 1, men (65-69)" ; label variable bal20f_w1b "Quintiles of balance time, wave 1, women (65-69)" ; label variable bal20m_w1c "Quintiles of balance time, wave 1, men (70-74)" ; label variable bal20f_w1c "Quintiles of balance time, wave 1, women (70-74)" ; recode balance_b20a_w1 1/4=0 0=1 ; label variable balance_b20a_w1 "In bottom 20% of balance times, wave 1, by sex and age" ; label values balance_b20a_w1 b20lab ; /*Wave 2 */ gen balance_w2=fftime ; label variable balance_w2 "Balance time(s), wave 2" ; /*Binary categorisations of balance time variable (including those unable) */ /*Able to balance for 30s or not */ gen balance_30_w2=balance_w2 ; recode balance_30_w2 (min/29.99=0) (30=1) ; replace balance_30_w2=0 if ffdone==0 ; label variable balance_30_w2 "Able to balance for 30s w2?" ; label values balance_30_w2 yeslab ; /*Able to complete at least 5 seconds */ gen balance_5_w2=balance_w2 ; recode balance_5_w2 (min/4.99=0) (5/30=1) ; replace balance_5_w2=0 if ffdone==0 ; label variable balance_5_w2 "Able to balance for at least 5s w2?" ; label values balance_5_w2 yeslab ; /*Coding balance the alternative way so that inability to balance is the 'positive' outcome */ gen balance_30_w2_opp=. ; replace balance_30_w2_opp=1 if balance_30_w2==0 ; replace balance_30_w2_opp=0 if balance_30_w2==1 ; label variable balance_30_w2_opp "Able to balance for 30s w2?" ; label values balance_30_w2_opp nolab ; gen balance_5_w2_opp=. ; replace balance_5_w2_opp=1 if balance_5_w2==0 ; replace balance_5_w2_opp=0 if balance_5_w2==1 ; label variable balance_5_w2_opp "Able to balance for at least 5s w2?" ; label values balance_5_w2_opp nolab ; /*Creating a categorisation of balance which instead of using a specific time as a cut-point, identifies those in the bottom */ /*20% of performance by sex */ gen balanceun_w2=balance_w2 ; replace balanceun_w2=0 if ffdone==0 ; egen bal20m_w2=cut(balanceun_w2) if sex==1, group(5) ; egen bal20f_w2=cut(balanceun_w2) if sex==2, group(5) ; table bal20m_w2, c(min balanceun_w2 max balanceun_w2) ; table bal20f_w2, c(min balanceun_w2 max balanceun_w2) ; drop balanceun_w2 ; gen balance_b20_w2=. ; replace balance_b20_w2=bal20m_w2 if sex==1 & bal20m_w2!=. ; replace balance_b20_w2=bal20f_w2 if sex==2 & bal20f_w2!=. ; recode balance_b20_w2 1/4=0 0=1 ; label variable balance_b20_w2 "In bottom 20% of balance times, wave 2" ; label values balance_b20_w2 b20lab ; label variable bal20m_w2 "Quintiles of balance time, wave 2, men" ; label variable bal20f_w2 "Quintiles of balance time, wave 2, women" ; /*COMBINED WAVE BALANCE VARIABLES */ gen balance_c=. ; replace balance_c=balance_w1 if balance_w1!=. ; replace balance_c=balance_w2 if balance_w2!=. ; label variable balance_c "Balance time(s), combined waves" ; /*Binary categorisations of balance time variable - including people unable*/ /*Able to balance for 30s or not */ gen balance_30_c=balance_c ; recode balance_30_c (min/29.99=0) (30=1) ; replace balance_30_c=0 if fsdone==0 ; replace balance_30_c=0 if ffdone==0 ; label variable balance_30_c "Able to balance for 30s combined?" ; label values balance_30_c yeslab ; /*Able to complete at least 5 seconds */ gen balance_5_c=balance_c ; recode balance_5_c (min/4.99=0) (5/30=1) ; replace balance_5_c=0 if fsdone==0 ; replace balance_5_c=0 if ffdone==0 ; label variable balance_5_c "Able to balance for at least 5s combined?" ; label values balance_5_c yeslab ; /*Coding balance the alternative way so that inability to balance is the 'positive' outcome */ gen balance_30_c_opp=. ; replace balance_30_c_opp=1 if balance_30_c==0 ; replace balance_30_c_opp=0 if balance_30_c==1 ; label variable balance_30_c_opp "Able to balance for 30s combined?" ; label values balance_30_c_opp nolab ; gen balance_5_c_opp=. ; replace balance_5_c_opp=1 if balance_5_c==0 ; replace balance_5_c_opp=0 if balance_5_c==1 ; label variable balance_5_c_opp "Able to balance for at least 5s combined?" ; label values balance_5_w1_opp nolab ; /*Creating a categorisation of balance which instead of using a specific time as a cut-point, identifies those in the bottom */ /*20% of performance by sex (including unable)*/ gen balanceun_c=balance_c ; replace balanceun_c=0 if fsdone==0 ; replace balanceun_c=0 if ffdone==0 ; egen bal20m_c=cut(balanceun_c) if sex==1, group(5) ; egen bal20f_c=cut(balanceun_c) if sex==2, group(5) ; table bal20m_c, c(min balanceun_c max balanceun_c) ; table bal20f_c, c(min balanceun_c max balanceun_c) ; gen balance_b20_c=. ; replace balance_b20_c=bal20m_c if sex==1 & bal20m_c!=. ; replace balance_b20_c=bal20f_c if sex==2 & bal20f_c!=. ; recode balance_b20_c 1/4=0 0=1 ; label variable balance_b20_c "In bottom 20% of balance times, combined waves" ; label values balance_b20_c b20lab ; label variable bal20m_c "Quintiles of balance time, combined, men" ; label variable bal20f_c "Quintiles of balance time, combined, women" ; drop balanceun_c ; /*TIMED GET UP AND GO */ /* 1 trial performed at both waves - time taken in seconds to get up from a chair, walk a distance of 3m at usual pace, turn on touching line */ /* return to chair and sit back down again */ /*Wave 1 */ gen tugtime_w1=tu6mupgo ; label variable tugtime_w1 "TUG time (s), wave 1 clin" ; /*Natural log transformation */ gen lntugtime_w1=ln(tugtime_w1) ; label variable lntugtime_w1 "ln(TUG time w1)" ; /*Calculation of timed get up and go speed (assuming all time is spent walking the 6m which is not entirely correct) */ gen tugspeed_w1=6/tugtime_w1 ; label variable tugspeed_w1 "TUG speed (m/s), wave 1" ; /*Wave 2 */ gen tugtime_w2=ft6mupgo ; label variable tugtime_w2 "TUG time (s), wave 2" ; /*Natural log transformation */ gen lntugtime_w2=ln(tugtime_w2) ; label variable lntugtime_w2 "ln(TUG time w2)" ; /*Calculation of timed get up and go speed (assuming all time is spent walking the 6m which is not entirely correct) */ gen tugspeed_w2=6/tugtime_w2 ; label variable tugspeed_w2 "TUG speed (m/s), wave 2" ; /*COMBINED TUG VARIABLES */ /*Using wave 1 if data available for an individual at both waves (n=135) */ gen tugtime_c=. ; replace tugtime_c=tugtime_w1 if tugtime_w1!=. ; replace tugtime_c=tugtime_w2 if tugtime_w1==. & tugtime_w2!=. ; label variable tugtime_c "TUG time (s), combined waves" ; /*Natural log transformation */ gen lntugtime_c=ln(tugtime_c) ; label variable lntugtime_c "ln(TUG time combined)" ; /*Calculation of timed get up and go speed (assuming all time is spent walking the 6m which is not entirely correct) */ gen tugspeed_c=6/tugtime_c ; label variable tugspeed_c "TUG speed (m/s), combined waves" ; /*generating variable to indicate what wave measure was taken from */ gen tugwave=. ; replace tugwave=1 if tugtime_w1!=. ; replace tugwave=2 if tugtime_w1==. & tugtime_w2!=. ; label variable tugwave "What wave was TUG data taken from?" ; /*WALKING TIME AND SPEED */ /*1 trial of time taken to walk 3m completed at both waves */ /*Wave 1 */ gen walktime_w1=tu3mwlk ; /*recode to missing person with time of 0.28s */ recode walktime_w1 0.28=. ; label variable walktime_w1 "Time to walk 3m (s), wave 1 clin"; /*Using walking time to calculate walking speed in m/s */ gen walkspeed_w1=3/walktime_w1 ; label variable walkspeed_w1 "Walking speed (m/s), wave 1 clin" ; /*Wave 2 */ gen walktime_w2=ft3mwlk ; label variable walktime_w2 "Time to walk 3m (s), wave 2"; /*Using walking time to calculate walking speed in m/s */ gen walkspeed_w2=3/walktime_w2 ; label variable walkspeed_w2 "Walking speed (m/s), wave 2" ; /*COMBINED WALKING SPEED VARIABLES */ /*Using wave 1 if data available for an individual at both waves (n=135) */ gen walktime_c=. ; replace walktime_c=walktime_w1 if walktime_w1!=. ; replace walktime_c=walktime_w2 if walktime_w1==. & walktime_w2!=. ; label variable walktime_c "Time to walk 3m (s), combined waves" ; /*Using walking time to calculate walking speed in m/s */ gen walkspeed_c=3/walktime_c ; label variable walkspeed_c "Walking speed (m/s), combined waves" ; /*generating variable to indicate what wave measure was taken from */ gen walkwave=. ; replace walkwave=1 if walktime_w1!=. ; replace walkwave=2 if walktime_w1==. & walktime_w2!=. ; label variable walkwave "What wave was walking data taken from?" ; /*CHAIR RISES */ /*1 trial of 5 chair rises at each wave (no overlap between the people measured at the different waves) */ /*Wave 1 */ /*exclude those who did not complete 5 chair rises (n=6) in creating variable */ gen chairtime_w1=crtime if crfive==1 ; label variable chairtime_w1 "Chair rise time (s), 5 rises, wave 1 clin" ; /*Natural log transformation */ gen lnchairtime_w1=ln(chairtime_w1) ; label variable lnchairtime_w1 "ln(chair rise time w1)" ; /*Reciprocal */ gen rpchairtime_w1=(1/chairtime_w1)*100 ; label variable rpchairtime_w1 "Reciprocal of chair rise time, wave 1" ; /*Wave 2 */ /*exclude those who did not complete 5 chair rises (n=5) in creating variable */ gen chairtime_w2=fctime if fcfive==1 ; label variable chairtime_w2 "Chair rise time (s), 5 rises, wave 2" ; /*Natural log transformation */ gen lnchairtime_w2=ln(chairtime_w2) ; label variable lnchairtime_w2 "ln(chair rise time w2)" ; /*Reciprocal */ gen rpchairtime_w2=(1/chairtime_w2)*100 ; label variable rpchairtime_w2 "Reciprocal of chair rise time, wave 2" ; /*COMBINED CHAIR RISE VARIABLES */ gen chairtime_c=. ; replace chairtime_c=chairtime_w1 if chairtime_w1!=. ; replace chairtime_c=chairtime_w2 if chairtime_w2!=. ; label variable chairtime_c "Chair rise time (s), 5 rises, combined waves" ; /*Natural log transformation */ gen lnchairtime_c=ln(chairtime_c) ; label variable lnchairtime_c "ln(chair rise time combined waves)" ; /*Reciprocal */ gen rpchairtime_c=(1/chairtime_c)*100 ; label variable rpchairtime_c "Reciprocal of chair rise time, combined waves" ; /*Chair rises per second */ gen chairspeed_s=5/chairtime_c ; label variable chairspeed_s "Chair rise speed (stands/sec), combined waves" ; /*per minute */ gen chairspeed_m=chairspeed_s*60 ; label variable chairspeed_m "Chair rise speed (stands/min), combined waves" ; /***********************************************/ /*unable to perform physical performance tests */ gen chairunable=. ; replace chairunable=1 if crdone==0 | fcdone==0 ; replace chairunable=1 if crfive==0 | fcfive==0 ; replace chairunable=0 if (crdone==1 | fcdone==1) & (crfive==1 | fcfive==1) ; label var chairunable "Unable to complete chair rise test" ; label define unablelab 0 "Able" 1 "Unable" ; label values chairunable unablelab ; /*age at chair rise assessment including unables */ gen age_c_unable=. ; replace age_c_unable=age_w1c if crdone!=. ; replace age_c_unable=age_w2 if fcdone!=. ; label variable age_c_unable "Age (y) at chair rise measurement" ; /*Categories of age at time of chair rise assessment */ /*in 10 year age groups 50-59, 60-69, 70-79 */ gen agecat_c_un=age_c_unable ; recode agecat_c_un (min/59.999=0)(60/69.999=1) (70/79.999=2) (80/89.999=3) ; label variable agecat_c_un "Age at chair rise measurement (10y cat.)" ; label values agecat_c_un agelab ; /*in 5 year age groups 55-59, 60-64, 65-69, 70-74, 75-79, 80-84 years */ gen agecat5_c_un=age_c_unable ; recode agecat5_c_un (min/59.999=0)(60/64.999=1) (65/69.999=2) (70/74.999=3) (75/79.999=4) (80/84.999=5) ; label variable agecat5_c_un "Age at chair rise measurement (5y cat.)" ; label values agecat5_c_un age5lab ; /*Unable to walk unaided */ gen walkunable=. ; replace walkunable=1 if tuwlkuna==0 | ftwlkuna==0 ; replace walkunable=0 if tugspeed_c!=. ; label var walkunable "Unable to walk unaided" ; label values walkunable unablelab ; /*use of walking aid */ gen walkaid=. ; replace walkaid=1 if (tuwlkaid==1 | tuwlkaid==3) & tugwave==1 ; replace walkaid=1 if (ftwlkaid==1 | ftwlkaid==3) & tugwave==2 ; replace walkaid=0 if walkaid!=1 & tugspeed_c!=. ; label var walkaid "Uses walking aid?" ; label define aidlab 0 "No" 1 "Yes" ; label values walkaid aidlab ; /**************************************************************/ /*AGES FOR COMBINED PHYSICAL PERFORMANCE VARIABLES */ /*age at balance assessment */ gen age_b=. ; replace age_b=age_w1c if balance_w1!=. ; replace age_b=age_w1c if fsdone==0 ; replace age_b=age_w2 if balance_w2!=. ; replace age_b=age_w2 if ffdone==0 ; label variable age_b "Age (y) at balance measurement" ; /*Categories of age at time of balance assessment */ /*in 10 year age groups 50-59, 60-69, 70-79 */ gen agecat_b=age_b ; recode agecat_b (min/59.999=0)(60/69.999=1) (70/79.999=2) (80/89.999=3) ; label variable agecat_b "Age at balance measurement (10y cat.)" ; label values agecat_b agelab ; /*in 5 year age groups 55-59, 60-64, 65-69, 70-74, 75-79, 80-84 years */ gen agecat5_b=age_b ; recode agecat5_b (min/59.999=0)(60/64.999=1) (65/69.999=2) (70/74.999=3) (75/79.999=4) (80/84.999=5) ; label variable agecat5_b "Age at balance measurement (5y cat.)" ; label values agecat5_b age5lab ; /*age at chair rise assessment */ gen age_c=. ; replace age_c=age_w1c if chairtime_w1!=. ; replace age_c=age_w2 if chairtime_w2!=. ; label variable age_c "Age (y) at chair rise measurement" ; /*Categories of age at time of chair rise assessment */ /*in 10 year age groups 50-59, 60-69, 70-79 */ gen agecat_c=age_c ; recode agecat_c (min/59.999=0)(60/69.999=1) (70/79.999=2) (80/89.999=3) ; label variable agecat_c "Age at chair rise measurement (10y cat.)" ; label values agecat_c agelab ; /*in 5 year age groups 55-59, 60-64, 65-69, 70-74, 75-79, 80-84 years */ gen agecat5_c=age_c ; recode agecat5_c (min/59.999=0)(60/64.999=1) (65/69.999=2) (70/74.999=3) (75/79.999=4) (80/84.999=5) ; label variable agecat5_c "Age at chair rise measurement (5y cat.)" ; label values agecat5_c age5lab ; /*age at walking speed assessment */ gen age_walk=. ; replace age_walk=age_w1c if walktime_w1!=. ; replace age_walk=age_w2 if walktime_w1==. & walktime_w2!=. ; label variable age_walk "Age (y) at walking speed measurement" ; /*Categories of age at time of walking speed assessment */ /*in 10 year age groups 50-59, 60-69, 70-79 */ gen agecat_walk=age_walk ; recode agecat_walk (min/59.999=0)(60/69.999=1) (70/79.999=2) (80/89.999=3) ; label variable agecat_walk "Age at walking speed measurement (10y cat.)" ; label values agecat_walk agelab ; /*in 5 year age groups 55-59, 60-64, 65-69, 70-74, 75-79, 80-84 years */ gen agecat5_walk=age_walk ; recode agecat5_walk (min/59.999=0)(60/64.999=1) (65/69.999=2) (70/74.999=3) (75/79.999=4) (80/84.999=5) ; label variable agecat5_walk "Age at walking speed measurement (5y cat.)" ; label values agecat5_walk age5lab ; /*age at TUG assessment */ gen age_tug=. ; replace age_tug=age_w1c if tugtime_w1!=. ; replace age_tug=age_w2 if tugtime_w1==. & tugtime_w2!=. ; label variable age_tug "Age (y) at TUG measurement" ; /*Categories of age at time of balance assessment */ /*in 10 year age groups 50-59, 60-69, 70-79 */ gen agecat_tug=age_tug ; recode agecat_tug (min/59.999=0)(60/69.999=1) (70/79.999=2) (80/89.999=3) ; label variable agecat_tug "Age at TUG measurement (10y cat.)" ; label values agecat_tug agelab ; /*in 5 year age groups 55-59, 60-64, 65-69, 70-74, 75-79, 80-84 years */ gen agecat5_tug=age_tug ; recode agecat5_tug (min/59.999=0)(60/64.999=1) (65/69.999=2) (70/74.999=3) (75/79.999=4) (80/84.999=5) ; label variable agecat5_tug "Age at TUG measurement (5y cat.)" ; label values agecat5_tug age5lab ; /*HEIGHTS, WEIGHTS AND BMI FOR COMBINED PHYSICAL PERFORMANCE VARIABLES */ /*****BALANCE*******************/ /*height at balance assessment */ gen ht_b=. ; replace ht_b=aht if balance_w1!=. ; replace ht_b=aht if fsdone==0 ; replace ht_b=fht if balance_w2!=. ; replace ht_b=fht if ffdone==0 ; label variable ht_b "Height (cm) at balance measurement" ; /*weight at balance assessment */ gen wt_b=. ; replace wt_b=awt if balance_w1!=. ; replace wt_b=awt if fsdone==0 ; replace wt_b=fwt if balance_w2!=. ; replace wt_b=fwt if ffdone==0 ; label variable wt_b "Weight (kg) at balance measurement" ; /*BMI at balance assessment */ gen bmi_b=. ; replace bmi_b=abmi if balance_w1!=. ; replace bmi_b=abmi if fsdone==0 ; replace bmi_b=fbmi if balance_w2!=. ; replace bmi_b=fbmi if ffdone==0 ; label variable bmi_b "BMI (kg/m2) at balance measurement" ; /****CHAIR RISE********************/ /*height at chair rise assessment */ gen ht_c=. ; replace ht_c=aht if chairtime_w1!=. ; replace ht_c=fht if chairtime_w2!=. ; label variable ht_c "Height (cm) at chair rise measurement" ; /*weight at chair rise assessment */ gen wt_c=. ; replace wt_c=awt if chairtime_w1!=. ; replace wt_c=fwt if chairtime_w2!=. ; label variable wt_c "Weight (kg) at chair rise measurement" ; /*BMI at chair rise assessment */ gen bmi_c=. ; replace bmi_c=abmi if chairtime_w1!=. ; replace bmi_c=fbmi if chairtime_w2!=. ; label variable bmi_c "BMI (kg/m2) at chair rise measurement" ; /****WALKING SPEED********************/ /*height at walking speed assessment */ gen ht_walk=. ; replace ht_walk=aht if walktime_w1!=. ; replace ht_walk=fht if walktime_w1==. & walktime_w2!=. ; label variable ht_walk "Height (cm) at walking speed measurement" ; /*weight at walking speed assessment */ gen wt_walk=. ; replace wt_walk=awt if walktime_w1!=. ; replace wt_walk=fwt if walktime_w1==. & walktime_w2!=. ; label variable wt_walk "Weight (kg) at walking speed measurement" ; /*BMI at walking speed assessment */ gen bmi_walk=. ; replace bmi_walk=abmi if walktime_w1!=. ; replace bmi_walk=fbmi if walktime_w1==. & walktime_w2!=. ; label variable bmi_walk "BMI (kg/m2) at walking speed measurement" ; /*****TUG SPEED*************/ /*height at TUG assessment */ gen ht_tug=. ; replace ht_tug=aht if tugtime_w1!=. ; replace ht_tug=fht if tugtime_w1==. & tugtime_w2!=. ; label variable ht_tug "Height (cm) at TUG measurement" ; /*weight at TUG assessment */ gen wt_tug=. ; replace wt_tug=awt if tugtime_w1!=. ; replace wt_tug=fwt if tugtime_w1==. & tugtime_w2!=. ; label variable wt_tug "Weight (kg) at TUG measurement" ; /*BMI at TUG assessment */ gen bmi_tug=. ; replace bmi_tug=abmi if tugtime_w1!=. ; replace bmi_tug=fbmi if tugtime_w1==. & tugtime_w2!=. ; label variable bmi_tug "BMI (kg/m2) at TUG measurement" ; /***************************************************************************************/ /*SOCIOECONOMIC POSITION */ /*Childhood SEP */ /*Father's occupational class - ascertained in 1999-2004 HHQ questionnaire */ gen occ_fath=hfjobsc ; label variable occ_fath "Father's occupation (6 categories)" ; label define seplab 1 "I" 2" II" 3 "IIINM" 4 "IIIM" 5 "IV" 6 "V" ; label values occ_fath seplab ; /*Too few people in occ_fath=1 to run analyses using occ_fath as a categorical variable and with group 1 as reference */ gen occ_fath3=occ_fath ; recode occ_fath3 1/2=1 3/4=2 5/6=3 ; label variable occ_fath3 "Father's occupation (3 categories)" ; label define sep2lab 1 "I or II" 2 "IIINM or IIIM" 3 "IV or V" ; label values occ_fath3 sep2lab ; /*Adult SEP */ /*Own occupational class in adulthood - from 1999-2004 HHQ questionnaire */ gen occ_adult_own=hcjobsc ; label variable occ_adult_own "Own adult occupational class" ; label values occ_adult_own seplab ; /*Binary categorisation (in line with what is possible in other cohorts (where IIINM and IIIM are grouped)) */ gen occ_adult_2cat=occ_adult_own ; recode occ_adult_2cat 1/2=1 3/6=2 ; label variable occ_adult_2cat "Adult occupational class (binary)" ; label define occcatlab 1 "I or II" 2 "III, IV or V" ; label values occ_adult_2cat occcatlab ; /*Occupational class in adulthood of self for men and never married women and of husband for ever married women - from 1999-2004 HHQ questionnaire */ gen occ_adult_hh=hcsocclass ; label variable occ_adult_hh "Head of house adult occupational class" ; label values occ_adult_hh seplab ; /*Education variables */ /*Age at leaving full-time education - ascertained in 1999-2004 HHQ */ gen agelefted=hendedu ; label variable agelefted "Age at leaving full-time ed (y)" ; /*Binary categorisation as per other cohorts */ gen agelefted_2cat=agelefted ; recode agelefted_2cat min/15=1 16/max=2 ; label define ageedlab 1 "<=15" 2 ">15" ; label values agelefted_2cat ageedlab ; /* Other variables on no. of rooms and cars for household use also available */ /*OTHER COVARIATES */ /*Disability */ /* 3 category */ gen townsend_3cat=fqtfrail ; recode townsend_3cat 0=0 1/6=1 7/18=2 ; label define townlab 0 "No disability (0)" 1 "Mild disability (1-6)" 2 "Disability (7-18)" ; label values townsend_3cat townlab ; /*Living alone */ /*Creating a variable to identify people living alone at baseline based on their marital status */ gen livealn=. ; replace livealn=1 if hmstat==1 | hmstat==3 | hmstat==4 ; replace livealn=2 if hmstat==2 | hmstat==5 ; label define alonelab 1 "Living alone" 2 "Not living alone" ; label values livealn alonelab ; /*Health status */ /*History of disease at wave 1 (based on similar diseases to those used in NSHD and LBC1921)*/ /*Including history of heart attack, angina, diabetes, stroke */ gen hp_w1=. ; replace hp_w1=1 if hstroke==1 | hdiab==1 | hdocha==1 | hdocang==1 ; replace hp_w1=0 if hstroke==0 & hdiab==0 & hdocha==0 & hdocang==0 ; label variable hp_w1 "History of specified health problems at wave 1" ; label define hplab 0 "No" 1 "Yes" ; label values hp_w1 hplab ;