ef_simulateData: Simulate Election data

Description Usage Arguments Value

View source: R/ef_simulate_data.R

Description

This function simulates data sets from the Election Forensics Finite Mixture models.

Usage

1
2
ef_simulateData(n = 2000, nCov = 0, nCov.fraud = 0, model,
  pi = NULL, overdispersion = 10)

Arguments

n

integer, the number of sample points representing observations of election units (e.g., precinct, ballot boxes)

nCov

number of covariates affecting both turnout and votes for the winner in each election unit

model

a string with the model ID to use in the estimation. Run ef_models() to see the list and descriptions of the models available.

pi

vector with three numbers between 0 and 1 whose sum must add up to 1. If NULL (default) this vector will be randomly generated

overdispersion

numeric, degree of overdispersion of the distributions

Value

The function returns a list with a data frame with the simulated data and a sublist with the parameters used to generate the data


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