******************************************************************** * File HALCyon PC covariate syntax_Lothian1921.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 Lothian Birth Cohort 1921 (LBC21) * Date Created 20/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 neuroticism) 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=. ; /*********************************************************************************/ /*Standard names and categories for demographic variables */ /* SEX */ gen sex=gender ; label variable sex "Sex of study member" ; label define sexlab 1 "Male" 2 "Female" ; label values sex sexlab ; /*AGE */ /*Wave 1 measures at approx age 79, wave 2 measures at approx age 83 and wave 3 at approx age 87 */ /*Small range in ages as attendance at clinic occurred over the period 1999 to 2001 for wave 1*/ /*using lbcappdt and dob rather than mhtdays as mhtdays missing for 2 men who did participate at wave 1 */ /*need to ensure that LBC0401E is coded as 02.11.2000 for lbcappdt as this was missing from original data file received */ gen age_w1=(lbcappdt-dob)/365.25 ; label variable age_w1 "Age at wave 1 (1999-2001)" ; /*wave 2*/ gen age_w2=agedayep/365.25 ; label variable age_w2 "Age at wave 2" ; /*wave 3*/ gen age_w3=agedaywtcrf/365.25 ; label variable age_w3 "Age at wave 3" ; /*********************************************************************************/ /* PHYSICAL CAPABILITY MEASURES */ /* GRIP STRENGTH */ /*Measured at waves 1, 2 and 3 using Jamar or Northern Coast dynamometer */ /* Wave 1 - age 79 */ /*provided with measure which is best of 3 from dominant hand */ gen bestgrip_w1=gripstr ; label variable bestgrip_w1 "Grip strength (kg), best of 3, wave 1" ; /* Wave 2 - age 83 */ /*provided with measure which is best of 3 from dominant hand */ gen bestgrip_w2=gripstr83 ; label variable bestgrip_w2 "Grip strength (kg), best of 3, wave 2" ; /*Wave 3 - age 87 */ /* 3 variables provided - best of 3 from R hand, best of 3 from L hand, best of 3 from dominant hand */ /* for consistency with measures from other 2 waves use best of 3 from dominant hand */ gen bestgrip_w3=gripstr87 ; label variable bestgrip_w3 "Grip strength (kg), best of 3, wave 3" ; /*WALKING TIME */ /*Measured at wave 1 - time taken to walk 6m as quickly but as safely as possible */ gen walktime_w1=sixmtime ; label variable walktime_w1 "Time to walk 6m (s), wave 1"; /*Using walking time to calculate walking speed in m/s */ gen walkspeed_w1=6/sixmtime ; label variable walkspeed_w1 "Walking speed (m/s), wave 1" ; /*Repeated at wave 3 - time taken to walk 6m as quickly but as safely as possible */ gen walktime_w3= sixmwk87 ; label variable walktime_w3 "Time to walk 6m (s), wave 3"; /*Using walking time to calculate walking speed in m/s */ gen walkspeed_w3=6/sixmwk87 ; label variable walkspeed_w3 "Walking speed (m/s), wave 3" ; /***************************************************************************************/ /*SOCIOECONOMIC POSITION */ /*Childhood SEP - reported in 2001 questionnaire */ /*Occupational class of father at age 11y (recalled in 2001, at age 80y) */ gen occ_fath=sclsfath ; label variable occ_fath "Father's occupation at age 11y" ; label define seplab 1 "I" 2 "II" 3 "III" 4 "IV" 5 "V" ; label values occ_fath seplab ; /*Occupational class of mother at age 11y (recalled in 2001, at age 80y) */ gen occ_moth=sclsmot ; label variable occ_moth "Mother's occupation at age 11y" ; label values occ_moth seplab ; /*Father's and mother's number of years in education */ gen yearsed_fath=fathsed ; label variable yearsed_fath "Father's education (no. of years)" ; gen yearsed_moth=mothsed ; label variable yearsed_moth "Mother's education (no. of years)" ; /*Categorising father's and mother's number of years in education */ gen yearsed_fathc=yearsed_fath ; recode yearsed_fathc min/8.9=3 9/12.9=2 13/max=1 ; label variable yearsed_fathc "Father's years in education" ; label define edlab 1 ">=13y" 2 "9-12y" 3 "<9y" ; label values yearsed_fathc edlab ; gen yearsed_mothc=yearsed_moth ; recode yearsed_mothc min/8.9=3 9/12.9=2 13/max=1 ; label variable yearsed_mothc "Mother's years in education" ; label values yearsed_mothc edlab ; /*Other childhood variables - no. of rooms, no. of people in house, crowding, indoor toilet facilities (all at age 11y) */ /*Adult SEP */ /*Highest reached occupational class in adulthood ascertained at wave 1 */ gen occ_adult=soclcode ; label variable occ_adult "Adult occupational class" ; label values occ_adult seplab ; /*Creating 2 category variable */ gen occ_adult_2cat=occ_adult ; recode occ_adult_2cat 1/2=1 3/5=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 ; /*Education variables */ /*Years in full-time formal education ascertained at wave 1 */ gen yearsed=yrseduc ; label variable yearsed "Years in full-time formal education" ; /*Creating a binary version of this variable */ gen yearsed_2cat=yearsed ; recode yearsed_2cat 6/10=1 10.5/max=2 ; label define yearsedlab 1 "<=10y" 2 ">10y" ; label values yearsed_2cat yearsedlab ; /*Other adult variables - type of accommodation, income, access to a range of facilities, years in main job, no. of years worked full-time, age at retirement */ /*OTHER COVARIATES */ /*Health status*/ /*History of disease at wave 1 (based on similar diseases to those used in NSHD)*/ /*Including history of cardiovascular disease, cancer, diabetes, cerebrovascular disease, dementia, other vascular problems */ gen hp_w1=. ; replace hp_w1=1 if cvd==1 | cahist==1 | diabhist==1 | cerbvasc==1 | demhist==1 | vaschist==1 ; replace hp_w1=0 if cvd==0 & cahist==0 & diabhist==0 & cerbvasc==0 & demhist==0 & vaschist==0 ; replace hp_w1=3 if hp_w1==. & (cvd==3 | cahist==3 | diabhist==3 | cerbvasc==3 | demhist==3 | vaschist==3) ; label variable hp_w1 "History of specified health problems at wave 1" ; label define hplab 0 "No" 1 "Yes" 3 "Unsure" ; label values hp_w1 hplab ; /*Neuroticism */ /*Reversal of scale for emotional stability so that it indicates neuroticism */ gen neurot=(40-emotstab)+1 ; /*Disability */ /* 3 category */ gen townsend_3cat=townsendtotal ; 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 */ /*Recoding of living alone into binary categorisation */ gen livealnx=livealn ; recode livealnx 1=1 2/3=2 ; label define alonelab 1 "Living alone" 2 "Not living alone" ; label values livealnx alonelab ;