Package 'ClinTrialPredict'

Title: Predicting and Simulating Clinical Trial with Time-to-Event Endpoint
Description: Predict the course of clinical trial with a time-to-event endpoint for both two-arm and single-arm design. Each of the four primary study design parameters (the expected number of observed events, the number of subjects enrolled, the observation time, and the censoring parameter) can be derived analytically given the other three parameters. And the simulation datasets can be generated based on the design settings.
Authors: Yang Ding [aut, cre]
Maintainer: Yang Ding <[email protected]>
License: MIT + file LICENSE
Version: 0.0.4
Built: 2024-11-26 05:54:28 UTC
Source: https://github.com/tomdingbiostat/clintrialpredict

Help Index


Calculate the censoring rate for a one-arm design

Description

Calculate the censoring rate for a one-arm design

Usage

CensRate.OneArm(
  N = NULL,
  d = NULL,
  s = NULL,
  m = NULL,
  l = NULL,
  alpha = NULL,
  nu = NULL
)

Arguments

N

Number of subjects plan to enrolled

d

expected number of events observed at time l

s

enrollment period

m

maximum follow-up for a single subject

l

observation time

alpha

shape parameter of weibull survival distribution

nu

scale parameter of weibull survival distribution

Value

This function returns a list containing all design parameters, including the calculated censoring rate gamma.

Examples

CensRate.OneArm(N=100,d=10,l=10,s=12,m=6,alpha=1,nu=20)

Calculate the censoring rate for a two-arm clinical trial

Description

Calculate the censoring rate for a two-arm clinical trial

Usage

CensTime.TwoArm(
  N.0 = NULL,
  N.1 = NULL,
  d = NULL,
  l = NULL,
  alpha0.t = NULL,
  nu0.t = NULL,
  alpha1.t = NULL,
  nu1.t = NULL,
  s = NULL,
  m = NULL,
  design2 = NULL
)

Arguments

N.0

number of subjects plan to be enrolled in control arm

N.1

number of subjects plan to be enrolled in experimental arm

d

expected number of events observed at time l

l

observation time

alpha0.t

shape parameter of weibull survival distribution for control arm

nu0.t

scale parameter of weibull survival distribution for control arm

alpha1.t

shape parameters of weibull survival distribution for experimental arm

nu1.t

scale parameter of a weibull survival distribution for control arm

s

enrollment time

m

maximum follow-up time for a subject

design2

a list containing all the above parameters for two-arm design

Value

This function returns a list containing all design parameters, including the calculated censoring rate gamma.c

Examples

#calculate the censoring parameter
CensTime.TwoArm(N.0=100,N.1=100,d=10,l=3,alpha0.t=1,nu0.t=5,alpha1.t=2,nu1.t=4,s=5,m=4)

Calculate the expected number of events or number of subjects enrolled in a one-arm clinical trial

Description

Calculate the expected number of events or number of subjects enrolled in a one-arm clinical trial

Usage

NumEventsSub.OneArm(
  N = NULL,
  d = NULL,
  l = NULL,
  gamma = NULL,
  s = NULL,
  m = NULL,
  alpha = NULL,
  nu = NULL,
  design1 = NULL
)

Arguments

N

Number of subjects plan to enrolled

d

expected number of events observed at time l

l

observation time

gamma

parameter of the exponential distribution of censoring time

s

enrollment period

m

maximum follow-up for a single subject

alpha

shape parameter of weibull survival distribution

nu

scale parameter of weibull survival distribution

design1

a list containing all the above parameters for one-arm design

Value

This function returns a list containing all design parameters as the same with input parameters of this function.

Examples

# Calculate the expected number of events in a one-arm clinical trial
NumEventsSub.OneArm(N=100,d=NULL,l=3,gamma=0.1,s=12,m=6,alpha=1,nu=20)

Calculate the expected number of events or number of subjects enrolled in a two-arm clinical trial

Description

Calculate the expected number of events or number of subjects enrolled in a two-arm clinical trial

Usage

NumEventsSub.TwoArm(
  N.0 = NULL,
  N.1 = NULL,
  ratio = NULL,
  d = NULL,
  l = NULL,
  gamma.c = NULL,
  alpha0.t = NULL,
  nu0.t = NULL,
  alpha1.t = NULL,
  nu1.t = NULL,
  s = NULL,
  m = NULL,
  design2 = NULL
)

Arguments

N.0

number of subjects plan to be enrolled in control arm

N.1

number of subjects plan to be enrolled in experimental arm

ratio

randomization ratio between two arms: N.1 / N.0

d

expected number of events observed at time l

l

observation time

gamma.c

parameter of the exponential distribution of censoring time

alpha0.t

shape parameter of weibull survival distribution for control arm

nu0.t

scale parameter of weibull survival distribution for control arm

alpha1.t

shape parameters of weibull survival distribution for experimental arm

nu1.t

scale parameter of a weibull survival distribution for control arm

s

enrollment time

m

maximum follow-up time for a subject

design2

a list containing all the above parameters for two-arm design

Value

This function returns a list containing all design parameters as the same with input parameters of this function.

Examples

# calculate the expected number of events
NumEventsSub.TwoArm(N.0=100,N.1=100,l=6,gamma.c=1,alpha0.t = 1,nu0.t=5,alpha1.t=2,nu1.t=4,s=5,m=4)

# calculate the expeTrcted number of events using a list as input
design2 <- list(N.0=100,N.1=100,l=6,gamma.c=1,alpha0.t = 1,nu0.t=5,alpha1.t=2,nu1.t=4,s=5,m=4)
NumEventsSub.TwoArm(design2=design2)

# calculate the number of subject enrolled
NumEventsSub.TwoArm(ratio=1,d=24,l=6,gamma.c=1,alpha0.t = 1,nu0.t=5,alpha1.t=2,nu1.t=4,s=5,m=4)

Calculate the observation time for a one-arm clinical trial

Description

Calculate the observation time for a one-arm clinical trial

Usage

ObsTime.OneArm(
  N = NULL,
  d = NULL,
  s = NULL,
  m = NULL,
  alpha = NULL,
  nu = NULL,
  gamma = NULL
)

Arguments

N

Number of subjects plan to enrolled

d

expected number of events observed at time l

s

enrollment period

m

maximum follow-up for a single subject

alpha

shape parameter of weibull survival distribution

nu

scale parameter of weibull survival distribution

gamma

parameter of the exponential distribution of censoring time

Value

This function returns a list containing all design parameters, including the calculated observation time l.

Examples

ObsTime.OneArm(N=100,d=10,gamma=0.1,s=12,m=6,alpha=1,nu=20)

Calculate the observation time for a two-arm clinical trial

Description

predicting two-arm clinical trial

Usage

ObsTime.TwoArm(
  N.0 = NULL,
  N.1 = NULL,
  ratio = NULL,
  d = NULL,
  gamma.c = NULL,
  alpha0.t = NULL,
  nu0.t,
  alpha1.t,
  nu1.t,
  s,
  m,
  design2 = NULL
)

Arguments

N.0

number of subjects plan to be enrolled in control arm

N.1

number of subjects plan to be enrolled in experimental arm

ratio

randomization ratio between two arms: N.1 / N.0

d

expected number of events observed at time l

gamma.c

parameter of the exponential distribution of censoring time

alpha0.t

shape parameter of weibull survival distribution for control arm

nu0.t

scale parameter of weibull survival distribution for control arm

alpha1.t

shape parameters of weibull survival distribution for experimental arm

nu1.t

scale parameter of a weibull survival distribution for control arm

s

enrollment time

m

maximum follow-up time for a subject

design2

a list containing all the above parameters for two-arm design

Value

This function returns a list containing all design parameters, including the calculated observation time l

Examples

# calculate the observation time
ObsTime.TwoArm(N.0=100,N.1=100,d=10,gamma.c=1,alpha0.t = 1,nu0.t=5,alpha1.t=2,nu1.t=4,s=5,m=4)

Simulating survival dataset for a one-arm design

Description

Simulating survival dataset for a one-arm design

Usage

SimData.OneArm(
  N = NULL,
  d = NULL,
  l = NULL,
  gamma = NULL,
  s = NULL,
  m = NULL,
  alpha = NULL,
  nu = NULL,
  design1,
  seed,
  nsim
)

Arguments

N

Number of subjects plan to enrolled

d

expected number of events observed at time l

l

observation time

gamma

parameter of the exponential distribution of censoring time

s

enrollment period

m

maximum follow-up for a single subject

alpha

shape parameter of weibull survival distribution

nu

scale parameter of weibull survival distribution

design1

a list containing all the above parameters for one-arm design

seed

random seed number

nsim

number of simulations

Value

This function will return the simulated datasets and the according design settings

Examples

design1 <- TrialPred.OneArm(N=100,d=NULL,l=3,gamma=0.1
                                     ,s=12,m=6,alpha=1,nu=20)
# Simulate 100 datasets under design1
SimData.OneArm(design1=design1,seed=1234,nsim=100)

Simulating survival dataset for a two-arm design

Description

Simulating survival dataset for a two-arm design

Usage

SimData.TwoArm(
  N.0 = NULL,
  N.1 = NULL,
  ratio = NULL,
  d = NULL,
  l = NULL,
  gamma.c = NULL,
  s = NULL,
  m = NULL,
  alpha0.t = NULL,
  nu0.t = NULL,
  HR = NULL,
  alpha1.t = NULL,
  nu1.t = NULL,
  design2 = NULL,
  seed = NULL,
  nsim = NULL
)

Arguments

N.0

number of subjects plan to be enrolled in control arm

N.1

number of subjects plan to be enrolled in experimental arm

ratio

randomization ratio between two arms: N.1 / N.0

d

expected number of events observed at time l

l

observation time

gamma.c

parameter of the exponential distribution of censoring time

s

enrollment time

m

maximum follow-up time for a subject

alpha0.t

shape parameter of weibull survival distribution for control arm

nu0.t

scale parameter of weibull survival distribution for control arm

HR

hazard ratio of experimental group over control group

alpha1.t

shape parameters of weibull survival distribution for experimental arm

nu1.t

scale parameter of a weibull survival distribution for control arm

design2

a list containing all the above parameters for two-arm design

seed

random seed

nsim

number of simulations

Value

This function will return the simulated datasets and the according design settings

Examples

design2 <- NumEventsSub.TwoArm(N.0=100,N.1=100,l=6,gamma.c=1
                                         ,alpha0.t = 1,nu0.t=5,alpha1.t=2,nu1.t=4,s=5,m=4)
SimData.TwoArm(design2=design2,seed=1234,nsim=100)

Function for predicting one-arm clinical trial

Description

Function for predicting one-arm clinical trial

Usage

TrialPred.OneArm(
  N = NULL,
  d = NULL,
  l = NULL,
  gamma = NULL,
  s = NULL,
  m = NULL,
  alpha = NULL,
  nu = NULL,
  design1 = NULL
)

Arguments

N

Number of subjects plan to enrolled

d

expected number of events observed at time l

l

observation time

gamma

parameter of the exponential distribution of censoring time

s

enrollment period

m

maximum follow-up for a single subject

alpha

shape parameter of weibull survival distribution

nu

scale parameter of weibull survival distribution

design1

a list containing all the above parameters for one-arm design

Value

This function returns a list containing all design parameters as the same with input parameters of this function. If any one of the parameters d, N, l or gamma is missing, it can be calculated based on the other parameters.

Examples

# Calculate the expected number of events in a one-arm clinical trial
TrialPred.OneArm(N=100,d=NULL,l=3,gamma=0.1,s=12,m=6,alpha=1,nu=20)

#Calculate the expected number of events using a list as input
design1 <- list(N=100,d=NULL,l=3,gamma=0.1,s=12,m=6,alpha=1,nu=20)
TrialPred.OneArm(design1=design1)

#Calculate the number of subjects enrolled
TrialPred.OneArm(N=NULL,d=8,l=15,gamma=0.1,s=12,m=6,alpha=1,nu=20)

#Calculate the observation time
TrialPred.OneArm(N=100,d=10,l=NULL,gamma=0.1,s=12,m=6,alpha=1,nu=20)

#Calculate the censoring parameter gamma
TrialPred.OneArm(N=100,d=10,l=10,gamma=NULL,s=12,m=6,alpha=1,nu=20)

Function for predicting two-arm clinical trial

Description

predicting two-arm clinical trial

Usage

TrialPred.TwoArm(
  N.0 = NULL,
  N.1 = NULL,
  ratio = NULL,
  d = NULL,
  l = NULL,
  gamma.c = NULL,
  alpha0.t = NULL,
  nu0.t = NULL,
  HR = NULL,
  alpha1.t = NULL,
  nu1.t = NULL,
  s = NULL,
  m = NULL,
  design2 = NULL
)

Arguments

N.0

number of subjects plan to be enrolled in control arm

N.1

number of subjects plan to be enrolled in experimental arm

ratio

randomization ratio between two arms: N.1 / N.0

d

expected number of events observed at time l

l

observation time

gamma.c

parameter of the exponential distribution of censoring time

alpha0.t

shape parameter of weibull survival distribution for control arm

nu0.t

scale parameter of weibull survival distribution for control arm

HR

hazard ratio of experimental group over control group

alpha1.t

shape parameters of weibull survival distribution for experimental arm

nu1.t

scale parameter of a weibull survival distribution for control arm

s

enrollment time

m

maximum follow-up time for a subject

design2

a list containing all the above parameters for two-arm design

Value

This function returns a list containing all design parameters as the same with input parameters of this function. If any one of the parameters d, N.0(or N.1), l or gamma.c is missing, it can be calculated based on the other parameters.

Examples

# calculate the expected number of events
TrialPred.TwoArm(N.0=100,N.1=100,d=NULL,l=6,gamma.c=1
                ,alpha0.t = 1,nu0.t=5,alpha1.t=2,nu1.t=4,s=5,m=4)

# calculate the expected number of events using a list as input
design2 <- list(N.0=100,N.1=100,d=NULL,l=6,gamma.c=1
                ,alpha0.t = 1,nu0.t=5,alpha1.t=2,nu1.t=4,s=5,m=4)
TrialPred.TwoArm(design2=design2)

# calculate the number of subject enrolled
TrialPred.TwoArm(N.0=NULL,N.1=NULL,ratio=1,d=24,l=6,gamma.c=1
                ,alpha0.t = 1,nu0.t=5,alpha1.t=2,nu1.t=4,s=5,m=4)

# calculate the observation time
TrialPred.TwoArm(N.0=100,N.1=100,d=10,l=NULL,gamma.c=1
                 ,alpha0.t = 1,nu0.t=5,alpha1.t=2,nu1.t=4,s=5,m=4)

# calculate the censoring parameter
TrialPred.TwoArm(N.0=100,N.1=100,d=10,l=3,gamma.c=NULL
                ,alpha0.t=1,nu0.t=5,alpha1.t=2,nu1.t=4,s=5,m=4)