| Title: | Doubly Truncated Data Analysis, Cumulative Incidence Functions | 
| Version: | 1.0.2 | 
| Maintainer: | José Carlos Soage González <jsoage@uvigo.es> | 
| Description: | 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. Efron, B. and Petrosian, V. (1999) <doi:10.2307/2669997>. | 
| Depends: | R (≥ 3.5.0) | 
| License: | GPL-2 | 
| Encoding: | UTF-8 | 
| Imports: | doParallel, foreach, Rcpp | 
| LinkingTo: | Rcpp | 
| LazyData: | true | 
| RoxygenNote: | 6.1.1 | 
| NeedsCompilation: | yes | 
| Packaged: | 2020-02-13 12:06:20 UTC; Matlab | 
| Author: | Jacobo de Uña Álvarez [aut], José Carlos Soage González [cre] | 
| Repository: | CRAN | 
| Date/Publication: | 2020-02-13 12:30:02 UTC | 
Doubly Truncated Data Analysis, Cumulative Incidence Functions
Description
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.
Details
- Package: ‘DTDA.cif’ 
- Version: 1.0.2 
- Maintainer: José Carlos Soage González jsoage@uvigo.es 
- License: GPL-2 
Value
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. 
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)
plot.DTDAcif
Description
S3 method to plot a DTDAcif object by using the generic plot function.
Usage
## S3 method for class 'DTDAcif'
plot(x, intervals = FALSE, level = 0.95, main = "",
  xlab = "", ylab = "", ylim, xlim, ...)
Arguments
| x | DTDAcif object. | 
| intervals | Logical. If TRUE confidence intervals are calculated if standard deviation was calculated before. | 
| level | Confidence level of the standard deviation of the cifs. Default is 0.95. | 
| main | An overall title for the plot. | 
| xlab | A title for the x axis. | 
| ylab | A title for the y axis. | 
| ylim | Limit over the y axis. | 
| xlim | Limit over the x axis. | 
| ... | Additional parameters. | 
Author(s)
- de Uña-Álvarez, Jacobo. 
- Soage González, José Carlos. 
- Maintainer: José Carlos Soage González. jsoage@uvigo.es 
summary.DTDAcif
Description
S3 method to summarize a DTDAcif object by using the generic summary function.
Usage
## S3 method for class 'DTDAcif'
summary(object, ...)
Arguments
| object | DTDAcif object. | 
| ... | Additonal parameters. | 
Author(s)
- de Uña-Álvarez, Jacobo. 
- Soage González, José Carlos. 
- Maintainer: José Carlos Soage González. jsoage@uvigo.es