Package 'EL2Surv'

Title: Empirical Likelihood (EL) for Comparing Two Survival Functions
Description: Functions for computing critical values and implementing the one-sided/two-sided EL tests.
Authors: Hsin-wen Chang [aut, cre] <[email protected]>
Maintainer: Guo-You Lan <[email protected]>
License: GPL (>= 2)
Version: 1.1
Built: 2024-10-30 04:44:59 UTC
Source: https://github.com/cran/EL2Surv

Help Index


Simulated Survival with Crossing Hazard Functions

Description

The data frame hazardcross is simulated from two groups of piecewise exponential lifetime distributions with crossing hazard functions. The estimated survival functions remain ordered even when the estimated hazard functions are crossed. See supELtest for the application.

Usage

hazardcross

Format

The hazardcross is a data frame with 100 simulated observations of 3 variables, and has the following columns:

  • time the survival time

  • censor the censoring indicator

  • group the grouping variable

See Also

supELtest


Survival from Severe Alcoholic Hepatitis

Description

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 and ptwiseELtest for the application.

Usage

hepatitis

Format

The hepatitis is a data frame with 174 observations of 3 variables, and has the following columns:

  • time the survival time

  • censor the censoring indicator

  • group the grouping variable

Source

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

References

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

See Also

intELtest, ptwiseELtest


The integrated likelihood ratio test

Description

intELtest gives a class of the weighted likelihood ratio statistics:

tUw(t){2logR(t)},\sum_{t\in U}w(t)\{-2\log R(t)\},

where w(t)w(t) is an objective weight function, and R(t)R(t) is an empirical likelihood (EL) ratio that compares two survival functions at each time point tt in the set of observed uncensored lifetimes, UU.

Usage

intELtest(data, g1 = 1, t1 = 0, t2 = Inf, sided = 2,
  nboot = 1000, wt = "p.event", alpha = 0.05, compo = FALSE,
  seed = 1011, nlimit = 200)

Arguments

data

a data frame/matrix with 3 columns. The first column is the survival time. The second is the censoring indicator. The last is the grouping variable. An example as the input to data provided is hepatitis.

g1

the group with longer survival in one-sided testing with the default value of 11.

t1

pre-specified t1t_1 based on domain knowledge with the default value of 00

t2

pre-specified t2t_2 based on domain knowledge with the default value of \infty

sided

2 if two-sided test, and 1 if one-sided test. It assumes the default value of 22.

nboot

number of bootstrap replications in calculating critical values with the defualt value of 10001000.

wt

a string for the integral statistic with a specific weight function. There are four types of integral statistics provided: "p.event", "dF", "dt", and "db". It assumes the default value of "p.event". See 'Details' for more about the integral statistics.

alpha

pre-specified significance level of the test with the default value of 0.050.05

compo

FALSE if taking the standardized square of the difference as the local statisic for two-sided testing, and TRUE if constructing for one-sided testing, but only the positive part of the difference included. It assumes the default value of FALSEFALSE.

seed

the parameter with the default value of 10111011 to set.seed for generating bootstrap-based critical values in R. The set.seed is used implicitly in intELtest.

nlimit

the splitting unit with the default value of 200200. To deal with large data problems, the bootstrap algorithm is to split the number of bootstrap replicates into nsplit parts. The number nsplit is the smallest integer not less than U/\left\| U\right\|/nlimit.

Details

intELtest calculates the weighted likelihood ratio statistics:

i=1hwi{2logR(ti)},\sum_{i=1}^{h}w_i\cdot \{-2\log R(t_i)\},

where w1,...,whw_1,...,w_h are the values of the weight function evaluated at the distinct ordered uncensored times t1,...,tht_1,...,t_h in UU. There are four types of weight functions considered.

  • (wt = "p.event")
    This default option is an objective weight,

    wi=dinw_i=\frac{d_i}{n}

    In other words, this wiw_i assigns weight proportional to the number of events at each observed uncensored time tit_i.

  • (wt = "dF")
    Based on the integral statistic built by Barmi and McKeague (2013), another weigth function is

    wi=F^(ti)F^(ti1)w_i= \hat{F}(t_i)-\hat{F}(t_{i-1})

    for i=1,,mi=1,\ldots,m,where F^(t)=1S^(t)\hat{F}(t)=1-\hat{S}(t), S^(t)\hat{S}(t) is the pooled KM estimator, and t00t_0 \equiv 0. This reduces to the objective weight when there is no censoring.The resulting InI_n can be seen as an empirical version of E(2logR(T))E(-2\log\mathcal{R}(T)), where TT denotes the lifetime random variable of interest distributed as the common distribution under H0H_0.

  • (wt = "dt")
    By means of an extension of the integral statistic derived by Pepe and Fleming (1989), another weight function is

    wi=ti+1tiw_i= t_{i+1}-t_i

    for i=1,,mi=1,\ldots,m, where tm+1tmt_{m+1} \equiv t_{m}. This gives more weight to the time intervals where there are fewer observed uncensored times, but may be affected by extreme observations.

  • (wt = "db")
    According to a weigthing method mentioned in Chang and McKeague (2016), the other weight function is

    wi=b^(ti)b^(ti1)w_i= \hat{b}(t_i)-\hat{b}(t_{i-1})

    where b^(t)=σ^2(t)/(1+σ^2(t))\hat{b}(t)=\hat{\sigma}^2(t)/(1+\hat{\sigma}^2(t)), and σ^2(t)\hat{\sigma}^2(t) is given. The b^(t)\hat{b}(t) is chosen so that the limiting distribution is the same as the asymptotic null distribution in EL Barmi and McKeague (2013).

Value

intELtest returns a list with three elements:

  • teststat the resulting integrated test statistic

  • critval the critical value

  • pvalue the p-value based on the integrated statistic

References

  • H.-w. Chang and 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).

  • 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. Uno, L. Tian, B. Claggett, and L. J. Wei, "A versatile test for equality of two survival functions based on weighted differences of Kaplan-Meier curves," Statistics in Medicine, Vol. 34, No. 28, pp. 3680-3695 (2015). http://onlinelibrary.wiley.com/doi/10.1002/sim.6591/abstract

  • 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

See Also

hepatitis, supELtest, ptwiseELtest

Examples

library(EL2Surv)
intELtest(hepatitis)

## OUTPUT:
## $teststat
## [1] 1.406016
## 
## $critval
## [1] 0.8993514
## 
## $pvalue
## [1] 0.012

The pointwise likelihood ratio test

Description

ptwiseELtest gives pointwise EL statistic values at uncensored time span. The pointwise statistic considers only the decision on each single time point; thus, it is different from the integral type and sup type statistics.

Usage

ptwiseELtest(data, g1 = 1, t1 = 0, t2 = Inf, sided = 2,
  nboot = 1000, alpha = 0.05, compo = FALSE, seed = 1011,
  nlimit = 200)

Arguments

data

a data frame/matrix with 3 columns. The first column is the survival time. The second is the censoring indicator. The last is the grouping variable. An example as the input to data provided is hepatitis.

g1

the group with longer survival in one-sided testing with the default value of 11.

t1

pre-specified t1t_1 based on domain knowledge with the default value of 00

t2

pre-specified t2t_2 based on domain knowledge with the default value of \infty

sided

2 if two-sided test, and 1 if one-sided test. It assumes the default value of 22.

nboot

number of bootstrap replications in calculating critical values with the defualt value of 10001000.

alpha

pre-specified significance level of the test with the default value of 0.050.05

compo

FALSE if taking the standardized square of the difference as the local statisic for two-sided testing, and TRUE if constructing for one-sided testing, but only the positive part of the difference included. It assumes the default value of FALSEFALSE.

seed

the parameter with the default value of 10111011 to set.seed for generating bootstrap-based critical values in R. The set.seed is used implicitly in intELtest.

nlimit

the splitting unit with the default value of 200200. To deal with large data problems, the bootstrap algorithm is to split the number of bootstrap replicates into nsplit parts. The number nsplit is the smallest integer not less than U/\left\| U\right\|/nlimit.

Value

ptwiseELtest returns a list with four elements:

  • time_pts the values of statistics at each uncensored time point

  • decision logical values. See stat_ptwise.

  • stat_ptwise the decision of the test in which the null hypothesis os rejected at a specific day if the decision exhibits 1 and not rejected if otherwise

  • critval_ptwise the critical values of the statistic at each uncensored time point

References

H.-w. Chang and 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).

See Also

hepatitis, intELtest, supELtest

Examples

library(EL2Surv)
ptwiseELtest(hepatitis)
## It produces the estimates on 44 distinct uncensored days
## out of 57 possibly repeated uncensored days.

ptwiseELtest(hepatitis, t1 = 30, t2 = 60)
## It produces the estimates on 12 distinct uncensored days
## on the restricted time interval [30, 60].

The maximally selected likelihood ratio test

Description

supELtest provides a maximal deviation type statistics that is better adapted at detecting local differences:

suptU{2logR(t)},\sup_{t\in U}\{-2\log R(t)\},

where R(t)R(t) is an empirical likelihood (EL) ratio that compares two survival functions at each time point tt in the set of observed uncensored lifetimes, UU.

Usage

supELtest(data, g1 = 1, t1 = 0, t2 = Inf, sided = 2,
  nboot = 1000, alpha = 0.05, compo = FALSE, seed = 1011,
  nlimit = 200)

Arguments

data

a data frame/matrix with 3 columns. The first column is the survival time. The second is the censoring indicator. The last is the grouping variable. An example as the input to data provided is hepatitis.

g1

the group with longer survival in one-sided testing with the default value of 11.

t1

pre-specified t1t_1 based on domain knowledge with the default value of 00

t2

pre-specified t2t_2 based on domain knowledge with the default value of \infty

sided

2 if two-sided test, and 1 if one-sided test. It assumes the default value of 22.

nboot

number of bootstrap replications in calculating critical values with the defualt value of 10001000.

alpha

pre-specified significance level of the test with the default value of 0.050.05

compo

FALSE if taking the standardized square of the difference as the local statisic for two-sided testing, and TRUE if constructing for one-sided testing, but only the positive part of the difference included. It assumes the default value of FALSEFALSE.

seed

the parameter with the default value of 10111011 to set.seed for generating bootstrap-based critical values in R. The set.seed is used implicitly in intELtest.

nlimit

the splitting unit with the default value of 200200. To deal with large data problems, the bootstrap algorithm is to split the number of bootstrap replicates into nsplit parts. The number nsplit is the smallest integer not less than U/\left\| U\right\|/nlimit.

Value

supELtest returns a list with three elements:

  • teststat the resulting integrated test statistic

  • critval the critical value

  • pvalue the p-value based on the integrated statistic

References

H.-w. Chang and 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).

See Also

hazardcross, intELtest, ptwiseELtest

Examples

library(EL2Surv)
supELtest(hazardcross)

## OUTPUT:
## $teststat
## [1] 8.945539
## 
## $critval
## [1] 8.738189
## 
## $pvalue
## [1] 0.045