help for rdiff

Title

rdiff —— Calculating 95% confidence intervals for the differences of
binomial proportions.

Syntax

rdiff
#n1
#succ1
#n2
#succ2
[,
correct]

Description

rdiff is an immediate command that constructs a 95% confidence interval
for the difference between two independent binomial proportions. Besides the most
well-known method —— normal approximation method —— which may produce undesirable
results in extreme cases, the more remarkable method, Wilson score method, is also
available. Note that rdiff is recommended only for the case where the
proportion of #succ1 for #n1 is equal to or greater than the proportion of
#succ2 for #n2.

Options

correct specifies with continuity correction when calculating.

Examples

Suppose that sample A shows 23 'successes' among 30 subjects and sample B shows
9 'successes' among 30 subjects. Calculating the 95% confidence interval for the
rate difference without continuity correction:

.rdiff 30 23 30 9

or with continuity correction:

.rdiff 30 23 30 9, correct

Stored results

rdiff stores the following in r():

Scalars

r(rd) rate difference

r(ll_a) lower limit calculated by normal approximation method

r(ul_a) upper limit calculated by normal approximation method

r(ll_w) lower limit calculated by Wald score method

r(ul_w) upper limit calculated by Wald score method

References

Beal, S. L. 1987. Asymptotic confidence intervals for the difference between two
binomial parameters for use with small samples. Biometrics, 43: 941-950.

Newcombe, R. 1998. Interval estimation for the difference between independent
proportions: Comparison of eleven methods. Statistics in Medicine, 17: 873-890.

Author

Xiaokun Yang, Lanzhou University, China.

E-mail: yangxk19@lzu.edu.cn.

Also see

Help: immed, ci, epitab