% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ci.wauc.R
\name{ci.wauc}
\alias{ci.wauc}
\title{Design-based confidence intervals for the AUC.}
\usage{
ci.wauc(
  design,
  response.var,
  phat.var,
  tag.event = NULL,
  tag.nonevent = NULL,
  method = c("JKn", "subbootstrap"),
  boot.B = 1000,
  boot.ci = c("normal", "quantile"),
  conf.level = 0.95
)
}
\arguments{
\item{design}{An object of class \code{survey.design} generated by
\code{survey::svydesign} indicating the complex sampling design of the data.}

\item{response.var}{A character string with the name of the column indicating the response variable in the data set.}

\item{phat.var}{A character string with the name of the column indicating the estimated probabilities in the data set.}

\item{tag.event}{A character string indicating the label used to indicate the event of interest in \code{response.var}.
The default option is \code{tag.event = NULL}, which selects the class with the lowest number of units as event.}

\item{tag.nonevent}{A character string indicating the label used for non-event in \code{response.var}.
The default option is \code{tag.nonevent = NULL}, which selects the class with the greatest number of units as non-event.}

\item{method}{A character string indicating the method implemented to calculate the confidence interval:
\code{method = 'JKn'} or \code{method = 'subbootstrap'}. Default is \code{method = 'JKn'}.}

\item{boot.B}{A numeric value indicating the number of bootstrap resamples to be considered. Default is \code{boot.B=1000}. Only for \code{method = 'subbootstrap'}.}

\item{boot.ci}{Select \code{boot.ci = 'normal'} for standardized normal distribution-based confidence intervals
and \code{boot.ci = 'quantile'} for confidence intervals based on quantiles. Default is \code{boot.ci = 'normal'}. Only for \code{method = 'subbootstrap'}.}

\item{conf.level}{A numeric value between 0 and 1 indicating the confidence level. Default is \code{conf.level = 0.95}, resulting in a 95\% CI.}
}
\value{
The output object of this function is a list of 2 elements containing the following information:
\itemize{
\item \code{wauc}: a numeric value indicating the weighted point estimate of the AUC.
\item \code{ci}: a numeric vector indicating the lower and upper values of the confidence interval.
}
}
\description{
Design-based confidence intervals for the AUC.
}
\examples{
\donttest{
mydesign <- survey::svydesign(ids = ~cluster, strata = ~strata, weights=~weights, 
data = example_variables_wroc, nest=TRUE)
m <- survey::svyglm(y ~ x1 + x2 + x3 + x4 + x5 + x6, design = mydesign, family = quasibinomial())
phat <- predict(m, newdata = example_variables_wroc, type = "response")
example_variables_wroc$phat <- phat
mydesign <- survey::svydesign(ids = ~cluster, strata = ~strata, weights = ~weights, 
data = example_variables_wroc, nest=TRUE)

# JKn-based confidence interval:
ci.JKn <- ci.wauc(design=mydesign, response.var = "y", phat.var = "phat", 
                  tag.event = 1, tag.nonevent = 0, method="JKn")

# Bootstrap-based confidence interval:
set.seed(123)
ci.boot <- ci.wauc(design=mydesign, response.var = "y", phat.var = "phat", 
                   tag.event = 1, tag.nonevent = 0, method="subbootstrap")
}

}
\references{
Iparragirre, A., Lumley, T., & Barrio, I. (2026).
Design-Based Inference for the AUC with Complex Survey Data.
arXiv, 2603.28320.
(https://arxiv.org/abs/2603.28320)
}
