Note: Data for covid-19 last updated 5/23/2020.

Data Set-up

# Data in use: BCG_covid19_DB_unfiltered_16.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.0100575 0.2525661 1557.91161
Days to 0.1 Death/1 M BCG % (mean) 1 0.0697068 0.0045333 813.35760 YES
Days to 1 Death/1 M BCG % (mean) 1 0.1109799 0.0009710 785.35502 YES
Deaths/day/1 M (mean) BCG % (mean) 1 0.0082428 0.3281958 361.89951
Deaths/day/1 M (median) BCG % (mean) 1 0.0023914 0.5989774 299.80616
Deaths/day/1 M (max) BCG % (mean) 1 0.0257301 0.0827120 761.76574
Deaths/1 M/week 3 (Total) BCG % (mean) 1 0.0214707 0.1197871 646.39704
Deaths/1 M/week 3 (median) BCG % (mean) 1 0.0248978 0.0936020 177.07824
Deaths/1 M/week 3 (mean) BCG % (mean) 1 0.0214707 0.1197871 202.72953
Deaths/1 M/week 3 (max) BCG % (mean) 1 0.0141349 0.2077102 379.04618
Deaths/1 M/month 1 (Total) BCG % (mean) 1 0.0032450 0.5544449 942.61856
Deaths/1 M/month 1 (median) BCG % (mean) 1 0.0262620 0.0907533 74.65498
Deaths/1 M/month 1 (mean) BCG % (mean) 1 0.0032450 0.5544449 194.35514
Deaths/1 M/month 1 (max) BCG % (mean) 1 0.0007187 0.7810019 485.92748
Deaths/1 M (Total) BCG % (mean) 1 0.0828828 0.0015710 501.84205 YES
Deaths/day/1 M log(mean) BCG % (mean) 1 0.0569798 0.0092376 483.82121 YES
Deaths/day/1 M log(median) BCG % (mean) 1 0.0819017 0.0294174 220.02204 YES
Deaths/day/1 M loglog(max) BCG % (mean) 1 0.0911369 0.0008927 438.80420 YES
Deaths/1 M/week 3 log(Total) BCG % (mean) 1 0.0968932 0.0023889 363.58632 YES
Deaths/1 M/week 3 log(median) BCG % (mean) 1 0.1129982 0.0121006 207.19470 YES
Deaths/1 M/week 3 log(mean) BCG % (mean) 1 0.0968932 0.0023889 363.58632 YES
Deaths/1 M/week 3 log(max) BCG % (mean) 1 0.0855129 0.0044500 340.02918 YES
Deaths/1 M/month 1 log(Total) BCG % (mean) 1 0.0779126 0.0031469 449.15418 YES
Deaths/1 M/month 1 log(median) BCG % (mean) 1 0.1369328 0.0069309 186.25396 YES
Deaths/1 M/month 1 log(mean) BCG % (mean) 1 0.0779126 0.0031469 449.15418 YES
Deaths/1 M/month 1 log(max) BCG % (mean) 1 0.0755714 0.0036552 405.42266 YES
Deaths/1 M (Total) BCG % (median) 1 0.0078893 0.3111653 1558.20041
Days to 0.1 Death/1 M BCG % (median) 1 0.0770725 0.0027851 812.45141 YES
Days to 1 Death/1 M BCG % (median) 1 0.1100417 0.0010236 785.45522 YES
Deaths/day/1 M (mean) BCG % (median) 1 0.0066096 0.3814714 362.09367
Deaths/day/1 M (median) BCG % (median) 1 0.0013963 0.6878797 299.92380
Deaths/day/1 M (max) BCG % (median) 1 0.0242313 0.0923322 761.94713
Deaths/1 M/week 3 (Total) BCG % (median) 1 0.0185268 0.1487372 646.73949
Deaths/1 M/week 3 (median) BCG % (median) 1 0.0216729 0.1180391 177.45465
Deaths/1 M/week 3 (mean) BCG % (median) 1 0.0185268 0.1487372 203.07198
Deaths/1 M/week 3 (max) BCG % (median) 1 0.0117105 0.2517715 379.32618
Deaths/1 M/month 1 (Total) BCG % (median) 1 0.0023746 0.6131759 942.71458
Deaths/1 M/month 1 (median) BCG % (median) 1 0.0226290 0.1167336 75.06463
Deaths/1 M/month 1 (mean) BCG % (median) 1 0.0023746 0.6131759 194.45116
Deaths/1 M/month 1 (max) BCG % (median) 1 0.0005611 0.8059700 485.94483
Deaths/1 M (Total) BCG % (median) 1 0.0774543 0.0022768 502.53844 YES
Deaths/day/1 M log(mean) BCG % (median) 1 0.0538859 0.0114251 484.20772 YES
Deaths/day/1 M log(median) BCG % (median) 1 0.0778406 0.0339341 220.27803 YES
Deaths/day/1 M loglog(max) BCG % (median) 1 0.0931657 0.0007768 438.54049 YES
Deaths/1 M/week 3 log(Total) BCG % (median) 1 0.0900686 0.0034696 364.28645 YES
Deaths/1 M/week 3 log(median) BCG % (median) 1 0.1116117 0.0126740 207.28061 YES
Deaths/1 M/week 3 log(mean) BCG % (median) 1 0.0900686 0.0034696 364.28645 YES
Deaths/1 M/week 3 log(max) BCG % (median) 1 0.0807154 0.0057825 340.51580 YES
Deaths/1 M/month 1 log(Total) BCG % (median) 1 0.0756980 0.0036257 449.41805 YES
Deaths/1 M/month 1 log(median) BCG % (median) 1 0.1290490 0.0089112 186.72681 YES
Deaths/1 M/month 1 log(mean) BCG % (median) 1 0.0756980 0.0036257 449.41805 YES
Deaths/1 M/month 1 log(max) BCG % (median) 1 0.0771482 0.0033046 405.23487 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 35.291558 2 226 0.2379876 0.0000000 3051.1237 YES
Days to 0.1 Death/1 M BCG Policy 9.550244 2 204 0.0856138 0.0001084 1413.5208 YES
Days to 1 Death/1 M BCG Policy 19.561125 2 182 0.1769259 0.0000000 1467.6526 YES
Deaths/day/1 M (mean) BCG Policy 34.701376 2 207 0.2510928 0.0000000 1018.0879 YES
Deaths/day/1 M (median) BCG Policy 30.848064 2 207 0.2296130 0.0000000 958.9569 YES
Deaths/day/1 M (max) BCG Policy 17.825712 2 207 0.1469244 0.0000001 1737.8075 YES
Deaths/1 M/week 3 (Total) BCG Policy 9.845409 2 203 0.0884222 0.0000830 1996.9980 YES
Deaths/1 M/week 3 (median) BCG Policy 20.342097 2 203 0.1669546 0.0000000 875.3993 YES
Deaths/1 M/week 3 (mean) BCG Policy 9.851171 2 203 0.0884694 0.0000826 1195.2663 YES
Deaths/1 M/week 3 (max) BCG Policy 5.148833 2 203 0.0482784 0.0065881 1656.8274 YES
Deaths/1 M/month 1 (Total) BCG Policy 17.468156 2 198 0.1499823 0.0000001 2333.7491 YES
Deaths/1 M/month 1 (median) BCG Policy 16.791176 2 198 0.1450126 0.0000002 747.9925 YES
Deaths/1 M/month 1 (mean) BCG Policy 17.482112 2 198 0.1500841 0.0000001 966.4304 YES
Deaths/1 M/month 1 (max) BCG Policy 11.112235 2 198 0.1009174 0.0000267 1650.6150 YES
Deaths/1 M (Total) BCG Policy 86.428983 2 207 0.4550595 0.0000000 820.0366 YES
Deaths/day/1 M log(mean) BCG Policy 89.084514 2 207 0.4625736 0.0000000 791.7902 YES
Deaths/day/1 M log(median) BCG Policy 50.525435 2 122 0.4530396 0.0000000 418.9885 YES
Deaths/day/1 M loglog(max) BCG Policy 82.171872 2 207 0.4425650 0.0000000 737.1333 YES
Deaths/1 M/week 3 log(Total) BCG Policy 61.776623 2 175 0.4138399 0.0000000 666.8013 YES
Deaths/1 M/week 3 log(median) BCG Policy 46.164918 2 118 0.4389764 0.0000000 407.6714 YES
Deaths/1 M/week 3 log(mean) BCG Policy 63.528813 2 175 0.4206404 0.0000000 663.8216 YES
Deaths/1 M/week 3 log(max) BCG Policy 55.035018 2 175 0.3861158 0.0000000 635.8427 YES
Deaths/1 M/month 1 log(Total) BCG Policy 80.226849 2 198 0.4476274 0.0000000 765.7283 YES
Deaths/1 M/month 1 log(median) BCG Policy 47.170933 2 113 0.4550064 0.0000000 376.4635 YES
Deaths/1 M/month 1 log(mean) BCG Policy 82.051059 2 198 0.4531929 0.0000000 763.0775 YES
Deaths/1 M/month 1 log(max) BCG Policy 79.479889 2 198 0.4453157 0.0000000 713.2738 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 8.578383 236 0.0000000 YES
t1 Days to 0.1 Death/1 M BCG Yes/No -4.089459 210 0.9999692
t2 Days to 1 Death/1 M BCG Yes/No -5.786119 188 1.0000000
t3 Deaths/day/1 M (mean) BCG Yes/No 8.314781 214 0.0000000 YES
t4 Deaths/day/1 M (median) BCG Yes/No 7.987650 214 0.0000000 YES
t5 Deaths/day/1 M (max) BCG Yes/No 5.673321 214 0.0000000 YES
t6 Deaths/1 M/week 3 (Total) BCG Yes/No 4.444807 210 0.0000071 YES
t7 Deaths/1 M/week 3 (median) BCG Yes/No 6.562097 210 0.0000000 YES
t8 Deaths/1 M/week 3 (mean) BCG Yes/No 4.445990 210 0.0000071 YES
t9 Deaths/1 M/week 3 (max) BCG Yes/No 3.141745 210 0.0009609 YES
t10 Deaths/1 M/month 1 (Total) BCG Yes/No 5.986539 205 0.0000000 YES
t11 Deaths/1 M/month 1 (median) BCG Yes/No 5.967557 205 0.0000000 YES
t12 Deaths/1 M/month 1 (mean) BCG Yes/No 5.988822 205 0.0000000 YES
t13 Deaths/1 M/month 1 (max) BCG Yes/No 4.434142 205 0.0000075 YES
t14 Deaths/1 M (Total) BCG Yes/No 13.084633 214 0.0000000 YES
t15 Deaths/day/1 M log(mean) BCG Yes/No 13.173120 214 0.0000000 YES
t16 Deaths/day/1 M log(median) BCG Yes/No 9.960480 123 0.0000000 YES
t17 Deaths/day/1 M loglog(max) BCG Yes/No 12.144409 214 0.0000000 YES
t18 Deaths/1 M/week 3 log(Total) BCG Yes/No 10.887818 180 0.0000000 YES
t19 Deaths/1 M/week 3 log(median) BCG Yes/No 9.621785 119 0.0000000 YES
t20 Deaths/1 M/week 3 log(mean) BCG Yes/No 11.031037 180 0.0000000 YES
t21 Deaths/1 M/week 3 log(max) BCG Yes/No 10.007811 180 0.0000000 YES
t22 Deaths/1 M/month 1 log(Total) BCG Yes/No 12.250776 205 0.0000000 YES
t23 Deaths/1 M/month 1 log(median) BCG Yes/No 9.755319 114 0.0000000 YES
t24 Deaths/1 M/month 1 log(mean) BCG Yes/No 12.379323 205 0.0000000 YES
t25 Deaths/1 M/month 1 log(max) BCG Yes/No 11.716173 205 0.0000000 YES
t26 Deaths/1 M (Total) BCG Yes/No 2 8.426339 216 0.0000000 YES
t27 Days to 0.1 Death/1 M BCG Yes/No 2 -4.087826 190 0.9999679
t28 Days to 1 Death/1 M BCG Yes/No 2 -5.690978 168 1.0000000
t29 Deaths/day/1 M (mean) BCG Yes/No 2 8.377878 194 0.0000000 YES
t30 Deaths/day/1 M (median) BCG Yes/No 2 8.032317 194 0.0000000 YES
t31 Deaths/day/1 M (max) BCG Yes/No 2 5.773224 194 0.0000000 YES
t32 Deaths/1 M/week 3 (Total) BCG Yes/No 2 4.351605 190 0.0000110 YES
t33 Deaths/1 M/week 3 (median) BCG Yes/No 2 6.410442 190 0.0000000 YES
t34 Deaths/1 M/week 3 (mean) BCG Yes/No 2 4.353014 190 0.0000110 YES
t35 Deaths/1 M/week 3 (max) BCG Yes/No 2 3.138014 190 0.0009861 YES
t36 Deaths/1 M/month 1 (Total) BCG Yes/No 2 5.957096 185 0.0000000 YES
t37 Deaths/1 M/month 1 (median) BCG Yes/No 2 6.208372 185 0.0000000 YES
t38 Deaths/1 M/month 1 (mean) BCG Yes/No 2 5.960000 185 0.0000000 YES
t39 Deaths/1 M/month 1 (max) BCG Yes/No 2 4.500736 185 0.0000060 YES
t40 Deaths/1 M (Total) BCG Yes/No 2 12.167201 194 0.0000000 YES
t41 Deaths/day/1 M log(mean) BCG Yes/No 2 12.412878 194 0.0000000 YES
t42 Deaths/day/1 M log(median) BCG Yes/No 2 9.797458 105 0.0000000 YES
t43 Deaths/day/1 M loglog(max) BCG Yes/No 2 11.635406 194 0.0000000 YES
t44 Deaths/1 M/week 3 log(Total) BCG Yes/No 2 10.535509 160 0.0000000 YES
t45 Deaths/1 M/week 3 log(median) BCG Yes/No 2 9.374008 102 0.0000000 YES
t46 Deaths/1 M/week 3 log(mean) BCG Yes/No 2 10.707597 160 0.0000000 YES
t47 Deaths/1 M/week 3 log(max) BCG Yes/No 2 9.865003 160 0.0000000 YES
t48 Deaths/1 M/month 1 log(Total) BCG Yes/No 2 11.524027 185 0.0000000 YES
t49 Deaths/1 M/month 1 log(median) BCG Yes/No 2 8.913883 98 0.0000000 YES
t50 Deaths/1 M/month 1 log(mean) BCG Yes/No 2 11.669882 185 0.0000000 YES
t51 Deaths/1 M/month 1 log(max) BCG Yes/No 2 11.261260 185 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.0100575 0.2525661 1557.91161
Days to 0.1 Death/1 M BCG % (mean) 1 0.0697068 0.0045333 813.35760 YES
Days to 1 Death/1 M BCG % (mean) 1 0.1109799 0.0009710 785.35502 YES
Deaths/day/1 M (mean) BCG % (mean) 1 0.0082428 0.3281958 361.89951
Deaths/day/1 M (median) BCG % (mean) 1 0.0023914 0.5989774 299.80616
Deaths/day/1 M (max) BCG % (mean) 1 0.0257301 0.0827120 761.76574
Deaths/1 M/week 3 (Total) BCG % (mean) 1 0.0214707 0.1197871 646.39704
Deaths/1 M/week 3 (median) BCG % (mean) 1 0.0248978 0.0936020 177.07824
Deaths/1 M/week 3 (mean) BCG % (mean) 1 0.0214707 0.1197871 202.72953
Deaths/1 M/week 3 (max) BCG % (mean) 1 0.0141349 0.2077102 379.04618
Deaths/1 M/month 1 (Total) BCG % (mean) 1 0.0032450 0.5544449 942.61856
Deaths/1 M/month 1 (median) BCG % (mean) 1 0.0262620 0.0907533 74.65498
Deaths/1 M/month 1 (mean) BCG % (mean) 1 0.0032450 0.5544449 194.35514
Deaths/1 M/month 1 (max) BCG % (mean) 1 0.0007187 0.7810019 485.92748
Deaths/1 M (Total) BCG % (mean) 1 0.0828828 0.0015710 501.84205 YES
Deaths/day/1 M log(mean) BCG % (mean) 1 0.0569798 0.0092376 483.82121 YES
Deaths/day/1 M log(median) BCG % (mean) 1 0.0819017 0.0294174 220.02204 YES
Deaths/day/1 M loglog(max) BCG % (mean) 1 0.0911369 0.0008927 438.80420 YES
Deaths/1 M/week 3 log(Total) BCG % (mean) 1 0.0968932 0.0023889 363.58632 YES
Deaths/1 M/week 3 log(median) BCG % (mean) 1 0.1129982 0.0121006 207.19470 YES
Deaths/1 M/week 3 log(mean) BCG % (mean) 1 0.0968932 0.0023889 363.58632 YES
Deaths/1 M/week 3 log(max) BCG % (mean) 1 0.0855129 0.0044500 340.02918 YES
Deaths/1 M/month 1 log(Total) BCG % (mean) 1 0.0779126 0.0031469 449.15418 YES
Deaths/1 M/month 1 log(median) BCG % (mean) 1 0.1369328 0.0069309 186.25396 YES
Deaths/1 M/month 1 log(mean) BCG % (mean) 1 0.0779126 0.0031469 449.15418 YES
Deaths/1 M/month 1 log(max) BCG % (mean) 1 0.0755714 0.0036552 405.42266 YES
Deaths/1 M (Total) BCG % (median) 1 0.0078893 0.3111653 1558.20041
Days to 0.1 Death/1 M BCG % (median) 1 0.0770725 0.0027851 812.45141 YES
Days to 1 Death/1 M BCG % (median) 1 0.1100417 0.0010236 785.45522 YES
Deaths/day/1 M (mean) BCG % (median) 1 0.0066096 0.3814714 362.09367
Deaths/day/1 M (median) BCG % (median) 1 0.0013963 0.6878797 299.92380
Deaths/day/1 M (max) BCG % (median) 1 0.0242313 0.0923322 761.94713
Deaths/1 M/week 3 (Total) BCG % (median) 1 0.0185268 0.1487372 646.73949
Deaths/1 M/week 3 (median) BCG % (median) 1 0.0216729 0.1180391 177.45465
Deaths/1 M/week 3 (mean) BCG % (median) 1 0.0185268 0.1487372 203.07198
Deaths/1 M/week 3 (max) BCG % (median) 1 0.0117105 0.2517715 379.32618
Deaths/1 M/month 1 (Total) BCG % (median) 1 0.0023746 0.6131759 942.71458
Deaths/1 M/month 1 (median) BCG % (median) 1 0.0226290 0.1167336 75.06463
Deaths/1 M/month 1 (mean) BCG % (median) 1 0.0023746 0.6131759 194.45116
Deaths/1 M/month 1 (max) BCG % (median) 1 0.0005611 0.8059700 485.94483
Deaths/1 M (Total) BCG % (median) 1 0.0774543 0.0022768 502.53844 YES
Deaths/day/1 M log(mean) BCG % (median) 1 0.0538859 0.0114251 484.20772 YES
Deaths/day/1 M log(median) BCG % (median) 1 0.0778406 0.0339341 220.27803 YES
Deaths/day/1 M loglog(max) BCG % (median) 1 0.0931657 0.0007768 438.54049 YES
Deaths/1 M/week 3 log(Total) BCG % (median) 1 0.0900686 0.0034696 364.28645 YES
Deaths/1 M/week 3 log(median) BCG % (median) 1 0.1116117 0.0126740 207.28061 YES
Deaths/1 M/week 3 log(mean) BCG % (median) 1 0.0900686 0.0034696 364.28645 YES
Deaths/1 M/week 3 log(max) BCG % (median) 1 0.0807154 0.0057825 340.51580 YES
Deaths/1 M/month 1 log(Total) BCG % (median) 1 0.0756980 0.0036257 449.41805 YES
Deaths/1 M/month 1 log(median) BCG % (median) 1 0.1290490 0.0089112 186.72681 YES
Deaths/1 M/month 1 log(mean) BCG % (median) 1 0.0756980 0.0036257 449.41805 YES
Deaths/1 M/month 1 log(max) BCG % (median) 1 0.0771482 0.0033046 405.23487 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 75.310156 2 171 0.4683172 0.0000000 2144.6544 YES
Days to 0.1 Death/1 M BCG Policy 1.137734 2 150 0.0149431 0.3232947 1092.5784
Days to 1 Death/1 M BCG Policy 2.995661 2 128 0.0447143 0.0535218 1081.2977
Deaths/day/1 M (mean) BCG Policy 62.121331 2 153 0.4481369 0.0000000 583.9640 YES
Deaths/day/1 M (median) BCG Policy 39.570068 2 153 0.3409154 0.0000000 523.4866 YES
Deaths/day/1 M (max) BCG Policy 24.543986 2 153 0.2429040 0.0000000 1278.2667 YES
Deaths/1 M/week 3 (Total) BCG Policy 20.616725 2 149 0.2167518 0.0000000 1465.2870 YES
Deaths/1 M/week 3 (median) BCG Policy 24.846593 2 149 0.2501001 0.0000000 475.9714 YES
Deaths/1 M/week 3 (mean) BCG Policy 20.616725 2 149 0.2167518 0.0000000 873.7303 YES
Deaths/1 M/week 3 (max) BCG Policy 16.080004 2 149 0.1775227 0.0000005 1237.8784 YES
Deaths/1 M/month 1 (Total) BCG Policy 27.112720 2 144 0.2735544 0.0000000 1662.8180 YES
Deaths/1 M/month 1 (median) BCG Policy 14.753138 2 144 0.1700588 0.0000015 446.9163 YES
Deaths/1 M/month 1 (mean) BCG Policy 27.112720 2 144 0.2735544 0.0000000 662.8660 YES
Deaths/1 M/month 1 (max) BCG Policy 21.670543 2 144 0.2313485 0.0000000 1201.9020 YES
Deaths/1 M (Total) BCG Policy 31.851392 2 153 0.2939638 0.0000000 636.9269 YES
Deaths/day/1 M log(mean) BCG Policy 30.423977 2 153 0.2845384 0.0000000 615.2620 YES
Deaths/day/1 M log(median) BCG Policy 22.551962 2 76 0.3724398 0.0000000 277.4063 YES
Deaths/day/1 M loglog(max) BCG Policy 25.888359 2 153 0.2528448 0.0000000 575.6096 YES
Deaths/1 M/week 3 log(Total) BCG Policy 22.500223 2 125 0.2647078 0.0000000 500.8128 YES
Deaths/1 M/week 3 log(median) BCG Policy 15.785794 2 74 0.2990538 0.0000020 279.2334 YES
Deaths/1 M/week 3 log(mean) BCG Policy 22.500223 2 125 0.2647078 0.0000000 500.8128 YES
Deaths/1 M/week 3 log(max) BCG Policy 17.619132 2 125 0.2199117 0.0000002 483.2901 YES
Deaths/1 M/month 1 log(Total) BCG Policy 28.225306 2 144 0.2816186 0.0000000 588.5559 YES
Deaths/1 M/month 1 log(median) BCG Policy 19.162672 2 69 0.3570950 0.0000002 248.4873 YES
Deaths/1 M/month 1 log(mean) BCG Policy 28.225306 2 144 0.2816186 0.0000000 588.5559 YES
Deaths/1 M/month 1 log(max) BCG Policy 26.138935 2 144 0.2663462 0.0000000 548.0434 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 9.6720593 181 0.0000000 YES
t1 Days to 0.1 Death/1 M BCG Yes/No -1.4295380 156 0.9225754
t2 Days to 1 Death/1 M BCG Yes/No -2.2827530 134 0.9879902
t3 Deaths/day/1 M (mean) BCG Yes/No 9.0001476 160 0.0000000 YES
t4 Deaths/day/1 M (median) BCG Yes/No 8.8552878 160 0.0000000 YES
t5 Deaths/day/1 M (max) BCG Yes/No 4.5495121 160 0.0000053 YES
t6 Deaths/1 M/week 3 (Total) BCG Yes/No 4.2907672 156 0.0000156 YES
t7 Deaths/1 M/week 3 (median) BCG Yes/No 7.2638501 156 0.0000000 YES
t8 Deaths/1 M/week 3 (mean) BCG Yes/No 4.2907672 156 0.0000156 YES
t9 Deaths/1 M/week 3 (max) BCG Yes/No 3.3112620 156 0.0005770 YES
t10 Deaths/1 M/month 1 (Total) BCG Yes/No 5.8702666 151 0.0000000 YES
t11 Deaths/1 M/month 1 (median) BCG Yes/No 5.5661085 151 0.0000001 YES
t12 Deaths/1 M/month 1 (mean) BCG Yes/No 5.8702666 151 0.0000000 YES
t13 Deaths/1 M/month 1 (max) BCG Yes/No 4.0017920 151 0.0000491 YES
t14 Deaths/1 M (Total) BCG Yes/No 7.8192201 160 0.0000000 YES
t15 Deaths/day/1 M log(mean) BCG Yes/No 7.6091458 160 0.0000000 YES
t16 Deaths/day/1 M log(median) BCG Yes/No 6.3833960 77 0.0000000 YES
t17 Deaths/day/1 M loglog(max) BCG Yes/No 6.7057254 160 0.0000000 YES
t18 Deaths/1 M/week 3 log(Total) BCG Yes/No 6.5008592 130 0.0000000 YES
t19 Deaths/1 M/week 3 log(median) BCG Yes/No 5.6396734 75 0.0000001 YES
t20 Deaths/1 M/week 3 log(mean) BCG Yes/No 6.5008592 130 0.0000000 YES
t21 Deaths/1 M/week 3 log(max) BCG Yes/No 5.5944071 130 0.0000001 YES
t22 Deaths/1 M/month 1 log(Total) BCG Yes/No 7.1706578 151 0.0000000 YES
t23 Deaths/1 M/month 1 log(median) BCG Yes/No 6.2131104 70 0.0000000 YES
t24 Deaths/1 M/month 1 log(mean) BCG Yes/No 7.1706578 151 0.0000000 YES
t25 Deaths/1 M/month 1 log(max) BCG Yes/No 6.5587285 151 0.0000000 YES
t26 Deaths/1 M (Total) BCG Yes/No 2 13.6246209 161 0.0000000 YES
t27 Days to 0.1 Death/1 M BCG Yes/No 2 -0.6859582 136 0.7530464
t28 Days to 1 Death/1 M BCG Yes/No 2 -1.0836337 114 0.8595931
t29 Deaths/day/1 M (mean) BCG Yes/No 2 12.5750619 140 0.0000000 YES
t30 Deaths/day/1 M (median) BCG Yes/No 2 11.6038010 140 0.0000000 YES
t31 Deaths/day/1 M (max) BCG Yes/No 2 6.6983521 140 0.0000000 YES
t32 Deaths/1 M/week 3 (Total) BCG Yes/No 2 6.2909928 136 0.0000000 YES
t33 Deaths/1 M/week 3 (median) BCG Yes/No 2 7.6553731 136 0.0000000 YES
t34 Deaths/1 M/week 3 (mean) BCG Yes/No 2 6.2909928 136 0.0000000 YES
t35 Deaths/1 M/week 3 (max) BCG Yes/No 2 5.5169846 136 0.0000001 YES
t36 Deaths/1 M/month 1 (Total) BCG Yes/No 2 7.8073274 131 0.0000000 YES
t37 Deaths/1 M/month 1 (median) BCG Yes/No 2 6.8750676 131 0.0000000 YES
t38 Deaths/1 M/month 1 (mean) BCG Yes/No 2 7.8073274 131 0.0000000 YES
t39 Deaths/1 M/month 1 (max) BCG Yes/No 2 6.3288930 131 0.0000000 YES
t40 Deaths/1 M (Total) BCG Yes/No 2 4.9996548 140 0.0000008 YES
t41 Deaths/day/1 M log(mean) BCG Yes/No 2 4.8344108 140 0.0000017 YES
t42 Deaths/day/1 M log(median) BCG Yes/No 2 4.6874525 59 0.0000084 YES
t43 Deaths/day/1 M loglog(max) BCG Yes/No 2 4.4779637 140 0.0000078 YES
t44 Deaths/1 M/week 3 log(Total) BCG Yes/No 2 4.3161314 110 0.0000174 YES
t45 Deaths/1 M/week 3 log(median) BCG Yes/No 2 2.7451430 58 0.0040196 YES
t46 Deaths/1 M/week 3 log(mean) BCG Yes/No 2 4.3161314 110 0.0000174 YES
t47 Deaths/1 M/week 3 log(max) BCG Yes/No 2 3.8771176 110 0.0000901 YES
t48 Deaths/1 M/month 1 log(Total) BCG Yes/No 2 4.5251840 131 0.0000067 YES
t49 Deaths/1 M/month 1 log(median) BCG Yes/No 2 2.6575081 54 0.0051662 YES
t50 Deaths/1 M/month 1 log(mean) BCG Yes/No 2 4.5251840 131 0.0000067 YES
t51 Deaths/1 M/month 1 log(max) BCG Yes/No 2 4.5233616 131 0.0000067 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.2353432 0.0928875 173.87119
Days to 0.1 Death/1 M BCG % (mean) 1 0.0002690 0.9575894 85.94672
Days to 1 Death/1 M BCG % (mean) 1 0.0000007 0.9977671 93.15374
Deaths/day/1 M (mean) BCG % (mean) 1 0.2820490 0.0618269 58.59584
Deaths/day/1 M (median) BCG % (mean) 1 0.2624751 0.0734482 54.28631
Deaths/day/1 M (max) BCG % (mean) 1 0.1782610 0.1506741 91.38915
Deaths/1 M/week 3 (Total) BCG % (mean) 1 0.0778762 0.3558381 87.07780
Deaths/1 M/week 3 (median) BCG % (mean) 1 0.0966083 0.3013023 38.26445
Deaths/1 M/week 3 (mean) BCG % (mean) 1 0.0778762 0.3558381 36.48414
Deaths/1 M/week 3 (max) BCG % (mean) 1 0.1299020 0.2263708 46.98715
Deaths/1 M/month 1 (Total) BCG % (mean) 1 0.2413049 0.0882472 125.18194
Deaths/1 M/month 1 (median) BCG % (mean) 1 0.0000108 0.9914933 29.51069
Deaths/1 M/month 1 (mean) BCG % (mean) 1 0.2413049 0.0882472 36.75080
Deaths/1 M/month 1 (max) BCG % (mean) 1 0.3774596 0.0254745 70.29746 YES
Deaths/1 M (Total) BCG % (mean) 1 0.0270851 0.5910722 50.49897
Deaths/day/1 M log(mean) BCG % (mean) 1 0.0344729 0.5436489 48.85614
Deaths/day/1 M log(median) BCG % (mean) 1 0.4355032 0.0195320 36.57134 YES
Deaths/day/1 M loglog(max) BCG % (mean) 1 0.0707716 0.3796605 45.25257
Deaths/1 M/week 3 log(Total) BCG % (mean) 1 0.0585076 0.4259286 51.79247
Deaths/1 M/week 3 log(median) BCG % (mean) 1 0.1524995 0.2350580 45.32722
Deaths/1 M/week 3 log(mean) BCG % (mean) 1 0.0585076 0.4259286 51.79247
Deaths/1 M/week 3 log(max) BCG % (mean) 1 0.0895938 0.3204635 46.65160
Deaths/1 M/month 1 log(Total) BCG % (mean) 1 0.0725442 0.3735312 48.18814
Deaths/1 M/month 1 log(median) BCG % (mean) 1 0.0628783 0.4846813 34.29566
Deaths/1 M/month 1 log(mean) BCG % (mean) 1 0.0725442 0.3735312 48.18814
Deaths/1 M/month 1 log(max) BCG % (mean) 1 0.1830745 0.1446985 40.88857
Deaths/1 M (Total) BCG % (median) 1 0.2508993 0.0812290 173.60399
Days to 0.1 Death/1 M BCG % (median) 1 0.0019095 0.8872806 85.92537
Days to 1 Death/1 M BCG % (median) 1 0.0001546 0.9678422 93.15174
Deaths/day/1 M (mean) BCG % (median) 1 0.2961326 0.0545268 58.33829
Deaths/day/1 M (median) BCG % (median) 1 0.2726945 0.0671536 54.10491
Deaths/day/1 M (max) BCG % (median) 1 0.1954382 0.1303914 91.11453
Deaths/1 M/week 3 (Total) BCG % (median) 1 0.0784003 0.3541563 87.07041
Deaths/1 M/week 3 (median) BCG % (median) 1 0.0981120 0.2973710 38.24280
Deaths/1 M/week 3 (mean) BCG % (median) 1 0.0784003 0.3541563 36.47674
Deaths/1 M/week 3 (max) BCG % (median) 1 0.1291221 0.2278724 46.99879
Deaths/1 M/month 1 (Total) BCG % (median) 1 0.2412295 0.0883046 125.18323
Deaths/1 M/month 1 (median) BCG % (median) 1 0.0000443 0.9827768 29.51026
Deaths/1 M/month 1 (mean) BCG % (median) 1 0.2412295 0.0883046 36.75210
Deaths/1 M/month 1 (max) BCG % (median) 1 0.3752214 0.0260383 70.34411 YES
Deaths/1 M (Total) BCG % (median) 1 0.0333967 0.5501185 50.41436
Deaths/day/1 M log(mean) BCG % (median) 1 0.0411450 0.5062876 48.76599
Deaths/day/1 M log(median) BCG % (median) 1 0.4550100 0.0161222 36.14933 YES
Deaths/day/1 M loglog(max) BCG % (median) 1 0.0806055 0.3471881 45.11426
Deaths/1 M/week 3 log(Total) BCG % (median) 1 0.0525224 0.4513514 51.87485
Deaths/1 M/week 3 log(median) BCG % (median) 1 0.1377221 0.2611631 45.51737
Deaths/1 M/week 3 log(mean) BCG % (median) 1 0.0525224 0.4513514 51.87485
Deaths/1 M/week 3 log(max) BCG % (median) 1 0.0805917 0.3472311 46.77951
Deaths/1 M/month 1 log(Total) BCG % (median) 1 0.0683899 0.3881031 48.24624
Deaths/1 M/month 1 log(median) BCG % (median) 1 0.0662416 0.4728291 34.25970
Deaths/1 M/month 1 log(mean) BCG % (median) 1 0.0683899 0.3881031 48.24624
Deaths/1 M/month 1 log(max) BCG % (median) 1 0.1787759 0.1500235 40.95680

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 5.6924285 2 20 0.3627500 0.0110433 305.30309 YES
Days to 0.1 Death/1 M BCG Policy 0.6885200 2 20 0.0644168 0.5138357 145.06209
Days to 1 Death/1 M BCG Policy 0.1505715 2 20 0.0148338 0.8611822 168.91091
Deaths/day/1 M (mean) BCG Policy 5.2073382 2 20 0.3424227 0.0151171 102.18718 YES
Deaths/day/1 M (median) BCG Policy 6.6144859 2 20 0.3981156 0.0062392 93.39816 YES
Deaths/day/1 M (max) BCG Policy 4.3263005 2 20 0.3019831 0.0274574 152.91915 YES
Deaths/1 M/week 3 (Total) BCG Policy 1.7184796 2 20 0.1466470 0.2047799 171.72751
Deaths/1 M/week 3 (median) BCG Policy 2.4802982 2 20 0.1987371 0.1090813 75.10446
Deaths/1 M/week 3 (mean) BCG Policy 1.7184796 2 20 0.1466470 0.2047799 82.21565
Deaths/1 M/week 3 (max) BCG Policy 0.9971117 2 20 0.0906703 0.3865571 110.98744
Deaths/1 M/month 1 (Total) BCG Policy 1.7950091 2 20 0.1521838 0.1918745 244.10306
Deaths/1 M/month 1 (median) BCG Policy 1.9468584 2 20 0.1629599 0.1688351 56.51448
Deaths/1 M/month 1 (mean) BCG Policy 1.7950091 2 20 0.1521838 0.1918745 87.64798
Deaths/1 M/month 1 (max) BCG Policy 1.9314023 2 20 0.1618756 0.1710350 143.17506
Deaths/1 M (Total) BCG Policy 5.3244083 2 20 0.3474463 0.0140011 82.61545 YES
Deaths/day/1 M log(mean) BCG Policy 4.7773193 2 20 0.3232873 0.0201393 80.86948 YES
Deaths/day/1 M log(median) BCG Policy 5.9366651 2 18 0.3974559 0.0104689 70.31754 YES
Deaths/day/1 M loglog(max) BCG Policy 5.0265215 2 20 0.3345100 0.0170379 73.27426 YES
Deaths/1 M/week 3 log(Total) BCG Policy 0.6793881 2 20 0.0636168 0.5182464 91.84391
Deaths/1 M/week 3 log(median) BCG Policy 1.3854314 2 16 0.1476151 0.2786673 75.73075
Deaths/1 M/week 3 log(mean) BCG Policy 0.6793881 2 20 0.0636168 0.5182464 91.84391
Deaths/1 M/week 3 log(max) BCG Policy 0.4226547 2 20 0.0405515 0.6610229 87.07605
Deaths/1 M/month 1 log(Total) BCG Policy 1.4282063 2 20 0.1249720 0.2631596 87.26353
Deaths/1 M/month 1 log(median) BCG Policy 3.7725406 2 15 0.3346664 0.0470756 62.74446 YES
Deaths/1 M/month 1 log(mean) BCG Policy 1.4282063 2 20 0.1249720 0.2631596 87.26353
Deaths/1 M/month 1 log(max) BCG Policy 1.8847822 2 20 0.1585879 0.1778639 78.22170

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.8671204 21 0.0046129 YES
t1 Days to 0.1 Death/1 M BCG Yes/No 0.8530290 21 0.2016341
t2 Days to 1 Death/1 M BCG Yes/No 0.1965676 21 0.4230279
t3 Deaths/day/1 M (mean) BCG Yes/No 2.9232477 21 0.0040625 YES
t4 Deaths/day/1 M (median) BCG Yes/No 2.9212037 21 0.0040814 YES
t5 Deaths/day/1 M (max) BCG Yes/No 2.9432473 21 0.0038820 YES
t6 Deaths/1 M/week 3 (Total) BCG Yes/No 1.8499652 21 0.0392208 YES
t7 Deaths/1 M/week 3 (median) BCG Yes/No 2.2603642 21 0.0172725 YES
t8 Deaths/1 M/week 3 (mean) BCG Yes/No 1.8499652 21 0.0392208 YES
t9 Deaths/1 M/week 3 (max) BCG Yes/No 1.3623322 21 0.0937636
t10 Deaths/1 M/month 1 (Total) BCG Yes/No 1.9403120 21 0.0329438 YES
t11 Deaths/1 M/month 1 (median) BCG Yes/No 1.8172900 21 0.0417358 YES
t12 Deaths/1 M/month 1 (mean) BCG Yes/No 1.9403120 21 0.0329438 YES
t13 Deaths/1 M/month 1 (max) BCG Yes/No 1.8928796 21 0.0361193 YES
t14 Deaths/1 M (Total) BCG Yes/No 2.8965111 21 0.0043163 YES
t15 Deaths/day/1 M log(mean) BCG Yes/No 2.7933282 21 0.0054457 YES
t16 Deaths/day/1 M log(median) BCG Yes/No 3.1169482 19 0.0028382 YES
t17 Deaths/day/1 M loglog(max) BCG Yes/No 3.0750525 21 0.0028718 YES
t18 Deaths/1 M/week 3 log(Total) BCG Yes/No 1.1868313 21 0.1242737
t19 Deaths/1 M/week 3 log(median) BCG Yes/No 1.6151611 17 0.0623407
t20 Deaths/1 M/week 3 log(mean) BCG Yes/No 1.1868313 21 0.1242737
t21 Deaths/1 M/week 3 log(max) BCG Yes/No 0.9119274 21 0.1860787
t22 Deaths/1 M/month 1 log(Total) BCG Yes/No 1.6941149 21 0.0525123
t23 Deaths/1 M/month 1 log(median) BCG Yes/No 2.1208456 16 0.0249550 YES
t24 Deaths/1 M/month 1 log(mean) BCG Yes/No 1.6941149 21 0.0525123
t25 Deaths/1 M/month 1 log(max) BCG Yes/No 1.8285492 21 0.0408538 YES
t26 Deaths/1 M (Total) BCG Yes/No 2 7.8482143 8 0.0000251 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.5746378 8 0.2906656
t29 Deaths/day/1 M (mean) BCG Yes/No 2 8.5677874 8 0.0000133 YES
t30 Deaths/day/1 M (median) BCG Yes/No 2 12.1221109 8 0.0000010 YES
t31 Deaths/day/1 M (max) BCG Yes/No 2 5.6882904 8 0.0002303 YES
t32 Deaths/1 M/week 3 (Total) BCG Yes/No 2 1.5260112 8 0.0827602
t33 Deaths/1 M/week 3 (median) BCG Yes/No 2 1.8424168 8 0.0513321
t34 Deaths/1 M/week 3 (mean) BCG Yes/No 2 1.5260112 8 0.0827602
t35 Deaths/1 M/week 3 (max) BCG Yes/No 2 0.7726660 8 0.2309676
t36 Deaths/1 M/month 1 (Total) BCG Yes/No 2 2.2145092 8 0.0288370 YES
t37 Deaths/1 M/month 1 (median) BCG Yes/No 2 0.8160790 8 0.2190385
t38 Deaths/1 M/month 1 (mean) BCG Yes/No 2 2.2145092 8 0.0288370 YES
t39 Deaths/1 M/month 1 (max) BCG Yes/No 2 2.4929544 8 0.0186749 YES
t40 Deaths/1 M (Total) BCG Yes/No 2 6.8048878 8 0.0000686 YES
t41 Deaths/day/1 M log(mean) BCG Yes/No 2 6.1573308 8 0.0001359 YES
t42 Deaths/day/1 M log(median) BCG Yes/No 2 5.6183467 7 0.0004002 YES
t43 Deaths/day/1 M loglog(max) BCG Yes/No 2 3.7005387 8 0.0030190 YES
t44 Deaths/1 M/week 3 log(Total) BCG Yes/No 2 0.7257480 8 0.2443389
t45 Deaths/1 M/week 3 log(median) BCG Yes/No 2 0.6077113 6 0.2828274
t46 Deaths/1 M/week 3 log(mean) BCG Yes/No 2 0.7257480 8 0.2443389
t47 Deaths/1 M/week 3 log(max) BCG Yes/No 2 0.3599300 8 0.3641082
t48 Deaths/1 M/month 1 log(Total) BCG Yes/No 2 1.7408722 8 0.0599427
t49 Deaths/1 M/month 1 log(median) BCG Yes/No 2 0.0730599 6 0.4720666
t50 Deaths/1 M/month 1 log(mean) BCG Yes/No 2 1.7408722 8 0.0599427
t51 Deaths/1 M/month 1 log(max) BCG Yes/No 2 2.0092334 8 0.0396862 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.0015626 0.5499921 3136.1817
Days to 0.1 Death/1 M Pop Dens 1 0.0014686 0.5835394 1364.4890
Days to 1 Death/1 M Pop Dens 1 0.0056609 0.3047965 1508.9396
Deaths/day/1 M (mean) Pop Dens 1 0.0022693 0.4912991 1080.1614
Deaths/day/1 M (median) Pop Dens 1 0.0001086 0.8803698 1015.6938
Deaths/day/1 M (max) Pop Dens 1 0.0385966 0.0041731 1769.4961 YES
Deaths/1 M/week 3 (Total) Pop Dens 1 0.0119940 0.1144446 2037.8554
Deaths/1 M/week 3 (median) Pop Dens 1 0.0000743 0.9014046 921.6182
Deaths/1 M/week 3 (mean) Pop Dens 1 0.0119926 0.1144665 1224.4592
Deaths/1 M/week 3 (max) Pop Dens 1 0.0598486 0.0003571 1673.3058 YES
Deaths/1 M/month 1 (Total) Pop Dens 1 0.0066389 0.2466448 2395.1370
Deaths/1 M/month 1 (median) Pop Dens 1 0.0000018 0.9849843 786.3645
Deaths/1 M/month 1 (mean) Pop Dens 1 0.0066371 0.2467086 1007.4353
Deaths/1 M/month 1 (max) Pop Dens 1 0.0499107 0.0013183 1683.6438 YES
Deaths/1 M (Total) Pop Dens 1 0.0028610 0.4395827 941.9856
Deaths/day/1 M log(mean) Pop Dens 1 0.0033667 0.4017288 919.9606
Deaths/day/1 M log(median) Pop Dens 1 0.0122279 0.2195715 490.8730
Deaths/day/1 M loglog(max) Pop Dens 1 0.0129545 0.0991806 858.1680
Deaths/1 M/week 3 log(Total) Pop Dens 1 0.0123495 0.1375008 756.2934
Deaths/1 M/week 3 log(median) Pop Dens 1 0.0100677 0.2735047 474.3841
Deaths/1 M/week 3 log(mean) Pop Dens 1 0.0123148 0.1380584 755.3188
Deaths/1 M/week 3 log(max) Pop Dens 1 0.0272380 0.0268278 717.0527 YES
Deaths/1 M/month 1 log(Total) Pop Dens 1 0.0085750 0.1877320 882.0224
Deaths/1 M/month 1 log(median) Pop Dens 1 0.0108051 0.2668111 443.6131
Deaths/1 M/month 1 log(mean) Pop Dens 1 0.0085353 0.1887620 881.3420
Deaths/1 M/month 1 log(max) Pop Dens 1 0.0185014 0.0523995 832.2929
Deaths/1 M (Total) Urban (%) 1 0.1435458 0.0000000 3101.1139 YES
Days to 0.1 Death/1 M Urban (%) 1 0.0801226 0.0000343 1389.4160 YES
Days to 1 Death/1 M Urban (%) 1 0.0756802 0.0001387 1502.9333 YES
Deaths/day/1 M (mean) Urban (%) 1 0.1416456 0.0000000 1053.0725 YES
Deaths/day/1 M (median) Urban (%) 1 0.1200590 0.0000002 992.5756 YES
Deaths/day/1 M (max) Urban (%) 1 0.0952023 0.0000047 1764.1964 YES
Deaths/1 M/week 3 (Total) Urban (%) 1 0.0644215 0.0002162 2017.7806 YES
Deaths/1 M/week 3 (median) Urban (%) 1 0.0712431 0.0000973 902.7307 YES
Deaths/1 M/week 3 (mean) Urban (%) 1 0.0644355 0.0002159 1208.2728 YES
Deaths/1 M/week 3 (max) Urban (%) 1 0.0509735 0.0010419 1668.2341 YES
Deaths/1 M/month 1 (Total) Urban (%) 1 0.0896944 0.0000142 2366.9879 YES
Deaths/1 M/month 1 (median) Urban (%) 1 0.0627204 0.0003136 770.2601 YES
Deaths/1 M/month 1 (mean) Urban (%) 1 0.0897234 0.0000142 986.0819 YES
Deaths/1 M/month 1 (max) Urban (%) 1 0.0688598 0.0001554 1671.7560 YES
Deaths/1 M (Total) Urban (%) 1 0.3004096 0.0000000 879.5372 YES
Deaths/day/1 M log(mean) Urban (%) 1 0.2721874 0.0000000 860.5901 YES
Deaths/day/1 M log(median) Urban (%) 1 0.2191157 0.0000000 461.4949 YES
Deaths/day/1 M loglog(max) Urban (%) 1 0.2543371 0.0000000 804.6305 YES
Deaths/1 M/week 3 log(Total) Urban (%) 1 0.2359741 0.0000000 722.4069 YES
Deaths/1 M/week 3 log(median) Urban (%) 1 0.2020207 0.0000002 448.3021 YES
Deaths/1 M/week 3 log(mean) Urban (%) 1 0.2382830 0.0000000 720.9515 YES
Deaths/1 M/week 3 log(max) Urban (%) 1 0.2032590 0.0000000 689.9442 YES
Deaths/1 M/month 1 log(Total) Urban (%) 1 0.2314930 0.0000000 835.2429 YES
Deaths/1 M/month 1 log(median) Urban (%) 1 0.1785410 0.0000023 422.0592 YES
Deaths/1 M/month 1 log(mean) Urban (%) 1 0.2331996 0.0000000 834.1674 YES
Deaths/1 M/month 1 log(max) Urban (%) 1 0.2038726 0.0000000 790.5829 YES
Deaths/1 M (Total) HDI 1 0.1582823 0.0000000 2931.0132 YES
Days to 0.1 Death/1 M HDI 1 0.1030880 0.0000045 1294.3788 YES
Days to 1 Death/1 M HDI 1 0.2800296 0.0000000 1400.9526 YES
Deaths/day/1 M (mean) HDI 1 0.1578105 0.0000000 980.8538 YES
Deaths/day/1 M (median) HDI 1 0.1425348 0.0000000 941.7487 YES
Deaths/day/1 M (max) HDI 1 0.1848134 0.0000000 1484.5827 YES
Deaths/1 M/week 3 (Total) HDI 1 0.0986929 0.0000073 1671.6507 YES
Deaths/1 M/week 3 (median) HDI 1 0.0987275 0.0000073 855.6164 YES
Deaths/1 M/week 3 (mean) HDI 1 0.0987484 0.0000073 908.8270 YES
Deaths/1 M/week 3 (max) HDI 1 0.0997234 0.0000065 1173.7940 YES
Deaths/1 M/month 1 (Total) HDI 1 0.1110148 0.0000025 2143.2019 YES
Deaths/1 M/month 1 (median) HDI 1 0.0799133 0.0000742 732.1773 YES
Deaths/1 M/month 1 (mean) HDI 1 0.1110850 0.0000025 843.9108 YES
Deaths/1 M/month 1 (max) HDI 1 0.1364666 0.0000001 1349.4479 YES
Deaths/1 M (Total) HDI 1 0.5621381 0.0000000 729.6336 YES
Deaths/day/1 M log(mean) HDI 1 0.5214629 0.0000000 720.8821 YES
Deaths/day/1 M log(median) HDI 1 0.4439661 0.0000000 395.3305 YES
Deaths/day/1 M loglog(max) HDI 1 0.4973115 0.0000000 673.5364 YES
Deaths/1 M/week 3 log(Total) HDI 1 0.4686292 0.0000000 600.6595 YES
Deaths/1 M/week 3 log(median) HDI 1 0.4542382 0.0000000 371.6139 YES
Deaths/1 M/week 3 log(mean) HDI 1 0.4744106 0.0000000 597.8508 YES
Deaths/1 M/week 3 log(max) HDI 1 0.4119289 0.0000000 577.0548 YES
Deaths/1 M/month 1 log(Total) HDI 1 0.5393430 0.0000000 684.2942 YES
Deaths/1 M/month 1 log(median) HDI 1 0.4611461 0.0000000 349.8992 YES
Deaths/1 M/month 1 log(mean) HDI 1 0.5440775 0.0000000 681.6604 YES
Deaths/1 M/month 1 log(max) HDI 1 0.4853272 0.0000000 655.1107 YES
Deaths/1 M (Total) >65 yrs 1 0.1329859 0.0000000 2991.6707 YES
Days to 0.1 Death/1 M >65 yrs 1 0.0462761 0.0020023 1373.1714 YES
Days to 1 Death/1 M >65 yrs 1 0.1517510 0.0000001 1455.3284 YES
Deaths/day/1 M (mean) >65 yrs 1 0.1166931 0.0000004 1013.4279 YES
Deaths/day/1 M (median) >65 yrs 1 0.1101392 0.0000010 958.9121 YES
Deaths/day/1 M (max) >65 yrs 1 0.1229898 0.0000002 1528.3747 YES
Deaths/1 M/week 3 (Total) >65 yrs 1 0.0890077 0.0000146 1690.6765 YES
Deaths/1 M/week 3 (median) >65 yrs 1 0.0850109 0.0000233 852.3407 YES
Deaths/1 M/week 3 (mean) >65 yrs 1 0.0890310 0.0000146 896.7229 YES
Deaths/1 M/week 3 (max) >65 yrs 1 0.0994454 0.0000043 1147.7613 YES
Deaths/1 M/month 1 (Total) >65 yrs 1 0.0978625 0.0000068 2178.6439 YES
Deaths/1 M/month 1 (median) >65 yrs 1 0.0782424 0.0000630 689.4063 YES
Deaths/1 M/month 1 (mean) >65 yrs 1 0.0978909 0.0000068 824.9396 YES
Deaths/1 M/month 1 (max) >65 yrs 1 0.0959641 0.0000085 1363.0371 YES
Deaths/1 M (Total) >65 yrs 1 0.4551973 0.0000000 807.6933 YES
Deaths/day/1 M log(mean) >65 yrs 1 0.4293954 0.0000000 790.1206 YES
Deaths/day/1 M log(median) >65 yrs 1 0.2277763 0.0000000 454.2141 YES
Deaths/day/1 M loglog(max) >65 yrs 1 0.3728709 0.0000000 740.7894 YES
Deaths/1 M/week 3 log(Total) >65 yrs 1 0.3588054 0.0000000 667.5269 YES
Deaths/1 M/week 3 log(median) >65 yrs 1 0.3503576 0.0000000 417.0047 YES
Deaths/1 M/week 3 log(mean) >65 yrs 1 0.3611842 0.0000000 665.9352 YES
Deaths/1 M/week 3 log(max) >65 yrs 1 0.3158804 0.0000000 633.2293 YES
Deaths/1 M/month 1 log(Total) >65 yrs 1 0.4229158 0.0000000 753.3609 YES
Deaths/1 M/month 1 log(median) >65 yrs 1 0.3202529 0.0000000 392.4027 YES
Deaths/1 M/month 1 log(mean) >65 yrs 1 0.4249439 0.0000000 752.0420 YES
Deaths/1 M/month 1 log(max) >65 yrs 1 0.3624869 0.0000000 714.6538 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.0005639 0.7544052 2276.2182
Days to 0.1 Death/1 M Pop Dens 1 0.0030420 0.4983133 1044.7279
Days to 1 Death/1 M Pop Dens 1 0.0102584 0.2442380 1098.1818
Deaths/day/1 M (mean) Pop Dens 1 0.0013783 0.6443577 677.4134
Deaths/day/1 M (median) Pop Dens 1 0.0014948 0.6306911 589.1414
Deaths/day/1 M (max) Pop Dens 1 0.0468337 0.0064831 1321.4424 YES
Deaths/1 M/week 3 (Total) Pop Dens 1 0.0131979 0.1546170 1524.8768
Deaths/1 M/week 3 (median) Pop Dens 1 0.0011490 0.6754278 524.9351
Deaths/1 M/week 3 (mean) Pop Dens 1 0.0131979 0.1546170 921.6446
Deaths/1 M/week 3 (max) Pop Dens 1 0.0643706 0.0014454 1277.1431 YES
Deaths/1 M/month 1 (Total) Pop Dens 1 0.0079138 0.2790044 1738.2920
Deaths/1 M/month 1 (median) Pop Dens 1 0.0006363 0.7592899 478.9128
Deaths/1 M/month 1 (mean) Pop Dens 1 0.0079138 0.2790044 717.9327
Deaths/1 M/month 1 (max) Pop Dens 1 0.0564143 0.0034264 1254.4429 YES
Deaths/1 M (Total) Pop Dens 1 0.0061338 0.3295656 687.7941
Deaths/day/1 M log(mean) Pop Dens 1 0.0072417 0.2892904 667.4229
Deaths/day/1 M log(median) Pop Dens 1 0.0129292 0.3183875 311.1856
Deaths/day/1 M loglog(max) Pop Dens 1 0.0241730 0.0518483 623.0497
Deaths/1 M/week 3 log(Total) Pop Dens 1 0.0230960 0.0843342 536.1813
Deaths/1 M/week 3 log(median) Pop Dens 1 0.0143965 0.2986153 303.4768
Deaths/1 M/week 3 log(mean) Pop Dens 1 0.0230960 0.0843342 536.1813
Deaths/1 M/week 3 log(max) Pop Dens 1 0.0470930 0.0131376 511.3166 YES
Deaths/1 M/month 1 log(Total) Pop Dens 1 0.0162128 0.1204841 637.3359
Deaths/1 M/month 1 log(median) Pop Dens 1 0.0129070 0.3420044 277.3585
Deaths/1 M/month 1 log(mean) Pop Dens 1 0.0162128 0.1204841 637.3359
Deaths/1 M/month 1 log(max) Pop Dens 1 0.0324002 0.0275145 598.2388 YES
Deaths/1 M (Total) Urban (%) 1 0.1094471 0.0000057 2303.5114 YES
Days to 0.1 Death/1 M Urban (%) 1 0.0692776 0.0008668 1084.8643 YES
Days to 1 Death/1 M Urban (%) 1 0.0732286 0.0014408 1116.3956 YES
Deaths/day/1 M (mean) Urban (%) 1 0.1122285 0.0000140 672.1685 YES
Deaths/day/1 M (median) Urban (%) 1 0.0828349 0.0002138 586.8015 YES
Deaths/day/1 M (max) Urban (%) 1 0.0595074 0.0018184 1349.0993 YES
Deaths/1 M/week 3 (Total) Urban (%) 1 0.0482977 0.0056824 1536.8551 YES
Deaths/1 M/week 3 (median) Urban (%) 1 0.0556275 0.0029423 521.0240 YES
Deaths/1 M/week 3 (mean) Urban (%) 1 0.0482977 0.0056824 925.8393 YES
Deaths/1 M/week 3 (max) Urban (%) 1 0.0445511 0.0079651 1294.8857 YES
Deaths/1 M/month 1 (Total) Urban (%) 1 0.0673157 0.0012475 1750.1509 YES
Deaths/1 M/month 1 (median) Urban (%) 1 0.0416414 0.0116798 476.9704 YES
Deaths/1 M/month 1 (mean) Urban (%) 1 0.0673157 0.0012475 716.1869 YES
Deaths/1 M/month 1 (max) Urban (%) 1 0.0466417 0.0075344 1270.7622 YES
Deaths/1 M (Total) Urban (%) 1 0.2715826 0.0000000 658.7387 YES
Deaths/day/1 M log(mean) Urban (%) 1 0.2385094 0.0000000 640.4009 YES
Deaths/day/1 M log(median) Urban (%) 1 0.2133931 0.0000182 293.2515 YES
Deaths/day/1 M loglog(max) Urban (%) 1 0.2223444 0.0000000 602.2441 YES
Deaths/1 M/week 3 log(Total) Urban (%) 1 0.2335778 0.0000000 518.2519 YES
Deaths/1 M/week 3 log(median) Urban (%) 1 0.2167114 0.0000199 285.7858 YES
Deaths/1 M/week 3 log(mean) Urban (%) 1 0.2335778 0.0000000 518.2519 YES
Deaths/1 M/week 3 log(max) Urban (%) 1 0.1878719 0.0000002 501.6220 YES
Deaths/1 M/month 1 log(Total) Urban (%) 1 0.2139539 0.0000000 618.2438 YES
Deaths/1 M/month 1 log(median) Urban (%) 1 0.2211259 0.0000307 260.3006 YES
Deaths/1 M/month 1 log(mean) Urban (%) 1 0.2139539 0.0000000 618.2438 YES
Deaths/1 M/month 1 log(max) Urban (%) 1 0.1762536 0.0000001 586.3827 YES
Deaths/1 M (Total) HDI 1 0.1556992 0.0000002 2051.0557 YES
Days to 0.1 Death/1 M HDI 1 0.0476219 0.0090812 982.6650 YES
Days to 1 Death/1 M HDI 1 0.1831021 0.0000006 1017.1018 YES
Deaths/day/1 M (mean) HDI 1 0.1557030 0.0000008 562.6591 YES
Deaths/day/1 M (median) HDI 1 0.1313091 0.0000070 537.7253 YES
Deaths/day/1 M (max) HDI 1 0.1455739 0.0000020 1010.0633 YES
Deaths/1 M/week 3 (Total) HDI 1 0.0858378 0.0004026 1094.7625 YES
Deaths/1 M/week 3 (median) HDI 1 0.0942397 0.0002024 478.6189 YES
Deaths/1 M/week 3 (mean) HDI 1 0.0858378 0.0004026 542.1240 YES
Deaths/1 M/week 3 (max) HDI 1 0.0694892 0.0015257 777.9178 YES
Deaths/1 M/month 1 (Total) HDI 1 0.0929102 0.0002928 1454.8914 YES
Deaths/1 M/month 1 (median) HDI 1 0.0542882 0.0061438 442.2028 YES
Deaths/1 M/month 1 (mean) HDI 1 0.0929102 0.0002928 522.9633 YES
Deaths/1 M/month 1 (max) HDI 1 0.1141919 0.0000538 885.3958 YES
Deaths/1 M (Total) HDI 1 0.4630266 0.0000000 547.7818 YES
Deaths/day/1 M log(mean) HDI 1 0.4060149 0.0000000 538.0238 YES
Deaths/day/1 M log(median) HDI 1 0.3690949 0.0000000 252.8348 YES
Deaths/day/1 M loglog(max) HDI 1 0.3763225 0.0000000 505.3182 YES
Deaths/1 M/week 3 log(Total) HDI 1 0.3771524 0.0000000 427.9810 YES
Deaths/1 M/week 3 log(median) HDI 1 0.3700595 0.0000000 240.0427 YES
Deaths/1 M/week 3 log(mean) HDI 1 0.3771524 0.0000000 427.9810 YES
Deaths/1 M/week 3 log(max) HDI 1 0.2954448 0.0000000 416.6500 YES
Deaths/1 M/month 1 log(Total) HDI 1 0.4407539 0.0000000 506.0474 YES
Deaths/1 M/month 1 log(median) HDI 1 0.3963960 0.0000000 219.9212 YES
Deaths/1 M/month 1 log(mean) HDI 1 0.4407539 0.0000000 506.0474 YES
Deaths/1 M/month 1 log(max) HDI 1 0.3677285 0.0000000 483.0027 YES
Deaths/1 M (Total) >65 yrs 1 0.2158669 0.0000000 2115.9801 YES
Days to 0.1 Death/1 M >65 yrs 1 0.0156516 0.1233536 1068.5504
Days to 1 Death/1 M >65 yrs 1 0.0898534 0.0004797 1080.3805 YES
Deaths/day/1 M (mean) >65 yrs 1 0.2103032 0.0000000 546.2240 YES
Deaths/day/1 M (median) >65 yrs 1 0.2280842 0.0000000 465.7943 YES
Deaths/day/1 M (max) >65 yrs 1 0.1435404 0.0000010 1021.3610 YES
Deaths/1 M/week 3 (Total) >65 yrs 1 0.2236943 0.0000000 979.1238 YES
Deaths/1 M/week 3 (median) >65 yrs 1 0.2414454 0.0000000 331.8721 YES
Deaths/1 M/week 3 (mean) >65 yrs 1 0.2236943 0.0000000 383.6753 YES
Deaths/1 M/week 3 (max) >65 yrs 1 0.1761894 0.0000001 626.5099 YES
Deaths/1 M/month 1 (Total) >65 yrs 1 0.2040037 0.0000000 1397.1699 YES
Deaths/1 M/month 1 (median) >65 yrs 1 0.2051907 0.0000000 211.2264 YES
Deaths/1 M/month 1 (mean) >65 yrs 1 0.2040037 0.0000000 390.4155 YES
Deaths/1 M/month 1 (max) >65 yrs 1 0.1568675 0.0000006 821.1937 YES
Deaths/1 M (Total) >65 yrs 1 0.4138894 0.0000000 600.6195 YES
Deaths/day/1 M log(mean) >65 yrs 1 0.3817056 0.0000000 583.0401 YES
Deaths/day/1 M log(median) >65 yrs 1 0.2600148 0.0000019 280.9655 YES
Deaths/day/1 M loglog(max) >65 yrs 1 0.3109188 0.0000000 547.3379 YES
Deaths/1 M/week 3 log(Total) >65 yrs 1 0.3260549 0.0000000 471.5735 YES
Deaths/1 M/week 3 log(median) >65 yrs 1 0.3795553 0.0000000 259.6630 YES
Deaths/1 M/week 3 log(mean) >65 yrs 1 0.3260549 0.0000000 471.5735 YES
Deaths/1 M/week 3 log(max) >65 yrs 1 0.2572991 0.0000000 453.0836 YES
Deaths/1 M/month 1 log(Total) >65 yrs 1 0.3701677 0.0000000 554.7081 YES
Deaths/1 M/month 1 log(median) >65 yrs 1 0.3634769 0.0000000 236.0110 YES
Deaths/1 M/month 1 log(mean) >65 yrs 1 0.3701677 0.0000000 554.7081 YES
Deaths/1 M/month 1 log(max) >65 yrs 1 0.2951913 0.0000000 522.7986 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.2147676 0.0259357 308.10590 YES
Days to 0.1 Death/1 M Pop Dens 1 0.0021796 0.8324767 144.54336
Days to 1 Death/1 M Pop Dens 1 0.0072532 0.6992257 167.08721
Deaths/day/1 M (mean) Pop Dens 1 0.2056850 0.0297402 104.53229 YES
Deaths/day/1 M (median) Pop Dens 1 0.2123108 0.0269162 97.58604 YES
Deaths/day/1 M (max) Pop Dens 1 0.1368203 0.0823445 155.80388
Deaths/1 M/week 3 (Total) Pop Dens 1 0.0748223 0.2066132 171.58620
Deaths/1 M/week 3 (median) Pop Dens 1 0.0935553 0.1557906 75.94130
Deaths/1 M/week 3 (mean) Pop Dens 1 0.0748223 0.2066132 82.07433
Deaths/1 M/week 3 (max) Pop Dens 1 0.0416372 0.3503533 110.19537
Deaths/1 M/month 1 (Total) Pop Dens 1 0.1177562 0.1089217 243.01856
Deaths/1 M/month 1 (median) Pop Dens 1 0.0760236 0.2028617 56.78722
Deaths/1 M/month 1 (mean) Pop Dens 1 0.1177562 0.1089217 86.56348
Deaths/1 M/month 1 (max) Pop Dens 1 0.1614571 0.0573573 141.18654
Deaths/1 M (Total) Pop Dens 1 0.2483851 0.0155019 83.86605 YES
Deaths/day/1 M log(mean) Pop Dens 1 0.2342950 0.0192657 81.71113 YES
Deaths/day/1 M log(median) Pop Dens 1 0.1839524 0.0523729 74.68709
Deaths/day/1 M loglog(max) Pop Dens 1 0.1520330 0.0658775 76.84758
Deaths/1 M/week 3 log(Total) Pop Dens 1 0.1046405 0.1321516 88.81352
Deaths/1 M/week 3 log(median) Pop Dens 1 0.0403543 0.4095748 75.98274
Deaths/1 M/week 3 log(mean) Pop Dens 1 0.1046405 0.1321516 88.81352
Deaths/1 M/week 3 log(max) Pop Dens 1 0.0625831 0.2496209 84.54175
Deaths/1 M/month 1 log(Total) Pop Dens 1 0.1701591 0.0504551 84.04403
Deaths/1 M/month 1 log(median) Pop Dens 1 0.0741212 0.2744135 66.69265
Deaths/1 M/month 1 log(mean) Pop Dens 1 0.1701591 0.0504551 84.04403
Deaths/1 M/month 1 log(max) Pop Dens 1 0.1715854 0.0494041 75.86364 YES
Deaths/1 M (Total) Urban (%) 1 0.0541294 0.2853816 312.38680
Days to 0.1 Death/1 M Urban (%) 1 0.0151126 0.5762872 144.24330
Days to 1 Death/1 M Urban (%) 1 0.0168201 0.5553264 166.86448
Deaths/day/1 M (mean) Urban (%) 1 0.0648578 0.2409108 108.28632
Deaths/day/1 M (median) Urban (%) 1 0.0565375 0.2746109 101.73646
Deaths/day/1 M (max) Urban (%) 1 0.0974209 0.1470788 156.83045
Deaths/1 M/week 3 (Total) Urban (%) 1 0.0080713 0.6835253 173.18851
Deaths/1 M/week 3 (median) Urban (%) 1 0.0168959 0.5544300 77.80856
Deaths/1 M/week 3 (mean) Urban (%) 1 0.0080713 0.6835253 83.67664
Deaths/1 M/week 3 (max) Urban (%) 1 0.0028298 0.8095073 111.10835
Deaths/1 M/month 1 (Total) Urban (%) 1 0.0132283 0.6012750 245.59388
Deaths/1 M/month 1 (median) Urban (%) 1 0.0003227 0.9351630 58.59837
Deaths/1 M/month 1 (mean) Urban (%) 1 0.0132283 0.6012750 89.13880
Deaths/1 M/month 1 (max) Urban (%) 1 0.0138302 0.5930605 144.91629
Deaths/1 M (Total) Urban (%) 1 0.0215017 0.5043627 89.93334
Deaths/day/1 M log(mean) Urban (%) 1 0.0181327 0.5401530 87.43029
Deaths/day/1 M log(median) Urban (%) 1 0.0311135 0.4443593 78.29226
Deaths/day/1 M loglog(max) Urban (%) 1 0.0527610 0.2917277 79.39390
Deaths/1 M/week 3 log(Total) Urban (%) 1 0.0000263 0.9814656 91.35510
Deaths/1 M/week 3 log(median) Urban (%) 1 0.0420291 0.3998172 75.94955
Deaths/1 M/week 3 log(mean) Urban (%) 1 0.0000263 0.9814656 91.35510
Deaths/1 M/week 3 log(max) Urban (%) 1 0.0001831 0.9511354 86.02396
Deaths/1 M/month 1 log(Total) Urban (%) 1 0.0010023 0.8859752 88.31096
Deaths/1 M/month 1 log(median) Urban (%) 1 0.0427607 0.4103420 67.29223
Deaths/1 M/month 1 log(mean) Urban (%) 1 0.0010023 0.8859752 88.31096
Deaths/1 M/month 1 log(max) Urban (%) 1 0.0024624 0.8220960 80.13649
Deaths/1 M (Total) HDI 1 0.0590384 0.2639330 312.26712
Days to 0.1 Death/1 M HDI 1 0.0148489 0.5796591 144.24946
Days to 1 Death/1 M HDI 1 0.0251713 0.4696498 166.66829
Deaths/day/1 M (mean) HDI 1 0.0712463 0.2182460 108.12865
Deaths/day/1 M (median) HDI 1 0.0666275 0.2343750 101.48916
Deaths/day/1 M (max) HDI 1 0.0969223 0.1481730 156.84315
Deaths/1 M/week 3 (Total) HDI 1 0.0337832 0.4011812 172.58446
Deaths/1 M/week 3 (median) HDI 1 0.0699252 0.2227274 76.53321
Deaths/1 M/week 3 (mean) HDI 1 0.0337832 0.4011812 83.07259
Deaths/1 M/week 3 (max) HDI 1 0.0196282 0.5237430 110.71759
Deaths/1 M/month 1 (Total) HDI 1 0.0387807 0.3677846 244.99045
Deaths/1 M/month 1 (median) HDI 1 0.0284305 0.4418470 57.94242
Deaths/1 M/month 1 (mean) HDI 1 0.0387807 0.3677846 88.53537
Deaths/1 M/month 1 (max) HDI 1 0.0535084 0.2882405 143.97176
Deaths/1 M (Total) HDI 1 0.0951097 0.1522237 88.13461
Deaths/day/1 M log(mean) HDI 1 0.0951673 0.1520931 85.55105
Deaths/day/1 M log(median) HDI 1 0.1140189 0.1343915 76.41377
Deaths/day/1 M loglog(max) HDI 1 0.1890112 0.0381601 75.82207 YES
Deaths/1 M/week 3 log(Total) HDI 1 0.0823476 0.1843091 89.37917
Deaths/1 M/week 3 log(median) HDI 1 0.1460549 0.1063668 73.76549
Deaths/1 M/week 3 log(mean) HDI 1 0.0823476 0.1843091 89.37917
Deaths/1 M/week 3 log(max) HDI 1 0.0716302 0.2169627 84.31869
Deaths/1 M/month 1 log(Total) HDI 1 0.1117448 0.1189967 85.60861
Deaths/1 M/month 1 log(median) HDI 1 0.1861739 0.0737936 64.37071
Deaths/1 M/month 1 log(mean) HDI 1 0.1117448 0.1189967 85.60861
Deaths/1 M/month 1 log(max) HDI 1 0.1413680 0.0770338 76.68765
Deaths/1 M (Total) >65 yrs 1 0.0158385 0.5671965 313.29954
Days to 0.1 Death/1 M >65 yrs 1 0.0939086 0.1549722 142.32540
Days to 1 Death/1 M >65 yrs 1 0.2569404 0.0135677 160.42412 YES
Deaths/day/1 M (mean) >65 yrs 1 0.0132317 0.6012273 109.52226
Deaths/day/1 M (median) >65 yrs 1 0.0078549 0.6875859 102.89365
Deaths/day/1 M (max) >65 yrs 1 0.0369302 0.3796946 158.32245
Deaths/1 M/week 3 (Total) >65 yrs 1 0.0646766 0.2415917 171.83705
Deaths/1 M/week 3 (median) >65 yrs 1 0.1001567 0.1412244 75.77319
Deaths/1 M/week 3 (mean) >65 yrs 1 0.0646766 0.2415917 82.32519
Deaths/1 M/week 3 (max) >65 yrs 1 0.0469654 0.3205938 110.06714
Deaths/1 M/month 1 (Total) >65 yrs 1 0.0405320 0.3569663 244.94851
Deaths/1 M/month 1 (median) >65 yrs 1 0.0679730 0.2295414 56.98675
Deaths/1 M/month 1 (mean) >65 yrs 1 0.0405320 0.3569663 88.49343
Deaths/1 M/month 1 (max) >65 yrs 1 0.0405685 0.3567455 144.28407
Deaths/1 M (Total) >65 yrs 1 0.0674666 0.2313471 88.82671
Deaths/day/1 M log(mean) >65 yrs 1 0.0761788 0.2023825 86.02872
Deaths/day/1 M log(median) >65 yrs 1 0.0337823 0.4251434 78.23434
Deaths/day/1 M loglog(max) >65 yrs 1 0.1009080 0.1396601 78.19408
Deaths/1 M/week 3 log(Total) >65 yrs 1 0.1939001 0.0354790 86.39811 YES
Deaths/1 M/week 3 log(median) >65 yrs 1 0.1882285 0.0634728 72.80318
Deaths/1 M/week 3 log(mean) >65 yrs 1 0.1939001 0.0354790 86.39811 YES
Deaths/1 M/week 3 log(max) >65 yrs 1 0.1830767 0.0416779 81.37734 YES
Deaths/1 M/month 1 log(Total) >65 yrs 1 0.1625544 0.0564385 84.25384
Deaths/1 M/month 1 log(median) >65 yrs 1 0.2881761 0.0216169 61.96022 YES
Deaths/1 M/month 1 log(mean) >65 yrs 1 0.1625544 0.0564385 84.25384
Deaths/1 M/month 1 log(max) >65 yrs 1 0.1124915 0.1176949 77.44844

—————-