R version 2.11.1 (2010-05-31)
Copyright (C) 2010 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(24,25,17,18,18,16,20,16,18,17,23,30,23,18,15,12,21,15,20,31,27,34,21,31,19,16,20,21,22,17,24,25,26,25,17,32,33,13,32,25,29,22,18,17,20,15,20,33,29,23,26,18,20,11,28,26,22,17,12,14,17,21,19,18,10,29,31,19,9,20,28,19,30,29,26,23,13,21,19,28,23,18,21,20,23,21,21,15,28,19,26,10,16,22,19,31,31,29,19,22,23,15,20,18,23,25,21,24,25,17,13,28,21,25,9,16,19,17,25,20,29,14,22,15,19,20,15,20,18,33,22,16,17,16,21,26,18,18,17,22,30,30,24,21,21,29,31,20,16,22,20,28,38,22,20,17,28,22,31),dim=c(1,159),dimnames=list(c('Concernovermistakes'),1:159))
> y <- array(NA,dim=c(1,159),dimnames=list(c('Concernovermistakes'),1:159))
> 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
> 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
Concernovermistakes M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 24 1 0 0 0 0 0 0 0 0 0 0 1
2 25 0 1 0 0 0 0 0 0 0 0 0 2
3 17 0 0 1 0 0 0 0 0 0 0 0 3
4 18 0 0 0 1 0 0 0 0 0 0 0 4
5 18 0 0 0 0 1 0 0 0 0 0 0 5
6 16 0 0 0 0 0 1 0 0 0 0 0 6
7 20 0 0 0 0 0 0 1 0 0 0 0 7
8 16 0 0 0 0 0 0 0 1 0 0 0 8
9 18 0 0 0 0 0 0 0 0 1 0 0 9
10 17 0 0 0 0 0 0 0 0 0 1 0 10
11 23 0 0 0 0 0 0 0 0 0 0 1 11
12 30 0 0 0 0 0 0 0 0 0 0 0 12
13 23 1 0 0 0 0 0 0 0 0 0 0 13
14 18 0 1 0 0 0 0 0 0 0 0 0 14
15 15 0 0 1 0 0 0 0 0 0 0 0 15
16 12 0 0 0 1 0 0 0 0 0 0 0 16
17 21 0 0 0 0 1 0 0 0 0 0 0 17
18 15 0 0 0 0 0 1 0 0 0 0 0 18
19 20 0 0 0 0 0 0 1 0 0 0 0 19
20 31 0 0 0 0 0 0 0 1 0 0 0 20
21 27 0 0 0 0 0 0 0 0 1 0 0 21
22 34 0 0 0 0 0 0 0 0 0 1 0 22
23 21 0 0 0 0 0 0 0 0 0 0 1 23
24 31 0 0 0 0 0 0 0 0 0 0 0 24
25 19 1 0 0 0 0 0 0 0 0 0 0 25
26 16 0 1 0 0 0 0 0 0 0 0 0 26
27 20 0 0 1 0 0 0 0 0 0 0 0 27
28 21 0 0 0 1 0 0 0 0 0 0 0 28
29 22 0 0 0 0 1 0 0 0 0 0 0 29
30 17 0 0 0 0 0 1 0 0 0 0 0 30
31 24 0 0 0 0 0 0 1 0 0 0 0 31
32 25 0 0 0 0 0 0 0 1 0 0 0 32
33 26 0 0 0 0 0 0 0 0 1 0 0 33
34 25 0 0 0 0 0 0 0 0 0 1 0 34
35 17 0 0 0 0 0 0 0 0 0 0 1 35
36 32 0 0 0 0 0 0 0 0 0 0 0 36
37 33 1 0 0 0 0 0 0 0 0 0 0 37
38 13 0 1 0 0 0 0 0 0 0 0 0 38
39 32 0 0 1 0 0 0 0 0 0 0 0 39
40 25 0 0 0 1 0 0 0 0 0 0 0 40
41 29 0 0 0 0 1 0 0 0 0 0 0 41
42 22 0 0 0 0 0 1 0 0 0 0 0 42
43 18 0 0 0 0 0 0 1 0 0 0 0 43
44 17 0 0 0 0 0 0 0 1 0 0 0 44
45 20 0 0 0 0 0 0 0 0 1 0 0 45
46 15 0 0 0 0 0 0 0 0 0 1 0 46
47 20 0 0 0 0 0 0 0 0 0 0 1 47
48 33 0 0 0 0 0 0 0 0 0 0 0 48
49 29 1 0 0 0 0 0 0 0 0 0 0 49
50 23 0 1 0 0 0 0 0 0 0 0 0 50
51 26 0 0 1 0 0 0 0 0 0 0 0 51
52 18 0 0 0 1 0 0 0 0 0 0 0 52
53 20 0 0 0 0 1 0 0 0 0 0 0 53
54 11 0 0 0 0 0 1 0 0 0 0 0 54
55 28 0 0 0 0 0 0 1 0 0 0 0 55
56 26 0 0 0 0 0 0 0 1 0 0 0 56
57 22 0 0 0 0 0 0 0 0 1 0 0 57
58 17 0 0 0 0 0 0 0 0 0 1 0 58
59 12 0 0 0 0 0 0 0 0 0 0 1 59
60 14 0 0 0 0 0 0 0 0 0 0 0 60
61 17 1 0 0 0 0 0 0 0 0 0 0 61
62 21 0 1 0 0 0 0 0 0 0 0 0 62
63 19 0 0 1 0 0 0 0 0 0 0 0 63
64 18 0 0 0 1 0 0 0 0 0 0 0 64
65 10 0 0 0 0 1 0 0 0 0 0 0 65
66 29 0 0 0 0 0 1 0 0 0 0 0 66
67 31 0 0 0 0 0 0 1 0 0 0 0 67
68 19 0 0 0 0 0 0 0 1 0 0 0 68
69 9 0 0 0 0 0 0 0 0 1 0 0 69
70 20 0 0 0 0 0 0 0 0 0 1 0 70
71 28 0 0 0 0 0 0 0 0 0 0 1 71
72 19 0 0 0 0 0 0 0 0 0 0 0 72
73 30 1 0 0 0 0 0 0 0 0 0 0 73
74 29 0 1 0 0 0 0 0 0 0 0 0 74
75 26 0 0 1 0 0 0 0 0 0 0 0 75
76 23 0 0 0 1 0 0 0 0 0 0 0 76
77 13 0 0 0 0 1 0 0 0 0 0 0 77
78 21 0 0 0 0 0 1 0 0 0 0 0 78
79 19 0 0 0 0 0 0 1 0 0 0 0 79
80 28 0 0 0 0 0 0 0 1 0 0 0 80
81 23 0 0 0 0 0 0 0 0 1 0 0 81
82 18 0 0 0 0 0 0 0 0 0 1 0 82
83 21 0 0 0 0 0 0 0 0 0 0 1 83
84 20 0 0 0 0 0 0 0 0 0 0 0 84
85 23 1 0 0 0 0 0 0 0 0 0 0 85
86 21 0 1 0 0 0 0 0 0 0 0 0 86
87 21 0 0 1 0 0 0 0 0 0 0 0 87
88 15 0 0 0 1 0 0 0 0 0 0 0 88
89 28 0 0 0 0 1 0 0 0 0 0 0 89
90 19 0 0 0 0 0 1 0 0 0 0 0 90
91 26 0 0 0 0 0 0 1 0 0 0 0 91
92 10 0 0 0 0 0 0 0 1 0 0 0 92
93 16 0 0 0 0 0 0 0 0 1 0 0 93
94 22 0 0 0 0 0 0 0 0 0 1 0 94
95 19 0 0 0 0 0 0 0 0 0 0 1 95
96 31 0 0 0 0 0 0 0 0 0 0 0 96
97 31 1 0 0 0 0 0 0 0 0 0 0 97
98 29 0 1 0 0 0 0 0 0 0 0 0 98
99 19 0 0 1 0 0 0 0 0 0 0 0 99
100 22 0 0 0 1 0 0 0 0 0 0 0 100
101 23 0 0 0 0 1 0 0 0 0 0 0 101
102 15 0 0 0 0 0 1 0 0 0 0 0 102
103 20 0 0 0 0 0 0 1 0 0 0 0 103
104 18 0 0 0 0 0 0 0 1 0 0 0 104
105 23 0 0 0 0 0 0 0 0 1 0 0 105
106 25 0 0 0 0 0 0 0 0 0 1 0 106
107 21 0 0 0 0 0 0 0 0 0 0 1 107
108 24 0 0 0 0 0 0 0 0 0 0 0 108
109 25 1 0 0 0 0 0 0 0 0 0 0 109
110 17 0 1 0 0 0 0 0 0 0 0 0 110
111 13 0 0 1 0 0 0 0 0 0 0 0 111
112 28 0 0 0 1 0 0 0 0 0 0 0 112
113 21 0 0 0 0 1 0 0 0 0 0 0 113
114 25 0 0 0 0 0 1 0 0 0 0 0 114
115 9 0 0 0 0 0 0 1 0 0 0 0 115
116 16 0 0 0 0 0 0 0 1 0 0 0 116
117 19 0 0 0 0 0 0 0 0 1 0 0 117
118 17 0 0 0 0 0 0 0 0 0 1 0 118
119 25 0 0 0 0 0 0 0 0 0 0 1 119
120 20 0 0 0 0 0 0 0 0 0 0 0 120
121 29 1 0 0 0 0 0 0 0 0 0 0 121
122 14 0 1 0 0 0 0 0 0 0 0 0 122
123 22 0 0 1 0 0 0 0 0 0 0 0 123
124 15 0 0 0 1 0 0 0 0 0 0 0 124
125 19 0 0 0 0 1 0 0 0 0 0 0 125
126 20 0 0 0 0 0 1 0 0 0 0 0 126
127 15 0 0 0 0 0 0 1 0 0 0 0 127
128 20 0 0 0 0 0 0 0 1 0 0 0 128
129 18 0 0 0 0 0 0 0 0 1 0 0 129
130 33 0 0 0 0 0 0 0 0 0 1 0 130
131 22 0 0 0 0 0 0 0 0 0 0 1 131
132 16 0 0 0 0 0 0 0 0 0 0 0 132
133 17 1 0 0 0 0 0 0 0 0 0 0 133
134 16 0 1 0 0 0 0 0 0 0 0 0 134
135 21 0 0 1 0 0 0 0 0 0 0 0 135
136 26 0 0 0 1 0 0 0 0 0 0 0 136
137 18 0 0 0 0 1 0 0 0 0 0 0 137
138 18 0 0 0 0 0 1 0 0 0 0 0 138
139 17 0 0 0 0 0 0 1 0 0 0 0 139
140 22 0 0 0 0 0 0 0 1 0 0 0 140
141 30 0 0 0 0 0 0 0 0 1 0 0 141
142 30 0 0 0 0 0 0 0 0 0 1 0 142
143 24 0 0 0 0 0 0 0 0 0 0 1 143
144 21 0 0 0 0 0 0 0 0 0 0 0 144
145 21 1 0 0 0 0 0 0 0 0 0 0 145
146 29 0 1 0 0 0 0 0 0 0 0 0 146
147 31 0 0 1 0 0 0 0 0 0 0 0 147
148 20 0 0 0 1 0 0 0 0 0 0 0 148
149 16 0 0 0 0 1 0 0 0 0 0 0 149
150 22 0 0 0 0 0 1 0 0 0 0 0 150
151 20 0 0 0 0 0 0 1 0 0 0 0 151
152 28 0 0 0 0 0 0 0 1 0 0 0 152
153 38 0 0 0 0 0 0 0 0 1 0 0 153
154 22 0 0 0 0 0 0 0 0 0 1 0 154
155 20 0 0 0 0 0 0 0 0 0 0 1 155
156 17 0 0 0 0 0 0 0 0 0 0 0 156
157 28 1 0 0 0 0 0 0 0 0 0 0 157
158 22 0 1 0 0 0 0 0 0 0 0 0 158
159 31 0 0 1 0 0 0 0 0 0 0 0 159
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
23.238311 1.263287 -2.742117 -1.318951 -3.572147 -3.808321
M6 M7 M8 M9 M10 M11
-4.429110 -3.126823 -2.439920 -1.445324 -0.989191 -2.686903
t
0.005405
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-13.166 -3.897 -0.507 3.825 15.380
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 23.238311 1.786634 13.007 <2e-16 ***
M1 1.263287 2.198322 0.575 0.5664
M2 -2.742117 2.198123 -1.247 0.2142
M3 -1.318951 2.197968 -0.600 0.5494
M4 -3.572147 2.239490 -1.595 0.1129
M5 -3.808321 2.239164 -1.701 0.0911 .
M6 -4.429110 2.238881 -1.978 0.0498 *
M7 -3.126823 2.238642 -1.397 0.1646
M8 -2.439920 2.238446 -1.090 0.2775
M9 -1.445324 2.238294 -0.646 0.5195
M10 -0.989191 2.238185 -0.442 0.6592
M11 -2.686903 2.238119 -1.201 0.2319
t 0.005405 0.009871 0.548 0.5848
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 5.706 on 146 degrees of freedom
Multiple R-squared: 0.08136, Adjusted R-squared: 0.005851
F-statistic: 1.077 on 12 and 146 DF, p-value: 0.3832
> 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.05656879 0.11313758 0.9434312
[2,] 0.08396590 0.16793181 0.9160341
[3,] 0.03675370 0.07350741 0.9632463
[4,] 0.01660351 0.03320701 0.9833965
[5,] 0.31258535 0.62517070 0.6874146
[6,] 0.32861486 0.65722973 0.6713851
[7,] 0.58356955 0.83286090 0.4164304
[8,] 0.51257756 0.97484489 0.4874224
[9,] 0.43507685 0.87015371 0.5649231
[10,] 0.43569323 0.87138647 0.5643068
[11,] 0.42543745 0.85087490 0.5745625
[12,] 0.36322860 0.72645721 0.6367714
[13,] 0.31984545 0.63969089 0.6801546
[14,] 0.25341155 0.50682309 0.7465885
[15,] 0.19622707 0.39245414 0.8037729
[16,] 0.15354742 0.30709483 0.8464526
[17,] 0.11545633 0.23091265 0.8845437
[18,] 0.08638576 0.17277151 0.9136142
[19,] 0.06475201 0.12950401 0.9352480
[20,] 0.06553398 0.13106796 0.9344660
[21,] 0.05346706 0.10693412 0.9465329
[22,] 0.07937975 0.15875950 0.9206202
[23,] 0.11544570 0.23089140 0.8845543
[24,] 0.22597393 0.45194785 0.7740261
[25,] 0.20754841 0.41509682 0.7924516
[26,] 0.21575528 0.43151055 0.7842447
[27,] 0.17886971 0.35773942 0.8211303
[28,] 0.18255695 0.36511389 0.8174431
[29,] 0.23334670 0.46669341 0.7666533
[30,] 0.22453795 0.44907591 0.7754620
[31,] 0.33273411 0.66546822 0.6672659
[32,] 0.28588622 0.57177243 0.7141138
[33,] 0.29881030 0.59762059 0.7011897
[34,] 0.26605995 0.53211989 0.7339401
[35,] 0.22970327 0.45940654 0.7702967
[36,] 0.20117335 0.40234671 0.7988266
[37,] 0.17386072 0.34772143 0.8261393
[38,] 0.15767713 0.31535427 0.8423229
[39,] 0.19240074 0.38480148 0.8075993
[40,] 0.20754962 0.41509924 0.7924504
[41,] 0.18973343 0.37946686 0.8102666
[42,] 0.16124596 0.32249192 0.8387540
[43,] 0.17074441 0.34148882 0.8292556
[44,] 0.22423202 0.44846405 0.7757680
[45,] 0.46091207 0.92182415 0.5390879
[46,] 0.50143053 0.99713895 0.4985695
[47,] 0.45381519 0.90763038 0.5461848
[48,] 0.41522880 0.83045761 0.5847712
[49,] 0.36967056 0.73934111 0.6303294
[50,] 0.46648455 0.93296910 0.5335154
[51,] 0.59544208 0.80911584 0.4045579
[52,] 0.70169646 0.59660707 0.2983035
[53,] 0.66824585 0.66350830 0.3317542
[54,] 0.81836192 0.36327617 0.1816381
[55,] 0.78910722 0.42178557 0.2108928
[56,] 0.81822726 0.36354547 0.1817727
[57,] 0.81771226 0.36457548 0.1822877
[58,] 0.81646660 0.36706679 0.1835334
[59,] 0.85459367 0.29081267 0.1454063
[60,] 0.84113840 0.31772321 0.1588616
[61,] 0.82041853 0.35916294 0.1795815
[62,] 0.82789181 0.34421639 0.1721082
[63,] 0.79973291 0.40053417 0.2002671
[64,] 0.77673595 0.44652810 0.2232640
[65,] 0.80960432 0.38079136 0.1903957
[66,] 0.77673777 0.44652447 0.2232622
[67,] 0.75939459 0.48121081 0.2406054
[68,] 0.71976597 0.56046806 0.2802340
[69,] 0.69917870 0.60164260 0.3008213
[70,] 0.65720918 0.68558164 0.3427908
[71,] 0.61216638 0.77566724 0.3878336
[72,] 0.56465683 0.87068635 0.4353432
[73,] 0.54940932 0.90118137 0.4505907
[74,] 0.61561067 0.76877865 0.3843893
[75,] 0.56738059 0.86523882 0.4326194
[76,] 0.62460369 0.75079263 0.3753963
[77,] 0.71784630 0.56430739 0.2821537
[78,] 0.72854822 0.54290356 0.2714518
[79,] 0.68887380 0.62225241 0.3111262
[80,] 0.64668701 0.70662598 0.3533130
[81,] 0.74310352 0.51379296 0.2568965
[82,] 0.77789153 0.44421695 0.2221085
[83,] 0.85853254 0.28293493 0.1414675
[84,] 0.83210057 0.33579886 0.1678994
[85,] 0.80339410 0.39321179 0.1966059
[86,] 0.80495733 0.39008535 0.1950427
[87,] 0.78131686 0.43736628 0.2186831
[88,] 0.79075330 0.41849339 0.2092467
[89,] 0.75497166 0.49005667 0.2450283
[90,] 0.71350111 0.57299777 0.2864989
[91,] 0.67788122 0.64423756 0.3221188
[92,] 0.62994116 0.74011769 0.3700588
[93,] 0.66389384 0.67221232 0.3361062
[94,] 0.64185520 0.71628961 0.3581448
[95,] 0.59950316 0.80099367 0.4004968
[96,] 0.66869746 0.66260509 0.3313025
[97,] 0.76001791 0.47996417 0.2399821
[98,] 0.75993498 0.48013003 0.2400650
[99,] 0.80404853 0.39190294 0.1959515
[100,] 0.82630386 0.34739228 0.1736961
[101,] 0.80142801 0.39714399 0.1985720
[102,] 0.79221236 0.41557529 0.2077876
[103,] 0.81664225 0.36671551 0.1833578
[104,] 0.81485260 0.37029480 0.1851474
[105,] 0.80880008 0.38239984 0.1911999
[106,] 0.88899599 0.22200802 0.1110040
[107,] 0.87381753 0.25236495 0.1261825
[108,] 0.83731041 0.32537918 0.1626896
[109,] 0.82012595 0.35974810 0.1798741
[110,] 0.79958986 0.40082028 0.2004101
[111,] 0.76056928 0.47886144 0.2394307
[112,] 0.70922414 0.58155173 0.2907759
[113,] 0.64638444 0.70723113 0.3536156
[114,] 0.82033102 0.35933796 0.1796690
[115,] 0.89788140 0.20423721 0.1021186
[116,] 0.86918116 0.26163768 0.1308188
[117,] 0.82999430 0.34001141 0.1700057
[118,] 0.80492452 0.39015096 0.1950755
[119,] 0.82048274 0.35903452 0.1795173
[120,] 0.88839640 0.22320719 0.1116036
[121,] 0.88048518 0.23902965 0.1195148
[122,] 0.82688432 0.34623135 0.1731157
[123,] 0.76935067 0.46129866 0.2306493
[124,] 0.69062172 0.61875656 0.3093783
[125,] 0.67009774 0.65980452 0.3299023
[126,] 0.78793192 0.42413615 0.2120681
[127,] 0.76173565 0.47652870 0.2382644
[128,] 0.62651531 0.74696938 0.3734847
> postscript(file="/var/www/rcomp/tmp/1b4ix1290858170.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/rcomp/tmp/24dhi1290858170.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/rcomp/tmp/34dhi1290858170.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/rcomp/tmp/44dhi1290858170.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/rcomp/tmp/54dhi1290858170.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 = 159
Frequency = 1
1 2 3 4 5
-5.070028e-01 4.492997e+00 -4.935574e+00 -1.687783e+00 -1.457014e+00
6 7 8 9 10
-2.841629e+00 -1.493213e-01 -4.841629e+00 -3.841629e+00 -5.303167e+00
11 12 13 14 15
2.389140e+00 6.696833e+00 -1.571860e+00 -2.571860e+00 -7.000431e+00
16 17 18 19 20
-7.752640e+00 1.478130e+00 -3.906486e+00 -2.141780e-01 1.009351e+01
21 22 23 24 25
5.093514e+00 1.163198e+01 3.242836e-01 7.631976e+00 -5.636716e+00
26 27 28 29 30
-4.636716e+00 -2.065288e+00 1.182504e+00 2.413273e+00 -1.971342e+00
31 32 33 34 35
3.720965e+00 4.028658e+00 4.028658e+00 2.567119e+00 -3.740573e+00
36 37 38 39 40
8.567119e+00 8.298427e+00 -7.701573e+00 9.869856e+00 5.117647e+00
41 42 43 44 45
9.348416e+00 2.963801e+00 -2.343891e+00 -4.036199e+00 -2.036199e+00
46 47 48 49 50
-7.497738e+00 -8.054299e-01 9.502262e+00 4.233570e+00 2.233570e+00
51 52 53 54 55
3.804999e+00 -1.947210e+00 2.835596e-01 -8.101056e+00 7.591252e+00
56 57 58 59 60
4.898944e+00 -1.010558e-01 -5.562594e+00 -8.870287e+00 -9.562594e+00
61 62 63 64 65
-7.831286e+00 1.687136e-01 -3.259858e+00 -2.012066e+00 -9.781297e+00
66 67 68 69 70
9.834087e+00 1.052640e+01 -2.165913e+00 -1.316591e+01 -2.627451e+00
71 72 73 74 75
7.064857e+00 -4.627451e+00 5.103857e+00 8.103857e+00 3.675285e+00
76 77 78 79 80
2.923077e+00 -6.846154e+00 1.769231e+00 -1.538462e+00 6.769231e+00
81 82 83 84 85
7.692308e-01 -4.692308e+00 3.256435e-16 -3.692308e+00 -1.961000e+00
86 87 88 89 90
3.900022e-02 -1.389571e+00 -5.141780e+00 8.088989e+00 -2.956259e-01
91 92 93 94 95
5.396682e+00 -1.129563e+01 -6.295626e+00 -7.571644e-01 -2.064857e+00
96 97 98 99 100
7.242836e+00 5.974144e+00 7.974144e+00 -3.454428e+00 1.793363e+00
101 102 103 104 105
3.024133e+00 -4.360483e+00 -6.681750e-01 -3.360483e+00 6.395173e-01
106 107 108 109 110
2.177979e+00 -1.297134e-01 1.779789e-01 -9.071321e-02 -4.090713e+00
111 112 113 114 115
-9.519285e+00 7.728507e+00 9.592760e-01 5.574661e+00 -1.173303e+01
116 117 118 119 120
-5.425339e+00 -3.425339e+00 -5.886878e+00 3.805430e+00 -3.886878e+00
121 122 123 124 125
3.844430e+00 -7.155570e+00 -5.841413e-01 -5.336350e+00 -1.105581e+00
126 127 128 129 130
5.098039e-01 -5.797888e+00 -1.490196e+00 -4.490196e+00 1.004827e+01
131 132 133 134 135
7.405732e-01 -7.951735e+00 -8.220427e+00 -5.220427e+00 -1.648998e+00
136 137 138 139 140
5.598793e+00 -2.170437e+00 -1.555053e+00 -3.862745e+00 4.449472e-01
141 142 143 144 145
7.444947e+00 6.983409e+00 2.675716e+00 -3.016591e+00 -4.285283e+00
146 147 148 149 150
7.714717e+00 8.286145e+00 -4.660633e-01 -4.235294e+00 2.380090e+00
151 152 153 154 155
-9.276018e-01 6.380090e+00 1.538009e+01 -1.081448e+00 -1.389140e+00
156 157 158 159
-7.081448e+00 2.649860e+00 6.498599e-01 8.221289e+00
> postscript(file="/var/www/rcomp/tmp/6f5y31290858170.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 = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 -5.070028e-01 NA
1 4.492997e+00 -5.070028e-01
2 -4.935574e+00 4.492997e+00
3 -1.687783e+00 -4.935574e+00
4 -1.457014e+00 -1.687783e+00
5 -2.841629e+00 -1.457014e+00
6 -1.493213e-01 -2.841629e+00
7 -4.841629e+00 -1.493213e-01
8 -3.841629e+00 -4.841629e+00
9 -5.303167e+00 -3.841629e+00
10 2.389140e+00 -5.303167e+00
11 6.696833e+00 2.389140e+00
12 -1.571860e+00 6.696833e+00
13 -2.571860e+00 -1.571860e+00
14 -7.000431e+00 -2.571860e+00
15 -7.752640e+00 -7.000431e+00
16 1.478130e+00 -7.752640e+00
17 -3.906486e+00 1.478130e+00
18 -2.141780e-01 -3.906486e+00
19 1.009351e+01 -2.141780e-01
20 5.093514e+00 1.009351e+01
21 1.163198e+01 5.093514e+00
22 3.242836e-01 1.163198e+01
23 7.631976e+00 3.242836e-01
24 -5.636716e+00 7.631976e+00
25 -4.636716e+00 -5.636716e+00
26 -2.065288e+00 -4.636716e+00
27 1.182504e+00 -2.065288e+00
28 2.413273e+00 1.182504e+00
29 -1.971342e+00 2.413273e+00
30 3.720965e+00 -1.971342e+00
31 4.028658e+00 3.720965e+00
32 4.028658e+00 4.028658e+00
33 2.567119e+00 4.028658e+00
34 -3.740573e+00 2.567119e+00
35 8.567119e+00 -3.740573e+00
36 8.298427e+00 8.567119e+00
37 -7.701573e+00 8.298427e+00
38 9.869856e+00 -7.701573e+00
39 5.117647e+00 9.869856e+00
40 9.348416e+00 5.117647e+00
41 2.963801e+00 9.348416e+00
42 -2.343891e+00 2.963801e+00
43 -4.036199e+00 -2.343891e+00
44 -2.036199e+00 -4.036199e+00
45 -7.497738e+00 -2.036199e+00
46 -8.054299e-01 -7.497738e+00
47 9.502262e+00 -8.054299e-01
48 4.233570e+00 9.502262e+00
49 2.233570e+00 4.233570e+00
50 3.804999e+00 2.233570e+00
51 -1.947210e+00 3.804999e+00
52 2.835596e-01 -1.947210e+00
53 -8.101056e+00 2.835596e-01
54 7.591252e+00 -8.101056e+00
55 4.898944e+00 7.591252e+00
56 -1.010558e-01 4.898944e+00
57 -5.562594e+00 -1.010558e-01
58 -8.870287e+00 -5.562594e+00
59 -9.562594e+00 -8.870287e+00
60 -7.831286e+00 -9.562594e+00
61 1.687136e-01 -7.831286e+00
62 -3.259858e+00 1.687136e-01
63 -2.012066e+00 -3.259858e+00
64 -9.781297e+00 -2.012066e+00
65 9.834087e+00 -9.781297e+00
66 1.052640e+01 9.834087e+00
67 -2.165913e+00 1.052640e+01
68 -1.316591e+01 -2.165913e+00
69 -2.627451e+00 -1.316591e+01
70 7.064857e+00 -2.627451e+00
71 -4.627451e+00 7.064857e+00
72 5.103857e+00 -4.627451e+00
73 8.103857e+00 5.103857e+00
74 3.675285e+00 8.103857e+00
75 2.923077e+00 3.675285e+00
76 -6.846154e+00 2.923077e+00
77 1.769231e+00 -6.846154e+00
78 -1.538462e+00 1.769231e+00
79 6.769231e+00 -1.538462e+00
80 7.692308e-01 6.769231e+00
81 -4.692308e+00 7.692308e-01
82 3.256435e-16 -4.692308e+00
83 -3.692308e+00 3.256435e-16
84 -1.961000e+00 -3.692308e+00
85 3.900022e-02 -1.961000e+00
86 -1.389571e+00 3.900022e-02
87 -5.141780e+00 -1.389571e+00
88 8.088989e+00 -5.141780e+00
89 -2.956259e-01 8.088989e+00
90 5.396682e+00 -2.956259e-01
91 -1.129563e+01 5.396682e+00
92 -6.295626e+00 -1.129563e+01
93 -7.571644e-01 -6.295626e+00
94 -2.064857e+00 -7.571644e-01
95 7.242836e+00 -2.064857e+00
96 5.974144e+00 7.242836e+00
97 7.974144e+00 5.974144e+00
98 -3.454428e+00 7.974144e+00
99 1.793363e+00 -3.454428e+00
100 3.024133e+00 1.793363e+00
101 -4.360483e+00 3.024133e+00
102 -6.681750e-01 -4.360483e+00
103 -3.360483e+00 -6.681750e-01
104 6.395173e-01 -3.360483e+00
105 2.177979e+00 6.395173e-01
106 -1.297134e-01 2.177979e+00
107 1.779789e-01 -1.297134e-01
108 -9.071321e-02 1.779789e-01
109 -4.090713e+00 -9.071321e-02
110 -9.519285e+00 -4.090713e+00
111 7.728507e+00 -9.519285e+00
112 9.592760e-01 7.728507e+00
113 5.574661e+00 9.592760e-01
114 -1.173303e+01 5.574661e+00
115 -5.425339e+00 -1.173303e+01
116 -3.425339e+00 -5.425339e+00
117 -5.886878e+00 -3.425339e+00
118 3.805430e+00 -5.886878e+00
119 -3.886878e+00 3.805430e+00
120 3.844430e+00 -3.886878e+00
121 -7.155570e+00 3.844430e+00
122 -5.841413e-01 -7.155570e+00
123 -5.336350e+00 -5.841413e-01
124 -1.105581e+00 -5.336350e+00
125 5.098039e-01 -1.105581e+00
126 -5.797888e+00 5.098039e-01
127 -1.490196e+00 -5.797888e+00
128 -4.490196e+00 -1.490196e+00
129 1.004827e+01 -4.490196e+00
130 7.405732e-01 1.004827e+01
131 -7.951735e+00 7.405732e-01
132 -8.220427e+00 -7.951735e+00
133 -5.220427e+00 -8.220427e+00
134 -1.648998e+00 -5.220427e+00
135 5.598793e+00 -1.648998e+00
136 -2.170437e+00 5.598793e+00
137 -1.555053e+00 -2.170437e+00
138 -3.862745e+00 -1.555053e+00
139 4.449472e-01 -3.862745e+00
140 7.444947e+00 4.449472e-01
141 6.983409e+00 7.444947e+00
142 2.675716e+00 6.983409e+00
143 -3.016591e+00 2.675716e+00
144 -4.285283e+00 -3.016591e+00
145 7.714717e+00 -4.285283e+00
146 8.286145e+00 7.714717e+00
147 -4.660633e-01 8.286145e+00
148 -4.235294e+00 -4.660633e-01
149 2.380090e+00 -4.235294e+00
150 -9.276018e-01 2.380090e+00
151 6.380090e+00 -9.276018e-01
152 1.538009e+01 6.380090e+00
153 -1.081448e+00 1.538009e+01
154 -1.389140e+00 -1.081448e+00
155 -7.081448e+00 -1.389140e+00
156 2.649860e+00 -7.081448e+00
157 6.498599e-01 2.649860e+00
158 8.221289e+00 6.498599e-01
159 NA 8.221289e+00
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 4.492997e+00 -5.070028e-01
[2,] -4.935574e+00 4.492997e+00
[3,] -1.687783e+00 -4.935574e+00
[4,] -1.457014e+00 -1.687783e+00
[5,] -2.841629e+00 -1.457014e+00
[6,] -1.493213e-01 -2.841629e+00
[7,] -4.841629e+00 -1.493213e-01
[8,] -3.841629e+00 -4.841629e+00
[9,] -5.303167e+00 -3.841629e+00
[10,] 2.389140e+00 -5.303167e+00
[11,] 6.696833e+00 2.389140e+00
[12,] -1.571860e+00 6.696833e+00
[13,] -2.571860e+00 -1.571860e+00
[14,] -7.000431e+00 -2.571860e+00
[15,] -7.752640e+00 -7.000431e+00
[16,] 1.478130e+00 -7.752640e+00
[17,] -3.906486e+00 1.478130e+00
[18,] -2.141780e-01 -3.906486e+00
[19,] 1.009351e+01 -2.141780e-01
[20,] 5.093514e+00 1.009351e+01
[21,] 1.163198e+01 5.093514e+00
[22,] 3.242836e-01 1.163198e+01
[23,] 7.631976e+00 3.242836e-01
[24,] -5.636716e+00 7.631976e+00
[25,] -4.636716e+00 -5.636716e+00
[26,] -2.065288e+00 -4.636716e+00
[27,] 1.182504e+00 -2.065288e+00
[28,] 2.413273e+00 1.182504e+00
[29,] -1.971342e+00 2.413273e+00
[30,] 3.720965e+00 -1.971342e+00
[31,] 4.028658e+00 3.720965e+00
[32,] 4.028658e+00 4.028658e+00
[33,] 2.567119e+00 4.028658e+00
[34,] -3.740573e+00 2.567119e+00
[35,] 8.567119e+00 -3.740573e+00
[36,] 8.298427e+00 8.567119e+00
[37,] -7.701573e+00 8.298427e+00
[38,] 9.869856e+00 -7.701573e+00
[39,] 5.117647e+00 9.869856e+00
[40,] 9.348416e+00 5.117647e+00
[41,] 2.963801e+00 9.348416e+00
[42,] -2.343891e+00 2.963801e+00
[43,] -4.036199e+00 -2.343891e+00
[44,] -2.036199e+00 -4.036199e+00
[45,] -7.497738e+00 -2.036199e+00
[46,] -8.054299e-01 -7.497738e+00
[47,] 9.502262e+00 -8.054299e-01
[48,] 4.233570e+00 9.502262e+00
[49,] 2.233570e+00 4.233570e+00
[50,] 3.804999e+00 2.233570e+00
[51,] -1.947210e+00 3.804999e+00
[52,] 2.835596e-01 -1.947210e+00
[53,] -8.101056e+00 2.835596e-01
[54,] 7.591252e+00 -8.101056e+00
[55,] 4.898944e+00 7.591252e+00
[56,] -1.010558e-01 4.898944e+00
[57,] -5.562594e+00 -1.010558e-01
[58,] -8.870287e+00 -5.562594e+00
[59,] -9.562594e+00 -8.870287e+00
[60,] -7.831286e+00 -9.562594e+00
[61,] 1.687136e-01 -7.831286e+00
[62,] -3.259858e+00 1.687136e-01
[63,] -2.012066e+00 -3.259858e+00
[64,] -9.781297e+00 -2.012066e+00
[65,] 9.834087e+00 -9.781297e+00
[66,] 1.052640e+01 9.834087e+00
[67,] -2.165913e+00 1.052640e+01
[68,] -1.316591e+01 -2.165913e+00
[69,] -2.627451e+00 -1.316591e+01
[70,] 7.064857e+00 -2.627451e+00
[71,] -4.627451e+00 7.064857e+00
[72,] 5.103857e+00 -4.627451e+00
[73,] 8.103857e+00 5.103857e+00
[74,] 3.675285e+00 8.103857e+00
[75,] 2.923077e+00 3.675285e+00
[76,] -6.846154e+00 2.923077e+00
[77,] 1.769231e+00 -6.846154e+00
[78,] -1.538462e+00 1.769231e+00
[79,] 6.769231e+00 -1.538462e+00
[80,] 7.692308e-01 6.769231e+00
[81,] -4.692308e+00 7.692308e-01
[82,] 3.256435e-16 -4.692308e+00
[83,] -3.692308e+00 3.256435e-16
[84,] -1.961000e+00 -3.692308e+00
[85,] 3.900022e-02 -1.961000e+00
[86,] -1.389571e+00 3.900022e-02
[87,] -5.141780e+00 -1.389571e+00
[88,] 8.088989e+00 -5.141780e+00
[89,] -2.956259e-01 8.088989e+00
[90,] 5.396682e+00 -2.956259e-01
[91,] -1.129563e+01 5.396682e+00
[92,] -6.295626e+00 -1.129563e+01
[93,] -7.571644e-01 -6.295626e+00
[94,] -2.064857e+00 -7.571644e-01
[95,] 7.242836e+00 -2.064857e+00
[96,] 5.974144e+00 7.242836e+00
[97,] 7.974144e+00 5.974144e+00
[98,] -3.454428e+00 7.974144e+00
[99,] 1.793363e+00 -3.454428e+00
[100,] 3.024133e+00 1.793363e+00
[101,] -4.360483e+00 3.024133e+00
[102,] -6.681750e-01 -4.360483e+00
[103,] -3.360483e+00 -6.681750e-01
[104,] 6.395173e-01 -3.360483e+00
[105,] 2.177979e+00 6.395173e-01
[106,] -1.297134e-01 2.177979e+00
[107,] 1.779789e-01 -1.297134e-01
[108,] -9.071321e-02 1.779789e-01
[109,] -4.090713e+00 -9.071321e-02
[110,] -9.519285e+00 -4.090713e+00
[111,] 7.728507e+00 -9.519285e+00
[112,] 9.592760e-01 7.728507e+00
[113,] 5.574661e+00 9.592760e-01
[114,] -1.173303e+01 5.574661e+00
[115,] -5.425339e+00 -1.173303e+01
[116,] -3.425339e+00 -5.425339e+00
[117,] -5.886878e+00 -3.425339e+00
[118,] 3.805430e+00 -5.886878e+00
[119,] -3.886878e+00 3.805430e+00
[120,] 3.844430e+00 -3.886878e+00
[121,] -7.155570e+00 3.844430e+00
[122,] -5.841413e-01 -7.155570e+00
[123,] -5.336350e+00 -5.841413e-01
[124,] -1.105581e+00 -5.336350e+00
[125,] 5.098039e-01 -1.105581e+00
[126,] -5.797888e+00 5.098039e-01
[127,] -1.490196e+00 -5.797888e+00
[128,] -4.490196e+00 -1.490196e+00
[129,] 1.004827e+01 -4.490196e+00
[130,] 7.405732e-01 1.004827e+01
[131,] -7.951735e+00 7.405732e-01
[132,] -8.220427e+00 -7.951735e+00
[133,] -5.220427e+00 -8.220427e+00
[134,] -1.648998e+00 -5.220427e+00
[135,] 5.598793e+00 -1.648998e+00
[136,] -2.170437e+00 5.598793e+00
[137,] -1.555053e+00 -2.170437e+00
[138,] -3.862745e+00 -1.555053e+00
[139,] 4.449472e-01 -3.862745e+00
[140,] 7.444947e+00 4.449472e-01
[141,] 6.983409e+00 7.444947e+00
[142,] 2.675716e+00 6.983409e+00
[143,] -3.016591e+00 2.675716e+00
[144,] -4.285283e+00 -3.016591e+00
[145,] 7.714717e+00 -4.285283e+00
[146,] 8.286145e+00 7.714717e+00
[147,] -4.660633e-01 8.286145e+00
[148,] -4.235294e+00 -4.660633e-01
[149,] 2.380090e+00 -4.235294e+00
[150,] -9.276018e-01 2.380090e+00
[151,] 6.380090e+00 -9.276018e-01
[152,] 1.538009e+01 6.380090e+00
[153,] -1.081448e+00 1.538009e+01
[154,] -1.389140e+00 -1.081448e+00
[155,] -7.081448e+00 -1.389140e+00
[156,] 2.649860e+00 -7.081448e+00
[157,] 6.498599e-01 2.649860e+00
[158,] 8.221289e+00 6.498599e-01
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 4.492997e+00 -5.070028e-01
2 -4.935574e+00 4.492997e+00
3 -1.687783e+00 -4.935574e+00
4 -1.457014e+00 -1.687783e+00
5 -2.841629e+00 -1.457014e+00
6 -1.493213e-01 -2.841629e+00
7 -4.841629e+00 -1.493213e-01
8 -3.841629e+00 -4.841629e+00
9 -5.303167e+00 -3.841629e+00
10 2.389140e+00 -5.303167e+00
11 6.696833e+00 2.389140e+00
12 -1.571860e+00 6.696833e+00
13 -2.571860e+00 -1.571860e+00
14 -7.000431e+00 -2.571860e+00
15 -7.752640e+00 -7.000431e+00
16 1.478130e+00 -7.752640e+00
17 -3.906486e+00 1.478130e+00
18 -2.141780e-01 -3.906486e+00
19 1.009351e+01 -2.141780e-01
20 5.093514e+00 1.009351e+01
21 1.163198e+01 5.093514e+00
22 3.242836e-01 1.163198e+01
23 7.631976e+00 3.242836e-01
24 -5.636716e+00 7.631976e+00
25 -4.636716e+00 -5.636716e+00
26 -2.065288e+00 -4.636716e+00
27 1.182504e+00 -2.065288e+00
28 2.413273e+00 1.182504e+00
29 -1.971342e+00 2.413273e+00
30 3.720965e+00 -1.971342e+00
31 4.028658e+00 3.720965e+00
32 4.028658e+00 4.028658e+00
33 2.567119e+00 4.028658e+00
34 -3.740573e+00 2.567119e+00
35 8.567119e+00 -3.740573e+00
36 8.298427e+00 8.567119e+00
37 -7.701573e+00 8.298427e+00
38 9.869856e+00 -7.701573e+00
39 5.117647e+00 9.869856e+00
40 9.348416e+00 5.117647e+00
41 2.963801e+00 9.348416e+00
42 -2.343891e+00 2.963801e+00
43 -4.036199e+00 -2.343891e+00
44 -2.036199e+00 -4.036199e+00
45 -7.497738e+00 -2.036199e+00
46 -8.054299e-01 -7.497738e+00
47 9.502262e+00 -8.054299e-01
48 4.233570e+00 9.502262e+00
49 2.233570e+00 4.233570e+00
50 3.804999e+00 2.233570e+00
51 -1.947210e+00 3.804999e+00
52 2.835596e-01 -1.947210e+00
53 -8.101056e+00 2.835596e-01
54 7.591252e+00 -8.101056e+00
55 4.898944e+00 7.591252e+00
56 -1.010558e-01 4.898944e+00
57 -5.562594e+00 -1.010558e-01
58 -8.870287e+00 -5.562594e+00
59 -9.562594e+00 -8.870287e+00
60 -7.831286e+00 -9.562594e+00
61 1.687136e-01 -7.831286e+00
62 -3.259858e+00 1.687136e-01
63 -2.012066e+00 -3.259858e+00
64 -9.781297e+00 -2.012066e+00
65 9.834087e+00 -9.781297e+00
66 1.052640e+01 9.834087e+00
67 -2.165913e+00 1.052640e+01
68 -1.316591e+01 -2.165913e+00
69 -2.627451e+00 -1.316591e+01
70 7.064857e+00 -2.627451e+00
71 -4.627451e+00 7.064857e+00
72 5.103857e+00 -4.627451e+00
73 8.103857e+00 5.103857e+00
74 3.675285e+00 8.103857e+00
75 2.923077e+00 3.675285e+00
76 -6.846154e+00 2.923077e+00
77 1.769231e+00 -6.846154e+00
78 -1.538462e+00 1.769231e+00
79 6.769231e+00 -1.538462e+00
80 7.692308e-01 6.769231e+00
81 -4.692308e+00 7.692308e-01
82 3.256435e-16 -4.692308e+00
83 -3.692308e+00 3.256435e-16
84 -1.961000e+00 -3.692308e+00
85 3.900022e-02 -1.961000e+00
86 -1.389571e+00 3.900022e-02
87 -5.141780e+00 -1.389571e+00
88 8.088989e+00 -5.141780e+00
89 -2.956259e-01 8.088989e+00
90 5.396682e+00 -2.956259e-01
91 -1.129563e+01 5.396682e+00
92 -6.295626e+00 -1.129563e+01
93 -7.571644e-01 -6.295626e+00
94 -2.064857e+00 -7.571644e-01
95 7.242836e+00 -2.064857e+00
96 5.974144e+00 7.242836e+00
97 7.974144e+00 5.974144e+00
98 -3.454428e+00 7.974144e+00
99 1.793363e+00 -3.454428e+00
100 3.024133e+00 1.793363e+00
101 -4.360483e+00 3.024133e+00
102 -6.681750e-01 -4.360483e+00
103 -3.360483e+00 -6.681750e-01
104 6.395173e-01 -3.360483e+00
105 2.177979e+00 6.395173e-01
106 -1.297134e-01 2.177979e+00
107 1.779789e-01 -1.297134e-01
108 -9.071321e-02 1.779789e-01
109 -4.090713e+00 -9.071321e-02
110 -9.519285e+00 -4.090713e+00
111 7.728507e+00 -9.519285e+00
112 9.592760e-01 7.728507e+00
113 5.574661e+00 9.592760e-01
114 -1.173303e+01 5.574661e+00
115 -5.425339e+00 -1.173303e+01
116 -3.425339e+00 -5.425339e+00
117 -5.886878e+00 -3.425339e+00
118 3.805430e+00 -5.886878e+00
119 -3.886878e+00 3.805430e+00
120 3.844430e+00 -3.886878e+00
121 -7.155570e+00 3.844430e+00
122 -5.841413e-01 -7.155570e+00
123 -5.336350e+00 -5.841413e-01
124 -1.105581e+00 -5.336350e+00
125 5.098039e-01 -1.105581e+00
126 -5.797888e+00 5.098039e-01
127 -1.490196e+00 -5.797888e+00
128 -4.490196e+00 -1.490196e+00
129 1.004827e+01 -4.490196e+00
130 7.405732e-01 1.004827e+01
131 -7.951735e+00 7.405732e-01
132 -8.220427e+00 -7.951735e+00
133 -5.220427e+00 -8.220427e+00
134 -1.648998e+00 -5.220427e+00
135 5.598793e+00 -1.648998e+00
136 -2.170437e+00 5.598793e+00
137 -1.555053e+00 -2.170437e+00
138 -3.862745e+00 -1.555053e+00
139 4.449472e-01 -3.862745e+00
140 7.444947e+00 4.449472e-01
141 6.983409e+00 7.444947e+00
142 2.675716e+00 6.983409e+00
143 -3.016591e+00 2.675716e+00
144 -4.285283e+00 -3.016591e+00
145 7.714717e+00 -4.285283e+00
146 8.286145e+00 7.714717e+00
147 -4.660633e-01 8.286145e+00
148 -4.235294e+00 -4.660633e-01
149 2.380090e+00 -4.235294e+00
150 -9.276018e-01 2.380090e+00
151 6.380090e+00 -9.276018e-01
152 1.538009e+01 6.380090e+00
153 -1.081448e+00 1.538009e+01
154 -1.389140e+00 -1.081448e+00
155 -7.081448e+00 -1.389140e+00
156 2.649860e+00 -7.081448e+00
157 6.498599e-01 2.649860e+00
158 8.221289e+00 6.498599e-01
> 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/7qeg61290858170.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/rcomp/tmp/8qeg61290858170.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/rcomp/tmp/9qeg61290858170.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/rcomp/tmp/10inx91290858170.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/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/11l6ve1290858170.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/127ock1290858170.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/13ep9e1290858170.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/14h8tc1290858171.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/152r901290858171.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/16y1p81290858171.tab")
+ }
>
> try(system("convert tmp/1b4ix1290858170.ps tmp/1b4ix1290858170.png",intern=TRUE))
character(0)
> try(system("convert tmp/24dhi1290858170.ps tmp/24dhi1290858170.png",intern=TRUE))
character(0)
> try(system("convert tmp/34dhi1290858170.ps tmp/34dhi1290858170.png",intern=TRUE))
character(0)
> try(system("convert tmp/44dhi1290858170.ps tmp/44dhi1290858170.png",intern=TRUE))
character(0)
> try(system("convert tmp/54dhi1290858170.ps tmp/54dhi1290858170.png",intern=TRUE))
character(0)
> try(system("convert tmp/6f5y31290858170.ps tmp/6f5y31290858170.png",intern=TRUE))
character(0)
> try(system("convert tmp/7qeg61290858170.ps tmp/7qeg61290858170.png",intern=TRUE))
character(0)
> try(system("convert tmp/8qeg61290858170.ps tmp/8qeg61290858170.png",intern=TRUE))
character(0)
> try(system("convert tmp/9qeg61290858170.ps tmp/9qeg61290858170.png",intern=TRUE))
character(0)
> try(system("convert tmp/10inx91290858170.ps tmp/10inx91290858170.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.380 1.210 6.588