Skip to content

Instantly share code, notes, and snippets.

@3inar
Created October 18, 2017 13:32
Show Gist options
  • Save 3inar/cc18a480aebe1d6998a579e727fc8be6 to your computer and use it in GitHub Desktop.
Save 3inar/cc18a480aebe1d6998a579e727fc8be6 to your computer and use it in GitHub Desktop.
2017-10-18 untitled from rstudio
# regression to the mean
n <- 10000
base <- runif(n, 0,10)
dat <- data.frame(x=base+rnorm(n), y=base+rnorm(n))
plot(dat)
abline(0,1, col="grey")
abline(lm(y~x, data=dat))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment