R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(95.43
+ ,0
+ ,104.48
+ ,103.84
+ ,100.01
+ ,104.80
+ ,0
+ ,95.43
+ ,104.48
+ ,103.84
+ ,108.64
+ ,0
+ ,104.80
+ ,95.43
+ ,104.48
+ ,105.65
+ ,0
+ ,108.64
+ ,104.80
+ ,95.43
+ ,108.42
+ ,0
+ ,105.65
+ ,108.64
+ ,104.80
+ ,115.35
+ ,0
+ ,108.42
+ ,105.65
+ ,108.64
+ ,113.64
+ ,0
+ ,115.35
+ ,108.42
+ ,105.65
+ ,115.24
+ ,0
+ ,113.64
+ ,115.35
+ ,108.42
+ ,100.33
+ ,0
+ ,115.24
+ ,113.64
+ ,115.35
+ ,101.29
+ ,0
+ ,100.33
+ ,115.24
+ ,113.64
+ ,104.48
+ ,0
+ ,101.29
+ ,100.33
+ ,115.24
+ ,99.26
+ ,0
+ ,104.48
+ ,101.29
+ ,100.33
+ ,100.11
+ ,0
+ ,99.26
+ ,104.48
+ ,101.29
+ ,103.52
+ ,0
+ ,100.11
+ ,99.26
+ ,104.48
+ ,101.18
+ ,0
+ ,103.52
+ ,100.11
+ ,99.26
+ ,96.39
+ ,0
+ ,101.18
+ ,103.52
+ ,100.11
+ ,97.56
+ ,0
+ ,96.39
+ ,101.18
+ ,103.52
+ ,96.39
+ ,0
+ ,97.56
+ ,96.39
+ ,101.18
+ ,85.10
+ ,0
+ ,96.39
+ ,97.56
+ ,96.39
+ ,79.77
+ ,0
+ ,85.10
+ ,96.39
+ ,97.56
+ ,79.13
+ ,0
+ ,79.77
+ ,85.10
+ ,96.39
+ ,80.84
+ ,0
+ ,79.13
+ ,79.77
+ ,85.10
+ ,82.75
+ ,0
+ ,80.84
+ ,79.13
+ ,79.77
+ ,92.55
+ ,0
+ ,82.75
+ ,80.84
+ ,79.13
+ ,96.60
+ ,0
+ ,92.55
+ ,82.75
+ ,80.84
+ ,96.92
+ ,0
+ ,96.60
+ ,92.55
+ ,82.75
+ ,95.32
+ ,0
+ ,96.92
+ ,96.60
+ ,92.55
+ ,98.52
+ ,0
+ ,95.32
+ ,96.92
+ ,96.60
+ ,100.22
+ ,0
+ ,98.52
+ ,95.32
+ ,96.92
+ ,104.91
+ ,0
+ ,100.22
+ ,98.52
+ ,95.32
+ ,103.10
+ ,0
+ ,104.91
+ ,100.22
+ ,98.52
+ ,97.13
+ ,0
+ ,103.10
+ ,104.91
+ ,100.22
+ ,103.42
+ ,0
+ ,97.13
+ ,103.10
+ ,104.91
+ ,111.72
+ ,0
+ ,103.42
+ ,97.13
+ ,103.10
+ ,118.11
+ ,0
+ ,111.72
+ ,103.42
+ ,97.13
+ ,111.62
+ ,0
+ ,118.11
+ ,111.72
+ ,103.42
+ ,100.22
+ ,0
+ ,111.62
+ ,118.11
+ ,111.72
+ ,102.03
+ ,0
+ ,100.22
+ ,111.62
+ ,118.11
+ ,105.76
+ ,0
+ ,102.03
+ ,100.22
+ ,111.62
+ ,107.68
+ ,0
+ ,105.76
+ ,102.03
+ ,100.22
+ ,110.77
+ ,0
+ ,107.68
+ ,105.76
+ ,102.03
+ ,105.44
+ ,0
+ ,110.77
+ ,107.68
+ ,105.76
+ ,112.26
+ ,0
+ ,105.44
+ ,110.77
+ ,107.68
+ ,114.07
+ ,0
+ ,112.26
+ ,105.44
+ ,110.77
+ ,117.90
+ ,0
+ ,114.07
+ ,112.26
+ ,105.44
+ ,124.72
+ ,0
+ ,117.90
+ ,114.07
+ ,112.26
+ ,126.42
+ ,0
+ ,124.72
+ ,117.90
+ ,114.07
+ ,134.73
+ ,0
+ ,126.42
+ ,124.72
+ ,117.90
+ ,135.79
+ ,0
+ ,134.73
+ ,126.42
+ ,124.72
+ ,143.36
+ ,0
+ ,135.79
+ ,134.73
+ ,126.42
+ ,140.37
+ ,0
+ ,143.36
+ ,135.79
+ ,134.73
+ ,144.74
+ ,0
+ ,140.37
+ ,143.36
+ ,135.79
+ ,151.98
+ ,0
+ ,144.74
+ ,140.37
+ ,143.36
+ ,150.92
+ ,0
+ ,151.98
+ ,144.74
+ ,140.37
+ ,163.38
+ ,0
+ ,150.92
+ ,151.98
+ ,144.74
+ ,154.43
+ ,0
+ ,163.38
+ ,150.92
+ ,151.98
+ ,146.66
+ ,0
+ ,154.43
+ ,163.38
+ ,150.92
+ ,157.95
+ ,0
+ ,146.66
+ ,154.43
+ ,163.38
+ ,162.10
+ ,0
+ ,157.95
+ ,146.66
+ ,154.43
+ ,180.42
+ ,0
+ ,162.10
+ ,157.95
+ ,146.66
+ ,179.57
+ ,0
+ ,180.42
+ ,162.10
+ ,157.95
+ ,171.58
+ ,0
+ ,179.57
+ ,180.42
+ ,162.10
+ ,185.43
+ ,0
+ ,171.58
+ ,179.57
+ ,180.42
+ ,190.64
+ ,0
+ ,185.43
+ ,171.58
+ ,179.57
+ ,203.00
+ ,0
+ ,190.64
+ ,185.43
+ ,171.58
+ ,202.36
+ ,0
+ ,203.00
+ ,190.64
+ ,185.43
+ ,193.41
+ ,0
+ ,202.36
+ ,203.00
+ ,190.64
+ ,186.17
+ ,0
+ ,193.41
+ ,202.36
+ ,203.00
+ ,192.24
+ ,0
+ ,186.17
+ ,193.41
+ ,202.36
+ ,209.60
+ ,0
+ ,192.24
+ ,186.17
+ ,193.41
+ ,206.41
+ ,0
+ ,209.60
+ ,192.24
+ ,186.17
+ ,209.82
+ ,0
+ ,206.41
+ ,209.60
+ ,192.24
+ ,230.37
+ ,0
+ ,209.82
+ ,206.41
+ ,209.60
+ ,235.80
+ ,0
+ ,230.37
+ ,209.82
+ ,206.41
+ ,232.07
+ ,0
+ ,235.80
+ ,230.37
+ ,209.82
+ ,244.64
+ ,0
+ ,232.07
+ ,235.80
+ ,230.37
+ ,242.19
+ ,0
+ ,244.64
+ ,232.07
+ ,235.80
+ ,217.48
+ ,0
+ ,242.19
+ ,244.64
+ ,232.07
+ ,209.39
+ ,0
+ ,217.48
+ ,242.19
+ ,244.64
+ ,211.73
+ ,0
+ ,209.39
+ ,217.48
+ ,242.19
+ ,221.00
+ ,0
+ ,211.73
+ ,209.39
+ ,217.48
+ ,203.11
+ ,0
+ ,221.00
+ ,211.73
+ ,209.39
+ ,214.71
+ ,0
+ ,203.11
+ ,221.00
+ ,211.73
+ ,224.19
+ ,0
+ ,214.71
+ ,203.11
+ ,221.00
+ ,238.04
+ ,0
+ ,224.19
+ ,214.71
+ ,203.11
+ ,238.36
+ ,0
+ ,238.04
+ ,224.19
+ ,214.71
+ ,246.24
+ ,0
+ ,238.36
+ ,238.04
+ ,224.19
+ ,259.87
+ ,0
+ ,246.24
+ ,238.36
+ ,238.04
+ ,249.97
+ ,0
+ ,259.87
+ ,246.24
+ ,238.36
+ ,266.48
+ ,0
+ ,249.97
+ ,259.87
+ ,246.24
+ ,282.98
+ ,0
+ ,266.48
+ ,249.97
+ ,259.87
+ ,306.31
+ ,0
+ ,282.98
+ ,266.48
+ ,249.97
+ ,301.73
+ ,1
+ ,306.31
+ ,282.98
+ ,266.48
+ ,314.62
+ ,1
+ ,301.73
+ ,306.31
+ ,282.98
+ ,332.62
+ ,1
+ ,314.62
+ ,301.73
+ ,306.31
+ ,355.51
+ ,1
+ ,332.62
+ ,314.62
+ ,301.73
+ ,370.32
+ ,1
+ ,355.51
+ ,332.62
+ ,314.62
+ ,408.13
+ ,1
+ ,370.32
+ ,355.51
+ ,332.62
+ ,433.58
+ ,1
+ ,408.13
+ ,370.32
+ ,355.51
+ ,440.51
+ ,1
+ ,433.58
+ ,408.13
+ ,370.32
+ ,386.29
+ ,1
+ ,440.51
+ ,433.58
+ ,408.13
+ ,342.84
+ ,1
+ ,386.29
+ ,440.51
+ ,433.58
+ ,254.97
+ ,1
+ ,342.84
+ ,386.29
+ ,440.51
+ ,203.42
+ ,1
+ ,254.97
+ ,342.84
+ ,386.29
+ ,170.09
+ ,1
+ ,203.42
+ ,254.97
+ ,342.84
+ ,174.03
+ ,1
+ ,170.09
+ ,203.42
+ ,254.97
+ ,167.85
+ ,1
+ ,174.03
+ ,170.09
+ ,203.42
+ ,177.01
+ ,1
+ ,167.85
+ ,174.03
+ ,170.09
+ ,188.19
+ ,1
+ ,177.01
+ ,167.85
+ ,174.03
+ ,211.20
+ ,1
+ ,188.19
+ ,177.01
+ ,167.85
+ ,240.91
+ ,1
+ ,211.20
+ ,188.19
+ ,177.01
+ ,230.26
+ ,1
+ ,240.91
+ ,211.20
+ ,188.19
+ ,251.25
+ ,1
+ ,230.26
+ ,240.91
+ ,211.20
+ ,241.66
+ ,1
+ ,251.25
+ ,230.26
+ ,240.91)
+ ,dim=c(5
+ ,114)
+ ,dimnames=list(c('Y'
+ ,'X'
+ ,'Y1'
+ ,'Y2'
+ ,'Y3')
+ ,1:114))
> y <- array(NA,dim=c(5,114),dimnames=list(c('Y','X','Y1','Y2','Y3'),1:114))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Include Monthly Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Y X Y1 Y2 Y3 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 95.43 0 104.48 103.84 100.01 1 0 0 0 0 0 0 0 0 0 0 1
2 104.80 0 95.43 104.48 103.84 0 1 0 0 0 0 0 0 0 0 0 2
3 108.64 0 104.80 95.43 104.48 0 0 1 0 0 0 0 0 0 0 0 3
4 105.65 0 108.64 104.80 95.43 0 0 0 1 0 0 0 0 0 0 0 4
5 108.42 0 105.65 108.64 104.80 0 0 0 0 1 0 0 0 0 0 0 5
6 115.35 0 108.42 105.65 108.64 0 0 0 0 0 1 0 0 0 0 0 6
7 113.64 0 115.35 108.42 105.65 0 0 0 0 0 0 1 0 0 0 0 7
8 115.24 0 113.64 115.35 108.42 0 0 0 0 0 0 0 1 0 0 0 8
9 100.33 0 115.24 113.64 115.35 0 0 0 0 0 0 0 0 1 0 0 9
10 101.29 0 100.33 115.24 113.64 0 0 0 0 0 0 0 0 0 1 0 10
11 104.48 0 101.29 100.33 115.24 0 0 0 0 0 0 0 0 0 0 1 11
12 99.26 0 104.48 101.29 100.33 0 0 0 0 0 0 0 0 0 0 0 12
13 100.11 0 99.26 104.48 101.29 1 0 0 0 0 0 0 0 0 0 0 13
14 103.52 0 100.11 99.26 104.48 0 1 0 0 0 0 0 0 0 0 0 14
15 101.18 0 103.52 100.11 99.26 0 0 1 0 0 0 0 0 0 0 0 15
16 96.39 0 101.18 103.52 100.11 0 0 0 1 0 0 0 0 0 0 0 16
17 97.56 0 96.39 101.18 103.52 0 0 0 0 1 0 0 0 0 0 0 17
18 96.39 0 97.56 96.39 101.18 0 0 0 0 0 1 0 0 0 0 0 18
19 85.10 0 96.39 97.56 96.39 0 0 0 0 0 0 1 0 0 0 0 19
20 79.77 0 85.10 96.39 97.56 0 0 0 0 0 0 0 1 0 0 0 20
21 79.13 0 79.77 85.10 96.39 0 0 0 0 0 0 0 0 1 0 0 21
22 80.84 0 79.13 79.77 85.10 0 0 0 0 0 0 0 0 0 1 0 22
23 82.75 0 80.84 79.13 79.77 0 0 0 0 0 0 0 0 0 0 1 23
24 92.55 0 82.75 80.84 79.13 0 0 0 0 0 0 0 0 0 0 0 24
25 96.60 0 92.55 82.75 80.84 1 0 0 0 0 0 0 0 0 0 0 25
26 96.92 0 96.60 92.55 82.75 0 1 0 0 0 0 0 0 0 0 0 26
27 95.32 0 96.92 96.60 92.55 0 0 1 0 0 0 0 0 0 0 0 27
28 98.52 0 95.32 96.92 96.60 0 0 0 1 0 0 0 0 0 0 0 28
29 100.22 0 98.52 95.32 96.92 0 0 0 0 1 0 0 0 0 0 0 29
30 104.91 0 100.22 98.52 95.32 0 0 0 0 0 1 0 0 0 0 0 30
31 103.10 0 104.91 100.22 98.52 0 0 0 0 0 0 1 0 0 0 0 31
32 97.13 0 103.10 104.91 100.22 0 0 0 0 0 0 0 1 0 0 0 32
33 103.42 0 97.13 103.10 104.91 0 0 0 0 0 0 0 0 1 0 0 33
34 111.72 0 103.42 97.13 103.10 0 0 0 0 0 0 0 0 0 1 0 34
35 118.11 0 111.72 103.42 97.13 0 0 0 0 0 0 0 0 0 0 1 35
36 111.62 0 118.11 111.72 103.42 0 0 0 0 0 0 0 0 0 0 0 36
37 100.22 0 111.62 118.11 111.72 1 0 0 0 0 0 0 0 0 0 0 37
38 102.03 0 100.22 111.62 118.11 0 1 0 0 0 0 0 0 0 0 0 38
39 105.76 0 102.03 100.22 111.62 0 0 1 0 0 0 0 0 0 0 0 39
40 107.68 0 105.76 102.03 100.22 0 0 0 1 0 0 0 0 0 0 0 40
41 110.77 0 107.68 105.76 102.03 0 0 0 0 1 0 0 0 0 0 0 41
42 105.44 0 110.77 107.68 105.76 0 0 0 0 0 1 0 0 0 0 0 42
43 112.26 0 105.44 110.77 107.68 0 0 0 0 0 0 1 0 0 0 0 43
44 114.07 0 112.26 105.44 110.77 0 0 0 0 0 0 0 1 0 0 0 44
45 117.90 0 114.07 112.26 105.44 0 0 0 0 0 0 0 0 1 0 0 45
46 124.72 0 117.90 114.07 112.26 0 0 0 0 0 0 0 0 0 1 0 46
47 126.42 0 124.72 117.90 114.07 0 0 0 0 0 0 0 0 0 0 1 47
48 134.73 0 126.42 124.72 117.90 0 0 0 0 0 0 0 0 0 0 0 48
49 135.79 0 134.73 126.42 124.72 1 0 0 0 0 0 0 0 0 0 0 49
50 143.36 0 135.79 134.73 126.42 0 1 0 0 0 0 0 0 0 0 0 50
51 140.37 0 143.36 135.79 134.73 0 0 1 0 0 0 0 0 0 0 0 51
52 144.74 0 140.37 143.36 135.79 0 0 0 1 0 0 0 0 0 0 0 52
53 151.98 0 144.74 140.37 143.36 0 0 0 0 1 0 0 0 0 0 0 53
54 150.92 0 151.98 144.74 140.37 0 0 0 0 0 1 0 0 0 0 0 54
55 163.38 0 150.92 151.98 144.74 0 0 0 0 0 0 1 0 0 0 0 55
56 154.43 0 163.38 150.92 151.98 0 0 0 0 0 0 0 1 0 0 0 56
57 146.66 0 154.43 163.38 150.92 0 0 0 0 0 0 0 0 1 0 0 57
58 157.95 0 146.66 154.43 163.38 0 0 0 0 0 0 0 0 0 1 0 58
59 162.10 0 157.95 146.66 154.43 0 0 0 0 0 0 0 0 0 0 1 59
60 180.42 0 162.10 157.95 146.66 0 0 0 0 0 0 0 0 0 0 0 60
61 179.57 0 180.42 162.10 157.95 1 0 0 0 0 0 0 0 0 0 0 61
62 171.58 0 179.57 180.42 162.10 0 1 0 0 0 0 0 0 0 0 0 62
63 185.43 0 171.58 179.57 180.42 0 0 1 0 0 0 0 0 0 0 0 63
64 190.64 0 185.43 171.58 179.57 0 0 0 1 0 0 0 0 0 0 0 64
65 203.00 0 190.64 185.43 171.58 0 0 0 0 1 0 0 0 0 0 0 65
66 202.36 0 203.00 190.64 185.43 0 0 0 0 0 1 0 0 0 0 0 66
67 193.41 0 202.36 203.00 190.64 0 0 0 0 0 0 1 0 0 0 0 67
68 186.17 0 193.41 202.36 203.00 0 0 0 0 0 0 0 1 0 0 0 68
69 192.24 0 186.17 193.41 202.36 0 0 0 0 0 0 0 0 1 0 0 69
70 209.60 0 192.24 186.17 193.41 0 0 0 0 0 0 0 0 0 1 0 70
71 206.41 0 209.60 192.24 186.17 0 0 0 0 0 0 0 0 0 0 1 71
72 209.82 0 206.41 209.60 192.24 0 0 0 0 0 0 0 0 0 0 0 72
73 230.37 0 209.82 206.41 209.60 1 0 0 0 0 0 0 0 0 0 0 73
74 235.80 0 230.37 209.82 206.41 0 1 0 0 0 0 0 0 0 0 0 74
75 232.07 0 235.80 230.37 209.82 0 0 1 0 0 0 0 0 0 0 0 75
76 244.64 0 232.07 235.80 230.37 0 0 0 1 0 0 0 0 0 0 0 76
77 242.19 0 244.64 232.07 235.80 0 0 0 0 1 0 0 0 0 0 0 77
78 217.48 0 242.19 244.64 232.07 0 0 0 0 0 1 0 0 0 0 0 78
79 209.39 0 217.48 242.19 244.64 0 0 0 0 0 0 1 0 0 0 0 79
80 211.73 0 209.39 217.48 242.19 0 0 0 0 0 0 0 1 0 0 0 80
81 221.00 0 211.73 209.39 217.48 0 0 0 0 0 0 0 0 1 0 0 81
82 203.11 0 221.00 211.73 209.39 0 0 0 0 0 0 0 0 0 1 0 82
83 214.71 0 203.11 221.00 211.73 0 0 0 0 0 0 0 0 0 0 1 83
84 224.19 0 214.71 203.11 221.00 0 0 0 0 0 0 0 0 0 0 0 84
85 238.04 0 224.19 214.71 203.11 1 0 0 0 0 0 0 0 0 0 0 85
86 238.36 0 238.04 224.19 214.71 0 1 0 0 0 0 0 0 0 0 0 86
87 246.24 0 238.36 238.04 224.19 0 0 1 0 0 0 0 0 0 0 0 87
88 259.87 0 246.24 238.36 238.04 0 0 0 1 0 0 0 0 0 0 0 88
89 249.97 0 259.87 246.24 238.36 0 0 0 0 1 0 0 0 0 0 0 89
90 266.48 0 249.97 259.87 246.24 0 0 0 0 0 1 0 0 0 0 0 90
91 282.98 0 266.48 249.97 259.87 0 0 0 0 0 0 1 0 0 0 0 91
92 306.31 0 282.98 266.48 249.97 0 0 0 0 0 0 0 1 0 0 0 92
93 301.73 1 306.31 282.98 266.48 0 0 0 0 0 0 0 0 1 0 0 93
94 314.62 1 301.73 306.31 282.98 0 0 0 0 0 0 0 0 0 1 0 94
95 332.62 1 314.62 301.73 306.31 0 0 0 0 0 0 0 0 0 0 1 95
96 355.51 1 332.62 314.62 301.73 0 0 0 0 0 0 0 0 0 0 0 96
97 370.32 1 355.51 332.62 314.62 1 0 0 0 0 0 0 0 0 0 0 97
98 408.13 1 370.32 355.51 332.62 0 1 0 0 0 0 0 0 0 0 0 98
99 433.58 1 408.13 370.32 355.51 0 0 1 0 0 0 0 0 0 0 0 99
100 440.51 1 433.58 408.13 370.32 0 0 0 1 0 0 0 0 0 0 0 100
101 386.29 1 440.51 433.58 408.13 0 0 0 0 1 0 0 0 0 0 0 101
102 342.84 1 386.29 440.51 433.58 0 0 0 0 0 1 0 0 0 0 0 102
103 254.97 1 342.84 386.29 440.51 0 0 0 0 0 0 1 0 0 0 0 103
104 203.42 1 254.97 342.84 386.29 0 0 0 0 0 0 0 1 0 0 0 104
105 170.09 1 203.42 254.97 342.84 0 0 0 0 0 0 0 0 1 0 0 105
106 174.03 1 170.09 203.42 254.97 0 0 0 0 0 0 0 0 0 1 0 106
107 167.85 1 174.03 170.09 203.42 0 0 0 0 0 0 0 0 0 0 1 107
108 177.01 1 167.85 174.03 170.09 0 0 0 0 0 0 0 0 0 0 0 108
109 188.19 1 177.01 167.85 174.03 1 0 0 0 0 0 0 0 0 0 0 109
110 211.20 1 188.19 177.01 167.85 0 1 0 0 0 0 0 0 0 0 0 110
111 240.91 1 211.20 188.19 177.01 0 0 1 0 0 0 0 0 0 0 0 111
112 230.26 1 240.91 211.20 188.19 0 0 0 1 0 0 0 0 0 0 0 112
113 251.25 1 230.26 240.91 211.20 0 0 0 0 1 0 0 0 0 0 0 113
114 241.66 1 251.25 230.26 240.91 0 0 0 0 0 1 0 0 0 0 0 114
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X Y1 Y2 Y3 M1
8.23393 -2.78755 1.31883 -0.15445 -0.25648 -3.13383
M2 M3 M4 M5 M6 M7
0.96805 -0.05394 -4.64989 -7.24377 -8.61427 -9.13615
M8 M9 M10 M11 t
-4.51485 -3.88401 2.93988 -1.78358 0.21043
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-42.5155 -5.7848 -0.2344 7.6919 32.9248
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.23393 5.15607 1.597 0.11353
X -2.78755 4.43870 -0.628 0.53147
Y1 1.31883 0.09924 13.289 < 2e-16 ***
Y2 -0.15445 0.16911 -0.913 0.36333
Y3 -0.25648 0.10160 -2.524 0.01321 *
M1 -3.13383 5.92095 -0.529 0.59782
M2 0.96805 5.91204 0.164 0.87027
M3 -0.05394 5.94160 -0.009 0.99278
M4 -4.64989 5.93870 -0.783 0.43555
M5 -7.24377 5.94582 -1.218 0.22607
M6 -8.61427 5.96636 -1.444 0.15202
M7 -9.13615 6.21328 -1.470 0.14468
M8 -4.51485 6.22465 -0.725 0.47000
M9 -3.88401 6.19152 -0.627 0.53193
M10 2.93988 6.12451 0.480 0.63229
M11 -1.78358 6.12548 -0.291 0.77154
t 0.21043 0.07013 3.001 0.00343 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 12.84 on 97 degrees of freedom
Multiple R-squared: 0.9795, Adjusted R-squared: 0.9761
F-statistic: 290 on 16 and 97 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 4.533341e-02 9.066683e-02 0.9546666
[2,] 1.321465e-01 2.642930e-01 0.8678535
[3,] 6.138150e-02 1.227630e-01 0.9386185
[4,] 2.660705e-02 5.321409e-02 0.9733930
[5,] 2.884013e-02 5.768026e-02 0.9711599
[6,] 1.854718e-02 3.709436e-02 0.9814528
[7,] 8.846947e-03 1.769389e-02 0.9911531
[8,] 3.853488e-03 7.706976e-03 0.9961465
[9,] 2.328354e-03 4.656709e-03 0.9976716
[10,] 9.536618e-04 1.907324e-03 0.9990463
[11,] 4.498770e-04 8.997539e-04 0.9995501
[12,] 2.105845e-04 4.211690e-04 0.9997894
[13,] 8.518235e-05 1.703647e-04 0.9999148
[14,] 1.865294e-04 3.730588e-04 0.9998135
[15,] 8.921396e-05 1.784279e-04 0.9999108
[16,] 3.934034e-05 7.868068e-05 0.9999607
[17,] 3.041123e-05 6.082246e-05 0.9999696
[18,] 2.116542e-05 4.233085e-05 0.9999788
[19,] 8.151604e-06 1.630321e-05 0.9999918
[20,] 3.296153e-06 6.592307e-06 0.9999967
[21,] 1.254651e-06 2.509302e-06 0.9999987
[22,] 4.672893e-07 9.345785e-07 0.9999995
[23,] 2.950009e-07 5.900018e-07 0.9999997
[24,] 5.396494e-07 1.079299e-06 0.9999995
[25,] 2.068841e-07 4.137683e-07 0.9999998
[26,] 1.328421e-07 2.656841e-07 0.9999999
[27,] 5.230928e-08 1.046186e-07 0.9999999
[28,] 1.862423e-08 3.724845e-08 1.0000000
[29,] 1.495703e-08 2.991406e-08 1.0000000
[30,] 5.772491e-09 1.154498e-08 1.0000000
[31,] 2.096438e-09 4.192877e-09 1.0000000
[32,] 1.061398e-09 2.122796e-09 1.0000000
[33,] 4.337911e-10 8.675821e-10 1.0000000
[34,] 1.837010e-10 3.674021e-10 1.0000000
[35,] 6.675567e-11 1.335113e-10 1.0000000
[36,] 2.085811e-10 4.171623e-10 1.0000000
[37,] 1.980886e-10 3.961772e-10 1.0000000
[38,] 1.094327e-10 2.188653e-10 1.0000000
[39,] 4.495628e-11 8.991257e-11 1.0000000
[40,] 1.458147e-11 2.916295e-11 1.0000000
[41,] 4.520200e-11 9.040400e-11 1.0000000
[42,] 2.118288e-11 4.236576e-11 1.0000000
[43,] 5.126216e-11 1.025243e-10 1.0000000
[44,] 4.392133e-11 8.784265e-11 1.0000000
[45,] 1.440820e-11 2.881640e-11 1.0000000
[46,] 1.514864e-11 3.029729e-11 1.0000000
[47,] 5.810079e-12 1.162016e-11 1.0000000
[48,] 5.389334e-12 1.077867e-11 1.0000000
[49,] 2.759886e-12 5.519772e-12 1.0000000
[50,] 1.096125e-12 2.192250e-12 1.0000000
[51,] 7.598801e-13 1.519760e-12 1.0000000
[52,] 6.039390e-13 1.207878e-12 1.0000000
[53,] 2.348196e-13 4.696391e-13 1.0000000
[54,] 1.048168e-12 2.096336e-12 1.0000000
[55,] 4.305744e-13 8.611488e-13 1.0000000
[56,] 4.251231e-13 8.502462e-13 1.0000000
[57,] 2.927171e-13 5.854342e-13 1.0000000
[58,] 4.194554e-13 8.389107e-13 1.0000000
[59,] 1.767707e-11 3.535415e-11 1.0000000
[60,] 1.360926e-11 2.721852e-11 1.0000000
[61,] 5.063379e-12 1.012676e-11 1.0000000
[62,] 1.991041e-12 3.982083e-12 1.0000000
[63,] 1.000385e-09 2.000769e-09 1.0000000
[64,] 5.742644e-10 1.148529e-09 1.0000000
[65,] 2.180407e-10 4.360814e-10 1.0000000
[66,] 1.969260e-10 3.938521e-10 1.0000000
[67,] 4.433997e-09 8.867994e-09 1.0000000
[68,] 1.004959e-07 2.009918e-07 0.9999999
[69,] 4.442189e-08 8.884377e-08 1.0000000
[70,] 1.108306e-07 2.216612e-07 0.9999999
[71,] 1.709284e-06 3.418567e-06 0.9999983
[72,] 9.771340e-07 1.954268e-06 0.9999990
[73,] 2.010100e-06 4.020201e-06 0.9999980
[74,] 1.129131e-06 2.258262e-06 0.9999989
[75,] 1.434704e-04 2.869407e-04 0.9998565
> postscript(file="/var/www/html/rcomp/tmp/18w7e1258729074.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/26xxu1258729074.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3l98h1258729074.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/4sata1258729074.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/58bdm1258729074.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 114
Frequency = 1
1 2 3 4 5 6
-5.98277270 12.09153352 3.15199287 -1.39075792 10.70235014 15.66234328
7 8 9 10 11 12
4.78523775 5.58952851 -10.75855007 2.63944949 7.18389432 -7.91309566
13 14 15 16 17 18
3.48353262 1.47216112 -5.76105950 -2.33477125 8.04907225 5.15610957
19 20 21 22 23 24
-5.32725251 -0.47999094 3.02425939 -5.17494769 -2.47302634 2.91395800
25 26 27 28 29 30
-2.30360589 -9.63366395 -7.70505273 3.07879140 2.77692594 6.46885561
31 32 33 34 35 36
-0.13169298 -7.38593060 6.85957891 -1.55651271 -2.15948861 -16.17559419
37 38 39 40 41 42
-12.97720720 0.19170793 -1.07915884 -2.33723648 1.64439598 -5.34748892
43 44 45 46 47 48
9.78304792 -2.26380994 -1.97586072 -5.21252677 -6.93813697 -0.82846143
49 50 51 52 53 54
-5.79276623 -2.21351251 -12.08040739 2.05950547 7.39942844 -2.14077476
55 56 57 58 59 60
14.26771355 -14.25343516 -9.40855448 6.90789325 -2.81431451 7.78940792
61 62 63 64 65 66
-10.76151192 -18.04883387 11.71769982 1.59531746 9.55750585 -1.86618244
67 68 69 70 71 72
-6.41536034 -3.61224718 9.61832756 8.52492692 -13.96638117 -4.10516392
73 74 75 76 77 78
18.83087940 -7.44492688 -13.47601614 14.50818196 -1.31948832 -20.65349807
79 80 81 82 83 84
7.00189305 10.73460903 8.49002696 -30.37340522 11.36548053 3.16747412
85 86 87 88 89 90
4.64148950 -13.17721441 -0.33704428 10.88781828 -13.30525557 21.54753446
91 92 93 94 95 96
18.55187431 15.30023388 -11.31881299 8.41248168 19.20215723 17.17536545
97 98 99 100 101 102
10.80692450 32.92484818 17.47973562 4.86936708 -42.47820918 -5.66318937
103 104 105 106 107 108
-42.51546076 -3.62895761 5.46958543 15.83264105 -9.40018449 -2.02389030
109 110 111 112 113 114
0.05503792 3.83790086 8.08931057 -30.93621600 16.97327447 -13.16370936
> postscript(file="/var/www/html/rcomp/tmp/67vwh1258729074.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 114
Frequency = 1
lag(myerror, k = 1) myerror
0 -5.98277270 NA
1 12.09153352 -5.98277270
2 3.15199287 12.09153352
3 -1.39075792 3.15199287
4 10.70235014 -1.39075792
5 15.66234328 10.70235014
6 4.78523775 15.66234328
7 5.58952851 4.78523775
8 -10.75855007 5.58952851
9 2.63944949 -10.75855007
10 7.18389432 2.63944949
11 -7.91309566 7.18389432
12 3.48353262 -7.91309566
13 1.47216112 3.48353262
14 -5.76105950 1.47216112
15 -2.33477125 -5.76105950
16 8.04907225 -2.33477125
17 5.15610957 8.04907225
18 -5.32725251 5.15610957
19 -0.47999094 -5.32725251
20 3.02425939 -0.47999094
21 -5.17494769 3.02425939
22 -2.47302634 -5.17494769
23 2.91395800 -2.47302634
24 -2.30360589 2.91395800
25 -9.63366395 -2.30360589
26 -7.70505273 -9.63366395
27 3.07879140 -7.70505273
28 2.77692594 3.07879140
29 6.46885561 2.77692594
30 -0.13169298 6.46885561
31 -7.38593060 -0.13169298
32 6.85957891 -7.38593060
33 -1.55651271 6.85957891
34 -2.15948861 -1.55651271
35 -16.17559419 -2.15948861
36 -12.97720720 -16.17559419
37 0.19170793 -12.97720720
38 -1.07915884 0.19170793
39 -2.33723648 -1.07915884
40 1.64439598 -2.33723648
41 -5.34748892 1.64439598
42 9.78304792 -5.34748892
43 -2.26380994 9.78304792
44 -1.97586072 -2.26380994
45 -5.21252677 -1.97586072
46 -6.93813697 -5.21252677
47 -0.82846143 -6.93813697
48 -5.79276623 -0.82846143
49 -2.21351251 -5.79276623
50 -12.08040739 -2.21351251
51 2.05950547 -12.08040739
52 7.39942844 2.05950547
53 -2.14077476 7.39942844
54 14.26771355 -2.14077476
55 -14.25343516 14.26771355
56 -9.40855448 -14.25343516
57 6.90789325 -9.40855448
58 -2.81431451 6.90789325
59 7.78940792 -2.81431451
60 -10.76151192 7.78940792
61 -18.04883387 -10.76151192
62 11.71769982 -18.04883387
63 1.59531746 11.71769982
64 9.55750585 1.59531746
65 -1.86618244 9.55750585
66 -6.41536034 -1.86618244
67 -3.61224718 -6.41536034
68 9.61832756 -3.61224718
69 8.52492692 9.61832756
70 -13.96638117 8.52492692
71 -4.10516392 -13.96638117
72 18.83087940 -4.10516392
73 -7.44492688 18.83087940
74 -13.47601614 -7.44492688
75 14.50818196 -13.47601614
76 -1.31948832 14.50818196
77 -20.65349807 -1.31948832
78 7.00189305 -20.65349807
79 10.73460903 7.00189305
80 8.49002696 10.73460903
81 -30.37340522 8.49002696
82 11.36548053 -30.37340522
83 3.16747412 11.36548053
84 4.64148950 3.16747412
85 -13.17721441 4.64148950
86 -0.33704428 -13.17721441
87 10.88781828 -0.33704428
88 -13.30525557 10.88781828
89 21.54753446 -13.30525557
90 18.55187431 21.54753446
91 15.30023388 18.55187431
92 -11.31881299 15.30023388
93 8.41248168 -11.31881299
94 19.20215723 8.41248168
95 17.17536545 19.20215723
96 10.80692450 17.17536545
97 32.92484818 10.80692450
98 17.47973562 32.92484818
99 4.86936708 17.47973562
100 -42.47820918 4.86936708
101 -5.66318937 -42.47820918
102 -42.51546076 -5.66318937
103 -3.62895761 -42.51546076
104 5.46958543 -3.62895761
105 15.83264105 5.46958543
106 -9.40018449 15.83264105
107 -2.02389030 -9.40018449
108 0.05503792 -2.02389030
109 3.83790086 0.05503792
110 8.08931057 3.83790086
111 -30.93621600 8.08931057
112 16.97327447 -30.93621600
113 -13.16370936 16.97327447
114 NA -13.16370936
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 12.09153352 -5.98277270
[2,] 3.15199287 12.09153352
[3,] -1.39075792 3.15199287
[4,] 10.70235014 -1.39075792
[5,] 15.66234328 10.70235014
[6,] 4.78523775 15.66234328
[7,] 5.58952851 4.78523775
[8,] -10.75855007 5.58952851
[9,] 2.63944949 -10.75855007
[10,] 7.18389432 2.63944949
[11,] -7.91309566 7.18389432
[12,] 3.48353262 -7.91309566
[13,] 1.47216112 3.48353262
[14,] -5.76105950 1.47216112
[15,] -2.33477125 -5.76105950
[16,] 8.04907225 -2.33477125
[17,] 5.15610957 8.04907225
[18,] -5.32725251 5.15610957
[19,] -0.47999094 -5.32725251
[20,] 3.02425939 -0.47999094
[21,] -5.17494769 3.02425939
[22,] -2.47302634 -5.17494769
[23,] 2.91395800 -2.47302634
[24,] -2.30360589 2.91395800
[25,] -9.63366395 -2.30360589
[26,] -7.70505273 -9.63366395
[27,] 3.07879140 -7.70505273
[28,] 2.77692594 3.07879140
[29,] 6.46885561 2.77692594
[30,] -0.13169298 6.46885561
[31,] -7.38593060 -0.13169298
[32,] 6.85957891 -7.38593060
[33,] -1.55651271 6.85957891
[34,] -2.15948861 -1.55651271
[35,] -16.17559419 -2.15948861
[36,] -12.97720720 -16.17559419
[37,] 0.19170793 -12.97720720
[38,] -1.07915884 0.19170793
[39,] -2.33723648 -1.07915884
[40,] 1.64439598 -2.33723648
[41,] -5.34748892 1.64439598
[42,] 9.78304792 -5.34748892
[43,] -2.26380994 9.78304792
[44,] -1.97586072 -2.26380994
[45,] -5.21252677 -1.97586072
[46,] -6.93813697 -5.21252677
[47,] -0.82846143 -6.93813697
[48,] -5.79276623 -0.82846143
[49,] -2.21351251 -5.79276623
[50,] -12.08040739 -2.21351251
[51,] 2.05950547 -12.08040739
[52,] 7.39942844 2.05950547
[53,] -2.14077476 7.39942844
[54,] 14.26771355 -2.14077476
[55,] -14.25343516 14.26771355
[56,] -9.40855448 -14.25343516
[57,] 6.90789325 -9.40855448
[58,] -2.81431451 6.90789325
[59,] 7.78940792 -2.81431451
[60,] -10.76151192 7.78940792
[61,] -18.04883387 -10.76151192
[62,] 11.71769982 -18.04883387
[63,] 1.59531746 11.71769982
[64,] 9.55750585 1.59531746
[65,] -1.86618244 9.55750585
[66,] -6.41536034 -1.86618244
[67,] -3.61224718 -6.41536034
[68,] 9.61832756 -3.61224718
[69,] 8.52492692 9.61832756
[70,] -13.96638117 8.52492692
[71,] -4.10516392 -13.96638117
[72,] 18.83087940 -4.10516392
[73,] -7.44492688 18.83087940
[74,] -13.47601614 -7.44492688
[75,] 14.50818196 -13.47601614
[76,] -1.31948832 14.50818196
[77,] -20.65349807 -1.31948832
[78,] 7.00189305 -20.65349807
[79,] 10.73460903 7.00189305
[80,] 8.49002696 10.73460903
[81,] -30.37340522 8.49002696
[82,] 11.36548053 -30.37340522
[83,] 3.16747412 11.36548053
[84,] 4.64148950 3.16747412
[85,] -13.17721441 4.64148950
[86,] -0.33704428 -13.17721441
[87,] 10.88781828 -0.33704428
[88,] -13.30525557 10.88781828
[89,] 21.54753446 -13.30525557
[90,] 18.55187431 21.54753446
[91,] 15.30023388 18.55187431
[92,] -11.31881299 15.30023388
[93,] 8.41248168 -11.31881299
[94,] 19.20215723 8.41248168
[95,] 17.17536545 19.20215723
[96,] 10.80692450 17.17536545
[97,] 32.92484818 10.80692450
[98,] 17.47973562 32.92484818
[99,] 4.86936708 17.47973562
[100,] -42.47820918 4.86936708
[101,] -5.66318937 -42.47820918
[102,] -42.51546076 -5.66318937
[103,] -3.62895761 -42.51546076
[104,] 5.46958543 -3.62895761
[105,] 15.83264105 5.46958543
[106,] -9.40018449 15.83264105
[107,] -2.02389030 -9.40018449
[108,] 0.05503792 -2.02389030
[109,] 3.83790086 0.05503792
[110,] 8.08931057 3.83790086
[111,] -30.93621600 8.08931057
[112,] 16.97327447 -30.93621600
[113,] -13.16370936 16.97327447
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 12.09153352 -5.98277270
2 3.15199287 12.09153352
3 -1.39075792 3.15199287
4 10.70235014 -1.39075792
5 15.66234328 10.70235014
6 4.78523775 15.66234328
7 5.58952851 4.78523775
8 -10.75855007 5.58952851
9 2.63944949 -10.75855007
10 7.18389432 2.63944949
11 -7.91309566 7.18389432
12 3.48353262 -7.91309566
13 1.47216112 3.48353262
14 -5.76105950 1.47216112
15 -2.33477125 -5.76105950
16 8.04907225 -2.33477125
17 5.15610957 8.04907225
18 -5.32725251 5.15610957
19 -0.47999094 -5.32725251
20 3.02425939 -0.47999094
21 -5.17494769 3.02425939
22 -2.47302634 -5.17494769
23 2.91395800 -2.47302634
24 -2.30360589 2.91395800
25 -9.63366395 -2.30360589
26 -7.70505273 -9.63366395
27 3.07879140 -7.70505273
28 2.77692594 3.07879140
29 6.46885561 2.77692594
30 -0.13169298 6.46885561
31 -7.38593060 -0.13169298
32 6.85957891 -7.38593060
33 -1.55651271 6.85957891
34 -2.15948861 -1.55651271
35 -16.17559419 -2.15948861
36 -12.97720720 -16.17559419
37 0.19170793 -12.97720720
38 -1.07915884 0.19170793
39 -2.33723648 -1.07915884
40 1.64439598 -2.33723648
41 -5.34748892 1.64439598
42 9.78304792 -5.34748892
43 -2.26380994 9.78304792
44 -1.97586072 -2.26380994
45 -5.21252677 -1.97586072
46 -6.93813697 -5.21252677
47 -0.82846143 -6.93813697
48 -5.79276623 -0.82846143
49 -2.21351251 -5.79276623
50 -12.08040739 -2.21351251
51 2.05950547 -12.08040739
52 7.39942844 2.05950547
53 -2.14077476 7.39942844
54 14.26771355 -2.14077476
55 -14.25343516 14.26771355
56 -9.40855448 -14.25343516
57 6.90789325 -9.40855448
58 -2.81431451 6.90789325
59 7.78940792 -2.81431451
60 -10.76151192 7.78940792
61 -18.04883387 -10.76151192
62 11.71769982 -18.04883387
63 1.59531746 11.71769982
64 9.55750585 1.59531746
65 -1.86618244 9.55750585
66 -6.41536034 -1.86618244
67 -3.61224718 -6.41536034
68 9.61832756 -3.61224718
69 8.52492692 9.61832756
70 -13.96638117 8.52492692
71 -4.10516392 -13.96638117
72 18.83087940 -4.10516392
73 -7.44492688 18.83087940
74 -13.47601614 -7.44492688
75 14.50818196 -13.47601614
76 -1.31948832 14.50818196
77 -20.65349807 -1.31948832
78 7.00189305 -20.65349807
79 10.73460903 7.00189305
80 8.49002696 10.73460903
81 -30.37340522 8.49002696
82 11.36548053 -30.37340522
83 3.16747412 11.36548053
84 4.64148950 3.16747412
85 -13.17721441 4.64148950
86 -0.33704428 -13.17721441
87 10.88781828 -0.33704428
88 -13.30525557 10.88781828
89 21.54753446 -13.30525557
90 18.55187431 21.54753446
91 15.30023388 18.55187431
92 -11.31881299 15.30023388
93 8.41248168 -11.31881299
94 19.20215723 8.41248168
95 17.17536545 19.20215723
96 10.80692450 17.17536545
97 32.92484818 10.80692450
98 17.47973562 32.92484818
99 4.86936708 17.47973562
100 -42.47820918 4.86936708
101 -5.66318937 -42.47820918
102 -42.51546076 -5.66318937
103 -3.62895761 -42.51546076
104 5.46958543 -3.62895761
105 15.83264105 5.46958543
106 -9.40018449 15.83264105
107 -2.02389030 -9.40018449
108 0.05503792 -2.02389030
109 3.83790086 0.05503792
110 8.08931057 3.83790086
111 -30.93621600 8.08931057
112 16.97327447 -30.93621600
113 -13.16370936 16.97327447
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/7bdo81258729074.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8snjl1258729074.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9izgm1258729074.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10bve41258729074.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/1153a21258729074.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/12e8l31258729074.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/13qd6m1258729074.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/14v6i31258729074.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/155auq1258729074.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/16mxo31258729074.tab")
+ }
> system("convert tmp/18w7e1258729074.ps tmp/18w7e1258729074.png")
> system("convert tmp/26xxu1258729074.ps tmp/26xxu1258729074.png")
> system("convert tmp/3l98h1258729074.ps tmp/3l98h1258729074.png")
> system("convert tmp/4sata1258729074.ps tmp/4sata1258729074.png")
> system("convert tmp/58bdm1258729074.ps tmp/58bdm1258729074.png")
> system("convert tmp/67vwh1258729074.ps tmp/67vwh1258729074.png")
> system("convert tmp/7bdo81258729074.ps tmp/7bdo81258729074.png")
> system("convert tmp/8snjl1258729074.ps tmp/8snjl1258729074.png")
> system("convert tmp/9izgm1258729074.ps tmp/9izgm1258729074.png")
> system("convert tmp/10bve41258729074.ps tmp/10bve41258729074.png")
>
>
> proc.time()
user system elapsed
3.305 1.655 3.666