R version 2.6.2 (2008-02-08)
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(112,118,132,129,121,135,148,148,136,119,104,118,115,126,141,135,125,149,170,170,158,133,114,140,145,150,178,163,172,178,199,199,184,162,146,166,171,180,193,181,183,218,230,242,209,191,172,194,196,196,236,235,229,243,264,272,237,211,180,201,204,188,235,227,234,264,302,293,259,229,203,229,242,233,267,269,270,315,364,347,312,274,237,278,284,277,317,313,318,374,413,405,355,306,271,306,315,301,356,348,355,422,465,467,404,347,305,336,340,318,362,348,363,435,491,505,404,359,310,337,360,342,406,396,420,472,548,559,463,407,362,405,417,391,419,461,472,535,622,606,508,461,390,432),dim=c(1,144),dimnames=list(c('Sales'),1:144))
> y <- array(NA,dim=c(1,144),dimnames=list(c('Sales'),1:144))
> 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
> 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
Sales M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 112 1 0 0 0 0 0 0 0 0 0 0 1
2 118 0 1 0 0 0 0 0 0 0 0 0 2
3 132 0 0 1 0 0 0 0 0 0 0 0 3
4 129 0 0 0 1 0 0 0 0 0 0 0 4
5 121 0 0 0 0 1 0 0 0 0 0 0 5
6 135 0 0 0 0 0 1 0 0 0 0 0 6
7 148 0 0 0 0 0 0 1 0 0 0 0 7
8 148 0 0 0 0 0 0 0 1 0 0 0 8
9 136 0 0 0 0 0 0 0 0 1 0 0 9
10 119 0 0 0 0 0 0 0 0 0 1 0 10
11 104 0 0 0 0 0 0 0 0 0 0 1 11
12 118 0 0 0 0 0 0 0 0 0 0 0 12
13 115 1 0 0 0 0 0 0 0 0 0 0 13
14 126 0 1 0 0 0 0 0 0 0 0 0 14
15 141 0 0 1 0 0 0 0 0 0 0 0 15
16 135 0 0 0 1 0 0 0 0 0 0 0 16
17 125 0 0 0 0 1 0 0 0 0 0 0 17
18 149 0 0 0 0 0 1 0 0 0 0 0 18
19 170 0 0 0 0 0 0 1 0 0 0 0 19
20 170 0 0 0 0 0 0 0 1 0 0 0 20
21 158 0 0 0 0 0 0 0 0 1 0 0 21
22 133 0 0 0 0 0 0 0 0 0 1 0 22
23 114 0 0 0 0 0 0 0 0 0 0 1 23
24 140 0 0 0 0 0 0 0 0 0 0 0 24
25 145 1 0 0 0 0 0 0 0 0 0 0 25
26 150 0 1 0 0 0 0 0 0 0 0 0 26
27 178 0 0 1 0 0 0 0 0 0 0 0 27
28 163 0 0 0 1 0 0 0 0 0 0 0 28
29 172 0 0 0 0 1 0 0 0 0 0 0 29
30 178 0 0 0 0 0 1 0 0 0 0 0 30
31 199 0 0 0 0 0 0 1 0 0 0 0 31
32 199 0 0 0 0 0 0 0 1 0 0 0 32
33 184 0 0 0 0 0 0 0 0 1 0 0 33
34 162 0 0 0 0 0 0 0 0 0 1 0 34
35 146 0 0 0 0 0 0 0 0 0 0 1 35
36 166 0 0 0 0 0 0 0 0 0 0 0 36
37 171 1 0 0 0 0 0 0 0 0 0 0 37
38 180 0 1 0 0 0 0 0 0 0 0 0 38
39 193 0 0 1 0 0 0 0 0 0 0 0 39
40 181 0 0 0 1 0 0 0 0 0 0 0 40
41 183 0 0 0 0 1 0 0 0 0 0 0 41
42 218 0 0 0 0 0 1 0 0 0 0 0 42
43 230 0 0 0 0 0 0 1 0 0 0 0 43
44 242 0 0 0 0 0 0 0 1 0 0 0 44
45 209 0 0 0 0 0 0 0 0 1 0 0 45
46 191 0 0 0 0 0 0 0 0 0 1 0 46
47 172 0 0 0 0 0 0 0 0 0 0 1 47
48 194 0 0 0 0 0 0 0 0 0 0 0 48
49 196 1 0 0 0 0 0 0 0 0 0 0 49
50 196 0 1 0 0 0 0 0 0 0 0 0 50
51 236 0 0 1 0 0 0 0 0 0 0 0 51
52 235 0 0 0 1 0 0 0 0 0 0 0 52
53 229 0 0 0 0 1 0 0 0 0 0 0 53
54 243 0 0 0 0 0 1 0 0 0 0 0 54
55 264 0 0 0 0 0 0 1 0 0 0 0 55
56 272 0 0 0 0 0 0 0 1 0 0 0 56
57 237 0 0 0 0 0 0 0 0 1 0 0 57
58 211 0 0 0 0 0 0 0 0 0 1 0 58
59 180 0 0 0 0 0 0 0 0 0 0 1 59
60 201 0 0 0 0 0 0 0 0 0 0 0 60
61 204 1 0 0 0 0 0 0 0 0 0 0 61
62 188 0 1 0 0 0 0 0 0 0 0 0 62
63 235 0 0 1 0 0 0 0 0 0 0 0 63
64 227 0 0 0 1 0 0 0 0 0 0 0 64
65 234 0 0 0 0 1 0 0 0 0 0 0 65
66 264 0 0 0 0 0 1 0 0 0 0 0 66
67 302 0 0 0 0 0 0 1 0 0 0 0 67
68 293 0 0 0 0 0 0 0 1 0 0 0 68
69 259 0 0 0 0 0 0 0 0 1 0 0 69
70 229 0 0 0 0 0 0 0 0 0 1 0 70
71 203 0 0 0 0 0 0 0 0 0 0 1 71
72 229 0 0 0 0 0 0 0 0 0 0 0 72
73 242 1 0 0 0 0 0 0 0 0 0 0 73
74 233 0 1 0 0 0 0 0 0 0 0 0 74
75 267 0 0 1 0 0 0 0 0 0 0 0 75
76 269 0 0 0 1 0 0 0 0 0 0 0 76
77 270 0 0 0 0 1 0 0 0 0 0 0 77
78 315 0 0 0 0 0 1 0 0 0 0 0 78
79 364 0 0 0 0 0 0 1 0 0 0 0 79
80 347 0 0 0 0 0 0 0 1 0 0 0 80
81 312 0 0 0 0 0 0 0 0 1 0 0 81
82 274 0 0 0 0 0 0 0 0 0 1 0 82
83 237 0 0 0 0 0 0 0 0 0 0 1 83
84 278 0 0 0 0 0 0 0 0 0 0 0 84
85 284 1 0 0 0 0 0 0 0 0 0 0 85
86 277 0 1 0 0 0 0 0 0 0 0 0 86
87 317 0 0 1 0 0 0 0 0 0 0 0 87
88 313 0 0 0 1 0 0 0 0 0 0 0 88
89 318 0 0 0 0 1 0 0 0 0 0 0 89
90 374 0 0 0 0 0 1 0 0 0 0 0 90
91 413 0 0 0 0 0 0 1 0 0 0 0 91
92 405 0 0 0 0 0 0 0 1 0 0 0 92
93 355 0 0 0 0 0 0 0 0 1 0 0 93
94 306 0 0 0 0 0 0 0 0 0 1 0 94
95 271 0 0 0 0 0 0 0 0 0 0 1 95
96 306 0 0 0 0 0 0 0 0 0 0 0 96
97 315 1 0 0 0 0 0 0 0 0 0 0 97
98 301 0 1 0 0 0 0 0 0 0 0 0 98
99 356 0 0 1 0 0 0 0 0 0 0 0 99
100 348 0 0 0 1 0 0 0 0 0 0 0 100
101 355 0 0 0 0 1 0 0 0 0 0 0 101
102 422 0 0 0 0 0 1 0 0 0 0 0 102
103 465 0 0 0 0 0 0 1 0 0 0 0 103
104 467 0 0 0 0 0 0 0 1 0 0 0 104
105 404 0 0 0 0 0 0 0 0 1 0 0 105
106 347 0 0 0 0 0 0 0 0 0 1 0 106
107 305 0 0 0 0 0 0 0 0 0 0 1 107
108 336 0 0 0 0 0 0 0 0 0 0 0 108
109 340 1 0 0 0 0 0 0 0 0 0 0 109
110 318 0 1 0 0 0 0 0 0 0 0 0 110
111 362 0 0 1 0 0 0 0 0 0 0 0 111
112 348 0 0 0 1 0 0 0 0 0 0 0 112
113 363 0 0 0 0 1 0 0 0 0 0 0 113
114 435 0 0 0 0 0 1 0 0 0 0 0 114
115 491 0 0 0 0 0 0 1 0 0 0 0 115
116 505 0 0 0 0 0 0 0 1 0 0 0 116
117 404 0 0 0 0 0 0 0 0 1 0 0 117
118 359 0 0 0 0 0 0 0 0 0 1 0 118
119 310 0 0 0 0 0 0 0 0 0 0 1 119
120 337 0 0 0 0 0 0 0 0 0 0 0 120
121 360 1 0 0 0 0 0 0 0 0 0 0 121
122 342 0 1 0 0 0 0 0 0 0 0 0 122
123 406 0 0 1 0 0 0 0 0 0 0 0 123
124 396 0 0 0 1 0 0 0 0 0 0 0 124
125 420 0 0 0 0 1 0 0 0 0 0 0 125
126 472 0 0 0 0 0 1 0 0 0 0 0 126
127 548 0 0 0 0 0 0 1 0 0 0 0 127
128 559 0 0 0 0 0 0 0 1 0 0 0 128
129 463 0 0 0 0 0 0 0 0 1 0 0 129
130 407 0 0 0 0 0 0 0 0 0 1 0 130
131 362 0 0 0 0 0 0 0 0 0 0 1 131
132 405 0 0 0 0 0 0 0 0 0 0 0 132
133 417 1 0 0 0 0 0 0 0 0 0 0 133
134 391 0 1 0 0 0 0 0 0 0 0 0 134
135 419 0 0 1 0 0 0 0 0 0 0 0 135
136 461 0 0 0 1 0 0 0 0 0 0 0 136
137 472 0 0 0 0 1 0 0 0 0 0 0 137
138 535 0 0 0 0 0 1 0 0 0 0 0 138
139 622 0 0 0 0 0 0 1 0 0 0 0 139
140 606 0 0 0 0 0 0 0 1 0 0 0 140
141 508 0 0 0 0 0 0 0 0 1 0 0 141
142 461 0 0 0 0 0 0 0 0 0 1 0 142
143 390 0 0 0 0 0 0 0 0 0 0 1 143
144 432 0 0 0 0 0 0 0 0 0 0 0 144
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
54.3277 9.1803 -0.2300 32.2763 26.5326 28.6223
M6 M7 M8 M9 M10 M11
65.7953 102.8016 99.8913 48.5643 10.0707 -26.3397
t
2.6603
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-42.121 -18.564 -3.268 15.189 95.085
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 54.32765 8.65118 6.280 4.61e-09 ***
M1 9.18029 10.76506 0.853 0.39533
M2 -0.23004 10.76232 -0.021 0.98298
M3 32.27630 10.75985 3.000 0.00324 **
M4 26.53263 10.75763 2.466 0.01494 *
M5 28.62230 10.75567 2.661 0.00876 **
M6 65.79531 10.75398 6.118 1.02e-08 ***
M7 102.80165 10.75254 9.561 < 2e-16 ***
M8 99.89132 10.75137 9.291 4.35e-16 ***
M9 48.56432 10.75046 4.517 1.38e-05 ***
M10 10.07066 10.74980 0.937 0.35057
M11 -26.33967 10.74941 -2.450 0.01559 *
t 2.66033 0.05297 50.225 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 26.33 on 131 degrees of freedom
Multiple R-squared: 0.9559, Adjusted R-squared: 0.9518
F-statistic: 236.5 on 12 and 131 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,] 6.234245e-04 1.246849e-03 0.9993765755
[2,] 5.924749e-05 1.184950e-04 0.9999407525
[3,] 5.919907e-05 1.183981e-04 0.9999408009
[4,] 2.140910e-04 4.281820e-04 0.9997859090
[5,] 1.604284e-04 3.208568e-04 0.9998395716
[6,] 7.883280e-05 1.576656e-04 0.9999211672
[7,] 1.737756e-05 3.475511e-05 0.9999826224
[8,] 4.074070e-06 8.148140e-06 0.9999959259
[9,] 2.006952e-06 4.013904e-06 0.9999979930
[10,] 1.617353e-06 3.234705e-06 0.9999983826
[11,] 6.200034e-07 1.240007e-06 0.9999993800
[12,] 2.210297e-06 4.420594e-06 0.9999977897
[13,] 7.571013e-07 1.514203e-06 0.9999992429
[14,] 4.126245e-06 8.252490e-06 0.9999958738
[15,] 1.652637e-06 3.305274e-06 0.9999983474
[16,] 1.047965e-06 2.095929e-06 0.9999989520
[17,] 6.277099e-07 1.255420e-06 0.9999993723
[18,] 2.290285e-07 4.580570e-07 0.9999997710
[19,] 8.363025e-08 1.672605e-07 0.9999999164
[20,] 4.268415e-08 8.536830e-08 0.9999999573
[21,] 1.872417e-08 3.744835e-08 0.9999999813
[22,] 7.446484e-09 1.489297e-08 0.9999999926
[23,] 5.134779e-09 1.026956e-08 0.9999999949
[24,] 1.853372e-09 3.706744e-09 0.9999999981
[25,] 7.179492e-10 1.435898e-09 0.9999999993
[26,] 2.131181e-10 4.262361e-10 0.9999999998
[27,] 9.839821e-10 1.967964e-09 0.9999999990
[28,] 1.277470e-09 2.554940e-09 0.9999999987
[29,] 1.010972e-08 2.021943e-08 0.9999999899
[30,] 3.615320e-09 7.230641e-09 0.9999999964
[31,] 1.747275e-09 3.494551e-09 0.9999999983
[32,] 1.371516e-09 2.743032e-09 0.9999999986
[33,] 9.180526e-10 1.836105e-09 0.9999999991
[34,] 4.564684e-10 9.129368e-10 0.9999999995
[35,] 5.571721e-10 1.114344e-09 0.9999999994
[36,] 1.628537e-09 3.257074e-09 0.9999999984
[37,] 1.632918e-08 3.265837e-08 0.9999999837
[38,] 3.316565e-08 6.633130e-08 0.9999999668
[39,] 2.117976e-08 4.235952e-08 0.9999999788
[40,] 4.643470e-08 9.286940e-08 0.9999999536
[41,] 1.192692e-07 2.385383e-07 0.9999998807
[42,] 5.272958e-08 1.054592e-07 0.9999999473
[43,] 3.099196e-08 6.198392e-08 0.9999999690
[44,] 9.051243e-08 1.810249e-07 0.9999999095
[45,] 1.467040e-07 2.934080e-07 0.9999998533
[46,] 2.601924e-07 5.203848e-07 0.9999997398
[47,] 1.025621e-05 2.051243e-05 0.9999897438
[48,] 8.843433e-06 1.768687e-05 0.9999911566
[49,] 6.979975e-06 1.395995e-05 0.9999930200
[50,] 3.755201e-06 7.510403e-06 0.9999962448
[51,] 3.587943e-06 7.175886e-06 0.9999964121
[52,] 3.985059e-05 7.970119e-05 0.9999601494
[53,] 2.539908e-04 5.079816e-04 0.9997460092
[54,] 2.038506e-04 4.077013e-04 0.9997961494
[55,] 1.350603e-04 2.701207e-04 0.9998649397
[56,] 1.297941e-04 2.595883e-04 0.9998702059
[57,] 8.683704e-05 1.736741e-04 0.9999131630
[58,] 5.278693e-05 1.055739e-04 0.9999472131
[59,] 4.604407e-05 9.208815e-05 0.9999539559
[60,] 2.718665e-05 5.437330e-05 0.9999728133
[61,] 1.718800e-05 3.437600e-05 0.9999828120
[62,] 1.120695e-05 2.241390e-05 0.9999887931
[63,] 5.921784e-05 1.184357e-04 0.9999407822
[64,] 4.960880e-03 9.921760e-03 0.9950391201
[65,] 4.635303e-02 9.270606e-02 0.9536469692
[66,] 5.232616e-02 1.046523e-01 0.9476738412
[67,] 4.185219e-02 8.370439e-02 0.9581478073
[68,] 3.566268e-02 7.132536e-02 0.9643373224
[69,] 3.651170e-02 7.302339e-02 0.9634883025
[70,] 3.272817e-02 6.545633e-02 0.9672718342
[71,] 3.803673e-02 7.607347e-02 0.9619632669
[72,] 4.230882e-02 8.461763e-02 0.9576911830
[73,] 4.306292e-02 8.612584e-02 0.9569370804
[74,] 4.290467e-02 8.580934e-02 0.9570953318
[75,] 1.057913e-01 2.115826e-01 0.8942086839
[76,] 3.204423e-01 6.408845e-01 0.6795577401
[77,] 5.985377e-01 8.029245e-01 0.4014622680
[78,] 5.889085e-01 8.221829e-01 0.4110914703
[79,] 5.348563e-01 9.302874e-01 0.4651437100
[80,] 5.228606e-01 9.542788e-01 0.4771394198
[81,] 5.133560e-01 9.732879e-01 0.4866439638
[82,] 4.890415e-01 9.780830e-01 0.5109584847
[83,] 5.134482e-01 9.731036e-01 0.4865518028
[84,] 6.386837e-01 7.226327e-01 0.3613163289
[85,] 6.719274e-01 6.561451e-01 0.3280725661
[86,] 6.722688e-01 6.554624e-01 0.3277311849
[87,] 8.038400e-01 3.923199e-01 0.1961599670
[88,] 8.843739e-01 2.312522e-01 0.1156261208
[89,] 9.301729e-01 1.396541e-01 0.0698270747
[90,] 9.544048e-01 9.119036e-02 0.0455951775
[91,] 9.574110e-01 8.517808e-02 0.0425890388
[92,] 9.854326e-01 2.913488e-02 0.0145674408
[93,] 9.963775e-01 7.244979e-03 0.0036224896
[94,] 9.972795e-01 5.440974e-03 0.0027204872
[95,] 9.985437e-01 2.912664e-03 0.0014563321
[96,] 9.992454e-01 1.509186e-03 0.0007545932
[97,] 9.986611e-01 2.677815e-03 0.0013389076
[98,] 9.976607e-01 4.678602e-03 0.0023393012
[99,] 9.964679e-01 7.064280e-03 0.0035321399
[100,] 9.977667e-01 4.466537e-03 0.0022332684
[101,] 9.974897e-01 5.020547e-03 0.0025102737
[102,] 9.954999e-01 9.000166e-03 0.0045000828
[103,] 9.912537e-01 1.749260e-02 0.0087462989
[104,] 9.858394e-01 2.832129e-02 0.0141606436
[105,] 9.779274e-01 4.414524e-02 0.0220726199
[106,] 9.636880e-01 7.262409e-02 0.0363120435
[107,] 9.385296e-01 1.229407e-01 0.0614703725
[108,] 9.739475e-01 5.210506e-02 0.0260525318
[109,] 9.617903e-01 7.641942e-02 0.0382097114
[110,] 9.244449e-01 1.511102e-01 0.0755550763
[111,] 8.952939e-01 2.094122e-01 0.1047060970
[112,] 9.660312e-01 6.793752e-02 0.0339687587
[113,] 9.265812e-01 1.468376e-01 0.0734188145
> postscript(file="/var/www/html/rcomp/tmp/1smxe1210164523.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/2k7gv1210164523.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/3frk41210164523.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/4f1y31210164523.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/5rp7e1210164523.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 = 144
Frequency = 1
1 2 3 4 5 6
45.8317308 58.5817308 37.4150641 37.4983974 24.7483974 -1.0849359
7 8 9 10 11 12
-27.7516026 -27.5016026 9.1650641 27.9983974 46.7483974 31.7483974
13 14 15 16 17 18
16.9077797 34.6577797 14.4911131 11.5744464 -3.1755536 -19.0088869
19 20 21 22 23 24
-37.6755536 -37.4255536 -0.7588869 10.0744464 24.8244464 21.8244464
25 26 27 28 29 30
14.9838287 26.7338287 19.5671620 7.6504953 11.9004953 -21.9328380
31 32 33 34 35 36
-40.5995047 -40.3495047 -6.6828380 7.1504953 24.9004953 15.9004953
37 38 39 40 41 42
9.0598776 24.8098776 2.6432110 -6.2734557 -9.0234557 -13.8567890
43 44 45 46 47 48
-41.5234557 -29.2734557 -13.6067890 4.2265443 18.9765443 11.9765443
49 50 51 52 53 54
2.1359266 8.8859266 13.7192599 15.8025932 5.0525932 -20.7807401
55 56 57 58 59 60
-39.4474068 -31.1974068 -17.5307401 -7.6974068 -4.9474068 -12.9474068
61 62 63 64 65 66
-21.7880245 -31.0380245 -19.2046911 -24.1213578 -21.8713578 -31.7046911
67 68 69 70 71 72
-33.3713578 -42.1213578 -27.4546911 -21.6213578 -13.8713578 -16.8713578
73 74 75 76 77 78
-15.7119755 -17.9619755 -19.1286422 -14.0453089 -17.7953089 -12.6286422
79 80 81 82 83 84
-3.2953089 -20.0453089 -6.3786422 -8.5453089 -11.7953089 0.2046911
85 86 87 88 89 90
-5.6359266 -5.8859266 -1.0525932 -1.9692599 -1.7192599 14.4474068
91 92 93 94 95 96
13.7807401 6.0307401 4.6974068 -8.4692599 -9.7192599 -3.7192599
97 98 99 100 101 102
-6.5598776 -13.8098776 6.0234557 1.1067890 3.3567890 30.5234557
103 104 105 106 107 108
33.8567890 36.1067890 21.7734557 0.6067890 -7.6432110 -5.6432110
109 110 111 112 113 114
-13.4838287 -28.7338287 -19.9004953 -30.8171620 -20.5671620 11.5995047
115 116 117 118 119 120
27.9328380 42.1828380 -10.1504953 -19.3171620 -34.5671620 -36.5671620
121 122 123 124 125 126
-25.4077797 -36.6577797 -7.8244464 -14.7411131 4.5088869 16.6755536
127 128 129 130 131 132
53.0088869 64.2588869 16.9255536 -3.2411131 -14.4911131 -0.4911131
133 134 135 136 137 138
-0.3317308 -19.5817308 -26.7483974 18.3349359 24.5849359 47.7516026
139 140 141 142 143 144
95.0849359 79.3349359 30.0016026 18.8349359 -18.4150641 -5.4150641
> postscript(file="/var/www/html/rcomp/tmp/6xddh1210164523.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 = 144
Frequency = 1
lag(myerror, k = 1) myerror
0 45.8317308 NA
1 58.5817308 45.8317308
2 37.4150641 58.5817308
3 37.4983974 37.4150641
4 24.7483974 37.4983974
5 -1.0849359 24.7483974
6 -27.7516026 -1.0849359
7 -27.5016026 -27.7516026
8 9.1650641 -27.5016026
9 27.9983974 9.1650641
10 46.7483974 27.9983974
11 31.7483974 46.7483974
12 16.9077797 31.7483974
13 34.6577797 16.9077797
14 14.4911131 34.6577797
15 11.5744464 14.4911131
16 -3.1755536 11.5744464
17 -19.0088869 -3.1755536
18 -37.6755536 -19.0088869
19 -37.4255536 -37.6755536
20 -0.7588869 -37.4255536
21 10.0744464 -0.7588869
22 24.8244464 10.0744464
23 21.8244464 24.8244464
24 14.9838287 21.8244464
25 26.7338287 14.9838287
26 19.5671620 26.7338287
27 7.6504953 19.5671620
28 11.9004953 7.6504953
29 -21.9328380 11.9004953
30 -40.5995047 -21.9328380
31 -40.3495047 -40.5995047
32 -6.6828380 -40.3495047
33 7.1504953 -6.6828380
34 24.9004953 7.1504953
35 15.9004953 24.9004953
36 9.0598776 15.9004953
37 24.8098776 9.0598776
38 2.6432110 24.8098776
39 -6.2734557 2.6432110
40 -9.0234557 -6.2734557
41 -13.8567890 -9.0234557
42 -41.5234557 -13.8567890
43 -29.2734557 -41.5234557
44 -13.6067890 -29.2734557
45 4.2265443 -13.6067890
46 18.9765443 4.2265443
47 11.9765443 18.9765443
48 2.1359266 11.9765443
49 8.8859266 2.1359266
50 13.7192599 8.8859266
51 15.8025932 13.7192599
52 5.0525932 15.8025932
53 -20.7807401 5.0525932
54 -39.4474068 -20.7807401
55 -31.1974068 -39.4474068
56 -17.5307401 -31.1974068
57 -7.6974068 -17.5307401
58 -4.9474068 -7.6974068
59 -12.9474068 -4.9474068
60 -21.7880245 -12.9474068
61 -31.0380245 -21.7880245
62 -19.2046911 -31.0380245
63 -24.1213578 -19.2046911
64 -21.8713578 -24.1213578
65 -31.7046911 -21.8713578
66 -33.3713578 -31.7046911
67 -42.1213578 -33.3713578
68 -27.4546911 -42.1213578
69 -21.6213578 -27.4546911
70 -13.8713578 -21.6213578
71 -16.8713578 -13.8713578
72 -15.7119755 -16.8713578
73 -17.9619755 -15.7119755
74 -19.1286422 -17.9619755
75 -14.0453089 -19.1286422
76 -17.7953089 -14.0453089
77 -12.6286422 -17.7953089
78 -3.2953089 -12.6286422
79 -20.0453089 -3.2953089
80 -6.3786422 -20.0453089
81 -8.5453089 -6.3786422
82 -11.7953089 -8.5453089
83 0.2046911 -11.7953089
84 -5.6359266 0.2046911
85 -5.8859266 -5.6359266
86 -1.0525932 -5.8859266
87 -1.9692599 -1.0525932
88 -1.7192599 -1.9692599
89 14.4474068 -1.7192599
90 13.7807401 14.4474068
91 6.0307401 13.7807401
92 4.6974068 6.0307401
93 -8.4692599 4.6974068
94 -9.7192599 -8.4692599
95 -3.7192599 -9.7192599
96 -6.5598776 -3.7192599
97 -13.8098776 -6.5598776
98 6.0234557 -13.8098776
99 1.1067890 6.0234557
100 3.3567890 1.1067890
101 30.5234557 3.3567890
102 33.8567890 30.5234557
103 36.1067890 33.8567890
104 21.7734557 36.1067890
105 0.6067890 21.7734557
106 -7.6432110 0.6067890
107 -5.6432110 -7.6432110
108 -13.4838287 -5.6432110
109 -28.7338287 -13.4838287
110 -19.9004953 -28.7338287
111 -30.8171620 -19.9004953
112 -20.5671620 -30.8171620
113 11.5995047 -20.5671620
114 27.9328380 11.5995047
115 42.1828380 27.9328380
116 -10.1504953 42.1828380
117 -19.3171620 -10.1504953
118 -34.5671620 -19.3171620
119 -36.5671620 -34.5671620
120 -25.4077797 -36.5671620
121 -36.6577797 -25.4077797
122 -7.8244464 -36.6577797
123 -14.7411131 -7.8244464
124 4.5088869 -14.7411131
125 16.6755536 4.5088869
126 53.0088869 16.6755536
127 64.2588869 53.0088869
128 16.9255536 64.2588869
129 -3.2411131 16.9255536
130 -14.4911131 -3.2411131
131 -0.4911131 -14.4911131
132 -0.3317308 -0.4911131
133 -19.5817308 -0.3317308
134 -26.7483974 -19.5817308
135 18.3349359 -26.7483974
136 24.5849359 18.3349359
137 47.7516026 24.5849359
138 95.0849359 47.7516026
139 79.3349359 95.0849359
140 30.0016026 79.3349359
141 18.8349359 30.0016026
142 -18.4150641 18.8349359
143 -5.4150641 -18.4150641
144 NA -5.4150641
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 58.5817308 45.8317308
[2,] 37.4150641 58.5817308
[3,] 37.4983974 37.4150641
[4,] 24.7483974 37.4983974
[5,] -1.0849359 24.7483974
[6,] -27.7516026 -1.0849359
[7,] -27.5016026 -27.7516026
[8,] 9.1650641 -27.5016026
[9,] 27.9983974 9.1650641
[10,] 46.7483974 27.9983974
[11,] 31.7483974 46.7483974
[12,] 16.9077797 31.7483974
[13,] 34.6577797 16.9077797
[14,] 14.4911131 34.6577797
[15,] 11.5744464 14.4911131
[16,] -3.1755536 11.5744464
[17,] -19.0088869 -3.1755536
[18,] -37.6755536 -19.0088869
[19,] -37.4255536 -37.6755536
[20,] -0.7588869 -37.4255536
[21,] 10.0744464 -0.7588869
[22,] 24.8244464 10.0744464
[23,] 21.8244464 24.8244464
[24,] 14.9838287 21.8244464
[25,] 26.7338287 14.9838287
[26,] 19.5671620 26.7338287
[27,] 7.6504953 19.5671620
[28,] 11.9004953 7.6504953
[29,] -21.9328380 11.9004953
[30,] -40.5995047 -21.9328380
[31,] -40.3495047 -40.5995047
[32,] -6.6828380 -40.3495047
[33,] 7.1504953 -6.6828380
[34,] 24.9004953 7.1504953
[35,] 15.9004953 24.9004953
[36,] 9.0598776 15.9004953
[37,] 24.8098776 9.0598776
[38,] 2.6432110 24.8098776
[39,] -6.2734557 2.6432110
[40,] -9.0234557 -6.2734557
[41,] -13.8567890 -9.0234557
[42,] -41.5234557 -13.8567890
[43,] -29.2734557 -41.5234557
[44,] -13.6067890 -29.2734557
[45,] 4.2265443 -13.6067890
[46,] 18.9765443 4.2265443
[47,] 11.9765443 18.9765443
[48,] 2.1359266 11.9765443
[49,] 8.8859266 2.1359266
[50,] 13.7192599 8.8859266
[51,] 15.8025932 13.7192599
[52,] 5.0525932 15.8025932
[53,] -20.7807401 5.0525932
[54,] -39.4474068 -20.7807401
[55,] -31.1974068 -39.4474068
[56,] -17.5307401 -31.1974068
[57,] -7.6974068 -17.5307401
[58,] -4.9474068 -7.6974068
[59,] -12.9474068 -4.9474068
[60,] -21.7880245 -12.9474068
[61,] -31.0380245 -21.7880245
[62,] -19.2046911 -31.0380245
[63,] -24.1213578 -19.2046911
[64,] -21.8713578 -24.1213578
[65,] -31.7046911 -21.8713578
[66,] -33.3713578 -31.7046911
[67,] -42.1213578 -33.3713578
[68,] -27.4546911 -42.1213578
[69,] -21.6213578 -27.4546911
[70,] -13.8713578 -21.6213578
[71,] -16.8713578 -13.8713578
[72,] -15.7119755 -16.8713578
[73,] -17.9619755 -15.7119755
[74,] -19.1286422 -17.9619755
[75,] -14.0453089 -19.1286422
[76,] -17.7953089 -14.0453089
[77,] -12.6286422 -17.7953089
[78,] -3.2953089 -12.6286422
[79,] -20.0453089 -3.2953089
[80,] -6.3786422 -20.0453089
[81,] -8.5453089 -6.3786422
[82,] -11.7953089 -8.5453089
[83,] 0.2046911 -11.7953089
[84,] -5.6359266 0.2046911
[85,] -5.8859266 -5.6359266
[86,] -1.0525932 -5.8859266
[87,] -1.9692599 -1.0525932
[88,] -1.7192599 -1.9692599
[89,] 14.4474068 -1.7192599
[90,] 13.7807401 14.4474068
[91,] 6.0307401 13.7807401
[92,] 4.6974068 6.0307401
[93,] -8.4692599 4.6974068
[94,] -9.7192599 -8.4692599
[95,] -3.7192599 -9.7192599
[96,] -6.5598776 -3.7192599
[97,] -13.8098776 -6.5598776
[98,] 6.0234557 -13.8098776
[99,] 1.1067890 6.0234557
[100,] 3.3567890 1.1067890
[101,] 30.5234557 3.3567890
[102,] 33.8567890 30.5234557
[103,] 36.1067890 33.8567890
[104,] 21.7734557 36.1067890
[105,] 0.6067890 21.7734557
[106,] -7.6432110 0.6067890
[107,] -5.6432110 -7.6432110
[108,] -13.4838287 -5.6432110
[109,] -28.7338287 -13.4838287
[110,] -19.9004953 -28.7338287
[111,] -30.8171620 -19.9004953
[112,] -20.5671620 -30.8171620
[113,] 11.5995047 -20.5671620
[114,] 27.9328380 11.5995047
[115,] 42.1828380 27.9328380
[116,] -10.1504953 42.1828380
[117,] -19.3171620 -10.1504953
[118,] -34.5671620 -19.3171620
[119,] -36.5671620 -34.5671620
[120,] -25.4077797 -36.5671620
[121,] -36.6577797 -25.4077797
[122,] -7.8244464 -36.6577797
[123,] -14.7411131 -7.8244464
[124,] 4.5088869 -14.7411131
[125,] 16.6755536 4.5088869
[126,] 53.0088869 16.6755536
[127,] 64.2588869 53.0088869
[128,] 16.9255536 64.2588869
[129,] -3.2411131 16.9255536
[130,] -14.4911131 -3.2411131
[131,] -0.4911131 -14.4911131
[132,] -0.3317308 -0.4911131
[133,] -19.5817308 -0.3317308
[134,] -26.7483974 -19.5817308
[135,] 18.3349359 -26.7483974
[136,] 24.5849359 18.3349359
[137,] 47.7516026 24.5849359
[138,] 95.0849359 47.7516026
[139,] 79.3349359 95.0849359
[140,] 30.0016026 79.3349359
[141,] 18.8349359 30.0016026
[142,] -18.4150641 18.8349359
[143,] -5.4150641 -18.4150641
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 58.5817308 45.8317308
2 37.4150641 58.5817308
3 37.4983974 37.4150641
4 24.7483974 37.4983974
5 -1.0849359 24.7483974
6 -27.7516026 -1.0849359
7 -27.5016026 -27.7516026
8 9.1650641 -27.5016026
9 27.9983974 9.1650641
10 46.7483974 27.9983974
11 31.7483974 46.7483974
12 16.9077797 31.7483974
13 34.6577797 16.9077797
14 14.4911131 34.6577797
15 11.5744464 14.4911131
16 -3.1755536 11.5744464
17 -19.0088869 -3.1755536
18 -37.6755536 -19.0088869
19 -37.4255536 -37.6755536
20 -0.7588869 -37.4255536
21 10.0744464 -0.7588869
22 24.8244464 10.0744464
23 21.8244464 24.8244464
24 14.9838287 21.8244464
25 26.7338287 14.9838287
26 19.5671620 26.7338287
27 7.6504953 19.5671620
28 11.9004953 7.6504953
29 -21.9328380 11.9004953
30 -40.5995047 -21.9328380
31 -40.3495047 -40.5995047
32 -6.6828380 -40.3495047
33 7.1504953 -6.6828380
34 24.9004953 7.1504953
35 15.9004953 24.9004953
36 9.0598776 15.9004953
37 24.8098776 9.0598776
38 2.6432110 24.8098776
39 -6.2734557 2.6432110
40 -9.0234557 -6.2734557
41 -13.8567890 -9.0234557
42 -41.5234557 -13.8567890
43 -29.2734557 -41.5234557
44 -13.6067890 -29.2734557
45 4.2265443 -13.6067890
46 18.9765443 4.2265443
47 11.9765443 18.9765443
48 2.1359266 11.9765443
49 8.8859266 2.1359266
50 13.7192599 8.8859266
51 15.8025932 13.7192599
52 5.0525932 15.8025932
53 -20.7807401 5.0525932
54 -39.4474068 -20.7807401
55 -31.1974068 -39.4474068
56 -17.5307401 -31.1974068
57 -7.6974068 -17.5307401
58 -4.9474068 -7.6974068
59 -12.9474068 -4.9474068
60 -21.7880245 -12.9474068
61 -31.0380245 -21.7880245
62 -19.2046911 -31.0380245
63 -24.1213578 -19.2046911
64 -21.8713578 -24.1213578
65 -31.7046911 -21.8713578
66 -33.3713578 -31.7046911
67 -42.1213578 -33.3713578
68 -27.4546911 -42.1213578
69 -21.6213578 -27.4546911
70 -13.8713578 -21.6213578
71 -16.8713578 -13.8713578
72 -15.7119755 -16.8713578
73 -17.9619755 -15.7119755
74 -19.1286422 -17.9619755
75 -14.0453089 -19.1286422
76 -17.7953089 -14.0453089
77 -12.6286422 -17.7953089
78 -3.2953089 -12.6286422
79 -20.0453089 -3.2953089
80 -6.3786422 -20.0453089
81 -8.5453089 -6.3786422
82 -11.7953089 -8.5453089
83 0.2046911 -11.7953089
84 -5.6359266 0.2046911
85 -5.8859266 -5.6359266
86 -1.0525932 -5.8859266
87 -1.9692599 -1.0525932
88 -1.7192599 -1.9692599
89 14.4474068 -1.7192599
90 13.7807401 14.4474068
91 6.0307401 13.7807401
92 4.6974068 6.0307401
93 -8.4692599 4.6974068
94 -9.7192599 -8.4692599
95 -3.7192599 -9.7192599
96 -6.5598776 -3.7192599
97 -13.8098776 -6.5598776
98 6.0234557 -13.8098776
99 1.1067890 6.0234557
100 3.3567890 1.1067890
101 30.5234557 3.3567890
102 33.8567890 30.5234557
103 36.1067890 33.8567890
104 21.7734557 36.1067890
105 0.6067890 21.7734557
106 -7.6432110 0.6067890
107 -5.6432110 -7.6432110
108 -13.4838287 -5.6432110
109 -28.7338287 -13.4838287
110 -19.9004953 -28.7338287
111 -30.8171620 -19.9004953
112 -20.5671620 -30.8171620
113 11.5995047 -20.5671620
114 27.9328380 11.5995047
115 42.1828380 27.9328380
116 -10.1504953 42.1828380
117 -19.3171620 -10.1504953
118 -34.5671620 -19.3171620
119 -36.5671620 -34.5671620
120 -25.4077797 -36.5671620
121 -36.6577797 -25.4077797
122 -7.8244464 -36.6577797
123 -14.7411131 -7.8244464
124 4.5088869 -14.7411131
125 16.6755536 4.5088869
126 53.0088869 16.6755536
127 64.2588869 53.0088869
128 16.9255536 64.2588869
129 -3.2411131 16.9255536
130 -14.4911131 -3.2411131
131 -0.4911131 -14.4911131
132 -0.3317308 -0.4911131
133 -19.5817308 -0.3317308
134 -26.7483974 -19.5817308
135 18.3349359 -26.7483974
136 24.5849359 18.3349359
137 47.7516026 24.5849359
138 95.0849359 47.7516026
139 79.3349359 95.0849359
140 30.0016026 79.3349359
141 18.8349359 30.0016026
142 -18.4150641 18.8349359
143 -5.4150641 -18.4150641
> 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/7evki1210164523.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/8cuom1210164523.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/92qm21210164524.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/10oxsj1210164524.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/1110vq1210164524.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/12t05l1210164524.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/1390gg1210164524.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/14jam01210164524.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/15t0ea1210164524.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/16eraf1210164524.tab")
+ }
>
> system("convert tmp/1smxe1210164523.ps tmp/1smxe1210164523.png")
> system("convert tmp/2k7gv1210164523.ps tmp/2k7gv1210164523.png")
> system("convert tmp/3frk41210164523.ps tmp/3frk41210164523.png")
> system("convert tmp/4f1y31210164523.ps tmp/4f1y31210164523.png")
> system("convert tmp/5rp7e1210164523.ps tmp/5rp7e1210164523.png")
> system("convert tmp/6xddh1210164523.ps tmp/6xddh1210164523.png")
> system("convert tmp/7evki1210164523.ps tmp/7evki1210164523.png")
> system("convert tmp/8cuom1210164523.ps tmp/8cuom1210164523.png")
> system("convert tmp/92qm21210164524.ps tmp/92qm21210164524.png")
> system("convert tmp/10oxsj1210164524.ps tmp/10oxsj1210164524.png")
>
>
> proc.time()
user system elapsed
4.077 1.709 9.106