#' --- #' title: "Lineae Regression" #' author: "C. Kuells" #' date: "9. Mai, 2015" #' --- x <- c(-2, -1, -0.8, -0.3, 0, 0.5, 0.6, 0.7, 1, 1.2) y <- c(1.9, 0.6, 0.5, 0.8, -0.4, -0.9, -0.7, -0.1, -1.7, -0.2) fm <- lm(y ~ x) #+ fig.width=5, fig.height=5 plot(x, y, xlim = c(-3, 3), ylim = c(-3, 3), pch = 19) fitted.values(fm) residuals(fm) #+ fig.width=5, fig.height=5 plot(x, y, xlim = c(-3, 3), ylim = c(-3, 3), pch = 19) abline(fm, col = "red")