% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rocvb.R
\name{sen.ci.mar}
\alias{sen.ci.mar}
\title{Confidence Intervals for Sensitivity at Fixed Level of Specificity Under MAR Verification}
\usage{
sen.ci.mar(
  Test,
  D,
  A,
  p,
  alpha = 0.05,
  search_step = 0.01,
  tol = 1e-05,
  precision = 1e-04,
  n.boot = 1000,
  plot = TRUE
)
}
\arguments{
\item{Test}{Test results; a positive numeric vector.}

\item{D}{Verified disease status; a logical vector with possible missing values.}

\item{A}{Covariate; a positive numeric vector. Only one covariate is allowed.}

\item{p}{Target specificity level; a number between 0 and 1.}

\item{alpha}{Significance level for the confidence interval. Default is 0.05.}

\item{search_step}{Step size used in root searching. Default is 0.01.}

\item{tol}{Tolerance used in root searching. Default is 1e-5.}

\item{precision}{Precision parameter used in the regression model. Default is 1e-4.}

\item{n.boot}{Number of bootstrap replicates. Default is 1000.}

\item{plot}{Logical; if \code{TRUE} (default) a density plot is produced.}
}
\value{
A list with elements:
\describe{
\item{\code{n.total}}{Total number of subjects.}
\item{\code{n.case}}{Number of verified diseased subjects.}
\item{\code{n.control}}{Number of verified non-diseased subjects.}
\item{\code{p.missing}}{Proportion of missing verification.}
\item{\code{pt.est}}{Point estimates of sensitivity at specificity \code{p}.}
\item{\code{pt.est.ac}}{Point estimates of sensitivity at specificity \code{p} using the Agresti--Coull method.}
\item{\code{AC.intervals}}{Agresti--Coull-based confidence intervals.}
\item{\code{WS.intervals}}{Wilson score-based confidence intervals.}
\item{\code{BTI.intervals}}{Bootstrap confidence intervals, type I.}
\item{\code{BTII.intervals}}{Bootstrap confidence intervals, type II.}
\item{\code{HEL1.intervals}}{Hybrid empirical likelihood confidence intervals, type I.}
\item{\code{HEL2.intervals}}{Hybrid empirical likelihood confidence intervals, type II.}
\item{\code{IFEL1.intervals}}{Influence Function-based empirical likelihood confidence intervals, type I.}
\item{\code{IFEL2.intervals}}{Influence Function-based empirical likelihood confidence intervals, type II.}
}
}
\description{
Computes point estimates and confidence intervals for sensitivity of a continuous test
at a fixed level of specificity when disease verification is missing at random (MAR).
The function returns four estimates simultaneously, obtained using the bias-corrected estimators
FI, MSI, IPW, and SPE proposed by Alonzo and Pepe (2005).
}
\details{
The function targets sensitivity evaluated at specificity level \code{p} (i.e.,
sensitivity at the threshold achieving specificity \code{p}). Bootstrap,
hybrid empirical likelihood and influence function-based empirical likelihood
confidence intervals are computed as returned in the list.

The disease model \eqn{\rho} is estimated using a probit regression model
linear in \eqn{Test} and \eqn{A} based on verified subjects, given by

\deqn{
  \rho_i = P(D_i = 1 \mid T_i, A_i)
  = \Phi(\alpha + \beta T_i + \gamma A_i),
  \quad i = 1, \ldots, n.
}

where \eqn{\Phi} denotes the standard normal cumulative distribution function.

The verification model is estimated using a logit regression model
linear in \eqn{Test} and \eqn{A} based on all subjects, given by

\deqn{
  \operatorname{logit}(\pi_i)
  = \log\!\left( \frac{\pi_i}{1 - \pi_i} \right)
  = \alpha + \beta T_i + \gamma A_i,
  \quad i = 1, \ldots, n,
}

where \eqn{\pi_i = P(V_i = 1 \mid T_i, A_i)}.

The function may also produce a density plot of the test measurements when \code{plot = TRUE}.
}
\examples{
set.seed(123)
Test <- abs(rnorm(100))
A <- abs(rnorm(100))
D <- as.logical(Test + A > stats::quantile(Test + A, 0.8))
D[sample(100, 30)] <- NA
sen.ci.mar(Test, D, A, p = 0.8, n.boot = 20, plot = FALSE)

}
\references{
Alonzo, T. A. and Pepe, M. S. (2005). Assessing accuracy of a continuous
screening test in the presence of verification bias. \emph{Journal of the Royal
Statistical Society: Series C (Applied Statistics)}.

Wang, S., Shi, S., and Qin, G. (2026). Empirical likelihood-based confidence
intervals for sensitivity of a continuous test at a fixed level of specificity
with verification bias. Manuscript under peer review.
}
