File:Spurious Correlation (Greyscale).svg

From formulasearchengine
Jump to navigation Jump to search

Original file(SVG file, nominally 540 × 540 pixels, file size: 146 KB)

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

Description
English: An illustration of spurious correlation as defined by Karl Pearson in Mathematical Contributions to the Theory of Evolution—On a Form of Spurious Correlation Which May Arise When Indices Are Used in the Measurement of Organs, Proceedings of the Royal Society of London, 1897, volume 60, pages 489-498, https://www.jstor.org/stable/115879)

Here is the R code used to generate this figure:

require(ggplot2)
set.seed(5)

n.obs <- 500
xyz.df <- data.frame(
  x=rnorm(n.obs, mean=10, sd=1),
  y=rnorm(n.obs, mean=10, sd=1),
  z=rnorm(n.obs, mean=30, sd=3)
)

xyz.df <- transform(
  xyz.df,
  x.over.z= x/z,
  y.over.z= y/z
)

ggplot(data=xyz.df, aes(y=x.over.z, x=y.over.z)) +
  geom_point() +
  labs(y="x/z", x="y/z") + 
  annotate(
    "text", x= 0.2, y=0.6, hjust=0, vjust=1, parse=TRUE, size=10,
    label=sprintf(" rho == %0.2f", with(xyz.df, cor(x.over.z,y.over.z)))
  ) +
  coord_equal(xlim=c(0.18,0.62), ylim=c(0.18,0.62))

ggsave("spuriousCorrelationBW.svg", height=6, width=6)
Date
Source Own work
Author David Lovell (Lov090)

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 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.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

10 January 2014

image/svg+xml

File history

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

Date/TimeThumbnailDimensionsUserComment
current02:26, 10 January 2014Thumbnail for version as of 02:26, 10 January 2014540 × 540 (146 KB)wikimediacommons>Lov090User created page with UploadWizard

The following page uses this file: