Lab 05 - Modelling course evaluations, Pt 2

Published

February 17, 2023

Introduction

In this lab we revisit the professor evaluations data we modeled in an earlier lab. In the modelling lab we modeled evaluation scores using a single predictor at a time. However, this time we use multiple predictors to model evaluation scores.

If you don’t remember the data, review the modelling lab’s introduction before continuing to the exercises.

Important

This lab is likely longer than what you’ll be able to complete in an hour. We will be looking to see that you minimally ran and interpreted a model using multiple linear regression (completed Part 2). If you’re able to finish the whole thing, awesome! If not, that’s OK.

Getting started

To get started, accept the lab05 assignment (link on Canvas), clone the repo (using SSH) into RStudio on datahub. Update the author name at the top of the .Rmd file in the YAML to be your name. And, then you’re ready to go!

Packages

In this lab we will work with the tidyverse, broom, and tidymodels packages. Be sure to import them prior to starting the lab.

The data

In this lab you will first read in the data (‘evals-mod.csv’) from the data/ folder (provided in the template). Then, recreate the bty_avg variable as you did in the previous lab.

Exercises

Exercise 1

Load the data by including the appropriate code in your R Markdown file.

Part 1: Simple linear regression

Exercise 2

[Review from linear regression lab] Fit a linear model (one you have fit before): m_bty, predicting average professor evaluation score based on average beauty rating (bty_avg) only. Write the linear model, and note the \(R^2\) and the adjusted \(R^2\).

Part 2: Multiple linear regression

Exercise 3

Fit a linear model: m_bty_gen, predicting average professor evaluation score based on average beauty rating (bty_avg) and gender. Write the linear model, and note the \(R^2\) and the adjusted \(R^2\).

Exercise 4

Interpret the slopes and intercept of m_bty_gen in context of the data.

Exercise 5

What percent of the variability in score is explained by the model m_bty_gen.

Exercise 6

What is the equation of the line corresponding to just male professors?

Exercise 7

For two professors who received the same beauty rating, which gender tends to have the higher course evaluation score?

Exercise 8

How do the adjusted \(R^2\) values of m_bty_gen and m_bty compare? What does this tell us about how useful gender is in explaining the variability in evaluation scores when we already have information on the beauty score of the professor.

Exercise 9

Compare the slopes of bty_avg under the two models (m_bty and m_bty_gen). Has the addition of gender to the model changed the parameter estimate (slope) for bty_avg?

Exercise 10

Create a new model called m_bty_rank with gender removed and rank added in. Write the equation of the linear model and interpret the slopes and intercept in context of the data.

Part 3: The search for the best model

Going forward, only consider the following variables as potential predictors: rank, ethnicity, gender, language, age, cls_perc_eval, cls_did_eval, cls_students, cls_level, cls_profs, cls_credits, bty_avg.

Exercise 11

Which variable, on its own, would you expect to be the worst predictor of evaluation scores? Why? Hint: Think about which variable would you expect to not have any association with the professor’s score.

Exercise 12

Check your suspicions from the previous exercise. Include the model output for that variable in your response.

Exercise 13

Suppose you wanted to fit a full model with the variables listed above. If you are already going to include cls_perc_eval and cls_students, which variable should you not include as an additional predictor? Why?

Exercise 14

Fit a full model with all predictors listed above (except for the one you decided to exclude) in the previous question.

Exercise 15

Using backward-selection (meaning fit all predictors and remove those that are not needed in the model) with adjusted R-squared as the selection criterion, determine the best model. You do not need to show all steps in your answer, just the output for the final model. Also, write out the linear model for predicting score based on the final model you settle on.

Exercise 16

Interpret the slopes of one numerical and one categorical predictor based on your final model.

Exercise 17

Based on your final model, describe the characteristics of a professor and course at University of Texas at Austin that would be associated with a high evaluation score.

Exercise 18

Would you be comfortable generalizing your conclusions to apply to professors generally (at any university)? Why or why not?