R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(18
+ ,1760
+ ,89
+ ,20465
+ ,70
+ ,20
+ ,1609
+ ,56
+ ,33629
+ ,80
+ ,0
+ ,192
+ ,18
+ ,1423
+ ,0
+ ,26
+ ,2182
+ ,92
+ ,25629
+ ,81
+ ,31
+ ,3367
+ ,131
+ ,54002
+ ,124
+ ,36
+ ,6727
+ ,257
+ ,151036
+ ,140
+ ,23
+ ,1619
+ ,55
+ ,33287
+ ,88
+ ,30
+ ,1507
+ ,56
+ ,31172
+ ,115
+ ,30
+ ,1682
+ ,42
+ ,28113
+ ,109
+ ,26
+ ,2812
+ ,92
+ ,57803
+ ,104
+ ,24
+ ,1943
+ ,74
+ ,49830
+ ,63
+ ,30
+ ,2017
+ ,66
+ ,52143
+ ,118
+ ,21
+ ,1702
+ ,96
+ ,21055
+ ,68
+ ,25
+ ,3034
+ ,110
+ ,47007
+ ,100
+ ,18
+ ,1379
+ ,55
+ ,28735
+ ,63
+ ,19
+ ,1517
+ ,79
+ ,59147
+ ,74
+ ,33
+ ,1637
+ ,53
+ ,78950
+ ,132
+ ,15
+ ,1169
+ ,54
+ ,13497
+ ,54
+ ,34
+ ,2384
+ ,84
+ ,46154
+ ,134
+ ,18
+ ,726
+ ,24
+ ,53249
+ ,57
+ ,15
+ ,993
+ ,55
+ ,10726
+ ,59
+ ,30
+ ,2683
+ ,96
+ ,83700
+ ,113
+ ,25
+ ,1713
+ ,70
+ ,40400
+ ,96
+ ,34
+ ,2027
+ ,50
+ ,33797
+ ,96
+ ,21
+ ,1818
+ ,81
+ ,36205
+ ,78
+ ,21
+ ,1393
+ ,28
+ ,30165
+ ,80
+ ,25
+ ,2000
+ ,154
+ ,58534
+ ,93
+ ,31
+ ,1346
+ ,85
+ ,44663
+ ,109
+ ,31
+ ,2676
+ ,115
+ ,92556
+ ,115
+ ,20
+ ,2106
+ ,43
+ ,40078
+ ,79
+ ,28
+ ,1591
+ ,43
+ ,34711
+ ,103
+ ,20
+ ,1519
+ ,43
+ ,31076
+ ,65
+ ,17
+ ,2171
+ ,101
+ ,74608
+ ,66
+ ,25
+ ,3003
+ ,121
+ ,58092
+ ,100
+ ,24
+ ,2364
+ ,52
+ ,42009
+ ,96
+ ,0
+ ,1
+ ,1
+ ,0
+ ,0
+ ,27
+ ,2017
+ ,60
+ ,36022
+ ,105
+ ,14
+ ,1564
+ ,50
+ ,23333
+ ,51
+ ,32
+ ,2072
+ ,47
+ ,53349
+ ,108
+ ,31
+ ,2106
+ ,63
+ ,92596
+ ,124
+ ,21
+ ,2270
+ ,69
+ ,49598
+ ,81
+ ,34
+ ,1643
+ ,56
+ ,44093
+ ,136
+ ,23
+ ,957
+ ,29
+ ,84205
+ ,84
+ ,24
+ ,2025
+ ,77
+ ,63369
+ ,92
+ ,26
+ ,1236
+ ,46
+ ,60132
+ ,103
+ ,22
+ ,1178
+ ,91
+ ,37403
+ ,82
+ ,35
+ ,744
+ ,31
+ ,24460
+ ,106
+ ,21
+ ,1976
+ ,92
+ ,46456
+ ,84
+ ,31
+ ,2224
+ ,85
+ ,66616
+ ,124
+ ,26
+ ,2561
+ ,56
+ ,41554
+ ,97
+ ,22
+ ,658
+ ,28
+ ,22346
+ ,82
+ ,21
+ ,1779
+ ,65
+ ,30874
+ ,79
+ ,27
+ ,2355
+ ,71
+ ,68701
+ ,97
+ ,30
+ ,2017
+ ,77
+ ,35728
+ ,107
+ ,33
+ ,1758
+ ,59
+ ,29010
+ ,126
+ ,11
+ ,1675
+ ,54
+ ,23110
+ ,40
+ ,26
+ ,1760
+ ,62
+ ,38844
+ ,96
+ ,26
+ ,875
+ ,23
+ ,27084
+ ,100
+ ,23
+ ,1169
+ ,65
+ ,35139
+ ,91
+ ,38
+ ,2789
+ ,93
+ ,57476
+ ,136
+ ,29
+ ,1606
+ ,56
+ ,33277
+ ,116
+ ,19
+ ,2020
+ ,76
+ ,31141
+ ,76
+ ,19
+ ,1300
+ ,58
+ ,61281
+ ,65
+ ,26
+ ,1235
+ ,35
+ ,25820
+ ,96
+ ,26
+ ,1215
+ ,32
+ ,23284
+ ,97
+ ,29
+ ,1230
+ ,38
+ ,35378
+ ,107
+ ,36
+ ,2226
+ ,67
+ ,74990
+ ,144
+ ,25
+ ,2897
+ ,65
+ ,29653
+ ,90
+ ,24
+ ,1071
+ ,38
+ ,64622
+ ,93
+ ,21
+ ,340
+ ,15
+ ,4157
+ ,78
+ ,19
+ ,2704
+ ,110
+ ,29245
+ ,72
+ ,12
+ ,1247
+ ,64
+ ,50008
+ ,45
+ ,30
+ ,1422
+ ,64
+ ,52338
+ ,120
+ ,21
+ ,1535
+ ,68
+ ,13310
+ ,59
+ ,34
+ ,2593
+ ,66
+ ,92901
+ ,133
+ ,32
+ ,1397
+ ,42
+ ,10956
+ ,117
+ ,28
+ ,2162
+ ,58
+ ,34241
+ ,123
+ ,28
+ ,2513
+ ,94
+ ,75043
+ ,110
+ ,21
+ ,917
+ ,26
+ ,21152
+ ,75
+ ,31
+ ,1234
+ ,71
+ ,42249
+ ,114
+ ,26
+ ,917
+ ,66
+ ,42005
+ ,94
+ ,29
+ ,1924
+ ,59
+ ,41152
+ ,116
+ ,23
+ ,853
+ ,27
+ ,14399
+ ,86
+ ,25
+ ,1398
+ ,34
+ ,28263
+ ,90
+ ,22
+ ,986
+ ,44
+ ,17215
+ ,87
+ ,26
+ ,1608
+ ,47
+ ,48140
+ ,99
+ ,33
+ ,2577
+ ,220
+ ,62897
+ ,132
+ ,24
+ ,1201
+ ,108
+ ,22883
+ ,96
+ ,24
+ ,1189
+ ,56
+ ,41622
+ ,91
+ ,21
+ ,1431
+ ,50
+ ,40715
+ ,77
+ ,28
+ ,1698
+ ,40
+ ,65897
+ ,104
+ ,27
+ ,2185
+ ,74
+ ,76542
+ ,97
+ ,25
+ ,1228
+ ,56
+ ,37477
+ ,94
+ ,15
+ ,1266
+ ,58
+ ,53216
+ ,60
+ ,13
+ ,830
+ ,36
+ ,40911
+ ,46
+ ,36
+ ,2238
+ ,111
+ ,57021
+ ,135
+ ,24
+ ,1787
+ ,68
+ ,73116
+ ,90
+ ,1
+ ,223
+ ,12
+ ,3895
+ ,2
+ ,24
+ ,2254
+ ,100
+ ,46609
+ ,96
+ ,31
+ ,1952
+ ,75
+ ,29351
+ ,109
+ ,4
+ ,665
+ ,28
+ ,2325
+ ,15
+ ,20
+ ,804
+ ,22
+ ,31747
+ ,64
+ ,23
+ ,1211
+ ,49
+ ,32665
+ ,88
+ ,23
+ ,1143
+ ,57
+ ,19249
+ ,84
+ ,12
+ ,710
+ ,38
+ ,15292
+ ,46
+ ,16
+ ,596
+ ,22
+ ,5842
+ ,59
+ ,29
+ ,1353
+ ,44
+ ,33994
+ ,116
+ ,10
+ ,971
+ ,32
+ ,13018
+ ,29
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,25
+ ,1030
+ ,31
+ ,98177
+ ,91
+ ,21
+ ,1130
+ ,66
+ ,37941
+ ,76
+ ,23
+ ,1284
+ ,44
+ ,31032
+ ,83
+ ,21
+ ,1438
+ ,61
+ ,32683
+ ,84
+ ,21
+ ,849
+ ,57
+ ,34545
+ ,65
+ ,0
+ ,78
+ ,5
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,23
+ ,925
+ ,39
+ ,27525
+ ,84
+ ,29
+ ,1518
+ ,78
+ ,66856
+ ,99
+ ,28
+ ,1946
+ ,95
+ ,28549
+ ,112
+ ,23
+ ,914
+ ,37
+ ,38610
+ ,92
+ ,1
+ ,778
+ ,19
+ ,2781
+ ,3
+ ,29
+ ,1713
+ ,71
+ ,41211
+ ,109
+ ,17
+ ,895
+ ,40
+ ,22698
+ ,71
+ ,29
+ ,1756
+ ,52
+ ,41194
+ ,106
+ ,12
+ ,701
+ ,40
+ ,32689
+ ,48
+ ,2
+ ,285
+ ,12
+ ,5752
+ ,8
+ ,21
+ ,1774
+ ,55
+ ,26757
+ ,80
+ ,25
+ ,1071
+ ,29
+ ,22527
+ ,95
+ ,29
+ ,1582
+ ,46
+ ,44810
+ ,116
+ ,2
+ ,256
+ ,9
+ ,0
+ ,8
+ ,0
+ ,98
+ ,9
+ ,0
+ ,0
+ ,18
+ ,1358
+ ,55
+ ,100674
+ ,56
+ ,1
+ ,41
+ ,3
+ ,0
+ ,4
+ ,21
+ ,1771
+ ,58
+ ,57786
+ ,70
+ ,0
+ ,42
+ ,3
+ ,0
+ ,0
+ ,4
+ ,528
+ ,16
+ ,5444
+ ,14
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,25
+ ,1026
+ ,45
+ ,28470
+ ,91
+ ,26
+ ,1296
+ ,38
+ ,61849
+ ,89
+ ,0
+ ,81
+ ,4
+ ,0
+ ,0
+ ,4
+ ,257
+ ,13
+ ,2179
+ ,12
+ ,17
+ ,914
+ ,23
+ ,8019
+ ,60
+ ,21
+ ,1178
+ ,50
+ ,39644
+ ,80
+ ,22
+ ,1080
+ ,19
+ ,23494
+ ,88)
+ ,dim=c(5
+ ,144)
+ ,dimnames=list(c('CPR'
+ ,'PGVWS'
+ ,'LGNS'
+ ,'CMPCH'
+ ,'TNSFM')
+ ,1:144))
> y <- array(NA,dim=c(5,144),dimnames=list(c('CPR','PGVWS','LGNS','CMPCH','TNSFM'),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
CPR PGVWS LGNS CMPCH TNSFM
1 18 1760 89 20465 70
2 20 1609 56 33629 80
3 0 192 18 1423 0
4 26 2182 92 25629 81
5 31 3367 131 54002 124
6 36 6727 257 151036 140
7 23 1619 55 33287 88
8 30 1507 56 31172 115
9 30 1682 42 28113 109
10 26 2812 92 57803 104
11 24 1943 74 49830 63
12 30 2017 66 52143 118
13 21 1702 96 21055 68
14 25 3034 110 47007 100
15 18 1379 55 28735 63
16 19 1517 79 59147 74
17 33 1637 53 78950 132
18 15 1169 54 13497 54
19 34 2384 84 46154 134
20 18 726 24 53249 57
21 15 993 55 10726 59
22 30 2683 96 83700 113
23 25 1713 70 40400 96
24 34 2027 50 33797 96
25 21 1818 81 36205 78
26 21 1393 28 30165 80
27 25 2000 154 58534 93
28 31 1346 85 44663 109
29 31 2676 115 92556 115
30 20 2106 43 40078 79
31 28 1591 43 34711 103
32 20 1519 43 31076 65
33 17 2171 101 74608 66
34 25 3003 121 58092 100
35 24 2364 52 42009 96
36 0 1 1 0 0
37 27 2017 60 36022 105
38 14 1564 50 23333 51
39 32 2072 47 53349 108
40 31 2106 63 92596 124
41 21 2270 69 49598 81
42 34 1643 56 44093 136
43 23 957 29 84205 84
44 24 2025 77 63369 92
45 26 1236 46 60132 103
46 22 1178 91 37403 82
47 35 744 31 24460 106
48 21 1976 92 46456 84
49 31 2224 85 66616 124
50 26 2561 56 41554 97
51 22 658 28 22346 82
52 21 1779 65 30874 79
53 27 2355 71 68701 97
54 30 2017 77 35728 107
55 33 1758 59 29010 126
56 11 1675 54 23110 40
57 26 1760 62 38844 96
58 26 875 23 27084 100
59 23 1169 65 35139 91
60 38 2789 93 57476 136
61 29 1606 56 33277 116
62 19 2020 76 31141 76
63 19 1300 58 61281 65
64 26 1235 35 25820 96
65 26 1215 32 23284 97
66 29 1230 38 35378 107
67 36 2226 67 74990 144
68 25 2897 65 29653 90
69 24 1071 38 64622 93
70 21 340 15 4157 78
71 19 2704 110 29245 72
72 12 1247 64 50008 45
73 30 1422 64 52338 120
74 21 1535 68 13310 59
75 34 2593 66 92901 133
76 32 1397 42 10956 117
77 28 2162 58 34241 123
78 28 2513 94 75043 110
79 21 917 26 21152 75
80 31 1234 71 42249 114
81 26 917 66 42005 94
82 29 1924 59 41152 116
83 23 853 27 14399 86
84 25 1398 34 28263 90
85 22 986 44 17215 87
86 26 1608 47 48140 99
87 33 2577 220 62897 132
88 24 1201 108 22883 96
89 24 1189 56 41622 91
90 21 1431 50 40715 77
91 28 1698 40 65897 104
92 27 2185 74 76542 97
93 25 1228 56 37477 94
94 15 1266 58 53216 60
95 13 830 36 40911 46
96 36 2238 111 57021 135
97 24 1787 68 73116 90
98 1 223 12 3895 2
99 24 2254 100 46609 96
100 31 1952 75 29351 109
101 4 665 28 2325 15
102 20 804 22 31747 64
103 23 1211 49 32665 88
104 23 1143 57 19249 84
105 12 710 38 15292 46
106 16 596 22 5842 59
107 29 1353 44 33994 116
108 10 971 32 13018 29
109 0 0 0 0 0
110 25 1030 31 98177 91
111 21 1130 66 37941 76
112 23 1284 44 31032 83
113 21 1438 61 32683 84
114 21 849 57 34545 65
115 0 78 5 0 0
116 0 0 0 0 0
117 23 925 39 27525 84
118 29 1518 78 66856 99
119 28 1946 95 28549 112
120 23 914 37 38610 92
121 1 778 19 2781 3
122 29 1713 71 41211 109
123 17 895 40 22698 71
124 29 1756 52 41194 106
125 12 701 40 32689 48
126 2 285 12 5752 8
127 21 1774 55 26757 80
128 25 1071 29 22527 95
129 29 1582 46 44810 116
130 2 256 9 0 8
131 0 98 9 0 0
132 18 1358 55 100674 56
133 1 41 3 0 4
134 21 1771 58 57786 70
135 0 42 3 0 0
136 4 528 16 5444 14
137 0 0 0 0 0
138 25 1026 45 28470 91
139 26 1296 38 61849 89
140 0 81 4 0 0
141 4 257 13 2179 12
142 17 914 23 8019 60
143 21 1178 50 39644 80
144 22 1080 19 23494 88
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) PGVWS LGNS CMPCH TNSFM
1.037e+00 4.956e-05 -4.678e-03 5.420e-06 2.552e-01
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-4.4505 -1.1685 -0.3968 0.6174 8.4120
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.037e+00 3.718e-01 2.791 0.006 **
PGVWS 4.956e-05 3.761e-04 0.132 0.895
LGNS -4.678e-03 7.584e-03 -0.617 0.538
CMPCH 5.420e-06 8.761e-06 0.619 0.537
TNSFM 2.552e-01 5.949e-03 42.904 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.79 on 139 degrees of freedom
Multiple R-squared: 0.9646, Adjusted R-squared: 0.9636
F-statistic: 947.7 on 4 and 139 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.8834590 2.330821e-01 1.165410e-01
[2,] 0.7933754 4.132493e-01 2.066246e-01
[3,] 0.7564508 4.870984e-01 2.435492e-01
[4,] 0.9993204 1.359230e-03 6.796150e-04
[5,] 0.9987495 2.501087e-03 1.250543e-03
[6,] 0.9984969 3.006229e-03 1.503115e-03
[7,] 0.9975811 4.837819e-03 2.418909e-03
[8,] 0.9955480 8.903946e-03 4.451973e-03
[9,] 0.9948060 1.038793e-02 5.193967e-03
[10,] 0.9919711 1.605783e-02 8.028915e-03
[11,] 0.9873917 2.521656e-02 1.260828e-02
[12,] 0.9807997 3.840060e-02 1.920030e-02
[13,] 0.9801600 3.967996e-02 1.983998e-02
[14,] 0.9767796 4.644078e-02 2.322039e-02
[15,] 0.9657001 6.859979e-02 3.429989e-02
[16,] 0.9510928 9.781436e-02 4.890718e-02
[17,] 0.9999256 1.487169e-04 7.435847e-05
[18,] 0.9998633 2.733258e-04 1.366629e-04
[19,] 0.9998827 2.345850e-04 1.172925e-04
[20,] 0.9999050 1.899623e-04 9.498115e-05
[21,] 0.9999386 1.228652e-04 6.143260e-05
[22,] 0.9998975 2.050395e-04 1.025198e-04
[23,] 0.9998885 2.229558e-04 1.114779e-04
[24,] 0.9998128 3.743817e-04 1.871909e-04
[25,] 0.9998112 3.775061e-04 1.887531e-04
[26,] 0.9997393 5.213417e-04 2.606709e-04
[27,] 0.9996840 6.320021e-04 3.160010e-04
[28,] 0.9996683 6.634101e-04 3.317051e-04
[29,] 0.9996581 6.838058e-04 3.419029e-04
[30,] 0.9995033 9.933278e-04 4.966639e-04
[31,] 0.9992242 1.551564e-03 7.757821e-04
[32,] 0.9996668 6.663609e-04 3.331805e-04
[33,] 0.9996675 6.649041e-04 3.324520e-04
[34,] 0.9995158 9.683830e-04 4.841915e-04
[35,] 0.9994849 1.030248e-03 5.151240e-04
[36,] 0.9992007 1.598586e-03 7.992928e-04
[37,] 0.9988176 2.364776e-03 1.182388e-03
[38,] 0.9986060 2.787973e-03 1.393986e-03
[39,] 0.9979000 4.199993e-03 2.099996e-03
[40,] 0.9999964 7.161567e-06 3.580784e-06
[41,] 0.9999958 8.351900e-06 4.175950e-06
[42,] 0.9999959 8.179142e-06 4.089571e-06
[43,] 0.9999927 1.458196e-05 7.290978e-06
[44,] 0.9999878 2.445467e-05 1.222734e-05
[45,] 0.9999794 4.120390e-05 2.060195e-05
[46,] 0.9999698 6.044459e-05 3.022229e-05
[47,] 0.9999676 6.474093e-05 3.237046e-05
[48,] 0.9999474 1.051735e-04 5.258673e-05
[49,] 0.9999164 1.671626e-04 8.358132e-05
[50,] 0.9998677 2.645331e-04 1.322666e-04
[51,] 0.9998046 3.907143e-04 1.953572e-04
[52,] 0.9997540 4.920032e-04 2.460016e-04
[53,] 0.9998169 3.662669e-04 1.831334e-04
[54,] 0.9998038 3.923162e-04 1.961581e-04
[55,] 0.9997701 4.597401e-04 2.298701e-04
[56,] 0.9997006 5.987740e-04 2.993870e-04
[57,] 0.9995535 8.929372e-04 4.464686e-04
[58,] 0.9993292 1.341660e-03 6.708299e-04
[59,] 0.9990487 1.902611e-03 9.513056e-04
[60,] 0.9991349 1.730120e-03 8.650599e-04
[61,] 0.9988762 2.247639e-03 1.123820e-03
[62,] 0.9985674 2.865127e-03 1.432564e-03
[63,] 0.9979530 4.094053e-03 2.047027e-03
[64,] 0.9970574 5.885284e-03 2.942642e-03
[65,] 0.9960098 7.980348e-03 3.990174e-03
[66,] 0.9959789 8.042153e-03 4.021076e-03
[67,] 0.9999336 1.328295e-04 6.641476e-05
[68,] 0.9999310 1.380901e-04 6.904505e-05
[69,] 0.9999372 1.256843e-04 6.284213e-05
[70,] 0.9999975 4.995669e-06 2.497835e-06
[71,] 0.9999976 4.706768e-06 2.353384e-06
[72,] 0.9999966 6.852483e-06 3.426241e-06
[73,] 0.9999951 9.765127e-06 4.882564e-06
[74,] 0.9999936 1.289343e-05 6.446714e-06
[75,] 0.9999948 1.041195e-05 5.205975e-06
[76,] 0.9999913 1.745901e-05 8.729505e-06
[77,] 0.9999876 2.489073e-05 1.244536e-05
[78,] 0.9999817 3.665063e-05 1.832531e-05
[79,] 0.9999712 5.750234e-05 2.875117e-05
[80,] 0.9999626 7.473238e-05 3.736619e-05
[81,] 0.9999508 9.844719e-05 4.922360e-05
[82,] 0.9999179 1.641317e-04 8.206585e-05
[83,] 0.9998606 2.788979e-04 1.394489e-04
[84,] 0.9997726 4.547420e-04 2.273710e-04
[85,] 0.9996483 7.033532e-04 3.516766e-04
[86,] 0.9994258 1.148384e-03 5.741919e-04
[87,] 0.9995913 8.174592e-04 4.087296e-04
[88,] 0.9993366 1.326880e-03 6.634400e-04
[89,] 0.9989745 2.050938e-03 1.025469e-03
[90,] 0.9988080 2.384004e-03 1.192002e-03
[91,] 0.9982462 3.507507e-03 1.753754e-03
[92,] 0.9992064 1.587120e-03 7.935600e-04
[93,] 0.9994792 1.041506e-03 5.207530e-04
[94,] 0.9992275 1.544941e-03 7.724703e-04
[95,] 0.9998183 3.634534e-04 1.817267e-04
[96,] 0.9996933 6.134894e-04 3.067447e-04
[97,] 0.9995680 8.640876e-04 4.320438e-04
[98,] 0.9993167 1.366579e-03 6.832894e-04
[99,] 0.9991457 1.708651e-03 8.543255e-04
[100,] 0.9988916 2.216820e-03 1.108410e-03
[101,] 0.9991212 1.757576e-03 8.787882e-04
[102,] 0.9986155 2.769013e-03 1.384507e-03
[103,] 0.9987034 2.593161e-03 1.296581e-03
[104,] 0.9978049 4.390205e-03 2.195102e-03
[105,] 0.9970885 5.823059e-03 2.911530e-03
[106,] 0.9971840 5.632081e-03 2.816040e-03
[107,] 0.9998322 3.356408e-04 1.678204e-04
[108,] 0.9996879 6.241194e-04 3.120597e-04
[109,] 0.9994233 1.153400e-03 5.766999e-04
[110,] 0.9993382 1.323594e-03 6.617969e-04
[111,] 0.9997979 4.041455e-04 2.020728e-04
[112,] 0.9996274 7.451524e-04 3.725762e-04
[113,] 0.9995191 9.617644e-04 4.808822e-04
[114,] 0.9991604 1.679247e-03 8.396234e-04
[115,] 0.9983889 3.222240e-03 1.611120e-03
[116,] 0.9985932 2.813601e-03 1.406800e-03
[117,] 0.9975226 4.954777e-03 2.477388e-03
[118,] 0.9978538 4.292434e-03 2.146217e-03
[119,] 0.9960112 7.977570e-03 3.988785e-03
[120,] 0.9934958 1.300839e-02 6.504195e-03
[121,] 0.9880917 2.381667e-02 1.190834e-02
[122,] 0.9969653 6.069358e-03 3.034679e-03
[123,] 0.9931207 1.375856e-02 6.879280e-03
[124,] 0.9847022 3.059565e-02 1.529783e-02
[125,] 0.9695942 6.081158e-02 3.040579e-02
[126,] 0.9366268 1.267464e-01 6.337321e-02
[127,] 0.8765883 2.468233e-01 1.234117e-01
[128,] 0.7750354 4.499291e-01 2.249646e-01
[129,] 0.6311859 7.376281e-01 3.688141e-01
> postscript(file="/var/www/rcomp/tmp/1pwvu1324373371.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/22v4m1324373371.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/3q8gb1324373371.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/48un41324373371.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/5f1qg1324373371.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
-0.68438965 -1.45479293 -0.97042350 4.47335462 -1.53103820 -0.71751348
7 8 9 10 11 12
-0.49984837 -0.36901325 1.10470134 -1.60223322 6.86373955 -1.22681834
13 14 15 16 17 18
2.85846727 -1.44965422 0.91714052 -0.94963713 -1.98711985 0.30240853
19 20 21 22 23 24
-1.21181700 2.20293205 -0.94525671 -0.01443316 -0.51462315 8.41203983
25 26 27 28 29 30
0.14827052 -0.55629688 0.53147320 2.23281300 0.51636508 -1.31997517
31 32 33 34 35 36
0.60943217 2.33094423 -0.92119514 -1.45673699 -1.63981399 -1.03277025
37 38 39 40 41 42
-0.84969566 -0.02353881 3.22720679 -1.99580752 -0.76850526 -1.80533705
43 44 45 46 47 48
0.15624406 -0.60095848 -1.49671209 0.19941150 6.88518414 -1.39496150
49 50 51 52 53 54
-1.75793701 0.11638274 0.01207596 -0.15096890 1.04963483 1.72098974
55 56 57 58 59 60
-0.16308879 -0.20173387 0.45405640 -0.64165253 -1.20645227 2.23841566
61 62 63 64 65 66
-1.64054552 -1.34725243 1.24826728 0.42435815 0.16984288 0.57945254
67 68 69 70 71 72
-1.99196274 0.99284892 -0.99812302 0.08646999 -0.19095973 -0.55560341
73 74 75 76 77 78
-1.71817390 5.07468855 -1.30451689 1.17007749 -4.45049060 -1.20279417
79 80 81 82 83 84
0.78287220 0.90987092 1.00785377 -1.68495318 0.01993537 0.92966230
85 86 87 88 89 90
-1.17760965 -0.42461172 -1.16548416 -1.21654569 -0.28468129 0.25320855
91 92 93 94 95 96
0.16585961 1.02959910 -0.02980049 -1.43025319 0.12816733 0.60761262
97 98 99 100 101 102
-0.17365577 -0.52385925 -1.43474882 2.23898296 -0.78023008 2.51972561
103 104 105 106 107 108
-0.50432281 0.63004966 -0.71768205 -0.05348342 -1.68802741 1.59232552
109 110 111 112 113 114
-1.03739867 0.29973958 0.61322655 0.75360393 -1.43866803 3.41084369
115 116 117 118 119 120
-1.01787478 -1.03739867 0.51179767 2.62343205 -1.42846400 -1.59882562
121 122 123 124 125 126
-0.76780121 0.16783956 -2.13805666 0.84256933 -1.31260004 -1.06829812
127 128 129 130 131 132
-0.43040507 -0.32251722 -1.74864107 -1.04972070 -1.00015411 2.31481323
133 134 135 136 137 138
-1.04626453 1.96777943 -1.02544643 -0.59126266 -1.03739867 0.74321955
139 140 141 142 143 144
2.02662134 -1.02270147 -0.06373546 0.66841737 -0.49409781 -1.58846563
> postscript(file="/var/www/rcomp/tmp/66edr1324373371.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 -0.68438965 NA
1 -1.45479293 -0.68438965
2 -0.97042350 -1.45479293
3 4.47335462 -0.97042350
4 -1.53103820 4.47335462
5 -0.71751348 -1.53103820
6 -0.49984837 -0.71751348
7 -0.36901325 -0.49984837
8 1.10470134 -0.36901325
9 -1.60223322 1.10470134
10 6.86373955 -1.60223322
11 -1.22681834 6.86373955
12 2.85846727 -1.22681834
13 -1.44965422 2.85846727
14 0.91714052 -1.44965422
15 -0.94963713 0.91714052
16 -1.98711985 -0.94963713
17 0.30240853 -1.98711985
18 -1.21181700 0.30240853
19 2.20293205 -1.21181700
20 -0.94525671 2.20293205
21 -0.01443316 -0.94525671
22 -0.51462315 -0.01443316
23 8.41203983 -0.51462315
24 0.14827052 8.41203983
25 -0.55629688 0.14827052
26 0.53147320 -0.55629688
27 2.23281300 0.53147320
28 0.51636508 2.23281300
29 -1.31997517 0.51636508
30 0.60943217 -1.31997517
31 2.33094423 0.60943217
32 -0.92119514 2.33094423
33 -1.45673699 -0.92119514
34 -1.63981399 -1.45673699
35 -1.03277025 -1.63981399
36 -0.84969566 -1.03277025
37 -0.02353881 -0.84969566
38 3.22720679 -0.02353881
39 -1.99580752 3.22720679
40 -0.76850526 -1.99580752
41 -1.80533705 -0.76850526
42 0.15624406 -1.80533705
43 -0.60095848 0.15624406
44 -1.49671209 -0.60095848
45 0.19941150 -1.49671209
46 6.88518414 0.19941150
47 -1.39496150 6.88518414
48 -1.75793701 -1.39496150
49 0.11638274 -1.75793701
50 0.01207596 0.11638274
51 -0.15096890 0.01207596
52 1.04963483 -0.15096890
53 1.72098974 1.04963483
54 -0.16308879 1.72098974
55 -0.20173387 -0.16308879
56 0.45405640 -0.20173387
57 -0.64165253 0.45405640
58 -1.20645227 -0.64165253
59 2.23841566 -1.20645227
60 -1.64054552 2.23841566
61 -1.34725243 -1.64054552
62 1.24826728 -1.34725243
63 0.42435815 1.24826728
64 0.16984288 0.42435815
65 0.57945254 0.16984288
66 -1.99196274 0.57945254
67 0.99284892 -1.99196274
68 -0.99812302 0.99284892
69 0.08646999 -0.99812302
70 -0.19095973 0.08646999
71 -0.55560341 -0.19095973
72 -1.71817390 -0.55560341
73 5.07468855 -1.71817390
74 -1.30451689 5.07468855
75 1.17007749 -1.30451689
76 -4.45049060 1.17007749
77 -1.20279417 -4.45049060
78 0.78287220 -1.20279417
79 0.90987092 0.78287220
80 1.00785377 0.90987092
81 -1.68495318 1.00785377
82 0.01993537 -1.68495318
83 0.92966230 0.01993537
84 -1.17760965 0.92966230
85 -0.42461172 -1.17760965
86 -1.16548416 -0.42461172
87 -1.21654569 -1.16548416
88 -0.28468129 -1.21654569
89 0.25320855 -0.28468129
90 0.16585961 0.25320855
91 1.02959910 0.16585961
92 -0.02980049 1.02959910
93 -1.43025319 -0.02980049
94 0.12816733 -1.43025319
95 0.60761262 0.12816733
96 -0.17365577 0.60761262
97 -0.52385925 -0.17365577
98 -1.43474882 -0.52385925
99 2.23898296 -1.43474882
100 -0.78023008 2.23898296
101 2.51972561 -0.78023008
102 -0.50432281 2.51972561
103 0.63004966 -0.50432281
104 -0.71768205 0.63004966
105 -0.05348342 -0.71768205
106 -1.68802741 -0.05348342
107 1.59232552 -1.68802741
108 -1.03739867 1.59232552
109 0.29973958 -1.03739867
110 0.61322655 0.29973958
111 0.75360393 0.61322655
112 -1.43866803 0.75360393
113 3.41084369 -1.43866803
114 -1.01787478 3.41084369
115 -1.03739867 -1.01787478
116 0.51179767 -1.03739867
117 2.62343205 0.51179767
118 -1.42846400 2.62343205
119 -1.59882562 -1.42846400
120 -0.76780121 -1.59882562
121 0.16783956 -0.76780121
122 -2.13805666 0.16783956
123 0.84256933 -2.13805666
124 -1.31260004 0.84256933
125 -1.06829812 -1.31260004
126 -0.43040507 -1.06829812
127 -0.32251722 -0.43040507
128 -1.74864107 -0.32251722
129 -1.04972070 -1.74864107
130 -1.00015411 -1.04972070
131 2.31481323 -1.00015411
132 -1.04626453 2.31481323
133 1.96777943 -1.04626453
134 -1.02544643 1.96777943
135 -0.59126266 -1.02544643
136 -1.03739867 -0.59126266
137 0.74321955 -1.03739867
138 2.02662134 0.74321955
139 -1.02270147 2.02662134
140 -0.06373546 -1.02270147
141 0.66841737 -0.06373546
142 -0.49409781 0.66841737
143 -1.58846563 -0.49409781
144 NA -1.58846563
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.45479293 -0.68438965
[2,] -0.97042350 -1.45479293
[3,] 4.47335462 -0.97042350
[4,] -1.53103820 4.47335462
[5,] -0.71751348 -1.53103820
[6,] -0.49984837 -0.71751348
[7,] -0.36901325 -0.49984837
[8,] 1.10470134 -0.36901325
[9,] -1.60223322 1.10470134
[10,] 6.86373955 -1.60223322
[11,] -1.22681834 6.86373955
[12,] 2.85846727 -1.22681834
[13,] -1.44965422 2.85846727
[14,] 0.91714052 -1.44965422
[15,] -0.94963713 0.91714052
[16,] -1.98711985 -0.94963713
[17,] 0.30240853 -1.98711985
[18,] -1.21181700 0.30240853
[19,] 2.20293205 -1.21181700
[20,] -0.94525671 2.20293205
[21,] -0.01443316 -0.94525671
[22,] -0.51462315 -0.01443316
[23,] 8.41203983 -0.51462315
[24,] 0.14827052 8.41203983
[25,] -0.55629688 0.14827052
[26,] 0.53147320 -0.55629688
[27,] 2.23281300 0.53147320
[28,] 0.51636508 2.23281300
[29,] -1.31997517 0.51636508
[30,] 0.60943217 -1.31997517
[31,] 2.33094423 0.60943217
[32,] -0.92119514 2.33094423
[33,] -1.45673699 -0.92119514
[34,] -1.63981399 -1.45673699
[35,] -1.03277025 -1.63981399
[36,] -0.84969566 -1.03277025
[37,] -0.02353881 -0.84969566
[38,] 3.22720679 -0.02353881
[39,] -1.99580752 3.22720679
[40,] -0.76850526 -1.99580752
[41,] -1.80533705 -0.76850526
[42,] 0.15624406 -1.80533705
[43,] -0.60095848 0.15624406
[44,] -1.49671209 -0.60095848
[45,] 0.19941150 -1.49671209
[46,] 6.88518414 0.19941150
[47,] -1.39496150 6.88518414
[48,] -1.75793701 -1.39496150
[49,] 0.11638274 -1.75793701
[50,] 0.01207596 0.11638274
[51,] -0.15096890 0.01207596
[52,] 1.04963483 -0.15096890
[53,] 1.72098974 1.04963483
[54,] -0.16308879 1.72098974
[55,] -0.20173387 -0.16308879
[56,] 0.45405640 -0.20173387
[57,] -0.64165253 0.45405640
[58,] -1.20645227 -0.64165253
[59,] 2.23841566 -1.20645227
[60,] -1.64054552 2.23841566
[61,] -1.34725243 -1.64054552
[62,] 1.24826728 -1.34725243
[63,] 0.42435815 1.24826728
[64,] 0.16984288 0.42435815
[65,] 0.57945254 0.16984288
[66,] -1.99196274 0.57945254
[67,] 0.99284892 -1.99196274
[68,] -0.99812302 0.99284892
[69,] 0.08646999 -0.99812302
[70,] -0.19095973 0.08646999
[71,] -0.55560341 -0.19095973
[72,] -1.71817390 -0.55560341
[73,] 5.07468855 -1.71817390
[74,] -1.30451689 5.07468855
[75,] 1.17007749 -1.30451689
[76,] -4.45049060 1.17007749
[77,] -1.20279417 -4.45049060
[78,] 0.78287220 -1.20279417
[79,] 0.90987092 0.78287220
[80,] 1.00785377 0.90987092
[81,] -1.68495318 1.00785377
[82,] 0.01993537 -1.68495318
[83,] 0.92966230 0.01993537
[84,] -1.17760965 0.92966230
[85,] -0.42461172 -1.17760965
[86,] -1.16548416 -0.42461172
[87,] -1.21654569 -1.16548416
[88,] -0.28468129 -1.21654569
[89,] 0.25320855 -0.28468129
[90,] 0.16585961 0.25320855
[91,] 1.02959910 0.16585961
[92,] -0.02980049 1.02959910
[93,] -1.43025319 -0.02980049
[94,] 0.12816733 -1.43025319
[95,] 0.60761262 0.12816733
[96,] -0.17365577 0.60761262
[97,] -0.52385925 -0.17365577
[98,] -1.43474882 -0.52385925
[99,] 2.23898296 -1.43474882
[100,] -0.78023008 2.23898296
[101,] 2.51972561 -0.78023008
[102,] -0.50432281 2.51972561
[103,] 0.63004966 -0.50432281
[104,] -0.71768205 0.63004966
[105,] -0.05348342 -0.71768205
[106,] -1.68802741 -0.05348342
[107,] 1.59232552 -1.68802741
[108,] -1.03739867 1.59232552
[109,] 0.29973958 -1.03739867
[110,] 0.61322655 0.29973958
[111,] 0.75360393 0.61322655
[112,] -1.43866803 0.75360393
[113,] 3.41084369 -1.43866803
[114,] -1.01787478 3.41084369
[115,] -1.03739867 -1.01787478
[116,] 0.51179767 -1.03739867
[117,] 2.62343205 0.51179767
[118,] -1.42846400 2.62343205
[119,] -1.59882562 -1.42846400
[120,] -0.76780121 -1.59882562
[121,] 0.16783956 -0.76780121
[122,] -2.13805666 0.16783956
[123,] 0.84256933 -2.13805666
[124,] -1.31260004 0.84256933
[125,] -1.06829812 -1.31260004
[126,] -0.43040507 -1.06829812
[127,] -0.32251722 -0.43040507
[128,] -1.74864107 -0.32251722
[129,] -1.04972070 -1.74864107
[130,] -1.00015411 -1.04972070
[131,] 2.31481323 -1.00015411
[132,] -1.04626453 2.31481323
[133,] 1.96777943 -1.04626453
[134,] -1.02544643 1.96777943
[135,] -0.59126266 -1.02544643
[136,] -1.03739867 -0.59126266
[137,] 0.74321955 -1.03739867
[138,] 2.02662134 0.74321955
[139,] -1.02270147 2.02662134
[140,] -0.06373546 -1.02270147
[141,] 0.66841737 -0.06373546
[142,] -0.49409781 0.66841737
[143,] -1.58846563 -0.49409781
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.45479293 -0.68438965
2 -0.97042350 -1.45479293
3 4.47335462 -0.97042350
4 -1.53103820 4.47335462
5 -0.71751348 -1.53103820
6 -0.49984837 -0.71751348
7 -0.36901325 -0.49984837
8 1.10470134 -0.36901325
9 -1.60223322 1.10470134
10 6.86373955 -1.60223322
11 -1.22681834 6.86373955
12 2.85846727 -1.22681834
13 -1.44965422 2.85846727
14 0.91714052 -1.44965422
15 -0.94963713 0.91714052
16 -1.98711985 -0.94963713
17 0.30240853 -1.98711985
18 -1.21181700 0.30240853
19 2.20293205 -1.21181700
20 -0.94525671 2.20293205
21 -0.01443316 -0.94525671
22 -0.51462315 -0.01443316
23 8.41203983 -0.51462315
24 0.14827052 8.41203983
25 -0.55629688 0.14827052
26 0.53147320 -0.55629688
27 2.23281300 0.53147320
28 0.51636508 2.23281300
29 -1.31997517 0.51636508
30 0.60943217 -1.31997517
31 2.33094423 0.60943217
32 -0.92119514 2.33094423
33 -1.45673699 -0.92119514
34 -1.63981399 -1.45673699
35 -1.03277025 -1.63981399
36 -0.84969566 -1.03277025
37 -0.02353881 -0.84969566
38 3.22720679 -0.02353881
39 -1.99580752 3.22720679
40 -0.76850526 -1.99580752
41 -1.80533705 -0.76850526
42 0.15624406 -1.80533705
43 -0.60095848 0.15624406
44 -1.49671209 -0.60095848
45 0.19941150 -1.49671209
46 6.88518414 0.19941150
47 -1.39496150 6.88518414
48 -1.75793701 -1.39496150
49 0.11638274 -1.75793701
50 0.01207596 0.11638274
51 -0.15096890 0.01207596
52 1.04963483 -0.15096890
53 1.72098974 1.04963483
54 -0.16308879 1.72098974
55 -0.20173387 -0.16308879
56 0.45405640 -0.20173387
57 -0.64165253 0.45405640
58 -1.20645227 -0.64165253
59 2.23841566 -1.20645227
60 -1.64054552 2.23841566
61 -1.34725243 -1.64054552
62 1.24826728 -1.34725243
63 0.42435815 1.24826728
64 0.16984288 0.42435815
65 0.57945254 0.16984288
66 -1.99196274 0.57945254
67 0.99284892 -1.99196274
68 -0.99812302 0.99284892
69 0.08646999 -0.99812302
70 -0.19095973 0.08646999
71 -0.55560341 -0.19095973
72 -1.71817390 -0.55560341
73 5.07468855 -1.71817390
74 -1.30451689 5.07468855
75 1.17007749 -1.30451689
76 -4.45049060 1.17007749
77 -1.20279417 -4.45049060
78 0.78287220 -1.20279417
79 0.90987092 0.78287220
80 1.00785377 0.90987092
81 -1.68495318 1.00785377
82 0.01993537 -1.68495318
83 0.92966230 0.01993537
84 -1.17760965 0.92966230
85 -0.42461172 -1.17760965
86 -1.16548416 -0.42461172
87 -1.21654569 -1.16548416
88 -0.28468129 -1.21654569
89 0.25320855 -0.28468129
90 0.16585961 0.25320855
91 1.02959910 0.16585961
92 -0.02980049 1.02959910
93 -1.43025319 -0.02980049
94 0.12816733 -1.43025319
95 0.60761262 0.12816733
96 -0.17365577 0.60761262
97 -0.52385925 -0.17365577
98 -1.43474882 -0.52385925
99 2.23898296 -1.43474882
100 -0.78023008 2.23898296
101 2.51972561 -0.78023008
102 -0.50432281 2.51972561
103 0.63004966 -0.50432281
104 -0.71768205 0.63004966
105 -0.05348342 -0.71768205
106 -1.68802741 -0.05348342
107 1.59232552 -1.68802741
108 -1.03739867 1.59232552
109 0.29973958 -1.03739867
110 0.61322655 0.29973958
111 0.75360393 0.61322655
112 -1.43866803 0.75360393
113 3.41084369 -1.43866803
114 -1.01787478 3.41084369
115 -1.03739867 -1.01787478
116 0.51179767 -1.03739867
117 2.62343205 0.51179767
118 -1.42846400 2.62343205
119 -1.59882562 -1.42846400
120 -0.76780121 -1.59882562
121 0.16783956 -0.76780121
122 -2.13805666 0.16783956
123 0.84256933 -2.13805666
124 -1.31260004 0.84256933
125 -1.06829812 -1.31260004
126 -0.43040507 -1.06829812
127 -0.32251722 -0.43040507
128 -1.74864107 -0.32251722
129 -1.04972070 -1.74864107
130 -1.00015411 -1.04972070
131 2.31481323 -1.00015411
132 -1.04626453 2.31481323
133 1.96777943 -1.04626453
134 -1.02544643 1.96777943
135 -0.59126266 -1.02544643
136 -1.03739867 -0.59126266
137 0.74321955 -1.03739867
138 2.02662134 0.74321955
139 -1.02270147 2.02662134
140 -0.06373546 -1.02270147
141 0.66841737 -0.06373546
142 -0.49409781 0.66841737
143 -1.58846563 -0.49409781
> 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/7b8tt1324373371.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/8g6z51324373371.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/rcomp/tmp/93v051324373371.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/rcomp/tmp/10q5sh1324373371.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/rcomp/tmp/11d9sm1324373371.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/123gri1324373371.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/13ihzo1324373371.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/14wcf71324373371.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/15l9111324373371.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/16f17i1324373371.tab")
+ }
>
> try(system("convert tmp/1pwvu1324373371.ps tmp/1pwvu1324373371.png",intern=TRUE))
character(0)
> try(system("convert tmp/22v4m1324373371.ps tmp/22v4m1324373371.png",intern=TRUE))
character(0)
> try(system("convert tmp/3q8gb1324373371.ps tmp/3q8gb1324373371.png",intern=TRUE))
character(0)
> try(system("convert tmp/48un41324373371.ps tmp/48un41324373371.png",intern=TRUE))
character(0)
> try(system("convert tmp/5f1qg1324373371.ps tmp/5f1qg1324373371.png",intern=TRUE))
character(0)
> try(system("convert tmp/66edr1324373371.ps tmp/66edr1324373371.png",intern=TRUE))
character(0)
> try(system("convert tmp/7b8tt1324373371.ps tmp/7b8tt1324373371.png",intern=TRUE))
character(0)
> try(system("convert tmp/8g6z51324373371.ps tmp/8g6z51324373371.png",intern=TRUE))
character(0)
> try(system("convert tmp/93v051324373371.ps tmp/93v051324373371.png",intern=TRUE))
character(0)
> try(system("convert tmp/10q5sh1324373371.ps tmp/10q5sh1324373371.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.780 0.430 6.215