plot_local_fraud: Plot samples from eforensics

Description Usage Arguments

Description

This function creates a plot with posterior distribution of fraud in a given election unit (ballot box, pooling place, etc)

Usage

1
2
3
4
plot_local_fraud(data, samples = NULL, model = NULL, row = NULL,
  election.unit = NULL, title = NULL, subtitle = TRUE,
  plot.mean = TRUE, legend.position = "bottom", sim_data = NULL,
  by.types = TRUE)

Arguments

data

either the data set used to estimate fraud or the output of the function ef_get_local_fraud

samples

eigher NULL (default) (which requires data to be the output of the function ef_get_local_fraud) or the outuput of the function eforensics

model

either NULL (default) (which requires data to be the output of the function ef_get_local_fraud) or a string with the name of the model used to estimate fraud (see eforensics)

row

an integer with the row number of data to plot

election.unit

a string with the name of the column that contains a label that identifies the election unit. Default NULL

title

a string with the title of the plot. Default NULL

subtitle

a string with the subtitle of the plot. Default NULL

plot.mean

boolean, if TRUE the posterior average of the distribution is also displayed as well as the 95% HPD

legend.position

a string with the position of the legend when posterior mean is displayed. Accepts top, bottom, left, right

sim_data

the output of the function ef_simulateData. It is used only if the fraud was estimated using simulated data. If provided, the plot also display the true fraud value. Default NULL

by.types

boolean, if TRUE incremental, extreme, and total fraud are displayed. Otherwise, only distribution of total fraud is shown


DiogoFerrari/eforensics documentation built on Aug. 31, 2019, 3:44 p.m.