Here you will find daily news and tutorials about R, contributed by over 750 bloggers.
There are many ways to follow us - By e-mail:On Facebook: If you are an R blogger yourself you are invited to add your own R content feed to this site (Non-English R bloggers should add themselves- here)

x <- c(173, 169, 176, 166, 161, 164, 160, 158, 180, 187) y <- c(80, 68, 72, 75, 70, 65, 62, 60, 85, 92)
# plot scatterplot and the regression line mod1 <- lm(y ~ x) 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 <- signif(residuals(mod1), 5) pre <- predict(mod1)
# plot distances between points and the regression line segments(x, y, x, pre, col="red")

# add labels (res values) to points library(calibrate) textxy(x, y, res, cx=0.7)

Related

To leave a comment for the author, please follow the link and comment on their blog: Statistic on aiR.