FHtesticp: The Fleming-Harrington test for interval-censored data based...

Description Usage Arguments Details Value Warning Author(s) References See Also Examples

View source: R/FHtesticp.R

Description

The FHtesticp function performs a test for interval-censored 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 Surv when type = "interval2").

R

Numeric vector of the right endpoints of the censoring intervals (equivalent to the second element of Surv when type = "interval2").

group

A vector denoting the group variable 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 trend ("correlation" type) test is performed. If there are only two groups, both methods give the same results.

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 two-sample and trend tests: "different", "increasing" or "decreasing" survival functions. For the k-sample case, "different" should be chosen.

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 below).

initfit

An object of class icfit or icsurv or a character vector giving a function name, used for the initial estimate (see Warning below). Ignored if icFIT is not NULL.

permcontrol

List of arguments for controlling permutation tests. Default value is permControl.

icontrol

List of arguments for controling the NPMLE algorithm in call to icfit. Default value is icfitControl.

exact

A logical value, where TRUE denotes exact test. Ignored if method is not NULL.

method

A character value, one of "pclt", "exact.network", "exact.ce", "exact.mc". If no value is specified, function methodRule chooses the value.

methodRule

A function used to choose the method. Default value is methodRuleIC1 (see details in perm).

Lin

Logical vector: should L be included in the interval?

Rin

Logical vector: should R be included in the interval?

formula

A formula with a numeric vector as response (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 that indicates what should happen if the data contain NAs. Default value is set to getOption("na.action").

...

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 follow-up 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 p-values (the last two are only available for the two-sample 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 two-sided methods for calculating p-values (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 icfit giving the NPMLE of all responses combined (ignoring the group variable).

diff

The weighted observed minus expected number of events in each group.

scores

Vector with the same length as L and R, containing the rank scores (see Oller and G<f3>mez, 2012).

statistic

Either the chi-square or Z statistic.

var

The variance matrix of the test.

alt.phrase

Phrase used to describe the alternative hypothesis.

pvalue

p-value associated with the alternative hypothesis.

p.conf.int

Confidence interval of p-value. For method = "exact.mc" only.

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 interval-censored data under the grouped continuous model. Biometrics 52, 811–822.

Fay, M. P. (1999). Comparing several score tests for interval-censored data. Statistics in Medicine 18, 273–285.

G<f3>mez, G., Calle, M. L., Oller, R. and Langohr, K. (2009). Tutorial on methods for interval-censored 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 interval-censored data. The Canadian Journal of Statistics 40, 501–516.

Oller, R. and Langohr, K. (2017). FHtest: An R Package for the Comparison of Survival Curves with Censored Data. Journal of Statistical Software 81, 1–25.

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
19
20
## Two-sample 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, 
          subset = (zper == 3), rho = 1, Lin = TRUE, Rin = TRUE, 
          icontrol = icfitControl(maxit = 100000))

## Trend test
data(illust3)
FHtesticp(Surv(left, right, type = "interval2") ~ group, data = illust3, 
          subset = c(1:100, 601:700, 1201:1250), lambda = 1, Lin = TRUE, 
          Rin = TRUE, alternative = "increasing")

## K-sample test
FHtesticp(Surv(left, right, type = "interval2") ~ as.character(zper), data = duser, 
          subset = (zper > 1) & (zgen == 0), rho = 3, lambda = 3, Lin = TRUE, Rin = TRUE)

FHtest documentation built on Oct. 23, 2020, 5:21 p.m.