Last active
August 29, 2015 14:03
-
-
Save datalove/c020315d8687ee8480f1 to your computer and use it in GitHub Desktop.
Calculate P-value for an odds ratio using CIs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# calculation as per: | |
# http://www.bmj.com/content/343/bmj.d2304 | |
get_odds_p <- function(est, cil, ciu) { | |
se <- (log(ciu) - log(cil))/(2*1.96) | |
z <- abs(log(est)/se) | |
p <- exp(-0.717*z - 0.416*z^2) | |
p | |
} | |
get_odds_p(1.7,0.94,3.08) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment