[go: up one dir, main page]

File: Rcode-4-1.R

package info (click to toggle)
urca 1.3-0-1
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 2,400 kB
  • ctags: 26
  • sloc: fortran: 501; makefile: 1
file content (9 lines) | stat: -rwxr-xr-x 199 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
library(lmtest)
set.seed(123456)
e1 <- rnorm(500)
e2 <- rnorm(500)
trd <- 1:500
y1 <- 0.8*trd + cumsum(e1)
y2 <- 0.6*trd + cumsum(e2)
sr.reg <- lm(y1 ~ y2)
sr.dw <- dwtest(sr.reg)$statistic