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

Department of Economics

Winter 2023

ECN 102: Analysis of Economic Data

Assignment 4: Due 5 p.m. 2/19

No credit for late assignments.

Answer questions 1-7. Keep answers as brief as possible. Include key Stata output with answers. You must hand in your own work.

This assignment uses the les KNEEREPLACE.DTA, ass4w21sim.do, and oecdhealth2008.dta on Canvas.

1. R-squared

Suppose a regression of y on an intercept and x with 50 observations yields total sum of squares 100 and explained sum of squares 36.

(a) What is R2?

(b) What is the correlation coefficient between y and x?

(c) What is the standard error of the residual?

2. Use dataset KNEEREPLACE.DTA. The data are 2011 data from 170 New York hospitals for knee replacement surgeries. For each hospital variable discharges is the number of knee replacements, variable medcost is the median cost to the hospital of these knee replacements, and variable medcharge is the median charge by the hospital for knee replacements.  Note that the hospital charge is the initial price that the hospital charges, but the hospital usually reeives less than this after negotiating with the patient or the patient’s insurance company.

(a) Provide a scatterplot of medcharge against medcost, along with tted regression line.

(b) Regress medcharge against medcost. Provide an interpretation of the slope coefficient.

(c) Calculate the residuals from this regression.   (Hint: Create a variable equal to yi  = b1 − b2xi . Alternatively after command regress give command predict uhat, resid).

(d) Do the residuals sum over observations to zero? Comment.

(e) Given these residuals, calculate the standard error of the regression.

(f) Given these residuals, calculate the sum of squared residuals and compare this to the regression output.

(g) Calculate the total sum of squares. (Hint: The sample variance of yi equals n 1 P(yi− y¯)2 .)

(h) Given your preceding answers, calculate R2  and compare to the regression output.

3. Continue with the same data as in question 2.

(a) Create the z-scores for medcharge and medcost.  (Recall: zi = (yi − y¯)/sy).

(b) Regress the z-score for medcharge against the z-score for medcost.  Provide an inter- pretation of the slope coefficient.

(c) Compare the slope coefficient in part (b) to the correlation coefficient between medcharge and medcost.

(d) Regress medcharge against just an intercept.  (In Stata simply regress medcharge). (e) Compare your results in part (d) to the sample mean of medcharge and its standard error.

(f) Do reverse regression of medcost against medcharge. Compare the slope coefficient and R2  with that from regression of medcharge against medcost. Comment.

4. The program ass4w21sim.do estimates 500 times the model yi  = 1 + 3xi + ui  where xi ⇠ N[5, 12] and ui ⇠ N[0, 42] where the sample size is 100.

This creates a le with 500 observations, where each observation is the result of one simu- lation with variables the estimated intercept and the estimated slope coefficient.

(a) Run this Stata program, as well as any additional commands needed to answer parts b and c.

(b) Does the OLS slope coefficient appear to be unbiased? Explain.

(c) Does the OLS slope coefficient appear to be normally distributed? Explain.

5. Consider the model y = β 1 + β2x + u.  Regression of y on an intercept and x with a sample of 40 observations leads to slope coefficient equal to 7 with standard error equal to 3.

Hint: For inference on β2  the t-statistic is (b2 − β2 )/se(b2 ) and is tn−2  distributed.

(a) Provide a 95 percent confidence interval for β2 .

(b) Test the hypothesis that β2 = 0 against the alternative that β2 0 at significance level 0.05.

(c) Test the hypothesis that β2  < 0 against the alternative that β2  > 0 at significance level 0.05.

(d) Test the hypothesis that β2  = 12 against the alternative that β2 12 at significance level 0.05.

6. Return to dataset KNEEREPLACE.DTA.

(a) Regress medcharge against medcost.

(b) Is the coefficient for medcost statistically significant at significance level 0.05? Explain.

(c) Test the hypothesis that the coefficient for medcost equals one against the alternative that it does not equal one at significance level 0.05.  What do you conclude? (Hint: This requires some extra computation).

(d) Test the claim that a one dollar increase in cost is associated with a more than one dollar increase in the charge, at significance level 0.05. What do you conclude?

(e) Which of assumptions 1-4 in the notes are necessary for this analysis to be valid?

7. Use data on health expenditures and outcomes in various OECD countries.  The data used is in file oecdhealth2008.dta Use describe for variable descriptions.

Regress hexp gdp on gdp pc.

(a) If per capita GDP rises by $1,000, by how much does the % of GDP spent on health change?

(b) If the slope coefficient equals zero what is the implied income elasticity of health ex- penditures? Explain.

(c) Test at 5% whether or not there is a relationship between healthgdp and gdppc. (d) Are there any outliers? Use results from command

graph twoway (scatter hexp gdp gdp pc) (lfit hexp gdp gdp pc)

(e) Which countries are an outlier? Use commands

predict uhat, resid and  list country uhat if abs(uhat) > 2