augment_withProportion_modif.Rd
Computes and appends row-wise total denominators and numerators from specified variables. Optionally estimates missing numerators using available percentage values.
augment_withProportion_modif(
df,
varname,
denominator_variables,
numerator_variables,
percentage_variables = NULL
)
A `data.frame` or tibble containing the dataset.
A string used as prefix to name the new columns (e.g., `HBI.num`, `HBI.den`).
Character vector specifying column(s) to sum for the denominator.
Character vector specifying column(s) to sum for the numerator.
Optional character vector of percentage column(s). When provided,
missing numerator values are estimated using: numerator = denominator * percentage / 100
.
A dataframe identical to `df` but with two additional columns:
<varname>.num
Total numerator, estimated using percentages if necessary.
<varname>.den
Total denominator. Zero values are treated as `NA`.