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(112285
+ ,210907
+ ,81
+ ,79
+ ,30
+ ,84786
+ ,120982
+ ,55
+ ,58
+ ,28
+ ,83123
+ ,176508
+ ,50
+ ,60
+ ,38
+ ,101193
+ ,179321
+ ,125
+ ,108
+ ,30
+ ,38361
+ ,123185
+ ,40
+ ,49
+ ,22
+ ,68504
+ ,52746
+ ,37
+ ,0
+ ,26
+ ,119182
+ ,385534
+ ,63
+ ,121
+ ,25
+ ,22807
+ ,33170
+ ,44
+ ,1
+ ,18
+ ,116174
+ ,149061
+ ,66
+ ,43
+ ,26
+ ,57635
+ ,165446
+ ,57
+ ,69
+ ,25
+ ,66198
+ ,237213
+ ,74
+ ,78
+ ,38
+ ,71701
+ ,173326
+ ,49
+ ,86
+ ,44
+ ,57793
+ ,133131
+ ,52
+ ,44
+ ,30
+ ,80444
+ ,258873
+ ,88
+ ,104
+ ,40
+ ,53855
+ ,180083
+ ,36
+ ,63
+ ,34
+ ,97668
+ ,324799
+ ,108
+ ,158
+ ,47
+ ,133824
+ ,230964
+ ,43
+ ,102
+ ,30
+ ,101481
+ ,236785
+ ,75
+ ,77
+ ,31
+ ,99645
+ ,135473
+ ,32
+ ,82
+ ,23
+ ,114789
+ ,202925
+ ,44
+ ,115
+ ,36
+ ,99052
+ ,215147
+ ,85
+ ,101
+ ,36
+ ,67654
+ ,344297
+ ,86
+ ,80
+ ,30
+ ,65553
+ ,153935
+ ,56
+ ,50
+ ,25
+ ,97500
+ ,132943
+ ,50
+ ,83
+ ,39
+ ,69112
+ ,174724
+ ,135
+ ,123
+ ,34
+ ,82753
+ ,174415
+ ,63
+ ,73
+ ,31
+ ,85323
+ ,225548
+ ,81
+ ,81
+ ,31
+ ,72654
+ ,223632
+ ,52
+ ,105
+ ,33
+ ,30727
+ ,124817
+ ,44
+ ,47
+ ,25
+ ,77873
+ ,221698
+ ,113
+ ,105
+ ,33
+ ,117478
+ ,210767
+ ,39
+ ,94
+ ,35
+ ,74007
+ ,170266
+ ,73
+ ,44
+ ,42
+ ,90183
+ ,260561
+ ,48
+ ,114
+ ,43
+ ,61542
+ ,84853
+ ,33
+ ,38
+ ,30
+ ,101494
+ ,294424
+ ,59
+ ,107
+ ,33
+ ,55813
+ ,215641
+ ,69
+ ,71
+ ,32
+ ,79215
+ ,325107
+ ,64
+ ,84
+ ,36
+ ,55461
+ ,167542
+ ,59
+ ,59
+ ,28
+ ,31081
+ ,106408
+ ,32
+ ,33
+ ,14
+ ,83122
+ ,265769
+ ,37
+ ,96
+ ,32
+ ,70106
+ ,269651
+ ,31
+ ,106
+ ,30
+ ,60578
+ ,149112
+ ,65
+ ,56
+ ,35
+ ,79892
+ ,152871
+ ,74
+ ,59
+ ,28
+ ,49810
+ ,111665
+ ,54
+ ,39
+ ,28
+ ,71570
+ ,116408
+ ,76
+ ,34
+ ,39
+ ,100708
+ ,362301
+ ,715
+ ,76
+ ,34
+ ,33032
+ ,78800
+ ,57
+ ,20
+ ,26
+ ,82875
+ ,183167
+ ,66
+ ,91
+ ,39
+ ,139077
+ ,277965
+ ,106
+ ,115
+ ,39
+ ,71595
+ ,150629
+ ,54
+ ,85
+ ,33
+ ,72260
+ ,168809
+ ,32
+ ,76
+ ,28
+ ,5950
+ ,24188
+ ,20
+ ,8
+ ,4
+ ,115762
+ ,329267
+ ,71
+ ,79
+ ,39
+ ,32551
+ ,65029
+ ,21
+ ,21
+ ,18
+ ,31701
+ ,101097
+ ,70
+ ,30
+ ,14
+ ,80670
+ ,218946
+ ,112
+ ,76
+ ,29
+ ,143558
+ ,244052
+ ,66
+ ,101
+ ,44
+ ,120733
+ ,233328
+ ,165
+ ,92
+ ,28
+ ,105195
+ ,256462
+ ,56
+ ,123
+ ,35
+ ,73107
+ ,206161
+ ,61
+ ,75
+ ,28
+ ,132068
+ ,311473
+ ,53
+ ,128
+ ,38
+ ,149193
+ ,235800
+ ,127
+ ,105
+ ,23
+ ,46821
+ ,177939
+ ,63
+ ,55
+ ,36
+ ,87011
+ ,207176
+ ,38
+ ,56
+ ,32
+ ,95260
+ ,196553
+ ,50
+ ,41
+ ,29
+ ,55183
+ ,174184
+ ,52
+ ,72
+ ,25
+ ,106671
+ ,143246
+ ,42
+ ,67
+ ,27
+ ,73511
+ ,187559
+ ,76
+ ,75
+ ,36
+ ,92945
+ ,187681
+ ,67
+ ,114
+ ,28
+ ,78664
+ ,119016
+ ,50
+ ,118
+ ,23
+ ,70054
+ ,182192
+ ,53
+ ,77
+ ,40
+ ,22618
+ ,73566
+ ,39
+ ,22
+ ,23
+ ,74011
+ ,194979
+ ,50
+ ,66
+ ,40
+ ,83737
+ ,167488
+ ,77
+ ,69
+ ,28
+ ,69094
+ ,143756
+ ,57
+ ,105
+ ,34
+ ,93133
+ ,275541
+ ,73
+ ,116
+ ,33
+ ,95536
+ ,243199
+ ,34
+ ,88
+ ,28
+ ,225920
+ ,182999
+ ,39
+ ,73
+ ,34
+ ,62133
+ ,135649
+ ,46
+ ,99
+ ,30
+ ,61370
+ ,152299
+ ,63
+ ,62
+ ,33
+ ,43836
+ ,120221
+ ,35
+ ,53
+ ,22
+ ,106117
+ ,346485
+ ,106
+ ,118
+ ,38
+ ,38692
+ ,145790
+ ,43
+ ,30
+ ,26
+ ,84651
+ ,193339
+ ,47
+ ,100
+ ,35
+ ,56622
+ ,80953
+ ,31
+ ,49
+ ,8
+ ,15986
+ ,122774
+ ,162
+ ,24
+ ,24
+ ,95364
+ ,130585
+ ,57
+ ,67
+ ,29
+ ,89691
+ ,286468
+ ,263
+ ,57
+ ,29
+ ,67267
+ ,241066
+ ,78
+ ,75
+ ,45
+ ,126846
+ ,148446
+ ,63
+ ,135
+ ,37
+ ,41140
+ ,204713
+ ,54
+ ,68
+ ,33
+ ,102860
+ ,182079
+ ,63
+ ,124
+ ,33
+ ,51715
+ ,140344
+ ,77
+ ,33
+ ,25
+ ,55801
+ ,220516
+ ,79
+ ,98
+ ,32
+ ,111813
+ ,243060
+ ,110
+ ,58
+ ,29
+ ,120293
+ ,162765
+ ,56
+ ,68
+ ,28
+ ,138599
+ ,182613
+ ,56
+ ,81
+ ,28
+ ,161647
+ ,232138
+ ,43
+ ,131
+ ,31
+ ,115929
+ ,265318
+ ,111
+ ,110
+ ,52
+ ,162901
+ ,310839
+ ,62
+ ,130
+ ,24
+ ,109825
+ ,225060
+ ,56
+ ,93
+ ,41
+ ,129838
+ ,232317
+ ,74
+ ,118
+ ,33
+ ,37510
+ ,144966
+ ,60
+ ,39
+ ,32
+ ,43750
+ ,43287
+ ,43
+ ,13
+ ,19
+ ,40652
+ ,155754
+ ,68
+ ,74
+ ,20
+ ,87771
+ ,164709
+ ,53
+ ,81
+ ,31
+ ,85872
+ ,201940
+ ,87
+ ,109
+ ,31
+ ,89275
+ ,235454
+ ,46
+ ,151
+ ,32
+ ,192565
+ ,99466
+ ,32
+ ,28
+ ,23
+ ,140867
+ ,100750
+ ,67
+ ,83
+ ,30
+ ,120662
+ ,224549
+ ,47
+ ,54
+ ,31
+ ,101338
+ ,243511
+ ,65
+ ,133
+ ,42
+ ,1168
+ ,22938
+ ,9
+ ,12
+ ,1
+ ,65567
+ ,152474
+ ,45
+ ,106
+ ,32
+ ,25162
+ ,61857
+ ,25
+ ,23
+ ,11
+ ,40735
+ ,132487
+ ,97
+ ,71
+ ,36
+ ,91413
+ ,317394
+ ,53
+ ,116
+ ,31
+ ,855
+ ,21054
+ ,2
+ ,4
+ ,0
+ ,97068
+ ,209641
+ ,52
+ ,62
+ ,24
+ ,14116
+ ,31414
+ ,22
+ ,18
+ ,8
+ ,76643
+ ,244749
+ ,144
+ ,98
+ ,33
+ ,110681
+ ,184510
+ ,60
+ ,64
+ ,40
+ ,92696
+ ,128423
+ ,89
+ ,32
+ ,38
+ ,94785
+ ,97839
+ ,42
+ ,25
+ ,24
+ ,8773
+ ,38214
+ ,52
+ ,16
+ ,8
+ ,83209
+ ,151101
+ ,98
+ ,48
+ ,35
+ ,93815
+ ,272458
+ ,99
+ ,100
+ ,43
+ ,86687
+ ,172494
+ ,52
+ ,46
+ ,43
+ ,105547
+ ,328107
+ ,125
+ ,129
+ ,41
+ ,103487
+ ,250579
+ ,106
+ ,130
+ ,38
+ ,213688
+ ,351067
+ ,95
+ ,136
+ ,45
+ ,71220
+ ,158015
+ ,40
+ ,59
+ ,31
+ ,56926
+ ,85439
+ ,43
+ ,32
+ ,28
+ ,91721
+ ,229242
+ ,128
+ ,63
+ ,31
+ ,115168
+ ,351619
+ ,142
+ ,95
+ ,40
+ ,111194
+ ,84207
+ ,73
+ ,14
+ ,30
+ ,135777
+ ,324598
+ ,128
+ ,113
+ ,37
+ ,51513
+ ,131069
+ ,61
+ ,47
+ ,30
+ ,74163
+ ,204271
+ ,73
+ ,92
+ ,35
+ ,51633
+ ,165543
+ ,148
+ ,70
+ ,32
+ ,75345
+ ,141722
+ ,64
+ ,19
+ ,27
+ ,98952
+ ,299775
+ ,97
+ ,91
+ ,31
+ ,102372
+ ,195838
+ ,50
+ ,111
+ ,31
+ ,37238
+ ,173260
+ ,37
+ ,41
+ ,21
+ ,103772
+ ,254488
+ ,50
+ ,120
+ ,39
+ ,123969
+ ,104389
+ ,105
+ ,135
+ ,41
+ ,135400
+ ,199476
+ ,46
+ ,87
+ ,32
+ ,130115
+ ,224330
+ ,52
+ ,131
+ ,39
+ ,6023
+ ,14688
+ ,0
+ ,4
+ ,0
+ ,64466
+ ,181633
+ ,48
+ ,47
+ ,30
+ ,54990
+ ,271856
+ ,91
+ ,109
+ ,37
+ ,1644
+ ,7199
+ ,0
+ ,7
+ ,0
+ ,6179
+ ,46660
+ ,7
+ ,12
+ ,5
+ ,3926
+ ,17547
+ ,3
+ ,0
+ ,1
+ ,34777
+ ,95227
+ ,70
+ ,37
+ ,32
+ ,73224
+ ,152601
+ ,36
+ ,46
+ ,24)
+ ,dim=c(5
+ ,156)
+ ,dimnames=list(c('Total_size'
+ ,'Time_RFC'
+ ,'PR_views'
+ ,'Blogged'
+ ,'Reviewed')
+ ,1:156))
> y <- array(NA,dim=c(5,156),dimnames=list(c('Total_size','Time_RFC','PR_views','Blogged','Reviewed'),1:156))
> 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 = '2'
> 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_RFC Total_size PR_views Blogged Reviewed
1 210907 112285 81 79 30
2 120982 84786 55 58 28
3 176508 83123 50 60 38
4 179321 101193 125 108 30
5 123185 38361 40 49 22
6 52746 68504 37 0 26
7 385534 119182 63 121 25
8 33170 22807 44 1 18
9 149061 116174 66 43 26
10 165446 57635 57 69 25
11 237213 66198 74 78 38
12 173326 71701 49 86 44
13 133131 57793 52 44 30
14 258873 80444 88 104 40
15 180083 53855 36 63 34
16 324799 97668 108 158 47
17 230964 133824 43 102 30
18 236785 101481 75 77 31
19 135473 99645 32 82 23
20 202925 114789 44 115 36
21 215147 99052 85 101 36
22 344297 67654 86 80 30
23 153935 65553 56 50 25
24 132943 97500 50 83 39
25 174724 69112 135 123 34
26 174415 82753 63 73 31
27 225548 85323 81 81 31
28 223632 72654 52 105 33
29 124817 30727 44 47 25
30 221698 77873 113 105 33
31 210767 117478 39 94 35
32 170266 74007 73 44 42
33 260561 90183 48 114 43
34 84853 61542 33 38 30
35 294424 101494 59 107 33
36 215641 55813 69 71 32
37 325107 79215 64 84 36
38 167542 55461 59 59 28
39 106408 31081 32 33 14
40 265769 83122 37 96 32
41 269651 70106 31 106 30
42 149112 60578 65 56 35
43 152871 79892 74 59 28
44 111665 49810 54 39 28
45 116408 71570 76 34 39
46 362301 100708 715 76 34
47 78800 33032 57 20 26
48 183167 82875 66 91 39
49 277965 139077 106 115 39
50 150629 71595 54 85 33
51 168809 72260 32 76 28
52 24188 5950 20 8 4
53 329267 115762 71 79 39
54 65029 32551 21 21 18
55 101097 31701 70 30 14
56 218946 80670 112 76 29
57 244052 143558 66 101 44
58 233328 120733 165 92 28
59 256462 105195 56 123 35
60 206161 73107 61 75 28
61 311473 132068 53 128 38
62 235800 149193 127 105 23
63 177939 46821 63 55 36
64 207176 87011 38 56 32
65 196553 95260 50 41 29
66 174184 55183 52 72 25
67 143246 106671 42 67 27
68 187559 73511 76 75 36
69 187681 92945 67 114 28
70 119016 78664 50 118 23
71 182192 70054 53 77 40
72 73566 22618 39 22 23
73 194979 74011 50 66 40
74 167488 83737 77 69 28
75 143756 69094 57 105 34
76 275541 93133 73 116 33
77 243199 95536 34 88 28
78 182999 225920 39 73 34
79 135649 62133 46 99 30
80 152299 61370 63 62 33
81 120221 43836 35 53 22
82 346485 106117 106 118 38
83 145790 38692 43 30 26
84 193339 84651 47 100 35
85 80953 56622 31 49 8
86 122774 15986 162 24 24
87 130585 95364 57 67 29
88 286468 89691 263 57 29
89 241066 67267 78 75 45
90 148446 126846 63 135 37
91 204713 41140 54 68 33
92 182079 102860 63 124 33
93 140344 51715 77 33 25
94 220516 55801 79 98 32
95 243060 111813 110 58 29
96 162765 120293 56 68 28
97 182613 138599 56 81 28
98 232138 161647 43 131 31
99 265318 115929 111 110 52
100 310839 162901 62 130 24
101 225060 109825 56 93 41
102 232317 129838 74 118 33
103 144966 37510 60 39 32
104 43287 43750 43 13 19
105 155754 40652 68 74 20
106 164709 87771 53 81 31
107 201940 85872 87 109 31
108 235454 89275 46 151 32
109 99466 192565 32 28 23
110 100750 140867 67 83 30
111 224549 120662 47 54 31
112 243511 101338 65 133 42
113 22938 1168 9 12 1
114 152474 65567 45 106 32
115 61857 25162 25 23 11
116 132487 40735 97 71 36
117 317394 91413 53 116 31
118 21054 855 2 4 0
119 209641 97068 52 62 24
120 31414 14116 22 18 8
121 244749 76643 144 98 33
122 184510 110681 60 64 40
123 128423 92696 89 32 38
124 97839 94785 42 25 24
125 38214 8773 52 16 8
126 151101 83209 98 48 35
127 272458 93815 99 100 43
128 172494 86687 52 46 43
129 328107 105547 125 129 41
130 250579 103487 106 130 38
131 351067 213688 95 136 45
132 158015 71220 40 59 31
133 85439 56926 43 32 28
134 229242 91721 128 63 31
135 351619 115168 142 95 40
136 84207 111194 73 14 30
137 324598 135777 128 113 37
138 131069 51513 61 47 30
139 204271 74163 73 92 35
140 165543 51633 148 70 32
141 141722 75345 64 19 27
142 299775 98952 97 91 31
143 195838 102372 50 111 31
144 173260 37238 37 41 21
145 254488 103772 50 120 39
146 104389 123969 105 135 41
147 199476 135400 46 87 32
148 224330 130115 52 131 39
149 14688 6023 0 4 0
150 181633 64466 48 47 30
151 271856 54990 91 109 37
152 7199 1644 0 7 0
153 46660 6179 7 12 5
154 17547 3926 3 0 1
155 95227 34777 70 37 32
156 152601 73224 36 46 24
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Total_size PR_views Blogged Reviewed
8592.1190 0.2633 309.4925 1077.0763 1747.0666
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-186377 -26218 -4038 21973 152697
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.592e+03 1.235e+04 0.696 0.48761
Total_size 2.633e-01 1.254e-01 2.099 0.03747 *
PR_views 3.095e+02 6.222e+01 4.974 1.76e-06 ***
Blogged 1.077e+03 1.448e+02 7.437 7.18e-12 ***
Reviewed 1.747e+03 5.336e+02 3.274 0.00131 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 46640 on 151 degrees of freedom
Multiple R-squared: 0.678, Adjusted R-squared: 0.6694
F-statistic: 79.47 on 4 and 151 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.46964394 0.93928787 0.53035606
[2,] 0.30787879 0.61575759 0.69212121
[3,] 0.18817049 0.37634098 0.81182951
[4,] 0.39031240 0.78062480 0.60968760
[5,] 0.47019336 0.94038672 0.52980664
[6,] 0.37194821 0.74389643 0.62805179
[7,] 0.33399120 0.66798240 0.66600880
[8,] 0.24702121 0.49404242 0.75297879
[9,] 0.18145558 0.36291116 0.81854442
[10,] 0.29903345 0.59806691 0.70096655
[11,] 0.28762299 0.57524598 0.71237701
[12,] 0.49205348 0.98410696 0.50794652
[13,] 0.55151659 0.89696683 0.44848341
[14,] 0.48779999 0.97559999 0.51220001
[15,] 0.91229077 0.17541846 0.08770923
[16,] 0.88187521 0.23624958 0.11812479
[17,] 0.89643209 0.20713581 0.10356791
[18,] 0.96531238 0.06937524 0.03468762
[19,] 0.95145525 0.09708951 0.04854475
[20,] 0.93952105 0.12095789 0.06047895
[21,] 0.91905210 0.16189580 0.08094790
[22,] 0.89369015 0.21261969 0.10630985
[23,] 0.86528915 0.26942171 0.13471085
[24,] 0.83075150 0.33849700 0.16924850
[25,] 0.80815883 0.38368235 0.19184117
[26,] 0.76969962 0.46060075 0.23030038
[27,] 0.75369975 0.49260050 0.24630025
[28,] 0.77372670 0.45254661 0.22627330
[29,] 0.75967850 0.48064299 0.24032150
[30,] 0.92443304 0.15113392 0.07556696
[31,] 0.90392072 0.19215857 0.09607928
[32,] 0.88014928 0.23970144 0.11985072
[33,] 0.88254972 0.23490056 0.11745028
[34,] 0.88060993 0.23878014 0.11939007
[35,] 0.85372707 0.29254586 0.14627293
[36,] 0.82270068 0.35459864 0.17729932
[37,] 0.79028763 0.41942473 0.20971237
[38,] 0.76311633 0.47376734 0.23688367
[39,] 0.79454702 0.41090597 0.20545298
[40,] 0.76279021 0.47441957 0.23720979
[41,] 0.74294807 0.51410386 0.25705193
[42,] 0.70052594 0.59894811 0.29947406
[43,] 0.70257752 0.59484497 0.29742248
[44,] 0.66106586 0.67786828 0.33893414
[45,] 0.62617037 0.74765926 0.37382963
[46,] 0.83573636 0.32852729 0.16426364
[47,] 0.80473408 0.39053184 0.19526592
[48,] 0.76912082 0.46175836 0.23087918
[49,] 0.73437388 0.53125223 0.26562612
[50,] 0.69685741 0.60628518 0.30314259
[51,] 0.66278007 0.67443985 0.33721993
[52,] 0.62559078 0.74881843 0.37440922
[53,] 0.59452075 0.81095850 0.40547925
[54,] 0.59162327 0.81675345 0.40837673
[55,] 0.56059266 0.87881468 0.43940734
[56,] 0.52279111 0.95441778 0.47720889
[57,] 0.53448794 0.93102412 0.46551206
[58,] 0.55319679 0.89360642 0.44680321
[59,] 0.51056145 0.97887710 0.48943855
[60,] 0.48508180 0.97016360 0.51491820
[61,] 0.43921638 0.87843277 0.56078362
[62,] 0.44549999 0.89099999 0.55450001
[63,] 0.61196932 0.77606137 0.38803068
[64,] 0.56947010 0.86105980 0.43052990
[65,] 0.52575276 0.94849447 0.47424724
[66,] 0.48512415 0.97024830 0.51487585
[67,] 0.44186635 0.88373270 0.55813365
[68,] 0.50357932 0.99284135 0.49642068
[69,] 0.48688546 0.97377092 0.51311454
[70,] 0.51433145 0.97133710 0.48566855
[71,] 0.50826214 0.98347571 0.49173786
[72,] 0.54035674 0.91928652 0.45964326
[73,] 0.49760306 0.99520612 0.50239694
[74,] 0.45123109 0.90246218 0.54876891
[75,] 0.54679109 0.90641781 0.45320891
[76,] 0.53534309 0.92931382 0.46465691
[77,] 0.49712448 0.99424896 0.50287552
[78,] 0.45761395 0.91522790 0.54238605
[79,] 0.43139234 0.86278468 0.56860766
[80,] 0.42266032 0.84532064 0.57733968
[81,] 0.42039484 0.84078969 0.57960516
[82,] 0.40269375 0.80538750 0.59730625
[83,] 0.65578876 0.68842248 0.34421124
[84,] 0.65231330 0.69537340 0.34768670
[85,] 0.68195469 0.63609062 0.31804531
[86,] 0.64126832 0.71746336 0.35873168
[87,] 0.59902064 0.80195871 0.40097936
[88,] 0.60554861 0.78890278 0.39445139
[89,] 0.56392406 0.87215187 0.43607594
[90,] 0.52105804 0.95788391 0.47894196
[91,] 0.48619724 0.97239447 0.51380276
[92,] 0.44261553 0.88523106 0.55738447
[93,] 0.46226454 0.92452908 0.53773546
[94,] 0.41585149 0.83170299 0.58414851
[95,] 0.37359566 0.74719132 0.62640434
[96,] 0.33214327 0.66428654 0.66785673
[97,] 0.31289768 0.62579537 0.68710232
[98,] 0.26990252 0.53980505 0.73009748
[99,] 0.23707083 0.47414166 0.76292917
[100,] 0.21204701 0.42409402 0.78795299
[101,] 0.18530487 0.37060974 0.81469513
[102,] 0.17821667 0.35643335 0.82178333
[103,] 0.38700945 0.77401889 0.61299055
[104,] 0.39982528 0.79965055 0.60017472
[105,] 0.35916502 0.71833004 0.64083498
[106,] 0.31197237 0.62394473 0.68802763
[107,] 0.31788369 0.63576739 0.68211631
[108,] 0.27238816 0.54477632 0.72761184
[109,] 0.27859588 0.55719176 0.72140412
[110,] 0.40328421 0.80656843 0.59671579
[111,] 0.35107888 0.70215775 0.64892112
[112,] 0.35188244 0.70376488 0.64811756
[113,] 0.31075846 0.62151692 0.68924154
[114,] 0.26388721 0.52777442 0.73611279
[115,] 0.21946312 0.43892624 0.78053688
[116,] 0.19951146 0.39902293 0.80048854
[117,] 0.16776606 0.33553213 0.83223394
[118,] 0.14620264 0.29240529 0.85379736
[119,] 0.12792947 0.25585893 0.87207053
[120,] 0.10709050 0.21418100 0.89290950
[121,] 0.08288124 0.16576247 0.91711876
[122,] 0.07477436 0.14954872 0.92522564
[123,] 0.05819266 0.11638532 0.94180734
[124,] 0.04802545 0.09605090 0.95197455
[125,] 0.03440163 0.06880327 0.96559837
[126,] 0.02750001 0.05500002 0.97249999
[127,] 0.01947613 0.03895226 0.98052387
[128,] 0.04866479 0.09732958 0.95133521
[129,] 0.05560870 0.11121741 0.94439130
[130,] 0.08752429 0.17504859 0.91247571
[131,] 0.06787083 0.13574166 0.93212917
[132,] 0.04570461 0.09140923 0.95429539
[133,] 0.03056822 0.06113644 0.96943178
[134,] 0.01913179 0.03826359 0.98086821
[135,] 0.47107238 0.94214475 0.52892762
[136,] 0.37401688 0.74803376 0.62598312
[137,] 0.36279415 0.72558830 0.63720585
[138,] 0.29660896 0.59321793 0.70339104
[139,] 0.72519332 0.54961336 0.27480668
[140,] 0.60451887 0.79096225 0.39548113
[141,] 0.95093804 0.09812393 0.04906196
> postscript(file="/var/wessaorg/rcomp/tmp/1ycxy1324044449.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/2ixeh1324044449.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/38xwd1324044449.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/49n3y1324044449.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/56njf1324044449.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 = 156
Frequency = 1
1 2 3 4 5 6
10179.5294 -38345.2493 -458.7260 -63338.7511 900.2549 -30758.6607
7 8 9 10 11 12
152059.4945 -27569.3087 -2285.0713 6042.1764 37887.5528 -38810.1235
13 14 15 16 17 18
-6575.3895 19965.4686 18912.6777 4774.8318 11553.1190 41166.3399
19 20 21 22 23 24
-37762.8993 -36267.7151 -17512.1763 152696.6481 13220.2531 -74329.1129
25 26 27 28 29 30
-85727.9330 -8250.2303 28018.5952 9069.7507 217.3237 -13117.4914
31 32 33 34 35 36
-3220.6166 -1173.7921 15456.8584 -43497.7124 67947.3750 38619.3929
37 38 39 40 41 42
122480.6853 13621.1840 19725.8239 64533.5931 66423.1232 -17011.3507
43 44 45 46 47 48
-12125.0584 -17678.8795 -39306.6276 -35353.4476 -23096.0084 -33822.7374
49 50 51 52 53 54
7947.3481 -42731.8663 510.8892 -7765.5228 114995.3362 -12699.1710
55 56 57 58 59 60
5722.0874 21927.0102 -8422.0959 -6129.1172 9211.9991 29741.6619
61 62 63 64 65 66
47449.0446 -4656.7798 15386.9592 47690.1511 52578.5653 13742.0389
67 68 69 70 71 72
-25766.9419 -7585.6346 -37824.7539 -93041.0653 -14066.4736 -16930.0163
73 74 75 76 77 78
10454.9370 -10219.7144 -73163.4053 37239.3037 55228.2536 -35176.4923
79 80 81 82 83 84
-62582.3831 -16382.2294 -6266.1939 83661.7866 35965.8058 -20943.4334
85 86 87 88 89 90
-18895.6302 -7944.5606 -43587.2497 60804.7991 31222.8701 -123090.3583
91 92 93 94 95 96
37681.4472 -64305.5694 15083.8506 11321.5678 57847.1966 -16991.7486
97 98 99 100 101 102
-15965.8394 -27581.1525 -17478.5672 58215.8456 -1579.2236 -18113.0271
103 104 105 106 107 108
10015.5759 -37329.2381 767.4544 -24799.1904 -27749.0515 -29426.1637
109 110 111 112 113 114
-40074.2719 -107478.7232 57318.3918 -28509.0873 -3419.0763 -57385.7543
115 116 117 118 119 120
-5088.2513 -56218.5197 89229.1751 7309.4633 50688.2522 -21067.7027
121 122 123 124 125 126
8202.6428 -10610.3054 -32976.4359 -17565.8701 -19991.4755 -22577.8951
127 128 129 130 131 132
25692.4777 313.5976 42464.4751 -24476.6313 31707.1605 583.8856
133 134 135 136 137 138
-34834.6210 34869.1824 96549.4858 -43747.3037 54288.7122 -13000.4825
139 140 141 142 143 144
-6680.0636 -33750.8148 25848.2421 82934.3404 -28898.5481 62563.1032
145 146 147 148 149 150
5712.6025 -186376.7754 -8616.3194 -43848.5197 201.6774 38176.3036
151 152 153 154 155 156
38578.0275 -9365.5299 12614.2106 5245.5933 -39944.5783 22111.6464
> postscript(file="/var/wessaorg/rcomp/tmp/66trv1324044449.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 = 156
Frequency = 1
lag(myerror, k = 1) myerror
0 10179.5294 NA
1 -38345.2493 10179.5294
2 -458.7260 -38345.2493
3 -63338.7511 -458.7260
4 900.2549 -63338.7511
5 -30758.6607 900.2549
6 152059.4945 -30758.6607
7 -27569.3087 152059.4945
8 -2285.0713 -27569.3087
9 6042.1764 -2285.0713
10 37887.5528 6042.1764
11 -38810.1235 37887.5528
12 -6575.3895 -38810.1235
13 19965.4686 -6575.3895
14 18912.6777 19965.4686
15 4774.8318 18912.6777
16 11553.1190 4774.8318
17 41166.3399 11553.1190
18 -37762.8993 41166.3399
19 -36267.7151 -37762.8993
20 -17512.1763 -36267.7151
21 152696.6481 -17512.1763
22 13220.2531 152696.6481
23 -74329.1129 13220.2531
24 -85727.9330 -74329.1129
25 -8250.2303 -85727.9330
26 28018.5952 -8250.2303
27 9069.7507 28018.5952
28 217.3237 9069.7507
29 -13117.4914 217.3237
30 -3220.6166 -13117.4914
31 -1173.7921 -3220.6166
32 15456.8584 -1173.7921
33 -43497.7124 15456.8584
34 67947.3750 -43497.7124
35 38619.3929 67947.3750
36 122480.6853 38619.3929
37 13621.1840 122480.6853
38 19725.8239 13621.1840
39 64533.5931 19725.8239
40 66423.1232 64533.5931
41 -17011.3507 66423.1232
42 -12125.0584 -17011.3507
43 -17678.8795 -12125.0584
44 -39306.6276 -17678.8795
45 -35353.4476 -39306.6276
46 -23096.0084 -35353.4476
47 -33822.7374 -23096.0084
48 7947.3481 -33822.7374
49 -42731.8663 7947.3481
50 510.8892 -42731.8663
51 -7765.5228 510.8892
52 114995.3362 -7765.5228
53 -12699.1710 114995.3362
54 5722.0874 -12699.1710
55 21927.0102 5722.0874
56 -8422.0959 21927.0102
57 -6129.1172 -8422.0959
58 9211.9991 -6129.1172
59 29741.6619 9211.9991
60 47449.0446 29741.6619
61 -4656.7798 47449.0446
62 15386.9592 -4656.7798
63 47690.1511 15386.9592
64 52578.5653 47690.1511
65 13742.0389 52578.5653
66 -25766.9419 13742.0389
67 -7585.6346 -25766.9419
68 -37824.7539 -7585.6346
69 -93041.0653 -37824.7539
70 -14066.4736 -93041.0653
71 -16930.0163 -14066.4736
72 10454.9370 -16930.0163
73 -10219.7144 10454.9370
74 -73163.4053 -10219.7144
75 37239.3037 -73163.4053
76 55228.2536 37239.3037
77 -35176.4923 55228.2536
78 -62582.3831 -35176.4923
79 -16382.2294 -62582.3831
80 -6266.1939 -16382.2294
81 83661.7866 -6266.1939
82 35965.8058 83661.7866
83 -20943.4334 35965.8058
84 -18895.6302 -20943.4334
85 -7944.5606 -18895.6302
86 -43587.2497 -7944.5606
87 60804.7991 -43587.2497
88 31222.8701 60804.7991
89 -123090.3583 31222.8701
90 37681.4472 -123090.3583
91 -64305.5694 37681.4472
92 15083.8506 -64305.5694
93 11321.5678 15083.8506
94 57847.1966 11321.5678
95 -16991.7486 57847.1966
96 -15965.8394 -16991.7486
97 -27581.1525 -15965.8394
98 -17478.5672 -27581.1525
99 58215.8456 -17478.5672
100 -1579.2236 58215.8456
101 -18113.0271 -1579.2236
102 10015.5759 -18113.0271
103 -37329.2381 10015.5759
104 767.4544 -37329.2381
105 -24799.1904 767.4544
106 -27749.0515 -24799.1904
107 -29426.1637 -27749.0515
108 -40074.2719 -29426.1637
109 -107478.7232 -40074.2719
110 57318.3918 -107478.7232
111 -28509.0873 57318.3918
112 -3419.0763 -28509.0873
113 -57385.7543 -3419.0763
114 -5088.2513 -57385.7543
115 -56218.5197 -5088.2513
116 89229.1751 -56218.5197
117 7309.4633 89229.1751
118 50688.2522 7309.4633
119 -21067.7027 50688.2522
120 8202.6428 -21067.7027
121 -10610.3054 8202.6428
122 -32976.4359 -10610.3054
123 -17565.8701 -32976.4359
124 -19991.4755 -17565.8701
125 -22577.8951 -19991.4755
126 25692.4777 -22577.8951
127 313.5976 25692.4777
128 42464.4751 313.5976
129 -24476.6313 42464.4751
130 31707.1605 -24476.6313
131 583.8856 31707.1605
132 -34834.6210 583.8856
133 34869.1824 -34834.6210
134 96549.4858 34869.1824
135 -43747.3037 96549.4858
136 54288.7122 -43747.3037
137 -13000.4825 54288.7122
138 -6680.0636 -13000.4825
139 -33750.8148 -6680.0636
140 25848.2421 -33750.8148
141 82934.3404 25848.2421
142 -28898.5481 82934.3404
143 62563.1032 -28898.5481
144 5712.6025 62563.1032
145 -186376.7754 5712.6025
146 -8616.3194 -186376.7754
147 -43848.5197 -8616.3194
148 201.6774 -43848.5197
149 38176.3036 201.6774
150 38578.0275 38176.3036
151 -9365.5299 38578.0275
152 12614.2106 -9365.5299
153 5245.5933 12614.2106
154 -39944.5783 5245.5933
155 22111.6464 -39944.5783
156 NA 22111.6464
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -38345.2493 10179.5294
[2,] -458.7260 -38345.2493
[3,] -63338.7511 -458.7260
[4,] 900.2549 -63338.7511
[5,] -30758.6607 900.2549
[6,] 152059.4945 -30758.6607
[7,] -27569.3087 152059.4945
[8,] -2285.0713 -27569.3087
[9,] 6042.1764 -2285.0713
[10,] 37887.5528 6042.1764
[11,] -38810.1235 37887.5528
[12,] -6575.3895 -38810.1235
[13,] 19965.4686 -6575.3895
[14,] 18912.6777 19965.4686
[15,] 4774.8318 18912.6777
[16,] 11553.1190 4774.8318
[17,] 41166.3399 11553.1190
[18,] -37762.8993 41166.3399
[19,] -36267.7151 -37762.8993
[20,] -17512.1763 -36267.7151
[21,] 152696.6481 -17512.1763
[22,] 13220.2531 152696.6481
[23,] -74329.1129 13220.2531
[24,] -85727.9330 -74329.1129
[25,] -8250.2303 -85727.9330
[26,] 28018.5952 -8250.2303
[27,] 9069.7507 28018.5952
[28,] 217.3237 9069.7507
[29,] -13117.4914 217.3237
[30,] -3220.6166 -13117.4914
[31,] -1173.7921 -3220.6166
[32,] 15456.8584 -1173.7921
[33,] -43497.7124 15456.8584
[34,] 67947.3750 -43497.7124
[35,] 38619.3929 67947.3750
[36,] 122480.6853 38619.3929
[37,] 13621.1840 122480.6853
[38,] 19725.8239 13621.1840
[39,] 64533.5931 19725.8239
[40,] 66423.1232 64533.5931
[41,] -17011.3507 66423.1232
[42,] -12125.0584 -17011.3507
[43,] -17678.8795 -12125.0584
[44,] -39306.6276 -17678.8795
[45,] -35353.4476 -39306.6276
[46,] -23096.0084 -35353.4476
[47,] -33822.7374 -23096.0084
[48,] 7947.3481 -33822.7374
[49,] -42731.8663 7947.3481
[50,] 510.8892 -42731.8663
[51,] -7765.5228 510.8892
[52,] 114995.3362 -7765.5228
[53,] -12699.1710 114995.3362
[54,] 5722.0874 -12699.1710
[55,] 21927.0102 5722.0874
[56,] -8422.0959 21927.0102
[57,] -6129.1172 -8422.0959
[58,] 9211.9991 -6129.1172
[59,] 29741.6619 9211.9991
[60,] 47449.0446 29741.6619
[61,] -4656.7798 47449.0446
[62,] 15386.9592 -4656.7798
[63,] 47690.1511 15386.9592
[64,] 52578.5653 47690.1511
[65,] 13742.0389 52578.5653
[66,] -25766.9419 13742.0389
[67,] -7585.6346 -25766.9419
[68,] -37824.7539 -7585.6346
[69,] -93041.0653 -37824.7539
[70,] -14066.4736 -93041.0653
[71,] -16930.0163 -14066.4736
[72,] 10454.9370 -16930.0163
[73,] -10219.7144 10454.9370
[74,] -73163.4053 -10219.7144
[75,] 37239.3037 -73163.4053
[76,] 55228.2536 37239.3037
[77,] -35176.4923 55228.2536
[78,] -62582.3831 -35176.4923
[79,] -16382.2294 -62582.3831
[80,] -6266.1939 -16382.2294
[81,] 83661.7866 -6266.1939
[82,] 35965.8058 83661.7866
[83,] -20943.4334 35965.8058
[84,] -18895.6302 -20943.4334
[85,] -7944.5606 -18895.6302
[86,] -43587.2497 -7944.5606
[87,] 60804.7991 -43587.2497
[88,] 31222.8701 60804.7991
[89,] -123090.3583 31222.8701
[90,] 37681.4472 -123090.3583
[91,] -64305.5694 37681.4472
[92,] 15083.8506 -64305.5694
[93,] 11321.5678 15083.8506
[94,] 57847.1966 11321.5678
[95,] -16991.7486 57847.1966
[96,] -15965.8394 -16991.7486
[97,] -27581.1525 -15965.8394
[98,] -17478.5672 -27581.1525
[99,] 58215.8456 -17478.5672
[100,] -1579.2236 58215.8456
[101,] -18113.0271 -1579.2236
[102,] 10015.5759 -18113.0271
[103,] -37329.2381 10015.5759
[104,] 767.4544 -37329.2381
[105,] -24799.1904 767.4544
[106,] -27749.0515 -24799.1904
[107,] -29426.1637 -27749.0515
[108,] -40074.2719 -29426.1637
[109,] -107478.7232 -40074.2719
[110,] 57318.3918 -107478.7232
[111,] -28509.0873 57318.3918
[112,] -3419.0763 -28509.0873
[113,] -57385.7543 -3419.0763
[114,] -5088.2513 -57385.7543
[115,] -56218.5197 -5088.2513
[116,] 89229.1751 -56218.5197
[117,] 7309.4633 89229.1751
[118,] 50688.2522 7309.4633
[119,] -21067.7027 50688.2522
[120,] 8202.6428 -21067.7027
[121,] -10610.3054 8202.6428
[122,] -32976.4359 -10610.3054
[123,] -17565.8701 -32976.4359
[124,] -19991.4755 -17565.8701
[125,] -22577.8951 -19991.4755
[126,] 25692.4777 -22577.8951
[127,] 313.5976 25692.4777
[128,] 42464.4751 313.5976
[129,] -24476.6313 42464.4751
[130,] 31707.1605 -24476.6313
[131,] 583.8856 31707.1605
[132,] -34834.6210 583.8856
[133,] 34869.1824 -34834.6210
[134,] 96549.4858 34869.1824
[135,] -43747.3037 96549.4858
[136,] 54288.7122 -43747.3037
[137,] -13000.4825 54288.7122
[138,] -6680.0636 -13000.4825
[139,] -33750.8148 -6680.0636
[140,] 25848.2421 -33750.8148
[141,] 82934.3404 25848.2421
[142,] -28898.5481 82934.3404
[143,] 62563.1032 -28898.5481
[144,] 5712.6025 62563.1032
[145,] -186376.7754 5712.6025
[146,] -8616.3194 -186376.7754
[147,] -43848.5197 -8616.3194
[148,] 201.6774 -43848.5197
[149,] 38176.3036 201.6774
[150,] 38578.0275 38176.3036
[151,] -9365.5299 38578.0275
[152,] 12614.2106 -9365.5299
[153,] 5245.5933 12614.2106
[154,] -39944.5783 5245.5933
[155,] 22111.6464 -39944.5783
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -38345.2493 10179.5294
2 -458.7260 -38345.2493
3 -63338.7511 -458.7260
4 900.2549 -63338.7511
5 -30758.6607 900.2549
6 152059.4945 -30758.6607
7 -27569.3087 152059.4945
8 -2285.0713 -27569.3087
9 6042.1764 -2285.0713
10 37887.5528 6042.1764
11 -38810.1235 37887.5528
12 -6575.3895 -38810.1235
13 19965.4686 -6575.3895
14 18912.6777 19965.4686
15 4774.8318 18912.6777
16 11553.1190 4774.8318
17 41166.3399 11553.1190
18 -37762.8993 41166.3399
19 -36267.7151 -37762.8993
20 -17512.1763 -36267.7151
21 152696.6481 -17512.1763
22 13220.2531 152696.6481
23 -74329.1129 13220.2531
24 -85727.9330 -74329.1129
25 -8250.2303 -85727.9330
26 28018.5952 -8250.2303
27 9069.7507 28018.5952
28 217.3237 9069.7507
29 -13117.4914 217.3237
30 -3220.6166 -13117.4914
31 -1173.7921 -3220.6166
32 15456.8584 -1173.7921
33 -43497.7124 15456.8584
34 67947.3750 -43497.7124
35 38619.3929 67947.3750
36 122480.6853 38619.3929
37 13621.1840 122480.6853
38 19725.8239 13621.1840
39 64533.5931 19725.8239
40 66423.1232 64533.5931
41 -17011.3507 66423.1232
42 -12125.0584 -17011.3507
43 -17678.8795 -12125.0584
44 -39306.6276 -17678.8795
45 -35353.4476 -39306.6276
46 -23096.0084 -35353.4476
47 -33822.7374 -23096.0084
48 7947.3481 -33822.7374
49 -42731.8663 7947.3481
50 510.8892 -42731.8663
51 -7765.5228 510.8892
52 114995.3362 -7765.5228
53 -12699.1710 114995.3362
54 5722.0874 -12699.1710
55 21927.0102 5722.0874
56 -8422.0959 21927.0102
57 -6129.1172 -8422.0959
58 9211.9991 -6129.1172
59 29741.6619 9211.9991
60 47449.0446 29741.6619
61 -4656.7798 47449.0446
62 15386.9592 -4656.7798
63 47690.1511 15386.9592
64 52578.5653 47690.1511
65 13742.0389 52578.5653
66 -25766.9419 13742.0389
67 -7585.6346 -25766.9419
68 -37824.7539 -7585.6346
69 -93041.0653 -37824.7539
70 -14066.4736 -93041.0653
71 -16930.0163 -14066.4736
72 10454.9370 -16930.0163
73 -10219.7144 10454.9370
74 -73163.4053 -10219.7144
75 37239.3037 -73163.4053
76 55228.2536 37239.3037
77 -35176.4923 55228.2536
78 -62582.3831 -35176.4923
79 -16382.2294 -62582.3831
80 -6266.1939 -16382.2294
81 83661.7866 -6266.1939
82 35965.8058 83661.7866
83 -20943.4334 35965.8058
84 -18895.6302 -20943.4334
85 -7944.5606 -18895.6302
86 -43587.2497 -7944.5606
87 60804.7991 -43587.2497
88 31222.8701 60804.7991
89 -123090.3583 31222.8701
90 37681.4472 -123090.3583
91 -64305.5694 37681.4472
92 15083.8506 -64305.5694
93 11321.5678 15083.8506
94 57847.1966 11321.5678
95 -16991.7486 57847.1966
96 -15965.8394 -16991.7486
97 -27581.1525 -15965.8394
98 -17478.5672 -27581.1525
99 58215.8456 -17478.5672
100 -1579.2236 58215.8456
101 -18113.0271 -1579.2236
102 10015.5759 -18113.0271
103 -37329.2381 10015.5759
104 767.4544 -37329.2381
105 -24799.1904 767.4544
106 -27749.0515 -24799.1904
107 -29426.1637 -27749.0515
108 -40074.2719 -29426.1637
109 -107478.7232 -40074.2719
110 57318.3918 -107478.7232
111 -28509.0873 57318.3918
112 -3419.0763 -28509.0873
113 -57385.7543 -3419.0763
114 -5088.2513 -57385.7543
115 -56218.5197 -5088.2513
116 89229.1751 -56218.5197
117 7309.4633 89229.1751
118 50688.2522 7309.4633
119 -21067.7027 50688.2522
120 8202.6428 -21067.7027
121 -10610.3054 8202.6428
122 -32976.4359 -10610.3054
123 -17565.8701 -32976.4359
124 -19991.4755 -17565.8701
125 -22577.8951 -19991.4755
126 25692.4777 -22577.8951
127 313.5976 25692.4777
128 42464.4751 313.5976
129 -24476.6313 42464.4751
130 31707.1605 -24476.6313
131 583.8856 31707.1605
132 -34834.6210 583.8856
133 34869.1824 -34834.6210
134 96549.4858 34869.1824
135 -43747.3037 96549.4858
136 54288.7122 -43747.3037
137 -13000.4825 54288.7122
138 -6680.0636 -13000.4825
139 -33750.8148 -6680.0636
140 25848.2421 -33750.8148
141 82934.3404 25848.2421
142 -28898.5481 82934.3404
143 62563.1032 -28898.5481
144 5712.6025 62563.1032
145 -186376.7754 5712.6025
146 -8616.3194 -186376.7754
147 -43848.5197 -8616.3194
148 201.6774 -43848.5197
149 38176.3036 201.6774
150 38578.0275 38176.3036
151 -9365.5299 38578.0275
152 12614.2106 -9365.5299
153 5245.5933 12614.2106
154 -39944.5783 5245.5933
155 22111.6464 -39944.5783
> 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/7vzx21324044449.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/864541324044449.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/9g33y1324044449.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/100ig91324044449.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/11gdnp1324044449.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/120qn71324044449.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/13d6mk1324044449.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/140efw1324044449.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/15edyk1324044449.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/16h4px1324044449.tab")
+ }
>
> try(system("convert tmp/1ycxy1324044449.ps tmp/1ycxy1324044449.png",intern=TRUE))
character(0)
> try(system("convert tmp/2ixeh1324044449.ps tmp/2ixeh1324044449.png",intern=TRUE))
character(0)
> try(system("convert tmp/38xwd1324044449.ps tmp/38xwd1324044449.png",intern=TRUE))
character(0)
> try(system("convert tmp/49n3y1324044449.ps tmp/49n3y1324044449.png",intern=TRUE))
character(0)
> try(system("convert tmp/56njf1324044449.ps tmp/56njf1324044449.png",intern=TRUE))
character(0)
> try(system("convert tmp/66trv1324044449.ps tmp/66trv1324044449.png",intern=TRUE))
character(0)
> try(system("convert tmp/7vzx21324044449.ps tmp/7vzx21324044449.png",intern=TRUE))
character(0)
> try(system("convert tmp/864541324044449.ps tmp/864541324044449.png",intern=TRUE))
character(0)
> try(system("convert tmp/9g33y1324044449.ps tmp/9g33y1324044449.png",intern=TRUE))
character(0)
> try(system("convert tmp/100ig91324044449.ps tmp/100ig91324044449.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.677 0.599 5.330