test_procedure {EventPredInCure}R Documentation

Function to provide summary and test statistics based on simulation.

Description

Provides summary and test statistics based on simulation.

Usage

test_procedure(
  pilevel = 0.9,
  nyears = 4,
  enroll_fit = enroll_fit,
  dropout_fit = dropout_fit,
  enroll_prior = NULL,
  event_prior_h0 = NULL,
  event_prior_ha = NULL,
  dropout_prior = NULL,
  target_n,
  target_IA_d,
  target_d,
  ialpha = 0.025,
  falpha,
  lag,
  by_fitted_enroll = FALSE,
  by_fitted_dropout = FALSE,
  treatment_label,
  ngroups = 2,
  alloc = NULL,
  nreps = 500,
  IA_included,
  test = "Superiority",
  test_IA = "Superiority",
  Futility_boundary = 1,
  seed.num = NULL
)

Arguments

pilevel

the confidence interval, the default is 0.95.

nyears

the year after data cutoff or follow-up.

enroll_fit

an object generated from fitEnrollment.

dropout_fit

an object generated from fitDropout.

enroll_prior

The prior of enrollment model parameters.

event_prior_h0

The prior of event model parameters under null hypothesis

event_prior_ha

The prior of event model parameters under alternative hypothesis

dropout_prior

The prior of dropout model parameters.

target_n

The target number of subjects to enroll in the study.

target_IA_d

number of events needed for interim analysis

target_d

number of events needed for primary analysis

ialpha

interim analysis alpha nominal value (only one interim allowed)

falpha

primary analysis alpha nominal value

lag

a scalar to denote time (days). Hazard ratio before and after this time would be calculated.

by_fitted_enroll

A Boolean variable to control whether or not to predict enrollment time with fitted model. By default, it is set to FALSE.

by_fitted_dropout

A Boolean variable to control whether or not to predict dropout time with fitted model. By default, it is set to FALSE.

treatment_label

The treatment labels for treatments in a randomization block for design stage prediction.

ngroups

The number of treatment groups for enrollment prediction at the design stage. By default, it is set to 2. It is replaced with the actual number of treatment groups in the observed data if df is not NULL.

alloc

The treatment allocation in a randomization block. By default, it is set to NULL, which yields equal allocation among the treatment groups.

nreps

The number of replications for simulation. By default, it is set to 500.

IA_included

A Boolean variable to control whether or not to include one interim analysis. By default, it is set to FALSE.

test

a character denotes the test type, includes "Superiority","Futility","Two-sided"

test_IA

a character denotes the test type in interim analysis, includes "Efficacy","Futility",or "Efficacy and Futility"

Futility_boundary

a positive number denotes the boundary of the Futility in the scale of hazard ratio

seed.num

The number of the random seed. The default is NULL.

Value

A list with following components

Examples


fit1 <- list(model = "piecewise uniform",
             theta = -0.58, 
             vtheta=0, accrualTime =0)
fit2<-list()
fit2[[1]] <- list(model = "weibull with cured population and delayed treatment", 
                  theta = c(-2.2,0,6.5,0,1), 
                  vtheta = matrix(0,5,5))
fit2[[2]] <- list(model = "weibull with cured population and delayed treatment", 
                 theta = c(-2.2,0,6.5,46,0.65), 
                 vtheta = matrix(0,5,5))
fit3 <-list()
fit3[[1]] <- list(model = "weibull with cured population and delayed treatment", 
                  theta = c(-2.2,0,6.5,0,1), 
                  vtheta = matrix(0,5,5))
fit3[[2]] <- list(model = "weibull with cured population and delayed treatment", 
                  theta = c(-2.2,0,6.5,0,1),
                  vtheta = matrix(0,5,5))
fit4 <-list()

fit4[[1]] <- list(model = "exponential", 
                   theta =log(0.0003), 
                   vtheta=0)
fit4[[2]] <- list(model = "exponential", 
                   theta =log(0.0003), 

                   vtheta=0)
test1<-test_procedure(pilevel=0.9,nyears=4,enroll_fit=fit1,
                      dropout_fit=fit4,enroll_prior=fit1,event_prior_h0=fit3,
                      event_prior_ha=fit2,dropout_prior=NULL,
                      target_n=200,target_IA_d=40,target_d=60,
                      ialpha=0.016,falpha=0.0450,
                      lag=46,by_fitted_enroll=FALSE,
                      by_fitted_dropout=FALSE,treatment_label=c('a','b'),
                      ngroups=2,alloc=c(1,1),nreps=100, IA_included=TRUE)
                       

[Package EventPredInCure version 1.0 Index]