Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


ECO 321 Fall 2021

Homework 5


Both problems must be solved using R. List your answers in the order of the problem. And remember to cut and paste your code at the end of your submission.


1. X is a continuous variable that takes on values between 5 and 100. Z is a binary variable. Generate variable X (you can generate x with command seq(5,100,1) [This generates equally space points between 5 and 100]). Then: Plot the following regres-sion functions (with values of X between 5 and 100 on the horizontal axis, and values of  on the vertical axis,). Compute the expected change in Y when X changes.

(a) = 2 + 3 log(X).

(b) = 2 − 3 log(X).

(c) Report in the same figure the curve from part (a), and the curve = 2 + 3 log(X) + 4Z, when Z = 1. Explain the difference between the two curves.

(d) Report in the same figure the curves from part (c), and the curve = 2 + 3 log(X) + 4Z − log(X)Z, when Z = 1. Explain the difference between these three curves.

(e) = 1 + 125X − 0.01X2.


2. The data set W AGENBA.CSV contains salary information and career statistics for 269 players in the National  Basketball Association (NBA).

(a) Estimate a model relating points-per-game (points) to years in the league (exper), age, and years played in college (coll). Include a quadratic in exper; the other variables should appear in level form. Report the results using heteroskedastic-ity robust standard error.

(b) Holding college years and age fixed, at what value of experience does the next year of experience actually reduce points-per-game? Is this evidence consistent with your intuition?

(c) Why do you think coll has a negative and statistically significant coefficient? (Hint: NBA players can be drafted before finishing their college careers and even directly out of high school.)

(d) Add a quadratic in age to the equation. Is it needed? What does this appear to imply about the effects of age, once experience and education are controlled for?

(e) Now regress log(wage) on points, exper, exper2, age, and coll. Report the results using heteroskedasticity robust standard error.

(f) Test whether age and coll are jointly significant in the regression from part (e). What does this imply about whether age and education have separate effects on wage, once productivity and seniority are accounted for?