Todos Logos posted an article on
Statistic on aiR
-
Jun 16, 2011, 3:52 am
x y
# plot scatterplot and the regression line
mod1 plot(x, y, xlim=c(min(x)-5, max(x)+5), ylim=c(min(y)-10, max(y)+10))
abline(mod1, lwd=2)
# calculate residuals and predicted values
res pre
# plot distances between points and the regression line
segments(x, y, x, pre, col="red")
# add labels (r...