Skip to content

Instantly share code, notes, and snippets.

@danlewer
Created September 16, 2024 06:42
Show Gist options
  • Save danlewer/e164f6422c843384a342669ce76d6d4c to your computer and use it in GitHub Desktop.
Save danlewer/e164f6422c843384a342669ce76d6d4c to your computer and use it in GitHub Desktop.
risk2odds <- function (risk) risk / (1-risk)
odds2risk <- function (odds) odds / (1+odds)
or2rr <- function (OR, p0) OR / ((1 - p0) + (p0 * OR))
rr2or <- function(RR, p0) RR * (1 - p0) / (1 - RR * p0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment