revealAtte | R Documentation |
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 (2022).
sumData
is a low-level function that generates summary statistics. For
revealed preference analysis, see revealPref
.
revealAtte( menu, choice, alternative = NULL, S = NULL, lower = TRUE, upper = TRUE, pref = NULL, nCritSimu = 2000, level = 0.95 )
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, |
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 |
upper |
Boolean, whether upper bounds should be computed (default is |
pref |
Numeric vector, corresponding to the preference. For example, |
nCritSimu |
Integer, number of simulations used to construct the critical value. Default is |
level |
Numeric, the significance level (default is |
sumStats |
Summary statistics, generated by |
lowerBound |
Matrix containing the lower bounds. |
upperBound |
Matrix containing the upper bounds. |
critVal |
The simulated critical value. |
opt |
Options used in the function call. |
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
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.
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.