% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/glm-anova-dispatch.R
\name{get_anova}
\alias{get_anova}
\title{Design-Based Analysis of Variance for Survey GLM Fits}
\usage{
get_anova(
  object,
  formula = NULL,
  response = NULL,
  predictors = NULL,
  ...,
  method = c("LRT", "Wald"),
  test = c("F", "Chisq"),
  null = NULL,
  tolerance = sqrt(.Machine$double.eps),
  decimals = NULL,
  label_vars = TRUE,
  name_style = "surveycore"
)
}
\arguments{
\item{object}{A \link{survey_glm_fit}, a list of \link{survey_glm_fit} objects, or a
survey design (\link{survey_base} subclass).}

\item{formula}{A model formula (e.g. \code{y ~ x1 + x2}). Only used when
\code{object} is a survey design. Passed through to \code{\link[=survey_glm]{survey_glm()}}; supplying
\code{formula} alongside \code{response} / \code{predictors} is rejected by
\code{\link[=survey_glm]{survey_glm()}}'s validator.}

\item{response}{Character string naming the outcome variable. Only used
when \code{object} is a survey design. Forwarded to \code{\link[=survey_glm]{survey_glm()}}.}

\item{predictors}{Character vector of predictor variable names. Only used
when \code{object} is a survey design. Forwarded to \code{\link[=survey_glm]{survey_glm()}}.}

\item{...}{Additional arguments forwarded to \code{\link[=survey_glm]{survey_glm()}} when \code{object}
is a survey design (e.g. \code{family}, \code{na.action}, \code{quiet}). For fit or list
inputs, \code{...} must be empty — any extras error via
\code{\link[rlang:check_dots_empty]{rlang::check_dots_empty()}} with fuzzy typo detection.}

\item{method}{Character(1). \code{"LRT"} (default) or \code{"Wald"}.}

\item{test}{Character(1). \code{"F"} (default) or \code{"Chisq"} reference
distribution.}

\item{null}{Numeric or \code{NULL}. Hypothesized value for the tested
coefficients (Wald only). Only used when \code{object} is a single
\link{survey_glm_fit} or a survey design (reducing to single-model mode);
ignored with warning \code{surveycore_warning_anova_null_ignored} when
\code{object} is a list of fits.}

\item{tolerance}{Numeric(1). Reciprocal-condition-number threshold for the
naive-covariance near-singular gate in the Rao-Scott LRT. Default
\code{sqrt(.Machine$double.eps)}.}

\item{decimals}{Integer(1) or \code{NULL}. Round double output columns.}

\item{label_vars}{Logical(1). When \code{TRUE}, compose term-row labels from
\verb{@metadata@variable_labels} for the \code{term} column. Default \code{TRUE}.}

\item{name_style}{Character(1). \code{"surveycore"} (default) or \code{"broom"}.}
}
\value{
A \code{survey_anova} tibble with columns \code{term}, \code{statistic}, \code{df},
\code{ddf}, \code{deff}, \code{p_value}, \code{stars} and a \code{.meta} attribute.
}
\description{
Rao-Scott design-based ANOVA for \code{\link[=survey_glm]{survey_glm()}} fits. Accepts three input
shapes on \code{object}:
}
\details{
\itemize{
\item A single \link{survey_glm_fit} — sequential mode, one row per term.
\item A list of \link{survey_glm_fit} objects — chained pairwise comparison,
producing \code{length(object) - 1} rows.
\item A survey design (any \link{survey_base} subclass) — fits the model internally
via \code{\link[=survey_glm]{survey_glm()}} using \code{formula} (or \code{response} + \code{predictors}), then
runs sequential anova on the fit.
}

Supports the four method x test combinations shared with
\code{survey::anova.svyglm()}: Rao-Scott working-LRT with F or Chisq reference,
and design-based Wald with F or Chisq reference.
}
\examples{
gss_cc <- gss_2024[
  stats::complete.cases(gss_2024[, c("age", "sex", "educ")]),
]
gss_design <- as_survey(
  gss_cc, ids = vpsu, weights = wtssps,
  strata = vstrat, nest = TRUE
)

# Single fit
fit <- survey_glm(gss_design, age ~ sex + educ)
get_anova(fit)

# Design + formula (fits internally)
get_anova(gss_design, age ~ sex + educ)

# List of fits (chained pairwise comparison)
fit_s <- survey_glm(gss_design, age ~ sex)
fit_b <- survey_glm(gss_design, age ~ sex + educ)
get_anova(list(fit_s, fit_b))

}
\seealso{
Other analysis: 
\code{\link{clean}()},
\code{\link{get_corr}()},
\code{\link{get_covariance}()},
\code{\link{get_diffs}()},
\code{\link{get_freqs}()},
\code{\link{get_means}()},
\code{\link{get_pairwise}()},
\code{\link{get_quantiles}()},
\code{\link{get_ratios}()},
\code{\link{get_t_test}()},
\code{\link{get_totals}()},
\code{\link{get_variance}()},
\code{\link{meta}()}
}
\concept{analysis}
