```{r setup, include = FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

## Overview

The questions and exercises below all include examples using the `mtcars` dataset from the `car` package. This dataset contains information about various cars, e.g., horsepower, engine type, etc. 

In this exercise, you will run models in which a car's average miles per gallon (mpg) is predicted by its weight (wt) and/or the type of transmission (am), i.e., automatic vs. manual.

## 0. Load the car package (install if necessary) and `mtcars` dataset. Create a new dataframe with the `mtcars` data  (Also load the tidyverse package.)

Then, view the first 10 rows of the `mtcars` dataset.

```{r}


```

## 1. First we need to prep our variables. Start by centering the weight variable (wt).

Bonus: Double check that your code worked by looking at the mean of this new centered variable.

```{r}


```

## 2. Now, let's take a look at the transmission type (`am`) variable. We went over two ways of coding categorical variables: dummy coding & effect coding. Which one does the dataframe use by default?

Hint: You can get more information about the variables in the `mtcars` dataset by running ?mtcars.

Now, make a new column where you recode `am` in a *different* way. 

```{r}

# dataframe uses dummy coding, where automatic = 0 and manual = 1


```


# 3. Now, fit a linear model predicting average miles per gallon as a function of weight. Print the model output and describe the intercept and main effects. 

```{r}
#model with the continuous variable

```




# 4. Now, fit a linear model predicting average miles per gallon as a function of transmission type (use the dummy coded version). Print the model output and describe the intercept and main effects. 

```{r}
#model with the dummy coded variable


```



#5. Now, fit a linear model predicting average miles per gallon as a function of transmission type using the effect coded version. Print the model output and describe the intercept and main effects.

```{r}
#model with the effect coded variable

```


#6. Compare the output of the dummy coded and the effect coded two models. Which terms are the same and which are different? Why? How does this change the interpretation of the model? Does the significance change?


#Bonus
Run a model prediction mpg as a function of am (either dummy or effect coded), controlling for wt. Print the model output and interpret the estimates.

```{r}

```

