
Compute Deciles of a Measure
compute_decile.RdAssigns rows to deciles of measure_col within each group and reference
date, then reports the median and mean of the measure in each decile.
Arguments
- data
Data frame containing a
ref_datecolumn and the measure.- group_cols
Character vector of columns to group by, or
NULLfor no grouping.- measure_col
Character. Numeric column to rank into deciles.
- latest_measure
Logical. Restrict to the latest reference date and drop
ref_datefrom the grouping. DefaultFALSE.