File:Odds ratio map.svg

Summary

Description
English: Map showing how the log odds ratio relates to the probability of the outcome in two groups.
Date
Source Own work
Author Skbkekas
SVG development
InfoField
 
The SVG code is valid.
 
This plot was created with Matplotlib.
Category:Valid SVG created with Matplotlib code#Odds%20ratio%20map.svg
 
The file size of this SVG plot may be irrationally large because its text has been converted to paths inhibiting translations.
Category:Path text SVG
Source code
InfoField

Python code

import numpy as np
import matplotlib.pyplot as plt

F = np.linspace(0.05,0.95, 100)

X = np.zeros((len(F),len(F)), dtype=np.float64)

for i1,f1 in enumerate(F):
    for i2,f2 in enumerate(F):
        X[i1,i2] = np.log(f1*(1-f2)/(f2*(1-f1)))

plt.clf()
im = plt.imshow(X, origin='lower', extent=(min(F),max(F),min(F),max(F)),\
          cmap="PiYG")
plt.xlabel(r"$P(X|A)$", size=18)
plt.ylabel(r"$P(X|B)$", size=18)
V = [-3,-2,-1,0,1,2,3]
CS = plt.contour(X, V, origin='lower',\
                 extent=(min(F),max(F),min(F),max(F)), colors='k',\
                linestyles='solid')
plt.colorbar(im)
plt.clabel(CS, V, fmt="%3.1f")
plt.grid(True)
plt.xlim(0.05,0.95)
plt.ylim(0.05,0.95)
plt.savefig("odds_ratio_map.pdf")
plt.savefig("odds_ratio_map.svg")

Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
w:en:Creative Commons
attribution share alike
This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported 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.
Category:CC-BY-SA-3.0#Odds%20ratio%20map.svg
GNU head Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License.
Category:License migration redundant#Odds%20ratio%20map.svgCategory:GFDL#Odds%20ratio%20map.svg
You may select the license of your choice.
Category:Self-published work Category:Statistical charts
Category:CC-BY-SA-3.0 Category:GFDL Category:License migration redundant Category:Path text SVG Category:Self-published work Category:Statistical charts Category:Valid SVG created with Matplotlib code