View source: R/ranks_multinom.R

csranks_multinom | R Documentation |

Marginal and simultaneous confidence sets for ranks of categories, where categories are ranked by the probabilities of being chosen.

```
csranks_multinom(
x,
coverage = 0.95,
cstype = "two-sided",
simul = TRUE,
multcorr = "Holm",
indices = NA,
na.rm = FALSE
)
```

`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 |

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 parameters`U`

Upper bounds of the confidence sets.

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 '`multcorr`

' indicates a method for multiplicity correction. See the paper for
details.

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

```
x <- c(rmultinom(1, 1000, 1:10))
csranks_multinom(x)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.