fourfold2: Fourfold Table (Moodle Version)

Exercise template for computing a fourfold table (as presented in Moodle) of joint and marginal probabilities based on three randomly-drawn conditional or marginal probabilities.

Name:
`fourfold2`
Description:
Computing all joint and marginal probabilities (in percent) in a fourfold table based on two randomly-generated conditional probabilities and one marginal probability. The exercise is a cloze with nine numeric answers presented in a table layout using Moodle-specific markup.
Solution feedback:
Yes
Randomization:
Random numbers
Mathematical notation:
Yes
Verbatim R input/output:
No
Images:
No
Other supplements:
No
Raw: (1 random version)
PDF:
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("fourfold2.Rnw")
set.seed(1090)
exams2pdf("fourfold2.Rnw")

set.seed(1090)
exams2html("fourfold2.Rmd")
set.seed(1090)
exams2pdf("fourfold2.Rmd")``````