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(1
+ ,476000
+ ,113000
+ ,363000
+ ,2
+ ,475000
+ ,110000
+ ,364000
+ ,3
+ ,470000
+ ,107000
+ ,363000
+ ,4
+ ,461000
+ ,103000
+ ,358000
+ ,5
+ ,455000
+ ,98000
+ ,357000
+ ,6
+ ,456000
+ ,98000
+ ,357000
+ ,7
+ ,517000
+ ,137000
+ ,380000
+ ,8
+ ,525000
+ ,148000
+ ,378000
+ ,9
+ ,523000
+ ,147000
+ ,376000
+ ,10
+ ,519000
+ ,139000
+ ,380000
+ ,11
+ ,509000
+ ,130000
+ ,379000
+ ,12
+ ,512000
+ ,128000
+ ,384000
+ ,1
+ ,519000
+ ,127000
+ ,392000
+ ,2
+ ,517000
+ ,123000
+ ,394000
+ ,3
+ ,510000
+ ,118000
+ ,392000
+ ,4
+ ,509000
+ ,114000
+ ,396000
+ ,5
+ ,501000
+ ,108000
+ ,392000
+ ,6
+ ,507000
+ ,111000
+ ,396000
+ ,7
+ ,569000
+ ,151000
+ ,419000
+ ,8
+ ,580000
+ ,159000
+ ,421000
+ ,9
+ ,578000
+ ,158000
+ ,420000
+ ,10
+ ,565000
+ ,148000
+ ,418000
+ ,11
+ ,547000
+ ,138000
+ ,410000
+ ,12
+ ,555000
+ ,137000
+ ,418000
+ ,1
+ ,562000
+ ,136000
+ ,426000
+ ,2
+ ,561000
+ ,133000
+ ,428000
+ ,3
+ ,555000
+ ,126000
+ ,430000
+ ,4
+ ,544000
+ ,120000
+ ,424000
+ ,5
+ ,537000
+ ,114000
+ ,423000
+ ,6
+ ,543000
+ ,116000
+ ,427000
+ ,7
+ ,594000
+ ,153000
+ ,441000
+ ,8
+ ,611000
+ ,162000
+ ,449000
+ ,9
+ ,613000
+ ,161000
+ ,452000
+ ,10
+ ,611000
+ ,149000
+ ,462000
+ ,11
+ ,594000
+ ,139000
+ ,455000
+ ,12
+ ,595000
+ ,135000
+ ,461000
+ ,1
+ ,591000
+ ,130000
+ ,461000
+ ,2
+ ,589000
+ ,127000
+ ,463000
+ ,3
+ ,584000
+ ,122000
+ ,462000
+ ,4
+ ,573000
+ ,117000
+ ,456000
+ ,5
+ ,567000
+ ,112000
+ ,455000
+ ,6
+ ,569000
+ ,113000
+ ,456000
+ ,7
+ ,621000
+ ,149000
+ ,472000
+ ,8
+ ,629000
+ ,157000
+ ,472000
+ ,9
+ ,628000
+ ,157000
+ ,471000
+ ,10
+ ,612000
+ ,147000
+ ,465000
+ ,11
+ ,595000
+ ,137000
+ ,459000
+ ,12
+ ,597000
+ ,132000
+ ,465000
+ ,1
+ ,593000
+ ,125000
+ ,468000
+ ,2
+ ,590000
+ ,123000
+ ,467000
+ ,3
+ ,580000
+ ,117000
+ ,463000
+ ,4
+ ,574000
+ ,114000
+ ,460000
+ ,5
+ ,573000
+ ,111000
+ ,462000
+ ,6
+ ,573000
+ ,112000
+ ,461000
+ ,7
+ ,620000
+ ,144000
+ ,476000
+ ,8
+ ,626000
+ ,150000
+ ,476000
+ ,9
+ ,620000
+ ,149000
+ ,471000
+ ,10
+ ,588000
+ ,134000
+ ,453000
+ ,11
+ ,566000
+ ,123000
+ ,443000
+ ,12
+ ,557000
+ ,116000
+ ,442000
+ ,1
+ ,561000
+ ,117000
+ ,444000
+ ,2
+ ,549000
+ ,111000
+ ,438000
+ ,3
+ ,532000
+ ,105000
+ ,427000
+ ,4
+ ,526000
+ ,102000
+ ,424000
+ ,5
+ ,511000
+ ,95000
+ ,416000
+ ,6
+ ,499000
+ ,93000
+ ,406000
+ ,7
+ ,555000
+ ,124000
+ ,431000
+ ,8
+ ,565000
+ ,130000
+ ,434000
+ ,9
+ ,542000
+ ,124000
+ ,418000
+ ,10
+ ,527000
+ ,115000
+ ,412000
+ ,11
+ ,510000
+ ,106000
+ ,404000
+ ,12
+ ,514000
+ ,105000
+ ,409000
+ ,1
+ ,517000
+ ,105000
+ ,412000
+ ,2
+ ,508000
+ ,101000
+ ,406000
+ ,3
+ ,493000
+ ,95000
+ ,398000
+ ,4
+ ,490000
+ ,93000
+ ,397000
+ ,5
+ ,469000
+ ,84000
+ ,385000
+ ,6
+ ,478000
+ ,87000
+ ,390000
+ ,7
+ ,528000
+ ,116000
+ ,413000
+ ,8
+ ,534000
+ ,120000
+ ,413000
+ ,9
+ ,518000
+ ,117000
+ ,401000
+ ,10
+ ,506000
+ ,109000
+ ,397000
+ ,11
+ ,502000
+ ,105000
+ ,397000
+ ,12
+ ,516000
+ ,107000
+ ,409000
+ ,1
+ ,528000
+ ,109000
+ ,419000
+ ,2
+ ,533000
+ ,109000
+ ,424000
+ ,3
+ ,536000
+ ,108000
+ ,428000
+ ,4
+ ,537000
+ ,107000
+ ,430000
+ ,5
+ ,524000
+ ,99000
+ ,424000
+ ,6
+ ,536000
+ ,103000
+ ,433000
+ ,7
+ ,587000
+ ,131000
+ ,456000
+ ,8
+ ,597000
+ ,137000
+ ,459000
+ ,9
+ ,581000
+ ,135000
+ ,446000
+ ,10
+ ,564000
+ ,124000
+ ,441000
+ ,11
+ ,558000
+ ,118000
+ ,439000
+ ,12
+ ,575000
+ ,121000
+ ,454000
+ ,1
+ ,580000
+ ,121000
+ ,460000
+ ,2
+ ,575000
+ ,118000
+ ,457000
+ ,3
+ ,563000
+ ,113000
+ ,451000
+ ,4
+ ,552000
+ ,107000
+ ,444000
+ ,5
+ ,537000
+ ,100000
+ ,437000
+ ,6
+ ,545000
+ ,102000
+ ,443000
+ ,7
+ ,601000
+ ,130000
+ ,471000
+ ,8
+ ,604000
+ ,136000
+ ,469000
+ ,9
+ ,586000
+ ,133000
+ ,454000
+ ,10
+ ,564000
+ ,120000
+ ,444000
+ ,11
+ ,549000
+ ,112000
+ ,436000
+ ,12
+ ,551000
+ ,109000
+ ,442000
+ ,1
+ ,556000
+ ,110000
+ ,446000
+ ,2
+ ,548000
+ ,106000
+ ,442000
+ ,3
+ ,540000
+ ,102000
+ ,438000
+ ,4
+ ,531000
+ ,98000
+ ,433000
+ ,5
+ ,521000
+ ,92000
+ ,428000
+ ,6
+ ,519000
+ ,92000
+ ,426000
+ ,7
+ ,572000
+ ,120000
+ ,452000
+ ,8
+ ,581000
+ ,127000
+ ,455000
+ ,9
+ ,563000
+ ,124000
+ ,439000
+ ,10
+ ,548000
+ ,114000
+ ,434000
+ ,11
+ ,539000
+ ,108000
+ ,431000
+ ,12
+ ,541000
+ ,106000
+ ,435000
+ ,1
+ ,562000
+ ,111000
+ ,450000
+ ,2
+ ,559000
+ ,110000
+ ,449000
+ ,3
+ ,546000
+ ,104000
+ ,442000
+ ,4
+ ,536000
+ ,100000
+ ,437000
+ ,5
+ ,528000
+ ,96000
+ ,431000
+ ,6
+ ,530000
+ ,98000
+ ,433000
+ ,7
+ ,582000
+ ,122000
+ ,460000
+ ,8
+ ,599000
+ ,134000
+ ,465000
+ ,9
+ ,584000
+ ,133000
+ ,451000
+ ,10
+ ,571000
+ ,125000
+ ,447000)
+ ,dim=c(4
+ ,130)
+ ,dimnames=list(c('Maanden'
+ ,'Totaal'
+ ,'jongerdan25jaar'
+ ,'vanaf25jaar')
+ ,1:130))
> y <- array(NA,dim=c(4,130),dimnames=list(c('Maanden','Totaal','jongerdan25jaar','vanaf25jaar'),1:130))
> 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 = 'Do not include Seasonal Dummies'
> par1 = '4'
> 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
vanaf25jaar Maanden Totaal jongerdan25jaar t
1 363000 1 476000 113000 1
2 364000 2 475000 110000 2
3 363000 3 470000 107000 3
4 358000 4 461000 103000 4
5 357000 5 455000 98000 5
6 357000 6 456000 98000 6
7 380000 7 517000 137000 7
8 378000 8 525000 148000 8
9 376000 9 523000 147000 9
10 380000 10 519000 139000 10
11 379000 11 509000 130000 11
12 384000 12 512000 128000 12
13 392000 1 519000 127000 13
14 394000 2 517000 123000 14
15 392000 3 510000 118000 15
16 396000 4 509000 114000 16
17 392000 5 501000 108000 17
18 396000 6 507000 111000 18
19 419000 7 569000 151000 19
20 421000 8 580000 159000 20
21 420000 9 578000 158000 21
22 418000 10 565000 148000 22
23 410000 11 547000 138000 23
24 418000 12 555000 137000 24
25 426000 1 562000 136000 25
26 428000 2 561000 133000 26
27 430000 3 555000 126000 27
28 424000 4 544000 120000 28
29 423000 5 537000 114000 29
30 427000 6 543000 116000 30
31 441000 7 594000 153000 31
32 449000 8 611000 162000 32
33 452000 9 613000 161000 33
34 462000 10 611000 149000 34
35 455000 11 594000 139000 35
36 461000 12 595000 135000 36
37 461000 1 591000 130000 37
38 463000 2 589000 127000 38
39 462000 3 584000 122000 39
40 456000 4 573000 117000 40
41 455000 5 567000 112000 41
42 456000 6 569000 113000 42
43 472000 7 621000 149000 43
44 472000 8 629000 157000 44
45 471000 9 628000 157000 45
46 465000 10 612000 147000 46
47 459000 11 595000 137000 47
48 465000 12 597000 132000 48
49 468000 1 593000 125000 49
50 467000 2 590000 123000 50
51 463000 3 580000 117000 51
52 460000 4 574000 114000 52
53 462000 5 573000 111000 53
54 461000 6 573000 112000 54
55 476000 7 620000 144000 55
56 476000 8 626000 150000 56
57 471000 9 620000 149000 57
58 453000 10 588000 134000 58
59 443000 11 566000 123000 59
60 442000 12 557000 116000 60
61 444000 1 561000 117000 61
62 438000 2 549000 111000 62
63 427000 3 532000 105000 63
64 424000 4 526000 102000 64
65 416000 5 511000 95000 65
66 406000 6 499000 93000 66
67 431000 7 555000 124000 67
68 434000 8 565000 130000 68
69 418000 9 542000 124000 69
70 412000 10 527000 115000 70
71 404000 11 510000 106000 71
72 409000 12 514000 105000 72
73 412000 1 517000 105000 73
74 406000 2 508000 101000 74
75 398000 3 493000 95000 75
76 397000 4 490000 93000 76
77 385000 5 469000 84000 77
78 390000 6 478000 87000 78
79 413000 7 528000 116000 79
80 413000 8 534000 120000 80
81 401000 9 518000 117000 81
82 397000 10 506000 109000 82
83 397000 11 502000 105000 83
84 409000 12 516000 107000 84
85 419000 1 528000 109000 85
86 424000 2 533000 109000 86
87 428000 3 536000 108000 87
88 430000 4 537000 107000 88
89 424000 5 524000 99000 89
90 433000 6 536000 103000 90
91 456000 7 587000 131000 91
92 459000 8 597000 137000 92
93 446000 9 581000 135000 93
94 441000 10 564000 124000 94
95 439000 11 558000 118000 95
96 454000 12 575000 121000 96
97 460000 1 580000 121000 97
98 457000 2 575000 118000 98
99 451000 3 563000 113000 99
100 444000 4 552000 107000 100
101 437000 5 537000 100000 101
102 443000 6 545000 102000 102
103 471000 7 601000 130000 103
104 469000 8 604000 136000 104
105 454000 9 586000 133000 105
106 444000 10 564000 120000 106
107 436000 11 549000 112000 107
108 442000 12 551000 109000 108
109 446000 1 556000 110000 109
110 442000 2 548000 106000 110
111 438000 3 540000 102000 111
112 433000 4 531000 98000 112
113 428000 5 521000 92000 113
114 426000 6 519000 92000 114
115 452000 7 572000 120000 115
116 455000 8 581000 127000 116
117 439000 9 563000 124000 117
118 434000 10 548000 114000 118
119 431000 11 539000 108000 119
120 435000 12 541000 106000 120
121 450000 1 562000 111000 121
122 449000 2 559000 110000 122
123 442000 3 546000 104000 123
124 437000 4 536000 100000 124
125 431000 5 528000 96000 125
126 433000 6 530000 98000 126
127 460000 7 582000 122000 127
128 465000 8 599000 134000 128
129 451000 9 584000 133000 129
130 447000 10 571000 125000 130
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Maanden Totaal jongerdan25jaar
-1173.3608 0.1358 1.0005 -0.9925
t
0.3792
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1183.02 -171.55 6.62 104.73 1129.86
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.173e+03 7.248e+02 -1.619 0.108
Maanden 1.358e-01 1.544e+01 0.009 0.993
Totaal 1.000e+00 2.289e-03 437.136 <2e-16 ***
jongerdan25jaar -9.925e-01 5.858e-03 -169.432 <2e-16 ***
t 3.792e-01 1.869e+00 0.203 0.840
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 523.8 on 125 degrees of freedom
Multiple R-squared: 0.9997, Adjusted R-squared: 0.9997
F-statistic: 1.025e+05 on 4 and 125 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.659886327 0.680227345 0.3401137
[2,] 0.770367954 0.459264092 0.2296320
[3,] 0.658348711 0.683302577 0.3416513
[4,] 0.572952006 0.854095988 0.4270480
[5,] 0.498089670 0.996179340 0.5019103
[6,] 0.386643655 0.773287310 0.6133563
[7,] 0.291826598 0.583653195 0.7081734
[8,] 0.212858875 0.425717750 0.7871411
[9,] 0.473112888 0.946225776 0.5268871
[10,] 0.648314680 0.703370640 0.3516853
[11,] 0.573570175 0.852859651 0.4264298
[12,] 0.551614193 0.896771615 0.4483858
[13,] 0.588972209 0.822055582 0.4110278
[14,] 0.567361846 0.865276309 0.4326382
[15,] 0.610464312 0.779071375 0.3895357
[16,] 0.641367396 0.717265207 0.3586326
[17,] 0.589776589 0.820446822 0.4102234
[18,] 0.559136394 0.881727211 0.4408636
[19,] 0.502516014 0.994967972 0.4974840
[20,] 0.603749710 0.792500579 0.3962503
[21,] 0.551390899 0.897218202 0.4486091
[22,] 0.490735108 0.981470215 0.5092649
[23,] 0.430012925 0.860025849 0.5699871
[24,] 0.429488174 0.858976348 0.5705118
[25,] 0.425872297 0.851744594 0.5741277
[26,] 0.402362630 0.804725259 0.5976374
[27,] 0.347034752 0.694069505 0.6529652
[28,] 0.293450488 0.586900977 0.7065495
[29,] 0.395097399 0.790194799 0.6049026
[30,] 0.341583581 0.683167162 0.6584164
[31,] 0.433617466 0.867234932 0.5663825
[32,] 0.384327573 0.768655146 0.6156724
[33,] 0.334663349 0.669326697 0.6653367
[34,] 0.286272443 0.572544885 0.7137276
[35,] 0.241607536 0.483215072 0.7583925
[36,] 0.216635533 0.433271067 0.7833645
[37,] 0.193696666 0.387393332 0.8063033
[38,] 0.167679314 0.335358629 0.8323207
[39,] 0.137711075 0.275422150 0.8622889
[40,] 0.199024636 0.398049271 0.8009754
[41,] 0.168882604 0.337765207 0.8311174
[42,] 0.137022045 0.274044089 0.8629780
[43,] 0.109465237 0.218930473 0.8905348
[44,] 0.086230145 0.172460290 0.9137699
[45,] 0.067124226 0.134248452 0.9328758
[46,] 0.051760436 0.103520872 0.9482396
[47,] 0.039517297 0.079034594 0.9604827
[48,] 0.030327663 0.060655326 0.9696723
[49,] 0.023092330 0.046184660 0.9769077
[50,] 0.017115886 0.034231771 0.9828841
[51,] 0.034720341 0.069440681 0.9652797
[52,] 0.028884799 0.057769598 0.9711152
[53,] 0.083757931 0.167515862 0.9162421
[54,] 0.067256299 0.134512599 0.9327437
[55,] 0.053291078 0.106582155 0.9467089
[56,] 0.042170884 0.084341767 0.9578291
[57,] 0.033319833 0.066639667 0.9666802
[58,] 0.027125602 0.054251205 0.9728744
[59,] 0.022233226 0.044466452 0.9777668
[60,] 0.016245569 0.032491137 0.9837544
[61,] 0.038591716 0.077183432 0.9614083
[62,] 0.029234270 0.058468540 0.9707657
[63,] 0.021831995 0.043663990 0.9781680
[64,] 0.016544278 0.033088556 0.9834557
[65,] 0.012747569 0.025495138 0.9872524
[66,] 0.009546013 0.019092026 0.9904540
[67,] 0.014235803 0.028471605 0.9857642
[68,] 0.011283171 0.022566342 0.9887168
[69,] 0.008915552 0.017831105 0.9910844
[70,] 0.007726233 0.015452467 0.9922738
[71,] 0.009050066 0.018100132 0.9909499
[72,] 0.025940672 0.051881343 0.9740593
[73,] 0.050975190 0.101950381 0.9490248
[74,] 0.039431808 0.078863616 0.9605682
[75,] 0.029741017 0.059482033 0.9702590
[76,] 0.022458477 0.044916955 0.9775415
[77,] 0.017339055 0.034678111 0.9826609
[78,] 0.012772548 0.025545095 0.9872275
[79,] 0.009197864 0.018395728 0.9908021
[80,] 0.006580315 0.013160631 0.9934197
[81,] 0.004750059 0.009500117 0.9952499
[82,] 0.006261402 0.012522803 0.9937386
[83,] 0.004621854 0.009243708 0.9953781
[84,] 0.003131354 0.006262708 0.9968686
[85,] 0.015096439 0.030192878 0.9849036
[86,] 0.013714982 0.027429964 0.9862850
[87,] 0.024536310 0.049072620 0.9754637
[88,] 0.052025195 0.104050389 0.9479748
[89,] 0.038365238 0.076730476 0.9616348
[90,] 0.060663995 0.121327991 0.9393360
[91,] 0.045459977 0.090919954 0.9545400
[92,] 0.096568381 0.193136763 0.9034316
[93,] 0.135619392 0.271238784 0.8643806
[94,] 0.110530144 0.221060288 0.8894699
[95,] 0.090576390 0.181152780 0.9094236
[96,] 0.069978871 0.139957743 0.9300211
[97,] 0.087034695 0.174069390 0.9129653
[98,] 0.124948210 0.249896420 0.8750518
[99,] 0.095424004 0.190848007 0.9045760
[100,] 0.140632689 0.281265378 0.8593673
[101,] 0.108019282 0.216038564 0.8919807
[102,] 0.081938726 0.163877451 0.9180613
[103,] 0.063908881 0.127817762 0.9360911
[104,] 0.052817813 0.105635626 0.9471822
[105,] 0.046970928 0.093941855 0.9530291
[106,] 0.043538122 0.087076245 0.9564619
[107,] 0.055996963 0.111993925 0.9440030
[108,] 0.035761102 0.071522205 0.9642389
[109,] 0.148581806 0.297163613 0.8514182
[110,] 0.106397425 0.212794849 0.8936026
[111,] 0.070021727 0.140043455 0.9299783
[112,] 0.041149205 0.082298411 0.9588508
[113,] 0.021823708 0.043647416 0.9781763
[114,] 0.019547171 0.039094342 0.9804528
[115,] 0.008603682 0.017207364 0.9913963
> postscript(file="/var/fisher/rcomp/tmp/1g1o11353452170.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/2x00s1353452170.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/3vigq1353452170.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/4fjop1353452170.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/5pcdr1353452171.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 = 130
Frequency = 1
1 2 3 4 5
91.7861750 -885.7237848 138.7240135 172.6347600 212.5823776
6 7 8 9 10
-788.4220309 -111.4952166 801.5172096 -190.5136904 -129.0293823
11 12 13 14 15
-57.1032470 -44.0761549 -38.8825073 -8.3978377 32.0392194
16 17 18 19 20
1062.0344495 -889.5338639 84.4989603 753.4311451 -312.5091777
21 22 23 24 25
-304.5400777 776.3595661 859.7064076 -137.2188879 -132.0252404
26 27 28 29 30
-109.5352002 945.4227972 -4.6771976 43.2650494 24.8030635
31 32 33 34 35
-278.3653471 -354.7474970 -348.7361552 -258.2099667 -175.3525648
36 37 38 39 40
853.6637862 -105.7379719 917.2415079 -43.3003140 -0.9054987
41 42 43 44 45
39.0421190 30.0430811 -266.1095792 -330.5815834 -330.6071128
46 47 48 49 50
-248.2391504 834.6182516 -129.3496472 -73.7410255 -57.7772960
51 52 53 54 55
-8.3667304 16.5705076 39.0605477 31.0403890 -232.6443141
56 57 58 59 60
-281.1270595 -271.2002013 -1143.4752569 -50.6654673 1005.7608487
61 62 63 64 65
-2.5875649 47.8018799 100.6385224 125.5757603 184.9387136
66 67 68 69 70
205.3073989 -55.2770702 -1105.7175738 -49.9442940 24.4290390
71 72 73 74 75
99.7812511 104.8137138 104.4599297 -861.6293239 190.2284395
76 77 78 79 80
206.1921690 283.5021392 -743.9333552 1013.4291926 -1020.0431730
81 82 83 84 85
9.7884604 75.1882849 106.6518335 84.2743312 64.5052115
86 87 88 89 90
61.5430448 67.0649471 73.5657284 -860.5450075 103.0459896
91 92 93 94 95
-132.5757123 -1183.0162159 -160.6897723 929.6728195 -1022.8743730
96 97 98 99 100
-54.2253838 944.4419529 -31.1102487 1011.7740062 -938.3259886
101 102 103 104 105
121.0369647 101.5960997 -136.4727999 816.5127734 847.3232859
106 107 108 109 110
-44.8565449 -977.9884017 43.0333198 34.1954667 67.6167736
111 112 113 114 115
101.0380805 134.9488269 -815.6406074 -815.1766973 -51.7772782
116 117 118 119 120
890.7664679 -78.4230196 3.4555032 52.3766294 65.8931611
121 122 123 124 125
-980.7964842 27.6620553 78.5409397 1112.9411256 -853.6375675
126 127 128 129 130
1129.8582048 -76.2321772 -175.1298967 -160.7980826 905.0911814
> postscript(file="/var/fisher/rcomp/tmp/6qk081353452171.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 = 130
Frequency = 1
lag(myerror, k = 1) myerror
0 91.7861750 NA
1 -885.7237848 91.7861750
2 138.7240135 -885.7237848
3 172.6347600 138.7240135
4 212.5823776 172.6347600
5 -788.4220309 212.5823776
6 -111.4952166 -788.4220309
7 801.5172096 -111.4952166
8 -190.5136904 801.5172096
9 -129.0293823 -190.5136904
10 -57.1032470 -129.0293823
11 -44.0761549 -57.1032470
12 -38.8825073 -44.0761549
13 -8.3978377 -38.8825073
14 32.0392194 -8.3978377
15 1062.0344495 32.0392194
16 -889.5338639 1062.0344495
17 84.4989603 -889.5338639
18 753.4311451 84.4989603
19 -312.5091777 753.4311451
20 -304.5400777 -312.5091777
21 776.3595661 -304.5400777
22 859.7064076 776.3595661
23 -137.2188879 859.7064076
24 -132.0252404 -137.2188879
25 -109.5352002 -132.0252404
26 945.4227972 -109.5352002
27 -4.6771976 945.4227972
28 43.2650494 -4.6771976
29 24.8030635 43.2650494
30 -278.3653471 24.8030635
31 -354.7474970 -278.3653471
32 -348.7361552 -354.7474970
33 -258.2099667 -348.7361552
34 -175.3525648 -258.2099667
35 853.6637862 -175.3525648
36 -105.7379719 853.6637862
37 917.2415079 -105.7379719
38 -43.3003140 917.2415079
39 -0.9054987 -43.3003140
40 39.0421190 -0.9054987
41 30.0430811 39.0421190
42 -266.1095792 30.0430811
43 -330.5815834 -266.1095792
44 -330.6071128 -330.5815834
45 -248.2391504 -330.6071128
46 834.6182516 -248.2391504
47 -129.3496472 834.6182516
48 -73.7410255 -129.3496472
49 -57.7772960 -73.7410255
50 -8.3667304 -57.7772960
51 16.5705076 -8.3667304
52 39.0605477 16.5705076
53 31.0403890 39.0605477
54 -232.6443141 31.0403890
55 -281.1270595 -232.6443141
56 -271.2002013 -281.1270595
57 -1143.4752569 -271.2002013
58 -50.6654673 -1143.4752569
59 1005.7608487 -50.6654673
60 -2.5875649 1005.7608487
61 47.8018799 -2.5875649
62 100.6385224 47.8018799
63 125.5757603 100.6385224
64 184.9387136 125.5757603
65 205.3073989 184.9387136
66 -55.2770702 205.3073989
67 -1105.7175738 -55.2770702
68 -49.9442940 -1105.7175738
69 24.4290390 -49.9442940
70 99.7812511 24.4290390
71 104.8137138 99.7812511
72 104.4599297 104.8137138
73 -861.6293239 104.4599297
74 190.2284395 -861.6293239
75 206.1921690 190.2284395
76 283.5021392 206.1921690
77 -743.9333552 283.5021392
78 1013.4291926 -743.9333552
79 -1020.0431730 1013.4291926
80 9.7884604 -1020.0431730
81 75.1882849 9.7884604
82 106.6518335 75.1882849
83 84.2743312 106.6518335
84 64.5052115 84.2743312
85 61.5430448 64.5052115
86 67.0649471 61.5430448
87 73.5657284 67.0649471
88 -860.5450075 73.5657284
89 103.0459896 -860.5450075
90 -132.5757123 103.0459896
91 -1183.0162159 -132.5757123
92 -160.6897723 -1183.0162159
93 929.6728195 -160.6897723
94 -1022.8743730 929.6728195
95 -54.2253838 -1022.8743730
96 944.4419529 -54.2253838
97 -31.1102487 944.4419529
98 1011.7740062 -31.1102487
99 -938.3259886 1011.7740062
100 121.0369647 -938.3259886
101 101.5960997 121.0369647
102 -136.4727999 101.5960997
103 816.5127734 -136.4727999
104 847.3232859 816.5127734
105 -44.8565449 847.3232859
106 -977.9884017 -44.8565449
107 43.0333198 -977.9884017
108 34.1954667 43.0333198
109 67.6167736 34.1954667
110 101.0380805 67.6167736
111 134.9488269 101.0380805
112 -815.6406074 134.9488269
113 -815.1766973 -815.6406074
114 -51.7772782 -815.1766973
115 890.7664679 -51.7772782
116 -78.4230196 890.7664679
117 3.4555032 -78.4230196
118 52.3766294 3.4555032
119 65.8931611 52.3766294
120 -980.7964842 65.8931611
121 27.6620553 -980.7964842
122 78.5409397 27.6620553
123 1112.9411256 78.5409397
124 -853.6375675 1112.9411256
125 1129.8582048 -853.6375675
126 -76.2321772 1129.8582048
127 -175.1298967 -76.2321772
128 -160.7980826 -175.1298967
129 905.0911814 -160.7980826
130 NA 905.0911814
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -885.7237848 91.7861750
[2,] 138.7240135 -885.7237848
[3,] 172.6347600 138.7240135
[4,] 212.5823776 172.6347600
[5,] -788.4220309 212.5823776
[6,] -111.4952166 -788.4220309
[7,] 801.5172096 -111.4952166
[8,] -190.5136904 801.5172096
[9,] -129.0293823 -190.5136904
[10,] -57.1032470 -129.0293823
[11,] -44.0761549 -57.1032470
[12,] -38.8825073 -44.0761549
[13,] -8.3978377 -38.8825073
[14,] 32.0392194 -8.3978377
[15,] 1062.0344495 32.0392194
[16,] -889.5338639 1062.0344495
[17,] 84.4989603 -889.5338639
[18,] 753.4311451 84.4989603
[19,] -312.5091777 753.4311451
[20,] -304.5400777 -312.5091777
[21,] 776.3595661 -304.5400777
[22,] 859.7064076 776.3595661
[23,] -137.2188879 859.7064076
[24,] -132.0252404 -137.2188879
[25,] -109.5352002 -132.0252404
[26,] 945.4227972 -109.5352002
[27,] -4.6771976 945.4227972
[28,] 43.2650494 -4.6771976
[29,] 24.8030635 43.2650494
[30,] -278.3653471 24.8030635
[31,] -354.7474970 -278.3653471
[32,] -348.7361552 -354.7474970
[33,] -258.2099667 -348.7361552
[34,] -175.3525648 -258.2099667
[35,] 853.6637862 -175.3525648
[36,] -105.7379719 853.6637862
[37,] 917.2415079 -105.7379719
[38,] -43.3003140 917.2415079
[39,] -0.9054987 -43.3003140
[40,] 39.0421190 -0.9054987
[41,] 30.0430811 39.0421190
[42,] -266.1095792 30.0430811
[43,] -330.5815834 -266.1095792
[44,] -330.6071128 -330.5815834
[45,] -248.2391504 -330.6071128
[46,] 834.6182516 -248.2391504
[47,] -129.3496472 834.6182516
[48,] -73.7410255 -129.3496472
[49,] -57.7772960 -73.7410255
[50,] -8.3667304 -57.7772960
[51,] 16.5705076 -8.3667304
[52,] 39.0605477 16.5705076
[53,] 31.0403890 39.0605477
[54,] -232.6443141 31.0403890
[55,] -281.1270595 -232.6443141
[56,] -271.2002013 -281.1270595
[57,] -1143.4752569 -271.2002013
[58,] -50.6654673 -1143.4752569
[59,] 1005.7608487 -50.6654673
[60,] -2.5875649 1005.7608487
[61,] 47.8018799 -2.5875649
[62,] 100.6385224 47.8018799
[63,] 125.5757603 100.6385224
[64,] 184.9387136 125.5757603
[65,] 205.3073989 184.9387136
[66,] -55.2770702 205.3073989
[67,] -1105.7175738 -55.2770702
[68,] -49.9442940 -1105.7175738
[69,] 24.4290390 -49.9442940
[70,] 99.7812511 24.4290390
[71,] 104.8137138 99.7812511
[72,] 104.4599297 104.8137138
[73,] -861.6293239 104.4599297
[74,] 190.2284395 -861.6293239
[75,] 206.1921690 190.2284395
[76,] 283.5021392 206.1921690
[77,] -743.9333552 283.5021392
[78,] 1013.4291926 -743.9333552
[79,] -1020.0431730 1013.4291926
[80,] 9.7884604 -1020.0431730
[81,] 75.1882849 9.7884604
[82,] 106.6518335 75.1882849
[83,] 84.2743312 106.6518335
[84,] 64.5052115 84.2743312
[85,] 61.5430448 64.5052115
[86,] 67.0649471 61.5430448
[87,] 73.5657284 67.0649471
[88,] -860.5450075 73.5657284
[89,] 103.0459896 -860.5450075
[90,] -132.5757123 103.0459896
[91,] -1183.0162159 -132.5757123
[92,] -160.6897723 -1183.0162159
[93,] 929.6728195 -160.6897723
[94,] -1022.8743730 929.6728195
[95,] -54.2253838 -1022.8743730
[96,] 944.4419529 -54.2253838
[97,] -31.1102487 944.4419529
[98,] 1011.7740062 -31.1102487
[99,] -938.3259886 1011.7740062
[100,] 121.0369647 -938.3259886
[101,] 101.5960997 121.0369647
[102,] -136.4727999 101.5960997
[103,] 816.5127734 -136.4727999
[104,] 847.3232859 816.5127734
[105,] -44.8565449 847.3232859
[106,] -977.9884017 -44.8565449
[107,] 43.0333198 -977.9884017
[108,] 34.1954667 43.0333198
[109,] 67.6167736 34.1954667
[110,] 101.0380805 67.6167736
[111,] 134.9488269 101.0380805
[112,] -815.6406074 134.9488269
[113,] -815.1766973 -815.6406074
[114,] -51.7772782 -815.1766973
[115,] 890.7664679 -51.7772782
[116,] -78.4230196 890.7664679
[117,] 3.4555032 -78.4230196
[118,] 52.3766294 3.4555032
[119,] 65.8931611 52.3766294
[120,] -980.7964842 65.8931611
[121,] 27.6620553 -980.7964842
[122,] 78.5409397 27.6620553
[123,] 1112.9411256 78.5409397
[124,] -853.6375675 1112.9411256
[125,] 1129.8582048 -853.6375675
[126,] -76.2321772 1129.8582048
[127,] -175.1298967 -76.2321772
[128,] -160.7980826 -175.1298967
[129,] 905.0911814 -160.7980826
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -885.7237848 91.7861750
2 138.7240135 -885.7237848
3 172.6347600 138.7240135
4 212.5823776 172.6347600
5 -788.4220309 212.5823776
6 -111.4952166 -788.4220309
7 801.5172096 -111.4952166
8 -190.5136904 801.5172096
9 -129.0293823 -190.5136904
10 -57.1032470 -129.0293823
11 -44.0761549 -57.1032470
12 -38.8825073 -44.0761549
13 -8.3978377 -38.8825073
14 32.0392194 -8.3978377
15 1062.0344495 32.0392194
16 -889.5338639 1062.0344495
17 84.4989603 -889.5338639
18 753.4311451 84.4989603
19 -312.5091777 753.4311451
20 -304.5400777 -312.5091777
21 776.3595661 -304.5400777
22 859.7064076 776.3595661
23 -137.2188879 859.7064076
24 -132.0252404 -137.2188879
25 -109.5352002 -132.0252404
26 945.4227972 -109.5352002
27 -4.6771976 945.4227972
28 43.2650494 -4.6771976
29 24.8030635 43.2650494
30 -278.3653471 24.8030635
31 -354.7474970 -278.3653471
32 -348.7361552 -354.7474970
33 -258.2099667 -348.7361552
34 -175.3525648 -258.2099667
35 853.6637862 -175.3525648
36 -105.7379719 853.6637862
37 917.2415079 -105.7379719
38 -43.3003140 917.2415079
39 -0.9054987 -43.3003140
40 39.0421190 -0.9054987
41 30.0430811 39.0421190
42 -266.1095792 30.0430811
43 -330.5815834 -266.1095792
44 -330.6071128 -330.5815834
45 -248.2391504 -330.6071128
46 834.6182516 -248.2391504
47 -129.3496472 834.6182516
48 -73.7410255 -129.3496472
49 -57.7772960 -73.7410255
50 -8.3667304 -57.7772960
51 16.5705076 -8.3667304
52 39.0605477 16.5705076
53 31.0403890 39.0605477
54 -232.6443141 31.0403890
55 -281.1270595 -232.6443141
56 -271.2002013 -281.1270595
57 -1143.4752569 -271.2002013
58 -50.6654673 -1143.4752569
59 1005.7608487 -50.6654673
60 -2.5875649 1005.7608487
61 47.8018799 -2.5875649
62 100.6385224 47.8018799
63 125.5757603 100.6385224
64 184.9387136 125.5757603
65 205.3073989 184.9387136
66 -55.2770702 205.3073989
67 -1105.7175738 -55.2770702
68 -49.9442940 -1105.7175738
69 24.4290390 -49.9442940
70 99.7812511 24.4290390
71 104.8137138 99.7812511
72 104.4599297 104.8137138
73 -861.6293239 104.4599297
74 190.2284395 -861.6293239
75 206.1921690 190.2284395
76 283.5021392 206.1921690
77 -743.9333552 283.5021392
78 1013.4291926 -743.9333552
79 -1020.0431730 1013.4291926
80 9.7884604 -1020.0431730
81 75.1882849 9.7884604
82 106.6518335 75.1882849
83 84.2743312 106.6518335
84 64.5052115 84.2743312
85 61.5430448 64.5052115
86 67.0649471 61.5430448
87 73.5657284 67.0649471
88 -860.5450075 73.5657284
89 103.0459896 -860.5450075
90 -132.5757123 103.0459896
91 -1183.0162159 -132.5757123
92 -160.6897723 -1183.0162159
93 929.6728195 -160.6897723
94 -1022.8743730 929.6728195
95 -54.2253838 -1022.8743730
96 944.4419529 -54.2253838
97 -31.1102487 944.4419529
98 1011.7740062 -31.1102487
99 -938.3259886 1011.7740062
100 121.0369647 -938.3259886
101 101.5960997 121.0369647
102 -136.4727999 101.5960997
103 816.5127734 -136.4727999
104 847.3232859 816.5127734
105 -44.8565449 847.3232859
106 -977.9884017 -44.8565449
107 43.0333198 -977.9884017
108 34.1954667 43.0333198
109 67.6167736 34.1954667
110 101.0380805 67.6167736
111 134.9488269 101.0380805
112 -815.6406074 134.9488269
113 -815.1766973 -815.6406074
114 -51.7772782 -815.1766973
115 890.7664679 -51.7772782
116 -78.4230196 890.7664679
117 3.4555032 -78.4230196
118 52.3766294 3.4555032
119 65.8931611 52.3766294
120 -980.7964842 65.8931611
121 27.6620553 -980.7964842
122 78.5409397 27.6620553
123 1112.9411256 78.5409397
124 -853.6375675 1112.9411256
125 1129.8582048 -853.6375675
126 -76.2321772 1129.8582048
127 -175.1298967 -76.2321772
128 -160.7980826 -175.1298967
129 905.0911814 -160.7980826
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/7781m1353452171.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/8ooy41353452171.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/9wwnf1353452171.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/fisher/rcomp/tmp/10c2jm1353452171.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/fisher/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/fisher/rcomp/tmp/11kxze1353452171.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/fisher/rcomp/tmp/123p2e1353452171.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/fisher/rcomp/tmp/131ix81353452171.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/fisher/rcomp/tmp/14zl3q1353452171.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/fisher/rcomp/tmp/15i4kd1353452171.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/fisher/rcomp/tmp/16futf1353452171.tab")
+ }
>
> try(system("convert tmp/1g1o11353452170.ps tmp/1g1o11353452170.png",intern=TRUE))
character(0)
> try(system("convert tmp/2x00s1353452170.ps tmp/2x00s1353452170.png",intern=TRUE))
character(0)
> try(system("convert tmp/3vigq1353452170.ps tmp/3vigq1353452170.png",intern=TRUE))
character(0)
> try(system("convert tmp/4fjop1353452170.ps tmp/4fjop1353452170.png",intern=TRUE))
character(0)
> try(system("convert tmp/5pcdr1353452171.ps tmp/5pcdr1353452171.png",intern=TRUE))
character(0)
> try(system("convert tmp/6qk081353452171.ps tmp/6qk081353452171.png",intern=TRUE))
character(0)
> try(system("convert tmp/7781m1353452171.ps tmp/7781m1353452171.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ooy41353452171.ps tmp/8ooy41353452171.png",intern=TRUE))
character(0)
> try(system("convert tmp/9wwnf1353452171.ps tmp/9wwnf1353452171.png",intern=TRUE))
character(0)
> try(system("convert tmp/10c2jm1353452171.ps tmp/10c2jm1353452171.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.284 1.357 8.645