genGroupLevelDataFrame: genGroupLevelDataFrame

Description Usage Arguments Value

Description

Creates a data.frame to hold the group level data for the simulation.

Usage

1
2
3
genGroupLevelDataFrame(groupSize, utilityDistribution,
  utilityDistributionParameters, errorDistribution, errorDistributionParameters,
  groupPostFailingProposalMeanUiIncrease)

Arguments

groupSize

This is a vector that has a length of numberOfGroups. Each element indicates the number of voters in each group. While the examples in the paper use 3 groups, the package can handle any number of groups.

utilityDistribution

The distribution the utility ui values will be drawn from. This can currently only be "normal".

utilityDistributionParameters

The relevant parameters needed for the distribution provided as utilityDistribution. You must provide a pair of parameters for each group. For "normal" you must provide the mean and standard deviation. For example for 5 groups and utilityDistribution="normal", you might provide c(-.7,.2,-.1,.2,0,.2,-.3,.2,.2,.2).

errorDistribution

The distribution the error ei values will be drawn from. This can be "uniform", "normal".

errorDistributionParameters

The relevant parameters needed for the distribution provided as errorDistribution. For "normal" you must provide the mean and standard deviation. For "uniform" you must provide the lower bound and upper bound. For example for 5 groups and errorDistribution="uniform", you might provide c(-.7,0,-.1,.3,0,.2,-.3,.2,-.2,.2).

groupPostFailingProposalMeanUiIncrease

The amount the mean used to sample a group's ui goes up after a failing proposal. Must be entered as a string vector.

Value

groupsDataFrame A dataframe with G rows, containing the following columns: groupID, utilityDistribution, utilityDistributionParam1, utilityDistributionParam2, errorDistribution, errorDistributionParam1, errorDistributionParam2, groupPostFailingProposalMeanUiIncrease.


codeForReviewer/kMajorityRule documentation built on May 13, 2019, 8:47 p.m.