R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
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(47
+ ,46
+ ,84
+ ,24
+ ,48
+ ,72
+ ,31
+ ,37
+ ,37
+ ,42
+ ,75
+ ,85
+ ,24
+ ,31
+ ,30
+ ,10
+ ,18
+ ,53
+ ,85
+ ,79
+ ,74
+ ,9
+ ,16
+ ,22
+ ,32
+ ,38
+ ,68
+ ,36
+ ,24
+ ,47
+ ,45
+ ,65
+ ,102
+ ,36
+ ,74
+ ,123
+ ,28
+ ,43
+ ,69
+ ,54
+ ,42
+ ,108
+ ,39
+ ,55
+ ,59
+ ,70
+ ,121
+ ,122
+ ,50
+ ,42
+ ,91
+ ,55
+ ,102
+ ,45
+ ,32
+ ,36
+ ,53
+ ,44
+ ,50
+ ,112
+ ,46
+ ,48
+ ,82
+ ,80
+ ,56
+ ,92
+ ,25
+ ,19
+ ,51
+ ,30
+ ,32
+ ,120
+ ,41
+ ,77
+ ,99
+ ,40
+ ,90
+ ,86
+ ,45
+ ,81
+ ,59
+ ,45
+ ,55
+ ,98
+ ,30
+ ,34
+ ,71
+ ,52
+ ,38
+ ,100
+ ,53
+ ,53
+ ,113
+ ,36
+ ,48
+ ,92
+ ,57
+ ,63
+ ,107
+ ,17
+ ,25
+ ,75
+ ,68
+ ,56
+ ,100
+ ,46
+ ,37
+ ,69
+ ,73
+ ,83
+ ,106
+ ,34
+ ,50
+ ,51
+ ,22
+ ,26
+ ,18
+ ,58
+ ,108
+ ,91
+ ,62
+ ,55
+ ,75
+ ,32
+ ,41
+ ,63
+ ,38
+ ,49
+ ,72
+ ,23
+ ,31
+ ,59
+ ,26
+ ,49
+ ,29
+ ,85
+ ,96
+ ,85
+ ,22
+ ,42
+ ,66
+ ,44
+ ,55
+ ,106
+ ,62
+ ,70
+ ,113
+ ,36
+ ,39
+ ,101
+ ,36
+ ,53
+ ,65
+ ,7
+ ,24
+ ,7
+ ,72
+ ,209
+ ,111
+ ,18
+ ,17
+ ,61
+ ,27
+ ,58
+ ,41
+ ,48
+ ,27
+ ,70
+ ,50
+ ,58
+ ,136
+ ,55
+ ,114
+ ,87
+ ,59
+ ,75
+ ,90
+ ,39
+ ,51
+ ,76
+ ,68
+ ,86
+ ,101
+ ,57
+ ,77
+ ,57
+ ,40
+ ,62
+ ,61
+ ,47
+ ,60
+ ,92
+ ,39
+ ,39
+ ,80
+ ,32
+ ,35
+ ,35
+ ,32
+ ,86
+ ,72
+ ,40
+ ,102
+ ,88
+ ,42
+ ,49
+ ,80
+ ,26
+ ,35
+ ,62
+ ,33
+ ,33
+ ,81
+ ,19
+ ,28
+ ,63
+ ,35
+ ,44
+ ,91
+ ,41
+ ,37
+ ,65
+ ,27
+ ,33
+ ,79
+ ,53
+ ,45
+ ,85
+ ,55
+ ,57
+ ,75
+ ,29
+ ,58
+ ,70
+ ,25
+ ,36
+ ,78
+ ,33
+ ,42
+ ,75
+ ,27
+ ,30
+ ,55
+ ,76
+ ,67
+ ,80
+ ,37
+ ,53
+ ,83
+ ,38
+ ,59
+ ,38
+ ,22
+ ,25
+ ,27
+ ,30
+ ,39
+ ,62
+ ,27
+ ,36
+ ,82
+ ,63
+ ,114
+ ,88
+ ,48
+ ,54
+ ,59
+ ,33
+ ,70
+ ,92
+ ,37
+ ,51
+ ,40
+ ,42
+ ,49
+ ,91
+ ,31
+ ,42
+ ,63
+ ,47
+ ,51
+ ,88
+ ,52
+ ,51
+ ,85
+ ,36
+ ,27
+ ,76
+ ,40
+ ,29
+ ,67
+ ,53
+ ,54
+ ,69
+ ,56
+ ,92
+ ,150
+ ,69
+ ,72
+ ,77
+ ,43
+ ,63
+ ,103
+ ,51
+ ,41
+ ,81
+ ,30
+ ,111
+ ,37
+ ,12
+ ,14
+ ,64
+ ,35
+ ,45
+ ,22
+ ,36
+ ,91
+ ,35
+ ,41
+ ,29
+ ,61
+ ,52
+ ,64
+ ,80
+ ,21
+ ,32
+ ,54
+ ,26
+ ,65
+ ,76
+ ,49
+ ,42
+ ,87
+ ,39
+ ,55
+ ,75
+ ,6
+ ,10
+ ,0
+ ,35
+ ,53
+ ,61
+ ,17
+ ,25
+ ,30
+ ,25
+ ,33
+ ,66
+ ,71
+ ,66
+ ,56
+ ,6
+ ,16
+ ,0
+ ,47
+ ,35
+ ,32
+ ,9
+ ,19
+ ,9
+ ,52
+ ,76
+ ,82
+ ,38
+ ,35
+ ,110
+ ,21
+ ,46
+ ,71
+ ,21
+ ,29
+ ,50
+ ,11
+ ,34
+ ,21
+ ,25
+ ,25
+ ,78
+ ,54
+ ,48
+ ,118
+ ,38
+ ,38
+ ,102
+ ,68
+ ,50
+ ,109
+ ,56
+ ,65
+ ,104
+ ,71
+ ,72
+ ,124
+ ,39
+ ,23
+ ,76
+ ,21
+ ,29
+ ,57
+ ,53
+ ,194
+ ,91
+ ,78
+ ,114
+ ,101
+ ,14
+ ,15
+ ,66
+ ,70
+ ,86
+ ,98
+ ,29
+ ,50
+ ,63
+ ,47
+ ,33
+ ,85
+ ,36
+ ,50
+ ,74
+ ,21
+ ,72
+ ,19
+ ,69
+ ,81
+ ,57
+ ,42
+ ,54
+ ,74
+ ,48
+ ,63
+ ,78
+ ,55
+ ,69
+ ,91
+ ,19
+ ,39
+ ,112
+ ,39
+ ,49
+ ,79
+ ,51
+ ,67
+ ,100
+ ,0
+ ,0
+ ,0
+ ,4
+ ,10
+ ,0
+ ,0
+ ,1
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,38
+ ,58
+ ,48
+ ,51
+ ,72
+ ,55
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,0
+ ,2
+ ,5
+ ,0
+ ,13
+ ,20
+ ,13
+ ,5
+ ,5
+ ,4
+ ,20
+ ,27
+ ,31
+ ,0
+ ,2
+ ,0
+ ,29
+ ,33
+ ,29)
+ ,dim=c(3
+ ,164)
+ ,dimnames=list(c('TT_Hours'
+ ,'Logins'
+ ,'PR_Messages')
+ ,1:164))
> y <- array(NA,dim=c(3,164),dimnames=list(c('TT_Hours','Logins','PR_Messages'),1:164))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '3'
> library(lattice)
> library(lmtest)
Loading required package: zoo
> 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
PR_Messages TT_Hours Logins
1 84 47 46
2 72 24 48
3 37 31 37
4 85 42 75
5 30 24 31
6 53 10 18
7 74 85 79
8 22 9 16
9 68 32 38
10 47 36 24
11 102 45 65
12 123 36 74
13 69 28 43
14 108 54 42
15 59 39 55
16 122 70 121
17 91 50 42
18 45 55 102
19 53 32 36
20 112 44 50
21 82 46 48
22 92 80 56
23 51 25 19
24 120 30 32
25 99 41 77
26 86 40 90
27 59 45 81
28 98 45 55
29 71 30 34
30 100 52 38
31 113 53 53
32 92 36 48
33 107 57 63
34 75 17 25
35 100 68 56
36 69 46 37
37 106 73 83
38 51 34 50
39 18 22 26
40 91 58 108
41 75 62 55
42 63 32 41
43 72 38 49
44 59 23 31
45 29 26 49
46 85 85 96
47 66 22 42
48 106 44 55
49 113 62 70
50 101 36 39
51 65 36 53
52 7 7 24
53 111 72 209
54 61 18 17
55 41 27 58
56 70 48 27
57 136 50 58
58 87 55 114
59 90 59 75
60 76 39 51
61 101 68 86
62 57 57 77
63 61 40 62
64 92 47 60
65 80 39 39
66 35 32 35
67 72 32 86
68 88 40 102
69 80 42 49
70 62 26 35
71 81 33 33
72 63 19 28
73 91 35 44
74 65 41 37
75 79 27 33
76 85 53 45
77 75 55 57
78 70 29 58
79 78 25 36
80 75 33 42
81 55 27 30
82 80 76 67
83 83 37 53
84 38 38 59
85 27 22 25
86 62 30 39
87 82 27 36
88 88 63 114
89 59 48 54
90 92 33 70
91 40 37 51
92 91 42 49
93 63 31 42
94 88 47 51
95 85 52 51
96 76 36 27
97 67 40 29
98 69 53 54
99 150 56 92
100 77 69 72
101 103 43 63
102 81 51 41
103 37 30 111
104 64 12 14
105 22 35 45
106 35 36 91
107 61 41 29
108 80 52 64
109 54 21 32
110 76 26 65
111 87 49 42
112 75 39 55
113 0 6 10
114 61 35 53
115 30 17 25
116 66 25 33
117 56 71 66
118 0 6 16
119 32 47 35
120 9 9 19
121 82 52 76
122 110 38 35
123 71 21 46
124 50 21 29
125 21 11 34
126 78 25 25
127 118 54 48
128 102 38 38
129 109 68 50
130 104 56 65
131 124 71 72
132 76 39 23
133 57 21 29
134 91 53 194
135 101 78 114
136 66 14 15
137 98 70 86
138 63 29 50
139 85 47 33
140 74 36 50
141 19 21 72
142 57 69 81
143 74 42 54
144 78 48 63
145 91 55 69
146 112 19 39
147 79 39 49
148 100 51 67
149 0 0 0
150 0 4 10
151 0 0 1
152 0 0 2
153 0 0 0
154 0 0 0
155 48 38 58
156 55 51 72
157 0 0 0
158 0 0 4
159 0 2 5
160 13 13 20
161 4 5 5
162 31 20 27
163 0 0 2
164 29 29 33
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) TT_Hours Logins
22.22076 1.11743 0.06997
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-50.176 -20.662 1.087 15.820 65.819
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 22.22076 4.04068 5.499 1.47e-07 ***
TT_Hours 1.11743 0.13135 8.507 1.17e-14 ***
Logins 0.06997 0.08271 0.846 0.399
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 23.24 on 161 degrees of freedom
Multiple R-squared: 0.5008, Adjusted R-squared: 0.4946
F-statistic: 80.77 on 2 and 161 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,] 0.53609661 9.278068e-01 4.639034e-01
[2,] 0.42218124 8.443625e-01 5.778188e-01
[3,] 0.34729962 6.945992e-01 6.527004e-01
[4,] 0.28554874 5.710975e-01 7.144513e-01
[5,] 0.19584465 3.916893e-01 8.041554e-01
[6,] 0.21352146 4.270429e-01 7.864785e-01
[7,] 0.24854522 4.970904e-01 7.514548e-01
[8,] 0.17595326 3.519065e-01 8.240467e-01
[9,] 0.49669356 9.933871e-01 5.033064e-01
[10,] 0.46960222 9.392044e-01 5.303978e-01
[11,] 0.42104783 8.420957e-01 5.789522e-01
[12,] 0.41862324 8.372465e-01 5.813768e-01
[13,] 0.78268647 4.346271e-01 2.173135e-01
[14,] 0.73138311 5.372338e-01 2.686169e-01
[15,] 0.81132640 3.773472e-01 1.886736e-01
[16,] 0.76413596 4.717281e-01 2.358640e-01
[17,] 0.71806671 5.638666e-01 2.819333e-01
[18,] 0.65887660 6.822468e-01 3.411234e-01
[19,] 0.88092376 2.381525e-01 1.190762e-01
[20,] 0.86510043 2.697991e-01 1.348996e-01
[21,] 0.83107932 3.378414e-01 1.689207e-01
[22,] 0.83588476 3.282305e-01 1.641152e-01
[23,] 0.82332539 3.533492e-01 1.766746e-01
[24,] 0.78595459 4.280908e-01 2.140454e-01
[25,] 0.77174836 4.565033e-01 2.282516e-01
[26,] 0.78751302 4.249740e-01 2.124870e-01
[27,] 0.77528315 4.494337e-01 2.247169e-01
[28,] 0.75176706 4.964659e-01 2.482329e-01
[29,] 0.74387046 5.122591e-01 2.561295e-01
[30,] 0.69744765 6.051047e-01 3.025523e-01
[31,] 0.65702491 6.859502e-01 3.429751e-01
[32,] 0.60554715 7.889057e-01 3.944529e-01
[33,] 0.59619205 8.076159e-01 4.038080e-01
[34,] 0.68970462 6.205908e-01 3.102954e-01
[35,] 0.64649179 7.070164e-01 3.535082e-01
[36,] 0.62655065 7.468987e-01 3.734493e-01
[37,] 0.57855392 8.428922e-01 4.214461e-01
[38,] 0.52794926 9.441015e-01 4.720507e-01
[39,] 0.47949904 9.589981e-01 5.205010e-01
[40,] 0.53374955 9.325009e-01 4.662504e-01
[41,] 0.58275863 8.344827e-01 4.172414e-01
[42,] 0.54417635 9.116473e-01 4.558237e-01
[43,] 0.57182459 8.563508e-01 4.281754e-01
[44,] 0.55471551 8.905690e-01 4.452845e-01
[45,] 0.60036003 7.992799e-01 3.996400e-01
[46,] 0.55686674 8.862665e-01 4.431333e-01
[47,] 0.61966279 7.606744e-01 3.803372e-01
[48,] 0.57591719 8.481656e-01 4.240828e-01
[49,] 0.54358541 9.128292e-01 4.564146e-01
[50,] 0.53406338 9.318732e-01 4.659366e-01
[51,] 0.49293278 9.858656e-01 5.070672e-01
[52,] 0.68567111 6.286578e-01 3.143289e-01
[53,] 0.64464334 7.107133e-01 3.553567e-01
[54,] 0.60061458 7.987708e-01 3.993854e-01
[55,] 0.55706811 8.858638e-01 4.429319e-01
[56,] 0.51080210 9.783958e-01 4.891979e-01
[57,] 0.56560783 8.687843e-01 4.343922e-01
[58,] 0.53296338 9.340732e-01 4.670366e-01
[59,] 0.49931080 9.986216e-01 5.006892e-01
[60,] 0.46147737 9.229547e-01 5.385226e-01
[61,] 0.48610607 9.722121e-01 5.138939e-01
[62,] 0.44405887 8.881177e-01 5.559411e-01
[63,] 0.41272082 8.254416e-01 5.872792e-01
[64,] 0.37201347 7.440269e-01 6.279865e-01
[65,] 0.33366265 6.673253e-01 6.663373e-01
[66,] 0.31657930 6.331586e-01 6.834207e-01
[67,] 0.29401640 5.880328e-01 7.059836e-01
[68,] 0.30087754 6.017551e-01 6.991225e-01
[69,] 0.26678871 5.335774e-01 7.332113e-01
[70,] 0.26438172 5.287634e-01 7.356183e-01
[71,] 0.22862524 4.572505e-01 7.713748e-01
[72,] 0.20492477 4.098495e-01 7.950752e-01
[73,] 0.18060986 3.612197e-01 8.193901e-01
[74,] 0.18201248 3.640250e-01 8.179875e-01
[75,] 0.16149730 3.229946e-01 8.385027e-01
[76,] 0.13794054 2.758811e-01 8.620595e-01
[77,] 0.15526592 3.105318e-01 8.447341e-01
[78,] 0.14064989 2.812998e-01 8.593501e-01
[79,] 0.16924977 3.384995e-01 8.307502e-01
[80,] 0.17703755 3.540751e-01 8.229625e-01
[81,] 0.15098978 3.019796e-01 8.490102e-01
[82,] 0.15953495 3.190699e-01 8.404651e-01
[83,] 0.13947558 2.789512e-01 8.605244e-01
[84,] 0.13520102 2.704020e-01 8.647990e-01
[85,] 0.14769372 2.953874e-01 8.523063e-01
[86,] 0.16232122 3.246424e-01 8.376788e-01
[87,] 0.15281066 3.056213e-01 8.471893e-01
[88,] 0.12933519 2.586704e-01 8.706648e-01
[89,] 0.11101144 2.220229e-01 8.889886e-01
[90,] 0.09103493 1.820699e-01 9.089651e-01
[91,] 0.07811856 1.562371e-01 9.218814e-01
[92,] 0.06313343 1.262669e-01 9.368666e-01
[93,] 0.05581108 1.116222e-01 9.441889e-01
[94,] 0.18450281 3.690056e-01 8.154972e-01
[95,] 0.19371372 3.874274e-01 8.062863e-01
[96,] 0.21659342 4.331868e-01 7.834066e-01
[97,] 0.18416627 3.683325e-01 8.158337e-01
[98,] 0.19501419 3.900284e-01 8.049858e-01
[99,] 0.21737107 4.347421e-01 7.826289e-01
[100,] 0.30860885 6.172177e-01 6.913912e-01
[101,] 0.35143888 7.028778e-01 6.485611e-01
[102,] 0.31506125 6.301225e-01 6.849388e-01
[103,] 0.27537227 5.507445e-01 7.246277e-01
[104,] 0.24523167 4.904633e-01 7.547683e-01
[105,] 0.24727191 4.945438e-01 7.527281e-01
[106,] 0.21477757 4.295551e-01 7.852224e-01
[107,] 0.18515984 3.703197e-01 8.148402e-01
[108,] 0.20721581 4.144316e-01 7.927842e-01
[109,] 0.17554657 3.510931e-01 8.244534e-01
[110,] 0.15507373 3.101475e-01 8.449263e-01
[111,] 0.14190394 2.838079e-01 8.580961e-01
[112,] 0.28528496 5.705699e-01 7.147150e-01
[113,] 0.30389573 6.077915e-01 6.961043e-01
[114,] 0.46225212 9.245042e-01 5.377479e-01
[115,] 0.45607999 9.121600e-01 5.439200e-01
[116,] 0.40719820 8.143964e-01 5.928018e-01
[117,] 0.53063866 9.387227e-01 4.693613e-01
[118,] 0.55973819 8.805236e-01 4.402618e-01
[119,] 0.51459972 9.708006e-01 4.854003e-01
[120,] 0.47603033 9.520607e-01 5.239697e-01
[121,] 0.51429295 9.714141e-01 4.857070e-01
[122,] 0.55875581 8.824884e-01 4.412442e-01
[123,] 0.65616175 6.876765e-01 3.438382e-01
[124,] 0.60645330 7.870934e-01 3.935467e-01
[125,] 0.58105503 8.378899e-01 4.189450e-01
[126,] 0.56241075 8.751785e-01 4.375892e-01
[127,] 0.53004659 9.399068e-01 4.699534e-01
[128,] 0.51250194 9.749961e-01 4.874981e-01
[129,] 0.45504136 9.100827e-01 5.449586e-01
[130,] 0.41571978 8.314396e-01 5.842802e-01
[131,] 0.53203662 9.359268e-01 4.679634e-01
[132,] 0.47439559 9.487912e-01 5.256044e-01
[133,] 0.43723195 8.744639e-01 5.627680e-01
[134,] 0.41398846 8.279769e-01 5.860115e-01
[135,] 0.39114214 7.822843e-01 6.088579e-01
[136,] 0.79449324 4.110135e-01 2.055068e-01
[137,] 0.83333295 3.333341e-01 1.666670e-01
[138,] 0.79415592 4.116882e-01 2.058441e-01
[139,] 0.73673219 5.265356e-01 2.632678e-01
[140,] 0.69831594 6.033681e-01 3.016841e-01
[141,] 0.99943089 1.138218e-03 5.691088e-04
[142,] 0.99967486 6.502896e-04 3.251448e-04
[143,] 1.00000000 3.043927e-09 1.521963e-09
[144,] 0.99999999 1.907636e-08 9.538181e-09
[145,] 0.99999998 3.615490e-08 1.807745e-08
[146,] 0.99999988 2.480456e-07 1.240228e-07
[147,] 0.99999918 1.644382e-06 8.221909e-07
[148,] 0.99999475 1.049981e-05 5.249907e-06
[149,] 0.99996795 6.410252e-05 3.205126e-05
[150,] 0.99987308 2.538325e-04 1.269163e-04
[151,] 0.99958162 8.367588e-04 4.183794e-04
[152,] 0.99780284 4.394323e-03 2.197162e-03
[153,] 0.98744918 2.510165e-02 1.255082e-02
> postscript(file="/var/wessaorg/rcomp/tmp/1fwxr1321903495.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2yidh1321903495.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/35yye1321903495.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/42rhp1321903495.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/5nd701321903495.ps",horizontal=F,onefile=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 = 164
Frequency = 1
1 2 3 4 5 6
6.0417909 19.6026340 -22.4497068 10.5998793 -21.2079306 18.3455888
7 8 9 10 11 12
-48.7292661 -11.3970526 7.3629013 -17.1272639 24.9472720 55.3743965
13 14 15 16 17 18
12.4827676 22.4996825 -10.6485097 13.0935047 9.9693828 -45.8157501
19 20 21 22 23 24
-7.4971651 37.1141989 5.0192824 -23.5329045 -0.4857541 62.0175522
25 26 27 28 29 30
25.5773707 12.7852275 -19.1721967 21.6469399 12.8776186 17.0143998
31 32 33 34 35 36
27.8474729 26.1935331 16.6781047 32.0338457 -2.1238036 -7.2110829
37 38 39 40 41 42
-3.6000324 -12.7115503 -30.6232464 -3.5878261 -20.3492864 2.1530009
43 44 45 46 47 48
3.8887162 8.9094945 -25.7021830 -38.9187015 16.2572849 30.7643650
49 50 51 52 53 54
16.6012118 35.8232342 -1.1563009 -24.7219368 -6.2984232 17.4761550
55 56 57 58 59 60
-15.4493092 -7.7462651 53.8499141 -4.6553516 -3.3963470 6.6313575
61 62 63 64 65 66
-3.2228074 -34.3014304 -10.2557023 13.0622558 11.4709590 -25.4271983
67 68 69 70 71 72
8.0044953 13.9456260 7.4190159 8.2773521 19.5953102 17.5890952
73 74 75 76 77 78
26.5908253 -5.6239576 24.2998606 0.4072072 -12.6672444 11.3158407
79 80 81 82 83 84
25.3248104 12.9656091 0.5097610 -31.8328389 15.7262741 -30.8109518
85 86 87 88 89 90
-21.5532797 3.5277847 27.0899603 -12.5947522 -20.6353685 28.0065389
91 92 93 94 95 96
-27.1337924 18.4190159 3.2004592 9.6919569 1.1048315 11.6628357
97 98 99 100 101 102
-1.9467981 -16.2224939 58.7664928 -27.3606973 28.3220557 -1.0780755
103 104 105 106 107 108
-26.5098244 27.3906058 -42.4791415 -33.8150390 -9.0642232 -4.8047368
109 110 111 112 113 114
6.0743779 20.1783483 7.0868079 5.3514903 -29.6249766 -4.0388758
115 116 117 118 119 120
-12.9661543 13.5347108 -50.1757467 -30.0447774 -45.1885744 -24.6069530
121 122 123 124 125 126
-3.6443383 42.8682512 22.0948428 2.2842782 -15.8913050 26.0944451
127 128 129 130 131 132
32.0798818 34.6583509 7.2959972 14.6555962 17.4044525 8.5904277
133 134 135 136 137 138
9.2842782 -4.0178449 -16.3561283 27.0857889 -8.4576575 4.8755750
139 140 141 142 143 144
7.9513592 8.0535995 -31.7242938 -47.9903985 1.0691819 -2.2650697
145 146 147 148 149 150
2.4931541 65.8194605 9.7712911 16.1027879 -22.2207582 -27.3901265
151 152 153 154 155 156
-22.2907250 -22.3606918 -22.2207582 -22.2207582 -20.7409850 -29.2470460
157 158 159 160 161 162
-22.2207582 -22.5006254 -24.8054423 -25.1466200 -24.1577176 -15.4583631
163 164
-22.3606918 -27.9349895
> postscript(file="/var/wessaorg/rcomp/tmp/6hj511321903495.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 164
Frequency = 1
lag(myerror, k = 1) myerror
0 6.0417909 NA
1 19.6026340 6.0417909
2 -22.4497068 19.6026340
3 10.5998793 -22.4497068
4 -21.2079306 10.5998793
5 18.3455888 -21.2079306
6 -48.7292661 18.3455888
7 -11.3970526 -48.7292661
8 7.3629013 -11.3970526
9 -17.1272639 7.3629013
10 24.9472720 -17.1272639
11 55.3743965 24.9472720
12 12.4827676 55.3743965
13 22.4996825 12.4827676
14 -10.6485097 22.4996825
15 13.0935047 -10.6485097
16 9.9693828 13.0935047
17 -45.8157501 9.9693828
18 -7.4971651 -45.8157501
19 37.1141989 -7.4971651
20 5.0192824 37.1141989
21 -23.5329045 5.0192824
22 -0.4857541 -23.5329045
23 62.0175522 -0.4857541
24 25.5773707 62.0175522
25 12.7852275 25.5773707
26 -19.1721967 12.7852275
27 21.6469399 -19.1721967
28 12.8776186 21.6469399
29 17.0143998 12.8776186
30 27.8474729 17.0143998
31 26.1935331 27.8474729
32 16.6781047 26.1935331
33 32.0338457 16.6781047
34 -2.1238036 32.0338457
35 -7.2110829 -2.1238036
36 -3.6000324 -7.2110829
37 -12.7115503 -3.6000324
38 -30.6232464 -12.7115503
39 -3.5878261 -30.6232464
40 -20.3492864 -3.5878261
41 2.1530009 -20.3492864
42 3.8887162 2.1530009
43 8.9094945 3.8887162
44 -25.7021830 8.9094945
45 -38.9187015 -25.7021830
46 16.2572849 -38.9187015
47 30.7643650 16.2572849
48 16.6012118 30.7643650
49 35.8232342 16.6012118
50 -1.1563009 35.8232342
51 -24.7219368 -1.1563009
52 -6.2984232 -24.7219368
53 17.4761550 -6.2984232
54 -15.4493092 17.4761550
55 -7.7462651 -15.4493092
56 53.8499141 -7.7462651
57 -4.6553516 53.8499141
58 -3.3963470 -4.6553516
59 6.6313575 -3.3963470
60 -3.2228074 6.6313575
61 -34.3014304 -3.2228074
62 -10.2557023 -34.3014304
63 13.0622558 -10.2557023
64 11.4709590 13.0622558
65 -25.4271983 11.4709590
66 8.0044953 -25.4271983
67 13.9456260 8.0044953
68 7.4190159 13.9456260
69 8.2773521 7.4190159
70 19.5953102 8.2773521
71 17.5890952 19.5953102
72 26.5908253 17.5890952
73 -5.6239576 26.5908253
74 24.2998606 -5.6239576
75 0.4072072 24.2998606
76 -12.6672444 0.4072072
77 11.3158407 -12.6672444
78 25.3248104 11.3158407
79 12.9656091 25.3248104
80 0.5097610 12.9656091
81 -31.8328389 0.5097610
82 15.7262741 -31.8328389
83 -30.8109518 15.7262741
84 -21.5532797 -30.8109518
85 3.5277847 -21.5532797
86 27.0899603 3.5277847
87 -12.5947522 27.0899603
88 -20.6353685 -12.5947522
89 28.0065389 -20.6353685
90 -27.1337924 28.0065389
91 18.4190159 -27.1337924
92 3.2004592 18.4190159
93 9.6919569 3.2004592
94 1.1048315 9.6919569
95 11.6628357 1.1048315
96 -1.9467981 11.6628357
97 -16.2224939 -1.9467981
98 58.7664928 -16.2224939
99 -27.3606973 58.7664928
100 28.3220557 -27.3606973
101 -1.0780755 28.3220557
102 -26.5098244 -1.0780755
103 27.3906058 -26.5098244
104 -42.4791415 27.3906058
105 -33.8150390 -42.4791415
106 -9.0642232 -33.8150390
107 -4.8047368 -9.0642232
108 6.0743779 -4.8047368
109 20.1783483 6.0743779
110 7.0868079 20.1783483
111 5.3514903 7.0868079
112 -29.6249766 5.3514903
113 -4.0388758 -29.6249766
114 -12.9661543 -4.0388758
115 13.5347108 -12.9661543
116 -50.1757467 13.5347108
117 -30.0447774 -50.1757467
118 -45.1885744 -30.0447774
119 -24.6069530 -45.1885744
120 -3.6443383 -24.6069530
121 42.8682512 -3.6443383
122 22.0948428 42.8682512
123 2.2842782 22.0948428
124 -15.8913050 2.2842782
125 26.0944451 -15.8913050
126 32.0798818 26.0944451
127 34.6583509 32.0798818
128 7.2959972 34.6583509
129 14.6555962 7.2959972
130 17.4044525 14.6555962
131 8.5904277 17.4044525
132 9.2842782 8.5904277
133 -4.0178449 9.2842782
134 -16.3561283 -4.0178449
135 27.0857889 -16.3561283
136 -8.4576575 27.0857889
137 4.8755750 -8.4576575
138 7.9513592 4.8755750
139 8.0535995 7.9513592
140 -31.7242938 8.0535995
141 -47.9903985 -31.7242938
142 1.0691819 -47.9903985
143 -2.2650697 1.0691819
144 2.4931541 -2.2650697
145 65.8194605 2.4931541
146 9.7712911 65.8194605
147 16.1027879 9.7712911
148 -22.2207582 16.1027879
149 -27.3901265 -22.2207582
150 -22.2907250 -27.3901265
151 -22.3606918 -22.2907250
152 -22.2207582 -22.3606918
153 -22.2207582 -22.2207582
154 -20.7409850 -22.2207582
155 -29.2470460 -20.7409850
156 -22.2207582 -29.2470460
157 -22.5006254 -22.2207582
158 -24.8054423 -22.5006254
159 -25.1466200 -24.8054423
160 -24.1577176 -25.1466200
161 -15.4583631 -24.1577176
162 -22.3606918 -15.4583631
163 -27.9349895 -22.3606918
164 NA -27.9349895
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 19.6026340 6.0417909
[2,] -22.4497068 19.6026340
[3,] 10.5998793 -22.4497068
[4,] -21.2079306 10.5998793
[5,] 18.3455888 -21.2079306
[6,] -48.7292661 18.3455888
[7,] -11.3970526 -48.7292661
[8,] 7.3629013 -11.3970526
[9,] -17.1272639 7.3629013
[10,] 24.9472720 -17.1272639
[11,] 55.3743965 24.9472720
[12,] 12.4827676 55.3743965
[13,] 22.4996825 12.4827676
[14,] -10.6485097 22.4996825
[15,] 13.0935047 -10.6485097
[16,] 9.9693828 13.0935047
[17,] -45.8157501 9.9693828
[18,] -7.4971651 -45.8157501
[19,] 37.1141989 -7.4971651
[20,] 5.0192824 37.1141989
[21,] -23.5329045 5.0192824
[22,] -0.4857541 -23.5329045
[23,] 62.0175522 -0.4857541
[24,] 25.5773707 62.0175522
[25,] 12.7852275 25.5773707
[26,] -19.1721967 12.7852275
[27,] 21.6469399 -19.1721967
[28,] 12.8776186 21.6469399
[29,] 17.0143998 12.8776186
[30,] 27.8474729 17.0143998
[31,] 26.1935331 27.8474729
[32,] 16.6781047 26.1935331
[33,] 32.0338457 16.6781047
[34,] -2.1238036 32.0338457
[35,] -7.2110829 -2.1238036
[36,] -3.6000324 -7.2110829
[37,] -12.7115503 -3.6000324
[38,] -30.6232464 -12.7115503
[39,] -3.5878261 -30.6232464
[40,] -20.3492864 -3.5878261
[41,] 2.1530009 -20.3492864
[42,] 3.8887162 2.1530009
[43,] 8.9094945 3.8887162
[44,] -25.7021830 8.9094945
[45,] -38.9187015 -25.7021830
[46,] 16.2572849 -38.9187015
[47,] 30.7643650 16.2572849
[48,] 16.6012118 30.7643650
[49,] 35.8232342 16.6012118
[50,] -1.1563009 35.8232342
[51,] -24.7219368 -1.1563009
[52,] -6.2984232 -24.7219368
[53,] 17.4761550 -6.2984232
[54,] -15.4493092 17.4761550
[55,] -7.7462651 -15.4493092
[56,] 53.8499141 -7.7462651
[57,] -4.6553516 53.8499141
[58,] -3.3963470 -4.6553516
[59,] 6.6313575 -3.3963470
[60,] -3.2228074 6.6313575
[61,] -34.3014304 -3.2228074
[62,] -10.2557023 -34.3014304
[63,] 13.0622558 -10.2557023
[64,] 11.4709590 13.0622558
[65,] -25.4271983 11.4709590
[66,] 8.0044953 -25.4271983
[67,] 13.9456260 8.0044953
[68,] 7.4190159 13.9456260
[69,] 8.2773521 7.4190159
[70,] 19.5953102 8.2773521
[71,] 17.5890952 19.5953102
[72,] 26.5908253 17.5890952
[73,] -5.6239576 26.5908253
[74,] 24.2998606 -5.6239576
[75,] 0.4072072 24.2998606
[76,] -12.6672444 0.4072072
[77,] 11.3158407 -12.6672444
[78,] 25.3248104 11.3158407
[79,] 12.9656091 25.3248104
[80,] 0.5097610 12.9656091
[81,] -31.8328389 0.5097610
[82,] 15.7262741 -31.8328389
[83,] -30.8109518 15.7262741
[84,] -21.5532797 -30.8109518
[85,] 3.5277847 -21.5532797
[86,] 27.0899603 3.5277847
[87,] -12.5947522 27.0899603
[88,] -20.6353685 -12.5947522
[89,] 28.0065389 -20.6353685
[90,] -27.1337924 28.0065389
[91,] 18.4190159 -27.1337924
[92,] 3.2004592 18.4190159
[93,] 9.6919569 3.2004592
[94,] 1.1048315 9.6919569
[95,] 11.6628357 1.1048315
[96,] -1.9467981 11.6628357
[97,] -16.2224939 -1.9467981
[98,] 58.7664928 -16.2224939
[99,] -27.3606973 58.7664928
[100,] 28.3220557 -27.3606973
[101,] -1.0780755 28.3220557
[102,] -26.5098244 -1.0780755
[103,] 27.3906058 -26.5098244
[104,] -42.4791415 27.3906058
[105,] -33.8150390 -42.4791415
[106,] -9.0642232 -33.8150390
[107,] -4.8047368 -9.0642232
[108,] 6.0743779 -4.8047368
[109,] 20.1783483 6.0743779
[110,] 7.0868079 20.1783483
[111,] 5.3514903 7.0868079
[112,] -29.6249766 5.3514903
[113,] -4.0388758 -29.6249766
[114,] -12.9661543 -4.0388758
[115,] 13.5347108 -12.9661543
[116,] -50.1757467 13.5347108
[117,] -30.0447774 -50.1757467
[118,] -45.1885744 -30.0447774
[119,] -24.6069530 -45.1885744
[120,] -3.6443383 -24.6069530
[121,] 42.8682512 -3.6443383
[122,] 22.0948428 42.8682512
[123,] 2.2842782 22.0948428
[124,] -15.8913050 2.2842782
[125,] 26.0944451 -15.8913050
[126,] 32.0798818 26.0944451
[127,] 34.6583509 32.0798818
[128,] 7.2959972 34.6583509
[129,] 14.6555962 7.2959972
[130,] 17.4044525 14.6555962
[131,] 8.5904277 17.4044525
[132,] 9.2842782 8.5904277
[133,] -4.0178449 9.2842782
[134,] -16.3561283 -4.0178449
[135,] 27.0857889 -16.3561283
[136,] -8.4576575 27.0857889
[137,] 4.8755750 -8.4576575
[138,] 7.9513592 4.8755750
[139,] 8.0535995 7.9513592
[140,] -31.7242938 8.0535995
[141,] -47.9903985 -31.7242938
[142,] 1.0691819 -47.9903985
[143,] -2.2650697 1.0691819
[144,] 2.4931541 -2.2650697
[145,] 65.8194605 2.4931541
[146,] 9.7712911 65.8194605
[147,] 16.1027879 9.7712911
[148,] -22.2207582 16.1027879
[149,] -27.3901265 -22.2207582
[150,] -22.2907250 -27.3901265
[151,] -22.3606918 -22.2907250
[152,] -22.2207582 -22.3606918
[153,] -22.2207582 -22.2207582
[154,] -20.7409850 -22.2207582
[155,] -29.2470460 -20.7409850
[156,] -22.2207582 -29.2470460
[157,] -22.5006254 -22.2207582
[158,] -24.8054423 -22.5006254
[159,] -25.1466200 -24.8054423
[160,] -24.1577176 -25.1466200
[161,] -15.4583631 -24.1577176
[162,] -22.3606918 -15.4583631
[163,] -27.9349895 -22.3606918
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 19.6026340 6.0417909
2 -22.4497068 19.6026340
3 10.5998793 -22.4497068
4 -21.2079306 10.5998793
5 18.3455888 -21.2079306
6 -48.7292661 18.3455888
7 -11.3970526 -48.7292661
8 7.3629013 -11.3970526
9 -17.1272639 7.3629013
10 24.9472720 -17.1272639
11 55.3743965 24.9472720
12 12.4827676 55.3743965
13 22.4996825 12.4827676
14 -10.6485097 22.4996825
15 13.0935047 -10.6485097
16 9.9693828 13.0935047
17 -45.8157501 9.9693828
18 -7.4971651 -45.8157501
19 37.1141989 -7.4971651
20 5.0192824 37.1141989
21 -23.5329045 5.0192824
22 -0.4857541 -23.5329045
23 62.0175522 -0.4857541
24 25.5773707 62.0175522
25 12.7852275 25.5773707
26 -19.1721967 12.7852275
27 21.6469399 -19.1721967
28 12.8776186 21.6469399
29 17.0143998 12.8776186
30 27.8474729 17.0143998
31 26.1935331 27.8474729
32 16.6781047 26.1935331
33 32.0338457 16.6781047
34 -2.1238036 32.0338457
35 -7.2110829 -2.1238036
36 -3.6000324 -7.2110829
37 -12.7115503 -3.6000324
38 -30.6232464 -12.7115503
39 -3.5878261 -30.6232464
40 -20.3492864 -3.5878261
41 2.1530009 -20.3492864
42 3.8887162 2.1530009
43 8.9094945 3.8887162
44 -25.7021830 8.9094945
45 -38.9187015 -25.7021830
46 16.2572849 -38.9187015
47 30.7643650 16.2572849
48 16.6012118 30.7643650
49 35.8232342 16.6012118
50 -1.1563009 35.8232342
51 -24.7219368 -1.1563009
52 -6.2984232 -24.7219368
53 17.4761550 -6.2984232
54 -15.4493092 17.4761550
55 -7.7462651 -15.4493092
56 53.8499141 -7.7462651
57 -4.6553516 53.8499141
58 -3.3963470 -4.6553516
59 6.6313575 -3.3963470
60 -3.2228074 6.6313575
61 -34.3014304 -3.2228074
62 -10.2557023 -34.3014304
63 13.0622558 -10.2557023
64 11.4709590 13.0622558
65 -25.4271983 11.4709590
66 8.0044953 -25.4271983
67 13.9456260 8.0044953
68 7.4190159 13.9456260
69 8.2773521 7.4190159
70 19.5953102 8.2773521
71 17.5890952 19.5953102
72 26.5908253 17.5890952
73 -5.6239576 26.5908253
74 24.2998606 -5.6239576
75 0.4072072 24.2998606
76 -12.6672444 0.4072072
77 11.3158407 -12.6672444
78 25.3248104 11.3158407
79 12.9656091 25.3248104
80 0.5097610 12.9656091
81 -31.8328389 0.5097610
82 15.7262741 -31.8328389
83 -30.8109518 15.7262741
84 -21.5532797 -30.8109518
85 3.5277847 -21.5532797
86 27.0899603 3.5277847
87 -12.5947522 27.0899603
88 -20.6353685 -12.5947522
89 28.0065389 -20.6353685
90 -27.1337924 28.0065389
91 18.4190159 -27.1337924
92 3.2004592 18.4190159
93 9.6919569 3.2004592
94 1.1048315 9.6919569
95 11.6628357 1.1048315
96 -1.9467981 11.6628357
97 -16.2224939 -1.9467981
98 58.7664928 -16.2224939
99 -27.3606973 58.7664928
100 28.3220557 -27.3606973
101 -1.0780755 28.3220557
102 -26.5098244 -1.0780755
103 27.3906058 -26.5098244
104 -42.4791415 27.3906058
105 -33.8150390 -42.4791415
106 -9.0642232 -33.8150390
107 -4.8047368 -9.0642232
108 6.0743779 -4.8047368
109 20.1783483 6.0743779
110 7.0868079 20.1783483
111 5.3514903 7.0868079
112 -29.6249766 5.3514903
113 -4.0388758 -29.6249766
114 -12.9661543 -4.0388758
115 13.5347108 -12.9661543
116 -50.1757467 13.5347108
117 -30.0447774 -50.1757467
118 -45.1885744 -30.0447774
119 -24.6069530 -45.1885744
120 -3.6443383 -24.6069530
121 42.8682512 -3.6443383
122 22.0948428 42.8682512
123 2.2842782 22.0948428
124 -15.8913050 2.2842782
125 26.0944451 -15.8913050
126 32.0798818 26.0944451
127 34.6583509 32.0798818
128 7.2959972 34.6583509
129 14.6555962 7.2959972
130 17.4044525 14.6555962
131 8.5904277 17.4044525
132 9.2842782 8.5904277
133 -4.0178449 9.2842782
134 -16.3561283 -4.0178449
135 27.0857889 -16.3561283
136 -8.4576575 27.0857889
137 4.8755750 -8.4576575
138 7.9513592 4.8755750
139 8.0535995 7.9513592
140 -31.7242938 8.0535995
141 -47.9903985 -31.7242938
142 1.0691819 -47.9903985
143 -2.2650697 1.0691819
144 2.4931541 -2.2650697
145 65.8194605 2.4931541
146 9.7712911 65.8194605
147 16.1027879 9.7712911
148 -22.2207582 16.1027879
149 -27.3901265 -22.2207582
150 -22.2907250 -27.3901265
151 -22.3606918 -22.2907250
152 -22.2207582 -22.3606918
153 -22.2207582 -22.2207582
154 -20.7409850 -22.2207582
155 -29.2470460 -20.7409850
156 -22.2207582 -29.2470460
157 -22.5006254 -22.2207582
158 -24.8054423 -22.5006254
159 -25.1466200 -24.8054423
160 -24.1577176 -25.1466200
161 -15.4583631 -24.1577176
162 -22.3606918 -15.4583631
163 -27.9349895 -22.3606918
> 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/wessaorg/rcomp/tmp/7wqlt1321903495.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/8kab01321903495.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/969r51321903495.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/10r5mx1321903495.ps",horizontal=F,onefile=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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/114lc61321903495.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/wessaorg/rcomp/tmp/12dtv11321903495.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/wessaorg/rcomp/tmp/13732o1321903495.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/wessaorg/rcomp/tmp/14m8qi1321903495.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/wessaorg/rcomp/tmp/15ybcj1321903495.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/wessaorg/rcomp/tmp/16mnjs1321903495.tab")
+ }
>
> try(system("convert tmp/1fwxr1321903495.ps tmp/1fwxr1321903495.png",intern=TRUE))
character(0)
> try(system("convert tmp/2yidh1321903495.ps tmp/2yidh1321903495.png",intern=TRUE))
character(0)
> try(system("convert tmp/35yye1321903495.ps tmp/35yye1321903495.png",intern=TRUE))
character(0)
> try(system("convert tmp/42rhp1321903495.ps tmp/42rhp1321903495.png",intern=TRUE))
character(0)
> try(system("convert tmp/5nd701321903495.ps tmp/5nd701321903495.png",intern=TRUE))
character(0)
> try(system("convert tmp/6hj511321903495.ps tmp/6hj511321903495.png",intern=TRUE))
character(0)
> try(system("convert tmp/7wqlt1321903495.ps tmp/7wqlt1321903495.png",intern=TRUE))
character(0)
> try(system("convert tmp/8kab01321903495.ps tmp/8kab01321903495.png",intern=TRUE))
character(0)
> try(system("convert tmp/969r51321903495.ps tmp/969r51321903495.png",intern=TRUE))
character(0)
> try(system("convert tmp/10r5mx1321903495.ps tmp/10r5mx1321903495.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.558 0.539 5.167