Skip to contents

DUPLICATE of the Python module attfr, which has no R arm; the formula is one line and is written here rather than duplicated twice.

Usage

Pareff(pe, RR, se_RR = NULL, alpha = 0.05)

Arguments

pe

Prevalence of exposure in the population, in [0, 1].

RR

Relative risk, strictly positive.

se_RR

Optional standard error of RR; supplying it adds a delta-method confidence interval.

alpha

Two-sided CI level.

Value

List with estimate, se, ci_lower, ci_upper, pe, RR.

Details

Formula: PAF = pe (RR - 1) / (pe (RR - 1) + 1).

References

Levin, M. L. (1953). The occurrence of lung cancer in man. Acta Unio Internationalis Contra Cancrum, 9(3), 531-541.

Examples

Pareff(pe = 0.3, RR = 2, se_RR = 0.2)[c("estimate", "ci_lower", "ci_upper")]   # 0.3 / 1.3
#> $estimate
#> [1] 0.2307692
#> 
#> $ci_lower
#> [1] 0.1611847
#> 
#> $ci_upper
#> [1] 0.3003538
#>