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.
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
)Arguments
- coefficients
Named numeric vector of length
p.- vcov
p × pdesign-based variance-covariance matrix.- fitted_values
Numeric vector of length
n(response scale).- residuals
Working residuals from IRLS, length
n.- weights
Survey weights used in fitting, length
n.- design
The original survey_base survey design object.
- 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
n - 1for SRS designs. This is not the residual degrees of freedom used for t-statistics and confidence intervals; those are computed asdegf - (p - 1)wherepis the number of model coefficients.- family
GLM family object (e.g.
gaussian(),binomial()).- formula
Model formula.
- null_deviance
Null model deviance.
- deviance
Residual deviance.
- df_null
Classical null df (
fit$df.nullfromstats::glm()).- df_residual
Classical residual df (
fit$df.residual, i.e.n - p). Used for the deviance display; not the design-based residual df.- converged
Logical; whether IRLS converged.
- call
The
survey_glm()call (language object orNULL).- fit_
Internal raw
stats::glm()result;NULLafter serialisation.
See also
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()
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
#> (Intercept) sex
#> 47.5603545 0.2595301
