
Last chance! 50% off unlimited learning
Sale ends in
Last chance! 50% off unlimited learning
Sale ends in
Define voting blocs along a continuous variable and estimate their partisan vote contributions.
vb_continuous(
data,
data_density = data,
data_turnout = data,
data_vote = data,
indep,
dv_vote3,
dv_turnout,
weight = NULL,
min_val = NULL,
max_val = NULL,
n_points = 100,
boot_iters = FALSE,
verbose = FALSE,
tolerance = sqrt(.Machine$double.eps),
...
)
a vbdf
data.frame with columns for the resample, bloc variable,
and, for each resample-bloc combination, four estimates:
probability density, turnout, Republican vote choice conditional on turnout,
and net Republican votes.
default data.frame to use as the source for density, turnout, and vote choice data.
data.frame of blocs' composition/density data. Must
include any columns named by indep
and weight
.
data.frame of blocs' turnout data. Must include any
columns named by dv_turnout
, indep
and
weight
.
data.frame of blocs' vote choice data. Must include any
columns named by dv_vote3
, indep
, and weight
.
string, column name of the independent variable defining discrete voting blocs.
string, column name of the dependent variable in data_vote
, coded as
follows: -1 for Democrat vote choice, 0 for third-party vote, 1 for
Republican vote choice, and NA for no vote.
string, column name of the dependent variable flagging
voter turnout in data_turnout
. That column must be coded 0 = no vote, 1 = voted.
optional string naming the column of sample weights.
numeric vector of the same length as indep
, Lower bound for the density estimation of each respective indep
. See
[estimate_density].
numeric vector of the same length as indep
, Upper bound for the density estimation of each respective indep
. See
[estimate_density].
scalar, number of points at which to estimate density. See [estimate_density].
integer, number of bootstrap iterations for uncertainty
estimation. The default FALSE
is equivalent to 0 and does not estimate
uncertainty.
logical, whether to print iteration number.
tolerance used when checking range of probability estimates
further arguments to pass to kde for density estimation.