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(1845
+ ,162687
+ ,95
+ ,595
+ ,115
+ ,0
+ ,48
+ ,1917
+ ,233285
+ ,67
+ ,580
+ ,79
+ ,1
+ ,75
+ ,192
+ ,7215
+ ,18
+ ,72
+ ,1
+ ,0
+ ,0
+ ,2665
+ ,164587
+ ,99
+ ,737
+ ,158
+ ,0
+ ,74
+ ,3709
+ ,283430
+ ,141
+ ,1255
+ ,127
+ ,0
+ ,92
+ ,7138
+ ,546996
+ ,275
+ ,2021
+ ,278
+ ,1
+ ,137
+ ,1888
+ ,192501
+ ,61
+ ,606
+ ,95
+ ,1
+ ,65
+ ,1909
+ ,213538
+ ,64
+ ,533
+ ,64
+ ,0
+ ,97
+ ,2140
+ ,182282
+ ,46
+ ,687
+ ,92
+ ,0
+ ,62
+ ,3168
+ ,336547
+ ,102
+ ,1074
+ ,130
+ ,1
+ ,72
+ ,1957
+ ,122275
+ ,77
+ ,637
+ ,158
+ ,2
+ ,50
+ ,2370
+ ,203938
+ ,72
+ ,743
+ ,120
+ ,0
+ ,88
+ ,1998
+ ,119300
+ ,110
+ ,701
+ ,87
+ ,0
+ ,68
+ ,3203
+ ,220796
+ ,122
+ ,1087
+ ,264
+ ,4
+ ,79
+ ,1505
+ ,174005
+ ,67
+ ,422
+ ,51
+ ,4
+ ,56
+ ,1574
+ ,156326
+ ,89
+ ,474
+ ,85
+ ,3
+ ,54
+ ,1965
+ ,164063
+ ,60
+ ,483
+ ,100
+ ,0
+ ,101
+ ,1314
+ ,90025
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42
+ ,5118
+ ,3
+ ,6
+ ,1
+ ,0
+ ,5
+ ,528
+ ,40248
+ ,16
+ ,183
+ ,34
+ ,1
+ ,8
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1122
+ ,127628
+ ,51
+ ,342
+ ,53
+ ,0
+ ,38
+ ,1305
+ ,88837
+ ,38
+ ,269
+ ,44
+ ,0
+ ,21
+ ,81
+ ,7131
+ ,4
+ ,27
+ ,0
+ ,1
+ ,0
+ ,262
+ ,9056
+ ,15
+ ,99
+ ,18
+ ,0
+ ,0
+ ,1165
+ ,97191
+ ,31
+ ,322
+ ,52
+ ,1
+ ,26
+ ,1405
+ ,157478
+ ,59
+ ,367
+ ,60
+ ,0
+ ,53
+ ,1409
+ ,125583
+ ,23
+ ,521
+ ,50
+ ,1
+ ,31)
+ ,dim=c(7
+ ,144)
+ ,dimnames=list(c('a'
+ ,'b'
+ ,'c'
+ ,'d'
+ ,'e'
+ ,'f'
+ ,'g')
+ ,1:144))
> y <- array(NA,dim=c(7,144),dimnames=list(c('a','b','c','d','e','f','g'),1:144))
> 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
a b c d e f g
1 1845 162687 95 595 115 0 48
2 1917 233285 67 580 79 1 75
3 192 7215 18 72 1 0 0
4 2665 164587 99 737 158 0 74
5 3709 283430 141 1255 127 0 92
6 7138 546996 275 2021 278 1 137
7 1888 192501 61 606 95 1 65
8 1909 213538 64 533 64 0 97
9 2140 182282 46 687 92 0 62
10 3168 336547 102 1074 130 1 72
11 1957 122275 77 637 158 2 50
12 2370 203938 72 743 120 0 88
13 1998 119300 110 701 87 0 68
14 3203 220796 122 1087 264 4 79
15 1505 174005 67 422 51 4 56
16 1574 156326 89 474 85 3 54
17 1965 164063 60 483 100 0 101
18 1314 90025 63 375 72 5 13
19 2921 179987 90 929 147 0 80
20 823 47066 29 262 49 0 19
21 1289 109572 64 437 40 0 33
22 2818 241285 103 850 99 0 99
23 1792 208339 77 652 127 1 38
24 2474 164166 59 754 166 1 68
25 1994 159763 89 619 41 1 54
26 1806 207078 34 657 160 0 63
27 2177 217028 169 695 92 0 66
28 1458 201536 96 366 59 0 90
29 3057 408960 124 1015 89 0 75
30 2487 250260 48 1029 104 0 68
31 1914 216527 46 576 81 0 69
32 1825 212949 51 656 116 2 80
33 2509 164248 110 812 105 4 59
34 3634 278911 136 1108 388 0 135
35 2608 238654 59 852 88 1 75
36 1 0 1 0 0 0 0
37 2157 233971 66 1009 63 0 54
38 1978 149649 55 658 138 3 62
39 2224 161703 52 547 270 9 46
40 2215 254893 70 826 64 0 83
41 2538 269492 73 838 96 2 106
42 1881 169526 62 704 62 0 51
43 1113 107893 35 404 35 2 27
44 2380 229714 83 848 66 1 78
45 1365 139667 51 419 56 2 71
46 1294 175983 102 349 46 2 44
47 756 81407 33 216 49 1 23
48 2465 251259 110 796 121 0 78
49 2327 239807 90 752 113 1 60
50 2787 172743 60 964 190 8 73
51 658 48188 28 205 37 0 12
52 2013 169355 71 506 52 0 104
53 2666 335398 78 841 89 0 95
54 2086 244729 81 699 73 0 57
55 2067 208286 62 746 61 1 68
56 1776 159913 58 547 77 8 44
57 2045 232137 72 561 63 0 62
58 1047 101694 26 329 75 1 26
59 1190 157258 68 427 32 0 67
60 2932 211586 101 993 59 10 36
61 1868 181076 66 564 71 6 56
62 2316 158024 86 858 92 0 55
63 1392 141491 64 376 87 11 54
64 1355 130108 40 471 48 3 61
65 1326 166420 39 432 63 0 27
66 1587 135509 45 500 41 0 64
67 2336 195043 72 504 86 8 76
68 2898 138708 66 887 152 2 93
69 1118 116552 40 271 49 0 59
70 340 31970 15 101 40 0 5
71 3224 291993 121 1203 148 3 62
72 1552 167825 82 506 86 1 47
73 1551 135926 69 528 62 2 88
74 1794 136647 77 501 96 1 57
75 2728 171518 71 698 95 0 81
76 1580 108980 46 426 83 2 35
77 2414 183471 61 709 112 1 102
78 2640 167426 101 847 77 0 73
79 1203 112510 49 367 78 0 32
80 1313 92421 77 413 114 0 34
81 1207 117169 84 272 55 0 80
82 2246 304603 65 830 60 0 49
83 1076 75101 30 334 49 1 30
84 1638 145043 41 524 132 0 57
85 1208 95827 48 393 49 0 54
86 1868 173931 60 574 71 0 38
87 2829 250424 252 695 102 0 63
88 1209 115367 116 284 74 0 58
89 1463 125839 66 462 49 7 49
90 1610 164078 54 653 74 0 46
91 1865 158931 42 684 59 5 51
92 2444 190382 85 714 91 1 90
93 1253 155226 59 420 68 0 45
94 1468 146159 61 551 81 0 28
95 979 62641 44 396 33 0 26
96 2365 258585 121 741 166 0 54
97 1890 199841 71 571 97 0 96
98 223 19349 12 67 15 0 13
99 2527 247280 109 877 105 3 43
100 2186 173152 88 885 61 0 46
101 778 72128 30 306 11 0 30
102 1194 104253 26 382 45 0 59
103 1424 151090 57 435 89 0 73
104 1386 147990 68 348 72 1 40
105 839 87448 42 227 27 1 36
106 596 27676 22 194 59 0 2
107 1684 170326 52 413 127 0 103
108 1168 132148 38 273 48 1 30
109 0 0 0 0 0 0 0
110 1315 133868 36 390 58 0 78
111 1149 109001 68 376 57 0 25
112 1485 158833 46 495 60 0 59
113 1529 150013 66 448 77 1 60
114 962 89887 63 313 71 0 36
115 78 3616 5 14 5 0 0
116 0 0 0 0 0 0 0
117 1295 216479 48 445 78 0 51
118 1751 177323 102 637 76 0 79
119 2142 177948 102 593 124 2 30
120 1070 140106 41 326 67 0 43
121 778 43410 19 292 63 0 7
122 1986 206059 76 573 92 1 92
123 1084 109873 45 315 58 0 32
124 2400 157084 61 683 65 10 84
125 731 60493 40 174 29 3 3
126 285 19764 12 75 19 1 10
127 1873 177559 57 572 64 3 47
128 1269 154169 36 414 79 0 44
129 1725 164249 54 562 104 0 54
130 256 11796 9 79 22 0 1
131 98 10674 9 33 7 0 0
132 1435 151322 59 487 37 0 46
133 41 6836 3 11 5 0 0
134 1931 174712 68 664 48 6 51
135 42 5118 3 6 1 0 5
136 528 40248 16 183 34 1 8
137 0 0 0 0 0 0 0
138 1122 127628 51 342 53 0 38
139 1305 88837 38 269 44 0 21
140 81 7131 4 27 0 1 0
141 262 9056 15 99 18 0 0
142 1165 97191 31 322 52 1 26
143 1405 157478 59 367 60 0 53
144 1409 125583 23 521 50 1 31
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) b c d e f
-4.255e+01 6.808e-04 3.756e+00 1.939e+00 1.549e+00 2.139e+01
g
3.848e+00
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-469.37 -101.03 -5.51 68.08 877.43
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -4.255e+01 3.179e+01 -1.338 0.183026
b 6.808e-04 4.241e-04 1.605 0.110755
c 3.756e+00 5.858e-01 6.412 2.15e-09 ***
d 1.939e+00 1.182e-01 16.407 < 2e-16 ***
e 1.549e+00 3.896e-01 3.977 0.000112 ***
f 2.139e+01 6.549e+00 3.266 0.001379 **
g 3.848e+00 7.968e-01 4.829 3.62e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 172.6 on 137 degrees of freedom
Multiple R-squared: 0.9673, Adjusted R-squared: 0.9659
F-statistic: 675.4 on 6 and 137 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.9728030 5.439399e-02 2.719700e-02
[2,] 0.9472134 1.055731e-01 5.278655e-02
[3,] 0.9074797 1.850406e-01 9.252031e-02
[4,] 0.9104541 1.790917e-01 8.954587e-02
[5,] 0.8781991 2.436018e-01 1.218009e-01
[6,] 0.9235561 1.528879e-01 7.644394e-02
[7,] 0.8941455 2.117089e-01 1.058545e-01
[8,] 0.8856855 2.286290e-01 1.143145e-01
[9,] 0.9518437 9.631258e-02 4.815629e-02
[10,] 0.9553966 8.920686e-02 4.460343e-02
[11,] 0.9459731 1.080537e-01 5.402687e-02
[12,] 0.9245530 1.508941e-01 7.544703e-02
[13,] 0.9013471 1.973057e-01 9.865286e-02
[14,] 0.9442380 1.115240e-01 5.576202e-02
[15,] 0.9570795 8.584109e-02 4.292054e-02
[16,] 0.9429098 1.141804e-01 5.709019e-02
[17,] 0.9384698 1.230603e-01 6.153016e-02
[18,] 0.9819146 3.617088e-02 1.808544e-02
[19,] 0.9760367 4.792662e-02 2.396331e-02
[20,] 0.9737543 5.249140e-02 2.624570e-02
[21,] 0.9912802 1.743967e-02 8.719834e-03
[22,] 0.9902050 1.959007e-02 9.795036e-03
[23,] 0.9937619 1.247617e-02 6.238084e-03
[24,] 0.9908630 1.827404e-02 9.137020e-03
[25,] 0.9936602 1.267955e-02 6.339773e-03
[26,] 0.9927994 1.440117e-02 7.200583e-03
[27,] 0.9922474 1.550528e-02 7.752641e-03
[28,] 0.9997051 5.897057e-04 2.948529e-04
[29,] 0.9995478 9.044025e-04 4.522012e-04
[30,] 0.9995764 8.472716e-04 4.236358e-04
[31,] 0.9996040 7.920876e-04 3.960438e-04
[32,] 0.9994642 1.071529e-03 5.357645e-04
[33,] 0.9991807 1.638647e-03 8.193236e-04
[34,] 0.9987467 2.506589e-03 1.253295e-03
[35,] 0.9983449 3.310103e-03 1.655052e-03
[36,] 0.9977140 4.572053e-03 2.286027e-03
[37,] 0.9971065 5.786953e-03 2.893476e-03
[38,] 0.9960865 7.826932e-03 3.913466e-03
[39,] 0.9949140 1.017193e-02 5.085964e-03
[40,] 0.9926578 1.468433e-02 7.342167e-03
[41,] 0.9918467 1.630658e-02 8.153289e-03
[42,] 0.9900093 1.998138e-02 9.990690e-03
[43,] 0.9922438 1.551236e-02 7.756178e-03
[44,] 0.9896606 2.067888e-02 1.033944e-02
[45,] 0.9856279 2.874422e-02 1.437211e-02
[46,] 0.9811399 3.772029e-02 1.886015e-02
[47,] 0.9751713 4.965750e-02 2.482875e-02
[48,] 0.9832628 3.347431e-02 1.673715e-02
[49,] 0.9790340 4.193200e-02 2.096600e-02
[50,] 0.9839012 3.219770e-02 1.609885e-02
[51,] 0.9800266 3.994685e-02 1.997342e-02
[52,] 0.9731634 5.367325e-02 2.683663e-02
[53,] 0.9659555 6.808907e-02 3.404454e-02
[54,] 0.9774972 4.500565e-02 2.250282e-02
[55,] 0.9747669 5.046623e-02 2.523311e-02
[56,] 0.9690770 6.184610e-02 3.092305e-02
[57,] 0.9650273 6.994533e-02 3.497266e-02
[58,] 0.9881302 2.373954e-02 1.186977e-02
[59,] 0.9908709 1.825813e-02 9.129066e-03
[60,] 0.9890500 2.190000e-02 1.095000e-02
[61,] 0.9858948 2.821034e-02 1.410517e-02
[62,] 0.9896630 2.067410e-02 1.033705e-02
[63,] 0.9885035 2.299295e-02 1.149647e-02
[64,] 0.9926732 1.465367e-02 7.326834e-03
[65,] 0.9906085 1.878301e-02 9.391505e-03
[66,] 0.9999540 9.194729e-05 4.597365e-05
[67,] 0.9999750 4.990541e-05 2.495271e-05
[68,] 0.9999801 3.979528e-05 1.989764e-05
[69,] 0.9999947 1.061083e-05 5.305413e-06
[70,] 0.9999907 1.866434e-05 9.332169e-06
[71,] 0.9999862 2.750462e-05 1.375231e-05
[72,] 0.9999769 4.629474e-05 2.314737e-05
[73,] 0.9999599 8.010373e-05 4.005187e-05
[74,] 0.9999461 1.078818e-04 5.394090e-05
[75,] 0.9999077 1.845250e-04 9.226250e-05
[76,] 0.9998467 3.066536e-04 1.533268e-04
[77,] 0.9999235 1.529596e-04 7.647982e-05
[78,] 0.9999457 1.086259e-04 5.431293e-05
[79,] 0.9999190 1.620494e-04 8.102470e-05
[80,] 0.9999551 8.977124e-05 4.488562e-05
[81,] 0.9999551 8.970868e-05 4.485434e-05
[82,] 0.9999467 1.065174e-04 5.325868e-05
[83,] 0.9999873 2.539567e-05 1.269783e-05
[84,] 0.9999835 3.309096e-05 1.654548e-05
[85,] 0.9999760 4.802441e-05 2.401220e-05
[86,] 0.9999568 8.644923e-05 4.322461e-05
[87,] 0.9999500 1.000168e-04 5.000842e-05
[88,] 0.9999139 1.722140e-04 8.610700e-05
[89,] 0.9998540 2.919595e-04 1.459797e-04
[90,] 0.9998118 3.764540e-04 1.882270e-04
[91,] 0.9997132 5.736518e-04 2.868259e-04
[92,] 0.9995036 9.927184e-04 4.963592e-04
[93,] 0.9993432 1.313601e-03 6.568007e-04
[94,] 0.9990432 1.913589e-03 9.567944e-04
[95,] 0.9985660 2.867946e-03 1.433973e-03
[96,] 0.9976832 4.633516e-03 2.316758e-03
[97,] 0.9964720 7.055969e-03 3.527985e-03
[98,] 0.9944332 1.113366e-02 5.566831e-03
[99,] 0.9952405 9.519055e-03 4.759528e-03
[100,] 0.9926052 1.478956e-02 7.394778e-03
[101,] 0.9897908 2.041837e-02 1.020919e-02
[102,] 0.9847243 3.055131e-02 1.527565e-02
[103,] 0.9773514 4.529726e-02 2.264863e-02
[104,] 0.9664988 6.700238e-02 3.350119e-02
[105,] 0.9657769 6.844618e-02 3.422309e-02
[106,] 0.9510202 9.795967e-02 4.897983e-02
[107,] 0.9307335 1.385329e-01 6.926647e-02
[108,] 0.9692177 6.156466e-02 3.078233e-02
[109,] 0.9844153 3.116946e-02 1.558473e-02
[110,] 0.9765294 4.694113e-02 2.347057e-02
[111,] 0.9701399 5.972024e-02 2.986012e-02
[112,] 0.9555348 8.893048e-02 4.446524e-02
[113,] 0.9363071 1.273859e-01 6.369294e-02
[114,] 0.9067624 1.864752e-01 9.323758e-02
[115,] 0.9462936 1.074128e-01 5.370638e-02
[116,] 0.9503708 9.925837e-02 4.962919e-02
[117,] 0.9306278 1.387445e-01 6.937224e-02
[118,] 0.8907434 2.185131e-01 1.092566e-01
[119,] 0.9248182 1.503636e-01 7.518181e-02
[120,] 0.8744801 2.510398e-01 1.255199e-01
[121,] 0.8017155 3.965689e-01 1.982845e-01
[122,] 0.7458228 5.083543e-01 2.541772e-01
[123,] 0.6296839 7.406322e-01 3.703161e-01
[124,] 0.5223050 9.553899e-01 4.776950e-01
[125,] 0.5214214 9.571572e-01 4.785786e-01
> postscript(file="/var/wessaorg/rcomp/tmp/1jo431324618970.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/2cko11324618970.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/35kwi1324618970.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/4w9nv1324618970.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/5cin11324618970.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 = 144
Frequency = 1
1 2 3 4 5 6
-96.567289 -7.862591 20.871126 265.129498 44.890043 877.428858
7 8 9 10 11 12
-23.284171 59.957992 172.547132 16.080504 -87.967655 38.139148
13 14 15 16 17 18
-209.464737 -269.165927 -20.834067 -146.858047 190.440083 63.015136
19 20 21 22 23 24
166.145586 67.556544 -19.695660 127.020275 -225.052440 181.012940
25 26 27 28 29 30
100.613054 -184.299650 -307.041399 -144.601254 -39.093704 -239.020246
31 32 33 34 35 36
128.559063 -271.224667 -23.089419 -293.083769 168.213195 39.789867
37 38 39 40 41 42
-469.374496 -80.250347 112.744632 -198.959293 -101.284633 -82.024710
43 44 45 46 47 48
-33.576180 -113.553119 -94.226158 -126.422594 14.562866 -107.652208
49 50 51 52 53 54
-17.152156 -128.879878 61.591603 211.752583 53.191988 -30.028522
55 56 57 58 59 60
-89.092457 -28.454068 235.172693 47.124840 -265.220692 82.000495
61 62 63 64 65 66
-7.974726 -89.807317 -209.033503 -127.735458 69.654738 89.042107
67 68 69 70 71 72
401.343477 242.293642 102.575789 27.393945 -251.260622 -144.278369
73 74 75 76 77 78
-259.337714 93.453226 574.885463 243.555208 140.456557 146.758211
79 80 81 82 83 84
29.340598 -104.823797 -66.159565 -53.758488 94.403954 -12.020397
85 86 87 88 89 90
-40.670650 197.617681 6.493639 -151.194039 -137.970102 -219.736986
91 92 93 94 95 96
-79.193232 144.613976 -124.589404 -119.655333 -105.344628 -124.702347
97 98 99 100 101 102
-96.972367 4.131816 -100.939228 -207.308119 -67.018434 30.520056
103 104 105 106 107 108
-112.615498 110.782429 22.383454 61.810882 21.418963 237.336685
109 110 111 112 113 114
42.546225 -14.963754 -51.619929 -33.099682 -18.669630 -148.691813
115 116 117 118 119 120
64.411253 42.546225 -170.022303 -367.107754 180.164942 -38.182014
121 122 123 124 125 126
28.922335 -26.114408 58.971458 144.429519 124.106616 34.296523
127 128 129 130 131 132
127.351165 -23.036325 -5.679118 65.601951 24.643208 -25.651970
133 134 135 136 137 138
38.548438 -87.167881 37.372006 23.380621 42.546225 -5.342615
139 140 141 142 143 144
473.791451 29.929382 22.196928 198.617564 110.252403 51.363041
> postscript(file="/var/wessaorg/rcomp/tmp/6x7ao1324618970.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 = 144
Frequency = 1
lag(myerror, k = 1) myerror
0 -96.567289 NA
1 -7.862591 -96.567289
2 20.871126 -7.862591
3 265.129498 20.871126
4 44.890043 265.129498
5 877.428858 44.890043
6 -23.284171 877.428858
7 59.957992 -23.284171
8 172.547132 59.957992
9 16.080504 172.547132
10 -87.967655 16.080504
11 38.139148 -87.967655
12 -209.464737 38.139148
13 -269.165927 -209.464737
14 -20.834067 -269.165927
15 -146.858047 -20.834067
16 190.440083 -146.858047
17 63.015136 190.440083
18 166.145586 63.015136
19 67.556544 166.145586
20 -19.695660 67.556544
21 127.020275 -19.695660
22 -225.052440 127.020275
23 181.012940 -225.052440
24 100.613054 181.012940
25 -184.299650 100.613054
26 -307.041399 -184.299650
27 -144.601254 -307.041399
28 -39.093704 -144.601254
29 -239.020246 -39.093704
30 128.559063 -239.020246
31 -271.224667 128.559063
32 -23.089419 -271.224667
33 -293.083769 -23.089419
34 168.213195 -293.083769
35 39.789867 168.213195
36 -469.374496 39.789867
37 -80.250347 -469.374496
38 112.744632 -80.250347
39 -198.959293 112.744632
40 -101.284633 -198.959293
41 -82.024710 -101.284633
42 -33.576180 -82.024710
43 -113.553119 -33.576180
44 -94.226158 -113.553119
45 -126.422594 -94.226158
46 14.562866 -126.422594
47 -107.652208 14.562866
48 -17.152156 -107.652208
49 -128.879878 -17.152156
50 61.591603 -128.879878
51 211.752583 61.591603
52 53.191988 211.752583
53 -30.028522 53.191988
54 -89.092457 -30.028522
55 -28.454068 -89.092457
56 235.172693 -28.454068
57 47.124840 235.172693
58 -265.220692 47.124840
59 82.000495 -265.220692
60 -7.974726 82.000495
61 -89.807317 -7.974726
62 -209.033503 -89.807317
63 -127.735458 -209.033503
64 69.654738 -127.735458
65 89.042107 69.654738
66 401.343477 89.042107
67 242.293642 401.343477
68 102.575789 242.293642
69 27.393945 102.575789
70 -251.260622 27.393945
71 -144.278369 -251.260622
72 -259.337714 -144.278369
73 93.453226 -259.337714
74 574.885463 93.453226
75 243.555208 574.885463
76 140.456557 243.555208
77 146.758211 140.456557
78 29.340598 146.758211
79 -104.823797 29.340598
80 -66.159565 -104.823797
81 -53.758488 -66.159565
82 94.403954 -53.758488
83 -12.020397 94.403954
84 -40.670650 -12.020397
85 197.617681 -40.670650
86 6.493639 197.617681
87 -151.194039 6.493639
88 -137.970102 -151.194039
89 -219.736986 -137.970102
90 -79.193232 -219.736986
91 144.613976 -79.193232
92 -124.589404 144.613976
93 -119.655333 -124.589404
94 -105.344628 -119.655333
95 -124.702347 -105.344628
96 -96.972367 -124.702347
97 4.131816 -96.972367
98 -100.939228 4.131816
99 -207.308119 -100.939228
100 -67.018434 -207.308119
101 30.520056 -67.018434
102 -112.615498 30.520056
103 110.782429 -112.615498
104 22.383454 110.782429
105 61.810882 22.383454
106 21.418963 61.810882
107 237.336685 21.418963
108 42.546225 237.336685
109 -14.963754 42.546225
110 -51.619929 -14.963754
111 -33.099682 -51.619929
112 -18.669630 -33.099682
113 -148.691813 -18.669630
114 64.411253 -148.691813
115 42.546225 64.411253
116 -170.022303 42.546225
117 -367.107754 -170.022303
118 180.164942 -367.107754
119 -38.182014 180.164942
120 28.922335 -38.182014
121 -26.114408 28.922335
122 58.971458 -26.114408
123 144.429519 58.971458
124 124.106616 144.429519
125 34.296523 124.106616
126 127.351165 34.296523
127 -23.036325 127.351165
128 -5.679118 -23.036325
129 65.601951 -5.679118
130 24.643208 65.601951
131 -25.651970 24.643208
132 38.548438 -25.651970
133 -87.167881 38.548438
134 37.372006 -87.167881
135 23.380621 37.372006
136 42.546225 23.380621
137 -5.342615 42.546225
138 473.791451 -5.342615
139 29.929382 473.791451
140 22.196928 29.929382
141 198.617564 22.196928
142 110.252403 198.617564
143 51.363041 110.252403
144 NA 51.363041
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -7.862591 -96.567289
[2,] 20.871126 -7.862591
[3,] 265.129498 20.871126
[4,] 44.890043 265.129498
[5,] 877.428858 44.890043
[6,] -23.284171 877.428858
[7,] 59.957992 -23.284171
[8,] 172.547132 59.957992
[9,] 16.080504 172.547132
[10,] -87.967655 16.080504
[11,] 38.139148 -87.967655
[12,] -209.464737 38.139148
[13,] -269.165927 -209.464737
[14,] -20.834067 -269.165927
[15,] -146.858047 -20.834067
[16,] 190.440083 -146.858047
[17,] 63.015136 190.440083
[18,] 166.145586 63.015136
[19,] 67.556544 166.145586
[20,] -19.695660 67.556544
[21,] 127.020275 -19.695660
[22,] -225.052440 127.020275
[23,] 181.012940 -225.052440
[24,] 100.613054 181.012940
[25,] -184.299650 100.613054
[26,] -307.041399 -184.299650
[27,] -144.601254 -307.041399
[28,] -39.093704 -144.601254
[29,] -239.020246 -39.093704
[30,] 128.559063 -239.020246
[31,] -271.224667 128.559063
[32,] -23.089419 -271.224667
[33,] -293.083769 -23.089419
[34,] 168.213195 -293.083769
[35,] 39.789867 168.213195
[36,] -469.374496 39.789867
[37,] -80.250347 -469.374496
[38,] 112.744632 -80.250347
[39,] -198.959293 112.744632
[40,] -101.284633 -198.959293
[41,] -82.024710 -101.284633
[42,] -33.576180 -82.024710
[43,] -113.553119 -33.576180
[44,] -94.226158 -113.553119
[45,] -126.422594 -94.226158
[46,] 14.562866 -126.422594
[47,] -107.652208 14.562866
[48,] -17.152156 -107.652208
[49,] -128.879878 -17.152156
[50,] 61.591603 -128.879878
[51,] 211.752583 61.591603
[52,] 53.191988 211.752583
[53,] -30.028522 53.191988
[54,] -89.092457 -30.028522
[55,] -28.454068 -89.092457
[56,] 235.172693 -28.454068
[57,] 47.124840 235.172693
[58,] -265.220692 47.124840
[59,] 82.000495 -265.220692
[60,] -7.974726 82.000495
[61,] -89.807317 -7.974726
[62,] -209.033503 -89.807317
[63,] -127.735458 -209.033503
[64,] 69.654738 -127.735458
[65,] 89.042107 69.654738
[66,] 401.343477 89.042107
[67,] 242.293642 401.343477
[68,] 102.575789 242.293642
[69,] 27.393945 102.575789
[70,] -251.260622 27.393945
[71,] -144.278369 -251.260622
[72,] -259.337714 -144.278369
[73,] 93.453226 -259.337714
[74,] 574.885463 93.453226
[75,] 243.555208 574.885463
[76,] 140.456557 243.555208
[77,] 146.758211 140.456557
[78,] 29.340598 146.758211
[79,] -104.823797 29.340598
[80,] -66.159565 -104.823797
[81,] -53.758488 -66.159565
[82,] 94.403954 -53.758488
[83,] -12.020397 94.403954
[84,] -40.670650 -12.020397
[85,] 197.617681 -40.670650
[86,] 6.493639 197.617681
[87,] -151.194039 6.493639
[88,] -137.970102 -151.194039
[89,] -219.736986 -137.970102
[90,] -79.193232 -219.736986
[91,] 144.613976 -79.193232
[92,] -124.589404 144.613976
[93,] -119.655333 -124.589404
[94,] -105.344628 -119.655333
[95,] -124.702347 -105.344628
[96,] -96.972367 -124.702347
[97,] 4.131816 -96.972367
[98,] -100.939228 4.131816
[99,] -207.308119 -100.939228
[100,] -67.018434 -207.308119
[101,] 30.520056 -67.018434
[102,] -112.615498 30.520056
[103,] 110.782429 -112.615498
[104,] 22.383454 110.782429
[105,] 61.810882 22.383454
[106,] 21.418963 61.810882
[107,] 237.336685 21.418963
[108,] 42.546225 237.336685
[109,] -14.963754 42.546225
[110,] -51.619929 -14.963754
[111,] -33.099682 -51.619929
[112,] -18.669630 -33.099682
[113,] -148.691813 -18.669630
[114,] 64.411253 -148.691813
[115,] 42.546225 64.411253
[116,] -170.022303 42.546225
[117,] -367.107754 -170.022303
[118,] 180.164942 -367.107754
[119,] -38.182014 180.164942
[120,] 28.922335 -38.182014
[121,] -26.114408 28.922335
[122,] 58.971458 -26.114408
[123,] 144.429519 58.971458
[124,] 124.106616 144.429519
[125,] 34.296523 124.106616
[126,] 127.351165 34.296523
[127,] -23.036325 127.351165
[128,] -5.679118 -23.036325
[129,] 65.601951 -5.679118
[130,] 24.643208 65.601951
[131,] -25.651970 24.643208
[132,] 38.548438 -25.651970
[133,] -87.167881 38.548438
[134,] 37.372006 -87.167881
[135,] 23.380621 37.372006
[136,] 42.546225 23.380621
[137,] -5.342615 42.546225
[138,] 473.791451 -5.342615
[139,] 29.929382 473.791451
[140,] 22.196928 29.929382
[141,] 198.617564 22.196928
[142,] 110.252403 198.617564
[143,] 51.363041 110.252403
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -7.862591 -96.567289
2 20.871126 -7.862591
3 265.129498 20.871126
4 44.890043 265.129498
5 877.428858 44.890043
6 -23.284171 877.428858
7 59.957992 -23.284171
8 172.547132 59.957992
9 16.080504 172.547132
10 -87.967655 16.080504
11 38.139148 -87.967655
12 -209.464737 38.139148
13 -269.165927 -209.464737
14 -20.834067 -269.165927
15 -146.858047 -20.834067
16 190.440083 -146.858047
17 63.015136 190.440083
18 166.145586 63.015136
19 67.556544 166.145586
20 -19.695660 67.556544
21 127.020275 -19.695660
22 -225.052440 127.020275
23 181.012940 -225.052440
24 100.613054 181.012940
25 -184.299650 100.613054
26 -307.041399 -184.299650
27 -144.601254 -307.041399
28 -39.093704 -144.601254
29 -239.020246 -39.093704
30 128.559063 -239.020246
31 -271.224667 128.559063
32 -23.089419 -271.224667
33 -293.083769 -23.089419
34 168.213195 -293.083769
35 39.789867 168.213195
36 -469.374496 39.789867
37 -80.250347 -469.374496
38 112.744632 -80.250347
39 -198.959293 112.744632
40 -101.284633 -198.959293
41 -82.024710 -101.284633
42 -33.576180 -82.024710
43 -113.553119 -33.576180
44 -94.226158 -113.553119
45 -126.422594 -94.226158
46 14.562866 -126.422594
47 -107.652208 14.562866
48 -17.152156 -107.652208
49 -128.879878 -17.152156
50 61.591603 -128.879878
51 211.752583 61.591603
52 53.191988 211.752583
53 -30.028522 53.191988
54 -89.092457 -30.028522
55 -28.454068 -89.092457
56 235.172693 -28.454068
57 47.124840 235.172693
58 -265.220692 47.124840
59 82.000495 -265.220692
60 -7.974726 82.000495
61 -89.807317 -7.974726
62 -209.033503 -89.807317
63 -127.735458 -209.033503
64 69.654738 -127.735458
65 89.042107 69.654738
66 401.343477 89.042107
67 242.293642 401.343477
68 102.575789 242.293642
69 27.393945 102.575789
70 -251.260622 27.393945
71 -144.278369 -251.260622
72 -259.337714 -144.278369
73 93.453226 -259.337714
74 574.885463 93.453226
75 243.555208 574.885463
76 140.456557 243.555208
77 146.758211 140.456557
78 29.340598 146.758211
79 -104.823797 29.340598
80 -66.159565 -104.823797
81 -53.758488 -66.159565
82 94.403954 -53.758488
83 -12.020397 94.403954
84 -40.670650 -12.020397
85 197.617681 -40.670650
86 6.493639 197.617681
87 -151.194039 6.493639
88 -137.970102 -151.194039
89 -219.736986 -137.970102
90 -79.193232 -219.736986
91 144.613976 -79.193232
92 -124.589404 144.613976
93 -119.655333 -124.589404
94 -105.344628 -119.655333
95 -124.702347 -105.344628
96 -96.972367 -124.702347
97 4.131816 -96.972367
98 -100.939228 4.131816
99 -207.308119 -100.939228
100 -67.018434 -207.308119
101 30.520056 -67.018434
102 -112.615498 30.520056
103 110.782429 -112.615498
104 22.383454 110.782429
105 61.810882 22.383454
106 21.418963 61.810882
107 237.336685 21.418963
108 42.546225 237.336685
109 -14.963754 42.546225
110 -51.619929 -14.963754
111 -33.099682 -51.619929
112 -18.669630 -33.099682
113 -148.691813 -18.669630
114 64.411253 -148.691813
115 42.546225 64.411253
116 -170.022303 42.546225
117 -367.107754 -170.022303
118 180.164942 -367.107754
119 -38.182014 180.164942
120 28.922335 -38.182014
121 -26.114408 28.922335
122 58.971458 -26.114408
123 144.429519 58.971458
124 124.106616 144.429519
125 34.296523 124.106616
126 127.351165 34.296523
127 -23.036325 127.351165
128 -5.679118 -23.036325
129 65.601951 -5.679118
130 24.643208 65.601951
131 -25.651970 24.643208
132 38.548438 -25.651970
133 -87.167881 38.548438
134 37.372006 -87.167881
135 23.380621 37.372006
136 42.546225 23.380621
137 -5.342615 42.546225
138 473.791451 -5.342615
139 29.929382 473.791451
140 22.196928 29.929382
141 198.617564 22.196928
142 110.252403 198.617564
143 51.363041 110.252403
> 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/7pzvw1324618970.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/8025k1324618970.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/9r9o31324618970.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/10td5z1324618970.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/11x2it1324618970.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/12b5pn1324618970.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/13ocom1324618970.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/14jzb81324618970.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/15z6501324618970.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/169al01324618970.tab")
+ }
>
> try(system("convert tmp/1jo431324618970.ps tmp/1jo431324618970.png",intern=TRUE))
character(0)
> try(system("convert tmp/2cko11324618970.ps tmp/2cko11324618970.png",intern=TRUE))
character(0)
> try(system("convert tmp/35kwi1324618970.ps tmp/35kwi1324618970.png",intern=TRUE))
character(0)
> try(system("convert tmp/4w9nv1324618970.ps tmp/4w9nv1324618970.png",intern=TRUE))
character(0)
> try(system("convert tmp/5cin11324618970.ps tmp/5cin11324618970.png",intern=TRUE))
character(0)
> try(system("convert tmp/6x7ao1324618970.ps tmp/6x7ao1324618970.png",intern=TRUE))
character(0)
> try(system("convert tmp/7pzvw1324618970.ps tmp/7pzvw1324618970.png",intern=TRUE))
character(0)
> try(system("convert tmp/8025k1324618970.ps tmp/8025k1324618970.png",intern=TRUE))
character(0)
> try(system("convert tmp/9r9o31324618970.ps tmp/9r9o31324618970.png",intern=TRUE))
character(0)
> try(system("convert tmp/10td5z1324618970.ps tmp/10td5z1324618970.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.760 0.641 5.432