ictest {interval}R Documentation

do logrank or Wilcoxon type tests on interval censored data

Description

The ictest function performs several different tests for interval censored data, and the wlr_trafo function gives the associated transformation to scores. The default tests use the permutation form of the test (the method option tells whether it is asymptotic or exact), but the score test form and multiple imputation form are supported. The 3 different scores give three different tests that generalize to interval censored data either the Wilcoxon-Mann-Whitney test (scores="wmw") or the logrank test (scores="logrank1" or scores="logrank2") (see details).

The function calls the icfit function, if an icfit object is not provided.

Usage


## Default S3 method:
ictest(L, R, group,  
    scores = c("logrank1","logrank2","wmw"),
    rho=NULL,
    alternative= c("two.sided", "less", "greater","two.sidedAbs"),   
    icFIT=NULL,
    initfit=NULL, 
    icontrol=icfitControl(),
    exact=NULL,
    method=NULL,
    methodRule=methodRuleIC1,
    mcontrol=mControl(),
    Lin=NULL,
    Rin=NULL,...)

## S3 method for class 'formula':
ictest(formula, data, subset, na.action, ...)



## Default S3 method:
wlr_trafo(x, R=NULL, 
    scores = c("logrank1", "logrank2", "wmw"), 
    icFIT = NULL, initfit = NULL, control=icfitControl(),
    Lin=NULL,Rin=NULL,...)

## S3 method for class 'Surv':
wlr_trafo(x,...)

Arguments

L numeric vector of left endpoints of censoring interval, if R is NULL then represents exact failure time
R numeric vector of right endpoints of censoring interval
x response, either a Surv object or a numeric vector representing the left endpoint. if latter and R is NULL then x is treated as exact
group a vector denoting the group for which the test is desired. If group is a factor or character then a k-sample test is performed, where k is the number of unique values of group. If group is numeric then a "correlation" type test is performed. If there are only two groups, both methods give the same results.
scores character vector defining the scores: "logrank1" (default), "logrank2", or "wmw" (see details)
rho either 0 (gives scores="logrank1"), or 1 (gives scores="wmw") (see Note)
alternative character giving alternative for two-sample and trend tests, K-sample should be two.sided
icFIT a precalculated icfit object for increased computation speed. This should be the icfit from the pooled data. Normally initfit should be used instead (see Warning)
initfit an object of class icfit or icsurv, used for the initial estimate (see Warning). Ignored if icFIT is not null
icontrol list of arguments for controling NPMLE algorithm in call to icfit (default icfitControl)
formula a formula with response a numeric vector (which assumes no censoring) or Surv object, the right side of the formula is the group variable. No strata() is allowed
data data frame for variables in formula
subset an optional vector specifying a subset of observations to be used
na.action a function which indicates what should happen when the data contain NAs. Defaults to getOption("na.action")
Surv a Surv object, see Surv
exact a logical value, TRUE denotes exact test, ignored if method is not NULL
method a character value, one of 'pclt','exact.network','exact.ce','exact.mc', 'scoretest', 'wsr.HLY', 'wsr.pclt', 'wsr.mc'. If NULL method chosen by methodRule.
methodRule a function used to choose the method, default methodRuleIC1. (see details in perm)
mcontrol list of arguments for controling algorithms of different methods (see mControl)
Lin logical vector, should L be included in the interval? (see details)
Rin logical vector, should R be included in the interval? (see details)
control list of arguments for controling NPMLE algorithm in call to icfit (default icfitControl)
... values passed to other functions

Details

The censoring in the default case (when Lin=Rin=NULL) assumes there are n (n=length(L)) failure times, and the ith one is in the interval between L[i] and R[i]. The default is not to include L[i] in the interval unless L[i]=R[i], and to include R[i] in the interval unless R[i]=Inf. When Lin and Rin are not NULL they describe whether to include L and R in the associated interval. If either Lin or Rin is length 1 then it is repeated n times, otherwise they should be logicals of length n.

The 3 different types of scores are compared in depth in Fay (1999). When scores='logrank1' this gives the most commonly used logrank scores for right censored data, and reduces to the scores of Sun (1996) for interval censored data. When scores='logrank2' this gives the scores associated with the grouped proportional hazards model of Finkelstein (1986). When scores='wmw' this gives the generalized Wilcoxon-Mann-Whitney scores.

For censored data 2 common likelihoods are the marginal likelihood of the ranks and the likelihood with nuisance parameters for the baseline survival. Here we use the latter likelihood (as in Finkelstein, 1986, Fay, 1996, and Sun, 1996).

Because of theoretical difficulties (discussed below), the default method is to perform a permutation test on the scores. There are several ways to perform the permutation test, and the function methodRuleIC1 chooses which of these ways will be used. The choice is basically between using a permutational central limit theorem (method="pclt") or using an exact method. There are several algorithms for the exact method (see perm ).

Another method is to perform a standard score test (method="scoretest"). It is difficult to prove the asymptotic validity of the standard score tests for this likelihood because the number of nuisance parameters typically grows with the sample size and often many of the parameters are equal at the nonparametric MLE, i.e., they are on the boundary of the parameter space (Fay, 1996). Specifically, when the score test is performed then an adjustment is made so that the nuisance parameters are defined based on the data and do not approach the boundary of the parameter space (see Fay, 1996). Theoretically, the score test should perform well when there are many individuals but few observation times, and its advantage in this situation is that it retains validity even when the censoring mechanism may depend on the treatment.

Another method is to use multiple imputation, or within subject resampling (method="wsr.HLY") (Huang, Lee, and Yu, 2008). This method samples interval censored observations from the nonparametric distribution, then performs the usual Martingale-based variance. A different possibility is to use a permutational central limit theorem variance for each wsr (method="wsr.pclt") or use Monte Carlo replications to get an possibly exact method from each within subject resampling (method="wsr.mc").

Note that when icfit and ictest are used on right censored data, because of the method of estimating variance is different, even Sun's method does not produce exactly the standard logrank test results.

There are some typos in Appendix II of Fay (1999), see the correction.

permControl

Value

The function wlr_trafo returns only the numeric vector of scores, while ictest returns an object of class `ictest', which is a list with the following values.

scores This is a vector the same length as L and R, containing the scores used in the permutation test.
U The efficient score vector. When group is a factor or character vector then each element of U has the interpretation as the weighted sum of "observed" minus "expected" deaths for the group element defined by the label of U. Thus negative values indicate better than average survival (see Fay, 1999).
N number of observations in each group
method full description of the test
data.name description of data variables
algorithm algorithm used in permutation calculation. For example, `pclt', 'exact.mc', 'exact.network'
statistic either the chi-square or Z statistic, or NULL for exact methods
parameter degrees of freedom for chi-square statistic
alternative alternative hypothesis
alt.phrase phrase used to describe the alternative hypothesis
p.value p value associated with alternative
p.values vector of p-values under different alternatives
p.conf.int confidence interval on p.value, for algorithm='exact.mc' only
nmc number of Monte Carlo replications, for algorithm='exact.mc' only
nwsr number of within subject resamplings, for WSR methods only
np number of permutation replications within each WSR, for method='wsr.mc' only

Warning

Because the input of icfit is only for saving computational time, no checks are made to determine if the icfit is in fact the correct one. Thus you will get wrong answers with no warnings if you input the wrong icfit object. The safer way to save computational time is to input the precalculated icfit object into initfit. When this is done, you will get either the correct answer or a warning even when you input a bad guess for the initfit.

Note

The rho argument gives the scores which match the scores from the survdiff function, so that when rho=0 then scores="logrank1", and when rho=1 then scores="wmw". These scores will exactly match those used in survdiff, but the function survdiff uses an asymptotic method based on the score test to calculate p-values, while ictest uses permutation methods to calculate the p-values, so that the p-values will not match exactly.

Author(s)

Michael P. Fay

References

Fay, MP (1996). "Rank invariant tests for interval censored data under the grouped continuous model". Biometrics, 52: 811-822.

Fay, MP (1999). "Comparing Several Score Tests for Interval Censored Data." Statistics in Medicine, 18: 273-285 (Correction: 1999, 18: 2681).

Finkelstein, DM (1986). "A proportional hazards model for interval censored failure time data" Biometrics, 42: 845-854.

Huang, J, Lee, C, Yu, Q (2008). "A generalized log-rank test for interval-censored failure time data via multiple imputation" Statistics in Medicine, 27: 3217-3226.

Sun, J (1996). "A non-parametric test for interval censored failure time data with applications to AIDS studies". Statistics in Medicine, 15: 1387-1395.

See Also

icfit

Examples

   ## perform a logrank-type test using the permutation form of the test
data(bcos)
testresult<-ictest(Surv(left,right,type="interval2")~treatment, scores="logrank1",data=bcos)
testresult
## perform a Wilcoxon rank sum-type test
## using asymptotic permutation variance
left<-bcos$left
right<-bcos$right
trt<-bcos$treatment
## save time by using previous fit
ictest(left,right,trt, initfit=testresult$fit, method="pclt",scores="wmw")

[Package interval version 0.7-5.5 Index]