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

## Overview

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

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

For more information about what this dataset contains, run `?Moore`. In brief, this dataset contains results from an experiment which assessed how an individual's likelihood to conform to their partner's behavior depends on that partner's social status.

After loading this dataset (and saving it into a new variable), view the first 10 rows of the dataframe.

```{r}


```

## 1. Using this dataset, we want to run a model in which `conformity` (the # of trials in which the participant conformed in the experiment) is predicted by `partner.status` (high or low) and `fscore` (the participant's own authoritarianism score). 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 `conformity` as a function of `partner.status`, `fscore`, and **their interaction**. Print the model output and describe the intercept, main effects, and interaction.

```{r}

```

Intercept: 

fscore.c: 

partner.status.d:

Interaction:

**Bonus:** If you use a different type of coding for your categorical variable, how does the model output (+ your interpretations) change?


# 3. Now let's instead run a model in which `confirmity` is predicted by `partner.status` and   `fcategory` levels of `low` and `high` (i.e. Authoritarianism scores labeled as low and high). 

## First make sure to prep all your variables. 

Hint 1: filter only those levels of fcategory you need (i.e., get rid of the "medium" level of `fcategory`)
Hint 2: be sure to dummy/effect code and center any of your predictor variables

```{r}

```

## Now, fit a linear model predicting `conformity` as a function of `partner.status`, `fcategory`, and **their interaction**. Print the model output and describe the intercept, main effects, and interaction.

```{r}

```

Intercept: 

fcategory.d: 

partner.status.d:

Interaction: 

# 4. Next, let's load in a dataset of professors' incomes. Here we will be running a linear model where the `salary` of professors is predicted by the number years since their phd (`yrs.since.phd`) and the their number of years of service (`yrs.service`).

Run the following code chunk.

```{r}
salaries <- Salaries
```

## a) First, inspect the dataset and look at the variables. 

```{r}

```

## b) Next prep your variables

HINT: you need to mean center your continuous predictor variables (`yrs.since.phd` and `yrs.service`).

```{r}

```

## c) Now, fit a linear model predicting `salary` as a function of `yrs.since.phd`, `yrs.service`, and **their interaction**. Print the model output and describe the intercept, main effects, and interaction.

```{r}

```

Intercept:

Years since phd slope:

Years of service slope:

Interaction:

