R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(617,614,647,580,614,636,388,356,639,753,611,639,630,586,695,552,619,681,421,307,754,690,644,643,608,651,691,627,634,731,475,337,803,722,590,724,627,696,825,677,656,785,412,352,839,729,696,641,695,638,762,635,721,854,418,367,824,687,601,676,740,691,683,594,729,731,386,331,706,715,657,653,642,643,718,654,632,731,392,344,792,852,649,629,685,617,715,715,629,916,531,357,917,828,708,858,775,785,1006,789,734,906,532,387,991,841,892,782,811,792,978,773,796,946,594,438,1023,868,791,760,779,852,1001,734,996,869,599,426,1138,1091,830,909),dim=c(1,132),dimnames=list(c('Aantal_Faillissementen'),1:132))
> y <- array(NA,dim=c(1,132),dimnames=list(c('Aantal_Faillissementen'),1:132))
> 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 = 'Include Monthly Dummies'
> par1 = '1'
> par3 <- 'Linear Trend'
> par2 <- 'Include Monthly 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, 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
Aantal_Faillissementen M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 617 1 0 0 0 0 0 0 0 0 0 0 1
2 614 0 1 0 0 0 0 0 0 0 0 0 2
3 647 0 0 1 0 0 0 0 0 0 0 0 3
4 580 0 0 0 1 0 0 0 0 0 0 0 4
5 614 0 0 0 0 1 0 0 0 0 0 0 5
6 636 0 0 0 0 0 1 0 0 0 0 0 6
7 388 0 0 0 0 0 0 1 0 0 0 0 7
8 356 0 0 0 0 0 0 0 1 0 0 0 8
9 639 0 0 0 0 0 0 0 0 1 0 0 9
10 753 0 0 0 0 0 0 0 0 0 1 0 10
11 611 0 0 0 0 0 0 0 0 0 0 1 11
12 639 0 0 0 0 0 0 0 0 0 0 0 12
13 630 1 0 0 0 0 0 0 0 0 0 0 13
14 586 0 1 0 0 0 0 0 0 0 0 0 14
15 695 0 0 1 0 0 0 0 0 0 0 0 15
16 552 0 0 0 1 0 0 0 0 0 0 0 16
17 619 0 0 0 0 1 0 0 0 0 0 0 17
18 681 0 0 0 0 0 1 0 0 0 0 0 18
19 421 0 0 0 0 0 0 1 0 0 0 0 19
20 307 0 0 0 0 0 0 0 1 0 0 0 20
21 754 0 0 0 0 0 0 0 0 1 0 0 21
22 690 0 0 0 0 0 0 0 0 0 1 0 22
23 644 0 0 0 0 0 0 0 0 0 0 1 23
24 643 0 0 0 0 0 0 0 0 0 0 0 24
25 608 1 0 0 0 0 0 0 0 0 0 0 25
26 651 0 1 0 0 0 0 0 0 0 0 0 26
27 691 0 0 1 0 0 0 0 0 0 0 0 27
28 627 0 0 0 1 0 0 0 0 0 0 0 28
29 634 0 0 0 0 1 0 0 0 0 0 0 29
30 731 0 0 0 0 0 1 0 0 0 0 0 30
31 475 0 0 0 0 0 0 1 0 0 0 0 31
32 337 0 0 0 0 0 0 0 1 0 0 0 32
33 803 0 0 0 0 0 0 0 0 1 0 0 33
34 722 0 0 0 0 0 0 0 0 0 1 0 34
35 590 0 0 0 0 0 0 0 0 0 0 1 35
36 724 0 0 0 0 0 0 0 0 0 0 0 36
37 627 1 0 0 0 0 0 0 0 0 0 0 37
38 696 0 1 0 0 0 0 0 0 0 0 0 38
39 825 0 0 1 0 0 0 0 0 0 0 0 39
40 677 0 0 0 1 0 0 0 0 0 0 0 40
41 656 0 0 0 0 1 0 0 0 0 0 0 41
42 785 0 0 0 0 0 1 0 0 0 0 0 42
43 412 0 0 0 0 0 0 1 0 0 0 0 43
44 352 0 0 0 0 0 0 0 1 0 0 0 44
45 839 0 0 0 0 0 0 0 0 1 0 0 45
46 729 0 0 0 0 0 0 0 0 0 1 0 46
47 696 0 0 0 0 0 0 0 0 0 0 1 47
48 641 0 0 0 0 0 0 0 0 0 0 0 48
49 695 1 0 0 0 0 0 0 0 0 0 0 49
50 638 0 1 0 0 0 0 0 0 0 0 0 50
51 762 0 0 1 0 0 0 0 0 0 0 0 51
52 635 0 0 0 1 0 0 0 0 0 0 0 52
53 721 0 0 0 0 1 0 0 0 0 0 0 53
54 854 0 0 0 0 0 1 0 0 0 0 0 54
55 418 0 0 0 0 0 0 1 0 0 0 0 55
56 367 0 0 0 0 0 0 0 1 0 0 0 56
57 824 0 0 0 0 0 0 0 0 1 0 0 57
58 687 0 0 0 0 0 0 0 0 0 1 0 58
59 601 0 0 0 0 0 0 0 0 0 0 1 59
60 676 0 0 0 0 0 0 0 0 0 0 0 60
61 740 1 0 0 0 0 0 0 0 0 0 0 61
62 691 0 1 0 0 0 0 0 0 0 0 0 62
63 683 0 0 1 0 0 0 0 0 0 0 0 63
64 594 0 0 0 1 0 0 0 0 0 0 0 64
65 729 0 0 0 0 1 0 0 0 0 0 0 65
66 731 0 0 0 0 0 1 0 0 0 0 0 66
67 386 0 0 0 0 0 0 1 0 0 0 0 67
68 331 0 0 0 0 0 0 0 1 0 0 0 68
69 706 0 0 0 0 0 0 0 0 1 0 0 69
70 715 0 0 0 0 0 0 0 0 0 1 0 70
71 657 0 0 0 0 0 0 0 0 0 0 1 71
72 653 0 0 0 0 0 0 0 0 0 0 0 72
73 642 1 0 0 0 0 0 0 0 0 0 0 73
74 643 0 1 0 0 0 0 0 0 0 0 0 74
75 718 0 0 1 0 0 0 0 0 0 0 0 75
76 654 0 0 0 1 0 0 0 0 0 0 0 76
77 632 0 0 0 0 1 0 0 0 0 0 0 77
78 731 0 0 0 0 0 1 0 0 0 0 0 78
79 392 0 0 0 0 0 0 1 0 0 0 0 79
80 344 0 0 0 0 0 0 0 1 0 0 0 80
81 792 0 0 0 0 0 0 0 0 1 0 0 81
82 852 0 0 0 0 0 0 0 0 0 1 0 82
83 649 0 0 0 0 0 0 0 0 0 0 1 83
84 629 0 0 0 0 0 0 0 0 0 0 0 84
85 685 1 0 0 0 0 0 0 0 0 0 0 85
86 617 0 1 0 0 0 0 0 0 0 0 0 86
87 715 0 0 1 0 0 0 0 0 0 0 0 87
88 715 0 0 0 1 0 0 0 0 0 0 0 88
89 629 0 0 0 0 1 0 0 0 0 0 0 89
90 916 0 0 0 0 0 1 0 0 0 0 0 90
91 531 0 0 0 0 0 0 1 0 0 0 0 91
92 357 0 0 0 0 0 0 0 1 0 0 0 92
93 917 0 0 0 0 0 0 0 0 1 0 0 93
94 828 0 0 0 0 0 0 0 0 0 1 0 94
95 708 0 0 0 0 0 0 0 0 0 0 1 95
96 858 0 0 0 0 0 0 0 0 0 0 0 96
97 775 1 0 0 0 0 0 0 0 0 0 0 97
98 785 0 1 0 0 0 0 0 0 0 0 0 98
99 1006 0 0 1 0 0 0 0 0 0 0 0 99
100 789 0 0 0 1 0 0 0 0 0 0 0 100
101 734 0 0 0 0 1 0 0 0 0 0 0 101
102 906 0 0 0 0 0 1 0 0 0 0 0 102
103 532 0 0 0 0 0 0 1 0 0 0 0 103
104 387 0 0 0 0 0 0 0 1 0 0 0 104
105 991 0 0 0 0 0 0 0 0 1 0 0 105
106 841 0 0 0 0 0 0 0 0 0 1 0 106
107 892 0 0 0 0 0 0 0 0 0 0 1 107
108 782 0 0 0 0 0 0 0 0 0 0 0 108
109 811 1 0 0 0 0 0 0 0 0 0 0 109
110 792 0 1 0 0 0 0 0 0 0 0 0 110
111 978 0 0 1 0 0 0 0 0 0 0 0 111
112 773 0 0 0 1 0 0 0 0 0 0 0 112
113 796 0 0 0 0 1 0 0 0 0 0 0 113
114 946 0 0 0 0 0 1 0 0 0 0 0 114
115 594 0 0 0 0 0 0 1 0 0 0 0 115
116 438 0 0 0 0 0 0 0 1 0 0 0 116
117 1023 0 0 0 0 0 0 0 0 1 0 0 117
118 868 0 0 0 0 0 0 0 0 0 1 0 118
119 791 0 0 0 0 0 0 0 0 0 0 1 119
120 760 0 0 0 0 0 0 0 0 0 0 0 120
121 779 1 0 0 0 0 0 0 0 0 0 0 121
122 852 0 1 0 0 0 0 0 0 0 0 0 122
123 1001 0 0 1 0 0 0 0 0 0 0 0 123
124 734 0 0 0 1 0 0 0 0 0 0 0 124
125 996 0 0 0 0 1 0 0 0 0 0 0 125
126 869 0 0 0 0 0 1 0 0 0 0 0 126
127 599 0 0 0 0 0 0 1 0 0 0 0 127
128 426 0 0 0 0 0 0 0 1 0 0 0 128
129 1138 0 0 0 0 0 0 0 0 1 0 0 129
130 1091 0 0 0 0 0 0 0 0 0 1 0 130
131 830 0 0 0 0 0 0 0 0 0 0 1 131
132 909 0 0 0 0 0 0 0 0 0 0 0 132
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
576.7045 -5.9182 -11.9009 91.2074 -37.2298 -0.1215
M6 M7 M8 M9 M10 M11
91.1686 -241.5414 -347.7058 143.4025 82.3289 -20.2901
t
1.9826
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-150.91 -37.62 -1.61 38.39 174.22
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 576.7045 22.3958 25.751 < 2e-16 ***
M1 -5.9182 27.8271 -0.213 0.83194
M2 -11.9009 27.8187 -0.428 0.66957
M3 91.2074 27.8111 3.280 0.00136 **
M4 -37.2298 27.8042 -1.339 0.18312
M5 -0.1215 27.7982 -0.004 0.99652
M6 91.1686 27.7930 3.280 0.00136 **
M7 -241.5414 27.7886 -8.692 2.29e-14 ***
M8 -347.7058 27.7850 -12.514 < 2e-16 ***
M9 143.4025 27.7821 5.162 9.92e-07 ***
M10 82.3289 27.7801 2.964 0.00367 **
M11 -20.2901 27.7789 -0.730 0.46657
t 1.9826 0.1494 13.268 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 65.15 on 119 degrees of freedom
Multiple R-squared: 0.8621, Adjusted R-squared: 0.8482
F-statistic: 62.01 on 12 and 119 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,] 7.171108e-02 0.1434221504 0.9282889
[2,] 2.237804e-02 0.0447560753 0.9776220
[3,] 1.325985e-02 0.0265197097 0.9867401
[4,] 5.172480e-03 0.0103449609 0.9948275
[5,] 6.195935e-03 0.0123918695 0.9938041
[6,] 2.770103e-02 0.0554020540 0.9722990
[7,] 3.089151e-02 0.0617830254 0.9691085
[8,] 1.717009e-02 0.0343401812 0.9828299
[9,] 8.484780e-03 0.0169695600 0.9915152
[10,] 4.736068e-03 0.0094721353 0.9952639
[11,] 3.126556e-03 0.0062531127 0.9968734
[12,] 1.426116e-03 0.0028522324 0.9985739
[13,] 9.986883e-04 0.0019973765 0.9990013
[14,] 4.426584e-04 0.0008853167 0.9995573
[15,] 3.511987e-04 0.0007023975 0.9996488
[16,] 2.917316e-04 0.0005834632 0.9997083
[17,] 1.700138e-04 0.0003400276 0.9998300
[18,] 2.971383e-04 0.0005942765 0.9997029
[19,] 1.775091e-04 0.0003550181 0.9998225
[20,] 2.212289e-04 0.0004424578 0.9997788
[21,] 2.443083e-04 0.0004886166 0.9997557
[22,] 1.465383e-04 0.0002930766 0.9998535
[23,] 1.217985e-04 0.0002435969 0.9998782
[24,] 5.797427e-04 0.0011594855 0.9994203
[25,] 4.977245e-04 0.0009954490 0.9995023
[26,] 2.924285e-04 0.0005848571 0.9997076
[27,] 2.539641e-04 0.0005079283 0.9997460
[28,] 3.343504e-04 0.0006687009 0.9996656
[29,] 2.891216e-04 0.0005782431 0.9997109
[30,] 2.891619e-04 0.0005783237 0.9997108
[31,] 2.208192e-04 0.0004416384 0.9997792
[32,] 1.911955e-04 0.0003823910 0.9998088
[33,] 2.766021e-04 0.0005532043 0.9997234
[34,] 1.969979e-04 0.0003939959 0.9998030
[35,] 1.951295e-04 0.0003902591 0.9998049
[36,] 1.164867e-04 0.0002329734 0.9998835
[37,] 8.272067e-05 0.0001654413 0.9999173
[38,] 8.126127e-05 0.0001625225 0.9999187
[39,] 3.070127e-04 0.0006140254 0.9996930
[40,] 3.692422e-04 0.0007384844 0.9996308
[41,] 4.902128e-04 0.0009804257 0.9995098
[42,] 3.259814e-04 0.0006519628 0.9996740
[43,] 5.694326e-04 0.0011388651 0.9994306
[44,] 7.970560e-04 0.0015941120 0.9992029
[45,] 6.709895e-04 0.0013419791 0.9993290
[46,] 1.151976e-03 0.0023039517 0.9988480
[47,] 1.069682e-03 0.0021393641 0.9989303
[48,] 2.046344e-03 0.0040926875 0.9979537
[49,] 2.175770e-03 0.0043515403 0.9978242
[50,] 2.740708e-03 0.0054814165 0.9972593
[51,] 2.396717e-03 0.0047934333 0.9976033
[52,] 2.904920e-03 0.0058098409 0.9970951
[53,] 3.668970e-03 0.0073379402 0.9963310
[54,] 9.417471e-03 0.0188349423 0.9905825
[55,] 7.402248e-03 0.0148044954 0.9925978
[56,] 5.299354e-03 0.0105987072 0.9947006
[57,] 4.233990e-03 0.0084679794 0.9957660
[58,] 3.399634e-03 0.0067992683 0.9966004
[59,] 2.531102e-03 0.0050622036 0.9974689
[60,] 2.394662e-03 0.0047893249 0.9976053
[61,] 1.604348e-03 0.0032086953 0.9983957
[62,] 1.473216e-03 0.0029464328 0.9985268
[63,] 1.197462e-03 0.0023949233 0.9988025
[64,] 1.081388e-03 0.0021627754 0.9989186
[65,] 8.802778e-04 0.0017605556 0.9991197
[66,] 9.869970e-04 0.0019739940 0.9990130
[67,] 1.763941e-03 0.0035278818 0.9982361
[68,] 1.213962e-03 0.0024279230 0.9987860
[69,] 1.480572e-03 0.0029611434 0.9985194
[70,] 9.311720e-04 0.0018623440 0.9990688
[71,] 1.397909e-03 0.0027958188 0.9986021
[72,] 9.527320e-03 0.0190546404 0.9904727
[73,] 8.417086e-03 0.0168341711 0.9915829
[74,] 2.234973e-02 0.0446994674 0.9776503
[75,] 5.159989e-02 0.1031997701 0.9484001
[76,] 4.892121e-02 0.0978424169 0.9510788
[77,] 3.619990e-02 0.0723998018 0.9638001
[78,] 4.915892e-02 0.0983178323 0.9508411
[79,] 4.183933e-02 0.0836786661 0.9581607
[80,] 4.001356e-02 0.0800271247 0.9599864
[81,] 9.385601e-02 0.1877120279 0.9061440
[82,] 8.013798e-02 0.1602759604 0.9198620
[83,] 7.041996e-02 0.1408399197 0.9295800
[84,] 1.680407e-01 0.3360813259 0.8319593
[85,] 2.038483e-01 0.4076965016 0.7961517
[86,] 2.246499e-01 0.4492997296 0.7753501
[87,] 2.132287e-01 0.4264573430 0.7867713
[88,] 1.653199e-01 0.3306397722 0.8346801
[89,] 1.259997e-01 0.2519993309 0.8740003
[90,] 1.193689e-01 0.2387377854 0.8806311
[91,] 1.152693e-01 0.2305386213 0.8847307
[92,] 2.690699e-01 0.5381397656 0.7309301
[93,] 2.086071e-01 0.4172142625 0.7913929
[94,] 2.034733e-01 0.4069465911 0.7965267
[95,] 1.460475e-01 0.2920950813 0.8539525
[96,] 1.245780e-01 0.2491559629 0.8754220
[97,] 1.356971e-01 0.2713941072 0.8643029
[98,] 1.764901e-01 0.3529802792 0.8235099
[99,] 3.230450e-01 0.6460899333 0.6769550
[100,] 3.152469e-01 0.6304937760 0.6847531
[101,] 4.790095e-01 0.9580189269 0.5209905
> postscript(file="/var/fisher/rcomp/tmp/1g3911352581892.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/fisher/rcomp/tmp/2tuvp1352581892.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/fisher/rcomp/tmp/36qhi1352581892.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/fisher/rcomp/tmp/4rdka1352581892.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/fisher/rcomp/tmp/581pq1352581892.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 = 132
Frequency = 1
1 2 3 4 5
44.23106061 45.23106061 -26.85984848 32.59469697 27.50378788
6 7 8 9 10
-43.76893939 38.95833333 111.14015152 -98.95075758 74.14015152
11 12 13 14 15
32.77651515 38.50378788 33.43939394 -6.56060606 -2.65151515
16 17 18 19 20
-19.19696970 8.71212121 -22.56060606 48.16666667 38.34848485
21 22 23 24 25
-7.74242424 -12.65151515 41.98484848 18.71212121 -12.35227273
26 27 28 29 30
34.64772727 -30.44318182 32.01136364 -0.07954545 3.64772727
31 32 33 34 35
78.37500000 44.55681818 17.46590909 -4.44318182 -35.80681818
36 37 38 39 40
75.92045455 -17.14393939 55.85606061 79.76515152 58.21969697
41 42 43 44 45
-1.87121212 33.85606061 -8.41666667 35.76515152 29.67424242
46 47 48 49 50
-21.23484848 46.40151515 -30.87121212 27.06439394 -25.93560606
51 52 53 54 55
-7.02651515 -7.57196970 39.33712121 79.06439394 -26.20833333
56 57 58 59 60
26.97348485 -9.11742424 -87.02651515 -72.39015152 -19.66287879
61 62 63 64 65
48.27272727 3.27272727 -109.81818182 -72.36363636 23.54545455
66 67 68 69 70
-67.72727273 -82.00000000 -32.81818182 -150.90909091 -82.81818182
71 72 73 74 75
-40.18181818 -66.45454545 -73.51893939 -68.51893939 -98.60984848
76 77 78 79 80
-36.15530303 -97.24621212 -91.51893939 -99.79166667 -43.60984848
81 82 83 84 85
-88.70075758 30.39015152 -71.97348485 -114.24621212 -54.31060606
86 87 88 89 90
-118.31060606 -125.40151515 1.05303030 -124.03787879 69.68939394
91 92 93 94 95
15.41666667 -54.40151515 12.50757576 -17.40151515 -36.76515152
96 97 98 99 100
90.96212121 11.89772727 25.89772727 141.80681818 51.26136364
101 102 103 104 105
-42.82954545 35.89772727 -7.37500000 -48.19318182 62.71590909
106 107 108 109 110
-28.19318182 123.44318182 -8.82954545 24.10606061 9.10606061
111 112 113 114 115
90.01515152 11.46969697 -4.62121212 52.10606061 30.83333333
116 117 118 119 120
-20.98484848 70.92424242 -24.98484848 -1.34848485 -54.62121212
121 122 123 124 125
-31.68560606 45.31439394 89.22348485 -51.32196970 171.58712121
126 127 128 129 130
-48.68560606 12.04166667 -56.77651515 162.13257576 174.22348485
131 132
13.85984848 70.58712121
> postscript(file="/var/fisher/rcomp/tmp/6xyzz1352581892.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 = 132
Frequency = 1
lag(myerror, k = 1) myerror
0 44.23106061 NA
1 45.23106061 44.23106061
2 -26.85984848 45.23106061
3 32.59469697 -26.85984848
4 27.50378788 32.59469697
5 -43.76893939 27.50378788
6 38.95833333 -43.76893939
7 111.14015152 38.95833333
8 -98.95075758 111.14015152
9 74.14015152 -98.95075758
10 32.77651515 74.14015152
11 38.50378788 32.77651515
12 33.43939394 38.50378788
13 -6.56060606 33.43939394
14 -2.65151515 -6.56060606
15 -19.19696970 -2.65151515
16 8.71212121 -19.19696970
17 -22.56060606 8.71212121
18 48.16666667 -22.56060606
19 38.34848485 48.16666667
20 -7.74242424 38.34848485
21 -12.65151515 -7.74242424
22 41.98484848 -12.65151515
23 18.71212121 41.98484848
24 -12.35227273 18.71212121
25 34.64772727 -12.35227273
26 -30.44318182 34.64772727
27 32.01136364 -30.44318182
28 -0.07954545 32.01136364
29 3.64772727 -0.07954545
30 78.37500000 3.64772727
31 44.55681818 78.37500000
32 17.46590909 44.55681818
33 -4.44318182 17.46590909
34 -35.80681818 -4.44318182
35 75.92045455 -35.80681818
36 -17.14393939 75.92045455
37 55.85606061 -17.14393939
38 79.76515152 55.85606061
39 58.21969697 79.76515152
40 -1.87121212 58.21969697
41 33.85606061 -1.87121212
42 -8.41666667 33.85606061
43 35.76515152 -8.41666667
44 29.67424242 35.76515152
45 -21.23484848 29.67424242
46 46.40151515 -21.23484848
47 -30.87121212 46.40151515
48 27.06439394 -30.87121212
49 -25.93560606 27.06439394
50 -7.02651515 -25.93560606
51 -7.57196970 -7.02651515
52 39.33712121 -7.57196970
53 79.06439394 39.33712121
54 -26.20833333 79.06439394
55 26.97348485 -26.20833333
56 -9.11742424 26.97348485
57 -87.02651515 -9.11742424
58 -72.39015152 -87.02651515
59 -19.66287879 -72.39015152
60 48.27272727 -19.66287879
61 3.27272727 48.27272727
62 -109.81818182 3.27272727
63 -72.36363636 -109.81818182
64 23.54545455 -72.36363636
65 -67.72727273 23.54545455
66 -82.00000000 -67.72727273
67 -32.81818182 -82.00000000
68 -150.90909091 -32.81818182
69 -82.81818182 -150.90909091
70 -40.18181818 -82.81818182
71 -66.45454545 -40.18181818
72 -73.51893939 -66.45454545
73 -68.51893939 -73.51893939
74 -98.60984848 -68.51893939
75 -36.15530303 -98.60984848
76 -97.24621212 -36.15530303
77 -91.51893939 -97.24621212
78 -99.79166667 -91.51893939
79 -43.60984848 -99.79166667
80 -88.70075758 -43.60984848
81 30.39015152 -88.70075758
82 -71.97348485 30.39015152
83 -114.24621212 -71.97348485
84 -54.31060606 -114.24621212
85 -118.31060606 -54.31060606
86 -125.40151515 -118.31060606
87 1.05303030 -125.40151515
88 -124.03787879 1.05303030
89 69.68939394 -124.03787879
90 15.41666667 69.68939394
91 -54.40151515 15.41666667
92 12.50757576 -54.40151515
93 -17.40151515 12.50757576
94 -36.76515152 -17.40151515
95 90.96212121 -36.76515152
96 11.89772727 90.96212121
97 25.89772727 11.89772727
98 141.80681818 25.89772727
99 51.26136364 141.80681818
100 -42.82954545 51.26136364
101 35.89772727 -42.82954545
102 -7.37500000 35.89772727
103 -48.19318182 -7.37500000
104 62.71590909 -48.19318182
105 -28.19318182 62.71590909
106 123.44318182 -28.19318182
107 -8.82954545 123.44318182
108 24.10606061 -8.82954545
109 9.10606061 24.10606061
110 90.01515152 9.10606061
111 11.46969697 90.01515152
112 -4.62121212 11.46969697
113 52.10606061 -4.62121212
114 30.83333333 52.10606061
115 -20.98484848 30.83333333
116 70.92424242 -20.98484848
117 -24.98484848 70.92424242
118 -1.34848485 -24.98484848
119 -54.62121212 -1.34848485
120 -31.68560606 -54.62121212
121 45.31439394 -31.68560606
122 89.22348485 45.31439394
123 -51.32196970 89.22348485
124 171.58712121 -51.32196970
125 -48.68560606 171.58712121
126 12.04166667 -48.68560606
127 -56.77651515 12.04166667
128 162.13257576 -56.77651515
129 174.22348485 162.13257576
130 13.85984848 174.22348485
131 70.58712121 13.85984848
132 NA 70.58712121
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 45.23106061 44.23106061
[2,] -26.85984848 45.23106061
[3,] 32.59469697 -26.85984848
[4,] 27.50378788 32.59469697
[5,] -43.76893939 27.50378788
[6,] 38.95833333 -43.76893939
[7,] 111.14015152 38.95833333
[8,] -98.95075758 111.14015152
[9,] 74.14015152 -98.95075758
[10,] 32.77651515 74.14015152
[11,] 38.50378788 32.77651515
[12,] 33.43939394 38.50378788
[13,] -6.56060606 33.43939394
[14,] -2.65151515 -6.56060606
[15,] -19.19696970 -2.65151515
[16,] 8.71212121 -19.19696970
[17,] -22.56060606 8.71212121
[18,] 48.16666667 -22.56060606
[19,] 38.34848485 48.16666667
[20,] -7.74242424 38.34848485
[21,] -12.65151515 -7.74242424
[22,] 41.98484848 -12.65151515
[23,] 18.71212121 41.98484848
[24,] -12.35227273 18.71212121
[25,] 34.64772727 -12.35227273
[26,] -30.44318182 34.64772727
[27,] 32.01136364 -30.44318182
[28,] -0.07954545 32.01136364
[29,] 3.64772727 -0.07954545
[30,] 78.37500000 3.64772727
[31,] 44.55681818 78.37500000
[32,] 17.46590909 44.55681818
[33,] -4.44318182 17.46590909
[34,] -35.80681818 -4.44318182
[35,] 75.92045455 -35.80681818
[36,] -17.14393939 75.92045455
[37,] 55.85606061 -17.14393939
[38,] 79.76515152 55.85606061
[39,] 58.21969697 79.76515152
[40,] -1.87121212 58.21969697
[41,] 33.85606061 -1.87121212
[42,] -8.41666667 33.85606061
[43,] 35.76515152 -8.41666667
[44,] 29.67424242 35.76515152
[45,] -21.23484848 29.67424242
[46,] 46.40151515 -21.23484848
[47,] -30.87121212 46.40151515
[48,] 27.06439394 -30.87121212
[49,] -25.93560606 27.06439394
[50,] -7.02651515 -25.93560606
[51,] -7.57196970 -7.02651515
[52,] 39.33712121 -7.57196970
[53,] 79.06439394 39.33712121
[54,] -26.20833333 79.06439394
[55,] 26.97348485 -26.20833333
[56,] -9.11742424 26.97348485
[57,] -87.02651515 -9.11742424
[58,] -72.39015152 -87.02651515
[59,] -19.66287879 -72.39015152
[60,] 48.27272727 -19.66287879
[61,] 3.27272727 48.27272727
[62,] -109.81818182 3.27272727
[63,] -72.36363636 -109.81818182
[64,] 23.54545455 -72.36363636
[65,] -67.72727273 23.54545455
[66,] -82.00000000 -67.72727273
[67,] -32.81818182 -82.00000000
[68,] -150.90909091 -32.81818182
[69,] -82.81818182 -150.90909091
[70,] -40.18181818 -82.81818182
[71,] -66.45454545 -40.18181818
[72,] -73.51893939 -66.45454545
[73,] -68.51893939 -73.51893939
[74,] -98.60984848 -68.51893939
[75,] -36.15530303 -98.60984848
[76,] -97.24621212 -36.15530303
[77,] -91.51893939 -97.24621212
[78,] -99.79166667 -91.51893939
[79,] -43.60984848 -99.79166667
[80,] -88.70075758 -43.60984848
[81,] 30.39015152 -88.70075758
[82,] -71.97348485 30.39015152
[83,] -114.24621212 -71.97348485
[84,] -54.31060606 -114.24621212
[85,] -118.31060606 -54.31060606
[86,] -125.40151515 -118.31060606
[87,] 1.05303030 -125.40151515
[88,] -124.03787879 1.05303030
[89,] 69.68939394 -124.03787879
[90,] 15.41666667 69.68939394
[91,] -54.40151515 15.41666667
[92,] 12.50757576 -54.40151515
[93,] -17.40151515 12.50757576
[94,] -36.76515152 -17.40151515
[95,] 90.96212121 -36.76515152
[96,] 11.89772727 90.96212121
[97,] 25.89772727 11.89772727
[98,] 141.80681818 25.89772727
[99,] 51.26136364 141.80681818
[100,] -42.82954545 51.26136364
[101,] 35.89772727 -42.82954545
[102,] -7.37500000 35.89772727
[103,] -48.19318182 -7.37500000
[104,] 62.71590909 -48.19318182
[105,] -28.19318182 62.71590909
[106,] 123.44318182 -28.19318182
[107,] -8.82954545 123.44318182
[108,] 24.10606061 -8.82954545
[109,] 9.10606061 24.10606061
[110,] 90.01515152 9.10606061
[111,] 11.46969697 90.01515152
[112,] -4.62121212 11.46969697
[113,] 52.10606061 -4.62121212
[114,] 30.83333333 52.10606061
[115,] -20.98484848 30.83333333
[116,] 70.92424242 -20.98484848
[117,] -24.98484848 70.92424242
[118,] -1.34848485 -24.98484848
[119,] -54.62121212 -1.34848485
[120,] -31.68560606 -54.62121212
[121,] 45.31439394 -31.68560606
[122,] 89.22348485 45.31439394
[123,] -51.32196970 89.22348485
[124,] 171.58712121 -51.32196970
[125,] -48.68560606 171.58712121
[126,] 12.04166667 -48.68560606
[127,] -56.77651515 12.04166667
[128,] 162.13257576 -56.77651515
[129,] 174.22348485 162.13257576
[130,] 13.85984848 174.22348485
[131,] 70.58712121 13.85984848
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 45.23106061 44.23106061
2 -26.85984848 45.23106061
3 32.59469697 -26.85984848
4 27.50378788 32.59469697
5 -43.76893939 27.50378788
6 38.95833333 -43.76893939
7 111.14015152 38.95833333
8 -98.95075758 111.14015152
9 74.14015152 -98.95075758
10 32.77651515 74.14015152
11 38.50378788 32.77651515
12 33.43939394 38.50378788
13 -6.56060606 33.43939394
14 -2.65151515 -6.56060606
15 -19.19696970 -2.65151515
16 8.71212121 -19.19696970
17 -22.56060606 8.71212121
18 48.16666667 -22.56060606
19 38.34848485 48.16666667
20 -7.74242424 38.34848485
21 -12.65151515 -7.74242424
22 41.98484848 -12.65151515
23 18.71212121 41.98484848
24 -12.35227273 18.71212121
25 34.64772727 -12.35227273
26 -30.44318182 34.64772727
27 32.01136364 -30.44318182
28 -0.07954545 32.01136364
29 3.64772727 -0.07954545
30 78.37500000 3.64772727
31 44.55681818 78.37500000
32 17.46590909 44.55681818
33 -4.44318182 17.46590909
34 -35.80681818 -4.44318182
35 75.92045455 -35.80681818
36 -17.14393939 75.92045455
37 55.85606061 -17.14393939
38 79.76515152 55.85606061
39 58.21969697 79.76515152
40 -1.87121212 58.21969697
41 33.85606061 -1.87121212
42 -8.41666667 33.85606061
43 35.76515152 -8.41666667
44 29.67424242 35.76515152
45 -21.23484848 29.67424242
46 46.40151515 -21.23484848
47 -30.87121212 46.40151515
48 27.06439394 -30.87121212
49 -25.93560606 27.06439394
50 -7.02651515 -25.93560606
51 -7.57196970 -7.02651515
52 39.33712121 -7.57196970
53 79.06439394 39.33712121
54 -26.20833333 79.06439394
55 26.97348485 -26.20833333
56 -9.11742424 26.97348485
57 -87.02651515 -9.11742424
58 -72.39015152 -87.02651515
59 -19.66287879 -72.39015152
60 48.27272727 -19.66287879
61 3.27272727 48.27272727
62 -109.81818182 3.27272727
63 -72.36363636 -109.81818182
64 23.54545455 -72.36363636
65 -67.72727273 23.54545455
66 -82.00000000 -67.72727273
67 -32.81818182 -82.00000000
68 -150.90909091 -32.81818182
69 -82.81818182 -150.90909091
70 -40.18181818 -82.81818182
71 -66.45454545 -40.18181818
72 -73.51893939 -66.45454545
73 -68.51893939 -73.51893939
74 -98.60984848 -68.51893939
75 -36.15530303 -98.60984848
76 -97.24621212 -36.15530303
77 -91.51893939 -97.24621212
78 -99.79166667 -91.51893939
79 -43.60984848 -99.79166667
80 -88.70075758 -43.60984848
81 30.39015152 -88.70075758
82 -71.97348485 30.39015152
83 -114.24621212 -71.97348485
84 -54.31060606 -114.24621212
85 -118.31060606 -54.31060606
86 -125.40151515 -118.31060606
87 1.05303030 -125.40151515
88 -124.03787879 1.05303030
89 69.68939394 -124.03787879
90 15.41666667 69.68939394
91 -54.40151515 15.41666667
92 12.50757576 -54.40151515
93 -17.40151515 12.50757576
94 -36.76515152 -17.40151515
95 90.96212121 -36.76515152
96 11.89772727 90.96212121
97 25.89772727 11.89772727
98 141.80681818 25.89772727
99 51.26136364 141.80681818
100 -42.82954545 51.26136364
101 35.89772727 -42.82954545
102 -7.37500000 35.89772727
103 -48.19318182 -7.37500000
104 62.71590909 -48.19318182
105 -28.19318182 62.71590909
106 123.44318182 -28.19318182
107 -8.82954545 123.44318182
108 24.10606061 -8.82954545
109 9.10606061 24.10606061
110 90.01515152 9.10606061
111 11.46969697 90.01515152
112 -4.62121212 11.46969697
113 52.10606061 -4.62121212
114 30.83333333 52.10606061
115 -20.98484848 30.83333333
116 70.92424242 -20.98484848
117 -24.98484848 70.92424242
118 -1.34848485 -24.98484848
119 -54.62121212 -1.34848485
120 -31.68560606 -54.62121212
121 45.31439394 -31.68560606
122 89.22348485 45.31439394
123 -51.32196970 89.22348485
124 171.58712121 -51.32196970
125 -48.68560606 171.58712121
126 12.04166667 -48.68560606
127 -56.77651515 12.04166667
128 162.13257576 -56.77651515
129 174.22348485 162.13257576
130 13.85984848 174.22348485
131 70.58712121 13.85984848
> 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/fisher/rcomp/tmp/7ypto1352581892.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/fisher/rcomp/tmp/8xkac1352581892.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/fisher/rcomp/tmp/965zb1352581892.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/fisher/rcomp/tmp/1008cg1352581892.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/fisher/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/fisher/rcomp/tmp/11mccg1352581892.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/fisher/rcomp/tmp/1231p61352581892.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/fisher/rcomp/tmp/13imbp1352581892.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/fisher/rcomp/tmp/147kv61352581892.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/fisher/rcomp/tmp/15xnzz1352581892.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/fisher/rcomp/tmp/16onxb1352581892.tab")
+ }
>
> try(system("convert tmp/1g3911352581892.ps tmp/1g3911352581892.png",intern=TRUE))
character(0)
> try(system("convert tmp/2tuvp1352581892.ps tmp/2tuvp1352581892.png",intern=TRUE))
character(0)
> try(system("convert tmp/36qhi1352581892.ps tmp/36qhi1352581892.png",intern=TRUE))
character(0)
> try(system("convert tmp/4rdka1352581892.ps tmp/4rdka1352581892.png",intern=TRUE))
character(0)
> try(system("convert tmp/581pq1352581892.ps tmp/581pq1352581892.png",intern=TRUE))
character(0)
> try(system("convert tmp/6xyzz1352581892.ps tmp/6xyzz1352581892.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ypto1352581892.ps tmp/7ypto1352581892.png",intern=TRUE))
character(0)
> try(system("convert tmp/8xkac1352581892.ps tmp/8xkac1352581892.png",intern=TRUE))
character(0)
> try(system("convert tmp/965zb1352581892.ps tmp/965zb1352581892.png",intern=TRUE))
character(0)
> try(system("convert tmp/1008cg1352581892.ps tmp/1008cg1352581892.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.109 1.144 8.262