csranks_multinom {csranks} | R Documentation |
Confidence sets for ranks based on multinomial data
Description
Marginal and simultaneous confidence sets for ranks of categories, where categories are ranked by the probabilities of being chosen.
Usage
csranks_multinom(
x,
coverage = 0.95,
cstype = "two-sided",
simul = TRUE,
multcorr = "Holm",
indices = NA,
na.rm = FALSE
)
Arguments
x |
vector of counts indicating how often each category was chosen. |
coverage |
nominal coverage of the confidence set. Default is 0.95. |
cstype |
type of confidence set ( |
simul |
logical; if |
multcorr |
multiplicity correction to be used: |
indices |
vector of indices of |
na.rm |
logical; if |
Value
A csranks
object, which is a list with three items:
L
Lower bounds of the confidence sets for ranks indicated in
indices
rank
Estimated ranks from
irank
with default parametersU
Upper bounds of the confidence sets.
Details
This function computes confidence sets for ranks similarly as csranks
, but it is tailored to the special case of
multinomial data. Suppose there are p
populations (for the case of multinomial data, we will refer to them as "categories") such
as political parties, for example, that one wants to rank by the probabilities of them being chosen. For political parties, this would
correspond to the share of votes each party obtains. Here, the underlying data are multinomial: each observation corresponds to a choice
among the p
categories. The vector x
contains the counts of how often each category was chosen in the data.
In this setting, link{csranks}
could be applied to compute confidence sets for the ranks of each category, but instead this function
implements a different method proposed by Bazylik, Mogstad, Romano, Shaikh, and Wilhelm (2023), which exploits the
multinomial structure of the problem and yields confidence sets for the ranks that are valid in finite samples (whereas csranks
produces
confidence sets that are valid only asymptotically).
The procedure involves testing multiple hypotheses. The \code{multcorr}
indicates a method for multiplicity correction. See the paper for
details.
References
Bazylik, Mogstad, Romano, Shaikh, and Wilhelm. "Finite-and large-sample inference for ranks using multinomial data with an application to ranking political parties". cemmap working paper
Examples
x <- c(rmultinom(1, 1000, 1:10))
csranks_multinom(x)