| FrandsenTest | R Documentation |
This function computes the test of Frandsen (2019). It is based on subsampling and has very much unoptimized implementation, so can be rahter slow.
FrandsenTest(
data,
Y.name,
C.name,
X.name = NULL,
ssreps = 500,
TRIM_POINT = 0.75
)
data |
Data frame. |
Y.name |
Name of the variable in |
C.name |
Name of the variable in |
X.name |
Name of the discrete variable in |
ssreps |
Number of subsampling repetitions to perform. |
TRIM_POINT |
Quantile of C at which to trim the integral when computing the test statistic. Frandsen recommends the value 0.75, which is therefore selected as the default value. |
Brigham R. Frandsen (2019) Testing Censoring Point Independence, Journal of Business & Economic Statistics, 37:3, 496-505, DOI: 10.1080/07350015.2017.1383261
# Generate survival data with censoring time always observed
n <- 5000
X <- sample(0:1, 10, replace = TRUE)
U <- copula::rCopula(n, copula::frankCopula(param = 6))
T <- X + qexp(U[, 1], rate = 1)
C <- X + qexp(U[, 2], rate = 1.5)
Y <- pmin(T, C)
Delta <- as.numeric(Y == T)
data <- as.data.frame(cbind(Y, Delta, C, X))
colnames(data) <- c("Y", "Delta", "C", "X")
# Run test of Frandsen
Y.name <- "Y"
C.name <- "C"
X.name <- "X"
ssreps <- 500
TRIM_POINT <- 0.75
FrandsenTest(data, Y.name, C.name, X.name, ssreps, TRIM_POINT)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.