Created
December 8, 2024 17:02
-
-
Save aakhmetz/e3a730ae7cd87a45b86dcb0fe3014437 to your computer and use it in GitHub Desktop.
20241209-Vaccine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"a0": 0.700102, | |
"b0": 1.0, | |
"n": 94, | |
"y": 8 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data { // everything to the right of the | in Bayes' Rule | |
real<lower = 0> a0; // expectation for normal prior on VE | |
real<lower = 0> b0; // standard deviation for normal prior on VE | |
int<lower = 0> n; // number of people with Covid in the RCT | |
int<lower = 0, upper = n> y; // number of them who were vaccinated | |
} | |
parameters { // everything to the left of the | in Bayes' Rule | |
real<upper = 1> theta; // = 1 - Pr(covid | vax) / Pr(covid | placebo) | |
} | |
model { // target has been initialized to zero basically | |
target += beta_lpdf(theta | a0, b0); // prior log-kernel | |
target += binomial_lpmf(y | n, theta); // log-likelihood | |
} // model block is like a function that returns target | |
generated quantities { | |
real<lower = 0, upper = 1> VE = (1 - 2 * theta) / (1 - theta); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"title":"Untitled"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"num_chains":4,"num_warmup":1000,"num_samples":1000,"init_radius":2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment