test_diff {EquiSurv} | R Documentation |
Non-inferiority and equivalence test for the difference of two parametric survival curves
Description
Function for fitting and testing two parametric survival curves S_1
, S_2
at t_0
concerning the
hypotheses of non-inferiority
H_0:S_1(t_0)-S_2(t_0)\geq \epsilon\ vs.\ H_1: S_1(t_0)-S_2(t_0)< \epsilon
or equivalence
H_0:|S_1(t_0)-S_2(t_0)|\geq \epsilon\ vs.\ H_1: |S_1(t_0)-S_2(t_0)|< \epsilon.
m_1
and m_2
are parametric survival models following a Weibull, exponential, gaussian, logistic, log-normal or log-logistic distribution.
The test procedure is based on confidence intervals obtained via bootstrap.
For the generation of the bootstrap data exponentially distributed random censoring is assumed and the rates estimated from the datasets.
See Moellenhoff and Tresch <arXiv:2009.06699> for details.
Usage
test_diff(
epsilon,
alpha,
t0,
type,
m1,
m2,
B = 1000,
plot = TRUE,
data_r,
data_t
)
Arguments
epsilon |
non-inferiority/equivalence margin |
alpha |
significance level |
t0 |
time point of interest |
type |
type of the test. "ni" for non-inferiority, "eq" for equivalence test |
m1 , m2 |
type of parametric model. Possible model types are "weibull", "exponential", "gaussian", "logistic", "lognormal" and "loglogistic" |
B |
number of bootstrap repetitions. The default is B=1000 |
plot |
if TRUE, a plot of the two survival curves will be given |
data_r , data_t |
datasets containing time and status for each individual (have to be referenced as this) |
Value
A list containing the difference S_1(t_0)-S_2(t_0)
, the lower and upper (1-\alpha
)-confidence bounds, the summary of the two model fits, the chosen margin and significance level and the test decision. Further a plot of the curves is given.
References
K.Moellenhoff and A.Tresch: Survival analysis under non-proportional hazards: investigating non-inferiority or equivalence in time-to-event data <arXiv:2009.06699>
Examples
data(veteran)
veteran_r <- veteran[veteran$trt==1,]
veteran_t <- veteran[veteran$trt==2,]
alpha<-0.05
t0<-80
epsilon<-0.15
test_diff(epsilon=epsilon,alpha=alpha,t0=t0,type="eq",m1="weibull",m2="weibull",
data_r=veteran_r,data_t=veteran_t)