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 = '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 t
1 143827 829461 4.93 5.01 639.98 3536.15 0.94 109.57 9113 1
2 145191 837669 4.92 5.02 597.33 3240.92 0.92 107.08 9140 2
3 146832 854793 4.83 4.94 558.36 3121.58 0.91 110.33 9309 3
4 148577 850092 5.02 5.10 593.09 3302.70 0.89 110.36 9395 4
5 149873 848783 5.22 5.26 585.15 3292.49 0.87 106.50 10027 5
6 151847 846150 5.17 5.21 573.50 3162.62 0.85 104.30 10202 6
7 153252 828543 5.17 5.25 548.72 3051.60 0.86 107.21 10003 7
8 154292 830389 4.98 5.06 523.63 2848.11 0.90 109.34 9745 8
9 155657 848989 4.98 5.04 453.87 2577.68 0.91 108.20 9966 9
10 156523 841106 4.77 4.82 460.33 2680.55 0.91 109.86 10035 10
11 156416 854616 4.62 4.67 492.67 2775.70 0.89 108.68 9999 11
12 156693 832714 4.89 4.95 506.78 2879.30 0.89 113.38 9943 12
13 160312 839290 4.97 5.02 500.92 2790.11 0.88 117.12 10258 13
14 160438 840572 5.03 5.07 494.91 2764.18 0.87 116.23 10926 14
15 160882 869186 5.27 5.31 531.21 2868.37 0.88 114.75 10807 15
16 161668 856979 5.25 5.29 511.28 2740.50 0.89 115.81 10992 16
17 164391 872126 5.30 5.31 484.55 2622.87 0.92 115.86 11034 17
18 168556 868281 5.16 5.17 439.66 2376.70 0.96 117.80 10801 18
19 169738 862455 4.99 5.03 363.59 2133.57 0.99 117.11 10161 19
20 170387 881177 4.71 4.73 371.59 2120.90 0.98 116.31 10191 20
21 171294 886924 4.50 4.52 296.36 1789.81 0.98 118.38 10451 21
22 172202 886842 4.58 4.62 342.84 1999.59 0.98 121.57 10380 22
23 172651 916407 4.56 4.59 361.99 2095.87 1.00 121.65 10251 23
24 172770 890606 4.36 4.41 322.73 1909.40 1.02 124.20 10522 24
25 178366 900409 4.19 4.27 294.94 1773.09 1.06 126.12 10801 25
26 180014 920169 3.97 4.06 266.21 1712.20 1.08 128.60 10731 26
27 181067 922871 4.01 4.13 248.54 1655.69 1.08 128.16 10161 27
28 182586 920004 4.23 4.23 282.63 1833.04 1.08 130.12 9728 28
29 184957 945772 3.91 3.92 280.57 1840.93 1.16 135.83 9882 29
30 186417 937507 3.72 3.72 291.55 1897.71 1.17 138.05 9839 30
31 188599 941691 4.04 4.06 317.49 1962.54 1.14 134.99 9917 31
32 189490 958256 4.19 4.21 329.41 1982.29 1.11 132.38 10356 32
33 190264 963509 4.21 4.23 306.78 1903.72 1.12 128.94 10857 33
34 191221 970266 4.27 4.31 330.22 2029.31 1.17 128.12 10424 34
35 191110 972853 4.41 4.44 332.19 2052.05 1.17 127.84 10721 35
36 190674 982168 4.33 4.36 337.65 2126.04 1.23 132.43 10669 36
37 195438 999892 4.18 4.26 353.31 2166.17 1.26 134.13 10565 37
38 196393 1002099 4.12 4.18 356.59 2216.34 1.26 134.78 10289 38
39 197172 1017611 3.93 4.02 338.87 2149.88 1.23 133.13 10646 39
40 198760 1029782 4.13 4.24 341.41 2176.87 1.20 129.08 10858 40
41 200945 1047956 4.37 4.39 337.19 2150.98 1.20 134.48 10282 41
42 203845 1047689 4.42 4.44 345.13 2176.22 1.21 132.86 10377 42
43 204613 1060054 4.31 4.34 329.91 2143.40 1.23 134.08 10443 43
44 205487 1067078 4.15 4.17 323.12 2118.28 1.22 134.54 10561 44
45 206100 1072366 4.09 4.11 323.94 2153.11 1.22 134.51 10668 45
46 206315 1081823 3.96 3.98 330.48 2176.63 1.25 135.97 10818 46
47 206291 1087601 3.85 3.87 337.15 2222.87 1.30 136.09 10865 47
48 207801 1089905 3.63 3.69 348.08 2263.48 1.34 139.14 10636 48
49 211653 1116316 3.56 3.63 360.42 2297.09 1.31 135.63 10409 49
50 211325 1111355 3.55 3.62 374.37 2361.41 1.30 136.55 10460 50
51 211893 1124250 3.69 3.76 369.56 2350.32 1.32 138.83 10579 51
52 212056 1140597 3.48 3.57 348.20 2301.54 1.29 138.84 10664 52
53 214696 1151683 3.30 3.40 364.68 2396.60 1.27 135.37 10711 53
54 217455 1137532 3.13 3.25 383.83 2472.42 1.22 132.22 11374 54
55 218884 967532 3.27 3.32 395.77 2558.95 1.20 134.75 11345 55
56 219816 972994 3.28 3.32 389.60 2548.21 1.23 135.98 11456 56
57 219984 999207 3.12 3.16 402.99 2666.55 1.23 136.06 11966 57
58 219062 1007982 3.28 3.32 394.16 2609.40 1.20 138.05 12580 58
59 218550 1015892 3.48 3.53 418.79 2676.24 1.18 139.59 13006 59
60 218179 994850 3.35 3.41 436.78 2751.42 1.19 140.58 13815 60
61 222218 987503 3.33 3.39 450.50 2832.63 1.21 139.82 14579 61
62 222196 986743 3.48 3.55 458.72 2862.98 1.19 140.77 14960 62
63 223393 1020674 3.66 3.73 468.69 2907.81 1.20 140.96 14904 63
64 223292 1024067 3.92 4.01 469.40 2927.28 1.23 143.59 16028 64
65 226236 1040444 3.96 4.06 440.41 2784.06 1.28 142.70 17079 65
66 228831 1019081 3.97 4.08 440.25 2799.96 1.27 145.11 15155 66
67 228745 1027828 3.99 4.10 454.06 2856.24 1.27 146.70 16049 67
68 229140 1021010 3.90 3.97 469.01 2913.79 1.28 148.53 15841 68
69 229270 1025563 3.78 3.84 483.62 2949.45 1.27 148.99 15159 69
70 229359 1044756 3.82 3.88 486.57 3047.90 1.26 149.65 14956 70
71 230006 1062545 3.75 3.80 477.67 3006.92 1.29 151.11 15645 71
72 228810 1070425 3.81 3.89 495.34 3092.79 1.32 154.82 15318 72
73 232677 1100087 4.05 4.11 499.81 3146.87 1.30 156.56 15595 73
74 232961 1093596 4.07 4.12 490.21 3073.62 1.31 157.60 16355 74
75 234629 1109143 3.98 3.98 510.50 3126.60 1.32 155.24 15925 75
76 235660 1113855 4.19 4.25 530.81 3244.06 1.35 160.68 16175 76
77 240024 1129275 4.32 4.38 540.39 3323.03 1.35 163.22 15900 77
78 243554 1131996 4.61 4.66 548.21 3328.75 1.34 164.55 15711 78
79 244368 1144103 4.57 4.63 533.99 3211.79 1.37 166.76 15594 79
80 244356 1167830 4.38 4.43 522.73 3191.27 1.36 159.05 15693 80
81 245126 1153194 4.34 4.37 540.98 3248.57 1.39 159.82 16438 81
82 246321 1175008 4.38 4.40 547.85 3335.88 1.42 164.95 17048 82
83 246797 1175805 4.21 4.25 507.58 3209.49 1.47 162.89 17699 83
84 246735 1173456 4.34 4.38 515.77 3167.39 1.46 163.55 17733 84
85 251083 1187498 4.13 4.22 441.33 2791.94 1.47 158.68 19439 85
86 251786 1202958 4.05 4.14 446.53 2757.24 1.47 157.97 20148 86
87 252732 1206229 3.97 4.07 442.43 2636.45 1.55 156.59 20112 87
88 255051 1249533 4.21 4.28 475.56 2806.76 1.58 161.56 18607 88
89 259022 1279743 4.35 4.42 485.52 2783.36 1.56 162.31 18409 89
90 261698 1283496 4.73 4.81 425.93 2522.41 1.56 166.26 18388 90
91 263891 1282942 4.69 4.82 399.95 2493.36 1.58 168.45 19187 91
92 265247 1284739 4.40 4.50 412.84 2515.39 1.50 163.63 17983 92
93 262228 1337169 4.35 4.50 331.45 2268.77 1.44 153.20 18449 93
94 263429 1314087 4.23 4.44 267.69 2008.13 1.33 133.52 19589 94
95 264305 1306144 3.96 4.20 252.55 1868.25 1.27 123.28 19135 95
96 266371 1200391 3.65 3.89 245.94 1798.68 1.34 122.51 19604 96
97 273248 1265445 3.76 4.11 248.60 1717.60 1.32 119.73 20877 97
98 275472 1259329 3.80 4.20 219.81 1546.92 1.28 118.30 23639 98
99 278146 1219342 3.66 4.15 216.98 1580.19 1.31 127.65 22830 99
100 279506 1227626 3.77 4.09 240.76 1771.33 1.32 130.25 21760 100
101 283991 1232874 3.85 4.14 259.45 1846.92 1.37 131.85 21879 101
102 286794 1241046 3.96 4.32 254.71 1821.18 1.40 135.39 21712 102
103 288703 1244172 3.76 4.09 283.17 1988.41 1.41 133.09 21321 103
104 289285 1237838 3.61 3.89 296.27 2074.01 1.43 135.31 21396 104
105 288869 1212801 3.58 3.86 311.35 2119.77 1.46 133.14 22000 105
106 286942 1234237 3.53 3.80 302.36 2081.89 1.48 133.91 22642 106
107 285833 1224699 3.52 3.83 305.90 2099.55 1.49 132.97 24272 107
108 284095 1237432 3.44 3.88 335.33 2233.67 1.46 131.21 24933 108
109 289229 1248847 3.47 4.10 327.90 2150.37 1.43 130.34 25219 109
110 289389 1256543 3.36 4.11 317.74 2146.66 1.37 123.46 25745 110
111 290793 1252434 3.37 3.98 344.22 2287.88 1.36 123.03 26433 111
112 291454 1265176 3.32 4.17 345.91 2236.06 1.34 125.33 27546 112
113 294733 1314670 3.02 3.68 320.70 2110.35 1.26 115.83 30774 113
114 293853 1299329 2.90 3.70 316.81 2086.51 1.22 110.99 32456 114
115 294056 1216744 2.85 3.62 330.64 2187.47 1.28 111.73 30124 115
116 293982 1225275 2.56 3.44 316.47 2159.21 1.29 110.04 30250 116
117 293075 1193478 2.52 3.50 334.39 2218.23 1.31 110.26 31288 117
118 292391 1207226 2.58 3.34 337.23 2274.11 1.39 113.67 31072 118
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Leningen `10jNL` `10JEUR` AEX EURO
1.634e+05 -5.116e-03 -4.556e+03 5.906e+03 1.440e+01 -6.306e+00
USD YEN GOLD t
1.454e+04 -1.653e+02 -8.418e-01 1.416e+03
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8014.074 -1439.997 4.143 1408.782 6912.047
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.634e+05 7.626e+03 21.422 < 2e-16 ***
Leningen -5.116e-03 6.574e-03 -0.778 0.438084
`10jNL` -4.556e+03 3.830e+03 -1.190 0.236842
`10JEUR` 5.906e+03 4.133e+03 1.429 0.155898
AEX 1.440e+01 2.525e+01 0.570 0.569800
EURO -6.306e+00 4.723e+00 -1.335 0.184584
USD 1.454e+04 5.423e+03 2.681 0.008488 **
YEN -1.653e+02 4.448e+01 -3.716 0.000323 ***
GOLD -8.418e-01 2.635e-01 -3.194 0.001838 **
t 1.416e+03 6.159e+01 22.984 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2579 on 108 degrees of freedom
Multiple R-squared: 0.9969, Adjusted R-squared: 0.9967
F-statistic: 3910 on 9 and 108 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.799132e-02 3.598263e-02 0.98200868
[2,] 3.621454e-03 7.242908e-03 0.99637855
[3,] 3.264300e-03 6.528599e-03 0.99673570
[4,] 8.754540e-04 1.750908e-03 0.99912455
[5,] 3.650340e-04 7.300681e-04 0.99963497
[6,] 1.413439e-03 2.826879e-03 0.99858656
[7,] 8.551736e-04 1.710347e-03 0.99914483
[8,] 3.212333e-04 6.424665e-04 0.99967877
[9,] 1.175519e-04 2.351038e-04 0.99988245
[10,] 6.429223e-05 1.285845e-04 0.99993571
[11,] 2.232480e-05 4.464959e-05 0.99997768
[12,] 9.061942e-06 1.812388e-05 0.99999094
[13,] 4.233759e-04 8.467518e-04 0.99957662
[14,] 3.063369e-04 6.126738e-04 0.99969366
[15,] 1.599764e-04 3.199527e-04 0.99984002
[16,] 2.213091e-04 4.426182e-04 0.99977869
[17,] 1.244831e-04 2.489661e-04 0.99987552
[18,] 7.516198e-05 1.503240e-04 0.99992484
[19,] 1.294403e-04 2.588807e-04 0.99987056
[20,] 1.090281e-04 2.180562e-04 0.99989097
[21,] 5.088037e-05 1.017607e-04 0.99994912
[22,] 3.780736e-05 7.561472e-05 0.99996219
[23,] 4.591414e-05 9.182828e-05 0.99995409
[24,] 2.494020e-04 4.988040e-04 0.99975060
[25,] 1.377847e-04 2.755693e-04 0.99986222
[26,] 6.797258e-05 1.359452e-04 0.99993203
[27,] 3.372004e-05 6.744007e-05 0.99996628
[28,] 1.687343e-05 3.374687e-05 0.99998313
[29,] 7.730935e-06 1.546187e-05 0.99999227
[30,] 6.192346e-06 1.238469e-05 0.99999381
[31,] 3.099860e-06 6.199720e-06 0.99999690
[32,] 1.475463e-06 2.950926e-06 0.99999852
[33,] 7.715012e-07 1.543002e-06 0.99999923
[34,] 5.606846e-07 1.121369e-06 0.99999944
[35,] 7.885293e-07 1.577059e-06 0.99999921
[36,] 6.150141e-07 1.230028e-06 0.99999938
[37,] 3.692364e-07 7.384728e-07 0.99999963
[38,] 1.681750e-07 3.363501e-07 0.99999983
[39,] 1.206273e-07 2.412546e-07 0.99999988
[40,] 1.309170e-07 2.618341e-07 0.99999987
[41,] 6.414146e-08 1.282829e-07 0.99999994
[42,] 5.950393e-07 1.190079e-06 0.99999940
[43,] 6.531505e-07 1.306301e-06 0.99999935
[44,] 4.699727e-07 9.399455e-07 0.99999953
[45,] 9.567829e-07 1.913566e-06 0.99999904
[46,] 1.324240e-06 2.648480e-06 0.99999868
[47,] 1.264369e-06 2.528737e-06 0.99999874
[48,] 7.624720e-07 1.524944e-06 0.99999924
[49,] 2.838654e-06 5.677307e-06 0.99999716
[50,] 2.592327e-06 5.184653e-06 0.99999741
[51,] 3.789515e-06 7.579030e-06 0.99999621
[52,] 2.388511e-06 4.777022e-06 0.99999761
[53,] 5.942444e-06 1.188489e-05 0.99999406
[54,] 1.289569e-05 2.579137e-05 0.99998710
[55,] 3.072844e-05 6.145688e-05 0.99996927
[56,] 5.107534e-05 1.021507e-04 0.99994892
[57,] 5.280704e-05 1.056141e-04 0.99994719
[58,] 1.241800e-04 2.483601e-04 0.99987582
[59,] 2.709564e-04 5.419128e-04 0.99972904
[60,] 1.083203e-03 2.166407e-03 0.99891680
[61,] 1.031525e-03 2.063050e-03 0.99896848
[62,] 6.814772e-04 1.362954e-03 0.99931852
[63,] 4.526129e-04 9.052257e-04 0.99954739
[64,] 2.684633e-04 5.369266e-04 0.99973154
[65,] 4.048184e-04 8.096367e-04 0.99959518
[66,] 8.993673e-04 1.798735e-03 0.99910063
[67,] 9.482136e-04 1.896427e-03 0.99905179
[68,] 5.885130e-04 1.177026e-03 0.99941149
[69,] 3.625461e-04 7.250921e-04 0.99963745
[70,] 2.491744e-04 4.983489e-04 0.99975083
[71,] 4.700206e-04 9.400412e-04 0.99952998
[72,] 3.049255e-04 6.098510e-04 0.99969507
[73,] 6.102495e-04 1.220499e-03 0.99938975
[74,] 1.250443e-03 2.500886e-03 0.99874956
[75,] 1.987138e-03 3.974277e-03 0.99801286
[76,] 1.030785e-02 2.061571e-02 0.98969215
[77,] 4.159892e-02 8.319784e-02 0.95840108
[78,] 3.768725e-02 7.537450e-02 0.96231275
[79,] 1.709016e-01 3.418032e-01 0.82909840
[80,] 1.525677e-01 3.051354e-01 0.84743229
[81,] 1.309529e-01 2.619058e-01 0.86904708
[82,] 3.770476e-01 7.540952e-01 0.62295240
[83,] 4.671353e-01 9.342707e-01 0.53286465
[84,] 4.740674e-01 9.481348e-01 0.52593259
[85,] 5.194590e-01 9.610821e-01 0.48054104
[86,] 5.444618e-01 9.110764e-01 0.45553819
[87,] 4.820873e-01 9.641746e-01 0.51791268
[88,] 9.051033e-01 1.897934e-01 0.09489669
[89,] 9.576711e-01 8.465779e-02 0.04232890
[90,] 9.490134e-01 1.019732e-01 0.05098660
[91,] 9.129849e-01 1.740302e-01 0.08701512
[92,] 8.677463e-01 2.645075e-01 0.13225375
[93,] 9.269192e-01 1.461616e-01 0.07308082
> postscript(file="/var/www/html/rcomp/tmp/1tva91292945013.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/2tva91292945013.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/3tva91292945013.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/4l5rc1292945013.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/5l5rc1292945013.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 6
1369.03134 -90.98628 917.66778 2154.20825 2229.05938 2264.75543
7 8 9 10 11 12
1752.48564 273.96928 -412.25901 228.52783 -822.45952 -1316.71139
13 14 15 16 17 18
1422.03190 600.75055 -903.98814 -1902.96982 -1157.92908 397.47042
19 20 21 22 23 24
-1340.79920 -1672.14393 -2311.87650 -1924.65601 -2708.54841 -4237.29887
25 26 27 28 29 30
-443.40725 217.74809 -1016.68831 70.98929 1520.66021 2223.64039
31 32 33 34 35 36
2493.04141 2178.15162 1074.59130 -320.91399 -1645.33519 -3110.83038
37 38 39 40 41 42
20.31671 -85.57683 -263.49352 -337.85571 1037.23197 2164.54676
43 44 45 46 47 48
1648.18411 1677.67292 1276.12588 284.96976 -1448.55715 -1453.16255
49 50 51 52 53 54
853.17926 -357.06644 -1142.10518 -1636.42718 -52.23364 2297.14418
55 56 57 58 59 60
2723.58699 2195.15997 2293.76211 833.80974 -411.39093 -1274.82299
61 62 63 64 65 66
1879.40346 1018.05035 708.21415 -202.81017 821.16547 845.40322
67 68 69 70 71 72
533.08269 -34.97147 -1414.31688 -2034.66843 -2303.88076 -4944.43627
73 74 75 76 77 78
-1458.78760 -2248.97431 -2355.58176 -2232.13489 1168.14001 3093.76531
79 80 81 82 83 84
1846.75755 -156.67379 -288.15846 984.80862 -576.11758 -2341.44179
85 86 87 88 89 90
-159.26125 -498.91932 -3027.10193 -2333.45569 144.73202 699.75021
91 92 93 94 95 96
2167.59097 1992.28210 -3244.51207 -5188.79258 -7448.03820 -8014.07382
97 98 99 100 101 102
-2664.53910 -228.26377 1161.60971 2250.63022 5261.38919 6042.94762
103 104 105 106 107 108
6789.77387 6912.04702 4778.00950 1939.10807 274.81823 -2349.46732
109 110 111 112 113 114
379.58131 -1095.82752 847.82364 65.24639 5589.60145 3653.96753
115 116 117 118
-12.03134 -2009.03553 -4297.28792 -5578.11547
> postscript(file="/var/www/html/rcomp/tmp/6l5rc1292945013.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 1369.03134 NA
1 -90.98628 1369.03134
2 917.66778 -90.98628
3 2154.20825 917.66778
4 2229.05938 2154.20825
5 2264.75543 2229.05938
6 1752.48564 2264.75543
7 273.96928 1752.48564
8 -412.25901 273.96928
9 228.52783 -412.25901
10 -822.45952 228.52783
11 -1316.71139 -822.45952
12 1422.03190 -1316.71139
13 600.75055 1422.03190
14 -903.98814 600.75055
15 -1902.96982 -903.98814
16 -1157.92908 -1902.96982
17 397.47042 -1157.92908
18 -1340.79920 397.47042
19 -1672.14393 -1340.79920
20 -2311.87650 -1672.14393
21 -1924.65601 -2311.87650
22 -2708.54841 -1924.65601
23 -4237.29887 -2708.54841
24 -443.40725 -4237.29887
25 217.74809 -443.40725
26 -1016.68831 217.74809
27 70.98929 -1016.68831
28 1520.66021 70.98929
29 2223.64039 1520.66021
30 2493.04141 2223.64039
31 2178.15162 2493.04141
32 1074.59130 2178.15162
33 -320.91399 1074.59130
34 -1645.33519 -320.91399
35 -3110.83038 -1645.33519
36 20.31671 -3110.83038
37 -85.57683 20.31671
38 -263.49352 -85.57683
39 -337.85571 -263.49352
40 1037.23197 -337.85571
41 2164.54676 1037.23197
42 1648.18411 2164.54676
43 1677.67292 1648.18411
44 1276.12588 1677.67292
45 284.96976 1276.12588
46 -1448.55715 284.96976
47 -1453.16255 -1448.55715
48 853.17926 -1453.16255
49 -357.06644 853.17926
50 -1142.10518 -357.06644
51 -1636.42718 -1142.10518
52 -52.23364 -1636.42718
53 2297.14418 -52.23364
54 2723.58699 2297.14418
55 2195.15997 2723.58699
56 2293.76211 2195.15997
57 833.80974 2293.76211
58 -411.39093 833.80974
59 -1274.82299 -411.39093
60 1879.40346 -1274.82299
61 1018.05035 1879.40346
62 708.21415 1018.05035
63 -202.81017 708.21415
64 821.16547 -202.81017
65 845.40322 821.16547
66 533.08269 845.40322
67 -34.97147 533.08269
68 -1414.31688 -34.97147
69 -2034.66843 -1414.31688
70 -2303.88076 -2034.66843
71 -4944.43627 -2303.88076
72 -1458.78760 -4944.43627
73 -2248.97431 -1458.78760
74 -2355.58176 -2248.97431
75 -2232.13489 -2355.58176
76 1168.14001 -2232.13489
77 3093.76531 1168.14001
78 1846.75755 3093.76531
79 -156.67379 1846.75755
80 -288.15846 -156.67379
81 984.80862 -288.15846
82 -576.11758 984.80862
83 -2341.44179 -576.11758
84 -159.26125 -2341.44179
85 -498.91932 -159.26125
86 -3027.10193 -498.91932
87 -2333.45569 -3027.10193
88 144.73202 -2333.45569
89 699.75021 144.73202
90 2167.59097 699.75021
91 1992.28210 2167.59097
92 -3244.51207 1992.28210
93 -5188.79258 -3244.51207
94 -7448.03820 -5188.79258
95 -8014.07382 -7448.03820
96 -2664.53910 -8014.07382
97 -228.26377 -2664.53910
98 1161.60971 -228.26377
99 2250.63022 1161.60971
100 5261.38919 2250.63022
101 6042.94762 5261.38919
102 6789.77387 6042.94762
103 6912.04702 6789.77387
104 4778.00950 6912.04702
105 1939.10807 4778.00950
106 274.81823 1939.10807
107 -2349.46732 274.81823
108 379.58131 -2349.46732
109 -1095.82752 379.58131
110 847.82364 -1095.82752
111 65.24639 847.82364
112 5589.60145 65.24639
113 3653.96753 5589.60145
114 -12.03134 3653.96753
115 -2009.03553 -12.03134
116 -4297.28792 -2009.03553
117 -5578.11547 -4297.28792
118 NA -5578.11547
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -90.98628 1369.03134
[2,] 917.66778 -90.98628
[3,] 2154.20825 917.66778
[4,] 2229.05938 2154.20825
[5,] 2264.75543 2229.05938
[6,] 1752.48564 2264.75543
[7,] 273.96928 1752.48564
[8,] -412.25901 273.96928
[9,] 228.52783 -412.25901
[10,] -822.45952 228.52783
[11,] -1316.71139 -822.45952
[12,] 1422.03190 -1316.71139
[13,] 600.75055 1422.03190
[14,] -903.98814 600.75055
[15,] -1902.96982 -903.98814
[16,] -1157.92908 -1902.96982
[17,] 397.47042 -1157.92908
[18,] -1340.79920 397.47042
[19,] -1672.14393 -1340.79920
[20,] -2311.87650 -1672.14393
[21,] -1924.65601 -2311.87650
[22,] -2708.54841 -1924.65601
[23,] -4237.29887 -2708.54841
[24,] -443.40725 -4237.29887
[25,] 217.74809 -443.40725
[26,] -1016.68831 217.74809
[27,] 70.98929 -1016.68831
[28,] 1520.66021 70.98929
[29,] 2223.64039 1520.66021
[30,] 2493.04141 2223.64039
[31,] 2178.15162 2493.04141
[32,] 1074.59130 2178.15162
[33,] -320.91399 1074.59130
[34,] -1645.33519 -320.91399
[35,] -3110.83038 -1645.33519
[36,] 20.31671 -3110.83038
[37,] -85.57683 20.31671
[38,] -263.49352 -85.57683
[39,] -337.85571 -263.49352
[40,] 1037.23197 -337.85571
[41,] 2164.54676 1037.23197
[42,] 1648.18411 2164.54676
[43,] 1677.67292 1648.18411
[44,] 1276.12588 1677.67292
[45,] 284.96976 1276.12588
[46,] -1448.55715 284.96976
[47,] -1453.16255 -1448.55715
[48,] 853.17926 -1453.16255
[49,] -357.06644 853.17926
[50,] -1142.10518 -357.06644
[51,] -1636.42718 -1142.10518
[52,] -52.23364 -1636.42718
[53,] 2297.14418 -52.23364
[54,] 2723.58699 2297.14418
[55,] 2195.15997 2723.58699
[56,] 2293.76211 2195.15997
[57,] 833.80974 2293.76211
[58,] -411.39093 833.80974
[59,] -1274.82299 -411.39093
[60,] 1879.40346 -1274.82299
[61,] 1018.05035 1879.40346
[62,] 708.21415 1018.05035
[63,] -202.81017 708.21415
[64,] 821.16547 -202.81017
[65,] 845.40322 821.16547
[66,] 533.08269 845.40322
[67,] -34.97147 533.08269
[68,] -1414.31688 -34.97147
[69,] -2034.66843 -1414.31688
[70,] -2303.88076 -2034.66843
[71,] -4944.43627 -2303.88076
[72,] -1458.78760 -4944.43627
[73,] -2248.97431 -1458.78760
[74,] -2355.58176 -2248.97431
[75,] -2232.13489 -2355.58176
[76,] 1168.14001 -2232.13489
[77,] 3093.76531 1168.14001
[78,] 1846.75755 3093.76531
[79,] -156.67379 1846.75755
[80,] -288.15846 -156.67379
[81,] 984.80862 -288.15846
[82,] -576.11758 984.80862
[83,] -2341.44179 -576.11758
[84,] -159.26125 -2341.44179
[85,] -498.91932 -159.26125
[86,] -3027.10193 -498.91932
[87,] -2333.45569 -3027.10193
[88,] 144.73202 -2333.45569
[89,] 699.75021 144.73202
[90,] 2167.59097 699.75021
[91,] 1992.28210 2167.59097
[92,] -3244.51207 1992.28210
[93,] -5188.79258 -3244.51207
[94,] -7448.03820 -5188.79258
[95,] -8014.07382 -7448.03820
[96,] -2664.53910 -8014.07382
[97,] -228.26377 -2664.53910
[98,] 1161.60971 -228.26377
[99,] 2250.63022 1161.60971
[100,] 5261.38919 2250.63022
[101,] 6042.94762 5261.38919
[102,] 6789.77387 6042.94762
[103,] 6912.04702 6789.77387
[104,] 4778.00950 6912.04702
[105,] 1939.10807 4778.00950
[106,] 274.81823 1939.10807
[107,] -2349.46732 274.81823
[108,] 379.58131 -2349.46732
[109,] -1095.82752 379.58131
[110,] 847.82364 -1095.82752
[111,] 65.24639 847.82364
[112,] 5589.60145 65.24639
[113,] 3653.96753 5589.60145
[114,] -12.03134 3653.96753
[115,] -2009.03553 -12.03134
[116,] -4297.28792 -2009.03553
[117,] -5578.11547 -4297.28792
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -90.98628 1369.03134
2 917.66778 -90.98628
3 2154.20825 917.66778
4 2229.05938 2154.20825
5 2264.75543 2229.05938
6 1752.48564 2264.75543
7 273.96928 1752.48564
8 -412.25901 273.96928
9 228.52783 -412.25901
10 -822.45952 228.52783
11 -1316.71139 -822.45952
12 1422.03190 -1316.71139
13 600.75055 1422.03190
14 -903.98814 600.75055
15 -1902.96982 -903.98814
16 -1157.92908 -1902.96982
17 397.47042 -1157.92908
18 -1340.79920 397.47042
19 -1672.14393 -1340.79920
20 -2311.87650 -1672.14393
21 -1924.65601 -2311.87650
22 -2708.54841 -1924.65601
23 -4237.29887 -2708.54841
24 -443.40725 -4237.29887
25 217.74809 -443.40725
26 -1016.68831 217.74809
27 70.98929 -1016.68831
28 1520.66021 70.98929
29 2223.64039 1520.66021
30 2493.04141 2223.64039
31 2178.15162 2493.04141
32 1074.59130 2178.15162
33 -320.91399 1074.59130
34 -1645.33519 -320.91399
35 -3110.83038 -1645.33519
36 20.31671 -3110.83038
37 -85.57683 20.31671
38 -263.49352 -85.57683
39 -337.85571 -263.49352
40 1037.23197 -337.85571
41 2164.54676 1037.23197
42 1648.18411 2164.54676
43 1677.67292 1648.18411
44 1276.12588 1677.67292
45 284.96976 1276.12588
46 -1448.55715 284.96976
47 -1453.16255 -1448.55715
48 853.17926 -1453.16255
49 -357.06644 853.17926
50 -1142.10518 -357.06644
51 -1636.42718 -1142.10518
52 -52.23364 -1636.42718
53 2297.14418 -52.23364
54 2723.58699 2297.14418
55 2195.15997 2723.58699
56 2293.76211 2195.15997
57 833.80974 2293.76211
58 -411.39093 833.80974
59 -1274.82299 -411.39093
60 1879.40346 -1274.82299
61 1018.05035 1879.40346
62 708.21415 1018.05035
63 -202.81017 708.21415
64 821.16547 -202.81017
65 845.40322 821.16547
66 533.08269 845.40322
67 -34.97147 533.08269
68 -1414.31688 -34.97147
69 -2034.66843 -1414.31688
70 -2303.88076 -2034.66843
71 -4944.43627 -2303.88076
72 -1458.78760 -4944.43627
73 -2248.97431 -1458.78760
74 -2355.58176 -2248.97431
75 -2232.13489 -2355.58176
76 1168.14001 -2232.13489
77 3093.76531 1168.14001
78 1846.75755 3093.76531
79 -156.67379 1846.75755
80 -288.15846 -156.67379
81 984.80862 -288.15846
82 -576.11758 984.80862
83 -2341.44179 -576.11758
84 -159.26125 -2341.44179
85 -498.91932 -159.26125
86 -3027.10193 -498.91932
87 -2333.45569 -3027.10193
88 144.73202 -2333.45569
89 699.75021 144.73202
90 2167.59097 699.75021
91 1992.28210 2167.59097
92 -3244.51207 1992.28210
93 -5188.79258 -3244.51207
94 -7448.03820 -5188.79258
95 -8014.07382 -7448.03820
96 -2664.53910 -8014.07382
97 -228.26377 -2664.53910
98 1161.60971 -228.26377
99 2250.63022 1161.60971
100 5261.38919 2250.63022
101 6042.94762 5261.38919
102 6789.77387 6042.94762
103 6912.04702 6789.77387
104 4778.00950 6912.04702
105 1939.10807 4778.00950
106 274.81823 1939.10807
107 -2349.46732 274.81823
108 379.58131 -2349.46732
109 -1095.82752 379.58131
110 847.82364 -1095.82752
111 65.24639 847.82364
112 5589.60145 65.24639
113 3653.96753 5589.60145
114 -12.03134 3653.96753
115 -2009.03553 -12.03134
116 -4297.28792 -2009.03553
117 -5578.11547 -4297.28792
> 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/7eeqf1292945013.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/8eeqf1292945013.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/97nqi1292945013.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/107nqi1292945013.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/11s6o61292945013.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/12d6nu1292945013.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/13syk21292945013.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/14vg1q1292945013.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/15hhie1292945013.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/16kzgk1292945013.tab")
+ }
>
> try(system("convert tmp/1tva91292945013.ps tmp/1tva91292945013.png",intern=TRUE))
character(0)
> try(system("convert tmp/2tva91292945013.ps tmp/2tva91292945013.png",intern=TRUE))
character(0)
> try(system("convert tmp/3tva91292945013.ps tmp/3tva91292945013.png",intern=TRUE))
character(0)
> try(system("convert tmp/4l5rc1292945013.ps tmp/4l5rc1292945013.png",intern=TRUE))
character(0)
> try(system("convert tmp/5l5rc1292945013.ps tmp/5l5rc1292945013.png",intern=TRUE))
character(0)
> try(system("convert tmp/6l5rc1292945013.ps tmp/6l5rc1292945013.png",intern=TRUE))
character(0)
> try(system("convert tmp/7eeqf1292945013.ps tmp/7eeqf1292945013.png",intern=TRUE))
character(0)
> try(system("convert tmp/8eeqf1292945013.ps tmp/8eeqf1292945013.png",intern=TRUE))
character(0)
> try(system("convert tmp/97nqi1292945013.ps tmp/97nqi1292945013.png",intern=TRUE))
character(0)
> try(system("convert tmp/107nqi1292945013.ps tmp/107nqi1292945013.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.569 1.708 8.455