knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Doubly truncated data analysis, non iterative

Description [package]

This package implements a non-iterative estimator for the cumulative distribution of a doubly truncated variable, see de Uña-Álvarez (2018). The package is restricted to interval sampling.

de Uña-Álvarez J. (2018) A Non-iterative Estimator for Interval Sampling and Doubly Truncated Data. In: Gil E., Gil E., Gil J., Gil M. (eds) The Mathematics of the Uncertain. Studies in Systems, Decision and Control, vol 142. Springer, Cham, pp. 387-400.

DTDAni(x, u , tau)

Description [function DTDAni]

This function calculates the non-iterative estimator for the cumulative distribution of a doubly truncated variable proposed by de Uña-Álvarez (2018). The package works for interval sampling.

Details [function DTDAni]

The function DTDAni is adapted to the presence of ties. It can be used to compute the direct $(Fd)$ and the reverse $(Fr)$ estimators; see the example below. Both curves are valid estimators for the cumulative distribution $(F)$ of the doubly truncated variable. Weighted estimators $Fw = wFd + (1-w)Fr$ with $0<w<1$ are valid too, the choice $w=1/2$ being recommended in practice (de Uña-Álvarez, 2018).

Usage

In order to use this package, install it and load the library with: library(DTDA.ni)

Parameters

Return

Usage

# Loading the package:
library(DTDA.ni)

# Generating data which are doubly truncated:
N <- 250
x0 <- runif(N)           # Original data
u0 <- runif(N, -0.25, 0.5) # Left-truncation times
tau <- 0.75               # Interval width
v0 <- u0 + tau

x <- x0[u0 <= x0 & x0 <= v0]
u <- u0[u0 <= x0 & x0 <= v0]
v <- v0[u0 <= x0 & x0 <= v0]
n <- length(x)  # Final sample size after the interval sampling

# Create an object wit DTDAni function
res <- DTDAni(x, u, tau)
plot(res, ecdf = T) # Plot with ecdf = T (default = FALSE)
# Calculating the reverse estimator:
plot(res)

res2 <- DTDAni(-x, -u - 0.75, 0.75)
lines(-res2$x, 1 - res2$cumprob, type = "s", col = "blue", lty = 2)

Author(s)

Maintainer: José Carlos Soage González (jsoage@uvigo.es)

Acknowledgements

References

de Uña-Álvarez J. (2018) A Non-iterative Estimator for Interval Sampling and Doubly Truncated Data. In: Gil E., Gil E., Gil J., Gil M. (eds) The Mathematics of the Uncertain. Studies in Systems, Decision and Control, vol 142. Springer, Cham



sidoruvigo/DTDA.ni documentation built on May 15, 2019, 4:17 p.m.