You could consider the number of deaths out of the total number of inhabitants to be a binomial process. You can then use a regression model with deprivation as an explanatory variable, to see whether higher values of deprivation correspond to an increase in the average mortality rate.
Suppose your data is called DF
and looks like this:
area |
year |
deaths |
depriv |
England |
2024 |
982 |
0.1 |
... |
... |
... |
|
with deaths
representing the number of deaths per $100,\!000$.
In R, you could fit a binomial GLM to estimate the relationship between deprivation (depriv
) and the probability of death like so:
GLM <- glm(cbind(deaths, 1e5 - deaths) ~ depriv,
family = "binomial", data = DF)
You can also try to include other effects, like a regression spline for the effect of year
:
require("splines")
GLM <- glm(cbind(deaths, 1e5 - deaths) ~ depriv + ns(year, 5),
family = "binomial", data = DF)
After that, you can use summary
for a standard regression table, emmeans
for comparisons and a marginal effects plot to see visualize the estimated effect of deprivation on the mortality rate.
In the same manner, you could add other potentially confounding variables.
This is actually a major challenge in what you're trying to do. It is easy to see how two variables are marginally correlated to each other. But why two variables correlate is a much harder question. You'll have to decide on which variables to include in the model.
Finally, it is also possible to correct for the fact that some cities just happen to have higher mortality rates than others. One way is by including all variables that might affect this (like size), and another is by including a random effect for area
, by using a mixed model.
Edit: If you want to know whether the effect of deprivation changes over time, you could add an interaction term (*
). This term tells you how the slope of depriv
depends on year
:
GLM <- glm(cbind(deaths, 1e5 - deaths) ~ depriv * time,
family = "binomial", data = DF)