[go: up one dir, main page]

File: Rcode-4-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 (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