Professional Documents
Culture Documents
Dean Fantazzini
University of Pavia
Overview of the Lecture
Econometrics I: OLS
Dean Fantazzini 2
Overview of the Lecture
Econometrics I: OLS
Dean Fantazzini 2-a
Overview of the Lecture
Econometrics I: OLS
Dean Fantazzini 2-b
EViews Session I: Convergence in the Solow Model
Variable Definition
gdp60 GDP per capita in real terms in 1960
gdp85 GDP per capita in real terms in 1985
pop60 Population in millions in 1960
pop85 Population in millions in 1985
inv Average from 1960 to 1985 of the ratio of
real domestic investment to real GDP
geetot Average from 1970 to 1985 of the ratio of
nominal government expenditure on education to nominal GDP
oecd Dummy for OECD member
Econometrics I: OLS
Dean Fantazzini 3
EViews Session I: Convergence in the Solow Model
Collected in 1985
Econometrics I: OLS
Dean Fantazzini 4
EViews Session I: Convergence in the Solow Model
b) Sample
The sample is the set of observations to be included in the analysis
Econometrics I: OLS
Dean Fantazzini 5
EViews Session I: Convergence in the Solow Model
Use the GENR button and type l gdp60=log(gdp60), and do the same
for the other series.
Furthermore we need the growth rates of the GDP and the population
(GENR - gr gdp=(l gdp85-l gdp60)/25, GENR -
gr pop=(l pop85-l pop60)/25).
Econometrics I: OLS
Dean Fantazzini 6
EViews Session I: Convergence in the Solow Model
Theory (Solow Model): All countries converge against a steady- state for
the per capita earnings Poor countries grow faster as rich countries (see
also Barro, Sala-i-Matin, Economic growth)
.06
.04
GR_GDP
.02
.00
-.02
-.04
-2 -1 0 1 2 3
L_GDP60
LS GR GDP c L GDP60
Econometrics I: OLS
Dean Fantazzini 8
EViews Session I: Convergence in the Solow Model
smpl if OECD=1
Econometrics I: OLS
Dean Fantazzini 9
EViews Session I: Convergence in the Solow Model
Econometrics I: OLS
Dean Fantazzini 10
EViews Session II: Estimating a money demand equation
Some Premises...
Detection of Heteroscedasticity:
Residual Plot;
White Test;
Breusch - Pagan test;
Detection of Autocorrelation:
Residual Plot;
Durbin-Watson test (... remember that X have to be deterministic);
d=2 no autoc., d<2 positive autoc., d>2 negative
autocor.
Breusch - Godfrey test
1. OLS to get the residuals et
2. et = 1 et1 + . . . + p etp + xt + t
3. H0 = n R2 2p
Econometrics I: OLS
Dean Fantazzini 11
EViews Session II: Estimating a money demand equation
Econometrics I: OLS
Dean Fantazzini 12
EViews Session II: Estimating a money demand equation
Variable Description
bondr bondrate
gdp GDP (real, seasonally adjusted)
m3 M3 (seasonally adjusted)
monrat money market interest rate
Econometrics I: OLS
Dean Fantazzini 13
EViews Session II: Estimating a money demand equation
c) ... and estimate the following equation (you take into account the
transaction demand):
l_m3 = 0 + 1 l_gdp + .
Save it as eq1.
d) Has 1 the sign you expected? Interpret.
Econometrics I: OLS
Dean Fantazzini 14
EViews Session II: Estimating a money demand equation
e) Now you consider the speculation demand as well and estimate the
following equation:
Save it as eq2.
f) Have the coefficients the signs you expected? How do you interpret 1 ,
2 and 3 ?
g) Now look at the residual plot. (View -> Actual, Fitted, Residual
-> Residual Graph). Do you find evidence of the presence of
heteroscedasticity and/or autocorrelation?
Econometrics I: OLS
Dean Fantazzini 15
EViews Session II: Estimating a money demand equation
Econometrics I: OLS
Dean Fantazzini 16
EViews Session II: Estimating a money demand equation
Econometrics I: OLS
Dean Fantazzini 17
EViews Session II: Estimating a money demand equation
Econometrics I: OLS
Dean Fantazzini 18
EViews Session III: Monte Carlo Simulation
2. Simulate a draw from the data and estimate the model using the
simulated data.
3. Repeat step 2 many times, each time storing the results of interest.
4. The end result is a series of estimation results, one for each repetition
of step 2. We can then characterize the empirical distribution of these
results by tabulating the sample moments or by plotting the
histogram or kernel density estimate.
Econometrics I: OLS
Dean Fantazzini 19
EViews Session III: Monte Carlo Simulation
The step that requires a little thinking is how to store the results from
each repetition (step 3). There are two methods that you can use in
EViews:
1. Storing results in a series;
2. Storing results in a matrix.
Econometrics I: OLS
Dean Fantazzini 20
EViews Session III: Monte Carlo Simulation
Moreover, the length of the series will be constrained by the size of your
workfile sample: for example, if you wish to perform 1000 replications on a
workfile with 100 observations, you will not be able to store all 1000 results
in a series since the latter only has 100 observations.
Econometrics I: OLS
Dean Fantazzini 21
EViews Session III: Monte Carlo Simulation
Econometrics I: OLS
Dean Fantazzini 22
EViews Session III: Monte Carlo Simulation
Refer to the 10 X values of Table 3.2 (which are: 80, 100, 120, 140, 160,
180, 200, 220, 240, 260). Let Beta(1) = 2.5 and Beta(2) = 0.5. Assume
that the errors are distributed N(0, 9), that is, the errors are normally
distributed with mean 0 and variance 9. Generate 100 samples using these
values, obtaining 100 estimates of Beta(1) and Beta(2). Graph these
estimates. What conclusions can you draw from the Monte Carlo study?
Econometrics I: OLS
Dean Fantazzini 23
EViews Session III: Monte Carlo Simulation
Econometrics I: OLS
Dean Fantazzini 24
EViews Session III: Monte Carlo Simulation
begin loop
for !i = 1 to !reps
set sample to estimation sample
smpl 1 10
simulate y data (only for 10 obs)
series y = !beta1 + !beta2*x + 3*nrnd
regress y on a constant and x
equation eq1.ls y c x
set sample to one observation
smpl !i !i
and store each coefficient estimate in a series
series b1 = eq1.@coefs(1)
series b2 = eq1.@coefs(2)
next
end of loop
Econometrics I: OLS
Dean Fantazzini 25
EViews Session III: Monte Carlo Simulation
Econometrics I: OLS
Dean Fantazzini 26
EViews Session III: Monte Carlo Simulation
Econometrics I: OLS
Dean Fantazzini 27
EViews Session III: Monte Carlo Simulation
begin loop
for !i = 1 to !reps
simulate y data
series y = 2.5 + 0.5*x + 3*nrnd
regress y on a constant and x
equation eq1.ls y c x
store each coefficient estimate in matrix
beta(!i,1) = eq1.@coefs(1) column 1 is intercept
beta(!i,2) = eq1.@coefs(2) column 2 is slope
next
end of loop
show descriptive stats of coef distribution
beta.stats
Econometrics I: OLS
Dean Fantazzini 28