Skip to content

v0.9.0

Choose a tag to compare

@JDenn0514 JDenn0514 released this 20 May 16:36
· 45 commits to main since this release
c9ff22d

New features

  • set_higher_is() and extract_higher_is() store and retrieve a
    direction-of-improvement attribute ("better" or "worse") for survey
    variables. The attribute is used by get_diffs(show_favorability = TRUE)
    to classify differences as favorable or backlash. Supports all three
    calling conventions (named ... args, named vector,
    variable = + direction =), data frames, and tidy-select.

  • set_reverse_coded() and extract_reverse_coded() store and retrieve a
    reverse-coded flag for survey variables. Supports tidy-select ... (bare
    names and selection helpers) and the variable = character-vector
    interface. Setting reverse_coded = FALSE removes the flag. Works on both
    survey design objects and plain data frames.

  • get_diffs() gains alpha and show_favorability arguments.
    show_favorability = TRUE appends favorable and backlash logical
    columns to the result. A difference is classified as favorable when it is
    statistically significant (p < alpha, default 0.05) and in the
    direction indicated by higher_is metadata set via set_higher_is().
    When no higher_is metadata is set, both columns are all FALSE. The
    adjusted p-value (when pval_adj is supplied) is used for classification.

  • as_survey_nonprob() gains replicate-weight (bootstrap) support via six
    new arguments: repweights, type, scale, rscales, mse, and
    reference_sample. When repweights is supplied, the constructor resolves
    and validates the replicate weight columns and stores them in @variables.
    A reference_sample property is also added to the survey_nonprob class
    for provenance tracking.

  • All get_*() estimation functions now dispatch to the replicate-weight
    variance engine when a survey_nonprob object has repweights set.
    When no repweights are supplied, a warning is emitted and the SRS
    approximation is used as a fallback. Degrees of freedom for
    survey_nonprob estimates always use the normal approximation (Inf).

  • print() for survey_nonprob now shows bootstrap replicate information
    (replicate count, type, and scale) when repweights are set.