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 |
Calculate the censoring rate for a one-arm design
CensRate.OneArm( N = NULL, d = NULL, s = NULL, m = NULL, l = NULL, alpha = NULL, nu = NULL )
CensRate.OneArm( N = NULL, d = NULL, s = NULL, m = NULL, l = NULL, alpha = NULL, nu = NULL )
N |
Number of subjects plan to enrolled |
d |
expected number of events observed at time |
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 |
This function returns a list containing all design parameters, including the calculated censoring rate gamma
.
CensRate.OneArm(N=100,d=10,l=10,s=12,m=6,alpha=1,nu=20)
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
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 )
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 )
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 |
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 |
This function returns a list containing all design parameters, including the calculated censoring rate gamma.c
#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 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
NumEventsSub.OneArm( N = NULL, d = NULL, l = NULL, gamma = NULL, s = NULL, m = NULL, alpha = NULL, nu = NULL, design1 = NULL )
NumEventsSub.OneArm( N = NULL, d = NULL, l = NULL, gamma = NULL, s = NULL, m = NULL, alpha = NULL, nu = NULL, design1 = NULL )
N |
Number of subjects plan to enrolled |
d |
expected number of events observed at time |
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 |
This function returns a list containing all design parameters as the same with input parameters of this function.
# 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 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
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 )
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 )
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: |
d |
expected number of events observed at time |
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 |
This function returns a list containing all design parameters as the same with input parameters of this function.
# 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 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
ObsTime.OneArm( N = NULL, d = NULL, s = NULL, m = NULL, alpha = NULL, nu = NULL, gamma = NULL )
ObsTime.OneArm( N = NULL, d = NULL, s = NULL, m = NULL, alpha = NULL, nu = NULL, gamma = NULL )
N |
Number of subjects plan to enrolled |
d |
expected number of events observed at 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 |
gamma |
parameter of the exponential distribution of censoring time |
This function returns a list containing all design parameters, including the calculated observation time l
.
ObsTime.OneArm(N=100,d=10,gamma=0.1,s=12,m=6,alpha=1,nu=20)
ObsTime.OneArm(N=100,d=10,gamma=0.1,s=12,m=6,alpha=1,nu=20)
predicting two-arm clinical trial
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 )
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 )
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: |
d |
expected number of events observed at 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 |
This function returns a list containing all design parameters, including the calculated observation time l
# 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)
# 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
SimData.OneArm( N = NULL, d = NULL, l = NULL, gamma = NULL, s = NULL, m = NULL, alpha = NULL, nu = NULL, design1, seed, nsim )
SimData.OneArm( N = NULL, d = NULL, l = NULL, gamma = NULL, s = NULL, m = NULL, alpha = NULL, nu = NULL, design1, seed, nsim )
N |
Number of subjects plan to enrolled |
d |
expected number of events observed at time |
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 |
This function will return the simulated datasets and the according design settings
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)
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
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 )
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 )
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: |
d |
expected number of events observed at time |
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 |
This function will return the simulated datasets and the according design settings
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)
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
TrialPred.OneArm( N = NULL, d = NULL, l = NULL, gamma = NULL, s = NULL, m = NULL, alpha = NULL, nu = NULL, design1 = NULL )
TrialPred.OneArm( N = NULL, d = NULL, l = NULL, gamma = NULL, s = NULL, m = NULL, alpha = NULL, nu = NULL, design1 = NULL )
N |
Number of subjects plan to enrolled |
d |
expected number of events observed at time |
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 |
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.
# 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)
# 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)
predicting two-arm clinical trial
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 )
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 )
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: |
d |
expected number of events observed at time |
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 |
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.
# 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)
# 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)