Create a multiple linear regression model with `GrLivArea` and `BedroomAbvGr` as explanatory variables.
```{r}
fit_03 <- lm(SalePrice ~ GrLivArea + BedroomAbvGr, data = data)
stargazer(fit_03, intercept.bottom = FALSE, single.row = TRUE, type = "text")
# YOUR CODE GOES HERE
```
...
...
@@ -301,22 +292,6 @@ plotmo(fit_08)
```
It's also possible to visually analyze interactions between explanatory variables, as we modeled them in model `fit_05`.
The `level` argument controls which confidence (grey) and prediction (red) intervals should be plotted. The prediction interval, for example, tells us that, according to our model, 95% of the houses with a specific `GrLivArea` have a `SalePrice` within the shaded area. Read more about the difference between confidence and prediction intervals here: <http://www.sthda.com/english/articles/40-regression-analysis/166-predict-in-r-model-predictions-and-confidence-intervals/>.
```{r}
plotmo(fit_05,
degree1 = c(),
#degree1 = c("GrLivArea"),
#degree2 = c(),
degree2 = c("GrLivArea", "LotArea"),
persp.ticktype="detailed",
level=.95,
theta=-35)
```
# Your Turn...
Improve the above models, e.g., by including more variables and interaction effects. Try to find a balance between model fit and interpretability. Note: We are doing explanatory modeling here, not prediction! Hence, we are not working with a train/test split of the data.