lynden {DTDA}R Documentation

Doubly truncated data analysis with the second Efron-Petrosian algorithm

Description

This function computes the NPMLE of a lifetime distribution function observed under one-sided (right or left) and two-sided (double) truncation. It provides bootstrap pointwise confidence limits too.

Usage

lynden(X, U = NA, V = NA, error = NA, nmaxit = NA,
                 boot = TRUE, B = NA, alpha = NA, 
                        display.F = FALSE, display.S = FALSE)

Arguments

X Numeric vector with the times of ultimate interest.
U Numeric vector with the left truncation times. If there are no truncation times from the left, put U=NA.
V Numeric vector with the right truncation times. If there are no truncation times from the left, put V=NA.
error Numeric value. Maximum distance among the densities computed in two successive steps. If this is missing, it is set to 10% of 1/n.
nmaxit Numeric value. Maximum number of iterations. If this is missing, it is set to nmaxit =100 .
boot Logical. If TRUE (default), the simple bootstrap method is applied to lifetime distribution estimation. Pointwise confidence bands are provided.
B Numeric value. Number of bootstrap resamples . The default NA is equivalent to B =500 .
alpha Numeric value. (1-alpha) is the nominal coverage for the pointwise confidence intervals.
display.F Logical. Default is FALSE. If TRUE, the estimated cumulative distribution function associated to X, (F) is plotted.
display.S Logical. Default is FALSE. If TRUE, the estimated survival function associated to X, (S) is plotted.

Details

The NPMLE of the lifetime is computed by the second algorithm proposed in Efron and Petrosian (1999). This is an alternative algorithm which converges to the NMPLE after a number of iterations. If the second (respectively third) argument is missing, computation of the Lynden-Bell estimator for right-truncated (respectively left-truncated) data is obtained. Note that individuals with NAs in the three first arguments will be automatically excluded.

Value

A list containing the following values:

time The timepoint on the curve.
n.event The number of events that ocurred at time t.
events The total number of events.
NJ The number of individuals in risk considering the left truncation times.
density The estimated density values.
cumulative.df The estimated cumulative distribution values.
truncation.probs The probabilities of truncation values, in each region.
hazard The estimated hazard values.
S0 error reached in the algorithm.
Survival The estimated survival values.
n.iterations The number of iterations used by this algorithm.
B Number of bootstrap resamples computed.
alpha The nominal level used to construct the confidence intervals.
upper.df The estimated upper limits of the confidence intervals for F.
lower.df The estimated lower limits of the confidence intervals for F.
upper.Sob The estimated upper limits of the confidence intervals for S.
lower.Sob The estimated lower limits of the confidence intervals for S.

Author(s)

Carla Moreira, Jacobo de Uña-Álvarez and Rosa Crujeiras

References

Efron, B. and Petrosian, V.(1999) Nonparametric methods for doubly truncated data. Journal of the American Statistical Association 94, 824-834.

Lynden-Bell, D. (1971) A method of allowing for known observational selection in small samples applied to 3CR quasars. Monograph National Royal Astronomical Society 155, 95-118.

See Also

efron.petrosian

Examples

#  Generating data which are doubly truncated
n<-25
X<-runif(n,0,1)
U<-runif(n,0,0.25)
V<-runif(n,0.75,1)

for (i in 1:n){
        while (X[i]<U[i]|X[i]>V[i]){
        U[i]<-runif(1,0,0.25)
        X[i]<-runif(1,0,1)
        V[i]<-runif(1,0.75,1)
                                           }
                 }
res<-lynden(X=X, U=U, V=V, display.F=TRUE, display.S=TRUE)

#  Generating data which are left truncated

n<-25
X<-runif(n,0,1)
U<-runif(n,0,0.25)

for (i in 1:n){
        while (X[i]<U[i]){
        U[i]<-runif(1,0,0.25)
        X[i]<-runif(1,0,1)
                             }
                  }
res<-lynden(X=X, U=U, V=NA)

# Generating data which are right truncated

n<-25
X<-runif(n,0,1)
V<-runif(n,0.75,1)

for (i in 1:n){
        while (X[i]>V[i]){
        X[i]<-runif(1,0,1)
        V[i]<-runif(1,0.75,1)
                             }
                 }
res<-lynden(X=X,U=NA, V=V, boot=FALSE)


[Package DTDA version 1.2-1 Index]