Title: | Bayesian Detection of Potential Risk Using Inference on Blinded Safety Data |
Version: | 1.0.4 |
Date: | 2018-08-25 |
Maintainer: | Saurabh Mukhopadhyay <saurabh.mukhopadhyay@abbvie.com> |
Description: | Implements Bayesian inference to detect signal from blinded clinical trial when total number of adverse events of special concerns and total risk exposures from all patients are available in the study. For more details see the article by Mukhopadhyay et. al. (2018) titled 'Bayesian Detection of Potential Risk Using Inference on Blinded Safety Data', in Pharmaceutical Statistics (to appear). |
Depends: | R (≥ 3.1.0), rjags |
Note: | Package 'rjags' requires JAGS executabe file (compatiable version) should be already installed. |
License: | GPL-2 |
LazyData: | TRUE |
RoxygenNote: | 6.0.1 |
NeedsCompilation: | no |
Packaged: | 2018-08-25 22:08:46 UTC; mukhosx |
Author: | Saurabh Mukhopadhyay [aut, cre] |
Repository: | CRAN |
Date/Publication: | 2018-08-31 17:50:17 UTC |
bdribs (Bayesian Detection of Risk using Inference on Blinded Safety data)
Description
Bayesian Detection of Risk using Inference on Blinded Safety data
Usage
bdribs(y, pyr, bg.events, bg.pyr, bg.rate = NULL, k = 1, p.params = list(a
= 1, b = 1), r.params = list(mu = 0, sd = 2), adj.k = FALSE,
mc.params = list(burn = 1000, iter = 10000, nc = 2), inf.type = 1,
plots = TRUE, prnt = TRUE)
Arguments
y |
observed pooled events (combined active and control group) e.g., y = 20 |
pyr |
total payr exposure (combined active and control group) e.g., pyr = 2000 |
bg.events |
background (historical) events for the control group e.g., bg.events = 5 |
bg.pyr |
background (historical) pyr exposure for the control group e.g., bg.pyr = 1000 |
bg.rate |
when specified used as the true background rate for the control group and ignores bg.events and bg.pyr, default: bg.rate=NULL |
k |
allocation ratio of treatment vs. control group, default: k=1 |
p.params |
paramaters of beta prior of p (used only when inf.type = 1 or = 2); default: p.param= list(a=1,b=1). See details below. |
r.params |
paramaters of log-normal prior of r (used only when p.params=NULL); default: r.param= list(mu=0,sd=2). See details below. |
adj.k |
when TRUE adjusts the prior specification for k >1 (or for k <1), default: adj.k = FALSE . See deatil below. |
mc.params |
contains detials of MCMC parameters, default: mc.params=list(burn=1000, iter=10000, nc=2) |
inf.type |
indicate inference type, default: inf.type =1 (gives conditional inference for fixed background rate). See deatil below. |
plots |
indicates whether standard plots to be generated, default: plots= TRUE |
prnt |
indicates whether inputs to be printed, default: prnt= TRUE |
Details
This 'bdribs' package obtains Bayesian inferences on blinded pooled safety data ...
Values of p.params are used to specify a beta prior for p - default is Jeffreys non-informative prior: Beta(a=0.5,b=0.5).
If inf.type=1, then conditional posterior inference on r is obtained for a given fixed values of del0 = bg.rate = bg.events/bg.pyr.
If inf.type=2, then an average (marginal) Bayesian inference on r is obtained with respect to a prior on del0, where del0 ~ Gamma(bg.events, bg.pyr).
If prior on r must be specified directly it can be done by using a log-normal prior. To do that, p.params must be set to NULL and and then r.params should be specifed as a list to supply mean and sd of the lognormal. For example, to have a lognormal prior with log-mean 0 and log-sd = 2, we should set r.params = list(mu=0, sd=2) and p.params=NULL.
when adj.k = TRUE, and k is not 1 (that is, allocation ratio is not 1:1), then a non-informative prior such as (beta(.5, .5) is first specified on p, assuming equal allocation ratio and then adjusted for the give k. When adj.k = F, then no such adjustment is made on the prior for p. Note that no such adjustments needed if prior on r is directly specified (as discussed above). However, it is always difficult to specify a non-informative prior on r and therefore a a prior on p with adj.k =T is recommended in most cases.
Value
returns a dataframe of MCMC output from the posterior distribution for parameters of interests
Author(s)
Saurabh Mukhopadhyay
Examples
## Sample calls
#run 1: simple case with a fixed background rate of 0.45 per 100 pyr.
bdribs(y=5,pyr=500, bg.rate=0.0045,k=2)
#run 2: same as run 1; here bg.rate gets computed as bg.events/bg.pyr
bdribs(y=5,pyr=500, bg.events = 18, bg.pyr = 4000, k=2)
# run3: when inf.type = 2, uses a Gamma distribution for del0; e.g. here Gamma(18, 4000)
bdribs(y=5,pyr=500, bg.events = 18, bg.pyr = 4000, k=2, inf.type = 2)
#run4: similar to run1, but instead of default p~u(0,1) using p~beta(.5,.5)
bdribs(y=5,pyr=500, , bg.rate=0.0045,k=2, p.params=list(a=.5,b=.5))
#run5: similar to run1, but instead of default p ~ beta(.5,.5) using r ~ lognormal(mu=0,sd=2)
bdribs(y=5,pyr=500, , bg.rate=0.0045,k=2, p.params= NULL, r.params=list(mu=0,sd=2))
contour plot - draws plot (optional) and returns a matrix/grid of posterior values
Description
Contour plot of posterior probabilities on a range of (y, E) values
Usage
bdribs.contour(ymax, pyrmax, eincr, tol, k, bg.rate, plt = TRUE, ...)
Arguments
ymax |
maximum number of AESI event for which contour plot to be drawn |
pyrmax |
maximum risk exposure (in patient-year) |
eincr |
increment of patient-year exposures (default = 50) |
tol |
the maximum tolerance value of relative risk r (default =1) |
k |
allocation ratio (T:C) |
bg.rate |
estimated background rate (historical control rate) per patient-year (using inf.type=1) |
plt |
whether a contour plot to be drawn (default = TRUE) |
... |
to supply remaining parameters for bdribs call when supplied will override the default values |
Value
returns contour plot matrix over the grid specified
Examples
## Sample calls
#run 1: The contour plot
bdribs.contour(ymax=15,pyrmax=2000,eincr=250,tol=1.5,k=2, bg.rate=0.0045)
#run 2: Monitoring blinded AE over time using contour plot
bdribs.contour(ymax=15,pyrmax=2000,eincr=250,tol=1.5,k=2, bg.rate=0.0045)
obs.pyr=c(300,570,650,800, 1200, 1500)
obs.y=c(2,4,5,6,10,12)
points(obs.pyr, obs.y,type="p",pch=16, cex=1.4,col="maroon")
if (length(obs.y)>1) points(c(0,obs.pyr), c(0,obs.y), type="s", lty=3, lwd=2,
col="black")
sensitivity plot - plot of range of posterior probability corresponding to a range of background rate
Description
plot of range of posterior probability corresponding to a range of background rate
Usage
bdribs.sensitivity(Y = 5:9, pyr = 800, k = 1, tol = 1.2, bg.evnt = 18,
bg.pyr = 4000, bg.ci.coef = 0.9, bg.rng = NULL, add.mid = FALSE, ...)
Arguments
Y |
range on number of AESI events for which sensitivity range to be drawn (default = 5:9) |
pyr |
total patient-year exposure where AESI events occurred (default =800) |
k |
allocation ratio (T:C) (default =1) |
tol |
clinically meaningful relative risk (default =1.2) |
bg.evnt |
background (historical) number of events in the control group (default =18) |
bg.pyr |
background (historical) patient-year exposure in the control group (default =4000) |
bg.ci.coef |
range of background rate estimate to be obtained from bg.ci.coef*100% CI (default =0.9); takes any value between 0.5 and 0.999. |
bg.rng |
range of background rate - if specified then bg.evnt, bg.pyr, and bg.ci.coef will be ignored (default =NULL) |
add.mid |
indicator variable to plot P(r>tol | Y, pyr) under inf.type=2 - requires related parameters to be supplied (default =F) |
... |
to supply remaining parameters of bdribs call (other than y, pyr, k, bg.events, bg.pyr) for bdribs call when supplied will override the default values |
Value
returns a plot of P(r>tol | Y, pyr) over the range of background rate
Examples
## Sample calls
#run 1: The sensitivity plot
bdribs.sensitivity(Y=5:9,pyr=800,k=1, tol=1.2, bg.evnt=18, bg.pyr=4000,bg.ci.coef=0.90)
#run 2: The sensitivity plot
bdribs.sensitivity(Y=5:9,pyr=800,k=1, tol=1.2, bg.evnt=18, bg.pyr=4000,bg.ci.coef=0.90,
add.mid=TRUE)
#run 3: Using bg.rng parameter
bdribs.sensitivity(Y=5:9,pyr=800,k=1, tol=1.2, bg.rng = c(0.0030, 0.0045, 0.0065))