R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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(621,0,604,0,584,0,574,0,555,0,545,0,599,0,620,0,608,0,590,0,579,0,580,0,579,0,572,0,560,0,551,0,537,0,541,0,588,0,607,0,599,0,578,0,563,0,566,0,561,0,554,0,540,0,526,0,512,0,505,0,554,0,584,0,569,0,540,0,522,0,526,0,527,0,516,0,503,0,489,0,479,0,475,0,524,0,552,0,532,0,511,0,492,0,492,0,493,0,481,0,462,0,457,0,442,0,439,0,488,0,521,0,501,0,485,0,464,0,460,0,467,0,460,0,448,0,443,0,436,0,431,0,484,0,510,0,513,0,503,0,471,0,471,0,476,0,475,0,470,0,461,0,455,0,456,0,517,0,525,0,523,0,519,1,509,1,512,1,519,1,517,1,510,1,509,1,501,1,507,1,569,1,580,1,578,1,565,1,547,1,555,1,562,1,561,1,555,1,544,1,537,1,543,1,594,1,611,1,613,1,611,1,594,1,595,1,591,1,589,1,584,1,573,1,567,1,569,1,621,1,629,1,628,1,612,1,595,1,597,1,593,1,590,1,580,1,574,1,573,1,573,1,620,1,626,1,620,1,588,1,566,1,557,1,561,1,549,1,532,1,526,1,511,1,499,1,555,1,565,1,542,1,527,1,510,1,514,1,517,1,508,1,493,1,490,1,469,1,478,1,528,1,534,1,518,1,506,1,502,1),dim=c(2,155),dimnames=list(c('X','Y'),1:155))
> y <- array(NA,dim=c(2,155),dimnames=list(c('X','Y'),1:155))
> 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'
> #'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
X Y M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 621 0 1 0 0 0 0 0 0 0 0 0 0 1
2 604 0 0 1 0 0 0 0 0 0 0 0 0 2
3 584 0 0 0 1 0 0 0 0 0 0 0 0 3
4 574 0 0 0 0 1 0 0 0 0 0 0 0 4
5 555 0 0 0 0 0 1 0 0 0 0 0 0 5
6 545 0 0 0 0 0 0 1 0 0 0 0 0 6
7 599 0 0 0 0 0 0 0 1 0 0 0 0 7
8 620 0 0 0 0 0 0 0 0 1 0 0 0 8
9 608 0 0 0 0 0 0 0 0 0 1 0 0 9
10 590 0 0 0 0 0 0 0 0 0 0 1 0 10
11 579 0 0 0 0 0 0 0 0 0 0 0 1 11
12 580 0 0 0 0 0 0 0 0 0 0 0 0 12
13 579 0 1 0 0 0 0 0 0 0 0 0 0 13
14 572 0 0 1 0 0 0 0 0 0 0 0 0 14
15 560 0 0 0 1 0 0 0 0 0 0 0 0 15
16 551 0 0 0 0 1 0 0 0 0 0 0 0 16
17 537 0 0 0 0 0 1 0 0 0 0 0 0 17
18 541 0 0 0 0 0 0 1 0 0 0 0 0 18
19 588 0 0 0 0 0 0 0 1 0 0 0 0 19
20 607 0 0 0 0 0 0 0 0 1 0 0 0 20
21 599 0 0 0 0 0 0 0 0 0 1 0 0 21
22 578 0 0 0 0 0 0 0 0 0 0 1 0 22
23 563 0 0 0 0 0 0 0 0 0 0 0 1 23
24 566 0 0 0 0 0 0 0 0 0 0 0 0 24
25 561 0 1 0 0 0 0 0 0 0 0 0 0 25
26 554 0 0 1 0 0 0 0 0 0 0 0 0 26
27 540 0 0 0 1 0 0 0 0 0 0 0 0 27
28 526 0 0 0 0 1 0 0 0 0 0 0 0 28
29 512 0 0 0 0 0 1 0 0 0 0 0 0 29
30 505 0 0 0 0 0 0 1 0 0 0 0 0 30
31 554 0 0 0 0 0 0 0 1 0 0 0 0 31
32 584 0 0 0 0 0 0 0 0 1 0 0 0 32
33 569 0 0 0 0 0 0 0 0 0 1 0 0 33
34 540 0 0 0 0 0 0 0 0 0 0 1 0 34
35 522 0 0 0 0 0 0 0 0 0 0 0 1 35
36 526 0 0 0 0 0 0 0 0 0 0 0 0 36
37 527 0 1 0 0 0 0 0 0 0 0 0 0 37
38 516 0 0 1 0 0 0 0 0 0 0 0 0 38
39 503 0 0 0 1 0 0 0 0 0 0 0 0 39
40 489 0 0 0 0 1 0 0 0 0 0 0 0 40
41 479 0 0 0 0 0 1 0 0 0 0 0 0 41
42 475 0 0 0 0 0 0 1 0 0 0 0 0 42
43 524 0 0 0 0 0 0 0 1 0 0 0 0 43
44 552 0 0 0 0 0 0 0 0 1 0 0 0 44
45 532 0 0 0 0 0 0 0 0 0 1 0 0 45
46 511 0 0 0 0 0 0 0 0 0 0 1 0 46
47 492 0 0 0 0 0 0 0 0 0 0 0 1 47
48 492 0 0 0 0 0 0 0 0 0 0 0 0 48
49 493 0 1 0 0 0 0 0 0 0 0 0 0 49
50 481 0 0 1 0 0 0 0 0 0 0 0 0 50
51 462 0 0 0 1 0 0 0 0 0 0 0 0 51
52 457 0 0 0 0 1 0 0 0 0 0 0 0 52
53 442 0 0 0 0 0 1 0 0 0 0 0 0 53
54 439 0 0 0 0 0 0 1 0 0 0 0 0 54
55 488 0 0 0 0 0 0 0 1 0 0 0 0 55
56 521 0 0 0 0 0 0 0 0 1 0 0 0 56
57 501 0 0 0 0 0 0 0 0 0 1 0 0 57
58 485 0 0 0 0 0 0 0 0 0 0 1 0 58
59 464 0 0 0 0 0 0 0 0 0 0 0 1 59
60 460 0 0 0 0 0 0 0 0 0 0 0 0 60
61 467 0 1 0 0 0 0 0 0 0 0 0 0 61
62 460 0 0 1 0 0 0 0 0 0 0 0 0 62
63 448 0 0 0 1 0 0 0 0 0 0 0 0 63
64 443 0 0 0 0 1 0 0 0 0 0 0 0 64
65 436 0 0 0 0 0 1 0 0 0 0 0 0 65
66 431 0 0 0 0 0 0 1 0 0 0 0 0 66
67 484 0 0 0 0 0 0 0 1 0 0 0 0 67
68 510 0 0 0 0 0 0 0 0 1 0 0 0 68
69 513 0 0 0 0 0 0 0 0 0 1 0 0 69
70 503 0 0 0 0 0 0 0 0 0 0 1 0 70
71 471 0 0 0 0 0 0 0 0 0 0 0 1 71
72 471 0 0 0 0 0 0 0 0 0 0 0 0 72
73 476 0 1 0 0 0 0 0 0 0 0 0 0 73
74 475 0 0 1 0 0 0 0 0 0 0 0 0 74
75 470 0 0 0 1 0 0 0 0 0 0 0 0 75
76 461 0 0 0 0 1 0 0 0 0 0 0 0 76
77 455 0 0 0 0 0 1 0 0 0 0 0 0 77
78 456 0 0 0 0 0 0 1 0 0 0 0 0 78
79 517 0 0 0 0 0 0 0 1 0 0 0 0 79
80 525 0 0 0 0 0 0 0 0 1 0 0 0 80
81 523 0 0 0 0 0 0 0 0 0 1 0 0 81
82 519 1 0 0 0 0 0 0 0 0 0 1 0 82
83 509 1 0 0 0 0 0 0 0 0 0 0 1 83
84 512 1 0 0 0 0 0 0 0 0 0 0 0 84
85 519 1 1 0 0 0 0 0 0 0 0 0 0 85
86 517 1 0 1 0 0 0 0 0 0 0 0 0 86
87 510 1 0 0 1 0 0 0 0 0 0 0 0 87
88 509 1 0 0 0 1 0 0 0 0 0 0 0 88
89 501 1 0 0 0 0 1 0 0 0 0 0 0 89
90 507 1 0 0 0 0 0 1 0 0 0 0 0 90
91 569 1 0 0 0 0 0 0 1 0 0 0 0 91
92 580 1 0 0 0 0 0 0 0 1 0 0 0 92
93 578 1 0 0 0 0 0 0 0 0 1 0 0 93
94 565 1 0 0 0 0 0 0 0 0 0 1 0 94
95 547 1 0 0 0 0 0 0 0 0 0 0 1 95
96 555 1 0 0 0 0 0 0 0 0 0 0 0 96
97 562 1 1 0 0 0 0 0 0 0 0 0 0 97
98 561 1 0 1 0 0 0 0 0 0 0 0 0 98
99 555 1 0 0 1 0 0 0 0 0 0 0 0 99
100 544 1 0 0 0 1 0 0 0 0 0 0 0 100
101 537 1 0 0 0 0 1 0 0 0 0 0 0 101
102 543 1 0 0 0 0 0 1 0 0 0 0 0 102
103 594 1 0 0 0 0 0 0 1 0 0 0 0 103
104 611 1 0 0 0 0 0 0 0 1 0 0 0 104
105 613 1 0 0 0 0 0 0 0 0 1 0 0 105
106 611 1 0 0 0 0 0 0 0 0 0 1 0 106
107 594 1 0 0 0 0 0 0 0 0 0 0 1 107
108 595 1 0 0 0 0 0 0 0 0 0 0 0 108
109 591 1 1 0 0 0 0 0 0 0 0 0 0 109
110 589 1 0 1 0 0 0 0 0 0 0 0 0 110
111 584 1 0 0 1 0 0 0 0 0 0 0 0 111
112 573 1 0 0 0 1 0 0 0 0 0 0 0 112
113 567 1 0 0 0 0 1 0 0 0 0 0 0 113
114 569 1 0 0 0 0 0 1 0 0 0 0 0 114
115 621 1 0 0 0 0 0 0 1 0 0 0 0 115
116 629 1 0 0 0 0 0 0 0 1 0 0 0 116
117 628 1 0 0 0 0 0 0 0 0 1 0 0 117
118 612 1 0 0 0 0 0 0 0 0 0 1 0 118
119 595 1 0 0 0 0 0 0 0 0 0 0 1 119
120 597 1 0 0 0 0 0 0 0 0 0 0 0 120
121 593 1 1 0 0 0 0 0 0 0 0 0 0 121
122 590 1 0 1 0 0 0 0 0 0 0 0 0 122
123 580 1 0 0 1 0 0 0 0 0 0 0 0 123
124 574 1 0 0 0 1 0 0 0 0 0 0 0 124
125 573 1 0 0 0 0 1 0 0 0 0 0 0 125
126 573 1 0 0 0 0 0 1 0 0 0 0 0 126
127 620 1 0 0 0 0 0 0 1 0 0 0 0 127
128 626 1 0 0 0 0 0 0 0 1 0 0 0 128
129 620 1 0 0 0 0 0 0 0 0 1 0 0 129
130 588 1 0 0 0 0 0 0 0 0 0 1 0 130
131 566 1 0 0 0 0 0 0 0 0 0 0 1 131
132 557 1 0 0 0 0 0 0 0 0 0 0 0 132
133 561 1 1 0 0 0 0 0 0 0 0 0 0 133
134 549 1 0 1 0 0 0 0 0 0 0 0 0 134
135 532 1 0 0 1 0 0 0 0 0 0 0 0 135
136 526 1 0 0 0 1 0 0 0 0 0 0 0 136
137 511 1 0 0 0 0 1 0 0 0 0 0 0 137
138 499 1 0 0 0 0 0 1 0 0 0 0 0 138
139 555 1 0 0 0 0 0 0 1 0 0 0 0 139
140 565 1 0 0 0 0 0 0 0 1 0 0 0 140
141 542 1 0 0 0 0 0 0 0 0 1 0 0 141
142 527 1 0 0 0 0 0 0 0 0 0 1 0 142
143 510 1 0 0 0 0 0 0 0 0 0 0 1 143
144 514 1 0 0 0 0 0 0 0 0 0 0 0 144
145 517 1 1 0 0 0 0 0 0 0 0 0 0 145
146 508 1 0 1 0 0 0 0 0 0 0 0 0 146
147 493 1 0 0 1 0 0 0 0 0 0 0 0 147
148 490 1 0 0 0 1 0 0 0 0 0 0 0 148
149 469 1 0 0 0 0 1 0 0 0 0 0 0 149
150 478 1 0 0 0 0 0 1 0 0 0 0 0 150
151 528 1 0 0 0 0 0 0 1 0 0 0 0 151
152 534 1 0 0 0 0 0 0 0 1 0 0 0 152
153 518 1 0 0 0 0 0 0 0 0 1 0 0 153
154 506 1 0 0 0 0 0 0 0 0 0 1 0 154
155 502 1 0 0 0 0 0 0 0 0 0 0 1 155
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Y M1 M2 M3 M4
566.657 129.841 7.028 1.261 -9.429 -16.196
M5 M6 M7 M8 M9 M10
-25.963 -25.730 27.810 46.197 38.199 13.367
M11 t
-2.400 -1.233
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-89.773 -18.356 -1.009 21.391 57.569
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 566.657 10.497 53.983 < 2e-16 ***
Y 129.841 10.208 12.719 < 2e-16 ***
M1 7.029 12.688 0.554 0.580484
M2 1.261 12.686 0.099 0.920943
M3 -9.429 12.686 -0.743 0.458550
M4 -16.196 12.686 -1.277 0.203814
M5 -25.963 12.688 -2.046 0.042580 *
M6 -25.730 12.690 -2.028 0.044486 *
M7 27.810 12.694 2.191 0.030106 *
M8 46.197 12.698 3.638 0.000385 ***
M9 38.199 12.704 3.007 0.003126 **
M10 13.367 12.686 1.054 0.293841
M11 -2.400 12.688 -0.189 0.850223
t -1.233 0.114 -10.812 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 31.68 on 141 degrees of freedom
Multiple R-squared: 0.6213, Adjusted R-squared: 0.5864
F-statistic: 17.8 on 13 and 141 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.908098e-02 3.816196e-02 9.809190e-01
[2,] 1.929042e-02 3.858085e-02 9.807096e-01
[3,] 7.718955e-03 1.543791e-02 9.922810e-01
[4,] 2.625198e-03 5.250396e-03 9.973748e-01
[5,] 1.040064e-03 2.080128e-03 9.989599e-01
[6,] 3.400513e-04 6.801025e-04 9.996599e-01
[7,] 9.639580e-05 1.927916e-04 9.999036e-01
[8,] 2.806066e-05 5.612132e-05 9.999719e-01
[9,] 1.299395e-05 2.598790e-05 9.999870e-01
[10,] 3.778986e-06 7.557973e-06 9.999962e-01
[11,] 9.968778e-07 1.993756e-06 9.999990e-01
[12,] 2.987417e-07 5.974833e-07 9.999997e-01
[13,] 7.529037e-08 1.505807e-07 9.999999e-01
[14,] 2.228937e-08 4.457874e-08 1.000000e+00
[15,] 7.012045e-09 1.402409e-08 1.000000e+00
[16,] 1.840123e-09 3.680247e-09 1.000000e+00
[17,] 4.387480e-10 8.774961e-10 1.000000e+00
[18,] 2.394306e-10 4.788611e-10 1.000000e+00
[19,] 2.624381e-10 5.248762e-10 1.000000e+00
[20,] 1.651208e-10 3.302415e-10 1.000000e+00
[21,] 1.150287e-10 2.300573e-10 1.000000e+00
[22,] 6.926087e-11 1.385217e-10 1.000000e+00
[23,] 2.727301e-11 5.454602e-11 1.000000e+00
[24,] 1.331844e-11 2.663688e-11 1.000000e+00
[25,] 3.687491e-12 7.374982e-12 1.000000e+00
[26,] 9.614556e-13 1.922911e-12 1.000000e+00
[27,] 2.528569e-13 5.057138e-13 1.000000e+00
[28,] 6.298678e-14 1.259736e-13 1.000000e+00
[29,] 2.152238e-14 4.304475e-14 1.000000e+00
[30,] 6.179585e-15 1.235917e-14 1.000000e+00
[31,] 2.673866e-15 5.347732e-15 1.000000e+00
[32,] 1.540597e-15 3.081194e-15 1.000000e+00
[33,] 8.341886e-16 1.668377e-15 1.000000e+00
[34,] 4.833870e-16 9.667740e-16 1.000000e+00
[35,] 4.921477e-16 9.842955e-16 1.000000e+00
[36,] 1.625764e-16 3.251528e-16 1.000000e+00
[37,] 5.576043e-17 1.115209e-16 1.000000e+00
[38,] 1.670111e-17 3.340223e-17 1.000000e+00
[39,] 5.329073e-18 1.065815e-17 1.000000e+00
[40,] 1.229692e-18 2.459384e-18 1.000000e+00
[41,] 3.117651e-19 6.235302e-19 1.000000e+00
[42,] 7.028075e-20 1.405615e-19 1.000000e+00
[43,] 1.612799e-20 3.225599e-20 1.000000e+00
[44,] 6.330320e-21 1.266064e-20 1.000000e+00
[45,] 1.431175e-21 2.862349e-21 1.000000e+00
[46,] 3.230905e-22 6.461809e-22 1.000000e+00
[47,] 8.984417e-23 1.796883e-22 1.000000e+00
[48,] 4.565652e-23 9.131304e-23 1.000000e+00
[49,] 9.023322e-23 1.804664e-22 1.000000e+00
[50,] 1.167746e-22 2.335492e-22 1.000000e+00
[51,] 2.628063e-22 5.256126e-22 1.000000e+00
[52,] 3.652058e-22 7.304115e-22 1.000000e+00
[53,] 3.972939e-20 7.945878e-20 1.000000e+00
[54,] 1.986483e-17 3.972965e-17 1.000000e+00
[55,] 5.978980e-17 1.195796e-16 1.000000e+00
[56,] 1.213512e-16 2.427024e-16 1.000000e+00
[57,] 2.467332e-16 4.934664e-16 1.000000e+00
[58,] 1.430007e-15 2.860013e-15 1.000000e+00
[59,] 2.366985e-14 4.733970e-14 1.000000e+00
[60,] 1.937506e-13 3.875012e-13 1.000000e+00
[61,] 2.285341e-12 4.570682e-12 1.000000e+00
[62,] 2.605295e-11 5.210590e-11 1.000000e+00
[63,] 5.143363e-10 1.028673e-09 1.000000e+00
[64,] 9.494204e-10 1.898841e-09 1.000000e+00
[65,] 3.051362e-09 6.102723e-09 1.000000e+00
[66,] 4.224288e-09 8.448576e-09 1.000000e+00
[67,] 5.981484e-09 1.196297e-08 1.000000e+00
[68,] 1.127332e-08 2.254665e-08 1.000000e+00
[69,] 2.074437e-08 4.148873e-08 1.000000e+00
[70,] 4.348669e-08 8.697339e-08 1.000000e+00
[71,] 1.052874e-07 2.105748e-07 9.999999e-01
[72,] 2.804654e-07 5.609308e-07 9.999997e-01
[73,] 8.631021e-07 1.726204e-06 9.999991e-01
[74,] 3.258126e-06 6.516252e-06 9.999967e-01
[75,] 1.211719e-05 2.423437e-05 9.999879e-01
[76,] 2.854112e-05 5.708224e-05 9.999715e-01
[77,] 7.182259e-05 1.436452e-04 9.999282e-01
[78,] 3.074443e-04 6.148885e-04 9.996926e-01
[79,] 1.412771e-03 2.825543e-03 9.985872e-01
[80,] 5.916517e-03 1.183303e-02 9.940835e-01
[81,] 1.796300e-02 3.592601e-02 9.820370e-01
[82,] 4.882877e-02 9.765754e-02 9.511712e-01
[83,] 1.136840e-01 2.273680e-01 8.863160e-01
[84,] 2.465702e-01 4.931405e-01 7.534298e-01
[85,] 4.523739e-01 9.047479e-01 5.476261e-01
[86,] 6.821623e-01 6.356754e-01 3.178377e-01
[87,] 8.756756e-01 2.486488e-01 1.243244e-01
[88,] 9.571537e-01 8.569259e-02 4.284630e-02
[89,] 9.845030e-01 3.099399e-02 1.549700e-02
[90,] 9.944331e-01 1.113387e-02 5.566937e-03
[91,] 9.983086e-01 3.382732e-03 1.691366e-03
[92,] 9.993465e-01 1.306950e-03 6.534751e-04
[93,] 9.997928e-01 4.144954e-04 2.072477e-04
[94,] 9.999234e-01 1.531242e-04 7.656211e-05
[95,] 9.999583e-01 8.348900e-05 4.174450e-05
[96,] 9.999861e-01 2.779124e-05 1.389562e-05
[97,] 9.999939e-01 1.212819e-05 6.064097e-06
[98,] 9.999972e-01 5.625343e-06 2.812671e-06
[99,] 9.999988e-01 2.407850e-06 1.203925e-06
[100,] 9.999995e-01 9.511950e-07 4.755975e-07
[101,] 9.999994e-01 1.103731e-06 5.518653e-07
[102,] 9.999993e-01 1.350510e-06 6.752550e-07
[103,] 9.999994e-01 1.272647e-06 6.363234e-07
[104,] 9.999987e-01 2.500949e-06 1.250475e-06
[105,] 9.999979e-01 4.285063e-06 2.142531e-06
[106,] 9.999953e-01 9.368317e-06 4.684159e-06
[107,] 9.999892e-01 2.157978e-05 1.078989e-05
[108,] 9.999754e-01 4.922071e-05 2.461036e-05
[109,] 9.999685e-01 6.305260e-05 3.152630e-05
[110,] 9.999676e-01 6.483771e-05 3.241886e-05
[111,] 9.999531e-01 9.375325e-05 4.687662e-05
[112,] 9.999272e-01 1.455311e-04 7.276553e-05
[113,] 9.999896e-01 2.076038e-05 1.038019e-05
[114,] 9.999915e-01 1.693525e-05 8.467624e-06
[115,] 9.999806e-01 3.885756e-05 1.942878e-05
[116,] 9.999495e-01 1.010258e-04 5.051289e-05
[117,] 9.998919e-01 2.161292e-04 1.080646e-04
[118,] 9.997291e-01 5.418080e-04 2.709040e-04
[119,] 9.992771e-01 1.445852e-03 7.229259e-04
[120,] 9.977779e-01 4.444283e-03 2.222142e-03
[121,] 9.976887e-01 4.622632e-03 2.311316e-03
[122,] 9.867607e-01 2.647858e-02 1.323929e-02
> postscript(file="/var/www/html/rcomp/tmp/1kabz1229790821.ps",horizontal=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/2bta81229790821.ps",horizontal=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/3s9mz1229790821.ps",horizontal=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/4m6621229790821.ps",horizontal=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/5m3l11229790821.ps",horizontal=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 = 155
Frequency = 1
1 2 3 4 5 6 7
48.547842 38.547842 30.470919 28.470919 20.470919 11.470919 13.163227
8 9 10 11 12 13 14
17.009381 14.240150 22.304845 28.304845 28.137396 21.341743 21.341743
15 16 17 18 19 20 21
21.264820 20.264820 17.264820 22.264820 16.957127 18.803281 20.034050
22 23 24 25 26 27 28
25.098745 27.098745 28.931296 18.135643 18.135643 16.058720 10.058720
29 30 31 32 33 34 35
7.058720 1.058720 -2.248973 10.597181 4.827951 1.892645 0.892645
36 37 38 39 40 41 42
3.725197 -1.070457 -5.070457 -6.147380 -12.147380 -11.147380 -14.147380
43 44 45 46 47 48 49
-17.455072 -6.608919 -17.378149 -12.313455 -14.313455 -15.480903 -20.276557
50 51 52 53 54 55 56
-25.276557 -32.353480 -29.353480 -33.353480 -35.353480 -38.661172 -22.815018
57 58 59 60 61 62 63
-33.584249 -23.519555 -27.519555 -32.687003 -31.482657 -31.482657 -31.559580
64 65 66 67 68 69 70
-28.559580 -24.559580 -28.559580 -27.867272 -19.021118 -6.790349 9.274346
71 72 73 74 75 76 77
-5.725654 -6.893103 -7.688756 -1.688756 5.234321 4.234321 9.234321
78 79 80 81 82 83 84
11.234321 19.926628 10.772782 18.003551 -89.772782 -82.772782 -80.940231
85 86 87 88 89 90 91
-79.735884 -74.735884 -69.812807 -62.812807 -59.812807 -52.812807 -43.120499
92 93 94 95 96 97 98
-49.274346 -42.043576 -28.978882 -29.978882 -23.146330 -21.941984 -15.941984
99 100 101 102 103 104 105
-10.018907 -13.018907 -9.018907 -2.018907 -3.326599 -3.480445 7.750324
106 107 108 109 110 111 112
31.815018 31.815018 31.647570 21.851916 26.851916 33.774993 30.774993
113 114 115 116 117 118 119
35.774993 38.774993 38.467301 29.313455 37.544224 47.608919 47.608919
120 121 122 123 124 125 126
48.441470 38.645817 42.645817 44.568894 46.568894 56.568894 57.568894
127 128 129 130 131 132 133
52.261201 41.107355 44.338124 38.402819 33.402819 23.235370 21.439717
134 135 136 137 138 139 140
16.439717 11.362794 13.362794 9.362794 -1.637206 2.055101 -5.098745
141 142 143 144 145 146 147
-18.867976 -7.803281 -7.803281 -4.970729 -7.766383 -9.766383 -12.843306
148 149 150 151 152 153 154
-7.843306 -17.843306 -7.843306 -10.150998 -21.304845 -28.074075 -14.009381
155
-1.009381
> postscript(file="/var/www/html/rcomp/tmp/6rxxb1229790821.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 155
Frequency = 1
lag(myerror, k = 1) myerror
0 48.547842 NA
1 38.547842 48.547842
2 30.470919 38.547842
3 28.470919 30.470919
4 20.470919 28.470919
5 11.470919 20.470919
6 13.163227 11.470919
7 17.009381 13.163227
8 14.240150 17.009381
9 22.304845 14.240150
10 28.304845 22.304845
11 28.137396 28.304845
12 21.341743 28.137396
13 21.341743 21.341743
14 21.264820 21.341743
15 20.264820 21.264820
16 17.264820 20.264820
17 22.264820 17.264820
18 16.957127 22.264820
19 18.803281 16.957127
20 20.034050 18.803281
21 25.098745 20.034050
22 27.098745 25.098745
23 28.931296 27.098745
24 18.135643 28.931296
25 18.135643 18.135643
26 16.058720 18.135643
27 10.058720 16.058720
28 7.058720 10.058720
29 1.058720 7.058720
30 -2.248973 1.058720
31 10.597181 -2.248973
32 4.827951 10.597181
33 1.892645 4.827951
34 0.892645 1.892645
35 3.725197 0.892645
36 -1.070457 3.725197
37 -5.070457 -1.070457
38 -6.147380 -5.070457
39 -12.147380 -6.147380
40 -11.147380 -12.147380
41 -14.147380 -11.147380
42 -17.455072 -14.147380
43 -6.608919 -17.455072
44 -17.378149 -6.608919
45 -12.313455 -17.378149
46 -14.313455 -12.313455
47 -15.480903 -14.313455
48 -20.276557 -15.480903
49 -25.276557 -20.276557
50 -32.353480 -25.276557
51 -29.353480 -32.353480
52 -33.353480 -29.353480
53 -35.353480 -33.353480
54 -38.661172 -35.353480
55 -22.815018 -38.661172
56 -33.584249 -22.815018
57 -23.519555 -33.584249
58 -27.519555 -23.519555
59 -32.687003 -27.519555
60 -31.482657 -32.687003
61 -31.482657 -31.482657
62 -31.559580 -31.482657
63 -28.559580 -31.559580
64 -24.559580 -28.559580
65 -28.559580 -24.559580
66 -27.867272 -28.559580
67 -19.021118 -27.867272
68 -6.790349 -19.021118
69 9.274346 -6.790349
70 -5.725654 9.274346
71 -6.893103 -5.725654
72 -7.688756 -6.893103
73 -1.688756 -7.688756
74 5.234321 -1.688756
75 4.234321 5.234321
76 9.234321 4.234321
77 11.234321 9.234321
78 19.926628 11.234321
79 10.772782 19.926628
80 18.003551 10.772782
81 -89.772782 18.003551
82 -82.772782 -89.772782
83 -80.940231 -82.772782
84 -79.735884 -80.940231
85 -74.735884 -79.735884
86 -69.812807 -74.735884
87 -62.812807 -69.812807
88 -59.812807 -62.812807
89 -52.812807 -59.812807
90 -43.120499 -52.812807
91 -49.274346 -43.120499
92 -42.043576 -49.274346
93 -28.978882 -42.043576
94 -29.978882 -28.978882
95 -23.146330 -29.978882
96 -21.941984 -23.146330
97 -15.941984 -21.941984
98 -10.018907 -15.941984
99 -13.018907 -10.018907
100 -9.018907 -13.018907
101 -2.018907 -9.018907
102 -3.326599 -2.018907
103 -3.480445 -3.326599
104 7.750324 -3.480445
105 31.815018 7.750324
106 31.815018 31.815018
107 31.647570 31.815018
108 21.851916 31.647570
109 26.851916 21.851916
110 33.774993 26.851916
111 30.774993 33.774993
112 35.774993 30.774993
113 38.774993 35.774993
114 38.467301 38.774993
115 29.313455 38.467301
116 37.544224 29.313455
117 47.608919 37.544224
118 47.608919 47.608919
119 48.441470 47.608919
120 38.645817 48.441470
121 42.645817 38.645817
122 44.568894 42.645817
123 46.568894 44.568894
124 56.568894 46.568894
125 57.568894 56.568894
126 52.261201 57.568894
127 41.107355 52.261201
128 44.338124 41.107355
129 38.402819 44.338124
130 33.402819 38.402819
131 23.235370 33.402819
132 21.439717 23.235370
133 16.439717 21.439717
134 11.362794 16.439717
135 13.362794 11.362794
136 9.362794 13.362794
137 -1.637206 9.362794
138 2.055101 -1.637206
139 -5.098745 2.055101
140 -18.867976 -5.098745
141 -7.803281 -18.867976
142 -7.803281 -7.803281
143 -4.970729 -7.803281
144 -7.766383 -4.970729
145 -9.766383 -7.766383
146 -12.843306 -9.766383
147 -7.843306 -12.843306
148 -17.843306 -7.843306
149 -7.843306 -17.843306
150 -10.150998 -7.843306
151 -21.304845 -10.150998
152 -28.074075 -21.304845
153 -14.009381 -28.074075
154 -1.009381 -14.009381
155 NA -1.009381
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 38.547842 48.547842
[2,] 30.470919 38.547842
[3,] 28.470919 30.470919
[4,] 20.470919 28.470919
[5,] 11.470919 20.470919
[6,] 13.163227 11.470919
[7,] 17.009381 13.163227
[8,] 14.240150 17.009381
[9,] 22.304845 14.240150
[10,] 28.304845 22.304845
[11,] 28.137396 28.304845
[12,] 21.341743 28.137396
[13,] 21.341743 21.341743
[14,] 21.264820 21.341743
[15,] 20.264820 21.264820
[16,] 17.264820 20.264820
[17,] 22.264820 17.264820
[18,] 16.957127 22.264820
[19,] 18.803281 16.957127
[20,] 20.034050 18.803281
[21,] 25.098745 20.034050
[22,] 27.098745 25.098745
[23,] 28.931296 27.098745
[24,] 18.135643 28.931296
[25,] 18.135643 18.135643
[26,] 16.058720 18.135643
[27,] 10.058720 16.058720
[28,] 7.058720 10.058720
[29,] 1.058720 7.058720
[30,] -2.248973 1.058720
[31,] 10.597181 -2.248973
[32,] 4.827951 10.597181
[33,] 1.892645 4.827951
[34,] 0.892645 1.892645
[35,] 3.725197 0.892645
[36,] -1.070457 3.725197
[37,] -5.070457 -1.070457
[38,] -6.147380 -5.070457
[39,] -12.147380 -6.147380
[40,] -11.147380 -12.147380
[41,] -14.147380 -11.147380
[42,] -17.455072 -14.147380
[43,] -6.608919 -17.455072
[44,] -17.378149 -6.608919
[45,] -12.313455 -17.378149
[46,] -14.313455 -12.313455
[47,] -15.480903 -14.313455
[48,] -20.276557 -15.480903
[49,] -25.276557 -20.276557
[50,] -32.353480 -25.276557
[51,] -29.353480 -32.353480
[52,] -33.353480 -29.353480
[53,] -35.353480 -33.353480
[54,] -38.661172 -35.353480
[55,] -22.815018 -38.661172
[56,] -33.584249 -22.815018
[57,] -23.519555 -33.584249
[58,] -27.519555 -23.519555
[59,] -32.687003 -27.519555
[60,] -31.482657 -32.687003
[61,] -31.482657 -31.482657
[62,] -31.559580 -31.482657
[63,] -28.559580 -31.559580
[64,] -24.559580 -28.559580
[65,] -28.559580 -24.559580
[66,] -27.867272 -28.559580
[67,] -19.021118 -27.867272
[68,] -6.790349 -19.021118
[69,] 9.274346 -6.790349
[70,] -5.725654 9.274346
[71,] -6.893103 -5.725654
[72,] -7.688756 -6.893103
[73,] -1.688756 -7.688756
[74,] 5.234321 -1.688756
[75,] 4.234321 5.234321
[76,] 9.234321 4.234321
[77,] 11.234321 9.234321
[78,] 19.926628 11.234321
[79,] 10.772782 19.926628
[80,] 18.003551 10.772782
[81,] -89.772782 18.003551
[82,] -82.772782 -89.772782
[83,] -80.940231 -82.772782
[84,] -79.735884 -80.940231
[85,] -74.735884 -79.735884
[86,] -69.812807 -74.735884
[87,] -62.812807 -69.812807
[88,] -59.812807 -62.812807
[89,] -52.812807 -59.812807
[90,] -43.120499 -52.812807
[91,] -49.274346 -43.120499
[92,] -42.043576 -49.274346
[93,] -28.978882 -42.043576
[94,] -29.978882 -28.978882
[95,] -23.146330 -29.978882
[96,] -21.941984 -23.146330
[97,] -15.941984 -21.941984
[98,] -10.018907 -15.941984
[99,] -13.018907 -10.018907
[100,] -9.018907 -13.018907
[101,] -2.018907 -9.018907
[102,] -3.326599 -2.018907
[103,] -3.480445 -3.326599
[104,] 7.750324 -3.480445
[105,] 31.815018 7.750324
[106,] 31.815018 31.815018
[107,] 31.647570 31.815018
[108,] 21.851916 31.647570
[109,] 26.851916 21.851916
[110,] 33.774993 26.851916
[111,] 30.774993 33.774993
[112,] 35.774993 30.774993
[113,] 38.774993 35.774993
[114,] 38.467301 38.774993
[115,] 29.313455 38.467301
[116,] 37.544224 29.313455
[117,] 47.608919 37.544224
[118,] 47.608919 47.608919
[119,] 48.441470 47.608919
[120,] 38.645817 48.441470
[121,] 42.645817 38.645817
[122,] 44.568894 42.645817
[123,] 46.568894 44.568894
[124,] 56.568894 46.568894
[125,] 57.568894 56.568894
[126,] 52.261201 57.568894
[127,] 41.107355 52.261201
[128,] 44.338124 41.107355
[129,] 38.402819 44.338124
[130,] 33.402819 38.402819
[131,] 23.235370 33.402819
[132,] 21.439717 23.235370
[133,] 16.439717 21.439717
[134,] 11.362794 16.439717
[135,] 13.362794 11.362794
[136,] 9.362794 13.362794
[137,] -1.637206 9.362794
[138,] 2.055101 -1.637206
[139,] -5.098745 2.055101
[140,] -18.867976 -5.098745
[141,] -7.803281 -18.867976
[142,] -7.803281 -7.803281
[143,] -4.970729 -7.803281
[144,] -7.766383 -4.970729
[145,] -9.766383 -7.766383
[146,] -12.843306 -9.766383
[147,] -7.843306 -12.843306
[148,] -17.843306 -7.843306
[149,] -7.843306 -17.843306
[150,] -10.150998 -7.843306
[151,] -21.304845 -10.150998
[152,] -28.074075 -21.304845
[153,] -14.009381 -28.074075
[154,] -1.009381 -14.009381
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 38.547842 48.547842
2 30.470919 38.547842
3 28.470919 30.470919
4 20.470919 28.470919
5 11.470919 20.470919
6 13.163227 11.470919
7 17.009381 13.163227
8 14.240150 17.009381
9 22.304845 14.240150
10 28.304845 22.304845
11 28.137396 28.304845
12 21.341743 28.137396
13 21.341743 21.341743
14 21.264820 21.341743
15 20.264820 21.264820
16 17.264820 20.264820
17 22.264820 17.264820
18 16.957127 22.264820
19 18.803281 16.957127
20 20.034050 18.803281
21 25.098745 20.034050
22 27.098745 25.098745
23 28.931296 27.098745
24 18.135643 28.931296
25 18.135643 18.135643
26 16.058720 18.135643
27 10.058720 16.058720
28 7.058720 10.058720
29 1.058720 7.058720
30 -2.248973 1.058720
31 10.597181 -2.248973
32 4.827951 10.597181
33 1.892645 4.827951
34 0.892645 1.892645
35 3.725197 0.892645
36 -1.070457 3.725197
37 -5.070457 -1.070457
38 -6.147380 -5.070457
39 -12.147380 -6.147380
40 -11.147380 -12.147380
41 -14.147380 -11.147380
42 -17.455072 -14.147380
43 -6.608919 -17.455072
44 -17.378149 -6.608919
45 -12.313455 -17.378149
46 -14.313455 -12.313455
47 -15.480903 -14.313455
48 -20.276557 -15.480903
49 -25.276557 -20.276557
50 -32.353480 -25.276557
51 -29.353480 -32.353480
52 -33.353480 -29.353480
53 -35.353480 -33.353480
54 -38.661172 -35.353480
55 -22.815018 -38.661172
56 -33.584249 -22.815018
57 -23.519555 -33.584249
58 -27.519555 -23.519555
59 -32.687003 -27.519555
60 -31.482657 -32.687003
61 -31.482657 -31.482657
62 -31.559580 -31.482657
63 -28.559580 -31.559580
64 -24.559580 -28.559580
65 -28.559580 -24.559580
66 -27.867272 -28.559580
67 -19.021118 -27.867272
68 -6.790349 -19.021118
69 9.274346 -6.790349
70 -5.725654 9.274346
71 -6.893103 -5.725654
72 -7.688756 -6.893103
73 -1.688756 -7.688756
74 5.234321 -1.688756
75 4.234321 5.234321
76 9.234321 4.234321
77 11.234321 9.234321
78 19.926628 11.234321
79 10.772782 19.926628
80 18.003551 10.772782
81 -89.772782 18.003551
82 -82.772782 -89.772782
83 -80.940231 -82.772782
84 -79.735884 -80.940231
85 -74.735884 -79.735884
86 -69.812807 -74.735884
87 -62.812807 -69.812807
88 -59.812807 -62.812807
89 -52.812807 -59.812807
90 -43.120499 -52.812807
91 -49.274346 -43.120499
92 -42.043576 -49.274346
93 -28.978882 -42.043576
94 -29.978882 -28.978882
95 -23.146330 -29.978882
96 -21.941984 -23.146330
97 -15.941984 -21.941984
98 -10.018907 -15.941984
99 -13.018907 -10.018907
100 -9.018907 -13.018907
101 -2.018907 -9.018907
102 -3.326599 -2.018907
103 -3.480445 -3.326599
104 7.750324 -3.480445
105 31.815018 7.750324
106 31.815018 31.815018
107 31.647570 31.815018
108 21.851916 31.647570
109 26.851916 21.851916
110 33.774993 26.851916
111 30.774993 33.774993
112 35.774993 30.774993
113 38.774993 35.774993
114 38.467301 38.774993
115 29.313455 38.467301
116 37.544224 29.313455
117 47.608919 37.544224
118 47.608919 47.608919
119 48.441470 47.608919
120 38.645817 48.441470
121 42.645817 38.645817
122 44.568894 42.645817
123 46.568894 44.568894
124 56.568894 46.568894
125 57.568894 56.568894
126 52.261201 57.568894
127 41.107355 52.261201
128 44.338124 41.107355
129 38.402819 44.338124
130 33.402819 38.402819
131 23.235370 33.402819
132 21.439717 23.235370
133 16.439717 21.439717
134 11.362794 16.439717
135 13.362794 11.362794
136 9.362794 13.362794
137 -1.637206 9.362794
138 2.055101 -1.637206
139 -5.098745 2.055101
140 -18.867976 -5.098745
141 -7.803281 -18.867976
142 -7.803281 -7.803281
143 -4.970729 -7.803281
144 -7.766383 -4.970729
145 -9.766383 -7.766383
146 -12.843306 -9.766383
147 -7.843306 -12.843306
148 -17.843306 -7.843306
149 -7.843306 -17.843306
150 -10.150998 -7.843306
151 -21.304845 -10.150998
152 -28.074075 -21.304845
153 -14.009381 -28.074075
154 -1.009381 -14.009381
> 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/7etqw1229790821.ps",horizontal=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/87hu31229790821.ps",horizontal=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/96r8p1229790821.ps",horizontal=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/10s6kg1229790821.ps",horizontal=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/11xsi41229790821.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/128ozz1229790821.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/13ymjk1229790821.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/149d691229790822.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/15a4fr1229790822.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/16ktbw1229790822.tab")
+ }
>
> system("convert tmp/1kabz1229790821.ps tmp/1kabz1229790821.png")
> system("convert tmp/2bta81229790821.ps tmp/2bta81229790821.png")
> system("convert tmp/3s9mz1229790821.ps tmp/3s9mz1229790821.png")
> system("convert tmp/4m6621229790821.ps tmp/4m6621229790821.png")
> system("convert tmp/5m3l11229790821.ps tmp/5m3l11229790821.png")
> system("convert tmp/6rxxb1229790821.ps tmp/6rxxb1229790821.png")
> system("convert tmp/7etqw1229790821.ps tmp/7etqw1229790821.png")
> system("convert tmp/87hu31229790821.ps tmp/87hu31229790821.png")
> system("convert tmp/96r8p1229790821.ps tmp/96r8p1229790821.png")
> system("convert tmp/10s6kg1229790821.ps tmp/10s6kg1229790821.png")
>
>
> proc.time()
user system elapsed
3.702 1.989 5.202