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(2000
+ ,501
+ ,134
+ ,368
+ ,6.70
+ ,8.50
+ ,8.70
+ ,2000
+ ,485
+ ,124
+ ,361
+ ,6.80
+ ,8.40
+ ,8.60
+ ,2000
+ ,464
+ ,113
+ ,351
+ ,6.70
+ ,8.40
+ ,8.60
+ ,2000
+ ,460
+ ,109
+ ,351
+ ,6.60
+ ,8.30
+ ,8.50
+ ,2001
+ ,467
+ ,109
+ ,358
+ ,6.40
+ ,8.20
+ ,8.50
+ ,2001
+ ,460
+ ,106
+ ,354
+ ,6.30
+ ,8.20
+ ,8.50
+ ,2001
+ ,448
+ ,101
+ ,347
+ ,6.30
+ ,8.10
+ ,8.50
+ ,2001
+ ,443
+ ,98
+ ,345
+ ,6.50
+ ,8.10
+ ,8.50
+ ,2001
+ ,436
+ ,93
+ ,343
+ ,6.50
+ ,8.10
+ ,8.50
+ ,2001
+ ,431
+ ,91
+ ,340
+ ,6.40
+ ,8.10
+ ,8.50
+ ,2001
+ ,484
+ ,122
+ ,362
+ ,6.20
+ ,8.10
+ ,8.50
+ ,2001
+ ,510
+ ,139
+ ,370
+ ,6.20
+ ,8.10
+ ,8.60
+ ,2001
+ ,513
+ ,140
+ ,373
+ ,6.50
+ ,8.10
+ ,8.60
+ ,2001
+ ,503
+ ,132
+ ,371
+ ,7.00
+ ,8.20
+ ,8.60
+ ,2001
+ ,471
+ ,117
+ ,354
+ ,7.20
+ ,8.20
+ ,8.70
+ ,2001
+ ,471
+ ,114
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.30
+ ,10.40
+ ,2012
+ ,530
+ ,98
+ ,433
+ ,7.40
+ ,11.40
+ ,10.50
+ ,2012
+ ,582
+ ,122
+ ,460
+ ,7.50
+ ,11.50
+ ,10.50
+ ,2012
+ ,599
+ ,134
+ ,465
+ ,7.40
+ ,11.50
+ ,10.60
+ ,2012
+ ,584
+ ,133
+ ,451
+ ,7.40
+ ,11.60
+ ,10.60)
+ ,dim=c(7
+ ,145)
+ ,dimnames=list(c('jaartal'
+ ,'Totaal'
+ ,'jongerdan25jaar'
+ ,'vanaf25jaar'
+ ,'Belgiƫ'
+ ,'Eurogebied'
+ ,'EU-27
')
+ ,1:145))
> y <- array(NA,dim=c(7,145),dimnames=list(c('jaartal','Totaal','jongerdan25jaar','vanaf25jaar','Belgiƫ','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 = '2'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '2'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date, as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Totaal jaartal jongerdan25jaar vanaf25jaar Belgi\303\253 Eurogebied EU-27\r
1 501 2000 134 368 6.7 8.5 8.7
2 485 2000 124 361 6.8 8.4 8.6
3 464 2000 113 351 6.7 8.4 8.6
4 460 2000 109 351 6.6 8.3 8.5
5 467 2001 109 358 6.4 8.2 8.5
6 460 2001 106 354 6.3 8.2 8.5
7 448 2001 101 347 6.3 8.1 8.5
8 443 2001 98 345 6.5 8.1 8.5
9 436 2001 93 343 6.5 8.1 8.5
10 431 2001 91 340 6.4 8.1 8.5
11 484 2001 122 362 6.2 8.1 8.5
12 510 2001 139 370 6.2 8.1 8.6
13 513 2001 140 373 6.5 8.1 8.6
14 503 2001 132 371 7.0 8.2 8.6
15 471 2001 117 354 7.2 8.2 8.7
16 471 2001 114 357 7.3 8.3 8.7
17 476 2002 113 363 7.4 8.2 8.7
18 475 2002 110 364 7.4 8.3 8.8
19 470 2002 107 363 7.4 8.3 8.8
20 461 2002 103 358 7.3 8.4 8.9
21 455 2002 98 357 7.4 8.5 8.9
22 456 2002 98 357 7.4 8.5 8.9
23 517 2002 137 380 7.6 8.6 9.0
24 525 2002 148 378 7.6 8.6 9.0
25 523 2002 147 376 7.7 8.7 9.0
26 519 2002 139 380 7.7 8.7 9.0
27 509 2002 130 379 7.8 8.8 9.0
28 512 2002 128 384 7.8 8.8 9.0
29 519 2003 127 392 8.0 8.9 9.1
30 517 2003 123 394 8.1 9.0 9.1
31 510 2003 118 392 8.1 9.0 9.1
32 509 2003 114 396 8.2 9.0 9.1
33 501 2003 108 392 8.1 9.0 9.1
34 507 2003 111 396 8.1 9.1 9.1
35 569 2003 151 419 8.1 9.1 9.1
36 580 2003 159 421 8.1 9.0 9.1
37 578 2003 158 420 8.2 9.1 9.1
38 565 2003 148 418 8.2 9.0 9.1
39 547 2003 138 410 8.3 9.1 9.1
40 555 2003 137 418 8.4 9.1 9.2
41 562 2004 136 426 8.6 9.2 9.3
42 561 2004 133 428 8.6 9.2 9.3
43 555 2004 126 430 8.4 9.2 9.3
44 544 2004 120 424 8.0 9.2 9.2
45 537 2004 114 423 7.9 9.2 9.2
46 543 2004 116 427 8.1 9.3 9.2
47 594 2004 153 441 8.5 9.3 9.2
48 611 2004 162 449 8.8 9.3 9.2
49 613 2004 161 452 8.8 9.3 9.2
50 611 2004 149 462 8.5 9.3 9.2
51 594 2004 139 455 8.3 9.4 9.2
52 595 2004 135 461 8.3 9.4 9.2
53 591 2005 130 461 8.3 9.3 9.2
54 589 2005 127 463 8.4 9.3 9.2
55 584 2005 122 462 8.5 9.3 9.2
56 573 2005 117 456 8.5 9.3 9.2
57 567 2005 112 455 8.6 9.2 9.1
58 569 2005 113 456 8.5 9.2 9.1
59 621 2005 149 472 8.6 9.2 9.0
60 629 2005 157 472 8.6 9.1 8.9
61 628 2005 157 471 8.6 9.1 8.9
62 612 2005 147 465 8.5 9.1 9.0
63 595 2005 137 459 8.4 9.1 8.9
64 597 2005 132 465 8.4 9.0 8.8
65 593 2006 125 468 8.5 8.9 8.7
66 590 2006 123 467 8.5 8.8 8.6
67 580 2006 117 463 8.5 8.7 8.5
68 574 2006 114 460 8.6 8.6 8.5
69 573 2006 111 462 8.6 8.6 8.4
70 573 2006 112 461 8.4 8.5 8.3
71 620 2006 144 476 8.2 8.4 8.2
72 626 2006 150 476 8.0 8.4 8.2
73 620 2006 149 471 8.0 8.3 8.1
74 588 2006 134 453 8.0 8.2 8.0
75 566 2006 123 443 8.0 8.2 7.9
76 557 2006 116 442 7.9 8.0 7.8
77 561 2007 117 444 7.9 7.9 7.6
78 549 2007 111 438 7.9 7.8 7.5
79 532 2007 105 427 7.9 7.7 7.4
80 526 2007 102 424 8.0 7.6 7.3
81 511 2007 95 416 7.9 7.6 7.3
82 499 2007 93 406 7.4 7.6 7.2
83 555 2007 124 431 7.2 7.6 7.2
84 565 2007 130 434 7.0 7.6 7.2
85 542 2007 124 418 6.9 7.5 7.1
86 527 2007 115 412 7.1 7.5 7.0
87 510 2007 106 404 7.2 7.4 7.0
88 514 2007 105 409 7.2 7.4 6.9
89 517 2008 105 412 7.1 7.4 6.9
90 508 2008 101 406 6.9 7.3 6.8
91 493 2008 95 398 6.8 7.3 6.8
92 490 2008 93 397 6.8 7.4 6.8
93 469 2008 84 385 6.8 7.5 6.9
94 478 2008 87 390 6.9 7.6 7.0
95 528 2008 116 413 7.1 7.6 7.0
96 534 2008 120 413 7.2 7.7 7.1
97 518 2008 117 401 7.2 7.7 7.2
98 506 2008 109 397 7.1 7.9 7.3
99 502 2008 105 397 7.1 8.1 7.5
100 516 2008 107 409 7.2 8.4 7.7
101 528 2009 109 419 7.5 8.7 8.1
102 533 2009 109 424 7.7 9.0 8.4
103 536 2009 108 428 7.8 9.3 8.6
104 537 2009 107 430 7.7 9.4 8.8
105 524 2009 99 424 7.7 9.5 8.9
106 536 2009 103 433 7.8 9.6 9.1
107 587 2009 131 456 8.0 9.8 9.2
108 597 2009 137 459 8.1 9.8 9.3
109 581 2009 135 446 8.1 9.9 9.4
110 564 2009 124 441 8.0 10.0 9.4
111 558 2009 118 439 8.1 10.0 9.5
112 575 2010 121 454 8.2 10.1 9.5
113 580 2010 121 460 8.4 10.1 9.7
114 575 2010 118 457 8.5 10.1 9.7
115 563 2010 113 451 8.5 10.1 9.7
116 552 2010 107 444 8.5 10.2 9.7
117 537 2010 100 437 8.5 10.2 9.7
118 545 2010 102 443 8.5 10.1 9.6
119 601 2010 130 471 8.4 10.1 9.6
120 604 2010 136 469 8.3 10.1 9.6
121 586 2010 133 454 8.2 10.1 9.6
122 564 2010 120 444 8.1 10.1 9.6
123 549 2010 112 436 7.9 10.1 9.6
124 551 2010 109 442 7.6 10.1 9.6
125 556 2011 110 446 7.3 10.0 9.5
126 548 2011 106 442 7.1 9.9 9.5
127 540 2011 102 438 7.0 9.9 9.4
128 531 2011 98 433 7.1 9.9 9.4
129 521 2011 92 428 7.1 9.9 9.5
130 519 2011 92 426 7.1 10.0 9.5
131 572 2011 120 452 7.3 10.1 9.6
132 581 2011 127 455 7.3 10.2 9.7
133 563 2011 124 439 7.3 10.3 9.8
134 548 2011 114 434 7.2 10.5 9.9
135 539 2011 108 431 7.2 10.6 10.0
136 541 2011 106 435 7.1 10.7 10.0
137 562 2012 111 450 7.1 10.8 10.1
138 559 2012 110 449 7.1 10.9 10.2
139 546 2012 104 442 7.2 11.0 10.3
140 536 2012 100 437 7.3 11.2 10.3
141 528 2012 96 431 7.4 11.3 10.4
142 530 2012 98 433 7.4 11.4 10.5
143 582 2012 122 460 7.5 11.5 10.5
144 599 2012 134 465 7.4 11.5 10.6
145 584 2012 133 451 7.4 11.6 10.6
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) jaartal jongerdan25jaar vanaf25jaar
-110.13929 0.05577 0.99600 1.00020
`Belgi\\303\\253` Eurogebied `EU-27\\r`
-0.07737 -0.45288 0.37661
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.10804 -0.14510 -0.00353 0.14941 1.11853
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.101e+02 8.855e+01 -1.244 0.216
jaartal 5.577e-02 4.433e-02 1.258 0.211
jongerdan25jaar 9.960e-01 3.604e-03 276.390 <2e-16 ***
vanaf25jaar 1.000e+00 3.015e-03 331.711 <2e-16 ***
`Belgi\\303\\253` -7.737e-02 1.127e-01 -0.687 0.494
Eurogebied -4.529e-01 3.525e-01 -1.285 0.201
`EU-27\\r` 3.766e-01 3.310e-01 1.138 0.257
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.5024 on 138 degrees of freedom
Multiple R-squared: 0.9999, Adjusted R-squared: 0.9999
F-statistic: 1.952e+05 on 6 and 138 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,] 0.0424116851 0.084823370 0.9575883
[2,] 0.0120418085 0.024083617 0.9879582
[3,] 0.2301180283 0.460236057 0.7698820
[4,] 0.2058510034 0.411702007 0.7941490
[5,] 0.1250557012 0.250111402 0.8749443
[6,] 0.0718306984 0.143661397 0.9281693
[7,] 0.0706378898 0.141275780 0.9293621
[8,] 0.0418707923 0.083741585 0.9581292
[9,] 0.2231356177 0.446271235 0.7768644
[10,] 0.2076072802 0.415214560 0.7923927
[11,] 0.1608993918 0.321798784 0.8391006
[12,] 0.1129288284 0.225857657 0.8870712
[13,] 0.2277414634 0.455482927 0.7722585
[14,] 0.1861359321 0.372271864 0.8138641
[15,] 0.1923424812 0.384684962 0.8076575
[16,] 0.2704950229 0.540990046 0.7295050
[17,] 0.2194350652 0.438870130 0.7805649
[18,] 0.1721475932 0.344295186 0.8278524
[19,] 0.1311596082 0.262319216 0.8688404
[20,] 0.1010236191 0.202047238 0.8989764
[21,] 0.0741822192 0.148364438 0.9258178
[22,] 0.0535496095 0.107099219 0.9464504
[23,] 0.1423282242 0.284656448 0.8576718
[24,] 0.2929108309 0.585821662 0.7070892
[25,] 0.2421804887 0.484360977 0.7578195
[26,] 0.2753261683 0.550652337 0.7246738
[27,] 0.2523923118 0.504784624 0.7476077
[28,] 0.2398989692 0.479797938 0.7601010
[29,] 0.3081998949 0.616399790 0.6918001
[30,] 0.3442351844 0.688470369 0.6557648
[31,] 0.2975802122 0.595160424 0.7024198
[32,] 0.2501497152 0.500299430 0.7498503
[33,] 0.2072718901 0.414543780 0.7927281
[34,] 0.3425039922 0.685007984 0.6574960
[35,] 0.2964276566 0.592855313 0.7035723
[36,] 0.2513069770 0.502613954 0.7486930
[37,] 0.2138142232 0.427628446 0.7861858
[38,] 0.2017038612 0.403407722 0.7982961
[39,] 0.1904299297 0.380859859 0.8095701
[40,] 0.1703181729 0.340636346 0.8296818
[41,] 0.1447587704 0.289517541 0.8552412
[42,] 0.1211960678 0.242392136 0.8788039
[43,] 0.1621619043 0.324323809 0.8378381
[44,] 0.1318376695 0.263675339 0.8681623
[45,] 0.2077165167 0.415433033 0.7922835
[46,] 0.1756518952 0.351303790 0.8243481
[47,] 0.1454778879 0.290955776 0.8545221
[48,] 0.1182020660 0.236404132 0.8817979
[49,] 0.0950123076 0.190024615 0.9049877
[50,] 0.0759891206 0.151978241 0.9240109
[51,] 0.0598607110 0.119721422 0.9401393
[52,] 0.0467652215 0.093530443 0.9532348
[53,] 0.0357460103 0.071492021 0.9642540
[54,] 0.0768165805 0.153633161 0.9231834
[55,] 0.0610033031 0.122006606 0.9389967
[56,] 0.0476470283 0.095294057 0.9523530
[57,] 0.0367597075 0.073519415 0.9632403
[58,] 0.0281011431 0.056202286 0.9718989
[59,] 0.0214990650 0.042998130 0.9785009
[60,] 0.0159269984 0.031853997 0.9840730
[61,] 0.0117204969 0.023440994 0.9882795
[62,] 0.0083926933 0.016785387 0.9916073
[63,] 0.0059225587 0.011845117 0.9940774
[64,] 0.0041256703 0.008251341 0.9958743
[65,] 0.0087979010 0.017595802 0.9912021
[66,] 0.0067181035 0.013436207 0.9932819
[67,] 0.0298475738 0.059695148 0.9701524
[68,] 0.0226690810 0.045338162 0.9773309
[69,] 0.0170189582 0.034037916 0.9829810
[70,] 0.0126769436 0.025353887 0.9873231
[71,] 0.0092708695 0.018541739 0.9907291
[72,] 0.0069191991 0.013838398 0.9930808
[73,] 0.0055495100 0.011099020 0.9944505
[74,] 0.0039941396 0.007988279 0.9960059
[75,] 0.0079524239 0.015904848 0.9920476
[76,] 0.0059162195 0.011832439 0.9940838
[77,] 0.0042154871 0.008430974 0.9957845
[78,] 0.0031411197 0.006282239 0.9968589
[79,] 0.0022886440 0.004577288 0.9977114
[80,] 0.0015873839 0.003174768 0.9984126
[81,] 0.0028345838 0.005669168 0.9971654
[82,] 0.0021564172 0.004312834 0.9978436
[83,] 0.0015560903 0.003112181 0.9984439
[84,] 0.0012619210 0.002523842 0.9987381
[85,] 0.0017860098 0.003572020 0.9982140
[86,] 0.0063243011 0.012648602 0.9936757
[87,] 0.0161386129 0.032277226 0.9838614
[88,] 0.0122213017 0.024442603 0.9877787
[89,] 0.0087728844 0.017545769 0.9912271
[90,] 0.0063441276 0.012688255 0.9936559
[91,] 0.0046786573 0.009357315 0.9953213
[92,] 0.0032365919 0.006473184 0.9967634
[93,] 0.0021937320 0.004387464 0.9978063
[94,] 0.0015196123 0.003039225 0.9984804
[95,] 0.0012266270 0.002453254 0.9987734
[96,] 0.0014131178 0.002826236 0.9985869
[97,] 0.0011884723 0.002376945 0.9988115
[98,] 0.0007628564 0.001525713 0.9992371
[99,] 0.0027618987 0.005523797 0.9972381
[100,] 0.0019952604 0.003990521 0.9980047
[101,] 0.0089093911 0.017818782 0.9910906
[102,] 0.0140016659 0.028003332 0.9859983
[103,] 0.0100031308 0.020006262 0.9899969
[104,] 0.0199279187 0.039855837 0.9800721
[105,] 0.0144551435 0.028910287 0.9855449
[106,] 0.0360755068 0.072151014 0.9639245
[107,] 0.0667600177 0.133520035 0.9332400
[108,] 0.0489702268 0.097940454 0.9510298
[109,] 0.0348393123 0.069678625 0.9651607
[110,] 0.0312362005 0.062472401 0.9687638
[111,] 0.0326501339 0.065300268 0.9673499
[112,] 0.0549799360 0.109959872 0.9450201
[113,] 0.0431362995 0.086272599 0.9568637
[114,] 0.0703966024 0.140793205 0.9296034
[115,] 0.0604947198 0.120989440 0.9395053
[116,] 0.0412074425 0.082414885 0.9587926
[117,] 0.0281631437 0.056326287 0.9718369
[118,] 0.0217265261 0.043453052 0.9782735
[119,] 0.0199285701 0.039857140 0.9800714
[120,] 0.0217037827 0.043407565 0.9782962
[121,] 0.0274939588 0.054987918 0.9725060
[122,] 0.0194106803 0.038821361 0.9805893
[123,] 0.0368030384 0.073606077 0.9631970
[124,] 0.0264860580 0.052972116 0.9735139
[125,] 0.0216776890 0.043355378 0.9783223
[126,] 0.2956662147 0.591332429 0.7043338
> postscript(file="/var/wessaorg/rcomp/tmp/1qpei1352142772.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/28cx21352142772.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/3w6o51352142772.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/4qmpw1352142772.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/5c84h1352142772.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.844436842 0.117056412 0.067302027 0.035931387 -0.081999450 -0.100940778
7 8 9 10 11 12
-0.164836208 -0.160967795 -0.180576195 -0.195715926 -0.091538504 0.937229206
13 14 15 16 17 18
-0.036159455 0.016198014 -0.062613022 -0.022194250 -0.120716670 0.874705018
19 20 21 22 23 24
-0.137100049 -0.152215946 -0.119000097 0.880999903 0.055564782 -0.900015863
25 26 27 28 29 30
0.149407062 0.116592637 0.133801548 0.124797394 0.086526116 0.123143290
31 32 33 34 35 36
0.103534890 -0.905535924 1.063517543 0.120009914 -0.724523845 0.261802044
37 38 39 40 41 42
0.311024833 -0.773879955 -0.759271821 0.205201336 0.166930058 0.154524580
43 44 45 46 47 48
-0.889361180 0.094543231 0.062996288 0.130960268 0.307169223 0.364793756
49 50 51 52 53 54
0.360191611 0.286959411 0.278157393 -0.739050367 0.139884424 -0.864784382
55 56 57 58 59 60
0.123143753 0.104335901 0.084637007 0.080701933 0.266959549 0.291346398
61 62 63 64 65 66
0.291546535 0.207332652 -0.801559861 0.169603616 0.085331884 0.069901522
67 68 69 70 71 72
0.039064632 -0.009891204 0.015364004 -0.003534497 0.098418588 0.106955653
73 74 75 76 77 78
0.096327573 1.032276986 0.027919958 -1.060543463 -0.082677167 -0.113113783
79 80 81 82 83 84
-0.142549716 -0.153844867 -0.187992587 -0.195017361 -0.091440350 0.916496305
85 86 87 88 89 90
-0.119675615 -0.101356378 -0.173321938 -0.140663672 -0.204769575 0.757323934
91 92 93 94 95 96
-0.272822051 -0.235337669 -0.261324610 0.765043610 -1.108035887 0.923334752
97 98 99 100 101 102
-0.123929495 -0.109964754 -0.110717634 -0.036837362 -0.078173666 -0.040819919
103 104 105 106 107 108
0.022656243 -0.019516093 0.957297879 -0.050793398 0.125040114 1.118526098
109 110 111 112 113 114
0.120751436 -0.884715919 1.061749933 0.068008650 -0.993040198 0.003291680
115 116 117 118 119 120
-1.015516173 1.007162091 -0.019449094 -0.020273475 0.078434594 -0.904891396
121 122 123 124 125 126
-0.921631219 0.020610926 0.974724800 -0.061691240 -0.145095919 -0.221063368
127 128 129 130 131 132
-0.206345746 -0.213615329 0.725714262 0.771402250 -0.098652364 -1.063613602
133 134 135 136 137 138
-0.064789588 -0.058628179 -0.074411148 -0.045664122 0.923200707 -0.072973862
139 140 141 142 143 144
-0.080219611 -0.996913766 1.003643817 -0.981125958 0.162536367 0.164159142
145
0.208247037
> postscript(file="/var/wessaorg/rcomp/tmp/6shtq1352142772.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.844436842 NA
1 0.117056412 -0.844436842
2 0.067302027 0.117056412
3 0.035931387 0.067302027
4 -0.081999450 0.035931387
5 -0.100940778 -0.081999450
6 -0.164836208 -0.100940778
7 -0.160967795 -0.164836208
8 -0.180576195 -0.160967795
9 -0.195715926 -0.180576195
10 -0.091538504 -0.195715926
11 0.937229206 -0.091538504
12 -0.036159455 0.937229206
13 0.016198014 -0.036159455
14 -0.062613022 0.016198014
15 -0.022194250 -0.062613022
16 -0.120716670 -0.022194250
17 0.874705018 -0.120716670
18 -0.137100049 0.874705018
19 -0.152215946 -0.137100049
20 -0.119000097 -0.152215946
21 0.880999903 -0.119000097
22 0.055564782 0.880999903
23 -0.900015863 0.055564782
24 0.149407062 -0.900015863
25 0.116592637 0.149407062
26 0.133801548 0.116592637
27 0.124797394 0.133801548
28 0.086526116 0.124797394
29 0.123143290 0.086526116
30 0.103534890 0.123143290
31 -0.905535924 0.103534890
32 1.063517543 -0.905535924
33 0.120009914 1.063517543
34 -0.724523845 0.120009914
35 0.261802044 -0.724523845
36 0.311024833 0.261802044
37 -0.773879955 0.311024833
38 -0.759271821 -0.773879955
39 0.205201336 -0.759271821
40 0.166930058 0.205201336
41 0.154524580 0.166930058
42 -0.889361180 0.154524580
43 0.094543231 -0.889361180
44 0.062996288 0.094543231
45 0.130960268 0.062996288
46 0.307169223 0.130960268
47 0.364793756 0.307169223
48 0.360191611 0.364793756
49 0.286959411 0.360191611
50 0.278157393 0.286959411
51 -0.739050367 0.278157393
52 0.139884424 -0.739050367
53 -0.864784382 0.139884424
54 0.123143753 -0.864784382
55 0.104335901 0.123143753
56 0.084637007 0.104335901
57 0.080701933 0.084637007
58 0.266959549 0.080701933
59 0.291346398 0.266959549
60 0.291546535 0.291346398
61 0.207332652 0.291546535
62 -0.801559861 0.207332652
63 0.169603616 -0.801559861
64 0.085331884 0.169603616
65 0.069901522 0.085331884
66 0.039064632 0.069901522
67 -0.009891204 0.039064632
68 0.015364004 -0.009891204
69 -0.003534497 0.015364004
70 0.098418588 -0.003534497
71 0.106955653 0.098418588
72 0.096327573 0.106955653
73 1.032276986 0.096327573
74 0.027919958 1.032276986
75 -1.060543463 0.027919958
76 -0.082677167 -1.060543463
77 -0.113113783 -0.082677167
78 -0.142549716 -0.113113783
79 -0.153844867 -0.142549716
80 -0.187992587 -0.153844867
81 -0.195017361 -0.187992587
82 -0.091440350 -0.195017361
83 0.916496305 -0.091440350
84 -0.119675615 0.916496305
85 -0.101356378 -0.119675615
86 -0.173321938 -0.101356378
87 -0.140663672 -0.173321938
88 -0.204769575 -0.140663672
89 0.757323934 -0.204769575
90 -0.272822051 0.757323934
91 -0.235337669 -0.272822051
92 -0.261324610 -0.235337669
93 0.765043610 -0.261324610
94 -1.108035887 0.765043610
95 0.923334752 -1.108035887
96 -0.123929495 0.923334752
97 -0.109964754 -0.123929495
98 -0.110717634 -0.109964754
99 -0.036837362 -0.110717634
100 -0.078173666 -0.036837362
101 -0.040819919 -0.078173666
102 0.022656243 -0.040819919
103 -0.019516093 0.022656243
104 0.957297879 -0.019516093
105 -0.050793398 0.957297879
106 0.125040114 -0.050793398
107 1.118526098 0.125040114
108 0.120751436 1.118526098
109 -0.884715919 0.120751436
110 1.061749933 -0.884715919
111 0.068008650 1.061749933
112 -0.993040198 0.068008650
113 0.003291680 -0.993040198
114 -1.015516173 0.003291680
115 1.007162091 -1.015516173
116 -0.019449094 1.007162091
117 -0.020273475 -0.019449094
118 0.078434594 -0.020273475
119 -0.904891396 0.078434594
120 -0.921631219 -0.904891396
121 0.020610926 -0.921631219
122 0.974724800 0.020610926
123 -0.061691240 0.974724800
124 -0.145095919 -0.061691240
125 -0.221063368 -0.145095919
126 -0.206345746 -0.221063368
127 -0.213615329 -0.206345746
128 0.725714262 -0.213615329
129 0.771402250 0.725714262
130 -0.098652364 0.771402250
131 -1.063613602 -0.098652364
132 -0.064789588 -1.063613602
133 -0.058628179 -0.064789588
134 -0.074411148 -0.058628179
135 -0.045664122 -0.074411148
136 0.923200707 -0.045664122
137 -0.072973862 0.923200707
138 -0.080219611 -0.072973862
139 -0.996913766 -0.080219611
140 1.003643817 -0.996913766
141 -0.981125958 1.003643817
142 0.162536367 -0.981125958
143 0.164159142 0.162536367
144 0.208247037 0.164159142
145 NA 0.208247037
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.117056412 -0.844436842
[2,] 0.067302027 0.117056412
[3,] 0.035931387 0.067302027
[4,] -0.081999450 0.035931387
[5,] -0.100940778 -0.081999450
[6,] -0.164836208 -0.100940778
[7,] -0.160967795 -0.164836208
[8,] -0.180576195 -0.160967795
[9,] -0.195715926 -0.180576195
[10,] -0.091538504 -0.195715926
[11,] 0.937229206 -0.091538504
[12,] -0.036159455 0.937229206
[13,] 0.016198014 -0.036159455
[14,] -0.062613022 0.016198014
[15,] -0.022194250 -0.062613022
[16,] -0.120716670 -0.022194250
[17,] 0.874705018 -0.120716670
[18,] -0.137100049 0.874705018
[19,] -0.152215946 -0.137100049
[20,] -0.119000097 -0.152215946
[21,] 0.880999903 -0.119000097
[22,] 0.055564782 0.880999903
[23,] -0.900015863 0.055564782
[24,] 0.149407062 -0.900015863
[25,] 0.116592637 0.149407062
[26,] 0.133801548 0.116592637
[27,] 0.124797394 0.133801548
[28,] 0.086526116 0.124797394
[29,] 0.123143290 0.086526116
[30,] 0.103534890 0.123143290
[31,] -0.905535924 0.103534890
[32,] 1.063517543 -0.905535924
[33,] 0.120009914 1.063517543
[34,] -0.724523845 0.120009914
[35,] 0.261802044 -0.724523845
[36,] 0.311024833 0.261802044
[37,] -0.773879955 0.311024833
[38,] -0.759271821 -0.773879955
[39,] 0.205201336 -0.759271821
[40,] 0.166930058 0.205201336
[41,] 0.154524580 0.166930058
[42,] -0.889361180 0.154524580
[43,] 0.094543231 -0.889361180
[44,] 0.062996288 0.094543231
[45,] 0.130960268 0.062996288
[46,] 0.307169223 0.130960268
[47,] 0.364793756 0.307169223
[48,] 0.360191611 0.364793756
[49,] 0.286959411 0.360191611
[50,] 0.278157393 0.286959411
[51,] -0.739050367 0.278157393
[52,] 0.139884424 -0.739050367
[53,] -0.864784382 0.139884424
[54,] 0.123143753 -0.864784382
[55,] 0.104335901 0.123143753
[56,] 0.084637007 0.104335901
[57,] 0.080701933 0.084637007
[58,] 0.266959549 0.080701933
[59,] 0.291346398 0.266959549
[60,] 0.291546535 0.291346398
[61,] 0.207332652 0.291546535
[62,] -0.801559861 0.207332652
[63,] 0.169603616 -0.801559861
[64,] 0.085331884 0.169603616
[65,] 0.069901522 0.085331884
[66,] 0.039064632 0.069901522
[67,] -0.009891204 0.039064632
[68,] 0.015364004 -0.009891204
[69,] -0.003534497 0.015364004
[70,] 0.098418588 -0.003534497
[71,] 0.106955653 0.098418588
[72,] 0.096327573 0.106955653
[73,] 1.032276986 0.096327573
[74,] 0.027919958 1.032276986
[75,] -1.060543463 0.027919958
[76,] -0.082677167 -1.060543463
[77,] -0.113113783 -0.082677167
[78,] -0.142549716 -0.113113783
[79,] -0.153844867 -0.142549716
[80,] -0.187992587 -0.153844867
[81,] -0.195017361 -0.187992587
[82,] -0.091440350 -0.195017361
[83,] 0.916496305 -0.091440350
[84,] -0.119675615 0.916496305
[85,] -0.101356378 -0.119675615
[86,] -0.173321938 -0.101356378
[87,] -0.140663672 -0.173321938
[88,] -0.204769575 -0.140663672
[89,] 0.757323934 -0.204769575
[90,] -0.272822051 0.757323934
[91,] -0.235337669 -0.272822051
[92,] -0.261324610 -0.235337669
[93,] 0.765043610 -0.261324610
[94,] -1.108035887 0.765043610
[95,] 0.923334752 -1.108035887
[96,] -0.123929495 0.923334752
[97,] -0.109964754 -0.123929495
[98,] -0.110717634 -0.109964754
[99,] -0.036837362 -0.110717634
[100,] -0.078173666 -0.036837362
[101,] -0.040819919 -0.078173666
[102,] 0.022656243 -0.040819919
[103,] -0.019516093 0.022656243
[104,] 0.957297879 -0.019516093
[105,] -0.050793398 0.957297879
[106,] 0.125040114 -0.050793398
[107,] 1.118526098 0.125040114
[108,] 0.120751436 1.118526098
[109,] -0.884715919 0.120751436
[110,] 1.061749933 -0.884715919
[111,] 0.068008650 1.061749933
[112,] -0.993040198 0.068008650
[113,] 0.003291680 -0.993040198
[114,] -1.015516173 0.003291680
[115,] 1.007162091 -1.015516173
[116,] -0.019449094 1.007162091
[117,] -0.020273475 -0.019449094
[118,] 0.078434594 -0.020273475
[119,] -0.904891396 0.078434594
[120,] -0.921631219 -0.904891396
[121,] 0.020610926 -0.921631219
[122,] 0.974724800 0.020610926
[123,] -0.061691240 0.974724800
[124,] -0.145095919 -0.061691240
[125,] -0.221063368 -0.145095919
[126,] -0.206345746 -0.221063368
[127,] -0.213615329 -0.206345746
[128,] 0.725714262 -0.213615329
[129,] 0.771402250 0.725714262
[130,] -0.098652364 0.771402250
[131,] -1.063613602 -0.098652364
[132,] -0.064789588 -1.063613602
[133,] -0.058628179 -0.064789588
[134,] -0.074411148 -0.058628179
[135,] -0.045664122 -0.074411148
[136,] 0.923200707 -0.045664122
[137,] -0.072973862 0.923200707
[138,] -0.080219611 -0.072973862
[139,] -0.996913766 -0.080219611
[140,] 1.003643817 -0.996913766
[141,] -0.981125958 1.003643817
[142,] 0.162536367 -0.981125958
[143,] 0.164159142 0.162536367
[144,] 0.208247037 0.164159142
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.117056412 -0.844436842
2 0.067302027 0.117056412
3 0.035931387 0.067302027
4 -0.081999450 0.035931387
5 -0.100940778 -0.081999450
6 -0.164836208 -0.100940778
7 -0.160967795 -0.164836208
8 -0.180576195 -0.160967795
9 -0.195715926 -0.180576195
10 -0.091538504 -0.195715926
11 0.937229206 -0.091538504
12 -0.036159455 0.937229206
13 0.016198014 -0.036159455
14 -0.062613022 0.016198014
15 -0.022194250 -0.062613022
16 -0.120716670 -0.022194250
17 0.874705018 -0.120716670
18 -0.137100049 0.874705018
19 -0.152215946 -0.137100049
20 -0.119000097 -0.152215946
21 0.880999903 -0.119000097
22 0.055564782 0.880999903
23 -0.900015863 0.055564782
24 0.149407062 -0.900015863
25 0.116592637 0.149407062
26 0.133801548 0.116592637
27 0.124797394 0.133801548
28 0.086526116 0.124797394
29 0.123143290 0.086526116
30 0.103534890 0.123143290
31 -0.905535924 0.103534890
32 1.063517543 -0.905535924
33 0.120009914 1.063517543
34 -0.724523845 0.120009914
35 0.261802044 -0.724523845
36 0.311024833 0.261802044
37 -0.773879955 0.311024833
38 -0.759271821 -0.773879955
39 0.205201336 -0.759271821
40 0.166930058 0.205201336
41 0.154524580 0.166930058
42 -0.889361180 0.154524580
43 0.094543231 -0.889361180
44 0.062996288 0.094543231
45 0.130960268 0.062996288
46 0.307169223 0.130960268
47 0.364793756 0.307169223
48 0.360191611 0.364793756
49 0.286959411 0.360191611
50 0.278157393 0.286959411
51 -0.739050367 0.278157393
52 0.139884424 -0.739050367
53 -0.864784382 0.139884424
54 0.123143753 -0.864784382
55 0.104335901 0.123143753
56 0.084637007 0.104335901
57 0.080701933 0.084637007
58 0.266959549 0.080701933
59 0.291346398 0.266959549
60 0.291546535 0.291346398
61 0.207332652 0.291546535
62 -0.801559861 0.207332652
63 0.169603616 -0.801559861
64 0.085331884 0.169603616
65 0.069901522 0.085331884
66 0.039064632 0.069901522
67 -0.009891204 0.039064632
68 0.015364004 -0.009891204
69 -0.003534497 0.015364004
70 0.098418588 -0.003534497
71 0.106955653 0.098418588
72 0.096327573 0.106955653
73 1.032276986 0.096327573
74 0.027919958 1.032276986
75 -1.060543463 0.027919958
76 -0.082677167 -1.060543463
77 -0.113113783 -0.082677167
78 -0.142549716 -0.113113783
79 -0.153844867 -0.142549716
80 -0.187992587 -0.153844867
81 -0.195017361 -0.187992587
82 -0.091440350 -0.195017361
83 0.916496305 -0.091440350
84 -0.119675615 0.916496305
85 -0.101356378 -0.119675615
86 -0.173321938 -0.101356378
87 -0.140663672 -0.173321938
88 -0.204769575 -0.140663672
89 0.757323934 -0.204769575
90 -0.272822051 0.757323934
91 -0.235337669 -0.272822051
92 -0.261324610 -0.235337669
93 0.765043610 -0.261324610
94 -1.108035887 0.765043610
95 0.923334752 -1.108035887
96 -0.123929495 0.923334752
97 -0.109964754 -0.123929495
98 -0.110717634 -0.109964754
99 -0.036837362 -0.110717634
100 -0.078173666 -0.036837362
101 -0.040819919 -0.078173666
102 0.022656243 -0.040819919
103 -0.019516093 0.022656243
104 0.957297879 -0.019516093
105 -0.050793398 0.957297879
106 0.125040114 -0.050793398
107 1.118526098 0.125040114
108 0.120751436 1.118526098
109 -0.884715919 0.120751436
110 1.061749933 -0.884715919
111 0.068008650 1.061749933
112 -0.993040198 0.068008650
113 0.003291680 -0.993040198
114 -1.015516173 0.003291680
115 1.007162091 -1.015516173
116 -0.019449094 1.007162091
117 -0.020273475 -0.019449094
118 0.078434594 -0.020273475
119 -0.904891396 0.078434594
120 -0.921631219 -0.904891396
121 0.020610926 -0.921631219
122 0.974724800 0.020610926
123 -0.061691240 0.974724800
124 -0.145095919 -0.061691240
125 -0.221063368 -0.145095919
126 -0.206345746 -0.221063368
127 -0.213615329 -0.206345746
128 0.725714262 -0.213615329
129 0.771402250 0.725714262
130 -0.098652364 0.771402250
131 -1.063613602 -0.098652364
132 -0.064789588 -1.063613602
133 -0.058628179 -0.064789588
134 -0.074411148 -0.058628179
135 -0.045664122 -0.074411148
136 0.923200707 -0.045664122
137 -0.072973862 0.923200707
138 -0.080219611 -0.072973862
139 -0.996913766 -0.080219611
140 1.003643817 -0.996913766
141 -0.981125958 1.003643817
142 0.162536367 -0.981125958
143 0.164159142 0.162536367
144 0.208247037 0.164159142
> 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/7azjq1352142772.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/8b7pu1352142772.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/9drz81352142772.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/1060y91352142772.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/11f57q1352142772.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/12r9mm1352142772.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/133sb11352142772.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/14k8vc1352142772.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/1593ud1352142772.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/164ep61352142772.tab")
+ }
>
> try(system("convert tmp/1qpei1352142772.ps tmp/1qpei1352142772.png",intern=TRUE))
character(0)
> try(system("convert tmp/28cx21352142772.ps tmp/28cx21352142772.png",intern=TRUE))
character(0)
> try(system("convert tmp/3w6o51352142772.ps tmp/3w6o51352142772.png",intern=TRUE))
character(0)
> try(system("convert tmp/4qmpw1352142772.ps tmp/4qmpw1352142772.png",intern=TRUE))
character(0)
> try(system("convert tmp/5c84h1352142772.ps tmp/5c84h1352142772.png",intern=TRUE))
character(0)
> try(system("convert tmp/6shtq1352142772.ps tmp/6shtq1352142772.png",intern=TRUE))
character(0)
> try(system("convert tmp/7azjq1352142772.ps tmp/7azjq1352142772.png",intern=TRUE))
character(0)
> try(system("convert tmp/8b7pu1352142772.ps tmp/8b7pu1352142772.png",intern=TRUE))
character(0)
> try(system("convert tmp/9drz81352142772.ps tmp/9drz81352142772.png",intern=TRUE))
character(0)
> try(system("convert tmp/1060y91352142772.ps tmp/1060y91352142772.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.410 0.912 8.366