Description Usage Arguments Value
View source: R/ef_simulate_data.R
This function simulates data sets from the Election Forensics Finite Mixture models.
1 2 | ef_simulateData(n = 2000, nCov = 0, nCov.fraud = 0, model,
pi = NULL, overdispersion = 10)
|
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 |
pi |
vector with three numbers between 0 and 1 whose sum must add up to 1. If |
overdispersion |
numeric, degree of overdispersion of the distributions |
The function returns a list with a data frame with the simulated data and a sublist with the parameters used to generate the data
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.