[go: up one dir, main page]

File: Rcode-7-1.R

package info (click to toggle)
urca 1.3-3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,432 kB
  • sloc: fortran: 501; ansic: 15; makefile: 2
file content (27 lines) | stat: -rwxr-xr-x 1,032 bytes parent folder | download | duplicates (7)
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
library(tseries)
library(urca)
data(Raotbl3)
attach(Raotbl3)
lc <- ts(lc, start=c(1966,4), end=c(1991,2),
         frequency=4)
li <- ts(li, start=c(1966,4), end=c(1991,2),
         frequency=4)
lw <- ts(lw, start=c(1966,4), end=c(1991,2),
         frequency=4)
ukcons <- window(cbind(lc, li, lw), start=c(1967, 2),
                 end=c(1991,2))
lc.eq <- summary(lm(lc ~ li + lw, data=ukcons))
li.eq <- summary(lm(li ~ lc + lw, data=ukcons))
lw.eq <- summary(lm(lw ~ li + lc, data=ukcons))
error.lc <- ts(resid(lc.eq), start=c(1967,2),
               end=c(1991,2), frequency=4)
error.li <- ts(resid(li.eq), start=c(1967,2),
               end=c(1991,2), frequency=4)
error.lw <- ts(resid(lw.eq), start=c(1967,2),
               end=c(1991,2), frequency=4)
ci.lc <- ur.df(error.lc, lags=1, type='none')
ci.li <- ur.df(error.li, lags=1, type='none')
ci.lw <- ur.df(error.lw, lags=1, type='none')
jb.lc <- jarque.bera.test(error.lc)
jb.li <- jarque.bera.test(error.li)
jb.lw <- jarque.bera.test(error.lw)