```{r, setup, include=FALSE}
require(mosaic)
```

## Agresti exercise 13.7

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

Start by making relevant plot(s).
```{r}
## Write plot command(s) here. 
```

Fit the linear model in R:
```{r}
## Write commands like:
##model <- lm( ??? ~ ???, data = ??? )
##summary(model)
```

Write the prediction equation with appropiate notation:
$$
\hat y = ???
$$


## Agresti exercise 13.8

Import data (this data set includes the variable `new`):
```{r}
HousePriceFull <- read.delim("https://asta.math.aau.dk/datasets?file=HousePriceFull.txt")
```


First interpret the following scatterplot matrix

```{r}
splom(~HousePriceFull[,c(2,5,6)], groups = New, data = HousePriceFull)
```

Now make other relevant plot(s) using `gf_point`:

```{r}
## gf_point(??? ~ ???, group = ~???, col = ~???, data = ???) %>% gf_lm()
```

Fit the linear model corresponding to Table 13.15 in Aggresti:
```{r}
## Write commands like:
## model <- lm( ??? ~ ???, data = ??? )
## summary(model)
```

Write the prediction equations.
$$
\hat y_{old} = ???\\
\hat y_{new} = ???
$$

Is the interaction significant?