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(158147
+ ,1760
+ ,89
+ ,48
+ ,18
+ ,20465
+ ,182462
+ ,1609
+ ,56
+ ,52
+ ,20
+ ,33629
+ ,7215
+ ,192
+ ,18
+ ,0
+ ,0
+ ,1423
+ ,122259
+ ,2182
+ ,92
+ ,49
+ ,26
+ ,25629
+ ,222405
+ ,3367
+ ,131
+ ,76
+ ,31
+ ,54002
+ ,485890
+ ,6658
+ ,253
+ ,124
+ ,36
+ ,151036
+ ,150777
+ ,1548
+ ,54
+ ,42
+ ,23
+ ,33287
+ ,160529
+ ,1507
+ ,56
+ ,68
+ ,30
+ ,31172
+ ,133238
+ ,1682
+ ,42
+ ,52
+ ,30
+ ,28113
+ ,275326
+ ,2811
+ ,91
+ ,67
+ ,26
+ ,57803
+ ,121821
+ ,1943
+ ,74
+ ,50
+ ,24
+ ,49830
+ ,172489
+ ,2017
+ ,66
+ ,71
+ ,30
+ ,52143
+ ,89942
+ ,1702
+ ,96
+ ,41
+ ,21
+ ,21055
+ ,208851
+ ,3034
+ ,110
+ ,79
+ ,25
+ ,47007
+ ,151886
+ ,1379
+ ,55
+ ,49
+ ,18
+ ,28735
+ ,145427
+ ,1517
+ ,79
+ ,54
+ ,19
+ ,59147
+ ,134153
+ ,1637
+ ,53
+ ,75
+ ,33
+ ,78950
+ ,64149
+ ,1077
+ ,53
+ ,0
+ ,15
+ ,13497
+ ,122417
+ ,2384
+ ,84
+ ,54
+ ,34
+ ,46154
+ ,27997
+ ,726
+ ,24
+ ,13
+ ,18
+ ,53249
+ ,65004
+ ,993
+ ,55
+ ,17
+ ,15
+ ,10726
+ ,205417
+ ,2446
+ ,91
+ ,83
+ ,27
+ ,83700
+ ,188103
+ ,1713
+ ,70
+ ,37
+ ,25
+ ,40400
+ ,118698
+ ,2027
+ ,50
+ ,44
+ ,34
+ ,33797
+ ,143682
+ ,1818
+ ,81
+ ,50
+ ,21
+ ,36205
+ ,140172
+ ,1393
+ ,28
+ ,39
+ ,21
+ ,30165
+ ,186377
+ ,2000
+ ,154
+ ,59
+ ,25
+ ,58534
+ ,174870
+ ,1346
+ ,85
+ ,79
+ ,31
+ ,44663
+ ,317699
+ ,2522
+ ,114
+ ,55
+ ,30
+ ,92556
+ ,192335
+ ,2106
+ ,43
+ ,52
+ ,20
+ ,40078
+ ,151621
+ ,1515
+ ,42
+ ,50
+ ,28
+ ,34711
+ ,167466
+ ,1519
+ ,43
+ ,54
+ ,20
+ ,31076
+ ,125909
+ ,2165
+ ,100
+ ,53
+ ,17
+ ,74608
+ ,221896
+ ,2959
+ ,120
+ ,76
+ ,25
+ ,58092
+ ,217447
+ ,2364
+ ,52
+ ,60
+ ,24
+ ,42009
+ ,0
+ ,1
+ ,1
+ ,0
+ ,0
+ ,0
+ ,207163
+ ,2009
+ ,59
+ ,53
+ ,27
+ ,36022
+ ,93107
+ ,1564
+ ,50
+ ,44
+ ,14
+ ,23333
+ ,133763
+ ,2072
+ ,47
+ ,36
+ ,32
+ ,53349
+ ,246427
+ ,2106
+ ,63
+ ,83
+ ,31
+ ,92596
+ ,224097
+ ,2270
+ ,69
+ ,100
+ ,21
+ ,49598
+ ,142057
+ ,1643
+ ,56
+ ,37
+ ,34
+ ,44093
+ ,94332
+ ,957
+ ,29
+ ,25
+ ,23
+ ,84205
+ ,171724
+ ,2025
+ ,77
+ ,59
+ ,24
+ ,63369
+ ,101683
+ ,1115
+ ,45
+ ,44
+ ,26
+ ,60132
+ ,156753
+ ,1176
+ ,90
+ ,41
+ ,22
+ ,37403
+ ,81293
+ ,744
+ ,31
+ ,23
+ ,35
+ ,24460
+ ,201984
+ ,1974
+ ,91
+ ,63
+ ,21
+ ,46456
+ ,219875
+ ,2224
+ ,85
+ ,54
+ ,31
+ ,66616
+ ,156589
+ ,2561
+ ,56
+ ,67
+ ,26
+ ,41554
+ ,48188
+ ,658
+ ,28
+ ,12
+ ,22
+ ,22346
+ ,138146
+ ,1716
+ ,64
+ ,82
+ ,21
+ ,30874
+ ,279590
+ ,2355
+ ,71
+ ,64
+ ,27
+ ,68701
+ ,234829
+ ,2017
+ ,77
+ ,56
+ ,30
+ ,35728
+ ,181731
+ ,1686
+ ,57
+ ,54
+ ,33
+ ,29010
+ ,141014
+ ,1675
+ ,54
+ ,35
+ ,11
+ ,23110
+ ,189220
+ ,1760
+ ,62
+ ,52
+ ,26
+ ,38844
+ ,76419
+ ,875
+ ,23
+ ,25
+ ,26
+ ,27084
+ ,151898
+ ,1169
+ ,65
+ ,67
+ ,23
+ ,35139
+ ,189402
+ ,2789
+ ,93
+ ,36
+ ,38
+ ,57476
+ ,140189
+ ,1606
+ ,56
+ ,50
+ ,29
+ ,33277
+ ,123181
+ ,1986
+ ,75
+ ,48
+ ,19
+ ,31141
+ ,124234
+ ,1300
+ ,58
+ ,46
+ ,19
+ ,61281
+ ,107277
+ ,1176
+ ,34
+ ,53
+ ,24
+ ,25820
+ ,153813
+ ,1215
+ ,32
+ ,27
+ ,26
+ ,23284
+ ,94982
+ ,1230
+ ,38
+ ,38
+ ,29
+ ,35378
+ ,178613
+ ,2226
+ ,67
+ ,68
+ ,36
+ ,74990
+ ,138708
+ ,2897
+ ,65
+ ,93
+ ,25
+ ,29653
+ ,102378
+ ,1008
+ ,37
+ ,48
+ ,24
+ ,64622
+ ,31970
+ ,340
+ ,15
+ ,5
+ ,21
+ ,4157
+ ,211635
+ ,2704
+ ,110
+ ,53
+ ,19
+ ,29245
+ ,111885
+ ,1209
+ ,63
+ ,36
+ ,12
+ ,50008
+ ,99687
+ ,1290
+ ,63
+ ,62
+ ,30
+ ,52338
+ ,102900
+ ,1535
+ ,68
+ ,46
+ ,21
+ ,13310
+ ,156475
+ ,2585
+ ,65
+ ,73
+ ,34
+ ,92901
+ ,74513
+ ,1315
+ ,41
+ ,2
+ ,32
+ ,10956
+ ,159186
+ ,2142
+ ,57
+ ,76
+ ,27
+ ,34241
+ ,155818
+ ,2513
+ ,94
+ ,71
+ ,28
+ ,75043
+ ,60138
+ ,817
+ ,24
+ ,16
+ ,21
+ ,21152
+ ,84971
+ ,1234
+ ,71
+ ,34
+ ,31
+ ,42249
+ ,80478
+ ,917
+ ,66
+ ,54
+ ,26
+ ,42005
+ ,244325
+ ,1924
+ ,59
+ ,39
+ ,29
+ ,41152
+ ,56486
+ ,853
+ ,27
+ ,26
+ ,23
+ ,14399
+ ,110743
+ ,1398
+ ,34
+ ,40
+ ,25
+ ,28263
+ ,75092
+ ,986
+ ,44
+ ,35
+ ,22
+ ,17215
+ ,148286
+ ,1608
+ ,47
+ ,32
+ ,26
+ ,48140
+ ,222914
+ ,2576
+ ,219
+ ,55
+ ,33
+ ,62897
+ ,115019
+ ,1201
+ ,108
+ ,58
+ ,24
+ ,22883
+ ,93083
+ ,1189
+ ,56
+ ,39
+ ,24
+ ,41622
+ ,143258
+ ,1383
+ ,49
+ ,33
+ ,21
+ ,40715
+ ,117794
+ ,1563
+ ,39
+ ,45
+ ,28
+ ,65897
+ ,158586
+ ,2185
+ ,74
+ ,72
+ ,27
+ ,76542
+ ,151465
+ ,1228
+ ,56
+ ,39
+ ,25
+ ,37477
+ ,124626
+ ,1266
+ ,58
+ ,27
+ ,15
+ ,53216
+ ,51801
+ ,830
+ ,36
+ ,22
+ ,13
+ ,40911
+ ,223020
+ ,2217
+ ,110
+ ,47
+ ,36
+ ,57021
+ ,188957
+ ,1787
+ ,68
+ ,95
+ ,24
+ ,73116
+ ,19349
+ ,223
+ ,12
+ ,13
+ ,1
+ ,3895
+ ,188069
+ ,2170
+ ,99
+ ,27
+ ,24
+ ,46609
+ ,150561
+ ,1927
+ ,74
+ ,40
+ ,31
+ ,29351
+ ,53921
+ ,665
+ ,28
+ ,22
+ ,4
+ ,2325
+ ,58280
+ ,804
+ ,22
+ ,41
+ ,20
+ ,31747
+ ,124951
+ ,1211
+ ,49
+ ,55
+ ,23
+ ,32665
+ ,112263
+ ,1143
+ ,57
+ ,28
+ ,23
+ ,19249
+ ,72904
+ ,710
+ ,38
+ ,30
+ ,12
+ ,15292
+ ,27676
+ ,596
+ ,22
+ ,2
+ ,16
+ ,5842
+ ,131274
+ ,1353
+ ,44
+ ,79
+ ,29
+ ,33994
+ ,117451
+ ,971
+ ,32
+ ,18
+ ,10
+ ,13018
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,85610
+ ,1030
+ ,31
+ ,46
+ ,25
+ ,98177
+ ,107175
+ ,1130
+ ,66
+ ,25
+ ,21
+ ,37941
+ ,133024
+ ,1284
+ ,44
+ ,50
+ ,23
+ ,31032
+ ,136473
+ ,1438
+ ,61
+ ,59
+ ,21
+ ,32683
+ ,71894
+ ,849
+ ,57
+ ,36
+ ,21
+ ,34545
+ ,3616
+ ,78
+ ,5
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,154806
+ ,925
+ ,39
+ ,35
+ ,23
+ ,27525
+ ,137977
+ ,1518
+ ,78
+ ,68
+ ,29
+ ,66856
+ ,149846
+ ,1946
+ ,95
+ ,26
+ ,28
+ ,28549
+ ,113245
+ ,914
+ ,37
+ ,36
+ ,23
+ ,38610
+ ,43410
+ ,778
+ ,19
+ ,7
+ ,1
+ ,2781
+ ,170330
+ ,1713
+ ,71
+ ,67
+ ,29
+ ,41211
+ ,89410
+ ,895
+ ,40
+ ,30
+ ,17
+ ,22698
+ ,112749
+ ,1756
+ ,52
+ ,55
+ ,29
+ ,41194
+ ,60373
+ ,701
+ ,40
+ ,3
+ ,12
+ ,32689
+ ,19764
+ ,285
+ ,12
+ ,10
+ ,2
+ ,5752
+ ,160995
+ ,1774
+ ,55
+ ,46
+ ,21
+ ,26757
+ ,121052
+ ,1021
+ ,28
+ ,26
+ ,25
+ ,22527
+ ,150039
+ ,1582
+ ,46
+ ,49
+ ,29
+ ,44810
+ ,11796
+ ,256
+ ,9
+ ,1
+ ,2
+ ,0
+ ,10674
+ ,98
+ ,9
+ ,0
+ ,0
+ ,0
+ ,134836
+ ,1358
+ ,55
+ ,33
+ ,18
+ ,100674
+ ,6836
+ ,41
+ ,3
+ ,0
+ ,1
+ ,0
+ ,153278
+ ,1770
+ ,57
+ ,48
+ ,21
+ ,57786
+ ,5118
+ ,42
+ ,3
+ ,5
+ ,0
+ ,0
+ ,40248
+ ,528
+ ,16
+ ,8
+ ,4
+ ,5444
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,117842
+ ,1026
+ ,45
+ ,35
+ ,25
+ ,28470
+ ,87635
+ ,1296
+ ,38
+ ,21
+ ,26
+ ,61849
+ ,7131
+ ,81
+ ,4
+ ,0
+ ,0
+ ,0
+ ,8812
+ ,257
+ ,13
+ ,0
+ ,4
+ ,2179
+ ,68916
+ ,914
+ ,23
+ ,15
+ ,17
+ ,8019
+ ,132686
+ ,1178
+ ,50
+ ,50
+ ,21
+ ,39644
+ ,94127
+ ,1080
+ ,19
+ ,17
+ ,22
+ ,23494)
+ ,dim=c(6
+ ,144)
+ ,dimnames=list(c('time'
+ ,'pageviews'
+ ,'logins'
+ ,'bloggedcomputations'
+ ,'reviews'
+ ,'characters')
+ ,1:144))
> y <- array(NA,dim=c(6,144),dimnames=list(c('time','pageviews','logins','bloggedcomputations','reviews','characters'),1:144))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par20 = ''
> par19 = ''
> par18 = ''
> par17 = ''
> par16 = ''
> par15 = ''
> par14 = ''
> par13 = ''
> par12 = ''
> par11 = ''
> par10 = ''
> par9 = ''
> par8 = ''
> par7 = ''
> par6 = ''
> par5 = ''
> par4 = ''
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> 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
time pageviews logins bloggedcomputations reviews characters
1 158147 1760 89 48 18 20465
2 182462 1609 56 52 20 33629
3 7215 192 18 0 0 1423
4 122259 2182 92 49 26 25629
5 222405 3367 131 76 31 54002
6 485890 6658 253 124 36 151036
7 150777 1548 54 42 23 33287
8 160529 1507 56 68 30 31172
9 133238 1682 42 52 30 28113
10 275326 2811 91 67 26 57803
11 121821 1943 74 50 24 49830
12 172489 2017 66 71 30 52143
13 89942 1702 96 41 21 21055
14 208851 3034 110 79 25 47007
15 151886 1379 55 49 18 28735
16 145427 1517 79 54 19 59147
17 134153 1637 53 75 33 78950
18 64149 1077 53 0 15 13497
19 122417 2384 84 54 34 46154
20 27997 726 24 13 18 53249
21 65004 993 55 17 15 10726
22 205417 2446 91 83 27 83700
23 188103 1713 70 37 25 40400
24 118698 2027 50 44 34 33797
25 143682 1818 81 50 21 36205
26 140172 1393 28 39 21 30165
27 186377 2000 154 59 25 58534
28 174870 1346 85 79 31 44663
29 317699 2522 114 55 30 92556
30 192335 2106 43 52 20 40078
31 151621 1515 42 50 28 34711
32 167466 1519 43 54 20 31076
33 125909 2165 100 53 17 74608
34 221896 2959 120 76 25 58092
35 217447 2364 52 60 24 42009
36 0 1 1 0 0 0
37 207163 2009 59 53 27 36022
38 93107 1564 50 44 14 23333
39 133763 2072 47 36 32 53349
40 246427 2106 63 83 31 92596
41 224097 2270 69 100 21 49598
42 142057 1643 56 37 34 44093
43 94332 957 29 25 23 84205
44 171724 2025 77 59 24 63369
45 101683 1115 45 44 26 60132
46 156753 1176 90 41 22 37403
47 81293 744 31 23 35 24460
48 201984 1974 91 63 21 46456
49 219875 2224 85 54 31 66616
50 156589 2561 56 67 26 41554
51 48188 658 28 12 22 22346
52 138146 1716 64 82 21 30874
53 279590 2355 71 64 27 68701
54 234829 2017 77 56 30 35728
55 181731 1686 57 54 33 29010
56 141014 1675 54 35 11 23110
57 189220 1760 62 52 26 38844
58 76419 875 23 25 26 27084
59 151898 1169 65 67 23 35139
60 189402 2789 93 36 38 57476
61 140189 1606 56 50 29 33277
62 123181 1986 75 48 19 31141
63 124234 1300 58 46 19 61281
64 107277 1176 34 53 24 25820
65 153813 1215 32 27 26 23284
66 94982 1230 38 38 29 35378
67 178613 2226 67 68 36 74990
68 138708 2897 65 93 25 29653
69 102378 1008 37 48 24 64622
70 31970 340 15 5 21 4157
71 211635 2704 110 53 19 29245
72 111885 1209 63 36 12 50008
73 99687 1290 63 62 30 52338
74 102900 1535 68 46 21 13310
75 156475 2585 65 73 34 92901
76 74513 1315 41 2 32 10956
77 159186 2142 57 76 27 34241
78 155818 2513 94 71 28 75043
79 60138 817 24 16 21 21152
80 84971 1234 71 34 31 42249
81 80478 917 66 54 26 42005
82 244325 1924 59 39 29 41152
83 56486 853 27 26 23 14399
84 110743 1398 34 40 25 28263
85 75092 986 44 35 22 17215
86 148286 1608 47 32 26 48140
87 222914 2576 219 55 33 62897
88 115019 1201 108 58 24 22883
89 93083 1189 56 39 24 41622
90 143258 1383 49 33 21 40715
91 117794 1563 39 45 28 65897
92 158586 2185 74 72 27 76542
93 151465 1228 56 39 25 37477
94 124626 1266 58 27 15 53216
95 51801 830 36 22 13 40911
96 223020 2217 110 47 36 57021
97 188957 1787 68 95 24 73116
98 19349 223 12 13 1 3895
99 188069 2170 99 27 24 46609
100 150561 1927 74 40 31 29351
101 53921 665 28 22 4 2325
102 58280 804 22 41 20 31747
103 124951 1211 49 55 23 32665
104 112263 1143 57 28 23 19249
105 72904 710 38 30 12 15292
106 27676 596 22 2 16 5842
107 131274 1353 44 79 29 33994
108 117451 971 32 18 10 13018
109 0 0 0 0 0 0
110 85610 1030 31 46 25 98177
111 107175 1130 66 25 21 37941
112 133024 1284 44 50 23 31032
113 136473 1438 61 59 21 32683
114 71894 849 57 36 21 34545
115 3616 78 5 0 0 0
116 0 0 0 0 0 0
117 154806 925 39 35 23 27525
118 137977 1518 78 68 29 66856
119 149846 1946 95 26 28 28549
120 113245 914 37 36 23 38610
121 43410 778 19 7 1 2781
122 170330 1713 71 67 29 41211
123 89410 895 40 30 17 22698
124 112749 1756 52 55 29 41194
125 60373 701 40 3 12 32689
126 19764 285 12 10 2 5752
127 160995 1774 55 46 21 26757
128 121052 1021 28 26 25 22527
129 150039 1582 46 49 29 44810
130 11796 256 9 1 2 0
131 10674 98 9 0 0 0
132 134836 1358 55 33 18 100674
133 6836 41 3 0 1 0
134 153278 1770 57 48 21 57786
135 5118 42 3 5 0 0
136 40248 528 16 8 4 5444
137 0 0 0 0 0 0
138 117842 1026 45 35 25 28470
139 87635 1296 38 21 26 61849
140 7131 81 4 0 0 0
141 8812 257 13 0 4 2179
142 68916 914 23 15 17 8019
143 132686 1178 50 50 21 39644
144 94127 1080 19 17 22 23494
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) pageviews logins
2905.4399 47.7826 213.7562
bloggedcomputations reviews characters
490.4432 598.0779 0.2189
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-83573 -19246 -2897 17214 104738
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2905.4399 6575.3683 0.442 0.6593
pageviews 47.7826 7.0460 6.781 3.2e-10 ***
logins 213.7562 131.1096 1.630 0.1053
bloggedcomputations 490.4432 182.5409 2.687 0.0081 **
reviews 598.0779 396.3667 1.509 0.1336
characters 0.2189 0.1542 1.420 0.1580
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 30840 on 138 degrees of freedom
Multiple R-squared: 0.822, Adjusted R-squared: 0.8155
F-statistic: 127.4 on 5 and 138 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.4430400 8.860799e-01 5.569600e-01
[2,] 0.5273116 9.453767e-01 4.726884e-01
[3,] 0.4596827 9.193654e-01 5.403173e-01
[4,] 0.4524016 9.048032e-01 5.475984e-01
[5,] 0.3827334 7.654667e-01 6.172666e-01
[6,] 0.6668959 6.662083e-01 3.331041e-01
[7,] 0.5893848 8.212303e-01 4.106152e-01
[8,] 0.4985924 9.971849e-01 5.014076e-01
[9,] 0.5690401 8.619198e-01 4.309599e-01
[10,] 0.5492555 9.014890e-01 4.507445e-01
[11,] 0.5836154 8.327692e-01 4.163846e-01
[12,] 0.5457896 9.084207e-01 4.542104e-01
[13,] 0.4764131 9.528261e-01 5.235869e-01
[14,] 0.4194376 8.388752e-01 5.805624e-01
[15,] 0.7659553 4.680894e-01 2.340447e-01
[16,] 0.7439157 5.121685e-01 2.560843e-01
[17,] 0.6855858 6.288283e-01 3.144142e-01
[18,] 0.6334170 7.331661e-01 3.665830e-01
[19,] 0.6907170 6.185659e-01 3.092830e-01
[20,] 0.6658479 6.683042e-01 3.341521e-01
[21,] 0.9856016 2.879686e-02 1.439843e-02
[22,] 0.9843425 3.131504e-02 1.565752e-02
[23,] 0.9807091 3.858184e-02 1.929092e-02
[24,] 0.9796031 4.079388e-02 2.039694e-02
[25,] 0.9930031 1.399379e-02 6.996896e-03
[26,] 0.9903927 1.921452e-02 9.607260e-03
[27,] 0.9901423 1.971538e-02 9.857692e-03
[28,] 0.9862950 2.740999e-02 1.370500e-02
[29,] 0.9901815 1.963692e-02 9.818460e-03
[30,] 0.9905748 1.885036e-02 9.425179e-03
[31,] 0.9887764 2.244717e-02 1.122358e-02
[32,] 0.9906427 1.871454e-02 9.357271e-03
[33,] 0.9889003 2.219943e-02 1.109972e-02
[34,] 0.9847168 3.056644e-02 1.528322e-02
[35,] 0.9799057 4.018856e-02 2.009428e-02
[36,] 0.9728425 5.431509e-02 2.715755e-02
[37,] 0.9663014 6.739725e-02 3.369863e-02
[38,] 0.9725718 5.485638e-02 2.742819e-02
[39,] 0.9640243 7.195147e-02 3.597574e-02
[40,] 0.9629503 7.409938e-02 3.704969e-02
[41,] 0.9647780 7.044404e-02 3.522202e-02
[42,] 0.9698738 6.025242e-02 3.012621e-02
[43,] 0.9622458 7.550838e-02 3.775419e-02
[44,] 0.9595250 8.095001e-02 4.047501e-02
[45,] 0.9950200 9.960023e-03 4.980012e-03
[46,] 0.9988963 2.207476e-03 1.103738e-03
[47,] 0.9989919 2.016172e-03 1.008086e-03
[48,] 0.9987628 2.474359e-03 1.237180e-03
[49,] 0.9991358 1.728363e-03 8.641815e-04
[50,] 0.9987292 2.541675e-03 1.270837e-03
[51,] 0.9986441 2.711858e-03 1.355929e-03
[52,] 0.9982416 3.516748e-03 1.758374e-03
[53,] 0.9974193 5.161373e-03 2.580687e-03
[54,] 0.9973267 5.346521e-03 2.673261e-03
[55,] 0.9962835 7.433055e-03 3.716528e-03
[56,] 0.9948729 1.025423e-02 5.127114e-03
[57,] 0.9976375 4.724923e-03 2.362461e-03
[58,] 0.9970180 5.964095e-03 2.982048e-03
[59,] 0.9962411 7.517794e-03 3.758897e-03
[60,] 0.9997209 5.582754e-04 2.791377e-04
[61,] 0.9996134 7.732490e-04 3.866245e-04
[62,] 0.9994073 1.185365e-03 5.926824e-04
[63,] 0.9991573 1.685417e-03 8.427087e-04
[64,] 0.9987530 2.494016e-03 1.247008e-03
[65,] 0.9989529 2.094264e-03 1.047132e-03
[66,] 0.9989187 2.162508e-03 1.081254e-03
[67,] 0.9997415 5.169455e-04 2.584728e-04
[68,] 0.9997775 4.449949e-04 2.224975e-04
[69,] 0.9997603 4.793629e-04 2.396815e-04
[70,] 0.9999694 6.123299e-05 3.061649e-05
[71,] 0.9999527 9.451570e-05 4.725785e-05
[72,] 0.9999615 7.704011e-05 3.852005e-05
[73,] 0.9999539 9.221086e-05 4.610543e-05
[74,] 0.9999997 6.291541e-07 3.145770e-07
[75,] 0.9999997 6.555285e-07 3.277643e-07
[76,] 0.9999995 1.082320e-06 5.411599e-07
[77,] 0.9999993 1.314246e-06 6.571228e-07
[78,] 0.9999989 2.237414e-06 1.118707e-06
[79,] 0.9999983 3.340209e-06 1.670104e-06
[80,] 0.9999985 2.946026e-06 1.473013e-06
[81,] 0.9999985 3.070077e-06 1.535038e-06
[82,] 0.9999984 3.172771e-06 1.586386e-06
[83,] 0.9999975 4.915262e-06 2.457631e-06
[84,] 0.9999985 3.008103e-06 1.504051e-06
[85,] 0.9999990 1.952990e-06 9.764951e-07
[86,] 0.9999984 3.166960e-06 1.583480e-06
[87,] 0.9999983 3.324812e-06 1.662406e-06
[88,] 0.9999982 3.657534e-06 1.828767e-06
[89,] 0.9999967 6.627497e-06 3.313749e-06
[90,] 0.9999935 1.303393e-05 6.516967e-06
[91,] 0.9999898 2.043384e-05 1.021692e-05
[92,] 0.9999845 3.096073e-05 1.548036e-05
[93,] 0.9999707 5.867372e-05 2.933686e-05
[94,] 0.9999734 5.313287e-05 2.656644e-05
[95,] 0.9999492 1.016531e-04 5.082654e-05
[96,] 0.9999066 1.867777e-04 9.338887e-05
[97,] 0.9998267 3.466547e-04 1.733273e-04
[98,] 0.9998411 3.177078e-04 1.588539e-04
[99,] 0.9997882 4.236072e-04 2.118036e-04
[100,] 0.9999369 1.262467e-04 6.312336e-05
[101,] 0.9998767 2.466675e-04 1.233338e-04
[102,] 0.9999001 1.998415e-04 9.992077e-05
[103,] 0.9998074 3.851654e-04 1.925827e-04
[104,] 0.9996464 7.071215e-04 3.535608e-04
[105,] 0.9993315 1.337088e-03 6.685441e-04
[106,] 0.9994768 1.046327e-03 5.231637e-04
[107,] 0.9990209 1.958223e-03 9.791114e-04
[108,] 0.9982131 3.573714e-03 1.786857e-03
[109,] 0.9999019 1.961893e-04 9.809465e-05
[110,] 0.9999510 9.801838e-05 4.900919e-05
[111,] 0.9998938 2.124447e-04 1.062224e-04
[112,] 0.9998002 3.996172e-04 1.998086e-04
[113,] 0.9995490 9.019774e-04 4.509887e-04
[114,] 0.9990468 1.906485e-03 9.532427e-04
[115,] 0.9980057 3.988601e-03 1.994300e-03
[116,] 0.9999904 1.920664e-05 9.603321e-06
[117,] 0.9999731 5.375818e-05 2.687909e-05
[118,] 0.9999348 1.304627e-04 6.523135e-05
[119,] 0.9998601 2.798381e-04 1.399190e-04
[120,] 0.9999626 7.488485e-05 3.744243e-05
[121,] 0.9998666 2.667021e-04 1.333511e-04
[122,] 0.9995178 9.643956e-04 4.821978e-04
[123,] 0.9984575 3.084993e-03 1.542496e-03
[124,] 0.9997547 4.906571e-04 2.453286e-04
[125,] 0.9989589 2.082157e-03 1.041078e-03
[126,] 0.9950978 9.804418e-03 4.902209e-03
[127,] 0.9827873 3.442545e-02 1.721273e-02
> postscript(file="/var/wessaorg/rcomp/tmp/1co4z1324481410.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/2co841324481410.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/3e0vq1324481410.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/4r8ak1324481410.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/5bf471324481410.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
13332.9161 45877.1407 -9023.8373 -49766.2038 -37023.0288 -4643.8094
7 8 9 10 11 12
20719.4612 15527.9983 -8615.5725 57587.5557 -39529.1222 -5081.1373
13 14 15 16 17 18
-52087.2868 -26528.0177 30243.8050 2352.3342 -32105.7400 -13473.3746
19 20 21 22 23 24
-69280.5666 -43527.5838 -16763.0368 -8995.5538 46440.0659 -41063.7581
25 26 27 28 29 30
-8414.4686 26429.3967 -1714.8356 22416.5532 104737.9305 33369.1705
31 32 33 34 35 36
18479.6714 37538.4380 -54315.8916 -12992.3732 37490.8570 -3166.9787
37 38 39 40 41 42
45622.9642 -30279.0125 -26668.4821 49905.7960 25513.6249 540.2301
43 44 45 46 47 48
-4951.9767 -1563.6147 -14413.1231 36962.7672 -1357.0029 31675.8984
49 50 51 52 53 54
32923.4181 -38164.9786 -16078.7331 -19969.8703 86402.9031 65857.8946
55 56 57 58 59 60
33508.4567 17726.1416 39407.2606 -6953.1221 24932.2006 -19614.3457
61 62 63 64 65 66
-577.2632 -32374.7093 -526.6169 -5088.5205 52122.0406 -18545.0577
67 68 69 70 71 72
-16276.4327 -83572.7096 -8643.9430 -6309.7880 12252.8161 1962.7669
73 74 75 76 77 78
-38132.6473 -25921.0459 -60318.1388 -22508.4649 -19171.8875 -55254.7545
79 80 81 82 83 84
-11973.4312 -36539.7775 -31581.9805 91393.4311 -22609.0395 -6987.4067
85 86 87 88 89 90
-18424.3870 16716.2627 -10372.7745 -16168.2645 -21199.6231 26137.3130
91 92 93 94 95 96
-21374.8929 -32759.4889 35628.2352 14966.3761 -25980.5113 33602.3187
97 98 99 100 101 102
9175.5952 -4603.5891 22513.6925 -4823.2895 -436.0862 -26765.2889
103 104 105 106 107 108
5825.3774 10855.6458 2712.1304 -20239.5920 -9218.0250 43649.7344
109 110 111 112 113 114
-2905.4399 -32143.9399 3040.2986 14288.7563 3166.1039 -21541.3917
115 116 117 118 119 120
-4085.2607 -2905.4399 62417.9056 -19466.3908 -2099.0188 18892.7670
121 122 123 124 125 126
-5371.6600 11170.1518 5339.0745 -38515.0914 -383.0612 -6684.4054
127 128 129 130 131 132
20588.8278 30740.1320 10522.6275 -6952.1805 1162.0635 6294.8753
133 134 135 136 137 138
732.1286 4861.4453 -2887.7921 1185.5675 -2905.4399 17942.2872
139 140 141 142 143 144
-24709.1796 -499.8522 -12021.7440 -1858.6489 17043.9197 8916.2852
> postscript(file="/var/wessaorg/rcomp/tmp/60xji1324481410.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 13332.9161 NA
1 45877.1407 13332.9161
2 -9023.8373 45877.1407
3 -49766.2038 -9023.8373
4 -37023.0288 -49766.2038
5 -4643.8094 -37023.0288
6 20719.4612 -4643.8094
7 15527.9983 20719.4612
8 -8615.5725 15527.9983
9 57587.5557 -8615.5725
10 -39529.1222 57587.5557
11 -5081.1373 -39529.1222
12 -52087.2868 -5081.1373
13 -26528.0177 -52087.2868
14 30243.8050 -26528.0177
15 2352.3342 30243.8050
16 -32105.7400 2352.3342
17 -13473.3746 -32105.7400
18 -69280.5666 -13473.3746
19 -43527.5838 -69280.5666
20 -16763.0368 -43527.5838
21 -8995.5538 -16763.0368
22 46440.0659 -8995.5538
23 -41063.7581 46440.0659
24 -8414.4686 -41063.7581
25 26429.3967 -8414.4686
26 -1714.8356 26429.3967
27 22416.5532 -1714.8356
28 104737.9305 22416.5532
29 33369.1705 104737.9305
30 18479.6714 33369.1705
31 37538.4380 18479.6714
32 -54315.8916 37538.4380
33 -12992.3732 -54315.8916
34 37490.8570 -12992.3732
35 -3166.9787 37490.8570
36 45622.9642 -3166.9787
37 -30279.0125 45622.9642
38 -26668.4821 -30279.0125
39 49905.7960 -26668.4821
40 25513.6249 49905.7960
41 540.2301 25513.6249
42 -4951.9767 540.2301
43 -1563.6147 -4951.9767
44 -14413.1231 -1563.6147
45 36962.7672 -14413.1231
46 -1357.0029 36962.7672
47 31675.8984 -1357.0029
48 32923.4181 31675.8984
49 -38164.9786 32923.4181
50 -16078.7331 -38164.9786
51 -19969.8703 -16078.7331
52 86402.9031 -19969.8703
53 65857.8946 86402.9031
54 33508.4567 65857.8946
55 17726.1416 33508.4567
56 39407.2606 17726.1416
57 -6953.1221 39407.2606
58 24932.2006 -6953.1221
59 -19614.3457 24932.2006
60 -577.2632 -19614.3457
61 -32374.7093 -577.2632
62 -526.6169 -32374.7093
63 -5088.5205 -526.6169
64 52122.0406 -5088.5205
65 -18545.0577 52122.0406
66 -16276.4327 -18545.0577
67 -83572.7096 -16276.4327
68 -8643.9430 -83572.7096
69 -6309.7880 -8643.9430
70 12252.8161 -6309.7880
71 1962.7669 12252.8161
72 -38132.6473 1962.7669
73 -25921.0459 -38132.6473
74 -60318.1388 -25921.0459
75 -22508.4649 -60318.1388
76 -19171.8875 -22508.4649
77 -55254.7545 -19171.8875
78 -11973.4312 -55254.7545
79 -36539.7775 -11973.4312
80 -31581.9805 -36539.7775
81 91393.4311 -31581.9805
82 -22609.0395 91393.4311
83 -6987.4067 -22609.0395
84 -18424.3870 -6987.4067
85 16716.2627 -18424.3870
86 -10372.7745 16716.2627
87 -16168.2645 -10372.7745
88 -21199.6231 -16168.2645
89 26137.3130 -21199.6231
90 -21374.8929 26137.3130
91 -32759.4889 -21374.8929
92 35628.2352 -32759.4889
93 14966.3761 35628.2352
94 -25980.5113 14966.3761
95 33602.3187 -25980.5113
96 9175.5952 33602.3187
97 -4603.5891 9175.5952
98 22513.6925 -4603.5891
99 -4823.2895 22513.6925
100 -436.0862 -4823.2895
101 -26765.2889 -436.0862
102 5825.3774 -26765.2889
103 10855.6458 5825.3774
104 2712.1304 10855.6458
105 -20239.5920 2712.1304
106 -9218.0250 -20239.5920
107 43649.7344 -9218.0250
108 -2905.4399 43649.7344
109 -32143.9399 -2905.4399
110 3040.2986 -32143.9399
111 14288.7563 3040.2986
112 3166.1039 14288.7563
113 -21541.3917 3166.1039
114 -4085.2607 -21541.3917
115 -2905.4399 -4085.2607
116 62417.9056 -2905.4399
117 -19466.3908 62417.9056
118 -2099.0188 -19466.3908
119 18892.7670 -2099.0188
120 -5371.6600 18892.7670
121 11170.1518 -5371.6600
122 5339.0745 11170.1518
123 -38515.0914 5339.0745
124 -383.0612 -38515.0914
125 -6684.4054 -383.0612
126 20588.8278 -6684.4054
127 30740.1320 20588.8278
128 10522.6275 30740.1320
129 -6952.1805 10522.6275
130 1162.0635 -6952.1805
131 6294.8753 1162.0635
132 732.1286 6294.8753
133 4861.4453 732.1286
134 -2887.7921 4861.4453
135 1185.5675 -2887.7921
136 -2905.4399 1185.5675
137 17942.2872 -2905.4399
138 -24709.1796 17942.2872
139 -499.8522 -24709.1796
140 -12021.7440 -499.8522
141 -1858.6489 -12021.7440
142 17043.9197 -1858.6489
143 8916.2852 17043.9197
144 NA 8916.2852
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 45877.1407 13332.9161
[2,] -9023.8373 45877.1407
[3,] -49766.2038 -9023.8373
[4,] -37023.0288 -49766.2038
[5,] -4643.8094 -37023.0288
[6,] 20719.4612 -4643.8094
[7,] 15527.9983 20719.4612
[8,] -8615.5725 15527.9983
[9,] 57587.5557 -8615.5725
[10,] -39529.1222 57587.5557
[11,] -5081.1373 -39529.1222
[12,] -52087.2868 -5081.1373
[13,] -26528.0177 -52087.2868
[14,] 30243.8050 -26528.0177
[15,] 2352.3342 30243.8050
[16,] -32105.7400 2352.3342
[17,] -13473.3746 -32105.7400
[18,] -69280.5666 -13473.3746
[19,] -43527.5838 -69280.5666
[20,] -16763.0368 -43527.5838
[21,] -8995.5538 -16763.0368
[22,] 46440.0659 -8995.5538
[23,] -41063.7581 46440.0659
[24,] -8414.4686 -41063.7581
[25,] 26429.3967 -8414.4686
[26,] -1714.8356 26429.3967
[27,] 22416.5532 -1714.8356
[28,] 104737.9305 22416.5532
[29,] 33369.1705 104737.9305
[30,] 18479.6714 33369.1705
[31,] 37538.4380 18479.6714
[32,] -54315.8916 37538.4380
[33,] -12992.3732 -54315.8916
[34,] 37490.8570 -12992.3732
[35,] -3166.9787 37490.8570
[36,] 45622.9642 -3166.9787
[37,] -30279.0125 45622.9642
[38,] -26668.4821 -30279.0125
[39,] 49905.7960 -26668.4821
[40,] 25513.6249 49905.7960
[41,] 540.2301 25513.6249
[42,] -4951.9767 540.2301
[43,] -1563.6147 -4951.9767
[44,] -14413.1231 -1563.6147
[45,] 36962.7672 -14413.1231
[46,] -1357.0029 36962.7672
[47,] 31675.8984 -1357.0029
[48,] 32923.4181 31675.8984
[49,] -38164.9786 32923.4181
[50,] -16078.7331 -38164.9786
[51,] -19969.8703 -16078.7331
[52,] 86402.9031 -19969.8703
[53,] 65857.8946 86402.9031
[54,] 33508.4567 65857.8946
[55,] 17726.1416 33508.4567
[56,] 39407.2606 17726.1416
[57,] -6953.1221 39407.2606
[58,] 24932.2006 -6953.1221
[59,] -19614.3457 24932.2006
[60,] -577.2632 -19614.3457
[61,] -32374.7093 -577.2632
[62,] -526.6169 -32374.7093
[63,] -5088.5205 -526.6169
[64,] 52122.0406 -5088.5205
[65,] -18545.0577 52122.0406
[66,] -16276.4327 -18545.0577
[67,] -83572.7096 -16276.4327
[68,] -8643.9430 -83572.7096
[69,] -6309.7880 -8643.9430
[70,] 12252.8161 -6309.7880
[71,] 1962.7669 12252.8161
[72,] -38132.6473 1962.7669
[73,] -25921.0459 -38132.6473
[74,] -60318.1388 -25921.0459
[75,] -22508.4649 -60318.1388
[76,] -19171.8875 -22508.4649
[77,] -55254.7545 -19171.8875
[78,] -11973.4312 -55254.7545
[79,] -36539.7775 -11973.4312
[80,] -31581.9805 -36539.7775
[81,] 91393.4311 -31581.9805
[82,] -22609.0395 91393.4311
[83,] -6987.4067 -22609.0395
[84,] -18424.3870 -6987.4067
[85,] 16716.2627 -18424.3870
[86,] -10372.7745 16716.2627
[87,] -16168.2645 -10372.7745
[88,] -21199.6231 -16168.2645
[89,] 26137.3130 -21199.6231
[90,] -21374.8929 26137.3130
[91,] -32759.4889 -21374.8929
[92,] 35628.2352 -32759.4889
[93,] 14966.3761 35628.2352
[94,] -25980.5113 14966.3761
[95,] 33602.3187 -25980.5113
[96,] 9175.5952 33602.3187
[97,] -4603.5891 9175.5952
[98,] 22513.6925 -4603.5891
[99,] -4823.2895 22513.6925
[100,] -436.0862 -4823.2895
[101,] -26765.2889 -436.0862
[102,] 5825.3774 -26765.2889
[103,] 10855.6458 5825.3774
[104,] 2712.1304 10855.6458
[105,] -20239.5920 2712.1304
[106,] -9218.0250 -20239.5920
[107,] 43649.7344 -9218.0250
[108,] -2905.4399 43649.7344
[109,] -32143.9399 -2905.4399
[110,] 3040.2986 -32143.9399
[111,] 14288.7563 3040.2986
[112,] 3166.1039 14288.7563
[113,] -21541.3917 3166.1039
[114,] -4085.2607 -21541.3917
[115,] -2905.4399 -4085.2607
[116,] 62417.9056 -2905.4399
[117,] -19466.3908 62417.9056
[118,] -2099.0188 -19466.3908
[119,] 18892.7670 -2099.0188
[120,] -5371.6600 18892.7670
[121,] 11170.1518 -5371.6600
[122,] 5339.0745 11170.1518
[123,] -38515.0914 5339.0745
[124,] -383.0612 -38515.0914
[125,] -6684.4054 -383.0612
[126,] 20588.8278 -6684.4054
[127,] 30740.1320 20588.8278
[128,] 10522.6275 30740.1320
[129,] -6952.1805 10522.6275
[130,] 1162.0635 -6952.1805
[131,] 6294.8753 1162.0635
[132,] 732.1286 6294.8753
[133,] 4861.4453 732.1286
[134,] -2887.7921 4861.4453
[135,] 1185.5675 -2887.7921
[136,] -2905.4399 1185.5675
[137,] 17942.2872 -2905.4399
[138,] -24709.1796 17942.2872
[139,] -499.8522 -24709.1796
[140,] -12021.7440 -499.8522
[141,] -1858.6489 -12021.7440
[142,] 17043.9197 -1858.6489
[143,] 8916.2852 17043.9197
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 45877.1407 13332.9161
2 -9023.8373 45877.1407
3 -49766.2038 -9023.8373
4 -37023.0288 -49766.2038
5 -4643.8094 -37023.0288
6 20719.4612 -4643.8094
7 15527.9983 20719.4612
8 -8615.5725 15527.9983
9 57587.5557 -8615.5725
10 -39529.1222 57587.5557
11 -5081.1373 -39529.1222
12 -52087.2868 -5081.1373
13 -26528.0177 -52087.2868
14 30243.8050 -26528.0177
15 2352.3342 30243.8050
16 -32105.7400 2352.3342
17 -13473.3746 -32105.7400
18 -69280.5666 -13473.3746
19 -43527.5838 -69280.5666
20 -16763.0368 -43527.5838
21 -8995.5538 -16763.0368
22 46440.0659 -8995.5538
23 -41063.7581 46440.0659
24 -8414.4686 -41063.7581
25 26429.3967 -8414.4686
26 -1714.8356 26429.3967
27 22416.5532 -1714.8356
28 104737.9305 22416.5532
29 33369.1705 104737.9305
30 18479.6714 33369.1705
31 37538.4380 18479.6714
32 -54315.8916 37538.4380
33 -12992.3732 -54315.8916
34 37490.8570 -12992.3732
35 -3166.9787 37490.8570
36 45622.9642 -3166.9787
37 -30279.0125 45622.9642
38 -26668.4821 -30279.0125
39 49905.7960 -26668.4821
40 25513.6249 49905.7960
41 540.2301 25513.6249
42 -4951.9767 540.2301
43 -1563.6147 -4951.9767
44 -14413.1231 -1563.6147
45 36962.7672 -14413.1231
46 -1357.0029 36962.7672
47 31675.8984 -1357.0029
48 32923.4181 31675.8984
49 -38164.9786 32923.4181
50 -16078.7331 -38164.9786
51 -19969.8703 -16078.7331
52 86402.9031 -19969.8703
53 65857.8946 86402.9031
54 33508.4567 65857.8946
55 17726.1416 33508.4567
56 39407.2606 17726.1416
57 -6953.1221 39407.2606
58 24932.2006 -6953.1221
59 -19614.3457 24932.2006
60 -577.2632 -19614.3457
61 -32374.7093 -577.2632
62 -526.6169 -32374.7093
63 -5088.5205 -526.6169
64 52122.0406 -5088.5205
65 -18545.0577 52122.0406
66 -16276.4327 -18545.0577
67 -83572.7096 -16276.4327
68 -8643.9430 -83572.7096
69 -6309.7880 -8643.9430
70 12252.8161 -6309.7880
71 1962.7669 12252.8161
72 -38132.6473 1962.7669
73 -25921.0459 -38132.6473
74 -60318.1388 -25921.0459
75 -22508.4649 -60318.1388
76 -19171.8875 -22508.4649
77 -55254.7545 -19171.8875
78 -11973.4312 -55254.7545
79 -36539.7775 -11973.4312
80 -31581.9805 -36539.7775
81 91393.4311 -31581.9805
82 -22609.0395 91393.4311
83 -6987.4067 -22609.0395
84 -18424.3870 -6987.4067
85 16716.2627 -18424.3870
86 -10372.7745 16716.2627
87 -16168.2645 -10372.7745
88 -21199.6231 -16168.2645
89 26137.3130 -21199.6231
90 -21374.8929 26137.3130
91 -32759.4889 -21374.8929
92 35628.2352 -32759.4889
93 14966.3761 35628.2352
94 -25980.5113 14966.3761
95 33602.3187 -25980.5113
96 9175.5952 33602.3187
97 -4603.5891 9175.5952
98 22513.6925 -4603.5891
99 -4823.2895 22513.6925
100 -436.0862 -4823.2895
101 -26765.2889 -436.0862
102 5825.3774 -26765.2889
103 10855.6458 5825.3774
104 2712.1304 10855.6458
105 -20239.5920 2712.1304
106 -9218.0250 -20239.5920
107 43649.7344 -9218.0250
108 -2905.4399 43649.7344
109 -32143.9399 -2905.4399
110 3040.2986 -32143.9399
111 14288.7563 3040.2986
112 3166.1039 14288.7563
113 -21541.3917 3166.1039
114 -4085.2607 -21541.3917
115 -2905.4399 -4085.2607
116 62417.9056 -2905.4399
117 -19466.3908 62417.9056
118 -2099.0188 -19466.3908
119 18892.7670 -2099.0188
120 -5371.6600 18892.7670
121 11170.1518 -5371.6600
122 5339.0745 11170.1518
123 -38515.0914 5339.0745
124 -383.0612 -38515.0914
125 -6684.4054 -383.0612
126 20588.8278 -6684.4054
127 30740.1320 20588.8278
128 10522.6275 30740.1320
129 -6952.1805 10522.6275
130 1162.0635 -6952.1805
131 6294.8753 1162.0635
132 732.1286 6294.8753
133 4861.4453 732.1286
134 -2887.7921 4861.4453
135 1185.5675 -2887.7921
136 -2905.4399 1185.5675
137 17942.2872 -2905.4399
138 -24709.1796 17942.2872
139 -499.8522 -24709.1796
140 -12021.7440 -499.8522
141 -1858.6489 -12021.7440
142 17043.9197 -1858.6489
143 8916.2852 17043.9197
> 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/7grde1324481410.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/8x3z91324481410.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/9s3951324481410.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/10sia61324481410.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/11i5xa1324481410.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/12d8vp1324481410.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/13nzwo1324481410.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/14xg7e1324481410.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/158ks51324481410.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/16osfh1324481410.tab")
+ }
>
> try(system("convert tmp/1co4z1324481410.ps tmp/1co4z1324481410.png",intern=TRUE))
character(0)
> try(system("convert tmp/2co841324481410.ps tmp/2co841324481410.png",intern=TRUE))
character(0)
> try(system("convert tmp/3e0vq1324481410.ps tmp/3e0vq1324481410.png",intern=TRUE))
character(0)
> try(system("convert tmp/4r8ak1324481410.ps tmp/4r8ak1324481410.png",intern=TRUE))
character(0)
> try(system("convert tmp/5bf471324481410.ps tmp/5bf471324481410.png",intern=TRUE))
character(0)
> try(system("convert tmp/60xji1324481410.ps tmp/60xji1324481410.png",intern=TRUE))
character(0)
> try(system("convert tmp/7grde1324481410.ps tmp/7grde1324481410.png",intern=TRUE))
character(0)
> try(system("convert tmp/8x3z91324481410.ps tmp/8x3z91324481410.png",intern=TRUE))
character(0)
> try(system("convert tmp/9s3951324481410.ps tmp/9s3951324481410.png",intern=TRUE))
character(0)
> try(system("convert tmp/10sia61324481410.ps tmp/10sia61324481410.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.858 0.655 5.654