*###### STATA CODE ##########* drop if dem1066_short ==. *Age (continuous variable)* mean Age sum Age, detail quietly summarize Age, detail di r(p25) di r(p75) display "interquartile range = " r(p75) - r(p25) mean Age if dem1066_short==1 logistic dem1066_short Age *Age2 (continuous variable)* generate Age2 = Age*Age logistic dem1066_short Age2 *Recoding of Gender* label variable Gender "Gender" label values Gender Genderx label define Genderx 1 "Male" 2 "Female" tab Gender dem1066_short, row col proportion dem1066_short if Gender==1 proportion dem1066_short if Gender==2 logistic dem1066_short Gender *Recoding of Ethnicity* gen EthnicityF1 =0 replace EthnicityF1=1 if Ethnicity==1 replace EthnicityF1=2 if Ethnicity==4 replace EthnicityF1=3 if Ethnicity==5 replace EthnicityF1=4 if Ethnicity==7 replace EthnicityF1=4 if Ethnicity==2 replace EthnicityF1=4 if Ethnicity==3 replace EthnicityF1=4 if Ethnicity==6 replace EthnicityF1=4 if Ethnicity==8 replace EthnicityF1=4 if Ethnicity==10 replace EthnicityF1=. if Ethnicity==11 label variable Ethnicity "Ethnicity" label values EthnicityF1 EthnicityF1x label define EthnicityF1x 1 "African" 2"East Indian" 3 "Mixed African & East Indian" 4 "Mixed Other/Others ie Cauasian/ Chinese/Indigenous/Portuguese/ Other ethnic groups " tab EthnicityF1 dem1066_short if EthnicityF1 !=., row col proportion dem1066_short if EthnicityF1==1 & EthnicityF1 !=. proportion dem1066_short if EthnicityF1==2 & EthnicityF1 !=. proportion dem1066_short if EthnicityF1==3 & EthnicityF1 !=. proportion dem1066_short if EthnicityF1==4 & EthnicityF1 !=. logistic dem1066_short i.EthnicityF1 if EthnicityF1 !=. *Recoding of marital status* gen Marital_Final =0 replace Marital_Final=1 if Marrital==1 replace Marital_Final=1 if Marrital==2 replace Marital_Final=2 if Marrital==3 replace Marital_Final=3 if Marrital==4 replace Marital_Final=4 if Marrital==5 replace Marital_Final=. if Marrital==6 label variable Marital_Final "Marital_Final" label values Marital_Final Marital_Finalx label define Marital_Finalx 1 "Divorced/Legally separated" 2 "Married/Co-habiting" 3 "Never married" 4 "Widowed" tab Marital_Final dem1066_short if Marital_Final !=5, row col proportion dem1066_short if Marital_Final==1 & Marital_Final !=. proportion dem1066_short if Marital_Final==2 & Marital_Final !=. proportion dem1066_short if Marital_Final==3 & Marital_Final !=. proportion dem1066_short if Marital_Final==4 & Marital_Final !=. logistic dem1066_short ib2.Marital_Final if Marital_Final!=. *Recoding of Education* gen EducationF=1 if Education==0 replace EducationF=2 if Education==1 replace EducationF=3 if Education==2 replace EducationF=4 if Education==3 replace EducationF=4 if Education==4 replace EducationF=. if Education==9 label variable Education "Education " label values EducationF EducationFx label define EducationFx 1 "None" 2 "Primary" 3 "Secondary" 4 "Tertiary/other" tab EducationF dem1066_short if EducationF !=., row col proportion dem1066_short if EducationF==1 & EducationF !=. proportion dem1066_short if EducationF==2 & EducationF !=. proportion dem1066_short if EducationF==3 & EducationF !=. proportion dem1066_short if EducationF==4 & EducationF !=. logistic dem1066_short ib4.EducationF if EducationF !=. *Recoding of Religion* gen ReligionF =0 replace ReligionF=1 if Religion==1 replace ReligionF=1 if Religion==2 replace ReligionF=1 if Religion==3 replace ReligionF=1 if Religion==6 replace ReligionF=1 if Religion==7 replace ReligionF=1 if Religion==8 replace ReligionF=1 if Religion==10 replace ReligionF=1 if Religion==11 replace ReligionF=1 if Religion==13 replace ReligionF=1 if Religion==14 replace ReligionF=2 if Religion==4 replace ReligionF=3 if Religion==5 replace ReligionF=4 if Religion==16 replace ReligionF=4 if Religion==17 label variable Religion "Religion " label values ReligionF ReligionFx label define ReligionFx 1 "Christian" 2 "Hindu" 3 "Muslim" 4 "Not stated/none" tab ReligionF dem1066_short if ReligionF !=., row col proportion dem1066_short if ReligionF==1 & ReligionF !=. proportion dem1066_short if ReligionF==2 & ReligionF !=. proportion dem1066_short if ReligionF==3 & ReligionF !=. proportion dem1066_short if ReligionF==4 & ReligionF !=. logistic dem1066_short i.ReligionF if ReligionF !=. * Recoding of Occupation* gen OccupationtypeF =0 replace OccupationtypeF=1 if Occupationtype==3 replace OccupationtypeF=1 if Occupationtype==7 replace OccupationtypeF=1 if Occupationtype==4 replace OccupationtypeF=1 if Occupationtype==6 replace OccupationtypeF=2 if Occupationtype==1 replace OccupationtypeF=2 if Occupationtype==2 replace OccupationtypeF=3 if Occupationtype==8 replace OccupationtypeF=3 if Occupationtype==10 replace OccupationtypeF=4 if Occupationtype==9 replace OccupationtypeF=5 if Occupationtype==5 replace OccupationtypeF=. if Occupationtype==99 label variable Occupationtype "Occupationtype " label values OccupationtypeF OccupationtypeFx label define OccupationtypeFx 1 "Professional/Associate professional/Manager/Administrator/clerical worker/secretary" 2 "Agricultural worker" 3 "Unskilled/Semi-skilled labourer " 4 "skilled labourer" 5 "Housewife" tab OccupationtypeF dem1066_short if OccupationtypeF !=., row col proportion dem1066_short if OccupationtypeF==1 & OccupationtypeF !=. proportion dem1066_short if OccupationtypeF==2 & OccupationtypeF !=. proportion dem1066_short if OccupationtypeF==3 & OccupationtypeF !=. proportion dem1066_short if OccupationtypeF==4 & OccupationtypeF !=. proportion dem1066_short if OccupationtypeF==5 & OccupationtypeF !=. logistic dem1066_short i.OccupationtypeF if OccupationtypeF !=. * Recoding of type of Accommodation * gen AccommotypeF=1 if Accommotype==0 replace AccommotypeF=2 if Accommotype==1 replace AccommotypeF=2 if Accommotype==2 replace AccommotypeF=2 if Accommotype==4 replace AccommotypeF=. if Accommotype==9 label variable Accommotype "Accommotype " label values AccommotypeF AccommotypeFx label define AccommotypeFx 1 "Detached house" 2 "Condominium/Townhouse/Other" tab AccommotypeF dem1066_short if AccommotypeF !=., row col proportion dem1066_short if AccommotypeF==1 & AccommotypeF !=. proportion dem1066_short if AccommotypeF==2 & AccommotypeF !=. logistic dem1066_short i.AccommotypeF if AccommotypeF !=. * Recoding of "Tenure of Accommodation"* gen AccommotenureF=0 replace AccommotenureF=1 if Accommotenure==1 replace AccommotenureF=1 if Accommotenure==2 replace AccommotenureF=2 if Accommotenure==3 replace AccommotenureF=2 if Accommotenure==4 replace AccommotenureF=2 if Accommotenure==6 replace AccommotenureF=. if Accommotenure==9 label variable Accommotenure "Accommotenure " label values AccommotenureF AccommotenureFx label define AccommotenureFx 1 "Privately owned by spouse/family" 2 "Rented from private landlord/NHA/housing association/Geriatric care home/other" 3 "Not stated" tab AccommotenureF dem1066_short if AccommotenureF !=., row col proportion dem1066_short if AccommotenureF==1 & AccommotenureF !=. proportion dem1066_short if AccommotenureF==2 & AccommotenureF !=. logistic dem1066_short i.AccommotenureF if AccommotenureF !=. *Recoding of "Living arrangements of chief respondent"* gen Socialnetwork1 =0 replace Socialnetwork1 =1 if Socialnetwork==1 replace Socialnetwork1 =2 if Socialnetwork==2 replace Socialnetwork1 =3 if Socialnetwork==3 replace Socialnetwork1 =4 if Socialnetwork==4 replace Socialnetwork1 =5 if Socialnetwork==5 replace Socialnetwork1 =. if Socialnetwork==9 label variable Socialnetwork "Socialnetwork" label values Socialnetwork1 Socialnetwork1x label define Socialnetwork1x 1 "Yourself /alone" 2 "With Spouse" 3 "With spouse and children" 4 "With children alone " 5 "With other " tab Socialnetwork1 dem1066_short if Socialnetwork1 != ., row col proportion dem1066_short if Socialnetwork1==1 & Socialnetwork1 !=. proportion dem1066_short if Socialnetwork1==2 & Socialnetwork1 !=. proportion dem1066_short if Socialnetwork1==3 & Socialnetwork1 !=. proportion dem1066_short if Socialnetwork1==4 & Socialnetwork1 !=. proportion dem1066_short if Socialnetwork1==5 & Socialnetwork1 !=. logistic dem1066_short i.Socialnetwork1 if Socialnetwork1 !=. * Recoding of the medical conditions (Presence of Comorbidity)* egen total_Comorbidity = rowtotal(Medconditions1 - Medconditions17) gen Comorbidity =1 if total_Comorbidity==0 replace Comorbidity =2 if total_Comorbidity==1 replace Comorbidity =3 if total_Comorbidity==2 replace Comorbidity =4 if total_Comorbidity==3 replace Comorbidity =5 if total_Comorbidity==4 replace Comorbidity =5 if total_Comorbidity==5 replace Comorbidity =5 if total_Comorbidity==6 replace Comorbidity =5 if total_Comorbidity==7 label variable Comorbidity "Comorbidity " label values Comorbidity Comorbidityx label define Comorbidityx 1 "None" 2 "one Comorbidity" 3 "two Comorbidities" 4 "three Comorbidities" 5 "four and more Comorbidities" tab Comorbidity dem1066_short, row col proportion dem1066_short if Comorbidity==1 proportion dem1066_short if Comorbidity==2 proportion dem1066_short if Comorbidity==3 proportion dem1066_short if Comorbidity==4 proportion dem1066_short if Comorbidity==5 logistic dem1066_short i.Comorbidity * Recoding of "Alcohol"* *How often do you normally have a drink of something with alcohol in it? gen Alcohol1 =1 if Alcohol==0 replace Alcohol1 =2 if Alcohol==1 replace Alcohol1 =3 if Alcohol==2 replace Alcohol1 =3 if Alcohol==3 replace Alcohol1 =. if Alcohol==9 label variable Alcohol1 "Alcohol1" label values Alcohol1 Alcohol1x label define Alcohol1x 1 "Never" 2 "Less than once a month" 3 "At least weekly+less than a week" tab Alcohol1 dem1066_short if dem1066_short != . , row col proportion dem1066_short if Alcohol1==1 proportion dem1066_short if Alcohol1==2 proportion dem1066_short if Alcohol1==3 logistic dem1066_short i. Alcohol1 if Alcohol1 ! = . *Smoking History* gen Smoker=1 replace Smoker =1 if Smokeever == 0 replace Smoker =2 if Smokeever == 1 replace Smoker =3 if Smoke==1 label variable Smoker "Categories of Smokers" label values Smoker Smokerx label define Smokerx 1 "Never Smoker" 2 "Ever Smoker" 3 "Current Smoker" tab Smoker dem1066_short , row col proportion dem1066_short if Smoker==1 proportion dem1066_short if Smoker==2 proportion dem1066_short if Smoker==3 logistic dem1066_short i.Smoker **Self-reported Medical conditions** *Arthritis* gen Arthritis=0 replace Arthritis = 1 if Medconditions3 == 1 label variable Arthritis "Arthritis" label values Arthritis Arthritisx label define Arthritisx 0 "No" 1 "Yes" tab Arthritis dem1066_short , row col proportion dem1066_short if Arthritis ==1 logistic dem1066_short Arthritis *Angina* gen Angina =0 replace Angina = 1 if Medconditions1 == 1 label variable Angina "Angina" label values Angina Anginax label define Anginax 0 "No" 1 "Yes" tab Angina dem1066_short , row col proportion dem1066_short if Angina ==1 logistic dem1066_short i.Angina *Diabetes (DM)* gen DM =0 replace DM = 1 if Medconditions8 == 1 label variable DM "Diabetes Mellitus(DM)" label values DM DMx label define DMx 0 "No" 1 "Yes" tab DM dem1066_short , row col proportion dem1066_short if DM ==1 logistic dem1066_short DM *Heart disease (HD)* gen HD =0 replace HD = 1 if Medconditions11 == 1 label variable HD "Heart disease (HD)" label values HD HDx label define HDx 0 "No" 1 "Yes" tab HD dem1066_short , row col proportion dem1066_short if HD ==1 logistic dem1066_short HD *High Cholesterol* gen Cholesterol =0 replace Cholesterol = 1 if Medconditions12 == 1 label variable Cholesterol "High Cholesterol" label values Cholesterol Cholesterolx label define Cholesterolx 0 "No" 1 "Yes" tab Cholesterol dem1066_short , row col proportion dem1066_short if Cholesterol ==1 logistic dem1066_short Cholesterol *Hypertension/BP medicineā€ gen HTN=0 replace HTN = 1 if Medconditions13 == 1 replace HTN = 1 if Medications2 == 1 label variable HTN "Hypertension/BP medicine" label values HTN HTNx label define HTNx 0 "No" 1 "Yes" tab HTN dem1066_short , row col proportion dem1066_short if HTN==1 logistic dem1066_short HTN *Stroke* gen Stroke =0 replace Stroke = 1 if Medconditions15 == 1 label variable Stroke "Stroke" label values Stroke Strokex label define Strokex 0 "No" 1 "Yes" tab Stroke dem1066_short , row col proportion dem1066_short if Stroke ==1 logistic dem1066_short Stroke * Impairment level "Eyesight"* recode Impairmentlevel1 (0=0) (1/3=1) , gen (Eyesight) label variable Eyesight "Eyesight" label values Eyesight Eyesightx label define Eyesightx 0 "No" 1 "Yes" tab Eyesight dem1066_short, row col proportion dem1066_short if Eyesight==0 proportion dem1066_short if Eyesight==1 logistic dem1066_short Eyesight * Impairment level "Hearing"* recode Impairmentlevel2 (0=0) (1/3=1) , gen (Hearing) label variable Hearing "Hearing" label value Hearing Hearingx label define Hearingx 0 "No" 1 "Yes" tab Hearing dem1066_short, row col proportion dem1066_short if Hearing==0 proportion dem1066_short if Hearing==1 logistic dem1066_short Hearing * Impairment level "Climbing Stairs"* recode Impairmentlevel3 (0=0) (1/3=1) , gen (Climbing) label variable Climbing "Climbing Stairs" label values Climbing Climbingx label define Climbingx 0 "No" 1 "Yes" tab Climbing dem1066_short, row col proportion dem1066_short if Climbing==0 proportion dem1066_short if Climbing==1 logistic dem1066_short Climbing * Impairment level "Walking"* recode Impairmentlevel4 (0=0) (1/3=1) , gen (Walking) label variable Walking "Walking" label values Walking Walkingx label define Walkingx 0 "No" 1 "Yes" tab Walking dem1066_short, row proportion dem1066_short if Walking==0 proportion dem1066_short if Walking==1 logistic dem1066_short Walking * Impairment level "Ability to speak and understand"* recode Impairmentlevel5 (0=0) (1/3=1) , gen (Speaking) label variable Speaking "Ability to speak and understand" label values Speaking Speakingx label define Speakingx 0 "No" 1 "Yes" tab Speaking dem1066_short, row col proportion dem1066_short if Speaking==0 proportion dem1066_short if Speaking==1 logistic dem1066_short Speaking *Instrumental activities of daily living (IADLCat)* egen IADL = rowtotal (Iadl1-Iadl8) recode IADL (0=0) (1/2=1) (3/4=2) (5/8=3), gen (IadlF) label variable IadlF "IADLs" label values IadlF IadlFx label define IadlFx 0 "No activity" 1 "at least two activities" 2 "3 or 4 activates" 3 "5 or 8 activities" tab IadlF dem1066_short if IadlF !=. , row col proportion dem1066_short if IadlF==0 proportion dem1066_short if IadlF==1 proportion dem1066_short if IadlF==2 proportion dem1066_short if IadlF==3 logistic dem1066_short i.IadlF **lifestyle : exercise (taking into account both work and leisure, would you say you are physically active)* gen ExerciseF1=1 replace ExerciseF1= 1 if Exercise==0 replace ExerciseF1= 1 if Exercise==1 replace ExerciseF1= 2 if Exercise==2 replace ExerciseF1= 3 if Exercise==3 replace ExerciseF1= . if Exercise==9 label variable ExerciseF1 "Categories of Exercise" label values ExerciseF1 ExerciseF1x label define ExerciseF1x 1 "Moderate/High" 2 "Low" 3 "None" proportion dem1066_short if ExerciseF1==1 proportion dem1066_short if ExerciseF1==2 proportion dem1066_short if ExerciseF1==3 tab ExerciseF1 dem1066_short if ExerciseF1 != . , row col logistic dem1066_short ib1.ExerciseF1 *For Medical Conditions* *Adjusted for age, age2, gender ethnicity, religion and self-reported medical conditions variables Model(Model I)* logistic dem1066_short Age Age2 Gender EthnicityF1 ReligionF Arthritis Angina DM HTN HD Cholesterol Stroke, vce(cluster EDNumber) estat classif estat gof estat gof, group(10) table lroc, nograph predict model1 *Adjusted for age age2, gender, ethnicity, religion, education, occupation and self-reported medical conditions variables Model(Model II)* logistic dem1066_short Age Age2 Gender EthnicityF1 ReligionF EducationF OccupationtypeF Arthritis Angina DM HTN HD Cholesterol Stroke , vce(cluster EDNumber) estat classif estat gof estat gof, group(10) table lroc, nograph predict model2 *Adjusted age, age2, gender, ethnicity, education, religion occupation, alcohol, smoker, marital status, Living arrangements of chief respondent(socialnetwork1), accommodation tenure, self-reported medical conditions variables (Model III)* logistic dem1066_short Age Age2 Gender EthnicityF1 EducationF ReligionF OccupationtypeF Alcohol1 Smoker Marital_Final Socialnetwork1 AccommotenureF Arthritis Angina DM HTN HD Cholesterol Stroke , vce(cluster EDNumber) estat classif estat gof estat gof, group(10) table lroc, nograph predict model3 **For quality of life variables* *Adjusted for age, age2 gender, ethnicity and Religion with quality of life variables (Model IV)* logistic dem1066_short Age Age2 Gender EthnicityF1 ReligionF Eyesight Hearing Climbing Walking Speaking i.IadlF i.ExerciseF1, vce(cluster EDNumber) estat classif estat gof estat gof, group(10) table lroc, nograph predict model4 *Adjusted for age, age2, gender, ethnicity, religion, education, occupation, with quality of life variables (Model V)* logistic dem1066_short Age Age2 Gender EthnicityF1 EducationF ReligionF OccupationtypeF Eyesight Hearing Climbing Walking Speaking i.IadlF i.ExerciseF1, vce(cluster EDNumber) estat classif estat gof estat gof, group(10) table lroc, nograph predict model5 *Adjusted age, age2, gender, ethnicity, education, religion occupation, alcohol, smoker, marital status, Living arrangements of chief respondent(socialnetwork1), accommodation tenure and quality of life variables (Model VI)* logistic dem1066_short Age Age2 Gender EthnicityF1 EducationF ReligionF OccupationtypeF Alcohol1 Smoker Marital_Final Socialnetwork1 AccommotenureF Eyesight Hearing Climbing Walking Speaking i.IadlF i.ExerciseF1, vce(cluster EDNumber) estat classif estat gof estat gof, group(10) table lroc, nograph predict model6 roccomp dem1066_short model1 model2 model3, graph summary roccomp dem1066_short model4 model5 model6, graph summary roccomp dem1066_short model1 model2 roccomp dem1066_short model2 model3 roccomp dem1066_short model4 model5 roccomp dem1066_short model5 model6