# essayreg: Linear Regression (Essay Question)

Exercise template for interpreting a simple regression based on randomly-generated data (with either a linear, semi-logarithmic, or log-log relationship) in form of an essay.

**Name:**

`essayreg`

**Type:**

**Related:**

**Description:**

The results of a linear regression model (linear, semi-logarithmic, or log-log) need to be interpreted in an essay. By adding the "exstringtype" metainformation "essay|file" for this "string" question, it is specified that an open-ended answer should be entered using a text editor and additionally a file can be uploaded. This type of extended string question is currently supported in Moodle and in QTI 2.1 (OpenOlat in particular). The details of the rendering in Moodle are additionally controlled through several "exextra" metainformation tags.

**Solution feedback:**

Yes

**Randomization:**

Random numbers and text blocks

**Mathematical notation:**

Yes

**Verbatim R input/output:**

Yes

**Images:**

No

**Other supplements:**

No

*(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("essayreg.Rmd", mathjax = TRUE)
set.seed(403)
exams2pdf("essayreg.Rmd")
set.seed(403)
exams2html("essayreg.Rnw", mathjax = TRUE)
set.seed(403)
exams2pdf("essayreg.Rnw")
```