Learn R Programming

csranks (version 1.0.1)

csranks_multinom: Confidence sets for ranks based on multinomial data

Description

Given data on counts of successes for each category, calculate confidence sets for the ranks of categories, where categories are ranked by their success probabilities.

Usage

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

Value

A csranks object, which is a list with three items:

L

Lower bounds of the confidence sets for ranks indicated in indices

rank

Raw rank estimates using irank with default parameters

U

Upper bounds of the confidence sets.

Arguments

x

vector of counts of successes for each category

coverage

nominal coverage of the confidence set. Default is 0.95.

cstype

type of confidence set (two-sided, upper, lower). Default is two-sided.

simul

logical; if TRUE (default), then simultaneous confidence sets are computed, which jointly cover all populations indicated by indices. Otherwise, for each population indicated in indices a marginal confidence set is computed.

multcorr

multiplicity correction to be used: Holm (default) or Bonferroni. See Details section for more.

indices

vector of indices of x for whose ranks the confidence sets are computed. indices=NA (default) means computation for all ranks.

na.rm

logical; if TRUE, then NA's are removed from x and Sigma (if any).

Details

The command implements the procedure for construction of confidence sets for ranks described in the referenced paper below.

It involves testing multiple hypotheses. The `multcorr` states, how the p-values should be corrected to control the Family Wise Error Rate (FWER).

From a practical point of view, multcorr=Holm takes more time, but usually results in tighter (better) confidence sets than multcorr=Bonferroni.

References

Bazylik, Mogstad, Romano, Shaikh, and Wilhelm. "Finite-and large-sample inference for ranks using multinomial data with an application to ranking political parties".

Examples

Run this code
x <- c(rmultinom(1, 1000, 1:10))
csranks_multinom(x)

Run the code above in your browser using DataLab