regression: Simple Linear Regression (by Hand)

Exercise template for computing the prediction from a simple linear prediction by hand, based on randomly-generated marginal means/variances and correlation.

Name:
regression
Type:
Description:
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.
Solution feedback:
Yes
Randomization:
Random numbers
Mathematical notation:
Yes
Verbatim R input/output:
No
Images:
No
Other supplements:
No
Raw: (1 random version)
PDF:
regression-Rnw-pdf
regression-Rmd-pdf
HTML:
regression-Rnw-html
regression-Rmd-html

(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.)

Demo code:

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")