Description Usage Arguments Details Value References See Also Examples
The function ComputeConfIntervals computes pointwise confidence intervals for the distribution function under current status data. The confidence intervals are based on the Smoothed Maximum likelihood Estimator and constructed using the nonparametric bootstrap.
1 | ComputeConfIntervals(data, x, alpha, bw)
|
data |
Dataframe with three variables:
|
x |
numeric vector containing the points where the confidence intervals are computed. This vector needs to be contained within the observation interval: t[1] < min(x) ≤ max(x) < t[n]. |
alpha |
confidence level of pointwise confidence intervals. |
bw |
numeric vector of size |
In the current status model, the variable of interest X with distribution function F is not observed directly.
A censoring variable T is observed instead together with the indicator Δ = (X ≤ T).
ComputeConfIntervals computes the pointwise 1-alpha
bootstrap confidence intervals around the SMLE of F based on a sample of size n <- sum(data$freq2)
.
The bandwidth parameter vector that minimizes the pointwise Mean Squared Error using the subsampling principle in combination with undersmoothing is returned by the function ComputeBW
.
The default method for constructing the confidence intervals in [Groeneboom & Hendrickx (2017)] is based on estimating the asymptotic variance of the SMLE. When the bandwidth is small for some point in x, the variance estimate of the SMLE at this point might not exist. If this happens the Non-Studentized confidence interval is returned for this particular point in x.
List with 5 variables:
Maximum Likelihood Estimator. This is a matrix of dimension (m+1)x2 where m is the number of jump points of the MLE. The first column consists of the point zero and the jump locations of the MLE. The second column contains the value zero and the values of the MLE at the jump points.
Smoothed Maximum Likelihood Estimator. This is a vector of size length(x)
containing the values of the SMLE for each point in the vector x.
pointwise confidence interval. This is a matrix of dimension length(x)
x2.
The first resp. second column contains the lower resp. upper values of the confidence intervals for each point in x.
points in x for which Studentized nonparametric bootstrap confidence intervals are computed.
points in x for which classical nonparametric bootstrap confidence intervals are computed.
Groeneboom, P. and Hendrickx, K. (2017). The nonparametric bootstrap for the current status model. Electronic Journal of Statistics 11(2):3446-3848.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | library(Rcpp)
library(curstatCI)
# sample size
n <- 1000
# Uniform data U(0,2)
set.seed(2)
y <- runif(n,0,2)
t <- runif(n,0,2)
delta <- as.numeric(y <= t)
A<-cbind(t[order(t)], delta[order(t)], rep(1,n))
# x vector
grid<-seq(0.1,1.9 ,by = 0.1)
# data-driven bandwidth vector
bw <- ComputeBW(data =A, x = grid)
# pointwise confidence intervals at grid points:
out<-ComputeConfIntervals(data = A,x =grid,alpha = 0.05, bw = bw)
left <- out$CI[,1]
right <- out$CI[,2]
plot(grid, out$SMLE,type ='l', ylim=c(0,1), main= "",ylab="",xlab="",las=1)
points(grid, left, col = 4)
points(grid, right, col = 4)
segments(grid,left, grid, right)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.