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(493
+ ,116
+ ,377
+ ,7.4
+ ,9.1
+ ,9
+ ,481
+ ,111
+ ,370
+ ,7.2
+ ,9.1
+ ,9
+ ,462
+ ,104
+ ,358
+ ,7
+ ,9
+ ,9
+ ,457
+ ,100
+ ,357
+ ,7
+ ,8.9
+ ,8.9
+ ,442
+ ,93
+ ,349
+ ,6.8
+ ,8.8
+ ,8.9
+ ,439
+ ,91
+ ,348
+ ,6.8
+ ,8.7
+ ,8.8
+ ,488
+ ,119
+ ,369
+ ,6.7
+ ,8.7
+ ,8.8
+ ,521
+ ,139
+ ,381
+ ,6.7
+ ,8.6
+ ,8.7
+ ,501
+ ,134
+ ,368
+ ,6.7
+ ,8.5
+ ,8.7
+ ,485
+ ,124
+ ,361
+ ,6.8
+ ,8.4
+ ,8.6
+ ,464
+ ,113
+ ,351
+ ,6.7
+ ,8.4
+ ,8.6
+ ,460
+ ,109
+ ,351
+ ,6.6
+ ,8.3
+ ,8.5
+ ,467
+ ,109
+ ,358
+ ,6.4
+ ,8.2
+ ,8.5
+ ,460
+ ,106
+ ,354
+ ,6.3
+ ,8.2
+ ,8.5
+ ,448
+ ,101
+ ,347
+ ,6.3
+ ,8.1
+ ,8.5
+ ,443
+ ,98
+ ,345
+ ,6.5
+ ,8.1
+ ,8.5
+ ,436
+ ,93
+ ,343
+ ,6.5
+ ,8.1
+ ,8.5
+ ,431
+ ,91
+ ,340
+ ,6.4
+ ,8.1
+ ,8.5
+ ,484
+ ,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9
+ ,539
+ ,108
+ ,431
+ ,7.2
+ ,10.6
+ ,10
+ ,541
+ ,106
+ ,435
+ ,7.1
+ ,10.7
+ ,10
+ ,562
+ ,111
+ ,450
+ ,7.1
+ ,10.8
+ ,10.1)
+ ,dim=c(6
+ ,145)
+ ,dimnames=list(c('Totaal_werklozen'
+ ,'Jonger_dan_25_jaar'
+ ,'Vanaf_25_jaar'
+ ,'Belgie'
+ ,'Eurogebied'
+ ,'EU_27')
+ ,1:145))
> y <- array(NA,dim=c(6,145),dimnames=list(c('Totaal_werklozen','Jonger_dan_25_jaar','Vanaf_25_jaar','Belgie','Eurogebied','EU_27'),1:145))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '5'
> 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
Eurogebied Totaal_werklozen Jonger_dan_25_jaar Vanaf_25_jaar Belgie EU_27
1 9.1 493 116 377 7.4 9.0
2 9.1 481 111 370 7.2 9.0
3 9.0 462 104 358 7.0 9.0
4 8.9 457 100 357 7.0 8.9
5 8.8 442 93 349 6.8 8.9
6 8.7 439 91 348 6.8 8.8
7 8.7 488 119 369 6.7 8.8
8 8.6 521 139 381 6.7 8.7
9 8.5 501 134 368 6.7 8.7
10 8.4 485 124 361 6.8 8.6
11 8.4 464 113 351 6.7 8.6
12 8.3 460 109 351 6.6 8.5
13 8.2 467 109 358 6.4 8.5
14 8.2 460 106 354 6.3 8.5
15 8.1 448 101 347 6.3 8.5
16 8.1 443 98 345 6.5 8.5
17 8.1 436 93 343 6.5 8.5
18 8.1 431 91 340 6.4 8.5
19 8.1 484 122 362 6.2 8.5
20 8.1 510 139 370 6.2 8.6
21 8.1 513 140 373 6.5 8.6
22 8.2 503 132 371 7.0 8.6
23 8.2 471 117 354 7.2 8.7
24 8.3 471 114 357 7.3 8.7
25 8.2 476 113 363 7.4 8.7
26 8.3 475 110 364 7.4 8.8
27 8.3 470 107 363 7.4 8.8
28 8.4 461 103 358 7.3 8.9
29 8.5 455 98 357 7.4 8.9
30 8.5 456 98 357 7.4 8.9
31 8.6 517 137 380 7.6 9.0
32 8.6 525 148 378 7.6 9.0
33 8.7 523 147 376 7.7 9.0
34 8.7 519 139 380 7.7 9.0
35 8.8 509 130 379 7.8 9.0
36 8.8 512 128 384 7.8 9.0
37 8.9 519 127 392 8.0 9.1
38 9.0 517 123 394 8.1 9.1
39 9.0 510 118 392 8.1 9.1
40 9.0 509 114 396 8.2 9.1
41 9.0 501 108 392 8.1 9.1
42 9.1 507 111 396 8.1 9.1
43 9.1 569 151 419 8.1 9.1
44 9.0 580 159 421 8.1 9.1
45 9.1 578 158 420 8.2 9.1
46 9.0 565 148 418 8.2 9.1
47 9.1 547 138 410 8.3 9.1
48 9.1 555 137 418 8.4 9.2
49 9.2 562 136 426 8.6 9.3
50 9.2 561 133 428 8.6 9.3
51 9.2 555 126 430 8.4 9.3
52 9.2 544 120 424 8.0 9.2
53 9.2 537 114 423 7.9 9.2
54 9.3 543 116 427 8.1 9.2
55 9.3 594 153 441 8.5 9.2
56 9.3 611 162 449 8.8 9.2
57 9.3 613 161 452 8.8 9.2
58 9.3 611 149 462 8.5 9.2
59 9.4 594 139 455 8.3 9.2
60 9.4 595 135 461 8.3 9.2
61 9.3 591 130 461 8.3 9.2
62 9.3 589 127 463 8.4 9.2
63 9.3 584 122 462 8.5 9.2
64 9.3 573 117 456 8.5 9.2
65 9.2 567 112 455 8.6 9.1
66 9.2 569 113 456 8.5 9.1
67 9.2 621 149 472 8.6 9.0
68 9.1 629 157 472 8.6 8.9
69 9.1 628 157 471 8.6 8.9
70 9.1 612 147 465 8.5 9.0
71 9.1 595 137 459 8.4 8.9
72 9.0 597 132 465 8.4 8.8
73 8.9 593 125 468 8.5 8.7
74 8.8 590 123 467 8.5 8.6
75 8.7 580 117 463 8.5 8.5
76 8.6 574 114 460 8.6 8.5
77 8.6 573 111 462 8.6 8.4
78 8.5 573 112 461 8.4 8.3
79 8.4 620 144 476 8.2 8.2
80 8.4 626 150 476 8.0 8.2
81 8.3 620 149 471 8.0 8.1
82 8.2 588 134 453 8.0 8.0
83 8.2 566 123 443 8.0 7.9
84 8.0 557 116 442 7.9 7.8
85 7.9 561 117 444 7.9 7.6
86 7.8 549 111 438 7.9 7.5
87 7.7 532 105 427 7.9 7.4
88 7.6 526 102 424 8.0 7.3
89 7.6 511 95 416 7.9 7.3
90 7.6 499 93 406 7.4 7.2
91 7.6 555 124 431 7.2 7.2
92 7.6 565 130 434 7.0 7.2
93 7.5 542 124 418 6.9 7.1
94 7.5 527 115 412 7.1 7.0
95 7.4 510 106 404 7.2 7.0
96 7.4 514 105 409 7.2 6.9
97 7.4 517 105 412 7.1 6.9
98 7.3 508 101 406 6.9 6.8
99 7.3 493 95 398 6.8 6.8
100 7.4 490 93 397 6.8 6.8
101 7.5 469 84 385 6.8 6.9
102 7.6 478 87 390 6.9 7.0
103 7.6 528 116 413 7.1 7.0
104 7.7 534 120 413 7.2 7.1
105 7.7 518 117 401 7.2 7.2
106 7.9 506 109 397 7.1 7.3
107 8.1 502 105 397 7.1 7.5
108 8.4 516 107 409 7.2 7.7
109 8.7 528 109 419 7.5 8.1
110 9.0 533 109 424 7.7 8.4
111 9.3 536 108 428 7.8 8.6
112 9.4 537 107 430 7.7 8.8
113 9.5 524 99 424 7.7 8.9
114 9.6 536 103 433 7.8 9.1
115 9.8 587 131 456 8.0 9.2
116 9.8 597 137 459 8.1 9.3
117 9.9 581 135 446 8.1 9.4
118 10.0 564 124 441 8.0 9.4
119 10.0 558 118 439 8.1 9.5
120 10.1 575 121 454 8.2 9.5
121 10.1 580 121 460 8.4 9.7
122 10.1 575 118 457 8.5 9.7
123 10.1 563 113 451 8.5 9.7
124 10.2 552 107 444 8.5 9.7
125 10.2 537 100 437 8.5 9.7
126 10.1 545 102 443 8.5 9.6
127 10.1 601 130 471 8.4 9.6
128 10.1 604 136 469 8.3 9.6
129 10.1 586 133 454 8.2 9.6
130 10.1 564 120 444 8.1 9.6
131 10.1 549 112 436 7.9 9.6
132 10.1 551 109 442 7.6 9.6
133 10.0 556 110 446 7.3 9.5
134 9.9 548 106 442 7.1 9.5
135 9.9 540 102 438 7.0 9.4
136 9.9 531 98 433 7.1 9.4
137 9.9 521 92 428 7.1 9.5
138 10.0 519 92 426 7.1 9.5
139 10.1 572 120 452 7.3 9.6
140 10.2 581 127 455 7.3 9.7
141 10.3 563 124 439 7.3 9.8
142 10.5 548 114 434 7.2 9.9
143 10.6 539 108 431 7.2 10.0
144 10.7 541 106 435 7.1 10.0
145 10.8 562 111 450 7.1 10.1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Totaal_werklozen Jonger_dan_25_jaar Vanaf_25_jaar
-1.042005 -0.004858 -0.002794 0.014730
Belgie EU_27
-0.204800 0.950844
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.34952 -0.15507 0.02661 0.16203 0.37630
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.042005 0.232168 -4.488 1.49e-05 ***
Totaal_werklozen -0.004858 0.033996 -0.143 0.887
Jonger_dan_25_jaar -0.002794 0.033839 -0.083 0.934
Vanaf_25_jaar 0.014730 0.034050 0.433 0.666
Belgie -0.204800 0.038894 -5.266 5.19e-07 ***
EU_27 0.950844 0.021395 44.443 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.1957 on 139 degrees of freedom
Multiple R-squared: 0.9497, Adjusted R-squared: 0.9479
F-statistic: 525.4 on 5 and 139 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,] 4.394927e-03 8.789853e-03 9.956051e-01
[2,] 5.354448e-04 1.070890e-03 9.994646e-01
[3,] 9.130958e-05 1.826192e-04 9.999087e-01
[4,] 2.817817e-05 5.635634e-05 9.999718e-01
[5,] 1.229049e-05 2.458098e-05 9.999877e-01
[6,] 1.736374e-06 3.472748e-06 9.999983e-01
[7,] 4.228440e-06 8.456879e-06 9.999958e-01
[8,] 1.477630e-05 2.955259e-05 9.999852e-01
[9,] 1.124579e-05 2.249158e-05 9.999888e-01
[10,] 3.926542e-06 7.853084e-06 9.999961e-01
[11,] 1.639251e-06 3.278502e-06 9.999984e-01
[12,] 1.587976e-05 3.175952e-05 9.999841e-01
[13,] 2.687472e-04 5.374944e-04 9.997313e-01
[14,] 1.624219e-03 3.248437e-03 9.983758e-01
[15,] 6.821788e-03 1.364358e-02 9.931782e-01
[16,] 6.008376e-03 1.201675e-02 9.939916e-01
[17,] 1.759811e-02 3.519622e-02 9.824019e-01
[18,] 2.846946e-02 5.693892e-02 9.715305e-01
[19,] 7.259165e-02 1.451833e-01 9.274084e-01
[20,] 2.173612e-01 4.347225e-01 7.826388e-01
[21,] 2.678783e-01 5.357566e-01 7.321217e-01
[22,] 2.803667e-01 5.607335e-01 7.196333e-01
[23,] 3.142496e-01 6.284992e-01 6.857504e-01
[24,] 3.132688e-01 6.265376e-01 6.867312e-01
[25,] 3.065187e-01 6.130374e-01 6.934813e-01
[26,] 2.793908e-01 5.587816e-01 7.206092e-01
[27,] 2.590466e-01 5.180933e-01 7.409534e-01
[28,] 2.343844e-01 4.687688e-01 7.656156e-01
[29,] 2.219426e-01 4.438853e-01 7.780574e-01
[30,] 1.901946e-01 3.803893e-01 8.098054e-01
[31,] 1.643443e-01 3.286886e-01 8.356557e-01
[32,] 1.537236e-01 3.074471e-01 8.462764e-01
[33,] 1.497199e-01 2.994398e-01 8.502801e-01
[34,] 1.335715e-01 2.671429e-01 8.664285e-01
[35,] 1.075214e-01 2.150427e-01 8.924786e-01
[36,] 9.284710e-02 1.856942e-01 9.071529e-01
[37,] 8.698392e-02 1.739678e-01 9.130161e-01
[38,] 8.451304e-02 1.690261e-01 9.154870e-01
[39,] 7.311315e-02 1.462263e-01 9.268869e-01
[40,] 8.030555e-02 1.606111e-01 9.196945e-01
[41,] 1.086394e-01 2.172788e-01 8.913606e-01
[42,] 1.577072e-01 3.154144e-01 8.422928e-01
[43,] 3.726711e-01 7.453422e-01 6.273289e-01
[44,] 5.204371e-01 9.591258e-01 4.795629e-01
[45,] 7.460381e-01 5.079238e-01 2.539619e-01
[46,] 8.338104e-01 3.323791e-01 1.661896e-01
[47,] 8.828635e-01 2.342730e-01 1.171365e-01
[48,] 9.196090e-01 1.607819e-01 8.039097e-02
[49,] 9.473624e-01 1.052752e-01 5.263762e-02
[50,] 9.575130e-01 8.497391e-02 4.248696e-02
[51,] 9.611276e-01 7.774472e-02 3.887236e-02
[52,] 9.579699e-01 8.406020e-02 4.203010e-02
[53,] 9.707598e-01 5.848033e-02 2.924016e-02
[54,] 9.786089e-01 4.278227e-02 2.139113e-02
[55,] 9.817240e-01 3.655202e-02 1.827601e-02
[56,] 9.876307e-01 2.473860e-02 1.236930e-02
[57,] 9.914528e-01 1.709434e-02 8.547168e-03
[58,] 9.948195e-01 1.036102e-02 5.180511e-03
[59,] 9.956818e-01 8.636319e-03 4.318160e-03
[60,] 9.969861e-01 6.027770e-03 3.013885e-03
[61,] 9.976717e-01 4.656674e-03 2.328337e-03
[62,] 9.993808e-01 1.238322e-03 6.191612e-04
[63,] 9.997129e-01 5.742261e-04 2.871131e-04
[64,] 9.997364e-01 5.272332e-04 2.636166e-04
[65,] 9.996577e-01 6.846214e-04 3.423107e-04
[66,] 9.995471e-01 9.058714e-04 4.529357e-04
[67,] 9.994003e-01 1.199427e-03 5.997135e-04
[68,] 9.994666e-01 1.066778e-03 5.333892e-04
[69,] 9.992626e-01 1.474841e-03 7.374205e-04
[70,] 9.989603e-01 2.079304e-03 1.039652e-03
[71,] 9.985074e-01 2.985154e-03 1.492577e-03
[72,] 9.979511e-01 4.097789e-03 2.048894e-03
[73,] 9.976285e-01 4.742989e-03 2.371494e-03
[74,] 9.988016e-01 2.396867e-03 1.198434e-03
[75,] 9.992177e-01 1.564595e-03 7.822977e-04
[76,] 9.995049e-01 9.902311e-04 4.951155e-04
[77,] 9.994569e-01 1.086236e-03 5.431182e-04
[78,] 9.993907e-01 1.218669e-03 6.093343e-04
[79,] 9.994742e-01 1.051668e-03 5.258338e-04
[80,] 9.995448e-01 9.103447e-04 4.551724e-04
[81,] 9.997504e-01 4.992575e-04 2.496288e-04
[82,] 9.998601e-01 2.798802e-04 1.399401e-04
[83,] 9.998602e-01 2.795137e-04 1.397568e-04
[84,] 9.998789e-01 2.421225e-04 1.210612e-04
[85,] 9.999477e-01 1.045411e-04 5.227054e-05
[86,] 9.999548e-01 9.048494e-05 4.524247e-05
[87,] 9.999844e-01 3.115640e-05 1.557820e-05
[88,] 9.999814e-01 3.714208e-05 1.857104e-05
[89,] 9.999753e-01 4.931747e-05 2.465874e-05
[90,] 9.999746e-01 5.088307e-05 2.544153e-05
[91,] 9.999757e-01 4.851051e-05 2.425525e-05
[92,] 9.999710e-01 5.793154e-05 2.896577e-05
[93,] 9.999688e-01 6.247635e-05 3.123818e-05
[94,] 9.999673e-01 6.531488e-05 3.265744e-05
[95,] 9.999502e-01 9.967973e-05 4.983987e-05
[96,] 9.999387e-01 1.225586e-04 6.127929e-05
[97,] 9.999726e-01 5.488878e-05 2.744439e-05
[98,] 9.999774e-01 4.519074e-05 2.259537e-05
[99,] 9.999857e-01 2.862571e-05 1.431286e-05
[100,] 9.999891e-01 2.179145e-05 1.089573e-05
[101,] 9.999883e-01 2.344064e-05 1.172032e-05
[102,] 9.999881e-01 2.380141e-05 1.190071e-05
[103,] 9.999983e-01 3.389732e-06 1.694866e-06
[104,] 9.999991e-01 1.799649e-06 8.998245e-07
[105,] 9.999997e-01 6.128687e-07 3.064343e-07
[106,] 9.999996e-01 7.959585e-07 3.979793e-07
[107,] 9.999999e-01 2.184877e-07 1.092438e-07
[108,] 9.999998e-01 4.641035e-07 2.320518e-07
[109,] 9.999996e-01 8.755779e-07 4.377889e-07
[110,] 9.999999e-01 1.682574e-07 8.412868e-08
[111,] 9.999998e-01 4.152279e-07 2.076139e-07
[112,] 1.000000e+00 6.660842e-08 3.330421e-08
[113,] 9.999999e-01 1.011331e-07 5.056653e-08
[114,] 1.000000e+00 6.909893e-08 3.454946e-08
[115,] 1.000000e+00 2.149446e-08 1.074723e-08
[116,] 1.000000e+00 8.263348e-08 4.131674e-08
[117,] 9.999999e-01 2.316715e-07 1.158357e-07
[118,] 9.999997e-01 6.407755e-07 3.203878e-07
[119,] 9.999986e-01 2.727205e-06 1.363603e-06
[120,] 9.999945e-01 1.097430e-05 5.487149e-06
[121,] 9.999780e-01 4.399238e-05 2.199619e-05
[122,] 9.999137e-01 1.725524e-04 8.627620e-05
[123,] 9.997612e-01 4.775960e-04 2.387980e-04
[124,] 9.990946e-01 1.810847e-03 9.054236e-04
[125,] 9.976368e-01 4.726476e-03 2.363238e-03
[126,] 9.981568e-01 3.686369e-03 1.843185e-03
[127,] 9.931836e-01 1.363287e-02 6.816436e-03
[128,] 9.727012e-01 5.459754e-02 2.729877e-02
> postscript(file="/var/wessaorg/rcomp/tmp/1f34h1354907477.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/wessaorg/rcomp/tmp/2y7o61354907477.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/wessaorg/rcomp/tmp/3izwp1354907477.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/wessaorg/rcomp/tmp/471nh1354907477.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/wessaorg/rcomp/tmp/5w8mg1354907477.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 = 145
Frequency = 1
1 2 3 4 5 6
0.265932133 0.255812654 0.179747436 0.154093714 0.038541107 0.028192361
7 8 9 10 11 12
0.014673243 0.049203667 0.029558339 0.042559211 0.036620332 -0.019385222
13 14 15 16 17 18
-0.229448123 -0.233398183 -0.302557692 -0.264811490 -0.283330235 -0.289499654
19 20 21 22 23 24
-0.310413141 -0.349521556 -0.314903106 -0.153979389 -0.155069715 -0.087162735
25 26 27 28 29 30
-0.233566322 -0.256621564 -0.274565631 -0.271380714 -0.179291321 -0.174432870
31 32 33 34 35 36
-0.062021194 0.037041416 0.174471059 0.073763767 0.135243209 0.070578997
37 38 39 40 41 42
0.029827319 0.099953658 0.081434913 0.026959106 0.009768486 0.088380109
43 44 45 46 47 48
0.162568685 0.108903345 0.231602689 0.069963054 0.192892938 0.036519727
49 50 51 52 53 54
-0.004231951 -0.046933110 -0.166062641 -0.134723591 -0.191246656 -0.074469099
55 56 57 58 59 60
0.152387031 0.203724599 0.166456569 -0.085531713 -0.033913631 -0.128613118
61 62 63 64 65 66
-0.262017106 -0.289096730 -0.292148885 -0.271180241 -0.284006466 -0.306705810
67 68 69 70 71 72
-0.073601436 -0.017297150 -0.007425303 -0.140283466 -0.087831315 -0.185382004
73 74 75 76 77 78
-0.253000593 -0.263349339 -0.274692495 -0.347554431 -0.295171207 -0.323522459
79 80 81 82 83 84
-0.272596145 -0.267641188 -0.230850057 -0.168001290 -0.063234253 -0.237183875
85 86 87 88 89 90
-0.154247865 -0.145847326 -0.088087551 -0.065865105 -0.060937727 0.015160227
91 92 93 94 95 96
-0.035368802 -0.055170935 0.026609640 0.153012685 0.083595058 0.121667716
97 98 99 100 101 102
0.071572189 0.059176185 0.066897599 0.161464471 0.215969865 0.219822146
103 104 105 106 107 108
0.245934874 0.311657332 0.307219201 0.369922320 0.349143603 0.376297632
109 110 111 112 113 114
0.273986561 0.280334147 0.363505490 0.225460558 0.233245807 0.100461902
115 116 117 118 119 120
0.233554663 0.180108103 0.293194307 0.333037740 0.241979013 0.232480302
121 122 123 124 125 126
0.019181972 0.051178487 0.067288680 0.200193586 0.210870651 0.162028925
127 128 129 130 131 132
0.079406877 0.119727062 0.224367322 0.207981919 0.189635275 0.041148321
133 134 135 136 137 138
-0.057042153 -0.189124686 -0.105642851 -0.066413581 -0.153195203 -0.033451508
139 140 141 142 143 144
-0.034832740 -0.010823701 0.133942460 0.191212450 0.179828683 0.204556333
145
0.104515132
> postscript(file="/var/wessaorg/rcomp/tmp/6m4g71354907477.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 = 145
Frequency = 1
lag(myerror, k = 1) myerror
0 0.265932133 NA
1 0.255812654 0.265932133
2 0.179747436 0.255812654
3 0.154093714 0.179747436
4 0.038541107 0.154093714
5 0.028192361 0.038541107
6 0.014673243 0.028192361
7 0.049203667 0.014673243
8 0.029558339 0.049203667
9 0.042559211 0.029558339
10 0.036620332 0.042559211
11 -0.019385222 0.036620332
12 -0.229448123 -0.019385222
13 -0.233398183 -0.229448123
14 -0.302557692 -0.233398183
15 -0.264811490 -0.302557692
16 -0.283330235 -0.264811490
17 -0.289499654 -0.283330235
18 -0.310413141 -0.289499654
19 -0.349521556 -0.310413141
20 -0.314903106 -0.349521556
21 -0.153979389 -0.314903106
22 -0.155069715 -0.153979389
23 -0.087162735 -0.155069715
24 -0.233566322 -0.087162735
25 -0.256621564 -0.233566322
26 -0.274565631 -0.256621564
27 -0.271380714 -0.274565631
28 -0.179291321 -0.271380714
29 -0.174432870 -0.179291321
30 -0.062021194 -0.174432870
31 0.037041416 -0.062021194
32 0.174471059 0.037041416
33 0.073763767 0.174471059
34 0.135243209 0.073763767
35 0.070578997 0.135243209
36 0.029827319 0.070578997
37 0.099953658 0.029827319
38 0.081434913 0.099953658
39 0.026959106 0.081434913
40 0.009768486 0.026959106
41 0.088380109 0.009768486
42 0.162568685 0.088380109
43 0.108903345 0.162568685
44 0.231602689 0.108903345
45 0.069963054 0.231602689
46 0.192892938 0.069963054
47 0.036519727 0.192892938
48 -0.004231951 0.036519727
49 -0.046933110 -0.004231951
50 -0.166062641 -0.046933110
51 -0.134723591 -0.166062641
52 -0.191246656 -0.134723591
53 -0.074469099 -0.191246656
54 0.152387031 -0.074469099
55 0.203724599 0.152387031
56 0.166456569 0.203724599
57 -0.085531713 0.166456569
58 -0.033913631 -0.085531713
59 -0.128613118 -0.033913631
60 -0.262017106 -0.128613118
61 -0.289096730 -0.262017106
62 -0.292148885 -0.289096730
63 -0.271180241 -0.292148885
64 -0.284006466 -0.271180241
65 -0.306705810 -0.284006466
66 -0.073601436 -0.306705810
67 -0.017297150 -0.073601436
68 -0.007425303 -0.017297150
69 -0.140283466 -0.007425303
70 -0.087831315 -0.140283466
71 -0.185382004 -0.087831315
72 -0.253000593 -0.185382004
73 -0.263349339 -0.253000593
74 -0.274692495 -0.263349339
75 -0.347554431 -0.274692495
76 -0.295171207 -0.347554431
77 -0.323522459 -0.295171207
78 -0.272596145 -0.323522459
79 -0.267641188 -0.272596145
80 -0.230850057 -0.267641188
81 -0.168001290 -0.230850057
82 -0.063234253 -0.168001290
83 -0.237183875 -0.063234253
84 -0.154247865 -0.237183875
85 -0.145847326 -0.154247865
86 -0.088087551 -0.145847326
87 -0.065865105 -0.088087551
88 -0.060937727 -0.065865105
89 0.015160227 -0.060937727
90 -0.035368802 0.015160227
91 -0.055170935 -0.035368802
92 0.026609640 -0.055170935
93 0.153012685 0.026609640
94 0.083595058 0.153012685
95 0.121667716 0.083595058
96 0.071572189 0.121667716
97 0.059176185 0.071572189
98 0.066897599 0.059176185
99 0.161464471 0.066897599
100 0.215969865 0.161464471
101 0.219822146 0.215969865
102 0.245934874 0.219822146
103 0.311657332 0.245934874
104 0.307219201 0.311657332
105 0.369922320 0.307219201
106 0.349143603 0.369922320
107 0.376297632 0.349143603
108 0.273986561 0.376297632
109 0.280334147 0.273986561
110 0.363505490 0.280334147
111 0.225460558 0.363505490
112 0.233245807 0.225460558
113 0.100461902 0.233245807
114 0.233554663 0.100461902
115 0.180108103 0.233554663
116 0.293194307 0.180108103
117 0.333037740 0.293194307
118 0.241979013 0.333037740
119 0.232480302 0.241979013
120 0.019181972 0.232480302
121 0.051178487 0.019181972
122 0.067288680 0.051178487
123 0.200193586 0.067288680
124 0.210870651 0.200193586
125 0.162028925 0.210870651
126 0.079406877 0.162028925
127 0.119727062 0.079406877
128 0.224367322 0.119727062
129 0.207981919 0.224367322
130 0.189635275 0.207981919
131 0.041148321 0.189635275
132 -0.057042153 0.041148321
133 -0.189124686 -0.057042153
134 -0.105642851 -0.189124686
135 -0.066413581 -0.105642851
136 -0.153195203 -0.066413581
137 -0.033451508 -0.153195203
138 -0.034832740 -0.033451508
139 -0.010823701 -0.034832740
140 0.133942460 -0.010823701
141 0.191212450 0.133942460
142 0.179828683 0.191212450
143 0.204556333 0.179828683
144 0.104515132 0.204556333
145 NA 0.104515132
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.255812654 0.265932133
[2,] 0.179747436 0.255812654
[3,] 0.154093714 0.179747436
[4,] 0.038541107 0.154093714
[5,] 0.028192361 0.038541107
[6,] 0.014673243 0.028192361
[7,] 0.049203667 0.014673243
[8,] 0.029558339 0.049203667
[9,] 0.042559211 0.029558339
[10,] 0.036620332 0.042559211
[11,] -0.019385222 0.036620332
[12,] -0.229448123 -0.019385222
[13,] -0.233398183 -0.229448123
[14,] -0.302557692 -0.233398183
[15,] -0.264811490 -0.302557692
[16,] -0.283330235 -0.264811490
[17,] -0.289499654 -0.283330235
[18,] -0.310413141 -0.289499654
[19,] -0.349521556 -0.310413141
[20,] -0.314903106 -0.349521556
[21,] -0.153979389 -0.314903106
[22,] -0.155069715 -0.153979389
[23,] -0.087162735 -0.155069715
[24,] -0.233566322 -0.087162735
[25,] -0.256621564 -0.233566322
[26,] -0.274565631 -0.256621564
[27,] -0.271380714 -0.274565631
[28,] -0.179291321 -0.271380714
[29,] -0.174432870 -0.179291321
[30,] -0.062021194 -0.174432870
[31,] 0.037041416 -0.062021194
[32,] 0.174471059 0.037041416
[33,] 0.073763767 0.174471059
[34,] 0.135243209 0.073763767
[35,] 0.070578997 0.135243209
[36,] 0.029827319 0.070578997
[37,] 0.099953658 0.029827319
[38,] 0.081434913 0.099953658
[39,] 0.026959106 0.081434913
[40,] 0.009768486 0.026959106
[41,] 0.088380109 0.009768486
[42,] 0.162568685 0.088380109
[43,] 0.108903345 0.162568685
[44,] 0.231602689 0.108903345
[45,] 0.069963054 0.231602689
[46,] 0.192892938 0.069963054
[47,] 0.036519727 0.192892938
[48,] -0.004231951 0.036519727
[49,] -0.046933110 -0.004231951
[50,] -0.166062641 -0.046933110
[51,] -0.134723591 -0.166062641
[52,] -0.191246656 -0.134723591
[53,] -0.074469099 -0.191246656
[54,] 0.152387031 -0.074469099
[55,] 0.203724599 0.152387031
[56,] 0.166456569 0.203724599
[57,] -0.085531713 0.166456569
[58,] -0.033913631 -0.085531713
[59,] -0.128613118 -0.033913631
[60,] -0.262017106 -0.128613118
[61,] -0.289096730 -0.262017106
[62,] -0.292148885 -0.289096730
[63,] -0.271180241 -0.292148885
[64,] -0.284006466 -0.271180241
[65,] -0.306705810 -0.284006466
[66,] -0.073601436 -0.306705810
[67,] -0.017297150 -0.073601436
[68,] -0.007425303 -0.017297150
[69,] -0.140283466 -0.007425303
[70,] -0.087831315 -0.140283466
[71,] -0.185382004 -0.087831315
[72,] -0.253000593 -0.185382004
[73,] -0.263349339 -0.253000593
[74,] -0.274692495 -0.263349339
[75,] -0.347554431 -0.274692495
[76,] -0.295171207 -0.347554431
[77,] -0.323522459 -0.295171207
[78,] -0.272596145 -0.323522459
[79,] -0.267641188 -0.272596145
[80,] -0.230850057 -0.267641188
[81,] -0.168001290 -0.230850057
[82,] -0.063234253 -0.168001290
[83,] -0.237183875 -0.063234253
[84,] -0.154247865 -0.237183875
[85,] -0.145847326 -0.154247865
[86,] -0.088087551 -0.145847326
[87,] -0.065865105 -0.088087551
[88,] -0.060937727 -0.065865105
[89,] 0.015160227 -0.060937727
[90,] -0.035368802 0.015160227
[91,] -0.055170935 -0.035368802
[92,] 0.026609640 -0.055170935
[93,] 0.153012685 0.026609640
[94,] 0.083595058 0.153012685
[95,] 0.121667716 0.083595058
[96,] 0.071572189 0.121667716
[97,] 0.059176185 0.071572189
[98,] 0.066897599 0.059176185
[99,] 0.161464471 0.066897599
[100,] 0.215969865 0.161464471
[101,] 0.219822146 0.215969865
[102,] 0.245934874 0.219822146
[103,] 0.311657332 0.245934874
[104,] 0.307219201 0.311657332
[105,] 0.369922320 0.307219201
[106,] 0.349143603 0.369922320
[107,] 0.376297632 0.349143603
[108,] 0.273986561 0.376297632
[109,] 0.280334147 0.273986561
[110,] 0.363505490 0.280334147
[111,] 0.225460558 0.363505490
[112,] 0.233245807 0.225460558
[113,] 0.100461902 0.233245807
[114,] 0.233554663 0.100461902
[115,] 0.180108103 0.233554663
[116,] 0.293194307 0.180108103
[117,] 0.333037740 0.293194307
[118,] 0.241979013 0.333037740
[119,] 0.232480302 0.241979013
[120,] 0.019181972 0.232480302
[121,] 0.051178487 0.019181972
[122,] 0.067288680 0.051178487
[123,] 0.200193586 0.067288680
[124,] 0.210870651 0.200193586
[125,] 0.162028925 0.210870651
[126,] 0.079406877 0.162028925
[127,] 0.119727062 0.079406877
[128,] 0.224367322 0.119727062
[129,] 0.207981919 0.224367322
[130,] 0.189635275 0.207981919
[131,] 0.041148321 0.189635275
[132,] -0.057042153 0.041148321
[133,] -0.189124686 -0.057042153
[134,] -0.105642851 -0.189124686
[135,] -0.066413581 -0.105642851
[136,] -0.153195203 -0.066413581
[137,] -0.033451508 -0.153195203
[138,] -0.034832740 -0.033451508
[139,] -0.010823701 -0.034832740
[140,] 0.133942460 -0.010823701
[141,] 0.191212450 0.133942460
[142,] 0.179828683 0.191212450
[143,] 0.204556333 0.179828683
[144,] 0.104515132 0.204556333
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.255812654 0.265932133
2 0.179747436 0.255812654
3 0.154093714 0.179747436
4 0.038541107 0.154093714
5 0.028192361 0.038541107
6 0.014673243 0.028192361
7 0.049203667 0.014673243
8 0.029558339 0.049203667
9 0.042559211 0.029558339
10 0.036620332 0.042559211
11 -0.019385222 0.036620332
12 -0.229448123 -0.019385222
13 -0.233398183 -0.229448123
14 -0.302557692 -0.233398183
15 -0.264811490 -0.302557692
16 -0.283330235 -0.264811490
17 -0.289499654 -0.283330235
18 -0.310413141 -0.289499654
19 -0.349521556 -0.310413141
20 -0.314903106 -0.349521556
21 -0.153979389 -0.314903106
22 -0.155069715 -0.153979389
23 -0.087162735 -0.155069715
24 -0.233566322 -0.087162735
25 -0.256621564 -0.233566322
26 -0.274565631 -0.256621564
27 -0.271380714 -0.274565631
28 -0.179291321 -0.271380714
29 -0.174432870 -0.179291321
30 -0.062021194 -0.174432870
31 0.037041416 -0.062021194
32 0.174471059 0.037041416
33 0.073763767 0.174471059
34 0.135243209 0.073763767
35 0.070578997 0.135243209
36 0.029827319 0.070578997
37 0.099953658 0.029827319
38 0.081434913 0.099953658
39 0.026959106 0.081434913
40 0.009768486 0.026959106
41 0.088380109 0.009768486
42 0.162568685 0.088380109
43 0.108903345 0.162568685
44 0.231602689 0.108903345
45 0.069963054 0.231602689
46 0.192892938 0.069963054
47 0.036519727 0.192892938
48 -0.004231951 0.036519727
49 -0.046933110 -0.004231951
50 -0.166062641 -0.046933110
51 -0.134723591 -0.166062641
52 -0.191246656 -0.134723591
53 -0.074469099 -0.191246656
54 0.152387031 -0.074469099
55 0.203724599 0.152387031
56 0.166456569 0.203724599
57 -0.085531713 0.166456569
58 -0.033913631 -0.085531713
59 -0.128613118 -0.033913631
60 -0.262017106 -0.128613118
61 -0.289096730 -0.262017106
62 -0.292148885 -0.289096730
63 -0.271180241 -0.292148885
64 -0.284006466 -0.271180241
65 -0.306705810 -0.284006466
66 -0.073601436 -0.306705810
67 -0.017297150 -0.073601436
68 -0.007425303 -0.017297150
69 -0.140283466 -0.007425303
70 -0.087831315 -0.140283466
71 -0.185382004 -0.087831315
72 -0.253000593 -0.185382004
73 -0.263349339 -0.253000593
74 -0.274692495 -0.263349339
75 -0.347554431 -0.274692495
76 -0.295171207 -0.347554431
77 -0.323522459 -0.295171207
78 -0.272596145 -0.323522459
79 -0.267641188 -0.272596145
80 -0.230850057 -0.267641188
81 -0.168001290 -0.230850057
82 -0.063234253 -0.168001290
83 -0.237183875 -0.063234253
84 -0.154247865 -0.237183875
85 -0.145847326 -0.154247865
86 -0.088087551 -0.145847326
87 -0.065865105 -0.088087551
88 -0.060937727 -0.065865105
89 0.015160227 -0.060937727
90 -0.035368802 0.015160227
91 -0.055170935 -0.035368802
92 0.026609640 -0.055170935
93 0.153012685 0.026609640
94 0.083595058 0.153012685
95 0.121667716 0.083595058
96 0.071572189 0.121667716
97 0.059176185 0.071572189
98 0.066897599 0.059176185
99 0.161464471 0.066897599
100 0.215969865 0.161464471
101 0.219822146 0.215969865
102 0.245934874 0.219822146
103 0.311657332 0.245934874
104 0.307219201 0.311657332
105 0.369922320 0.307219201
106 0.349143603 0.369922320
107 0.376297632 0.349143603
108 0.273986561 0.376297632
109 0.280334147 0.273986561
110 0.363505490 0.280334147
111 0.225460558 0.363505490
112 0.233245807 0.225460558
113 0.100461902 0.233245807
114 0.233554663 0.100461902
115 0.180108103 0.233554663
116 0.293194307 0.180108103
117 0.333037740 0.293194307
118 0.241979013 0.333037740
119 0.232480302 0.241979013
120 0.019181972 0.232480302
121 0.051178487 0.019181972
122 0.067288680 0.051178487
123 0.200193586 0.067288680
124 0.210870651 0.200193586
125 0.162028925 0.210870651
126 0.079406877 0.162028925
127 0.119727062 0.079406877
128 0.224367322 0.119727062
129 0.207981919 0.224367322
130 0.189635275 0.207981919
131 0.041148321 0.189635275
132 -0.057042153 0.041148321
133 -0.189124686 -0.057042153
134 -0.105642851 -0.189124686
135 -0.066413581 -0.105642851
136 -0.153195203 -0.066413581
137 -0.033451508 -0.153195203
138 -0.034832740 -0.033451508
139 -0.010823701 -0.034832740
140 0.133942460 -0.010823701
141 0.191212450 0.133942460
142 0.179828683 0.191212450
143 0.204556333 0.179828683
144 0.104515132 0.204556333
> 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/wessaorg/rcomp/tmp/7h65x1354907477.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/wessaorg/rcomp/tmp/8g9ir1354907477.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/wessaorg/rcomp/tmp/9ntv91354907477.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/wessaorg/rcomp/tmp/10p3491354907477.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/116g6l1354907477.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/wessaorg/rcomp/tmp/12a0rt1354907477.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/wessaorg/rcomp/tmp/13oi241354907477.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/wessaorg/rcomp/tmp/14dfn71354907477.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/wessaorg/rcomp/tmp/15pzy91354907477.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/wessaorg/rcomp/tmp/16byh01354907477.tab")
+ }
>
> try(system("convert tmp/1f34h1354907477.ps tmp/1f34h1354907477.png",intern=TRUE))
character(0)
> try(system("convert tmp/2y7o61354907477.ps tmp/2y7o61354907477.png",intern=TRUE))
character(0)
> try(system("convert tmp/3izwp1354907477.ps tmp/3izwp1354907477.png",intern=TRUE))
character(0)
> try(system("convert tmp/471nh1354907477.ps tmp/471nh1354907477.png",intern=TRUE))
character(0)
> try(system("convert tmp/5w8mg1354907477.ps tmp/5w8mg1354907477.png",intern=TRUE))
character(0)
> try(system("convert tmp/6m4g71354907477.ps tmp/6m4g71354907477.png",intern=TRUE))
character(0)
> try(system("convert tmp/7h65x1354907477.ps tmp/7h65x1354907477.png",intern=TRUE))
character(0)
> try(system("convert tmp/8g9ir1354907477.ps tmp/8g9ir1354907477.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ntv91354907477.ps tmp/9ntv91354907477.png",intern=TRUE))
character(0)
> try(system("convert tmp/10p3491354907477.ps tmp/10p3491354907477.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.102 0.889 7.989