Computing the 1-sample t-test statistic from randomly-drawn hypothesized mean, sample size, and empirical mean and variance. The correct answer has to be selected from five choice items which have been added to the numeric version of the exercise linked above.
Verbatim R input/output:
(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.)
library("exams") set.seed(403) exams2html("tstat2.Rmd", mathjax = TRUE) set.seed(403) exams2pdf("tstat2.Rmd") set.seed(403) exams2html("tstat2.Rnw", mathjax = TRUE) set.seed(403) exams2pdf("tstat2.Rnw")