2020 excess mortality & voting patterns in CH
Assesing bias & coverage of 2015-19 models
Data
Mortality data
= read_rds("data/BfS-closed/monthly_deaths/w_deaths_2015_2020_year_fin.Rds") %>%
data filter(age != "<40") %>%
# strata with double zeroes seem to be crashing
filter(pop_mid_poi > 0) %>%
# only data till 2019
filter(year < 2020)
= data %>%
data_male filter(sex == "Male") %>%
select(-sex) %>%
as.data.frame()
# data_female = data %>%
# filter(sex == "Female") %>%
# select(-sex) %>%
# as.data.frame()
Spatial
= read_rds("data/BfS/kt.Rds")
kt = read_rds("data/BfS/gg.Rds")
gg = read_rds("data/BfS/tg3o.Rds")
tg3o = read_rds("data/BfS/se_alt.Rds") se_alt
Results from Ubelix
= read_rds("results_inla/gem_bym2_cv.Rds")
gem_bym2_cv = read_rds("results_inla/gem_bym2_cv_kt.Rds") gem_bym2_cv_kt
Year of interest
= 2019 yoi
Canton
Models with and without canton (iid).
DIC
WAIC
Models
No canton
summary(gem_bym2_cv$Male)
Call:
c("inla(formula = formula, family = \"Poisson\", data = data_sex, ", "
quantiles = c(0.025, 0.5, 0.975), control.compute = list(config = TRUE,
", " cpo = TRUE, dic = TRUE, waic = TRUE), control.predictor =
list(compute = TRUE, ", " link = 1), control.family = control.family,
control.mode = list(restart = TRUE), ", " num.threads = threads)")
Time used:
Pre = 13.6, Running = 122, Post = 5.17, Total = 141
Fixed effects:
mean sd 0.025quant 0.5quant 0.975quant mode kld
(Intercept) 47.676 5.441 37.000 47.673 58.357 47.669 0
year -0.026 0.003 -0.031 -0.026 -0.021 -0.026 0
Random effects:
Name Model
id_age IID model
id_space BYM2 model
row_id IID model
Model hyperparameters:
mean sd 0.025quant 0.5quant 0.975quant mode
Precision for id_age 0.816 0.343 0.357 0.747 1.672 0.630
Precision for id_space 56.842 5.074 47.279 56.729 67.178 56.638
Phi for id_space 0.394 0.075 0.267 0.387 0.557 0.364
Precision for row_id 255.840 64.190 154.199 247.545 404.124 231.688
Deviance Information Criterion (DIC) ...............: 109037.28
Deviance Information Criterion (DIC, saturated) ....: 40687.99
Effective number of parameters .....................: 1087.92
Watanabe-Akaike information criterion (WAIC) ...: 109055.96
Effective number of parameters .................: 1033.89
Marginal log-Likelihood: -53882.05
CPO, PIT is computed
Posterior summaries for the linear predictor and the fitted values are computed
(Posterior marginals needs also 'control.compute=list(return.marginals.predictor=TRUE)')
Canton
summary(gem_bym2_cv_kt$Male)
Call:
c("inla(formula = formula, family = \"Poisson\", data = data_sex, ", "
quantiles = c(0.025, 0.5, 0.975), control.compute = list(config = TRUE,
", " cpo = TRUE, dic = TRUE, waic = TRUE), control.predictor =
list(compute = TRUE, ", " link = 1), control.family = control.family,
control.mode = list(restart = TRUE), ", " num.threads = threads)")
Time used:
Pre = 21.4, Running = 110, Post = 5.37, Total = 137
Fixed effects:
mean sd 0.025quant 0.5quant 0.975quant mode kld
(Intercept) 47.595 5.427 36.947 47.593 58.248 47.588 0
year -0.026 0.003 -0.031 -0.026 -0.021 -0.026 0
Random effects:
Name Model
id_age IID model
id_kt IID model
id_space BYM2 model
row_id IID model
Model hyperparameters:
mean sd 0.025quant 0.5quant 0.975quant mode
Precision for id_age 0.646 0.219 0.303 0.619 1.15 0.564
Precision for id_kt 3199.311 5766.719 312.357 1610.714 16044.72 687.504
Precision for id_space 58.014 5.310 48.677 57.618 69.53 56.655
Phi for id_space 0.374 0.082 0.230 0.368 0.55 0.352
Precision for row_id 272.344 77.631 147.143 263.570 449.53 246.735
Deviance Information Criterion (DIC) ...............: 109036.78
Deviance Information Criterion (DIC, saturated) ....: 40687.49
Effective number of parameters .....................: 1062.98
Watanabe-Akaike information criterion (WAIC) ...: 109056.47
Effective number of parameters .................: 1012.88
Marginal log-Likelihood: -53881.42
CPO, PIT is computed
Posterior summaries for the linear predictor and the fitted values are computed
(Posterior marginals needs also 'control.compute=list(return.marginals.predictor=TRUE)')
Canton effect
Observed vs predicted
No canton
Canton
Age bias
No canton
Canton
Coverage
No canton
frq(males_fit_2000_space$within)
x <character>
# total N=10705 valid N=10705 mean=1.65 sd=0.48
Value | N | Raw % | Valid % | Cum. %
---------------------------------------
no | 3752 | 35.05 | 35.05 | 35.05
yes | 6953 | 64.95 | 64.95 | 100.00
<NA> | 0 | 0.00 | <NA> | <NA>
Canton
frq(males_fit_kt_2000_space$within)
x <character>
# total N=10705 valid N=10705 mean=1.65 sd=0.48
Value | N | Raw % | Valid % | Cum. %
---------------------------------------
no | 3782 | 35.33 | 35.33 | 35.33
yes | 6923 | 64.67 | 64.67 | 100.00
<NA> | 0 | 0.00 | <NA> | <NA>