Week 10 Exercises - Multiple Regressions
Follow Along
Download Week 10 Class ActivityFollow Along (.csv)
Data is taken from Cards Against Humanity - Pulse of the Nation
Download the data and move it to the correct folder so that you can access it in this activity.
Import the data into your R file.
Focus on having reproducible code! You will share your file with someone else. They should be able to run it.
Steps:
- Import Data
- Check descriptive statistics
- Create a correlation plot for the continuous variables
- Visualize the relationship between # of Transformers Movies and Books
- Conduct a multiple linear regression predict # of Transformers Movies.
- Briefly report the results
Items in the Data:
| Var Name | Info |
|---|---|
| id | Study ID |
| Income | Overall income |
| Sex | Sex |
| Age | Age |
| Age Range | Age given in ranges |
| Political Affiliation | Political Affiliation |
| Education | What is your highest level of education? |
| ethnicity | What is your race? |
| marrital status | What is your marital status? |
| climate change | Do you believe that climate change is real and caused by people, real but not caused by people, or not real at all? |
| Transformers | How many Transformers movies have you seen? |
| books | How many books, if any, have you read in the past year? |
| ghosts | Do you believe in ghosts? |
| spending | Is federal funding of scientific research too high, too low, or about right? |
| choice | If you had to choose: would you rather be smart and sad, or dumb and happy? |
| shower_pee | Do you think it is acceptable or unacceptable to urinate in the shower? |
On Your Own
Objective: To examine the process of multiple linear regression. To produce a reproducible workflow.
Download Week 10 Class Activity - On Your Own (.csv)
Data is taken from Kaggle
Download the data and move it to the correct folder so that you can access it in this activity.
Import the data into your R file.
Focus on having reproducible code! You will share your file with someone else. They should be able to run it.
You will be saving this to a thumb drive to share with someone else in the class. Please put everything in one folder that can be shared with a classmate.
Steps:
- Import Data
- Identify your Outcome Variable and up to 3 predictor variables. Why did you choose your predictors?
- Visualize the relationship between 2 variables (with one being your Outcome)
- Conduct a multiple linear regression to predict your outcome variable (3 predictors maximum)
- Use
check_modelto examine the model - Briefly report the results