Skip to contents

$$RD = p_e - p_u$$ with the binomial variance \(p_e(1-p_e)/n_e + p_u(1-p_u)/n_u\). The arm sizes are optional; without them only the point estimate is defined.

Usage

Riskdf(
  p_exposed,
  p_unexposed,
  n_exposed = NULL,
  n_unexposed = NULL,
  confidence = 0.95
)

Arguments

p_exposed, p_unexposed

Risks in the two arms.

n_exposed, n_unexposed

Optional arm sizes.

confidence

One of 0.90, 0.95, 0.99.

Value

Named list with estimate, se, ci_lower, ci_upper, p_exposed, p_unexposed, confidence, method.

References

Rothman & Greenland, Modern Epidemiology.

Examples

Riskdf(0.3, 0.2, 100, 100)
#> $estimate
#> [1] 0.1
#> 
#> $se
#> [1] 0.06082763
#> 
#> $ci_lower
#> [1] -0.01921995
#> 
#> $ci_upper
#> [1] 0.21922
#> 
#> $p_exposed
#> [1] 0.3
#> 
#> $p_unexposed
#> [1] 0.2
#> 
#> $confidence
#> [1] 0.95
#> 
#> $method
#> [1] "risk difference (Rothman & Greenland)"
#>