By the end of the lab you will be able to…
The goal of today’s lab is to use the GSS to examine the relationship between US adults’ political views and attitudes towards government spending on mass transportation projects.
Let’s begin by making a binary variable for respondents’ views on spending on mass transportation. Create a new variable that is equal to “1” if a respondent said spending on mass transportation is about right and “0” otherwise. Then make a plot of the new variable, using informative labels for each category.
Recode polviews
so it is a factor with levels that are in an order that is consistent with question on the survey. Note how the categories are spelled in the data.
polviews
.Make a plot displaying the relationship between satisfaction with mass transportation spending and political views. Use the plot to describe the relationship the two variables.
We’d like to use age
as a quantitative variable in your model; however, it is currently a character data type because some observations are coded as "89 or older"
.
age
so that is a numeric variable. Note: Before making the variable numeric, you will need to replace the values "89 or older"
with a single value.Briefly explain why we should use a logistic regression model to predict the odds a randomly selected person is satisfied with spending on mass transportation.
Let’s start by fitting a model using the demographic factors - age
, sex
, sei10
, and region
- to predict the odds a person is satisfied with spending on mass transportation. Make any necessary adjustments to the variables so the intercept will have a meaningful interpretation. Neatly display the model.
Interpret the intercept in the context of the data.
Consider the relationship between age and one’s opinion about spending on mass transportation. Interpret the coefficient of age in terms of the odds of being satisfied with spending on mass transportation.
Now let’s see whether a person’s political views has a significant impact on their odds of being satisfied with spending on mass transportation, after accounting for the demographic factors.
Conduct a drop-in-deviance test to determine if polviews
is a significant predictor of attitude towards spending on mass transportation. State the null and alternative hypotheses in words, display all relevant code and output, and state your conclusion in the context of the problem.
Use the model selected in the previous exercise to describe the relationship (if any) between one’s political views and their attitude towards spending on mass transportation. Be sure your answer includes the interpretation of the model coefficients and associated hypothesis tests or confidence intervals used to support your response.
There should only be one submission per team on Gradescope.
Component | Points |
---|---|
Ex 1 - 10 | 40 |
Model diagnostics activity (individual score) | 5 |
Workflow & formatting | 5 |
Grading notes:
There should only be one submission per team on Gradescope.