Skip to contents

Implement the empirical Bayes robust meta-analytical-predictive (EB-rMAP) prior for outcomes distributions including binomial, normal (with known standard deviation) and Poisson.

Usage

EB_rMAP(map_obj, vague_prior, ppp_cut, n, y_range = NA, nbreak = 100)

Arguments

map_obj

The mixture of conjugate priors approximating the MAP prior, derived by the *RBesT* package.

vague_prior

The vague prior to form the robust MAP prior, must be in the same class of `map_obj`.

ppp_cut

A scalar cutoff for the prior predictive p value.

n

Current trial sample size: number of subjects for binary and normal endpoints; total exposure for time-to-event endpoint.

y_range

A vector containing the lower and upper limits of the observed response in the current trial. Required for normal and time-to-event endpoints.

nbreak

The number of breaks within the `y_range`, inclusive of the lower and upper limits. Required for normal endpoint. See details. Default is 100.

Value

An object of S3 class "EBrMAP"

Details

For discrete outcomes (binomial and Poisson), all possible outcome values can be enumerated and thus the `nbreak` option is needed. Note that `y_range` is still needed for a Poisson outcome.

For the normal outcome, the interval `y_range` is evenly divided into `nbreak` breaks. EB-rMAP weight is computed at each break value. Default `nbreak` is 100. A finer grid can be used with a larger `nbreak` at the cost of more computation time.

Examples

if (FALSE) {
set.seed(712)

dt <- RBesT::crohn
sigma <- 88
dt$se_yh <- sigma/sqrt(dt$n)
map_mcmc <- RBesT::gMAP(cbind(y, se_yh) ~ 1 | study, weight = n, data=dt,
                    family=gaussian, beta.prior=cbind(0, sigma),
                    tau.dist="HalfNormal",tau.prior=cbind(0,sigma/2))
map_hat <- RBesT::automixfit(map_mcmc)
sigma(map_hat) <- sigma
vague_prior <- RBesT::mixnorm(c(1, -50, 1), sigma=sigma, param="mn")

obj <- EB_rMAP(map_hat, vague_prior, ppp_cut=0.85, n=100, y_range=c(-80, -20))
wEB(obj, -61)
plot(obj)
}