EMET2007 Assignment 2¶

General instructions¶

Before you start, and while you're going, have a look at the website for important reminders on deadlines and academic honesty!

Your job consists of

  • coding in Python, and

  • writing explanations and offering econometric interpretations.

For the coding you will need to use code cells and for the explanations you will need to use text (or markdown) cells. In the notebook below, we have included empty code and text cells in which you can type your solutions. Feel free to put additional code and text cells wherever you may need them!

Note: You may only use Python and you may only use packages that were used during the EMET2007 computer labs.

Marking¶

There are 10 exercises in total, receiving 1 mark each.

Your task: studying the association between a professor's beauty and their course evaluations.¶

You will use the Teaching_Ratings data from the U.S. You can find it on the course website.

The data contain observation on course evaluations, course characteristics, and professor characteristics for 463 courses at the University of Texas at Austin. One of the characteristics is an index of the professor's beauty as rated by a panel of six judges.

Answer all of the following exercises! Good luck!

Imports and loading data¶

In [1]:
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import statsmodels.stats.api as sms
import statsmodels.formula.api as smf
In [2]:
# from google.colab import drive
# drive.mount('/content/drive')
# df = pd.read_csv('drive/MyDrive/EMET2007/datasets/teaching_ratings.csv')
In [3]:
# df = pd.read_csv('../datasets/teaching_ratings.csv')

Exercise 1¶

Create box plots and histograms for courseEval and beauty. Describe and interpret your findings. (Whenever and wherever you describe or interpret, do so by using text cells. Instructions for this were given as part of assignment 1.)

In [ ]:
 
In [ ]:
 

Exercise 2¶

Run a simple regression of courseEval on the professor's beauty. Create a scatter plot and add the estimated PRF. Does there appear to be an association between the variables?

In [ ]:
 
In [ ]:
 

Exercise 3¶

Exercise 3a¶

Professor Watson is of average beauty, while Professor Stock's value of beauty is one standard deviation above the average. Predict both professors' course evaluations.

In [ ]:
 
In [ ]:
 

Exercise 3b¶

What does a comparison of the predicted course evaluations tell you about the size of the effect of beauty on courseEval? Is it large or small?

Exercise 4¶

Exercise 4a¶

Run a multiple regression of courseEval on beauty plus all of the following explanatory variables: intro, oneCredit, female, minority, and nnEnglish.

In [ ]:
 

Exercise 4b¶

Professor Smith is a black male with average beauty and is a native English speaker. He teaches a three-credit upper-division course. Predict Professor Smith's course evaluation.

In [ ]:
 

Exercise 4c¶

Also predict the course evaluation of Professor Jones, who is female but otherwise has the same observable attributes as Professor Smith.

In [ ]:
 

Exercise 5¶

Run the same multiple regression as in part (4) but exclude the variable female. What is the coefficient estimate on beauty equal to? How has it changed? What does this tell you about omitted variables bias? Give a brief yet thoughtful discussion!

In [ ]:
 

Note¶

For the remainder of this assignment, always include the regressors beauty, intro, oneCredit, female, minority, and nnEnglish in your models.

Exercise 6¶

Modify the model so that the effect of beauty on courseEval is different for men and women. (Hint: the intended modification does NOT consist of splitting the sample and running separate regressions.) Is the male/female difference in the effect of beauty statistically significant?

In [ ]:
 

Note¶

For the remainder of this assignment, use the model from Exercise 6.

Exercise 7¶

Professor White has cosmetic surgery that increases his beauty index from one standard deviation below the average to one standard deviation above the average.

Exercise 7a¶

What is his value of beauty before the surgery? After the surgery?

In [ ]:
 

Exercise 7b¶

By how much does his predicted course evaluation increase?

In [ ]:
 

Exercise 7c¶

Construct a 95% confidence interval for the increase in his course evaluation.

In [ ]:
 

Exercise 8¶

Repeat Exercise 7 for Professor Robinson, who identifies as female. She also has cosmetic surgery that increases her beauty index from one standard deviation below the average to one standard deviation above the average.

Exercise 8 a¶

By how much does her predicted course evaluation increase?

In [ ]:
 

Exercise 8b¶

Construct a 95% confidence interval for the increase in her course evaluation.

In [ ]:
 

Exercise 9¶

Exercise 9a¶

Add a linear and a quadratic age term to the regression.

In [ ]:
 

Exercise 9b¶

Is there evidence that age has a nonlinear effect on courseEval? Is there evidence that age has any effect on courseEval?

In [ ]:
 

Exercise 10¶

Submit both an ipynb-file and an html-file on the course's Wattle page.

We suggest that you

  • name the notebook file assignment_2.ipynb, and

  • the html file assignment_2.html

Note: We absolutely require you to submit the ipynb-file. If you struggle with the creation of an html-file, don't worry: we will not deduct partial marks if you are unable to create and submit an html-file.

Make sure to follow our instructions asking you to double check that your files have uploaded properly to Wattle/Turnitin. A digital receipt or confirmation email from Wattle/Turnitin is NOT sufficient! Check my Github site (under Assignments) for details. Double checking your upload is part of the assignment and must occur before the deadline.

Attribution¶

This exercise is based on Additional Empirical Exercise 4.2, 5.2, 6.1, 7.2, 8.1 of Stock and Watson, Introduction to Econometrics, 4th global edition