compCDF {drcte}R Documentation

Compare time-to-event curves

Description

This function is used to compare time-to-event curves for different experimental treatments. The apprach depends on the type of time-to-event curves, i.e., parametric, NPMLE and KDE (see details)

Usage

compCDF(obj, scores = c("wmw", "logrank1", "logrank2"),
B = 199, type = c("naive", "permutation"), units = NULL, upperl,
lowerl, display = TRUE)

Arguments

obj

A time-to-event model fitted with 'drmte' (drcte object)

scores

This argument is only meaningful for NPMLEs of time-to-event curves and it specifies the type of log-rank statistic to compare the curves. Possible values are 'wmw' (Wilcoxon-Mann-Whitney) , 'logrank1' (Sun's scores), 'logrank2' (Finkelstein's scores) and it defaults to 'wmw'. See details in Fay and Shaw, 2010.

B

Number of permutations for permutation tests

type

For parametric models, comparisons are based on a Likelihood Ratio Test (LRT). The argument type specifies whether P-levels should be calculated by using a 'naive' chi-square approximation, or a 'permutation' approach. It defaults to 'naive' and it is neglected for NPMLE and KDE fits, which always use the permutation approach.

units

A vector for the clustering units (e.g. Petri dishes or other containers for seed germination/emergence assays). When type = 'permutation' and 'units' is given, the permutation approach is performed at the units level and not at the individuals level.

upperl

Only for parametric models: a numeric vector of upper limits for all parameters in the model (the default corresponds to infinity for all parameters).

lowerl

Only for parametric models: a numeric vector of lower limits for all parameters in the model (the default corresponds to minus infinity for all parameters).

display

logical. If TRUE, results are displayed, otherwise, they are not (useful in simulations).

Details

This function is used to compare time-to-event curves fitted with the function 'drmte()' in the 'drcte' package, where treatment factors have been included by using the 'curveid' argument. The type of test statistic depends on the fitted model, whether it is a parametric time-to-event model or a NPMLE or a KDE. With parametric time-to-event models a Likelihood Ratio test is used, with NPMLE, weighted log-rank statistics are used, while for KDEs, a Cramér‐von Mises type distance among curves is used. In all cases, this function is used to determine the p-level for the null (i.e. the curves are not significantly different from each other). WARNING: a permutation based approach may not necessarily work with parametric and KDE models; indeed, the permuted sample can be such that a model cannot be fitted into it. We are working a solution for these cases, but, in the meantime, we recommend that the user resorts to the naive inference approach whenever a permutation based approach does not work.

Value

method

The test statistic used for the comparison

scores

The individual scores for the statistic (when applicable)

val0

The observed value for the test statistic

vali

The observed values of the test statistic for the permutational samples

pval

The P-value for the LRT statistic, by using the chi square approximation

pvalb

The P-value for the test statistic, by using permutation methods

U

The score values for each group (only for Weighted Log-rank methods)

N

Sample size for each group (only for Weighted Log-rank methods)

Note

Some code is taken from the 'interval' package and from the 'binnednp' package (citations below).

Author(s)

Andrea Onofri

References

Bolker, BM (2008) Ecological models and data in R. Princeton University Press

Fay MP, Shaw PA (2010) Exact and Asymptotic Weighted Logrank Tests for Interval Censored Data: The interval R Package. J Stat Softw 36:1–34

Barreiro-Ures D, Francisco-Fernández M, Cao R, Fraguela BB, Doallo R, González-Andújar JL, Reyes M (2019) Analysis of interval-grouped data in weed science: The binnednp Rcpp package. Ecol Evol 9:10903–10915

Examples

data(verbascum)

modVerb <- drmte(nSeeds ~ timeBef + timeAf, curveid = Species,
              fct = NPMLE(), data = verbascum)
compCDF(modVerb, units = verbascum$Dish)

[Package drcte version 1.0.30 Index]