---
title: "Lecture 3 Exercises"
author: "Your Name"
output: html_document
---
```{r setup, message = FALSE, warning = FALSE, echo=FALSE}
knitr::opts_chunk$set(message = FALSE, warning = FALSE, dev="svg", tidy=TRUE,  tidy.opts = list(only.comment=TRUE,  width.cutoff=80))
library(summarytools)
library(dplyr)
```

We're going to use the same data as yesterday, we need to load it first.  (It's also available locally in the RStudio.cloud instance or from [my website](https://quantoid.net/files/reg3/counties.rda))

```{r}
load(file("https://quantoid.net/files/reg3/counties.rda"))
```

This makes an object in your workspace called `counties`.  To remind, here's a summary of the data: 

```{r, results='asis'}
counties %>% 
  select(-c("fips", "NAME", "date", "state", "st")) %>% 
  dfSummary(., plain.ascii=FALSE)
```

I want you to use the data to answer the following questions. 

### Question 1

There are two categorical variables - `region` and `urban_rural`.  Build a model of `cases` (or its log+1 if you prefer) that uses at least one of these variables in an interaction with one of the continuous variables.  

- Use the methods we talked about in class to understand whether there is an interaction and if so, what it looks like. 
- Make sure you use both numerical and graphical methods. 
  

### Question 2

Pick at least two continuous variables as covariates in the cases model (they don't have to be the same variables as in the answer to question 1).  Use an interaction between those two variables.   

- Evaluate whether the interaction is necessary? 
- Look at the nature of the interaction with the graphical measures we talked about. 
- Do the tests Berry, Golder and Milton suggested. 



