ipcw.dcov.test {dcortools} | R Documentation |
Performs a permutation test based on the IPCW distance covariance.
Description
Performs a permutation test based on the IPCW distance covariance.
Usage
ipcw.dcov.test(
Y,
X,
affine = FALSE,
standardize = FALSE,
timetrafo = "none",
type.X = "sample",
metr.X = "euclidean",
use = "all",
cutoff = NULL,
B = 499
)
Arguments
Y |
A column with two rows, where the first row contains the survival times and the second row the status indicators (a survival object will work). |
X |
A vector or matrix containing the covariate information. |
affine |
logical; indicates if X should be transformed such that the result is invariant under affine transformations of X. |
standardize |
logical; should X be standardized using the standard deviations of single observations. No effect when affine = TRUE. |
timetrafo |
specifies a transformation applied on the follow-up times. Can be "none", "log" or a user-specified function. |
type.X |
For "distance", X is interpreted as a distance matrix. For "sample" (or any other value), X is interpreted as a sample. |
metr.X |
metr.X specifies the metric which should be used for X to analyze the distance covariance. Options are "euclidean", "discrete", "alpha", "minkowski", "gaussian", "gaussauto" and "boundsq". For "alpha", "minkowski", "gauss", "gaussauto" and "boundsq", the corresponding parameters are specified via "c(metric,parameter)" (see examples); the standard parameter is 2 for "minkowski" and "1" for all other metrics. |
use |
specifies how to treat missing values. "complete.obs" excludes observations containing NAs, "all" uses all observations. |
cutoff |
If provided, all survival times larger than cutoff are set to the cutoff and all corresponding status indicators are set to one. Under most circumstances, choosing a cutoff is highly recommended. |
B |
The number of permutations used for the permutation test |
Value
An list with two arguments, $dcov contains the IPCW distance covariance, $pvalue the corresponding p-value
References
Bottcher B, Keller-Ressel M, Schilling RL (2018). “Detecting independence of random vectors: generalized distance covariance and Gaussian covariance.” Modern Stochastics: Theory and Applications, 3, 353–383.
Datta S, Bandyopadhyay D, Satten GA (2010). “Inverse Probability of Censoring Weighted U-statistics for Right-Censored Data with an Application to Testing Hypotheses.” Scandinavian Journal of Statistics, 37(4), 680–700.
Dueck J, Edelmann D, Gneiting T, Richards D (2014). “The affinely invariant distance correlation.” Bernoulli, 20, 2305–2330.
Huo X, Szekely GJ (2016). “Fast computing for distance covariance.” Technometrics, 58(4), 435–447.
Lyons R (2013). “Distance covariance in metric spaces.” The Annals of Probability, 41, 3284–3305.
Sejdinovic D, Sriperumbudur B, Gretton A, Fukumizu K (2013). “Equivalence of distance-based and RKHS-based statistics in hypothesis testing.” The Annals of Statistics, 41, 2263–2291.
Szekely GJ, Rizzo ML, Bakirov NK (2007). “Measuring and testing dependence by correlation of distances.” The Annals of Statistics, 35, 2769–2794.
Szekely GJ, Rizzo ML (2009). “Brownian distance covariance.” The Annals of Applied Statistics, 3, 1236–1265.
Examples
X <- rnorm(100)
survtime <- rgamma(100, abs(X))
cens <- rexp(100)
status <- as.numeric(survtime < cens)
time <- sapply(1:100, function(u) min(survtime[u], cens[u]))
surv <- cbind(time, status)
ipcw.dcov.test(surv, X)
ipcw.dcov.test(surv, X, cutoff = quantile(time, 0.8))
# often better performance when using a cutoff time