Econ231W MWD Example
Econ231W MWD Example
Problem 11.17
a. Estimate a log-linear model using the given data. You can use any combination of the independent
variables you choose. I estimated a regression with ln(Q)=f(ln(disposable income), ln(price of
chicken), ln(composite price index)). [Note this is not the best model] Be sure to store the
residuals, this also stores the predicted Y, (Y-hat).
SUMMARY
OUTPUT
Regression Statistics
Multiple R 0.990
R Square 0.980
Adjusted R Square 0.977
Standard Error 0.028
Observations 23
ANOVA
df SS MS F Significance F
Regression 3 0.759 0.253 315.206 0.000
Residual 19 0.015 0.001
Total 22 0.775
Standard
Coefficients Error t Stat P-value
Intercept 2.030 0.119 17.103 0.000
ln(disposable inc) 0.481 0.068 7.058 0.000
ln(Pchick) -0.351 0.079 -4.416 0.000
ln(Pcomp index) -0.061 0.130 -0.470 0.644
Here are the predicted values of (ln(Y)) and the residuals (e) from the log-linear regression.
RESIDUAL
OUTPUT
Regression Statistics
Multiple R 0.959
R Square 0.920
Adjusted R Square 0.907
Standard Error 2.246
Observations 23
ANOVA
df SS MS F Significance F
Regression 3 1100.112 366.704 72.716 0.000
Residual 19 95.816 5.043
Total 22 1195.929
Standard
Coefficients Error t Stat P-value
Intercept 32.587 3.974 8.200 0.000
Disposable inc 0.010 0.004 2.283 0.034
Pchick -0.296 0.131 -2.257 0.036
Pcomp index 0.106 0.072 1.466 0.159
Here are the predicted values of Y and the residuals (e) from the linear regression.
RESIDUAL
OUTPUT
Take the natural log of Y-hat from the linear regression, that is take the natural log of the predicted Y in the
table above. [Note this is not the same as the predicted(lnY) from the first regression.] You would get the
following values:
ln(Y-hat)
3.429
3.476
3.466
3.485
3.512
3.530
3.537
3.570
3.579
3.598
3.647
3.647
3.694
3.639
3.690
3.711
3.763
3.777
3.755
3.861
3.965
3.982
4.016
We use these values to create the variable Z1 = ln(Y-hat) – predicted(lnY)
Z1 = ln(Y-hat) - predicted(lnY)
0.09
0.08
0.06
0.05
0.02
0.02
0.01
-0.02
-0.04
-0.03
-0.02
-0.06
-0.04
-0.01
-0.02
0.01
-0.01
-0.04
-0.06
-0.01
0.02
0.02
0.04
SUMMARY OUTPUT
Regression Statistics
Multiple R 0.991
R Square 0.981
Adjusted R Square 0.977
Standard Error 1.120
Observations 23
ANOVA
df SS MS F Significance F
Regression 4 1173.361 293.340 233.967 0.000
Residual 18 22.568 1.254
Total 22 1195.929
Coefficient Standard
s Error t Stat P-value
Intercept 30.766 1.996 15.416 0.000
Disposable inc 0.008 0.002 3.994 0.001
Pchick -0.187 0.067 -2.796 0.012
Pcomp index 0.087 0.036 2.404 0.027
Z1 = ln(Y-hat) - predicted(lnY) -45.125 5.904 -7.643 0.000
Reject H0 if Z1 is statistically significant, in this case we see that Z1 is statistically significant, conclude that
H1 a log-linear model is a better fit.
Now calculate Z2 = antilog(ln(Y-hat) – Y(hat)) and regress lnY on the natural logs of X’s and the new
variable Z2.
SUMMARY OUTPUT
Regression Statistics
Multiple R 0.991
R Square 0.982
Adjusted R Square 0.978
Standard Error 0.028
Observations 23
ANOVA
df SS MS F Significance F
Regression 4 0.761 0.190 242.066 0.000
Residual 18 0.014 0.001
Total 22 0.775
Here we find that the variable Z2 is not statistically significant and conclude that the log-linear model is the
appropriate model.