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.
There are 10 exercises in total, receiving 1 mark each.
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!
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
# from google.colab import drive
# drive.mount('/content/drive')
# df = pd.read_csv('drive/MyDrive/EMET2007/datasets/teaching_ratings.csv')
# df = pd.read_csv('../datasets/teaching_ratings.csv')
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.)
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?
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?
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.
Also predict the course evaluation of Professor Jones, who is female but otherwise has the same observable attributes as Professor Smith.
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!
For the remainder of this assignment, always include the regressors beauty
, intro
, oneCredit
, female
, minority
, and nnEnglish
in your models.
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?
For the remainder of this assignment, use the model from Exercise 6.
By how much does his predicted course evaluation increase?
Construct a 95% confidence interval for the increase in his course evaluation.
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.
By how much does her predicted course evaluation increase?
Construct a 95% confidence interval for the increase in her course evaluation.
Is there evidence that age
has a nonlinear effect on courseEval
? Is there evidence that age
has any effect on courseEval
?
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.
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