---
output: html_document
---

# Exam exercise: Houseprices

You may use the combined lecture notes for this module available at
<https://asta.math.aau.dk> to guide you to the relevant methods and R commands
for this exam.

Remember to load the `mosaic` package first:
```{r message=FALSE}
library(mosaic)
```

In this exercise you will study the data described in Agresti EXAMPLE 9.10. 

You are studying house sales in Gainesville, Florida, where among other things the data contain the selling price (`Price`), property taxes (`Taxes`) and house size (`Size`).

Read in the data:
```{r}
HousePrices <- read.delim("https://asta.math.aau.dk/datasets?file=HousePrice.txt")
head(HousePrices)
```

- Make a relevant plot of the variables and discuss how they are related.

- Explain the concept of correlation and determine whether there is significant positive correlation between `Taxes` and `Size`. 

```{r}
## Delete this line and write a command using cor.test(...)
```

Fit a multiple regression model with Price as the response variable and `Taxes` and `Size` as predictors.

```{r}
## Delete this line and write a command using lm(...)
```

- What are the parameters of the model and what is the interpretation of these parameters?

- What is the prediction equation?
$$
\widehat y = 
$$

Explain the output of
```{r eval=FALSE}
summary(model)
```
where `model` is the fitted multiple regression model.
This explanation should as a minimum include

- Calculation of `t value` and determination and interpretation of p-value.

- Interpretation of `Multiple R-squared`.

- How the table of output can be used to construct confidence intervals for parameters. This should be supplemented by actual calculation for the current data using `confint`.

Finally, you have to investigate whether or not there is an interaction between the effect of `Taxes` and the effect of `Size` as predictors of `Price`.
