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.
csranks_multinom(
x,
coverage = 0.95,
cstype = "two-sided",
simul = TRUE,
multcorr = "Holm",
indices = NA,
na.rm = FALSE
)A csranks object, which is a list with three items:
LLower bounds of the confidence sets for ranks indicated in indices
rankRaw rank estimates using irank with default parameters
UUpper bounds of the confidence sets.
vector of counts of successes for each category
nominal coverage of the confidence set. Default is 0.95.
type of confidence set (two-sided, upper, lower). Default is two-sided.
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.
multiplicity correction to be used: Holm (default) or Bonferroni. See Details section for more.
vector of indices of x for whose ranks the confidence sets are computed. indices=NA (default) means computation for all ranks.
logical; if TRUE, then NA's are removed from x and Sigma (if any).
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.
Bazylik, Mogstad, Romano, Shaikh, and Wilhelm. "Finite-and large-sample inference for ranks using multinomial data with an application to ranking political parties".
x <- c(rmultinom(1, 1000, 1:10))
csranks_multinom(x)
Run the code above in your browser using DataLab