```{r}
knitr::opts_chunk$set(echo = TRUE)
```

## Overview

The questions and exercises below will all ask you to run linear models and plot linear models, both with and without interaction terms.

Today, we will run regressions and practice plotting the outcome of those regressions using the `Prestige` dataset, which is in the `car` package.

## 0. Load the `tidyverse` package and `sjPlot`. Also Load the `car` package and save the `Prestige` dataset in that package as a variable called `df`. Filter out rows where job type is equal to "prof" and view the first 10 rows of the dataframe. 

```{r, echo = F}



```
## 1. We are going to run models in which `income` is predicted by `prestige` (continous) and `type` (blue collar or white collar). First, prep your variables for analysis.

Hint: You should center any continuous variables, and either dummy or effect code any categorical variables.

```{r}


```

## 2. Now, fit a linear model predicting `income` as a function of `prestige`. Print the model output and describe the intercept and main effect. Quickly visualize the model output using `sjPlot`. 

```{r}


```

## 3. Create a dataframe spanning all the values of prestige, from minimum to maximum values. Then, use the `predict()` function to generate predicted income values and a confidence intervale for all the values of prestige. View the predictions.

```{r}


```

##4. Create a dataframe combining the predicted values (stored in `predictions`) with the range of prestige values (stored in `df_pred`).

Hint: you can use `cbind()`

```{r}



```

## 5. Plot the predicted values, confidence intervals, and the original data points on the same graph using ggplot().

```{r}


```

## 6. Now, fit a linear model predicting `income` as a function of `prestige` and `type`. Print the model output and describe the intercept, main effects, and interaction. Quickly visualize the model output using sjPlot.


```{r}


```


## 7. Create two dataframes spanning all the values of prestige, from minimum to maximum values, for blue and white collar jobs respectively. Then, use the `predict()` function to generate predicted income values and a confidence intervals for all the values of prestige for both dataframes. Finally, combine the predicted values with the range of prestige values for blue and white collar jobs.

```{r}


```

## 8. Plot the predicted values, confidence intervals, and the original data points for the interaction model on the same graph using ggplot(). 

Hint: you will need 2 geom_line() and geom_ribbon() calls, one for blue collar and one for white collar. Remember to specify which data frame you're referencing!

```{r}

 

```

## Bonus
### 1. What does the regression line tell us? What do the individual data points tell us? Why do we want to plot both?
### 2. If you plotted your interaction using the effect coded variable, try using the dummy coded variable and vice versa. 
