vb_summary {blocs}R Documentation

Summarize uncertainty for a vbdf objects

Description

Summarize uncertainty for a vbdf objects. Analysis must have run with bootstrap iterations. vb_uncertainty is just an alias for vb_summary.

Usage

vb_summary(
  object,
  type = c("discrete", "continuous", "binned"),
  estimates = grep("prob|pr_turnout|pr_votedem|pr_voterep|cond_rep|net_rep",
    names(object), value = TRUE),
  na.rm = FALSE,
  funcs = c("mean", "median", "low", "high"),
  low_ci = 0.025,
  high_ci = 0.975,
  bin_col,
  tolerance = sqrt(.Machine$double.eps)
)

vb_uncertainty(
  object,
  type = c("discrete", "continuous", "binned"),
  estimates = grep("prob|pr_turnout|pr_votedem|pr_voterep|cond_rep|net_rep",
    names(object), value = TRUE),
  na.rm = FALSE,
  funcs = c("mean", "median", "low", "high"),
  low_ci = 0.025,
  high_ci = 0.975,
  bin_col,
  tolerance = sqrt(.Machine$double.eps)
)

Arguments

object

a vbdf object, usually the output of [vb_discrete], [vb_continuous], or [vb_difference].

type

a string naming the type of independent variable summary. Use "binned" when using the output of [vb_continuous] plus a binned version of the continuous bloc variable.

estimates

character vector naming columns for which to calculate uncertainty estimates.

na.rm

logical indicating whether to remove NA values in estimates.

funcs

character vector of summary functions to apply to estimates. Alternatively, supply your own list of functions, which should accept a numeric vector input and return a scalar.

low_ci

numeric. If you include the string "low" in funcs, then use this argument to control the lower bound of the confidence interval.

high_ci

numeric. If you include the string "high" in funcs, then use this argument to control the upper bound of the confidence interval.

bin_col

character vector naming the column(s) that define the bins. Used only when type is "binned".

tolerance

tolerance used when checking range of probability estimates

Value

A summary object with additional columns for each combination of estimates and funcs.


[Package blocs version 0.1.1 Index]