% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ht.indep.R
\name{ht.indep}
\alias{ht.indep}
\title{Design-based hypothesis test for the comparison of two independent AUCs.}
\usage{
ht.indep(
  design.1,
  response.var.1,
  phat.var.1,
  design.2,
  response.var.2,
  phat.var.2,
  tag.event = NULL,
  tag.nonevent = NULL,
  alternative = c("two.sided", "greater", "less"),
  method = c("JKn", "subbootstrap"),
  boot.B = 1000
)
}
\arguments{
\item{design.1}{An object of class \code{survey.design} generated by
\code{survey::svydesign} indicating the complex sampling design of the data set 1.}

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

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

\item{design.2}{An object of class \code{survey.design} generated by
\code{survey::svydesign} indicating the complex sampling design of the data set 2.}

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

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

\item{tag.event}{A character string indicating the label used to indicate the event of interest.
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.
The default option is \code{tag.nonevent = NULL}, which selects the class with the greatest number of units as non-event.}

\item{alternative}{A character string specifying the alternative hypothesis: \code{'two.sided'}, \code{greater}, or \code{less}.
Default is \code{alternative = 'two.sided'}.}

\item{method}{A character string indicating the method implemented to estimate the variance:
\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'}.}
}
\value{
The output object of this function is a list of 5 elements containing the following information:
\itemize{
\item \code{wauc.1}: a numeric value indicating the weighted point estimate of the AUC for model 1.
\item \code{wauc.2}: a numeric value indicating the weighted point estimate of the AUC for model 2.
\item \code{sd}: a numeric value indicating the square root of the estimated variance.
\item \code{z}: a numeric value indicating the value of the statistic.
\item \code{pvalue}: a numeric value indicating the p-value of the test.
}
}
\description{
Design-based hypothesis test for the comparison of two independent AUCs.
}
\examples{
\donttest{
des.1 <- survey::svydesign(ids = ~cluster, strata = ~strata, weights=~weights, 
                           data = example_variables_wroc, nest=TRUE)
m.1 <- survey::svyglm(y ~ x1 + x2 + x3 + x4 + x5 + x6, design = des.1, family = quasibinomial())
example_variables_wroc$phat.1 <- predict(m.1, newdata = example_variables_wroc, type = "response")
des.1 <- survey::svydesign(ids = ~cluster, strata = ~strata, weights = ~weights,
                           data = example_variables_wroc, nest=TRUE)
des.2 <- survey::svydesign(ids = ~cluster, strata = ~strata, weights=~weights, 
                           data = example_variables_wroc_2, nest=TRUE)
m.2 <- survey::svyglm(y ~ x1 + x2 + x3 + x4 + x5 + x6, design = des.2, family = quasibinomial())
example_variables_wroc$phat.2 <- predict(m.1, newdata = example_variables_wroc_2, type = "response")
des.2 <- survey::svydesign(ids = ~cluster, strata = ~strata, weights = ~weights,
                           data = example_variables_wroc_2, nest=TRUE)
                           
# JKn-based hypothesis test:
jkn.ht <- ht.indep(design.1=des.1, response.var.1="y", phat.var.1 = "phat.1",
                   design.2=des.2, response.var.2="y", phat.var.2 = "phat.2",
                   tag.event=1, tag.nonevent=0, method="JKn")
                   
# Bootstrap-based hypothesis test:
boot.ht <- ht.indep(design.1=des.1, response.var.1="y", phat.var.1 = "phat.1",
                    design.2=des.2, response.var.2="y", phat.var.2 = "phat.2",
                    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)
}
