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


# Lesson 2


## Simple Regression

**2.1. Load the `tidyverse` package (you can ignore the notes that you see below that it gives you once you load it)**

```{r, message = FALSE}

```

**2.2. Import the GSS data set into R.**

```{r}

```

**2.3. Use a simple regression model to assess the relationship of income (continuous outcome) and daily hours of tv watched (continuous predictor).**

```{r}

```

**2.4. This output gives you two values, that for the intercept and that for the slope of the predictor (tvhours). What does the slope of the predictor mean here (i.e., interpret the value)?**

[Click here to begin Kahoot](https://kahoot.it/)

**2.5. Check the summary of the model. What is the best fit line? Is the model statistically significant?**

```{r}

```


Go back to Kahoot to answer.


## Regression and Correlation

**2.6. Using your data you already imported above, look at the correlation between those same variables. What is the correlation?**

```{r}

```

Go back to Kahoot to Answer.

**2.7. Let's compare this to the regression value after we standardize both variables with `scale()`. First have to grab just the complete cases of the variables first.**
```{r}

```

**2.8. The intercept is essentially zero and the slope is the same as the correlation you reported before. Should the intercept be zero?**

Go back to Kahoot to Answer.


## Residuals


**2.9. Assign the first model to `fit` (or any other name you want to use).**

```{r}

```

**2.10. With that object, use the function `resid()` to produce the residuals of the model.**

```{r}

```

Why do we care about residuals again? Go back to Kahoot.

**2.11. Often we are going to be looking at the residuals in plots. To do this simply, we'll use `plot()`. You don't need to know what the four plots mean, but know that it uses the residuals from the model to do it. Show these plots below.**

```{r}

```




# Lesson 3

## Multiple Regression

**3.1. Use a multiple regression model to assess the relationship of interest while controlling for years of education.**

```{r}

```

**3.2. This output gives you three values, one for the intercept, one for the slope of your predictor of interest, and another for the slope of your covariate. What does the slope of your predictor of interest mean here (i.e., interpret the value)?**

a. For each one hour increase in TV watched and 1 year of education received, there is an associated $4,490.10 decrease in yearly income.

b. The salary of an individual with 1 SD years of education above the mean earns $2,904.1 more than the average salary.

c. The salary of an individual with 1 SD of hours of tv watched above the mean earns $4,494.10 less than the average salary.

d. For each one hour increase in TV watched, there is an associated $4,494.10 decrease in yearly income, controlling for years of education

Select an Answer at Kahoot! [Click here](https://kahoot.it/)


## Partial Effects (partial regression, partial standardized effect, and partial correlation)

**3.3. Using the your data you already imported above, let's look at the correlation between between these three variables using `furniture::tableC()`.**
```{r}

```

**3.4. Are the covariate and the predictor of interest correlated?**

Go back to Kahoot to answer.

**3.5. Now, run the simple regression between your outcome and predictor and compare to the results from the multiple regression earlier. How does the estimate on the predictor of interest change?**

```{r}

```

Go back to Kahoot to answer.


**3.6. Let's compare this to the regression value after we standardize both variables with `scale()`. We first have to grab just the complete cases of the variables first (again, consider why).**

```{r}

```

**3.7. How is the estimate on the predictor of interest interpreted in this case?**

a.  For each one hour increase in tv watched, there is an associated 0.2488% decrease in yearly income, controlling for education.

b. For each one SD unit increase in tv watched, there is an associated 0.2488 SD unit decrease in yearly income, controlling for education.

c. The average yearly income is 0.2488% less when tv hours are standardized and education is held constant.

d. For each one SD unit increase in tv watched, there is an associated $0.2488 increase in yearly income, controlling for education.

Select an answer in Kahoot.


**3.8. Run a partial correlation by using the residuals as shown in the example.**

```{r}

```

**3.9. Are these values the same as the standardized regression? Should they be the same?**

Select an answer in Kahoot.

**3.10. Consider if we had a variable that we wanted to control for (let's call it $c$) but didn't have access to it. We report on the regression below with $x$ predicting $y$. If we know that the correlation between $x$ and $c$ is positive and the correlation between $y$ and $c$ is positive, will the estimate on $x$ go up, down, or stay the same?**

Select an answer in Kahoot.



# Lesson 4 
## Regression with Categorical Variables (Dummy Variables)

**4.1. `R` is very helpful in creating dummy variables since it does all the work for you. All you need to do is let `R` know that the variable is a factor. Select sex and see if `R` already knows that it should be a factor or not. If, at the top of the column it says says `<fct>` then `R` already knows that it is a factor; otherwise we need use the `factor()` function to tell `R` that it was a factor. Is it currently a factor?**

Select an answer in Kahoot [Click here](https://kahoot.it/)

```{r}


```


**4.2. Using this categorical variable, let's predict income (obtain the inferential statistics as well with `summary()`). The output for the coefficient now says sex plus one of the levels meaning the unlist level is the reference category and this is in comparison to that.**

Which of the levels is the reference group?

Select an answer in Kahoot.

With that in mind, what is the interpretation of the estimate? Is it significant?
```{r}

```

a. On average, the yearly income of males is $5,900 greater than females; this difference is statistically significant.

b. On average, the yearly income of females is $5,900 greater than males; this difference is statistically significant.

c. For each one unit increase in sex, there is an associated $5,900 increase in yearly income; this effect is statistically significant.

d. The average difference between males and females in yearly income is $5,900; this difference is not statistically significant.

Select an answer in Kahoot.

**4.3. Let's control for two other covariates education and tvhours. How does the estimate for sex change when controlling for education and tvhours?**
```{r}

```

Select an answer in Kahoot.


