R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
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(143827
+ ,829461
+ ,4.93
+ ,5.01
+ ,639.98
+ ,3536.15
+ ,0.94
+ ,109.57
+ ,9113
+ ,145191
+ ,837669
+ ,4.92
+ ,5.02
+ ,597.33
+ ,3240.92
+ ,0.92
+ ,107.08
+ ,9140
+ ,146832
+ ,854793
+ ,4.83
+ ,4.94
+ ,558.36
+ ,3121.58
+ ,0.91
+ ,110.33
+ ,9309
+ ,148577
+ ,850092
+ ,5.02
+ ,5.10
+ ,593.09
+ ,3302.70
+ ,0.89
+ ,110.36
+ ,9395
+ ,149873
+ ,848783
+ ,5.22
+ ,5.26
+ ,585.15
+ ,3292.49
+ ,0.87
+ ,106.50
+ ,10027
+ ,151847
+ ,846150
+ ,5.17
+ ,5.21
+ ,573.50
+ ,3162.62
+ ,0.85
+ ,104.30
+ ,10202
+ ,153252
+ ,828543
+ ,5.17
+ ,5.25
+ ,548.72
+ ,3051.60
+ ,0.86
+ ,107.21
+ ,10003
+ ,154292
+ ,830389
+ ,4.98
+ ,5.06
+ ,523.63
+ ,2848.11
+ ,0.90
+ ,109.34
+ ,9745
+ ,155657
+ ,848989
+ ,4.98
+ ,5.04
+ ,453.87
+ ,2577.68
+ ,0.91
+ ,108.20
+ ,9966
+ ,156523
+ ,841106
+ ,4.77
+ ,4.82
+ ,460.33
+ ,2680.55
+ ,0.91
+ ,109.86
+ ,10035
+ ,156416
+ ,854616
+ ,4.62
+ ,4.67
+ ,492.67
+ ,2775.70
+ ,0.89
+ ,108.68
+ ,9999
+ ,156693
+ ,832714
+ ,4.89
+ ,4.95
+ ,506.78
+ ,2879.30
+ ,0.89
+ ,113.38
+ ,9943
+ ,160312
+ ,839290
+ ,4.97
+ ,5.02
+ ,500.92
+ ,2790.11
+ ,0.88
+ ,117.12
+ ,10258
+ ,160438
+ ,840572
+ ,5.03
+ ,5.07
+ ,494.91
+ ,2764.18
+ ,0.87
+ ,116.23
+ ,10926
+ ,160882
+ ,869186
+ ,5.27
+ ,5.31
+ ,531.21
+ ,2868.37
+ ,0.88
+ ,114.75
+ ,10807
+ ,161668
+ ,856979
+ ,5.25
+ ,5.29
+ ,511.28
+ ,2740.50
+ ,0.89
+ ,115.81
+ ,10992
+ ,164391
+ ,872126
+ ,5.30
+ ,5.31
+ ,484.55
+ ,2622.87
+ ,0.92
+ ,115.86
+ ,11034
+ ,168556
+ ,868281
+ ,5.16
+ ,5.17
+ ,439.66
+ ,2376.70
+ ,0.96
+ ,117.80
+ ,10801
+ ,169738
+ ,862455
+ ,4.99
+ ,5.03
+ ,363.59
+ ,2133.57
+ ,0.99
+ ,117.11
+ ,10161
+ ,170387
+ ,881177
+ ,4.71
+ ,4.73
+ ,371.59
+ ,2120.90
+ ,0.98
+ ,116.31
+ ,10191
+ ,171294
+ ,886924
+ ,4.50
+ ,4.52
+ ,296.36
+ ,1789.81
+ ,0.98
+ ,118.38
+ ,10451
+ ,172202
+ ,886842
+ ,4.58
+ ,4.62
+ ,342.84
+ ,1999.59
+ ,0.98
+ ,121.57
+ ,10380
+ ,172651
+ ,916407
+ ,4.56
+ ,4.59
+ ,361.99
+ ,2095.87
+ ,1.00
+ ,121.65
+ ,10251
+ ,172770
+ ,890606
+ ,4.36
+ ,4.41
+ ,322.73
+ ,1909.40
+ ,1.02
+ ,124.20
+ ,10522
+ ,178366
+ ,900409
+ ,4.19
+ ,4.27
+ ,294.94
+ ,1773.09
+ ,1.06
+ ,126.12
+ ,10801
+ ,180014
+ ,920169
+ ,3.97
+ ,4.06
+ ,266.21
+ ,1712.20
+ ,1.08
+ ,128.60
+ ,10731
+ ,181067
+ ,922871
+ ,4.01
+ ,4.13
+ ,248.54
+ ,1655.69
+ ,1.08
+ ,128.16
+ ,10161
+ ,182586
+ ,920004
+ ,4.23
+ ,4.23
+ ,282.63
+ ,1833.04
+ ,1.08
+ ,130.12
+ ,9728
+ ,184957
+ ,945772
+ ,3.91
+ ,3.92
+ ,280.57
+ ,1840.93
+ ,1.16
+ ,135.83
+ ,9882
+ ,186417
+ ,937507
+ ,3.72
+ ,3.72
+ ,291.55
+ ,1897.71
+ ,1.17
+ ,138.05
+ ,9839
+ ,188599
+ ,941691
+ ,4.04
+ ,4.06
+ ,317.49
+ ,1962.54
+ ,1.14
+ ,134.99
+ ,9917
+ ,189490
+ ,958256
+ ,4.19
+ ,4.21
+ ,329.41
+ ,1982.29
+ ,1.11
+ ,132.38
+ ,10356
+ ,190264
+ ,963509
+ ,4.21
+ ,4.23
+ ,306.78
+ ,1903.72
+ ,1.12
+ ,128.94
+ ,10857
+ ,191221
+ ,970266
+ ,4.27
+ ,4.31
+ ,330.22
+ ,2029.31
+ ,1.17
+ ,128.12
+ ,10424
+ ,191110
+ ,972853
+ ,4.41
+ ,4.44
+ ,332.19
+ ,2052.05
+ ,1.17
+ ,127.84
+ ,10721
+ ,190674
+ ,982168
+ ,4.33
+ ,4.36
+ ,337.65
+ ,2126.04
+ ,1.23
+ ,132.43
+ ,10669
+ ,195438
+ ,999892
+ ,4.18
+ ,4.26
+ ,353.31
+ ,2166.17
+ ,1.26
+ ,134.13
+ ,10565
+ ,196393
+ ,1002099
+ ,4.12
+ ,4.18
+ ,356.59
+ ,2216.34
+ ,1.26
+ ,134.78
+ ,10289
+ ,197172
+ ,1017611
+ ,3.93
+ ,4.02
+ ,338.87
+ ,2149.88
+ ,1.23
+ ,133.13
+ ,10646
+ ,198760
+ ,1029782
+ ,4.13
+ ,4.24
+ ,341.41
+ ,2176.87
+ ,1.20
+ ,129.08
+ ,10858
+ ,200945
+ ,1047956
+ ,4.37
+ ,4.39
+ ,337.19
+ ,2150.98
+ ,1.20
+ ,134.48
+ ,10282
+ ,203845
+ ,1047689
+ ,4.42
+ ,4.44
+ ,345.13
+ ,2176.22
+ ,1.21
+ ,132.86
+ ,10377
+ ,204613
+ ,1060054
+ ,4.31
+ ,4.34
+ ,329.91
+ ,2143.40
+ ,1.23
+ ,134.08
+ ,10443
+ ,205487
+ ,1067078
+ ,4.15
+ ,4.17
+ ,323.12
+ ,2118.28
+ ,1.22
+ ,134.54
+ ,10561
+ ,206100
+ ,1072366
+ ,4.09
+ ,4.11
+ ,323.94
+ ,2153.11
+ ,1.22
+ ,134.51
+ ,10668
+ ,206315
+ ,1081823
+ ,3.96
+ ,3.98
+ ,330.48
+ ,2176.63
+ ,1.25
+ ,135.97
+ ,10818
+ ,206291
+ ,1087601
+ ,3.85
+ ,3.87
+ ,337.15
+ ,2222.87
+ ,1.30
+ ,136.09
+ ,10865
+ ,207801
+ ,1089905
+ ,3.63
+ ,3.69
+ ,348.08
+ ,2263.48
+ ,1.34
+ ,139.14
+ ,10636
+ ,211653
+ ,1116316
+ ,3.56
+ ,3.63
+ ,360.42
+ ,2297.09
+ ,1.31
+ ,135.63
+ ,10409
+ ,211325
+ ,1111355
+ ,3.55
+ ,3.62
+ ,374.37
+ ,2361.41
+ ,1.30
+ ,136.55
+ ,10460
+ ,211893
+ ,1124250
+ ,3.69
+ ,3.76
+ ,369.56
+ ,2350.32
+ ,1.32
+ ,138.83
+ ,10579
+ ,212056
+ ,1140597
+ ,3.48
+ ,3.57
+ ,348.20
+ ,2301.54
+ ,1.29
+ ,138.84
+ ,10664
+ ,214696
+ ,1151683
+ ,3.30
+ ,3.40
+ ,364.68
+ ,2396.60
+ ,1.27
+ ,135.37
+ ,10711
+ ,217455
+ ,1137532
+ ,3.13
+ ,3.25
+ ,383.83
+ ,2472.42
+ ,1.22
+ ,132.22
+ ,11374
+ ,218884
+ ,967532
+ ,3.27
+ ,3.32
+ ,395.77
+ ,2558.95
+ ,1.20
+ ,134.75
+ ,11345
+ ,219816
+ ,972994
+ ,3.28
+ ,3.32
+ ,389.60
+ ,2548.21
+ ,1.23
+ ,135.98
+ ,11456
+ ,219984
+ ,999207
+ ,3.12
+ ,3.16
+ ,402.99
+ ,2666.55
+ ,1.23
+ ,136.06
+ ,11966
+ ,219062
+ ,1007982
+ ,3.28
+ ,3.32
+ ,394.16
+ ,2609.40
+ ,1.20
+ ,138.05
+ ,12580
+ ,218550
+ ,1015892
+ ,3.48
+ ,3.53
+ ,418.79
+ ,2676.24
+ ,1.18
+ ,139.59
+ ,13006
+ ,218179
+ ,994850
+ ,3.35
+ ,3.41
+ ,436.78
+ ,2751.42
+ ,1.19
+ ,140.58
+ ,13815
+ ,222218
+ ,987503
+ ,3.33
+ ,3.39
+ ,450.50
+ ,2832.63
+ ,1.21
+ ,139.82
+ ,14579
+ ,222196
+ ,986743
+ ,3.48
+ ,3.55
+ ,458.72
+ ,2862.98
+ ,1.19
+ ,140.77
+ ,14960
+ ,223393
+ ,1020674
+ ,3.66
+ ,3.73
+ ,468.69
+ ,2907.81
+ ,1.20
+ ,140.96
+ ,14904
+ ,223292
+ ,1024067
+ ,3.92
+ ,4.01
+ ,469.40
+ ,2927.28
+ ,1.23
+ ,143.59
+ ,16028
+ ,226236
+ ,1040444
+ ,3.96
+ ,4.06
+ ,440.41
+ ,2784.06
+ ,1.28
+ ,142.70
+ ,17079
+ ,228831
+ ,1019081
+ ,3.97
+ ,4.08
+ ,440.25
+ ,2799.96
+ ,1.27
+ ,145.11
+ ,15155
+ ,228745
+ ,1027828
+ ,3.99
+ ,4.10
+ ,454.06
+ ,2856.24
+ ,1.27
+ ,146.70
+ ,16049
+ ,229140
+ ,1021010
+ ,3.90
+ ,3.97
+ ,469.01
+ ,2913.79
+ ,1.28
+ ,148.53
+ ,15841
+ ,229270
+ ,1025563
+ ,3.78
+ ,3.84
+ ,483.62
+ ,2949.45
+ ,1.27
+ ,148.99
+ ,15159
+ ,229359
+ ,1044756
+ ,3.82
+ ,3.88
+ ,486.57
+ ,3047.90
+ ,1.26
+ ,149.65
+ ,14956
+ ,230006
+ ,1062545
+ ,3.75
+ ,3.80
+ ,477.67
+ ,3006.92
+ ,1.29
+ ,151.11
+ ,15645
+ ,228810
+ ,1070425
+ ,3.81
+ ,3.89
+ ,495.34
+ ,3092.79
+ ,1.32
+ ,154.82
+ ,15318
+ ,232677
+ ,1100087
+ ,4.05
+ ,4.11
+ ,499.81
+ ,3146.87
+ ,1.30
+ ,156.56
+ ,15595
+ ,232961
+ ,1093596
+ ,4.07
+ ,4.12
+ ,490.21
+ ,3073.62
+ ,1.31
+ ,157.60
+ ,16355
+ ,234629
+ ,1109143
+ ,3.98
+ ,3.98
+ ,510.50
+ ,3126.60
+ ,1.32
+ ,155.24
+ ,15925
+ ,235660
+ ,1113855
+ ,4.19
+ ,4.25
+ ,530.81
+ ,3244.06
+ ,1.35
+ ,160.68
+ ,16175
+ ,240024
+ ,1129275
+ ,4.32
+ ,4.38
+ ,540.39
+ ,3323.03
+ ,1.35
+ ,163.22
+ ,15900
+ ,243554
+ ,1131996
+ ,4.61
+ ,4.66
+ ,548.21
+ ,3328.75
+ ,1.34
+ ,164.55
+ ,15711
+ ,244368
+ ,1144103
+ ,4.57
+ ,4.63
+ ,533.99
+ ,3211.79
+ ,1.37
+ ,166.76
+ ,15594
+ ,244356
+ ,1167830
+ ,4.38
+ ,4.43
+ ,522.73
+ ,3191.27
+ ,1.36
+ ,159.05
+ ,15693
+ ,245126
+ ,1153194
+ ,4.34
+ ,4.37
+ ,540.98
+ ,3248.57
+ ,1.39
+ ,159.82
+ ,16438
+ ,246321
+ ,1175008
+ ,4.38
+ ,4.40
+ ,547.85
+ ,3335.88
+ ,1.42
+ ,164.95
+ ,17048
+ ,246797
+ ,1175805
+ ,4.21
+ ,4.25
+ ,507.58
+ ,3209.49
+ ,1.47
+ ,162.89
+ ,17699
+ ,246735
+ ,1173456
+ ,4.34
+ ,4.38
+ ,515.77
+ ,3167.39
+ ,1.46
+ ,163.55
+ ,17733
+ ,251083
+ ,1187498
+ ,4.13
+ ,4.22
+ ,441.33
+ ,2791.94
+ ,1.47
+ ,158.68
+ ,19439
+ ,251786
+ ,1202958
+ ,4.05
+ ,4.14
+ ,446.53
+ ,2757.24
+ ,1.47
+ ,157.97
+ ,20148
+ ,252732
+ ,1206229
+ ,3.97
+ ,4.07
+ ,442.43
+ ,2636.45
+ ,1.55
+ ,156.59
+ ,20112
+ ,255051
+ ,1249533
+ ,4.21
+ ,4.28
+ ,475.56
+ ,2806.76
+ ,1.58
+ ,161.56
+ ,18607
+ ,259022
+ ,1279743
+ ,4.35
+ ,4.42
+ ,485.52
+ ,2783.36
+ ,1.56
+ ,162.31
+ ,18409
+ ,261698
+ ,1283496
+ ,4.73
+ ,4.81
+ ,425.93
+ ,2522.41
+ ,1.56
+ ,166.26
+ ,18388
+ ,263891
+ ,1282942
+ ,4.69
+ ,4.82
+ ,399.95
+ ,2493.36
+ ,1.58
+ ,168.45
+ ,19187
+ ,265247
+ ,1284739
+ ,4.40
+ ,4.50
+ ,412.84
+ ,2515.39
+ ,1.50
+ ,163.63
+ ,17983
+ ,262228
+ ,1337169
+ ,4.35
+ ,4.50
+ ,331.45
+ ,2268.77
+ ,1.44
+ ,153.20
+ ,18449
+ ,263429
+ ,1314087
+ ,4.23
+ ,4.44
+ ,267.69
+ ,2008.13
+ ,1.33
+ ,133.52
+ ,19589
+ ,264305
+ ,1306144
+ ,3.96
+ ,4.20
+ ,252.55
+ ,1868.25
+ ,1.27
+ ,123.28
+ ,19135
+ ,266371
+ ,1200391
+ ,3.65
+ ,3.89
+ ,245.94
+ ,1798.68
+ ,1.34
+ ,122.51
+ ,19604
+ ,273248
+ ,1265445
+ ,3.76
+ ,4.11
+ ,248.60
+ ,1717.60
+ ,1.32
+ ,119.73
+ ,20877
+ ,275472
+ ,1259329
+ ,3.80
+ ,4.20
+ ,219.81
+ ,1546.92
+ ,1.28
+ ,118.30
+ ,23639
+ ,278146
+ ,1219342
+ ,3.66
+ ,4.15
+ ,216.98
+ ,1580.19
+ ,1.31
+ ,127.65
+ ,22830
+ ,279506
+ ,1227626
+ ,3.77
+ ,4.09
+ ,240.76
+ ,1771.33
+ ,1.32
+ ,130.25
+ ,21760
+ ,283991
+ ,1232874
+ ,3.85
+ ,4.14
+ ,259.45
+ ,1846.92
+ ,1.37
+ ,131.85
+ ,21879
+ ,286794
+ ,1241046
+ ,3.96
+ ,4.32
+ ,254.71
+ ,1821.18
+ ,1.40
+ ,135.39
+ ,21712
+ ,288703
+ ,1244172
+ ,3.76
+ ,4.09
+ ,283.17
+ ,1988.41
+ ,1.41
+ ,133.09
+ ,21321
+ ,289285
+ ,1237838
+ ,3.61
+ ,3.89
+ ,296.27
+ ,2074.01
+ ,1.43
+ ,135.31
+ ,21396
+ ,288869
+ ,1212801
+ ,3.58
+ ,3.86
+ ,311.35
+ ,2119.77
+ ,1.46
+ ,133.14
+ ,22000
+ ,286942
+ ,1234237
+ ,3.53
+ ,3.80
+ ,302.36
+ ,2081.89
+ ,1.48
+ ,133.91
+ ,22642
+ ,285833
+ ,1224699
+ ,3.52
+ ,3.83
+ ,305.90
+ ,2099.55
+ ,1.49
+ ,132.97
+ ,24272
+ ,284095
+ ,1237432
+ ,3.44
+ ,3.88
+ ,335.33
+ ,2233.67
+ ,1.46
+ ,131.21
+ ,24933
+ ,289229
+ ,1248847
+ ,3.47
+ ,4.10
+ ,327.90
+ ,2150.37
+ ,1.43
+ ,130.34
+ ,25219
+ ,289389
+ ,1256543
+ ,3.36
+ ,4.11
+ ,317.74
+ ,2146.66
+ ,1.37
+ ,123.46
+ ,25745
+ ,290793
+ ,1252434
+ ,3.37
+ ,3.98
+ ,344.22
+ ,2287.88
+ ,1.36
+ ,123.03
+ ,26433
+ ,291454
+ ,1265176
+ ,3.32
+ ,4.17
+ ,345.91
+ ,2236.06
+ ,1.34
+ ,125.33
+ ,27546
+ ,294733
+ ,1314670
+ ,3.02
+ ,3.68
+ ,320.70
+ ,2110.35
+ ,1.26
+ ,115.83
+ ,30774
+ ,293853
+ ,1299329
+ ,2.90
+ ,3.70
+ ,316.81
+ ,2086.51
+ ,1.22
+ ,110.99
+ ,32456
+ ,294056
+ ,1216744
+ ,2.85
+ ,3.62
+ ,330.64
+ ,2187.47
+ ,1.28
+ ,111.73
+ ,30124
+ ,293982
+ ,1225275
+ ,2.56
+ ,3.44
+ ,316.47
+ ,2159.21
+ ,1.29
+ ,110.04
+ ,30250
+ ,293075
+ ,1193478
+ ,2.52
+ ,3.50
+ ,334.39
+ ,2218.23
+ ,1.31
+ ,110.26
+ ,31288
+ ,292391
+ ,1207226
+ ,2.58
+ ,3.34
+ ,337.23
+ ,2274.11
+ ,1.39
+ ,113.67
+ ,31072)
+ ,dim=c(9
+ ,118)
+ ,dimnames=list(c('SpaarNL'
+ ,'Leningen'
+ ,'10jNL'
+ ,'10JEUR'
+ ,'AEX'
+ ,'EURO'
+ ,'USD'
+ ,'YEN'
+ ,'GOLD')
+ ,1:118))
> y <- array(NA,dim=c(9,118),dimnames=list(c('SpaarNL','Leningen','10jNL','10JEUR','AEX','EURO','USD','YEN','GOLD'),1:118))
> 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 = '1'
> #'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
Attaching package: 'zoo'
The following object(s) are masked from package:base :
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
SpaarNL Leningen 10jNL 10JEUR AEX EURO USD YEN GOLD
1 143827 829461 4.93 5.01 639.98 3536.15 0.94 109.57 9113
2 145191 837669 4.92 5.02 597.33 3240.92 0.92 107.08 9140
3 146832 854793 4.83 4.94 558.36 3121.58 0.91 110.33 9309
4 148577 850092 5.02 5.10 593.09 3302.70 0.89 110.36 9395
5 149873 848783 5.22 5.26 585.15 3292.49 0.87 106.50 10027
6 151847 846150 5.17 5.21 573.50 3162.62 0.85 104.30 10202
7 153252 828543 5.17 5.25 548.72 3051.60 0.86 107.21 10003
8 154292 830389 4.98 5.06 523.63 2848.11 0.90 109.34 9745
9 155657 848989 4.98 5.04 453.87 2577.68 0.91 108.20 9966
10 156523 841106 4.77 4.82 460.33 2680.55 0.91 109.86 10035
11 156416 854616 4.62 4.67 492.67 2775.70 0.89 108.68 9999
12 156693 832714 4.89 4.95 506.78 2879.30 0.89 113.38 9943
13 160312 839290 4.97 5.02 500.92 2790.11 0.88 117.12 10258
14 160438 840572 5.03 5.07 494.91 2764.18 0.87 116.23 10926
15 160882 869186 5.27 5.31 531.21 2868.37 0.88 114.75 10807
16 161668 856979 5.25 5.29 511.28 2740.50 0.89 115.81 10992
17 164391 872126 5.30 5.31 484.55 2622.87 0.92 115.86 11034
18 168556 868281 5.16 5.17 439.66 2376.70 0.96 117.80 10801
19 169738 862455 4.99 5.03 363.59 2133.57 0.99 117.11 10161
20 170387 881177 4.71 4.73 371.59 2120.90 0.98 116.31 10191
21 171294 886924 4.50 4.52 296.36 1789.81 0.98 118.38 10451
22 172202 886842 4.58 4.62 342.84 1999.59 0.98 121.57 10380
23 172651 916407 4.56 4.59 361.99 2095.87 1.00 121.65 10251
24 172770 890606 4.36 4.41 322.73 1909.40 1.02 124.20 10522
25 178366 900409 4.19 4.27 294.94 1773.09 1.06 126.12 10801
26 180014 920169 3.97 4.06 266.21 1712.20 1.08 128.60 10731
27 181067 922871 4.01 4.13 248.54 1655.69 1.08 128.16 10161
28 182586 920004 4.23 4.23 282.63 1833.04 1.08 130.12 9728
29 184957 945772 3.91 3.92 280.57 1840.93 1.16 135.83 9882
30 186417 937507 3.72 3.72 291.55 1897.71 1.17 138.05 9839
31 188599 941691 4.04 4.06 317.49 1962.54 1.14 134.99 9917
32 189490 958256 4.19 4.21 329.41 1982.29 1.11 132.38 10356
33 190264 963509 4.21 4.23 306.78 1903.72 1.12 128.94 10857
34 191221 970266 4.27 4.31 330.22 2029.31 1.17 128.12 10424
35 191110 972853 4.41 4.44 332.19 2052.05 1.17 127.84 10721
36 190674 982168 4.33 4.36 337.65 2126.04 1.23 132.43 10669
37 195438 999892 4.18 4.26 353.31 2166.17 1.26 134.13 10565
38 196393 1002099 4.12 4.18 356.59 2216.34 1.26 134.78 10289
39 197172 1017611 3.93 4.02 338.87 2149.88 1.23 133.13 10646
40 198760 1029782 4.13 4.24 341.41 2176.87 1.20 129.08 10858
41 200945 1047956 4.37 4.39 337.19 2150.98 1.20 134.48 10282
42 203845 1047689 4.42 4.44 345.13 2176.22 1.21 132.86 10377
43 204613 1060054 4.31 4.34 329.91 2143.40 1.23 134.08 10443
44 205487 1067078 4.15 4.17 323.12 2118.28 1.22 134.54 10561
45 206100 1072366 4.09 4.11 323.94 2153.11 1.22 134.51 10668
46 206315 1081823 3.96 3.98 330.48 2176.63 1.25 135.97 10818
47 206291 1087601 3.85 3.87 337.15 2222.87 1.30 136.09 10865
48 207801 1089905 3.63 3.69 348.08 2263.48 1.34 139.14 10636
49 211653 1116316 3.56 3.63 360.42 2297.09 1.31 135.63 10409
50 211325 1111355 3.55 3.62 374.37 2361.41 1.30 136.55 10460
51 211893 1124250 3.69 3.76 369.56 2350.32 1.32 138.83 10579
52 212056 1140597 3.48 3.57 348.20 2301.54 1.29 138.84 10664
53 214696 1151683 3.30 3.40 364.68 2396.60 1.27 135.37 10711
54 217455 1137532 3.13 3.25 383.83 2472.42 1.22 132.22 11374
55 218884 967532 3.27 3.32 395.77 2558.95 1.20 134.75 11345
56 219816 972994 3.28 3.32 389.60 2548.21 1.23 135.98 11456
57 219984 999207 3.12 3.16 402.99 2666.55 1.23 136.06 11966
58 219062 1007982 3.28 3.32 394.16 2609.40 1.20 138.05 12580
59 218550 1015892 3.48 3.53 418.79 2676.24 1.18 139.59 13006
60 218179 994850 3.35 3.41 436.78 2751.42 1.19 140.58 13815
61 222218 987503 3.33 3.39 450.50 2832.63 1.21 139.82 14579
62 222196 986743 3.48 3.55 458.72 2862.98 1.19 140.77 14960
63 223393 1020674 3.66 3.73 468.69 2907.81 1.20 140.96 14904
64 223292 1024067 3.92 4.01 469.40 2927.28 1.23 143.59 16028
65 226236 1040444 3.96 4.06 440.41 2784.06 1.28 142.70 17079
66 228831 1019081 3.97 4.08 440.25 2799.96 1.27 145.11 15155
67 228745 1027828 3.99 4.10 454.06 2856.24 1.27 146.70 16049
68 229140 1021010 3.90 3.97 469.01 2913.79 1.28 148.53 15841
69 229270 1025563 3.78 3.84 483.62 2949.45 1.27 148.99 15159
70 229359 1044756 3.82 3.88 486.57 3047.90 1.26 149.65 14956
71 230006 1062545 3.75 3.80 477.67 3006.92 1.29 151.11 15645
72 228810 1070425 3.81 3.89 495.34 3092.79 1.32 154.82 15318
73 232677 1100087 4.05 4.11 499.81 3146.87 1.30 156.56 15595
74 232961 1093596 4.07 4.12 490.21 3073.62 1.31 157.60 16355
75 234629 1109143 3.98 3.98 510.50 3126.60 1.32 155.24 15925
76 235660 1113855 4.19 4.25 530.81 3244.06 1.35 160.68 16175
77 240024 1129275 4.32 4.38 540.39 3323.03 1.35 163.22 15900
78 243554 1131996 4.61 4.66 548.21 3328.75 1.34 164.55 15711
79 244368 1144103 4.57 4.63 533.99 3211.79 1.37 166.76 15594
80 244356 1167830 4.38 4.43 522.73 3191.27 1.36 159.05 15693
81 245126 1153194 4.34 4.37 540.98 3248.57 1.39 159.82 16438
82 246321 1175008 4.38 4.40 547.85 3335.88 1.42 164.95 17048
83 246797 1175805 4.21 4.25 507.58 3209.49 1.47 162.89 17699
84 246735 1173456 4.34 4.38 515.77 3167.39 1.46 163.55 17733
85 251083 1187498 4.13 4.22 441.33 2791.94 1.47 158.68 19439
86 251786 1202958 4.05 4.14 446.53 2757.24 1.47 157.97 20148
87 252732 1206229 3.97 4.07 442.43 2636.45 1.55 156.59 20112
88 255051 1249533 4.21 4.28 475.56 2806.76 1.58 161.56 18607
89 259022 1279743 4.35 4.42 485.52 2783.36 1.56 162.31 18409
90 261698 1283496 4.73 4.81 425.93 2522.41 1.56 166.26 18388
91 263891 1282942 4.69 4.82 399.95 2493.36 1.58 168.45 19187
92 265247 1284739 4.40 4.50 412.84 2515.39 1.50 163.63 17983
93 262228 1337169 4.35 4.50 331.45 2268.77 1.44 153.20 18449
94 263429 1314087 4.23 4.44 267.69 2008.13 1.33 133.52 19589
95 264305 1306144 3.96 4.20 252.55 1868.25 1.27 123.28 19135
96 266371 1200391 3.65 3.89 245.94 1798.68 1.34 122.51 19604
97 273248 1265445 3.76 4.11 248.60 1717.60 1.32 119.73 20877
98 275472 1259329 3.80 4.20 219.81 1546.92 1.28 118.30 23639
99 278146 1219342 3.66 4.15 216.98 1580.19 1.31 127.65 22830
100 279506 1227626 3.77 4.09 240.76 1771.33 1.32 130.25 21760
101 283991 1232874 3.85 4.14 259.45 1846.92 1.37 131.85 21879
102 286794 1241046 3.96 4.32 254.71 1821.18 1.40 135.39 21712
103 288703 1244172 3.76 4.09 283.17 1988.41 1.41 133.09 21321
104 289285 1237838 3.61 3.89 296.27 2074.01 1.43 135.31 21396
105 288869 1212801 3.58 3.86 311.35 2119.77 1.46 133.14 22000
106 286942 1234237 3.53 3.80 302.36 2081.89 1.48 133.91 22642
107 285833 1224699 3.52 3.83 305.90 2099.55 1.49 132.97 24272
108 284095 1237432 3.44 3.88 335.33 2233.67 1.46 131.21 24933
109 289229 1248847 3.47 4.10 327.90 2150.37 1.43 130.34 25219
110 289389 1256543 3.36 4.11 317.74 2146.66 1.37 123.46 25745
111 290793 1252434 3.37 3.98 344.22 2287.88 1.36 123.03 26433
112 291454 1265176 3.32 4.17 345.91 2236.06 1.34 125.33 27546
113 294733 1314670 3.02 3.68 320.70 2110.35 1.26 115.83 30774
114 293853 1299329 2.90 3.70 316.81 2086.51 1.22 110.99 32456
115 294056 1216744 2.85 3.62 330.64 2187.47 1.28 111.73 30124
116 293982 1225275 2.56 3.44 316.47 2159.21 1.29 110.04 30250
117 293075 1193478 2.52 3.50 334.39 2218.23 1.31 110.26 31288
118 292391 1207226 2.58 3.34 337.23 2274.11 1.39 113.67 31072
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Leningen `10jNL` `10JEUR` AEX EURO
2.553e+04 6.758e-02 1.138e+04 -1.278e+04 -2.841e+02 4.832e+01
USD YEN GOLD
3.675e+04 1.087e+02 4.306e+00
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-12711.2 -3588.9 -491.2 3945.6 14855.3
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.553e+04 1.138e+04 2.243 0.02690 *
Leningen 6.758e-02 1.392e-02 4.854 4.07e-06 ***
`10jNL` 1.138e+04 9.101e+03 1.250 0.21395
`10JEUR` -1.278e+04 9.791e+03 -1.305 0.19451
AEX -2.841e+02 5.232e+01 -5.429 3.46e-07 ***
EURO 4.832e+01 9.860e+00 4.901 3.35e-06 ***
USD 3.675e+04 1.289e+04 2.850 0.00523 **
YEN 1.087e+02 1.035e+02 1.050 0.29617
GOLD 4.306e+00 3.356e-01 12.832 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 6230 on 109 degrees of freedom
Multiple R-squared: 0.982, Adjusted R-squared: 0.9807
F-statistic: 742.2 on 8 and 109 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,] 1.318844e-03 2.637688e-03 0.9986811562
[2,] 1.050470e-04 2.100940e-04 0.9998949530
[3,] 7.639417e-06 1.527883e-05 0.9999923606
[4,] 1.232044e-04 2.464088e-04 0.9998767956
[5,] 1.920703e-05 3.841406e-05 0.9999807930
[6,] 3.532429e-06 7.064857e-06 0.9999964676
[7,] 1.598465e-06 3.196930e-06 0.9999984015
[8,] 2.925977e-06 5.851954e-06 0.9999970740
[9,] 8.849166e-07 1.769833e-06 0.9999991151
[10,] 4.398692e-07 8.797385e-07 0.9999995601
[11,] 1.812007e-07 3.624013e-07 0.9999998188
[12,] 9.089094e-08 1.817819e-07 0.9999999091
[13,] 2.442995e-08 4.885990e-08 0.9999999756
[14,] 6.411558e-08 1.282312e-07 0.9999999359
[15,] 2.174005e-08 4.348009e-08 0.9999999783
[16,] 1.850824e-08 3.701648e-08 0.9999999815
[17,] 1.363104e-08 2.726209e-08 0.9999999864
[18,] 4.509685e-09 9.019370e-09 0.9999999955
[19,] 2.117608e-09 4.235216e-09 0.9999999979
[20,] 2.071533e-08 4.143066e-08 0.9999999793
[21,] 6.647980e-08 1.329596e-07 0.9999999335
[22,] 5.307093e-08 1.061419e-07 0.9999999469
[23,] 5.034807e-08 1.006961e-07 0.9999999497
[24,] 1.661056e-08 3.322112e-08 0.9999999834
[25,] 1.703969e-08 3.407938e-08 0.9999999830
[26,] 7.350292e-09 1.470058e-08 0.9999999926
[27,] 3.827387e-09 7.654774e-09 0.9999999962
[28,] 2.014050e-09 4.028100e-09 0.9999999980
[29,] 1.158341e-09 2.316681e-09 0.9999999988
[30,] 4.249285e-10 8.498571e-10 0.9999999996
[31,] 2.070886e-10 4.141772e-10 0.9999999998
[32,] 7.790628e-11 1.558126e-10 0.9999999999
[33,] 3.260318e-11 6.520636e-11 1.0000000000
[34,] 1.716911e-11 3.433821e-11 1.0000000000
[35,] 1.689992e-11 3.379984e-11 1.0000000000
[36,] 4.156695e-11 8.313391e-11 1.0000000000
[37,] 4.987796e-11 9.975591e-11 1.0000000000
[38,] 6.396306e-11 1.279261e-10 0.9999999999
[39,] 6.068014e-11 1.213603e-10 0.9999999999
[40,] 5.893384e-11 1.178677e-10 0.9999999999
[41,] 1.180631e-10 2.361261e-10 0.9999999999
[42,] 1.834011e-10 3.668023e-10 0.9999999998
[43,] 2.746956e-09 5.493912e-09 0.9999999973
[44,] 4.238418e-04 8.476836e-04 0.9995761582
[45,] 6.137868e-04 1.227574e-03 0.9993862132
[46,] 4.149208e-04 8.298417e-04 0.9995850792
[47,] 4.927750e-04 9.855500e-04 0.9995072250
[48,] 4.599509e-04 9.199018e-04 0.9995400491
[49,] 8.271303e-04 1.654261e-03 0.9991728697
[50,] 9.746017e-04 1.949203e-03 0.9990253983
[51,] 7.774482e-04 1.554896e-03 0.9992225518
[52,] 5.280316e-04 1.056063e-03 0.9994719684
[53,] 6.768606e-04 1.353721e-03 0.9993231394
[54,] 2.520748e-03 5.041495e-03 0.9974792524
[55,] 3.810345e-03 7.620690e-03 0.9961896551
[56,] 4.192597e-03 8.385195e-03 0.9958074025
[57,] 3.557717e-03 7.115434e-03 0.9964422832
[58,] 2.360902e-03 4.721804e-03 0.9976390980
[59,] 1.509374e-03 3.018749e-03 0.9984906256
[60,] 1.606227e-03 3.212455e-03 0.9983937725
[61,] 1.726786e-03 3.453571e-03 0.9982732143
[62,] 1.326723e-03 2.653446e-03 0.9986732772
[63,] 1.671671e-03 3.343341e-03 0.9983283295
[64,] 1.458140e-03 2.916280e-03 0.9985418601
[65,] 1.151002e-03 2.302003e-03 0.9988489984
[66,] 8.903026e-04 1.780605e-03 0.9991096974
[67,] 1.905853e-03 3.811707e-03 0.9980941467
[68,] 2.693653e-03 5.387306e-03 0.9973063469
[69,] 2.584132e-03 5.168264e-03 0.9974158678
[70,] 3.171043e-03 6.342086e-03 0.9968289571
[71,] 7.224023e-03 1.444805e-02 0.9927759766
[72,] 9.369474e-03 1.873895e-02 0.9906305260
[73,] 1.664091e-02 3.328181e-02 0.9833590930
[74,] 1.400722e-02 2.801444e-02 0.9859927797
[75,] 1.163019e-02 2.326038e-02 0.9883698090
[76,] 2.634826e-02 5.269651e-02 0.9736517444
[77,] 2.872451e-02 5.744902e-02 0.9712754900
[78,] 2.290238e-02 4.580476e-02 0.9770976189
[79,] 2.078259e-02 4.156517e-02 0.9792174127
[80,] 4.009189e-02 8.018378e-02 0.9599081083
[81,] 6.356261e-02 1.271252e-01 0.9364373892
[82,] 5.342614e-01 9.314772e-01 0.4657386216
[83,] 6.677334e-01 6.645332e-01 0.3322665769
[84,] 8.370942e-01 3.258116e-01 0.1629057996
[85,] 9.804808e-01 3.903832e-02 0.0195191612
[86,] 9.842486e-01 3.150287e-02 0.0157514347
[87,] 9.793983e-01 4.120330e-02 0.0206016522
[88,] 9.829753e-01 3.404931e-02 0.0170246571
[89,] 9.982461e-01 3.507756e-03 0.0017538779
[90,] 9.994086e-01 1.182877e-03 0.0005914385
[91,] 9.982687e-01 3.462635e-03 0.0017313177
[92,] 9.951716e-01 9.656777e-03 0.0048283885
[93,] 9.879376e-01 2.412478e-02 0.0120623919
[94,] 9.719263e-01 5.614749e-02 0.0280737441
[95,] 9.238211e-01 1.523577e-01 0.0761788553
> postscript(file="/var/www/html/rcomp/tmp/1iwh21292943782.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/www/html/rcomp/tmp/2iwh21292943782.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/www/html/rcomp/tmp/3iwh21292943782.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/www/html/rcomp/tmp/4sng51292943782.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/www/html/rcomp/tmp/5sng51292943782.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 = 118
Frequency = 1
1 2 3 4 5
-4578.034187 -488.069828 -6020.206192 -2598.814191 -4774.248514
6 7 8 9 10
493.912228 2098.281698 4861.855781 -3230.935762 -5867.794641
11 12 13 14 15
-1490.626444 -494.235968 3914.417956 1043.501524 5473.861301
16 17 18 19 20
6294.528049 4482.483303 7176.346945 763.778823 2709.216495
21 22 23 24 25
-3784.093797 523.611341 -581.578611 -3065.553103 -2175.014773
26 27 28 29 30
-7965.615866 -6442.449837 -3188.608789 -8070.032894 -6493.901923
31 32 33 34 35
1445.384973 3354.951090 -981.112206 565.578080 -1439.306266
36 37 38 39 40
-7120.962450 -1455.900192 -1364.471173 -3594.954085 -2246.215642
41 42 43 44 45
-157.261853 3266.416582 -717.253472 -1575.937869 -3312.043691
46 47 48 49 50
-5104.143734 -8065.258986 -6180.955295 258.649036 1154.661275
51 52 53 54 55
-1278.051558 -5234.338562 -2470.338510 2363.235686 14378.004347
56 57 58 59 60
11879.246988 5932.032621 3136.795027 4998.928051 3514.463682
61 62 63 64 65
4053.124694 4280.392386 3955.979092 -2721.351848 -8281.464430
66 67 68 69 70
3475.827679 7.944771 2021.656218 7229.339296 3328.128891
71 72 73 74 75
-2229.157747 -2717.215706 -2763.963964 -5081.854798 -285.213928
76 77 78 79 80
-1187.453330 2130.580831 8737.648151 9578.391415 6140.455602
81 82 83 84 85
5609.337865 -1295.453613 -10605.570039 -5816.177004 -12261.966527
86 87 88 89 90
-12537.896133 -9760.158233 -4394.105938 3197.936618 1623.422053
91 92 93 94 95
-5953.441866 5736.263952 -10129.708297 -11016.963866 -1868.743355
96 97 98 99 100
3884.780101 8154.576335 1287.578540 6571.201675 6829.876043
101 102 103 104 105
9822.263925 12251.209975 14855.333828 13301.916081 13141.098152
106 107 108 109 110
5260.891974 -1838.335308 -2560.586110 6152.219130 5151.985038
111 112 113 114 115
3208.562989 4682.004755 -9248.131553 -12670.596047 -533.167217
116 117 118
-3570.923745 -4096.963347 -12711.186122
> postscript(file="/var/www/html/rcomp/tmp/6sng51292943782.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 = 118
Frequency = 1
lag(myerror, k = 1) myerror
0 -4578.034187 NA
1 -488.069828 -4578.034187
2 -6020.206192 -488.069828
3 -2598.814191 -6020.206192
4 -4774.248514 -2598.814191
5 493.912228 -4774.248514
6 2098.281698 493.912228
7 4861.855781 2098.281698
8 -3230.935762 4861.855781
9 -5867.794641 -3230.935762
10 -1490.626444 -5867.794641
11 -494.235968 -1490.626444
12 3914.417956 -494.235968
13 1043.501524 3914.417956
14 5473.861301 1043.501524
15 6294.528049 5473.861301
16 4482.483303 6294.528049
17 7176.346945 4482.483303
18 763.778823 7176.346945
19 2709.216495 763.778823
20 -3784.093797 2709.216495
21 523.611341 -3784.093797
22 -581.578611 523.611341
23 -3065.553103 -581.578611
24 -2175.014773 -3065.553103
25 -7965.615866 -2175.014773
26 -6442.449837 -7965.615866
27 -3188.608789 -6442.449837
28 -8070.032894 -3188.608789
29 -6493.901923 -8070.032894
30 1445.384973 -6493.901923
31 3354.951090 1445.384973
32 -981.112206 3354.951090
33 565.578080 -981.112206
34 -1439.306266 565.578080
35 -7120.962450 -1439.306266
36 -1455.900192 -7120.962450
37 -1364.471173 -1455.900192
38 -3594.954085 -1364.471173
39 -2246.215642 -3594.954085
40 -157.261853 -2246.215642
41 3266.416582 -157.261853
42 -717.253472 3266.416582
43 -1575.937869 -717.253472
44 -3312.043691 -1575.937869
45 -5104.143734 -3312.043691
46 -8065.258986 -5104.143734
47 -6180.955295 -8065.258986
48 258.649036 -6180.955295
49 1154.661275 258.649036
50 -1278.051558 1154.661275
51 -5234.338562 -1278.051558
52 -2470.338510 -5234.338562
53 2363.235686 -2470.338510
54 14378.004347 2363.235686
55 11879.246988 14378.004347
56 5932.032621 11879.246988
57 3136.795027 5932.032621
58 4998.928051 3136.795027
59 3514.463682 4998.928051
60 4053.124694 3514.463682
61 4280.392386 4053.124694
62 3955.979092 4280.392386
63 -2721.351848 3955.979092
64 -8281.464430 -2721.351848
65 3475.827679 -8281.464430
66 7.944771 3475.827679
67 2021.656218 7.944771
68 7229.339296 2021.656218
69 3328.128891 7229.339296
70 -2229.157747 3328.128891
71 -2717.215706 -2229.157747
72 -2763.963964 -2717.215706
73 -5081.854798 -2763.963964
74 -285.213928 -5081.854798
75 -1187.453330 -285.213928
76 2130.580831 -1187.453330
77 8737.648151 2130.580831
78 9578.391415 8737.648151
79 6140.455602 9578.391415
80 5609.337865 6140.455602
81 -1295.453613 5609.337865
82 -10605.570039 -1295.453613
83 -5816.177004 -10605.570039
84 -12261.966527 -5816.177004
85 -12537.896133 -12261.966527
86 -9760.158233 -12537.896133
87 -4394.105938 -9760.158233
88 3197.936618 -4394.105938
89 1623.422053 3197.936618
90 -5953.441866 1623.422053
91 5736.263952 -5953.441866
92 -10129.708297 5736.263952
93 -11016.963866 -10129.708297
94 -1868.743355 -11016.963866
95 3884.780101 -1868.743355
96 8154.576335 3884.780101
97 1287.578540 8154.576335
98 6571.201675 1287.578540
99 6829.876043 6571.201675
100 9822.263925 6829.876043
101 12251.209975 9822.263925
102 14855.333828 12251.209975
103 13301.916081 14855.333828
104 13141.098152 13301.916081
105 5260.891974 13141.098152
106 -1838.335308 5260.891974
107 -2560.586110 -1838.335308
108 6152.219130 -2560.586110
109 5151.985038 6152.219130
110 3208.562989 5151.985038
111 4682.004755 3208.562989
112 -9248.131553 4682.004755
113 -12670.596047 -9248.131553
114 -533.167217 -12670.596047
115 -3570.923745 -533.167217
116 -4096.963347 -3570.923745
117 -12711.186122 -4096.963347
118 NA -12711.186122
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -488.069828 -4578.034187
[2,] -6020.206192 -488.069828
[3,] -2598.814191 -6020.206192
[4,] -4774.248514 -2598.814191
[5,] 493.912228 -4774.248514
[6,] 2098.281698 493.912228
[7,] 4861.855781 2098.281698
[8,] -3230.935762 4861.855781
[9,] -5867.794641 -3230.935762
[10,] -1490.626444 -5867.794641
[11,] -494.235968 -1490.626444
[12,] 3914.417956 -494.235968
[13,] 1043.501524 3914.417956
[14,] 5473.861301 1043.501524
[15,] 6294.528049 5473.861301
[16,] 4482.483303 6294.528049
[17,] 7176.346945 4482.483303
[18,] 763.778823 7176.346945
[19,] 2709.216495 763.778823
[20,] -3784.093797 2709.216495
[21,] 523.611341 -3784.093797
[22,] -581.578611 523.611341
[23,] -3065.553103 -581.578611
[24,] -2175.014773 -3065.553103
[25,] -7965.615866 -2175.014773
[26,] -6442.449837 -7965.615866
[27,] -3188.608789 -6442.449837
[28,] -8070.032894 -3188.608789
[29,] -6493.901923 -8070.032894
[30,] 1445.384973 -6493.901923
[31,] 3354.951090 1445.384973
[32,] -981.112206 3354.951090
[33,] 565.578080 -981.112206
[34,] -1439.306266 565.578080
[35,] -7120.962450 -1439.306266
[36,] -1455.900192 -7120.962450
[37,] -1364.471173 -1455.900192
[38,] -3594.954085 -1364.471173
[39,] -2246.215642 -3594.954085
[40,] -157.261853 -2246.215642
[41,] 3266.416582 -157.261853
[42,] -717.253472 3266.416582
[43,] -1575.937869 -717.253472
[44,] -3312.043691 -1575.937869
[45,] -5104.143734 -3312.043691
[46,] -8065.258986 -5104.143734
[47,] -6180.955295 -8065.258986
[48,] 258.649036 -6180.955295
[49,] 1154.661275 258.649036
[50,] -1278.051558 1154.661275
[51,] -5234.338562 -1278.051558
[52,] -2470.338510 -5234.338562
[53,] 2363.235686 -2470.338510
[54,] 14378.004347 2363.235686
[55,] 11879.246988 14378.004347
[56,] 5932.032621 11879.246988
[57,] 3136.795027 5932.032621
[58,] 4998.928051 3136.795027
[59,] 3514.463682 4998.928051
[60,] 4053.124694 3514.463682
[61,] 4280.392386 4053.124694
[62,] 3955.979092 4280.392386
[63,] -2721.351848 3955.979092
[64,] -8281.464430 -2721.351848
[65,] 3475.827679 -8281.464430
[66,] 7.944771 3475.827679
[67,] 2021.656218 7.944771
[68,] 7229.339296 2021.656218
[69,] 3328.128891 7229.339296
[70,] -2229.157747 3328.128891
[71,] -2717.215706 -2229.157747
[72,] -2763.963964 -2717.215706
[73,] -5081.854798 -2763.963964
[74,] -285.213928 -5081.854798
[75,] -1187.453330 -285.213928
[76,] 2130.580831 -1187.453330
[77,] 8737.648151 2130.580831
[78,] 9578.391415 8737.648151
[79,] 6140.455602 9578.391415
[80,] 5609.337865 6140.455602
[81,] -1295.453613 5609.337865
[82,] -10605.570039 -1295.453613
[83,] -5816.177004 -10605.570039
[84,] -12261.966527 -5816.177004
[85,] -12537.896133 -12261.966527
[86,] -9760.158233 -12537.896133
[87,] -4394.105938 -9760.158233
[88,] 3197.936618 -4394.105938
[89,] 1623.422053 3197.936618
[90,] -5953.441866 1623.422053
[91,] 5736.263952 -5953.441866
[92,] -10129.708297 5736.263952
[93,] -11016.963866 -10129.708297
[94,] -1868.743355 -11016.963866
[95,] 3884.780101 -1868.743355
[96,] 8154.576335 3884.780101
[97,] 1287.578540 8154.576335
[98,] 6571.201675 1287.578540
[99,] 6829.876043 6571.201675
[100,] 9822.263925 6829.876043
[101,] 12251.209975 9822.263925
[102,] 14855.333828 12251.209975
[103,] 13301.916081 14855.333828
[104,] 13141.098152 13301.916081
[105,] 5260.891974 13141.098152
[106,] -1838.335308 5260.891974
[107,] -2560.586110 -1838.335308
[108,] 6152.219130 -2560.586110
[109,] 5151.985038 6152.219130
[110,] 3208.562989 5151.985038
[111,] 4682.004755 3208.562989
[112,] -9248.131553 4682.004755
[113,] -12670.596047 -9248.131553
[114,] -533.167217 -12670.596047
[115,] -3570.923745 -533.167217
[116,] -4096.963347 -3570.923745
[117,] -12711.186122 -4096.963347
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -488.069828 -4578.034187
2 -6020.206192 -488.069828
3 -2598.814191 -6020.206192
4 -4774.248514 -2598.814191
5 493.912228 -4774.248514
6 2098.281698 493.912228
7 4861.855781 2098.281698
8 -3230.935762 4861.855781
9 -5867.794641 -3230.935762
10 -1490.626444 -5867.794641
11 -494.235968 -1490.626444
12 3914.417956 -494.235968
13 1043.501524 3914.417956
14 5473.861301 1043.501524
15 6294.528049 5473.861301
16 4482.483303 6294.528049
17 7176.346945 4482.483303
18 763.778823 7176.346945
19 2709.216495 763.778823
20 -3784.093797 2709.216495
21 523.611341 -3784.093797
22 -581.578611 523.611341
23 -3065.553103 -581.578611
24 -2175.014773 -3065.553103
25 -7965.615866 -2175.014773
26 -6442.449837 -7965.615866
27 -3188.608789 -6442.449837
28 -8070.032894 -3188.608789
29 -6493.901923 -8070.032894
30 1445.384973 -6493.901923
31 3354.951090 1445.384973
32 -981.112206 3354.951090
33 565.578080 -981.112206
34 -1439.306266 565.578080
35 -7120.962450 -1439.306266
36 -1455.900192 -7120.962450
37 -1364.471173 -1455.900192
38 -3594.954085 -1364.471173
39 -2246.215642 -3594.954085
40 -157.261853 -2246.215642
41 3266.416582 -157.261853
42 -717.253472 3266.416582
43 -1575.937869 -717.253472
44 -3312.043691 -1575.937869
45 -5104.143734 -3312.043691
46 -8065.258986 -5104.143734
47 -6180.955295 -8065.258986
48 258.649036 -6180.955295
49 1154.661275 258.649036
50 -1278.051558 1154.661275
51 -5234.338562 -1278.051558
52 -2470.338510 -5234.338562
53 2363.235686 -2470.338510
54 14378.004347 2363.235686
55 11879.246988 14378.004347
56 5932.032621 11879.246988
57 3136.795027 5932.032621
58 4998.928051 3136.795027
59 3514.463682 4998.928051
60 4053.124694 3514.463682
61 4280.392386 4053.124694
62 3955.979092 4280.392386
63 -2721.351848 3955.979092
64 -8281.464430 -2721.351848
65 3475.827679 -8281.464430
66 7.944771 3475.827679
67 2021.656218 7.944771
68 7229.339296 2021.656218
69 3328.128891 7229.339296
70 -2229.157747 3328.128891
71 -2717.215706 -2229.157747
72 -2763.963964 -2717.215706
73 -5081.854798 -2763.963964
74 -285.213928 -5081.854798
75 -1187.453330 -285.213928
76 2130.580831 -1187.453330
77 8737.648151 2130.580831
78 9578.391415 8737.648151
79 6140.455602 9578.391415
80 5609.337865 6140.455602
81 -1295.453613 5609.337865
82 -10605.570039 -1295.453613
83 -5816.177004 -10605.570039
84 -12261.966527 -5816.177004
85 -12537.896133 -12261.966527
86 -9760.158233 -12537.896133
87 -4394.105938 -9760.158233
88 3197.936618 -4394.105938
89 1623.422053 3197.936618
90 -5953.441866 1623.422053
91 5736.263952 -5953.441866
92 -10129.708297 5736.263952
93 -11016.963866 -10129.708297
94 -1868.743355 -11016.963866
95 3884.780101 -1868.743355
96 8154.576335 3884.780101
97 1287.578540 8154.576335
98 6571.201675 1287.578540
99 6829.876043 6571.201675
100 9822.263925 6829.876043
101 12251.209975 9822.263925
102 14855.333828 12251.209975
103 13301.916081 14855.333828
104 13141.098152 13301.916081
105 5260.891974 13141.098152
106 -1838.335308 5260.891974
107 -2560.586110 -1838.335308
108 6152.219130 -2560.586110
109 5151.985038 6152.219130
110 3208.562989 5151.985038
111 4682.004755 3208.562989
112 -9248.131553 4682.004755
113 -12670.596047 -9248.131553
114 -533.167217 -12670.596047
115 -3570.923745 -533.167217
116 -4096.963347 -3570.923745
117 -12711.186122 -4096.963347
> 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/www/html/rcomp/tmp/7lef81292943782.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/www/html/rcomp/tmp/8eoet1292943782.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/www/html/rcomp/tmp/9eoet1292943782.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/www/html/rcomp/tmp/10eoet1292943782.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/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/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/www/html/rcomp/tmp/11axc21292943782.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/www/html/rcomp/tmp/12vgbq1292943782.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/www/html/rcomp/tmp/13989z1292943782.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/www/html/rcomp/tmp/14vq741292943782.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/www/html/rcomp/tmp/15gr5s1292943782.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/www/html/rcomp/tmp/162rmg1292943782.tab")
+ }
>
> try(system("convert tmp/1iwh21292943782.ps tmp/1iwh21292943782.png",intern=TRUE))
character(0)
> try(system("convert tmp/2iwh21292943782.ps tmp/2iwh21292943782.png",intern=TRUE))
character(0)
> try(system("convert tmp/3iwh21292943782.ps tmp/3iwh21292943782.png",intern=TRUE))
character(0)
> try(system("convert tmp/4sng51292943782.ps tmp/4sng51292943782.png",intern=TRUE))
character(0)
> try(system("convert tmp/5sng51292943782.ps tmp/5sng51292943782.png",intern=TRUE))
character(0)
> try(system("convert tmp/6sng51292943782.ps tmp/6sng51292943782.png",intern=TRUE))
character(0)
> try(system("convert tmp/7lef81292943782.ps tmp/7lef81292943782.png",intern=TRUE))
character(0)
> try(system("convert tmp/8eoet1292943782.ps tmp/8eoet1292943782.png",intern=TRUE))
character(0)
> try(system("convert tmp/9eoet1292943782.ps tmp/9eoet1292943782.png",intern=TRUE))
character(0)
> try(system("convert tmp/10eoet1292943782.ps tmp/10eoet1292943782.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.576 1.742 15.795