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(97687
+ ,70863
+ ,28779
+ ,19459
+ ,35054
+ ,49638
+ ,119087
+ ,90582
+ ,34943
+ ,13292
+ ,33932
+ ,98512
+ ,70806
+ ,28802
+ ,19266
+ ,34984
+ ,49566
+ ,117267
+ ,89214
+ ,35155
+ ,13124
+ ,33287
+ ,98673
+ ,69484
+ ,28027
+ ,18661
+ ,32996
+ ,48268
+ ,116417
+ ,87633
+ ,33835
+ ,12934
+ ,32871
+ ,96028
+ ,70150
+ ,28551
+ ,18153
+ ,32864
+ ,49060
+ ,114582
+ ,86279
+ ,34146
+ ,12654
+ ,31738
+ ,98014
+ ,69210
+ ,28159
+ ,18151
+ ,31943
+ ,48473
+ ,114804
+ ,86370
+ ,33357
+ ,12649
+ ,31645
+ ,95580
+ ,68733
+ ,28354
+ ,18431
+ ,32032
+ ,49063
+ ,115956
+ ,87056
+ ,33275
+ ,12828
+ ,31634
+ ,97838
+ ,75930
+ ,32439
+ ,19867
+ ,37740
+ ,55813
+ ,121919
+ ,91972
+ ,38126
+ ,13997
+ ,33926
+ ,97760
+ ,76162
+ ,33368
+ ,20508
+ ,37430
+ ,55878
+ ,124049
+ ,93651
+ ,37798
+ ,14484
+ ,34721
+ ,99913
+ ,73891
+ ,31846
+ ,20761
+ ,35681
+ ,53075
+ ,124286
+ ,94551
+ ,36087
+ ,14733
+ ,35092
+ ,97588
+ ,67348
+ ,28765
+ ,20390
+ ,32042
+ ,47957
+ ,121491
+ ,91188
+ ,32683
+ ,14207
+ ,33966
+ ,93942
+ ,64297
+ ,27107
+ ,19781
+ ,30623
+ ,45030
+ ,118314
+ ,88686
+ ,30865
+ ,13854
+ ,33243
+ ,93656
+ ,63111
+ ,26368
+ ,19147
+ ,30335
+ ,44401
+ ,116786
+ ,86821
+ ,30381
+ ,13619
+ ,32649
+ ,93365
+ ,63263
+ ,26444
+ ,19359
+ ,30294
+ ,44364
+ ,118038
+ ,88490
+ ,30216
+ ,13679
+ ,33064
+ ,92881
+ ,60733
+ ,25326
+ ,19110
+ ,28507
+ ,42489
+ ,116710
+ ,88003
+ ,28631
+ ,13417
+ ,33047
+ ,93120
+ ,58521
+ ,24375
+ ,18179
+ ,26903
+ ,40994
+ ,112999
+ ,84371
+ ,27313
+ ,12957
+ ,31941
+ ,91063
+ ,56734
+ ,23899
+ ,18342
+ ,25504
+ ,40001
+ ,113754
+ ,85368
+ ,26470
+ ,12833
+ ,31951
+ ,90930
+ ,55327
+ ,23065
+ ,17765
+ ,24488
+ ,38675
+ ,110388
+ ,81981
+ ,25747
+ ,12147
+ ,30525
+ ,91946
+ ,55257
+ ,23279
+ ,16691
+ ,25011
+ ,38933
+ ,104055
+ ,76861
+ ,25573
+ ,11735
+ ,29321
+ ,94624
+ ,64301
+ ,28134
+ ,18529
+ ,31224
+ ,47441
+ ,112205
+ ,82785
+ ,31200
+ ,12766
+ ,32153
+ ,95484
+ ,64261
+ ,28438
+ ,19177
+ ,31192
+ ,47431
+ ,115302
+ ,85314
+ ,31066
+ ,13444
+ ,33482
+ ,95862
+ ,59119
+ ,25717
+ ,18764
+ ,27630
+ ,42799
+ ,113290
+ ,84691
+ ,27251
+ ,13584
+ ,32950
+ ,95530
+ ,56530
+ ,24125
+ ,18448
+ ,26423
+ ,40844
+ ,111036
+ ,82758
+ ,25554
+ ,13355
+ ,32467
+ ,94574
+ ,54445
+ ,23050
+ ,17574
+ ,25703
+ ,39053
+ ,107273
+ ,79645
+ ,24193
+ ,12830
+ ,31506
+ ,94677
+ ,55462
+ ,23489
+ ,17561
+ ,26834
+ ,40408
+ ,107007
+ ,79663
+ ,25104
+ ,12649
+ ,31404
+ ,93845
+ ,55333
+ ,23238
+ ,17784
+ ,26563
+ ,40033
+ ,108862
+ ,81661
+ ,24534
+ ,13072
+ ,31997
+ ,91533
+ ,54048
+ ,22625
+ ,17786
+ ,25515
+ ,38550
+ ,108383
+ ,81269
+ ,23444
+ ,12803
+ ,31605
+ ,91214
+ ,53213
+ ,22223
+ ,16748
+ ,24583
+ ,38694
+ ,103508
+ ,77079
+ ,23201
+ ,12217
+ ,29942
+ ,90922
+ ,52764
+ ,22036
+ ,16788
+ ,23834
+ ,38156
+ ,103459
+ ,77499
+ ,22822
+ ,12041
+ ,29922
+ ,89563
+ ,49933
+ ,20921
+ ,15966
+ ,22274
+ ,36027
+ ,99384
+ ,73724
+ ,21846
+ ,11233
+ ,28486
+ ,89945
+ ,51515
+ ,21982
+ ,16291
+ ,23943
+ ,37659
+ ,99649
+ ,73841
+ ,23015
+ ,11224
+ ,28516
+ ,91850
+ ,59302
+ ,25828
+ ,17939
+ ,29226
+ ,44630
+ ,107542
+ ,80755
+ ,27544
+ ,12593
+ ,31170
+ ,92505
+ ,59681
+ ,26099
+ ,18171
+ ,29528
+ ,44467
+ ,108831
+ ,81806
+ ,27294
+ ,13126
+ ,32082
+ ,92437
+ ,56195
+ ,24168
+ ,17691
+ ,27446
+ ,41585
+ ,107473
+ ,81450
+ ,24936
+ ,13053
+ ,31511
+ ,93876
+ ,55210
+ ,23333
+ ,17095
+ ,26148
+ ,40133
+ ,104079
+ ,78725
+ ,24538
+ ,12527
+ ,30510
+ ,93561
+ ,54698
+ ,22695
+ ,17007
+ ,26303
+ ,39012
+ ,103497
+ ,78109
+ ,24119
+ ,12522
+ ,30343
+ ,94119
+ ,57875
+ ,23884
+ ,16992
+ ,28112
+ ,41902
+ ,104741
+ ,79089
+ ,26264
+ ,12722
+ ,30441
+ ,95264
+ ,60611
+ ,24835
+ ,17118
+ ,29610
+ ,43440
+ ,105625
+ ,79831
+ ,27916
+ ,13060
+ ,30912
+ ,96089
+ ,61857
+ ,24930
+ ,17349
+ ,29902
+ ,44214
+ ,105908
+ ,80080
+ ,28323
+ ,13006
+ ,30980
+ ,97160
+ ,62885
+ ,25283
+ ,17399
+ ,30065
+ ,44529
+ ,106028
+ ,80377
+ ,28801
+ ,12870
+ ,30925
+ ,98644
+ ,62313
+ ,25056
+ ,17547
+ ,29027
+ ,44052
+ ,106619
+ ,81034
+ ,28458
+ ,12929
+ ,30856
+ ,96266
+ ,62056
+ ,24583
+ ,16962
+ ,28238
+ ,43318
+ ,103930
+ ,78207
+ ,27810
+ ,12365
+ ,29862
+ ,97938
+ ,64702
+ ,25967
+ ,17125
+ ,29823
+ ,45333
+ ,104216
+ ,79197
+ ,29484
+ ,12384
+ ,30045
+ ,99757
+ ,72334
+ ,30042
+ ,19119
+ ,35004
+ ,52043
+ ,112086
+ ,85448
+ ,34109
+ ,13801
+ ,32827
+ ,101550
+ ,73577
+ ,31011
+ ,19691
+ ,35596
+ ,52545
+ ,113824
+ ,86899
+ ,34170
+ ,14421
+ ,33310
+ ,102449
+ ,70290
+ ,29404
+ ,19274
+ ,33112
+ ,49331
+ ,111904
+ ,85899
+ ,31989
+ ,14097
+ ,32774
+ ,102416
+ ,68633
+ ,28233
+ ,18743
+ ,31710
+ ,47736
+ ,108435
+ ,82824
+ ,30591
+ ,13656
+ ,31501
+ ,102491
+ ,68311
+ ,27552
+ ,18577
+ ,31794
+ ,46786
+ ,106798
+ ,80785
+ ,29999
+ ,13375
+ ,31092
+ ,102495
+ ,73335
+ ,29009
+ ,18629
+ ,34412
+ ,50367
+ ,107841
+ ,81061
+ ,33253
+ ,13493
+ ,31198
+ ,104552
+ ,71257
+ ,28645
+ ,19245
+ ,33735
+ ,48695
+ ,111377
+ ,84209
+ ,31988
+ ,13885
+ ,32524
+ ,104798
+ ,70743
+ ,28472
+ ,18998
+ ,33143
+ ,48439
+ ,109589
+ ,82931
+ ,31791
+ ,13788
+ ,32069
+ ,104947
+ ,68932
+ ,27613
+ ,18662
+ ,31682
+ ,46993
+ ,107481
+ ,81327
+ ,30596
+ ,13529
+ ,31488
+ ,103950
+ ,68045
+ ,27078
+ ,17937
+ ,30483
+ ,46454
+ ,105055
+ ,78790
+ ,30136
+ ,13090
+ ,30513
+ ,102858
+ ,66338
+ ,26260
+ ,17421
+ ,29281
+ ,44895
+ ,102265
+ ,76645
+ ,28948
+ ,12529
+ ,29594
+ ,106952
+ ,67339
+ ,27078
+ ,17708
+ ,29589
+ ,45313
+ ,102323
+ ,76614
+ ,29244
+ ,12690
+ ,29836
+ ,110901
+ ,75744
+ ,31018
+ ,19608
+ ,35155
+ ,52826
+ ,110832
+ ,83558
+ ,34396
+ ,14137
+ ,32816
+ ,107706
+ ,76098
+ ,31546
+ ,20209
+ ,35198
+ ,52560
+ ,112899
+ ,85307
+ ,34125
+ ,14887
+ ,33843
+ ,111267
+ ,71483
+ ,29293
+ ,19983
+ ,32032
+ ,48224
+ ,110949
+ ,84348
+ ,30836
+ ,14661
+ ,33035
+ ,107643
+ ,69240
+ ,28528
+ ,19256
+ ,30642
+ ,46029
+ ,106594
+ ,81247
+ ,29116
+ ,13827
+ ,31546
+ ,105387
+ ,66421
+ ,27151
+ ,18582
+ ,30011
+ ,44262
+ ,104743
+ ,79685
+ ,27925
+ ,13530
+ ,30907
+ ,105718
+ ,67840
+ ,27241
+ ,18430
+ ,30464
+ ,45453
+ ,103932
+ ,79365
+ ,28836
+ ,13383
+ ,30512
+ ,106039
+ ,69663
+ ,27640
+ ,18154
+ ,30981
+ ,45671
+ ,104727
+ ,79577
+ ,29134
+ ,13569
+ ,30499
+ ,106203
+ ,68564
+ ,27106
+ ,18023
+ ,30010
+ ,44620
+ ,103163
+ ,78666
+ ,28180
+ ,13324
+ ,30111
+ ,105558
+ ,67149
+ ,26457
+ ,17821
+ ,28403
+ ,43467
+ ,102364
+ ,78790
+ ,27208
+ ,13166
+ ,29941
+ ,105230
+ ,65656
+ ,25897
+ ,17482
+ ,26988
+ ,42542
+ ,100650
+ ,77396
+ ,26744
+ ,12777
+ ,29215
+ ,104864
+ ,64412
+ ,25227
+ ,17243
+ ,25903
+ ,41161
+ ,99513
+ ,75712
+ ,25711
+ ,12390
+ ,28413
+ ,104374
+ ,63910
+ ,25405
+ ,17097
+ ,25893
+ ,41407
+ ,98565
+ ,75456
+ ,25895
+ ,12225
+ ,28427
+ ,107450
+ ,71415
+ ,29466
+ ,18885
+ ,31220
+ ,48444
+ ,106846
+ ,82648
+ ,30979
+ ,13706
+ ,31214
+ ,108173
+ ,71369
+ ,29824
+ ,19738
+ ,31486
+ ,47924
+ ,110051
+ ,84929
+ ,30848
+ ,14431
+ ,32529
+ ,108629
+ ,68474
+ ,28357
+ ,19359
+ ,29343
+ ,45206
+ ,106968
+ ,82731
+ ,28760
+ ,13860
+ ,31593
+ ,107847
+ ,66073
+ ,27117
+ ,18854
+ ,27972
+ ,42923
+ ,104773
+ ,80655
+ ,27483
+ ,13303
+ ,30612
+ ,107394
+ ,64685
+ ,26136
+ ,18670
+ ,27699
+ ,41532
+ ,103209
+ ,79635
+ ,26372
+ ,13075
+ ,30305
+ ,106278
+ ,66445
+ ,26481
+ ,18338
+ ,28746
+ ,42860
+ ,102176
+ ,78882
+ ,27455
+ ,13096
+ ,29978
+ ,107733
+ ,70281
+ ,27876
+ ,19102
+ ,30786
+ ,45173
+ ,105190
+ ,81507
+ ,29467
+ ,13652
+ ,30882
+ ,107573
+ ,70149
+ ,27531
+ ,19070
+ ,30055
+ ,45079
+ ,104718
+ ,81284
+ ,29106
+ ,13568
+ ,30552
+ ,107500
+ ,68677
+ ,26899
+ ,18232
+ ,28534
+ ,43751
+ ,101671
+ ,79593
+ ,28117
+ ,13034
+ ,29724
+ ,106382
+ ,67404
+ ,26335
+ ,17990
+ ,27189
+ ,43087
+ ,100434
+ ,78122
+ ,27380
+ ,12804
+ ,29225
+ ,104412
+ ,66627
+ ,26044
+ ,17740
+ ,26378
+ ,42257
+ ,98870
+ ,77192
+ ,26916
+ ,12520
+ ,28720
+ ,105871
+ ,66856
+ ,26429
+ ,17649
+ ,26523
+ ,42563
+ ,98374
+ ,77669
+ ,27051
+ ,12622
+ ,28848
+ ,108767
+ ,73889
+ ,29970
+ ,19729
+ ,30999
+ ,48299
+ ,107670
+ ,84926
+ ,31262
+ ,14285
+ ,31948
+ ,109728
+ ,76518
+ ,31450
+ ,20370
+ ,33356
+ ,50385
+ ,110188
+ ,86563
+ ,32616
+ ,14767
+ ,32773
+ ,109769
+ ,74592
+ ,29910
+ ,20060
+ ,31794
+ ,48600
+ ,106972
+ ,84766
+ ,31326
+ ,14377
+ ,31609
+ ,109609
+ ,73417
+ ,28905
+ ,19441
+ ,30973
+ ,46726
+ ,104495
+ ,82590
+ ,30485
+ ,13854
+ ,30982)
+ ,dim=c(11
+ ,82)
+ ,dimnames=list(c('Werkloosheid_BRUSSELS_HOOFDSTEDELIJK_GEWEST'
+ ,'Werkloosheid_ANTWERPEN'
+ ,'Werkloosheid_VLAAMS-BRABANT'
+ ,'Werkloosheid_WAALS-BRABANT'
+ ,'Werkloosheid_WEST-VLAANDEREN'
+ ,'Werkloosheid_OOST-VLAANDEREN'
+ ,'Werkloosheid_HENEGOUWEN'
+ ,'Werkloosheid_LUIK'
+ ,'Werkloosheid_LIMBURG'
+ ,'Werkloosheid_LUXEMBURG'
+ ,'Werkloosheid_NAMEN')
+ ,1:82))
> y <- array(NA,dim=c(11,82),dimnames=list(c('Werkloosheid_BRUSSELS_HOOFDSTEDELIJK_GEWEST','Werkloosheid_ANTWERPEN','Werkloosheid_VLAAMS-BRABANT','Werkloosheid_WAALS-BRABANT','Werkloosheid_WEST-VLAANDEREN','Werkloosheid_OOST-VLAANDEREN','Werkloosheid_HENEGOUWEN','Werkloosheid_LUIK','Werkloosheid_LIMBURG','Werkloosheid_LUXEMBURG','Werkloosheid_NAMEN'),1:82))
> 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 = 'Include Monthly Dummies'
> par1 = '1'
> 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
Werkloosheid_BRUSSELS_HOOFDSTEDELIJK_GEWEST Werkloosheid_ANTWERPEN
1 97687 70863
2 98512 70806
3 98673 69484
4 96028 70150
5 98014 69210
6 95580 68733
7 97838 75930
8 97760 76162
9 99913 73891
10 97588 67348
11 93942 64297
12 93656 63111
13 93365 63263
14 92881 60733
15 93120 58521
16 91063 56734
17 90930 55327
18 91946 55257
19 94624 64301
20 95484 64261
21 95862 59119
22 95530 56530
23 94574 54445
24 94677 55462
25 93845 55333
26 91533 54048
27 91214 53213
28 90922 52764
29 89563 49933
30 89945 51515
31 91850 59302
32 92505 59681
33 92437 56195
34 93876 55210
35 93561 54698
36 94119 57875
37 95264 60611
38 96089 61857
39 97160 62885
40 98644 62313
41 96266 62056
42 97938 64702
43 99757 72334
44 101550 73577
45 102449 70290
46 102416 68633
47 102491 68311
48 102495 73335
49 104552 71257
50 104798 70743
51 104947 68932
52 103950 68045
53 102858 66338
54 106952 67339
55 110901 75744
56 107706 76098
57 111267 71483
58 107643 69240
59 105387 66421
60 105718 67840
61 106039 69663
62 106203 68564
63 105558 67149
64 105230 65656
65 104864 64412
66 104374 63910
67 107450 71415
68 108173 71369
69 108629 68474
70 107847 66073
71 107394 64685
72 106278 66445
73 107733 70281
74 107573 70149
75 107500 68677
76 106382 67404
77 104412 66627
78 105871 66856
79 108767 73889
80 109728 76518
81 109769 74592
82 109609 73417
Werkloosheid_VLAAMS-BRABANT Werkloosheid_WAALS-BRABANT
1 28779 19459
2 28802 19266
3 28027 18661
4 28551 18153
5 28159 18151
6 28354 18431
7 32439 19867
8 33368 20508
9 31846 20761
10 28765 20390
11 27107 19781
12 26368 19147
13 26444 19359
14 25326 19110
15 24375 18179
16 23899 18342
17 23065 17765
18 23279 16691
19 28134 18529
20 28438 19177
21 25717 18764
22 24125 18448
23 23050 17574
24 23489 17561
25 23238 17784
26 22625 17786
27 22223 16748
28 22036 16788
29 20921 15966
30 21982 16291
31 25828 17939
32 26099 18171
33 24168 17691
34 23333 17095
35 22695 17007
36 23884 16992
37 24835 17118
38 24930 17349
39 25283 17399
40 25056 17547
41 24583 16962
42 25967 17125
43 30042 19119
44 31011 19691
45 29404 19274
46 28233 18743
47 27552 18577
48 29009 18629
49 28645 19245
50 28472 18998
51 27613 18662
52 27078 17937
53 26260 17421
54 27078 17708
55 31018 19608
56 31546 20209
57 29293 19983
58 28528 19256
59 27151 18582
60 27241 18430
61 27640 18154
62 27106 18023
63 26457 17821
64 25897 17482
65 25227 17243
66 25405 17097
67 29466 18885
68 29824 19738
69 28357 19359
70 27117 18854
71 26136 18670
72 26481 18338
73 27876 19102
74 27531 19070
75 26899 18232
76 26335 17990
77 26044 17740
78 26429 17649
79 29970 19729
80 31450 20370
81 29910 20060
82 28905 19441
Werkloosheid_WEST-VLAANDEREN Werkloosheid_OOST-VLAANDEREN
1 35054 49638
2 34984 49566
3 32996 48268
4 32864 49060
5 31943 48473
6 32032 49063
7 37740 55813
8 37430 55878
9 35681 53075
10 32042 47957
11 30623 45030
12 30335 44401
13 30294 44364
14 28507 42489
15 26903 40994
16 25504 40001
17 24488 38675
18 25011 38933
19 31224 47441
20 31192 47431
21 27630 42799
22 26423 40844
23 25703 39053
24 26834 40408
25 26563 40033
26 25515 38550
27 24583 38694
28 23834 38156
29 22274 36027
30 23943 37659
31 29226 44630
32 29528 44467
33 27446 41585
34 26148 40133
35 26303 39012
36 28112 41902
37 29610 43440
38 29902 44214
39 30065 44529
40 29027 44052
41 28238 43318
42 29823 45333
43 35004 52043
44 35596 52545
45 33112 49331
46 31710 47736
47 31794 46786
48 34412 50367
49 33735 48695
50 33143 48439
51 31682 46993
52 30483 46454
53 29281 44895
54 29589 45313
55 35155 52826
56 35198 52560
57 32032 48224
58 30642 46029
59 30011 44262
60 30464 45453
61 30981 45671
62 30010 44620
63 28403 43467
64 26988 42542
65 25903 41161
66 25893 41407
67 31220 48444
68 31486 47924
69 29343 45206
70 27972 42923
71 27699 41532
72 28746 42860
73 30786 45173
74 30055 45079
75 28534 43751
76 27189 43087
77 26378 42257
78 26523 42563
79 30999 48299
80 33356 50385
81 31794 48600
82 30973 46726
Werkloosheid_HENEGOUWEN Werkloosheid_LUIK Werkloosheid_LIMBURG
1 119087 90582 34943
2 117267 89214 35155
3 116417 87633 33835
4 114582 86279 34146
5 114804 86370 33357
6 115956 87056 33275
7 121919 91972 38126
8 124049 93651 37798
9 124286 94551 36087
10 121491 91188 32683
11 118314 88686 30865
12 116786 86821 30381
13 118038 88490 30216
14 116710 88003 28631
15 112999 84371 27313
16 113754 85368 26470
17 110388 81981 25747
18 104055 76861 25573
19 112205 82785 31200
20 115302 85314 31066
21 113290 84691 27251
22 111036 82758 25554
23 107273 79645 24193
24 107007 79663 25104
25 108862 81661 24534
26 108383 81269 23444
27 103508 77079 23201
28 103459 77499 22822
29 99384 73724 21846
30 99649 73841 23015
31 107542 80755 27544
32 108831 81806 27294
33 107473 81450 24936
34 104079 78725 24538
35 103497 78109 24119
36 104741 79089 26264
37 105625 79831 27916
38 105908 80080 28323
39 106028 80377 28801
40 106619 81034 28458
41 103930 78207 27810
42 104216 79197 29484
43 112086 85448 34109
44 113824 86899 34170
45 111904 85899 31989
46 108435 82824 30591
47 106798 80785 29999
48 107841 81061 33253
49 111377 84209 31988
50 109589 82931 31791
51 107481 81327 30596
52 105055 78790 30136
53 102265 76645 28948
54 102323 76614 29244
55 110832 83558 34396
56 112899 85307 34125
57 110949 84348 30836
58 106594 81247 29116
59 104743 79685 27925
60 103932 79365 28836
61 104727 79577 29134
62 103163 78666 28180
63 102364 78790 27208
64 100650 77396 26744
65 99513 75712 25711
66 98565 75456 25895
67 106846 82648 30979
68 110051 84929 30848
69 106968 82731 28760
70 104773 80655 27483
71 103209 79635 26372
72 102176 78882 27455
73 105190 81507 29467
74 104718 81284 29106
75 101671 79593 28117
76 100434 78122 27380
77 98870 77192 26916
78 98374 77669 27051
79 107670 84926 31262
80 110188 86563 32616
81 106972 84766 31326
82 104495 82590 30485
Werkloosheid_LUXEMBURG Werkloosheid_NAMEN M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 13292 33932 1 0 0 0 0 0 0 0 0 0 0
2 13124 33287 0 1 0 0 0 0 0 0 0 0 0
3 12934 32871 0 0 1 0 0 0 0 0 0 0 0
4 12654 31738 0 0 0 1 0 0 0 0 0 0 0
5 12649 31645 0 0 0 0 1 0 0 0 0 0 0
6 12828 31634 0 0 0 0 0 1 0 0 0 0 0
7 13997 33926 0 0 0 0 0 0 1 0 0 0 0
8 14484 34721 0 0 0 0 0 0 0 1 0 0 0
9 14733 35092 0 0 0 0 0 0 0 0 1 0 0
10 14207 33966 0 0 0 0 0 0 0 0 0 1 0
11 13854 33243 0 0 0 0 0 0 0 0 0 0 1
12 13619 32649 0 0 0 0 0 0 0 0 0 0 0
13 13679 33064 1 0 0 0 0 0 0 0 0 0 0
14 13417 33047 0 1 0 0 0 0 0 0 0 0 0
15 12957 31941 0 0 1 0 0 0 0 0 0 0 0
16 12833 31951 0 0 0 1 0 0 0 0 0 0 0
17 12147 30525 0 0 0 0 1 0 0 0 0 0 0
18 11735 29321 0 0 0 0 0 1 0 0 0 0 0
19 12766 32153 0 0 0 0 0 0 1 0 0 0 0
20 13444 33482 0 0 0 0 0 0 0 1 0 0 0
21 13584 32950 0 0 0 0 0 0 0 0 1 0 0
22 13355 32467 0 0 0 0 0 0 0 0 0 1 0
23 12830 31506 0 0 0 0 0 0 0 0 0 0 1
24 12649 31404 0 0 0 0 0 0 0 0 0 0 0
25 13072 31997 1 0 0 0 0 0 0 0 0 0 0
26 12803 31605 0 1 0 0 0 0 0 0 0 0 0
27 12217 29942 0 0 1 0 0 0 0 0 0 0 0
28 12041 29922 0 0 0 1 0 0 0 0 0 0 0
29 11233 28486 0 0 0 0 1 0 0 0 0 0 0
30 11224 28516 0 0 0 0 0 1 0 0 0 0 0
31 12593 31170 0 0 0 0 0 0 1 0 0 0 0
32 13126 32082 0 0 0 0 0 0 0 1 0 0 0
33 13053 31511 0 0 0 0 0 0 0 0 1 0 0
34 12527 30510 0 0 0 0 0 0 0 0 0 1 0
35 12522 30343 0 0 0 0 0 0 0 0 0 0 1
36 12722 30441 0 0 0 0 0 0 0 0 0 0 0
37 13060 30912 1 0 0 0 0 0 0 0 0 0 0
38 13006 30980 0 1 0 0 0 0 0 0 0 0 0
39 12870 30925 0 0 1 0 0 0 0 0 0 0 0
40 12929 30856 0 0 0 1 0 0 0 0 0 0 0
41 12365 29862 0 0 0 0 1 0 0 0 0 0 0
42 12384 30045 0 0 0 0 0 1 0 0 0 0 0
43 13801 32827 0 0 0 0 0 0 1 0 0 0 0
44 14421 33310 0 0 0 0 0 0 0 1 0 0 0
45 14097 32774 0 0 0 0 0 0 0 0 1 0 0
46 13656 31501 0 0 0 0 0 0 0 0 0 1 0
47 13375 31092 0 0 0 0 0 0 0 0 0 0 1
48 13493 31198 0 0 0 0 0 0 0 0 0 0 0
49 13885 32524 1 0 0 0 0 0 0 0 0 0 0
50 13788 32069 0 1 0 0 0 0 0 0 0 0 0
51 13529 31488 0 0 1 0 0 0 0 0 0 0 0
52 13090 30513 0 0 0 1 0 0 0 0 0 0 0
53 12529 29594 0 0 0 0 1 0 0 0 0 0 0
54 12690 29836 0 0 0 0 0 1 0 0 0 0 0
55 14137 32816 0 0 0 0 0 0 1 0 0 0 0
56 14887 33843 0 0 0 0 0 0 0 1 0 0 0
57 14661 33035 0 0 0 0 0 0 0 0 1 0 0
58 13827 31546 0 0 0 0 0 0 0 0 0 1 0
59 13530 30907 0 0 0 0 0 0 0 0 0 0 1
60 13383 30512 0 0 0 0 0 0 0 0 0 0 0
61 13569 30499 1 0 0 0 0 0 0 0 0 0 0
62 13324 30111 0 1 0 0 0 0 0 0 0 0 0
63 13166 29941 0 0 1 0 0 0 0 0 0 0 0
64 12777 29215 0 0 0 1 0 0 0 0 0 0 0
65 12390 28413 0 0 0 0 1 0 0 0 0 0 0
66 12225 28427 0 0 0 0 0 1 0 0 0 0 0
67 13706 31214 0 0 0 0 0 0 1 0 0 0 0
68 14431 32529 0 0 0 0 0 0 0 1 0 0 0
69 13860 31593 0 0 0 0 0 0 0 0 1 0 0
70 13303 30612 0 0 0 0 0 0 0 0 0 1 0
71 13075 30305 0 0 0 0 0 0 0 0 0 0 1
72 13096 29978 0 0 0 0 0 0 0 0 0 0 0
73 13652 30882 1 0 0 0 0 0 0 0 0 0 0
74 13568 30552 0 1 0 0 0 0 0 0 0 0 0
75 13034 29724 0 0 1 0 0 0 0 0 0 0 0
76 12804 29225 0 0 0 1 0 0 0 0 0 0 0
77 12520 28720 0 0 0 0 1 0 0 0 0 0 0
78 12622 28848 0 0 0 0 0 1 0 0 0 0 0
79 14285 31948 0 0 0 0 0 0 1 0 0 0 0
80 14767 32773 0 0 0 0 0 0 0 1 0 0 0
81 14377 31609 0 0 0 0 0 0 0 0 1 0 0
82 13854 30982 0 0 0 0 0 0 0 0 0 1 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Werkloosheid_ANTWERPEN
55099.3199 1.3922
`Werkloosheid_VLAAMS-BRABANT` `Werkloosheid_WAALS-BRABANT`
1.5684 -0.6045
`Werkloosheid_WEST-VLAANDEREN` `Werkloosheid_OOST-VLAANDEREN`
-0.1106 -1.4845
Werkloosheid_HENEGOUWEN Werkloosheid_LUIK
-0.3117 -0.7995
Werkloosheid_LIMBURG Werkloosheid_LUXEMBURG
-0.5638 0.5484
Werkloosheid_NAMEN M1
3.2610 -698.9912
M2 M3
-364.0072 286.3812
M4 M5
772.0133 983.5266
M6 M7
1106.3087 -710.3718
M8 M9
-3019.5429 -108.5359
M10 M11
377.1265 -145.7865
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2328.17 -591.63 2.57 582.61 2551.46
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 55099.3199 10210.5458 5.396 1.22e-06 ***
Werkloosheid_ANTWERPEN 1.3922 0.3120 4.462 3.64e-05 ***
`Werkloosheid_VLAAMS-BRABANT` 1.5684 0.8317 1.886 0.064158 .
`Werkloosheid_WAALS-BRABANT` -0.6045 0.8106 -0.746 0.458750
`Werkloosheid_WEST-VLAANDEREN` -0.1106 0.6100 -0.181 0.856734
`Werkloosheid_OOST-VLAANDEREN` -1.4845 0.5489 -2.705 0.008883 **
Werkloosheid_HENEGOUWEN -0.3117 0.2446 -1.274 0.207603
Werkloosheid_LUIK -0.7995 0.2089 -3.827 0.000312 ***
Werkloosheid_LIMBURG -0.5638 0.5160 -1.093 0.278865
Werkloosheid_LUXEMBURG 0.5484 0.8985 0.610 0.543987
Werkloosheid_NAMEN 3.2610 0.6682 4.881 8.17e-06 ***
M1 -698.9912 748.8654 -0.933 0.354355
M2 -364.0072 703.3194 -0.518 0.606671
M3 286.3812 787.1775 0.364 0.717281
M4 772.0133 1032.8827 0.747 0.457720
M5 983.5266 1258.4617 0.782 0.437563
M6 1106.3087 1152.7844 0.960 0.341066
M7 -710.3718 1293.2779 -0.549 0.584852
M8 -3019.5429 1516.4826 -1.991 0.051024 .
M9 -108.5359 1168.4090 -0.093 0.926299
M10 377.1265 844.0852 0.447 0.656637
M11 -145.7865 735.5201 -0.198 0.843552
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1166 on 60 degrees of freedom
Multiple R-squared: 0.9748, Adjusted R-squared: 0.966
F-statistic: 110.5 on 21 and 60 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.19958530 0.39917060 0.8004147
[2,] 0.09609047 0.19218094 0.9039095
[3,] 0.04891677 0.09783355 0.9510832
[4,] 0.08417391 0.16834782 0.9158261
[5,] 0.11593272 0.23186544 0.8840673
[6,] 0.08871217 0.17742434 0.9112878
[7,] 0.09395467 0.18790933 0.9060453
[8,] 0.06171987 0.12343975 0.9382801
[9,] 0.04962372 0.09924744 0.9503763
[10,] 0.02832866 0.05665733 0.9716713
[11,] 0.05337680 0.10675361 0.9466232
[12,] 0.03083063 0.06166125 0.9691694
[13,] 0.01915100 0.03830201 0.9808490
[14,] 0.01032966 0.02065932 0.9896703
[15,] 0.00568283 0.01136566 0.9943172
[16,] 0.04574621 0.09149243 0.9542538
[17,] 0.06098776 0.12197552 0.9390122
[18,] 0.04178541 0.08357082 0.9582146
[19,] 0.13402491 0.26804981 0.8659751
[20,] 0.24454091 0.48908183 0.7554591
[21,] 0.28655205 0.57310410 0.7134480
[22,] 0.23739321 0.47478641 0.7626068
[23,] 0.24274593 0.48549187 0.7572541
[24,] 0.29907288 0.59814577 0.7009271
[25,] 0.31440892 0.62881785 0.6855911
[26,] 0.25868443 0.51736886 0.7413156
[27,] 0.22681613 0.45363226 0.7731839
[28,] 0.32094653 0.64189305 0.6790535
[29,] 0.73003923 0.53992153 0.2699608
[30,] 0.69871153 0.60257693 0.3012885
[31,] 0.76611060 0.46777880 0.2338894
[32,] 0.77212579 0.45574843 0.2278742
[33,] 0.79983586 0.40032829 0.2001641
> postscript(file="/var/wessaorg/rcomp/tmp/19pds1356024793.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/27yoj1356024793.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/3w5l71356024793.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/460l61356024793.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/55e2m1356024793.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 = 82
Frequency = 1
1 2 3 4 5 6
120.39706 1076.43075 318.10018 -1338.35476 1388.23436 1043.66226
7 8 9 10 11 12
620.37979 482.95139 -445.52705 941.88313 -1667.77930 -812.54628
13 14 15 16 17 18
-421.31742 -594.00749 -338.49442 -584.50444 769.89660 -796.71164
19 20 21 22 23 24
-1430.63617 -103.25066 -347.92534 204.81791 86.40994 944.99683
25 26 27 28 29 30
621.85677 -1242.41158 -197.55799 -645.56076 -68.59294 -129.77344
31 32 33 34 35 36
-216.12859 -438.22060 -469.53616 597.18574 455.53142 1012.57150
37 38 39 40 41 42
159.89767 411.79574 161.75181 2287.78100 -645.58279 -468.32784
43 44 45 46 47 48
-1900.51095 -71.03961 -986.56178 -140.44927 -513.90174 -2328.17372
49 50 51 52 53 54
73.73909 223.68825 502.99529 99.68694 -253.46234 1152.01399
55 56 57 58 59 60
2551.45594 -1552.71347 1662.15625 -1470.11950 -469.86573 698.68788
61 62 63 64 65 66
-705.44637 -609.77012 -985.69247 93.40319 528.36701 259.56731
67 68 69 70 71 72
1748.07396 2118.83556 963.98183 1578.32149 2109.60540 484.46378
73 74 75 76 77 78
150.87319 734.27444 538.89760 87.54882 -1718.85990 -1060.43064
79 80 81 82
-1372.63397 -436.56261 -376.58775 -1711.63951
> postscript(file="/var/wessaorg/rcomp/tmp/6fizj1356024793.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 = 82
Frequency = 1
lag(myerror, k = 1) myerror
0 120.39706 NA
1 1076.43075 120.39706
2 318.10018 1076.43075
3 -1338.35476 318.10018
4 1388.23436 -1338.35476
5 1043.66226 1388.23436
6 620.37979 1043.66226
7 482.95139 620.37979
8 -445.52705 482.95139
9 941.88313 -445.52705
10 -1667.77930 941.88313
11 -812.54628 -1667.77930
12 -421.31742 -812.54628
13 -594.00749 -421.31742
14 -338.49442 -594.00749
15 -584.50444 -338.49442
16 769.89660 -584.50444
17 -796.71164 769.89660
18 -1430.63617 -796.71164
19 -103.25066 -1430.63617
20 -347.92534 -103.25066
21 204.81791 -347.92534
22 86.40994 204.81791
23 944.99683 86.40994
24 621.85677 944.99683
25 -1242.41158 621.85677
26 -197.55799 -1242.41158
27 -645.56076 -197.55799
28 -68.59294 -645.56076
29 -129.77344 -68.59294
30 -216.12859 -129.77344
31 -438.22060 -216.12859
32 -469.53616 -438.22060
33 597.18574 -469.53616
34 455.53142 597.18574
35 1012.57150 455.53142
36 159.89767 1012.57150
37 411.79574 159.89767
38 161.75181 411.79574
39 2287.78100 161.75181
40 -645.58279 2287.78100
41 -468.32784 -645.58279
42 -1900.51095 -468.32784
43 -71.03961 -1900.51095
44 -986.56178 -71.03961
45 -140.44927 -986.56178
46 -513.90174 -140.44927
47 -2328.17372 -513.90174
48 73.73909 -2328.17372
49 223.68825 73.73909
50 502.99529 223.68825
51 99.68694 502.99529
52 -253.46234 99.68694
53 1152.01399 -253.46234
54 2551.45594 1152.01399
55 -1552.71347 2551.45594
56 1662.15625 -1552.71347
57 -1470.11950 1662.15625
58 -469.86573 -1470.11950
59 698.68788 -469.86573
60 -705.44637 698.68788
61 -609.77012 -705.44637
62 -985.69247 -609.77012
63 93.40319 -985.69247
64 528.36701 93.40319
65 259.56731 528.36701
66 1748.07396 259.56731
67 2118.83556 1748.07396
68 963.98183 2118.83556
69 1578.32149 963.98183
70 2109.60540 1578.32149
71 484.46378 2109.60540
72 150.87319 484.46378
73 734.27444 150.87319
74 538.89760 734.27444
75 87.54882 538.89760
76 -1718.85990 87.54882
77 -1060.43064 -1718.85990
78 -1372.63397 -1060.43064
79 -436.56261 -1372.63397
80 -376.58775 -436.56261
81 -1711.63951 -376.58775
82 NA -1711.63951
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1076.43075 120.39706
[2,] 318.10018 1076.43075
[3,] -1338.35476 318.10018
[4,] 1388.23436 -1338.35476
[5,] 1043.66226 1388.23436
[6,] 620.37979 1043.66226
[7,] 482.95139 620.37979
[8,] -445.52705 482.95139
[9,] 941.88313 -445.52705
[10,] -1667.77930 941.88313
[11,] -812.54628 -1667.77930
[12,] -421.31742 -812.54628
[13,] -594.00749 -421.31742
[14,] -338.49442 -594.00749
[15,] -584.50444 -338.49442
[16,] 769.89660 -584.50444
[17,] -796.71164 769.89660
[18,] -1430.63617 -796.71164
[19,] -103.25066 -1430.63617
[20,] -347.92534 -103.25066
[21,] 204.81791 -347.92534
[22,] 86.40994 204.81791
[23,] 944.99683 86.40994
[24,] 621.85677 944.99683
[25,] -1242.41158 621.85677
[26,] -197.55799 -1242.41158
[27,] -645.56076 -197.55799
[28,] -68.59294 -645.56076
[29,] -129.77344 -68.59294
[30,] -216.12859 -129.77344
[31,] -438.22060 -216.12859
[32,] -469.53616 -438.22060
[33,] 597.18574 -469.53616
[34,] 455.53142 597.18574
[35,] 1012.57150 455.53142
[36,] 159.89767 1012.57150
[37,] 411.79574 159.89767
[38,] 161.75181 411.79574
[39,] 2287.78100 161.75181
[40,] -645.58279 2287.78100
[41,] -468.32784 -645.58279
[42,] -1900.51095 -468.32784
[43,] -71.03961 -1900.51095
[44,] -986.56178 -71.03961
[45,] -140.44927 -986.56178
[46,] -513.90174 -140.44927
[47,] -2328.17372 -513.90174
[48,] 73.73909 -2328.17372
[49,] 223.68825 73.73909
[50,] 502.99529 223.68825
[51,] 99.68694 502.99529
[52,] -253.46234 99.68694
[53,] 1152.01399 -253.46234
[54,] 2551.45594 1152.01399
[55,] -1552.71347 2551.45594
[56,] 1662.15625 -1552.71347
[57,] -1470.11950 1662.15625
[58,] -469.86573 -1470.11950
[59,] 698.68788 -469.86573
[60,] -705.44637 698.68788
[61,] -609.77012 -705.44637
[62,] -985.69247 -609.77012
[63,] 93.40319 -985.69247
[64,] 528.36701 93.40319
[65,] 259.56731 528.36701
[66,] 1748.07396 259.56731
[67,] 2118.83556 1748.07396
[68,] 963.98183 2118.83556
[69,] 1578.32149 963.98183
[70,] 2109.60540 1578.32149
[71,] 484.46378 2109.60540
[72,] 150.87319 484.46378
[73,] 734.27444 150.87319
[74,] 538.89760 734.27444
[75,] 87.54882 538.89760
[76,] -1718.85990 87.54882
[77,] -1060.43064 -1718.85990
[78,] -1372.63397 -1060.43064
[79,] -436.56261 -1372.63397
[80,] -376.58775 -436.56261
[81,] -1711.63951 -376.58775
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1076.43075 120.39706
2 318.10018 1076.43075
3 -1338.35476 318.10018
4 1388.23436 -1338.35476
5 1043.66226 1388.23436
6 620.37979 1043.66226
7 482.95139 620.37979
8 -445.52705 482.95139
9 941.88313 -445.52705
10 -1667.77930 941.88313
11 -812.54628 -1667.77930
12 -421.31742 -812.54628
13 -594.00749 -421.31742
14 -338.49442 -594.00749
15 -584.50444 -338.49442
16 769.89660 -584.50444
17 -796.71164 769.89660
18 -1430.63617 -796.71164
19 -103.25066 -1430.63617
20 -347.92534 -103.25066
21 204.81791 -347.92534
22 86.40994 204.81791
23 944.99683 86.40994
24 621.85677 944.99683
25 -1242.41158 621.85677
26 -197.55799 -1242.41158
27 -645.56076 -197.55799
28 -68.59294 -645.56076
29 -129.77344 -68.59294
30 -216.12859 -129.77344
31 -438.22060 -216.12859
32 -469.53616 -438.22060
33 597.18574 -469.53616
34 455.53142 597.18574
35 1012.57150 455.53142
36 159.89767 1012.57150
37 411.79574 159.89767
38 161.75181 411.79574
39 2287.78100 161.75181
40 -645.58279 2287.78100
41 -468.32784 -645.58279
42 -1900.51095 -468.32784
43 -71.03961 -1900.51095
44 -986.56178 -71.03961
45 -140.44927 -986.56178
46 -513.90174 -140.44927
47 -2328.17372 -513.90174
48 73.73909 -2328.17372
49 223.68825 73.73909
50 502.99529 223.68825
51 99.68694 502.99529
52 -253.46234 99.68694
53 1152.01399 -253.46234
54 2551.45594 1152.01399
55 -1552.71347 2551.45594
56 1662.15625 -1552.71347
57 -1470.11950 1662.15625
58 -469.86573 -1470.11950
59 698.68788 -469.86573
60 -705.44637 698.68788
61 -609.77012 -705.44637
62 -985.69247 -609.77012
63 93.40319 -985.69247
64 528.36701 93.40319
65 259.56731 528.36701
66 1748.07396 259.56731
67 2118.83556 1748.07396
68 963.98183 2118.83556
69 1578.32149 963.98183
70 2109.60540 1578.32149
71 484.46378 2109.60540
72 150.87319 484.46378
73 734.27444 150.87319
74 538.89760 734.27444
75 87.54882 538.89760
76 -1718.85990 87.54882
77 -1060.43064 -1718.85990
78 -1372.63397 -1060.43064
79 -436.56261 -1372.63397
80 -376.58775 -436.56261
81 -1711.63951 -376.58775
> 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/705py1356024793.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/85ctt1356024793.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/9wiam1356024793.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/10hwtq1356024793.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/11n43m1356024793.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/12ybxd1356024793.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/13301r1356024793.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/14dvk51356024793.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/150cj61356024793.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/167qi21356024793.tab")
+ }
>
> try(system("convert tmp/19pds1356024793.ps tmp/19pds1356024793.png",intern=TRUE))
character(0)
> try(system("convert tmp/27yoj1356024793.ps tmp/27yoj1356024793.png",intern=TRUE))
character(0)
> try(system("convert tmp/3w5l71356024793.ps tmp/3w5l71356024793.png",intern=TRUE))
character(0)
> try(system("convert tmp/460l61356024793.ps tmp/460l61356024793.png",intern=TRUE))
character(0)
> try(system("convert tmp/55e2m1356024793.ps tmp/55e2m1356024793.png",intern=TRUE))
character(0)
> try(system("convert tmp/6fizj1356024793.ps tmp/6fizj1356024793.png",intern=TRUE))
character(0)
> try(system("convert tmp/705py1356024793.ps tmp/705py1356024793.png",intern=TRUE))
character(0)
> try(system("convert tmp/85ctt1356024793.ps tmp/85ctt1356024793.png",intern=TRUE))
character(0)
> try(system("convert tmp/9wiam1356024793.ps tmp/9wiam1356024793.png",intern=TRUE))
character(0)
> try(system("convert tmp/10hwtq1356024793.ps tmp/10hwtq1356024793.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
9.411 1.767 11.280