% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/glm.R
\name{survey_glm_fit}
\alias{survey_glm_fit}
\title{Survey-Weighted GLM Fit Object}
\usage{
survey_glm_fit(
  coefficients = integer(0),
  vcov = NULL,
  fitted_values = integer(0),
  residuals = integer(0),
  weights = integer(0),
  design = survey_base(),
  degf = integer(0),
  family = list(),
  formula = NULL,
  null_deviance = integer(0),
  deviance = integer(0),
  df_null = integer(0),
  df_residual = integer(0),
  converged = logical(0),
  call = NULL,
  fit_ = NULL,
  term_assign = integer(0)
)
}
\arguments{
\item{coefficients}{Named numeric vector of length \code{p}.}

\item{vcov}{\verb{p x p} design-based variance-covariance matrix.}

\item{fitted_values}{Numeric vector of length \code{n} (response scale).}

\item{residuals}{Working residuals from IRLS, length \code{n}.}

\item{weights}{Survey weights used in fitting, length \code{n}.}

\item{design}{The original \link{survey_base} survey design object.}

\item{degf}{Raw design degrees of freedom (positive scalar): number of
PSUs minus number of strata for Taylor designs, number of replicates
minus one for replicate designs, and \code{n - 1} for SRS designs. This is
\emph{not} the residual degrees of freedom used for t-statistics and confidence
intervals; those are computed as \code{degf - (p - 1)} where \code{p} is the number
of model coefficients.}

\item{family}{GLM family object (e.g. \code{gaussian()}, \code{binomial()}).}

\item{formula}{Model formula.}

\item{null_deviance}{Null model deviance.}

\item{deviance}{Residual deviance.}

\item{df_null}{Classical null df (\code{fit$df.null} from \code{stats::glm()}).}

\item{df_residual}{Classical residual df (\code{fit$df.residual}, i.e. \code{n - p}).
Used for the deviance display; \strong{not} the design-based residual df.}

\item{converged}{Logical; whether IRLS converged.}

\item{call}{The \code{survey_glm()} call (language object or \code{NULL}).}

\item{fit_}{Internal raw \code{stats::glm()} result; \code{NULL} after serialisation.}

\item{term_assign}{Integer vector: \code{attr(model.matrix(fit_), "assign")}
captured at fit time. Maps design-matrix columns to formula terms (0 =
intercept; positive values index \code{attr(terms(formula), "term.labels")}).
Required by \code{get_anova()}'s serialization-safe Wald path (spec §3.3.1):
after \verb{@fit_} is stripped via \code{saveRDS()}, the term-to-column map
survives in this slot. Default \code{integer(0)}.}
}
\value{
A \code{survey_glm_fit} object.
}
\description{
S7 class produced by \code{\link[=survey_glm]{survey_glm()}}. Holds all regression output from a
survey-weighted generalised linear model: design-based coefficient
estimates, variance-covariance matrix, fitted values, residuals, and
model metadata.
}
\examples{
# survey_glm_fit objects are created by survey_glm(), not directly
d <- as_survey(gss_2024, ids = vpsu, weights = wtssps,
               strata = vstrat, nest = TRUE)
fit <- survey_glm(d, age ~ sex)
fit@coefficients

}
\seealso{
\code{\link[=survey_glm]{survey_glm()}} to create a \code{survey_glm_fit}.

Other constructors: 
\code{\link{as_survey}()},
\code{\link{as_survey_nonprob}()},
\code{\link{as_survey_replicate}()},
\code{\link{as_survey_twophase}()},
\code{\link{survey_data}()},
\code{\link{survey_glm}()},
\code{\link{survey_nonprob}()},
\code{\link{survey_replicate}()},
\code{\link{survey_taylor}()},
\code{\link{survey_twophase}()}
}
\concept{constructors}
