------------------------------------------------------------------------------- help forciw,ciwi-------------------------------------------------------------------------------

Binomial confidence intervals for proportions (Wilson score)

ciw[varlist] [weight] [ifexp] [inrange] [,level(#)total]

ciwi#obs#succ[,level(#)]

by...:may be used withciw(but not withciwi); see help by.

fweights are allowed withciw; see help weights.

Description

ciwcomputes standard errors and binomial confidence intervals for each variable invarlist, which should be 0/1 binomial variables.ciwiis the immediate form ofciw, for which specify the number of observations and the number of successes. See help immed for more on immediate commands. With both commands confidence intervals are calculated as Wilson score intervals.

RemarksSuppose we observe

nevents and recordksuccesses. Here as usual "success" is conventional terminology for whatever is coded 1. For a 95% confidence interval, for example, we then solve the quadratic equation inp(

k/n-p) / sqrt[p(1 -p) /n] = +/-zwhere

zisinvnorm(0.975). See Wilson (1927). This contribution is of historical interest as an anticipation of Neyman's subsequent formulation of confidence intervals. It is equivalent to addingz^2 observations to a sample, half of them successes and half failures. (At a 95% level,z^2 / 2 = 1.921 to 3 d.p. and so is nearly 2.) Among other properties, note that this interval is typically less conservative than the exact interval, so that coverage probabilities are on average close to the nominal confidence level.See Brown

et al.(2001) for a much fuller discussion and an entry to the literature. Brownet al.(2002) provide supporting technical background to that paper. Among many references, Agresti (2002, pp.14-21), Agresti and Coull (1998), Newcombe (1998, 2001) and Vollset (1993) provide clear and helpful context. Williams (2001, Ch.6) provides a lively alternative treatment of confidence intervals for one-parameter models. For more on the American mathematician, physicist and statistician Edwin Bidwell Wilson (1879-1964), see Stigler (1997). He should not be confused with the American biologist Edmund Beecher Wilson (1856-1939), who worked on cytology, embryology and heredity, nor with the American physical chemist Edgar Bright Wilson (1908-1992); the writings of the last include statistical topics (Wilson 1952).Note that this is close to, but not identical to, a procedure implemented by Gleason (1999).

Options

level(#)specifies the confidence level, in percent, for confidence intervals; see help level.

totalis for use with theby...:prefix; it requests that, in addition to output for each by-group, output be added for all groups combined.

Examples. ciw foreign

. ciwi 10 1 (10 binomial events, 1 observed success)

ReferencesAgresti, A. 2002.

Categorical data analysis.Hoboken, NJ: John Wiley.Agresti, A. and Coull, B.A. 1998. Approximate is better than "exact" for interval estimation of binomial proportions.

American Statistician52: 119-126.Brown, L.D., Cai, T.T., DasGupta, A. 2001. Interval estimation for a binomial proportion.

Statistical Science16: 101-133.Brown, L.D., Cai, T.T., DasGupta, A. 2002. Confidence intervals for a binomial proportion and asymptotic expansions.

Annals of Statistics30: 160-201.Gleason, J.R. 1999. Improved confidence intervals for binomial proportions.

Stata Technical Bulletin52: 16-18 (STB Reprints9: 208-211).Newcombe, R.G. 1998. Two-sided confidence intervals for the single proportion: comparison of seven methods.

Statistics in Medicine17: 857-872.Newcombe, R.G. 2001. Logit confidence intervals and the inverse sinh transformation.

American Statistician55: 200-202.Stigler, S.M. 1997. Wilson, Edwin Bidwell. In Johnson, N.L. and Kotz, S. (eds)

Leading personalities in statistical sciences: from the seventeenth century tothe present.New York: John Wiley, 344-346.Vollset, S.E. 1993. Confidence intervals for a binomial proportion.

Statisticsin Medicine12: 809-824.Williams, D. 2001.

Weighing the odds: a course in probability and statistics.Cambridge: Cambridge University Press.Wilson, Edgar Bright. 1952.

An introduction to scientific research.New York: McGraw-Hill.Wilson, Edwin Bidwell. 1927. Probable inference, the law of succession, and statistical inference.

Journal, American Statistical Association22: 209-212.

AcknowledgementsJohn R. Gleason increased my interest in this problem. Richard Williams found a bug in

ciwi.

Also seeManual:

[R] ciOn-line: help for ci, bitest, immed