Skip to contents

Number needed to treat (NNT) = 1 / |RD|

Usage

number_needed_to_treat(a, b, c, d, confidence = 0.95)

Arguments

a, b, c, d

Cell counts of the 2x2 table: a = exposed with outcome, b = exposed without, c = unexposed with outcome, d = unexposed without.

confidence

Confidence level. Default 0.95.

Value

A morie_effect_size.

Examples

# Treatment lowers the bad outcome from 20% to 10% -> NNT = 1/0.10 = 10.
res <- number_needed_to_treat(10, 90, 20, 80)
res$estimate                 # patients to treat to prevent one event
#> [1] 10

# NNT is the reciprocal of the (absolute) risk difference.
1 / abs(risk_difference(10, 90, 20, 80)$estimate)
#> [1] 10