revealAtte {ramchoice}R Documentation

Revealed Attention Analysis in Random Limited Attention Models

Description

Given a random sample of choice problems and choices, revealAtte returns the upper and lower bounds on the attention frequency following the construction of Cattaneo, Cheung, Ma, and Masatlioglu (2024).

sumData is a low-level function that generates summary statistics. For revealed preference analysis, see revealPref.

Usage

revealAtte(
  menu,
  choice,
  alternative = NULL,
  S = NULL,
  lower = TRUE,
  upper = TRUE,
  pref = NULL,
  nCritSimu = 2000,
  level = 0.95
)

Arguments

menu

Numeric matrix of 0s and 1s, the collection of choice problems.

choice

Numeric matrix of 0s and 1s, the collection of choices.

alternative

Numeric vector, the alternatives for which to compute bounds on the attention frequency. For example, c(1, 2, 4) means the first, second, and fourth alternatives.

S

Numeric matrix of 0s and 1s, the collection of choice problems to compute bounds on the attention frequency.

lower

Boolean, whether lower bounds should be computed (default is TRUE).

upper

Boolean, whether upper bounds should be computed (default is TRUE).

pref

Numeric vector, corresponding to the 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. This option only applies to the upper bounds (i.e., when upper is set to TRUE).

nCritSimu

Integer, number of simulations used to construct the critical value. Default is 2000.

level

Numeric, the significance level (default is 0.95).

Value

sumStats

Summary statistics, generated by sumData.

lowerBound

Matrix containing the lower bounds.

upperBound

Matrix containing the upper bounds.

critVal

The simulated critical value.

opt

Options used in the function call.

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 (2024). Attention Overload. Working paper.

Examples

# Load data
data(ramdata)

# Set seed, to replicate simulated critical values
set.seed(42)

# preference
pref <- matrix(c(1, 2, 3, 4, 5), ncol=5, byrow=TRUE)
# list of choice problems
S <- matrix(c(1, 1, 0, 0, 0,
              1, 1, 1, 0, 0,
              1, 1, 1, 0, 1,
              1, 1, 1, 1, 1), ncol=5, byrow=TRUE)
result <- revealAtte(menu = ramdata$menu, choice = ramdata$choice,
  alternative = c(1,2), S = S,
  lower = TRUE, upper = TRUE,
  pref = pref)
summary(result)


[Package ramchoice version 2.2 Index]