genIdeals: genIdeals Generates ideal points for a set of voters....

Description Usage Arguments Value Examples

View source: R/genIdeals.R

Description

genIdeals Generates ideal points for a set of voters.

Generates one or two dimensional ideal points from one of given set of distributions, from calibrated data, or from a user provided distribution. it is a wrapper for genPoints and is itself further wrapped by genVoters.

Usage

1
2
3
4
5
6
7
8
genIdeals(
  numberOfDimensionsGenIdeals = 1,
  numberOfIdealsGenIdeals = 100,
  distributionTypeGenIdeals = "unif",
  distributionParametersGenIdeals = c(-1, 1),
  dimOneBoundsGenIdeals = c(-Inf, Inf),
  dimTwoBoundsGenIdeals = c(-Inf, Inf)
)

Arguments

numberOfDimensionsGenIdeals

The number of policy dimensions.

numberOfIdealsGenIdeals

Number of points to generate.

distributionTypeGenIdeals

A string identifying the base R discribution to draw the ideal points from. Uses the base R random number generation family of commands rxxxx (see ?distributions). The user should specify the distribution as a string using the standard R abreviation for the distribution (see ?distributions for a list). Currently supported are: "norm", "unif", "beta", "cauchy", "chisq", "weibull"

distributionParametersGenIdeals

A vector that contains the additional parameters needed by the particular rxxxx function for a distribtuion. (see ?rxxxx where xxxx is a function listed under ?distribution). Example for a Normal(0,1), use: c(0,1).

dimOneBoundsGenIdeals

A vector that contains the starting and ending poitns of t he first dimension. Example: c(0,1). Defaults to c(-Inf, Inf) if no boundary is provided.

dimTwoBoundsGenIdeals

A vector that contains the starting and ending poitns of t he first dimension. Example: c(0,1). Defaults to c(-Inf, Inf) if no boundary is provided.

Value

outIdeals An ideal point matrix that is numVoters x numDimensions

Examples

1
2
3
4
5
6
  genIdeals(numberOfDimensionsGenIdeals=1, numberOfIdealsGenIdeals=100, distributionTypeGenIdeals ="norm", distributionParametersGenIdeals = c(0,.5), dimOneBoundsGenIdeals = c(0,Inf), dimTwoBoundsGenIdeals = c(-Inf,0))
  
  genIdeals(numberOfDimensionsGenIdeals=2, numberOfIdealsGenIdeals=100, distributionTypeGenIdeals ="unif", distributionParametersGenIdeals = c(-1,1), dimOneBoundsGenIdeals = c(-Inf,Inf), dimTwoBoundsGenIdeals = c(-Inf,Inf) )
  
 genIdeals(numberOfDimensionsGenIdeals=2, numberOfIdealsGenIdeals=100, distributionTypeGenIdeals ="beta", distributionParametersGenIdeals = c(.1,1), dimOneBoundsGenIdeals = c(-Inf,Inf), dimTwoBoundsGenIdeals = c(-Inf,Inf) )
  

robiRagan/voteR documentation built on Feb. 27, 2020, 6:48 p.m.