vb_continuous {blocs} | R Documentation |
Continuous voting bloc analysis
Description
Define voting blocs along a continuous variable and estimate their partisan vote contributions.
Usage
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),
...
)
Arguments
data |
default data.frame to use as the source for density, turnout, and vote choice data. |
data_density |
data.frame of blocs' composition/density data. Must
include any columns named by |
data_turnout |
data.frame of blocs' turnout data. Must include any
columns named by |
data_vote |
data.frame of blocs' vote choice data. Must include any
columns named by |
indep |
string, column name of the independent variable defining discrete voting blocs. |
dv_vote3 |
string, column name of the dependent variable in |
dv_turnout |
string, column name of the dependent variable flagging
voter turnout in |
weight |
optional string naming the column of sample weights. |
min_val |
numeric vector of the same length as |
max_val |
numeric vector of the same length as |
n_points |
scalar, number of points at which to estimate density. See [estimate_density]. |
boot_iters |
integer, number of bootstrap iterations for uncertainty
estimation. The default |
verbose |
logical, whether to print iteration number. |
tolerance |
tolerance used when checking range of probability estimates |
... |
further arguments to pass to kde for density estimation. |
Value
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.