The projective distribution of a district-level summary statistic (McCartan 2024) is the distribution of values of that statistic across a set of plans for the district each precinct belongs to. The projective average of a statistic is the average value of the projective distribution in each precinct. A projective contrast is the difference between the projective average for a single plan and the projective average for an ensemble of sampled plans.
This PR adds functions to calculate each of these, replacing the old avg_by_prec(), which is now deprecated. It also adds redist.plot.contr_fdr() which plots projective contrasts while controlling the positive false discovery rate (pFDR).
Adds matrixStats and ggpattern in Suggests so as not to bloat dependencies (though the former might be worth Importing, as it could simplify lots of our other code, potentially).
The projective distribution of a district-level summary statistic (McCartan 2024) is the distribution of values of that statistic across a set of plans for the district each precinct belongs to. The projective average of a statistic is the average value of the projective distribution in each precinct. A projective contrast is the difference between the projective average for a single plan and the projective average for an ensemble of sampled plans.
This PR adds functions to calculate each of these, replacing the old
avg_by_prec()
, which is now deprecated. It also addsredist.plot.contr_fdr()
which plots projective contrasts while controlling the positive false discovery rate (pFDR).Adds
matrixStats
andggpattern
inSuggests
so as not to bloat dependencies (though the former might be worth Importing, as it could simplify lots of our other code, potentially).