Image:Simpson's paradox.svg

From Wikipedia, the free encyclopedia

Simpson's_paradox.svg (SVG file, nominally 500 × 346 pixels, file size: 9 KB)

Wikimedia Commons logo This is a file from the Wikimedia Commons. The description on its description page there is shown below.
Commons is a freely licensed media file repository. You can help.

[edit] Summary

Description

An illustration of w:en:Simpson's paradox

Source

self-made

Date

15 August 2007

Author

Schutz

Permission
(Reusing this image)

see below


The graphic was created by User:Schutz for Wikipedia on 15 August 2007, using the R statistical project. The program that generated and exported the graphic is given below; the postscript file was converted to SVG with the pstoedit command and the layout was slightly modified using Inkscape before upload.

The example is taken from w:en:Simpson's paradox#Description of the paradox.

 success1 <- c( 60,  1)
 total1   <- c(100, 10)
 success2 <- c(  9, 30)
 total2   <- c( 10,100)
 
 ratios1 <- success1/total1
 ratios2 <- success2/total2
 
 postscript("simpson.eps", paper="special", height=4, width=6, horizontal=F)
 
 par(mfrow=c(2,1))
 par(las=1)
 par(yaxs="i")
 par(xpd=NA)
 par(cex=1.3)
 
 par(mar=c(2.1, 2.6, 0.7, 0.6))
 plot.new()
 plot.window(xlim=range(ratios1, ratios2)+c(-1,1)*0.05*diff(range(ratios1,ratios2)),
            ylim=c(0,max(total1, total2)))
 
 width  <- (par("usr")[2]-par("usr")[1])/15
 height <- (par("usr")[4]-par("usr")[3])/5
 
 rect( ratios1[1]-width/2, 0, ratios1[1]+width/2, total1[1], col="red")
 rect( ratios1[2]-width/2, 0, ratios1[2]+width/2, total1[2], col="blue")
 segments ( min(ratios1)-width/2, 0, max(ratios1)+width/2, 0, lwd=2)
 ratiototal1 <- sum(success1)/sum(total1)
 
 polygon(c(ratiototal1, ratiototal1-width/2, ratiototal1+width/2),
         c(0, -height, -height), col="black")
 
 axis(2)
 axis(1, at=c(ratios1))
 
 plot.new()
 plot.window(xlim=range(ratios1, ratios2)+c(-1,1)*0.05*diff(range(ratios1,ratios2)),
             ylim=c(0,max(total1, total2)))
 
 rect( ratios2[1]-width/2, 0, ratios2[1]+width/2, total2[1], col="red")
 rect( ratios2[2]-width/2, 0, ratios2[2]+width/2, total2[2], col="blue")
 segments ( min(ratios2)-width/2, 0, max(ratios2)+width/2, 0, lwd=2)
 
 ratiototal2 <- sum(success2)/sum(total2)
 
 polygon(c(ratiototal2, ratiototal2-width/2, ratiototal2+width/2),
         c(0, -height, -height), col="black")
 
 axis(2)
 axis(1, at=c(ratios2))
 
 dev.off()

[edit] Licensing

I, the copyright holder of this work, hereby publish it under the following licenses:
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".

Aragonés | العربية | Asturianu | Български | বাংলা | ইমার ঠার/বিষ্ণুপ্রিয়া মণিপুরী | Brezhoneg | Bosanski | Català | Cebuano | Česky | Dansk | Deutsch | Ελληνικά | English | Esperanto | Español | Eesti | Euskara | فارسی | Suomi | Français | Gaeilge | Galego | עברית | Hrvatski | Magyar | Bahasa Indonesia | Ido | Íslenska | Italiano | 日本語 | ქართული | ភាសាខ្មែរ | 한국어 | Kurdî / كوردی | Latina | Lëtzebuergesch | Lietuvių | Bahasa Melayu | Nnapulitano | Nederlands | ‪Norsk (nynorsk)‬ | ‪Norsk (bokmål)‬ | Occitan | Polski | Português | Română | Русский | Slovenčina | Slovenščina | Shqip | Српски / Srpski | Svenska | తెలుగు | ไทย | Türkçe | Українська | اردو | Tiếng Việt | Volapük | Yorùbá | ‪中文(中国大陆)‬ | ‪中文(台灣)‬ | +/-

Some rights reserved
Creative Commons Attribution iconCreative Commons Share Alike icon
This file is licensed under the Creative Commons Attribution ShareAlike license versions 3.0, 2.5, 2.0, and 1.0

Български | Català | Česky | Dansk | Deutsch | Ελληνικά | English | Español | Euskara | Estremeñu | Français | עברית | Italiano | 日本語 | 한국어 | Lietuvių | Nederlands | ‪Norsk (bokmål)‬  | Occitan | Polski | Piemontèis | Português | Русский | 中文 | +/-

You may select the license of your choice.



This chart was created with R.

File history

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

Date/TimeDimensionsUserComment
current18:43, 15 August 2007500×346 (9 KB)Schutz ({{Information |Description=An illustration of w:en:Simpson's paradox |Source=self-made |Date=15 August 2007 |Author= Schutz }} )
The following pages on the English Wikipedia link to this file (pages on other projects are not listed):