#2010 Asthma rm(list=ls(all=TRUE)) setwd("[working directory]") #import data Population = read.csv("Population.csv") Life_exp = read.csv("Life_exp.csv") BoD2010 = read.csv("BoD.csv") PAF_calc = read.csv("PAF_calc.csv") EBoD2010 = read.csv("EBoD.csv") Deaths = read.csv("Deaths.csv") Prevalence201415 = read.csv("Morb_201415.csv") DW = read.csv("DW.csv") NO2_Exp = read.csv("NO2_Exp.csv") counterfact = 10 #set counterfactual value increment = 10 #set NO2 increment (from ERF used) Asthma_Morb_mean = 1.255 #set ERF for asthma morbidity Asthma_Morb_lower = 1.001 #set lower confidence interval bound Asthma_Morb_upper = 1.573 #set upper confidence interval bound Asthma_Mort_mean = 1 #set ERF for asthma mortality Asthma_Mort_lower = 1 #set lower confidence interval bound Asthma_Mort_upper = 1 #set upper confidence interval bound #load Packages library(dplyr) #Step 1: calculate "raw" Burden of Disease due to health outcomes #Years of Life Lost (YLL) 2010 BoD2010$YLLmale2010 = Deaths$X2010Asthmamale * Life_exp$X2010Male BoD2010$YLLfemale2010 = Deaths$X2010Asthmafemale * Life_exp$X2010Female BoD2010$YLLtotal2010 = BoD2010$YLLmale2010 + BoD2010$YLLfemale2010 #calculate population at age 18 (from age group 15 to 20) Pop15_20_male = Population[5, "X2010male"] Pop18_male = (Pop15_20_male / 5 * 2) Pop18_male Pop15_20_female = Population[5, "X2010female"] Pop18_female = (Pop15_20_female / 5 * 2) Pop18_female #calculate prevalence 2010 with correct age groups BoD2010$Prevalence_male2010 = ifelse(Prevalence201415$X == "15 - 19", (Pop18_male * Prevalence201415$X201415AsthmaMale), Population$X2010male * Prevalence201415$X201415AsthmaMale) BoD2010$Prevalence_female2010 = ifelse(Prevalence201415$X == "15 - 19", (Pop18_female * Prevalence201415$X201415AsthmaFemale), Population$X2010female * Prevalence201415$X201415AsthmaFemale) BoD2010$Prevalence_female2010 #Years Lived with Disability (YLD) 2010 male BoD2010$YLDmeanmale2010 = BoD2010$Prevalence_male2010 * DW$AsthmaMale_mean BoD2010$YLDlowermale2010 = BoD2010$Prevalence_male2010 * DW$AsthmaMale_lower BoD2010$YLDuppermale2010 = BoD2010$Prevalence_male2010 * DW$AsthmaMale_upper #YLD 2010 female BoD2010$YLDmeanfemale2010 = BoD2010$Prevalence_female2010 * DW$AsthmaFemale_mean BoD2010$YLDlowerfemale2010 = BoD2010$Prevalence_female2010 * DW$AsthmaFemale_lower BoD2010$YLDupperfemale2010 = BoD2010$Prevalence_female2010 * DW$AsthmaFemale_upper #Disability-Adjusted Life Years (DALYS) 2010 male BoD2010$DALYmeanmale2010 = BoD2010$YLLmale2010 + BoD2010$YLDmeanmale2010 BoD2010$DALYlowermale2010 = BoD2010$YLLmale2010 + BoD2010$YLDlowermale2010 BoD2010$DALYuppermale2010 = BoD2010$YLLmale2010 + BoD2010$YLDuppermale2010 #DALYS 2010 female BoD2010$DALYmeanfemale2010 = BoD2010$YLLfemale2010 + BoD2010$YLDmeanfemale2010 BoD2010$DALYlowerfemale2010 = BoD2010$YLLfemale2010 + BoD2010$YLDlowerfemale2010 BoD2010$DALYupperfemale2010 = BoD2010$YLLfemale2010 + BoD2010$YLDupperfemale2010 #Calculate Exposure-Response Functions (ERF) #### #calculate ß-values morbidity ß_morb_mean = log(Asthma_Morb_mean) / increment ß_morb_lower = log(Asthma_Morb_lower) / increment ß_morb_upper = log(Asthma_Morb_upper) / increment #calculate ß-values mortality ß_mort_mean = log(Asthma_Mort_mean) / increment ß_mort_lower = log(Asthma_Mort_lower) / increment ß_mort_upper = log(Asthma_Mort_upper) / increment #Calculate ERF for Morbidity and Mortality with Confidence Interval over all NO2 Concentrations #ERF Morbidity #2010: morbidity mean PAF_calc$EWF2010mean_morb = (exp(ß_morb_mean * (NO2_Exp$mean_concentr - counterfact))) PAF_calc$EWF2010mean_morb = ifelse(PAF_calc$EWF2010mean_morb < 1, 1, PAF_calc$EWF2010mean_morb) #2010: morbidity lower PAF_calc$EWF2010lower_morb = (exp(ß_morb_lower * (NO2_Exp$mean_concentr - counterfact))) PAF_calc$EWF2010lower_morb = ifelse(PAF_calc$EWF2010lower_morb < 1, 1, PAF_calc$EWF2010lower_morb) #2010: morbidity upper PAF_calc$EWF2010upper_morb = (exp(ß_morb_upper * (NO2_Exp$mean_concentr - counterfact))) PAF_calc$EWF2010upper_morb = ifelse(PAF_calc$EWF2010upper_morb < 1, 1, PAF_calc$EWF2010upper_morb) #ERF Mortality #2010: mortality mean PAF_calc$EWF2010mean_mort = (exp(ß_mort_mean * (NO2_Exp$mean_concentr - counterfact))) PAF_calc$EWF2010mean_mort = ifelse(PAF_calc$EWF2010mean_mort < 1, 1, PAF_calc$EWF2010mean_mort) #2010: mortality lower PAF_calc$EWF2010lower_mort = (exp(ß_mort_lower * (NO2_Exp$mean_concentr - counterfact))) PAF_calc$PAF2010lower_mort = ifelse(PAF_calc$EWF2010lower_mort < 1, 1, PAF_calc$EWF2010lower_mort) #2010: mortality upper PAF_calc$EWF2010upper_mort = (exp(ß_mort_upper * (NO2_Exp$mean_concentr - counterfact))) PAF_calc$EWF2010upper_mort = ifelse(PAF_calc$EWF2010upper_mort < 1, 1, PAF_calc$EWF2010upper_mort) #Calculate Population Attributable Fraction (PAF) #### #Morbidity #PAF for all concentrations 2010: morbidity mean PAF_calc$PAF2010mean_morb = (NO2_Exp$X2010 * (PAF_calc$EWF2010mean_morb - 1)) / (NO2_Exp$X2010 * ((PAF_calc$EWF2010mean_morb - 1)+ 1)) PAF_calc$PAF2010mean_morb = ifelse(PAF_calc$PAF2010mean_morb < 0, 0, PAF_calc$PAF2010mean_morb) PAF_calc$PAF2010mean_morb_pop = (PAF_calc$PAF2010mean_morb * NO2_Exp$X2010) PAF2010mean_morb_val = (sum(PAF_calc$PAF2010mean_morb_pop, na.rm=T) / sum(NO2_Exp$X2010, na.rm=T)) #PAF for all concentrations 2010: morbidity lower PAF_calc$PAF2010lower_morb = (NO2_Exp$X2010 * (PAF_calc$EWF2010lower_morb - 1)) / (NO2_Exp$X2010 * ((PAF_calc$EWF2010lower_morb - 1)+ 1)) PAF_calc$PAF2010lower_morb = ifelse(PAF_calc$PAF2010lower_morb < 0, 0, PAF_calc$PAF2010lower_morb) PAF_calc$PAF2010lower_morb_pop = (PAF_calc$PAF2010lower_morb * NO2_Exp$X2010) PAF2010lower_morb_val = (sum(PAF_calc$PAF2010lower_morb_pop, na.rm=T) / sum(NO2_Exp$X2010, na.rm=T)) #PAF for all concentrations 2010: morbidity upper PAF_calc$PAF2010upper_morb = (NO2_Exp$X2010 * (PAF_calc$EWF2010upper_morb - 1)) / (NO2_Exp$X2010 * ((PAF_calc$EWF2010upper_morb - 1)+ 1)) PAF_calc$PAF2010upper_morb = ifelse(PAF_calc$PAF2010upper_morb < 0, 0, PAF_calc$PAF2010upper_morb) PAF_calc$PAF2010upper_morb_pop = (PAF_calc$PAF2010upper_morb * NO2_Exp$X2010) PAF2010upper_morb_val = (sum(PAF_calc$PAF2010upper_morb_pop, na.rm=T) / sum(NO2_Exp$X2010, na.rm=T)) #Mortality #PAF for all concentrations 2010: mortality mean PAF_calc$PAF2010mean_mort = (NO2_Exp$X2010 * (PAF_calc$EWF2010mean_mort - 1)) / (NO2_Exp$X2010 * ((PAF_calc$EWF2010mean_mort - 1)+ 1)) PAF_calc$PAF2010mean_mort = ifelse(PAF_calc$PAF2010mean_mort < 0, 0, PAF_calc$PAF2010mean_mort) PAF_calc$PAF2010mean_mort_pop = (PAF_calc$PAF2010mean_mort * NO2_Exp$X2010) PAF2010mean_mort_val = (sum(PAF_calc$PAF2010mean_mort_pop, na.rm=T) / sum(NO2_Exp$X2010, na.rm=T)) #PAF for all concentrations 2010: mortality lower PAF_calc$PAF2010lower_mort = (NO2_Exp$X2010 * (PAF_calc$EWF2010lower_mort - 1)) / (NO2_Exp$X2010 * ((PAF_calc$EWF2010lower_mort - 1)+ 1)) PAF_calc$PAF2010lower_mort = ifelse(PAF_calc$PAF2010lower_mort < 0, 0, PAF_calc$PAF2010lower_mort) PAF_calc$PAF2010lower_mort_pop = (PAF_calc$PAF2010lower_mort * NO2_Exp$X2010) PAF2010lower_mort_val = (sum(PAF_calc$PAF2010lower_mort_pop, na.rm=T) / sum(NO2_Exp$X2010, na.rm=T)) #PAF for all concentrations 2010: mortality upper PAF_calc$PAF2010upper_mort = (NO2_Exp$X2010 * (PAF_calc$EWF2010upper_mort - 1)) / (NO2_Exp$X2010 * ((PAF_calc$EWF2010upper_mort - 1)+ 1)) PAF_calc$PAF2010upper_mort = ifelse(PAF_calc$PAF2010upper_mort < 0, 0, PAF_calc$PAF2010upper_mort) PAF_calc$PAF2010upper_mort_pop = (PAF_calc$PAF2010upper_mort * NO2_Exp$X2010) PAF2010upper_mort_val = (sum(PAF_calc$PAF2010upper_mort_pop, na.rm=T) / sum(NO2_Exp$X2010, na.rm=T)) #Environmental Burden of Disease (EBD) Calculations #Attributable Deaths #### #Attributable Deaths male EBoD2010$Deathsmeanmale2010 = (Deaths$X2010Asthmamale * PAF2010mean_mort_val) EBoD2010$Deathslowermale2010 = (Deaths$X2010Asthmamale * PAF2010lower_mort_val) EBoD2010$Deathsuppermale2010 = (Deaths$X2010Asthmamale * PAF2010upper_mort_val) #Attributable Deaths male EBoD2010$Deathsmeanfemale2010 = (Deaths$X2010Asthmafemale * PAF2010mean_mort_val) EBoD2010$Deathslowerfemale2010 = (Deaths$X2010Asthmafemale * PAF2010lower_mort_val) EBoD2010$Deathsupperfemale2010 = (Deaths$X2010Asthmafemale * PAF2010upper_mort_val) #Attributable Deaths total EBoD2010$Deathsmeantotal2010 = ((Deaths$X2010Asthmafemale + Deaths$X2010Asthmamale) * PAF2010mean_mort_val) EBoD2010$Deathslowertotal2010 = ((Deaths$X2010Asthmafemale + Deaths$X2010Asthmamale) * PAF2010lower_mort_val) EBoD2010$Deathsuppertotal2010 = ((Deaths$X2010Asthmafemale + Deaths$X2010Asthmamale) * PAF2010upper_mort_val) #YLL ##### #YLL male EBoD2010$YLLmeanmale2010 = (BoD2010$YLLmale2010 * PAF2010mean_mort_val) EBoD2010$YLLuppermale2010 = (BoD2010$YLLmale2010 * PAF2010upper_mort_val) EBoD2010$YLLlowermale2010 = (BoD2010$YLLmale2010 * PAF2010lower_mort_val) #YLL female EBoD2010$YLLmeanfemale2010 = (BoD2010$YLLfemale2010 * PAF2010mean_mort_val) EBoD2010$YLLupperfemale2010 = (BoD2010$YLLfemale2010 * PAF2010upper_mort_val) EBoD2010$YLLlowerfemale2010 = (BoD2010$YLLfemale2010 * PAF2010lower_mort_val) #YLL total EBoD2010$YLLmeantotal2010 = ((BoD2010$YLLfemale2010 + BoD2010$YLLmale2010) * PAF2010mean_mort_val) EBoD2010$YLLuppertotal2010 = ((BoD2010$YLLfemale2010 + BoD2010$YLLmale2010) * PAF2010upper_mort_val) EBoD2010$YLLlowertotal2010 = ((BoD2010$YLLfemale2010 + BoD2010$YLLmale2010) * PAF2010lower_mort_val) EBoD2010$YLLmeantotal2010 #YLD #### #YLD male EBoD2010$YLDmeanmale2010 = (BoD2010$YLDmeanmale2010 * PAF2010mean_morb_val) EBoD2010$YLDlowermale2010 = (BoD2010$YLDmeanmale2010 * PAF2010lower_morb_val) EBoD2010$YLDuppermale2010 = (BoD2010$YLDmeanmale2010 * PAF2010upper_morb_val) #YLD female EBoD2010$YLDmeanfemale2010 = (BoD2010$YLDmeanfemale2010 * PAF2010mean_morb_val) EBoD2010$YLDlowerfemale2010 = (BoD2010$YLDmeanfemale2010 * PAF2010lower_morb_val) EBoD2010$YLDupperfemale2010 = (BoD2010$YLDmeanfemale2010 * PAF2010upper_morb_val) #YLD total EBoD2010$YLDmeantotal2010 = ((BoD2010$YLDmeanfemale2010 + BoD2010$YLDmeanmale2010) * PAF2010mean_morb_val) EBoD2010$YLDlowertotal2010 = ((BoD2010$YLDmeanfemale2010 + BoD2010$YLDmeanmale2010)* PAF2010lower_morb_val) EBoD2010$YLDuppertotal2010 = ((BoD2010$YLDmeanfemale2010 + BoD2010$YLDmeanmale2010) * PAF2010upper_morb_val) #DALYs #### #DALY male EBoD2010$DALYmeanmale2010 = (EBoD2010$YLLmeanmale2010 + EBoD2010$YLDmeanmale2010) EBoD2010$DALYlowermale2010 = (EBoD2010$YLLlowermale2010 + EBoD2010$YLDlowermale2010) EBoD2010$DALYuppermale2010 = (EBoD2010$YLLuppermale2010 + EBoD2010$YLDuppermale2010) #DALY female EBoD2010$DALYmeanfemale2010 = (EBoD2010$YLLmeanfemale2010 + EBoD2010$YLDmeanfemale2010) EBoD2010$DALYlowerfemale2010 = (EBoD2010$YLLlowerfemale2010 + EBoD2010$YLDlowerfemale2010) EBoD2010$DALYupperfemale2010 = (EBoD2010$YLLupperfemale2010 + EBoD2010$YLDupperfemale2010) #DALY total EBoD2010$DALYmeantotal2010 = (EBoD2010$YLLmeantotal2010 + EBoD2010$YLDmeantotal2010) EBoD2010$DALYlowertotal2010 = (EBoD2010$YLLlowertotal2010 + EBoD2010$YLDlowertotal2010) EBoD2010$DALYuppertotal2010 = (EBoD2010$YLLuppertotal2010 + EBoD2010$YLDuppertotal2010) #select only age groups 25 up EBoD2010_above25 = EBoD2010 %>% slice(7:20) #n people over 25 Pop2010_above25 = Population %>% slice(7:20) Pop2010_above25_n_total = sum(Pop2010_above25$X2010male + Pop2010_above25$X2010female) Pop2010_above25_n_male = sum(Pop2010_above25$X2010male) Pop2010_above25_n_female = sum(Pop2010_above25$X2010female) #EBD Sums #Attributable Cases #### attrCases_mean_total2010 = (sum(BoD2010$Prevalence_male2010 + BoD2010$Prevalence_female2010) * PAF2010mean_morb_val) attrCases_lower_total2010 = (sum(BoD2010$Prevalence_male2010 + BoD2010$Prevalence_female2010) * PAF2010lower_morb_val) attrCases_upper_total2010 = (sum(BoD2010$Prevalence_male2010 + BoD2010$Prevalence_female2010) * PAF2010upper_morb_val) attrCases_mean_male2010 = (sum(BoD2010$Prevalence_male2010) * PAF2010mean_morb_val) attrCases_lower_male2010 = (sum(BoD2010$Prevalence_male2010) * PAF2010lower_morb_val) attrCases_upper_male2010 = (sum(BoD2010$Prevalence_male2010) * PAF2010upper_morb_val) attrCases_mean_female2010 = (sum(BoD2010$Prevalence_female2010) * PAF2010mean_morb_val) attrCases_lower_female2010 = (sum(BoD2010$Prevalence_female2010) * PAF2010lower_morb_val) attrCases_upper_female2010 = (sum(BoD2010$Prevalence_female2010) * PAF2010upper_morb_val) #per 100000 attrCasesper100000_mean_total2010 = (attrCases_mean_total2010 * 100000) / Pop2010_above25_n_total attrCasesper100000_lower_total2010 = (attrCases_lower_total2010 * 100000) / Pop2010_above25_n_total attrCasesper100000_upper_total2010 = (attrCases_upper_total2010 * 100000) / Pop2010_above25_n_total attrCasesper100000_mean_male2010 = (attrCases_mean_male2010 * 100000) / Pop2010_above25_n_male attrCasesper100000_lower_male2010 = (attrCases_lower_male2010 * 100000) / Pop2010_above25_n_male attrCasesper100000_upper_male2010 = (attrCases_upper_male2010 * 100000) / Pop2010_above25_n_male attrCasesper100000_mean_female2010 = (attrCases_mean_female2010 * 100000) / Pop2010_above25_n_female attrCasesper100000_lower_female2010 = (attrCases_lower_female2010 * 100000) / Pop2010_above25_n_female attrCasesper100000_upper_female2010 = (attrCases_upper_female2010 * 100000) / Pop2010_above25_n_female #Attributable Deaths #### attrDeaths_mean_total2010 = (sum(EBoD2010_above25$Deathsmeanmale2010 + EBoD2010_above25$Deathsmeanfemale2010)) attrDeaths_lower_total2010 = (sum(EBoD2010_above25$Deathslowermale2010 + EBoD2010_above25$Deathslowerfemale2010)) attrDeaths_upper_total2010 = (sum(EBoD2010_above25$Deathsuppermale2010 + EBoD2010_above25$Deathsupperfemale2010)) attrDeaths_mean_male2010 = sum(EBoD2010_above25$Deathsmeanmale2010) attrDeaths_lower_male2010 = sum(EBoD2010_above25$Deathslowermale2010) attrDeaths_upper_male2010 = sum(EBoD2010_above25$Deathsuppermale2010) attrDeaths_mean_female2010 = sum(EBoD2010_above25$Deathsmeanfemale2010) attrDeaths_lower_female2010 = sum(EBoD2010_above25$Deathslowerfemale2010) attrDeaths_upper_female2010 = sum(EBoD2010_above25$Deathsupperfemale2010) #per 100000 attrDeathsper100000_mean_total2010 = (attrDeaths_mean_total2010 * 100000) / Pop2010_above25_n_total attrDeathsper100000_lower_total2010 = (attrDeaths_lower_total2010 * 100000) / Pop2010_above25_n_total attrDeathsper100000_upper_total2010 = (attrDeaths_upper_total2010 * 100000) / Pop2010_above25_n_total attrDeathsper100000_mean_male2010 = (attrDeaths_mean_male2010 * 100000) / Pop2010_above25_n_male attrDeathsper100000_lower_male2010 = (attrDeaths_lower_male2010 * 100000) / Pop2010_above25_n_male attrDeathsper100000_upper_male2010 = (attrDeaths_upper_male2010 * 100000) / Pop2010_above25_n_male attrDeathsper100000_mean_female2010 = (attrDeaths_mean_female2010 * 100000) / Pop2010_above25_n_female attrDeathsper100000_lower_female2010 = (attrDeaths_lower_female2010 * 100000) / Pop2010_above25_n_female attrDeathsper100000_upper_female2010 = (attrDeaths_upper_female2010 * 100000) / Pop2010_above25_n_female #YLL #### YLL_mean_total2010 = (sum(EBoD2010_above25$YLLmeantotal2010)) YLL_lower_total2010 = (sum(EBoD2010_above25$YLLlowertotal2010)) YLL_upper_total2010 = (sum(EBoD2010_above25$YLLuppertotal2010)) YLL_mean_male2010 = (sum(EBoD2010_above25$YLLmeanmale2010)) YLL_lower_male2010 = (sum(EBoD2010_above25$YLLlowermale2010)) YLL_upper_male2010 = (sum(EBoD2010_above25$YLLuppermale2010)) YLL_mean_female2010 = (sum(EBoD2010_above25$YLLmeanfemale2010)) YLL_lower_female2010 = (sum(EBoD2010_above25$YLLlowerfemale2010)) YLL_upper_female2010 = (sum(EBoD2010_above25$YLLupperfemale2010)) #per 100000 YLLper100000_mean_total2010 = (YLL_mean_total2010 * 100000) / Pop2010_above25_n_total YLLper100000_lower_total2010 = (YLL_lower_total2010 * 100000)/ Pop2010_above25_n_total YLLper100000_upper_total2010 = (YLL_upper_total2010 * 100000)/ Pop2010_above25_n_total YLLper100000_mean_male2010 = (YLL_mean_male2010 * 100000)/ Pop2010_above25_n_male YLLper100000_lower_male2010 = (YLL_lower_male2010 * 100000)/ Pop2010_above25_n_male YLLper100000_upper_male2010 = (YLL_upper_male2010 * 100000)/ Pop2010_above25_n_male YLLper100000_mean_female2010 = (YLL_mean_female2010 * 100000)/ Pop2010_above25_n_female YLLper100000_lower_female2010 = (YLL_lower_female2010 * 100000)/ Pop2010_above25_n_female YLLper100000_upper_female2010 = (YLL_upper_female2010 * 100000)/ Pop2010_above25_n_female #YLD #### YLD_mean_total2010 = (sum(EBoD2010_above25$YLDmeantotal2010)) YLD_lower_total2010 = (sum(EBoD2010_above25$YLDlowertotal2010)) YLD_upper_total2010 = (sum(EBoD2010_above25$YLDuppertotal2010)) YLD_mean_male2010 = (sum(EBoD2010_above25$YLDmeanmale2010)) YLD_lower_male2010 = (sum(EBoD2010_above25$YLDlowermale2010)) YLD_upper_male2010 = (sum(EBoD2010_above25$YLDuppermale2010)) YLD_mean_female2010 = (sum(EBoD2010_above25$YLDmeanfemale2010)) YLD_lower_female2010 = (sum(EBoD2010_above25$YLDlowerfemale2010)) YLD_upper_female2010 = (sum(EBoD2010_above25$YLDupperfemale2010)) #per 100000 YLDper100000_mean_total2010 = (YLD_mean_total2010 * 100000)/ Pop2010_above25_n_total YLDper100000_lower_total2010 = (YLD_lower_total2010 * 100000)/ Pop2010_above25_n_total YLDper100000_upper_total2010 = (YLD_upper_total2010 * 100000)/ Pop2010_above25_n_total YLDper100000_mean_male2010 = (YLD_mean_male2010 * 100000) / Pop2010_above25_n_male YLDper100000_lower_male2010 = (YLD_lower_male2010 * 100000) / Pop2010_above25_n_male YLDper100000_upper_male2010 = (YLD_upper_male2010 * 100000) / Pop2010_above25_n_male YLDper100000_mean_female2010 = (YLD_mean_female2010 * 100000) / Pop2010_above25_n_female YLDper100000_lower_female2010 = (YLD_lower_female2010 * 100000) / Pop2010_above25_n_female YLDper100000_upper_female2010 = (YLD_upper_female2010 * 100000) / Pop2010_above25_n_female #DALYs #### DALY_mean_total2010 = (sum(EBoD2010_above25$DALYmeantotal2010)) DALY_lower_total2010 = (sum(EBoD2010_above25$DALYlowertotal2010)) DALY_upper_total2010 = (sum(EBoD2010_above25$DALYuppertotal2010)) DALY_mean_male2010 = (sum(EBoD2010_above25$DALYmeanmale2010)) DALY_lower_male2010 = (sum(EBoD2010_above25$DALYlowermale2010)) DALY_upper_male2010 = (sum(EBoD2010_above25$DALYuppermale2010)) DALY_mean_female2010 = (sum(EBoD2010_above25$DALYmeanfemale2010)) DALY_lower_female2010 = (sum(EBoD2010_above25$DALYlowerfemale2010)) DALY_upper_female2010 = (sum(EBoD2010_above25$DALYupperfemale2010)) #per 100000 DALYper100000_mean_total2010 = (DALY_mean_total2010 * 100000) / Pop2010_above25_n_total DALYper100000_lower_total2010 = (DALY_lower_total2010 * 100000) / Pop2010_above25_n_total DALYper100000_upper_total2010 = (DALY_upper_total2010 * 100000) / Pop2010_above25_n_total DALYper100000_mean_male2010 = (DALY_mean_male2010 * 100000) / Pop2010_above25_n_male DALYper100000_lower_male2010 = (DALY_lower_male2010 * 100000) / Pop2010_above25_n_male DALYper100000_upper_male2010 = (DALY_upper_male2010 * 100000) / Pop2010_above25_n_male DALYper100000_mean_female2010 = (DALY_mean_female2010 * 100000) / Pop2010_above25_n_female DALYper100000_lower_female2010 = (DALY_lower_female2010 * 100000) / Pop2010_above25_n_female DALYper100000_upper_female2010 = (DALY_upper_female2010 * 100000) / Pop2010_above25_n_female #Percentage YLD of DALYS #### Perc_YLDmean_total2010 = YLD_mean_total2010 / DALY_mean_total2010 Perc_YLDlower_total2010 = YLD_lower_total2010 / DALY_lower_total2010 Perc_YLDupper_total2010 = YLD_upper_total2010 / DALY_upper_total2010 Perc_YLDmean_male2010 = YLD_mean_male2010 / DALY_mean_male2010 Perc_YLDlower_male2010 = YLD_lower_male2010 / DALY_lower_male2010 Perc_YLDupper_male2010 = YLD_upper_male2010 / DALY_upper_male2010 Perc_YLDmean_female2010 = YLD_mean_female2010 / DALY_mean_female2010 Perc_YLDlower_female2010 = YLD_lower_female2010 / DALY_lower_female2010 Perc_YLDupper_female2010 = YLD_upper_female2010 / DALY_upper_female2010 #end #gather results in table#### Results <- matrix(c(PAF2010mean_morb_val, PAF2010lower_morb_val, PAF2010upper_morb_val, PAF2010mean_morb_val, PAF2010lower_morb_val, PAF2010upper_morb_val, PAF2010mean_morb_val, PAF2010lower_morb_val, PAF2010upper_morb_val, PAF2010mean_mort_val, PAF2010lower_mort_val, PAF2010upper_mort_val, PAF2010mean_mort_val, PAF2010lower_mort_val, PAF2010upper_mort_val, PAF2010mean_mort_val, PAF2010lower_mort_val, PAF2010upper_mort_val, attrCases_mean_total2010, attrCases_lower_total2010, attrCases_upper_total2010, attrCases_mean_male2010, attrCases_lower_male2010, attrCases_upper_male2010, attrCases_mean_female2010, attrCases_lower_female2010, attrCases_upper_female2010, attrCasesper100000_mean_total2010, attrCasesper100000_lower_total2010, attrCasesper100000_upper_total2010, attrCasesper100000_mean_male2010, attrCasesper100000_lower_male2010, attrCasesper100000_upper_male2010, attrCasesper100000_mean_female2010, attrCasesper100000_lower_female2010, attrCasesper100000_upper_female2010, attrDeaths_mean_total2010, attrDeaths_lower_total2010, attrDeaths_upper_total2010, attrDeaths_mean_male2010, attrDeaths_lower_male2010, attrDeaths_upper_male2010, attrDeaths_mean_female2010, attrDeaths_lower_female2010, attrDeaths_upper_female2010, attrDeathsper100000_mean_total2010, attrDeathsper100000_lower_total2010, attrDeathsper100000_upper_total2010, attrDeathsper100000_mean_male2010, attrDeathsper100000_lower_male2010, attrDeathsper100000_upper_male2010, attrDeathsper100000_mean_female2010, attrDeathsper100000_lower_female2010, attrDeathsper100000_upper_female2010, YLL_mean_total2010, YLL_lower_total2010, YLL_upper_total2010, YLL_mean_male2010, YLL_lower_male2010, YLL_upper_male2010, YLL_mean_female2010, YLL_lower_female2010, YLL_upper_female2010, YLLper100000_mean_total2010, YLLper100000_lower_total2010, YLLper100000_upper_total2010, YLLper100000_mean_male2010, YLLper100000_lower_male2010, YLLper100000_upper_male2010, YLLper100000_mean_female2010, YLLper100000_lower_female2010, YLLper100000_upper_female2010, YLD_mean_total2010, YLD_lower_total2010, YLD_upper_total2010, YLD_mean_male2010, YLD_lower_male2010, YLD_upper_male2010, YLD_mean_female2010, YLD_lower_female2010, YLD_upper_female2010, YLDper100000_mean_total2010, YLDper100000_lower_total2010, YLDper100000_upper_total2010, YLDper100000_mean_male2010, YLDper100000_lower_male2010, YLDper100000_upper_male2010, YLDper100000_mean_female2010, YLDper100000_lower_female2010, YLDper100000_upper_female2010, DALY_mean_total2010, DALY_lower_total2010, DALY_upper_total2010, DALY_mean_male2010, DALY_lower_male2010, DALY_upper_male2010, DALY_mean_female2010, DALY_lower_female2010, DALY_upper_female2010, DALYper100000_mean_total2010, DALYper100000_lower_total2010, DALYper100000_upper_total2010, DALYper100000_mean_male2010, DALYper100000_lower_male2010, DALYper100000_upper_male2010, DALYper100000_mean_female2010, DALYper100000_lower_female2010, DALYper100000_upper_female2010, Perc_YLDmean_total2010, Perc_YLDlower_total2010, Perc_YLDupper_total2010, Perc_YLDmean_male2010, Perc_YLDlower_male2010, Perc_YLDupper_male2010, Perc_YLDmean_female2010, Perc_YLDlower_female2010, Perc_YLDupper_female2010 ),ncol=9, byrow=TRUE) colnames(Results) <- c('total_mean','total_lower','total_upper','male_mean','male_lower','male_upper','female_mean','female_lower','female_upper') rownames(Results) <- c('PAF Morbidity','PAF Mortality', 'Attributable Cases', 'Attributable Cases per 100,000', 'Attributable Deaths','Attributable Deaths per 100,000', 'YLL', 'YLL per 100,000', 'YLD', 'YLD per 100,000', 'DALY', 'DALY per 100,000', 'Percentage YLD') EBoD2010_Asthma_results <- as.data.frame(Results) view(EBoD2010_Asthma_results) write.csv(EBoD2010_Asthma_results, "EBD_Asthma_2010.csv", row.names=T) write.csv(BoD2010, "BoD_Asthma_2010.csv", row.names=T)