Computing coefficients and a point prediction from a simple linear prediction (by hand). Internally, a full bivariate data set is simulated but only the marginal means and variances and the correlation coefficient are presented in the exercise.
Verbatim R input/output:
(Note that the HTML output contains mathematical equations in MathML. It is displayed by browsers with MathML support like Firefox or Safari - but not Chrome.)
library("exams") set.seed(1090) exams2html("regression.Rnw") set.seed(1090) exams2pdf("regression.Rnw") set.seed(1090) exams2html("regression.Rmd") set.seed(1090) exams2pdf("regression.Rmd")