surveycore 0.6.0
Breaking changes
survey_srsclass andas_survey_srs()constructor have been removed. SRS
designs are now created viaas_survey()with noidsorstrata— this
produces asurvey_taylorwith no cluster/strata structure. All estimates are
numerically identical.
New features
-
get_diffs()estimates treatment effects (differences from a reference group)
via survey-weighted regression. Supports bivariate and multivariate models,
Gaussian and non-Gaussian families, and optional subgroup analysis. Two
estimation paths: direct coefficients for simple models, and
marginaleffects::avg_slopes()/avg_predictions()for models with
covariates or non-Gaussian AMEs. Returns asurvey_diffstibble with optional
mean,pct_change,n_weightedcolumns, significance stars, and p-value
adjustment.marginaleffectsmoved from Suggests to Imports. -
as_survey()now supports multi-column FPC for multi-stage designs
(e.g.,fpc = c(fpc_stage1, fpc_stage2)). Each FPC column corresponds to one
ID stage. Per-stage FPC is validated for NAs, non-positive values, and
within-cluster constancy. -
print()forsurvey_taylornow displays per-stage FPC bullets for
multi-stage designs (e.g.,FPC (stage 1): fpc,FPC (stage 2): fpc2).
Bug fixes
-
SRS variance estimation now uses Taylor (HT) linearization via
.build_cluster_matrices(), correct for any weight structure. Previously used
unweighted sample variance which was incorrect for non-proportional weights. -
survey_glm()now correctly indexes weights whenna.action = na.omitdrops
non-contiguous rows. -
get_freqs()now routessurvey_nonprobdesigns through the
Horvitz-Thompson variance path, consistent with the other five analysis
functions. -
as_survey_twophase()now acceptssurvey_replicateand SRS
survey_taylorobjects as the phase-1 design (previously restricted to
stratified/clusteredsurvey_tayloronly). -
as_survey()SRS fallback downgraded from warning to message.
Internal infrastructure
.build_cluster_matrices()extracts multi-stage cluster, strata, and FPC
matrix construction into a shared helper, used across the Taylor variance
engine, analysis cell estimators, and GLM sandwich variance.