File:Risk Ratio vs Odds Ratio.svg
From testwiki
Jump to navigation
Jump to search
Original file (SVG file, nominally 300 × 244 pixels, file size: 68 KB)
Contents
This file is from Wikimedia Commons and may be used by other projects. The description on its file description page there is shown below.
Summary
| DescriptionRisk Ratio vs Odds Ratio.svg |
English: Plot showing the relationship between risk ratio and odds ratio for various baseline risks with y=x in blue for comparison. |
| Date | |
| Source | Own work |
| Author | D Wells |
| SVG development InfoField | |
| Source code InfoField | R codeRR2OR <- function(RR, baseline){
((1 - baseline) * RR) / (1 - RR * baseline)
}
library(ggplot2)
svg(height=3, width=5)
ggplot() +
scale_x_continuous(limits=c(1,5)) +
scale_y_continuous(limits=c(1,5)) +
geom_abline(intercept=0, slope=1, linetype="dashed", colour='blue') +
geom_function(aes(colour = "0.01"), fun = RR2OR, args = list(baseline=0.01)) +
geom_function(aes(colour = "0.05"), n=200, fun = RR2OR, args = list(baseline=0.05)) +
geom_function(aes(colour = "0.10"), n=200, fun = RR2OR, args = list(baseline=0.10)) +
geom_function(aes(colour = "0.25"), n=1e3, fun = RR2OR, args = list(baseline=0.25)) +
geom_function(aes(colour = "0.50"), n=4e3, fun = RR2OR, args = list(baseline=0.50)) +
scale_colour_manual(values = c("black","#BD0026","#F03B20","#FD8D3C","#FECC5C"), name="Baseline\nRisk") +
theme_classic() +
coord_fixed(expand=F) +
xlab("Risk Ratio") +
ylab("Odds Ratio")
dev.off()
|
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
Captions
Add a one-line explanation of what this file represents
Items portrayed in this file
depicts
21 February 2021
image/svg+xml
69,574 byte
46e112945e928bfbba1642f0071093d6d9717dc1
File history
Click on a date/time to view the file as it appeared at that time.
| Date/Time | Thumbnail | Dimensions | User | Comment | |
|---|---|---|---|---|---|
| current | 11:16, 28 October 2023 | 300 × 244 (68 KB) | wikimediacommons>Mikhail Ryazanov | crop unreasonable margins |
File usage
There are no pages that use this file.