Skip to contents

$$RR = p_e/p_u$$ with \(Var(\log RR) = (1-p_e)/(n_e p_e) + (1-p_u)/(n_u p_u)\). The interval is symmetric on the log scale, never on the ratio scale.

Usage

Riskrt(
  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, ln_estimate, se_ln, ci_lower, ci_upper, p_exposed, p_unexposed, confidence, method.

References

Rothman & Greenland, Modern Epidemiology.

Examples

Riskrt(0.3, 0.2, 100, 100)
#> $estimate
#> [1] 1.5
#> 
#> $ln_estimate
#> [1] 0.4054651
#> 
#> $se_ln
#> [1] 0.2516611
#> 
#> $ci_lower
#> [1] 0.9159608
#> 
#> $ci_upper
#> [1] 2.456437
#> 
#> $p_exposed
#> [1] 0.3
#> 
#> $p_unexposed
#> [1] 0.2
#> 
#> $confidence
#> [1] 0.95
#> 
#> $method
#> [1] "risk ratio (Rothman & Greenland)"
#>