The FlemingHarrington test for intervalcensored data based on a permutation distribution
Description
The FHtesticp
function performs a test for intervalcensored data based on a permutation distribution. It uses the Gρ,λ family of statistics for testing the differences of two or more survival curves.
Usage
1 2 3 4 5 6  ## Default S3 method:
FHtesticp(L, R, group, rho=0, lambda=0, alternative, permcontrol=permControl(),
icFIT=NULL, initfit=NULL, icontrol=icfitControl(), exact=NULL,
method=NULL, methodRule=methodRuleIC1, Lin=NULL, Rin=NULL, ...)
## S3 method for class 'formula'
FHtesticp(formula, data, subset, na.action, ...)

Arguments
L 
Numeric vector of the left endpoints of the censoring intervals (equivalent to the first element of 
R 
Numeric vector of the right endpoints of the censoring intervals (equivalent to the second element of 
group 
A vector denoting the group variable for which the test is desired. If 
rho 
A scalar parameter that controls the type of test (see details). 
lambda 
A scalar parameter that controls the type of test (see details). 
alternative 
Character giving the type of alternative hypothesis for twosample and trend tests: 
icFIT 
A precalculated 
initfit 
An object of class 
permcontrol 
List of arguments for controlling permutation tests. Default value is 
icontrol 
List of arguments for controling the NPMLE algorithm in call to 
exact 
A logical value, where 
method 
A character value, one of 
methodRule 
A function used to choose the method. Default value is 
Lin 
Logical vector: should 
Rin 
Logical vector: should 
formula 
A formula with a numeric vector as response (which assumes no censoring) or 
data 
Data frame for variables in 
subset 
An optional vector specifying a subset of observations to be used. 
na.action 
A function that indicates what should happen if the data contain 
... 
Additional arguments. 
Details
The appropriate selection of the parameters rho
and lambda
gives emphasis to early, middle or late hazard differences. For instance, in a given clinical trial, if one would like to assess whether the effect of a treatment or therapy on the survival is stronger at the earlier phases of the therapy, we should choose lambda= 0
, with increasing values of rho
emphasizing stronger early differences. If there were a clinical reason to believe that the effect of the therapy would be more pronounced towards the middle or the end of the followup period, it would make sense to choose rho = lambda > 0
or rho = 0
respectively, with increasing values of lambda
emphasizing stronger middle or late differences. The choice of the weights has to be made prior to the examination of the data and taking into account that they should provide the greatest statistical power, which in turns depends on how it is believed the null is violated.
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.
Many standard statistical tests may be put into the form of the permutation test (see Graubard and Korn, 1987). There is a choice of four different methods to calculate the pvalues (the last two are only available for the twosample test): (1) pclt
: using permutational central limit theorem (see, e.g., Sen, 1985). (2) exact.mc
: exact method using Monte Carlo. (3) exact.network
: exact method using a network algorithm (see, e.g., Agresti, Mehta, and Patel, 1990). Currently, the network method does not implement many of the time saving suggestions such as clubbing. (4) exact.ce
: exact method using complete enumeration. This is good for very small sample sizes and when doing simulations, since the complete enumeration matrix need only be calculated once for the simulation.
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. Note that there are two exact twosided methods for calculating pvalues (see permControl
and the tsmethod
option).
Value
information 
Full description of the test. 
data.name 
Description of data variables. 
n 
Number of observations in each group. 
fit 
Object of class 
diff 
The weighted observed minus expected number of events in each group. 
scores 
Vector with the same length as 
statistic 
Either the chisquare or Z statistic. 
var 
The variance matrix of the test. 
alt.phrase 
Phrase used to describe the alternative hypothesis. 
pvalue 
pvalue associated with the alternative hypothesis. 
p.conf.int 
Confidence interval of pvalue. For 
call 
The matched call. 
Warning
Since the input of icFIT
is only for saving computational time, no checks are carried out to determine if the icFIT
is in fact the correct one. Thus, one may get wrong answers with no warnings if the wrong icFIT
object is chosen. A safer way to save computational time is to choose for initfit
either a precalculated icfit
object or an icsurv
object from a function in the Icens
package such as EMICM
. If this is done, either the correct answer or a warning will be returned even if a bad guess for initfit
is chosen. Additionally, one may specify a function name for initfit
. The default is NULL
which uses a simple initial fit function (the weighted average of the A
matrix, see the code of icfit.default (Package interval
)). A fast but somewhat unstable function uses initcomputeMLE
which uses function computeMLE of the 'MLEcens' package. See the help for icfit
for details on the initfit option.
Author(s)
R. Oller and K. Langohr
References
Fay, M. P. (1996). Rank invariant tests for intervalcensored data under the grouped continuous model. Biometrics 52, 811–822.
Fay, M. P. (1999). Comparing several score tests for intervalcensored data. Statistics in Medicine 18, 273–285.
G<f3>mez, G., Calle, M. L., Oller, R. and Langohr, K. (2009). Tutorial on methods for intervalcensored data and their implementation in R. Statistical Modelling 9, 259–297.
Oller, R. and G<f3>mez, G. (2012). A generalized Fleming and Harrington's class of tests for intervalcensored data. The Canadian Journal of Statistics 40, 501–516.
See Also
FHtestics, icfit (Package interval
), icsurv (Package Icens
).
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  ## Twosample tests
data(bcos)
FHtesticp(Surv(left, right, type="interval2")~treatment, data=bcos)
FHtesticp(Surv(left, right, type="interval2")~treatment, data=bcos, exact=TRUE)
FHtesticp(Surv(left, right, type="interval2")~treatment, data=bcos, rho=1)
data(duser)
FHtesticp(Surv(left, right, type="interval2")~as.factor(age>21), data=duser, rho=1,
Lin=TRUE, Rin=TRUE, subset=(zper==3), icontrol=icfitControl(maxit=100000))
## Trend test
data(illust3)
FHtesticp(Surv(left, right, type="interval2")~group, data=illust3, alternative="increasing",
subset=c(1:100, 601:700, 1201:1300), lambda=1, Lin=TRUE, Rin=TRUE)
## Ksample test
FHtesticp(Surv(left, right, type="interval2")~as.character(zper), data=duser, rho=3, lambda=3,
Lin=TRUE, Rin=TRUE, subset=(zper>1)&(zgen==0))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.