Stima dell'efficacia vaccinale dai Report ISS con metodo bayesiano.
Max Pierini
NB: per semplicità, i vaccinati da meno di 4 e 6 mesi e i vaccinati da più di 4 e 6 mesi, sono accoparti rispettivamente in vaccinati da meno 4-6 mesi e da più di 4-6 mesi.
We assume expected vaccine efficacy $0 \leq E \leq 1$ and we adopt the following notation:
Vaccinated | Controls | |
---|---|---|
Event | VE | CE |
Not event | VN | CN |
Control event rate
$$ \mathrm{CER} = \frac{\mathrm{CE}}{\mathrm{CE+CN}} = P(\mathrm{Event}|\mathrm{Control}) $$Vaccinated event rate
$$ \mathrm{VER} = \frac{\mathrm{VE}}{\mathrm{VE+VN}} = P(\mathrm{Event}|\mathrm{Vaccinated}) $$Efficacy is estimated as Relative Risk Reduction $\mathrm{RRR}$, complementary of Risk Reduction $\mathrm{RR}$
\begin{align*} E &= \mathrm{RRR} = 1 - \mathrm{RR} \\&= 1-\frac{P(\mathrm{Event}|\mathrm{Vaccinated})}{P(\mathrm{Event}|\mathrm{Control})} \\&= 1 - \frac{\mathrm{VER}}{\mathrm{CER}} = 1 - \frac{\frac{\mathrm{VE}}{\mathrm{VE}+\mathrm{VN}}}{\frac{\mathrm{CE}}{\mathrm{CE}+\mathrm{CN}}} \end{align*}So, given the assumption $0 \leq E \leq 1$, we are assuming that $P(\mathrm{Event}|\mathrm{Vaccinated}) \leq P(\mathrm{Event}|\mathrm{Control})$, i.e. $\mathrm{VER} \leq \mathrm{CER}$.
VER and CER could be Beta distributed, because given $\pi \sim \mathbf{Beta}(\alpha, \beta)$ the expected values $\hat{\pi} = \frac{\alpha}{\alpha+\beta}$
$$ E \sim 1 - \frac{ \mathbf{Beta}(\alpha = \mathrm{VE}, \beta = \mathrm{VN}) }{ \mathbf{Beta}(\alpha = \mathrm{CE}, \beta = \mathrm{CN}) } $$but this would lead to a Beta quotient distribution which is very difficult to compute.
Thus, we can define a parameter $\theta$ that can be Beta distributed and from which we can estimate the efficacy $E$
\begin{align*} \theta &= \frac{\mathrm{VER}}{\mathrm{VER} + \mathrm{CER}} = \frac{ \frac{\mathrm{VER}}{\mathrm{CER}} }{ 1 + \frac{\mathrm{VER}}{\mathrm{CER}} } \\&= \frac{ 1 - (1 - \frac{\mathrm{VER}}{\mathrm{CER}}) }{ 2 - (1 - \frac{\mathrm{VER}}{\mathrm{CER}}) } = \frac{1 - E}{2 - E} \end{align*}which ensured $0 \leq \theta \leq 0.5$ and from which we find $E$
$$ \theta(2 - E) = 1 - E $$$$ 2\theta - \theta E = 1 - E $$$$ E(1 - \theta) = 1 - 2\theta $$$$ E = \frac{1 - 2\theta}{1 - \theta} = 1 - \frac{\theta}{1 - \theta} = 1 - \mathbf{odds}(\theta) $$where $\mathbf{odds}(\pi) = \frac{\pi}{1-\pi}$.
Assuming that VER and CER are drawn from same sized populations we can define
$$ \mathrm{VE}^* = \frac{\mathrm{VE}}{\mathrm{VE+VN}} \cdot \hat{N} = P(\mathrm{Event}|\mathrm{Vaccinated}) \cdot \hat{N} $$$$ \mathrm{CE}^* = \frac{\mathrm{CE}}{\mathrm{CE+CN}} \cdot \hat{N} = P(\mathrm{Event}|\mathrm{Control}) \cdot \hat{N} $$where
$$ \hat{N} = \frac{1}{2} \Big( \mathrm{VE+VN+CE+CN} \Big) $$so that $\theta$ can be rewritten as
$$ \theta = \frac{ \frac{\mathrm{VE^*}}{\hat{N}} }{ \frac{\mathrm{VE^*}}{\hat{N}} + \frac{\mathrm{CE^*}}{\hat{N}} } = \frac{\mathrm{VE^*}}{\mathrm{VE^*}+\mathrm{CE^*}} $$and can be Beta distributed
$$ \theta \sim \mathbf{Beta}(\alpha = \mathrm{VE^*}, \beta = \mathrm{CE^*}) $$Given a prior efficacy $E_{prior}$ we can define $\theta$ prior as
$$ \theta_{prior} = \frac{1 - E_{prior}}{2 - E_{prior}} $$and knowing that
$$ \hat{\theta} = \frac{\alpha}{\alpha + \beta} \Rightarrow \alpha = \frac{\hat{\theta}\beta}{1 - \hat{\theta}} $$considering an uninformative $\beta_{prior}=1$ we can compute $\alpha_{prior}$ as
$$ \alpha_{prior} = \frac{\theta_{prior}}{1 - \theta_{prior}} $$Thus, $\theta$ posterior will be
$$ \theta_{post} \sim \mathbf{Beta}(\alpha=\alpha_{prior} + \mathrm{VE^*}, \beta=\beta_{prior} + \mathrm{CE^*}) $$that immediately follows the Beta-Binomial model with binomially distributed likelihood
$$ \mathrm{VE^*} \sim \mathbf{Binom}( n=\mathrm{VE^*}+\mathrm{CE^*} , p=\theta ) $$If we have got $n$ obervations we can finally define $\theta_{post}$ as
$$ \theta_{post} \sim \mathbf{Beta}\left(\alpha=\alpha_{post}, \beta=\beta_{post}\right) $$where
$$ \alpha_{post} = \alpha_{prior} + \sum_{i=1}^{n} \mathrm{VE}_i^* $$$$ \beta_{post} = \beta_{prior} + \sum_{i=1}^{n} \mathrm{CE}_i^* $$following the Beta-Binomial model with binomially distributed likelihoods
$$ \mathrm{VE}_i^* \sim \mathbf{Binom}( n=\mathrm{VE}_i^*+\mathrm{CE}_i^* , p=\theta_i ) \;,\; i=1\cdots n $$so that efficacy $E$ posterior is
$$ E_{post} \sim 1 - \mathbf{odds}( \theta_{post} ) $$Thus, we can compute $\hat{E}$ expected value
$$ \hat{E} = 1 - \mathbf{odds}\big(\hat{\theta}_{post}\big) = 1 - \mathbf{odds}\left( \frac{\alpha_{post}}{\alpha_{post} + \beta_{post}} \right) $$the mode $\omega(E)$
$$ \omega(E) = 1 - \mathbf{odds}\big(\omega({\theta}_{post})\big) = 1 - \mathbf{odds}\left( \frac{\alpha_{post}-1}{\alpha_{post} + \beta_{post}-2} \right) $$and bayesian credibility intervals from $\theta_{post}$ inverse cumulative probability function $\Phi^{-1}_\mathbf{Beta}\{\cdot, a\}$ of $\cdot$ distribution with chosen $a$ significance as
$$ E \Big]_{lo}^{up} = \Big[ 1 - \mathbf{odds}\left( \Phi^{-1}_\mathbf{Beta}\left\{( \theta_{post}, \frac{a}{2} \right\} \right) , 1 - \mathbf{odds}\left( \Phi^{-1}_\mathbf{Beta}\left\{ \theta_{post}, 1-\frac{a}{2} \right\} \right) \Big] $$that gives upper and lower values of $E$ with credibility $\mathrm{CI}=1-a$.
Exported from Italia/Vaccini_Bayes_Efficacia.ipynb
committed by maxdevblock on Fri Feb 11 18:19:20 2022 revision 12, ce6f96b8