genAlts: genAlts Generates a set of alternatives or a single status...

Description Usage Arguments Value Examples

View source: R/genAlts.R

Description

genAlts Generates a set of alternatives or a single status quo.

Generates one or more one or two dimensional alternatives from one of given set of distributions, from calibrated data, or from a user provided distribution. it is a wrapper for genPoints.

Usage

1
2
3
4
5
6
7
8
genAlts(
  numberOfDimensionsGenAlts = 1,
  numberOfAltsGenAlts = 5,
  distributionTypeGenAlts = "unif",
  distributionParametersGenAlts = c(-1, 1),
  dimOneBoundsGenAlts = c(-Inf, Inf),
  dimTwoBoundsGenAlts = c(-Inf, Inf)
)

Arguments

numberOfDimensionsGenAlts

The number of policy dimensions.

numberOfAltsGenAlts

Number of points to generate.

distributionTypeGenAlts

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", "binom", "cauchy", "chisq", "weibull"

distributionParametersGenAlts

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).

dimOneBoundsGenAlts

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.

dimTwoBoundsGenAlts

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
  genAlts(numberOfDimensionsGenAlts=2, numberOfAltsGenAlts=10, distributionTypeGenAlts ="norm", distributionParametersGenAlts = c(0,1), dimOneBoundsGenAlts = c(-Inf,0), dimTwoBoundsGenAlts = c(0,Inf))
 genAlts(numberOfDimensionsGenAlts=1, numberOfAltsGenAlts=100, distributionTypeGenAlts ="unif", distributionParametersGenAlts = c(0,10)) 
 
  genAlts(numberOfDimensionsGenAlts=1, numberOfAltsGenAlts=100, distributionTypeGenAlts ="unif", distributionParametersGenAlts = c(-1,1))

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