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
+ ,24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,9
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,9
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,9
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,9
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,9
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,10
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,10
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,10
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,10
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,10
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,10
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,10
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,10
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,10
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,10
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,10
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,10
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,10
+ ,20
+ ,8
+ ,17
+ ,7
+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Dummies'
> par1 = '7'
> #'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
O Months CM D PE PC PS t
1 26 9 24 14 11 12 24 1
2 23 9 25 11 7 8 25 2
3 25 9 17 6 17 8 30 3
4 23 9 18 12 10 8 19 4
5 19 9 18 8 12 9 22 5
6 29 9 16 10 12 7 22 6
7 25 10 20 10 11 4 25 7
8 21 10 16 11 11 11 23 8
9 22 10 18 16 12 7 17 9
10 25 10 17 11 13 7 21 10
11 24 10 23 13 14 12 19 11
12 18 10 30 12 16 10 19 12
13 22 10 23 8 11 10 15 13
14 15 10 18 12 10 8 16 14
15 22 10 15 11 11 8 23 15
16 28 10 12 4 15 4 27 16
17 20 10 21 9 9 9 22 17
18 12 10 15 8 11 8 14 18
19 24 10 20 8 17 7 22 19
20 20 10 31 14 17 11 23 20
21 21 10 27 15 11 9 23 21
22 20 10 34 16 18 11 21 22
23 21 10 21 9 14 13 19 23
24 23 10 31 14 10 8 18 24
25 28 10 19 11 11 8 20 25
26 24 10 16 8 15 9 23 26
27 24 10 20 9 15 6 25 27
28 24 10 21 9 13 9 19 28
29 23 10 22 9 16 9 24 29
30 23 10 17 9 13 6 22 30
31 29 10 24 10 9 6 25 31
32 24 10 25 16 18 16 26 32
33 18 10 26 11 18 5 29 33
34 25 10 25 8 12 7 32 34
35 21 10 17 9 17 9 25 35
36 26 10 32 16 9 6 29 36
37 22 10 33 11 9 6 28 37
38 22 10 13 16 12 5 17 38
39 22 10 32 12 18 12 28 39
40 23 10 25 12 12 7 29 40
41 30 10 29 14 18 10 26 41
42 23 10 22 9 14 9 25 42
43 17 10 18 10 15 8 14 43
44 23 10 17 9 16 5 25 44
45 23 10 20 10 10 8 26 45
46 25 10 15 12 11 8 20 46
47 24 10 20 14 14 10 18 47
48 24 10 33 14 9 6 32 48
49 23 10 29 10 12 8 25 49
50 21 10 23 14 17 7 25 50
51 24 10 26 16 5 4 23 51
52 24 10 18 9 12 8 21 52
53 28 10 20 10 12 8 20 53
54 16 10 11 6 6 4 15 54
55 20 10 28 8 24 20 30 55
56 29 10 26 13 12 8 24 56
57 27 10 22 10 12 8 26 57
58 22 10 17 8 14 6 24 58
59 28 10 12 7 7 4 22 59
60 16 10 14 15 13 8 14 60
61 25 10 17 9 12 9 24 61
62 24 10 21 10 13 6 24 62
63 28 10 19 12 14 7 24 63
64 24 10 18 13 8 9 24 64
65 23 10 10 10 11 5 19 65
66 30 10 29 11 9 5 31 66
67 24 10 31 8 11 8 22 67
68 21 10 19 9 13 8 27 68
69 25 10 9 13 10 6 19 69
70 25 10 20 11 11 8 25 70
71 22 10 28 8 12 7 20 71
72 23 10 19 9 9 7 21 72
73 26 10 30 9 15 9 27 73
74 23 10 29 15 18 11 23 74
75 25 10 26 9 15 6 25 75
76 21 10 23 10 12 8 20 76
77 25 10 13 14 13 6 21 77
78 24 10 21 12 14 9 22 78
79 29 10 19 12 10 8 23 79
80 22 10 28 11 13 6 25 80
81 27 10 23 14 13 10 25 81
82 26 10 18 6 11 8 17 82
83 22 10 21 12 13 8 19 83
84 24 10 20 8 16 10 25 84
85 27 10 23 14 8 5 19 85
86 24 10 21 11 16 7 20 86
87 24 10 21 10 11 5 26 87
88 29 10 15 14 9 8 23 88
89 22 10 28 12 16 14 27 89
90 21 10 19 10 12 7 17 90
91 24 10 26 14 14 8 17 91
92 24 10 10 5 8 6 19 92
93 23 10 16 11 9 5 17 93
94 20 10 22 10 15 6 22 94
95 27 10 19 9 11 10 21 95
96 26 10 31 10 21 12 32 96
97 25 10 31 16 14 9 21 97
98 21 10 29 13 18 12 21 98
99 21 10 19 9 12 7 18 99
100 19 10 22 10 13 8 18 100
101 21 10 23 10 15 10 23 101
102 21 10 15 7 12 6 19 102
103 16 10 20 9 19 10 20 103
104 22 10 18 8 15 10 21 104
105 29 10 23 14 11 10 20 105
106 15 10 25 14 11 5 17 106
107 17 10 21 8 10 7 18 107
108 15 10 24 9 13 10 19 108
109 21 10 25 14 15 11 22 109
110 21 10 17 14 12 6 15 110
111 19 10 13 8 12 7 14 111
112 24 10 28 8 16 12 18 112
113 20 10 21 8 9 11 24 113
114 17 10 25 7 18 11 35 114
115 23 10 9 6 8 11 29 115
116 24 10 16 8 13 5 21 116
117 14 10 19 6 17 8 25 117
118 19 10 17 11 9 6 20 118
119 24 10 25 14 15 9 22 119
120 13 10 20 11 8 4 13 120
121 22 10 29 11 7 4 26 121
122 16 10 14 11 12 7 17 122
123 19 10 22 14 14 11 25 123
124 25 10 15 8 6 6 20 124
125 25 10 19 20 8 7 19 125
126 23 10 20 11 17 8 21 126
127 24 10 15 8 10 4 22 127
128 26 10 20 11 11 8 24 128
129 26 10 18 10 14 9 21 129
130 25 10 33 14 11 8 26 130
131 18 10 22 11 13 11 24 131
132 21 10 16 9 12 8 16 132
133 26 10 17 9 11 5 23 133
134 23 10 16 8 9 4 18 134
135 23 10 21 10 12 8 16 135
136 22 10 26 13 20 10 26 136
137 20 10 18 13 12 6 19 137
138 13 10 18 12 13 9 21 138
139 24 10 17 8 12 9 21 139
140 15 10 22 13 12 13 22 140
141 14 10 30 14 9 9 23 141
142 22 10 30 12 15 10 29 142
143 10 10 24 14 24 20 21 143
144 24 10 21 15 7 5 21 144
145 22 10 21 13 17 11 23 145
146 24 10 29 16 11 6 27 146
147 19 10 31 9 17 9 25 147
148 20 10 20 9 11 7 21 148
149 13 10 16 9 12 9 10 149
150 20 10 22 8 14 10 20 150
151 22 10 20 7 11 9 26 151
152 24 10 28 16 16 8 24 152
153 29 10 38 11 21 7 29 153
154 12 10 22 9 14 6 19 154
155 20 10 20 11 20 13 24 155
156 21 10 17 9 13 6 19 156
157 24 10 28 14 11 8 24 157
158 22 10 22 13 15 10 22 158
159 20 10 31 16 19 16 17 159
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Months CM D PE PC
18.26518 -0.08082 -0.05915 0.21692 -0.13256 -0.25400
PS t
0.39567 -0.01477
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.2587 -1.9245 0.2826 2.1639 7.5018
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 18.265180 15.349762 1.190 0.2359
Months -0.080824 1.543240 -0.052 0.9583
CM -0.059154 0.062410 -0.948 0.3447
D 0.216924 0.111196 1.951 0.0529 .
PE -0.132556 0.103796 -1.277 0.2035
PC -0.254001 0.129774 -1.957 0.0522 .
PS 0.395674 0.075665 5.229 5.58e-07 ***
t -0.014766 0.006382 -2.314 0.0220 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.454 on 151 degrees of freedom
Multiple R-squared: 0.2523, Adjusted R-squared: 0.2176
F-statistic: 7.278 on 7 and 151 DF, p-value: 1.633e-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.388811921 0.777623841 0.6111881
[2,] 0.327160951 0.654321901 0.6728390
[3,] 0.605495953 0.789008095 0.3945040
[4,] 0.798945740 0.402108520 0.2010543
[5,] 0.735893075 0.528213850 0.2641069
[6,] 0.728799730 0.542400540 0.2712003
[7,] 0.646254838 0.707490324 0.3537452
[8,] 0.770551049 0.458897903 0.2294490
[9,] 0.712553678 0.574892645 0.2874463
[10,] 0.658537074 0.682925853 0.3414629
[11,] 0.590212787 0.819574426 0.4097872
[12,] 0.514603674 0.970792652 0.4853963
[13,] 0.501911471 0.996177058 0.4980885
[14,] 0.541661035 0.916677930 0.4583390
[15,] 0.675128752 0.649742495 0.3248712
[16,] 0.608206676 0.783586648 0.3917933
[17,] 0.549677876 0.900644248 0.4503221
[18,] 0.513206161 0.973587678 0.4867938
[19,] 0.451042831 0.902085661 0.5489572
[20,] 0.394921653 0.789843306 0.6050783
[21,] 0.391136589 0.782273177 0.6088634
[22,] 0.330310656 0.660621311 0.6696893
[23,] 0.621934224 0.756131552 0.3780658
[24,] 0.577676871 0.844646258 0.4223231
[25,] 0.553222368 0.893555264 0.4467776
[26,] 0.497071700 0.994143400 0.5029283
[27,] 0.483014894 0.966029788 0.5169851
[28,] 0.431904453 0.863808906 0.5680955
[29,] 0.382554842 0.765109683 0.6174452
[30,] 0.359526273 0.719052547 0.6404737
[31,] 0.509702399 0.980595201 0.4902976
[32,] 0.455954760 0.911909519 0.5440452
[33,] 0.437020250 0.874040501 0.5629797
[34,] 0.390414503 0.780829006 0.6095855
[35,] 0.350904247 0.701808494 0.6490958
[36,] 0.320169561 0.640339122 0.6798304
[37,] 0.290611801 0.581223601 0.7093882
[38,] 0.287170565 0.574341130 0.7128294
[39,] 0.248734757 0.497469514 0.7512652
[40,] 0.252832407 0.505664814 0.7471676
[41,] 0.232068095 0.464136190 0.7679319
[42,] 0.199720959 0.399441918 0.8002790
[43,] 0.258190266 0.516380532 0.7418097
[44,] 0.344858192 0.689716384 0.6551418
[45,] 0.330972549 0.661945099 0.6690275
[46,] 0.383485769 0.766971537 0.6165142
[47,] 0.357941919 0.715883839 0.6420581
[48,] 0.329596310 0.659192620 0.6704037
[49,] 0.328065181 0.656130361 0.6719348
[50,] 0.417917511 0.835835023 0.5820825
[51,] 0.373373721 0.746747442 0.6266263
[52,] 0.330689568 0.661379137 0.6693104
[53,] 0.328468945 0.656937889 0.6715311
[54,] 0.294505633 0.589011267 0.7054944
[55,] 0.256216239 0.512432478 0.7437838
[56,] 0.238331788 0.476663577 0.7616682
[57,] 0.207879658 0.415759316 0.7921203
[58,] 0.231608170 0.463216340 0.7683918
[59,] 0.198505794 0.397011588 0.8014942
[60,] 0.166937051 0.333874102 0.8330629
[61,] 0.138905493 0.277810985 0.8610945
[62,] 0.115186507 0.230373015 0.8848135
[63,] 0.098653574 0.197307149 0.9013464
[64,] 0.079644636 0.159289272 0.9203554
[65,] 0.063938468 0.127876936 0.9360615
[66,] 0.053774558 0.107549116 0.9462254
[67,] 0.042184184 0.084368369 0.9578158
[68,] 0.032571494 0.065142987 0.9674285
[69,] 0.036777262 0.073554524 0.9632227
[70,] 0.034359477 0.068718953 0.9656405
[71,] 0.028479770 0.056959539 0.9715202
[72,] 0.036990750 0.073981500 0.9630093
[73,] 0.028914791 0.057829581 0.9710852
[74,] 0.022521125 0.045042250 0.9774789
[75,] 0.020172501 0.040345002 0.9798275
[76,] 0.015670463 0.031340927 0.9843295
[77,] 0.012816537 0.025633075 0.9871835
[78,] 0.013111807 0.026223614 0.9868882
[79,] 0.011096811 0.022193621 0.9889032
[80,] 0.008435633 0.016871265 0.9915644
[81,] 0.007009882 0.014019765 0.9929901
[82,] 0.005684286 0.011368571 0.9943157
[83,] 0.004172386 0.008344771 0.9958276
[84,] 0.004107159 0.008214318 0.9958928
[85,] 0.006095033 0.012190066 0.9939050
[86,] 0.004923541 0.009847082 0.9950765
[87,] 0.004132592 0.008265184 0.9958674
[88,] 0.003183520 0.006367039 0.9968165
[89,] 0.002416003 0.004832006 0.9975840
[90,] 0.002045477 0.004090953 0.9979545
[91,] 0.001621383 0.003242767 0.9983786
[92,] 0.001194825 0.002389650 0.9988052
[93,] 0.001514341 0.003028683 0.9984857
[94,] 0.001178049 0.002356098 0.9988220
[95,] 0.005144788 0.010289576 0.9948552
[96,] 0.012975228 0.025950456 0.9870248
[97,] 0.013762186 0.027524372 0.9862378
[98,] 0.018845327 0.037690654 0.9811547
[99,] 0.014686960 0.029373920 0.9853130
[100,] 0.010639088 0.021278176 0.9893609
[101,] 0.007680369 0.015360738 0.9923196
[102,] 0.022127754 0.044255508 0.9778722
[103,] 0.022118259 0.044236518 0.9778817
[104,] 0.055328486 0.110656972 0.9446715
[105,] 0.047136392 0.094272783 0.9528636
[106,] 0.039427480 0.078854960 0.9605725
[107,] 0.103765893 0.207531787 0.8962341
[108,] 0.097924799 0.195849599 0.9020752
[109,] 0.087245832 0.174491663 0.9127542
[110,] 0.152343613 0.304687227 0.8476564
[111,] 0.149510112 0.299020225 0.8504899
[112,] 0.189821231 0.379642463 0.8101788
[113,] 0.189201762 0.378403525 0.8107982
[114,] 0.179172697 0.358345394 0.8208273
[115,] 0.155186382 0.310372764 0.8448136
[116,] 0.124362819 0.248725638 0.8756372
[117,] 0.097319045 0.194638090 0.9026810
[118,] 0.094740436 0.189480872 0.9052596
[119,] 0.132633761 0.265267522 0.8673662
[120,] 0.114656101 0.229312202 0.8853439
[121,] 0.096107012 0.192214025 0.9038930
[122,] 0.085267336 0.170534672 0.9147327
[123,] 0.083324994 0.166649988 0.9166750
[124,] 0.074095553 0.148191106 0.9259044
[125,] 0.173101014 0.346202027 0.8268990
[126,] 0.138030968 0.276061936 0.8619690
[127,] 0.115666778 0.231333557 0.8843332
[128,] 0.163171769 0.326343537 0.8368282
[129,] 0.394903450 0.789806901 0.6050965
[130,] 0.340483059 0.680966118 0.6595169
[131,] 0.484493738 0.968987476 0.5155063
[132,] 0.393268068 0.786536136 0.6067319
[133,] 0.556428664 0.887142671 0.4435713
[134,] 0.502585613 0.994828774 0.4974144
[135,] 0.405643386 0.811286772 0.5943566
[136,] 0.300847635 0.601695271 0.6991524
[137,] 0.292262080 0.584524160 0.7077379
[138,] 0.174421109 0.348842218 0.8255789
> postscript(file="/var/www/html/rcomp/tmp/1dojr1290538330.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/2dojr1290538330.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/36xiu1290538330.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/46xiu1290538330.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/56xiu1290538330.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 = 159
Frequency = 1
1 2 3 4 5 6
1.86971023 -2.34750045 -0.37415319 -0.17725791 -3.96270253 4.99190386
7 8 9 10 11 12
-0.75747263 -2.62688953 -1.08784218 1.50225196 2.63200470 -2.96511662
13 14 15 16 17 18
2.42318440 -6.76175059 -2.34468471 2.94261336 -3.14181607 -8.08854603
19 20 21 22 23 24
1.59793335 -2.41782127 -3.15993564 -1.72077134 0.81258936 0.92971643
25 26 27 28 29 30
5.22661518 1.31189628 -0.20699806 2.73785843 0.23107668 -0.41825190
31 32 33 34 35 36
4.07642117 1.18613970 -7.63635500 -1.50432626 -2.23921474 -1.26075882
37 38 39 40 41 42
-3.70654224 -1.46339731 -1.23607472 -3.09640498 6.46549195 -0.23775005
43 44 45 46 47 48
-2.44555468 -1.25488114 -1.70858442 2.08316328 2.65687027 -3.77758454
49 50 51 52 53 54
-0.45634686 -3.25542336 -2.05837402 1.73687772 6.04870162 -5.43419298
55 56 57 58 59 60
-0.33273527 5.21445462 2.85202968 -1.44666772 3.84470477 -4.78088130
61 62 63 64 65 66
1.87759791 0.28260796 4.13177460 -0.41687218 0.13546847 3.04403574
67 68 69 70 71 72
2.41606670 -3.20919850 1.60605074 0.97187475 0.96757208 0.43968455
73 74 75 76 77 78
3.03444057 1.17687356 1.85670073 -0.43421512 1.35019195 1.77092563
79 80 81 82 83 84
5.48748346 -1.65012176 3.43410611 6.28077532 0.64522107 2.00015762
85 86 87 88 89 90
3.93442757 2.65443702 -0.65870062 4.81735732 -0.09581984 0.46891546
91 92 93 94 95 96
3.54917592 2.47510917 1.21315596 -2.12926113 5.80642206 2.79526190
97 98 99 100 101 102
3.17099906 1.01045924 0.42306102 -1.21507758 -0.34641282 0.01491663
103 104 105 106 107 108
-3.56017124 1.62731239 7.50175146 -6.44815875 -3.38868970 -4.64938733
109 110 111 112 113 114
-0.32799800 0.31557903 0.04495112 6.16456327 -1.79068827 -7.48179089
115 116 117 118 119 120
-1.14808252 2.15107874 -7.51331164 -3.29155758 2.31166063 -6.95540331
121 122 123 124 125 126
-2.68457012 -4.57126302 -3.61831280 2.93183592 1.49491264 2.17681175
127 128 129 130 131 132
1.20700815 3.22398461 5.17605928 1.58039810 -3.58629244 1.77823080
133 134 135 136 137 138
3.18787205 1.81966536 3.90137505 0.17284929 -1.59235324 -8.25745061
139 140 141 142 143 144
3.43330311 -5.72045143 -8.25872532 -1.13481642 -7.01041158 0.54649249
145 146 147 148 149 150
1.05332929 -0.75748572 -1.75725091 -1.11382285 -3.34269897 0.80628870
151 152 153 154 155 156
-0.10604334 1.62976295 6.75110104 -7.97190253 0.08568264 0.62930325
157 158 159
1.47466161 1.18100347 3.10998615
> postscript(file="/var/www/html/rcomp/tmp/6y6zx1290538330.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 = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 1.86971023 NA
1 -2.34750045 1.86971023
2 -0.37415319 -2.34750045
3 -0.17725791 -0.37415319
4 -3.96270253 -0.17725791
5 4.99190386 -3.96270253
6 -0.75747263 4.99190386
7 -2.62688953 -0.75747263
8 -1.08784218 -2.62688953
9 1.50225196 -1.08784218
10 2.63200470 1.50225196
11 -2.96511662 2.63200470
12 2.42318440 -2.96511662
13 -6.76175059 2.42318440
14 -2.34468471 -6.76175059
15 2.94261336 -2.34468471
16 -3.14181607 2.94261336
17 -8.08854603 -3.14181607
18 1.59793335 -8.08854603
19 -2.41782127 1.59793335
20 -3.15993564 -2.41782127
21 -1.72077134 -3.15993564
22 0.81258936 -1.72077134
23 0.92971643 0.81258936
24 5.22661518 0.92971643
25 1.31189628 5.22661518
26 -0.20699806 1.31189628
27 2.73785843 -0.20699806
28 0.23107668 2.73785843
29 -0.41825190 0.23107668
30 4.07642117 -0.41825190
31 1.18613970 4.07642117
32 -7.63635500 1.18613970
33 -1.50432626 -7.63635500
34 -2.23921474 -1.50432626
35 -1.26075882 -2.23921474
36 -3.70654224 -1.26075882
37 -1.46339731 -3.70654224
38 -1.23607472 -1.46339731
39 -3.09640498 -1.23607472
40 6.46549195 -3.09640498
41 -0.23775005 6.46549195
42 -2.44555468 -0.23775005
43 -1.25488114 -2.44555468
44 -1.70858442 -1.25488114
45 2.08316328 -1.70858442
46 2.65687027 2.08316328
47 -3.77758454 2.65687027
48 -0.45634686 -3.77758454
49 -3.25542336 -0.45634686
50 -2.05837402 -3.25542336
51 1.73687772 -2.05837402
52 6.04870162 1.73687772
53 -5.43419298 6.04870162
54 -0.33273527 -5.43419298
55 5.21445462 -0.33273527
56 2.85202968 5.21445462
57 -1.44666772 2.85202968
58 3.84470477 -1.44666772
59 -4.78088130 3.84470477
60 1.87759791 -4.78088130
61 0.28260796 1.87759791
62 4.13177460 0.28260796
63 -0.41687218 4.13177460
64 0.13546847 -0.41687218
65 3.04403574 0.13546847
66 2.41606670 3.04403574
67 -3.20919850 2.41606670
68 1.60605074 -3.20919850
69 0.97187475 1.60605074
70 0.96757208 0.97187475
71 0.43968455 0.96757208
72 3.03444057 0.43968455
73 1.17687356 3.03444057
74 1.85670073 1.17687356
75 -0.43421512 1.85670073
76 1.35019195 -0.43421512
77 1.77092563 1.35019195
78 5.48748346 1.77092563
79 -1.65012176 5.48748346
80 3.43410611 -1.65012176
81 6.28077532 3.43410611
82 0.64522107 6.28077532
83 2.00015762 0.64522107
84 3.93442757 2.00015762
85 2.65443702 3.93442757
86 -0.65870062 2.65443702
87 4.81735732 -0.65870062
88 -0.09581984 4.81735732
89 0.46891546 -0.09581984
90 3.54917592 0.46891546
91 2.47510917 3.54917592
92 1.21315596 2.47510917
93 -2.12926113 1.21315596
94 5.80642206 -2.12926113
95 2.79526190 5.80642206
96 3.17099906 2.79526190
97 1.01045924 3.17099906
98 0.42306102 1.01045924
99 -1.21507758 0.42306102
100 -0.34641282 -1.21507758
101 0.01491663 -0.34641282
102 -3.56017124 0.01491663
103 1.62731239 -3.56017124
104 7.50175146 1.62731239
105 -6.44815875 7.50175146
106 -3.38868970 -6.44815875
107 -4.64938733 -3.38868970
108 -0.32799800 -4.64938733
109 0.31557903 -0.32799800
110 0.04495112 0.31557903
111 6.16456327 0.04495112
112 -1.79068827 6.16456327
113 -7.48179089 -1.79068827
114 -1.14808252 -7.48179089
115 2.15107874 -1.14808252
116 -7.51331164 2.15107874
117 -3.29155758 -7.51331164
118 2.31166063 -3.29155758
119 -6.95540331 2.31166063
120 -2.68457012 -6.95540331
121 -4.57126302 -2.68457012
122 -3.61831280 -4.57126302
123 2.93183592 -3.61831280
124 1.49491264 2.93183592
125 2.17681175 1.49491264
126 1.20700815 2.17681175
127 3.22398461 1.20700815
128 5.17605928 3.22398461
129 1.58039810 5.17605928
130 -3.58629244 1.58039810
131 1.77823080 -3.58629244
132 3.18787205 1.77823080
133 1.81966536 3.18787205
134 3.90137505 1.81966536
135 0.17284929 3.90137505
136 -1.59235324 0.17284929
137 -8.25745061 -1.59235324
138 3.43330311 -8.25745061
139 -5.72045143 3.43330311
140 -8.25872532 -5.72045143
141 -1.13481642 -8.25872532
142 -7.01041158 -1.13481642
143 0.54649249 -7.01041158
144 1.05332929 0.54649249
145 -0.75748572 1.05332929
146 -1.75725091 -0.75748572
147 -1.11382285 -1.75725091
148 -3.34269897 -1.11382285
149 0.80628870 -3.34269897
150 -0.10604334 0.80628870
151 1.62976295 -0.10604334
152 6.75110104 1.62976295
153 -7.97190253 6.75110104
154 0.08568264 -7.97190253
155 0.62930325 0.08568264
156 1.47466161 0.62930325
157 1.18100347 1.47466161
158 3.10998615 1.18100347
159 NA 3.10998615
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.34750045 1.86971023
[2,] -0.37415319 -2.34750045
[3,] -0.17725791 -0.37415319
[4,] -3.96270253 -0.17725791
[5,] 4.99190386 -3.96270253
[6,] -0.75747263 4.99190386
[7,] -2.62688953 -0.75747263
[8,] -1.08784218 -2.62688953
[9,] 1.50225196 -1.08784218
[10,] 2.63200470 1.50225196
[11,] -2.96511662 2.63200470
[12,] 2.42318440 -2.96511662
[13,] -6.76175059 2.42318440
[14,] -2.34468471 -6.76175059
[15,] 2.94261336 -2.34468471
[16,] -3.14181607 2.94261336
[17,] -8.08854603 -3.14181607
[18,] 1.59793335 -8.08854603
[19,] -2.41782127 1.59793335
[20,] -3.15993564 -2.41782127
[21,] -1.72077134 -3.15993564
[22,] 0.81258936 -1.72077134
[23,] 0.92971643 0.81258936
[24,] 5.22661518 0.92971643
[25,] 1.31189628 5.22661518
[26,] -0.20699806 1.31189628
[27,] 2.73785843 -0.20699806
[28,] 0.23107668 2.73785843
[29,] -0.41825190 0.23107668
[30,] 4.07642117 -0.41825190
[31,] 1.18613970 4.07642117
[32,] -7.63635500 1.18613970
[33,] -1.50432626 -7.63635500
[34,] -2.23921474 -1.50432626
[35,] -1.26075882 -2.23921474
[36,] -3.70654224 -1.26075882
[37,] -1.46339731 -3.70654224
[38,] -1.23607472 -1.46339731
[39,] -3.09640498 -1.23607472
[40,] 6.46549195 -3.09640498
[41,] -0.23775005 6.46549195
[42,] -2.44555468 -0.23775005
[43,] -1.25488114 -2.44555468
[44,] -1.70858442 -1.25488114
[45,] 2.08316328 -1.70858442
[46,] 2.65687027 2.08316328
[47,] -3.77758454 2.65687027
[48,] -0.45634686 -3.77758454
[49,] -3.25542336 -0.45634686
[50,] -2.05837402 -3.25542336
[51,] 1.73687772 -2.05837402
[52,] 6.04870162 1.73687772
[53,] -5.43419298 6.04870162
[54,] -0.33273527 -5.43419298
[55,] 5.21445462 -0.33273527
[56,] 2.85202968 5.21445462
[57,] -1.44666772 2.85202968
[58,] 3.84470477 -1.44666772
[59,] -4.78088130 3.84470477
[60,] 1.87759791 -4.78088130
[61,] 0.28260796 1.87759791
[62,] 4.13177460 0.28260796
[63,] -0.41687218 4.13177460
[64,] 0.13546847 -0.41687218
[65,] 3.04403574 0.13546847
[66,] 2.41606670 3.04403574
[67,] -3.20919850 2.41606670
[68,] 1.60605074 -3.20919850
[69,] 0.97187475 1.60605074
[70,] 0.96757208 0.97187475
[71,] 0.43968455 0.96757208
[72,] 3.03444057 0.43968455
[73,] 1.17687356 3.03444057
[74,] 1.85670073 1.17687356
[75,] -0.43421512 1.85670073
[76,] 1.35019195 -0.43421512
[77,] 1.77092563 1.35019195
[78,] 5.48748346 1.77092563
[79,] -1.65012176 5.48748346
[80,] 3.43410611 -1.65012176
[81,] 6.28077532 3.43410611
[82,] 0.64522107 6.28077532
[83,] 2.00015762 0.64522107
[84,] 3.93442757 2.00015762
[85,] 2.65443702 3.93442757
[86,] -0.65870062 2.65443702
[87,] 4.81735732 -0.65870062
[88,] -0.09581984 4.81735732
[89,] 0.46891546 -0.09581984
[90,] 3.54917592 0.46891546
[91,] 2.47510917 3.54917592
[92,] 1.21315596 2.47510917
[93,] -2.12926113 1.21315596
[94,] 5.80642206 -2.12926113
[95,] 2.79526190 5.80642206
[96,] 3.17099906 2.79526190
[97,] 1.01045924 3.17099906
[98,] 0.42306102 1.01045924
[99,] -1.21507758 0.42306102
[100,] -0.34641282 -1.21507758
[101,] 0.01491663 -0.34641282
[102,] -3.56017124 0.01491663
[103,] 1.62731239 -3.56017124
[104,] 7.50175146 1.62731239
[105,] -6.44815875 7.50175146
[106,] -3.38868970 -6.44815875
[107,] -4.64938733 -3.38868970
[108,] -0.32799800 -4.64938733
[109,] 0.31557903 -0.32799800
[110,] 0.04495112 0.31557903
[111,] 6.16456327 0.04495112
[112,] -1.79068827 6.16456327
[113,] -7.48179089 -1.79068827
[114,] -1.14808252 -7.48179089
[115,] 2.15107874 -1.14808252
[116,] -7.51331164 2.15107874
[117,] -3.29155758 -7.51331164
[118,] 2.31166063 -3.29155758
[119,] -6.95540331 2.31166063
[120,] -2.68457012 -6.95540331
[121,] -4.57126302 -2.68457012
[122,] -3.61831280 -4.57126302
[123,] 2.93183592 -3.61831280
[124,] 1.49491264 2.93183592
[125,] 2.17681175 1.49491264
[126,] 1.20700815 2.17681175
[127,] 3.22398461 1.20700815
[128,] 5.17605928 3.22398461
[129,] 1.58039810 5.17605928
[130,] -3.58629244 1.58039810
[131,] 1.77823080 -3.58629244
[132,] 3.18787205 1.77823080
[133,] 1.81966536 3.18787205
[134,] 3.90137505 1.81966536
[135,] 0.17284929 3.90137505
[136,] -1.59235324 0.17284929
[137,] -8.25745061 -1.59235324
[138,] 3.43330311 -8.25745061
[139,] -5.72045143 3.43330311
[140,] -8.25872532 -5.72045143
[141,] -1.13481642 -8.25872532
[142,] -7.01041158 -1.13481642
[143,] 0.54649249 -7.01041158
[144,] 1.05332929 0.54649249
[145,] -0.75748572 1.05332929
[146,] -1.75725091 -0.75748572
[147,] -1.11382285 -1.75725091
[148,] -3.34269897 -1.11382285
[149,] 0.80628870 -3.34269897
[150,] -0.10604334 0.80628870
[151,] 1.62976295 -0.10604334
[152,] 6.75110104 1.62976295
[153,] -7.97190253 6.75110104
[154,] 0.08568264 -7.97190253
[155,] 0.62930325 0.08568264
[156,] 1.47466161 0.62930325
[157,] 1.18100347 1.47466161
[158,] 3.10998615 1.18100347
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.34750045 1.86971023
2 -0.37415319 -2.34750045
3 -0.17725791 -0.37415319
4 -3.96270253 -0.17725791
5 4.99190386 -3.96270253
6 -0.75747263 4.99190386
7 -2.62688953 -0.75747263
8 -1.08784218 -2.62688953
9 1.50225196 -1.08784218
10 2.63200470 1.50225196
11 -2.96511662 2.63200470
12 2.42318440 -2.96511662
13 -6.76175059 2.42318440
14 -2.34468471 -6.76175059
15 2.94261336 -2.34468471
16 -3.14181607 2.94261336
17 -8.08854603 -3.14181607
18 1.59793335 -8.08854603
19 -2.41782127 1.59793335
20 -3.15993564 -2.41782127
21 -1.72077134 -3.15993564
22 0.81258936 -1.72077134
23 0.92971643 0.81258936
24 5.22661518 0.92971643
25 1.31189628 5.22661518
26 -0.20699806 1.31189628
27 2.73785843 -0.20699806
28 0.23107668 2.73785843
29 -0.41825190 0.23107668
30 4.07642117 -0.41825190
31 1.18613970 4.07642117
32 -7.63635500 1.18613970
33 -1.50432626 -7.63635500
34 -2.23921474 -1.50432626
35 -1.26075882 -2.23921474
36 -3.70654224 -1.26075882
37 -1.46339731 -3.70654224
38 -1.23607472 -1.46339731
39 -3.09640498 -1.23607472
40 6.46549195 -3.09640498
41 -0.23775005 6.46549195
42 -2.44555468 -0.23775005
43 -1.25488114 -2.44555468
44 -1.70858442 -1.25488114
45 2.08316328 -1.70858442
46 2.65687027 2.08316328
47 -3.77758454 2.65687027
48 -0.45634686 -3.77758454
49 -3.25542336 -0.45634686
50 -2.05837402 -3.25542336
51 1.73687772 -2.05837402
52 6.04870162 1.73687772
53 -5.43419298 6.04870162
54 -0.33273527 -5.43419298
55 5.21445462 -0.33273527
56 2.85202968 5.21445462
57 -1.44666772 2.85202968
58 3.84470477 -1.44666772
59 -4.78088130 3.84470477
60 1.87759791 -4.78088130
61 0.28260796 1.87759791
62 4.13177460 0.28260796
63 -0.41687218 4.13177460
64 0.13546847 -0.41687218
65 3.04403574 0.13546847
66 2.41606670 3.04403574
67 -3.20919850 2.41606670
68 1.60605074 -3.20919850
69 0.97187475 1.60605074
70 0.96757208 0.97187475
71 0.43968455 0.96757208
72 3.03444057 0.43968455
73 1.17687356 3.03444057
74 1.85670073 1.17687356
75 -0.43421512 1.85670073
76 1.35019195 -0.43421512
77 1.77092563 1.35019195
78 5.48748346 1.77092563
79 -1.65012176 5.48748346
80 3.43410611 -1.65012176
81 6.28077532 3.43410611
82 0.64522107 6.28077532
83 2.00015762 0.64522107
84 3.93442757 2.00015762
85 2.65443702 3.93442757
86 -0.65870062 2.65443702
87 4.81735732 -0.65870062
88 -0.09581984 4.81735732
89 0.46891546 -0.09581984
90 3.54917592 0.46891546
91 2.47510917 3.54917592
92 1.21315596 2.47510917
93 -2.12926113 1.21315596
94 5.80642206 -2.12926113
95 2.79526190 5.80642206
96 3.17099906 2.79526190
97 1.01045924 3.17099906
98 0.42306102 1.01045924
99 -1.21507758 0.42306102
100 -0.34641282 -1.21507758
101 0.01491663 -0.34641282
102 -3.56017124 0.01491663
103 1.62731239 -3.56017124
104 7.50175146 1.62731239
105 -6.44815875 7.50175146
106 -3.38868970 -6.44815875
107 -4.64938733 -3.38868970
108 -0.32799800 -4.64938733
109 0.31557903 -0.32799800
110 0.04495112 0.31557903
111 6.16456327 0.04495112
112 -1.79068827 6.16456327
113 -7.48179089 -1.79068827
114 -1.14808252 -7.48179089
115 2.15107874 -1.14808252
116 -7.51331164 2.15107874
117 -3.29155758 -7.51331164
118 2.31166063 -3.29155758
119 -6.95540331 2.31166063
120 -2.68457012 -6.95540331
121 -4.57126302 -2.68457012
122 -3.61831280 -4.57126302
123 2.93183592 -3.61831280
124 1.49491264 2.93183592
125 2.17681175 1.49491264
126 1.20700815 2.17681175
127 3.22398461 1.20700815
128 5.17605928 3.22398461
129 1.58039810 5.17605928
130 -3.58629244 1.58039810
131 1.77823080 -3.58629244
132 3.18787205 1.77823080
133 1.81966536 3.18787205
134 3.90137505 1.81966536
135 0.17284929 3.90137505
136 -1.59235324 0.17284929
137 -8.25745061 -1.59235324
138 3.43330311 -8.25745061
139 -5.72045143 3.43330311
140 -8.25872532 -5.72045143
141 -1.13481642 -8.25872532
142 -7.01041158 -1.13481642
143 0.54649249 -7.01041158
144 1.05332929 0.54649249
145 -0.75748572 1.05332929
146 -1.75725091 -0.75748572
147 -1.11382285 -1.75725091
148 -3.34269897 -1.11382285
149 0.80628870 -3.34269897
150 -0.10604334 0.80628870
151 1.62976295 -0.10604334
152 6.75110104 1.62976295
153 -7.97190253 6.75110104
154 0.08568264 -7.97190253
155 0.62930325 0.08568264
156 1.47466161 0.62930325
157 1.18100347 1.47466161
158 3.10998615 1.18100347
> 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/79fyi1290538330.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/89fyi1290538330.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/99fyi1290538330.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/1017yk1290538330.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/11npw81290538330.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/1288ve1290538330.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/13f9sq1290538330.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/14j98w1290538330.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/15mspj1290538330.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/160kms1290538330.tab")
+ }
>
> try(system("convert tmp/1dojr1290538330.ps tmp/1dojr1290538330.png",intern=TRUE))
character(0)
> try(system("convert tmp/2dojr1290538330.ps tmp/2dojr1290538330.png",intern=TRUE))
character(0)
> try(system("convert tmp/36xiu1290538330.ps tmp/36xiu1290538330.png",intern=TRUE))
character(0)
> try(system("convert tmp/46xiu1290538330.ps tmp/46xiu1290538330.png",intern=TRUE))
character(0)
> try(system("convert tmp/56xiu1290538330.ps tmp/56xiu1290538330.png",intern=TRUE))
character(0)
> try(system("convert tmp/6y6zx1290538330.ps tmp/6y6zx1290538330.png",intern=TRUE))
character(0)
> try(system("convert tmp/79fyi1290538330.ps tmp/79fyi1290538330.png",intern=TRUE))
character(0)
> try(system("convert tmp/89fyi1290538330.ps tmp/89fyi1290538330.png",intern=TRUE))
character(0)
> try(system("convert tmp/99fyi1290538330.ps tmp/99fyi1290538330.png",intern=TRUE))
character(0)
> try(system("convert tmp/1017yk1290538330.ps tmp/1017yk1290538330.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.154 1.682 9.225