Given a dataset providing the quantiles (calc_quantiles), calculates delta function(s) for the character vectors minuends and subtrahends
calc_delta_funs(
quantiles_dat,
minuends = NULL,
subtrahends = NULL,
dvs = NULL,
b_coding
)a data.frame with columns "Source", "Prob", the "Quant_<u_label>", "Quant_<l_label". May have the following additional columns:
if only one dv: as many Delta_<minuend_subtrahend> and Avg_<minuends_subtrahends> as minuends and subtrahends.
if more than one dv: as many Delta_<u/l-label><minuend_subtrahend> and Avg<u/l-label>_<minuends_subtrahends> as minuends and subtrahends.
The data.frame is of type c("delta_funs", "sum_dist", "stats_dm", "data.frame")
a data.frame of quantiles (calc_quantiles)
character vectors (with equal length), specifying the conditions to use for the delta function: minuend - subtrahend
character, indicating which quantile columns to use. Default is "Quant_<u_label>". If multiple dvs are provided, then minuends and subtrahends must have the same length, and matching occurs pairwise. In this case, if only one minuend/subtrahend is specified, minuend and subtrahend are recycled to the necessary length.
a b_coding object, necessary to build default dvs
Takes the quantile data_frame, stats::reshape it to wide, and then
access the relevant dv columns, together with minuends and subtrahends
to calculate the delta functions.
new_stats_dm()