R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(9
+ ,4
+ ,2
+ ,5
+ ,4
+ ,3
+ ,9
+ ,4
+ ,2
+ ,4
+ ,3
+ ,2
+ ,9
+ ,5
+ ,4
+ ,4
+ ,2
+ ,2
+ ,9
+ ,3
+ ,2
+ ,4
+ ,2
+ ,2
+ ,9
+ ,4
+ ,3
+ ,2
+ ,2
+ ,2
+ ,9
+ ,3
+ ,4
+ ,5
+ ,2
+ ,2
+ ,10
+ ,4
+ ,3
+ ,5
+ ,3
+ ,2
+ ,10
+ ,3
+ ,3
+ ,4
+ ,2
+ ,1
+ ,10
+ ,2
+ ,3
+ ,3
+ ,1
+ ,2
+ ,10
+ ,4
+ ,2
+ ,4
+ ,2
+ ,2
+ ,10
+ ,2
+ ,4
+ ,4
+ ,2
+ ,2
+ ,10
+ ,2
+ ,3
+ ,3
+ ,2
+ ,2
+ ,10
+ ,1
+ ,3
+ ,3
+ ,2
+ ,2
+ ,10
+ ,4
+ ,4
+ ,4
+ ,2
+ ,2
+ ,10
+ ,4
+ ,4
+ ,5
+ ,1
+ ,1
+ ,10
+ ,2
+ ,3
+ ,4
+ ,2
+ ,2
+ ,10
+ ,2
+ ,3
+ ,2
+ ,2
+ ,1
+ ,10
+ ,3
+ ,3
+ ,4
+ ,3
+ ,2
+ ,10
+ ,3
+ ,4
+ ,4
+ ,4
+ ,2
+ ,10
+ ,3
+ ,2
+ ,4
+ ,4
+ ,2
+ ,10
+ ,4
+ ,5
+ ,4
+ ,4
+ ,4
+ ,10
+ ,3
+ ,4
+ ,4
+ ,4
+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= '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.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
YT T1 X1 X2 X3 X4 t
1 4 9 2 5 4 3 1
2 4 9 2 4 3 2 2
3 5 9 4 4 2 2 3
4 3 9 2 4 2 2 4
5 4 9 3 2 2 2 5
6 3 9 4 5 2 2 6
7 4 10 3 5 3 2 7
8 3 10 3 4 2 1 8
9 2 10 3 3 1 2 9
10 4 10 2 4 2 2 10
11 2 10 4 4 2 2 11
12 2 10 3 3 2 2 12
13 1 10 3 3 2 2 13
14 4 10 4 4 2 2 14
15 4 10 4 5 1 1 15
16 2 10 3 4 2 2 16
17 2 10 3 2 2 1 17
18 3 10 3 4 3 2 18
19 3 10 4 4 4 2 19
20 3 10 2 4 4 2 20
21 4 10 5 4 4 4 21
22 3 10 4 4 4 2 22
23 2 10 2 4 4 4 23
24 2 10 3 5 2 2 24
25 4 10 4 4 2 2 25
26 4 10 4 4 4 2 26
27 3 10 3 4 2 2 27
28 4 10 4 4 3 2 28
29 2 10 4 4 2 2 29
30 4 10 1 4 4 2 30
31 4 10 4 4 3 3 31
32 5 10 5 2 4 2 32
33 5 10 2 4 2 2 33
34 4 10 4 4 2 2 34
35 4 10 3 5 4 3 35
36 4 10 2 5 5 4 36
37 2 10 4 4 2 1 37
38 4 10 5 3 4 2 38
39 4 10 4 4 4 3 39
40 4 10 4 5 5 3 40
41 3 10 4 4 3 2 41
42 2 10 3 4 2 2 42
43 3 10 4 5 3 2 43
44 4 10 2 4 2 2 44
45 3 10 2 5 1 2 45
46 2 10 4 4 2 2 46
47 4 10 2 4 4 4 47
48 4 10 4 4 4 4 48
49 3 10 4 3 4 2 49
50 4 10 1 4 4 3 50
51 3 10 4 4 2 2 51
52 4 10 2 4 2 2 52
53 2 10 1 2 1 1 53
54 4 10 4 3 4 3 54
55 4 10 3 5 2 4 55
56 4 10 2 4 4 2 56
57 4 10 4 4 2 2 57
58 3 10 3 5 2 1 58
59 1 10 2 3 1 2 59
60 3 10 2 5 2 2 60
61 3 10 3 4 2 2 61
62 4 10 2 5 2 2 62
63 2 10 1 4 2 2 63
64 3 10 3 4 1 1 64
65 5 10 2 5 5 2 65
66 4 10 3 4 3 3 66
67 4 10 3 4 2 2 67
68 3 10 3 5 1 1 68
69 4 10 2 4 2 2 69
70 2 10 3 3 4 4 70
71 3 10 2 4 2 2 71
72 4 10 4 5 5 3 72
73 3 10 4 5 4 4 73
74 4 10 4 5 3 2 74
75 4 10 2 4 2 4 75
76 3 10 3 4 2 1 76
77 3 10 4 5 2 2 77
78 2 10 3 5 2 2 78
79 4 10 4 4 4 4 79
80 3 10 2 5 2 3 80
81 2 10 3 3 2 2 81
82 2 10 3 4 4 2 82
83 3 10 4 4 4 2 83
84 2 10 2 4 2 3 84
85 2 10 4 4 2 2 85
86 4 10 2 4 3 2 86
87 4 10 2 5 2 1 87
88 4 10 4 4 4 2 88
89 2 10 3 4 2 2 89
90 2 10 4 4 4 4 90
91 4 10 2 5 1 1 91
92 2 10 2 3 2 2 92
93 3 10 3 3 3 2 93
94 3 10 3 5 2 2 94
95 5 10 5 5 4 4 95
96 3 10 2 4 2 4 96
97 4 10 3 4 3 3 97
98 3 10 4 4 2 2 98
99 2 10 3 4 2 3 99
100 4 10 4 4 2 2 100
101 3 10 3 4 2 1 101
102 3 10 3 4 2 2 102
103 3 10 2 4 2 2 103
104 4 10 3 5 3 2 104
105 1 10 2 2 2 4 105
106 3 10 3 4 2 2 106
107 2 10 2 2 4 3 107
108 3 10 4 4 3 3 108
109 2 10 2 5 2 2 109
110 2 10 4 3 1 1 110
111 2 10 4 4 2 4 111
112 4 10 1 3 2 2 112
113 5 10 5 4 5 2 113
114 5 10 2 4 1 1 114
115 3 10 3 4 2 2 115
116 4 10 4 2 2 2 116
117 4 10 1 1 2 2 117
118 3 10 5 4 2 3 118
119 2 10 3 3 2 1 119
120 4 10 3 4 5 3 120
121 2 10 3 3 2 2 121
122 3 10 3 3 2 3 122
123 2 10 2 5 2 1 123
124 2 10 2 4 2 2 124
125 2 10 4 3 2 3 125
126 4 10 4 4 2 1 126
127 4 10 3 4 3 2 127
128 4 10 3 4 2 2 128
129 4 10 3 4 4 3 129
130 3 10 4 3 4 2 130
131 2 10 3 4 2 2 131
132 4 10 4 4 4 2 132
133 3 10 4 4 4 2 133
134 2 10 2 4 2 2 134
135 4 10 4 4 4 2 135
136 3 10 2 3 3 3 136
137 3 10 4 4 2 2 137
138 3 10 3 4 2 2 138
139 3 10 3 2 3 3 139
140 3 10 2 2 4 2 140
141 4 10 2 4 4 2 141
142 5 10 5 2 5 1 142
143 2 10 2 4 2 1 143
144 4 10 3 4 3 4 144
145 3 10 3 3 5 3 145
146 3 10 3 2 2 3 146
147 1 10 3 2 2 2 147
148 2 10 4 4 2 2 148
149 4 10 4 3 2 2 149
150 4 10 4 4 2 4 150
151 5 10 4 4 5 3 151
152 2 10 4 2 3 3 152
153 4 10 5 5 2 2 153
154 3 10 3 4 2 2 154
155 2 10 3 4 3 2 155
156 4 10 4 4 3 3 156
157 2 10 4 3 2 5 157
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) T1 X1 X2 X3 X4
8.5671390 -0.7353716 0.0759379 0.2517584 0.3663606 -0.1176082
t
0.0003611
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.70811 -0.73772 0.01269 0.64200 2.33774
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.5671390 3.7556296 2.281 0.02395 *
T1 -0.7353716 0.3809853 -1.930 0.05547 .
X1 0.0759379 0.0733136 1.036 0.30196
X2 0.2517584 0.0844205 2.982 0.00334 **
X3 0.3663606 0.0720633 5.084 1.09e-06 ***
X4 -0.1176082 0.0897171 -1.311 0.19190
t 0.0003611 0.0016626 0.217 0.82833
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.8612 on 150 degrees of freedom
Multiple R-squared: 0.2289, Adjusted R-squared: 0.1981
F-statistic: 7.423 on 6 and 150 DF, p-value: 5.697e-07
> 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.81490063 0.3701987 0.18509937
[2,] 0.83274245 0.3345151 0.16725755
[3,] 0.75355351 0.4928930 0.24644649
[4,] 0.73178735 0.5364253 0.26821265
[5,] 0.92138496 0.1572301 0.07861504
[6,] 0.91814326 0.1637135 0.08185674
[7,] 0.88627120 0.2274576 0.11372880
[8,] 0.83961086 0.3207783 0.16038914
[9,] 0.79956688 0.4008662 0.20043312
[10,] 0.74001515 0.5199697 0.25998485
[11,] 0.68161900 0.6367620 0.31838100
[12,] 0.69906952 0.6018610 0.30093048
[13,] 0.64180276 0.7163945 0.35819724
[14,] 0.60242927 0.7951415 0.39757073
[15,] 0.56039363 0.8792127 0.43960637
[16,] 0.66625913 0.6674817 0.33374087
[17,] 0.63140449 0.7371910 0.36859551
[18,] 0.58416859 0.8316628 0.41583141
[19,] 0.55861522 0.8827696 0.44138478
[20,] 0.57675185 0.8464963 0.42324815
[21,] 0.62391966 0.7521607 0.37608034
[22,] 0.61996960 0.7600608 0.38003040
[23,] 0.67708574 0.6458285 0.32291426
[24,] 0.85505347 0.2898931 0.14494653
[25,] 0.83133377 0.3373325 0.16866623
[26,] 0.79176167 0.4164767 0.20823833
[27,] 0.74828188 0.5034362 0.25171812
[28,] 0.86031211 0.2793758 0.13968789
[29,] 0.82975011 0.3404998 0.17024989
[30,] 0.79345236 0.4130953 0.20654764
[31,] 0.76069996 0.4786001 0.23930004
[32,] 0.74510725 0.5097855 0.25489275
[33,] 0.77225577 0.4554885 0.22774423
[34,] 0.75594848 0.4881030 0.24405152
[35,] 0.76850436 0.4629913 0.23149564
[36,] 0.72640187 0.5471963 0.27359813
[37,] 0.76460055 0.4707989 0.23539945
[38,] 0.73366410 0.5326718 0.26633590
[39,] 0.69320090 0.6135982 0.30679910
[40,] 0.67740691 0.6451862 0.32259309
[41,] 0.64144280 0.7171144 0.35855720
[42,] 0.59495817 0.8100837 0.40504183
[43,] 0.59878639 0.8024272 0.40121361
[44,] 0.56327957 0.8734409 0.43672043
[45,] 0.52288394 0.9542321 0.47711606
[46,] 0.50973023 0.9805395 0.49026977
[47,] 0.46522531 0.9304506 0.53477469
[48,] 0.45211525 0.9042305 0.54788475
[49,] 0.41441192 0.8288238 0.58558808
[50,] 0.52149515 0.9570097 0.47850485
[51,] 0.47540057 0.9508011 0.52459943
[52,] 0.42790918 0.8558184 0.57209082
[53,] 0.41768431 0.8353686 0.58231569
[54,] 0.42214321 0.8442864 0.57785679
[55,] 0.37752808 0.7550562 0.62247192
[56,] 0.36293247 0.7258649 0.63706753
[57,] 0.34214739 0.6842948 0.65785261
[58,] 0.34430627 0.6886125 0.65569373
[59,] 0.30205932 0.6041186 0.69794068
[60,] 0.31552364 0.6310473 0.68447636
[61,] 0.40016431 0.8003286 0.59983569
[62,] 0.35749394 0.7149879 0.64250606
[63,] 0.32695860 0.6539172 0.67304140
[64,] 0.33132529 0.6626506 0.66867471
[65,] 0.29453344 0.5890669 0.70546656
[66,] 0.34459928 0.6891986 0.65540072
[67,] 0.30523585 0.6104717 0.69476415
[68,] 0.27386691 0.5477338 0.72613309
[69,] 0.31824376 0.6364875 0.68175624
[70,] 0.29043812 0.5808762 0.70956188
[71,] 0.25452282 0.5090456 0.74547718
[72,] 0.24711437 0.4942287 0.75288563
[73,] 0.35229122 0.7045824 0.64770878
[74,] 0.34023644 0.6804729 0.65976356
[75,] 0.33261648 0.6652330 0.66738352
[76,] 0.35275279 0.7055056 0.64724721
[77,] 0.34261332 0.6852266 0.65738668
[78,] 0.33281269 0.6656254 0.66718731
[79,] 0.29397049 0.5879410 0.70602951
[80,] 0.30384058 0.6076812 0.69615942
[81,] 0.40348482 0.8069696 0.59651518
[82,] 0.43442211 0.8688442 0.56557789
[83,] 0.41231855 0.8246371 0.58768145
[84,] 0.36973699 0.7394740 0.63026301
[85,] 0.32830920 0.6566184 0.67169080
[86,] 0.34553168 0.6910634 0.65446832
[87,] 0.31120570 0.6224114 0.68879430
[88,] 0.30359510 0.6071902 0.69640490
[89,] 0.26279215 0.5255843 0.73720785
[90,] 0.25809327 0.5161865 0.74190673
[91,] 0.25974559 0.5194912 0.74025441
[92,] 0.22193193 0.4438639 0.77806807
[93,] 0.18672453 0.3734491 0.81327547
[94,] 0.15615753 0.3123151 0.84384247
[95,] 0.13585067 0.2717013 0.86414933
[96,] 0.15452181 0.3090436 0.84547819
[97,] 0.12638958 0.2527792 0.87361042
[98,] 0.14711617 0.2942323 0.85288383
[99,] 0.12546601 0.2509320 0.87453399
[100,] 0.14238810 0.2847762 0.85761190
[101,] 0.13424927 0.2684985 0.86575073
[102,] 0.15656762 0.3131352 0.84343238
[103,] 0.19692768 0.3938554 0.80307232
[104,] 0.17477902 0.3495580 0.82522098
[105,] 0.49460310 0.9892062 0.50539690
[106,] 0.43993707 0.8798741 0.56006293
[107,] 0.48953287 0.9790657 0.51046713
[108,] 0.81248426 0.3750315 0.18751574
[109,] 0.78330397 0.4333921 0.21669603
[110,] 0.75838902 0.4832220 0.24161098
[111,] 0.71483637 0.5703273 0.28516363
[112,] 0.68592522 0.6281496 0.31407478
[113,] 0.64563397 0.7087321 0.35436603
[114,] 0.65325538 0.6934892 0.34674462
[115,] 0.62821745 0.7435651 0.37178255
[116,] 0.65382316 0.6923537 0.34617684
[117,] 0.63556677 0.7288665 0.36443323
[118,] 0.60623995 0.7875201 0.39376005
[119,] 0.67306241 0.6538752 0.32693759
[120,] 0.61727377 0.7654525 0.38272623
[121,] 0.59298110 0.8140378 0.40701890
[122,] 0.57990686 0.8401863 0.42009314
[123,] 0.51170107 0.9765979 0.48829893
[124,] 0.61489413 0.7702117 0.38510587
[125,] 0.58608433 0.8278313 0.41391567
[126,] 0.56294683 0.8741063 0.43705317
[127,] 0.48314404 0.9662881 0.51685596
[128,] 0.48748733 0.9749747 0.51251267
[129,] 0.43693893 0.8738779 0.56306107
[130,] 0.35554199 0.7110840 0.64445801
[131,] 0.28879604 0.5775921 0.71120396
[132,] 0.24040788 0.4808158 0.75959212
[133,] 0.19579466 0.3915893 0.80420534
[134,] 0.14413163 0.2882633 0.85586837
[135,] 0.09471649 0.1894330 0.90528351
[136,] 0.08472666 0.1694533 0.91527334
[137,] 0.08570808 0.1714162 0.91429192
[138,] 0.05281654 0.1056331 0.94718346
> postscript(file="/var/www/html/rcomp/tmp/1pn2t1290528966.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/20wje1290528966.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/30wje1290528966.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/40wje1290528966.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/50wje1290528966.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 157
Frequency = 1
1 2 3 4 5 6
-0.472441356 0.027708278 1.241831987 -0.606653451 0.820564423 -1.011009881
7 8 9 10 11 12
0.433577858 -0.066272509 -0.330906441 1.126551273 -1.025685576 -0.698350432
13 14 15 16 17 18
-1.698711576 0.973230991 0.969863753 -0.951553444 -0.566005934 -0.318636291
19 20 21 22 23 24
-0.761295847 -0.609781286 0.397260446 -0.762379280 -1.375648283 -1.206201032
25 26 27 28 29 30
0.969258406 0.236176144 0.044473971 0.601814415 -1.032186170 0.462545126
31 32 33 34 35 36
0.718339200 1.661588298 2.118244960 0.966008110 0.174713482 0.001537849
37 38 39 40 41 42
-1.152683540 0.407662998 0.349089488 -0.269390650 -0.402880458 -0.960943190
43 44 45 46 47 48
-0.655361182 1.114272375 0.228513354 -1.038325619 0.615684259 0.463447409
49 50 51 52 53 54
-0.520371734 0.572930462 -0.040131340 1.111383222 -0.060770856 0.595430763
55 56 57 58 59 60
1.017819936 0.377217527 0.957701796 -0.336088148 -1.273025792 -0.143264366
61 62 63 64 65 66
0.032195073 0.856013346 -0.816651510 0.279863982 0.755848236 0.781637010
67 68 69 70 71 72
1.030028208 0.026660970 1.105243773 -1.216801472 0.104521485 -0.280947261
73 74 75 76 77 78
-0.797339628 0.333443352 1.338293343 -0.090830306 -0.301279521 -1.225702812
79 80 81 82 83 84
0.452251943 -0.032879030 -0.723269373 -1.708110071 -0.784409068 -0.782565171
85 86 87 88 89 90
-1.052410238 0.732743764 0.729376526 0.213785211 -0.977916962 -1.551720642
91 92 93 94 95 96
1.094292509 -0.651304105 -0.093963662 -0.231481118 1.118777349 0.330709318
97 98 99 100 101 102
0.770441544 -0.057105111 -0.863920185 0.942172601 -0.099858908 0.017388165
103 104 105 106 107 108
0.092964874 0.398546882 -1.169024108 0.015943589 -1.020075732 -0.309468894
109 110 111 112 113 114
-1.160960426 -0.560928063 -0.826583549 1.417410866 0.762458197 2.337744631
115 116 117 118 119 120
0.012693292 1.439911167 1.919122017 -0.022657628 -0.854601066 0.029414112
121 122 123 124 125 126
-0.737715136 0.379531937 -1.283624660 -0.914619151 -0.697489348 0.815174637
127 128 129 130 131 132
0.641999004 1.007998419 0.392524374 -0.549624404 -0.993085013 0.197894872
133 134 135 136 137 138
-0.802466272 -0.918230592 0.196811440 0.084053213 -0.071189730 0.004386979
139 140 141 142 143 144
0.258790364 -0.149601704 0.346520281 1.137893673 -1.039089106 0.871075990
145 146 147 148 149 150
-0.727856055 0.622622915 -1.495346447 -1.075162315 1.176234976 1.159331832
151 152 153 154 155 156
0.942280793 -0.821842362 0.595335676 -0.001391327 -1.368113030 0.673196191
157
-0.473829524
> postscript(file="/var/www/html/rcomp/tmp/6t6ih1290528966.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 157
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.472441356 NA
1 0.027708278 -0.472441356
2 1.241831987 0.027708278
3 -0.606653451 1.241831987
4 0.820564423 -0.606653451
5 -1.011009881 0.820564423
6 0.433577858 -1.011009881
7 -0.066272509 0.433577858
8 -0.330906441 -0.066272509
9 1.126551273 -0.330906441
10 -1.025685576 1.126551273
11 -0.698350432 -1.025685576
12 -1.698711576 -0.698350432
13 0.973230991 -1.698711576
14 0.969863753 0.973230991
15 -0.951553444 0.969863753
16 -0.566005934 -0.951553444
17 -0.318636291 -0.566005934
18 -0.761295847 -0.318636291
19 -0.609781286 -0.761295847
20 0.397260446 -0.609781286
21 -0.762379280 0.397260446
22 -1.375648283 -0.762379280
23 -1.206201032 -1.375648283
24 0.969258406 -1.206201032
25 0.236176144 0.969258406
26 0.044473971 0.236176144
27 0.601814415 0.044473971
28 -1.032186170 0.601814415
29 0.462545126 -1.032186170
30 0.718339200 0.462545126
31 1.661588298 0.718339200
32 2.118244960 1.661588298
33 0.966008110 2.118244960
34 0.174713482 0.966008110
35 0.001537849 0.174713482
36 -1.152683540 0.001537849
37 0.407662998 -1.152683540
38 0.349089488 0.407662998
39 -0.269390650 0.349089488
40 -0.402880458 -0.269390650
41 -0.960943190 -0.402880458
42 -0.655361182 -0.960943190
43 1.114272375 -0.655361182
44 0.228513354 1.114272375
45 -1.038325619 0.228513354
46 0.615684259 -1.038325619
47 0.463447409 0.615684259
48 -0.520371734 0.463447409
49 0.572930462 -0.520371734
50 -0.040131340 0.572930462
51 1.111383222 -0.040131340
52 -0.060770856 1.111383222
53 0.595430763 -0.060770856
54 1.017819936 0.595430763
55 0.377217527 1.017819936
56 0.957701796 0.377217527
57 -0.336088148 0.957701796
58 -1.273025792 -0.336088148
59 -0.143264366 -1.273025792
60 0.032195073 -0.143264366
61 0.856013346 0.032195073
62 -0.816651510 0.856013346
63 0.279863982 -0.816651510
64 0.755848236 0.279863982
65 0.781637010 0.755848236
66 1.030028208 0.781637010
67 0.026660970 1.030028208
68 1.105243773 0.026660970
69 -1.216801472 1.105243773
70 0.104521485 -1.216801472
71 -0.280947261 0.104521485
72 -0.797339628 -0.280947261
73 0.333443352 -0.797339628
74 1.338293343 0.333443352
75 -0.090830306 1.338293343
76 -0.301279521 -0.090830306
77 -1.225702812 -0.301279521
78 0.452251943 -1.225702812
79 -0.032879030 0.452251943
80 -0.723269373 -0.032879030
81 -1.708110071 -0.723269373
82 -0.784409068 -1.708110071
83 -0.782565171 -0.784409068
84 -1.052410238 -0.782565171
85 0.732743764 -1.052410238
86 0.729376526 0.732743764
87 0.213785211 0.729376526
88 -0.977916962 0.213785211
89 -1.551720642 -0.977916962
90 1.094292509 -1.551720642
91 -0.651304105 1.094292509
92 -0.093963662 -0.651304105
93 -0.231481118 -0.093963662
94 1.118777349 -0.231481118
95 0.330709318 1.118777349
96 0.770441544 0.330709318
97 -0.057105111 0.770441544
98 -0.863920185 -0.057105111
99 0.942172601 -0.863920185
100 -0.099858908 0.942172601
101 0.017388165 -0.099858908
102 0.092964874 0.017388165
103 0.398546882 0.092964874
104 -1.169024108 0.398546882
105 0.015943589 -1.169024108
106 -1.020075732 0.015943589
107 -0.309468894 -1.020075732
108 -1.160960426 -0.309468894
109 -0.560928063 -1.160960426
110 -0.826583549 -0.560928063
111 1.417410866 -0.826583549
112 0.762458197 1.417410866
113 2.337744631 0.762458197
114 0.012693292 2.337744631
115 1.439911167 0.012693292
116 1.919122017 1.439911167
117 -0.022657628 1.919122017
118 -0.854601066 -0.022657628
119 0.029414112 -0.854601066
120 -0.737715136 0.029414112
121 0.379531937 -0.737715136
122 -1.283624660 0.379531937
123 -0.914619151 -1.283624660
124 -0.697489348 -0.914619151
125 0.815174637 -0.697489348
126 0.641999004 0.815174637
127 1.007998419 0.641999004
128 0.392524374 1.007998419
129 -0.549624404 0.392524374
130 -0.993085013 -0.549624404
131 0.197894872 -0.993085013
132 -0.802466272 0.197894872
133 -0.918230592 -0.802466272
134 0.196811440 -0.918230592
135 0.084053213 0.196811440
136 -0.071189730 0.084053213
137 0.004386979 -0.071189730
138 0.258790364 0.004386979
139 -0.149601704 0.258790364
140 0.346520281 -0.149601704
141 1.137893673 0.346520281
142 -1.039089106 1.137893673
143 0.871075990 -1.039089106
144 -0.727856055 0.871075990
145 0.622622915 -0.727856055
146 -1.495346447 0.622622915
147 -1.075162315 -1.495346447
148 1.176234976 -1.075162315
149 1.159331832 1.176234976
150 0.942280793 1.159331832
151 -0.821842362 0.942280793
152 0.595335676 -0.821842362
153 -0.001391327 0.595335676
154 -1.368113030 -0.001391327
155 0.673196191 -1.368113030
156 -0.473829524 0.673196191
157 NA -0.473829524
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.027708278 -0.472441356
[2,] 1.241831987 0.027708278
[3,] -0.606653451 1.241831987
[4,] 0.820564423 -0.606653451
[5,] -1.011009881 0.820564423
[6,] 0.433577858 -1.011009881
[7,] -0.066272509 0.433577858
[8,] -0.330906441 -0.066272509
[9,] 1.126551273 -0.330906441
[10,] -1.025685576 1.126551273
[11,] -0.698350432 -1.025685576
[12,] -1.698711576 -0.698350432
[13,] 0.973230991 -1.698711576
[14,] 0.969863753 0.973230991
[15,] -0.951553444 0.969863753
[16,] -0.566005934 -0.951553444
[17,] -0.318636291 -0.566005934
[18,] -0.761295847 -0.318636291
[19,] -0.609781286 -0.761295847
[20,] 0.397260446 -0.609781286
[21,] -0.762379280 0.397260446
[22,] -1.375648283 -0.762379280
[23,] -1.206201032 -1.375648283
[24,] 0.969258406 -1.206201032
[25,] 0.236176144 0.969258406
[26,] 0.044473971 0.236176144
[27,] 0.601814415 0.044473971
[28,] -1.032186170 0.601814415
[29,] 0.462545126 -1.032186170
[30,] 0.718339200 0.462545126
[31,] 1.661588298 0.718339200
[32,] 2.118244960 1.661588298
[33,] 0.966008110 2.118244960
[34,] 0.174713482 0.966008110
[35,] 0.001537849 0.174713482
[36,] -1.152683540 0.001537849
[37,] 0.407662998 -1.152683540
[38,] 0.349089488 0.407662998
[39,] -0.269390650 0.349089488
[40,] -0.402880458 -0.269390650
[41,] -0.960943190 -0.402880458
[42,] -0.655361182 -0.960943190
[43,] 1.114272375 -0.655361182
[44,] 0.228513354 1.114272375
[45,] -1.038325619 0.228513354
[46,] 0.615684259 -1.038325619
[47,] 0.463447409 0.615684259
[48,] -0.520371734 0.463447409
[49,] 0.572930462 -0.520371734
[50,] -0.040131340 0.572930462
[51,] 1.111383222 -0.040131340
[52,] -0.060770856 1.111383222
[53,] 0.595430763 -0.060770856
[54,] 1.017819936 0.595430763
[55,] 0.377217527 1.017819936
[56,] 0.957701796 0.377217527
[57,] -0.336088148 0.957701796
[58,] -1.273025792 -0.336088148
[59,] -0.143264366 -1.273025792
[60,] 0.032195073 -0.143264366
[61,] 0.856013346 0.032195073
[62,] -0.816651510 0.856013346
[63,] 0.279863982 -0.816651510
[64,] 0.755848236 0.279863982
[65,] 0.781637010 0.755848236
[66,] 1.030028208 0.781637010
[67,] 0.026660970 1.030028208
[68,] 1.105243773 0.026660970
[69,] -1.216801472 1.105243773
[70,] 0.104521485 -1.216801472
[71,] -0.280947261 0.104521485
[72,] -0.797339628 -0.280947261
[73,] 0.333443352 -0.797339628
[74,] 1.338293343 0.333443352
[75,] -0.090830306 1.338293343
[76,] -0.301279521 -0.090830306
[77,] -1.225702812 -0.301279521
[78,] 0.452251943 -1.225702812
[79,] -0.032879030 0.452251943
[80,] -0.723269373 -0.032879030
[81,] -1.708110071 -0.723269373
[82,] -0.784409068 -1.708110071
[83,] -0.782565171 -0.784409068
[84,] -1.052410238 -0.782565171
[85,] 0.732743764 -1.052410238
[86,] 0.729376526 0.732743764
[87,] 0.213785211 0.729376526
[88,] -0.977916962 0.213785211
[89,] -1.551720642 -0.977916962
[90,] 1.094292509 -1.551720642
[91,] -0.651304105 1.094292509
[92,] -0.093963662 -0.651304105
[93,] -0.231481118 -0.093963662
[94,] 1.118777349 -0.231481118
[95,] 0.330709318 1.118777349
[96,] 0.770441544 0.330709318
[97,] -0.057105111 0.770441544
[98,] -0.863920185 -0.057105111
[99,] 0.942172601 -0.863920185
[100,] -0.099858908 0.942172601
[101,] 0.017388165 -0.099858908
[102,] 0.092964874 0.017388165
[103,] 0.398546882 0.092964874
[104,] -1.169024108 0.398546882
[105,] 0.015943589 -1.169024108
[106,] -1.020075732 0.015943589
[107,] -0.309468894 -1.020075732
[108,] -1.160960426 -0.309468894
[109,] -0.560928063 -1.160960426
[110,] -0.826583549 -0.560928063
[111,] 1.417410866 -0.826583549
[112,] 0.762458197 1.417410866
[113,] 2.337744631 0.762458197
[114,] 0.012693292 2.337744631
[115,] 1.439911167 0.012693292
[116,] 1.919122017 1.439911167
[117,] -0.022657628 1.919122017
[118,] -0.854601066 -0.022657628
[119,] 0.029414112 -0.854601066
[120,] -0.737715136 0.029414112
[121,] 0.379531937 -0.737715136
[122,] -1.283624660 0.379531937
[123,] -0.914619151 -1.283624660
[124,] -0.697489348 -0.914619151
[125,] 0.815174637 -0.697489348
[126,] 0.641999004 0.815174637
[127,] 1.007998419 0.641999004
[128,] 0.392524374 1.007998419
[129,] -0.549624404 0.392524374
[130,] -0.993085013 -0.549624404
[131,] 0.197894872 -0.993085013
[132,] -0.802466272 0.197894872
[133,] -0.918230592 -0.802466272
[134,] 0.196811440 -0.918230592
[135,] 0.084053213 0.196811440
[136,] -0.071189730 0.084053213
[137,] 0.004386979 -0.071189730
[138,] 0.258790364 0.004386979
[139,] -0.149601704 0.258790364
[140,] 0.346520281 -0.149601704
[141,] 1.137893673 0.346520281
[142,] -1.039089106 1.137893673
[143,] 0.871075990 -1.039089106
[144,] -0.727856055 0.871075990
[145,] 0.622622915 -0.727856055
[146,] -1.495346447 0.622622915
[147,] -1.075162315 -1.495346447
[148,] 1.176234976 -1.075162315
[149,] 1.159331832 1.176234976
[150,] 0.942280793 1.159331832
[151,] -0.821842362 0.942280793
[152,] 0.595335676 -0.821842362
[153,] -0.001391327 0.595335676
[154,] -1.368113030 -0.001391327
[155,] 0.673196191 -1.368113030
[156,] -0.473829524 0.673196191
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.027708278 -0.472441356
2 1.241831987 0.027708278
3 -0.606653451 1.241831987
4 0.820564423 -0.606653451
5 -1.011009881 0.820564423
6 0.433577858 -1.011009881
7 -0.066272509 0.433577858
8 -0.330906441 -0.066272509
9 1.126551273 -0.330906441
10 -1.025685576 1.126551273
11 -0.698350432 -1.025685576
12 -1.698711576 -0.698350432
13 0.973230991 -1.698711576
14 0.969863753 0.973230991
15 -0.951553444 0.969863753
16 -0.566005934 -0.951553444
17 -0.318636291 -0.566005934
18 -0.761295847 -0.318636291
19 -0.609781286 -0.761295847
20 0.397260446 -0.609781286
21 -0.762379280 0.397260446
22 -1.375648283 -0.762379280
23 -1.206201032 -1.375648283
24 0.969258406 -1.206201032
25 0.236176144 0.969258406
26 0.044473971 0.236176144
27 0.601814415 0.044473971
28 -1.032186170 0.601814415
29 0.462545126 -1.032186170
30 0.718339200 0.462545126
31 1.661588298 0.718339200
32 2.118244960 1.661588298
33 0.966008110 2.118244960
34 0.174713482 0.966008110
35 0.001537849 0.174713482
36 -1.152683540 0.001537849
37 0.407662998 -1.152683540
38 0.349089488 0.407662998
39 -0.269390650 0.349089488
40 -0.402880458 -0.269390650
41 -0.960943190 -0.402880458
42 -0.655361182 -0.960943190
43 1.114272375 -0.655361182
44 0.228513354 1.114272375
45 -1.038325619 0.228513354
46 0.615684259 -1.038325619
47 0.463447409 0.615684259
48 -0.520371734 0.463447409
49 0.572930462 -0.520371734
50 -0.040131340 0.572930462
51 1.111383222 -0.040131340
52 -0.060770856 1.111383222
53 0.595430763 -0.060770856
54 1.017819936 0.595430763
55 0.377217527 1.017819936
56 0.957701796 0.377217527
57 -0.336088148 0.957701796
58 -1.273025792 -0.336088148
59 -0.143264366 -1.273025792
60 0.032195073 -0.143264366
61 0.856013346 0.032195073
62 -0.816651510 0.856013346
63 0.279863982 -0.816651510
64 0.755848236 0.279863982
65 0.781637010 0.755848236
66 1.030028208 0.781637010
67 0.026660970 1.030028208
68 1.105243773 0.026660970
69 -1.216801472 1.105243773
70 0.104521485 -1.216801472
71 -0.280947261 0.104521485
72 -0.797339628 -0.280947261
73 0.333443352 -0.797339628
74 1.338293343 0.333443352
75 -0.090830306 1.338293343
76 -0.301279521 -0.090830306
77 -1.225702812 -0.301279521
78 0.452251943 -1.225702812
79 -0.032879030 0.452251943
80 -0.723269373 -0.032879030
81 -1.708110071 -0.723269373
82 -0.784409068 -1.708110071
83 -0.782565171 -0.784409068
84 -1.052410238 -0.782565171
85 0.732743764 -1.052410238
86 0.729376526 0.732743764
87 0.213785211 0.729376526
88 -0.977916962 0.213785211
89 -1.551720642 -0.977916962
90 1.094292509 -1.551720642
91 -0.651304105 1.094292509
92 -0.093963662 -0.651304105
93 -0.231481118 -0.093963662
94 1.118777349 -0.231481118
95 0.330709318 1.118777349
96 0.770441544 0.330709318
97 -0.057105111 0.770441544
98 -0.863920185 -0.057105111
99 0.942172601 -0.863920185
100 -0.099858908 0.942172601
101 0.017388165 -0.099858908
102 0.092964874 0.017388165
103 0.398546882 0.092964874
104 -1.169024108 0.398546882
105 0.015943589 -1.169024108
106 -1.020075732 0.015943589
107 -0.309468894 -1.020075732
108 -1.160960426 -0.309468894
109 -0.560928063 -1.160960426
110 -0.826583549 -0.560928063
111 1.417410866 -0.826583549
112 0.762458197 1.417410866
113 2.337744631 0.762458197
114 0.012693292 2.337744631
115 1.439911167 0.012693292
116 1.919122017 1.439911167
117 -0.022657628 1.919122017
118 -0.854601066 -0.022657628
119 0.029414112 -0.854601066
120 -0.737715136 0.029414112
121 0.379531937 -0.737715136
122 -1.283624660 0.379531937
123 -0.914619151 -1.283624660
124 -0.697489348 -0.914619151
125 0.815174637 -0.697489348
126 0.641999004 0.815174637
127 1.007998419 0.641999004
128 0.392524374 1.007998419
129 -0.549624404 0.392524374
130 -0.993085013 -0.549624404
131 0.197894872 -0.993085013
132 -0.802466272 0.197894872
133 -0.918230592 -0.802466272
134 0.196811440 -0.918230592
135 0.084053213 0.196811440
136 -0.071189730 0.084053213
137 0.004386979 -0.071189730
138 0.258790364 0.004386979
139 -0.149601704 0.258790364
140 0.346520281 -0.149601704
141 1.137893673 0.346520281
142 -1.039089106 1.137893673
143 0.871075990 -1.039089106
144 -0.727856055 0.871075990
145 0.622622915 -0.727856055
146 -1.495346447 0.622622915
147 -1.075162315 -1.495346447
148 1.176234976 -1.075162315
149 1.159331832 1.176234976
150 0.942280793 1.159331832
151 -0.821842362 0.942280793
152 0.595335676 -0.821842362
153 -0.001391327 0.595335676
154 -1.368113030 -0.001391327
155 0.673196191 -1.368113030
156 -0.473829524 0.673196191
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/780781290528966.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/880781290528966.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/980781290528966.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10w6hn1290528966.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/11zpxa1290528966.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/1237eg1290528966.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/13hhc71290528966.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/14k0av1290528966.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/156i911290528966.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/1691p71290528966.tab")
+ }
> try(system("convert tmp/1pn2t1290528966.ps tmp/1pn2t1290528966.png",intern=TRUE))
character(0)
> try(system("convert tmp/20wje1290528966.ps tmp/20wje1290528966.png",intern=TRUE))
character(0)
> try(system("convert tmp/30wje1290528966.ps tmp/30wje1290528966.png",intern=TRUE))
character(0)
> try(system("convert tmp/40wje1290528966.ps tmp/40wje1290528966.png",intern=TRUE))
character(0)
> try(system("convert tmp/50wje1290528966.ps tmp/50wje1290528966.png",intern=TRUE))
character(0)
> try(system("convert tmp/6t6ih1290528966.ps tmp/6t6ih1290528966.png",intern=TRUE))
character(0)
> try(system("convert tmp/780781290528966.ps tmp/780781290528966.png",intern=TRUE))
character(0)
> try(system("convert tmp/880781290528966.ps tmp/880781290528966.png",intern=TRUE))
character(0)
> try(system("convert tmp/980781290528966.ps tmp/980781290528966.png",intern=TRUE))
character(0)
> try(system("convert tmp/10w6hn1290528966.ps tmp/10w6hn1290528966.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.092 1.767 14.175