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(97
+ ,197426
+ ,39
+ ,178377
+ ,490
+ ,146
+ ,187326
+ ,173
+ ,250931
+ ,2563
+ ,116
+ ,184923
+ ,165
+ ,226168
+ ,1538
+ ,113
+ ,183500
+ ,181
+ ,211381
+ ,898
+ ,75
+ ,176225
+ ,139
+ ,214738
+ ,1212
+ ,228
+ ,169707
+ ,166
+ ,210012
+ ,790
+ ,138
+ ,169265
+ ,116
+ ,163073
+ ,738
+ ,153
+ ,167949
+ ,114
+ ,164263
+ ,845
+ ,248
+ ,165986
+ ,155
+ ,189944
+ ,1369
+ ,161
+ ,165933
+ ,127
+ ,147581
+ ,1830
+ ,155
+ ,165904
+ ,107
+ ,127667
+ ,711
+ ,142
+ ,160902
+ ,126
+ ,106330
+ ,992
+ ,145
+ ,160141
+ ,161
+ ,175721
+ ,1272
+ ,159
+ ,156349
+ ,185
+ ,169216
+ ,852
+ ,153
+ ,154771
+ ,63
+ ,18284
+ ,575
+ ,130
+ ,154451
+ ,121
+ ,134969
+ ,1101
+ ,177
+ ,151911
+ ,150
+ ,191889
+ ,1410
+ ,181
+ ,151715
+ ,160
+ ,197765
+ ,1352
+ ,140
+ ,150491
+ ,132
+ ,194679
+ ,1208
+ ,196
+ ,150047
+ ,147
+ ,75767
+ ,739
+ ,140
+ ,149959
+ ,176
+ ,195894
+ ,926
+ ,175
+ ,149695
+ ,88
+ ,191179
+ ,865
+ ,155
+ ,147172
+ ,82
+ ,178303
+ ,677
+ ,147
+ ,146975
+ ,75
+ ,135599
+ ,971
+ ,177
+ ,146760
+ ,128
+ ,195791
+ ,1574
+ ,159
+ ,144551
+ ,165
+ ,81716
+ ,1051
+ ,132
+ ,144408
+ ,88
+ ,115466
+ ,763
+ ,94
+ ,144244
+ ,62
+ ,88229
+ ,724
+ ,140
+ ,143592
+ ,93
+ ,113963
+ ,652
+ ,130
+ ,140824
+ ,96
+ ,186099
+ ,504
+ ,176
+ ,140358
+ ,121
+ ,117495
+ ,893
+ ,153
+ ,140015
+ ,146
+ ,145758
+ ,1034
+ ,179
+ ,139165
+ ,143
+ ,184531
+ ,1111
+ ,197
+ ,136588
+ ,135
+ ,134163
+ ,692
+ ,163
+ ,135356
+ ,76
+ ,91502
+ ,740
+ ,170
+ ,134238
+ ,152
+ ,191469
+ ,1716
+ ,145
+ ,134047
+ ,163
+ ,231257
+ ,884
+ ,129
+ ,131072
+ ,154
+ ,114268
+ ,925
+ ,57
+ ,128692
+ ,48
+ ,100187
+ ,723
+ ,144
+ ,127654
+ ,168
+ ,105590
+ ,732
+ ,92
+ ,126817
+ ,143
+ ,94333
+ ,637
+ ,144
+ ,126372
+ ,156
+ ,165278
+ ,1266
+ ,95
+ ,125818
+ ,103
+ ,111669
+ ,527
+ ,126
+ ,125386
+ ,128
+ ,134218
+ ,811
+ ,97
+ ,125081
+ ,121
+ ,135213
+ ,1390
+ ,144
+ ,124089
+ ,96
+ ,130332
+ ,1613
+ ,137
+ ,123534
+ ,76
+ ,100922
+ ,459
+ ,155
+ ,120192
+ ,161
+ ,197680
+ ,1118
+ ,163
+ ,119442
+ ,141
+ ,189723
+ ,1293
+ ,227
+ ,118906
+ ,103
+ ,102509
+ ,636
+ ,187
+ ,117440
+ ,137
+ ,157384
+ ,1031
+ ,148
+ ,116066
+ ,55
+ ,24469
+ ,524
+ ,208
+ ,114948
+ ,176
+ ,165354
+ ,1775
+ ,136
+ ,114799
+ ,66
+ ,153242
+ ,669
+ ,134
+ ,114360
+ ,101
+ ,79367
+ ,2089
+ ,149
+ ,113344
+ ,155
+ ,230054
+ ,1230
+ ,160
+ ,112431
+ ,123
+ ,140303
+ ,847
+ ,187
+ ,112302
+ ,145
+ ,198299
+ ,906
+ ,146
+ ,112098
+ ,134
+ ,106194
+ ,1154
+ ,102
+ ,110529
+ ,164
+ ,232241
+ ,1251
+ ,143
+ ,110459
+ ,75
+ ,113854
+ ,510
+ ,115
+ ,109432
+ ,148
+ ,116938
+ ,698
+ ,151
+ ,108535
+ ,85
+ ,118845
+ ,1586
+ ,144
+ ,108146
+ ,140
+ ,100125
+ ,1001
+ ,118
+ ,105079
+ ,70
+ ,99776
+ ,710
+ ,98
+ ,104978
+ ,117
+ ,139292
+ ,906
+ ,142
+ ,104767
+ ,103
+ ,124527
+ ,1030
+ ,151
+ ,104581
+ ,116
+ ,116136
+ ,1092
+ ,171
+ ,104128
+ ,50
+ ,122975
+ ,511
+ ,156
+ ,103925
+ ,152
+ ,164808
+ ,1319
+ ,171
+ ,103297
+ ,139
+ ,101345
+ ,1186
+ ,142
+ ,103129
+ ,114
+ ,158376
+ ,1201
+ ,148
+ ,103037
+ ,110
+ ,150773
+ ,1443
+ ,96
+ ,102812
+ ,120
+ ,136323
+ ,703
+ ,151
+ ,102153
+ ,98
+ ,80716
+ ,862
+ ,173
+ ,102070
+ ,94
+ ,86480
+ ,1031
+ ,151
+ ,101629
+ ,112
+ ,188355
+ ,1348
+ ,77
+ ,101382
+ ,81
+ ,127097
+ ,866
+ ,135
+ ,101047
+ ,169
+ ,135848
+ ,1079
+ ,71
+ ,100350
+ ,62
+ ,75882
+ ,695
+ ,133
+ ,100087
+ ,102
+ ,129711
+ ,1229
+ ,139
+ ,100046
+ ,133
+ ,128602
+ ,1288
+ ,201
+ ,96125
+ ,107
+ ,106314
+ ,764
+ ,141
+ ,95893
+ ,90
+ ,81180
+ ,919
+ ,158
+ ,95676
+ ,99
+ ,160792
+ ,691
+ ,126
+ ,93879
+ ,152
+ ,170492
+ ,1099
+ ,119
+ ,93487
+ ,84
+ ,133252
+ ,766
+ ,65
+ ,93473
+ ,57
+ ,121850
+ ,1150
+ ,128
+ ,92622
+ ,126
+ ,134097
+ ,1566
+ ,147
+ ,92280
+ ,118
+ ,147341
+ ,668
+ ,90
+ ,92059
+ ,101
+ ,91313
+ ,910
+ ,169
+ ,89626
+ ,85
+ ,134904
+ ,894
+ ,150
+ ,89506
+ ,118
+ ,160501
+ ,1351
+ ,156
+ ,89256
+ ,129
+ ,104864
+ ,1187
+ ,179
+ ,88977
+ ,85
+ ,111563
+ ,784
+ ,149
+ ,86652
+ ,50
+ ,114198
+ ,758
+ ,94
+ ,84601
+ ,85
+ ,105406
+ ,816
+ ,154
+ ,83515
+ ,158
+ ,96785
+ ,1370
+ ,103
+ ,83248
+ ,146
+ ,106020
+ ,785
+ ,148
+ ,83243
+ ,150
+ ,153990
+ ,763
+ ,84
+ ,82317
+ ,77
+ ,111848
+ ,569
+ ,144
+ ,81897
+ ,131
+ ,89770
+ ,781
+ ,203
+ ,81625
+ ,132
+ ,94853
+ ,743
+ ,160
+ ,81351
+ ,107
+ ,102204
+ ,900
+ ,152
+ ,79756
+ ,80
+ ,122531
+ ,575
+ ,147
+ ,79089
+ ,114
+ ,169351
+ ,981
+ ,111
+ ,79011
+ ,97
+ ,80238
+ ,784
+ ,89
+ ,76173
+ ,8
+ ,47552
+ ,179
+ ,87
+ ,72128
+ ,163
+ ,145707
+ ,542
+ ,121
+ ,71571
+ ,102
+ ,75881
+ ,746
+ ,146
+ ,71154
+ ,137
+ ,80906
+ ,767
+ ,100
+ ,70168
+ ,79
+ ,104470
+ ,695
+ ,127
+ ,69867
+ ,83
+ ,100826
+ ,1186
+ ,153
+ ,69652
+ ,56
+ ,33750
+ ,456
+ ,87
+ ,69446
+ ,87
+ ,113713
+ ,724
+ ,129
+ ,68946
+ ,164
+ ,174586
+ ,1145
+ ,113
+ ,68788
+ ,57
+ ,72591
+ ,785
+ ,124
+ ,67150
+ ,110
+ ,114651
+ ,905
+ ,92
+ ,66485
+ ,104
+ ,110896
+ ,661
+ ,112
+ ,66089
+ ,65
+ ,61394
+ ,507
+ ,102
+ ,65594
+ ,48
+ ,92795
+ ,632
+ ,115
+ ,64593
+ ,60
+ ,72558
+ ,790
+ ,148
+ ,64520
+ ,68
+ ,54518
+ ,488
+ ,135
+ ,59938
+ ,149
+ ,82390
+ ,1128
+ ,97
+ ,59900
+ ,104
+ ,96252
+ ,1257
+ ,59
+ ,57224
+ ,86
+ ,80684
+ ,800
+ ,101
+ ,56750
+ ,89
+ ,115750
+ ,846
+ ,27
+ ,56622
+ ,49
+ ,55792
+ ,437
+ ,112
+ ,55918
+ ,74
+ ,83963
+ ,795
+ ,89
+ ,52789
+ ,37
+ ,15673
+ ,309
+ ,40
+ ,48029
+ ,120
+ ,88634
+ ,833
+ ,130
+ ,45724
+ ,87
+ ,74151
+ ,641
+ ,73
+ ,43929
+ ,83
+ ,100792
+ ,415
+ ,64
+ ,43750
+ ,13
+ ,19630
+ ,214
+ ,99
+ ,38692
+ ,30
+ ,68580
+ ,657
+ ,78
+ ,37238
+ ,41
+ ,10901
+ ,716
+ ,110
+ ,37110
+ ,67
+ ,64057
+ ,665)
+ ,dim=c(5
+ ,137)
+ ,dimnames=list(c('FbackMess'
+ ,'CompendiumCharacters'
+ ,'BloggedComputations'
+ ,'CompendiumSeconds'
+ ,'CourseViews')
+ ,1:137))
> y <- array(NA,dim=c(5,137),dimnames=list(c('FbackMess','CompendiumCharacters','BloggedComputations','CompendiumSeconds','CourseViews'),1:137))
> 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'
> #'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
CompendiumCharacters FbackMess BloggedComputations CompendiumSeconds
1 197426 97 39 178377
2 187326 146 173 250931
3 184923 116 165 226168
4 183500 113 181 211381
5 176225 75 139 214738
6 169707 228 166 210012
7 169265 138 116 163073
8 167949 153 114 164263
9 165986 248 155 189944
10 165933 161 127 147581
11 165904 155 107 127667
12 160902 142 126 106330
13 160141 145 161 175721
14 156349 159 185 169216
15 154771 153 63 18284
16 154451 130 121 134969
17 151911 177 150 191889
18 151715 181 160 197765
19 150491 140 132 194679
20 150047 196 147 75767
21 149959 140 176 195894
22 149695 175 88 191179
23 147172 155 82 178303
24 146975 147 75 135599
25 146760 177 128 195791
26 144551 159 165 81716
27 144408 132 88 115466
28 144244 94 62 88229
29 143592 140 93 113963
30 140824 130 96 186099
31 140358 176 121 117495
32 140015 153 146 145758
33 139165 179 143 184531
34 136588 197 135 134163
35 135356 163 76 91502
36 134238 170 152 191469
37 134047 145 163 231257
38 131072 129 154 114268
39 128692 57 48 100187
40 127654 144 168 105590
41 126817 92 143 94333
42 126372 144 156 165278
43 125818 95 103 111669
44 125386 126 128 134218
45 125081 97 121 135213
46 124089 144 96 130332
47 123534 137 76 100922
48 120192 155 161 197680
49 119442 163 141 189723
50 118906 227 103 102509
51 117440 187 137 157384
52 116066 148 55 24469
53 114948 208 176 165354
54 114799 136 66 153242
55 114360 134 101 79367
56 113344 149 155 230054
57 112431 160 123 140303
58 112302 187 145 198299
59 112098 146 134 106194
60 110529 102 164 232241
61 110459 143 75 113854
62 109432 115 148 116938
63 108535 151 85 118845
64 108146 144 140 100125
65 105079 118 70 99776
66 104978 98 117 139292
67 104767 142 103 124527
68 104581 151 116 116136
69 104128 171 50 122975
70 103925 156 152 164808
71 103297 171 139 101345
72 103129 142 114 158376
73 103037 148 110 150773
74 102812 96 120 136323
75 102153 151 98 80716
76 102070 173 94 86480
77 101629 151 112 188355
78 101382 77 81 127097
79 101047 135 169 135848
80 100350 71 62 75882
81 100087 133 102 129711
82 100046 139 133 128602
83 96125 201 107 106314
84 95893 141 90 81180
85 95676 158 99 160792
86 93879 126 152 170492
87 93487 119 84 133252
88 93473 65 57 121850
89 92622 128 126 134097
90 92280 147 118 147341
91 92059 90 101 91313
92 89626 169 85 134904
93 89506 150 118 160501
94 89256 156 129 104864
95 88977 179 85 111563
96 86652 149 50 114198
97 84601 94 85 105406
98 83515 154 158 96785
99 83248 103 146 106020
100 83243 148 150 153990
101 82317 84 77 111848
102 81897 144 131 89770
103 81625 203 132 94853
104 81351 160 107 102204
105 79756 152 80 122531
106 79089 147 114 169351
107 79011 111 97 80238
108 76173 89 8 47552
109 72128 87 163 145707
110 71571 121 102 75881
111 71154 146 137 80906
112 70168 100 79 104470
113 69867 127 83 100826
114 69652 153 56 33750
115 69446 87 87 113713
116 68946 129 164 174586
117 68788 113 57 72591
118 67150 124 110 114651
119 66485 92 104 110896
120 66089 112 65 61394
121 65594 102 48 92795
122 64593 115 60 72558
123 64520 148 68 54518
124 59938 135 149 82390
125 59900 97 104 96252
126 57224 59 86 80684
127 56750 101 89 115750
128 56622 27 49 55792
129 55918 112 74 83963
130 52789 89 37 15673
131 48029 40 120 88634
132 45724 130 87 74151
133 43929 73 83 100792
134 43750 64 13 19630
135 38692 99 30 68580
136 37238 78 41 10901
137 37110 110 67 64057
CourseViews
1 490
2 2563
3 1538
4 898
5 1212
6 790
7 738
8 845
9 1369
10 1830
11 711
12 992
13 1272
14 852
15 575
16 1101
17 1410
18 1352
19 1208
20 739
21 926
22 865
23 677
24 971
25 1574
26 1051
27 763
28 724
29 652
30 504
31 893
32 1034
33 1111
34 692
35 740
36 1716
37 884
38 925
39 723
40 732
41 637
42 1266
43 527
44 811
45 1390
46 1613
47 459
48 1118
49 1293
50 636
51 1031
52 524
53 1775
54 669
55 2089
56 1230
57 847
58 906
59 1154
60 1251
61 510
62 698
63 1586
64 1001
65 710
66 906
67 1030
68 1092
69 511
70 1319
71 1186
72 1201
73 1443
74 703
75 862
76 1031
77 1348
78 866
79 1079
80 695
81 1229
82 1288
83 764
84 919
85 691
86 1099
87 766
88 1150
89 1566
90 668
91 910
92 894
93 1351
94 1187
95 784
96 758
97 816
98 1370
99 785
100 763
101 569
102 781
103 743
104 900
105 575
106 981
107 784
108 179
109 542
110 746
111 767
112 695
113 1186
114 456
115 724
116 1145
117 785
118 905
119 661
120 507
121 632
122 790
123 488
124 1128
125 1257
126 800
127 846
128 437
129 795
130 309
131 833
132 641
133 415
134 214
135 657
136 716
137 665
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) FbackMess BloggedComputations
28472.4263 228.0500 6.4417
CompendiumSeconds CourseViews
0.3824 -0.1902
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-56549 -21437 -3598 15022 84118
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.847e+04 1.015e+04 2.805 0.00579 **
FbackMess 2.281e+02 7.216e+01 3.160 0.00195 **
BloggedComputations 6.442e+00 8.814e+01 0.073 0.94185
CompendiumSeconds 3.824e-01 6.703e-02 5.705 7.3e-08 ***
CourseViews -1.902e-01 8.263e+00 -0.023 0.98167
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 28570 on 132 degrees of freedom
Multiple R-squared: 0.4052, Adjusted R-squared: 0.3872
F-statistic: 22.48 on 4 and 132 DF, p-value: 3.56e-14
> 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,] 3.741751e-02 7.483502e-02 9.625825e-01
[2,] 9.439405e-03 1.887881e-02 9.905606e-01
[3,] 2.907624e-03 5.815249e-03 9.970924e-01
[4,] 8.157599e-04 1.631520e-03 9.991842e-01
[5,] 2.587600e-04 5.175199e-04 9.997412e-01
[6,] 1.436599e-04 2.873197e-04 9.998563e-01
[7,] 4.076681e-05 8.153361e-05 9.999592e-01
[8,] 2.450989e-05 4.901977e-05 9.999755e-01
[9,] 3.660691e-05 7.321382e-05 9.999634e-01
[10,] 1.555312e-04 3.110624e-04 9.998445e-01
[11,] 2.240164e-04 4.480329e-04 9.997760e-01
[12,] 9.764377e-04 1.952875e-03 9.990236e-01
[13,] 5.995680e-04 1.199136e-03 9.994004e-01
[14,] 6.036119e-04 1.207224e-03 9.993964e-01
[15,] 1.536475e-03 3.072950e-03 9.984635e-01
[16,] 2.454689e-03 4.909379e-03 9.975453e-01
[17,] 2.823940e-03 5.647880e-03 9.971761e-01
[18,] 2.820202e-03 5.640404e-03 9.971798e-01
[19,] 2.297931e-03 4.595862e-03 9.977021e-01
[20,] 2.749611e-03 5.499221e-03 9.972504e-01
[21,] 4.403150e-03 8.806299e-03 9.955969e-01
[22,] 4.734040e-03 9.468080e-03 9.952660e-01
[23,] 8.028276e-03 1.605655e-02 9.919717e-01
[24,] 7.370055e-03 1.474011e-02 9.926299e-01
[25,] 8.647283e-03 1.729457e-02 9.913527e-01
[26,] 9.878896e-03 1.975779e-02 9.901211e-01
[27,] 8.478786e-03 1.695757e-02 9.915212e-01
[28,] 9.532893e-03 1.906579e-02 9.904671e-01
[29,] 1.614816e-02 3.229631e-02 9.838518e-01
[30,] 3.049730e-02 6.099461e-02 9.695027e-01
[31,] 4.293285e-02 8.586569e-02 9.570672e-01
[32,] 1.069135e-01 2.138271e-01 8.930865e-01
[33,] 1.244450e-01 2.488900e-01 8.755550e-01
[34,] 1.860428e-01 3.720855e-01 8.139572e-01
[35,] 2.396214e-01 4.792429e-01 7.603786e-01
[36,] 3.435996e-01 6.871991e-01 6.564004e-01
[37,] 4.222244e-01 8.444487e-01 5.777756e-01
[38,] 5.259123e-01 9.481755e-01 4.740877e-01
[39,] 5.889656e-01 8.220689e-01 4.110344e-01
[40,] 6.820847e-01 6.358307e-01 3.179153e-01
[41,] 7.669661e-01 4.660679e-01 2.330339e-01
[42,] 8.277071e-01 3.445857e-01 1.722929e-01
[43,] 8.336127e-01 3.327746e-01 1.663873e-01
[44,] 8.569308e-01 2.861385e-01 1.430692e-01
[45,] 9.215565e-01 1.568869e-01 7.844347e-02
[46,] 9.318889e-01 1.362221e-01 6.811106e-02
[47,] 9.580886e-01 8.382273e-02 4.191137e-02
[48,] 9.611623e-01 7.767539e-02 3.883769e-02
[49,] 9.798642e-01 4.027162e-02 2.013581e-02
[50,] 9.841602e-01 3.167967e-02 1.583984e-02
[51,] 9.879618e-01 2.407631e-02 1.203816e-02
[52,] 9.909057e-01 1.818865e-02 9.094327e-03
[53,] 9.949581e-01 1.008380e-02 5.041900e-03
[54,] 9.968621e-01 6.275777e-03 3.137888e-03
[55,] 9.984452e-01 3.109666e-03 1.554833e-03
[56,] 9.985504e-01 2.899118e-03 1.449559e-03
[57,] 9.990660e-01 1.867968e-03 9.339839e-04
[58,] 9.995238e-01 9.523803e-04 4.761901e-04
[59,] 9.997335e-01 5.329227e-04 2.664613e-04
[60,] 9.997883e-01 4.233443e-04 2.116722e-04
[61,] 9.998230e-01 3.540862e-04 1.770431e-04
[62,] 9.998534e-01 2.932334e-04 1.466167e-04
[63,] 9.998633e-01 2.734735e-04 1.367368e-04
[64,] 9.998709e-01 2.581563e-04 1.290782e-04
[65,] 9.998782e-01 2.435244e-04 1.217622e-04
[66,] 9.998692e-01 2.615705e-04 1.307852e-04
[67,] 9.999337e-01 1.325562e-04 6.627810e-05
[68,] 9.999596e-01 8.071595e-05 4.035797e-05
[69,] 9.999659e-01 6.813585e-05 3.406792e-05
[70,] 9.999673e-01 6.549318e-05 3.274659e-05
[71,] 9.999833e-01 3.334708e-05 1.667354e-05
[72,] 9.999873e-01 2.541717e-05 1.270858e-05
[73,] 9.999986e-01 2.727802e-06 1.363901e-06
[74,] 9.999987e-01 2.607508e-06 1.303754e-06
[75,] 9.999988e-01 2.306915e-06 1.153457e-06
[76,] 9.999986e-01 2.763954e-06 1.381977e-06
[77,] 9.999993e-01 1.396042e-06 6.980212e-07
[78,] 9.999992e-01 1.538636e-06 7.693178e-07
[79,] 9.999992e-01 1.616816e-06 8.084079e-07
[80,] 9.999993e-01 1.449574e-06 7.247870e-07
[81,] 9.999997e-01 5.651752e-07 2.825876e-07
[82,] 9.999997e-01 5.294418e-07 2.647209e-07
[83,] 9.999997e-01 6.200637e-07 3.100318e-07
[84,] 9.999999e-01 1.028934e-07 5.144669e-08
[85,] 9.999999e-01 1.523828e-07 7.619140e-08
[86,] 9.999999e-01 2.059381e-07 1.029690e-07
[87,] 9.999999e-01 2.030432e-07 1.015216e-07
[88,] 9.999998e-01 3.138383e-07 1.569192e-07
[89,] 9.999998e-01 3.755284e-07 1.877642e-07
[90,] 9.999999e-01 1.738290e-07 8.691451e-08
[91,] 9.999999e-01 1.668870e-07 8.344349e-08
[92,] 9.999999e-01 1.238438e-07 6.192190e-08
[93,] 9.999999e-01 1.956554e-07 9.782770e-08
[94,] 9.999999e-01 1.216815e-07 6.084075e-08
[95,] 9.999999e-01 1.524956e-07 7.624780e-08
[96,] 9.999998e-01 3.216963e-07 1.608482e-07
[97,] 9.999997e-01 5.033121e-07 2.516561e-07
[98,] 9.999995e-01 9.756386e-07 4.878193e-07
[99,] 9.999992e-01 1.694897e-06 8.474486e-07
[100,] 9.999994e-01 1.140230e-06 5.701152e-07
[101,] 9.999997e-01 5.417175e-07 2.708587e-07
[102,] 9.999995e-01 1.043726e-06 5.218630e-07
[103,] 9.999992e-01 1.618410e-06 8.092049e-07
[104,] 9.999984e-01 3.184726e-06 1.592363e-06
[105,] 9.999973e-01 5.442419e-06 2.721210e-06
[106,] 9.999948e-01 1.043634e-05 5.218170e-06
[107,] 9.999928e-01 1.447896e-05 7.239481e-06
[108,] 9.999877e-01 2.453062e-05 1.226531e-05
[109,] 9.999744e-01 5.115448e-05 2.557724e-05
[110,] 9.999669e-01 6.617825e-05 3.308913e-05
[111,] 9.999248e-01 1.504017e-04 7.520083e-05
[112,] 9.998488e-01 3.023037e-04 1.511519e-04
[113,] 9.997926e-01 4.148146e-04 2.074073e-04
[114,] 9.997108e-01 5.784835e-04 2.892417e-04
[115,] 9.996506e-01 6.987609e-04 3.493804e-04
[116,] 9.997361e-01 5.278481e-04 2.639241e-04
[117,] 9.993062e-01 1.387603e-03 6.938016e-04
[118,] 9.984059e-01 3.188234e-03 1.594117e-03
[119,] 9.960495e-01 7.901084e-03 3.950542e-03
[120,] 9.920920e-01 1.581603e-02 7.908017e-03
[121,] 9.846383e-01 3.072331e-02 1.536165e-02
[122,] 9.908038e-01 1.839234e-02 9.196168e-03
> postscript(file="/var/wessaorg/rcomp/tmp/1zmzp1324668538.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/2obhm1324668538.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/3sb2t1324668538.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/41n7l1324668538.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/553e01324668538.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 = 137
Frequency = 1
1 2 3 4 5 6
78459.93952 28970.62073 42735.50778 47426.67018 47864.07780 8007.52707
7 8 9 10 11 12
46352.59452 41194.00383 7580.91781 43836.75838 52707.51280 58760.90269
13 14 15 16 17 18
30607.11584 25875.55071 84118.32290 44147.34763 8993.67429 5562.92863
19 20 21 22 23 24
15022.10025 47095.66847 13688.37845 7801.00060 14765.91560 32825.16173
25 26 27 28 29 30
2523.39179 47705.91155 41254.84416 60332.76010 39135.89483 11014.73260
31 32 33 34 35 36
26206.86741 20166.48810 -1406.37465 11145.23363 34370.50884 -6877.03065
37 38 39 40 41 42
-16811.60505 28666.79641 48735.63845 25019.77874 40489.24352 1090.83554
43 44 45 46 47 48
32413.21948 16181.48403 22264.66707 12624.36827 24821.96604 -20049.22148
49 50 51 52 53 54
-19418.58737 -1077.69212 -14550.81281 44230.14294 -24989.43577 -3588.78323
55 56 57 58 59 60
24724.20066 -37849.39963 -6815.18049 -35410.80270 9075.99588 -30836.37860
61 62 63 64 65 66
5449.36601 9193.90495 -67.41145 7833.24088 11224.56876 307.42235
67 68 69 70 71 72
-4177.58853 -3279.10832 -10593.84621 -23877.17862 -3598.02627 -18798.42058
73 74 75 76 77 78
-17279.38460 -325.01839 7910.37229 663.92450 -33774.56439 6388.36680
79 80 81 82 83 84
-11046.43718 26400.12267 -8743.29994 -9916.96716 -19385.91224 3815.80758
85 86 87 88 89 90
-30824.54017 -29297.19917 -13476.87333 3431.14876 -16835.83180 -26694.83893
91 92 93 94 95 96
7664.73627 -29354.22349 -35055.69302 -15499.40078 -23378.60620 -19649.26469
97 98 99 100 101 102
-6009.71048 -17846.73395 -10048.80903 -38690.65637 -8472.20815 -14439.68590
103 104 105 106 107 108
-30124.14548 -23212.24587 -30644.17806 -48217.57208 -5935.22622 9201.84599
109 110 111 112 113 114
-32852.81095 -14028.96437 -22290.33696 -21437.43466 -26434.61188 -6892.71652
115 116 117 118 119 120
-22775.50060 -56548.52292 -13432.10820 -33981.78848 -25920.97055 -11725.53115
121 122 123 124 125 126
-21815.08327 -18088.96247 -18897.75890 -31573.92197 -27932.69521 -15960.27993
127 128 129 130 131 132
-39432.86358 423.78559 -30530.53495 -2153.09572 -24075.30175 -41190.17860
133 134 135 136 137
-40191.57902 -6867.54776 -38651.94813 -13318.98228 -41249.63926
> postscript(file="/var/wessaorg/rcomp/tmp/6k13y1324668538.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 = 137
Frequency = 1
lag(myerror, k = 1) myerror
0 78459.93952 NA
1 28970.62073 78459.93952
2 42735.50778 28970.62073
3 47426.67018 42735.50778
4 47864.07780 47426.67018
5 8007.52707 47864.07780
6 46352.59452 8007.52707
7 41194.00383 46352.59452
8 7580.91781 41194.00383
9 43836.75838 7580.91781
10 52707.51280 43836.75838
11 58760.90269 52707.51280
12 30607.11584 58760.90269
13 25875.55071 30607.11584
14 84118.32290 25875.55071
15 44147.34763 84118.32290
16 8993.67429 44147.34763
17 5562.92863 8993.67429
18 15022.10025 5562.92863
19 47095.66847 15022.10025
20 13688.37845 47095.66847
21 7801.00060 13688.37845
22 14765.91560 7801.00060
23 32825.16173 14765.91560
24 2523.39179 32825.16173
25 47705.91155 2523.39179
26 41254.84416 47705.91155
27 60332.76010 41254.84416
28 39135.89483 60332.76010
29 11014.73260 39135.89483
30 26206.86741 11014.73260
31 20166.48810 26206.86741
32 -1406.37465 20166.48810
33 11145.23363 -1406.37465
34 34370.50884 11145.23363
35 -6877.03065 34370.50884
36 -16811.60505 -6877.03065
37 28666.79641 -16811.60505
38 48735.63845 28666.79641
39 25019.77874 48735.63845
40 40489.24352 25019.77874
41 1090.83554 40489.24352
42 32413.21948 1090.83554
43 16181.48403 32413.21948
44 22264.66707 16181.48403
45 12624.36827 22264.66707
46 24821.96604 12624.36827
47 -20049.22148 24821.96604
48 -19418.58737 -20049.22148
49 -1077.69212 -19418.58737
50 -14550.81281 -1077.69212
51 44230.14294 -14550.81281
52 -24989.43577 44230.14294
53 -3588.78323 -24989.43577
54 24724.20066 -3588.78323
55 -37849.39963 24724.20066
56 -6815.18049 -37849.39963
57 -35410.80270 -6815.18049
58 9075.99588 -35410.80270
59 -30836.37860 9075.99588
60 5449.36601 -30836.37860
61 9193.90495 5449.36601
62 -67.41145 9193.90495
63 7833.24088 -67.41145
64 11224.56876 7833.24088
65 307.42235 11224.56876
66 -4177.58853 307.42235
67 -3279.10832 -4177.58853
68 -10593.84621 -3279.10832
69 -23877.17862 -10593.84621
70 -3598.02627 -23877.17862
71 -18798.42058 -3598.02627
72 -17279.38460 -18798.42058
73 -325.01839 -17279.38460
74 7910.37229 -325.01839
75 663.92450 7910.37229
76 -33774.56439 663.92450
77 6388.36680 -33774.56439
78 -11046.43718 6388.36680
79 26400.12267 -11046.43718
80 -8743.29994 26400.12267
81 -9916.96716 -8743.29994
82 -19385.91224 -9916.96716
83 3815.80758 -19385.91224
84 -30824.54017 3815.80758
85 -29297.19917 -30824.54017
86 -13476.87333 -29297.19917
87 3431.14876 -13476.87333
88 -16835.83180 3431.14876
89 -26694.83893 -16835.83180
90 7664.73627 -26694.83893
91 -29354.22349 7664.73627
92 -35055.69302 -29354.22349
93 -15499.40078 -35055.69302
94 -23378.60620 -15499.40078
95 -19649.26469 -23378.60620
96 -6009.71048 -19649.26469
97 -17846.73395 -6009.71048
98 -10048.80903 -17846.73395
99 -38690.65637 -10048.80903
100 -8472.20815 -38690.65637
101 -14439.68590 -8472.20815
102 -30124.14548 -14439.68590
103 -23212.24587 -30124.14548
104 -30644.17806 -23212.24587
105 -48217.57208 -30644.17806
106 -5935.22622 -48217.57208
107 9201.84599 -5935.22622
108 -32852.81095 9201.84599
109 -14028.96437 -32852.81095
110 -22290.33696 -14028.96437
111 -21437.43466 -22290.33696
112 -26434.61188 -21437.43466
113 -6892.71652 -26434.61188
114 -22775.50060 -6892.71652
115 -56548.52292 -22775.50060
116 -13432.10820 -56548.52292
117 -33981.78848 -13432.10820
118 -25920.97055 -33981.78848
119 -11725.53115 -25920.97055
120 -21815.08327 -11725.53115
121 -18088.96247 -21815.08327
122 -18897.75890 -18088.96247
123 -31573.92197 -18897.75890
124 -27932.69521 -31573.92197
125 -15960.27993 -27932.69521
126 -39432.86358 -15960.27993
127 423.78559 -39432.86358
128 -30530.53495 423.78559
129 -2153.09572 -30530.53495
130 -24075.30175 -2153.09572
131 -41190.17860 -24075.30175
132 -40191.57902 -41190.17860
133 -6867.54776 -40191.57902
134 -38651.94813 -6867.54776
135 -13318.98228 -38651.94813
136 -41249.63926 -13318.98228
137 NA -41249.63926
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 28970.62073 78459.93952
[2,] 42735.50778 28970.62073
[3,] 47426.67018 42735.50778
[4,] 47864.07780 47426.67018
[5,] 8007.52707 47864.07780
[6,] 46352.59452 8007.52707
[7,] 41194.00383 46352.59452
[8,] 7580.91781 41194.00383
[9,] 43836.75838 7580.91781
[10,] 52707.51280 43836.75838
[11,] 58760.90269 52707.51280
[12,] 30607.11584 58760.90269
[13,] 25875.55071 30607.11584
[14,] 84118.32290 25875.55071
[15,] 44147.34763 84118.32290
[16,] 8993.67429 44147.34763
[17,] 5562.92863 8993.67429
[18,] 15022.10025 5562.92863
[19,] 47095.66847 15022.10025
[20,] 13688.37845 47095.66847
[21,] 7801.00060 13688.37845
[22,] 14765.91560 7801.00060
[23,] 32825.16173 14765.91560
[24,] 2523.39179 32825.16173
[25,] 47705.91155 2523.39179
[26,] 41254.84416 47705.91155
[27,] 60332.76010 41254.84416
[28,] 39135.89483 60332.76010
[29,] 11014.73260 39135.89483
[30,] 26206.86741 11014.73260
[31,] 20166.48810 26206.86741
[32,] -1406.37465 20166.48810
[33,] 11145.23363 -1406.37465
[34,] 34370.50884 11145.23363
[35,] -6877.03065 34370.50884
[36,] -16811.60505 -6877.03065
[37,] 28666.79641 -16811.60505
[38,] 48735.63845 28666.79641
[39,] 25019.77874 48735.63845
[40,] 40489.24352 25019.77874
[41,] 1090.83554 40489.24352
[42,] 32413.21948 1090.83554
[43,] 16181.48403 32413.21948
[44,] 22264.66707 16181.48403
[45,] 12624.36827 22264.66707
[46,] 24821.96604 12624.36827
[47,] -20049.22148 24821.96604
[48,] -19418.58737 -20049.22148
[49,] -1077.69212 -19418.58737
[50,] -14550.81281 -1077.69212
[51,] 44230.14294 -14550.81281
[52,] -24989.43577 44230.14294
[53,] -3588.78323 -24989.43577
[54,] 24724.20066 -3588.78323
[55,] -37849.39963 24724.20066
[56,] -6815.18049 -37849.39963
[57,] -35410.80270 -6815.18049
[58,] 9075.99588 -35410.80270
[59,] -30836.37860 9075.99588
[60,] 5449.36601 -30836.37860
[61,] 9193.90495 5449.36601
[62,] -67.41145 9193.90495
[63,] 7833.24088 -67.41145
[64,] 11224.56876 7833.24088
[65,] 307.42235 11224.56876
[66,] -4177.58853 307.42235
[67,] -3279.10832 -4177.58853
[68,] -10593.84621 -3279.10832
[69,] -23877.17862 -10593.84621
[70,] -3598.02627 -23877.17862
[71,] -18798.42058 -3598.02627
[72,] -17279.38460 -18798.42058
[73,] -325.01839 -17279.38460
[74,] 7910.37229 -325.01839
[75,] 663.92450 7910.37229
[76,] -33774.56439 663.92450
[77,] 6388.36680 -33774.56439
[78,] -11046.43718 6388.36680
[79,] 26400.12267 -11046.43718
[80,] -8743.29994 26400.12267
[81,] -9916.96716 -8743.29994
[82,] -19385.91224 -9916.96716
[83,] 3815.80758 -19385.91224
[84,] -30824.54017 3815.80758
[85,] -29297.19917 -30824.54017
[86,] -13476.87333 -29297.19917
[87,] 3431.14876 -13476.87333
[88,] -16835.83180 3431.14876
[89,] -26694.83893 -16835.83180
[90,] 7664.73627 -26694.83893
[91,] -29354.22349 7664.73627
[92,] -35055.69302 -29354.22349
[93,] -15499.40078 -35055.69302
[94,] -23378.60620 -15499.40078
[95,] -19649.26469 -23378.60620
[96,] -6009.71048 -19649.26469
[97,] -17846.73395 -6009.71048
[98,] -10048.80903 -17846.73395
[99,] -38690.65637 -10048.80903
[100,] -8472.20815 -38690.65637
[101,] -14439.68590 -8472.20815
[102,] -30124.14548 -14439.68590
[103,] -23212.24587 -30124.14548
[104,] -30644.17806 -23212.24587
[105,] -48217.57208 -30644.17806
[106,] -5935.22622 -48217.57208
[107,] 9201.84599 -5935.22622
[108,] -32852.81095 9201.84599
[109,] -14028.96437 -32852.81095
[110,] -22290.33696 -14028.96437
[111,] -21437.43466 -22290.33696
[112,] -26434.61188 -21437.43466
[113,] -6892.71652 -26434.61188
[114,] -22775.50060 -6892.71652
[115,] -56548.52292 -22775.50060
[116,] -13432.10820 -56548.52292
[117,] -33981.78848 -13432.10820
[118,] -25920.97055 -33981.78848
[119,] -11725.53115 -25920.97055
[120,] -21815.08327 -11725.53115
[121,] -18088.96247 -21815.08327
[122,] -18897.75890 -18088.96247
[123,] -31573.92197 -18897.75890
[124,] -27932.69521 -31573.92197
[125,] -15960.27993 -27932.69521
[126,] -39432.86358 -15960.27993
[127,] 423.78559 -39432.86358
[128,] -30530.53495 423.78559
[129,] -2153.09572 -30530.53495
[130,] -24075.30175 -2153.09572
[131,] -41190.17860 -24075.30175
[132,] -40191.57902 -41190.17860
[133,] -6867.54776 -40191.57902
[134,] -38651.94813 -6867.54776
[135,] -13318.98228 -38651.94813
[136,] -41249.63926 -13318.98228
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 28970.62073 78459.93952
2 42735.50778 28970.62073
3 47426.67018 42735.50778
4 47864.07780 47426.67018
5 8007.52707 47864.07780
6 46352.59452 8007.52707
7 41194.00383 46352.59452
8 7580.91781 41194.00383
9 43836.75838 7580.91781
10 52707.51280 43836.75838
11 58760.90269 52707.51280
12 30607.11584 58760.90269
13 25875.55071 30607.11584
14 84118.32290 25875.55071
15 44147.34763 84118.32290
16 8993.67429 44147.34763
17 5562.92863 8993.67429
18 15022.10025 5562.92863
19 47095.66847 15022.10025
20 13688.37845 47095.66847
21 7801.00060 13688.37845
22 14765.91560 7801.00060
23 32825.16173 14765.91560
24 2523.39179 32825.16173
25 47705.91155 2523.39179
26 41254.84416 47705.91155
27 60332.76010 41254.84416
28 39135.89483 60332.76010
29 11014.73260 39135.89483
30 26206.86741 11014.73260
31 20166.48810 26206.86741
32 -1406.37465 20166.48810
33 11145.23363 -1406.37465
34 34370.50884 11145.23363
35 -6877.03065 34370.50884
36 -16811.60505 -6877.03065
37 28666.79641 -16811.60505
38 48735.63845 28666.79641
39 25019.77874 48735.63845
40 40489.24352 25019.77874
41 1090.83554 40489.24352
42 32413.21948 1090.83554
43 16181.48403 32413.21948
44 22264.66707 16181.48403
45 12624.36827 22264.66707
46 24821.96604 12624.36827
47 -20049.22148 24821.96604
48 -19418.58737 -20049.22148
49 -1077.69212 -19418.58737
50 -14550.81281 -1077.69212
51 44230.14294 -14550.81281
52 -24989.43577 44230.14294
53 -3588.78323 -24989.43577
54 24724.20066 -3588.78323
55 -37849.39963 24724.20066
56 -6815.18049 -37849.39963
57 -35410.80270 -6815.18049
58 9075.99588 -35410.80270
59 -30836.37860 9075.99588
60 5449.36601 -30836.37860
61 9193.90495 5449.36601
62 -67.41145 9193.90495
63 7833.24088 -67.41145
64 11224.56876 7833.24088
65 307.42235 11224.56876
66 -4177.58853 307.42235
67 -3279.10832 -4177.58853
68 -10593.84621 -3279.10832
69 -23877.17862 -10593.84621
70 -3598.02627 -23877.17862
71 -18798.42058 -3598.02627
72 -17279.38460 -18798.42058
73 -325.01839 -17279.38460
74 7910.37229 -325.01839
75 663.92450 7910.37229
76 -33774.56439 663.92450
77 6388.36680 -33774.56439
78 -11046.43718 6388.36680
79 26400.12267 -11046.43718
80 -8743.29994 26400.12267
81 -9916.96716 -8743.29994
82 -19385.91224 -9916.96716
83 3815.80758 -19385.91224
84 -30824.54017 3815.80758
85 -29297.19917 -30824.54017
86 -13476.87333 -29297.19917
87 3431.14876 -13476.87333
88 -16835.83180 3431.14876
89 -26694.83893 -16835.83180
90 7664.73627 -26694.83893
91 -29354.22349 7664.73627
92 -35055.69302 -29354.22349
93 -15499.40078 -35055.69302
94 -23378.60620 -15499.40078
95 -19649.26469 -23378.60620
96 -6009.71048 -19649.26469
97 -17846.73395 -6009.71048
98 -10048.80903 -17846.73395
99 -38690.65637 -10048.80903
100 -8472.20815 -38690.65637
101 -14439.68590 -8472.20815
102 -30124.14548 -14439.68590
103 -23212.24587 -30124.14548
104 -30644.17806 -23212.24587
105 -48217.57208 -30644.17806
106 -5935.22622 -48217.57208
107 9201.84599 -5935.22622
108 -32852.81095 9201.84599
109 -14028.96437 -32852.81095
110 -22290.33696 -14028.96437
111 -21437.43466 -22290.33696
112 -26434.61188 -21437.43466
113 -6892.71652 -26434.61188
114 -22775.50060 -6892.71652
115 -56548.52292 -22775.50060
116 -13432.10820 -56548.52292
117 -33981.78848 -13432.10820
118 -25920.97055 -33981.78848
119 -11725.53115 -25920.97055
120 -21815.08327 -11725.53115
121 -18088.96247 -21815.08327
122 -18897.75890 -18088.96247
123 -31573.92197 -18897.75890
124 -27932.69521 -31573.92197
125 -15960.27993 -27932.69521
126 -39432.86358 -15960.27993
127 423.78559 -39432.86358
128 -30530.53495 423.78559
129 -2153.09572 -30530.53495
130 -24075.30175 -2153.09572
131 -41190.17860 -24075.30175
132 -40191.57902 -41190.17860
133 -6867.54776 -40191.57902
134 -38651.94813 -6867.54776
135 -13318.98228 -38651.94813
136 -41249.63926 -13318.98228
> 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/70h2i1324668538.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/8p4fo1324668538.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/9qeef1324668538.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/10qv1j1324668538.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/1173c81324668538.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/12rjux1324668538.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/13n8x71324668538.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/1491691324668538.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/15j8s81324668538.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/16d8x31324668538.tab")
+ }
>
> try(system("convert tmp/1zmzp1324668538.ps tmp/1zmzp1324668538.png",intern=TRUE))
character(0)
> try(system("convert tmp/2obhm1324668538.ps tmp/2obhm1324668538.png",intern=TRUE))
character(0)
> try(system("convert tmp/3sb2t1324668538.ps tmp/3sb2t1324668538.png",intern=TRUE))
character(0)
> try(system("convert tmp/41n7l1324668538.ps tmp/41n7l1324668538.png",intern=TRUE))
character(0)
> try(system("convert tmp/553e01324668538.ps tmp/553e01324668538.png",intern=TRUE))
character(0)
> try(system("convert tmp/6k13y1324668538.ps tmp/6k13y1324668538.png",intern=TRUE))
character(0)
> try(system("convert tmp/70h2i1324668538.ps tmp/70h2i1324668538.png",intern=TRUE))
character(0)
> try(system("convert tmp/8p4fo1324668538.ps tmp/8p4fo1324668538.png",intern=TRUE))
character(0)
> try(system("convert tmp/9qeef1324668538.ps tmp/9qeef1324668538.png",intern=TRUE))
character(0)
> try(system("convert tmp/10qv1j1324668538.ps tmp/10qv1j1324668538.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.531 0.735 5.281