
Extract coefficients from a survey result object
Source:R/analysis-methods-coef-vcov.R
coef.survey_result.RdReturns a named numeric vector of point estimates from a survey_result
object (produced by get_means(), get_totals(), get_freqs(),
get_ratios(), get_quantiles(), get_corr(), get_covariance(),
or get_diffs()).
Usage
# S3 method for class 'survey_result'
coef(object, ...)Value
A named numeric vector. Names follow variable-major, group-secondary
ordering matching survey::coef.svyby(). For grouped results, names are
"group_value:variable_name" (e.g., "A:y1", "B:y1"). For ungrouped
results, names are the variable name (e.g., "y1"). See the spec for
class-specific naming rules.
Details
Not all survey_result subclasses support coef(). survey_t_test and
survey_pairwise objects throw surveycore_error_result_method_unsupported.
Wide-format survey_corr objects (from get_corr(format = "wide")) also
throw this error. For those objects, access columns directly (e.g.,
result$estimate, result$se).