OMF Lecture 7
OMF Lecture 7
University of York
Heteroskedasticity
Autocorrelation
Measurement error
Overview
Heteroskedasticity
Autocorrelation
Measurement error
The OLS Assumptions
OLS Assumptions
1. E(ut ) = 0
2. var(ut ) = σ 2 < ∞
3. cov(ui ,uj ) = 0 for i ̸= j
4. cov(ut ,xt ) = 0
5. ut ∼ N(0, σ 2 )
1 / 64
Outline for the topic
▶ Note that because the actual error term ut is not observable, the
tests or checks we use rely on the residuals ût from the estimated
sample regression function
2 / 64
Overview
Heteroskedasticity
Autocorrelation
Measurement error
Heteroskedasticity and Homoskedasticity
var(ut ) = σ 2 < ∞
▶ This is not always realistic - the error variance may vary across units
(for cross-sectional data) or over time (for time series data).
▶ In this case, we say that the errors are heteroskedastic - formally this
can be expressed as:
for the cases of time series and cross sectional notation respectively.
3 / 64
Heteroskedasticity
▶ We will focus in this topic on the standard form of heteroskedasticity
that is often found in cross-sectional data.
▶ In a later topic we will also look at a specific form of time series
heteroskedasticity that is important in financial data, where the
current error variance depends on the past error variance.
wagei = β0 + β1 educi + ui
[ = −0.905 + 0.541educ
wage
(−1.321) (10.166)
4 / 64
Heteroskedasticity
▶ Plotting this fitted regression line together with the data:
40
30
Wage ($/hr)
20
10
-10
-2 0 2 4 6 8 10 12 14 16 18 20
Education (years)
5 / 64
Heteroskedasticity
▶ Or alternatively, plotting the residuals themselves against the value
of the explanatory variable education:
30
20
10
Residual
-10
-20
-2 0 2 4 6 8 10 12 14 16 18 20
Education (years)
▶ We can see that the variance of the residuals is increasing with the
level of education.
6 / 64
Testing for heteroskedasticity
▶ Therefore, in simple cases with a single explanatory variable, it is in
principle possible to check for heteroskedasticity graphically.
▶ However:
▶ Even if applicable, graphical checks are often imprecise and/or
inconclusive - how strong does the pattern need to be?
▶ For more general regression models, the size of the error variance
may vary with the values of multiple explanatory variables, or vary
over time - not easy to detect graphically.
7 / 64
Testing for heteroskedasticity: White’s test
▶ White’s test is conducted as follows:
1. Assume that the regression model of interest is:
yt = β0 + β1 x1t + β2 x2t + ut
and we want to test Var(ut ) = σ 2 (i.e. homoskedasticity). We
estimate the model, obtaining the residuals, uˆt .
2. Then run the auxiliary regression:
ût2 = α0 + α1 x1t + α2 x2t + α3 x1t
2 2
+ α4 x2t + α5 x1t x2t + vt
and test the null hypothesis H0 : α1 = · · · = α5 = 0
(homoskedasticity) vs. H1 : at least one αj ̸= 0 (heteroskedasticity).
3. We can either do this using a standard F-test, or more simply using
an LM test. It can be shown that under H0 :
TR 2 ∼ χ2 (m)
where, R 2 is from the auxiliary regression, T is the number of
observations, and m is the number of regressors in the auxiliary
regression excluding the constant (i.e. m = 5 above).
4. If the χ2 test statistic from step 3 is greater than the corresponding
value from the statistical table then reject the null hypothesis that
the disturbances are homoscedastic.
8 / 64
Testing for heteroskedasticity: White’s test
▶ Let’s look a little more at the logic underlying White’s test.
9 / 64
Testing for heteroskedasticity: tests in EViews
▶ If you wish to implement White’s test, or other heteroskedasticity
tests in EViews, first estimate your model in the usual way.
▶ Once you have estimated your model, from the estimated equation
object go to: View -> Residual Diagnostics ->
Heteroskedasticity Tests and choose the test to perform.
▶ For the previous wage and education example:
10 / 64
Testing for heteroskedasticity: tests in EViews
▶ If we were to expand the model to include years of experience:
11 / 64
Consequences of ignoring heteroskedasticity
▶ Suppose that the errors for our model of interest are heteroskedastic,
but we do not realise this and apply the methods studied so far.
▶ What are the consequences?
▶ OLS estimator: the standard OLS estimator remains unbiased and
consistent - these properties do not depend on the error variance,
and so heteroskedasticity is irrelevant.
▶ However, the OLS estimator is no longer efficient i.e. it is no longer
the estimator (linear or otherwise) with the minimum variance.
▶ Intuitively, by using information about the form of heteroskedasticity
in the errors (if it were available), then we could derive a more
efficient estimator.
▶ Statistical inference: the standard t-tests and F-tests are no longer
valid - the test statistics depend on the standard errors of the
coefficients, which in turn depend on σ 2 .
▶ With heteroskedasticity the usual SEs are invalid - true SEs may be
larger or smaller, depending on form of heteroskedasticity.
12 / 64
Dealing with heteroskedasticity
13 / 64
Dealing with heteroskedasticity
▶ What about if the cause/form of heteroskedasticity is unknown?
Here there are two common strategies.
14 / 64
Dealing with heteroskedasticity
▶ To use White’s heteroskedasticity robust SEs in EViews, you need to
manually select them from the estimation options - the EViews
default is the standard OLS SEs.
▶ From the Equation Estimation box, click on the Options tab
and then select Huber-White for the Covariance method option:
15 / 64
Overview
Heteroskedasticity
Autocorrelation
Measurement error
Autocorrelation
16 / 64
Testing for autocorrelation - graphical checks
+
ût
ût
– +
û t–1
time
– –
17 / 64
Testing for autocorrelation - graphical checks
+
ût
ût
– +
û t–1
time
– –
18 / 64
Testing for autocorrelation - graphical checks
+
ût
ût
+
– +
û t–1
time
– –
19 / 64
Testing for autocorrelation - Durbin Watson test
▶ Graphical checks can be useful, but as always they can be imprecise
and/or inconclusive and so various formal statistical tests for
autocorrelation were developed
ut = ρut−1 + vt
H0 : ρ = 0 and H1 : ρ ̸= 0
and so under the null, the errors in consecutive time periods are
uncorrelated i.e. no first order autocorrelation. The alternative
implies the presence of first order autocorrelation.
20 / 64
Testing for autocorrelation - Durbin Watson test
▶ We can test this null from the residuals of the original model
without having to estimate the auxiliary model above.
▶ Specifically, the DW test statistic is calculated as:
T
X 2
(ût − ût−1 )
t=2
DW = T
X
ût2
t=2
▶ The above form of the DW statistic is not very intuitive, but it can
be shown (see Section 5.5.3 of Brooks) that as T grows, the DW
test statistic satisfies the approximation:
cov(ût , ût−1 )
DW ≈ 2 1 − = 2 (1 − corr(ût , ût−1 ))
var(ût )
21 / 64
Testing for autocorrelation - Durbin Watson test
DW ≈ 2 (1 − corr(ût , ût−1 ))
we can see that there are three possibilities for the DW statistic,
depending on the autocorrelation in the errors:
1. The null of no first order autocorrelation =⇒ corr(ût , ût−1 ) = 0
=⇒ DW = 2.
2. Under the alternative, positive first order autocorrelation =⇒
1 ≥ corr(ût , ût−1 ) > 0 =⇒ 2 > DW ≥ 0.
3. Under the alternative, negative first order autocorrelation =⇒
0 > corr(ût , ût−1 ) ≥ −1 =⇒ 4 > DW ≥ 2.
22 / 64
Testing for autocorrelation - Durbin Watson test
▶ However, the DW test statistic does not follow a standard statistical
distribution - instead, it has two critical values: an upper CV,
denoted dL , and a lower CV, denoted dL .
▶ We also have regions in which the test outcome is inconclusive and
we cannot reject or fail to reject the null.
23 / 64
Testing for autocorrelation - Durbin Watson test
24 / 64
Testing for autocorrelation - Breusch-Godfrey test
▶ The DW test has several limitations - see Brooks for a full list, but
the most important from a practical perspective are:
▶ DW only tests for first order autocorrelation, but in reality AC may
be higher order too e.g. may have corr(ût , ût−1 ) = 0 (no first order
AC), but corr(ût , ût−2 ) ̸= 0 (2nd order AC).
▶ Test outcome may be inconclusive.
▶ There cannot be any lags of the dependent variable in the model -
rules out AR and ARDL models, which we will see later on.
25 / 64
Testing for autocorrelation - Breusch-Godfrey test
▶ The null and alternative hypotheses are:
H0 : ρ1 = · · · = ρr = 0 (no AC)
H1 : at least one ρj ̸= 0 (AC)
▶ Test user must choose value of r , but data frequency can often
provide a guide e.g. r = 4 for quarterly data.
▶ The BG test is carried out as follows:
1. Estimate the original linear regression using OLS and obtain the
residuals, ût .
2. Regress ût on all of the regressors from stage 1 (the xs) plus ût−1 ,
ût−2 , . . . , ût−r
Obtain R 2 from this regression.
3. It can be shown that under the null of no autocorrelation:
(T − r )R 2 ∼ χ2r
▶ If the test statistic exceeds the critical value from the statistical
tables, reject the null hypothesis of no autocorrelation.
26 / 64
Testing for autocorrelation - EViews
▶ The value of the DW test statistic is computed automatically by
EViews when estimating any regression model - see below the
regression output under the information criteria:
28 / 64
Consequences of ignoring autocorrelation
▶ If the errors are autocorrelated, but we ignore this fact then the
consequences are similar to those we saw for previously
heteroskedastic errors.
▶ The coefficient estimates derived using OLS are still unbiased and
consistent, since these properties do not depend on the lack of
autocorrelation.
▶ However, they are no longer efficient i.e. they do not have lowest
variance out of the class of linear estimaters (they are not BLUE),
even in large sample sizes.
29 / 64
Dealing with autocorrelation
30 / 64
Dealing with autocorrelation
▶ As with heteroskedasticity, we could also use modified standard
errors that are valid in the presence of autocorrelation.
▶ The White SEs we saw previously only allow for heteroskedastic
errors, but would not be appropriate for autocorrelated errors.
▶ Unlike White’s SEs, the NW HAC standard errors require the user to
select the number of lagged residuals to evaluate the autocorrelation.
▶ Software such as EViews will automatically select this for you based
on the sample size.
31 / 64
Dealing with autocorrelation
▶ NW standard errors can be computed easily in EViews in a similar
way to White’s heteroskedasticity robust SEs we saw previously.
▶ From the Equation Estimation box, click on the Options tab and
then select HAC (Newey-West) for the Covariance method option:
32 / 64
Overview
Heteroskedasticity
Autocorrelation
Measurement error
Incorrect Functional Form
▶ In the first half of the module, you saw different functional forms
that were all still linear in the parameters e.g. log-log.
▶ Each implies a different relationship between the dependent variable
and explanatory variable(s), but financial or economic theory will
often not suggest a unique ‘correct’ functional form to describe a
given relationship of interest.
▶ Although there may not be one unique functional form that is always
‘correct’ for modelling a specific relationship between variables, there
will usually be some functional forms that are incorrect or unsuitable.
▶ Therefore, it is important to know what problems will be created if
we use an incorrect functional form for our regression model.
▶ The short answer is that the coefficient estimators will be biased and
inconsistent and the standard t-tests and F-tests will be invalid.
33 / 64
Incorrect Functional Form
▶ To discuss the problem of choosing an incorrect functional form we
will use the sample of data plotted below containing 50 observations
for X and Y :
28
26
24
22
Y
20
18
16
14
0 10 20 30 40 50 60 70 80 90 100 110
X
34 / 64
Incorrect Functional Form
▶ To ensure we know what the true functional form is, these data were
artificially generated and the true relationship between X and Y is
correctly described by the following regression model:
yt = β0 + β1 ln xt + ut
35 / 64
Incorrect Functional Form
▶ Plots of estimated (incorrect) linear and (correct) lin-log models:
28
Linear Model
26 Lin-log Model
24
22
Y
20
18
16
14
0 10 20 30 40 50 60 70 80 90 100 110
X
36 / 64
Incorrect Functional Form
▶ As expected, the incorrect linear functional form fits the data worse
than the correct linear-log functional form
▶ Looking at the previous graph, the predicted values of y for the
linear model differ quite substantially from the true values
▶ In addition, the incorrect linear functional form implies that the
predicted change in y for a one unit increase in x is always the same
▶ However, the true effect on y of an increase in x varies for different
values of x, because the slope of the linear-log model form is not
constant
▶ It is obvious therefore that the estimated effect of x on y is not a
reliable estimate of the true effect - as we said before, the coefficient
estimator will be biased (and inconsistent), so this is not surprising.
▶ Essentially, the inappropriate functional form means that the errors
are correlated with the explanatory variable(s) i.e. cov(ut ,xt ) ̸= 0.
37 / 64
Detecting Incorrect Functional Form: Residual Plots
▶ One possible method for detecting incorrect functional form is to use
residual plots in which we plot the fitted values Ybi against the
residuals ûi .
▶ Incorrect functional form will often lead to patterns in the residual
values, which can be visible on such plots - e.g. for the previous
incorrect linear functional form:
4
2
Residuals
-1
-2
16 18 20 22 24 26
Fitted Values for Y 38 / 64
Detecting Incorrect Functional Form: Residual Plots
▶ Like all graphical checks, residual plots are informal and may be
inconclusive and/or subjective.
39 / 64
Detecting Incorrect Functional Form: RESET
Yt = β0 + β1 X1,t + . . . + βk Xk,t + ut
40 / 64
Detecting Incorrect Functional Form: RESET
▶ Instead, RESET uses the fact that the powers of the fitted values Yb ,
such as Yb 2 , Yb 3 etc. are nonlinear functions of the original
explanatory variables X1 , X2 , . . . Xk
▶ It then uses these powers of the fitted values as additional
explanatory variables and tests to see if they are statistically
significant
41 / 64
Detecting Incorrect Functional Form: RESET
▶ If the original model was correctly specified then the true values of
α1 and α2 should be zero in the new model.
▶ Therefore, we can use the F-test to test the null hypothesis
H0 : α1 = α2 = 0, which corresponds to no specification error
42 / 64
Some Important Points to Note About RESET
▶ If the test outcome for RESET implies that there is functional form
misspecification, RESET does not provide any guidance about what
the true functional form might be
▶ In this case, we can test different possible functional forms (selected
based on theory, intuition, etc.) until we hopefully find one that
passes RESET
▶ It is also possible for more than one different functional form to pass
RESET - in this case, one option is to select the model with the most
statistically significant RESET F-test (equivalently lowest p-value)
▶ Note that RESET can also be used to choose between models with
different dependent variable forms e.g. between a log-log model with
ln Y and a linear model with Y )
43 / 64
Overview
Heteroskedasticity
Autocorrelation
Measurement error
Omitting relevant or including irrelevant variables
Omission of a relevant variable
▶ By relevant we mean the variable has a systematic and significant
effect on the dependent variable.
▶ The effects of any excluded variables are contained in the error term.
If the variable is relevant, it is likely that it will be correlated with at
least some of the included explanatory variables.
▶ In this case, cov(ut ,xjt ) ̸= 0 for some j and the estimated
coefficients on all the explanatory variables will be biased and
inconsistent - often known as omitted variables bias (OVB).
▶ The standard errors will also be biased and so standard statistical
tests will be invalid.
44 / 64
Omitting relevant or including irrelevant variables
45 / 64
Testing for Omitted Variables: Residual Plots
Some examples of residual plots from correctly specified models:
800
600
400
Residuals
200
-200
-400
-600
-1000 -500 0 500 1000 1500 2000 2500 3000
Fitted Values for Y
300
200
100
Residuals
-100
-200
-300
-400
-200 0 200 400 600 800 1000 1200
Fitted Values for Y
46 / 64
Testing for Omitted Variables: Residual Plots
Some examples of residual plots from incorrectly specified models:
25
20
15
Residuals 10
-5
-10
-15
-20
-500 -400 -300 -200 -100 0 100 200 300 400
Fitted Values for Y
100
50
0
Residuals
-50
-100
-150
-200
-250
-5 0 5 10 15 20 25 30
Fitted Values for Y
47 / 64
Testing for Omitted Variables
▶ Often the best approach is to compare the results obtained from the
model to what would be predicted by relevant financial or economic
theory.
▶ If the results from the model are inconsistent with those implied by
theory, this could be because something is wrong with the model we
have used - omitted variables could be one reason.
▶ For example, this may result in estimated coefficients with the
opposite sign to that implied by theory, or variables that are
theoretically important having statistically insignificant coefficients.
48 / 64
Omission of Relevant Variables: Solutions
49 / 64
Omission of Relevant Variables: Solutions
▶ However, this ideal solution can only be used if we know what the
omitted variables are, and can obtain data for them.
▶ Generally the reason a variable was omitted was either lack of
information (not knowing the variable was relevant) or a lack of data
for the variable.
▶ If we cannot obtain data, then we can instead try to identify one or
more suitable control variables that we can obtain data for.
▶ The key requirement for a control variable is that it must be
correlated with the omitted variable (although it may or may not
have a direct effect on the dependent variable)
▶ Including suitable control variables as explanatory variables will
reduce the correlation between the error term and the explanatory
variables and therefore reduce or eliminate the omitted variable bias
51 / 64
Omitted Variables: An Example
52 / 64
Omitted Variables: An Example
▶ Suppose now that we omitted the UK interest rate from our model:
fwdisct = β0 + β2 US3mt−1 + ut
53 / 64
Omitted Variables: An Example
54 / 64
Omitted Variables: An Example
55 / 64
Omitted Variables: An Example
Below is the residual plot (using fitted values of Y ) for the first model
that includes both UK 3m and US3m:
5
2
Residuals
-1
-2
-3
-4
-8 -6 -4 -2 0 2 4 6
Fitted Values for Y
56 / 64
Omitted Variables: An Example
Here is the residual plot (using fitted values of Y ) for the second model
that omits UK 3m:
6
2
Residuals
-2
-4
-6
-1.5 -1.4 -1.3 -1.2 -1.1 -1 -0.9 -0.8 -0.7 -0.6 -0.5
Fitted Values for Y
57 / 64
Omitted Variables: An Example
▶ Finally It is important to note too that the model that includes both
UK 3m and US3m may still omit other relevant variables
▶ As we discuss next week, the model may also have forms of
misspecification, such as incorrect functional form that we need to
check for
▶ Therefore, whenever we are interpreting regression results we should
always be considering and checking for a range of different forms of
specification error
58 / 64
Overview
Heteroskedasticity
Autocorrelation
Measurement error
Measurement error
▶ Often financial and economic data are measured with some error
and so we do not observe the true values of the variables.
▶ This is known as measurement error or errors-in-variables and
can occur in a variety of circumstances, e.g.
▶ Macroeconomic variables are almost always estimated quantities
(GDP, inflation, and so on), as is most information contained in
company accounts.
▶ Sometimes we cannot observe or obtain data on a variable we require
and so we need to use a proxy variable - for instance, many models
include expected. quantities (e.g., expected inflation) but we cannot
typically measure expectations.
▶ In survey data, respondents may intentionally or unintentionally give
incorrect or incomplete responses.
59 / 64
Measurement error in the explanatory variable(s)
▶ Suppose that we wish to estimate a model containing just one
explanatory variable, xt :
yt = β0 + β1 xt + ut
x̃t = xt + vt
▶ Taking the first equation and substituting in for xt from the second:
yt = β0 + β1 (x̃t − vt ) + ut
▶ We can rewrite this equation by separately expressing the composite
error term, (ut − β1 vt )
yt = β0 + β1 x̃t + (ut − β1 vt )
60 / 64
Measurement error in the explanatory variable(s)
▶ It is clear from this equation and the definition of x̃t , that x̃t and the
composite error term, (ut − β2 vt ), are correlated since both depend
on the measurement error vt .
▶ Therefore, the requirement that the explanatory variables are
non-stochastic does not hold, causing the OLS estimator for the
coefficients to be biased and inconsistent.
61 / 64
Measurement error in the dependent variable
▶ What about the case where all explanatory variables are measured
correctly, but the dependent variable Y is measured with error?
▶ In this case the effects are different from measurement error in the
explanatory variable(s) and are usually less serious.
▶ Using the same notation as before, let’s assume that we cannot
measure and record Y exactly, but instead measure Ỹ .
▶ Therefore, instead of estimating the true model:
Yi = β0 + β1 Xi + ui
we estimate:
Ỹi = β0 + β1 Xi + vi
62 / 64
Measurement error in the dependent variable
63 / 64
Solutions to measurement error
64 / 64