Skip to content

Instantly share code, notes, and snippets.

View jayvn's full-sized avatar

Jay Nair jayvn

  • Munich, Germany
View GitHub Profile
set.seed(2)
x <- 1:100
y <- 20 + 3 * x
e <- rnorm(100, 0, 60)
y <- 20 + 3 * x + e
plot(x,y)
yx.lm <- lm(y ~ x)
lines(x, predict(yx.lm), col="red")