You are on page 1of 10

Heteroscedasticity

Use the data of Heteroscedasticity. xls, we assume that there is linear

relationship between consumption and income. If there is

heteroscedasticity in the data, and the error variance is proportional to

Xi2, .

(1) Please regress consumption (Y) on income (X), and explain the

results;

(2) Determine whether the model has heteroscedasticity (Use the

informal method, spearman rank coefficient, and White test)

(3) How to remedy the heteroscedasticity?

Steps:

1. Determine the relationship between Y and X and draw a scatter

diagram
2. Regress consumption (Y) on income (X), and explain the results

3. Test the heteroscedasticity.

(1) informal method

generate the residual (e), and get the square sequence of the

residual (e2)
plot scatter plot between e2 and X
As can be seen from the scatter diagram, e2 and X show a roughly

increasing relationship, that is, with the increase of X, e2 also

increase, and there is a incremental heteroscedasticity in the model.

(2) spearman rank coefficient test

SPSS

Use the “Transform -> Compute Variable” to calculate the absolute

value of e, |e|=abs(e). Then, “Analyze-> Correlate-> Bivariate->

Spearman”, calculate the rank coefficient r between |e| and X.


√n−2 r s
t=
√1−r2s
If |t|<= t(n-2), there is no heteroscedasticity; It |t|>t(n-2), there is

heteroscedasticity.

r=0.1822

t=0.98

(3) White test

4. Remedy heteroscedasticity

(1) find the optimal weight function

SPSS software can be used to determine the optimal value of the


power index m.

Click Analyze-Regression-Weight Estimation to enter the Estimation

function dialog box. The default power exponent m is M =-2.0, -1.5, -

1.0, -0.5, 0,0.5, 1.0, 1.5, 2.0.

(2) Weighted least squares regression

First, select the dependent variable y and independent variable x into

their variable box, and then select x into the Weight variable box, and

take the default value of Power exponent m.

The optimal value of the power exponent m is ?

Second, For the determined optimal power exponent, the weight

function w is calculated by the command “Transform -> Compute

Variable”. m=?, w=1/x2 (if m=2)

Third, Enter the linear regression dialog box, select the dependent

variable Y and independent variable X, and then select the Weight

function w calculated in the first step into the “WLS Weight” variable

box.

Fourth, Click the save option of the linear regression dialog box to

save the residual variable. You can select the unstandardized or


standardized residual according to the needs, run the weighted

residual eiw, and then calculate the weight transformation residual

√ w e iw.

Fifth, the residual graph is drawn with the independent variable X as

the X-axis and the weight transformation residual √ w e iwas the Y-axis.

(Using spearman rank coefficient test, white test and other methods,

test whether to remedy heteroscedasticity)

Do the practice of “ 人 均 实 际 消 费 与 人 均 可 支 配 收 入 数 据

(heteroscedasticity).xls”

Autocorrelation

Use the data of “ 自 相 关 练 习 (autocorrelation).xls” to test

autocorrelation.

(1) Please regress Y on X, and explain the results;

(2) Determine whether the model has autocorrelation (Use the informal

method, D-W test, B-G test)

Plot the scatter diagram between Y and X.


regress Y on X, and explain the results.

test autocorrelation with informal method

Make a scatter diagram of residual ehat and residual ehat(-1) of the

previous period
As this figure reveals, most of the residuals are bunched in the second

(northeast) and the fourth (southwest) quadrants, suggesting a strong

positive correlation in the residuals.

test autocorrelation with D-W test

d-statistic is near to 0, it means there is a positive correlation.


test autocorrelation with B-G test

p-value is 0.0002, reject the null hypothesis of no serial correlation, there

is autocorrelation.

You might also like