ramchoice (version 1.1)

genMat: ramchoice Package: Generate Constraint Matrices

Description

genMat generates constraint matrices which correspond to (i) the monotonic attention assumption, (ii) attentive at binaries restriction, and (iii) preferences specified as the null hypotheses.

This function is embedded in rAtte.

Usage

genMat(sumMenu, sumMsize, pref_list = NULL, limDataCorr = TRUE,
  attBinary = 1)

Arguments

sumMenu

Numeric matrix, summary of choice problems, returned by sumData.

sumMsize

Numeric matrix, summary of choice problem sizes, returned by sumData.

pref_list

Numeric matrix, each row corresponds to one preference. For example, c(2, 3, 1) means 2 is preferred to 3 and to 1. When set to NULL, the default, c(1, 2, 3, ...), will be used.

limDataCorr

Boolean, whether assumes limited data (default is TRUE). When set to FALSE, will assume all choice problems are observed.

attBinary

Numeric, between 1/2 and 1 (default is 1), whether additional restrictions (on the attention rule) should be imposed for binary choice problems (i.e., attentive at binaries).

Value

R

Matrices of constraints, stacked vertically.

ConstN

The number of constraints for each preference, used to extract from R individual matrices of constraints.

References

M. D. Cattaneo, X. Ma, Y. Masatlioglu and E. Suleymanov (2019). A Random Attention Model. Journal of Political Economy, forthcoming.

Examples

Run this code
# NOT RUN {
# Load data
data(ramdata)

# Generate summary statistics
summaryStats <- sumData(ramdata$menu, ramdata$choice)

# Generate constraint matrices
constraints <- genMat(summaryStats$sumMenu, summaryStats$sumMsize)
constraints$ConstN
constraints$R[1:10, 1:10]

# }

Run the code above in your browser using DataLab