knitr::opts_chunk$set(echo = TRUE) library( kableExtra) options(tinytex.verbose = TRUE)
#library(tidyverse) #library(ggplot2) #library( OCTOPUS ) source("PostProcess.R") # This file contains the functionality to process the simulation results and plot
In this simulation we consider a platform trial with 2 Intervention Specific Appendix (ISAs). There are 3 designs simulated. Designs 1 and 2 do not include an interim analysis where as Design 3 has 1 interim analysis for each ISA when half the patients enrolled and followed for the desired time.
The sample sizes and borrowing for the designs are as follows:
load( "cTrialDesign.RData") load( "lTrialDesigns.RData") nQtyDesigns <- length( lTrialDesigns ) nQtyISAs <- lTrialDesigns[[1]]$nQtyISAs iDesign <- 1 iISA <- 1 strDesignDesc <- "" for( iDesign in 1:nQtyDesigns ) { strDesignDesc <- paste( strDesignDesc, "- **Design", iDesign," **\n" ) for( iISA in 1:lTrialDesigns[[1]]$nQtyISAs ) { strBorrow <- class( lTrialDesigns[[ iDesign ]]$cISADesigns[[ iISA ]]$cISAAnalysis ) if( strBorrow == "NoBorrowing") strBorrow <- "No Borrowing" else strBorrow <- "Share Controls" vQtyPats <- lTrialDesigns[[ iDesign ]]$cISADesigns[[ iISA ]]$vQtyPats strDesignDesc <- paste(strDesignDesc, paste( "\t- *ISA", iISA, "*- Borrowing: ", strBorrow, ", # Patients on Control:", vQtyPats[1], ", # Patients on Treatment:", vQtyPats[2], "\n", sep="" )) } strDesignDesc <- paste( strDesignDesc, "\n \n \n") }
r strDesignDesc
All analysis and decisions are the same for the interim analysis, if included, and the final analysis.
The default analysis included with this example computes probabilities that the difference between treatment (T) and control (C) is greater than the Minimum Acceptable Value (MAV), specifically, $p_{MAV} =Pr( \pi_T - \pi_C > MAV | data )$ .
At an interim analysis, the default decisions from OCTOPUS are utilized see help with with ?MakeDecisionBasedOnPostProb.MAVOnly. In particular, if $p_{MAV} >$ r lTrialDesigns[[3]]$cISADesigns$cISA1$cISAAnalysis$vAnalysis[[1]]$vPUpper[1]
the a Go is declared and the ISA is stopped early; If $p_{MAV} <$ r lTrialDesigns[[3]]$cISADesigns$cISA1$cISAAnalysis$vAnalysis[[1]]$vPLower[1]
then a No Go is declared an the ISA stopped early; otherwise an indeterminate decision is made and the trial continues.
At the end of an ISA the final analysis is performed and if $p_{MAV} >$ r cTrialDesign$cISADesigns$cISA1$cISAAnalysis$vAnalysis[[1]]$dFinalPUpper
the a Go is declared; if $p_{MAV} <$ r cTrialDesign$cISADesigns$cISA1$cISAAnalysis$vAnalysis[[1]]$dFinalPLower
then a No Go is declared for the ISA; Otherwise, the decision is indeterminate.
Describe scenarios... Possibly like the following, but typically best to read of the simulation design elements just in case the scenarios change.
Scenario 1 - Null case
Scenario 2 - Difference in ...
# Now create the graphs based on the results#### lResults <- ProcessSimulationResults( ) # # Get a subset of the results - We will use this for splitting scenarios into meaningful graphs dfResSub <- lResults$mResults#[ lResults$mResults$scenario <=7, ] vScenarioLabel <-c() vScenarioLabel <- vScenarioLabel PlotResultsWithIAInfo( dfResSub, vScenarioLabel = vScenarioLabel) #PlotSubgroupResults( lResults$mSubgroupRes )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.