% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/survdt-package.R
\docType{package}
\name{survdt-package}
\alias{survdt}
\alias{survdt-package}
\title{survdt: Improved Methods for Survival Analysis under Double Truncation}
\description{
Contains existing and novel methods for nonparametric analysis and Cox regression analysis with doubly truncated survival data, as described in Vazquez and Xie (2025) \doi{10.1007/s10985-025-09650-5}. Includes survival curves and hazard estimates through nonparametric maximum likelihood estimation, various tests for detecting group differences or non-ignorable sampling bias, and inverse probability weighted Cox regression with several options of nonparametric weights. Also implements diagnostics for key modeling assumptions such as quasi-independent truncation and the positivity assumption. Closed-form standard errors are available for all estimates, i.e. bootstrapping is not required.
}
\section{Datasets}{

\itemize{
\item \link{aids}: a doubly truncated sample of AIDS incubation times from patients
with transfusion-acquired HIV.
\item \link{nonprop_sample}: a simulated sample with non-proportional hazards and
quasi-independent double truncation.
}
}

\section{Key functions}{


\strong{Survival objects to hold doubly truncated data}
\itemize{
\item \code{\link[=Survdt]{Survdt()}}: one observation per subject.
\item \code{\link[=Survdt2]{Survdt2()}}: for (start,stop] data with multiple observations per subject.
\item \code{\link[=time_split]{time_split()}}, \code{\link[=survdt2to1]{survdt2to1()}}: convert between the two formats above.
}

\strong{Nonparametric analysis under double truncation}
\itemize{
\item \code{\link[=npmle]{npmle()}}: nonparametric maximum likelihood estimation.
The output has a \code{plot} method to plot the estimated survival function,
cumulative hazard, and selection probabilities along with pointwise
confidence intervals.
The nonparametric maximum likelihood estimator (NPMLE) is used in the two
tests that follow.
\item \code{\link[=test_ignorability_indtrunc]{test_ignorability_indtrunc()}}: test for non-ignorable sampling bias.
\item \code{\link[=test_samplediff_indtrunc]{test_samplediff_indtrunc()}}: test for any difference in event time
distribution across groups.
\item \code{\link[=test_quasiindep_ctau]{test_quasiindep_ctau()}}: test for dependence between truncation times and
the event time.
The NPMLE requires quasi-independence.
}

\strong{Cox regression under double truncation}
\itemize{
\item \code{\link[=coxph_indtrunc]{coxph_indtrunc()}}: inverse probability weighted Cox regression with options
for robust time-varying weights estimated nonparametrically.
The output has common methods such as \code{confint}, \code{residuals}, and \code{vcov}.
\item \code{\link[=plot_coxsurv]{plot_coxsurv()}}: plot conditional survival functions or cumulative hazards
from a fitted Cox model along with pointwise confidence intervals.
\item \code{\link[=test_quasiindep_covariates]{test_quasiindep_covariates()}}: test for dependence between truncation times
and the event time or covariates.
The nonparametric inverse probability weighting used by \code{\link[=coxph_indtrunc]{coxph_indtrunc()}}
requires quasi-independence.
\item \code{\link[=positivity_sens_indtrunc]{positivity_sens_indtrunc()}}: sensitivity analysis for positivity violations.
Check how the estimates and confidence intervals may change under a range
of values for the baseline probability mass potentially lost due to zero
sampling probability.
}
}

\section{Vignettes}{

If vignettes were built when installing \link{survdt}, see
\itemize{
\item \code{vignette("nonparametric-analysis", package = "survdt")}: an example of
various nonparametric analyses applied to the \link{aids} data.
\item \code{vignette("cox-regression-quasiindep", package = "survdt")}: an example of
Cox regression and its assumption diagnostics applied to the \link{aids} data.
}
}

\references{
Vazquez, O., & Xie, S. X. (2025). Robust inverse probability weighted
estimators for doubly truncated Cox regression with closed-form standard
errors. \emph{Lifetime Data Analysis}, \strong{31}(2), 364–-393.
}
\author{
\strong{Maintainer}: Omar Vazquez \email{omar.vazquez@pennmedicine.upenn.edu} (\href{https://orcid.org/0009-0009-4137-3333}{ORCID}) [copyright holder]

Other contributors:
\itemize{
  \item Sharon X. Xie (\href{https://orcid.org/0000-0002-7886-4103}{ORCID}) [thesis advisor]
}

}
\keyword{internal}
