******************************************************************** * File HALCyon PC covariate syntax_Aberdeen1936.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 Aberdeen Birth Cohort 1936 (ABC1936) * Date Created 20/08/2009 * last modified 15/11/2011 * PURPOSE Recodes and derives physical capability variables, basic sociodemographic variables * and covariates (indicators of socioeconomic position, 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=. ; /*********************************************************************************/ /*Standard names and categories for demographic variables */ /* SEX */ gen sex=gender ; label variable sex "Sex of study member" ; label define sex1lab 1 "Male" 2 "Female" ; label values sex sex1lab ; /*AGE */ /*Variables on date of birth and date at wave 1 */ /*All same age (born in 1936) but wave 1 conducted between 1999 and 2005 */ /*Converting dates to Stata dates (i.e. days since 1 January 1960) - for calculation of age at wave 1 in years */ gen double dob_st=dofC(dob) ; /*one person has a date of birth outside the expected range - on checking this is because it is coded as 10March2002 */ /*assume this should be 10March1936 and recode accordingly */ replace dob_st=-8691 if dob_st==15408 ; gen double w1_date_st=dofC(w1_date) ; label variable w1_date_st "Wave 1 collection date (stata format)" ; label variable dob_st "Date of birth (stata format)" ; /*Calculate age in days at wave 1 (subtracting dob_st as it is a negative number (because it is pre=1960)) */ gen aged_w1=w1_date_st-dob_st ; /*dividing by 365 for estimation of age in years */ gen age_w1=aged_w1/365.25 ; label variable aged_w1 "Age(in days) at wave 1" ; label variable age_w1 "Age(y) at wave 1" ; gen age_w4=age_W4 ; label variable age_w4 "Age(y) at wave 4" ; /*Categories of age at time of wave 1 */ /*in 10 year age groups 50-59, 60-69, 70-79 */ gen agecat_w1=age_w1 ; recode agecat_w1 (min/59.999=0)(60/69.999=1) (70/79.999=2) (80/89.999=3) ; label variable agecat_w1 "Age at wave 1 (10y cat.)" ; label define agelab 0 "50-59" 1 "60-69" 2 "70-79" 3 "80+" ; label values agecat_w1 agelab ; /*in 5 year age groups 55-59, 60-64, 65-69, 70-74, 75-79, 80-84 years */ gen agecat5_w1=age_w1 ; recode agecat5_w1 (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_w1 "Age at wave 1 (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_w1 age5lab ; /*********************************************************************************/ /* PHYSICAL CAPABILITY MEASURES */ /*WALKING TIME */ /*Measured at wave 1 - time taken to walk 6m at a normal pace */ gen walktime_w1=wtm ; 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/wtm ; label variable walkspeed_w1 "Walking speed (m/s), wave 1" ; /*BALANCE */ /*Assessed whether participant able to balance with eyes open for 5 seconds */ gen balance_5_w1=bal1 ; label variable balance_5_w1 "Able to balance for at least 5s?" ; label define yeslab 0 "No" 1 "Yes" ; label values balance_5_w1 yeslab ; /*Coding balance the alternative way so that inability to balance is the 'positive' outcome */ gen balance_5_w1_opp=. ; replace balance_5_w1_opp=1 if bal1==0 ; replace balance_5_w1_opp=0 if bal1==1 ; label variable balance_5_w1_opp "Able to balance for at least 5s?" ; label define nolab 1 "No" 0 "Yes" ; label values balance_5_w1_opp nolab ; /*ABILITY TO STAND FROM SITTING POSITION */ /*Not a very useful variable as only 1 person could not stand from sitting */ gen sitstand_w1=sitstand ; label variable sitstand_w1 "Able to stand from a seated position?" ; label values sitstand_w1 yeslab ; /***************************************************************************************/ /*SOCIOECONOMIC POSITION */ /*Childhood SEP - reported in 2001 questionnaire */ /*Occupational class of father in childhood (recalled at wave 1) */ gen occ_fath=f_occode ; label variable occ_fath "Father's occupation" ; label define sepxlab 1 "Manager & administrator" 2 "Professional" 3 "Associate professional & technical" 4 "Clerical & secretarial" 5 "Craft & related" 6 "Personal & protected service" 7 "Sales" 8 "Plant & machinery" 9 "Other manual" ; label values occ_fath sepxlab ; /*Occupational class of mother in childhood (recalled at wave 1) */ gen occ_moth=m_occode ; label variable occ_moth "Mother's occupation" ; label values occ_moth sepxlab ; /*Other childhood variables - no. of rooms, no. of people in house, sanitation indoors, bed shared (recalled at wave 1) */ /*Adult SEP */ /*Main occupational class in adulthood ascertained at wave 1 */ gen occ_adult=occ_code ; label variable occ_adult "Adult occupational class" ; label values occ_adult sepxlab ; /*Creating 2 category variable */ gen occ_adult_2cat=occ_adult ; recode occ_adult_2cat 1/3=1 4/9=2 ; label variable occ_adult_2cat "Adult occupational class (binary)" ; label define occcatlab 1 "Associate pro & technical or higher" 2 "Clerical & sec or lower" ; label values occ_adult_2cat occcatlab ; /*Education variables */ /*Years in full-time formal education */ gen yearsed=edu_year ; label variable yearsed "Years in full-time formal education" ; /*Creating a binary version of this variable (equivalent to LBC1921)*/ 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 ; /*Highest educational qualification obtained */ gen highestqual=qual21 ; label variable highestqual "Highest qualification achieved" ; label define quallab 1 "None" 2 "Lower leaving certificate" 3 "Higher leaving certificate" 4 "Scotvec" 5 "O grades/levels" 6 "A grades/levels" 7 "Diploma/degree" 8 "Postgraduate" 9 "Professional" 10 "Other" ; label values highestqual quallab ; /*********************************/ /* OTHER COVARIATES */ /* HEALTH STATUS AT W1 */ /*History of disease at wave 1 (based on similar diseases to those used in other cohorts (but more restricted due to lack of vars)*/ /*Including history of heart disease, diabetes */ gen hp_w1=. ; replace hp_w1=1 if pheart1==1 | pdiabet==1 ; replace hp_w1=0 if pheart1==0 & pdiabet==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 ; /*LIVING ALONE */ /*Aberdeen has a variable indicating whether people are living alone but also has data on marital status so can compare the 2 */ gen livealonx=livealon ; recode livealonx 0=2 ; label define alonelab 1 "Living alone" 2 "Not living alone" ; label values livealonx alonelab ; /*Creating a variable to identify people living alone at baseline based on their marital status */ gen livealnm=. ; replace livealnm=1 if marital==1 | marital==3 | marital==4 ; replace livealnm=2 if marital==2 ; label values livealnm alonelab ; /*BMI */ gen bmi=wgt/((hgt/100)^2) ;