Title: | Comparing Multiple Survival Functions with Crossing Hazards |
---|---|
Description: | Computing the one-sided/two-sided integrated/maximally selected EL statistics for simultaneous testing, the one-sided/two-sided EL tests for pointwise testing, and an initial test that precedes one-sided testing to exclude the possibility of crossings or alternative orderings among the survival functions. |
Authors: | Hsin-wen Chang [aut, cre] <[email protected]> |
Maintainer: | Guo-You Lan <[email protected]> |
License: | GPL (>= 2) |
Version: | 2.0.1 |
Built: | 2024-10-17 03:13:28 UTC |
Source: | https://github.com/news11/surveltest |
The data frame hazardcross
is obtained as follows. The survival time is generated
from the piecewise exponential model displayed in the left column of Figure 1 in Chang and McKeague (2016).
The censoring distributions (the same in each arm) is specified to
be uniform with administrative censoring at , and a censoring rate of
in the first group.
hazardcross
hazardcross
The hazardcross
is a data frame with 100 observations of 3 variables,
and has the following columns:
time
the observed times to first remission and censoring times
censor
the censoring indicator
group
the grouping variable
H. Chang, I.W. McKeague, "Empirical likelihood based tests for stochastic ordering under right censorship," Electronic Journal of Statistics, Vol. 10, No. 2, pp. 2511-2536, (2016).
nocrossings
, ptwiseELtest
, supELtest
The data frame hazardcross_Weibull
is obtained as follows. The survival time
is generated from the Weibull model displayed as the solid and dashed lines
in the right panel of Figure 1 in Chang and McKeague (2019). The censoring distributions
(the same in each arm) is specified to be uniform with administrative censoring at ,
and a censoring rate of
in the first group.
hazardcross_Weibull
hazardcross_Weibull
The hazardcross_Weibull
is a data frame with 100 observations of 3 variables,
and has the following columns:
time
the observed times to first remission and censoring times
censor
the censoring indicator
group
the grouping variable
H. Chang, I.W. McKeague, "Nonparametric testing for multiple survival functions with non-inferiority margins," Annals of Statistics, Vol. 47, No. 1, pp. 205-232, (2019).
nocrossings
, ptwiseELtest
, supELtest
The data frame hepatitis
is obtained by digitizing the published
Kaplan-Meier curves in Nguyen-Khac et al. (2011). The method of digitizing is described in
Guyot et al. (2012).
See intELtest
for the application.
hepatitis
hepatitis
The hepatitis
is a data frame with 174 observations of 3 variables,
and has the following columns:
time
the observed survival and censoring times
censor
the censoring indicator
group
the grouping variable
Nguyen-Khac et al., "Glucocorticoids plus N-Acetylcysteine in Severe Alcoholic Hepatitis," The New England Journal of Medicine, Vol. 365, No. 19, pp. 1781-1789 (2011). http://www.nejm.org/doi/full/10.1056/NEJMoa1101214#t=article
P. Guyot, A. E. Ades, M. J. N. M. Ouwens, and N. J. Welton, "Enhanced secondary analysis of survival data: reconstructing the data from published Kaplan-Meier survival curves," BMC Medical Research Methodology, 12(1):9. http://bmcmedresmethodol.biomedcentral.com/articles/10.1186/1471-2288-12-9
Nguyen-Khac et al., "Glucocorticoids plus N-Acetylcysteine in Severe Alcoholic Hepatitis," The New England Journal of Medicine, Vol. 365, No. 19, pp. 1781-1789 (2011). http://www.nejm.org/doi/full/10.1056/NEJMoa1101214#t=article
P. Guyot, A. E. Ades, M. J. N. M. Ouwens, and N. J. Welton, "Enhanced secondary analysis of survival data: reconstructing the data from published Kaplan-Meier survival curves," BMC Medical Research Methodology, 12(1):9. http://bmcmedresmethodol.biomedcentral.com/articles/10.1186/1471-2288-12-9
intELtest
, supELtest
, ptwiseELtest
, nocrossings
intELtest
gives a class of integrated EL statistics:
where is the EL ratio that compares the survival functions at each given time
,
is the weight at each
, and
are the (ordered)
observed uncensored times at which the Kaplan–Meier estimate is positive and less than
for
each sample.
intELtest( formula, data = NULL, group_order = NULL, t1 = 0, t2 = Inf, sided = 2, nboot = 1000, wt = "p.event", alpha = 0.05, seed = 1011, nlimit = 200 )
intELtest( formula, data = NULL, group_order = NULL, t1 = 0, t2 = Inf, sided = 2, nboot = 1000, wt = "p.event", alpha = 0.05, seed = 1011, nlimit = 200 )
formula |
a formula object with a |
data |
an optional data frame containing the variables in the |
group_order |
a |
t1 |
the first endpoint of a prespecified time interval, if any, to which the comparison of the survival functions is restricted.
The default value is |
t2 |
the second endpoint of a prespecified time interval, if any, to which the comparison of the survival
functions is restricted. The default value is |
sided |
|
nboot |
the number of bootstrap replications in calculating critical values for the tests.
The default value is |
wt |
the name of the weight for the integrated EL statistics:
|
alpha |
the pre-specified significance level of the tests. The default value is |
seed |
the seed for the random number generator in |
nlimit |
a number used to calculate |
There are three options for the weight :
(wt = "p.event"
)
This default option is an objective weight,
which assigns weight proportional to the number of events
at each observed uncensored time
. Here
is the total sample size.
(wt = "dF"
)
Inspired by the integral-type statistics considered in Barmi and McKeague (2013),
another weigth function is
for , where
,
is the pooled KM estimator, and
.
This reduces to the objective weight when there is no censoring. The resulting
can be seen as an empirical
version of the expected negative two times log EL ratio under
.
(wt = "dt"
)
Inspired by the integral-type statistics considered in Pepe and Fleming (1989), another weight function is
for , where
. This gives more weight to the time intervals where
there are fewer observed uncensored times, but can be affected by extreme observations.
intELtest
returns a intELtest
object, a list with 15 elements:
call
the function call
teststat
the resulting integrated EL statistics
critval
the critical value based on bootstrap
pvalue
the p-value of the test
formula
the value of the input argument of intELtest
data
the value of the input argument of intELtest
group_order
the value of the input argument of intELtest
t1
the value of the input argument of intELtest
t2
the value of the input argument of intELtest
sided
the value of the input argument of intELtest
nboot
the value of the input argument of intELtest
wt
the value of the input argument of intELtest
alpha
the value of the input argument of intELtest
seed
the value of the input argument of intELtest
nlimit
the value of the input argument of intELtest
Methods defined for intELtest
objects are provided for print
and summary
.
H. Chang, I.W. McKeague, "Nonparametric testing for multiple survival functions with non-inferiority margins," Annals of Statistics, Vol. 47, No. 1, pp. 205-232, (2019).
M. S. Pepe and T. R. Fleming, "Weighted Kaplan-Meier Statistics: A Class of Distance Tests for Censored Survival Data," Biometrics, Vol. 45, No. 2, pp. 497-507 (1989). https://www.jstor.org/stable/2531492?seq=1#page_scan_tab_contents
H. E. Barmi and I.W. McKeague, "Empirical likelihood-based tests for stochastic ordering," Bernoulli, Vol. 19, No. 1, pp. 295-307 (2013). https://projecteuclid.org/euclid.bj/1358531751
hepatitis
, supELtest
, ptwiseELtest
, nocrossings
, print.intELtest
, summary.intELtest
library(survELtest) intELtest(survival::Surv(hepatitis$time, hepatitis$censor) ~ hepatitis$group) ## OUTPUT: ## Call: ## intELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group) ## ## Two-sided integrated EL test statistic = 1.42, p = 0.007
library(survELtest) intELtest(survival::Surv(hepatitis$time, hepatitis$censor) ~ hepatitis$group) ## OUTPUT: ## Call: ## intELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group) ## ## Two-sided integrated EL test statistic = 1.42, p = 0.007
The test nocrossings
should be used before one-sided testing via intELtest
or supELtest
to exclude the possibility of crossings or alternative orderings among the survival functions.
nocrossings( formula, data = NULL, group_order = NULL, t1 = 0, t2 = Inf, sided = 2, nboot = 1000, alpha = 0.05, seed = 1011, nlimit = 200 )
nocrossings( formula, data = NULL, group_order = NULL, t1 = 0, t2 = Inf, sided = 2, nboot = 1000, alpha = 0.05, seed = 1011, nlimit = 200 )
formula |
a formula object with a |
data |
an optional data frame containing the variables in the |
group_order |
a |
t1 |
the first endpoint of a prespecified time interval, if any, to which the comparison of the survival functions is restricted.
The default value is |
t2 |
the second endpoint of a prespecified time interval, if any, to which the comparison of the survival
functions is restricted. The default value is |
sided |
|
nboot |
the number of bootstrap replications in calculating critical values for the tests.
The default value is |
alpha |
the pre-specified significance level of the tests. The default value is |
seed |
the seed for the random number generator in |
nlimit |
a number used to calculate |
nocrossings
returns a nocrossings
object, a list with 12 elements:
call
the function call
decision
for rejection of the null hypothesis that there are crossings or alternative orderings among the survival functions, and
otherwise
formula
the value of the input argument of nocrossings
data
the value of the input argument of nocrossings
group_order
the value of the input argument of nocrossings
t1
the value of the input argument of nocrossings
t2
the value of the input argument of nocrossings
sided
the value of the input argument of nocrossings
nboot
the value of the input argument of nocrossings
alpha
the value of the input argument of nocrossings
seed
the value of the input argument of nocrossings
nlimit
the value of the input argument of nocrossings
Methods defined for nocrossings
objects are provided for print
and summary
.
H. Chang, I.W. McKeague, "Empirical likelihood based tests for stochastic ordering under right censorship," Electronic Journal of Statistics, Vol. 10, No. 2, pp. 2511-2536 (2016).
H. Chang, I.W. McKeague, "Nonparametric testing for multiple survival functions with non-inferiority margins," Annals of Statistics, Vol. 47, No. 1, pp. 205-232, (2019).
hepatitis
, intELtest
, supELtest
, ptwiseELtest
, print.nocrossings
, summary.nocrossings
library(survELtest) nocrossings(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) ## OUTPUT: ## Call: ## nocrossings(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Decision = 1
library(survELtest) nocrossings(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) ## OUTPUT: ## Call: ## nocrossings(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Decision = 1
Print the integrated EL statistics and the p-value of the test.
## S3 method for class 'intELtest' print(x, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
## S3 method for class 'intELtest' print(x, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
x |
the result of a call to the |
digits |
significant digits to print, the default value is |
quiet |
a logical indicating whether to reduce the amount of output or not, the default value is |
... |
for future method |
hepatitis
, intELtest
, summary.intELtest
library(survELtest) result = intELtest(survival::Surv(hepatitis$time, hepatitis$censor) ~ hepatitis$group) print(result) ## OUTPUT: ## Call: ## intELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group) ## ## Two-sided integrated EL test statistic = 1.42, p = 0.007
library(survELtest) result = intELtest(survival::Surv(hepatitis$time, hepatitis$censor) ~ hepatitis$group) print(result) ## OUTPUT: ## Call: ## intELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group) ## ## Two-sided integrated EL test statistic = 1.42, p = 0.007
Returns the decision for rejection of the null hypothesis that there are crossings or alternative orderings among the survival functions.
## S3 method for class 'nocrossings' print(x, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
## S3 method for class 'nocrossings' print(x, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
x |
the result of a call to the |
digits |
significant digits to print, the default value is |
quiet |
a logical indicating whether to reduce the amount of output or not, the default value is |
... |
for future method |
hepatitis
, nocrossings
, summary.nocrossings
library(survELtest) result = nocrossings(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) print(result) ## OUTPUT: ## Call: ## nocrossings(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Decision = 1
library(survELtest) result = nocrossings(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) print(result) ## OUTPUT: ## Call: ## nocrossings(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Decision = 1
Print some summary statistics for the observed uncensored time points, and the decisions, statistics, and critical values of the pointwise EL tests at those time points.
## S3 method for class 'ptwiseELtest' print(x, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
## S3 method for class 'ptwiseELtest' print(x, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
x |
the result of a call to the |
digits |
significant digits to print, the default value is |
quiet |
a logical indicating whether to reduce the amount of output or not, the default value is |
... |
for future method |
hepatitis
, ptwiseELtest
, summary.ptwiseELtest
library(survELtest) result = ptwiseELtest(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) print(result) ## OUTPUT: ## Call: ## ptwiseELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Range of time_pts is from 5.2 to 153.1 ## 30 out of 45 decisions are 1, the other 15 decisions are 0 ## ----- ## Summary of stat_ptwise: ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 0.000 2.293 3.694 4.263 6.288 10.360 ## ----- ## Summary of critval_ptwise: ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 2.117 2.346 2.483 2.509 2.669 2.951
library(survELtest) result = ptwiseELtest(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) print(result) ## OUTPUT: ## Call: ## ptwiseELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Range of time_pts is from 5.2 to 153.1 ## 30 out of 45 decisions are 1, the other 15 decisions are 0 ## ----- ## Summary of stat_ptwise: ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 0.000 2.293 3.694 4.263 6.288 10.360 ## ----- ## Summary of critval_ptwise: ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 2.117 2.346 2.483 2.509 2.669 2.951
Print the maximally selected EL statistics and the p-value of the test.
## S3 method for class 'supELtest' print(x, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
## S3 method for class 'supELtest' print(x, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
x |
the result of a call to the |
digits |
significant digits to print, the default value is |
quiet |
a logical indicating whether to reduce the amount of output or not, the default value is |
... |
for future method |
hepatitis
, supELtest
, summary.supELtest
library(survELtest) nocrossings(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) ## OUTPUT: ## Call: ## nocrossings(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Decision = 1 ## A decision value of 1 means the case of crossings or alternative orderings among the ## survival functions is excluded. Thus, we can proceed to the one-sided test. result = supELtest(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) print(result) ## OUTPUT: ## Call: ## supELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## One-sided maximally selected EL test statistic = 10.36, p = 0.006
library(survELtest) nocrossings(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) ## OUTPUT: ## Call: ## nocrossings(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Decision = 1 ## A decision value of 1 means the case of crossings or alternative orderings among the ## survival functions is excluded. Thus, we can proceed to the one-sided test. result = supELtest(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) print(result) ## OUTPUT: ## Call: ## supELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## One-sided maximally selected EL test statistic = 10.36, p = 0.006
ptwiseELtest
gives pointwise EL testing to compare the survival curves at
each time point.
ptwiseELtest( formula, data = NULL, group_order = NULL, t1 = 0, t2 = Inf, sided = 2, nboot = 1000, alpha = 0.05, seed = 1011, nlimit = 200 )
ptwiseELtest( formula, data = NULL, group_order = NULL, t1 = 0, t2 = Inf, sided = 2, nboot = 1000, alpha = 0.05, seed = 1011, nlimit = 200 )
formula |
a formula object with a |
data |
an optional data frame containing the variables in the |
group_order |
a |
t1 |
the first endpoint of a prespecified time interval, if any, to which the comparison of the survival functions is restricted.
The default value is |
t2 |
the second endpoint of a prespecified time interval, if any, to which the comparison of the survival
functions is restricted. The default value is |
sided |
|
nboot |
the number of bootstrap replications in calculating critical values for the tests.
The default value is |
alpha |
the pre-specified significance level of the tests. The default value is |
seed |
the seed for the random number generator in |
nlimit |
a number used to calculate |
ptwiseELtest
returns a ptwiseELtest
object, a list with 12 elements:
call
the function call
result_dataframe
a dataframe with time_pts
in the first column, decision
in the second column, stat_ptwise
in the third column and critval_ptwise
in the fourth column.
time_pts
a vector containing the observed uncensored time points at which the
Kaplan—Meier estimate is positive and less than for each sample.
decision
a vector containing the decisions of the pointwise EL tests at time_pts
.
The decision at each of time_pts
is for rejection of the null hypothesis that the survival
functions are the same at the specific time point, and
otherwise.
stat_ptwise
a vector containing the pointwise EL statistics at time_pts
.
critval_ptwise
a vector containing the critical values for pointwise EL testing
at time_pts
.
formula
the value of the input argument of ptwiseELtest
data
the value of the input argument of ptwiseELtest
group_order
the value of the input argument of ptwiseELtest
t1
the value of the input argument of ptwiseELtest
t2
the value of the input argument of ptwiseELtest
sided
the value of the input argument of ptwiseELtest
nboot
the value of the input argument of ptwiseELtest
alpha
the value of the input argument of ptwiseELtest
seed
the value of the input argument of ptwiseELtest
nlimit
the value of the input argument of ptwiseELtest
Methods defined for ptwiseELtest
objects are provided for print
and summary
.
hepatitis
, intELtest
, supELtest
, nocrossings
, print.ptwiseELtest
, summary.ptwiseELtest
library(survELtest) ptwiseELtest(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) ## OUTPUT: ## Call: ## ptwiseELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Range of time_pts is from 5.2 to 153.1 ## 30 out of 45 decisions are 1, the other 15 decisions are 0 ## ----- ## Summary of stat_ptwise: ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 0.000 2.293 3.694 4.263 6.288 10.360 ## ----- ## Summary of critval_ptwise: ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 2.117 2.346 2.483 2.509 2.669 2.951
library(survELtest) ptwiseELtest(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) ## OUTPUT: ## Call: ## ptwiseELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Range of time_pts is from 5.2 to 153.1 ## 30 out of 45 decisions are 1, the other 15 decisions are 0 ## ----- ## Summary of stat_ptwise: ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 0.000 2.293 3.694 4.263 6.288 10.360 ## ----- ## Summary of critval_ptwise: ## Min. 1st Qu. Median Mean 3rd Qu. Max. ## 2.117 2.346 2.483 2.509 2.669 2.951
Returns a list containing the integrated EL statistics, the critical value based on bootstrap, and the p-value of the test.
## S3 method for class 'intELtest' summary(object, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
## S3 method for class 'intELtest' summary(object, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
object |
the result of a call to the |
digits |
significant digits to print, the default value is |
quiet |
a logical indicating whether to reduce the amount of output or not, the default value is |
... |
for future method |
summary.intELtest
returns a list with following components:
call
the statement used to create the intELtest
object
teststat
the resulting integrated EL statistics
critval
the critical value based on bootstrap
pvalue
the p-value of the test
sided
the value of the input argument of intELtest
alpha
the value of the input argument of intELtest
hepatitis
, intELtest
, print.intELtest
library(survELtest) result = intELtest(survival::Surv(hepatitis$time, hepatitis$censor) ~ hepatitis$group) summary(result) ## OUTPUT: ## Call: ## intELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group) ## ## Two-sided integrated EL test statistic = 1.42, p = 0.007, ## critical value based on bootstrap = 0.875 at a significance level of 0.05
library(survELtest) result = intELtest(survival::Surv(hepatitis$time, hepatitis$censor) ~ hepatitis$group) summary(result) ## OUTPUT: ## Call: ## intELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group) ## ## Two-sided integrated EL test statistic = 1.42, p = 0.007, ## critical value based on bootstrap = 0.875 at a significance level of 0.05
Returns the decision for rejection of the null hypothesis that there are crossings or alternative orderings among the survival functions.
## S3 method for class 'nocrossings' summary(object, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
## S3 method for class 'nocrossings' summary(object, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
object |
the result of a call to the |
digits |
significant digits to print, the default value is |
quiet |
a logical indicating whether to reduce the amount of output or not, the default value is |
... |
for future method |
summary.nocrossings
returns a list with following components:
call
the statement used to create the nocrossings
object
decision
for rejection of the null hypothesis that there are crossings or alternative orderings among the survival functions, and
otherwise
hepatitis
, nocrossings
, print.nocrossings
library(survELtest) result = nocrossings(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) summary(result) ## OUTPUT: ## Call: ## nocrossings(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Decision = 1
library(survELtest) result = nocrossings(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) summary(result) ## OUTPUT: ## Call: ## nocrossings(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Decision = 1
Returns a list with a data frame containing the observed uncensored time points, and the decisions, statistics, and critical values of the pointwise EL tests at those time points.
## S3 method for class 'ptwiseELtest' summary(object, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
## S3 method for class 'ptwiseELtest' summary(object, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
object |
the result of a call to the |
digits |
significant digits to print, the default value is |
quiet |
a logical indicating whether to reduce the amount of output or not, the default value is |
... |
for future method |
summary.ptwiseELtest
returns a list with following components:
call
the statement used to create the ptwiseELtest
object
result_dataframe
a dataframe with time_pts
in the first column, decision
in the second column, stat_ptwise
in the third column and critval_ptwise
in the fourth column.
time_pts
a vector containing the observed uncensored time points at which the
Kaplan—Meier estimate is positive and less than for each sample.
decision
a vector containing the decisions of the pointwise EL tests at time_pts
.
The decision at each of time_pts
is for rejection of the null hypothesis that the survival
functions are the same at the specific time point, and
otherwise.
stat_ptwise
a vector containing the pointwise EL statistics at time_pts
.
critval_ptwise
a vector containing the critical values for pointwise EL testing
at time_pts
.
hepatitis
, ptwiseELtest
, print.ptwiseELtest
library(survELtest) result = ptwiseELtest(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) summary(result) ## OUTPUT: ## Call: ## ptwiseELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## time_pts decision stat_ptwise critval_ptwise ## 1 5.2 0 0.3005 2.951 ## 2 9.7 0 0.0000 2.833 ## 3 12.9 0 0.1627 2.748 ## 4 14.0 0 0.6114 2.583 ## 5 14.9 0 2.0010 2.780 ## 6 15.7 1 3.7873 2.764 ## 7 18.0 1 3.0722 2.652 ## 8 18.9 0 1.8878 2.454 ## 9 19.2 1 2.5896 2.339 ## 10 19.7 0 1.6133 2.601 ## 11 20.0 0 2.2393 2.383 ## 12 21.7 1 3.6936 2.192 ## 13 24.0 1 4.5083 2.300 ## 14 24.9 1 5.3743 2.391 ## 15 26.0 1 6.2879 2.253 ## 16 26.9 1 9.2827 2.117 ## 17 27.8 1 10.3581 2.209 ## 18 28.0 1 6.9862 2.317 ## 19 30.0 1 7.9190 2.346 ## 20 31.2 1 6.5074 2.318 ## 21 32.1 1 4.9709 2.310 ## 22 34.1 1 5.7455 2.360 ## 23 36.1 1 6.5627 2.244 ## 24 44.9 1 5.4374 2.363 ## 25 45.2 1 6.2240 2.416 ## 26 47.8 1 7.0519 2.409 ## 27 54.1 1 7.9198 2.427 ## 28 54.9 1 6.7260 2.310 ## 29 58.1 1 7.5667 2.456 ## 30 59.8 1 7.2524 2.483 ## 31 63.2 1 6.1770 2.511 ## 32 70.4 1 5.2110 2.562 ## 33 76.1 1 4.3461 2.683 ## 34 80.1 1 3.5753 2.744 ## 35 81.3 1 2.8926 2.467 ## 36 82.1 0 2.2925 2.669 ## 37 90.1 1 2.7908 2.543 ## 38 92.1 0 2.2120 2.523 ## 39 95.0 0 1.7079 2.755 ## 40 99.0 0 2.1383 2.762 ## 41 108.2 0 2.6206 2.652 ## 42 109.9 1 3.1475 2.630 ## 43 117.0 0 2.5398 2.646 ## 44 148.8 1 3.0555 2.685 ## 45 153.1 0 2.4658 2.774
library(survELtest) result = ptwiseELtest(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) summary(result) ## OUTPUT: ## Call: ## ptwiseELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## time_pts decision stat_ptwise critval_ptwise ## 1 5.2 0 0.3005 2.951 ## 2 9.7 0 0.0000 2.833 ## 3 12.9 0 0.1627 2.748 ## 4 14.0 0 0.6114 2.583 ## 5 14.9 0 2.0010 2.780 ## 6 15.7 1 3.7873 2.764 ## 7 18.0 1 3.0722 2.652 ## 8 18.9 0 1.8878 2.454 ## 9 19.2 1 2.5896 2.339 ## 10 19.7 0 1.6133 2.601 ## 11 20.0 0 2.2393 2.383 ## 12 21.7 1 3.6936 2.192 ## 13 24.0 1 4.5083 2.300 ## 14 24.9 1 5.3743 2.391 ## 15 26.0 1 6.2879 2.253 ## 16 26.9 1 9.2827 2.117 ## 17 27.8 1 10.3581 2.209 ## 18 28.0 1 6.9862 2.317 ## 19 30.0 1 7.9190 2.346 ## 20 31.2 1 6.5074 2.318 ## 21 32.1 1 4.9709 2.310 ## 22 34.1 1 5.7455 2.360 ## 23 36.1 1 6.5627 2.244 ## 24 44.9 1 5.4374 2.363 ## 25 45.2 1 6.2240 2.416 ## 26 47.8 1 7.0519 2.409 ## 27 54.1 1 7.9198 2.427 ## 28 54.9 1 6.7260 2.310 ## 29 58.1 1 7.5667 2.456 ## 30 59.8 1 7.2524 2.483 ## 31 63.2 1 6.1770 2.511 ## 32 70.4 1 5.2110 2.562 ## 33 76.1 1 4.3461 2.683 ## 34 80.1 1 3.5753 2.744 ## 35 81.3 1 2.8926 2.467 ## 36 82.1 0 2.2925 2.669 ## 37 90.1 1 2.7908 2.543 ## 38 92.1 0 2.2120 2.523 ## 39 95.0 0 1.7079 2.755 ## 40 99.0 0 2.1383 2.762 ## 41 108.2 0 2.6206 2.652 ## 42 109.9 1 3.1475 2.630 ## 43 117.0 0 2.5398 2.646 ## 44 148.8 1 3.0555 2.685 ## 45 153.1 0 2.4658 2.774
Returns a list containing the maximally selected EL statistics, the critical value based on bootstrap, and the p-value of the test.
## S3 method for class 'supELtest' summary(object, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
## S3 method for class 'supELtest' summary(object, digits = max(3L, getOption("digits") - 3L), quiet = FALSE, ...)
object |
the result of a call to the |
digits |
significant digits to print, the default value is |
quiet |
a logical indicating whether to reduce the amount of output or not, the default value is |
... |
for future method |
summary.supELtest
returns a list with following components:
call
the statement used to create the supELtest
object
teststat
the resulting integrated EL statistics
critval
the critical value based on bootstrap
pvalue
the p-value of the test
sided
the value of the input argument of supELtest
alpha
the value of the input argument of supELtest
hepatitis
, supELtest
, print.supELtest
library(survELtest) nocrossings(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) ## OUTPUT: ## Call: ## nocrossings(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Decision = 1 ## A decision value of 1 means the case of crossings or alternative orderings among the ## survival functions is excluded. Thus, we can proceed to the one-sided test. result = supELtest(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) summary(result) ## OUTPUT: ## Call: ## supELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## One-sided maximally selected EL test statistic = 10.36, p = 0.006, ## critical value based on bootstrap = 6.289 at a significance level of 0.05
library(survELtest) nocrossings(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) ## OUTPUT: ## Call: ## nocrossings(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Decision = 1 ## A decision value of 1 means the case of crossings or alternative orderings among the ## survival functions is excluded. Thus, we can proceed to the one-sided test. result = supELtest(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) summary(result) ## OUTPUT: ## Call: ## supELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## One-sided maximally selected EL test statistic = 10.36, p = 0.006, ## critical value based on bootstrap = 6.289 at a significance level of 0.05
supELtest
provides the maximally selected EL statistics that
is better adapted at detecting local differences:
where is the EL ratio that compares the survival functions at each given time
,
and
are the (ordered) observed uncensored times at which the
Kaplan–Meier estimate is positive and less than 1 for each sample.
supELtest( formula, data = NULL, group_order = NULL, t1 = 0, t2 = Inf, sided = 2, nboot = 1000, alpha = 0.05, seed = 1011, nlimit = 200 )
supELtest( formula, data = NULL, group_order = NULL, t1 = 0, t2 = Inf, sided = 2, nboot = 1000, alpha = 0.05, seed = 1011, nlimit = 200 )
formula |
a formula object with a |
data |
an optional data frame containing the variables in the |
group_order |
a |
t1 |
the first endpoint of a prespecified time interval, if any, to which the comparison of the survival functions is restricted.
The default value is |
t2 |
the second endpoint of a prespecified time interval, if any, to which the comparison of the survival
functions is restricted. The default value is |
sided |
|
nboot |
the number of bootstrap replications in calculating critical values for the tests.
The default value is |
alpha |
the pre-specified significance level of the tests. The default value is |
seed |
the seed for the random number generator in |
nlimit |
a number used to calculate |
supELtest
returns a supELtest
object, a list with 14 elements:
call
the function call
teststat
the resulting integrated EL statistics
critval
the critical value based on bootstrap
pvalue
the p-value of the test
formula
the value of the input argument of supELtest
data
the value of the input argument of supELtest
group_order
the value of the input argument of supELtest
t1
the value of the input argument of supELtest
t2
the value of the input argument of supELtest
sided
the value of the input argument of supELtest
nboot
the value of the input argument of supELtest
alpha
the value of the input argument of supELtest
seed
the value of the input argument of supELtest
nlimit
the value of the input argument of supELtest
Methods defined for supELtest
objects are provided for print
and summary
.
H. Chang, I.W. McKeague, "Empirical likelihood based tests for stochastic ordering under right censorship," Electronic Journal of Statistics, Vol. 10, No. 2, pp. 2511-2536 (2016).
H. Chang, I.W. McKeague, "Nonparametric testing for multiple survival functions with non-inferiority margins," Annals of Statistics, Vol. 47, No. 1, pp. 205-232, (2019).
hepatitis
, intELtest
, ptwiseELtest
, nocrossings
, print.supELtest
, summary.supELtest
library(survELtest) nocrossings(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) ## OUTPUT: ## Call: ## nocrossings(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Decision = 1 ## A decision value of 1 means the case of crossings or alternative orderings among the ## survival functions is excluded. Thus, we can proceed to the one-sided test. supELtest(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) ## OUTPUT: ## Call: ## supELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## One-sided maximally selected EL test statistic = 10.36, p = 0.006
library(survELtest) nocrossings(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) ## OUTPUT: ## Call: ## nocrossings(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## Decision = 1 ## A decision value of 1 means the case of crossings or alternative orderings among the ## survival functions is excluded. Thus, we can proceed to the one-sided test. supELtest(survival::Surv(hepatitis$time, hepatitis$censor)~ hepatitis$group, sided = 1) ## OUTPUT: ## Call: ## supELtest(formula = survival::Surv(hepatitis$time, hepatitis$censor) ~ ## hepatitis$group, sided = 1) ## ## One-sided maximally selected EL test statistic = 10.36, p = 0.006
The data frame threearm
is obtained by resampling from perturbed time-to-remission
from patients in a three-arm randomized clinical trial for the treatment of major depression.
See nocrossings
, ptwiseELtest
and supELtest
for the application.
threearm
threearm
The threearm
is a data frame with 664 observations of 3 variables,
and has the following columns:
time
the observed times to first remission and censoring times
censor
the censoring indicator
group
the grouping variable
nocrossings
, ptwiseELtest
, supELtest