confIntSquareAdd: Square-and-Add Method for Confidence Interval of Difference...

View source: R/confIntSquareAdd.R

confIntSquareAddR Documentation

Square-and-Add Method for Confidence Interval of Difference in Point Estimates

Description

This function computes the confidence interval for the difference between two point estimates using the square-and-add method.

Usage

confIntSquareAdd(theta1, lower1, upper1, theta2, lower2, upper2)

Arguments

theta1

Numeric value of the point estimate for group 1.

lower1

Numeric value of the lower bound of the confidence interval for group 1.

upper1

Numeric value of the upper bound of the confidence interval for group 1.

theta2

Numeric value of the point estimate for group 2.

lower2

Numeric value of the lower bound of the confidence interval for group 2.

upper2

Numeric value of the upper bound of the confidence interval for group 2.

Details

The function returns a confidence interval of the same level as the confidence intervals for theta1 and theta2

Value

A list with the entries:

  • difference: Estimated difference (group 1 - group 2).

  • CI: Lower and upper bound of the confidence interval for the difference.

Author(s)

Manuel Pfister, Leonhard Held, Charlotte Micheloud

References

Newcombe, R.G. (1998). Interval estimation for the difference between independent proportions: comparison of eleven methods, Statistics in Medicine, 17, 873–890.

Newcombe, R.G. (2013). Confidence Intervals for Proportions and Related Measures of Effect Size, CRC Press, 2nd Edition, Chapter 7.3.

Examples

ci1 <- wilson(x=11, n=12)
ci2 <- wilson(x=1, n=12)
confIntSquareAdd(theta1 = ci1[2], lower1=ci1[1], upper1=ci1[3],
                 theta2 = ci2[2], lower2=ci2[1], upper2=ci2[3]) 

felix-hof/biostatUZH documentation built on Sept. 27, 2024, 1:48 p.m.