apply_mcmc {psborrow}R 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:

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):


[Package psborrow version 0.2.1 Index]