rr.r: risk ratio to r

rr.rR Documentation

risk ratio to r

Description

risk ratio to correlation coefficient use crosstab.rr() to calculate rr and use crosstab.prev() to calculate prevalence of the outcome in reference group then use the following to calculate rr to r

Usage

rr.r(rr, prev, n1, n2)

Arguments

rr

the risk ratio

prev

the prevalence of the outcome in the reference group

n1

the cell size of group 1 (if unknown, leave blank, assumes correcting factor a = 4 where n1 = n2)

n2

the cell size of group 2 (if unknown, leave blank, assumes correcting factor a = 4 where n1 = n2)

Examples

rr.r(4.05, 1.56, 10.51, 141, 8)
dat %>% mutate (r_from_rr = rr.r(rr, rr_lowerci, rr_upperci, rr_n, rr_predictors)) -> dat


phoebehlam/michaela documentation built on Oct. 23, 2024, 4:10 p.m.