Note: Data for covid-19 last updated 4/22/2020.

Data Set-up

# Data in use: BCG_covid19_DB_unfiltered_14.csv

df_unfiltered[df_unfiltered == ""] <- NA

df_unfiltered$BCG_mean_coverage <- ifelse(!is.na(df_unfiltered$BCG_policy) & is.na(df_unfiltered$BCG_mean_coverage), 0, df_unfiltered$BCG_mean_coverage)

df_unfiltered$BCG_median_coverage <- ifelse(!is.na(df_unfiltered$BCG_policy) & is.na(df_unfiltered$BCG_median_coverage), 0, df_unfiltered$BCG_median_coverage)

df_world <- subset(df_unfiltered, ISO3 != "USA_state")

df_filtered <- subset(df_unfiltered, 
                covid19_cumulative_deaths > 0
                  & population_million > 1
                  & ages_65_up > 15 
                  & urban_percentage_2018 > 60 
                  & population_density_2018 < 300 
                  & HDI_2018 > 0.7
                  & ISO3 != "USA_state")



df_unfiltered <- df_unfiltered[-which(df_unfiltered$ISO3 == "USA"), ]

df_linear_models <- data.frame()
df_anova_models <- data.frame()
df_t_models <- data.frame()

Key for the dfs:

df_unfiltered: USA as states, no as country

df_world: USA as country, no as states

df_filtered: Social variables (population, age, urban, density, HDI) and USA as country, no as states.

df_filtered_2: Social varibales (popualtion, age, density, HDI) and USA as country, no as states.

VARIABLES

dependent_variables <- names(df_unfiltered)[c(23:28,30:33,35:50)]
dependent_variables
##  [1] "total_deaths_per_million"                   
##  [2] "days_to_reached_0.1_deaths_per_million"     
##  [3] "days_to_reached_1_deaths_per_million"       
##  [4] "mean_daily_deaths_per_million"              
##  [5] "median_daily_deaths_per_million"            
##  [6] "max_daily_deaths_per_million"               
##  [7] "total_deaths_week_3_per_million"            
##  [8] "median_daily_deaths_per_million_week_3"     
##  [9] "mean_daily_deaths_per_million_week_3"       
## [10] "max_daily_deaths_per_million_week_3"        
## [11] "total_deaths_month_1_per_million"           
## [12] "median_daily_deaths_per_million_month_1"    
## [13] "mean_daily_deaths_per_million_month_1"      
## [14] "max_daily_deaths_per_million_month_1"       
## [15] "log_total_deaths_per_million"               
## [16] "log_mean_daily_deaths_per_million"          
## [17] "log_median_daily_deaths_per_million"        
## [18] "log_max_daily_deaths_per_million"           
## [19] "log_total_deaths_week_3_per_million"        
## [20] "log_median_daily_deaths_per_million_week_3" 
## [21] "log_mean_daily_deaths_per_million_week_3"   
## [22] "log_max_daily_deaths_per_million_week_3"    
## [23] "log_total_deaths_month_1_per_million"       
## [24] "log_median_daily_deaths_per_million_month_1"
## [25] "log_mean_daily_deaths_per_million_month_1"  
## [26] "log_max_daily_deaths_per_million_month_1"
independent_variables_continuous <- names(df_unfiltered)[17:18]
independent_variables_continuous
## [1] "BCG_mean_coverage"   "BCG_median_coverage"
independent_variables_categorical <- names(df_unfiltered)[12]
independent_variables_categorical
## [1] "BCG_policy"
confounding_varibales <- names(df_unfiltered)[c(7,51,6,10)]
confounding_varibales
## [1] "population_density_2018" "urban_percentage_2018"  
## [3] "HDI_2018"                "ages_65_up"

Models with UNFILTERED data

All data, including states of USA

Linear Models Unfiltered

model_results <- data.frame()

for(i in 1:length(independent_variables_continuous)){
  for(j in 1:length(dependent_variables)){
    linear_model <- lm(df_unfiltered[,dependent_variables[j]]~df_unfiltered[,independent_variables_continuous[i]])
    new_row <- data.frame(dependent_variable = dependent_variables_labels$V2[j],
                          independent_variable = independent_variables_labels_continuous$V2[i],
                          df = glance(linear_model)$df-1,
                          r_squared = summary(linear_model)$r.squared,
                          p_value = glance(linear_model)$p.value,
                          AIC = glance(linear_model)$AIC)
    model_results <- rbind(model_results, new_row)
    }
}

model_results$significant <- ifelse(model_results$p_value < 0.05, "YES", "") 
dependent_variable independent_variable df r_squared p_value AIC significant
Deaths/1 M (Total) BCG % (mean) 1 0.1361260 0.0000000 2881.1695 YES
Days to 0.1 Death/1 M BCG % (mean) 1 0.0301561 0.0149270 1338.3408 YES
Days to 1 Death/1 M BCG % (mean) 1 0.1151209 0.0000129 1158.9959 YES
Deaths/day/1 M (mean) BCG % (mean) 1 0.1554433 0.0000000 1019.2580 YES
Deaths/day/1 M (median) BCG % (mean) 1 0.1428752 0.0000000 881.1248 YES
Deaths/day/1 M (max) BCG % (mean) 1 0.0933998 0.0000103 1742.1516 YES
Deaths/1 M/week 3 (Total) BCG % (mean) 1 0.0756698 0.0002023 1744.4458 YES
Deaths/1 M/week 3 (median) BCG % (mean) 1 0.1448583 0.0000002 759.7916 YES
Deaths/1 M/week 3 (mean) BCG % (mean) 1 0.0757124 0.0002014 1051.6875 YES
Deaths/1 M/week 3 (max) BCG % (mean) 1 0.0410293 0.0066965 1454.9023 YES
Deaths/1 M/month 1 (Total) BCG % (mean) 1 0.1564731 0.0000050 1489.9232 YES
Deaths/1 M/month 1 (median) BCG % (mean) 1 0.1360215 0.0000231 496.9906 YES
Deaths/1 M/month 1 (mean) BCG % (mean) 1 0.1569069 0.0000048 639.5211 YES
Deaths/1 M/month 1 (max) BCG % (mean) 1 0.1113513 0.0001430 1069.3321 YES
Deaths/1 M (Total) BCG % (mean) 1 0.2620092 0.0000000 841.1621 YES
Deaths/day/1 M log(mean) BCG % (mean) 1 0.2754344 0.0000000 813.6563 YES
Deaths/day/1 M log(median) BCG % (mean) 1 0.3033121 0.0000000 430.0039 YES
Deaths/day/1 M loglog(max) BCG % (mean) 1 0.2947645 0.0000000 766.1058 YES
Deaths/1 M/week 3 log(Total) BCG % (mean) 1 0.2595466 0.0000000 637.9625 YES
Deaths/1 M/week 3 log(median) BCG % (mean) 1 0.3063559 0.0000000 414.8523 YES
Deaths/1 M/week 3 log(mean) BCG % (mean) 1 0.2649374 0.0000000 635.8839 YES
Deaths/1 M/week 3 log(max) BCG % (mean) 1 0.2842838 0.0000000 599.3573 YES
Deaths/1 M/month 1 log(Total) BCG % (mean) 1 0.2422890 0.0000000 519.1898 YES
Deaths/1 M/month 1 log(median) BCG % (mean) 1 0.2820385 0.0000000 338.3441 YES
Deaths/1 M/month 1 log(mean) BCG % (mean) 1 0.2473710 0.0000000 518.0925 YES
Deaths/1 M/month 1 log(max) BCG % (mean) 1 0.3127480 0.0000000 475.1724 YES
Deaths/1 M (Total) BCG % (median) 1 0.1407637 0.0000000 2879.9261 YES
Days to 0.1 Death/1 M BCG % (median) 1 0.0358504 0.0078625 1337.1866 YES
Days to 1 Death/1 M BCG % (median) 1 0.1178717 0.0000100 1158.5040 YES
Deaths/day/1 M (mean) BCG % (median) 1 0.1602067 0.0000000 1018.1211 YES
Deaths/day/1 M (median) BCG % (median) 1 0.1459009 0.0000000 880.4140 YES
Deaths/day/1 M (max) BCG % (median) 1 0.0953403 0.0000082 1741.7209 YES
Deaths/1 M/week 3 (Total) BCG % (median) 1 0.0763381 0.0001891 1744.3171 YES
Deaths/1 M/week 3 (median) BCG % (median) 1 0.1468238 0.0000001 759.3820 YES
Deaths/1 M/week 3 (mean) BCG % (median) 1 0.0763808 0.0001883 1051.5587 YES
Deaths/1 M/week 3 (max) BCG % (median) 1 0.0414890 0.0063904 1454.8170 YES
Deaths/1 M/month 1 (Total) BCG % (median) 1 0.1574993 0.0000046 1489.7711 YES
Deaths/1 M/month 1 (median) BCG % (median) 1 0.1366783 0.0000220 496.8956 YES
Deaths/1 M/month 1 (mean) BCG % (median) 1 0.1579324 0.0000045 639.3689 YES
Deaths/1 M/month 1 (max) BCG % (median) 1 0.1122710 0.0001337 1069.2027 YES
Deaths/1 M (Total) BCG % (median) 1 0.2785653 0.0000000 836.6015 YES
Deaths/day/1 M log(mean) BCG % (median) 1 0.2927808 0.0000000 808.7858 YES
Deaths/day/1 M log(median) BCG % (median) 1 0.3253688 0.0000000 426.1755 YES
Deaths/day/1 M loglog(max) BCG % (median) 1 0.3138860 0.0000000 760.5807 YES
Deaths/1 M/week 3 log(Total) BCG % (median) 1 0.2800072 0.0000000 633.5071 YES
Deaths/1 M/week 3 log(median) BCG % (median) 1 0.3260764 0.0000000 411.5066 YES
Deaths/1 M/week 3 log(mean) BCG % (median) 1 0.2856561 0.0000000 631.3379 YES
Deaths/1 M/week 3 log(max) BCG % (median) 1 0.3044250 0.0000000 594.8187 YES
Deaths/1 M/month 1 log(Total) BCG % (median) 1 0.2621527 0.0000000 515.8692 YES
Deaths/1 M/month 1 log(median) BCG % (median) 1 0.3003552 0.0000000 335.9149 YES
Deaths/1 M/month 1 log(mean) BCG % (median) 1 0.2674310 0.0000000 514.7157 YES
Deaths/1 M/month 1 log(max) BCG % (median) 1 0.3349844 0.0000000 471.0610 YES

Anova Models Unfiltered

model_results <- data.frame()

for(i in 1:length(independent_variables_categorical)){
  for(j in 1:length(dependent_variables)){
    aov_model <- aov(df_unfiltered[,dependent_variables[j]]~df_unfiltered[,independent_variables_categorical[i]])
    
    new_row <- data.frame(dependent_variable = dependent_variables_labels$V2[j],
                          independent_variable = independent_variables_labels_categorical$V2[i],
                          F_statistic = glance(aov_model)$statistic,
                          df = glance(aov_model)$df-1,
                          df.residual = glance(aov_model)$df.residual,
                          r_squared = glance(aov_model)$r.squared,
                          p_value = glance(aov_model)$p.value,
                          AIC = glance(aov_model)$AIC)
    model_results <- rbind(model_results, new_row)
  }
}

model_results$significant <- ifelse(model_results$p_value < 0.05, "YES", "")
dependent_variable independent_variable F_statistic df df.residual r_squared p_value AIC significant
Deaths/1 M (Total) BCG Policy 22.651874 2 226 0.1669853 0.0000000 2851.6834 YES
Days to 0.1 Death/1 M BCG Policy 9.237080 2 192 0.0877740 0.0001479 1322.5557 YES
Days to 1 Death/1 M BCG Policy 12.061801 2 155 0.1346757 0.0000135 1157.4651 YES
Deaths/day/1 M (mean) BCG Policy 21.469455 2 196 0.1797066 0.0000000 1007.0192 YES
Deaths/day/1 M (median) BCG Policy 20.425812 2 196 0.1724777 0.0000000 869.1265 YES
Deaths/day/1 M (max) BCG Policy 11.928408 2 196 0.1085107 0.0000129 1725.2938 YES
Deaths/1 M/week 3 (Total) BCG Policy 7.968327 2 175 0.0834657 0.0004875 1744.9382 YES
Deaths/1 M/week 3 (median) BCG Policy 17.817025 2 175 0.1691752 0.0000001 756.6566 YES
Deaths/1 M/week 3 (mean) BCG Policy 7.973209 2 175 0.0835125 0.0004854 1052.1790 YES
Deaths/1 M/week 3 (max) BCG Policy 4.157750 2 175 0.0453617 0.0172147 1456.0963 YES
Deaths/1 M/month 1 (Total) BCG Policy 10.964452 2 122 0.1523593 0.0000418 1492.5314 YES
Deaths/1 M/month 1 (median) BCG Policy 10.345279 2 122 0.1450030 0.0000708 497.6844 YES
Deaths/1 M/month 1 (mean) BCG Policy 10.999720 2 122 0.1527745 0.0000405 642.1322 YES
Deaths/1 M/month 1 (max) BCG Policy 7.456168 2 122 0.1089189 0.0008810 1071.6738 YES
Deaths/1 M (Total) BCG Policy 89.762284 2 196 0.4780634 0.0000000 762.5743 YES
Deaths/day/1 M log(mean) BCG Policy 93.491717 2 196 0.4882285 0.0000000 737.8344 YES
Deaths/day/1 M log(median) BCG Policy 44.116434 2 115 0.4341466 0.0000000 403.8535 YES
Deaths/day/1 M loglog(max) BCG Policy 86.155087 2 196 0.4678398 0.0000000 703.5123 YES
Deaths/1 M/week 3 log(Total) BCG Policy 56.390419 2 156 0.4196015 0.0000000 601.2384 YES
Deaths/1 M/week 3 log(median) BCG Policy 41.756647 2 113 0.4249753 0.0000000 395.0969 YES
Deaths/1 M/week 3 log(mean) BCG Policy 58.068272 2 156 0.4267584 0.0000000 598.3488 YES
Deaths/1 M/week 3 log(max) BCG Policy 57.291321 2 156 0.4234663 0.0000000 566.9736 YES
Deaths/1 M/month 1 log(Total) BCG Policy 48.282277 2 122 0.4418125 0.0000000 482.9889 YES
Deaths/1 M/month 1 log(median) BCG Policy 36.942619 2 91 0.4481010 0.0000000 315.6173 YES
Deaths/1 M/month 1 log(mean) BCG Policy 49.584277 2 122 0.4483845 0.0000000 481.2524 YES
Deaths/1 M/month 1 log(max) BCG Policy 57.157905 2 122 0.4837417 0.0000000 441.4106 YES

T-test Models Unfiltered

df_unfiltered$BCG_TF <- 1
df_unfiltered[which(df_unfiltered$BCG_policy == "never"),]$BCG_TF <- 0
df_unfiltered[which(df_unfiltered$BCG_policy == "interrupted"),]$BCG_TF <- 0

df_unfiltered$BCG_TF_2 <- 1
df_unfiltered[which(df_unfiltered$BCG_policy == "never"),]$BCG_TF_2 <- 0
df_unfiltered[which(df_unfiltered$BCG_policy == "interrupted"),]$BCG_TF_2 <- NA
independent_variables_t_test <- names(df_unfiltered)[c(ncol(df_unfiltered)-1, ncol(df_unfiltered))] #BCG_TF
independent_variables_t_test
## [1] "BCG_TF"   "BCG_TF_2"
independent_variables_t_test_labels <- c("BCG Yes/No", "BCG Yes/No 2")
model_results <- data.frame()

for(i in 1:length(independent_variables_t_test)){
  for(j in 1:length(dependent_variables)){
    t_test_model <- t.test(df_unfiltered[,dependent_variables[j]]~df_unfiltered[,independent_variables_t_test[i]], paired = FALSE, na.action = na.pass, alternative="greater", var.equal = TRUE)
    
    new_row <- data.frame(dependent_variable = dependent_variables_labels$V2[j],
                          independent_variable = independent_variables_t_test_labels[i],
                          t_statistic = glance(t_test_model)$statistic,
                          df = glance(t_test_model)$parameter,
                          p_value = glance(t_test_model)$p.value)
    
    model_results <- rbind(model_results, new_row)
  }
}

model_results$significant <- ifelse(model_results$p_value < 0.05, "YES", "")
dependent_variable independent_variable t_statistic df p_value significant
t Deaths/1 M (Total) BCG Yes/No 6.939394 236 0.0000000 YES
t1 Days to 0.1 Death/1 M BCG Yes/No -3.976275 198 0.9999510
t2 Days to 1 Death/1 M BCG Yes/No -4.042137 160 0.9999589
t3 Deaths/day/1 M (mean) BCG Yes/No 6.662134 203 0.0000000 YES
t4 Deaths/day/1 M (median) BCG Yes/No 6.544694 203 0.0000000 YES
t5 Deaths/day/1 M (max) BCG Yes/No 4.671407 203 0.0000027 YES
t6 Deaths/1 M/week 3 (Total) BCG Yes/No 3.931218 179 0.0000603 YES
t7 Deaths/1 M/week 3 (median) BCG Yes/No 6.084141 179 0.0000000 YES
t8 Deaths/1 M/week 3 (mean) BCG Yes/No 3.932301 179 0.0000601 YES
t9 Deaths/1 M/week 3 (max) BCG Yes/No 2.757321 179 0.0032160 YES
t10 Deaths/1 M/month 1 (Total) BCG Yes/No 4.673863 125 0.0000038 YES
t11 Deaths/1 M/month 1 (median) BCG Yes/No 4.647118 125 0.0000042 YES
t12 Deaths/1 M/month 1 (mean) BCG Yes/No 4.680721 125 0.0000037 YES
t13 Deaths/1 M/month 1 (max) BCG Yes/No 3.616805 125 0.0002156 YES
t14 Deaths/1 M (Total) BCG Yes/No 13.195005 203 0.0000000 YES
t15 Deaths/day/1 M log(mean) BCG Yes/No 13.280831 203 0.0000000 YES
t16 Deaths/day/1 M log(median) BCG Yes/No 9.552910 117 0.0000000 YES
t17 Deaths/day/1 M loglog(max) BCG Yes/No 12.386055 203 0.0000000 YES
t18 Deaths/1 M/week 3 log(Total) BCG Yes/No 10.273627 160 0.0000000 YES
t19 Deaths/1 M/week 3 log(median) BCG Yes/No 9.148268 114 0.0000000 YES
t20 Deaths/1 M/week 3 log(mean) BCG Yes/No 10.414801 160 0.0000000 YES
t21 Deaths/1 M/week 3 log(max) BCG Yes/No 10.017302 160 0.0000000 YES
t22 Deaths/1 M/month 1 log(Total) BCG Yes/No 9.553772 125 0.0000000 YES
t23 Deaths/1 M/month 1 log(median) BCG Yes/No 8.641484 92 0.0000000 YES
t24 Deaths/1 M/month 1 log(mean) BCG Yes/No 9.674140 125 0.0000000 YES
t25 Deaths/1 M/month 1 log(max) BCG Yes/No 10.097245 125 0.0000000 YES
t26 Deaths/1 M (Total) BCG Yes/No 2 6.400807 216 0.0000000 YES
t27 Days to 0.1 Death/1 M BCG Yes/No 2 -4.029448 178 0.9999586
t28 Days to 1 Death/1 M BCG Yes/No 2 -4.445051 140 0.9999911
t29 Deaths/day/1 M (mean) BCG Yes/No 2 6.425030 183 0.0000000 YES
t30 Deaths/day/1 M (median) BCG Yes/No 2 6.201199 183 0.0000000 YES
t31 Deaths/day/1 M (max) BCG Yes/No 2 4.661817 183 0.0000030 YES
t32 Deaths/1 M/week 3 (Total) BCG Yes/No 2 3.875566 159 0.0000776 YES
t33 Deaths/1 M/week 3 (median) BCG Yes/No 2 6.063385 159 0.0000000 YES
t34 Deaths/1 M/week 3 (mean) BCG Yes/No 2 3.876865 159 0.0000772 YES
t35 Deaths/1 M/week 3 (max) BCG Yes/No 2 2.774742 159 0.0030934 YES
t36 Deaths/1 M/month 1 (Total) BCG Yes/No 2 4.700281 107 0.0000039 YES
t37 Deaths/1 M/month 1 (median) BCG Yes/No 2 4.957549 107 0.0000013 YES
t38 Deaths/1 M/month 1 (mean) BCG Yes/No 2 4.709514 107 0.0000037 YES
t39 Deaths/1 M/month 1 (max) BCG Yes/No 2 3.681038 107 0.0001829 YES
t40 Deaths/1 M (Total) BCG Yes/No 2 11.922752 183 0.0000000 YES
t41 Deaths/day/1 M log(mean) BCG Yes/No 2 12.168867 183 0.0000000 YES
t42 Deaths/day/1 M log(median) BCG Yes/No 2 8.729902 99 0.0000000 YES
t43 Deaths/day/1 M loglog(max) BCG Yes/No 2 11.562369 183 0.0000000 YES
t44 Deaths/1 M/week 3 log(Total) BCG Yes/No 2 10.024597 140 0.0000000 YES
t45 Deaths/1 M/week 3 log(median) BCG Yes/No 2 8.936436 97 0.0000000 YES
t46 Deaths/1 M/week 3 log(mean) BCG Yes/No 2 10.196845 140 0.0000000 YES
t47 Deaths/1 M/week 3 log(max) BCG Yes/No 2 9.976614 140 0.0000000 YES
t48 Deaths/1 M/month 1 log(Total) BCG Yes/No 2 8.828179 107 0.0000000 YES
t49 Deaths/1 M/month 1 log(median) BCG Yes/No 2 7.648712 76 0.0000000 YES
t50 Deaths/1 M/month 1 log(mean) BCG Yes/No 2 8.971739 107 0.0000000 YES
t51 Deaths/1 M/month 1 log(max) BCG Yes/No 2 9.644907 107 0.0000000 YES

Models without USA states (UNFILTEREDish data)

All data, excluding states of USA

Linear Models without USA states

model_results <- data.frame()

for(i in 1:length(independent_variables_continuous)){
  for(j in 1:length(dependent_variables)){
    linear_model <- lm(df_world[,dependent_variables[j]]~df_world[,independent_variables_continuous[i]])
    new_row <- data.frame(dependent_variable = dependent_variables_labels$V2[j],
                          independent_variable = independent_variables_labels_continuous$V2[i],
                          df = glance(linear_model)$df-1,
                          r_squared = summary(linear_model)$r.squared,
                          p_value = glance(linear_model)$p.value,
                          AIC = glance(linear_model)$AIC)
    model_results <- rbind(model_results, new_row)
    }
}

model_results$significant <- ifelse(model_results$p_value < 0.05, "YES", "") 
dependent_variable independent_variable df r_squared p_value AIC significant
Deaths/1 M (Total) BCG % (mean) 1 0.2366031 0.0000000 2140.5160 YES
Days to 0.1 Death/1 M BCG % (mean) 1 0.0067255 0.3319204 1008.9422
Days to 1 Death/1 M BCG % (mean) 1 0.0066346 0.4110823 797.6343
Deaths/day/1 M (mean) BCG % (mean) 1 0.2415931 0.0000000 683.5829 YES
Deaths/day/1 M (median) BCG % (mean) 1 0.2362020 0.0000000 563.0322 YES
Deaths/day/1 M (max) BCG % (mean) 1 0.1258195 0.0000104 1226.1923 YES
Deaths/1 M/week 3 (Total) BCG % (mean) 1 0.1083522 0.0001675 1253.1962 YES
Deaths/1 M/week 3 (median) BCG % (mean) 1 0.1474357 0.0000091 430.2380 YES
Deaths/1 M/week 3 (mean) BCG % (mean) 1 0.1083522 0.0001675 762.8268 YES
Deaths/1 M/week 3 (max) BCG % (mean) 1 0.0766226 0.0017025 1063.2026 YES
Deaths/1 M/month 1 (Total) BCG % (mean) 1 0.2336352 0.0000016 1053.4319 YES
Deaths/1 M/month 1 (median) BCG % (mean) 1 0.1406704 0.0002930 316.0412 YES
Deaths/1 M/month 1 (mean) BCG % (mean) 1 0.2336352 0.0000016 448.0188 YES
Deaths/1 M/month 1 (max) BCG % (mean) 1 0.1658594 0.0000747 773.3003 YES
Deaths/1 M (Total) BCG % (mean) 1 0.0679371 0.0014301 646.4148 YES
Deaths/day/1 M log(mean) BCG % (mean) 1 0.0594069 0.0029308 625.0253 YES
Deaths/day/1 M log(median) BCG % (mean) 1 0.2251042 0.0000195 287.4574 YES
Deaths/day/1 M loglog(max) BCG % (mean) 1 0.0775044 0.0006394 586.0335 YES
Deaths/1 M/week 3 log(Total) BCG % (mean) 1 0.0573318 0.0121553 461.7982 YES
Deaths/1 M/week 3 log(median) BCG % (mean) 1 0.1002202 0.0067429 281.0635 YES
Deaths/1 M/week 3 log(mean) BCG % (mean) 1 0.0573318 0.0121553 461.7982 YES
Deaths/1 M/week 3 log(max) BCG % (mean) 1 0.0696141 0.0055685 437.6662 YES
Deaths/1 M/month 1 log(Total) BCG % (mean) 1 0.0710927 0.0115453 390.9117 YES
Deaths/1 M/month 1 log(median) BCG % (mean) 1 0.1228169 0.0056246 236.1278 YES
Deaths/1 M/month 1 log(mean) BCG % (mean) 1 0.0710927 0.0115453 390.9117 YES
Deaths/1 M/month 1 log(max) BCG % (mean) 1 0.1146359 0.0011728 359.4208 YES
Deaths/1 M (Total) BCG % (median) 1 0.2482997 0.0000000 2137.7985 YES
Days to 0.1 Death/1 M BCG % (median) 1 0.0029027 0.5242558 1009.4876
Days to 1 Death/1 M BCG % (median) 1 0.0080735 0.3643631 797.4836
Deaths/day/1 M (mean) BCG % (median) 1 0.2540927 0.0000000 681.1399 YES
Deaths/day/1 M (median) BCG % (median) 1 0.2446902 0.0000000 561.3895 YES
Deaths/day/1 M (max) BCG % (median) 1 0.1304179 0.0000070 1225.4170 YES
Deaths/1 M/week 3 (Total) BCG % (median) 1 0.1090331 0.0001593 1253.0999 YES
Deaths/1 M/week 3 (median) BCG % (median) 1 0.1537013 0.0000056 429.3086 YES
Deaths/1 M/week 3 (mean) BCG % (median) 1 0.1090331 0.0001593 762.7306 YES
Deaths/1 M/week 3 (max) BCG % (median) 1 0.0770338 0.0016524 1063.1465 YES
Deaths/1 M/month 1 (Total) BCG % (median) 1 0.2334873 0.0000016 1053.4491 YES
Deaths/1 M/month 1 (median) BCG % (median) 1 0.1419351 0.0002737 315.9101 YES
Deaths/1 M/month 1 (mean) BCG % (median) 1 0.2334873 0.0000016 448.0360 YES
Deaths/1 M/month 1 (max) BCG % (median) 1 0.1657452 0.0000751 773.3125 YES
Deaths/1 M (Total) BCG % (median) 1 0.0855354 0.0003249 643.6127 YES
Deaths/day/1 M log(mean) BCG % (median) 1 0.0767411 0.0006819 622.2910 YES
Deaths/day/1 M log(median) BCG % (median) 1 0.2637837 0.0000029 283.6683 YES
Deaths/day/1 M loglog(max) BCG % (median) 1 0.0988073 0.0001056 582.5990 YES
Deaths/1 M/week 3 log(Total) BCG % (median) 1 0.0789881 0.0030733 459.2648 YES
Deaths/1 M/week 3 log(median) BCG % (median) 1 0.1265373 0.0021655 278.9262 YES
Deaths/1 M/week 3 log(mean) BCG % (median) 1 0.0789881 0.0030733 459.2648 YES
Deaths/1 M/week 3 log(max) BCG % (median) 1 0.0918373 0.0013596 435.0310 YES
Deaths/1 M/month 1 log(Total) BCG % (median) 1 0.0924947 0.0037608 388.8372 YES
Deaths/1 M/month 1 log(median) BCG % (median) 1 0.1483364 0.0021765 234.3268 YES
Deaths/1 M/month 1 log(mean) BCG % (median) 1 0.0924947 0.0037608 388.8372 YES
Deaths/1 M/month 1 log(max) BCG % (median) 1 0.1416911 0.0002773 356.6587 YES

Anova Models without USA states

model_results <- data.frame()

for(i in 1:length(independent_variables_categorical)){
  for(j in 1:length(dependent_variables)){
    aov_model <- aov(df_world[,dependent_variables[j]]~df_world[,independent_variables_categorical[i]])
    
    new_row <- data.frame(dependent_variable = dependent_variables_labels$V2[j],
                          independent_variable = independent_variables_labels_categorical$V2[i],
                          F_statistic = glance(aov_model)$statistic,
                          df = glance(aov_model)$df-1,
                          df.residual = glance(aov_model)$df.residual,
                          r_squared = glance(aov_model)$r.squared,
                          p_value = glance(aov_model)$p.value,
                          AIC = glance(aov_model)$AIC)
    model_results <- rbind(model_results, new_row)
  }
}

model_results$significant <- ifelse(model_results$p_value < 0.05, "YES", "")
dependent_variable independent_variable F_statistic df df.residual r_squared p_value AIC significant
Deaths/1 M (Total) BCG Policy 70.0171070 2 171 0.4502213 0.0000000 2062.9673 YES
Days to 0.1 Death/1 M BCG Policy 0.9957736 2 138 0.0142262 0.3720762 1003.6961
Days to 1 Death/1 M BCG Policy 0.7311560 2 101 0.0142717 0.4838823 798.8317
Deaths/day/1 M (mean) BCG Policy 48.4725905 2 142 0.4057214 0.0000000 642.7717 YES
Deaths/day/1 M (median) BCG Policy 34.4402350 2 142 0.3266328 0.0000000 540.9820 YES
Deaths/day/1 M (max) BCG Policy 26.8070302 2 142 0.2740808 0.0000000 1186.4926 YES
Deaths/1 M/week 3 (Total) BCG Policy 16.2457856 2 123 0.2089603 0.0000005 1240.1111 YES
Deaths/1 M/week 3 (median) BCG Policy 18.2586556 2 123 0.2289238 0.0000001 419.5799 YES
Deaths/1 M/week 3 (mean) BCG Policy 16.2457856 2 123 0.2089603 0.0000005 749.7417 YES
Deaths/1 M/week 3 (max) BCG Policy 13.0322419 2 123 0.1748537 0.0000074 1051.0305 YES
Deaths/1 M/month 1 (Total) BCG Policy 15.3620035 2 86 0.2632193 0.0000020 1051.9282 YES
Deaths/1 M/month 1 (median) BCG Policy 8.4820719 2 86 0.1647578 0.0004344 315.5109 YES
Deaths/1 M/month 1 (mean) BCG Policy 15.3620035 2 86 0.2632193 0.0000020 446.5150 YES
Deaths/1 M/month 1 (max) BCG Policy 13.8077419 2 86 0.2430609 0.0000063 766.6567 YES
Deaths/1 M (Total) BCG Policy 42.1632816 2 142 0.3725880 0.0000000 580.5231 YES
Deaths/day/1 M log(mean) BCG Policy 38.1751417 2 142 0.3496688 0.0000000 565.4862 YES
Deaths/day/1 M log(median) BCG Policy 25.7859864 2 70 0.4242094 0.0000000 264.5246 YES
Deaths/day/1 M loglog(max) BCG Policy 34.3488636 2 142 0.3260487 0.0000000 534.7549 YES
Deaths/1 M/week 3 log(Total) BCG Policy 19.9412074 2 106 0.2733874 0.0000000 435.4232 YES
Deaths/1 M/week 3 log(median) BCG Policy 13.6730223 2 69 0.2838315 0.0000100 266.6306 YES
Deaths/1 M/week 3 log(mean) BCG Policy 19.9412074 2 106 0.2733874 0.0000000 435.4232 YES
Deaths/1 M/week 3 log(max) BCG Policy 18.3335492 2 106 0.2570116 0.0000001 415.1500 YES
Deaths/1 M/month 1 log(Total) BCG Policy 21.1959276 2 86 0.3301756 0.0000000 363.8093 YES
Deaths/1 M/month 1 log(median) BCG Policy 17.0795265 2 58 0.3706533 0.0000015 217.8737 YES
Deaths/1 M/month 1 log(mean) BCG Policy 21.1959276 2 86 0.3301756 0.0000000 363.8093 YES
Deaths/1 M/month 1 log(max) BCG Policy 23.2284605 2 86 0.3507323 0.0000000 333.8171 YES

T-test Models without USA states

df_world$BCG_TF <- 1
df_world[which(df_world$BCG_policy == "never"),]$BCG_TF <- 0
df_world[which(df_world$BCG_policy == "interrupted"),]$BCG_TF <- 0

df_world$BCG_TF_2 <- 1
df_world[which(df_world$BCG_policy == "never"),]$BCG_TF_2 <- 0
df_world[which(df_world$BCG_policy == "interrupted"),]$BCG_TF_2 <- NA
independent_variables_t_test <- names(df_world)[c(ncol(df_world)-1, ncol(df_world))] #BCG_TF
independent_variables_t_test
## [1] "BCG_TF"   "BCG_TF_2"
model_results <- data.frame()

for(i in 1:length(independent_variables_t_test)){
  for(j in 1:length(dependent_variables)){
    t_test_model <- t.test(df_world[,dependent_variables[j]]~df_world[,independent_variables_t_test[i]], paired = FALSE, na.action = na.pass, alternative="greater", var.equal = TRUE)

    new_row <- data.frame(dependent_variable = dependent_variables_labels$V2[j],
                          independent_variable = independent_variables_t_test_labels[i],
                          t_statistic = glance(t_test_model)$statistic,
                          df = glance(t_test_model)$parameter,
                          p_value = glance(t_test_model)$p.value)
    model_results <- rbind(model_results, new_row)
  }
}

model_results$significant <- ifelse(model_results$p_value < 0.05, "YES", "")
dependent_variable independent_variable t_statistic df p_value significant
t Deaths/1 M (Total) BCG Yes/No 8.6688316 181 0.0000000 YES
t1 Days to 0.1 Death/1 M BCG Yes/No -1.3248692 144 0.9063435
t2 Days to 1 Death/1 M BCG Yes/No -0.9523412 106 0.8284547
t3 Deaths/day/1 M (mean) BCG Yes/No 7.6369304 149 0.0000000 YES
t4 Deaths/day/1 M (median) BCG Yes/No 7.9914050 149 0.0000000 YES
t5 Deaths/day/1 M (max) BCG Yes/No 4.7064001 149 0.0000029 YES
t6 Deaths/1 M/week 3 (Total) BCG Yes/No 3.7083465 127 0.0001552 YES
t7 Deaths/1 M/week 3 (median) BCG Yes/No 6.1693230 127 0.0000000 YES
t8 Deaths/1 M/week 3 (mean) BCG Yes/No 3.7083465 127 0.0001552 YES
t9 Deaths/1 M/week 3 (max) BCG Yes/No 2.8855427 127 0.0022963 YES
t10 Deaths/1 M/month 1 (Total) BCG Yes/No 4.4487645 89 0.0000124 YES
t11 Deaths/1 M/month 1 (median) BCG Yes/No 4.1421637 89 0.0000391 YES
t12 Deaths/1 M/month 1 (mean) BCG Yes/No 4.4487645 89 0.0000124 YES
t13 Deaths/1 M/month 1 (max) BCG Yes/No 3.3084646 89 0.0006775 YES
t14 Deaths/1 M (Total) BCG Yes/No 8.8361166 149 0.0000000 YES
t15 Deaths/day/1 M log(mean) BCG Yes/No 8.3384083 149 0.0000000 YES
t16 Deaths/day/1 M log(median) BCG Yes/No 7.0595723 72 0.0000000 YES
t17 Deaths/day/1 M loglog(max) BCG Yes/No 7.5996555 149 0.0000000 YES
t18 Deaths/1 M/week 3 log(Total) BCG Yes/No 6.0640919 110 0.0000000 YES
t19 Deaths/1 M/week 3 log(median) BCG Yes/No 5.2333074 70 0.0000008 YES
t20 Deaths/1 M/week 3 log(mean) BCG Yes/No 6.0640919 110 0.0000000 YES
t21 Deaths/1 M/week 3 log(max) BCG Yes/No 5.6006445 110 0.0000001 YES
t22 Deaths/1 M/month 1 log(Total) BCG Yes/No 6.2896413 89 0.0000000 YES
t23 Deaths/1 M/month 1 log(median) BCG Yes/No 5.8512544 59 0.0000001 YES
t24 Deaths/1 M/month 1 log(mean) BCG Yes/No 6.2896413 89 0.0000000 YES
t25 Deaths/1 M/month 1 log(max) BCG Yes/No 6.3646151 89 0.0000000 YES
t26 Deaths/1 M (Total) BCG Yes/No 2 12.6073605 161 0.0000000 YES
t27 Days to 0.1 Death/1 M BCG Yes/No 2 -0.6575432 124 0.7439748
t28 Days to 1 Death/1 M BCG Yes/No 2 -0.3956464 86 0.6533272
t29 Deaths/day/1 M (mean) BCG Yes/No 2 10.8134151 129 0.0000000 YES
t30 Deaths/day/1 M (median) BCG Yes/No 2 9.7895438 129 0.0000000 YES
t31 Deaths/day/1 M (max) BCG Yes/No 2 6.9818895 129 0.0000000 YES
t32 Deaths/1 M/week 3 (Total) BCG Yes/No 2 5.4794354 107 0.0000001 YES
t33 Deaths/1 M/week 3 (median) BCG Yes/No 2 6.2679344 107 0.0000000 YES
t34 Deaths/1 M/week 3 (mean) BCG Yes/No 2 5.4794354 107 0.0000001 YES
t35 Deaths/1 M/week 3 (max) BCG Yes/No 2 4.8561118 107 0.0000021 YES
t36 Deaths/1 M/month 1 (Total) BCG Yes/No 2 5.6889062 71 0.0000001 YES
t37 Deaths/1 M/month 1 (median) BCG Yes/No 2 4.8163410 71 0.0000040 YES
t38 Deaths/1 M/month 1 (mean) BCG Yes/No 2 5.6889062 71 0.0000001 YES
t39 Deaths/1 M/month 1 (max) BCG Yes/No 2 4.9264382 71 0.0000026 YES
t40 Deaths/1 M (Total) BCG Yes/No 2 5.7336526 129 0.0000000 YES
t41 Deaths/day/1 M log(mean) BCG Yes/No 2 5.2659604 129 0.0000003 YES
t42 Deaths/day/1 M log(median) BCG Yes/No 2 4.6623847 54 0.0000105 YES
t43 Deaths/day/1 M loglog(max) BCG Yes/No 2 5.0930708 129 0.0000006 YES
t44 Deaths/1 M/week 3 log(Total) BCG Yes/No 2 3.9753289 90 0.0000708 YES
t45 Deaths/1 M/week 3 log(median) BCG Yes/No 2 2.4161023 53 0.0095828 YES
t46 Deaths/1 M/week 3 log(mean) BCG Yes/No 2 3.9753289 90 0.0000708 YES
t47 Deaths/1 M/week 3 log(max) BCG Yes/No 2 3.8964772 90 0.0000937 YES
t48 Deaths/1 M/month 1 log(Total) BCG Yes/No 2 3.9743529 71 0.0000838 YES
t49 Deaths/1 M/month 1 log(median) BCG Yes/No 2 2.3929547 43 0.0105758 YES
t50 Deaths/1 M/month 1 log(mean) BCG Yes/No 2 3.9743529 71 0.0000838 YES
t51 Deaths/1 M/month 1 log(max) BCG Yes/No 2 4.3619597 71 0.0000214 YES

Models with FILTERED data

All data, filtered as follows

df_filtered <- subsoet(df_unfiltered, 
                covid19_cumulative_deaths > 0
                  & population_million > 1
                  & ages_65_up > 15 
                  & urban_percentage_2018 > 60 
                  & population_density_2018 < 300 
                  & HDI_2018 > 0.7
                  & ISO3 != "USA_state")

Linear Models Filtered

model_results <- data.frame()

for(i in 1:length(independent_variables_continuous)){
  for(j in 1:length(dependent_variables)){
    linear_model <- lm(df_filtered[,dependent_variables[j]]~df_filtered[,independent_variables_continuous[i]])
    new_row <- data.frame(dependent_variable = dependent_variables_labels$V2[j],
                          independent_variable = independent_variables_labels_continuous$V2[i],
                          df = glance(linear_model)$df-1,
                          r_squared = summary(linear_model)$r.squared,
                          p_value = glance(linear_model)$p.value,
                          AIC = glance(linear_model)$AIC)
    model_results <- rbind(model_results, new_row)
    }
}

model_results$significant <- ifelse(model_results$p_value < 0.05, "YES", "") 
dependent_variable independent_variable df r_squared p_value AIC significant
Deaths/1 M (Total) BCG % (mean) 1 0.2315898 0.0200810 289.73459 YES
Days to 0.1 Death/1 M BCG % (mean) 1 0.0490357 0.3098944 143.65850
Days to 1 Death/1 M BCG % (mean) 1 0.0822410 0.1846061 165.77632
Deaths/day/1 M (mean) BCG % (mean) 1 0.2432249 0.0167913 104.90964 YES
Deaths/day/1 M (median) BCG % (mean) 1 0.2211632 0.0235405 107.10708 YES
Deaths/day/1 M (max) BCG % (mean) 1 0.2212832 0.0234976 153.75040 YES
Deaths/1 M/week 3 (Total) BCG % (mean) 1 0.0607500 0.2688315 165.03485
Deaths/1 M/week 3 (median) BCG % (mean) 1 0.0590461 0.2758677 73.23700
Deaths/1 M/week 3 (mean) BCG % (mean) 1 0.0607500 0.2688315 79.41480
Deaths/1 M/week 3 (max) BCG % (mean) 1 0.0688437 0.2381408 105.98417
Deaths/1 M/month 1 (Total) BCG % (mean) 1 0.1820186 0.0606641 211.99767
Deaths/1 M/month 1 (median) BCG % (mean) 1 0.0368319 0.4176019 52.61515
Deaths/1 M/month 1 (mean) BCG % (mean) 1 0.1820186 0.0606641 75.94978
Deaths/1 M/month 1 (max) BCG % (mean) 1 0.2748073 0.0176593 122.43004 YES
Deaths/1 M (Total) BCG % (mean) 1 0.1490677 0.0688078 89.22857
Deaths/day/1 M log(mean) BCG % (mean) 1 0.1156751 0.1123067 85.60804
Deaths/day/1 M log(median) BCG % (mean) 1 0.1461186 0.0872487 77.05683
Deaths/day/1 M loglog(max) BCG % (mean) 1 0.1247578 0.0982779 82.46990
Deaths/1 M/week 3 log(Total) BCG % (mean) 1 0.0067133 0.7169883 88.19857
Deaths/1 M/week 3 log(median) BCG % (mean) 1 0.0434929 0.3915494 75.95261
Deaths/1 M/week 3 log(mean) BCG % (mean) 1 0.0067133 0.7169883 88.19857
Deaths/1 M/week 3 log(max) BCG % (mean) 1 0.0126939 0.6176365 82.56393
Deaths/1 M/month 1 log(Total) BCG % (mean) 1 0.0789809 0.2300306 77.21616
Deaths/1 M/month 1 log(median) BCG % (mean) 1 0.0144304 0.6460633 65.85636
Deaths/1 M/month 1 log(mean) BCG % (mean) 1 0.0789809 0.2300306 77.21616
Deaths/1 M/month 1 log(max) BCG % (mean) 1 0.1700604 0.0707810 68.60796
Deaths/1 M (Total) BCG % (median) 1 0.2592818 0.0130794 288.89041 YES
Days to 0.1 Death/1 M BCG % (median) 1 0.0515939 0.2972757 143.59654
Days to 1 Death/1 M BCG % (median) 1 0.0791804 0.1933569 165.85290
Deaths/day/1 M (mean) BCG % (median) 1 0.2769130 0.0098991 103.86230 YES
Deaths/day/1 M (median) BCG % (median) 1 0.2275458 0.0213611 106.91781 YES
Deaths/day/1 M (max) BCG % (median) 1 0.2495587 0.0152219 152.89973 YES
Deaths/1 M/week 3 (Total) BCG % (median) 1 0.0560872 0.2886136 165.14379
Deaths/1 M/week 3 (median) BCG % (median) 1 0.0553037 0.2921062 73.32432
Deaths/1 M/week 3 (mean) BCG % (median) 1 0.0560872 0.2886136 79.52375
Deaths/1 M/week 3 (max) BCG % (median) 1 0.0628742 0.2603534 106.12476
Deaths/1 M/month 1 (Total) BCG % (median) 1 0.1831038 0.0598189 211.97112
Deaths/1 M/month 1 (median) BCG % (median) 1 0.0320625 0.4500354 52.71394
Deaths/1 M/month 1 (mean) BCG % (median) 1 0.1831038 0.0598189 75.92323
Deaths/1 M/month 1 (max) BCG % (median) 1 0.3029795 0.0119085 121.63759 YES
Deaths/1 M (Total) BCG % (median) 1 0.1751143 0.0468943 88.51356 YES
Deaths/day/1 M log(mean) BCG % (median) 1 0.1393051 0.0793990 84.98510
Deaths/day/1 M log(median) BCG % (median) 1 0.1617827 0.0706727 76.66802
Deaths/day/1 M loglog(max) BCG % (median) 1 0.1467794 0.0711571 81.88380
Deaths/1 M/week 3 log(Total) BCG % (median) 1 0.0085930 0.6815864 88.15689
Deaths/1 M/week 3 log(median) BCG % (median) 1 0.0445313 0.3858247 75.93197
Deaths/1 M/week 3 log(mean) BCG % (median) 1 0.0085930 0.6815864 88.15689
Deaths/1 M/week 3 log(max) BCG % (median) 1 0.0141842 0.5975727 82.53070
Deaths/1 M/month 1 log(Total) BCG % (median) 1 0.0903511 0.1978414 76.96771
Deaths/1 M/month 1 log(median) BCG % (median) 1 0.0170870 0.6170304 65.81048
Deaths/1 M/month 1 log(mean) BCG % (median) 1 0.0903511 0.1978414 76.96771
Deaths/1 M/month 1 log(max) BCG % (median) 1 0.1978513 0.0494013 67.92678 YES

Anova Models Filtered

model_results <- data.frame()

for(i in 1:length(independent_variables_categorical)){
  for(j in 1:length(dependent_variables)){
    aov_model <- aov(df_filtered[,dependent_variables[j]]~df_filtered[,independent_variables_categorical[i]])
    
    new_row <- data.frame(dependent_variable = dependent_variables_labels$V2[j],
                          independent_variable = independent_variables_labels_categorical$V2[i],
                          F_statistic = glance(aov_model)$statistic,
                          df = glance(aov_model)$df-1,
                          df.residual = glance(aov_model)$df.residual,
                          r_squared = glance(aov_model)$r.squared,
                          p_value = glance(aov_model)$p.value,
                          AIC = glance(aov_model)$AIC)
    model_results <- rbind(model_results, new_row)
  }
}

model_results$significant <- ifelse(model_results$p_value < 0.05, "YES", "") 
dependent_variable independent_variable F_statistic df df.residual r_squared p_value AIC significant
Deaths/1 M (Total) BCG Policy 4.9213153 2 20 0.3298178 0.0182780 288.58878 YES
Days to 0.1 Death/1 M BCG Policy 0.7034859 2 20 0.0657249 0.5066961 145.25127
Days to 1 Death/1 M BCG Policy 0.2388688 2 20 0.0233296 0.7897329 169.20725
Deaths/day/1 M (mean) BCG Policy 4.4953917 2 20 0.3101256 0.0244175 104.78084 YES
Deaths/day/1 M (median) BCG Policy 3.0372701 2 20 0.2329683 0.0704910 108.75579
Deaths/day/1 M (max) BCG Policy 5.8771309 2 20 0.3701633 0.0098238 150.87011 YES
Deaths/1 M/week 3 (Total) BCG Policy 1.4112872 2 19 0.1293420 0.2682578 165.36653
Deaths/1 M/week 3 (median) BCG Policy 1.9968146 2 19 0.1736842 0.1632630 72.37882
Deaths/1 M/week 3 (mean) BCG Policy 1.4112872 2 19 0.1293420 0.2682578 79.74649
Deaths/1 M/week 3 (max) BCG Policy 0.8962004 2 19 0.0862046 0.4246833 107.57012
Deaths/1 M/month 1 (Total) BCG Policy 1.7178052 2 17 0.1681188 0.2091805 214.33467
Deaths/1 M/month 1 (median) BCG Policy 2.2701622 2 17 0.2107825 0.1337124 50.63143
Deaths/1 M/month 1 (mean) BCG Policy 1.7178052 2 17 0.1681188 0.2091805 78.28678
Deaths/1 M/month 1 (max) BCG Policy 1.9305108 2 17 0.1850831 0.1755753 126.76302
Deaths/1 M (Total) BCG Policy 6.3166573 2 20 0.3871294 0.0074763 83.68046 YES
Deaths/day/1 M log(mean) BCG Policy 5.3229454 2 20 0.3473840 0.0140145 80.61982 YES
Deaths/day/1 M log(median) BCG Policy 5.1047601 2 18 0.3619175 0.0175344 72.93901 YES
Deaths/day/1 M loglog(max) BCG Policy 5.7217908 2 20 0.3639401 0.0108388 77.12811 YES
Deaths/1 M/week 3 log(Total) BCG Policy 0.6398720 2 19 0.0631045 0.5383513 88.91272
Deaths/1 M/week 3 log(median) BCG Policy 1.3983268 2 16 0.1487847 0.2756231 75.73677
Deaths/1 M/week 3 log(mean) BCG Policy 0.6398720 2 19 0.0631045 0.5383513 88.91272
Deaths/1 M/week 3 log(max) BCG Policy 0.5257399 2 19 0.0524390 0.5994709 83.65998
Deaths/1 M/month 1 log(Total) BCG Policy 1.9249627 2 17 0.1846494 0.1763712 76.77891
Deaths/1 M/month 1 log(median) BCG Policy 5.2427191 2 14 0.4282316 0.0199775 58.60010 YES
Deaths/1 M/month 1 log(mean) BCG Policy 1.9249627 2 17 0.1846494 0.1763712 76.77891
Deaths/1 M/month 1 log(max) BCG Policy 2.5992495 2 17 0.2341825 0.1035297 68.99978

T-test Filtered

df_filtered$BCG_TF <- 1
df_filtered[which(df_filtered$BCG_policy == "never"),]$BCG_TF <- 0
df_filtered[which(df_filtered$BCG_policy == "interrupted"),]$BCG_TF <- 0

df_filtered$BCG_TF_2 <- 1
df_filtered[which(df_filtered$BCG_policy == "never"),]$BCG_TF_2 <- 0
df_filtered[which(df_filtered$BCG_policy == "interrupted"),]$BCG_TF_2 <- NA
independent_variables_t_test <- names(df_filtered)[c(ncol(df_filtered)-1, ncol(df_filtered))] #BCG_TF
independent_variables_t_test
## [1] "BCG_TF"   "BCG_TF_2"
model_results <- data.frame()

for(i in 1:length(independent_variables_t_test)){
  for(j in 1:length(dependent_variables)){
    t_test_model <- t.test(df_filtered[,dependent_variables[j]]~df_filtered[,independent_variables_t_test[i]], paired = FALSE, na.action = na.pass, alternative="greater", var.equal = TRUE)

    new_row <- data.frame(dependent_variable = dependent_variables_labels$V2[j],
                          independent_variable = independent_variables_t_test_labels[i],
                          t_statistic = glance(t_test_model)$statistic,
                          df = glance(t_test_model)$parameter,
                          p_value = glance(t_test_model)$p.value)
    model_results <- rbind(model_results, new_row)
  }
}

model_results$significant <- ifelse(model_results$p_value < 0.05, "YES", "")
dependent_variable independent_variable t_statistic df p_value significant
t Deaths/1 M (Total) BCG Yes/No 2.5857733 21 0.0086223 YES
t1 Days to 0.1 Death/1 M BCG Yes/No 0.9109031 21 0.1863422
t2 Days to 1 Death/1 M BCG Yes/No 0.2661910 21 0.3963441
t3 Deaths/day/1 M (mean) BCG Yes/No 2.7181348 21 0.0064404 YES
t4 Deaths/day/1 M (median) BCG Yes/No 2.0814867 21 0.0249060 YES
t5 Deaths/day/1 M (max) BCG Yes/No 3.1224536 21 0.0025747 YES
t6 Deaths/1 M/week 3 (Total) BCG Yes/No 1.6065653 20 0.0619118
t7 Deaths/1 M/week 3 (median) BCG Yes/No 1.9330375 20 0.0337576 YES
t8 Deaths/1 M/week 3 (mean) BCG Yes/No 1.6065653 20 0.0619118
t9 Deaths/1 M/week 3 (max) BCG Yes/No 1.3076538 20 0.1029118
t10 Deaths/1 M/month 1 (Total) BCG Yes/No 1.9001319 18 0.0367781 YES
t11 Deaths/1 M/month 1 (median) BCG Yes/No 1.8758008 18 0.0384985 YES
t12 Deaths/1 M/month 1 (mean) BCG Yes/No 1.9001319 18 0.0367781 YES
t13 Deaths/1 M/month 1 (max) BCG Yes/No 1.9622093 18 0.0326939 YES
t14 Deaths/1 M (Total) BCG Yes/No 3.2189562 21 0.0020591 YES
t15 Deaths/day/1 M log(mean) BCG Yes/No 3.0346632 21 0.0031508 YES
t16 Deaths/day/1 M log(median) BCG Yes/No 3.1282507 19 0.0027675 YES
t17 Deaths/day/1 M loglog(max) BCG Yes/No 3.1539555 21 0.0023940 YES
t18 Deaths/1 M/week 3 log(Total) BCG Yes/No 1.0982842 20 0.1425635
t19 Deaths/1 M/week 3 log(median) BCG Yes/No 1.5011314 17 0.0758333
t20 Deaths/1 M/week 3 log(mean) BCG Yes/No 1.0982842 20 0.1425635
t21 Deaths/1 M/week 3 log(max) BCG Yes/No 1.0227095 20 0.1593286
t22 Deaths/1 M/month 1 log(Total) BCG Yes/No 2.0167052 18 0.0294479 YES
t23 Deaths/1 M/month 1 log(median) BCG Yes/No 2.3878842 15 0.0152696 YES
t24 Deaths/1 M/month 1 log(mean) BCG Yes/No 2.0167052 18 0.0294479 YES
t25 Deaths/1 M/month 1 log(max) BCG Yes/No 2.3048966 18 0.0166482 YES
t26 Deaths/1 M (Total) BCG Yes/No 2 4.8082918 8 0.0006706 YES
t27 Days to 0.1 Death/1 M BCG Yes/No 2 1.3253436 8 0.1108277
t28 Days to 1 Death/1 M BCG Yes/No 2 0.7191757 8 0.2462513
t29 Deaths/day/1 M (mean) BCG Yes/No 2 4.9972556 8 0.0005282 YES
t30 Deaths/day/1 M (median) BCG Yes/No 2 2.9116612 8 0.0097696 YES
t31 Deaths/day/1 M (max) BCG Yes/No 2 12.5358423 8 0.0000008 YES
t32 Deaths/1 M/week 3 (Total) BCG Yes/No 2 1.0764244 7 0.1587155
t33 Deaths/1 M/week 3 (median) BCG Yes/No 2 1.3021756 7 0.1170317
t34 Deaths/1 M/week 3 (mean) BCG Yes/No 2 1.0764244 7 0.1587155
t35 Deaths/1 M/week 3 (max) BCG Yes/No 2 0.8870599 7 0.2022459
t36 Deaths/1 M/month 1 (Total) BCG Yes/No 2 2.1196461 6 0.0391609 YES
t37 Deaths/1 M/month 1 (median) BCG Yes/No 2 1.1000912 6 0.1567297
t38 Deaths/1 M/month 1 (mean) BCG Yes/No 2 2.1196461 6 0.0391609 YES
t39 Deaths/1 M/month 1 (max) BCG Yes/No 2 2.2081792 6 0.0346584 YES
t40 Deaths/1 M (Total) BCG Yes/No 2 5.2840271 8 0.0003713 YES
t41 Deaths/day/1 M log(mean) BCG Yes/No 2 4.2938492 8 0.0013188 YES
t42 Deaths/day/1 M log(median) BCG Yes/No 2 3.3055750 7 0.0065103 YES
t43 Deaths/day/1 M loglog(max) BCG Yes/No 2 3.8036082 8 0.0026049 YES
t44 Deaths/1 M/week 3 log(Total) BCG Yes/No 2 0.4121970 7 0.3462628
t45 Deaths/1 M/week 3 log(median) BCG Yes/No 2 0.3161754 6 0.3812898
t46 Deaths/1 M/week 3 log(mean) BCG Yes/No 2 0.4121970 7 0.3462628
t47 Deaths/1 M/week 3 log(max) BCG Yes/No 2 0.4384424 7 0.3371390
t48 Deaths/1 M/month 1 log(Total) BCG Yes/No 2 1.8432899 6 0.0574266
t49 Deaths/1 M/month 1 log(median) BCG Yes/No 2 0.1319640 5 0.4500793
t50 Deaths/1 M/month 1 log(mean) BCG Yes/No 2 1.8432899 6 0.0574266
t51 Deaths/1 M/month 1 log(max) BCG Yes/No 2 2.1317797 6 0.0385099 YES

Models with Confounding varibales

confounding_varibales <- names(df_unfiltered)[c(7,51,6,10)]
confounding_varibales
## [1] "population_density_2018" "urban_percentage_2018"  
## [3] "HDI_2018"                "ages_65_up"
df_confounding_models_stats <- data.frame()

Linear Models (with UNFILTERED data, including USA states)

model_results <- data.frame()

for(i in 1:length(confounding_varibales)){
  for(j in 1:length(dependent_variables)){
    linear_model <- lm(df_unfiltered[,dependent_variables[j]]~df_unfiltered[,confounding_varibales[i]])
    new_row <- data.frame(dependent_variable = dependent_variables_labels$V2[j],
                          independent_variable = confounding_varibales_labels$V2[i],
                          df = glance(linear_model)$df-1,
                          r_squared = summary(linear_model)$r.squared,
                          p_value = glance(linear_model)$p.value,
                          AIC = glance(linear_model)$AIC)
    model_results <- rbind(model_results, new_row)
    }
}

model_results$significant <- ifelse(model_results$p_value < 0.05, "YES", "")
dependent_variable independent_variable df r_squared p_value AIC significant
Deaths/1 M (Total) Pop Dens 1 0.0012826 0.5881310 2914.3202
Days to 0.1 Death/1 M Pop Dens 1 0.0012243 0.6254575 1279.1824
Days to 1 Death/1 M Pop Dens 1 0.0065920 0.3043795 1206.7222
Deaths/day/1 M (mean) Pop Dens 1 0.0037711 0.3852901 1056.2067
Deaths/day/1 M (median) Pop Dens 1 0.0000289 0.9394696 915.7692
Deaths/day/1 M (max) Pop Dens 1 0.0290726 0.0152616 1764.5744 YES
Deaths/1 M/week 3 (Total) Pop Dens 1 0.0122200 0.1418436 1756.0897
Deaths/1 M/week 3 (median) Pop Dens 1 0.0000457 0.9286466 787.6383
Deaths/1 M/week 3 (mean) Pop Dens 1 0.0122185 0.1418689 1063.3398
Deaths/1 M/week 3 (max) Pop Dens 1 0.0602869 0.0009550 1451.1537 YES
Deaths/1 M/month 1 (Total) Pop Dens 1 0.0023094 0.5960968 1499.3819
Deaths/1 M/month 1 (median) Pop Dens 1 0.0009423 0.7350231 511.8853
Deaths/1 M/month 1 (mean) Pop Dens 1 0.0023016 0.5967231 655.8468
Deaths/1 M/month 1 (max) Pop Dens 1 0.0032974 0.5264177 1075.9317
Deaths/1 M (Total) Pop Dens 1 0.0051273 0.3112114 898.9853
Deaths/day/1 M log(mean) Pop Dens 1 0.0066454 0.2487730 872.6668
Deaths/day/1 M log(median) Pop Dens 1 0.0060058 0.4021833 472.2958
Deaths/day/1 M loglog(max) Pop Dens 1 0.0159402 0.0733813 836.2330
Deaths/1 M/week 3 log(Total) Pop Dens 1 0.0115343 0.1764563 678.0033
Deaths/1 M/week 3 log(median) Pop Dens 1 0.0089428 0.3126177 456.2426
Deaths/1 M/week 3 log(mean) Pop Dens 1 0.0115017 0.1770712 676.9950
Deaths/1 M/week 3 log(max) Pop Dens 1 0.0257704 0.0425772 646.0196 YES
Deaths/1 M/month 1 log(Total) Pop Dens 1 0.0005947 0.7880514 532.0551
Deaths/1 M/month 1 log(median) Pop Dens 1 0.0095882 0.3477729 368.5844
Deaths/1 M/month 1 log(mean) Pop Dens 1 0.0006419 0.7800000 531.6820
Deaths/1 M/month 1 log(max) Pop Dens 1 0.0003752 0.8309074 507.4020
Deaths/1 M (Total) Urban (%) 1 0.1038580 0.0000006 2889.6267 YES
Days to 0.1 Death/1 M Urban (%) 1 0.0727658 0.0001316 1298.3850 YES
Days to 1 Death/1 M Urban (%) 1 0.0000003 0.9947058 1185.4248
Deaths/day/1 M (mean) Urban (%) 1 0.1024288 0.0000036 1031.3771 YES
Deaths/day/1 M (median) Urban (%) 1 0.0810039 0.0000422 895.1341 YES
Deaths/day/1 M (max) Urban (%) 1 0.0720169 0.0001172 1747.6361 YES
Deaths/1 M/week 3 (Total) Urban (%) 1 0.0670075 0.0004850 1746.0101 YES
Deaths/1 M/week 3 (median) Urban (%) 1 0.0711937 0.0003179 774.5003 YES
Deaths/1 M/week 3 (mean) Urban (%) 1 0.0670202 0.0004843 1053.2575 YES
Deaths/1 M/week 3 (max) Urban (%) 1 0.0547293 0.0016727 1452.2338 YES
Deaths/1 M/month 1 (Total) Urban (%) 1 0.1051652 0.0002247 1497.1887 YES
Deaths/1 M/month 1 (median) Urban (%) 1 0.0671013 0.0035340 506.5842 YES
Deaths/1 M/month 1 (mean) Urban (%) 1 0.1052619 0.0002231 646.8371 YES
Deaths/1 M/month 1 (max) Urban (%) 1 0.0884788 0.0007549 1072.6410 YES
Deaths/1 M (Total) Urban (%) 1 0.2553527 0.0000000 840.4204 YES
Deaths/day/1 M log(mean) Urban (%) 1 0.2311372 0.0000000 821.5424 YES
Deaths/day/1 M log(median) Urban (%) 1 0.1582105 0.0000075 452.5178 YES
Deaths/day/1 M loglog(max) Urban (%) 1 0.2172510 0.0000000 787.0326 YES
Deaths/1 M/week 3 log(Total) Urban (%) 1 0.2309684 0.0000000 650.4444 YES
Deaths/1 M/week 3 log(median) Urban (%) 1 0.1937220 0.0000008 432.3067 YES
Deaths/1 M/week 3 log(mean) Urban (%) 1 0.2332719 0.0000000 649.0324 YES
Deaths/1 M/week 3 log(max) Urban (%) 1 0.2232756 0.0000000 618.5531 YES
Deaths/1 M/month 1 log(Total) Urban (%) 1 0.2423223 0.0000000 513.2619 YES
Deaths/1 M/month 1 log(median) Urban (%) 1 0.2106434 0.0000033 347.2555 YES
Deaths/1 M/month 1 log(mean) Urban (%) 1 0.2438350 0.0000000 512.7211 YES
Deaths/1 M/month 1 log(max) Urban (%) 1 0.2486295 0.0000000 483.8969 YES
Deaths/1 M (Total) HDI 1 0.1225412 0.0000001 2670.4135 YES
Days to 0.1 Death/1 M HDI 1 0.1180112 0.0000017 1218.2600 YES
Days to 1 Death/1 M HDI 1 0.0808761 0.0003671 1131.1507 YES
Deaths/day/1 M (mean) HDI 1 0.1237036 0.0000007 925.3614 YES
Deaths/day/1 M (median) HDI 1 0.1001064 0.0000092 848.4256 YES
Deaths/day/1 M (max) HDI 1 0.0941681 0.0000175 1544.4640 YES
Deaths/1 M/week 3 (Total) HDI 1 0.1062720 0.0000162 1431.5540 YES
Deaths/1 M/week 3 (median) HDI 1 0.1056200 0.0000172 733.5421 YES
Deaths/1 M/week 3 (mean) HDI 1 0.1063348 0.0000161 777.6996 YES
Deaths/1 M/week 3 (max) HDI 1 0.1068488 0.0000153 1011.0336 YES
Deaths/1 M/month 1 (Total) HDI 1 0.1117858 0.0002153 1352.7861 YES
Deaths/1 M/month 1 (median) HDI 1 0.0781521 0.0021708 483.2223 YES
Deaths/1 M/month 1 (mean) HDI 1 0.1120653 0.0002112 550.0093 YES
Deaths/1 M/month 1 (max) HDI 1 0.1330962 0.0000487 860.9100 YES
Deaths/1 M (Total) HDI 1 0.6243828 0.0000000 651.7074 YES
Deaths/day/1 M log(mean) HDI 1 0.6065008 0.0000000 639.5277 YES
Deaths/day/1 M log(median) HDI 1 0.4304673 0.0000000 384.8134 YES
Deaths/day/1 M loglog(max) HDI 1 0.5469538 0.0000000 628.8042 YES
Deaths/1 M/week 3 log(Total) HDI 1 0.5039806 0.0000000 530.0584 YES
Deaths/1 M/week 3 log(median) HDI 1 0.5093705 0.0000000 347.4171 YES
Deaths/1 M/week 3 log(mean) HDI 1 0.5105042 0.0000000 527.0622 YES
Deaths/1 M/week 3 log(max) HDI 1 0.4837598 0.0000000 501.7570 YES
Deaths/1 M/month 1 log(Total) HDI 1 0.5382291 0.0000000 425.0290 YES
Deaths/1 M/month 1 log(median) HDI 1 0.5001284 0.0000000 287.5345 YES
Deaths/1 M/month 1 log(mean) HDI 1 0.5433370 0.0000000 423.4222 YES
Deaths/1 M/month 1 log(max) HDI 1 0.5367977 0.0000000 396.1802 YES
Deaths/1 M (Total) >65 yrs 1 0.1279780 0.0000000 2708.6330 YES
Days to 0.1 Death/1 M >65 yrs 1 0.0456386 0.0029274 1280.5698 YES
Days to 1 Death/1 M >65 yrs 1 0.0284165 0.0360163 1150.9434 YES
Deaths/day/1 M (mean) >65 yrs 1 0.1087013 0.0000022 935.3557 YES
Deaths/day/1 M (median) >65 yrs 1 0.1060613 0.0000030 846.4015 YES
Deaths/day/1 M (max) >65 yrs 1 0.0598786 0.0005292 1596.8299 YES
Deaths/1 M/week 3 (Total) >65 yrs 1 0.0885068 0.0000638 1444.0942 YES
Deaths/1 M/week 3 (median) >65 yrs 1 0.0827749 0.0001131 728.6481 YES
Deaths/1 M/week 3 (mean) >65 yrs 1 0.0885257 0.0000637 763.0022 YES
Deaths/1 M/week 3 (max) >65 yrs 1 0.0990977 0.0000221 983.3174 YES
Deaths/1 M/month 1 (Total) >65 yrs 1 0.0715799 0.0027748 1370.9796 YES
Deaths/1 M/month 1 (median) >65 yrs 1 0.0535412 0.0100217 449.5272 YES
Deaths/1 M/month 1 (mean) >65 yrs 1 0.0715986 0.0027711 534.2129 YES
Deaths/1 M/month 1 (max) >65 yrs 1 0.0683357 0.0034942 875.0408 YES
Deaths/1 M (Total) >65 yrs 1 0.5198194 0.0000000 731.0145 YES
Deaths/day/1 M log(mean) >65 yrs 1 0.4962101 0.0000000 714.7282 YES
Deaths/day/1 M log(median) >65 yrs 1 0.2328582 0.0000000 434.9981 YES
Deaths/day/1 M loglog(max) >65 yrs 1 0.4346149 0.0000000 693.5060 YES
Deaths/1 M/week 3 log(Total) >65 yrs 1 0.3595892 0.0000000 598.9413 YES
Deaths/1 M/week 3 log(median) >65 yrs 1 0.3373678 0.0000000 403.2550 YES
Deaths/1 M/week 3 log(mean) >65 yrs 1 0.3618312 0.0000000 597.4358 YES
Deaths/1 M/week 3 log(max) >65 yrs 1 0.3402736 0.0000000 564.4313 YES
Deaths/1 M/month 1 log(Total) >65 yrs 1 0.3193619 0.0000000 485.5408 YES
Deaths/1 M/month 1 log(median) >65 yrs 1 0.2899025 0.0000000 329.8553 YES
Deaths/1 M/month 1 log(mean) >65 yrs 1 0.3197732 0.0000000 485.1937 YES
Deaths/1 M/month 1 log(max) >65 yrs 1 0.3087627 0.0000000 457.2030 YES

Linear Models (with UNFILTEREDish data, excluding USA states)

model_results <- data.frame()

for(i in 1:length(confounding_varibales)){
  for(j in 1:length(dependent_variables)){
    linear_model <- lm(df_world[,dependent_variables[j]]~df_world[,confounding_varibales[i]])
    new_row <- data.frame(dependent_variable = dependent_variables_labels$V2[j],
                          independent_variable = confounding_varibales_labels$V2[i],
                          df = glance(linear_model)$df-1,
                          r_squared = summary(linear_model)$r.squared,
                          p_value = glance(linear_model)$p.value,
                          AIC = glance(linear_model)$AIC)
    model_results <- rbind(model_results, new_row)
    }
}

model_results$significant <- ifelse(model_results$p_value < 0.05, "YES", "")
dependent_variable independent_variable df r_squared p_value AIC significant
Deaths/1 M (Total) Pop Dens 1 0.0011480 0.6552885 2187.5546
Days to 0.1 Death/1 M Pop Dens 1 0.0027777 0.5318725 964.3518
Days to 1 Death/1 M Pop Dens 1 0.0117844 0.2634260 828.4526
Deaths/day/1 M (mean) Pop Dens 1 0.0047670 0.4043781 727.1314
Deaths/day/1 M (median) Pop Dens 1 0.0008471 0.7254814 605.6779
Deaths/day/1 M (max) Pop Dens 1 0.0509724 0.0057970 1247.6014 YES
Deaths/1 M/week 3 (Total) Pop Dens 1 0.0127465 0.2081375 1265.9456
Deaths/1 M/week 3 (median) Pop Dens 1 0.0014999 0.6667958 450.1467
Deaths/1 M/week 3 (mean) Pop Dens 1 0.0127465 0.2081375 775.5763
Deaths/1 M/week 3 (max) Pop Dens 1 0.0637288 0.0043473 1064.8793 YES
Deaths/1 M/month 1 (Total) Pop Dens 1 0.0000810 0.9336853 1065.7884
Deaths/1 M/month 1 (median) Pop Dens 1 0.0010301 0.7665812 326.6968
Deaths/1 M/month 1 (mean) Pop Dens 1 0.0000810 0.9336853 467.1777
Deaths/1 M/month 1 (max) Pop Dens 1 0.0004802 0.8394024 781.6398
Deaths/1 M (Total) Pop Dens 1 0.0095672 0.2369341 656.6831
Deaths/day/1 M log(mean) Pop Dens 1 0.0126368 0.1737385 632.4162
Deaths/day/1 M log(median) Pop Dens 1 0.0243621 0.1841849 304.5043
Deaths/day/1 M loglog(max) Pop Dens 1 0.0278764 0.0425377 602.0916 YES
Deaths/1 M/week 3 log(Total) Pop Dens 1 0.0220958 0.1211820 463.3588
Deaths/1 M/week 3 log(median) Pop Dens 1 0.0183798 0.2561719 287.3315
Deaths/1 M/week 3 log(mean) Pop Dens 1 0.0220958 0.1211820 463.3588
Deaths/1 M/week 3 log(max) Pop Dens 1 0.0467794 0.0232416 441.9745 YES
Deaths/1 M/month 1 log(Total) Pop Dens 1 0.0044630 0.5362953 380.2796
Deaths/1 M/month 1 log(median) Pop Dens 1 0.0193912 0.2844749 242.9267
Deaths/1 M/month 1 log(mean) Pop Dens 1 0.0044630 0.5362953 380.2796
Deaths/1 M/month 1 log(max) Pop Dens 1 0.0043115 0.5433118 359.7105
Deaths/1 M (Total) Urban (%) 1 0.0853292 0.0000692 2217.5829 YES
Days to 0.1 Death/1 M Urban (%) 1 0.0657615 0.0018491 995.9030 YES
Days to 1 Death/1 M Urban (%) 1 0.0000161 0.9671671 829.7311
Deaths/day/1 M (mean) Urban (%) 1 0.0820361 0.0003804 722.9856 YES
Deaths/day/1 M (median) Urban (%) 1 0.0632207 0.0019110 602.3101 YES
Deaths/day/1 M (max) Urban (%) 1 0.0556056 0.0036729 1261.7902 YES
Deaths/1 M/week 3 (Total) Urban (%) 1 0.0538204 0.0084138 1278.5809 YES
Deaths/1 M/week 3 (median) Urban (%) 1 0.0519262 0.0096835 448.8019 YES
Deaths/1 M/week 3 (mean) Urban (%) 1 0.0538204 0.0084138 780.4279 YES
Deaths/1 M/week 3 (max) Urban (%) 1 0.0519901 0.0096377 1081.3356 YES
Deaths/1 M/month 1 (Total) Urban (%) 1 0.0936797 0.0033483 1079.2267 YES
Deaths/1 M/month 1 (median) Urban (%) 1 0.0531242 0.0288492 327.3560 YES
Deaths/1 M/month 1 (mean) Urban (%) 1 0.0936797 0.0033483 467.0111 YES
Deaths/1 M/month 1 (max) Urban (%) 1 0.0726142 0.0102175 790.6374 YES
Deaths/1 M (Total) Urban (%) 1 0.2271102 0.0000000 629.2237 YES
Deaths/day/1 M log(mean) Urban (%) 1 0.2005993 0.0000000 611.4268 YES
Deaths/day/1 M log(median) Urban (%) 1 0.1673835 0.0002954 292.7739 YES
Deaths/day/1 M loglog(max) Urban (%) 1 0.1838463 0.0000000 584.3602 YES
Deaths/1 M/week 3 log(Total) Urban (%) 1 0.2552129 0.0000000 446.7262 YES
Deaths/1 M/week 3 log(median) Urban (%) 1 0.2232255 0.0000279 270.4795 YES
Deaths/1 M/week 3 log(mean) Urban (%) 1 0.2552129 0.0000000 446.7262 YES
Deaths/1 M/week 3 log(max) Urban (%) 1 0.2421337 0.0000000 427.3247 YES
Deaths/1 M/month 1 log(Total) Urban (%) 1 0.2344023 0.0000013 373.2958 YES
Deaths/1 M/month 1 log(median) Urban (%) 1 0.2299334 0.0000923 228.1832 YES
Deaths/1 M/month 1 log(mean) Urban (%) 1 0.2344023 0.0000013 373.2958 YES
Deaths/1 M/month 1 log(max) Urban (%) 1 0.2341700 0.0000014 349.5776 YES
Deaths/1 M (Total) HDI 1 0.1405257 0.0000007 1910.6796 YES
Days to 0.1 Death/1 M HDI 1 0.0586622 0.0053167 907.3821 YES
Days to 1 Death/1 M HDI 1 0.0151554 0.2247596 763.1417
Deaths/day/1 M (mean) HDI 1 0.1354480 0.0000113 572.9072 YES
Deaths/day/1 M (median) HDI 1 0.1058122 0.0001183 549.4594 YES
Deaths/day/1 M (max) HDI 1 0.1536850 0.0000026 912.6502 YES
Deaths/1 M/week 3 (Total) HDI 1 0.0856054 0.0014368 916.4944 YES
Deaths/1 M/week 3 (median) HDI 1 0.0954405 0.0007402 412.0146 YES
Deaths/1 M/week 3 (mean) HDI 1 0.0856054 0.0014368 465.0433 YES
Deaths/1 M/week 3 (max) HDI 1 0.0714125 0.0037324 657.1093 YES
Deaths/1 M/month 1 (Total) HDI 1 0.0894234 0.0063512 910.8626 YES
Deaths/1 M/month 1 (median) HDI 1 0.0529740 0.0375058 306.0163 YES
Deaths/1 M/month 1 (mean) HDI 1 0.0894234 0.0063512 353.0662 YES
Deaths/1 M/month 1 (max) HDI 1 0.1047204 0.0030207 560.2606 YES
Deaths/1 M (Total) HDI 1 0.5662770 0.0000000 481.6867 YES
Deaths/day/1 M log(mean) HDI 1 0.5297392 0.0000000 473.0943 YES
Deaths/day/1 M log(median) HDI 1 0.3794444 0.0000000 249.8007 YES
Deaths/day/1 M loglog(max) HDI 1 0.4620395 0.0000000 460.3211 YES
Deaths/1 M/week 3 log(Total) HDI 1 0.4300768 0.0000000 361.3481 YES
Deaths/1 M/week 3 log(median) HDI 1 0.4377653 0.0000000 221.6089 YES
Deaths/1 M/week 3 log(mean) HDI 1 0.4300768 0.0000000 361.3481 YES
Deaths/1 M/week 3 log(max) HDI 1 0.3864858 0.0000000 345.4028 YES
Deaths/1 M/month 1 log(Total) HDI 1 0.4693786 0.0000000 308.9053 YES
Deaths/1 M/month 1 log(median) HDI 1 0.4565029 0.0000000 190.3747 YES
Deaths/1 M/month 1 log(mean) HDI 1 0.4693786 0.0000000 308.9053 YES
Deaths/1 M/month 1 log(max) HDI 1 0.4477385 0.0000000 287.5034 YES
Deaths/1 M (Total) >65 yrs 1 0.2141009 0.0000000 1956.8134 YES
Days to 0.1 Death/1 M >65 yrs 1 0.0159982 0.1350306 978.5320
Days to 1 Death/1 M >65 yrs 1 0.0057871 0.4427651 797.3250
Deaths/day/1 M (mean) >65 yrs 1 0.2165571 0.0000000 530.5210 YES
Deaths/day/1 M (median) >65 yrs 1 0.1765938 0.0000001 517.0416 YES
Deaths/day/1 M (max) >65 yrs 1 0.2025607 0.0000000 898.5790 YES
Deaths/1 M/week 3 (Total) >65 yrs 1 0.2131513 0.0000001 822.4299 YES
Deaths/1 M/week 3 (median) >65 yrs 1 0.2378441 0.0000000 290.8471 YES
Deaths/1 M/week 3 (mean) >65 yrs 1 0.2131513 0.0000001 335.9524 YES
Deaths/1 M/week 3 (max) >65 yrs 1 0.1724767 0.0000015 530.3502 YES
Deaths/1 M/month 1 (Total) >65 yrs 1 0.1721879 0.0000583 872.8241 YES
Deaths/1 M/month 1 (median) >65 yrs 1 0.1780683 0.0000422 167.8466 YES
Deaths/1 M/month 1 (mean) >65 yrs 1 0.1721879 0.0000583 274.2133 YES
Deaths/1 M/month 1 (max) >65 yrs 1 0.1422840 0.0002915 527.0995 YES
Deaths/1 M (Total) >65 yrs 1 0.5129491 0.0000000 534.5202 YES
Deaths/day/1 M log(mean) >65 yrs 1 0.4780123 0.0000000 520.3650 YES
Deaths/day/1 M log(median) >65 yrs 1 0.2789231 0.0000016 274.8591 YES
Deaths/day/1 M loglog(max) >65 yrs 1 0.4124758 0.0000000 499.2423 YES
Deaths/1 M/week 3 log(Total) >65 yrs 1 0.3513346 0.0000000 403.3858 YES
Deaths/1 M/week 3 log(median) >65 yrs 1 0.3861803 0.0000000 245.6643 YES
Deaths/1 M/week 3 log(mean) >65 yrs 1 0.3513346 0.0000000 403.3858 YES
Deaths/1 M/week 3 log(max) >65 yrs 1 0.3103516 0.0000000 381.3821 YES
Deaths/1 M/month 1 log(Total) >65 yrs 1 0.3315835 0.0000000 344.1489 YES
Deaths/1 M/month 1 log(median) >65 yrs 1 0.3707648 0.0000002 206.9585 YES
Deaths/1 M/month 1 log(mean) >65 yrs 1 0.3315835 0.0000000 344.1489 YES
Deaths/1 M/month 1 log(max) >65 yrs 1 0.3212595 0.0000000 318.6506 YES

Linear Models (with FILTERED data)

model_results <- data.frame()

for(i in 1:length(confounding_varibales)){
  for(j in 1:length(dependent_variables)){
    linear_model <- lm(df_filtered[,dependent_variables[j]]~df_filtered[,confounding_varibales[i]])
    new_row <- data.frame(dependent_variable = dependent_variables_labels$V2[j],
                          independent_variable = confounding_varibales_labels$V2[i],
                          df = glance(linear_model)$df-1,
                          r_squared = summary(linear_model)$r.squared,
                          p_value = glance(linear_model)$p.value,
                          AIC = glance(linear_model)$AIC)
    model_results <- rbind(model_results, new_row)
    }
}

model_results$significant <- ifelse(model_results$p_value < 0.05, "YES", "")
dependent_variable independent_variable df r_squared p_value AIC significant
Deaths/1 M (Total) Pop Dens 1 0.2234335 0.0227421 289.97743 YES
Days to 0.1 Death/1 M Pop Dens 1 0.0077975 0.6886736 144.63486
Days to 1 Death/1 M Pop Dens 1 0.0044023 0.7635746 167.64872
Deaths/day/1 M (mean) Pop Dens 1 0.2174525 0.0249032 105.67987 YES
Deaths/day/1 M (median) Pop Dens 1 0.1948731 0.0349675 107.87064 YES
Deaths/day/1 M (max) Pop Dens 1 0.0879740 0.1693494 157.38489
Deaths/1 M/week 3 (Total) Pop Dens 1 0.0352501 0.4027611 165.62417
Deaths/1 M/week 3 (median) Pop Dens 1 0.0525821 0.3046428 73.38761
Deaths/1 M/week 3 (mean) Pop Dens 1 0.0352501 0.4027611 80.00412
Deaths/1 M/week 3 (max) Pop Dens 1 0.0206925 0.5230424 107.09338
Deaths/1 M/month 1 (Total) Pop Dens 1 0.0677091 0.2678673 214.61378
Deaths/1 M/month 1 (median) Pop Dens 1 0.0553493 0.3180395 52.22690
Deaths/1 M/month 1 (mean) Pop Dens 1 0.0677091 0.2678673 78.56588
Deaths/1 M/month 1 (max) Pop Dens 1 0.1353197 0.1105504 125.94849
Deaths/1 M (Total) Pop Dens 1 0.2679180 0.0114176 85.76845 YES
Deaths/day/1 M log(mean) Pop Dens 1 0.2395510 0.0177705 82.13698 YES
Deaths/day/1 M log(median) Pop Dens 1 0.2693613 0.0159156 73.78349 YES
Deaths/day/1 M loglog(max) Pop Dens 1 0.1173600 0.1095580 82.66348
Deaths/1 M/week 3 log(Total) Pop Dens 1 0.0829842 0.1935794 86.44088
Deaths/1 M/week 3 log(median) Pop Dens 1 0.0301752 0.4769506 76.21532
Deaths/1 M/week 3 log(mean) Pop Dens 1 0.0829842 0.1935794 86.44088
Deaths/1 M/week 3 log(max) Pop Dens 1 0.0494529 0.3198832 81.72920
Deaths/1 M/month 1 log(Total) Pop Dens 1 0.1576447 0.0830269 75.43058
Deaths/1 M/month 1 log(median) Pop Dens 1 0.0969490 0.2237801 64.36987
Deaths/1 M/month 1 log(mean) Pop Dens 1 0.1576447 0.0830269 75.43058
Deaths/1 M/month 1 log(max) Pop Dens 1 0.1923848 0.0530406 68.06262
Deaths/1 M (Total) Urban (%) 1 0.0210892 0.5085246 295.30327
Days to 0.1 Death/1 M Urban (%) 1 0.0187160 0.5336460 144.38036
Days to 1 Death/1 M Urban (%) 1 0.0208280 0.5111901 167.26609
Deaths/day/1 M (mean) Urban (%) 1 0.0291560 0.4359951 110.63893
Deaths/day/1 M (median) Urban (%) 1 0.0005150 0.9181378 112.84417
Deaths/day/1 M (max) Urban (%) 1 0.1078515 0.1260287 156.87806
Deaths/1 M/week 3 (Total) Urban (%) 1 0.0039207 0.7819172 166.32724
Deaths/1 M/week 3 (median) Urban (%) 1 0.0107779 0.6456844 74.33754
Deaths/1 M/week 3 (mean) Urban (%) 1 0.0039207 0.7819172 80.70719
Deaths/1 M/week 3 (max) Urban (%) 1 0.0011815 0.8793002 107.52738
Deaths/1 M/month 1 (Total) Urban (%) 1 0.0128226 0.6345460 215.75787
Deaths/1 M/month 1 (median) Urban (%) 1 0.0015975 0.8671323 53.33372
Deaths/1 M/month 1 (mean) Urban (%) 1 0.0128226 0.6345460 79.70998
Deaths/1 M/month 1 (max) Urban (%) 1 0.0188331 0.5639718 128.47615
Deaths/1 M (Total) Urban (%) 1 0.0292497 0.4352474 92.25852
Deaths/day/1 M log(mean) Urban (%) 1 0.0220120 0.4992911 87.92351
Deaths/day/1 M log(median) Urban (%) 1 0.0119435 0.6372384 80.12173
Deaths/day/1 M loglog(max) Urban (%) 1 0.0594129 0.2623762 84.12598
Deaths/1 M/week 3 log(Total) Urban (%) 1 0.0000960 0.9654785 88.34464
Deaths/1 M/week 3 log(median) Urban (%) 1 0.0381293 0.4230607 76.05885
Deaths/1 M/week 3 log(mean) Urban (%) 1 0.0000960 0.9654785 88.34464
Deaths/1 M/week 3 log(max) Urban (%) 1 0.0000564 0.9735288 82.84374
Deaths/1 M/month 1 log(Total) Urban (%) 1 0.0064736 0.7359661 78.73175
Deaths/1 M/month 1 log(median) Urban (%) 1 0.0552392 0.3638491 65.13747
Deaths/1 M/month 1 log(mean) Urban (%) 1 0.0064736 0.7359661 78.73175
Deaths/1 M/month 1 log(max) Urban (%) 1 0.0138611 0.6210655 72.05685
Deaths/1 M (Total) HDI 1 0.0355103 0.3891885 294.96192
Days to 0.1 Death/1 M HDI 1 0.0123456 0.6137551 144.52919
Days to 1 Death/1 M HDI 1 0.0209127 0.5103232 167.26410
Deaths/day/1 M (mean) HDI 1 0.0519757 0.2954470 110.09186
Deaths/day/1 M (median) HDI 1 0.0199101 0.5207464 112.39346
Deaths/day/1 M (max) HDI 1 0.1100131 0.1220730 156.82227
Deaths/1 M/week 3 (Total) HDI 1 0.0260200 0.4732807 165.83365
Deaths/1 M/week 3 (median) HDI 1 0.0593675 0.2745237 73.22948
Deaths/1 M/week 3 (mean) HDI 1 0.0260200 0.4732807 80.21360
Deaths/1 M/week 3 (max) HDI 1 0.0164286 0.5697286 107.18896
Deaths/1 M/month 1 (Total) HDI 1 0.0356434 0.4253593 215.29010
Deaths/1 M/month 1 (median) HDI 1 0.0301139 0.4643671 52.75416
Deaths/1 M/month 1 (mean) HDI 1 0.0356434 0.4253593 79.24221
Deaths/1 M/month 1 (max) HDI 1 0.0556718 0.3165927 127.71077
Deaths/1 M (Total) HDI 1 0.1490655 0.0688101 89.22863
Deaths/day/1 M log(mean) HDI 1 0.1538929 0.0641028 84.59193
Deaths/day/1 M log(median) HDI 1 0.1492920 0.0836058 76.97864
Deaths/day/1 M loglog(max) HDI 1 0.2225340 0.0230553 79.74530 YES
Deaths/1 M/week 3 log(Total) HDI 1 0.0777593 0.2088619 86.56588
Deaths/1 M/week 3 log(median) HDI 1 0.1387693 0.1162568 73.95902
Deaths/1 M/week 3 log(mean) HDI 1 0.0777593 0.2088619 86.56588
Deaths/1 M/week 3 log(max) HDI 1 0.0788529 0.2055565 81.03800
Deaths/1 M/month 1 log(Total) HDI 1 0.1289717 0.1199333 76.10003
Deaths/1 M/month 1 log(median) HDI 1 0.1847851 0.0850376 62.63031
Deaths/1 M/month 1 log(mean) HDI 1 0.1289717 0.1199333 76.10003
Deaths/1 M/month 1 log(max) HDI 1 0.1682877 0.0724144 68.65063
Deaths/1 M (Total) >65 yrs 1 0.0419849 0.3483063 294.80700
Days to 0.1 Death/1 M >65 yrs 1 0.0993130 0.1430033 142.40917
Days to 1 Death/1 M >65 yrs 1 0.2745283 0.0102821 160.36873 YES
Deaths/day/1 M (mean) >65 yrs 1 0.0390157 0.3663080 110.40415
Deaths/day/1 M (median) >65 yrs 1 0.0747764 0.2067582 111.06846
Deaths/day/1 M (max) >65 yrs 1 0.0211304 0.5081068 159.01168
Deaths/1 M/week 3 (Total) >65 yrs 1 0.0652192 0.2513538 164.92991
Deaths/1 M/week 3 (median) >65 yrs 1 0.0955818 0.1615026 72.36574
Deaths/1 M/week 3 (mean) >65 yrs 1 0.0652192 0.2513538 79.30987
Deaths/1 M/week 3 (max) >65 yrs 1 0.0544502 0.2959691 106.32164
Deaths/1 M/month 1 (Total) >65 yrs 1 0.0403471 0.3957908 215.19231
Deaths/1 M/month 1 (median) >65 yrs 1 0.0505340 0.3406577 52.32858
Deaths/1 M/month 1 (mean) >65 yrs 1 0.0403471 0.3957908 79.14442
Deaths/1 M/month 1 (max) >65 yrs 1 0.0369466 0.4168637 128.10347
Deaths/1 M (Total) >65 yrs 1 0.0895061 0.1655063 90.78463
Deaths/day/1 M log(mean) >65 yrs 1 0.1106745 0.1208885 85.73773
Deaths/day/1 M log(median) >65 yrs 1 0.1346590 0.1017734 77.33679
Deaths/day/1 M loglog(max) >65 yrs 1 0.0942064 0.1542857 83.25905
Deaths/1 M/week 3 log(Total) >65 yrs 1 0.2111992 0.0314163 83.12744 YES
Deaths/1 M/week 3 log(median) >65 yrs 1 0.1951387 0.0582856 72.67286
Deaths/1 M/week 3 log(mean) >65 yrs 1 0.2111992 0.0314163 83.12744 YES
Deaths/1 M/week 3 log(max) >65 yrs 1 0.1997742 0.0370244 77.94203 YES
Deaths/1 M/month 1 log(Total) >65 yrs 1 0.1587214 0.0818872 75.40500
Deaths/1 M/month 1 log(median) >65 yrs 1 0.2825526 0.0280949 60.45852 YES
Deaths/1 M/month 1 log(mean) >65 yrs 1 0.1587214 0.0818872 75.40500
Deaths/1 M/month 1 log(max) >65 yrs 1 0.1061196 0.1610295 70.09234

—————-