% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/def_ensemble_gof.R
\name{def.ensemble.gof}
\alias{def.ensemble.gof}
\title{Combine Directed GOF Tests into One Decision (Ensemble)}
\usage{
def.ensemble.gof(
  object,
  predicted_probs = NULL,
  X = NULL,
  components = c("poly2", "poly3", "stukel"),
  add_ef = FALSE,
  combine = c("cct", "minp", "fisher"),
  G = 10,
  extra_pvalues = NULL
)
}
\arguments{
\item{object}{A fitted binary logistic \code{\link[stats]{glm}}, or a binary
(0/1) vector \code{y} (then supply \code{predicted_probs}).}

\item{predicted_probs}{Numeric predicted probabilities; required when
\code{object} is a \code{y} vector.}

\item{X}{Optional design matrix, threaded to \code{\link{def.gof}} for the exact
calibration (only used with the \code{y}/\code{predicted_probs} form).}

\item{components}{Character vector, a subset of \code{c("poly2","poly3","stukel")}.
Default is all three.}

\item{add_ef}{Logical; if \code{TRUE}, the omnibus EF p-value (\code{\link{ef.gof}})
is appended to the components. Default \code{FALSE}.}

\item{combine}{One of \code{"cct"} (default), \code{"minp"}, \code{"fisher"}.}

\item{G}{Integer number of groups passed to \code{def.gof}/\code{ef.gof} (default 10).}

\item{extra_pvalues}{Optional named numeric vector of additional p-values to
include (e.g. a Tsiatis test computed elsewhere). Default \code{NULL}.}
}
\value{
A one-row \code{data.frame} with columns \code{Test}, \code{Combiner},
  \code{Components}, \code{k}, and \code{p_value}.
}
\description{
Combines the three Directed Ebrahim-Farrington (DEF) basis tests
(\code{"poly2"}, \code{"poly3"}, \code{"stukel"}) into a single goodness-of-fit
decision, so the user does not have to choose a basis. By default the p-values
are combined with the Cauchy Combination Test (CCT), which controls the error
rate under the strong dependence between tests computed on the same fitted
model. The omnibus EF test can optionally be added to the vote.
}
\details{
Because the component tests are computed on the same fit, their p-values are
strongly dependent. The CCT (\code{combine = "cct"}) has an asymptotic
standard-Cauchy null whose tail is robust to this dependence, so it needs no
calibration. The \code{"minp"} (Sidak) and \code{"fisher"} rules assume
independence and are offered for comparison only; under positive dependence
\code{"minp"} is conservative and \code{"fisher"} is anti-conservative, so they
should be calibrated by simulation before use (not done here).
}
\examples{
set.seed(1)
n <- 500
x <- runif(n, -3, 3)
y <- rbinom(n, 1, 1 / (1 + exp(-(0.6 * x))))
fit <- glm(y ~ x, family = binomial())
def.ensemble.gof(fit)                 # CCT of the three DEF bases
def.ensemble.gof(fit, add_ef = TRUE)  # add the omnibus EF

}
\references{
Liu, Y. and Xie, J. (2020). Cauchy combination test. \emph{JASA}, 115(529), 393-402.
}
\seealso{
\code{\link{def.gof}}, \code{\link{ef.gof}}.
}
\author{
Ebrahim Khaled Ebrahim \email{ebrahimkhaled@alexu.edu.eg}
}
