R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-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(1
+ ,110.115
+ ,110.661
+ ,100.294
+ ,107.711
+ ,1
+ ,114.151
+ ,115.626
+ ,109.764
+ ,113.241
+ ,1
+ ,122.563
+ ,121.828
+ ,120.711
+ ,121.998
+ ,1
+ ,136.114
+ ,137.409
+ ,131.551
+ ,135.136
+ ,1
+ ,159.863
+ ,171.274
+ ,145.023
+ ,157.641
+ ,1
+ ,210.638
+ ,238.258
+ ,177.164
+ ,205.875
+ ,1
+ ,219.929
+ ,251.688
+ ,190.269
+ ,216.347
+ ,1
+ ,255.015
+ ,296.637
+ ,219.996
+ ,251.435
+ ,1
+ ,242.351
+ ,296.679
+ ,218.186
+ ,243.588
+ ,1
+ ,220.855
+ ,256.573
+ ,191.582
+ ,217.678
+ ,1
+ ,215.9
+ ,244.361
+ ,204.484
+ ,216.346
+ ,1
+ ,239.951
+ ,274.37
+ ,219.318
+ ,239.488
+ ,2
+ ,110.439
+ ,113.149
+ ,100.578
+ ,108.313
+ ,2
+ ,114.069
+ ,116.697
+ ,108.502
+ ,113.015
+ ,2
+ ,124.143
+ ,122.603
+ ,121.37
+ ,123.239
+ ,2
+ ,136.177
+ ,138.866
+ ,131.422
+ ,135.336
+ ,2
+ ,164.488
+ ,177.848
+ ,148.287
+ ,162.182
+ ,2
+ ,212.831
+ ,241.42
+ ,174.947
+ ,207.085
+ ,2
+ ,222.144
+ ,255.734
+ ,196.606
+ ,219.825
+ ,2
+ ,253.493
+ ,299.882
+ ,223.847
+ ,252.091
+ ,2
+ ,238.172
+ ,285.712
+ ,206.917
+ ,236.447
+ ,2
+ ,220.127
+ ,257.917
+ ,195.727
+ ,218.478
+ ,2
+ ,217.141
+ ,255.116
+ ,208.73
+ ,220.221
+ ,2
+ ,240.436
+ ,275.671
+ ,213.558
+ ,238.741
+ ,3
+ ,100
+ ,100
+ ,100
+ ,100
+ ,3
+ ,111.054
+ ,113.853
+ ,97.9592
+ ,108.124
+ ,3
+ ,114.798
+ ,119.368
+ ,109.211
+ ,113.998
+ ,3
+ ,126.574
+ ,123.803
+ ,120.473
+ ,124.666
+ ,3
+ ,136.883
+ ,135.802
+ ,131.112
+ ,135.284
+ ,3
+ ,172.288
+ ,185.538
+ ,147.732
+ ,167.86
+ ,3
+ ,214.227
+ ,242.44
+ ,179.407
+ ,209.204
+ ,3
+ ,224.73
+ ,257.646
+ ,197.796
+ ,221.956
+ ,3
+ ,255.976
+ ,292.588
+ ,227.227
+ ,252.946
+ ,3
+ ,226.723
+ ,270.085
+ ,197.833
+ ,224.906
+ ,3
+ ,215.471
+ ,253.316
+ ,194.766
+ ,214.815
+ ,3
+ ,219.459
+ ,256.46
+ ,210.264
+ ,222.182
+ ,3
+ ,241.588
+ ,270.831
+ ,214.026
+ ,238.5
+ ,4
+ ,102.815
+ ,101.542
+ ,100.254
+ ,102
+ ,4
+ ,112.319
+ ,115.143
+ ,100.107
+ ,109.615
+ ,4
+ ,114.537
+ ,120.264
+ ,113.097
+ ,114.936
+ ,4
+ ,128.069
+ ,127.692
+ ,122.204
+ ,126.54
+ ,4
+ ,139.095
+ ,139.408
+ ,131.193
+ ,137.144
+ ,4
+ ,181.098
+ ,193.704
+ ,151.23
+ ,175.245
+ ,4
+ ,216.573
+ ,248.809
+ ,181.625
+ ,212.246
+ ,4
+ ,228.912
+ ,263.016
+ ,205.874
+ ,227.184
+ ,4
+ ,255.878
+ ,292.523
+ ,226.757
+ ,252.773
+ ,4
+ ,225.84
+ ,261.006
+ ,194.438
+ ,221.934
+ ,4
+ ,214.691
+ ,257.496
+ ,194.576
+ ,215.143
+ ,4
+ ,222.898
+ ,258.249
+ ,214.211
+ ,225.455
+ ,4
+ ,241.512
+ ,275.141
+ ,225.59
+ ,242.116
+ ,5
+ ,104.301
+ ,102.179
+ ,102.839
+ ,103.65
+ ,5
+ ,113.607
+ ,116.923
+ ,102.865
+ ,111.34
+ ,5
+ ,114.118
+ ,118.74
+ ,112.18
+ ,114.245
+ ,5
+ ,128.101
+ ,128.336
+ ,124.943
+ ,127.336
+ ,5
+ ,141.551
+ ,142.191
+ ,136.448
+ ,140.349
+ ,5
+ ,186.026
+ ,203.366
+ ,150.278
+ ,179.32
+ ,5
+ ,217.504
+ ,254.991
+ ,188.871
+ ,215.466
+ ,5
+ ,231.613
+ ,265.367
+ ,206.229
+ ,229.247
+ ,5
+ ,254.149
+ ,290.063
+ ,223.928
+ ,250.677
+ ,5
+ ,225.751
+ ,266.44
+ ,202.508
+ ,224.903
+ ,5
+ ,216.2
+ ,264.861
+ ,198.563
+ ,218.381
+ ,5
+ ,225.478
+ ,256.327
+ ,214.169
+ ,226.42
+ ,5
+ ,243.05
+ ,277.59
+ ,227.637
+ ,243.923
+ ,6
+ ,104.964
+ ,105.494
+ ,104.726
+ ,104.974
+ ,6
+ ,112.716
+ ,116.638
+ ,102.719
+ ,110.717
+ ,6
+ ,113.814
+ ,116.522
+ ,114.855
+ ,114.437
+ ,6
+ ,128.752
+ ,128.718
+ ,125.276
+ ,127.871
+ ,6
+ ,144.647
+ ,146.027
+ ,138.433
+ ,143.264
+ ,6
+ ,191.144
+ ,213.692
+ ,154.789
+ ,184.979
+ ,6
+ ,219.151
+ ,255.458
+ ,189.866
+ ,216.693
+ ,6
+ ,235.936
+ ,271.406
+ ,208.473
+ ,233.33
+ ,6
+ ,252.408
+ ,296.831
+ ,220.682
+ ,250.105
+ ,6
+ ,226.192
+ ,267.075
+ ,196.651
+ ,223.798
+ ,6
+ ,219.85
+ ,257.795
+ ,201.679
+ ,219.962
+ ,6
+ ,228.098
+ ,259.192
+ ,213.656
+ ,228.287
+ ,6
+ ,246.469
+ ,276.357
+ ,229
+ ,245.813
+ ,7
+ ,104.83
+ ,106.14
+ ,103.387
+ ,104.641
+ ,7
+ ,113.126
+ ,116.227
+ ,103.921
+ ,111.217
+ ,7
+ ,115.232
+ ,116.967
+ ,114.53
+ ,115.286
+ ,7
+ ,129.991
+ ,130.539
+ ,130.192
+ ,130.115
+ ,7
+ ,147.403
+ ,145.695
+ ,136.323
+ ,144.381
+ ,7
+ ,196.021
+ ,220.819
+ ,153.029
+ ,188.482
+ ,7
+ ,220.494
+ ,261.125
+ ,192.114
+ ,219.019
+ ,7
+ ,239.005
+ ,278.478
+ ,211.102
+ ,236.987
+ ,7
+ ,252.503
+ ,296.742
+ ,227.654
+ ,251.788
+ ,7
+ ,220.037
+ ,263.672
+ ,191.446
+ ,218.529
+ ,7
+ ,220.182
+ ,251.318
+ ,201.506
+ ,218.933
+ ,7
+ ,230.729
+ ,260.776
+ ,219.028
+ ,231.349
+ ,7
+ ,248.64
+ ,279.389
+ ,226.841
+ ,247.143
+ ,8
+ ,105.878
+ ,106.371
+ ,101.746
+ ,104.902
+ ,8
+ ,112.818
+ ,115.942
+ ,105.751
+ ,111.452
+ ,8
+ ,115.945
+ ,118.061
+ ,115.328
+ ,116.071
+ ,8
+ ,133.236
+ ,132.864
+ ,131.595
+ ,132.773
+ ,8
+ ,148.778
+ ,148.469
+ ,137.453
+ ,145.881
+ ,8
+ ,200.338
+ ,225.005
+ ,157.658
+ ,192.86
+ ,8
+ ,220.484
+ ,258.58
+ ,189.665
+ ,217.924
+ ,8
+ ,242.293
+ ,284.415
+ ,211.503
+ ,240.027
+ ,8
+ ,253.733
+ ,296.479
+ ,218.398
+ ,250.212
+ ,8
+ ,220.406
+ ,259.121
+ ,190.056
+ ,217.521
+ ,8
+ ,220.283
+ ,243.526
+ ,204.453
+ ,218.36
+ ,8
+ ,230.535
+ ,261.166
+ ,217.602
+ ,231.015
+ ,8
+ ,251.147
+ ,274.787
+ ,221.488
+ ,246.381
+ ,9
+ ,107.542
+ ,107.249
+ ,100.371
+ ,105.695
+ ,9
+ ,112.565
+ ,116.42
+ ,106.746
+ ,111.611
+ ,9
+ ,117.543
+ ,118.711
+ ,117.973
+ ,117.807
+ ,9
+ ,134.689
+ ,134.529
+ ,133.091
+ ,134.265
+ ,9
+ ,149.123
+ ,152.221
+ ,137.072
+ ,146.497
+ ,9
+ ,202.319
+ ,229.096
+ ,161.039
+ ,195.475
+ ,9
+ ,220.269
+ ,257.981
+ ,191.006
+ ,217.978
+ ,9
+ ,248.077
+ ,287.685
+ ,218.055
+ ,245.433
+ ,9
+ ,252.299
+ ,295.557
+ ,213.639
+ ,248.073
+ ,9
+ ,223.551
+ ,262.711
+ ,190.322
+ ,219.971
+ ,9
+ ,216.675
+ ,247.503
+ ,206.552
+ ,217.72
+ ,9
+ ,229.735
+ ,265.351
+ ,220.635
+ ,232.241
+ ,10
+ ,107.954
+ ,109.481
+ ,101.337
+ ,106.489
+ ,10
+ ,112.698
+ ,113.365
+ ,108.454
+ ,111.717
+ ,10
+ ,118.205
+ ,119.223
+ ,117.863
+ ,118.255
+ ,10
+ ,135.058
+ ,135.166
+ ,133.167
+ ,134.596
+ ,10
+ ,150.925
+ ,157.061
+ ,139.485
+ ,148.857
+ ,10
+ ,204.148
+ ,233.982
+ ,165.599
+ ,198.4
+ ,10
+ ,222.524
+ ,257.756
+ ,186.398
+ ,218.186
+ ,10
+ ,248.956
+ ,287.97
+ ,221.076
+ ,246.641
+ ,10
+ ,248.838
+ ,288.037
+ ,212.71
+ ,244.468
+ ,10
+ ,223.373
+ ,265.838
+ ,203.701
+ ,223.841
+ ,10
+ ,217.808
+ ,256.9
+ ,205.642
+ ,219.934
+ ,10
+ ,233.148
+ ,261.627
+ ,222.011
+ ,233.688
+ ,11
+ ,108.09
+ ,111.951
+ ,102.307
+ ,107.146
+ ,11
+ ,113.701
+ ,112.709
+ ,107.724
+ ,112.062
+ ,11
+ ,119.899
+ ,119.196
+ ,116.582
+ ,118.969
+ ,11
+ ,135.615
+ ,133.458
+ ,131.858
+ ,134.38
+ ,11
+ ,152.195
+ ,160.782
+ ,142.049
+ ,150.78
+ ,11
+ ,205.288
+ ,234.529
+ ,171.248
+ ,200.598
+ ,11
+ ,221.905
+ ,257.984
+ ,189.577
+ ,218.54
+ ,11
+ ,252.358
+ ,290.44
+ ,226.743
+ ,250.328
+ ,11
+ ,247.559
+ ,287.377
+ ,217.355
+ ,244.727
+ ,11
+ ,224.678
+ ,265.766
+ ,200.524
+ ,223.764
+ ,11
+ ,217.66
+ ,261.806
+ ,205.679
+ ,220.842
+ ,11
+ ,235.221
+ ,266.932
+ ,224.948
+ ,236.667
+ ,12
+ ,109.19
+ ,111.972
+ ,101.794
+ ,107.695
+ ,12
+ ,113.844
+ ,115.609
+ ,108.936
+ ,112.842
+ ,12
+ ,121.35
+ ,120.729
+ ,117.645
+ ,120.333
+ ,12
+ ,136.088
+ ,135.621
+ ,132.5
+ ,135.121
+ ,12
+ ,155.762
+ ,164.581
+ ,141.315
+ ,153.293
+ ,12
+ ,206.439
+ ,238.753
+ ,172.249
+ ,202.121
+ ,12
+ ,222.286
+ ,252.604
+ ,190.244
+ ,217.886
+ ,12
+ ,254.122
+ ,292.298
+ ,223.179
+ ,250.849
+ ,12
+ ,245.331
+ ,290.101
+ ,217.786
+ ,244.034
+ ,12
+ ,223.629
+ ,269.162
+ ,200.524
+ ,223.664
+ ,12
+ ,217.951
+ ,260.758
+ ,204.583
+ ,220.584
+ ,12
+ ,237.46
+ ,268.695
+ ,225.566
+ ,238.439)
+ ,dim=c(5
+ ,150)
+ ,dimnames=list(c('month'
+ ,'SMF'
+ ,'SSF'
+ ,'NS'
+ ,'TOT')
+ ,1:150))
> y <- array(NA,dim=c(5,150),dimnames=list(c('month','SMF','SSF','NS','TOT'),1:150))
> 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 = '5'
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date, as.Date.numeric
> 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
TOT month SMF SSF NS
1 107.711 1 110.115 110.661 100.2940
2 113.241 1 114.151 115.626 109.7640
3 121.998 1 122.563 121.828 120.7110
4 135.136 1 136.114 137.409 131.5510
5 157.641 1 159.863 171.274 145.0230
6 205.875 1 210.638 238.258 177.1640
7 216.347 1 219.929 251.688 190.2690
8 251.435 1 255.015 296.637 219.9960
9 243.588 1 242.351 296.679 218.1860
10 217.678 1 220.855 256.573 191.5820
11 216.346 1 215.900 244.361 204.4840
12 239.488 1 239.951 274.370 219.3180
13 108.313 2 110.439 113.149 100.5780
14 113.015 2 114.069 116.697 108.5020
15 123.239 2 124.143 122.603 121.3700
16 135.336 2 136.177 138.866 131.4220
17 162.182 2 164.488 177.848 148.2870
18 207.085 2 212.831 241.420 174.9470
19 219.825 2 222.144 255.734 196.6060
20 252.091 2 253.493 299.882 223.8470
21 236.447 2 238.172 285.712 206.9170
22 218.478 2 220.127 257.917 195.7270
23 220.221 2 217.141 255.116 208.7300
24 238.741 2 240.436 275.671 213.5580
25 100.000 3 100.000 100.000 100.0000
26 108.124 3 111.054 113.853 97.9592
27 113.998 3 114.798 119.368 109.2110
28 124.666 3 126.574 123.803 120.4730
29 135.284 3 136.883 135.802 131.1120
30 167.860 3 172.288 185.538 147.7320
31 209.204 3 214.227 242.440 179.4070
32 221.956 3 224.730 257.646 197.7960
33 252.946 3 255.976 292.588 227.2270
34 224.906 3 226.723 270.085 197.8330
35 214.815 3 215.471 253.316 194.7660
36 222.182 3 219.459 256.460 210.2640
37 238.500 3 241.588 270.831 214.0260
38 102.000 4 102.815 101.542 100.2540
39 109.615 4 112.319 115.143 100.1070
40 114.936 4 114.537 120.264 113.0970
41 126.540 4 128.069 127.692 122.2040
42 137.144 4 139.095 139.408 131.1930
43 175.245 4 181.098 193.704 151.2300
44 212.246 4 216.573 248.809 181.6250
45 227.184 4 228.912 263.016 205.8740
46 252.773 4 255.878 292.523 226.7570
47 221.934 4 225.840 261.006 194.4380
48 215.143 4 214.691 257.496 194.5760
49 225.455 4 222.898 258.249 214.2110
50 242.116 4 241.512 275.141 225.5900
51 103.650 5 104.301 102.179 102.8390
52 111.340 5 113.607 116.923 102.8650
53 114.245 5 114.118 118.740 112.1800
54 127.336 5 128.101 128.336 124.9430
55 140.349 5 141.551 142.191 136.4480
56 179.320 5 186.026 203.366 150.2780
57 215.466 5 217.504 254.991 188.8710
58 229.247 5 231.613 265.367 206.2290
59 250.677 5 254.149 290.063 223.9280
60 224.903 5 225.751 266.440 202.5080
61 218.381 5 216.200 264.861 198.5630
62 226.420 5 225.478 256.327 214.1690
63 243.923 5 243.050 277.590 227.6370
64 104.974 6 104.964 105.494 104.7260
65 110.717 6 112.716 116.638 102.7190
66 114.437 6 113.814 116.522 114.8550
67 127.871 6 128.752 128.718 125.2760
68 143.264 6 144.647 146.027 138.4330
69 184.979 6 191.144 213.692 154.7890
70 216.693 6 219.151 255.458 189.8660
71 233.330 6 235.936 271.406 208.4730
72 250.105 6 252.408 296.831 220.6820
73 223.798 6 226.192 267.075 196.6510
74 219.962 6 219.850 257.795 201.6790
75 228.287 6 228.098 259.192 213.6560
76 245.813 6 246.469 276.357 229.0000
77 104.641 7 104.830 106.140 103.3870
78 111.217 7 113.126 116.227 103.9210
79 115.286 7 115.232 116.967 114.5300
80 130.115 7 129.991 130.539 130.1920
81 144.381 7 147.403 145.695 136.3230
82 188.482 7 196.021 220.819 153.0290
83 219.019 7 220.494 261.125 192.1140
84 236.987 7 239.005 278.478 211.1020
85 251.788 7 252.503 296.742 227.6540
86 218.529 7 220.037 263.672 191.4460
87 218.933 7 220.182 251.318 201.5060
88 231.349 7 230.729 260.776 219.0280
89 247.143 7 248.640 279.389 226.8410
90 104.902 8 105.878 106.371 101.7460
91 111.452 8 112.818 115.942 105.7510
92 116.071 8 115.945 118.061 115.3280
93 132.773 8 133.236 132.864 131.5950
94 145.881 8 148.778 148.469 137.4530
95 192.860 8 200.338 225.005 157.6580
96 217.924 8 220.484 258.580 189.6650
97 240.027 8 242.293 284.415 211.5030
98 250.212 8 253.733 296.479 218.3980
99 217.521 8 220.406 259.121 190.0560
100 218.360 8 220.283 243.526 204.4530
101 231.015 8 230.535 261.166 217.6020
102 246.381 8 251.147 274.787 221.4880
103 105.695 9 107.542 107.249 100.3710
104 111.611 9 112.565 116.420 106.7460
105 117.807 9 117.543 118.711 117.9730
106 134.265 9 134.689 134.529 133.0910
107 146.497 9 149.123 152.221 137.0720
108 195.475 9 202.319 229.096 161.0390
109 217.978 9 220.269 257.981 191.0060
110 245.433 9 248.077 287.685 218.0550
111 248.073 9 252.299 295.557 213.6390
112 219.971 9 223.551 262.711 190.3220
113 217.720 9 216.675 247.503 206.5520
114 232.241 9 229.735 265.351 220.6350
115 106.489 10 107.954 109.481 101.3370
116 111.717 10 112.698 113.365 108.4540
117 118.255 10 118.205 119.223 117.8630
118 134.596 10 135.058 135.166 133.1670
119 148.857 10 150.925 157.061 139.4850
120 198.400 10 204.148 233.982 165.5990
121 218.186 10 222.524 257.756 186.3980
122 246.641 10 248.956 287.970 221.0760
123 244.468 10 248.838 288.037 212.7100
124 223.841 10 223.373 265.838 203.7010
125 219.934 10 217.808 256.900 205.6420
126 233.688 10 233.148 261.627 222.0110
127 107.146 11 108.090 111.951 102.3070
128 112.062 11 113.701 112.709 107.7240
129 118.969 11 119.899 119.196 116.5820
130 134.380 11 135.615 133.458 131.8580
131 150.780 11 152.195 160.782 142.0490
132 200.598 11 205.288 234.529 171.2480
133 218.540 11 221.905 257.984 189.5770
134 250.328 11 252.358 290.440 226.7430
135 244.727 11 247.559 287.377 217.3550
136 223.764 11 224.678 265.766 200.5240
137 220.842 11 217.660 261.806 205.6790
138 236.667 11 235.221 266.932 224.9480
139 107.695 12 109.190 111.972 101.7940
140 112.842 12 113.844 115.609 108.9360
141 120.333 12 121.350 120.729 117.6450
142 135.121 12 136.088 135.621 132.5000
143 153.293 12 155.762 164.581 141.3150
144 202.121 12 206.439 238.753 172.2490
145 217.886 12 222.286 252.604 190.2440
146 250.849 12 254.122 292.298 223.1790
147 244.034 12 245.331 290.101 217.7860
148 223.664 12 223.629 269.162 200.5240
149 220.584 12 217.951 260.758 204.5830
150 238.439 12 237.460 268.695 225.5660
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) month SMF SSF NS
0.566832 -0.001983 0.603744 0.140665 0.250962
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.75107 -0.08354 -0.01635 0.11676 0.64409
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.566832 0.124560 4.551 1.12e-05 ***
month -0.001983 0.004927 -0.402 0.688
SMF 0.603744 0.004461 135.337 < 2e-16 ***
SSF 0.140665 0.002935 47.922 < 2e-16 ***
NS 0.250962 0.002152 116.614 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.2053 on 145 degrees of freedom
Multiple R-squared: 1, Adjusted R-squared: 1
F-statistic: 2.523e+06 on 4 and 145 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.09147601 0.18295203 0.90852399
[2,] 0.24728263 0.49456527 0.75271737
[3,] 0.65502052 0.68995895 0.34497948
[4,] 0.65009616 0.69980767 0.34990384
[5,] 0.88045570 0.23908859 0.11954430
[6,] 0.82196641 0.35606719 0.17803359
[7,] 0.75108838 0.49782323 0.24891162
[8,] 0.67237226 0.65525548 0.32762774
[9,] 0.58811179 0.82377642 0.41188821
[10,] 0.51197862 0.97604276 0.48802138
[11,] 0.46526251 0.93052501 0.53473749
[12,] 0.47723749 0.95447498 0.52276251
[13,] 0.40982382 0.81964764 0.59017618
[14,] 0.33845726 0.67691453 0.66154274
[15,] 0.51124775 0.97750449 0.48875225
[16,] 0.55631833 0.88736335 0.44368167
[17,] 0.86433339 0.27133322 0.13566661
[18,] 0.83086302 0.33827397 0.16913698
[19,] 0.78723765 0.42552469 0.21276235
[20,] 0.73892555 0.52214891 0.26107445
[21,] 0.68866456 0.62267087 0.31133544
[22,] 0.63520824 0.72958353 0.36479176
[23,] 0.58041341 0.83917317 0.41958659
[24,] 0.53746379 0.92507242 0.46253621
[25,] 0.57929881 0.84140237 0.42070119
[26,] 0.76723269 0.46553461 0.23276731
[27,] 0.74088104 0.51823792 0.25911896
[28,] 0.78731527 0.42536945 0.21268473
[29,] 0.81537150 0.36925699 0.18462850
[30,] 0.81393975 0.37212050 0.18606025
[31,] 0.77588056 0.44823888 0.22411944
[32,] 0.73592861 0.52814278 0.26407139
[33,] 0.69161734 0.61676533 0.30838266
[34,] 0.64221163 0.71557674 0.35778837
[35,] 0.59312253 0.81375494 0.40687747
[36,] 0.56385944 0.87228113 0.43614056
[37,] 0.66424745 0.67150511 0.33575255
[38,] 0.70527375 0.58945250 0.29472625
[39,] 0.79329139 0.41341723 0.20670861
[40,] 0.90126221 0.19747558 0.09873779
[41,] 0.88165560 0.23668879 0.11834440
[42,] 0.88829530 0.22340940 0.11170470
[43,] 0.93668036 0.12663928 0.06331964
[44,] 0.92023903 0.15952194 0.07976097
[45,] 0.90230456 0.19539088 0.09769544
[46,] 0.88084785 0.23830430 0.11915215
[47,] 0.85455529 0.29088943 0.14544471
[48,] 0.82849113 0.34301774 0.17150887
[49,] 0.81665122 0.36669757 0.18334878
[50,] 0.87156671 0.25686658 0.12843329
[51,] 0.88125842 0.23748316 0.11874158
[52,] 0.91525244 0.16949512 0.08474756
[53,] 0.91884980 0.16230039 0.08115020
[54,] 0.92562246 0.14875508 0.07437754
[55,] 0.91074796 0.17850408 0.08925204
[56,] 0.96261662 0.07476676 0.03738338
[57,] 0.95268419 0.09463161 0.04731581
[58,] 0.94128745 0.11742510 0.05871255
[59,] 0.92646432 0.14707137 0.07353568
[60,] 0.90896060 0.18207879 0.09103940
[61,] 0.89348557 0.21302887 0.10651443
[62,] 0.88248159 0.23503682 0.11751841
[63,] 0.89608336 0.20783328 0.10391664
[64,] 0.88764787 0.22470425 0.11235213
[65,] 0.86445375 0.27109250 0.13554625
[66,] 0.86786593 0.26426814 0.13213407
[67,] 0.86468304 0.27063393 0.13531696
[68,] 0.84057681 0.31884639 0.15942319
[69,] 0.82701497 0.34597006 0.17298503
[70,] 0.79983677 0.40032646 0.20016323
[71,] 0.76993136 0.46013729 0.23006864
[72,] 0.73341881 0.53316237 0.26658119
[73,] 0.69504675 0.60990651 0.30495325
[74,] 0.67688263 0.64623474 0.32311737
[75,] 0.65408348 0.69183303 0.34591652
[76,] 0.77810125 0.44379749 0.22189875
[77,] 0.74190388 0.51619225 0.25809612
[78,] 0.70677305 0.58645391 0.29322695
[79,] 0.66398224 0.67203552 0.33601776
[80,] 0.81716251 0.36567499 0.18283749
[81,] 0.79861287 0.40277427 0.20138713
[82,] 0.83766929 0.32466141 0.16233071
[83,] 0.81128979 0.37742043 0.18871021
[84,] 0.78268833 0.43462335 0.21731167
[85,] 0.74732821 0.50534359 0.25267179
[86,] 0.71323521 0.57352959 0.28676479
[87,] 0.70403250 0.59193499 0.29596750
[88,] 0.69232011 0.61535979 0.30767989
[89,] 0.74466406 0.51067188 0.25533594
[90,] 0.72712739 0.54574522 0.27287261
[91,] 0.68864044 0.62271911 0.31135956
[92,] 0.69455164 0.61089672 0.30544836
[93,] 0.97533727 0.04932546 0.02466273
[94,] 0.96719119 0.06561762 0.03280881
[95,] 0.95905848 0.08188304 0.04094152
[96,] 0.94857589 0.10284822 0.05142411
[97,] 0.93954183 0.12091633 0.06045817
[98,] 0.92443994 0.15112013 0.07556006
[99,] 0.90592423 0.18815154 0.09407577
[100,] 0.89308028 0.21383945 0.10691972
[101,] 0.89349052 0.21301896 0.10650948
[102,] 0.90437857 0.19124285 0.09562143
[103,] 0.87879670 0.24240661 0.12120330
[104,] 0.85777036 0.28445929 0.14222964
[105,] 0.86853108 0.26293785 0.13146892
[106,] 0.91587162 0.16825677 0.08412838
[107,] 0.93264280 0.13471440 0.06735720
[108,] 0.92115725 0.15768550 0.07884275
[109,] 0.90383602 0.19232797 0.09616398
[110,] 0.88184927 0.23630146 0.11815073
[111,] 0.85117896 0.29764208 0.14882104
[112,] 0.82342117 0.35315765 0.17657883
[113,] 0.81977893 0.36044214 0.18022107
[114,] 0.91601637 0.16796726 0.08398363
[115,] 0.89410970 0.21178060 0.10589030
[116,] 0.86491987 0.27016026 0.13508013
[117,] 0.84640261 0.30719478 0.15359739
[118,] 0.80581212 0.38837576 0.19418788
[119,] 0.77334253 0.45331495 0.22665747
[120,] 0.77457848 0.45084304 0.22542152
[121,] 0.72858470 0.54283059 0.27141530
[122,] 0.67658175 0.64683650 0.32341825
[123,] 0.61142542 0.77714916 0.38857458
[124,] 0.53664200 0.92671599 0.46335800
[125,] 0.60095591 0.79808818 0.39904409
[126,] 0.74506411 0.50987177 0.25493589
[127,] 0.75283946 0.49432107 0.24716054
[128,] 0.70744809 0.58510383 0.29255191
[129,] 0.74290826 0.51418348 0.25709174
[130,] 0.72386135 0.55227729 0.27613865
[131,] 0.62135945 0.75728110 0.37864055
[132,] 0.55608349 0.88783302 0.44391651
[133,] 0.51914572 0.96170856 0.48085428
[134,] 0.46353986 0.92707972 0.53646014
[135,] 0.37607612 0.75215224 0.62392388
> postscript(file="/var/wessaorg/rcomp/tmp/137ke1353412866.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/2m43z1353412866.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/35gvf1353412866.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/43wzi1353412866.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/5k5jl1353412866.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 = 150
Frequency = 1
1 2 3 4 5 6
-0.071250472 -0.052973519 0.005646126 0.050178697 0.072274407 0.162684126
7 8 9 10 11 12
-0.152691666 -0.030761144 0.216385604 -0.397421492 -0.257976108 0.419384158
13 14 15 16 17 18
-0.084128804 -0.061421984 0.020314290 0.041550719 0.079068419 0.162255630
19 20 21 22 23 24
-0.169478769 0.123207159 -0.028819311 -0.385203989 0.291321343 0.644086489
25 26 27 28 29 30
-0.097998518 -0.084257545 -0.070217181 0.037910310 0.074087237 0.107416373
31 32 33 34 35 36
0.177643493 -0.165374242 -0.341144617 -0.177657078 -0.346813554 0.280796242
37 38 39 40 41 42
0.272926386 -0.076204863 -0.075484736 -0.073930931 0.029833845 0.073021762
43 44 45 46 47 48
0.148877644 0.352712548 -0.242891250 -0.325899240 -0.485452213 -0.086208268
49 50 51 52 53 54
0.237307023 0.428403213 -0.059725583 -0.068660983 -0.065473113 0.030524068
55 56 57 58 59 60
0.086933401 0.130418210 0.324547279 -0.228416152 -0.320034951 -0.250373606
61 62 63 64 65 66
0.206140257 -0.072470209 0.450619810 -0.073895246 -0.075011930 -0.047279301
67 68 69 70 71 72
0.037165419 0.096973775 0.116840791 0.243766306 -0.166054391 0.023666105
73 74 75 76 77 78
-0.239080154 -0.202598476 -0.059558874 0.109781528 -0.078842211 -0.064406603
79 80 81 82 83 84
-0.033438556 0.045229562 0.128269015 0.116536022 0.399608739 -0.014525266
85 86 87 88 89 90
-0.085893625 -0.005112202 -0.475552867 -0.155007294 0.246366096 -0.069247959
91 92 93 94 95 96
-0.060641008 -0.031080301 0.066917162 0.126311726 0.139628885 0.285228168
97 98 99 100 101 102
0.106582153 -0.042617227 -0.244905828 -0.751068688 -0.066885621 -0.036496184
103 104 105 106 107 108
-0.057326301 -0.063855755 -0.013106708 0.074013591 0.103843512 0.136631320
109 110 111 112 113 114
0.218734846 -0.081767727 0.010155852 -0.263441734 -0.296972197 0.294241003
115 116 117 118 119 120
-0.066479808 -0.035081051 -0.007216905 0.075538303 0.091488941 0.127689852
121 122 123 124 125 126
0.255357464 -0.200721066 -0.212356565 -0.081471842 0.141512639 -0.138840088
127 128 129 130 131 132
-0.080482165 -0.018174505 0.011304100 0.094001484 0.082835372 0.144777148
133 134 135 136 137 138
0.155178534 -0.335319293 -0.252063849 -0.136940725 0.441460386 0.107277329
139 140 141 142 143 144
-0.067827918 -0.034621925 0.018842339 0.086037157 0.094082369 0.129467928
145 146 147 148 149 150
-0.137477132 -0.244268407 -0.089275977 -0.079329486 0.432225488 0.126390350
> postscript(file="/var/wessaorg/rcomp/tmp/6fj5w1353412866.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 = 150
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.071250472 NA
1 -0.052973519 -0.071250472
2 0.005646126 -0.052973519
3 0.050178697 0.005646126
4 0.072274407 0.050178697
5 0.162684126 0.072274407
6 -0.152691666 0.162684126
7 -0.030761144 -0.152691666
8 0.216385604 -0.030761144
9 -0.397421492 0.216385604
10 -0.257976108 -0.397421492
11 0.419384158 -0.257976108
12 -0.084128804 0.419384158
13 -0.061421984 -0.084128804
14 0.020314290 -0.061421984
15 0.041550719 0.020314290
16 0.079068419 0.041550719
17 0.162255630 0.079068419
18 -0.169478769 0.162255630
19 0.123207159 -0.169478769
20 -0.028819311 0.123207159
21 -0.385203989 -0.028819311
22 0.291321343 -0.385203989
23 0.644086489 0.291321343
24 -0.097998518 0.644086489
25 -0.084257545 -0.097998518
26 -0.070217181 -0.084257545
27 0.037910310 -0.070217181
28 0.074087237 0.037910310
29 0.107416373 0.074087237
30 0.177643493 0.107416373
31 -0.165374242 0.177643493
32 -0.341144617 -0.165374242
33 -0.177657078 -0.341144617
34 -0.346813554 -0.177657078
35 0.280796242 -0.346813554
36 0.272926386 0.280796242
37 -0.076204863 0.272926386
38 -0.075484736 -0.076204863
39 -0.073930931 -0.075484736
40 0.029833845 -0.073930931
41 0.073021762 0.029833845
42 0.148877644 0.073021762
43 0.352712548 0.148877644
44 -0.242891250 0.352712548
45 -0.325899240 -0.242891250
46 -0.485452213 -0.325899240
47 -0.086208268 -0.485452213
48 0.237307023 -0.086208268
49 0.428403213 0.237307023
50 -0.059725583 0.428403213
51 -0.068660983 -0.059725583
52 -0.065473113 -0.068660983
53 0.030524068 -0.065473113
54 0.086933401 0.030524068
55 0.130418210 0.086933401
56 0.324547279 0.130418210
57 -0.228416152 0.324547279
58 -0.320034951 -0.228416152
59 -0.250373606 -0.320034951
60 0.206140257 -0.250373606
61 -0.072470209 0.206140257
62 0.450619810 -0.072470209
63 -0.073895246 0.450619810
64 -0.075011930 -0.073895246
65 -0.047279301 -0.075011930
66 0.037165419 -0.047279301
67 0.096973775 0.037165419
68 0.116840791 0.096973775
69 0.243766306 0.116840791
70 -0.166054391 0.243766306
71 0.023666105 -0.166054391
72 -0.239080154 0.023666105
73 -0.202598476 -0.239080154
74 -0.059558874 -0.202598476
75 0.109781528 -0.059558874
76 -0.078842211 0.109781528
77 -0.064406603 -0.078842211
78 -0.033438556 -0.064406603
79 0.045229562 -0.033438556
80 0.128269015 0.045229562
81 0.116536022 0.128269015
82 0.399608739 0.116536022
83 -0.014525266 0.399608739
84 -0.085893625 -0.014525266
85 -0.005112202 -0.085893625
86 -0.475552867 -0.005112202
87 -0.155007294 -0.475552867
88 0.246366096 -0.155007294
89 -0.069247959 0.246366096
90 -0.060641008 -0.069247959
91 -0.031080301 -0.060641008
92 0.066917162 -0.031080301
93 0.126311726 0.066917162
94 0.139628885 0.126311726
95 0.285228168 0.139628885
96 0.106582153 0.285228168
97 -0.042617227 0.106582153
98 -0.244905828 -0.042617227
99 -0.751068688 -0.244905828
100 -0.066885621 -0.751068688
101 -0.036496184 -0.066885621
102 -0.057326301 -0.036496184
103 -0.063855755 -0.057326301
104 -0.013106708 -0.063855755
105 0.074013591 -0.013106708
106 0.103843512 0.074013591
107 0.136631320 0.103843512
108 0.218734846 0.136631320
109 -0.081767727 0.218734846
110 0.010155852 -0.081767727
111 -0.263441734 0.010155852
112 -0.296972197 -0.263441734
113 0.294241003 -0.296972197
114 -0.066479808 0.294241003
115 -0.035081051 -0.066479808
116 -0.007216905 -0.035081051
117 0.075538303 -0.007216905
118 0.091488941 0.075538303
119 0.127689852 0.091488941
120 0.255357464 0.127689852
121 -0.200721066 0.255357464
122 -0.212356565 -0.200721066
123 -0.081471842 -0.212356565
124 0.141512639 -0.081471842
125 -0.138840088 0.141512639
126 -0.080482165 -0.138840088
127 -0.018174505 -0.080482165
128 0.011304100 -0.018174505
129 0.094001484 0.011304100
130 0.082835372 0.094001484
131 0.144777148 0.082835372
132 0.155178534 0.144777148
133 -0.335319293 0.155178534
134 -0.252063849 -0.335319293
135 -0.136940725 -0.252063849
136 0.441460386 -0.136940725
137 0.107277329 0.441460386
138 -0.067827918 0.107277329
139 -0.034621925 -0.067827918
140 0.018842339 -0.034621925
141 0.086037157 0.018842339
142 0.094082369 0.086037157
143 0.129467928 0.094082369
144 -0.137477132 0.129467928
145 -0.244268407 -0.137477132
146 -0.089275977 -0.244268407
147 -0.079329486 -0.089275977
148 0.432225488 -0.079329486
149 0.126390350 0.432225488
150 NA 0.126390350
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.052973519 -0.071250472
[2,] 0.005646126 -0.052973519
[3,] 0.050178697 0.005646126
[4,] 0.072274407 0.050178697
[5,] 0.162684126 0.072274407
[6,] -0.152691666 0.162684126
[7,] -0.030761144 -0.152691666
[8,] 0.216385604 -0.030761144
[9,] -0.397421492 0.216385604
[10,] -0.257976108 -0.397421492
[11,] 0.419384158 -0.257976108
[12,] -0.084128804 0.419384158
[13,] -0.061421984 -0.084128804
[14,] 0.020314290 -0.061421984
[15,] 0.041550719 0.020314290
[16,] 0.079068419 0.041550719
[17,] 0.162255630 0.079068419
[18,] -0.169478769 0.162255630
[19,] 0.123207159 -0.169478769
[20,] -0.028819311 0.123207159
[21,] -0.385203989 -0.028819311
[22,] 0.291321343 -0.385203989
[23,] 0.644086489 0.291321343
[24,] -0.097998518 0.644086489
[25,] -0.084257545 -0.097998518
[26,] -0.070217181 -0.084257545
[27,] 0.037910310 -0.070217181
[28,] 0.074087237 0.037910310
[29,] 0.107416373 0.074087237
[30,] 0.177643493 0.107416373
[31,] -0.165374242 0.177643493
[32,] -0.341144617 -0.165374242
[33,] -0.177657078 -0.341144617
[34,] -0.346813554 -0.177657078
[35,] 0.280796242 -0.346813554
[36,] 0.272926386 0.280796242
[37,] -0.076204863 0.272926386
[38,] -0.075484736 -0.076204863
[39,] -0.073930931 -0.075484736
[40,] 0.029833845 -0.073930931
[41,] 0.073021762 0.029833845
[42,] 0.148877644 0.073021762
[43,] 0.352712548 0.148877644
[44,] -0.242891250 0.352712548
[45,] -0.325899240 -0.242891250
[46,] -0.485452213 -0.325899240
[47,] -0.086208268 -0.485452213
[48,] 0.237307023 -0.086208268
[49,] 0.428403213 0.237307023
[50,] -0.059725583 0.428403213
[51,] -0.068660983 -0.059725583
[52,] -0.065473113 -0.068660983
[53,] 0.030524068 -0.065473113
[54,] 0.086933401 0.030524068
[55,] 0.130418210 0.086933401
[56,] 0.324547279 0.130418210
[57,] -0.228416152 0.324547279
[58,] -0.320034951 -0.228416152
[59,] -0.250373606 -0.320034951
[60,] 0.206140257 -0.250373606
[61,] -0.072470209 0.206140257
[62,] 0.450619810 -0.072470209
[63,] -0.073895246 0.450619810
[64,] -0.075011930 -0.073895246
[65,] -0.047279301 -0.075011930
[66,] 0.037165419 -0.047279301
[67,] 0.096973775 0.037165419
[68,] 0.116840791 0.096973775
[69,] 0.243766306 0.116840791
[70,] -0.166054391 0.243766306
[71,] 0.023666105 -0.166054391
[72,] -0.239080154 0.023666105
[73,] -0.202598476 -0.239080154
[74,] -0.059558874 -0.202598476
[75,] 0.109781528 -0.059558874
[76,] -0.078842211 0.109781528
[77,] -0.064406603 -0.078842211
[78,] -0.033438556 -0.064406603
[79,] 0.045229562 -0.033438556
[80,] 0.128269015 0.045229562
[81,] 0.116536022 0.128269015
[82,] 0.399608739 0.116536022
[83,] -0.014525266 0.399608739
[84,] -0.085893625 -0.014525266
[85,] -0.005112202 -0.085893625
[86,] -0.475552867 -0.005112202
[87,] -0.155007294 -0.475552867
[88,] 0.246366096 -0.155007294
[89,] -0.069247959 0.246366096
[90,] -0.060641008 -0.069247959
[91,] -0.031080301 -0.060641008
[92,] 0.066917162 -0.031080301
[93,] 0.126311726 0.066917162
[94,] 0.139628885 0.126311726
[95,] 0.285228168 0.139628885
[96,] 0.106582153 0.285228168
[97,] -0.042617227 0.106582153
[98,] -0.244905828 -0.042617227
[99,] -0.751068688 -0.244905828
[100,] -0.066885621 -0.751068688
[101,] -0.036496184 -0.066885621
[102,] -0.057326301 -0.036496184
[103,] -0.063855755 -0.057326301
[104,] -0.013106708 -0.063855755
[105,] 0.074013591 -0.013106708
[106,] 0.103843512 0.074013591
[107,] 0.136631320 0.103843512
[108,] 0.218734846 0.136631320
[109,] -0.081767727 0.218734846
[110,] 0.010155852 -0.081767727
[111,] -0.263441734 0.010155852
[112,] -0.296972197 -0.263441734
[113,] 0.294241003 -0.296972197
[114,] -0.066479808 0.294241003
[115,] -0.035081051 -0.066479808
[116,] -0.007216905 -0.035081051
[117,] 0.075538303 -0.007216905
[118,] 0.091488941 0.075538303
[119,] 0.127689852 0.091488941
[120,] 0.255357464 0.127689852
[121,] -0.200721066 0.255357464
[122,] -0.212356565 -0.200721066
[123,] -0.081471842 -0.212356565
[124,] 0.141512639 -0.081471842
[125,] -0.138840088 0.141512639
[126,] -0.080482165 -0.138840088
[127,] -0.018174505 -0.080482165
[128,] 0.011304100 -0.018174505
[129,] 0.094001484 0.011304100
[130,] 0.082835372 0.094001484
[131,] 0.144777148 0.082835372
[132,] 0.155178534 0.144777148
[133,] -0.335319293 0.155178534
[134,] -0.252063849 -0.335319293
[135,] -0.136940725 -0.252063849
[136,] 0.441460386 -0.136940725
[137,] 0.107277329 0.441460386
[138,] -0.067827918 0.107277329
[139,] -0.034621925 -0.067827918
[140,] 0.018842339 -0.034621925
[141,] 0.086037157 0.018842339
[142,] 0.094082369 0.086037157
[143,] 0.129467928 0.094082369
[144,] -0.137477132 0.129467928
[145,] -0.244268407 -0.137477132
[146,] -0.089275977 -0.244268407
[147,] -0.079329486 -0.089275977
[148,] 0.432225488 -0.079329486
[149,] 0.126390350 0.432225488
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.052973519 -0.071250472
2 0.005646126 -0.052973519
3 0.050178697 0.005646126
4 0.072274407 0.050178697
5 0.162684126 0.072274407
6 -0.152691666 0.162684126
7 -0.030761144 -0.152691666
8 0.216385604 -0.030761144
9 -0.397421492 0.216385604
10 -0.257976108 -0.397421492
11 0.419384158 -0.257976108
12 -0.084128804 0.419384158
13 -0.061421984 -0.084128804
14 0.020314290 -0.061421984
15 0.041550719 0.020314290
16 0.079068419 0.041550719
17 0.162255630 0.079068419
18 -0.169478769 0.162255630
19 0.123207159 -0.169478769
20 -0.028819311 0.123207159
21 -0.385203989 -0.028819311
22 0.291321343 -0.385203989
23 0.644086489 0.291321343
24 -0.097998518 0.644086489
25 -0.084257545 -0.097998518
26 -0.070217181 -0.084257545
27 0.037910310 -0.070217181
28 0.074087237 0.037910310
29 0.107416373 0.074087237
30 0.177643493 0.107416373
31 -0.165374242 0.177643493
32 -0.341144617 -0.165374242
33 -0.177657078 -0.341144617
34 -0.346813554 -0.177657078
35 0.280796242 -0.346813554
36 0.272926386 0.280796242
37 -0.076204863 0.272926386
38 -0.075484736 -0.076204863
39 -0.073930931 -0.075484736
40 0.029833845 -0.073930931
41 0.073021762 0.029833845
42 0.148877644 0.073021762
43 0.352712548 0.148877644
44 -0.242891250 0.352712548
45 -0.325899240 -0.242891250
46 -0.485452213 -0.325899240
47 -0.086208268 -0.485452213
48 0.237307023 -0.086208268
49 0.428403213 0.237307023
50 -0.059725583 0.428403213
51 -0.068660983 -0.059725583
52 -0.065473113 -0.068660983
53 0.030524068 -0.065473113
54 0.086933401 0.030524068
55 0.130418210 0.086933401
56 0.324547279 0.130418210
57 -0.228416152 0.324547279
58 -0.320034951 -0.228416152
59 -0.250373606 -0.320034951
60 0.206140257 -0.250373606
61 -0.072470209 0.206140257
62 0.450619810 -0.072470209
63 -0.073895246 0.450619810
64 -0.075011930 -0.073895246
65 -0.047279301 -0.075011930
66 0.037165419 -0.047279301
67 0.096973775 0.037165419
68 0.116840791 0.096973775
69 0.243766306 0.116840791
70 -0.166054391 0.243766306
71 0.023666105 -0.166054391
72 -0.239080154 0.023666105
73 -0.202598476 -0.239080154
74 -0.059558874 -0.202598476
75 0.109781528 -0.059558874
76 -0.078842211 0.109781528
77 -0.064406603 -0.078842211
78 -0.033438556 -0.064406603
79 0.045229562 -0.033438556
80 0.128269015 0.045229562
81 0.116536022 0.128269015
82 0.399608739 0.116536022
83 -0.014525266 0.399608739
84 -0.085893625 -0.014525266
85 -0.005112202 -0.085893625
86 -0.475552867 -0.005112202
87 -0.155007294 -0.475552867
88 0.246366096 -0.155007294
89 -0.069247959 0.246366096
90 -0.060641008 -0.069247959
91 -0.031080301 -0.060641008
92 0.066917162 -0.031080301
93 0.126311726 0.066917162
94 0.139628885 0.126311726
95 0.285228168 0.139628885
96 0.106582153 0.285228168
97 -0.042617227 0.106582153
98 -0.244905828 -0.042617227
99 -0.751068688 -0.244905828
100 -0.066885621 -0.751068688
101 -0.036496184 -0.066885621
102 -0.057326301 -0.036496184
103 -0.063855755 -0.057326301
104 -0.013106708 -0.063855755
105 0.074013591 -0.013106708
106 0.103843512 0.074013591
107 0.136631320 0.103843512
108 0.218734846 0.136631320
109 -0.081767727 0.218734846
110 0.010155852 -0.081767727
111 -0.263441734 0.010155852
112 -0.296972197 -0.263441734
113 0.294241003 -0.296972197
114 -0.066479808 0.294241003
115 -0.035081051 -0.066479808
116 -0.007216905 -0.035081051
117 0.075538303 -0.007216905
118 0.091488941 0.075538303
119 0.127689852 0.091488941
120 0.255357464 0.127689852
121 -0.200721066 0.255357464
122 -0.212356565 -0.200721066
123 -0.081471842 -0.212356565
124 0.141512639 -0.081471842
125 -0.138840088 0.141512639
126 -0.080482165 -0.138840088
127 -0.018174505 -0.080482165
128 0.011304100 -0.018174505
129 0.094001484 0.011304100
130 0.082835372 0.094001484
131 0.144777148 0.082835372
132 0.155178534 0.144777148
133 -0.335319293 0.155178534
134 -0.252063849 -0.335319293
135 -0.136940725 -0.252063849
136 0.441460386 -0.136940725
137 0.107277329 0.441460386
138 -0.067827918 0.107277329
139 -0.034621925 -0.067827918
140 0.018842339 -0.034621925
141 0.086037157 0.018842339
142 0.094082369 0.086037157
143 0.129467928 0.094082369
144 -0.137477132 0.129467928
145 -0.244268407 -0.137477132
146 -0.089275977 -0.244268407
147 -0.079329486 -0.089275977
148 0.432225488 -0.079329486
149 0.126390350 0.432225488
> 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/784cu1353412866.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/8nlls1353412866.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/9aumg1353412867.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/10papn1353412867.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/115y971353412867.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/120uhx1353412867.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/13aul21353412867.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/14uwbz1353412867.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/15s2el1353412867.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/16y3nw1353412867.tab")
+ }
>
> try(system("convert tmp/137ke1353412866.ps tmp/137ke1353412866.png",intern=TRUE))
character(0)
> try(system("convert tmp/2m43z1353412866.ps tmp/2m43z1353412866.png",intern=TRUE))
character(0)
> try(system("convert tmp/35gvf1353412866.ps tmp/35gvf1353412866.png",intern=TRUE))
character(0)
> try(system("convert tmp/43wzi1353412866.ps tmp/43wzi1353412866.png",intern=TRUE))
character(0)
> try(system("convert tmp/5k5jl1353412866.ps tmp/5k5jl1353412866.png",intern=TRUE))
character(0)
> try(system("convert tmp/6fj5w1353412866.ps tmp/6fj5w1353412866.png",intern=TRUE))
character(0)
> try(system("convert tmp/784cu1353412866.ps tmp/784cu1353412866.png",intern=TRUE))
character(0)
> try(system("convert tmp/8nlls1353412866.ps tmp/8nlls1353412866.png",intern=TRUE))
character(0)
> try(system("convert tmp/9aumg1353412867.ps tmp/9aumg1353412867.png",intern=TRUE))
character(0)
> try(system("convert tmp/10papn1353412867.ps tmp/10papn1353412867.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
11.402 1.349 12.801