sampleElectionData: Sample Election Data

Description Usage Arguments Value Examples

Description

Return a pseudorandom sample (from a truncated log-normal distribution) of n election results using a variaty of paremeters such as: the number of parties (np), the total number of seats (TS) or the number of electoral districts.

Usage

1
2
sampleElectionData(seed = 0, dist = "uniform", np, nd, ne, mean = NULL,
  sd = NULL, rate = NULL, max, TS, formula_dist, ...)

Arguments

seed

A scalar value (a random seed) used to initialize a pseudorandom number generator.

dist

A character value for a probability distribution function used to sample data. 'Uniform' (default) = 'uniform', 'Exponential' = 'exp' and 'Log-Normal' = 'lnorm' distributions are available.

np

A numeric value for the number of parties.

nd

A numeric value for the number of electoral districts.

ne

A numeric value for the number of elections.

mean

A numeric value for the location parameter (a log-normal distribution).

sd

A numeric value for the scale parameter (a log-normal distribution).

rate

A numeric value for the rate parameter (an exponential distribution).

max

A numeric value for the upper limit of the domain for a truncated log-normal distribution used to sample votes for parties at the constituency level.

TS

A numeric value for the total number of seats apportioned among electoral district (if nd (the number of district) > 1), using a selected electoral formula.

formula_dist

A character value that specifies the apportionment method used to divide seats ('TS') among electoral districts.

Value

A list containing: Votes_Dist_Party, Seats_Dist, Votes_Share_Party, Votes_Total_Dist, Votes_Total_Party, Votes_Total.

Examples

1
(...)

pierzgal/dispam documentation built on May 25, 2019, 7:11 a.m.