confIntRiskDiff: Confidence interval for a risk difference

View source: R/confIntDiagnostic.R

confIntRiskDiffR Documentation

Confidence interval for a risk difference

Description

Compute a confidence interval for a risk difference based on Wald and Wilson confidence intervals for the individual risks.

Usage

confIntRiskDiff(x, n, conf.level = 0.95)

Arguments

x

Vector of length 2, number of successes in each group.

n

Vector of length 2, total number of trials in each group.

conf.level

Confidence level for confidence interval. Default value is 0.95.

Value

A list with the entries:

  • rd: Estimated risk difference.

  • CIs: Data.frame containing confidence intervals for the risk difference.

Author(s)

Leonhard Held

References

DG Altman, D Machin, TN Bryant, MJ Gardner. Statistics with confidence, 2nd Edition, 2000, Chapter 6

See Also

wilson, confIntRiskRatio, confIntOddsRatio.

Examples


x <- c(30, 50)
n <- c(100, 120)
confIntRiskDiff(x = x, n = n)$CIs


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