Posterior_phi {brr} | R Documentation |
Density, distribution function, quantile function and random generation for the posterior distribution on relative risk or the vaccine efficacy.
dpost_phi(phi, a, b, c, d, S, T, x, y, ...)
dpost_VE(VE, a, b, c, d, S, T, x, y, ...)
ppost_phi(q, a, b, c, d, S, T, x, y, ...)
ppost_VE(q, a, b, c, d, S, T, x, y, ...)
qpost_phi(p, a, b, c, d, S, T, x, y, ...)
qpost_VE(p, a, b, c, d, S, T, x, y, ...)
rpost_phi(n, a, b, c, d, S, T, x, y)
spost_phi(a, b, c, d, S, T, x, y, ...)
phi , VE , q |
vector of quantiles |
a , b |
non-negative shape parameter and rate parameter of the prior Gamma distribution on the control incidence rate |
c , d |
non-negative shape parameters of the prior distribution on the relative risk |
S , T |
sample sizes in control group and treated group |
x , y |
counts in the treated group and control group |
... |
other arguments passed to |
p |
vector of probabilities |
n |
number of observations to be simulated |
The prior distribution on the relative risk \phi
is the Beta2 distribution
with shape parameters c
and d
and scale parameter (T+b)/S
.
dpost_phi
gives the density, ppost_phi
the distribution function, qpost_phi
the quantile function,
rpost_phi
samples from the distribution, and spost_phi
gives a summary of the distribution.
Posterior_phi
is a generic name for the functions documented.
a <- 2; b <- 2; c <- 3; d <- 4; S <- 1; T <- 1; x <- 2; y <- 6
spost_phi(a, b, c, d, S, T, x, y, output="pandoc")
require(magrittr)
phi <- seq(0, 6, length.out=100)
phi %>% { plot(., dpost_phi(., a, b, c, d, S, T, x, y), type="l") }
phi %>% { lines(., dprior_phi(., b, c, d, S, T), col="red") }