Package 'bacistool'

Title: Bayesian Classification and Information Sharing (BaCIS) Tool for the Design of Multi-Group Phase II Clinical Trials
Description: Provides the design of multi-group phase II clinical trials with binary outcomes using the hierarchical Bayesian classification and information sharing (BaCIS) model. Subgroups are classified into two clusters on the basis of their outcomes mimicking the hypothesis testing framework. Subsequently, information sharing takes place within subgroups in the same cluster, rather than across all subgroups. This method can be applied to the design and analysis of multi-group clinical trials with binary outcomes. Reference: Nan Chen and J. Jack Lee (2019) <doi:10.1002/bimj.201700275>.
Authors: Nan Chen and J. Jack Lee
Maintainer: J. Jack Lee <[email protected]>
License: GNU General Public License (>= 3)
Version: 1.0.0
Built: 2024-11-06 05:12:08 UTC
Source: https://github.com/cran/bacistool

Help Index


Compute the DIC value for the classification model.

Description

In this function, the classification model is applied using the input parameter values and the DIC value is calculated.

Usage

bacisCheckDIC(numGroup, tau1, tau2, phi1, phi2,
               MCNum, nDat, xDat, seed)

Arguments

numGroup

Number of subgroups in the trial.

tau1

The precision parameter of subgroups clustering for the classification model.

tau2

The precision prior for the latent variable for the classification.

phi1

Center for the low response rate cluster.

phi2

Center for the high response rate cluster.

MCNum

The number of MCMC sampling iterations.

nDat

The vector of total sample sizes of all subgroups.

xDat

The vector of the response numbers of all subgroups.

seed

Random seed value. If its value is NA, a time dependent random seed is generated and applied.

Value

The classification model is applied using the input parameter values and the DIC value is returned.

Author(s)

Nan Chen and J. Jack Lee / Department of Biostatistics UT MD Anderson Cancer Center

Examples

## An example to compute the DIC value.
library(bacistool)
result<-bacisCheckDIC(numGroup=5,
                      tau1=NA,
                      tau2=.001,
                      phi1=0.1, phi2=0.3,
                      MCNum=5000,
                      nDat=c(25,25,25,25,25),
                      xDat=c(3,4,3,8,7),
                      seed=100
                      )

Conduct classification for subgroups.

Description

The classification model is conducted based on the BaCIS method and the subgroupos are classified into two clusters: high respone rate cluster and low response rate cluster.

Usage

bacisClassification(numGroup, tau1, tau2, phi1, phi2,
                    clusterCutoff, MCNum, nDat, xDat, seed)

Arguments

numGroup

Number of subgroups in the trial.

tau1

The precision parameter of subgroups clustering for the classification model.

tau2

The precision prior for the latent variable for the classification.

phi1

Center for the low response rate cluster.

phi2

Center for the high response rate cluster.

clusterCutoff

The cutoff value of the cluster classification. If its value is NA, adaptive classification is applied.

MCNum

The number of MCMC sampling iterations.

nDat

The vector of total sample sizes of all subgroups.

xDat

The vector of the response numbers of all subgroups.

seed

Random seed value. If its value is NA, a time dependent random seed is generated and applied.

Value

The classification model is applied using the input parameter values and subgroup outcomes. The classification results are returned. The return list includes highResponseGroup and lowResponseGroup index vlaues.

Author(s)

Nan Chen and J. Jack Lee / Department of Biostatistics UT MD Anderson Cancer Center

Examples

## An example to conduct subgroup classification.

library(bacistool)
result<-bacisClassification(numGroup=5,
                      tau1=NA,
                      tau2=.001,
                      phi1=0.1, phi2=0.3,
                      clusterCutoff = NA,
                      MCNum=5000,
                      nDat=c(25,25,25,25,25),
                      xDat=c(3,4,3,8,7),seed=100)

Running one trial computation based on the BaCIS model.

Description

The bacisOneTrial function takes data and parameter values as input. It conducts a trial computation based on the BaCIS model. It calls the JAGS for the Bayesian MCMC sampling for the subgroup classification and hierarchical model information borrowing. It illustrates plots of the classficaiton results and the posterior response distributions of subgroups, and returns the inference results.

Usage

bacisOneTrial(numGroup, tau1, tau2, phi1, phi2, tau4, alpha, beta,
            clusterCutoff, finalCutoff, MCNum, nDat,xDat, cols,
            clusterCols, yLim, seed)

Arguments

numGroup

Number of subgroups in the trial.

tau1

The precision parameter of subgroups clustering for the classification model.

tau2

The precision prior for the latent variable for the classification.

phi1

Center for the low response rate cluster.

phi2

Center for the high response rate cluster.

tau4

The precision prior for the center of the cluster in the information borrowing model.

alpha

Hyperprior parameters alpha to control the magnitude of information borrowing model.

beta

Hyperprior parameters beta to control the magnitude of the information borrowing model.

clusterCutoff

The cutoff value of the cluster classification. If its value is NA, adaptive classification is applied.

finalCutoff

The posterior cutoff value of the final inference for each subgroup.

MCNum

The number of MCMC sampling iterations.

nDat

The vector of total sample sizes of all subgroups.

xDat

The vector of the response numbers of all subgroups.

cols

The color vector of all subgroups in the illustration.

clusterCols

The color vector of all clusters in the illustration.

yLim

The maximum Y-axis value in the illustration.

seed

Random seed value. If its value is NA, a time dependent random seed is generated and applied.

Value

The trial simulation illustrates the plot of posterior distribution of classificaiton, posterior response rates of all subgroups, and the posterior response distributions of two clusters.

It also return a matrix including the following information of all subgroups:

Prob(p_i>phi_1)

Posterior probability of response probability being greater than phi_1.

Prob(p_i>phi_2)

Posterior probability of response probability being greater than phi_2.

theta>0

Posterior probability of latent variable being greater than 0.

Classified to high response cluster

0: Classified into the lower response cluster, 1: classified into the high response cluster.

The treatment is effective

0: The subgroup is not effective, 1: the subgroup is effective.

Posterior Resp.

Posterior response rates of subgroups.

Observed Resp.

Observe response rates of subgroups.

Number of response

Number of responses of subgroups.

Total sample size

Total sample sizes of subgroups.

Effective sample size

Effective sample sizes of subgroups.

Author(s)

Nan Chen and J. Jack Lee / Department of Biostatistics UT MD Anderson Cancer Center

Examples

## Not run: 
## An example for running a simulation trial using the BaCIS method
library(bacistool)
bacisOneTrial(
  numGroup=5,
  tau1=NA,
  tau2=.001,
  phi1=0.1, phi2=0.3,
  tau4=0.1,
  alpha=50,
  beta=2,
  clusterCutoff = NA,
  finalCutoff = 0.92,
  MCNum=50000,
  nDat=c(25,25,25,25,25),
  xDat=c(2,3,7,6,10),
  cols=c("brown","red","orange","blue","green"),
  clusterCols=c(6,4),
  yLim=22,
  seed=100
)

## End(Not run)

Plot the posterior density of θ\theta in the classification model.

Description

The classification model is conducted based on the BaCIS method and the posterior density of θ\theta is plotted.

Usage

bacisPlotClassification(numGroup, tau1, tau2, phi1, phi2,
                        clusterCutoff, MCNum, nDat, xDat, cols, seed)

Arguments

numGroup

Number of subgroups in the trial.

tau1

The precision parameter of subgroups clustering for the classification model.

tau2

The precision prior for the latent variable for the classification.

phi1

Center for the low response rate cluster.

phi2

Center for the high response rate cluster.

clusterCutoff

The cutoff value of the cluster classification. If its value is NA, adaptive classification is applied.

MCNum

The number of MCMC sampling iterations.

nDat

The vector of total sample sizes of all subgroups.

xDat

The vector of the response numbers of all subgroups.

cols

The color vector of all subgroups in the illustration.

seed

Random seed value. If its value is NA, a time dependent random seed is generated and applied.

Value

The classification model is conducted using the input parameter values and subgroup outcomes. The posterior density of θ\theta is plotted.

Author(s)

Nan Chen and J. Jack Lee / Department of Biostatistics UT MD Anderson Cancer Center

Examples

## Compute the posterior distribution of \eqn{\theta}.
library(bacistool)
bacisPlotClassification(numGroup=5,
                            tau1=NA,
                            tau2=.001,
                            phi1=0.1, phi2=0.3,
                            clusterCutoff=NA,
                            MCNum=5000,
                            nDat=c(25,25,25,25,25),
                            xDat=c(3,4,3,8,7),
                            cols = c("brown", "red", "orange", "blue", "green")

)

Compute the posterior distribution of response rates of subgroups using the BaCIS method.

Description

In this function, a trial computation is conducted based on the BaCIS model. It calls the JAGS for the Bayesian MCMC sampling for the subgroup classification and hierarchical model information borrowing. The response rate posterior distributions of subgroups are returned from this function.

Usage

bacisSubgroupPosterior(numGroup, tau1, tau2, phi1, phi2, tau4, alpha, beta,
                      clusterCutoff, MCNum, nDat, xDat, seed)

Arguments

numGroup

Number of subgroups in the trial.

tau1

The precision parameter of subgroups clustering for the classification model.

tau2

The precision prior for the latent variable for the classification.

phi1

Center for the low response rate cluster.

phi2

Center for the high response rate cluster.

tau4

The precision prior for the center of the cluster in the information borrowing model.

alpha

Hyperprior parameters alpha to control the magnitude of information borrowing model.

beta

Hyperprior parameters beta to control the magnitude of the information borrowing model.

clusterCutoff

The cutoff value of the cluster classification. If its value is NA, adaptive classification is applied.

MCNum

The number of MCMC sampling iterations.

nDat

The vector of total sample sizes of all subgroups.

xDat

The vector of the response numbers of all subgroups.

seed

Random seed value. If its value is NA, a time dependent random seed is generated and applied.

Value

The MCMC sampling data of the response rate posterior distributions of all subgroups is returned as an matrix format. Each column of the return matrix corresponds to the response rate distribution of one subgroup.

Author(s)

Nan Chen and J. Jack Lee / Department of Biostatistics UT MD Anderson Cancer Center

Examples

## Compute the response rate posterior distributioni
## of each subgroup using the BaCIS method
## Not run: 
library(bacistool)
result<-bacisSubgroupPosterior(numGroup=5,
                               tau1=NA,
                               tau2=.001,
                               phi1=0.1, phi2=0.3,
                               tau4=0.1,
                               alpha=50,
                               beta=20,
                               clusterCutoff=NA,
                               MCNum=5000,
                               nDat=c(25,25,25,25,25),
                               xDat=c(3,4,3,8,7))



## End(Not run)

Compute the posterior distribution of θ\theta in the classification model.

Description

The classification model is conducted based on the BaCIS method and the posterior distribution of θ\theta is returned for further analyses.

Usage

bacisThetaPosterior(numGroup, tau1, tau2, phi1, phi2,
                     MCNum, nDat, xDat, seed)

Arguments

numGroup

Number of subgroups in the trial.

tau1

The precision parameter of subgroups clustering for the classification model.

tau2

The precision prior for the latent variable for the classification.

phi1

Center for the low response rate cluster.

phi2

Center for the high response rate cluster.

MCNum

The number of MCMC sampling iterations.

nDat

The vector of total sample sizes of all subgroups.

xDat

The vector of the response numbers of all subgroups.

seed

Random seed value. If its value is NA, a time dependent random seed is generated and applied.

Value

The classification model is conducted using the input parameter values and subgroup outcomes. The posterior distribution of θ\theta is returned. The returned value is an matrix in which each column corresponds the data of one subgroup.

Author(s)

Nan Chen and J. Jack Lee / Department of Biostatistics UT MD Anderson Cancer Center

Examples

## Conduct subgroup classification and
## compute the posterior distribution of \eqn{\theta}.

library(bacistool)
result<-bacisThetaPosterior(numGroup=5,
                      tau1=NA,
                      tau2=.001,
                      phi1=0.1, phi2=0.3,
                      MCNum=5000,
                      nDat=c(25,25,25,25,25),
                      xDat=c(3,4,3,8,7)
)