Anscombe's Quartet of ‘Identical’ Simple Linear Regressions

knitr::opts_chunk$set(echo = TRUE)

Note: The descriptions has been taken from R.

Description

Four x-y datasets which have the same traditional statistical properties (mean, variance, correlation, regression line, etc.), yet are quite different.

Usage

head(anscombe)

Format

A data frame with 11 observations on 8 variables.

Variable | Meaning -------------|--------------------------------------------------------------------------------------- x1 | X for linear relationship x2 | X for non-linear relationship x3 | X for outlier
x4 | X for constant y1 | Y for linear relationship y2 | Y for non-linear relationship
y3 | Y for outlier y4 | Y for constant

library("lattice")
dn <- c("x1-y1", "x2-y2", "x3-y3", "x4-y4")
dxy<-data.frame(dataset=dn[1+(0:43)/11],
                x=c(anscombe$x1, anscombe$x2, anscombe$x3, anscombe$x4),
                y=c(anscombe$y1, anscombe$y2, anscombe$y3, anscombe$y4))
xyplot(y~x|dataset, data=dxy)

Source

References



Try the rmdwc package in your browser

Any scripts or data that you put into this service are public.

rmdwc documentation built on Nov. 13, 2022, 1:07 a.m.