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(56
+ ,79
+ ,30
+ ,112285
+ ,21
+ ,56
+ ,58
+ ,28
+ ,84786
+ ,23
+ ,54
+ ,60
+ ,38
+ ,83123
+ ,22
+ ,92
+ ,121
+ ,25
+ ,119182
+ ,22
+ ,44
+ ,43
+ ,26
+ ,116174
+ ,21
+ ,33
+ ,69
+ ,25
+ ,57635
+ ,22
+ ,84
+ ,78
+ ,38
+ ,66198
+ ,21
+ ,55
+ ,44
+ ,30
+ ,57793
+ ,21
+ ,154
+ ,158
+ ,47
+ ,97668
+ ,21
+ ,53
+ ,102
+ ,30
+ ,133824
+ ,21
+ ,119
+ ,77
+ ,31
+ ,101481
+ ,23
+ ,41
+ ,82
+ ,23
+ ,99645
+ ,21
+ ,58
+ ,101
+ ,36
+ ,99052
+ ,21
+ ,75
+ ,80
+ ,30
+ ,67654
+ ,22
+ ,33
+ ,50
+ ,25
+ ,65553
+ ,22
+ ,100
+ ,73
+ ,31
+ ,82753
+ ,21
+ ,112
+ ,81
+ ,31
+ ,85323
+ ,22
+ ,73
+ ,105
+ ,33
+ ,72654
+ ,23
+ ,40
+ ,47
+ ,25
+ ,30727
+ ,22
+ ,60
+ ,94
+ ,35
+ ,117478
+ ,22
+ ,62
+ ,44
+ ,42
+ ,74007
+ ,21
+ ,77
+ ,107
+ ,33
+ ,101494
+ ,21
+ ,99
+ ,84
+ ,36
+ ,79215
+ ,21
+ ,17
+ ,0
+ ,0
+ ,1423
+ ,20
+ ,30
+ ,33
+ ,14
+ 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 ,20
+ ,35
+ ,41
+ ,21
+ ,45097
+ ,18
+ ,63
+ ,12
+ ,18
+ ,28394
+ ,19
+ ,44
+ ,21
+ ,17
+ ,18632
+ ,19
+ ,19
+ ,8
+ ,4
+ ,2325
+ ,20
+ ,13
+ ,26
+ ,10
+ ,25139
+ ,20
+ ,42
+ ,27
+ ,16
+ ,27975
+ ,21
+ ,42
+ ,37
+ ,18
+ ,21792
+ ,20
+ ,49
+ ,29
+ ,12
+ ,26263
+ ,21
+ ,30
+ ,32
+ ,16
+ ,23686
+ ,18
+ ,49
+ ,35
+ ,21
+ ,49303
+ ,19
+ ,12
+ ,10
+ ,2
+ ,5752
+ ,19
+ ,20
+ ,17
+ ,17
+ ,20055
+ ,19
+ ,27
+ ,10
+ ,16
+ ,20154
+ ,19
+ ,14
+ ,17
+ ,16
+ ,19540
+ ,19)
+ ,dim=c(5
+ ,171)
+ ,dimnames=list(c('log'
+ ,'blog'
+ ,'PR'
+ ,'size'
+ ,'age
')
+ ,1:171))
> y <- array(NA,dim=c(5,171),dimnames=list(c('log','blog','PR','size','age
'),1:171))
> 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 = '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
log blog PR size age\r
1 56 79 30 112285 21
2 56 58 28 84786 23
3 54 60 38 83123 22
4 92 121 25 119182 22
5 44 43 26 116174 21
6 33 69 25 57635 22
7 84 78 38 66198 21
8 55 44 30 57793 21
9 154 158 47 97668 21
10 53 102 30 133824 21
11 119 77 31 101481 23
12 41 82 23 99645 21
13 58 101 36 99052 21
14 75 80 30 67654 22
15 33 50 25 65553 22
16 100 73 31 82753 21
17 112 81 31 85323 22
18 73 105 33 72654 23
19 40 47 25 30727 22
20 60 94 35 117478 22
21 62 44 42 74007 21
22 77 107 33 101494 21
23 99 84 36 79215 21
24 17 0 0 1423 20
25 30 33 14 31081 21
26 76 42 17 22996 25
27 146 96 32 83122 21
28 56 56 35 60578 21
29 107 57 20 39992 20
30 58 59 28 79892 24
31 34 39 28 49810 23
32 119 76 34 100708 21
33 66 91 39 82875 24
34 66 76 28 72260 21
35 24 8 4 5950 23
36 259 79 39 115762 23
37 41 76 29 80670 21
38 68 101 44 143558 22
39 168 94 21 117105 20
40 43 27 16 23789 18
41 105 123 35 105195 22
42 94 105 23 149193 21
43 57 41 29 95260 21
44 53 72 25 55183 23
45 103 67 27 106671 22
46 121 75 36 73511 21
47 62 114 28 92945 21
48 32 22 23 22618 21
49 45 69 28 83737 22
50 46 105 34 69094 21
51 75 88 28 95536 21
52 88 73 34 225920 23
53 53 62 33 61370 21
54 78 100 35 84651 22
55 45 24 24 15986 22
56 46 67 29 95364 20
57 41 46 20 26706 21
58 144 57 29 89691 21
59 91 135 37 126846 21
60 63 124 33 102860 21
61 53 33 25 51715 22
62 62 98 32 55801 21
63 63 58 29 111813 24
64 32 68 28 120293 22
65 62 131 31 161647 24
66 117 110 52 115929 21
67 34 37 21 24266 22
68 92 130 24 162901 22
69 93 93 41 109825 21
70 54 118 33 129838 24
71 144 39 32 37510 21
72 109 81 31 87771 22
73 75 51 18 44418 19
74 50 28 23 192565 22
75 61 40 17 35232 23
76 55 56 20 40909 20
77 77 27 12 13294 20
78 72 83 30 140867 23
79 53 28 13 44332 20
80 42 59 22 61056 20
81 71 133 42 101338 23
82 10 12 1 1168 25
83 65 106 32 65567 21
84 66 44 25 32334 22
85 41 71 36 40735 21
86 86 116 31 91413 22
87 16 4 0 855 22
88 42 62 24 97068 23
89 19 12 13 44339 21
90 19 18 8 14116 21
91 45 14 13 10288 20
92 65 60 19 65622 19
93 95 98 33 76643 22
94 64 32 38 92696 21
95 38 25 24 94785 21
96 65 100 43 93815 21
97 52 46 43 86687 21
98 62 45 14 34553 21
99 65 129 41 105547 21
100 95 136 45 213688 22
101 29 59 31 71220 22
102 247 63 31 91721 22
103 29 14 30 111194 22
104 118 36 16 51009 18
105 110 113 37 135777 21
106 67 47 30 51513 23
107 42 92 35 74163 21
108 64 50 20 33416 19
109 81 41 18 83305 19
110 95 91 31 98952 23
111 67 111 31 102372 21
112 63 41 21 37238 21
113 83 120 39 103772 21
114 32 25 18 21399 21
115 83 131 39 130115 20
116 31 45 14 24874 19
117 67 29 7 34988 21
118 66 58 17 45549 22
119 70 47 30 64466 21
120 103 109 37 54990 25
121 34 37 32 34777 23
122 40 15 17 27114 19
123 31 7 24 37636 19
124 42 54 22 65461 19
125 46 54 12 30080 19
126 33 14 19 24094 19
127 18 16 13 69008 20
128 35 32 15 46090 19
129 66 38 15 34029 19
130 60 22 17 46300 19
131 54 32 16 40662 19
132 53 32 18 28987 19
133 39 37 17 30594 20
134 45 32 16 27913 19
135 36 0 23 42744 19
136 28 5 22 12934 18
137 30 10 13 41385 19
138 22 27 16 18653 19
139 31 29 20 30976 21
140 55 25 22 63339 18
141 54 55 17 25568 18
142 14 5 17 4154 21
143 81 43 12 19474 20
144 43 34 17 39067 19
145 30 35 23 65892 21
146 23 0 17 4143 21
147 38 37 14 28579 20
148 53 26 21 38084 24
149 45 38 18 27717 22
150 39 23 18 32928 21
151 24 30 17 19499 21
152 35 18 15 36874 19
153 151 28 21 48259 18
154 30 21 14 28207 19
155 57 50 15 45833 19
156 40 12 15 29156 19
157 77 27 22 45588 20
158 35 41 21 45097 18
159 63 12 18 28394 19
160 44 21 17 18632 19
161 19 8 4 2325 20
162 13 26 10 25139 20
163 42 27 16 27975 21
164 42 37 18 21792 20
165 49 29 12 26263 21
166 30 32 16 23686 18
167 49 35 21 49303 19
168 12 10 2 5752 19
169 20 17 17 20055 19
170 27 10 16 20154 19
171 14 17 16 19540 19
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) blog PR size `age\r`
45.8494816 0.2871328 0.8107209 0.0001046 -1.2908111
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-40.262 -19.188 -6.816 9.393 176.731
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 45.8494816 34.7365255 1.320 0.1887
blog 0.2871328 0.1133361 2.533 0.0122 *
PR 0.8107209 0.3921386 2.067 0.0402 *
size 0.0001046 0.0000896 1.168 0.2446
`age\r` -1.2908111 1.7453409 -0.740 0.4606
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 31.7 on 166 degrees of freedom
Multiple R-squared: 0.2921, Adjusted R-squared: 0.275
F-statistic: 17.12 on 4 and 166 DF, p-value: 8.94e-12
> 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.15773112 3.154622e-01 8.422689e-01
[2,] 0.07357405 1.471481e-01 9.264260e-01
[3,] 0.09579171 1.915834e-01 9.042083e-01
[4,] 0.22892765 4.578553e-01 7.710723e-01
[5,] 0.14479602 2.895920e-01 8.552040e-01
[6,] 0.14414160 2.882832e-01 8.558584e-01
[7,] 0.08995251 1.799050e-01 9.100475e-01
[8,] 0.05678814 1.135763e-01 9.432119e-01
[9,] 0.11907027 2.381405e-01 8.809297e-01
[10,] 0.14866615 2.973323e-01 8.513338e-01
[11,] 0.15358983 3.071797e-01 8.464102e-01
[12,] 0.10756928 2.151386e-01 8.924307e-01
[13,] 0.11068123 2.213625e-01 8.893188e-01
[14,] 0.07830096 1.566019e-01 9.216990e-01
[15,] 0.05356627 1.071325e-01 9.464337e-01
[16,] 0.04517250 9.034500e-02 9.548275e-01
[17,] 0.04756304 9.512607e-02 9.524370e-01
[18,] 0.03192791 6.385581e-02 9.680721e-01
[19,] 0.02623019 5.246039e-02 9.737698e-01
[20,] 0.11058756 2.211751e-01 8.894124e-01
[21,] 0.08533337 1.706667e-01 9.146666e-01
[22,] 0.13726162 2.745232e-01 8.627384e-01
[23,] 0.10440384 2.088077e-01 8.955962e-01
[24,] 0.08845088 1.769018e-01 9.115491e-01
[25,] 0.13689944 2.737989e-01 8.631006e-01
[26,] 0.11915299 2.383060e-01 8.808470e-01
[27,] 0.09359123 1.871825e-01 9.064088e-01
[28,] 0.07075343 1.415069e-01 9.292466e-01
[29,] 0.99504811 9.903780e-03 4.951890e-03
[30,] 0.99476293 1.047413e-02 5.237066e-03
[31,] 0.99477716 1.044569e-02 5.222845e-03
[32,] 0.99959349 8.130264e-04 4.065132e-04
[33,] 0.99936806 1.263883e-03 6.319417e-04
[34,] 0.99908013 1.839741e-03 9.198705e-04
[35,] 0.99865758 2.684832e-03 1.342416e-03
[36,] 0.99800199 3.996024e-03 1.998012e-03
[37,] 0.99725392 5.492151e-03 2.746075e-03
[38,] 0.99712619 5.747621e-03 2.873811e-03
[39,] 0.99776906 4.461880e-03 2.230940e-03
[40,] 0.99754172 4.916562e-03 2.458281e-03
[41,] 0.99658268 6.834645e-03 3.417323e-03
[42,] 0.99603734 7.925321e-03 3.962660e-03
[43,] 0.99659056 6.818879e-03 3.409439e-03
[44,] 0.99519767 9.604664e-03 4.802332e-03
[45,] 0.99354848 1.290304e-02 6.451519e-03
[46,] 0.99168405 1.663190e-02 8.315949e-03
[47,] 0.98886170 2.227660e-02 1.113830e-02
[48,] 0.98495559 3.008883e-02 1.504441e-02
[49,] 0.98306812 3.386377e-02 1.693188e-02
[50,] 0.97785237 4.429526e-02 2.214763e-02
[51,] 0.99439128 1.121745e-02 5.608723e-03
[52,] 0.99269778 1.460444e-02 7.302222e-03
[53,] 0.99225458 1.549084e-02 7.745421e-03
[54,] 0.98943520 2.112960e-02 1.056480e-02
[55,] 0.98667514 2.664971e-02 1.332486e-02
[56,] 0.98265044 3.469912e-02 1.734956e-02
[57,] 0.98523360 2.953280e-02 1.476640e-02
[58,] 0.98548857 2.902286e-02 1.451143e-02
[59,] 0.98160465 3.679071e-02 1.839535e-02
[60,] 0.97679577 4.640845e-02 2.320423e-02
[61,] 0.96986421 6.027157e-02 3.013579e-02
[62,] 0.96153942 7.692115e-02 3.846058e-02
[63,] 0.96264388 7.471224e-02 3.735612e-02
[64,] 0.99286192 1.427616e-02 7.138082e-03
[65,] 0.99329018 1.341964e-02 6.709818e-03
[66,] 0.99177267 1.645467e-02 8.227335e-03
[67,] 0.98984324 2.031352e-02 1.015676e-02
[68,] 0.98741208 2.517585e-02 1.258792e-02
[69,] 0.98330032 3.339936e-02 1.669968e-02
[70,] 0.98487698 3.024605e-02 1.512302e-02
[71,] 0.98043179 3.913641e-02 1.956821e-02
[72,] 0.97476708 5.046584e-02 2.523292e-02
[73,] 0.97066955 5.866091e-02 2.933045e-02
[74,] 0.96757411 6.485179e-02 3.242589e-02
[75,] 0.95989615 8.020770e-02 4.010385e-02
[76,] 0.95198661 9.602679e-02 4.801339e-02
[77,] 0.94232564 1.153487e-01 5.767436e-02
[78,] 0.94046200 1.190760e-01 5.953800e-02
[79,] 0.92604029 1.479194e-01 7.395971e-02
[80,] 0.90995288 1.800942e-01 9.004712e-02
[81,] 0.90228974 1.954205e-01 9.771026e-02
[82,] 0.89210671 2.157866e-01 1.078933e-01
[83,] 0.87641383 2.471723e-01 1.235862e-01
[84,] 0.85365589 2.926882e-01 1.463441e-01
[85,] 0.82633770 3.473246e-01 1.736623e-01
[86,] 0.80396345 3.920731e-01 1.960366e-01
[87,] 0.77389795 4.522041e-01 2.261021e-01
[88,] 0.75501029 4.899794e-01 2.449897e-01
[89,] 0.73813000 5.237400e-01 2.618700e-01
[90,] 0.71631008 5.673798e-01 2.836899e-01
[91,] 0.68311085 6.337783e-01 3.168892e-01
[92,] 0.68694303 6.261139e-01 3.130570e-01
[93,] 0.69681837 6.063633e-01 3.031816e-01
[94,] 0.72161472 5.567706e-01 2.783853e-01
[95,] 0.99999266 1.468154e-05 7.340771e-06
[96,] 0.99999321 1.357113e-05 6.785563e-06
[97,] 0.99999957 8.510924e-07 4.255462e-07
[98,] 0.99999930 1.406716e-06 7.033579e-07
[99,] 0.99999883 2.349732e-06 1.174866e-06
[100,] 0.99999926 1.476118e-06 7.380589e-07
[101,] 0.99999879 2.421945e-06 1.210973e-06
[102,] 0.99999855 2.900921e-06 1.450461e-06
[103,] 0.99999791 4.185856e-06 2.092928e-06
[104,] 0.99999728 5.448317e-06 2.724158e-06
[105,] 0.99999573 8.544583e-06 4.272291e-06
[106,] 0.99999348 1.303262e-05 6.516309e-06
[107,] 0.99998902 2.196733e-05 1.098366e-05
[108,] 0.99999300 1.399502e-05 6.997511e-06
[109,] 0.99999065 1.869215e-05 9.346076e-06
[110,] 0.99999296 1.408959e-05 7.044793e-06
[111,] 0.99998837 2.326787e-05 1.163393e-05
[112,] 0.99997914 4.172108e-05 2.086054e-05
[113,] 0.99996944 6.112058e-05 3.056029e-05
[114,] 0.99995908 8.183106e-05 4.091553e-05
[115,] 0.99992929 1.414253e-04 7.071263e-05
[116,] 0.99989366 2.126771e-04 1.063385e-04
[117,] 0.99989868 2.026324e-04 1.013162e-04
[118,] 0.99983047 3.390575e-04 1.695287e-04
[119,] 0.99972128 5.574397e-04 2.787199e-04
[120,] 0.99971518 5.696309e-04 2.848155e-04
[121,] 0.99960962 7.807577e-04 3.903789e-04
[122,] 0.99946057 1.078867e-03 5.394335e-04
[123,] 0.99917308 1.653833e-03 8.269163e-04
[124,] 0.99865664 2.686725e-03 1.343362e-03
[125,] 0.99788631 4.227386e-03 2.113693e-03
[126,] 0.99674989 6.500225e-03 3.250112e-03
[127,] 0.99490782 1.018436e-02 5.092179e-03
[128,] 0.99238386 1.523228e-02 7.616140e-03
[129,] 0.98887760 2.224479e-02 1.112240e-02
[130,] 0.98410536 3.178928e-02 1.589464e-02
[131,] 0.97980950 4.038101e-02 2.019050e-02
[132,] 0.97304558 5.390884e-02 2.695442e-02
[133,] 0.96342034 7.315931e-02 3.657966e-02
[134,] 0.94814618 1.037076e-01 5.185382e-02
[135,] 0.93088254 1.382349e-01 6.911746e-02
[136,] 0.96342479 7.315042e-02 3.657521e-02
[137,] 0.94805584 1.038883e-01 5.194416e-02
[138,] 0.97972598 4.054804e-02 2.027402e-02
[139,] 0.96925294 6.149411e-02 3.074706e-02
[140,] 0.95386546 9.226907e-02 4.613454e-02
[141,] 0.93279650 1.344070e-01 6.720350e-02
[142,] 0.90774898 1.845020e-01 9.225102e-02
[143,] 0.87652470 2.469506e-01 1.234753e-01
[144,] 0.83162437 3.367513e-01 1.683756e-01
[145,] 0.81981087 3.603783e-01 1.801891e-01
[146,] 0.99963203 7.359389e-04 3.679694e-04
[147,] 0.99912573 1.748548e-03 8.742742e-04
[148,] 0.99881360 2.372806e-03 1.186403e-03
[149,] 0.99700303 5.993932e-03 2.996966e-03
[150,] 0.99587756 8.244887e-03 4.122444e-03
[151,] 0.99024976 1.950048e-02 9.750241e-03
[152,] 0.99649513 7.009748e-03 3.504874e-03
[153,] 0.99563478 8.730432e-03 4.365216e-03
[154,] 0.98793119 2.413762e-02 1.206881e-02
[155,] 0.99680534 6.389319e-03 3.194660e-03
[156,] 0.98490443 3.019113e-02 1.509557e-02
> postscript(file="/var/wessaorg/rcomp/tmp/12r6h1323864652.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/2eqii1323864652.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/3jj1b1323864652.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/4y5pw1323864652.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/5y0ar1323864652.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 = 171
Frequency = 1
1 2 3 4 5 6
-21.49463716 -8.38488481 -20.18319035 7.06864799 -20.32183315 -30.56150178
7 8 9 10 11 12
5.12827327 -6.74412695 41.56882172 -33.35206590 44.98082612 -30.35861351
13 14 15 16 17 18
-29.29147003 3.17826175 -25.93434638 26.50702726 37.23190678 -7.66450172
19 20 21 22 23 24
-14.42951004 -25.10770573 -11.16905949 -9.83758209 18.66510147 -3.18213196
25 26 27 28 29 30
-12.81956667 34.17315883 65.05364763 -13.53468724 50.20185548 -4.86920444
31 32 33 34 35 36
-21.27023082 40.33504400 -15.28746076 -4.82444830 1.67674800 176.42673885
37 38 39 40 41 42
-31.51500936 -29.14256960 91.69978753 -2.82776804 12.85046982 10.85370297
43 44 45 46 47 48
-6.99174255 -9.87556498 33.26125763 43.84603968 -21.89952508 -14.07220910
49 50 51 52 53 54
-23.72441214 -37.68440354 -1.70513820 -0.32140562 -16.71889997 -5.39619668
55 56 57 58 59 60
-0.47255579 -26.75888690 -9.95891345 75.99675202 -9.77246820 -28.86174844
61 62 63 64 65 66
0.39461977 -16.66234062 -3.73231422 -40.26170696 -32.52800073 12.38715657
67 68 69 70 71 72
-13.63935930 0.72136492 2.82493460 -35.08891165 84.19206882 33.97580111
73 74 75 76 77 78
19.79224235 -14.28376600 15.88569241 -1.60694672 38.09470713 -7.05174731
79 80 81 82 83 84
9.74970972 -19.19753243 -28.00158066 -7.95771349 -16.98110567 12.26376673
85 86 87 88 89 90
-31.57645875 0.54513292 -2.68961782 -21.57545470 -18.36608663 -12.87339915
91 92 93 94 95 96
9.33119540 4.17899913 14.63729433 -4.43579411 -17.29431937 -27.13149743
97 98 99 100 101 102
-23.88060642 15.37160481 -35.06428923 -20.33982215 -37.97573919 176.73094923
103 104 105 106 107 108
-28.42605506 66.74032579 14.61010725 7.63309989 -39.29270827 8.60894418
109 110 111 112 113 114
24.59527746 17.22554658 -19.45652639 11.56418943 -12.67295461 -10.75247321
115 116 117 118 119 120
-19.87818720 -17.19741654 30.59526713 13.34714352 6.69635652 22.37368372
121 122 123 124 125 126
-22.36612151 -2.24994014 -15.72871813 -19.51352322 -3.70481300 -10.26830180
127 128 129 130 131 132
-24.38625849 -12.49499344 18.04401139 13.73292296 6.26215394 4.86213111
133 134 135 136 137 138
-8.64012259 -1.40406698 -8.44245800 -15.23953981 -9.06440063 -21.99963723
139 140 141 142 143 144
-15.52437600 0.74451719 -0.86432354 -20.39495309 36.85404095 -5.95596635
145 146 147 148 149 150
-24.33218915 -9.95813825 -6.99715392 9.65510766 -0.85536722 -4.38435231
151 152 153 154 155 156
-19.17864151 -7.51097162 98.27148408 -11.65492207 4.36350296 0.01926948
157 158 159 160 161 162
26.60895369 -21.13043925 20.66682591 0.91463569 -6.81644380 -25.23592235
163 164 165 166 167 168
-0.39326713 -5.52999297 9.45445749 -17.25265639 -4.55685602 -14.41860568
169 170 171
-22.08570497 -12.27541162 -27.22110562
> postscript(file="/var/wessaorg/rcomp/tmp/68kbq1323864652.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 = 171
Frequency = 1
lag(myerror, k = 1) myerror
0 -21.49463716 NA
1 -8.38488481 -21.49463716
2 -20.18319035 -8.38488481
3 7.06864799 -20.18319035
4 -20.32183315 7.06864799
5 -30.56150178 -20.32183315
6 5.12827327 -30.56150178
7 -6.74412695 5.12827327
8 41.56882172 -6.74412695
9 -33.35206590 41.56882172
10 44.98082612 -33.35206590
11 -30.35861351 44.98082612
12 -29.29147003 -30.35861351
13 3.17826175 -29.29147003
14 -25.93434638 3.17826175
15 26.50702726 -25.93434638
16 37.23190678 26.50702726
17 -7.66450172 37.23190678
18 -14.42951004 -7.66450172
19 -25.10770573 -14.42951004
20 -11.16905949 -25.10770573
21 -9.83758209 -11.16905949
22 18.66510147 -9.83758209
23 -3.18213196 18.66510147
24 -12.81956667 -3.18213196
25 34.17315883 -12.81956667
26 65.05364763 34.17315883
27 -13.53468724 65.05364763
28 50.20185548 -13.53468724
29 -4.86920444 50.20185548
30 -21.27023082 -4.86920444
31 40.33504400 -21.27023082
32 -15.28746076 40.33504400
33 -4.82444830 -15.28746076
34 1.67674800 -4.82444830
35 176.42673885 1.67674800
36 -31.51500936 176.42673885
37 -29.14256960 -31.51500936
38 91.69978753 -29.14256960
39 -2.82776804 91.69978753
40 12.85046982 -2.82776804
41 10.85370297 12.85046982
42 -6.99174255 10.85370297
43 -9.87556498 -6.99174255
44 33.26125763 -9.87556498
45 43.84603968 33.26125763
46 -21.89952508 43.84603968
47 -14.07220910 -21.89952508
48 -23.72441214 -14.07220910
49 -37.68440354 -23.72441214
50 -1.70513820 -37.68440354
51 -0.32140562 -1.70513820
52 -16.71889997 -0.32140562
53 -5.39619668 -16.71889997
54 -0.47255579 -5.39619668
55 -26.75888690 -0.47255579
56 -9.95891345 -26.75888690
57 75.99675202 -9.95891345
58 -9.77246820 75.99675202
59 -28.86174844 -9.77246820
60 0.39461977 -28.86174844
61 -16.66234062 0.39461977
62 -3.73231422 -16.66234062
63 -40.26170696 -3.73231422
64 -32.52800073 -40.26170696
65 12.38715657 -32.52800073
66 -13.63935930 12.38715657
67 0.72136492 -13.63935930
68 2.82493460 0.72136492
69 -35.08891165 2.82493460
70 84.19206882 -35.08891165
71 33.97580111 84.19206882
72 19.79224235 33.97580111
73 -14.28376600 19.79224235
74 15.88569241 -14.28376600
75 -1.60694672 15.88569241
76 38.09470713 -1.60694672
77 -7.05174731 38.09470713
78 9.74970972 -7.05174731
79 -19.19753243 9.74970972
80 -28.00158066 -19.19753243
81 -7.95771349 -28.00158066
82 -16.98110567 -7.95771349
83 12.26376673 -16.98110567
84 -31.57645875 12.26376673
85 0.54513292 -31.57645875
86 -2.68961782 0.54513292
87 -21.57545470 -2.68961782
88 -18.36608663 -21.57545470
89 -12.87339915 -18.36608663
90 9.33119540 -12.87339915
91 4.17899913 9.33119540
92 14.63729433 4.17899913
93 -4.43579411 14.63729433
94 -17.29431937 -4.43579411
95 -27.13149743 -17.29431937
96 -23.88060642 -27.13149743
97 15.37160481 -23.88060642
98 -35.06428923 15.37160481
99 -20.33982215 -35.06428923
100 -37.97573919 -20.33982215
101 176.73094923 -37.97573919
102 -28.42605506 176.73094923
103 66.74032579 -28.42605506
104 14.61010725 66.74032579
105 7.63309989 14.61010725
106 -39.29270827 7.63309989
107 8.60894418 -39.29270827
108 24.59527746 8.60894418
109 17.22554658 24.59527746
110 -19.45652639 17.22554658
111 11.56418943 -19.45652639
112 -12.67295461 11.56418943
113 -10.75247321 -12.67295461
114 -19.87818720 -10.75247321
115 -17.19741654 -19.87818720
116 30.59526713 -17.19741654
117 13.34714352 30.59526713
118 6.69635652 13.34714352
119 22.37368372 6.69635652
120 -22.36612151 22.37368372
121 -2.24994014 -22.36612151
122 -15.72871813 -2.24994014
123 -19.51352322 -15.72871813
124 -3.70481300 -19.51352322
125 -10.26830180 -3.70481300
126 -24.38625849 -10.26830180
127 -12.49499344 -24.38625849
128 18.04401139 -12.49499344
129 13.73292296 18.04401139
130 6.26215394 13.73292296
131 4.86213111 6.26215394
132 -8.64012259 4.86213111
133 -1.40406698 -8.64012259
134 -8.44245800 -1.40406698
135 -15.23953981 -8.44245800
136 -9.06440063 -15.23953981
137 -21.99963723 -9.06440063
138 -15.52437600 -21.99963723
139 0.74451719 -15.52437600
140 -0.86432354 0.74451719
141 -20.39495309 -0.86432354
142 36.85404095 -20.39495309
143 -5.95596635 36.85404095
144 -24.33218915 -5.95596635
145 -9.95813825 -24.33218915
146 -6.99715392 -9.95813825
147 9.65510766 -6.99715392
148 -0.85536722 9.65510766
149 -4.38435231 -0.85536722
150 -19.17864151 -4.38435231
151 -7.51097162 -19.17864151
152 98.27148408 -7.51097162
153 -11.65492207 98.27148408
154 4.36350296 -11.65492207
155 0.01926948 4.36350296
156 26.60895369 0.01926948
157 -21.13043925 26.60895369
158 20.66682591 -21.13043925
159 0.91463569 20.66682591
160 -6.81644380 0.91463569
161 -25.23592235 -6.81644380
162 -0.39326713 -25.23592235
163 -5.52999297 -0.39326713
164 9.45445749 -5.52999297
165 -17.25265639 9.45445749
166 -4.55685602 -17.25265639
167 -14.41860568 -4.55685602
168 -22.08570497 -14.41860568
169 -12.27541162 -22.08570497
170 -27.22110562 -12.27541162
171 NA -27.22110562
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -8.38488481 -21.49463716
[2,] -20.18319035 -8.38488481
[3,] 7.06864799 -20.18319035
[4,] -20.32183315 7.06864799
[5,] -30.56150178 -20.32183315
[6,] 5.12827327 -30.56150178
[7,] -6.74412695 5.12827327
[8,] 41.56882172 -6.74412695
[9,] -33.35206590 41.56882172
[10,] 44.98082612 -33.35206590
[11,] -30.35861351 44.98082612
[12,] -29.29147003 -30.35861351
[13,] 3.17826175 -29.29147003
[14,] -25.93434638 3.17826175
[15,] 26.50702726 -25.93434638
[16,] 37.23190678 26.50702726
[17,] -7.66450172 37.23190678
[18,] -14.42951004 -7.66450172
[19,] -25.10770573 -14.42951004
[20,] -11.16905949 -25.10770573
[21,] -9.83758209 -11.16905949
[22,] 18.66510147 -9.83758209
[23,] -3.18213196 18.66510147
[24,] -12.81956667 -3.18213196
[25,] 34.17315883 -12.81956667
[26,] 65.05364763 34.17315883
[27,] -13.53468724 65.05364763
[28,] 50.20185548 -13.53468724
[29,] -4.86920444 50.20185548
[30,] -21.27023082 -4.86920444
[31,] 40.33504400 -21.27023082
[32,] -15.28746076 40.33504400
[33,] -4.82444830 -15.28746076
[34,] 1.67674800 -4.82444830
[35,] 176.42673885 1.67674800
[36,] -31.51500936 176.42673885
[37,] -29.14256960 -31.51500936
[38,] 91.69978753 -29.14256960
[39,] -2.82776804 91.69978753
[40,] 12.85046982 -2.82776804
[41,] 10.85370297 12.85046982
[42,] -6.99174255 10.85370297
[43,] -9.87556498 -6.99174255
[44,] 33.26125763 -9.87556498
[45,] 43.84603968 33.26125763
[46,] -21.89952508 43.84603968
[47,] -14.07220910 -21.89952508
[48,] -23.72441214 -14.07220910
[49,] -37.68440354 -23.72441214
[50,] -1.70513820 -37.68440354
[51,] -0.32140562 -1.70513820
[52,] -16.71889997 -0.32140562
[53,] -5.39619668 -16.71889997
[54,] -0.47255579 -5.39619668
[55,] -26.75888690 -0.47255579
[56,] -9.95891345 -26.75888690
[57,] 75.99675202 -9.95891345
[58,] -9.77246820 75.99675202
[59,] -28.86174844 -9.77246820
[60,] 0.39461977 -28.86174844
[61,] -16.66234062 0.39461977
[62,] -3.73231422 -16.66234062
[63,] -40.26170696 -3.73231422
[64,] -32.52800073 -40.26170696
[65,] 12.38715657 -32.52800073
[66,] -13.63935930 12.38715657
[67,] 0.72136492 -13.63935930
[68,] 2.82493460 0.72136492
[69,] -35.08891165 2.82493460
[70,] 84.19206882 -35.08891165
[71,] 33.97580111 84.19206882
[72,] 19.79224235 33.97580111
[73,] -14.28376600 19.79224235
[74,] 15.88569241 -14.28376600
[75,] -1.60694672 15.88569241
[76,] 38.09470713 -1.60694672
[77,] -7.05174731 38.09470713
[78,] 9.74970972 -7.05174731
[79,] -19.19753243 9.74970972
[80,] -28.00158066 -19.19753243
[81,] -7.95771349 -28.00158066
[82,] -16.98110567 -7.95771349
[83,] 12.26376673 -16.98110567
[84,] -31.57645875 12.26376673
[85,] 0.54513292 -31.57645875
[86,] -2.68961782 0.54513292
[87,] -21.57545470 -2.68961782
[88,] -18.36608663 -21.57545470
[89,] -12.87339915 -18.36608663
[90,] 9.33119540 -12.87339915
[91,] 4.17899913 9.33119540
[92,] 14.63729433 4.17899913
[93,] -4.43579411 14.63729433
[94,] -17.29431937 -4.43579411
[95,] -27.13149743 -17.29431937
[96,] -23.88060642 -27.13149743
[97,] 15.37160481 -23.88060642
[98,] -35.06428923 15.37160481
[99,] -20.33982215 -35.06428923
[100,] -37.97573919 -20.33982215
[101,] 176.73094923 -37.97573919
[102,] -28.42605506 176.73094923
[103,] 66.74032579 -28.42605506
[104,] 14.61010725 66.74032579
[105,] 7.63309989 14.61010725
[106,] -39.29270827 7.63309989
[107,] 8.60894418 -39.29270827
[108,] 24.59527746 8.60894418
[109,] 17.22554658 24.59527746
[110,] -19.45652639 17.22554658
[111,] 11.56418943 -19.45652639
[112,] -12.67295461 11.56418943
[113,] -10.75247321 -12.67295461
[114,] -19.87818720 -10.75247321
[115,] -17.19741654 -19.87818720
[116,] 30.59526713 -17.19741654
[117,] 13.34714352 30.59526713
[118,] 6.69635652 13.34714352
[119,] 22.37368372 6.69635652
[120,] -22.36612151 22.37368372
[121,] -2.24994014 -22.36612151
[122,] -15.72871813 -2.24994014
[123,] -19.51352322 -15.72871813
[124,] -3.70481300 -19.51352322
[125,] -10.26830180 -3.70481300
[126,] -24.38625849 -10.26830180
[127,] -12.49499344 -24.38625849
[128,] 18.04401139 -12.49499344
[129,] 13.73292296 18.04401139
[130,] 6.26215394 13.73292296
[131,] 4.86213111 6.26215394
[132,] -8.64012259 4.86213111
[133,] -1.40406698 -8.64012259
[134,] -8.44245800 -1.40406698
[135,] -15.23953981 -8.44245800
[136,] -9.06440063 -15.23953981
[137,] -21.99963723 -9.06440063
[138,] -15.52437600 -21.99963723
[139,] 0.74451719 -15.52437600
[140,] -0.86432354 0.74451719
[141,] -20.39495309 -0.86432354
[142,] 36.85404095 -20.39495309
[143,] -5.95596635 36.85404095
[144,] -24.33218915 -5.95596635
[145,] -9.95813825 -24.33218915
[146,] -6.99715392 -9.95813825
[147,] 9.65510766 -6.99715392
[148,] -0.85536722 9.65510766
[149,] -4.38435231 -0.85536722
[150,] -19.17864151 -4.38435231
[151,] -7.51097162 -19.17864151
[152,] 98.27148408 -7.51097162
[153,] -11.65492207 98.27148408
[154,] 4.36350296 -11.65492207
[155,] 0.01926948 4.36350296
[156,] 26.60895369 0.01926948
[157,] -21.13043925 26.60895369
[158,] 20.66682591 -21.13043925
[159,] 0.91463569 20.66682591
[160,] -6.81644380 0.91463569
[161,] -25.23592235 -6.81644380
[162,] -0.39326713 -25.23592235
[163,] -5.52999297 -0.39326713
[164,] 9.45445749 -5.52999297
[165,] -17.25265639 9.45445749
[166,] -4.55685602 -17.25265639
[167,] -14.41860568 -4.55685602
[168,] -22.08570497 -14.41860568
[169,] -12.27541162 -22.08570497
[170,] -27.22110562 -12.27541162
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -8.38488481 -21.49463716
2 -20.18319035 -8.38488481
3 7.06864799 -20.18319035
4 -20.32183315 7.06864799
5 -30.56150178 -20.32183315
6 5.12827327 -30.56150178
7 -6.74412695 5.12827327
8 41.56882172 -6.74412695
9 -33.35206590 41.56882172
10 44.98082612 -33.35206590
11 -30.35861351 44.98082612
12 -29.29147003 -30.35861351
13 3.17826175 -29.29147003
14 -25.93434638 3.17826175
15 26.50702726 -25.93434638
16 37.23190678 26.50702726
17 -7.66450172 37.23190678
18 -14.42951004 -7.66450172
19 -25.10770573 -14.42951004
20 -11.16905949 -25.10770573
21 -9.83758209 -11.16905949
22 18.66510147 -9.83758209
23 -3.18213196 18.66510147
24 -12.81956667 -3.18213196
25 34.17315883 -12.81956667
26 65.05364763 34.17315883
27 -13.53468724 65.05364763
28 50.20185548 -13.53468724
29 -4.86920444 50.20185548
30 -21.27023082 -4.86920444
31 40.33504400 -21.27023082
32 -15.28746076 40.33504400
33 -4.82444830 -15.28746076
34 1.67674800 -4.82444830
35 176.42673885 1.67674800
36 -31.51500936 176.42673885
37 -29.14256960 -31.51500936
38 91.69978753 -29.14256960
39 -2.82776804 91.69978753
40 12.85046982 -2.82776804
41 10.85370297 12.85046982
42 -6.99174255 10.85370297
43 -9.87556498 -6.99174255
44 33.26125763 -9.87556498
45 43.84603968 33.26125763
46 -21.89952508 43.84603968
47 -14.07220910 -21.89952508
48 -23.72441214 -14.07220910
49 -37.68440354 -23.72441214
50 -1.70513820 -37.68440354
51 -0.32140562 -1.70513820
52 -16.71889997 -0.32140562
53 -5.39619668 -16.71889997
54 -0.47255579 -5.39619668
55 -26.75888690 -0.47255579
56 -9.95891345 -26.75888690
57 75.99675202 -9.95891345
58 -9.77246820 75.99675202
59 -28.86174844 -9.77246820
60 0.39461977 -28.86174844
61 -16.66234062 0.39461977
62 -3.73231422 -16.66234062
63 -40.26170696 -3.73231422
64 -32.52800073 -40.26170696
65 12.38715657 -32.52800073
66 -13.63935930 12.38715657
67 0.72136492 -13.63935930
68 2.82493460 0.72136492
69 -35.08891165 2.82493460
70 84.19206882 -35.08891165
71 33.97580111 84.19206882
72 19.79224235 33.97580111
73 -14.28376600 19.79224235
74 15.88569241 -14.28376600
75 -1.60694672 15.88569241
76 38.09470713 -1.60694672
77 -7.05174731 38.09470713
78 9.74970972 -7.05174731
79 -19.19753243 9.74970972
80 -28.00158066 -19.19753243
81 -7.95771349 -28.00158066
82 -16.98110567 -7.95771349
83 12.26376673 -16.98110567
84 -31.57645875 12.26376673
85 0.54513292 -31.57645875
86 -2.68961782 0.54513292
87 -21.57545470 -2.68961782
88 -18.36608663 -21.57545470
89 -12.87339915 -18.36608663
90 9.33119540 -12.87339915
91 4.17899913 9.33119540
92 14.63729433 4.17899913
93 -4.43579411 14.63729433
94 -17.29431937 -4.43579411
95 -27.13149743 -17.29431937
96 -23.88060642 -27.13149743
97 15.37160481 -23.88060642
98 -35.06428923 15.37160481
99 -20.33982215 -35.06428923
100 -37.97573919 -20.33982215
101 176.73094923 -37.97573919
102 -28.42605506 176.73094923
103 66.74032579 -28.42605506
104 14.61010725 66.74032579
105 7.63309989 14.61010725
106 -39.29270827 7.63309989
107 8.60894418 -39.29270827
108 24.59527746 8.60894418
109 17.22554658 24.59527746
110 -19.45652639 17.22554658
111 11.56418943 -19.45652639
112 -12.67295461 11.56418943
113 -10.75247321 -12.67295461
114 -19.87818720 -10.75247321
115 -17.19741654 -19.87818720
116 30.59526713 -17.19741654
117 13.34714352 30.59526713
118 6.69635652 13.34714352
119 22.37368372 6.69635652
120 -22.36612151 22.37368372
121 -2.24994014 -22.36612151
122 -15.72871813 -2.24994014
123 -19.51352322 -15.72871813
124 -3.70481300 -19.51352322
125 -10.26830180 -3.70481300
126 -24.38625849 -10.26830180
127 -12.49499344 -24.38625849
128 18.04401139 -12.49499344
129 13.73292296 18.04401139
130 6.26215394 13.73292296
131 4.86213111 6.26215394
132 -8.64012259 4.86213111
133 -1.40406698 -8.64012259
134 -8.44245800 -1.40406698
135 -15.23953981 -8.44245800
136 -9.06440063 -15.23953981
137 -21.99963723 -9.06440063
138 -15.52437600 -21.99963723
139 0.74451719 -15.52437600
140 -0.86432354 0.74451719
141 -20.39495309 -0.86432354
142 36.85404095 -20.39495309
143 -5.95596635 36.85404095
144 -24.33218915 -5.95596635
145 -9.95813825 -24.33218915
146 -6.99715392 -9.95813825
147 9.65510766 -6.99715392
148 -0.85536722 9.65510766
149 -4.38435231 -0.85536722
150 -19.17864151 -4.38435231
151 -7.51097162 -19.17864151
152 98.27148408 -7.51097162
153 -11.65492207 98.27148408
154 4.36350296 -11.65492207
155 0.01926948 4.36350296
156 26.60895369 0.01926948
157 -21.13043925 26.60895369
158 20.66682591 -21.13043925
159 0.91463569 20.66682591
160 -6.81644380 0.91463569
161 -25.23592235 -6.81644380
162 -0.39326713 -25.23592235
163 -5.52999297 -0.39326713
164 9.45445749 -5.52999297
165 -17.25265639 9.45445749
166 -4.55685602 -17.25265639
167 -14.41860568 -4.55685602
168 -22.08570497 -14.41860568
169 -12.27541162 -22.08570497
170 -27.22110562 -12.27541162
> 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/7mak31323864652.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/89gyb1323864652.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/975sm1323864652.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/10wb4g1323864652.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/11v6rt1323864652.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/12bhqa1323864652.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/13h02q1323864652.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/14ldg71323864652.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/15n1bw1323864652.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/16ha8p1323864652.tab")
+ }
>
> try(system("convert tmp/12r6h1323864652.ps tmp/12r6h1323864652.png",intern=TRUE))
character(0)
> try(system("convert tmp/2eqii1323864652.ps tmp/2eqii1323864652.png",intern=TRUE))
character(0)
> try(system("convert tmp/3jj1b1323864652.ps tmp/3jj1b1323864652.png",intern=TRUE))
character(0)
> try(system("convert tmp/4y5pw1323864652.ps tmp/4y5pw1323864652.png",intern=TRUE))
character(0)
> try(system("convert tmp/5y0ar1323864652.ps tmp/5y0ar1323864652.png",intern=TRUE))
character(0)
> try(system("convert tmp/68kbq1323864652.ps tmp/68kbq1323864652.png",intern=TRUE))
character(0)
> try(system("convert tmp/7mak31323864652.ps tmp/7mak31323864652.png",intern=TRUE))
character(0)
> try(system("convert tmp/89gyb1323864652.ps tmp/89gyb1323864652.png",intern=TRUE))
character(0)
> try(system("convert tmp/975sm1323864652.ps tmp/975sm1323864652.png",intern=TRUE))
character(0)
> try(system("convert tmp/10wb4g1323864652.ps tmp/10wb4g1323864652.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.061 0.556 6.015