S7 class produced by 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.
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)
)A survey_glm_fit object.
Named numeric vector of length p.
p x p design-based variance-covariance matrix.
Numeric vector of length n (response scale).
Working residuals from IRLS, length n.
Survey weights used in fitting, length n.
The original survey_base survey design object.
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 n - 1 for SRS designs. This is
not the residual degrees of freedom used for t-statistics and confidence
intervals; those are computed as degf - (p - 1) where p is the number
of model coefficients.
GLM family object (e.g. gaussian(), binomial()).
Model formula.
Null model deviance.
Residual deviance.
Classical null df (fit$df.null from stats::glm()).
Classical residual df (fit$df.residual, i.e. n - p).
Used for the deviance display; not the design-based residual df.
Logical; whether IRLS converged.
The survey_glm() call (language object or NULL).
Internal raw stats::glm() result; NULL after serialisation.
Integer vector: attr(model.matrix(fit_), "assign")
captured at fit time. Maps design-matrix columns to formula terms (0 =
intercept; positive values index attr(terms(formula), "term.labels")).
Required by get_anova()'s serialization-safe Wald path (spec §3.3.1):
after @fit_ is stripped via saveRDS(), the term-to-column map
survives in this slot. Default integer(0).
survey_glm() to create a survey_glm_fit.
Other constructors:
as_survey(),
as_survey_nonprob(),
as_survey_replicate(),
as_survey_twophase(),
survey_data(),
survey_glm(),
survey_nonprob(),
survey_replicate(),
survey_taylor(),
survey_twophase()
# 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
Run the code above in your browser using DataLab