genMat: Generate Constraint Matrices

View source: R/auxiliaryFunctions.R

genMatR Documentation

Generate Constraint Matrices

Description

genMat generates constraint matrices for a range of preference orderings according to (i) the monotonic attention assumption proposed by Cattaneo, Ma, Masatlioglu, and Suleymanov (2020), (ii) the attention overload assumption proposed by Cattaneo, Cheung, Ma, and Masatlioglu (2021), and (iii) the attentive-at-binaries restriction.

This function is embedded in revealPref.

Usage

genMat(
  sumMenu,
  sumMsize,
  pref_list = NULL,
  RAM = TRUE,
  AOM = TRUE,
  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.

RAM

Boolean, whether the restrictions implied by the random attention model of Cattaneo, Ma, Masatlioglu, and Suleymanov (2020) should be incorporated, that is, their monotonic attention assumption (default is TRUE).

AOM

Boolean, whether the restrictions implied by the attention overload model of Cattaneo, Cheung, Ma, and Masatlioglu (2021) should be incorporated, that is, their attention overload assumption (default is TRUE).

limDataCorr

Boolean, whether assuming limited data (default is TRUE). When set to FALSE, will assume all choice problems are observed. This option only applies when RAM is set to TRUE.

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.

Author(s)

Matias D. Cattaneo, Princeton University. cattaneo@princeton.edu.

Paul Cheung, University of Maryland. hycheung@umd.edu

Xinwei Ma (maintainer), University of California San Diego. x1ma@ucsd.edu

Yusufcan Masatlioglu, University of Maryland. yusufcan@umd.edu

Elchin Suleymanov, Purdue University. esuleyma@purdue.edu

References

M. D. Cattaneo, X. Ma, Y. Masatlioglu, and E. Suleymanov (2020). A Random Attention Model. Journal of Political Economy 128(7): 2796-2836. doi: 10.1086/706861

M. D. Cattaneo, P. Cheung, X. Ma, and Y. Masatlioglu (2022). Attention Overload. Working paper.

Examples

# 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]


ramchoice documentation built on May 24, 2022, 1:06 a.m.