Skip to content

Instantly share code, notes, and snippets.

@aaizemberg
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaizemberg/83650d60e25da853ab2c to your computer and use it in GitHub Desktop.
Save aaizemberg/83650d60e25da853ab2c to your computer and use it in GitHub Desktop.
el cuarteto de Anscombe
# 1
anscombe
help(anscombe)
# Tufte, Edward R. (1989) The Visual Display of Quantitative Information, 13-14. Graphics Press.
#
# Anscombe, Francis J. (1973) Graphs in statistical analysis. American Statistician, 27, 17-21.
#
# http://en.wikipedia.org/wiki/Anscombe%27s_quartet
summary(anscombe)
# 2
attach(anscombe)
par(mfrow=c(2,2))
plot(x1, y1, xlim=c(min(x1,x2,x3,x4),max(x1,x2,x3,x4)), ylim=c(min(y1,y2,y3,y4),max(y1,y2,y3,y4)))
abline(lm(y1~x1))
plot(x2, y2, xlim=c(min(x1,x2,x3,x4),max(x1,x2,x3,x4)), ylim=c(min(y1,y2,y3,y4),max(y1,y2,y3,y4)))
abline(lm(y2~x2))
plot(x3, y3, xlim=c(min(x1,x2,x3,x4),max(x1,x2,x3,x4)), ylim=c(min(y1,y2,y3,y4),max(y1,y2,y3,y4)))
abline(lm(y3~x3))
plot(x4, y4, xlim=c(min(x1,x2,x3,x4),max(x1,x2,x3,x4)), ylim=c(min(y1,y2,y3,y4),max(y1,y2,y3,y4)))
abline(lm(y4~x4))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment