You are on page 1of 16

Introduction to Econometrics - (Gretl Lab 1)

Roberto Casarin
Ca Foscari Summer School

Venice, July 4, 2012

Roberto Casarin

Introduction to Econometrics - (Gretl Lab 1)

Introduction
Diagnostic Tests
We discussed the assumptions of the OLS model and the properties
of the OLS estimator under these assumptions. In the following we
will show how to test whether or not the OLS residuals of a given
model and dataset are coherent with assumptions.

Disturbance distribution and Normality Test (test JB)

Heterosckedasticity tests (Goldfeld-Quandt, Breusch-Pagan,


White, ARCH-LM)

Autocorrelation tests (Breusch-Godfrey, Durbin-Watson,


Box-Pierce, Lijung-Box)

Specification and functional form tests (AIC, BIC, RESET)

Stability tests (Chow, CUSUM)

Roberto Casarin

Introduction to Econometrics - (Gretl Lab 1)

Outline

Properties of the OLS residual

Stock Market return (Jarque-Bera)

Bank Wage data (Orthogonality)

Roberto Casarin

Introduction to Econometrics - (Gretl Lab 1)

Stock Market return

Monthly excess returns in the UK over the period January 1980 to


December 1999. Source: DataStream.

yt , excess returns on an index of stocks in sector of cyclical


consumer goods. The index is composed on the basis of 104
firms in the areas of household durables, automobiles, textiles,
and sports. The consumption of these goods is relatively
sensitive to economic fluctuations, for which reason they are
said to be cyclical.

xt , corresponds to the excess returns on an overall stock


market index. The index t denotes the observations from 1
(1980.01) to 240 (1999.12).

Roberto Casarin

Introduction to Econometrics - (Gretl Lab 1)

Stock Market return


RENDNCCO versus RENDMARK (with least squares fit)
20

Y = 0.198 + 0.932X

15
10

RENDNCCO

5
0
-5
-10
-15
-20
-25
-30
-25

-20

-15

Roberto Casarin

-10
-5
RENDMARK

10

Introduction to Econometrics - (Gretl Lab 1)

Stock Market return


0.3

Relative frequency

0.25

0.2

0.15

0.1

0.05

0
-30

-25

-20

-15

Roberto Casarin

-10
-5
RENDMARK

10

Introduction to Econometrics - (Gretl Lab 1)

15

Stock Market return

0.3

Relative frequency

0.25

0.2

0.15

0.1

0.05

0
-30

-20

Roberto Casarin

-10
0
RENDNCCO

10

Introduction to Econometrics - (Gretl Lab 1)

20

Jarque-Bera test on normality

In many situations it is of interest to test the assumption of


normality. For example a normality test is needed when choosing a
statistical model (distribution) for the data. Another example is
the assumption of normality of the error term in the OLS model.
This assumption affects the distribution of the test statistics. More
specifically let
yt = 1 + 2 xt + t
(1)
be the linear model of interest with E(t ) = 0, E(2t ) = 2 and
E(t s ) = 0 for s 6= t. We can test the normality assumption by
using the OLS residuals: ut = yt 1 2 xt .

Roberto Casarin

Introduction to Econometrics - (Gretl Lab 1)

Jarque-Bera test on normality


In particular, we can compare the sample moments of the residuals
with the theoretical moments of the disturbances under the null
hypothesis of the normal distribution.
E(4t )
E(3t )
=
0,
K
=
=3
E(3t ) = 0, E(4t ) = 3 4 , S =
3
4
!
r
2
2
r
6
n
JB =
S
(K 3)
+
n
24


1
1 2
2
S + (K 3) 2 (2)
=n
6
24
Ipotesi nulla: H0 : JB = 0

Roberto Casarin

Introduction to Econometrics - (Gretl Lab 1)

Stock Market return


Model 1: OLS, using observations 1980:011999:12 (T = 240)
Dependent variable: RENDNCCO

const
RENDMARK

Coefficient

Std. Error

t-ratio

p-value

0.197877
0.931537

0.188637
0.0391816

1.0490
23.7748

0.2953
0.0000

Mean dependent var


Sum squared resid
R2
F (1, 238)
Log-likelihood
Schwarz criterion

0.951383
1975.184
0.703701
565.2434
593.4786
1197.918
0.019127

Roberto Casarin

S.D. dependent var


S.E. of regression
Adjusted R 2
P-value(F )
Akaike criterion
HannanQuinn
DurbinWatson

5.281289
2.880814
0.702456
8.41e65
1190.957
1193.762
1.969687

Introduction to Econometrics - (Gretl Lab 1)

Stock Market return

Test for normality of resid1:

Doornik-Hansen test = 44.5845, with p-value 2.08259e-010

Shapiro-Wilk W = 0.965234, with p-value 1.3812e-005

Lilliefors test = 0.0592045, with p-value = 0.04

Jarque-Bera test = 84.1231, with p-value 5.4062e-019

Roberto Casarin

Introduction to Econometrics - (Gretl Lab 1)

Bank Wage
The data consists of a cross section of 474 individuals working for
a US bank. For each employee, the information consists of the
following variables: salary, education, begin salary, gender (0:
male, 1: females), minority (1: minority group, 0:otherwise), job
category and some further job related variables.
The scatter diagrams show the bivariate relations between
variables: LOGSAL (log of yearly salary in dollar), EDUC (finished
years of education), LOGSALBEGIN (log of yearly salary when
employee entered the firm) and GENDER (0: females, 1: males)
for 474 US bank employs.
Scatter diagrams: simple regressions may be misldeadinig as the
explanatory variables are mutually related. For example the
GENDER effect on salary is partially caused by the GENDER effect
on EDUC. Multiple regression accounts for this mutual
dependence.
Roberto Casarin

Introduction to Econometrics - (Gretl Lab 1)

Bank Wage
0.3

Relative frequency

0.25

0.2

0.15

0.1

0.05

0
20000

40000

60000

Roberto Casarin

80000
SALARY

100000

120000

Introduction to Econometrics - (Gretl Lab 1)

140000

Bank Wage

yi = 1 + 2 x2i + 2 x3i + i
yi : log of the salary
x2i : education
x3i : log of begin salary
con i = 1, . . . , n.

Roberto Casarin

Introduction to Econometrics - (Gretl Lab 1)

(2)

Bank Wage
Model 2: OLS, using observations 1474
Dependent variable: LOGSAL

const
LOGSALBEGIN
EDUC

Coefficient

Std. Error

t-ratio

p-value

1.64692
0.868505
0.0231223

0.274598
0.0318346
0.00389364

5.9976
27.2817
5.9385

0.0000
0.0000
0.0000

Mean dependent var


Sum squared resid
R2
F (2, 471)
Log-likelihood
Schwarz criterion

10.35679
14.89166
0.800579
945.4206
147.5393
276.5950

Roberto Casarin

S.D. dependent var


S.E. of regression
Adjusted R 2
P-value(F )
Akaike criterion
HannanQuinn

0.397334
0.177812
0.799733
1.2e165
289.0786
284.1690

Introduction to Econometrics - (Gretl Lab 1)

Bank Wage
The interpretation of the estimates is as follows. The marginal
relative effect of education x2 on wage S is
log S
1 S
=
= 2
S x2
x2

(3)

that is estimated now as 0.023. That is an additional year of


education corresponds on average with a 2.3 per cent increase in
salary (if the begin salary is kept fixed).
Residual Sum of Square (RSS) = 14.89
TSS = RSS/(1 R 2 ) = 74.67 thus the
ESS = TSS RSS = 59.78
Regressing the residuals on xt gives a R 2 = 0 (orthogonality)

Roberto Casarin

Introduction to Econometrics - (Gretl Lab 1)

You might also like