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(24
+ ,24
+ ,14
+ ,11
+ ,12
+ ,25
+ ,25
+ ,11
+ ,7
+ ,8
+ ,30
+ ,17
+ ,6
+ ,17
+ ,8
+ ,19
+ ,18
+ ,12
+ ,10
+ ,8
+ ,22
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,16
+ ,10
+ ,12
+ ,7
+ ,25
+ ,20
+ ,10
+ ,11
+ ,4
+ ,23
+ ,16
+ ,11
+ ,11
+ ,11
+ ,17
+ ,18
+ ,16
+ ,12
+ ,7
+ ,21
+ ,17
+ ,11
+ ,13
+ ,7
+ ,19
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,30
+ ,12
+ ,16
+ ,10
+ ,15
+ ,23
+ ,8
+ ,11
+ ,10
+ ,16
+ ,18
+ ,12
+ ,10
+ ,8
+ ,23
+ ,15
+ ,11
+ ,11
+ ,8
+ ,27
+ ,12
+ ,4
+ ,15
+ ,4
+ ,22
+ ,21
+ ,9
+ ,9
+ ,9
+ ,14
+ ,15
+ ,8
+ ,11
+ ,8
+ ,22
+ ,20
+ ,8
+ ,17
+ ,7
+ ,23
+ ,31
+ ,14
+ ,17
+ ,11
+ ,23
+ ,27
+ ,15
+ ,11
+ ,9
+ ,21
+ ,34
+ ,16
+ ,18
+ ,11
+ ,19
+ ,21
+ ,9
+ ,14
+ ,13
+ ,18
+ ,31
+ ,14
+ ,10
+ ,8
+ ,20
+ ,19
+ ,11
+ ,11
+ ,8
+ ,23
+ ,16
+ ,8
+ ,15
+ ,9
+ ,25
+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','PE','PC'),1:159))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'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
PS CM D PE PC
1 24 24 14 11 12
2 25 25 11 7 8
3 30 17 6 17 8
4 19 18 12 10 8
5 22 18 8 12 9
6 22 16 10 12 7
7 25 20 10 11 4
8 23 16 11 11 11
9 17 18 16 12 7
10 21 17 11 13 7
11 19 23 13 14 12
12 19 30 12 16 10
13 15 23 8 11 10
14 16 18 12 10 8
15 23 15 11 11 8
16 27 12 4 15 4
17 22 21 9 9 9
18 14 15 8 11 8
19 22 20 8 17 7
20 23 31 14 17 11
21 23 27 15 11 9
22 21 34 16 18 11
23 19 21 9 14 13
24 18 31 14 10 8
25 20 19 11 11 8
26 23 16 8 15 9
27 25 20 9 15 6
28 19 21 9 13 9
29 24 22 9 16 9
30 22 17 9 13 6
31 25 24 10 9 6
32 26 25 16 18 16
33 29 26 11 18 5
34 32 25 8 12 7
35 25 17 9 17 9
36 29 32 16 9 6
37 28 33 11 9 6
38 17 13 16 12 5
39 28 32 12 18 12
40 29 25 12 12 7
41 26 29 14 18 10
42 25 22 9 14 9
43 14 18 10 15 8
44 25 17 9 16 5
45 26 20 10 10 8
46 20 15 12 11 8
47 18 20 14 14 10
48 32 33 14 9 6
49 25 29 10 12 8
50 25 23 14 17 7
51 23 26 16 5 4
52 21 18 9 12 8
53 20 20 10 12 8
54 15 11 6 6 4
55 30 28 8 24 20
56 24 26 13 12 8
57 26 22 10 12 8
58 24 17 8 14 6
59 22 12 7 7 4
60 14 14 15 13 8
61 24 17 9 12 9
62 24 21 10 13 6
63 24 19 12 14 7
64 24 18 13 8 9
65 19 10 10 11 5
66 31 29 11 9 5
67 22 31 8 11 8
68 27 19 9 13 8
69 19 9 13 10 6
70 25 20 11 11 8
71 20 28 8 12 7
72 21 19 9 9 7
73 27 30 9 15 9
74 23 29 15 18 11
75 25 26 9 15 6
76 20 23 10 12 8
77 21 13 14 13 6
78 22 21 12 14 9
79 23 19 12 10 8
80 25 28 11 13 6
81 25 23 14 13 10
82 17 18 6 11 8
83 19 21 12 13 8
84 25 20 8 16 10
85 19 23 14 8 5
86 20 21 11 16 7
87 26 21 10 11 5
88 23 15 14 9 8
89 27 28 12 16 14
90 17 19 10 12 7
91 17 26 14 14 8
92 19 10 5 8 6
93 17 16 11 9 5
94 22 22 10 15 6
95 21 19 9 11 10
96 32 31 10 21 12
97 21 31 16 14 9
98 21 29 13 18 12
99 18 19 9 12 7
100 18 22 10 13 8
101 23 23 10 15 10
102 19 15 7 12 6
103 20 20 9 19 10
104 21 18 8 15 10
105 20 23 14 11 10
106 17 25 14 11 5
107 18 21 8 10 7
108 19 24 9 13 10
109 22 25 14 15 11
110 15 17 14 12 6
111 14 13 8 12 7
112 18 28 8 16 12
113 24 21 8 9 11
114 35 25 7 18 11
115 29 9 6 8 11
116 21 16 8 13 5
117 25 19 6 17 8
118 20 17 11 9 6
119 22 25 14 15 9
120 13 20 11 8 4
121 26 29 11 7 4
122 17 14 11 12 7
123 25 22 14 14 11
124 20 15 8 6 6
125 19 19 20 8 7
126 21 20 11 17 8
127 22 15 8 10 4
128 24 20 11 11 8
129 21 18 10 14 9
130 26 33 14 11 8
131 24 22 11 13 11
132 16 16 9 12 8
133 23 17 9 11 5
134 18 16 8 9 4
135 16 21 10 12 8
136 26 26 13 20 10
137 19 18 13 12 6
138 21 18 12 13 9
139 21 17 8 12 9
140 22 22 13 12 13
141 23 30 14 9 9
142 29 30 12 15 10
143 21 24 14 24 20
144 21 21 15 7 5
145 23 21 13 17 11
146 27 29 16 11 6
147 25 31 9 17 9
148 21 20 9 11 7
149 10 16 9 12 9
150 20 22 8 14 10
151 26 20 7 11 9
152 24 28 16 16 8
153 29 38 11 21 7
154 19 22 9 14 6
155 24 20 11 20 13
156 19 17 9 13 6
157 24 28 14 11 8
158 22 22 13 15 10
159 17 31 16 19 16
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) CM D PE PC
16.78149 0.36104 -0.33141 0.15269 -0.09514
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-10.5515 -2.5219 0.3322 2.4195 10.7827
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 16.78149 1.64963 10.173 < 2e-16 ***
CM 0.36104 0.06041 5.976 1.53e-08 ***
D -0.33141 0.11701 -2.832 0.00524 **
PE 0.15269 0.11043 1.383 0.16876
PC -0.09514 0.13877 -0.686 0.49396
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.729 on 154 degrees of freedom
Multiple R-squared: 0.2378, Adjusted R-squared: 0.218
F-statistic: 12.01 on 4 and 154 DF, p-value: 1.61e-08
> 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.27544126 0.5508825 0.72455874
[2,] 0.16788505 0.3357701 0.83211495
[3,] 0.09178646 0.1835729 0.90821354
[4,] 0.19871548 0.3974310 0.80128452
[5,] 0.26281679 0.5256336 0.73718321
[6,] 0.77821736 0.4435653 0.22178264
[7,] 0.80378380 0.3924324 0.19621620
[8,] 0.74784001 0.5043200 0.25215999
[9,] 0.68724225 0.6255155 0.31275775
[10,] 0.60607631 0.7878474 0.39392369
[11,] 0.84179225 0.3164155 0.15820775
[12,] 0.80144899 0.3971020 0.19855101
[13,] 0.75830490 0.4833902 0.24169510
[14,] 0.72614983 0.5477003 0.27385017
[15,] 0.67849362 0.6430128 0.32150638
[16,] 0.62815353 0.7436929 0.37184647
[17,] 0.62659321 0.7468136 0.37340679
[18,] 0.56332725 0.8733455 0.43667275
[19,] 0.50018885 0.9996223 0.49981115
[20,] 0.44756441 0.8951288 0.55243559
[21,] 0.42385262 0.8477052 0.57614738
[22,] 0.36770596 0.7354119 0.63229404
[23,] 0.31203523 0.6240705 0.68796477
[24,] 0.29444732 0.5888946 0.70555268
[25,] 0.38834607 0.7766921 0.61165393
[26,] 0.39827041 0.7965408 0.60172959
[27,] 0.64600506 0.7079899 0.35399494
[28,] 0.61126006 0.7774799 0.38873994
[29,] 0.69884860 0.6023028 0.30115140
[30,] 0.66999675 0.6600065 0.33000325
[31,] 0.63558622 0.7288276 0.36441378
[32,] 0.60508404 0.7898319 0.39491596
[33,] 0.66437528 0.6712494 0.33562472
[34,] 0.61966193 0.7606761 0.38033807
[35,] 0.57704624 0.8459075 0.42295376
[36,] 0.75054649 0.4989070 0.24945351
[37,] 0.72654856 0.5469029 0.27345144
[38,] 0.74028118 0.5194376 0.25971882
[39,] 0.69838791 0.6032242 0.30161209
[40,] 0.66959000 0.6608200 0.33041000
[41,] 0.74605521 0.5078896 0.25394479
[42,] 0.70765324 0.5846935 0.29234676
[43,] 0.67980154 0.6403969 0.32019846
[44,] 0.63841186 0.7231763 0.36158814
[45,] 0.59268582 0.8146284 0.40731418
[46,] 0.55960233 0.8807953 0.44039767
[47,] 0.59817484 0.8036503 0.40182516
[48,] 0.62522497 0.7495501 0.37477503
[49,] 0.58050275 0.8389945 0.41949725
[50,] 0.56903688 0.8619262 0.43096312
[51,] 0.53446960 0.9310608 0.46553040
[52,] 0.50677577 0.9864485 0.49322423
[53,] 0.50594318 0.9881136 0.49405682
[54,] 0.49165147 0.9833029 0.50834853
[55,] 0.45239539 0.9047908 0.54760461
[56,] 0.43161613 0.8632323 0.56838387
[57,] 0.47379487 0.9475897 0.52620513
[58,] 0.42968435 0.8593687 0.57031565
[59,] 0.50799216 0.9840157 0.49200784
[60,] 0.55337899 0.8932420 0.44662101
[61,] 0.59221938 0.8155612 0.40778062
[62,] 0.56699516 0.8660097 0.43300484
[63,] 0.56694477 0.8661105 0.43305523
[64,] 0.63790977 0.7241805 0.36209023
[65,] 0.59495453 0.8100909 0.40504547
[66,] 0.55395377 0.8920925 0.44604623
[67,] 0.51321375 0.9735725 0.48678625
[68,] 0.47688633 0.9537727 0.52311367
[69,] 0.46077327 0.9215465 0.53922673
[70,] 0.44685247 0.8937049 0.55314753
[71,] 0.40307220 0.8061444 0.59692780
[72,] 0.38107813 0.7621563 0.61892187
[73,] 0.34374448 0.6874890 0.65625552
[74,] 0.34073829 0.6814766 0.65926171
[75,] 0.38431056 0.7686211 0.61568944
[76,] 0.36366759 0.7273352 0.63633241
[77,] 0.33758132 0.6751626 0.66241868
[78,] 0.31259653 0.6251931 0.68740347
[79,] 0.29414292 0.5882858 0.70585708
[80,] 0.30602529 0.6120506 0.69397471
[81,] 0.34488466 0.6897693 0.65511534
[82,] 0.32686642 0.6537328 0.67313358
[83,] 0.34280730 0.6856146 0.65719270
[84,] 0.40462073 0.8092415 0.59537927
[85,] 0.36128031 0.7225606 0.63871969
[86,] 0.33851490 0.6770298 0.66148510
[87,] 0.30270440 0.6054088 0.69729560
[88,] 0.26303972 0.5260794 0.73696028
[89,] 0.30951376 0.6190275 0.69048624
[90,] 0.29188664 0.5837733 0.70811336
[91,] 0.28569095 0.5713819 0.71430905
[92,] 0.28091201 0.5618240 0.71908799
[93,] 0.29527098 0.5905420 0.70472902
[94,] 0.25553625 0.5110725 0.74446375
[95,] 0.22668182 0.4533636 0.77331818
[96,] 0.20762226 0.4152445 0.79237774
[97,] 0.17574246 0.3514849 0.82425754
[98,] 0.14864550 0.2972910 0.85135450
[99,] 0.16987237 0.3397447 0.83012763
[100,] 0.18057707 0.3611541 0.81942293
[101,] 0.19497865 0.3899573 0.80502135
[102,] 0.16268754 0.3253751 0.83731246
[103,] 0.16561979 0.3312396 0.83438021
[104,] 0.20510669 0.4102134 0.79489331
[105,] 0.34699469 0.6939894 0.65300531
[106,] 0.30774166 0.6154833 0.69225834
[107,] 0.59372221 0.8125556 0.40627779
[108,] 0.91277352 0.1744530 0.08722648
[109,] 0.89041670 0.2191666 0.10958330
[110,] 0.88535493 0.2292901 0.11464507
[111,] 0.85695711 0.2860858 0.14304289
[112,] 0.82406043 0.3518791 0.17593957
[113,] 0.93735676 0.1252865 0.06264324
[114,] 0.91959252 0.1608150 0.08040748
[115,] 0.90202465 0.1959507 0.09797535
[116,] 0.90841899 0.1831620 0.09158101
[117,] 0.88419458 0.2316108 0.11580542
[118,] 0.85388131 0.2922374 0.14611869
[119,] 0.81732394 0.3653521 0.18267606
[120,] 0.79239209 0.4152158 0.20760791
[121,] 0.78791475 0.4241705 0.21208525
[122,] 0.74465396 0.5106921 0.25534604
[123,] 0.69099373 0.6180125 0.30900627
[124,] 0.67773595 0.6445281 0.32226405
[125,] 0.66195717 0.6760857 0.33804283
[126,] 0.64211093 0.7157781 0.35788907
[127,] 0.58756258 0.8248748 0.41243742
[128,] 0.65302117 0.6939577 0.34697883
[129,] 0.61614169 0.7677166 0.38385831
[130,] 0.55041567 0.8991687 0.44958433
[131,] 0.48464734 0.9692947 0.51535266
[132,] 0.42311221 0.8462244 0.57688779
[133,] 0.37042519 0.7408504 0.62957481
[134,] 0.30137855 0.6027571 0.69862145
[135,] 0.32995092 0.6599018 0.67004908
[136,] 0.27628966 0.5525793 0.72371034
[137,] 0.20739555 0.4147911 0.79260445
[138,] 0.18328472 0.3665694 0.81671528
[139,] 0.16069762 0.3213952 0.83930238
[140,] 0.10768202 0.2153640 0.89231798
[141,] 0.06702927 0.1340585 0.93297073
[142,] 0.32425939 0.6485188 0.67574061
[143,] 0.25974577 0.5194915 0.74025423
[144,] 0.33333183 0.6666637 0.66666817
> postscript(file="/var/www/html/rcomp/tmp/1pkxf1290523939.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/2pkxf1290523939.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/3ibw01290523939.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/4ibw01290523939.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/5ibw01290523939.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
2.655396715 2.530315038 7.234667042 -1.069064789 0.395053338
6 7 8 9 10
1.589666866 3.012761388 3.454348308 -2.143952242 0.407344045
11 12 13 14 15
-2.773049790 -6.127420942 -8.162314455 -4.069064789 3.529955283
16 17 18 19 20
5.301856912 0.101417929 -6.464276120 -1.280779555 -1.883188634
21 22 23 24 25
0.618250330 -4.456182901 -3.281465086 -6.099776296 -0.914208545
26 27 28 29 30
1.659058258 2.260870915 -3.509351397 0.671530651 0.649378449
31 32 33 34 35
2.064271543 4.268909015 4.204224453 7.677477317 3.324043105
36 37 38 39 40
5.164406693 2.146313397 -0.529036777 2.035401802 6.003119188
41 42 43 44 45
1.591056288 1.976915314 -7.495347382 3.096156795 4.546032361
46 47 48 49 50
0.861365751 -2.548805772 7.140544801 -0.008720915 2.624560380
51 52 53 54 55
1.751132440 -0.368680855 -1.759352301 -4.300050212 3.998927056
56 57 58 59 60
1.068633359 3.518565784 2.165275650 2.517626967 -4.088746552
61 62 63 64 65
3.087504763 1.536625089 2.863980268 4.662875002 0.718315619
66 67 68 69 70
6.495332565 -4.240931433 5.117585856 2.321424971 3.724750498
71 72 73 74 75
-5.405645554 -0.366789478 0.935895326 -0.982388584 0.094625173
76 77 78 79 80
-2.842475173 2.750594616 0.332187675 2.569894254 0.340748857
81 82 83 84 85
3.520763688 -5.210219927 -2.610264655 2.157346758 -2.191497958
86 87 88 89 90
-2.494896777 3.746865091 4.829571349 2.975239615 -4.493456005
91 92 93 94 95
-5.905340836 -0.385515064 -2.811134993 -1.129800531 -0.386740159
96 97 98 99 100
5.275544830 -2.952580026 -3.550064859 -3.824866473 -4.634126547
101 102 103 104 105
-0.110262846 -2.138668240 -2.969319768 -0.967878996 -1.173851649
106 107 108 109 110
-5.371656866 -4.572974192 -4.497329608 -0.411558229 -4.540876881
111 112 113 114 115
-5.990031198 -7.540691577 1.960296782 9.810491503 10.782659663
116 117 118 119 120
-0.416135722 1.512585128 -0.077031289 -0.601847550 -8.197751150
121 122 123 124 125
1.705572568 -2.356840752 3.824256974 0.108896216 1.431417998
126 127 128 129 130
-1.191403491 1.307837569 2.724750498 -0.247510390 1.025449459
131 132 133 134 135
1.982717902 -4.646598941 1.859618452 -2.900511056 -6.120393259
136 137 138 139 140
2.037384029 -1.233328305 0.568002877 -0.243905705 0.988520490
141 142 143 144 145
-0.490898346 4.025271390 -1.568446310 1.014686756 1.395810469
146 147 148 149 150
3.942144901 -1.730530294 -1.033215098 -10.551454280 -3.259350493
151 152 153 154 155
3.494253288 0.730013522 -0.396054705 -4.308518667 1.826242817
156 157 158 159
-2.350621551 0.830654244 0.245009514 -7.050029059
> postscript(file="/var/www/html/rcomp/tmp/6s2v31290523939.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 2.655396715 NA
1 2.530315038 2.655396715
2 7.234667042 2.530315038
3 -1.069064789 7.234667042
4 0.395053338 -1.069064789
5 1.589666866 0.395053338
6 3.012761388 1.589666866
7 3.454348308 3.012761388
8 -2.143952242 3.454348308
9 0.407344045 -2.143952242
10 -2.773049790 0.407344045
11 -6.127420942 -2.773049790
12 -8.162314455 -6.127420942
13 -4.069064789 -8.162314455
14 3.529955283 -4.069064789
15 5.301856912 3.529955283
16 0.101417929 5.301856912
17 -6.464276120 0.101417929
18 -1.280779555 -6.464276120
19 -1.883188634 -1.280779555
20 0.618250330 -1.883188634
21 -4.456182901 0.618250330
22 -3.281465086 -4.456182901
23 -6.099776296 -3.281465086
24 -0.914208545 -6.099776296
25 1.659058258 -0.914208545
26 2.260870915 1.659058258
27 -3.509351397 2.260870915
28 0.671530651 -3.509351397
29 0.649378449 0.671530651
30 2.064271543 0.649378449
31 4.268909015 2.064271543
32 4.204224453 4.268909015
33 7.677477317 4.204224453
34 3.324043105 7.677477317
35 5.164406693 3.324043105
36 2.146313397 5.164406693
37 -0.529036777 2.146313397
38 2.035401802 -0.529036777
39 6.003119188 2.035401802
40 1.591056288 6.003119188
41 1.976915314 1.591056288
42 -7.495347382 1.976915314
43 3.096156795 -7.495347382
44 4.546032361 3.096156795
45 0.861365751 4.546032361
46 -2.548805772 0.861365751
47 7.140544801 -2.548805772
48 -0.008720915 7.140544801
49 2.624560380 -0.008720915
50 1.751132440 2.624560380
51 -0.368680855 1.751132440
52 -1.759352301 -0.368680855
53 -4.300050212 -1.759352301
54 3.998927056 -4.300050212
55 1.068633359 3.998927056
56 3.518565784 1.068633359
57 2.165275650 3.518565784
58 2.517626967 2.165275650
59 -4.088746552 2.517626967
60 3.087504763 -4.088746552
61 1.536625089 3.087504763
62 2.863980268 1.536625089
63 4.662875002 2.863980268
64 0.718315619 4.662875002
65 6.495332565 0.718315619
66 -4.240931433 6.495332565
67 5.117585856 -4.240931433
68 2.321424971 5.117585856
69 3.724750498 2.321424971
70 -5.405645554 3.724750498
71 -0.366789478 -5.405645554
72 0.935895326 -0.366789478
73 -0.982388584 0.935895326
74 0.094625173 -0.982388584
75 -2.842475173 0.094625173
76 2.750594616 -2.842475173
77 0.332187675 2.750594616
78 2.569894254 0.332187675
79 0.340748857 2.569894254
80 3.520763688 0.340748857
81 -5.210219927 3.520763688
82 -2.610264655 -5.210219927
83 2.157346758 -2.610264655
84 -2.191497958 2.157346758
85 -2.494896777 -2.191497958
86 3.746865091 -2.494896777
87 4.829571349 3.746865091
88 2.975239615 4.829571349
89 -4.493456005 2.975239615
90 -5.905340836 -4.493456005
91 -0.385515064 -5.905340836
92 -2.811134993 -0.385515064
93 -1.129800531 -2.811134993
94 -0.386740159 -1.129800531
95 5.275544830 -0.386740159
96 -2.952580026 5.275544830
97 -3.550064859 -2.952580026
98 -3.824866473 -3.550064859
99 -4.634126547 -3.824866473
100 -0.110262846 -4.634126547
101 -2.138668240 -0.110262846
102 -2.969319768 -2.138668240
103 -0.967878996 -2.969319768
104 -1.173851649 -0.967878996
105 -5.371656866 -1.173851649
106 -4.572974192 -5.371656866
107 -4.497329608 -4.572974192
108 -0.411558229 -4.497329608
109 -4.540876881 -0.411558229
110 -5.990031198 -4.540876881
111 -7.540691577 -5.990031198
112 1.960296782 -7.540691577
113 9.810491503 1.960296782
114 10.782659663 9.810491503
115 -0.416135722 10.782659663
116 1.512585128 -0.416135722
117 -0.077031289 1.512585128
118 -0.601847550 -0.077031289
119 -8.197751150 -0.601847550
120 1.705572568 -8.197751150
121 -2.356840752 1.705572568
122 3.824256974 -2.356840752
123 0.108896216 3.824256974
124 1.431417998 0.108896216
125 -1.191403491 1.431417998
126 1.307837569 -1.191403491
127 2.724750498 1.307837569
128 -0.247510390 2.724750498
129 1.025449459 -0.247510390
130 1.982717902 1.025449459
131 -4.646598941 1.982717902
132 1.859618452 -4.646598941
133 -2.900511056 1.859618452
134 -6.120393259 -2.900511056
135 2.037384029 -6.120393259
136 -1.233328305 2.037384029
137 0.568002877 -1.233328305
138 -0.243905705 0.568002877
139 0.988520490 -0.243905705
140 -0.490898346 0.988520490
141 4.025271390 -0.490898346
142 -1.568446310 4.025271390
143 1.014686756 -1.568446310
144 1.395810469 1.014686756
145 3.942144901 1.395810469
146 -1.730530294 3.942144901
147 -1.033215098 -1.730530294
148 -10.551454280 -1.033215098
149 -3.259350493 -10.551454280
150 3.494253288 -3.259350493
151 0.730013522 3.494253288
152 -0.396054705 0.730013522
153 -4.308518667 -0.396054705
154 1.826242817 -4.308518667
155 -2.350621551 1.826242817
156 0.830654244 -2.350621551
157 0.245009514 0.830654244
158 -7.050029059 0.245009514
159 NA -7.050029059
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2.530315038 2.655396715
[2,] 7.234667042 2.530315038
[3,] -1.069064789 7.234667042
[4,] 0.395053338 -1.069064789
[5,] 1.589666866 0.395053338
[6,] 3.012761388 1.589666866
[7,] 3.454348308 3.012761388
[8,] -2.143952242 3.454348308
[9,] 0.407344045 -2.143952242
[10,] -2.773049790 0.407344045
[11,] -6.127420942 -2.773049790
[12,] -8.162314455 -6.127420942
[13,] -4.069064789 -8.162314455
[14,] 3.529955283 -4.069064789
[15,] 5.301856912 3.529955283
[16,] 0.101417929 5.301856912
[17,] -6.464276120 0.101417929
[18,] -1.280779555 -6.464276120
[19,] -1.883188634 -1.280779555
[20,] 0.618250330 -1.883188634
[21,] -4.456182901 0.618250330
[22,] -3.281465086 -4.456182901
[23,] -6.099776296 -3.281465086
[24,] -0.914208545 -6.099776296
[25,] 1.659058258 -0.914208545
[26,] 2.260870915 1.659058258
[27,] -3.509351397 2.260870915
[28,] 0.671530651 -3.509351397
[29,] 0.649378449 0.671530651
[30,] 2.064271543 0.649378449
[31,] 4.268909015 2.064271543
[32,] 4.204224453 4.268909015
[33,] 7.677477317 4.204224453
[34,] 3.324043105 7.677477317
[35,] 5.164406693 3.324043105
[36,] 2.146313397 5.164406693
[37,] -0.529036777 2.146313397
[38,] 2.035401802 -0.529036777
[39,] 6.003119188 2.035401802
[40,] 1.591056288 6.003119188
[41,] 1.976915314 1.591056288
[42,] -7.495347382 1.976915314
[43,] 3.096156795 -7.495347382
[44,] 4.546032361 3.096156795
[45,] 0.861365751 4.546032361
[46,] -2.548805772 0.861365751
[47,] 7.140544801 -2.548805772
[48,] -0.008720915 7.140544801
[49,] 2.624560380 -0.008720915
[50,] 1.751132440 2.624560380
[51,] -0.368680855 1.751132440
[52,] -1.759352301 -0.368680855
[53,] -4.300050212 -1.759352301
[54,] 3.998927056 -4.300050212
[55,] 1.068633359 3.998927056
[56,] 3.518565784 1.068633359
[57,] 2.165275650 3.518565784
[58,] 2.517626967 2.165275650
[59,] -4.088746552 2.517626967
[60,] 3.087504763 -4.088746552
[61,] 1.536625089 3.087504763
[62,] 2.863980268 1.536625089
[63,] 4.662875002 2.863980268
[64,] 0.718315619 4.662875002
[65,] 6.495332565 0.718315619
[66,] -4.240931433 6.495332565
[67,] 5.117585856 -4.240931433
[68,] 2.321424971 5.117585856
[69,] 3.724750498 2.321424971
[70,] -5.405645554 3.724750498
[71,] -0.366789478 -5.405645554
[72,] 0.935895326 -0.366789478
[73,] -0.982388584 0.935895326
[74,] 0.094625173 -0.982388584
[75,] -2.842475173 0.094625173
[76,] 2.750594616 -2.842475173
[77,] 0.332187675 2.750594616
[78,] 2.569894254 0.332187675
[79,] 0.340748857 2.569894254
[80,] 3.520763688 0.340748857
[81,] -5.210219927 3.520763688
[82,] -2.610264655 -5.210219927
[83,] 2.157346758 -2.610264655
[84,] -2.191497958 2.157346758
[85,] -2.494896777 -2.191497958
[86,] 3.746865091 -2.494896777
[87,] 4.829571349 3.746865091
[88,] 2.975239615 4.829571349
[89,] -4.493456005 2.975239615
[90,] -5.905340836 -4.493456005
[91,] -0.385515064 -5.905340836
[92,] -2.811134993 -0.385515064
[93,] -1.129800531 -2.811134993
[94,] -0.386740159 -1.129800531
[95,] 5.275544830 -0.386740159
[96,] -2.952580026 5.275544830
[97,] -3.550064859 -2.952580026
[98,] -3.824866473 -3.550064859
[99,] -4.634126547 -3.824866473
[100,] -0.110262846 -4.634126547
[101,] -2.138668240 -0.110262846
[102,] -2.969319768 -2.138668240
[103,] -0.967878996 -2.969319768
[104,] -1.173851649 -0.967878996
[105,] -5.371656866 -1.173851649
[106,] -4.572974192 -5.371656866
[107,] -4.497329608 -4.572974192
[108,] -0.411558229 -4.497329608
[109,] -4.540876881 -0.411558229
[110,] -5.990031198 -4.540876881
[111,] -7.540691577 -5.990031198
[112,] 1.960296782 -7.540691577
[113,] 9.810491503 1.960296782
[114,] 10.782659663 9.810491503
[115,] -0.416135722 10.782659663
[116,] 1.512585128 -0.416135722
[117,] -0.077031289 1.512585128
[118,] -0.601847550 -0.077031289
[119,] -8.197751150 -0.601847550
[120,] 1.705572568 -8.197751150
[121,] -2.356840752 1.705572568
[122,] 3.824256974 -2.356840752
[123,] 0.108896216 3.824256974
[124,] 1.431417998 0.108896216
[125,] -1.191403491 1.431417998
[126,] 1.307837569 -1.191403491
[127,] 2.724750498 1.307837569
[128,] -0.247510390 2.724750498
[129,] 1.025449459 -0.247510390
[130,] 1.982717902 1.025449459
[131,] -4.646598941 1.982717902
[132,] 1.859618452 -4.646598941
[133,] -2.900511056 1.859618452
[134,] -6.120393259 -2.900511056
[135,] 2.037384029 -6.120393259
[136,] -1.233328305 2.037384029
[137,] 0.568002877 -1.233328305
[138,] -0.243905705 0.568002877
[139,] 0.988520490 -0.243905705
[140,] -0.490898346 0.988520490
[141,] 4.025271390 -0.490898346
[142,] -1.568446310 4.025271390
[143,] 1.014686756 -1.568446310
[144,] 1.395810469 1.014686756
[145,] 3.942144901 1.395810469
[146,] -1.730530294 3.942144901
[147,] -1.033215098 -1.730530294
[148,] -10.551454280 -1.033215098
[149,] -3.259350493 -10.551454280
[150,] 3.494253288 -3.259350493
[151,] 0.730013522 3.494253288
[152,] -0.396054705 0.730013522
[153,] -4.308518667 -0.396054705
[154,] 1.826242817 -4.308518667
[155,] -2.350621551 1.826242817
[156,] 0.830654244 -2.350621551
[157,] 0.245009514 0.830654244
[158,] -7.050029059 0.245009514
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2.530315038 2.655396715
2 7.234667042 2.530315038
3 -1.069064789 7.234667042
4 0.395053338 -1.069064789
5 1.589666866 0.395053338
6 3.012761388 1.589666866
7 3.454348308 3.012761388
8 -2.143952242 3.454348308
9 0.407344045 -2.143952242
10 -2.773049790 0.407344045
11 -6.127420942 -2.773049790
12 -8.162314455 -6.127420942
13 -4.069064789 -8.162314455
14 3.529955283 -4.069064789
15 5.301856912 3.529955283
16 0.101417929 5.301856912
17 -6.464276120 0.101417929
18 -1.280779555 -6.464276120
19 -1.883188634 -1.280779555
20 0.618250330 -1.883188634
21 -4.456182901 0.618250330
22 -3.281465086 -4.456182901
23 -6.099776296 -3.281465086
24 -0.914208545 -6.099776296
25 1.659058258 -0.914208545
26 2.260870915 1.659058258
27 -3.509351397 2.260870915
28 0.671530651 -3.509351397
29 0.649378449 0.671530651
30 2.064271543 0.649378449
31 4.268909015 2.064271543
32 4.204224453 4.268909015
33 7.677477317 4.204224453
34 3.324043105 7.677477317
35 5.164406693 3.324043105
36 2.146313397 5.164406693
37 -0.529036777 2.146313397
38 2.035401802 -0.529036777
39 6.003119188 2.035401802
40 1.591056288 6.003119188
41 1.976915314 1.591056288
42 -7.495347382 1.976915314
43 3.096156795 -7.495347382
44 4.546032361 3.096156795
45 0.861365751 4.546032361
46 -2.548805772 0.861365751
47 7.140544801 -2.548805772
48 -0.008720915 7.140544801
49 2.624560380 -0.008720915
50 1.751132440 2.624560380
51 -0.368680855 1.751132440
52 -1.759352301 -0.368680855
53 -4.300050212 -1.759352301
54 3.998927056 -4.300050212
55 1.068633359 3.998927056
56 3.518565784 1.068633359
57 2.165275650 3.518565784
58 2.517626967 2.165275650
59 -4.088746552 2.517626967
60 3.087504763 -4.088746552
61 1.536625089 3.087504763
62 2.863980268 1.536625089
63 4.662875002 2.863980268
64 0.718315619 4.662875002
65 6.495332565 0.718315619
66 -4.240931433 6.495332565
67 5.117585856 -4.240931433
68 2.321424971 5.117585856
69 3.724750498 2.321424971
70 -5.405645554 3.724750498
71 -0.366789478 -5.405645554
72 0.935895326 -0.366789478
73 -0.982388584 0.935895326
74 0.094625173 -0.982388584
75 -2.842475173 0.094625173
76 2.750594616 -2.842475173
77 0.332187675 2.750594616
78 2.569894254 0.332187675
79 0.340748857 2.569894254
80 3.520763688 0.340748857
81 -5.210219927 3.520763688
82 -2.610264655 -5.210219927
83 2.157346758 -2.610264655
84 -2.191497958 2.157346758
85 -2.494896777 -2.191497958
86 3.746865091 -2.494896777
87 4.829571349 3.746865091
88 2.975239615 4.829571349
89 -4.493456005 2.975239615
90 -5.905340836 -4.493456005
91 -0.385515064 -5.905340836
92 -2.811134993 -0.385515064
93 -1.129800531 -2.811134993
94 -0.386740159 -1.129800531
95 5.275544830 -0.386740159
96 -2.952580026 5.275544830
97 -3.550064859 -2.952580026
98 -3.824866473 -3.550064859
99 -4.634126547 -3.824866473
100 -0.110262846 -4.634126547
101 -2.138668240 -0.110262846
102 -2.969319768 -2.138668240
103 -0.967878996 -2.969319768
104 -1.173851649 -0.967878996
105 -5.371656866 -1.173851649
106 -4.572974192 -5.371656866
107 -4.497329608 -4.572974192
108 -0.411558229 -4.497329608
109 -4.540876881 -0.411558229
110 -5.990031198 -4.540876881
111 -7.540691577 -5.990031198
112 1.960296782 -7.540691577
113 9.810491503 1.960296782
114 10.782659663 9.810491503
115 -0.416135722 10.782659663
116 1.512585128 -0.416135722
117 -0.077031289 1.512585128
118 -0.601847550 -0.077031289
119 -8.197751150 -0.601847550
120 1.705572568 -8.197751150
121 -2.356840752 1.705572568
122 3.824256974 -2.356840752
123 0.108896216 3.824256974
124 1.431417998 0.108896216
125 -1.191403491 1.431417998
126 1.307837569 -1.191403491
127 2.724750498 1.307837569
128 -0.247510390 2.724750498
129 1.025449459 -0.247510390
130 1.982717902 1.025449459
131 -4.646598941 1.982717902
132 1.859618452 -4.646598941
133 -2.900511056 1.859618452
134 -6.120393259 -2.900511056
135 2.037384029 -6.120393259
136 -1.233328305 2.037384029
137 0.568002877 -1.233328305
138 -0.243905705 0.568002877
139 0.988520490 -0.243905705
140 -0.490898346 0.988520490
141 4.025271390 -0.490898346
142 -1.568446310 4.025271390
143 1.014686756 -1.568446310
144 1.395810469 1.014686756
145 3.942144901 1.395810469
146 -1.730530294 3.942144901
147 -1.033215098 -1.730530294
148 -10.551454280 -1.033215098
149 -3.259350493 -10.551454280
150 3.494253288 -3.259350493
151 0.730013522 3.494253288
152 -0.396054705 0.730013522
153 -4.308518667 -0.396054705
154 1.826242817 -4.308518667
155 -2.350621551 1.826242817
156 0.830654244 -2.350621551
157 0.245009514 0.830654244
158 -7.050029059 0.245009514
> 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/73bdo1290523939.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/83bdo1290523939.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/93bdo1290523939.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/10elc91290523939.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/11zlse1290523939.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/12kl9k1290523939.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/13zv7t1290523939.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/1495oe1290523939.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/155e4n1290523939.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/169xkb1290523939.tab")
+ }
>
> try(system("convert tmp/1pkxf1290523939.ps tmp/1pkxf1290523939.png",intern=TRUE))
character(0)
> try(system("convert tmp/2pkxf1290523939.ps tmp/2pkxf1290523939.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ibw01290523939.ps tmp/3ibw01290523939.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ibw01290523939.ps tmp/4ibw01290523939.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ibw01290523939.ps tmp/5ibw01290523939.png",intern=TRUE))
character(0)
> try(system("convert tmp/6s2v31290523939.ps tmp/6s2v31290523939.png",intern=TRUE))
character(0)
> try(system("convert tmp/73bdo1290523939.ps tmp/73bdo1290523939.png",intern=TRUE))
character(0)
> try(system("convert tmp/83bdo1290523939.ps tmp/83bdo1290523939.png",intern=TRUE))
character(0)
> try(system("convert tmp/93bdo1290523939.ps tmp/93bdo1290523939.png",intern=TRUE))
character(0)
> try(system("convert tmp/10elc91290523939.ps tmp/10elc91290523939.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.022 1.738 10.449