Jump to content

File:Risk Ratio vs Odds Ratio.svg

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file (SVG file, nominally 300 × 244 pixels, file size: 68 KB)

Summary

Description
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
 
The SVG code is valid.
 
This plot was created with R.
 
The file size of this SVG plot may be irrationally large because its text has been converted to paths inhibiting translations.
Source code
InfoField

R code

RR2OR <- 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:
w:en:Creative Commons
attribution share alike
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

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current10:16, 28 October 2023Thumbnail for version as of 10:16, 28 October 2023300 × 244 (68 KB)Mikhail Ryazanovcrop unreasonable margins
16:23, 21 February 2021Thumbnail for version as of 16:23, 21 February 2021450 × 270 (68 KB)D Wellslimit ratio to a more realistic 5 instead of 10
16:10, 21 February 2021Thumbnail for version as of 16:10, 21 February 2021450 × 270 (69 KB)D WellsUploaded own work with UploadWizard

Metadata