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-Rmd-pdf
regression-Rnw-pdf
HTML:
regression-Rmd-html
regression-Rnw-html

(Note that the HTML output contains mathematical equations in MathML, rendered by MathJax using ‘mathjax = TRUE’. Instead it is also possible to use ‘converter = “pandoc-mathjax”’ so that LaTeX equations are rendered by MathJax directly.)

Demo code:

library("exams")

set.seed(403)
exams2html("regression.Rmd", mathjax = TRUE)
set.seed(403)
exams2pdf("regression.Rmd")

set.seed(403)
exams2html("regression.Rnw", mathjax = TRUE)
set.seed(403)
exams2pdf("regression.Rnw")