R version 2.12.0 (2010-10-15)
Copyright (C) 2010 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.38555556
+ ,46
+ ,26
+ ,99
+ ,24.06138889
+ ,48
+ ,20
+ ,77
+ ,31.4825
+ ,37
+ ,24
+ ,90
+ ,42.36388889
+ ,75
+ ,25
+ ,96
+ ,23.94611111
+ ,31
+ ,15
+ ,41
+ ,10.34916667
+ ,18
+ ,16
+ ,64
+ ,85.01527778
+ ,79
+ ,20
+ ,76
+ ,9.097222222
+ ,16
+ ,18
+ ,67
+ ,32.36166667
+ ,38
+ ,19
+ ,72
+ ,36.26083333
+ ,24
+ ,20
+ ,75
+ ,44.96555556
+ ,65
+ ,30
+ ,113
+ ,35.63166667
+ ,74
+ ,37
+ ,139
+ ,28.43055556
+ ,43
+ ,23
+ ,76
+ ,53.61777778
+ ,42
+ ,36
+ ,123
+ ,39.32611111
+ ,55
+ ,29
+ ,110
+ ,70.43305556
+ ,121
+ ,35
+ ,133
+ ,50.30833333
+ ,42
+ ,24
+ ,92
+ ,55.12
+ ,102
+ ,22
+ ,83
+ ,31.62583333
+ ,36
+ ,19
+ ,72
+ ,44.42777778
+ ,50
+ ,30
+ ,115
+ ,46.33944444
+ ,48
+ ,27
+ ,99
+ ,79.63194444
+ ,56
+ ,26
+ ,92
+ ,25.46027778
+ ,19
+ ,15
+ ,56
+ ,30.07722222
+ ,32
+ ,30
+ ,120
+ ,40.65055556
+ ,77
+ ,28
+ ,107
+ ,40.31722222
+ ,90
+ ,24
+ ,90
+ ,44.92777778
+ ,81
+ ,21
+ ,78
+ ,44.69583333
+ ,55
+ ,27
+ ,103
+ ,29.69111111
+ ,34
+ ,21
+ ,81
+ ,52.26388889
+ ,38
+ ,30
+ ,114
+ ,52.61138889
+ ,53
+ ,30
+ ,115
+ ,35.96777778
+ ,48
+ ,33
+ ,118
+ ,56.675
+ ,63
+ ,30
+ ,113
+ ,17.42527778
+ ,25
+ ,20
+ ,75
+ ,67.67361111
+ ,56
+ ,27
+ ,103
+ ,46.45972222
+ ,37
+ ,25
+ ,93
+ ,73.48
+ ,83
+ ,30
+ ,114
+ ,33.89555556
+ ,50
+ ,20
+ ,76
+ ,22.49
+ ,26
+ ,8
+ ,27
+ ,58.27638889
+ ,108
+ ,24
+ ,92
+ ,62.27916667
+ ,55
+ ,25
+ ,96
+ ,32.21416667
+ ,41
+ ,25
+ ,92
+ ,38.38638889
+ ,49
+ ,21
+ ,76
+ ,22.52944444
+ ,31
+ ,21
+ ,79
+ ,25.86805556
+ ,49
+ ,21
+ ,57
+ ,84.93222222
+ ,96
+ ,26
+ ,99
+ ,21.88888889
+ ,42
+ ,26
+ ,82
+ ,44.12083333
+ ,55
+ ,30
+ ,113
+ ,61.59583333
+ ,70
+ ,34
+ ,129
+ ,36.41888889
+ ,39
+ ,30
+ ,110
+ ,35.75944444
+ ,53
+ ,18
+ ,78
+ ,6.718888889
+ ,24
+ ,4
+ ,12
+ ,71.57277778
+ ,209
+ ,31
+ ,114
+ ,18.06361111
+ ,17
+ ,18
+ ,67
+ ,27.24055556
+ ,58
+ ,14
+ ,52
+ ,48.21861111
+ ,27
+ ,20
+ ,76
+ ,50.01166667
+ ,58
+ ,36
+ ,138
+ ,54.79611111
+ ,114
+ ,24
+ ,92
+ ,58.90555556
+ ,75
+ ,26
+ ,93
+ ,39.32833333
+ ,51
+ ,22
+ ,83
+ ,68.08527778
+ ,86
+ ,31
+ ,118
+ ,57.46638889
+ ,77
+ ,21
+ ,77
+ ,40.47111111
+ ,62
+ ,31
+ ,122
+ ,47.39861111
+ ,60
+ ,26
+ ,99
+ ,39.46222222
+ ,39
+ ,24
+ ,92
+ ,31.89444444
+ ,35
+ ,15
+ ,58
+ ,31.51694444
+ ,86
+ ,19
+ ,73
+ ,40.35694444
+ ,102
+ ,28
+ ,103
+ ,41.94416667
+ ,49
+ ,24
+ ,92
+ ,25.50333333
+ ,35
+ ,18
+ ,69
+ ,33.00194444
+ ,33
+ ,25
+ ,95
+ ,19.2975
+ ,28
+ ,20
+ ,76
+ ,35.175
+ ,44
+ ,25
+ ,95
+ ,40.53
+ ,37
+ ,24
+ ,92
+ ,27.33138889
+ ,33
+ ,23
+ ,88
+ ,53.035
+ ,45
+ ,25
+ ,95
+ ,55.22138889
+ ,57
+ ,20
+ ,76
+ ,29.49805556
+ ,58
+ ,23
+ ,87
+ ,24.81055556
+ ,36
+ ,22
+ ,84
+ ,33.43388889
+ ,42
+ ,25
+ ,95
+ ,27.44194444
+ ,30
+ ,18
+ ,69
+ ,76.37583333
+ ,67
+ ,30
+ ,115
+ ,36.88833333
+ ,53
+ ,22
+ ,83
+ ,37.56972222
+ ,59
+ ,25
+ ,47
+ ,22.48694444
+ ,25
+ ,8
+ ,28
+ ,30.34361111
+ ,39
+ ,21
+ ,79
+ ,26.84277778
+ ,36
+ ,22
+ ,83
+ ,62.83083333
+ ,114
+ ,24
+ ,92
+ ,47.57944444
+ ,54
+ ,30
+ ,98
+ ,32.72638889
+ ,70
+ ,27
+ ,103
+ ,37.10027778
+ ,51
+ ,24
+ ,89
+ ,42.27583333
+ ,49
+ ,25
+ ,95
+ ,31.11222222
+ ,42
+ ,21
+ ,78
+ ,47.11472222
+ ,51
+ ,24
+ ,92
+ ,52.07861111
+ ,51
+ ,24
+ ,92
+ ,36.25916667
+ ,27
+ ,20
+ ,76
+ ,39.53861111
+ ,29
+ ,20
+ ,67
+ ,52.71222222
+ ,54
+ ,24
+ ,92
+ ,56.00083333
+ ,92
+ ,40
+ ,151
+ ,68.565
+ ,72
+ ,22
+ ,83
+ ,43.31861111
+ ,63
+ ,31
+ ,118
+ ,50.71694444
+ ,41
+ ,26
+ ,98
+ ,29.54194444
+ ,111
+ ,20
+ ,76
+ ,12.02416667
+ ,14
+ ,19
+ ,71
+ ,35.41472222
+ ,45
+ ,15
+ ,57
+ ,35.53611111
+ ,91
+ ,21
+ ,79
+ ,41.39055556
+ ,29
+ ,22
+ ,83
+ ,52.12583333
+ ,64
+ ,24
+ ,92
+ ,20.58666667
+ ,32
+ ,19
+ ,75
+ ,26.11277778
+ ,65
+ ,24
+ ,95
+ ,49.0625
+ ,42
+ ,23
+ ,88
+ ,39.42583333
+ ,55
+ ,27
+ ,99
+ ,6.371666667
+ ,10
+ ,1
+ ,0
+ ,34.97972222
+ ,53
+ ,24
+ ,91
+ ,17.1825
+ ,25
+ ,11
+ ,32
+ ,25.35833333
+ ,33
+ ,27
+ ,101
+ ,70.86111111
+ ,66
+ ,22
+ ,84
+ ,5.848333333
+ ,16
+ ,0
+ ,0
+ ,46.97027778
+ ,35
+ ,17
+ ,60
+ ,8.726111111
+ ,19
+ ,8
+ ,25
+ ,52.41694444
+ ,76
+ ,24
+ ,90
+ ,38.20666667
+ ,35
+ ,31
+ ,115
+ ,21.435
+ ,46
+ ,24
+ ,92
+ ,20.71305556
+ ,29
+ ,20
+ ,71
+ ,10.615
+ ,34
+ ,8
+ ,27
+ ,25.26694444
+ ,25
+ ,22
+ ,83
+ ,53.95111111
+ ,48
+ ,33
+ ,126
+ ,37.5725
+ ,38
+ ,33
+ ,125
+ ,67.85333333
+ ,50
+ ,31
+ ,119
+ ,56.04111111
+ ,65
+ ,33
+ ,127
+ ,71.22277778
+ ,72
+ ,35
+ ,133
+ ,38.65111111
+ ,23
+ ,21
+ ,79
+ ,21.24166667
+ ,29
+ ,20
+ ,76
+ ,52.63944444
+ ,194
+ ,24
+ ,92
+ ,77.87055556
+ ,114
+ ,29
+ ,109
+ ,14.16638889
+ ,15
+ ,20
+ ,76
+ ,70.35388889
+ ,86
+ ,27
+ ,100
+ ,28.6775
+ ,50
+ ,24
+ ,87
+ ,46.68305556
+ ,33
+ ,26
+ ,97
+ ,35.76888889
+ ,50
+ ,26
+ ,95
+ ,21.04055556
+ ,72
+ ,12
+ ,48
+ ,69.23111111
+ ,81
+ ,21
+ ,80
+ ,42.32388889
+ ,54
+ ,24
+ ,91
+ ,48.12777778
+ ,63
+ ,21
+ ,79
+ ,54.77694444
+ ,69
+ ,30
+ ,114
+ ,18.75194444
+ ,39
+ ,32
+ ,120
+ ,38.72472222
+ ,49
+ ,24
+ ,89
+ ,51.49055556
+ ,67
+ ,29
+ ,111
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4.08
+ ,10
+ ,0
+ ,0
+ ,0.027222222
+ ,1
+ ,0
+ ,0
+ ,0.126388889
+ ,2
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,38.30138889
+ ,58
+ ,20
+ ,74
+ ,51.46888889
+ ,72
+ ,27
+ ,107
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0.056388889
+ ,4
+ ,0
+ ,0
+ ,1.999722222
+ ,5
+ ,0
+ ,0
+ ,12.96111111
+ ,20
+ ,5
+ ,15
+ ,4.874166667
+ ,5
+ ,1
+ ,4
+ ,20.43527778
+ ,27
+ ,23
+ ,82
+ ,0.269166667
+ ,2
+ ,0
+ ,0
+ ,29.29916667
+ ,33
+ ,16
+ ,54)
+ ,dim=c(4
+ ,164)
+ ,dimnames=list(c('Total_time'
+ ,'Logins'
+ ,'Reviewed_compendiums'
+ ,'long_feedback')
+ ,1:164))
> y <- array(NA,dim=c(4,164),dimnames=list(c('Total_time','Logins','Reviewed_compendiums','long_feedback'),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
Reviewed_compendiums Total_time Logins long_feedback
1 26 47.38555556 46 99
2 20 24.06138889 48 77
3 24 31.48250000 37 90
4 25 42.36388889 75 96
5 15 23.94611111 31 41
6 16 10.34916667 18 64
7 20 85.01527778 79 76
8 18 9.09722222 16 67
9 19 32.36166667 38 72
10 20 36.26083333 24 75
11 30 44.96555556 65 113
12 37 35.63166667 74 139
13 23 28.43055556 43 76
14 36 53.61777778 42 123
15 29 39.32611111 55 110
16 35 70.43305556 121 133
17 24 50.30833333 42 92
18 22 55.12000000 102 83
19 19 31.62583333 36 72
20 30 44.42777778 50 115
21 27 46.33944444 48 99
22 26 79.63194444 56 92
23 15 25.46027778 19 56
24 30 30.07722222 32 120
25 28 40.65055556 77 107
26 24 40.31722222 90 90
27 21 44.92777778 81 78
28 27 44.69583333 55 103
29 21 29.69111111 34 81
30 30 52.26388889 38 114
31 30 52.61138889 53 115
32 33 35.96777778 48 118
33 30 56.67500000 63 113
34 20 17.42527778 25 75
35 27 67.67361111 56 103
36 25 46.45972222 37 93
37 30 73.48000000 83 114
38 20 33.89555556 50 76
39 8 22.49000000 26 27
40 24 58.27638889 108 92
41 25 62.27916667 55 96
42 25 32.21416667 41 92
43 21 38.38638889 49 76
44 21 22.52944444 31 79
45 21 25.86805556 49 57
46 26 84.93222222 96 99
47 26 21.88888889 42 82
48 30 44.12083333 55 113
49 34 61.59583333 70 129
50 30 36.41888889 39 110
51 18 35.75944444 53 78
52 4 6.71888889 24 12
53 31 71.57277778 209 114
54 18 18.06361111 17 67
55 14 27.24055556 58 52
56 20 48.21861111 27 76
57 36 50.01166667 58 138
58 24 54.79611111 114 92
59 26 58.90555556 75 93
60 22 39.32833333 51 83
61 31 68.08527778 86 118
62 21 57.46638889 77 77
63 31 40.47111111 62 122
64 26 47.39861111 60 99
65 24 39.46222222 39 92
66 15 31.89444444 35 58
67 19 31.51694444 86 73
68 28 40.35694444 102 103
69 24 41.94416667 49 92
70 18 25.50333333 35 69
71 25 33.00194444 33 95
72 20 19.29750000 28 76
73 25 35.17500000 44 95
74 24 40.53000000 37 92
75 23 27.33138889 33 88
76 25 53.03500000 45 95
77 20 55.22138889 57 76
78 23 29.49805556 58 87
79 22 24.81055556 36 84
80 25 33.43388889 42 95
81 18 27.44194444 30 69
82 30 76.37583333 67 115
83 22 36.88833333 53 83
84 25 37.56972222 59 47
85 8 22.48694444 25 28
86 21 30.34361111 39 79
87 22 26.84277778 36 83
88 24 62.83083333 114 92
89 30 47.57944444 54 98
90 27 32.72638889 70 103
91 24 37.10027778 51 89
92 25 42.27583333 49 95
93 21 31.11222222 42 78
94 24 47.11472222 51 92
95 24 52.07861111 51 92
96 20 36.25916667 27 76
97 20 39.53861111 29 67
98 24 52.71222222 54 92
99 40 56.00083333 92 151
100 22 68.56500000 72 83
101 31 43.31861111 63 118
102 26 50.71694444 41 98
103 20 29.54194444 111 76
104 19 12.02416667 14 71
105 15 35.41472222 45 57
106 21 35.53611111 91 79
107 22 41.39055556 29 83
108 24 52.12583333 64 92
109 19 20.58666667 32 75
110 24 26.11277778 65 95
111 23 49.06250000 42 88
112 27 39.42583333 55 99
113 1 6.37166667 10 0
114 24 34.97972222 53 91
115 11 17.18250000 25 32
116 27 25.35833333 33 101
117 22 70.86111111 66 84
118 0 5.84833333 16 0
119 17 46.97027778 35 60
120 8 8.72611111 19 25
121 24 52.41694444 76 90
122 31 38.20666667 35 115
123 24 21.43500000 46 92
124 20 20.71305556 29 71
125 8 10.61500000 34 27
126 22 25.26694444 25 83
127 33 53.95111111 48 126
128 33 37.57250000 38 125
129 31 67.85333333 50 119
130 33 56.04111111 65 127
131 35 71.22277778 72 133
132 21 38.65111111 23 79
133 20 21.24166667 29 76
134 24 52.63944444 194 92
135 29 77.87055556 114 109
136 20 14.16638889 15 76
137 27 70.35388889 86 100
138 24 28.67750000 50 87
139 26 46.68305556 33 97
140 26 35.76888889 50 95
141 12 21.04055556 72 48
142 21 69.23111111 81 80
143 24 42.32388889 54 91
144 21 48.12777778 63 79
145 30 54.77694444 69 114
146 32 18.75194444 39 120
147 24 38.72472222 49 89
148 29 51.49055556 67 111
149 0 0.00000000 0 0
150 0 4.08000000 10 0
151 0 0.02722222 1 0
152 0 0.12638889 2 0
153 0 0.00000000 0 0
154 0 0.00000000 0 0
155 20 38.30138889 58 74
156 27 51.46888889 72 107
157 0 0.00000000 0 0
158 0 0.05638889 4 0
159 0 1.99972222 5 0
160 5 12.96111111 20 15
161 1 4.87416667 5 4
162 23 20.43527778 27 82
163 0 0.26916667 2 0
164 16 29.29916667 33 54
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Total_time Logins long_feedback
0.8434492 0.0052882 0.0009164 0.2547275
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.9499 -0.5838 -0.2687 0.0949 11.9316
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.8434492 0.2872852 2.936 0.00382 **
Total_time 0.0052882 0.0094511 0.560 0.57658
Logins 0.0009164 0.0049365 0.186 0.85296
long_feedback 0.2547275 0.0047071 54.116 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.383 on 160 degrees of freedom
Multiple R-squared: 0.9753, Adjusted R-squared: 0.9748
F-statistic: 2104 on 3 and 160 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.789496288 4.210074e-01 2.105037e-01
[2,] 0.666956870 6.660863e-01 3.330431e-01
[3,] 0.550011969 8.999761e-01 4.499880e-01
[4,] 0.418846517 8.376930e-01 5.811535e-01
[5,] 0.441902806 8.838056e-01 5.580972e-01
[6,] 0.466938773 9.338775e-01 5.330612e-01
[7,] 0.619750370 7.604993e-01 3.802496e-01
[8,] 0.904089176 1.918216e-01 9.591082e-02
[9,] 0.866777368 2.664453e-01 1.332226e-01
[10,] 0.818912101 3.621758e-01 1.810879e-01
[11,] 0.796140089 4.077198e-01 2.038599e-01
[12,] 0.735963563 5.280729e-01 2.640364e-01
[13,] 0.685535798 6.289284e-01 3.144642e-01
[14,] 0.636011273 7.279775e-01 3.639887e-01
[15,] 0.569528288 8.609434e-01 4.304717e-01
[16,] 0.519856263 9.602875e-01 4.801437e-01
[17,] 0.465116510 9.302330e-01 5.348835e-01
[18,] 0.519384564 9.612309e-01 4.806154e-01
[19,] 0.453583506 9.071670e-01 5.464165e-01
[20,] 0.388780035 7.775601e-01 6.112200e-01
[21,] 0.326872805 6.537456e-01 6.731272e-01
[22,] 0.276639511 5.532790e-01 7.233605e-01
[23,] 0.243166984 4.863340e-01 7.568330e-01
[24,] 0.200482023 4.009640e-01 7.995180e-01
[25,] 0.165490908 3.309818e-01 8.345091e-01
[26,] 0.207300222 4.146004e-01 7.926998e-01
[27,] 0.166711237 3.334225e-01 8.332888e-01
[28,] 0.132293642 2.645873e-01 8.677064e-01
[29,] 0.111076106 2.221522e-01 8.889239e-01
[30,] 0.085623068 1.712461e-01 9.143769e-01
[31,] 0.066419926 1.328399e-01 9.335801e-01
[32,] 0.051772161 1.035443e-01 9.482278e-01
[33,] 0.038236338 7.647268e-02 9.617637e-01
[34,] 0.029051109 5.810222e-02 9.709489e-01
[35,] 0.023633665 4.726733e-02 9.763663e-01
[36,] 0.017514174 3.502835e-02 9.824858e-01
[37,] 0.012975398 2.595080e-02 9.870246e-01
[38,] 0.009121185 1.824237e-02 9.908788e-01
[39,] 0.348500883 6.970018e-01 6.514991e-01
[40,] 0.308133265 6.162665e-01 6.918667e-01
[41,] 0.639209255 7.215815e-01 3.607907e-01
[42,] 0.591185550 8.176289e-01 4.088145e-01
[43,] 0.542126728 9.157465e-01 4.578733e-01
[44,] 0.510462582 9.790748e-01 4.895374e-01
[45,] 0.706926485 5.861470e-01 2.930735e-01
[46,] 0.673197979 6.536040e-01 3.268020e-01
[47,] 0.638752366 7.224953e-01 3.612476e-01
[48,] 0.596123335 8.077533e-01 4.038767e-01
[49,] 0.557182252 8.856355e-01 4.428177e-01
[50,] 0.516295803 9.674084e-01 4.837042e-01
[51,] 0.470033087 9.400662e-01 5.299669e-01
[52,] 0.435461631 8.709233e-01 5.645384e-01
[53,] 0.417063906 8.341278e-01 5.829361e-01
[54,] 0.374313378 7.486268e-01 6.256866e-01
[55,] 0.331889115 6.637782e-01 6.681109e-01
[56,] 0.290294798 5.805896e-01 7.097052e-01
[57,] 0.280346918 5.606938e-01 7.196531e-01
[58,] 0.245028408 4.900568e-01 7.549716e-01
[59,] 0.215765607 4.315312e-01 7.842344e-01
[60,] 0.199689597 3.993792e-01 8.003104e-01
[61,] 0.179520903 3.590418e-01 8.204791e-01
[62,] 0.155537427 3.110749e-01 8.444626e-01
[63,] 0.133824352 2.676487e-01 8.661756e-01
[64,] 0.116573747 2.331475e-01 8.834263e-01
[65,] 0.096315803 1.926316e-01 9.036842e-01
[66,] 0.079999267 1.599985e-01 9.200007e-01
[67,] 0.064870922 1.297418e-01 9.351291e-01
[68,] 0.053403752 1.068075e-01 9.465962e-01
[69,] 0.043329637 8.665927e-02 9.566704e-01
[70,] 0.034297017 6.859403e-02 9.657030e-01
[71,] 0.027655705 5.531141e-02 9.723443e-01
[72,] 0.021369067 4.273813e-02 9.786309e-01
[73,] 0.016682990 3.336598e-02 9.833170e-01
[74,] 0.012614398 2.522880e-02 9.873856e-01
[75,] 0.010013464 2.002693e-02 9.899865e-01
[76,] 0.007761868 1.552374e-02 9.922381e-01
[77,] 0.005699706 1.139941e-02 9.943003e-01
[78,] 1.000000000 1.755592e-11 8.777960e-12
[79,] 1.000000000 3.364631e-11 1.682315e-11
[80,] 1.000000000 7.402256e-11 3.701128e-11
[81,] 1.000000000 1.606824e-10 8.034121e-11
[82,] 1.000000000 3.030754e-10 1.515377e-10
[83,] 1.000000000 2.617266e-15 1.308633e-15
[84,] 1.000000000 6.742040e-15 3.371020e-15
[85,] 1.000000000 1.613077e-14 8.065386e-15
[86,] 1.000000000 4.042482e-14 2.021241e-14
[87,] 1.000000000 1.016596e-13 5.082979e-14
[88,] 1.000000000 2.121336e-13 1.060668e-13
[89,] 1.000000000 4.301435e-13 2.150718e-13
[90,] 1.000000000 9.514166e-13 4.757083e-13
[91,] 1.000000000 4.587138e-14 2.293569e-14
[92,] 1.000000000 9.855586e-14 4.927793e-14
[93,] 1.000000000 2.318357e-13 1.159178e-13
[94,] 1.000000000 5.914445e-13 2.957222e-13
[95,] 1.000000000 1.490297e-12 7.451486e-13
[96,] 1.000000000 3.844525e-12 1.922263e-12
[97,] 1.000000000 9.006330e-12 4.503165e-12
[98,] 1.000000000 2.258882e-11 1.129441e-11
[99,] 1.000000000 4.783211e-11 2.391605e-11
[100,] 1.000000000 1.130844e-10 5.654220e-11
[101,] 1.000000000 2.665462e-10 1.332731e-10
[102,] 1.000000000 5.342540e-10 2.671270e-10
[103,] 1.000000000 4.693197e-10 2.346599e-10
[104,] 1.000000000 2.732133e-10 1.366067e-10
[105,] 1.000000000 5.413609e-10 2.706804e-10
[106,] 1.000000000 8.653467e-10 4.326734e-10
[107,] 0.999999999 1.448678e-09 7.243390e-10
[108,] 0.999999998 3.326194e-09 1.663097e-09
[109,] 1.000000000 4.078528e-11 2.039264e-11
[110,] 1.000000000 1.091937e-10 5.459684e-11
[111,] 1.000000000 2.551300e-10 1.275650e-10
[112,] 1.000000000 5.024768e-10 2.512384e-10
[113,] 1.000000000 4.471768e-10 2.235884e-10
[114,] 1.000000000 2.360627e-10 1.180313e-10
[115,] 1.000000000 6.212677e-10 3.106338e-10
[116,] 0.999999999 1.307659e-09 6.538294e-10
[117,] 0.999999999 2.501529e-09 1.250765e-09
[118,] 0.999999999 1.707671e-09 8.538357e-10
[119,] 0.999999999 2.341259e-09 1.170630e-09
[120,] 0.999999997 6.360220e-09 3.180110e-09
[121,] 0.999999993 1.371163e-08 6.855813e-09
[122,] 0.999999983 3.363403e-08 1.681702e-08
[123,] 0.999999972 5.565384e-08 2.782692e-08
[124,] 0.999999966 6.821745e-08 3.410872e-08
[125,] 0.999999928 1.441286e-07 7.206431e-08
[126,] 0.999999822 3.554735e-07 1.777368e-07
[127,] 0.999999616 7.676974e-07 3.838487e-07
[128,] 0.999999272 1.456469e-06 7.282347e-07
[129,] 0.999998395 3.209265e-06 1.604633e-06
[130,] 0.999997496 5.008450e-06 2.504225e-06
[131,] 0.999996050 7.900202e-06 3.950101e-06
[132,] 0.999995768 8.464433e-06 4.232216e-06
[133,] 0.999991137 1.772693e-05 8.863466e-06
[134,] 0.999986740 2.652050e-05 1.326025e-05
[135,] 0.999979308 4.138484e-05 2.069242e-05
[136,] 0.999948451 1.030984e-04 5.154920e-05
[137,] 0.999886502 2.269950e-04 1.134975e-04
[138,] 0.999742491 5.150183e-04 2.575092e-04
[139,] 0.999510461 9.790775e-04 4.895387e-04
[140,] 0.998898316 2.203368e-03 1.101684e-03
[141,] 0.997536290 4.927420e-03 2.463710e-03
[142,] 0.996994511 6.010978e-03 3.005489e-03
[143,] 0.994071876 1.185625e-02 5.928124e-03
[144,] 0.988229723 2.354055e-02 1.177028e-02
[145,] 0.976924883 4.615023e-02 2.307512e-02
[146,] 0.955596690 8.880662e-02 4.440331e-02
[147,] 0.922850896 1.542982e-01 7.714910e-02
[148,] 0.872862600 2.542748e-01 1.271374e-01
[149,] 0.882747259 2.345055e-01 1.172527e-01
[150,] 0.999776459 4.470825e-04 2.235412e-04
[151,] 0.999508183 9.836334e-04 4.918167e-04
> postscript(file="/var/www/rcomp/tmp/1tlzq1321905834.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/www/rcomp/tmp/28wzc1321905834.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/www/rcomp/tmp/3whby1321905834.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/www/rcomp/tmp/4d1xp1321905834.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/www/rcomp/tmp/5bvvd1321905834.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
-0.354215419 -0.628699289 0.030679354 -0.590054026 3.557680299 -1.217234769
7 8 9 10 11 12
-0.724720341 0.027036171 -0.389791135 -0.161763160 0.074984503 0.493181045
13 14 15 16 17 18
2.607505250 3.503032613 -0.121845778 -0.205564898 -0.582913408 -0.370797777
19 20 21 22 23 24
-0.384066982 -0.417879941 0.649483776 1.249186081 -0.260242299 -1.599132306
25 26 27 28 29 30
-0.384829022 -0.064612377 -0.024015957 -0.367149577 -0.664550416 -0.193594317
31 32 33 34 35 36
-0.463906172 1.864508922 0.014895048 -0.063072678 -0.489578012 0.187293684
37 38 39 40 41 42
-0.347030234 -0.427810096 0.136147945 -0.685535789 -0.677041875 0.513689322
43 44 45 46 47 48
0.549357748 -0.114473450 5.455380402 -0.598593450 4.114650528 0.088616050
49 50 51 52 53 54
-0.093182792 0.908191436 -2.949871145 0.042294913 0.547583495 -0.021296686
55 56 57 58 59 60
-0.286488160 -0.482475599 -0.313473200 -0.672629920 1.086652213 -0.240548948
61 62 63 64 65 66
-0.340161032 0.168070158 -1.191046063 -0.367114695 -0.522807240 -0.818385861
67 68 69 70 71 72
-0.684040932 0.612722573 -0.545096810 -0.586590757 -0.247327606 -0.330450285
73 74 75 76 77 78
-0.268900143 -0.526621014 -0.434247773 -0.364264544 -0.547001326 -0.213889248
79 80 81 82 83 84
-0.404756294 -0.257859840 -0.592260370 -0.602408479 -0.229478535 11.931609844
85 86 87 88 89 90
-0.117646962 -0.163128197 -0.160775661 -0.715119454 3.892155198 -0.317598970
91 92 93 94 95 96
0.242868476 -0.311033276 0.084785378 -0.574272837 -0.600523070 -0.419231193
97 98 99 100 101 102
1.854141028 -0.606623093 0.312237865 -0.414404794 -0.188110725 -0.112522863
103 104 105 106 107 108
-0.460690327 -0.005519366 -0.591438875 -0.238242541 -0.231292675 -0.612686582
109 110 111 112 113 114
-1.086205977 -1.240222295 -0.557415099 0.679629489 0.113691476 -0.257205431
115 116 117 118 119 120
1.891494166 0.264728573 -0.675776018 -0.889039684 0.592434501 0.724804825
121 122 123 124 125 126
-0.115768370 0.628765465 -0.433890091 0.934785029 0.191614225 -0.142361378
127 128 129 130 131 132
-0.268411339 0.082094643 -0.560669931 -0.549770842 -0.164835314 -0.192397120
133 134 135 136 137 138
-0.341647949 -0.734540581 -0.125020795 -0.291401951 0.232937209 0.797781609
139 140 141 142 143 144
0.170868381 0.722460558 -1.247621267 -0.661992824 -0.296959588 -0.279169818
145 146 147 148 149 150
-0.235293763 0.454343356 0.236110916 -0.451899128 -0.843449171 -0.874189642
151 152 153 154 155 156
-0.844509574 -0.845950437 -0.843449171 -0.843449171 0.051014262 -1.437456732
157 158 159 160 161 162
-0.843449171 -0.847413151 -0.858606408 0.248767796 -0.892717203 1.136084253
163 164
-0.846705480 1.216081524
> postscript(file="/var/www/rcomp/tmp/6vypo1321905834.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 -0.354215419 NA
1 -0.628699289 -0.354215419
2 0.030679354 -0.628699289
3 -0.590054026 0.030679354
4 3.557680299 -0.590054026
5 -1.217234769 3.557680299
6 -0.724720341 -1.217234769
7 0.027036171 -0.724720341
8 -0.389791135 0.027036171
9 -0.161763160 -0.389791135
10 0.074984503 -0.161763160
11 0.493181045 0.074984503
12 2.607505250 0.493181045
13 3.503032613 2.607505250
14 -0.121845778 3.503032613
15 -0.205564898 -0.121845778
16 -0.582913408 -0.205564898
17 -0.370797777 -0.582913408
18 -0.384066982 -0.370797777
19 -0.417879941 -0.384066982
20 0.649483776 -0.417879941
21 1.249186081 0.649483776
22 -0.260242299 1.249186081
23 -1.599132306 -0.260242299
24 -0.384829022 -1.599132306
25 -0.064612377 -0.384829022
26 -0.024015957 -0.064612377
27 -0.367149577 -0.024015957
28 -0.664550416 -0.367149577
29 -0.193594317 -0.664550416
30 -0.463906172 -0.193594317
31 1.864508922 -0.463906172
32 0.014895048 1.864508922
33 -0.063072678 0.014895048
34 -0.489578012 -0.063072678
35 0.187293684 -0.489578012
36 -0.347030234 0.187293684
37 -0.427810096 -0.347030234
38 0.136147945 -0.427810096
39 -0.685535789 0.136147945
40 -0.677041875 -0.685535789
41 0.513689322 -0.677041875
42 0.549357748 0.513689322
43 -0.114473450 0.549357748
44 5.455380402 -0.114473450
45 -0.598593450 5.455380402
46 4.114650528 -0.598593450
47 0.088616050 4.114650528
48 -0.093182792 0.088616050
49 0.908191436 -0.093182792
50 -2.949871145 0.908191436
51 0.042294913 -2.949871145
52 0.547583495 0.042294913
53 -0.021296686 0.547583495
54 -0.286488160 -0.021296686
55 -0.482475599 -0.286488160
56 -0.313473200 -0.482475599
57 -0.672629920 -0.313473200
58 1.086652213 -0.672629920
59 -0.240548948 1.086652213
60 -0.340161032 -0.240548948
61 0.168070158 -0.340161032
62 -1.191046063 0.168070158
63 -0.367114695 -1.191046063
64 -0.522807240 -0.367114695
65 -0.818385861 -0.522807240
66 -0.684040932 -0.818385861
67 0.612722573 -0.684040932
68 -0.545096810 0.612722573
69 -0.586590757 -0.545096810
70 -0.247327606 -0.586590757
71 -0.330450285 -0.247327606
72 -0.268900143 -0.330450285
73 -0.526621014 -0.268900143
74 -0.434247773 -0.526621014
75 -0.364264544 -0.434247773
76 -0.547001326 -0.364264544
77 -0.213889248 -0.547001326
78 -0.404756294 -0.213889248
79 -0.257859840 -0.404756294
80 -0.592260370 -0.257859840
81 -0.602408479 -0.592260370
82 -0.229478535 -0.602408479
83 11.931609844 -0.229478535
84 -0.117646962 11.931609844
85 -0.163128197 -0.117646962
86 -0.160775661 -0.163128197
87 -0.715119454 -0.160775661
88 3.892155198 -0.715119454
89 -0.317598970 3.892155198
90 0.242868476 -0.317598970
91 -0.311033276 0.242868476
92 0.084785378 -0.311033276
93 -0.574272837 0.084785378
94 -0.600523070 -0.574272837
95 -0.419231193 -0.600523070
96 1.854141028 -0.419231193
97 -0.606623093 1.854141028
98 0.312237865 -0.606623093
99 -0.414404794 0.312237865
100 -0.188110725 -0.414404794
101 -0.112522863 -0.188110725
102 -0.460690327 -0.112522863
103 -0.005519366 -0.460690327
104 -0.591438875 -0.005519366
105 -0.238242541 -0.591438875
106 -0.231292675 -0.238242541
107 -0.612686582 -0.231292675
108 -1.086205977 -0.612686582
109 -1.240222295 -1.086205977
110 -0.557415099 -1.240222295
111 0.679629489 -0.557415099
112 0.113691476 0.679629489
113 -0.257205431 0.113691476
114 1.891494166 -0.257205431
115 0.264728573 1.891494166
116 -0.675776018 0.264728573
117 -0.889039684 -0.675776018
118 0.592434501 -0.889039684
119 0.724804825 0.592434501
120 -0.115768370 0.724804825
121 0.628765465 -0.115768370
122 -0.433890091 0.628765465
123 0.934785029 -0.433890091
124 0.191614225 0.934785029
125 -0.142361378 0.191614225
126 -0.268411339 -0.142361378
127 0.082094643 -0.268411339
128 -0.560669931 0.082094643
129 -0.549770842 -0.560669931
130 -0.164835314 -0.549770842
131 -0.192397120 -0.164835314
132 -0.341647949 -0.192397120
133 -0.734540581 -0.341647949
134 -0.125020795 -0.734540581
135 -0.291401951 -0.125020795
136 0.232937209 -0.291401951
137 0.797781609 0.232937209
138 0.170868381 0.797781609
139 0.722460558 0.170868381
140 -1.247621267 0.722460558
141 -0.661992824 -1.247621267
142 -0.296959588 -0.661992824
143 -0.279169818 -0.296959588
144 -0.235293763 -0.279169818
145 0.454343356 -0.235293763
146 0.236110916 0.454343356
147 -0.451899128 0.236110916
148 -0.843449171 -0.451899128
149 -0.874189642 -0.843449171
150 -0.844509574 -0.874189642
151 -0.845950437 -0.844509574
152 -0.843449171 -0.845950437
153 -0.843449171 -0.843449171
154 0.051014262 -0.843449171
155 -1.437456732 0.051014262
156 -0.843449171 -1.437456732
157 -0.847413151 -0.843449171
158 -0.858606408 -0.847413151
159 0.248767796 -0.858606408
160 -0.892717203 0.248767796
161 1.136084253 -0.892717203
162 -0.846705480 1.136084253
163 1.216081524 -0.846705480
164 NA 1.216081524
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.628699289 -0.354215419
[2,] 0.030679354 -0.628699289
[3,] -0.590054026 0.030679354
[4,] 3.557680299 -0.590054026
[5,] -1.217234769 3.557680299
[6,] -0.724720341 -1.217234769
[7,] 0.027036171 -0.724720341
[8,] -0.389791135 0.027036171
[9,] -0.161763160 -0.389791135
[10,] 0.074984503 -0.161763160
[11,] 0.493181045 0.074984503
[12,] 2.607505250 0.493181045
[13,] 3.503032613 2.607505250
[14,] -0.121845778 3.503032613
[15,] -0.205564898 -0.121845778
[16,] -0.582913408 -0.205564898
[17,] -0.370797777 -0.582913408
[18,] -0.384066982 -0.370797777
[19,] -0.417879941 -0.384066982
[20,] 0.649483776 -0.417879941
[21,] 1.249186081 0.649483776
[22,] -0.260242299 1.249186081
[23,] -1.599132306 -0.260242299
[24,] -0.384829022 -1.599132306
[25,] -0.064612377 -0.384829022
[26,] -0.024015957 -0.064612377
[27,] -0.367149577 -0.024015957
[28,] -0.664550416 -0.367149577
[29,] -0.193594317 -0.664550416
[30,] -0.463906172 -0.193594317
[31,] 1.864508922 -0.463906172
[32,] 0.014895048 1.864508922
[33,] -0.063072678 0.014895048
[34,] -0.489578012 -0.063072678
[35,] 0.187293684 -0.489578012
[36,] -0.347030234 0.187293684
[37,] -0.427810096 -0.347030234
[38,] 0.136147945 -0.427810096
[39,] -0.685535789 0.136147945
[40,] -0.677041875 -0.685535789
[41,] 0.513689322 -0.677041875
[42,] 0.549357748 0.513689322
[43,] -0.114473450 0.549357748
[44,] 5.455380402 -0.114473450
[45,] -0.598593450 5.455380402
[46,] 4.114650528 -0.598593450
[47,] 0.088616050 4.114650528
[48,] -0.093182792 0.088616050
[49,] 0.908191436 -0.093182792
[50,] -2.949871145 0.908191436
[51,] 0.042294913 -2.949871145
[52,] 0.547583495 0.042294913
[53,] -0.021296686 0.547583495
[54,] -0.286488160 -0.021296686
[55,] -0.482475599 -0.286488160
[56,] -0.313473200 -0.482475599
[57,] -0.672629920 -0.313473200
[58,] 1.086652213 -0.672629920
[59,] -0.240548948 1.086652213
[60,] -0.340161032 -0.240548948
[61,] 0.168070158 -0.340161032
[62,] -1.191046063 0.168070158
[63,] -0.367114695 -1.191046063
[64,] -0.522807240 -0.367114695
[65,] -0.818385861 -0.522807240
[66,] -0.684040932 -0.818385861
[67,] 0.612722573 -0.684040932
[68,] -0.545096810 0.612722573
[69,] -0.586590757 -0.545096810
[70,] -0.247327606 -0.586590757
[71,] -0.330450285 -0.247327606
[72,] -0.268900143 -0.330450285
[73,] -0.526621014 -0.268900143
[74,] -0.434247773 -0.526621014
[75,] -0.364264544 -0.434247773
[76,] -0.547001326 -0.364264544
[77,] -0.213889248 -0.547001326
[78,] -0.404756294 -0.213889248
[79,] -0.257859840 -0.404756294
[80,] -0.592260370 -0.257859840
[81,] -0.602408479 -0.592260370
[82,] -0.229478535 -0.602408479
[83,] 11.931609844 -0.229478535
[84,] -0.117646962 11.931609844
[85,] -0.163128197 -0.117646962
[86,] -0.160775661 -0.163128197
[87,] -0.715119454 -0.160775661
[88,] 3.892155198 -0.715119454
[89,] -0.317598970 3.892155198
[90,] 0.242868476 -0.317598970
[91,] -0.311033276 0.242868476
[92,] 0.084785378 -0.311033276
[93,] -0.574272837 0.084785378
[94,] -0.600523070 -0.574272837
[95,] -0.419231193 -0.600523070
[96,] 1.854141028 -0.419231193
[97,] -0.606623093 1.854141028
[98,] 0.312237865 -0.606623093
[99,] -0.414404794 0.312237865
[100,] -0.188110725 -0.414404794
[101,] -0.112522863 -0.188110725
[102,] -0.460690327 -0.112522863
[103,] -0.005519366 -0.460690327
[104,] -0.591438875 -0.005519366
[105,] -0.238242541 -0.591438875
[106,] -0.231292675 -0.238242541
[107,] -0.612686582 -0.231292675
[108,] -1.086205977 -0.612686582
[109,] -1.240222295 -1.086205977
[110,] -0.557415099 -1.240222295
[111,] 0.679629489 -0.557415099
[112,] 0.113691476 0.679629489
[113,] -0.257205431 0.113691476
[114,] 1.891494166 -0.257205431
[115,] 0.264728573 1.891494166
[116,] -0.675776018 0.264728573
[117,] -0.889039684 -0.675776018
[118,] 0.592434501 -0.889039684
[119,] 0.724804825 0.592434501
[120,] -0.115768370 0.724804825
[121,] 0.628765465 -0.115768370
[122,] -0.433890091 0.628765465
[123,] 0.934785029 -0.433890091
[124,] 0.191614225 0.934785029
[125,] -0.142361378 0.191614225
[126,] -0.268411339 -0.142361378
[127,] 0.082094643 -0.268411339
[128,] -0.560669931 0.082094643
[129,] -0.549770842 -0.560669931
[130,] -0.164835314 -0.549770842
[131,] -0.192397120 -0.164835314
[132,] -0.341647949 -0.192397120
[133,] -0.734540581 -0.341647949
[134,] -0.125020795 -0.734540581
[135,] -0.291401951 -0.125020795
[136,] 0.232937209 -0.291401951
[137,] 0.797781609 0.232937209
[138,] 0.170868381 0.797781609
[139,] 0.722460558 0.170868381
[140,] -1.247621267 0.722460558
[141,] -0.661992824 -1.247621267
[142,] -0.296959588 -0.661992824
[143,] -0.279169818 -0.296959588
[144,] -0.235293763 -0.279169818
[145,] 0.454343356 -0.235293763
[146,] 0.236110916 0.454343356
[147,] -0.451899128 0.236110916
[148,] -0.843449171 -0.451899128
[149,] -0.874189642 -0.843449171
[150,] -0.844509574 -0.874189642
[151,] -0.845950437 -0.844509574
[152,] -0.843449171 -0.845950437
[153,] -0.843449171 -0.843449171
[154,] 0.051014262 -0.843449171
[155,] -1.437456732 0.051014262
[156,] -0.843449171 -1.437456732
[157,] -0.847413151 -0.843449171
[158,] -0.858606408 -0.847413151
[159,] 0.248767796 -0.858606408
[160,] -0.892717203 0.248767796
[161,] 1.136084253 -0.892717203
[162,] -0.846705480 1.136084253
[163,] 1.216081524 -0.846705480
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.628699289 -0.354215419
2 0.030679354 -0.628699289
3 -0.590054026 0.030679354
4 3.557680299 -0.590054026
5 -1.217234769 3.557680299
6 -0.724720341 -1.217234769
7 0.027036171 -0.724720341
8 -0.389791135 0.027036171
9 -0.161763160 -0.389791135
10 0.074984503 -0.161763160
11 0.493181045 0.074984503
12 2.607505250 0.493181045
13 3.503032613 2.607505250
14 -0.121845778 3.503032613
15 -0.205564898 -0.121845778
16 -0.582913408 -0.205564898
17 -0.370797777 -0.582913408
18 -0.384066982 -0.370797777
19 -0.417879941 -0.384066982
20 0.649483776 -0.417879941
21 1.249186081 0.649483776
22 -0.260242299 1.249186081
23 -1.599132306 -0.260242299
24 -0.384829022 -1.599132306
25 -0.064612377 -0.384829022
26 -0.024015957 -0.064612377
27 -0.367149577 -0.024015957
28 -0.664550416 -0.367149577
29 -0.193594317 -0.664550416
30 -0.463906172 -0.193594317
31 1.864508922 -0.463906172
32 0.014895048 1.864508922
33 -0.063072678 0.014895048
34 -0.489578012 -0.063072678
35 0.187293684 -0.489578012
36 -0.347030234 0.187293684
37 -0.427810096 -0.347030234
38 0.136147945 -0.427810096
39 -0.685535789 0.136147945
40 -0.677041875 -0.685535789
41 0.513689322 -0.677041875
42 0.549357748 0.513689322
43 -0.114473450 0.549357748
44 5.455380402 -0.114473450
45 -0.598593450 5.455380402
46 4.114650528 -0.598593450
47 0.088616050 4.114650528
48 -0.093182792 0.088616050
49 0.908191436 -0.093182792
50 -2.949871145 0.908191436
51 0.042294913 -2.949871145
52 0.547583495 0.042294913
53 -0.021296686 0.547583495
54 -0.286488160 -0.021296686
55 -0.482475599 -0.286488160
56 -0.313473200 -0.482475599
57 -0.672629920 -0.313473200
58 1.086652213 -0.672629920
59 -0.240548948 1.086652213
60 -0.340161032 -0.240548948
61 0.168070158 -0.340161032
62 -1.191046063 0.168070158
63 -0.367114695 -1.191046063
64 -0.522807240 -0.367114695
65 -0.818385861 -0.522807240
66 -0.684040932 -0.818385861
67 0.612722573 -0.684040932
68 -0.545096810 0.612722573
69 -0.586590757 -0.545096810
70 -0.247327606 -0.586590757
71 -0.330450285 -0.247327606
72 -0.268900143 -0.330450285
73 -0.526621014 -0.268900143
74 -0.434247773 -0.526621014
75 -0.364264544 -0.434247773
76 -0.547001326 -0.364264544
77 -0.213889248 -0.547001326
78 -0.404756294 -0.213889248
79 -0.257859840 -0.404756294
80 -0.592260370 -0.257859840
81 -0.602408479 -0.592260370
82 -0.229478535 -0.602408479
83 11.931609844 -0.229478535
84 -0.117646962 11.931609844
85 -0.163128197 -0.117646962
86 -0.160775661 -0.163128197
87 -0.715119454 -0.160775661
88 3.892155198 -0.715119454
89 -0.317598970 3.892155198
90 0.242868476 -0.317598970
91 -0.311033276 0.242868476
92 0.084785378 -0.311033276
93 -0.574272837 0.084785378
94 -0.600523070 -0.574272837
95 -0.419231193 -0.600523070
96 1.854141028 -0.419231193
97 -0.606623093 1.854141028
98 0.312237865 -0.606623093
99 -0.414404794 0.312237865
100 -0.188110725 -0.414404794
101 -0.112522863 -0.188110725
102 -0.460690327 -0.112522863
103 -0.005519366 -0.460690327
104 -0.591438875 -0.005519366
105 -0.238242541 -0.591438875
106 -0.231292675 -0.238242541
107 -0.612686582 -0.231292675
108 -1.086205977 -0.612686582
109 -1.240222295 -1.086205977
110 -0.557415099 -1.240222295
111 0.679629489 -0.557415099
112 0.113691476 0.679629489
113 -0.257205431 0.113691476
114 1.891494166 -0.257205431
115 0.264728573 1.891494166
116 -0.675776018 0.264728573
117 -0.889039684 -0.675776018
118 0.592434501 -0.889039684
119 0.724804825 0.592434501
120 -0.115768370 0.724804825
121 0.628765465 -0.115768370
122 -0.433890091 0.628765465
123 0.934785029 -0.433890091
124 0.191614225 0.934785029
125 -0.142361378 0.191614225
126 -0.268411339 -0.142361378
127 0.082094643 -0.268411339
128 -0.560669931 0.082094643
129 -0.549770842 -0.560669931
130 -0.164835314 -0.549770842
131 -0.192397120 -0.164835314
132 -0.341647949 -0.192397120
133 -0.734540581 -0.341647949
134 -0.125020795 -0.734540581
135 -0.291401951 -0.125020795
136 0.232937209 -0.291401951
137 0.797781609 0.232937209
138 0.170868381 0.797781609
139 0.722460558 0.170868381
140 -1.247621267 0.722460558
141 -0.661992824 -1.247621267
142 -0.296959588 -0.661992824
143 -0.279169818 -0.296959588
144 -0.235293763 -0.279169818
145 0.454343356 -0.235293763
146 0.236110916 0.454343356
147 -0.451899128 0.236110916
148 -0.843449171 -0.451899128
149 -0.874189642 -0.843449171
150 -0.844509574 -0.874189642
151 -0.845950437 -0.844509574
152 -0.843449171 -0.845950437
153 -0.843449171 -0.843449171
154 0.051014262 -0.843449171
155 -1.437456732 0.051014262
156 -0.843449171 -1.437456732
157 -0.847413151 -0.843449171
158 -0.858606408 -0.847413151
159 0.248767796 -0.858606408
160 -0.892717203 0.248767796
161 1.136084253 -0.892717203
162 -0.846705480 1.136084253
163 1.216081524 -0.846705480
> 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/rcomp/tmp/715pj1321905834.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/www/rcomp/tmp/85m9z1321905834.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/www/rcomp/tmp/979qf1321905834.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/www/rcomp/tmp/105ps11321905834.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/1173zl1321905834.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/rcomp/tmp/125xag1321905834.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/rcomp/tmp/13t6uo1321905834.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/rcomp/tmp/144jc51321905834.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/rcomp/tmp/15p2pu1321905834.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/rcomp/tmp/16oztw1321905834.tab")
+ }
>
> try(system("convert tmp/1tlzq1321905834.ps tmp/1tlzq1321905834.png",intern=TRUE))
character(0)
> try(system("convert tmp/28wzc1321905834.ps tmp/28wzc1321905834.png",intern=TRUE))
character(0)
> try(system("convert tmp/3whby1321905834.ps tmp/3whby1321905834.png",intern=TRUE))
character(0)
> try(system("convert tmp/4d1xp1321905834.ps tmp/4d1xp1321905834.png",intern=TRUE))
character(0)
> try(system("convert tmp/5bvvd1321905834.ps tmp/5bvvd1321905834.png",intern=TRUE))
character(0)
> try(system("convert tmp/6vypo1321905834.ps tmp/6vypo1321905834.png",intern=TRUE))
character(0)
> try(system("convert tmp/715pj1321905834.ps tmp/715pj1321905834.png",intern=TRUE))
character(0)
> try(system("convert tmp/85m9z1321905834.ps tmp/85m9z1321905834.png",intern=TRUE))
character(0)
> try(system("convert tmp/979qf1321905834.ps tmp/979qf1321905834.png",intern=TRUE))
character(0)
> try(system("convert tmp/105ps11321905834.ps tmp/105ps11321905834.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.130 0.360 5.476