Chap 8 AE

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

lOMoARcPSD|10538911

Applied Econometrics Homework

Economics 101 (Trường Đại học Kinh tế Thành phố Hồ Chí Minh)

StuDocu is not sponsored or endorsed by any college or university


Downloaded by Tan Tran Tien (31211022001@student.isb.edu.vn)
lOMoARcPSD|10538911

Homework Session 12 (chapter 8)

1. Use the data in HPRICE1 to obtain the heteroskedasticity-robust standard errors for
equation (8.17).
i. Discuss any important differences with the usual standard errors.
. reg price lotsize sqrft bdrms

Source SS df MS Number of obs = 88


F(3, 84) = 57.46
Model 617130.701 3 205710.234 Prob > F = 0.0000
Residual 300723.805 84 3580.0453 R-squared = 0.6724
Adj R-squared = 0.6607
Total 917854.506 87 10550.0518 Root MSE = 59.833

price Coef. Std. Err. t P>|t| [95% Conf. Interval]

lotsize .0020677 .0006421 3.22 0.002 .0007908 .0033446


sqrft .1227782 .0132374 9.28 0.000 .0964541 .1491022
bdrms 13.85252 9.010145 1.54 0.128 -4.065141 31.77018
_cons -21.77031 29.47504 -0.74 0.462 -80.38466 36.84405

. reg price lotsize sqrft bdrms, vce(robust)

Linear regression Number of obs = 88


F(3, 84) = 23.72
Prob > F = 0.0000
R-squared = 0.6724
Root MSE = 59.833

Robust
price Coef. Std. Err. t P>|t| [95% Conf. Interval]

lotsize .0020677 .0012514 1.65 0.102 -.0004209 .0045563


sqrft .1227782 .0177253 6.93 0.000 .0875294 .158027
bdrms 13.85252 8.478625 1.63 0.106 -3.008154 30.7132
_cons -21.77031 37.13821 -0.59 0.559 -95.62371 52.0831

The estimated equation with both sets of standard errors (heteroskedasticity-robust


standard errors in parentheses) is

price = 21.77 + 0.00207 lotsize + 0.123 sqrft + 13.85 bdrms

(29.48) (0.00064) (0.013) (9.01)


[37.138] [0.00123] [0.018] [8.47]
n = 88, R2 = 0.672.

The robust standard error on lotsize is almost twice as large as the usual standard
error, making lotsize much less significant (the t statistic falls from about 3.23 to

Downloaded by Tan Tran Tien (31211022001@student.isb.edu.vn)


lOMoARcPSD|10538911

1.65). The t statistic on sqrft also falls, but it is still very significant. The variable
bdrms actually becomes somewhat more significant, but it is still barely significant.
The most important change is in the significance of lotsize.

ii. Repeat part (i) for equation (8.18).


. reg lprice llotsize lsqrft bdrms

Source SS df MS Number of obs = 88


F(3, 84) = 50.42
Model 5.15504028 3 1.71834676 Prob > F = 0.0000
Residual 2.86256324 84 .034078134 R-squared = 0.6430
Adj R-squared = 0.6302
Total 8.01760352 87 .092156362 Root MSE = .1846

lprice Coef. Std. Err. t P>|t| [95% Conf. Interval]

llotsize .1679667 .0382812 4.39 0.000 .0918404 .244093


lsqrft .7002324 .0928652 7.54 0.000 .5155597 .8849051
bdrms .0369584 .0275313 1.34 0.183 -.0177906 .0917074
_cons -1.297042 .6512836 -1.99 0.050 -2.592191 -.001893

. reg lprice llotsize lsqrft bdrms, vce(robust)

Linear regression Number of obs = 88


F(3, 84) = 49.32
Prob > F = 0.0000
R-squared = 0.6430
Root MSE = .1846

Robust
lprice Coef. Std. Err. t P>|t| [95% Conf. Interval]

llotsize .1679667 .0414734 4.05 0.000 .0854922 .2504412


lsqrft .7002324 .1038288 6.74 0.000 .4937574 .9067074
bdrms .0369584 .0306011 1.21 0.231 -.0238953 .0978121
_cons -1.297042 .7813145 -1.66 0.101 -2.850771 .2566876

For the log-log model,

log( price) = 5.61 + 0.168 log(lotsize) +0.700 log(sqrft) + 0.037 bdrms


(0.65) (0.038) (0.093) (0.028)
[0.78] [0.041] [0.101] [0.030]
n = 88, R2 = .643.

Here, the heteroskedasticity-robust standard error is always slightly greater than


the corresponding usual standard error, but the differences are relatively small. In
particular, log(lotsize) and log(sqrft) still have very large t statistics, and the t statistic

Downloaded by Tan Tran Tien (31211022001@student.isb.edu.vn)


lOMoARcPSD|10538911

on bdrms is not significant at the 5% level against a one-sided alternative using


either standard error.

iii. What does this example suggest about heteroskedasticity and the transformation used
for the dependent variable?

Using the logarithmic transformation of the dependent variable often mitigates, if


not entirely eliminates, heteroskedasticity. This is certainly the case here, as no
important conclusions in the model for log(price) depend on the choice of standard
error. (We have also transformed two of the independent variables to make the
model of the constant elasticity variety in lotsize and sqrft.)

2. Apply the full White test for heteroskedasticity [see equation (8.19)] to equation (8.18).
Using the chisquare form of the statistic, obtain the p-value. What do you conclude?

Solution 1:

After estimating equation (8.18), we obtain the squared OLS residuals û 2 . The full-

blown White test is based on the R-squared from the auxiliary regression (with an
intercept),

û 2 on llotsize, lsqrft, bdrms, llotsize2, lsqrft2, bdrms2,

llotsize  lsqrft, llotsize  bdrms, and lsqrft  bdrms,

where “l ” in front of lotsize and sqrft denotes the natural log. [See equation (8.19).]
With 88 observations the n-R-squared version of the White statistic is 88(.109) 
9.59, and this is the outcome of an (approximately)  92 random variable. The p-

value is about .385, which provides little evidence against the homoskedasticity
assumption.

gen llotsize_lsqrft=llotsize*lsqrft

gen llotsize_bdrms=llotsize*bdrms

gen lsqrft_bdrms=lsqrft*bdrms

reg lprice llotsize lsqrft bdrms

predict uhat, re

Downloaded by Tan Tran Tien (31211022001@student.isb.edu.vn)


lOMoARcPSD|10538911

gen uhatsq=uhat^2

gen llotsizesq= llotsize^2

gen lsqrftsq= lsqrft^2

gen bdrmssq= bdrms^2

reg uhatsq llotsize lsqrft bdrms llotsizesq lsqrftsq bdrmssq llotsize_lsqrft llotsize_bdrms
lsqrft_bdrms
. reg uhatsq llotsize lsqrft bdrms llotsizesq lsqrftsq bdrmssq llotsize_lsqrft llotsize_bdrms lsq
> rft_bdrms

Source SS df MS Number of obs = 88


F(9, 78) = 1.05
Model .051148284 9 .005683143 Prob > F = 0.4053
Residual .420189078 78 .005387039 R-squared = 0.1085
Adj R-squared = 0.0057
Total .471337362 87 .005417671 Root MSE = .0734

uhatsq Coef. Std. Err. t P>|t| [95% Conf. Interval]

llotsize -1.272838 .7082543 -1.80 0.076 -2.682864 .1371875


lsqrft -1.756801 1.664947 -1.06 0.295 -5.071455 1.557853
bdrms .2878727 .2845219 1.01 0.315 -.2785668 .8543123
llotsizesq .0235206 .0162958 1.44 0.153 -.0089218 .055963
lsqrftsq .0402748 .1230733 0.33 0.744 -.2047454 .285295
bdrmssq -.0050909 .0090558 -0.56 0.576 -.0231196 .0129378
llotsize_lsqrft .1208609 .0721295 1.68 0.098 -.0227379 .2644597
llotsize_bdrms -.025276 .0320631 -0.79 0.433 -.0891087 .0385567
lsqrft_bdrms -.0010947 .0482468 -0.02 0.982 -.0971468 .0949573
_cons 12.20708 6.692661 1.82 0.072 -1.116984 25.53114

Solution 2:
. estat imtest, white

White's test for Ho: homoskedasticity


against Ha: unrestricted heteroskedasticity

chi2(9) = 9.55
Prob > chi2 = 0.3882

Cameron & Trivedi's decomposition of IM-test

Source chi2 df p

Heteroskedasticity 9.55 9 0.3882


Skewness 1.69 3 0.6381
Kurtosis 2.57 1 0.1090

Total 13.81 13 0.3872

Since the value of Prob > chi2 = 0.3882 that is larger than 5%, we fail to reject two-
sided alternative H0: homoscedasticity at the 5% level.

Downloaded by Tan Tran Tien (31211022001@student.isb.edu.vn)


lOMoARcPSD|10538911

3. In Example 7.12, we estimated a linear probability model for whether a young man was
arrested during 1986:

i. Using the data in CRIME1, estimate this model by OLS and verify that all fitted
values are strictly between zero and one. What are the smallest and largest fitted
values?

Let arr86 be a binary variable equal to unity if a man was arrested during 1986, and
zero otherwise.
. reg arr86 pcnv avgsen tottime ptime86 qemp86

Source SS df MS Number of obs = 2,725


F(5, 2719) = 27.03
Model 25.8452455 5 5.16904909 Prob > F = 0.0000
Residual 519.971268 2,719 .191236215 R-squared = 0.0474
Adj R-squared = 0.0456
Total 545.816514 2,724 .20037317 Root MSE = .43731

arr86 Coef. Std. Err. t P>|t| [95% Conf. Interval]

pcnv -.1624448 .0212368 -7.65 0.000 -.2040866 -.120803


avgsen .0061127 .006452 0.95 0.344 -.0065385 .018764
tottime -.0022616 .0049781 -0.45 0.650 -.0120229 .0074997
ptime86 -.0219664 .0046349 -4.74 0.000 -.0310547 -.0128781
qemp86 -.0428294 .0054046 -7.92 0.000 -.0534268 -.0322319
_cons .4406154 .0172329 25.57 0.000 .4068246 .4744063

. predict fitted
(option xb assumed; fitted values)

. sum fitted

Variable Obs Mean Std. Dev. Min Max

fitted 2,725 .2770642 .0974062 .0066431 .5576897

The estimates are given in equation (7.31). Rounded to four decimal places, the
smallest fitted value is 0.0066 and the largest fitted value is 0.5577.

ii. Estimate the equation by weighted least squares, as discussed in Section 8-5.

Downloaded by Tan Tran Tien (31211022001@student.isb.edu.vn)


lOMoARcPSD|10538911

. gen h= fitted*(1- fitted)

. gen weight=1/h

. reg arr86 pcnv avgsen tottime ptime86 qemp86 [aweight=weight]


(sum of wgt is 1.5961e+04)

Source SS df MS Number of obs = 2,725


F(5, 2719) = 43.70
Model 36.6318176 5 7.32636351 Prob > F = 0.0000
Residual 455.826896 2,719 .167645052 R-squared = 0.0744
Adj R-squared = 0.0727
Total 492.458714 2,724 .180785137 Root MSE = .40944

arr86 Coef. Std. Err. t P>|t| [95% Conf. Interval]

pcnv -.1678436 .0189122 -8.87 0.000 -.2049272 -.1307599


avgsen .0053665 .0051146 1.05 0.294 -.0046624 .0153954
tottime -.0017615 .0032514 -0.54 0.588 -.008137 .004614
ptime86 -.0246188 .0030451 -8.08 0.000 -.0305898 -.0186479
qemp86 -.0451885 .0054225 -8.33 0.000 -.0558212 -.0345558
_cons .4475965 .0179922 24.88 0.000 .4123167 .4828763

The estimated heteroskedasticity function for each observation i is

hˆi  arr86 i (1  arr86 i ) , which is strictly between zero and one because 0 < arr86 i < 1

for all i. The weights for WLS are 1/ hˆi . To show the WLS estimate of each

parameter, we report the WLS results using the same equation format as for OLS:

arr86 = .448  0.168 pcnv + .0054 avgsen  .0018 tottime  .025


ptime86
(.018) (.019) (.0051) (.0033) (.003)
 .045 qemp86
(.005)
n = 2,725, R2 = .0744.

The coefficients on the significant explanatory variables are very similar to the OLS
estimates. The WLS standard errors on the slope coefficients are generally lower
than the nonrobust OLS standard errors. A proper comparison would be with the
robust OLS standard errors.

iii. Use the WLS estimates to determine whether avgsen and tottime are jointly
significant at the 5% level.

Downloaded by Tan Tran Tien (31211022001@student.isb.edu.vn)


lOMoARcPSD|10538911

. test avgsen==tottime==0

( 1) avgsen - tottime = 0
( 2) avgsen = 0

F( 2, 2719) = 0.88
Prob > F = 0.4129

After WLS estimation, the F statistic for joint significance of avgsen and tottime,
with 2 and 2,719 df, is about 0.88 with p-value  0.41. They are not close to being
jointly significant at the 5% level. If your econometrics package has a command for
WLS and a test command for joint hypotheses, the F statistic and p-value are easy to
obtain. Alternatively, you can obtain the restricted R-squared using the same
weights as in part (ii) and dropping avgsen and tottime from the WLS estimation.
(The unrestricted R-squared is .0744.)

Downloaded by Tan Tran Tien (31211022001@student.isb.edu.vn)

You might also like