shen {DTDA} | R Documentation |
NPMLE computation with Shen algorithm
Description
This function computes the NPMLE for the cumulative distribution function of X
observed under one-sided (right or left) and two-sided (double) truncation.
The NPMLE of the joint distribution of the truncation times along with its marginal distributions are also computed.
It provides bootstrap pointwise confidence limits too.
Usage
shen(X, U = NA, V = NA, wt = NA, error = NA,
nmaxit = NA, boot = TRUE, boot.type = "simple",
B = NA, alpha = NA, display.FS = FALSE,
display.UV = FALSE, plot.joint = FALSE, plot.type = NULL)
Arguments
X |
Numeric vector with the values of the target variable. |
U |
Numeric vector with the values of the left truncation variable. If there are no truncation values from the left, put |
V |
Numeric vector with the values of the right truncation variable. If there are no truncation values from the right, put |
wt |
Numeric vector of non-negative initial solution, with the same length as |
error |
Numeric value. Maximum pointwise error when estimating the density associated to X (f) in two consecutive steps. If this is missing, it is $1e-06$. |
nmaxit |
Numeric value. Maximum number of iterations. If this is missing, it is set to |
boot |
Logical. If TRUE (default), the simple bootstrap method is applied to lifetime and truncation times distributions estimation. Pointwise confidence bands are provided. |
boot.type |
A character string giving the bootstrap type to be used. This must be one of |
B |
Numeric value. Number of bootstrap resamples . The default |
alpha |
Numeric value. (1- |
display.FS |
Logical. Default is FALSE. If TRUE, the estimated cumulative distribution function and the estimated survival function associated to |
display.UV |
Logical. Default is FALSE. If TRUE, the marginal distributions of |
plot.joint |
Logical. Default is FALSE. If TRUE, the joint distribution of the truncation times is plotted. |
plot.type |
A character string giving the plot type to be used to represent the joint distribution of the truncation times.
This must be one of "image" or "persp", with default |
Details
The NPMLE for the cumulative distribution function is computed by a single algorithm proposed in Shen (2010). This is an iterative algorithm which converges to the NMPLE after a number of iterations. Initial solutions are given by the ordinary empirical distribution functions. 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 |
events |
The total number of events. |
density |
The estimated density values associated to |
cumulative.df |
The estimated cumulative distribution values of |
truncation.probs |
The probability of |
S0 |
|
Survival |
The estimated survival values. |
density.joint |
The estimated joint densities values associated to |
marginal.U |
The estimated cumulative univariate marginal values of the |
marginal.V |
The estimated cumulative univariate marginal values of the |
cumulative.joint |
The estimated joint cumulative distribution values. |
n.iterations |
The number of iterations used by this algorithm. |
biasf |
The estimated probabilities of observing the lifetimes. |
Boot |
The type of bootstrap method applied. |
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. |
upper.fU |
The estimated upper limits of the confidence intervals for |
lower.fU |
The estimated lower limits of the confidence intervals for |
upper.fV |
The estimated upper limits of the confidence intervals for |
lower.fV |
The estimated lower limits of the confidence intervals for |
sd.boot |
The bootstrap standard deviation of F estimator. |
boot.repeat |
The number of resamples done in each bootstrap call to ensure the existence and uniqueness of the bootstrap NPMLE. |
Author(s)
Carla Moreira, Jacobo de Uña-Álvarez and Rosa Crujeiras
References
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.
Shen P-S (2010) Nonparametric analysis of doubly truncated data. Annals of the Institute of Statistical Mathematics 62, 835-853.
Xiao J, Hudgens MG (2020) On nonparametric maximum likelihood estimation with double truncation. Biometrika 106, 989-996.
See Also
Examples
## Generating data which are doubly truncated
set.seed(4321)
n<-100
X<-runif(n,0,1)
U<-runif(n,0,0.67)
V<-runif(n,0.33,1)
for (i in 1:n){
while (X[i]<U[i]|X[i]>V[i]){
U[i]<-runif(1,0,0.67)
X[i]<-runif(1,0,1)
V[i]<-runif(1,0.33,1)
}
}
res<-shen(X,U,V,boot=FALSE, plot.joint=TRUE, plot.type="persp")