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(3.32
+ ,523
+ ,-3
+ ,2065.81
+ ,10457
+ ,28.37
+ ,111.22
+ ,3.30
+ ,519
+ ,-3
+ ,1940.49
+ ,10368
+ ,27.34
+ ,111.09
+ ,3.30
+ ,509
+ ,-4
+ ,2042.00
+ ,10244
+ ,24.46
+ ,111
+ ,3.09
+ ,512
+ ,-8
+ ,1995.37
+ ,10511
+ ,27.46
+ ,111.06
+ ,2.79
+ ,519
+ ,-9
+ ,1946.81
+ ,10812
+ ,30.23
+ ,111.55
+ ,2.76
+ ,517
+ ,-13
+ ,1765.90
+ ,10738
+ ,32.33
+ ,112.32
+ ,2.75
+ ,510
+ ,-18
+ ,1635.25
+ ,10171
+ ,29.87
+ ,112.64
+ ,2.56
+ ,509
+ ,-11
+ ,1833.42
+ ,9721
+ ,24.87
+ ,112.36
+ ,2.56
+ ,501
+ ,-9
+ ,1910.43
+ ,9897
+ ,25.48
+ ,112.04
+ ,2.21
+ ,507
+ ,-10
+ ,1959.67
+ ,9828
+ ,27.28
+ ,112.37
+ ,2.08
+ ,569
+ ,-13
+ ,1969.60
+ ,9924
+ ,28.24
+ ,112.59
+ ,2.10
+ ,580
+ ,-11
+ ,2061.41
+ ,10371
+ ,29.58
+ ,112.89
+ ,2.02
+ ,578
+ ,-5
+ ,2093.48
+ ,10846
+ ,26.95
+ ,113.22
+ ,2.01
+ ,565
+ ,-15
+ ,2120.88
+ ,10413
+ ,29.08
+ ,112.85
+ ,1.97
+ ,547
+ ,-6
+ ,2174.56
+ ,10709
+ ,28.76
+ ,113.06
+ ,2.06
+ ,555
+ ,-6
+ ,2196.72
+ ,10662
+ ,29.59
+ ,112.99
+ ,2.02
+ ,562
+ ,-3
+ ,2350.44
+ ,10570
+ ,30.70
+ ,113.32
+ ,2.03
+ ,561
+ ,-1
+ ,2440.25
+ ,10297
+ ,30.52
+ ,113.74
+ ,2.01
+ ,555
+ ,-3
+ ,2408.64
+ ,10635
+ ,32.67
+ ,113.91
+ ,2.08
+ ,544
+ ,-4
+ ,2472.81
+ ,10872
+ ,33.19
+ ,114.52
+ ,2.02
+ ,537
+ ,-6
+ ,2407.60
+ ,10296
+ ,37.13
+ ,114.96
+ ,2.03
+ ,543
+ ,0
+ ,2454.62
+ ,10383
+ ,35.54
+ ,114.91
+ ,2.07
+ ,594
+ ,-4
+ ,2448.05
+ ,10431
+ ,37.75
+ ,115.3
+ ,2.04
+ ,611
+ ,-2
+ ,2497.84
+ ,10574
+ ,41.84
+ ,115.44
+ ,2.05
+ ,613
+ ,-2
+ ,2645.64
+ ,10653
+ ,42.94
+ ,115.52
+ ,2.11
+ ,611
+ ,-6
+ ,2756.76
+ ,10805
+ ,49.14
+ ,116.08
+ ,2.09
+ ,594
+ ,-7
+ ,2849.27
+ ,10872
+ ,44.61
+ ,115.94
+ ,2.05
+ ,595
+ ,-6
+ ,2921.44
+ ,10625
+ ,40.22
+ ,115.56
+ ,2.08
+ ,591
+ ,-6
+ ,2981.85
+ ,10407
+ ,44.23
+ ,115.88
+ ,2.06
+ ,589
+ ,-3
+ ,3080.58
+ ,10463
+ ,45.85
+ ,116.66
+ ,2.06
+ ,584
+ ,-2
+ ,3106.22
+ ,10556
+ ,53.38
+ ,117.41
+ ,2.08
+ ,573
+ ,-5
+ ,3119.31
+ ,10646
+ ,53.26
+ ,117.68
+ ,2.07
+ ,567
+ ,-11
+ ,3061.26
+ ,10702
+ ,51.80
+ ,117.85
+ ,2.06
+ ,569
+ ,-11
+ ,3097.31
+ ,11353
+ ,55.30
+ ,118.21
+ ,2.07
+ ,621
+ ,-11
+ ,3161.69
+ ,11346
+ ,57.81
+ ,118.92
+ ,2.06
+ ,629
+ ,-10
+ ,3257.16
+ ,11451
+ ,63.96
+ ,119.03
+ ,2.09
+ ,628
+ ,-14
+ ,3277.01
+ ,11964
+ ,63.77
+ ,119.17
+ ,2.07
+ ,612
+ ,-8
+ ,3295.32
+ ,12574
+ ,59.15
+ ,118.95
+ ,2.09
+ ,595
+ ,-9
+ ,3363.99
+ ,13031
+ ,56.12
+ ,118.92
+ ,2.28
+ ,597
+ ,-5
+ ,3494.17
+ ,13812
+ ,57.42
+ ,118.9
+ ,2.33
+ ,593
+ ,-1
+ ,3667.03
+ ,14544
+ ,63.52
+ ,118.92
+ ,2.35
+ ,590
+ ,-2
+ ,3813.06
+ ,14931
+ ,61.71
+ ,119.44
+ ,2.52
+ ,580
+ ,-5
+ ,3917.96
+ ,14886
+ ,63.01
+ ,119.40
+ ,2.63
+ ,574
+ ,-4
+ ,3895.51
+ ,16005
+ ,68.18
+ ,119.98
+ ,2.58
+ ,573
+ ,-6
+ ,3801.06
+ ,17064
+ ,72.03
+ ,120.43
+ ,2.70
+ ,573
+ ,-2
+ ,3570.12
+ ,15168
+ ,69.75
+ ,120.41
+ ,2.81
+ ,620
+ ,-2
+ ,3701.61
+ ,16050
+ ,74.41
+ ,120.82
+ ,2.97
+ ,626
+ ,-2
+ ,3862.27
+ ,15839
+ ,74.33
+ ,120.97
+ ,3.04
+ ,620
+ ,-2
+ ,3970.10
+ ,15137
+ ,64.24
+ ,120.63
+ ,3.28
+ ,588
+ ,2
+ ,4138.52
+ ,14954
+ ,60.03
+ ,120.38
+ ,3.33
+ ,566
+ ,1
+ ,4199.75
+ ,15648
+ ,59.44
+ ,120.68
+ ,3.50
+ ,557
+ ,-8
+ ,4290.89
+ ,15305
+ ,62.50
+ ,120.84
+ ,3.56
+ ,561
+ ,-1
+ ,4443.91
+ ,15579
+ ,55.04
+ ,120.90
+ ,3.57
+ ,549
+ ,1
+ ,4502.64
+ ,16348
+ ,58.34
+ ,121.56
+ ,3.69
+ ,532
+ ,-1
+ ,4356.98
+ ,15928
+ ,61.92
+ ,121.57
+ ,3.82
+ ,526
+ ,2
+ ,4591.27
+ ,16171
+ ,67.65
+ ,122.12
+ ,3.79
+ ,511
+ ,2
+ ,4696.96
+ ,15937
+ ,67.68
+ ,121.97
+ ,3.96
+ ,499
+ ,1
+ ,4621.40
+ ,15713
+ ,70.30
+ ,121.96
+ ,4.06
+ ,555
+ ,-1
+ ,4562.84
+ ,15594
+ ,75.26
+ ,122.48
+ ,4.05
+ ,565
+ ,-2
+ ,4202.52
+ ,15683
+ ,71.44
+ ,122.33
+ ,4.03
+ ,542
+ ,-2
+ ,4296.49
+ ,16438
+ ,76.36
+ ,122.44
+ ,3.94
+ ,527
+ ,-1
+ ,4435.23
+ ,17032
+ ,81.71
+ ,123.08
+ ,4.02
+ ,510
+ ,-8
+ ,4105.18
+ ,17696
+ ,92.60
+ ,124.23
+ ,3.88
+ ,514
+ ,-4
+ ,4116.68
+ ,17745
+ ,90.60
+ ,124.58
+ ,4.02
+ ,517
+ ,-6
+ ,3844.49
+ ,19394
+ ,92.23
+ ,125.08
+ ,4.03
+ ,508
+ ,-3
+ ,3720.98
+ ,20148
+ ,94.09
+ ,125.98
+ ,4.09
+ ,493
+ ,-3
+ ,3674.40
+ ,20108
+ ,102.79
+ ,126.90
+ ,3.99
+ ,490
+ ,-7
+ ,3857.62
+ ,18584
+ ,109.65
+ ,127.19
+ ,4.01
+ ,469
+ ,-9
+ ,3801.06
+ ,18441
+ ,124.05
+ ,128.33
+ ,4.01
+ ,478
+ ,-11
+ ,3504.37
+ ,18391
+ ,132.69
+ ,129.04
+ ,4.19
+ ,528
+ ,-13
+ ,3032.60
+ ,19178
+ ,135.81
+ ,129.72
+ ,4.30
+ ,534
+ ,-11
+ ,3047.03
+ ,18079
+ ,116.07
+ ,128.92
+ ,4.27
+ ,518
+ ,-9
+ ,2962.34
+ ,18483
+ ,101.42
+ ,129.13
+ ,3.82
+ ,506
+ ,-17
+ ,2197.82
+ ,19644
+ ,75.73
+ ,128.90
+ ,3.15
+ ,502
+ ,-22
+ ,2014.45
+ ,19195
+ ,55.48
+ ,128.13
+ ,2.49
+ ,516
+ ,-25
+ ,1862.83
+ ,19650
+ ,43.80
+ ,127.85
+ ,1.81
+ ,528
+ ,-20
+ ,1905.41
+ ,20830
+ ,45.29
+ ,127.98
+ ,1.26
+ ,533
+ ,-24
+ ,1810.99
+ ,23595
+ ,44.01
+ ,128.42
+ ,1.06
+ ,536
+ ,-24
+ ,1670.07
+ ,22937
+ ,47.48
+ ,127.68
+ ,0.84
+ ,537
+ ,-22
+ ,1864.44
+ ,21814
+ ,51.07
+ ,127.95
+ ,0.78
+ ,524
+ ,-19
+ ,2052.02
+ ,21928
+ ,57.84
+ ,127.85
+ ,0.70
+ ,536
+ ,-18
+ ,2029.60
+ ,21777
+ ,69.04
+ ,127.61
+ ,0.36
+ ,587
+ ,-17
+ ,2070.83
+ ,21383
+ ,65.61
+ ,127.53
+ ,0.35
+ ,597
+ ,-11
+ ,2293.41
+ ,21467
+ ,72.87
+ ,127.92
+ ,0.36
+ ,581
+ ,-11
+ ,2443.27
+ ,22052
+ ,68.41
+ ,127.59
+ ,0.36
+ ,564
+ ,-12
+ ,2513.17
+ ,22680
+ ,73.25
+ ,127.65
+ ,0.36
+ ,558
+ ,-10
+ ,2466.92
+ ,24320
+ ,77.43
+ ,127.98
+ ,0.35
+ ,575
+ ,-15
+ ,2502.66
+ ,24977
+ ,75.28
+ ,128.19
+ ,0.34
+ ,580
+ ,-15
+ ,2539.91
+ ,25204
+ ,77.33
+ ,128.77
+ ,0.34
+ ,575
+ ,-15
+ ,2482.60
+ ,25739
+ ,74.31
+ ,129.31
+ ,0.35
+ ,563
+ ,-13
+ ,2626.15
+ ,26434
+ ,79.70
+ ,129.80
+ ,0.35
+ ,552
+ ,-8
+ ,2656.32
+ ,27525
+ ,85.47
+ ,130.24
+ ,0.34
+ ,537
+ ,-13
+ ,2446.66
+ ,30695
+ ,77.98
+ ,130.76
+ ,0.35
+ ,545
+ ,-9
+ ,2467.38
+ ,32436
+ ,75.69
+ ,130.75
+ ,0.48
+ ,601
+ ,-7
+ ,2462.32
+ ,30160
+ ,75.20
+ ,130.81
+ ,0.43
+ ,604
+ ,-4
+ ,2504.58
+ ,30236
+ ,77.21
+ ,130.89
+ ,0.45
+ ,586
+ ,-4
+ ,2579.39
+ ,31293
+ ,77.85
+ ,131.30
+ ,0.70
+ ,564
+ ,-2
+ ,2649.24
+ ,31077
+ ,83.53
+ ,131.49
+ ,0.59
+ ,549
+ ,0
+ ,2636.87
+ ,32226
+ ,85.99
+ ,131.65)
+ ,dim=c(7
+ ,99)
+ ,dimnames=list(c('Eonia'
+ ,'Werkloosheid'
+ ,'Consumentenvertrouwen'
+ ,'BEL20'
+ ,'Goudprijs'
+ ,'Olieprijs'
+ ,'CPI')
+ ,1:99))
> y <- array(NA,dim=c(7,99),dimnames=list(c('Eonia','Werkloosheid','Consumentenvertrouwen','BEL20','Goudprijs','Olieprijs','CPI'),1:99))
> 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 = '4'
> #'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
BEL20 Eonia Werkloosheid Consumentenvertrouwen Goudprijs Olieprijs CPI
1 2065.81 3.32 523 -3 10457 28.37 111.22
2 1940.49 3.30 519 -3 10368 27.34 111.09
3 2042.00 3.30 509 -4 10244 24.46 111.00
4 1995.37 3.09 512 -8 10511 27.46 111.06
5 1946.81 2.79 519 -9 10812 30.23 111.55
6 1765.90 2.76 517 -13 10738 32.33 112.32
7 1635.25 2.75 510 -18 10171 29.87 112.64
8 1833.42 2.56 509 -11 9721 24.87 112.36
9 1910.43 2.56 501 -9 9897 25.48 112.04
10 1959.67 2.21 507 -10 9828 27.28 112.37
11 1969.60 2.08 569 -13 9924 28.24 112.59
12 2061.41 2.10 580 -11 10371 29.58 112.89
13 2093.48 2.02 578 -5 10846 26.95 113.22
14 2120.88 2.01 565 -15 10413 29.08 112.85
15 2174.56 1.97 547 -6 10709 28.76 113.06
16 2196.72 2.06 555 -6 10662 29.59 112.99
17 2350.44 2.02 562 -3 10570 30.70 113.32
18 2440.25 2.03 561 -1 10297 30.52 113.74
19 2408.64 2.01 555 -3 10635 32.67 113.91
20 2472.81 2.08 544 -4 10872 33.19 114.52
21 2407.60 2.02 537 -6 10296 37.13 114.96
22 2454.62 2.03 543 0 10383 35.54 114.91
23 2448.05 2.07 594 -4 10431 37.75 115.30
24 2497.84 2.04 611 -2 10574 41.84 115.44
25 2645.64 2.05 613 -2 10653 42.94 115.52
26 2756.76 2.11 611 -6 10805 49.14 116.08
27 2849.27 2.09 594 -7 10872 44.61 115.94
28 2921.44 2.05 595 -6 10625 40.22 115.56
29 2981.85 2.08 591 -6 10407 44.23 115.88
30 3080.58 2.06 589 -3 10463 45.85 116.66
31 3106.22 2.06 584 -2 10556 53.38 117.41
32 3119.31 2.08 573 -5 10646 53.26 117.68
33 3061.26 2.07 567 -11 10702 51.80 117.85
34 3097.31 2.06 569 -11 11353 55.30 118.21
35 3161.69 2.07 621 -11 11346 57.81 118.92
36 3257.16 2.06 629 -10 11451 63.96 119.03
37 3277.01 2.09 628 -14 11964 63.77 119.17
38 3295.32 2.07 612 -8 12574 59.15 118.95
39 3363.99 2.09 595 -9 13031 56.12 118.92
40 3494.17 2.28 597 -5 13812 57.42 118.90
41 3667.03 2.33 593 -1 14544 63.52 118.92
42 3813.06 2.35 590 -2 14931 61.71 119.44
43 3917.96 2.52 580 -5 14886 63.01 119.40
44 3895.51 2.63 574 -4 16005 68.18 119.98
45 3801.06 2.58 573 -6 17064 72.03 120.43
46 3570.12 2.70 573 -2 15168 69.75 120.41
47 3701.61 2.81 620 -2 16050 74.41 120.82
48 3862.27 2.97 626 -2 15839 74.33 120.97
49 3970.10 3.04 620 -2 15137 64.24 120.63
50 4138.52 3.28 588 2 14954 60.03 120.38
51 4199.75 3.33 566 1 15648 59.44 120.68
52 4290.89 3.50 557 -8 15305 62.50 120.84
53 4443.91 3.56 561 -1 15579 55.04 120.90
54 4502.64 3.57 549 1 16348 58.34 121.56
55 4356.98 3.69 532 -1 15928 61.92 121.57
56 4591.27 3.82 526 2 16171 67.65 122.12
57 4696.96 3.79 511 2 15937 67.68 121.97
58 4621.40 3.96 499 1 15713 70.30 121.96
59 4562.84 4.06 555 -1 15594 75.26 122.48
60 4202.52 4.05 565 -2 15683 71.44 122.33
61 4296.49 4.03 542 -2 16438 76.36 122.44
62 4435.23 3.94 527 -1 17032 81.71 123.08
63 4105.18 4.02 510 -8 17696 92.60 124.23
64 4116.68 3.88 514 -4 17745 90.60 124.58
65 3844.49 4.02 517 -6 19394 92.23 125.08
66 3720.98 4.03 508 -3 20148 94.09 125.98
67 3674.40 4.09 493 -3 20108 102.79 126.90
68 3857.62 3.99 490 -7 18584 109.65 127.19
69 3801.06 4.01 469 -9 18441 124.05 128.33
70 3504.37 4.01 478 -11 18391 132.69 129.04
71 3032.60 4.19 528 -13 19178 135.81 129.72
72 3047.03 4.30 534 -11 18079 116.07 128.92
73 2962.34 4.27 518 -9 18483 101.42 129.13
74 2197.82 3.82 506 -17 19644 75.73 128.90
75 2014.45 3.15 502 -22 19195 55.48 128.13
76 1862.83 2.49 516 -25 19650 43.80 127.85
77 1905.41 1.81 528 -20 20830 45.29 127.98
78 1810.99 1.26 533 -24 23595 44.01 128.42
79 1670.07 1.06 536 -24 22937 47.48 127.68
80 1864.44 0.84 537 -22 21814 51.07 127.95
81 2052.02 0.78 524 -19 21928 57.84 127.85
82 2029.60 0.70 536 -18 21777 69.04 127.61
83 2070.83 0.36 587 -17 21383 65.61 127.53
84 2293.41 0.35 597 -11 21467 72.87 127.92
85 2443.27 0.36 581 -11 22052 68.41 127.59
86 2513.17 0.36 564 -12 22680 73.25 127.65
87 2466.92 0.36 558 -10 24320 77.43 127.98
88 2502.66 0.35 575 -15 24977 75.28 128.19
89 2539.91 0.34 580 -15 25204 77.33 128.77
90 2482.60 0.34 575 -15 25739 74.31 129.31
91 2626.15 0.35 563 -13 26434 79.70 129.80
92 2656.32 0.35 552 -8 27525 85.47 130.24
93 2446.66 0.34 537 -13 30695 77.98 130.76
94 2467.38 0.35 545 -9 32436 75.69 130.75
95 2462.32 0.48 601 -7 30160 75.20 130.81
96 2504.58 0.43 604 -4 30236 77.21 130.89
97 2579.39 0.45 586 -4 31293 77.85 131.30
98 2649.24 0.70 564 -2 31077 83.53 131.49
99 2636.87 0.59 549 0 32226 85.99 131.65
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Eonia Werkloosheid
-1.176e+04 3.675e+02 6.359e+00
Consumentenvertrouwen Goudprijs Olieprijs
6.839e+01 -4.552e-02 2.570e+00
CPI
9.423e+01
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1115.29 -224.39 18.52 284.53 916.43
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.176e+04 2.992e+03 -3.930 0.000164 ***
Eonia 3.675e+02 7.372e+01 4.985 2.90e-06 ***
Werkloosheid 6.359e+00 1.607e+00 3.956 0.000150 ***
Consumentenvertrouwen 6.839e+01 1.003e+01 6.821 9.35e-10 ***
Goudprijs -4.552e-02 2.644e-02 -1.721 0.088541 .
Olieprijs 2.570e+00 4.087e+00 0.629 0.530922
CPI 9.423e+01 3.018e+01 3.122 0.002399 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 421.3 on 92 degrees of freedom
Multiple R-squared: 0.7769, Adjusted R-squared: 0.7623
F-statistic: 53.38 on 6 and 92 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,] 5.217613e-03 1.043523e-02 9.947824e-01
[2,] 6.669858e-04 1.333972e-03 9.993330e-01
[3,] 1.090190e-04 2.180379e-04 9.998910e-01
[4,] 1.924617e-05 3.849233e-05 9.999808e-01
[5,] 3.005153e-05 6.010306e-05 9.999699e-01
[6,] 1.159920e-05 2.319840e-05 9.999884e-01
[7,] 4.053132e-06 8.106264e-06 9.999959e-01
[8,] 3.682114e-06 7.364228e-06 9.999963e-01
[9,] 2.127175e-06 4.254350e-06 9.999979e-01
[10,] 8.588287e-07 1.717657e-06 9.999991e-01
[11,] 1.066965e-06 2.133929e-06 9.999989e-01
[12,] 3.182204e-07 6.364408e-07 9.999997e-01
[13,] 2.561231e-07 5.122462e-07 9.999997e-01
[14,] 1.382780e-07 2.765560e-07 9.999999e-01
[15,] 1.591563e-07 3.183125e-07 9.999998e-01
[16,] 1.539222e-07 3.078444e-07 9.999998e-01
[17,] 2.950756e-07 5.901512e-07 9.999997e-01
[18,] 6.336151e-06 1.267230e-05 9.999937e-01
[19,] 1.779439e-04 3.558878e-04 9.998221e-01
[20,] 9.125811e-04 1.825162e-03 9.990874e-01
[21,] 1.641610e-03 3.283219e-03 9.983584e-01
[22,] 2.228499e-03 4.456998e-03 9.977715e-01
[23,] 2.964408e-03 5.928816e-03 9.970356e-01
[24,] 2.990766e-03 5.981531e-03 9.970092e-01
[25,] 2.718897e-03 5.437794e-03 9.972811e-01
[26,] 1.708614e-03 3.417228e-03 9.982914e-01
[27,] 1.062650e-03 2.125301e-03 9.989373e-01
[28,] 6.643592e-04 1.328718e-03 9.993356e-01
[29,] 4.083448e-04 8.166895e-04 9.995917e-01
[30,] 2.909493e-04 5.818986e-04 9.997091e-01
[31,] 2.517361e-04 5.034722e-04 9.997483e-01
[32,] 4.152122e-04 8.304244e-04 9.995848e-01
[33,] 3.974673e-04 7.949346e-04 9.996025e-01
[34,] 5.090088e-04 1.018018e-03 9.994910e-01
[35,] 4.308663e-04 8.617325e-04 9.995691e-01
[36,] 8.451661e-04 1.690332e-03 9.991548e-01
[37,] 2.870777e-02 5.741555e-02 9.712922e-01
[38,] 1.204016e-01 2.408032e-01 8.795984e-01
[39,] 1.613815e-01 3.227631e-01 8.386185e-01
[40,] 1.702722e-01 3.405444e-01 8.297278e-01
[41,] 2.773809e-01 5.547618e-01 7.226191e-01
[42,] 3.734121e-01 7.468242e-01 6.265879e-01
[43,] 4.127544e-01 8.255088e-01 5.872456e-01
[44,] 3.735021e-01 7.470041e-01 6.264979e-01
[45,] 3.266277e-01 6.532553e-01 6.733723e-01
[46,] 2.814864e-01 5.629729e-01 7.185136e-01
[47,] 2.415259e-01 4.830518e-01 7.584741e-01
[48,] 2.515176e-01 5.030352e-01 7.484824e-01
[49,] 2.257925e-01 4.515850e-01 7.742075e-01
[50,] 2.923608e-01 5.847216e-01 7.076392e-01
[51,] 3.628167e-01 7.256334e-01 6.371833e-01
[52,] 3.528264e-01 7.056528e-01 6.471736e-01
[53,] 3.862213e-01 7.724427e-01 6.137787e-01
[54,] 5.530476e-01 8.939048e-01 4.469524e-01
[55,] 7.708943e-01 4.582114e-01 2.291057e-01
[56,] 9.376938e-01 1.246123e-01 6.230617e-02
[57,] 9.909007e-01 1.819852e-02 9.099261e-03
[58,] 9.968785e-01 6.242979e-03 3.121489e-03
[59,] 9.987338e-01 2.532487e-03 1.266244e-03
[60,] 9.998929e-01 2.141134e-04 1.070567e-04
[61,] 9.999466e-01 1.067528e-04 5.337642e-05
[62,] 9.999946e-01 1.087958e-05 5.439791e-06
[63,] 9.999986e-01 2.714401e-06 1.357201e-06
[64,] 9.999998e-01 3.002330e-07 1.501165e-07
[65,] 1.000000e+00 3.796216e-08 1.898108e-08
[66,] 9.999999e-01 1.052722e-07 5.263610e-08
[67,] 9.999998e-01 4.014299e-07 2.007150e-07
[68,] 9.999998e-01 4.921823e-07 2.460912e-07
[69,] 9.999997e-01 5.062712e-07 2.531356e-07
[70,] 9.999989e-01 2.225082e-06 1.112541e-06
[71,] 9.999958e-01 8.431985e-06 4.215992e-06
[72,] 9.999966e-01 6.766675e-06 3.383338e-06
[73,] 9.999897e-01 2.054060e-05 1.027030e-05
[74,] 9.999965e-01 7.013209e-06 3.506605e-06
[75,] 9.999999e-01 2.987367e-07 1.493683e-07
[76,] 9.999985e-01 2.955423e-06 1.477712e-06
[77,] 9.999911e-01 1.778835e-05 8.894173e-06
[78,] 9.999643e-01 7.142286e-05 3.571143e-05
[79,] 9.996440e-01 7.120410e-04 3.560205e-04
[80,] 9.971213e-01 5.757322e-03 2.878661e-03
> postscript(file="/var/www/html/rcomp/tmp/1amm41292426076.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/23dlp1292426076.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/33dlp1292426076.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/43dlp1292426076.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/53dlp1292426076.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 = 99
Frequency = 1
1 2 3 4 5 6
-594.661466 -676.348008 -432.615669 -148.787926 -102.808279 -67.733767
7 8 9 10 11 12
142.122776 -43.510691 -15.812749 153.430010 3.218080 -130.423552
13 14 15 16 17 18
-469.301124 338.044024 -100.131550 -159.597365 -279.004967 -374.838044
19 20 21 22 23 24
-230.319238 -101.564506 -41.236037 -433.638885 -545.904015 -747.173662
25 26 27 28 29 30
-622.537096 -308.970382 -4.726647 43.242318 67.677676 -93.817656
31 32 33 34 35 36
-190.571329 69.256483 453.670082 467.390166 123.743627 82.230135
37 38 39 40 41 42
381.629171 159.057799 428.292586 236.453280 158.563467 357.979089
43 44 45 46 47 48
667.548072 557.426772 620.400428 -6.771274 -225.051744 -184.883473
49 50 51 52 53 54
-38.605804 -2.415980 253.568208 916.433986 569.215952 528.124542
55 56 57 58 59 60
553.988920 517.985024 733.493673 724.168911 342.362406 18.523508
61 62 63 64 65 66
277.459844 429.248790 550.511044 288.847855 106.668508 -223.730152
67 68 69 70 71 72
-307.853022 90.429911 145.895192 -162.633422 -918.003012 -1042.839346
73 74 75 76 77 78
-1115.285548 -950.423078 -415.989836 -131.782139 -219.926726 217.250260
79 80 81 82 83 84
161.618326 207.908281 292.243660 141.478582 -86.623384 -385.899723
85 86 87 88 89 90
-68.778200 188.111303 76.044340 364.958108 324.495404 280.210066
91 92 93 94 95 96
331.218082 82.747394 428.659013 207.342684 -446.388667 -619.251732
97 98 99
-429.493910 -490.742620 -473.180418
> postscript(file="/var/www/html/rcomp/tmp/6w4291292426076.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 = 99
Frequency = 1
lag(myerror, k = 1) myerror
0 -594.661466 NA
1 -676.348008 -594.661466
2 -432.615669 -676.348008
3 -148.787926 -432.615669
4 -102.808279 -148.787926
5 -67.733767 -102.808279
6 142.122776 -67.733767
7 -43.510691 142.122776
8 -15.812749 -43.510691
9 153.430010 -15.812749
10 3.218080 153.430010
11 -130.423552 3.218080
12 -469.301124 -130.423552
13 338.044024 -469.301124
14 -100.131550 338.044024
15 -159.597365 -100.131550
16 -279.004967 -159.597365
17 -374.838044 -279.004967
18 -230.319238 -374.838044
19 -101.564506 -230.319238
20 -41.236037 -101.564506
21 -433.638885 -41.236037
22 -545.904015 -433.638885
23 -747.173662 -545.904015
24 -622.537096 -747.173662
25 -308.970382 -622.537096
26 -4.726647 -308.970382
27 43.242318 -4.726647
28 67.677676 43.242318
29 -93.817656 67.677676
30 -190.571329 -93.817656
31 69.256483 -190.571329
32 453.670082 69.256483
33 467.390166 453.670082
34 123.743627 467.390166
35 82.230135 123.743627
36 381.629171 82.230135
37 159.057799 381.629171
38 428.292586 159.057799
39 236.453280 428.292586
40 158.563467 236.453280
41 357.979089 158.563467
42 667.548072 357.979089
43 557.426772 667.548072
44 620.400428 557.426772
45 -6.771274 620.400428
46 -225.051744 -6.771274
47 -184.883473 -225.051744
48 -38.605804 -184.883473
49 -2.415980 -38.605804
50 253.568208 -2.415980
51 916.433986 253.568208
52 569.215952 916.433986
53 528.124542 569.215952
54 553.988920 528.124542
55 517.985024 553.988920
56 733.493673 517.985024
57 724.168911 733.493673
58 342.362406 724.168911
59 18.523508 342.362406
60 277.459844 18.523508
61 429.248790 277.459844
62 550.511044 429.248790
63 288.847855 550.511044
64 106.668508 288.847855
65 -223.730152 106.668508
66 -307.853022 -223.730152
67 90.429911 -307.853022
68 145.895192 90.429911
69 -162.633422 145.895192
70 -918.003012 -162.633422
71 -1042.839346 -918.003012
72 -1115.285548 -1042.839346
73 -950.423078 -1115.285548
74 -415.989836 -950.423078
75 -131.782139 -415.989836
76 -219.926726 -131.782139
77 217.250260 -219.926726
78 161.618326 217.250260
79 207.908281 161.618326
80 292.243660 207.908281
81 141.478582 292.243660
82 -86.623384 141.478582
83 -385.899723 -86.623384
84 -68.778200 -385.899723
85 188.111303 -68.778200
86 76.044340 188.111303
87 364.958108 76.044340
88 324.495404 364.958108
89 280.210066 324.495404
90 331.218082 280.210066
91 82.747394 331.218082
92 428.659013 82.747394
93 207.342684 428.659013
94 -446.388667 207.342684
95 -619.251732 -446.388667
96 -429.493910 -619.251732
97 -490.742620 -429.493910
98 -473.180418 -490.742620
99 NA -473.180418
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -676.348008 -594.661466
[2,] -432.615669 -676.348008
[3,] -148.787926 -432.615669
[4,] -102.808279 -148.787926
[5,] -67.733767 -102.808279
[6,] 142.122776 -67.733767
[7,] -43.510691 142.122776
[8,] -15.812749 -43.510691
[9,] 153.430010 -15.812749
[10,] 3.218080 153.430010
[11,] -130.423552 3.218080
[12,] -469.301124 -130.423552
[13,] 338.044024 -469.301124
[14,] -100.131550 338.044024
[15,] -159.597365 -100.131550
[16,] -279.004967 -159.597365
[17,] -374.838044 -279.004967
[18,] -230.319238 -374.838044
[19,] -101.564506 -230.319238
[20,] -41.236037 -101.564506
[21,] -433.638885 -41.236037
[22,] -545.904015 -433.638885
[23,] -747.173662 -545.904015
[24,] -622.537096 -747.173662
[25,] -308.970382 -622.537096
[26,] -4.726647 -308.970382
[27,] 43.242318 -4.726647
[28,] 67.677676 43.242318
[29,] -93.817656 67.677676
[30,] -190.571329 -93.817656
[31,] 69.256483 -190.571329
[32,] 453.670082 69.256483
[33,] 467.390166 453.670082
[34,] 123.743627 467.390166
[35,] 82.230135 123.743627
[36,] 381.629171 82.230135
[37,] 159.057799 381.629171
[38,] 428.292586 159.057799
[39,] 236.453280 428.292586
[40,] 158.563467 236.453280
[41,] 357.979089 158.563467
[42,] 667.548072 357.979089
[43,] 557.426772 667.548072
[44,] 620.400428 557.426772
[45,] -6.771274 620.400428
[46,] -225.051744 -6.771274
[47,] -184.883473 -225.051744
[48,] -38.605804 -184.883473
[49,] -2.415980 -38.605804
[50,] 253.568208 -2.415980
[51,] 916.433986 253.568208
[52,] 569.215952 916.433986
[53,] 528.124542 569.215952
[54,] 553.988920 528.124542
[55,] 517.985024 553.988920
[56,] 733.493673 517.985024
[57,] 724.168911 733.493673
[58,] 342.362406 724.168911
[59,] 18.523508 342.362406
[60,] 277.459844 18.523508
[61,] 429.248790 277.459844
[62,] 550.511044 429.248790
[63,] 288.847855 550.511044
[64,] 106.668508 288.847855
[65,] -223.730152 106.668508
[66,] -307.853022 -223.730152
[67,] 90.429911 -307.853022
[68,] 145.895192 90.429911
[69,] -162.633422 145.895192
[70,] -918.003012 -162.633422
[71,] -1042.839346 -918.003012
[72,] -1115.285548 -1042.839346
[73,] -950.423078 -1115.285548
[74,] -415.989836 -950.423078
[75,] -131.782139 -415.989836
[76,] -219.926726 -131.782139
[77,] 217.250260 -219.926726
[78,] 161.618326 217.250260
[79,] 207.908281 161.618326
[80,] 292.243660 207.908281
[81,] 141.478582 292.243660
[82,] -86.623384 141.478582
[83,] -385.899723 -86.623384
[84,] -68.778200 -385.899723
[85,] 188.111303 -68.778200
[86,] 76.044340 188.111303
[87,] 364.958108 76.044340
[88,] 324.495404 364.958108
[89,] 280.210066 324.495404
[90,] 331.218082 280.210066
[91,] 82.747394 331.218082
[92,] 428.659013 82.747394
[93,] 207.342684 428.659013
[94,] -446.388667 207.342684
[95,] -619.251732 -446.388667
[96,] -429.493910 -619.251732
[97,] -490.742620 -429.493910
[98,] -473.180418 -490.742620
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -676.348008 -594.661466
2 -432.615669 -676.348008
3 -148.787926 -432.615669
4 -102.808279 -148.787926
5 -67.733767 -102.808279
6 142.122776 -67.733767
7 -43.510691 142.122776
8 -15.812749 -43.510691
9 153.430010 -15.812749
10 3.218080 153.430010
11 -130.423552 3.218080
12 -469.301124 -130.423552
13 338.044024 -469.301124
14 -100.131550 338.044024
15 -159.597365 -100.131550
16 -279.004967 -159.597365
17 -374.838044 -279.004967
18 -230.319238 -374.838044
19 -101.564506 -230.319238
20 -41.236037 -101.564506
21 -433.638885 -41.236037
22 -545.904015 -433.638885
23 -747.173662 -545.904015
24 -622.537096 -747.173662
25 -308.970382 -622.537096
26 -4.726647 -308.970382
27 43.242318 -4.726647
28 67.677676 43.242318
29 -93.817656 67.677676
30 -190.571329 -93.817656
31 69.256483 -190.571329
32 453.670082 69.256483
33 467.390166 453.670082
34 123.743627 467.390166
35 82.230135 123.743627
36 381.629171 82.230135
37 159.057799 381.629171
38 428.292586 159.057799
39 236.453280 428.292586
40 158.563467 236.453280
41 357.979089 158.563467
42 667.548072 357.979089
43 557.426772 667.548072
44 620.400428 557.426772
45 -6.771274 620.400428
46 -225.051744 -6.771274
47 -184.883473 -225.051744
48 -38.605804 -184.883473
49 -2.415980 -38.605804
50 253.568208 -2.415980
51 916.433986 253.568208
52 569.215952 916.433986
53 528.124542 569.215952
54 553.988920 528.124542
55 517.985024 553.988920
56 733.493673 517.985024
57 724.168911 733.493673
58 342.362406 724.168911
59 18.523508 342.362406
60 277.459844 18.523508
61 429.248790 277.459844
62 550.511044 429.248790
63 288.847855 550.511044
64 106.668508 288.847855
65 -223.730152 106.668508
66 -307.853022 -223.730152
67 90.429911 -307.853022
68 145.895192 90.429911
69 -162.633422 145.895192
70 -918.003012 -162.633422
71 -1042.839346 -918.003012
72 -1115.285548 -1042.839346
73 -950.423078 -1115.285548
74 -415.989836 -950.423078
75 -131.782139 -415.989836
76 -219.926726 -131.782139
77 217.250260 -219.926726
78 161.618326 217.250260
79 207.908281 161.618326
80 292.243660 207.908281
81 141.478582 292.243660
82 -86.623384 141.478582
83 -385.899723 -86.623384
84 -68.778200 -385.899723
85 188.111303 -68.778200
86 76.044340 188.111303
87 364.958108 76.044340
88 324.495404 364.958108
89 280.210066 324.495404
90 331.218082 280.210066
91 82.747394 331.218082
92 428.659013 82.747394
93 207.342684 428.659013
94 -446.388667 207.342684
95 -619.251732 -446.388667
96 -429.493910 -619.251732
97 -490.742620 -429.493910
98 -473.180418 -490.742620
> 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/7ow2d1292426076.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/8ow2d1292426076.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/9ow2d1292426076.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/10z5jg1292426076.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/1135h31292426076.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/1266y91292426076.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/13v7dl1292426076.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/145guo1292426076.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/159hbb1292426076.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/16ch9h1292426076.tab")
+ }
>
> try(system("convert tmp/1amm41292426076.ps tmp/1amm41292426076.png",intern=TRUE))
character(0)
> try(system("convert tmp/23dlp1292426076.ps tmp/23dlp1292426076.png",intern=TRUE))
character(0)
> try(system("convert tmp/33dlp1292426076.ps tmp/33dlp1292426076.png",intern=TRUE))
character(0)
> try(system("convert tmp/43dlp1292426076.ps tmp/43dlp1292426076.png",intern=TRUE))
character(0)
> try(system("convert tmp/53dlp1292426076.ps tmp/53dlp1292426076.png",intern=TRUE))
character(0)
> try(system("convert tmp/6w4291292426076.ps tmp/6w4291292426076.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ow2d1292426076.ps tmp/7ow2d1292426076.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ow2d1292426076.ps tmp/8ow2d1292426076.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ow2d1292426076.ps tmp/9ow2d1292426076.png",intern=TRUE))
character(0)
> try(system("convert tmp/10z5jg1292426076.ps tmp/10z5jg1292426076.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.082 1.701 7.791