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

## Agresti exercise 13.7

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(5,6,7)], groups = New, data = HousePriceFull)
```

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

Write the prediction equation with appropiate notation:
$$
\hat y = ???
$$
Plot the two regression lines:
```{r}
## plotModel( ??? )
```


## Agresti exercise 13.8

Make the relevant plot(s) using `gf_point`:

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

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

Write the prediction equations for old and new houses:
$$
\hat y_{old} = ???\\
\hat y_{new} = ???
$$

Is the interaction significant?