summary.blrmfit: Summarise model results

View source: R/summary.R

summary.blrmfitR Documentation

Summarise model results

Description

Provides model summaries for blrm_exnex and blrm_trial analyses.

Usage

## S3 method for class 'blrmfit'
summary(
  object,
  newdata,
  transform = !predictive,
  prob = 0.95,
  interval_prob,
  predictive = FALSE,
  ...
)

Arguments

object

fitted model object

newdata

optional data frame specifying for what to predict; if missing, then the data of the input model object is used

transform

logical (defaults to FALSE) indicating if the linear predictor on the logit link scale is transformed with inv_logit to the 0-1 response scale.

prob

central probability mass to report, i.e. the quantiles 0.5-prob/2 and 0.5+prob/2 are displayed. Multiple central widths can be specified.

interval_prob

optional vector of sorted quantiles for which the interval probabilities are calculated

predictive

logical indicates if the posterior predictive is being summarized. Defaults to FALSE.

...

not used in this function

Details

The calculated posterior summaries are returned as a data.frame and contain optional interval probabilites for the specified vector of sorted quantiles. These summaries are calculated on the response scale by default and can be obtained on the link scale when setting transform=FALSE.

When the results are requested for the predictive distribution with predictive=TRUE, then the link scale refers to the total counts while the transformed scale divides the (predictive) counts by the number of trials such that results are on the 0-1 scale.

Value

Returns a data.frame of the key summaries of the posterior mean, standard deviation, central probability interval, median and optional interval probabilities. Each row of the data.frame corresponds to the respective input data which is by default the same data set as used for the blrm_exnex analysis or the data specified in the newdata argument.

Examples

## Setting up dummy sampling for fast execution of example
## Please use 4 chains and 100x more warmup & iter in practice
.user_mc_options <- options(OncoBayes2.MC.warmup=10, OncoBayes2.MC.iter=20, OncoBayes2.MC.chains=1,
                            OncoBayes2.MC.save_warmup=FALSE)

example_model("single_agent", silent=TRUE)

## obtain underdosing (0-0.16], target dosing (0.16-0.33] and
## overdosing (0.33-1] probabilities
summary(blrmfit, interval_prob=c(0,0.16,0.33,1))

## obtain predictive distribution for respective cohorts and
## calculate probability for no event, 1 event or >1 event
## note that this does the calculation for the cohort sizes
## as put into the data-set
summary(blrmfit, interval_prob=c(-1,0,1,10), predictive=TRUE)

## to obtain the predictive for a cohort-size of 6 for all patients
## in the data-set one would need to use the newdata argument, e.g.
summary(blrmfit, newdata=transform(hist_SA, num_patients=6),
                 interval_prob=c(-1,0,1,10), predictive=TRUE)

## Recover user set sampling defaults
options(.user_mc_options)


OncoBayes2 documentation built on July 26, 2023, 5:30 p.m.