File: sw_ch12.inp

package info (click to toggle)
gretl 2022c-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 59,552 kB
  • sloc: ansic: 409,074; sh: 4,449; makefile: 3,222; cpp: 2,777; xml: 599; perl: 364
file content (35 lines) | stat: -rw-r--r-- 812 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Reproduce some of the time-series material in Stock and Watson,
# "Introduction to Econometrics", 1e, chapter 12
open sw_ch12.gdt

# S & W use White's standard errors in this chapter,
# not HAC.
set force_hc on
set hc_version 1

# generate inflation rate
series infl = 400 * log(PUNEW/PUNEW(-1))
diff infl 
lags d_infl LHUR
smpl 1962:1 1999:4

# equation 12.7
ols d_infl 0 d_infl_1 --robust

# equation 12.13
ols d_infl 0 d_infl(-1 to -4) --robust

# F-test following 12.13  
omit d_infl_2 d_infl_3 d_infl_4 --test-only

# equation 12.16
ols d_infl 0 d_infl(-1 to -4) LHUR_1 --robust

# equation 12.17
ols d_infl 0 d_infl(-1 to -4) LHUR(-1 to -4) --robust

# ADF regression, equation 12.34
series infl_1 = infl(-1)
ols d_infl 0 infl_1 d_infl(-1 to -4)
scalar adft = $coeff(infl_1) / $stderr(infl_1)
print adft