DTDAcif {DTDA.cif} | R Documentation |
Doubly Truncated Data Analysis, Cumulative Incidence Functions
Description
This function computes a nonparametric estimator of the cumulative incidences of competing risks under double truncation. The estimator generalizes the Efron-Petrosian NPMLE (Non-Parametric Maximun Likelihood Estimator) to the competing risks setting.
Usage
DTDAcif(x, u, v, comp.event, method = c("indep", "dep"), boot = F,
B = 300, N.iter = 100, error = 1e-06)
Arguments
x |
Numeric vector corresponding to the variable of ultimate interest. |
u |
Numeric vector corresponding to the left truncation variable. |
v |
Numeric vector corresponding to the right truncation variable. |
comp.event |
Competing risk indicator. |
method |
The method used to compute the nonparametric estimator. Use ‘indep’ for independent truncation variables and “dep“ for truncation variables possibly depending on the competing risk. |
boot |
Logical. If TRUE the bootstrap standard deviation of the cumulative incidences is calculated. |
B |
Number of bootstrap replicates. |
N.iter |
Maximum number of iterations. |
error |
Error criterion for convergence. |
Details
The nonparametric estimator is based on the Efron-Petrosian NPMLE (Efron and Petrosian, 1999). Actually, each pair (Xi,Zi) -where Xi stands for the variable of interest and Zi is the competing event indicator- is weighted by the jump of the Efron-Petrosian NPMLE at Xi (method=“indep"), or by a normalized version of the Efron-Petrosian NPMLE computed from the subset of (Xs,Zs)'s such that Zs=Zi (method=“dep”). The former is suitable when the truncating couple (U,V) is independent of (X,Z), while the latter is recommended when (U,V) and X are only conditionally independent given Z; see de Uña-Álvarez (2019) for a full description of the estimators and of their properties. When the competing event indicator is missing, the function simply computes the Efron-Petrosian NPMLE and the argument method has no role.
Value
A list containing:
method: The method used to compute the estimator.
biasf: The biasing function which reports the sampling probability for each Xi.
cif.mas: The mass attached to each (Xi,Zi). The cumsum of cif.mas for Zi=j is the estimator of the j-th cumulative incidence function.
data: The data corresponding to (X,Z) ordered with respect to X within each Z-value.
sd.boot: The bootstrap standard deviation.
Acknowledgements
Jacobo de Uña-Álvarez was supported by Grant MTM2017-89422-P (MINECO/AEI/FEDER, UE).
José Carlos Soage was supported by Grupos de Referencia Competitiva, Consolidación y Estructuración de Unidades de Investigación Competitivas del SUG, Cons. de Cultura, Educación e OU, Xunta de Galicia (GRC ED431C 2016/040).
Author(s)
de Uña-Álvarez, Jacobo.
Soage González, José Carlos.
Maintainer: José Carlos Soage González. jsoage@uvigo.es
References
de Uña-Álvarez, J. (2019). Nonparametric estimation of the cumulative incidences of competing risks under double truncation. Preprint.
Efron, B. and Petrosian, V. (1999). Nonparametric methods for doubly truncated data. Journal of the American Statistical Association 94, 824-834.
Examples
set.seed(1234)
n <- 50 # sample size
x <- runif(n, 0, 1) # time variable of interest
z <- rbinom(n, 1, 1 / 4) # competing event indicator
# truncation variables
u <- runif(n, -.25, .5) # left truncation variable
v <- u + .75 # right truncation variable
# note: (u,v) is independent of (x,z) so both estimation methods are consistent
# truncating the sample:
for (i in 1:n) {
while (u[i] > x[i] | v[i] < x[i]) {
x[i] <- runif(1, 0, 1)
z[i] <- rbinom(1, 1, 1 / 4)
u[i] <- runif(1, -.25, .5)
v[i] <- u[i] + .75
}
}
# note: (u,v) since is independent of (x,z)
# both estimation methods are consistent:
res.i <- DTDAcif(x, u, v, z, method = "indep", boot = TRUE)
res.d <- DTDAcif(x, u, v, z, method = "dep", boot = TRUE)
oldpar <- par(mfrow=c(1,2))
plot(res.i, main = "Indep trunc", intervals = TRUE)
plot(res.d, main = "Cond indep trunc", intervals = TRUE)
summary(res.i)
summary(res.d)
plot(res.i$data$x, res.i$biasf, type = "s") # the observational bias
# the observational bias, event 1
plot(res.d$data$x[res.d$data$z == 1], res.d$biasf$biasf_1, type = "s")
# the observational bias, event 2
lines(res.d$data$x[res.d$data$z == 2], res.d$biasf$biasf_2, type = "s", col = 2)
par(oldpar)