Posterior_phi: Posterior distribution on the relative risk and the vaccine...

Description Usage Arguments Details Value Note Examples

Description

Density, distribution function, quantile function and random generation for the posterior distribution on relative risk or the vaccine efficacy.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
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, ...)

Arguments

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 Beta2Dist

p

vector of probabilities

n

number of observations to be simulated

Details

The prior distribution on the relative risk φ is the Beta2 distribution with shape parameters c and d and scale parameter (T+b)/S.

Value

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.

Note

Posterior_phi is a generic name for the functions documented.

Examples

1
2
3
4
5
6
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") }

brr documentation built on May 29, 2017, 3:10 p.m.