---
title: " HW Question Week 2 "
author: "STA2101F 2021"
date: ''
output:
  pdf_document: default
  html_document: default
fontsize: 12pt
---


```{r setup, include=FALSE}
# knitr::opts_chunk$set(echo = TRUE)
knitr::opts_chunk$set(
  echo = FALSE,
  message = FALSE,
  warning = FALSE,
  error = FALSE, 
  out.width = "100%",
  fig.width = 10,
  fig.height = 6.7, 
  fig.retina = 3,
  cache = FALSE)
```
```{r library}
library(faraway)
data(prostate)
```

## Due September 29 2021 11.59 pm

**Homework to be submitted through Quercus**

This question concerns the article "How people understand risk matrices..." by Sutherland et al., available on the course web site. 

  (a) What is a risk matrix? Find an example of a risk matrix for the assessment of risk related to either COVID-19 or wildfire. Provide the reference (link) to the example and a snapshot of one or two of the published risk matrices. 
  (b) The authors describe two randomized controlled experiments, in Sections 2 and 3, respectively. What are the units of analysis in these two experiments? 
  (c) In the first experiment, the authors describe derived variables: a "basic knowledge score", a "risk comparison score", a "prioritization score", the results of a "matrix preference test", and a "total numeracy score". Which of these are treated as response variables and which are treated as explanatory variables? 
  (d) What 'treatments' were randomly assigned to units in Experiment 1? 
  (e) What are the "two, main registered hypotheses" in Experiment 1? 
  (f) What is the design of Experiment 2? 
  (g) The analysis section for Experiment 2 refers to a "three-way ANCOVA". Write out some  `R` code, and an algebraic equation, for this analysis. 
  (h) The authors mention "ceiling effects" -- what are these? Why were they of concern in the analysis of the data from Experiments 1 and 2?  
  (h) *Required for PhD; bonus for MSc* (SM Exercise 8.4.3): Consider a linear regression model $y_i = x_i^T\beta + \epsilon_i, \quad i = 1, \dots, n$ in which the errors $\epsilon_i$ are independently distributed with Laplace density (corrected from original printing):
  $$ f(\epsilon) = (2^{1/2}\sigma)^{-1} \exp\{-|\epsilon/(2^{-1/2}\sigma)|\}, -\infty < \epsilon < \infty, \sigma > 0.
  $$ Verify that this density has variance $\sigma^2$. Show that the maximum likelihood estimate of $\beta$ is defined by $$\hat\beta_{ML} = \arg\min_\beta \sum_{i=1}^n | y_i - x_i^{T}\beta|.$$  If in fact $\epsilon_i \sim N(0, \sigma^2)$,  the asymptotic relative efficiency of the MLE of $\beta_j$ relative to its least squares estimator is $2/\pi$. You don't need to prove this, but extra bonus points if you do.
  
     
     
