Use vbdf output to calculate differences in blocs' net Republican vote contributions.
vb_difference(
vbdf,
estimates = grep("prob|pr_turnout|pr_votedem|pr_voterep|cond_rep|net_rep",
names(vbdf), value = TRUE),
sort_col = "year",
tolerance = sqrt(.Machine$double.eps)
)
A vbdf
object, plus two types of columns:
for each column named in estimates
, a column named diff_*
containing the
difference in each estimate across sort_col
values,
comp
, which contains a string tag for the rows compared (e.g., 2020-2016),
A vbdf
object.
data.frame holding the results of voting bloc analyses.
character vector naming the column(s) in vbdf
with
which to compute differences.
character vector naming the column(s) in vbdf
to use
for sorting before calling diff.
tolerance used when checking range of probability estimates