multinomialCI: Simultaneous Confidence Intervals for Multinomial Proportions

Description Usage Arguments Details Value References Examples

View source: R/sison.R

Description

Simultaneous confidence intervals for multinomial proportions, calculated according to the method of Sison and Glaz

Usage

1
multinomialCI(x, alpha, verbose = FALSE)

Arguments

x

A vector of positive integers representing the number of occurrences of each class. The total number of samples equals the sum of such elements.

alpha

The significance level for the confidence intervals. Must be a real number in the interval [0, 1].

verbose

A boolean flag indicating whether details should be printed to screen during the execution of the method. Defaults to FALSE.

Details

Given a vector of observations with the number of samples falling in each class of a multinomial distribution, this function builds simultaneous confidence intervals for the multinomial probabilities according to the method proposed by Sison and Glaz (1995). The R code has been translated from the SAS code written by May and Johnson (2000).

Value

A k x 2 real matrix, with k being the number of classes, which matches the length of the input vector x. Row iof the matrix contains the lower bound (first column) and upper bound (second column) defining the confidence interval for the probability of the i-th class, which corresponds to the i-th position of the input vector.

References

Sison, C.P and J. Glaz. Simultaneous confidence intervals and sample size determination for multinomial proportions. Journal of the American Statistical Association, 90:366-369 (1995).

Glaz, J. and Sison, C.P. Simultaneous confidence intervals for multinomial proportions. Journal of Statistical Planning and Inference 82:251-262 (1999).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Multinomial distribution with 3 classes, from which 79 samples 
# were drawn: 23 of them belong to the first class, 12 to the 
# second class and 44 to the third class. Punctual estimations 
# of the probabilities from this sample would be 23/79, 12/79 
# and 44/79 but we want to build 95% simultaneous confidence intervals 
# for the true probabilities
m = multinomialCI(c(23,12,44), 0.05)
print(paste("First class: [", m[1,1], m[1,2], "]"))
print(paste("Second class: [", m[2,1], m[2,2], "]"))
print(paste("Third class: [", m[3,1], m[3,2], "]"))

Example output

[1] "First class: [ 0.189873417721519 0.410670296139722 ]"
[1] "Second class: [ 0.0506329113924051 0.271429789810608 ]"
[1] "Third class: [ 0.455696202531646 0.676493080949849 ]"

MultinomialCI documentation built on May 12, 2021, 1:07 a.m.