Statistics, Department of
The R Journal
Date of this Version
12-2013
Document Type
Article
Citation
The R Journal (December 2013) 5(2); Editor: Hadley Wickham
Abstract
Comparing two proportions through the difference is a basic problem in statistics and has applications in many fields. More than twenty confidence intervals (Newcombe, 1998a,b) have been proposed. Most of them are approximate intervals with an asymptotic infimum coverage probability much less than the nominal level. In addition, large sample may be costly in practice. So exact optimal confidence intervals become critical for drawing valid statistical inference with accuracy and precision. Recently, Wang (2010, 2012) derived the exact smallest (optimal) one-sided 1 confidence intervals for the difference of two paired or independent proportions. His intervals, however, are computer-intensive by nature. In this article, we provide an R package ExactCIdiff to implement the intervals when the sample size is not large. This would be the first available package in R to calculate the exact confidence intervals for the difference of proportions. Exact two-sided 1 easily obtained by taking the intersection of the lower and upper one-sided 1 interval can be /2 intervals. Readers may jump to Examples 1 and 2 to obtain these intervals.
Included in
Numerical Analysis and Scientific Computing Commons, Programming Languages and Compilers Commons
Comments
Copyright 2013, The R Foundation. Open access material. License: CC BY 3.0 Unported