apply_mcmc: Fit Dynamic Borrowing MCMC Model

View source: R/apply_mcmc.R

apply_mcmcR Documentation

Fit Dynamic Borrowing MCMC Model

Description

Fit a dynamic borrowing Weibull survival model to the given dataset and extract the posterior samples using MCMC. See the user guide for more information on the model formulation. See run_mcmc() for more information on the available parameters for tuning the MCMC sampling process

Usage

apply_mcmc(dt, formula_cov, ...)

extract_samples(object)

## S3 method for class 'apply_mcmc'
summary(object, ...)

Arguments

dt

A data.frame containing data required for modelling. See details

formula_cov

A one sided formula specifying which non-treatment covariates should be included into the model. See details

...

Additional arguments passed onto run_mcmc(). Only exception being the path argument which is not supported by this function

object

A apply_mcmc object created by apply_mcmc()

Details

apply_mcmc()

The dt data.frame must contain 1 row per subject with the following variables:

  • time - A continuous non-zero number specifying the time that the subject had an event at

  • cnsr - A column of 0/1's where 1 indicates that the event was censored/right truncated

  • ext - A column of 0/1's where 1 indicates that the subject was part of the external control

  • trt - A column of 0/1's where 1 indicates that the subject was receiving the experimental treatment

The dt data.frame may also contain any additional covariates to be used in the Weibull model as specified by formula_cov. In order to fit a valid model formula_cov must contain the intercept term. The formula will be automatically adjusted to include the treatment term and as such should not be included here, if you want to include a treatment interaction term this should be done by using ~ trt:covariate and NOT via ~ trt*covariate.

extract_samples()

This function can be used to extract the samples generated by apply_mcmc()

summary()

This function provides summary statistics about the samples generated by apply_mcmc()

Extracted Samples

The extracted samples can be roughly defined as follows (see the user guide for full details):

  • HR_cc_hc - The hazard ratio between the concurrent control arm and the historical control arm. This can be be thought of as the ratio of the scale parameter between the baseline trial distribution and the baseline external control distribution. This is equivalent to exp(alpha[2] - alpha[1])

  • HR_trt_cc - The hazard ratio between the treatment arm and the concurrent control arm. This is equivalent to exp(beta_trt)

  • alpha[1] - The shape parameter for the trial's baseline distribution

  • alpha[2] - The shape parameter for the historical control's baseline distribution

  • beta_trt - The log-hazard ratio for the treatment effect. This is equivalent to log(HR_trt_cc)

  • beta_<var> - The log-hazard ratio for any other covariate provided to the model via formula_cov

  • r0 - The scale parameter for the baseline distribution of both the trial and the historical control

  • tau/sigma - The precision/variance for alpha[1] i.e. controls how much information is borrowed from the historical control arm


psborrow documentation built on March 7, 2023, 8:32 p.m.