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(0
+ ,1
+ ,24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,1
+ ,1
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,1
+ ,0
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,0
+ ,1
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,1
+ ,0
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,1
+ ,1
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,1
+ ,1
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,1
+ ,1
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,1
+ ,1
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,0
+ ,1
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,1
+ ,1
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,1
+ ,1
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,0
+ ,1
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,0
+ ,1
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,1
+ ,1
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,0
+ ,1
+ ,20
+ ,8
+ ,17
+ ,7
+ ,22
+ ,24
+ ,1
+ ,1
+ ,27
+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S','O
'),1:120))
> 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 = '5'
> #'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
PE G B CM D PC PS O\r
1 11 0 1 24 14 12 24 26
2 7 1 1 25 11 8 25 23
3 17 1 0 17 6 8 30 25
4 10 0 1 18 12 8 19 23
5 12 1 0 16 10 7 22 29
6 11 1 1 20 10 4 25 25
7 11 1 1 16 11 11 23 21
8 12 1 1 18 16 7 17 22
9 13 1 1 17 11 7 21 25
10 14 0 1 23 13 12 19 24
11 16 1 1 30 12 10 19 18
12 10 1 1 18 12 8 16 15
13 11 0 1 15 11 8 23 22
14 15 0 1 12 4 4 27 28
15 9 1 1 21 9 9 22 20
16 17 0 1 20 8 7 22 24
17 11 1 1 27 15 9 23 21
18 18 0 1 34 16 11 21 20
19 14 1 1 21 9 13 19 21
20 10 0 1 31 14 8 18 23
21 11 0 1 19 11 8 20 28
22 15 1 1 16 8 9 23 24
23 15 1 1 20 9 6 25 24
24 13 0 1 21 9 9 19 24
25 16 0 1 22 9 9 24 23
26 13 1 1 17 9 6 22 23
27 9 0 1 24 10 6 25 29
28 18 1 1 25 16 16 26 24
29 18 1 1 26 11 5 29 18
30 12 1 1 25 8 7 32 25
31 17 1 1 17 9 9 25 21
32 9 0 1 32 16 6 29 26
33 9 0 1 33 11 6 28 22
34 18 0 0 32 12 12 28 22
35 12 0 1 25 12 7 29 23
36 18 0 1 29 14 10 26 30
37 14 1 1 22 9 9 25 23
38 15 0 1 18 10 8 14 17
39 16 1 1 17 9 5 25 23
40 10 0 1 20 10 8 26 23
41 11 0 1 15 12 8 20 25
42 14 1 1 20 14 10 18 24
43 9 0 1 33 14 6 32 24
44 17 1 1 23 14 7 25 21
45 5 0 1 26 16 4 23 24
46 12 0 1 18 9 8 21 24
47 12 1 1 20 10 8 20 28
48 6 1 1 11 6 4 15 16
49 24 0 1 28 8 20 30 20
50 12 1 1 26 13 8 24 29
51 12 1 1 22 10 8 26 27
52 14 0 1 17 8 6 24 22
53 7 0 1 12 7 4 22 28
54 12 0 1 17 9 9 24 25
55 14 1 0 19 12 7 24 28
56 8 0 1 18 13 9 24 24
57 11 0 1 10 10 5 19 23
58 9 0 1 29 11 5 31 30
59 11 0 1 31 8 8 22 24
60 10 0 1 9 13 6 19 25
61 11 1 0 20 11 8 25 25
62 12 1 1 28 8 7 20 22
63 9 1 1 19 9 7 21 23
64 18 1 1 29 15 11 23 23
65 15 1 1 26 9 6 25 25
66 12 1 1 23 10 8 20 21
67 13 0 1 13 14 6 21 25
68 14 1 1 21 12 9 22 24
69 10 0 1 19 12 8 23 29
70 13 1 1 28 11 6 25 22
71 13 1 1 23 14 10 25 27
72 11 1 0 18 6 8 17 26
73 13 0 1 21 12 8 19 22
74 16 1 1 20 8 10 25 24
75 11 1 1 21 10 5 26 24
76 16 1 1 28 12 14 27 22
77 14 0 1 26 14 8 17 24
78 8 1 1 10 5 6 19 24
79 9 0 0 16 11 5 17 23
80 15 0 1 22 10 6 22 20
81 11 0 1 19 9 10 21 27
82 21 1 1 31 10 12 32 26
83 14 0 1 31 16 9 21 25
84 18 1 1 29 13 12 21 21
85 12 0 1 19 9 7 18 21
86 13 1 1 22 10 8 18 19
87 12 0 1 15 7 6 19 21
88 19 1 1 20 9 10 20 16
89 11 0 1 23 14 10 20 29
90 13 1 1 24 9 10 19 15
91 15 1 1 25 14 11 22 21
92 12 1 1 13 8 7 14 19
93 16 1 1 28 8 12 18 24
94 18 1 0 25 7 11 35 17
95 8 1 1 9 6 11 29 23
96 9 0 1 17 11 6 20 19
97 15 0 1 25 14 9 22 24
98 6 1 1 15 8 6 20 25
99 8 0 1 19 20 7 19 25
100 10 1 0 15 8 4 22 24
101 11 1 1 20 11 8 24 26
102 14 1 1 18 10 9 21 26
103 11 1 1 33 14 8 26 25
104 12 1 1 16 9 8 16 21
105 11 0 1 17 9 5 23 26
106 9 1 1 16 8 4 18 23
107 12 0 1 21 10 8 16 23
108 20 0 1 26 13 10 26 22
109 13 1 1 18 12 9 21 13
110 12 1 1 22 13 13 22 15
111 9 1 1 30 14 9 23 14
112 24 1 1 24 14 20 21 10
113 11 1 1 29 16 6 27 24
114 17 1 1 31 9 9 25 19
115 11 1 0 20 9 7 21 20
116 11 1 1 20 7 9 26 22
117 16 1 1 28 16 8 24 24
118 13 1 1 17 9 6 19 21
119 11 0 1 28 14 8 24 24
120 19 1 1 31 16 16 17 20
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) G B CM D PC
7.09326 0.18510 -0.54385 0.09739 -0.16026 0.67955
PS `O\r`
0.10435 -0.09801
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.89625 -1.79516 0.07974 1.83856 5.83669
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.09326 2.64507 2.682 0.00843 **
G 0.18510 0.54186 0.342 0.73329
B -0.54385 0.93406 -0.582 0.56158
CM 0.09739 0.05724 1.701 0.09164 .
D -0.16026 0.10618 -1.509 0.13403
PC 0.67955 0.09979 6.810 5.11e-10 ***
PS 0.10435 0.07262 1.437 0.15352
`O\r` -0.09801 0.07963 -1.231 0.22096
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.731 on 112 degrees of freedom
Multiple R-squared: 0.4361, Adjusted R-squared: 0.4009
F-statistic: 12.38 on 7 and 112 DF, p-value: 1.181e-11
> 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.87158898 0.25682204 0.12841102
[2,] 0.86557591 0.26884819 0.13442409
[3,] 0.78654779 0.42690443 0.21345221
[4,] 0.74953343 0.50093313 0.25046657
[5,] 0.80953667 0.38092666 0.19046333
[6,] 0.81580211 0.36839578 0.18419789
[7,] 0.76384046 0.47231908 0.23615954
[8,] 0.77866823 0.44266354 0.22133177
[9,] 0.73211674 0.53576652 0.26788326
[10,] 0.84357415 0.31285171 0.15642585
[11,] 0.79856856 0.40286288 0.20143144
[12,] 0.79840833 0.40318334 0.20159167
[13,] 0.80552503 0.38894994 0.19447497
[14,] 0.75494622 0.49010756 0.24505378
[15,] 0.71981651 0.56036699 0.28018349
[16,] 0.66942477 0.66115046 0.33057523
[17,] 0.70670593 0.58658814 0.29329407
[18,] 0.76544356 0.46911288 0.23455644
[19,] 0.83631592 0.32736816 0.16368408
[20,] 0.83302332 0.33395336 0.16697668
[21,] 0.84220189 0.31559621 0.15779811
[22,] 0.84278237 0.31443525 0.15721763
[23,] 0.88282707 0.23434587 0.11717293
[24,] 0.85052854 0.29894292 0.14947146
[25,] 0.81535464 0.36929072 0.18464536
[26,] 0.89915250 0.20169500 0.10084750
[27,] 0.86965053 0.26069895 0.13034947
[28,] 0.86311139 0.27377722 0.13688861
[29,] 0.91882401 0.16235199 0.08117599
[30,] 0.92507575 0.14984850 0.07492425
[31,] 0.90292942 0.19414116 0.09707058
[32,] 0.88316386 0.23367228 0.11683614
[33,] 0.89182387 0.21635226 0.10817613
[34,] 0.94108172 0.11783655 0.05891828
[35,] 0.96361309 0.07277381 0.03638691
[36,] 0.95123886 0.09752227 0.04876114
[37,] 0.93576896 0.12846208 0.06423104
[38,] 0.95765920 0.08468160 0.04234080
[39,] 0.94690890 0.10618220 0.05309110
[40,] 0.92988894 0.14022211 0.07011106
[41,] 0.91165799 0.17668402 0.08834201
[42,] 0.90930347 0.18139306 0.09069653
[43,] 0.90015487 0.19969025 0.09984513
[44,] 0.87726152 0.24547697 0.12273848
[45,] 0.86959709 0.26080582 0.13040291
[46,] 0.91027235 0.17945531 0.08972765
[47,] 0.90024940 0.19950120 0.09975060
[48,] 0.89389264 0.21221472 0.10610736
[49,] 0.90721138 0.18557724 0.09278862
[50,] 0.89022027 0.21955945 0.10977973
[51,] 0.88229730 0.23540540 0.11770270
[52,] 0.86030476 0.27939049 0.13969524
[53,] 0.86048498 0.27903005 0.13951502
[54,] 0.87563426 0.24873148 0.12436574
[55,] 0.87785247 0.24429507 0.12214753
[56,] 0.85013307 0.29973385 0.14986693
[57,] 0.89302995 0.21394011 0.10697005
[58,] 0.87532719 0.24934562 0.12467281
[59,] 0.85051293 0.29897415 0.14948707
[60,] 0.81649472 0.36701056 0.18350528
[61,] 0.77791616 0.44416767 0.22208384
[62,] 0.74850756 0.50298488 0.25149244
[63,] 0.70660550 0.58678900 0.29339450
[64,] 0.68421271 0.63157459 0.31578729
[65,] 0.63792378 0.72415244 0.36207622
[66,] 0.60461135 0.79077729 0.39538865
[67,] 0.57982861 0.84034278 0.42017139
[68,] 0.55463929 0.89072143 0.44536071
[69,] 0.50076637 0.99846726 0.49923363
[70,] 0.51943568 0.96112863 0.48056432
[71,] 0.51298982 0.97402035 0.48701018
[72,] 0.58193281 0.83613438 0.41806719
[73,] 0.53090486 0.93819028 0.46909514
[74,] 0.49996180 0.99992360 0.50003820
[75,] 0.43886601 0.87773201 0.56113399
[76,] 0.37725867 0.75451735 0.62274133
[77,] 0.32399864 0.64799727 0.67600136
[78,] 0.45166062 0.90332124 0.54833938
[79,] 0.44741548 0.89483095 0.55258452
[80,] 0.40812444 0.81624889 0.59187556
[81,] 0.34693878 0.69387755 0.65306122
[82,] 0.31555867 0.63111733 0.68444133
[83,] 0.26997925 0.53995850 0.73002075
[84,] 0.23004036 0.46008072 0.76995964
[85,] 0.39142915 0.78285829 0.60857085
[86,] 0.33646690 0.67293380 0.66353310
[87,] 0.28181520 0.56363040 0.71818480
[88,] 0.37612236 0.75224473 0.62387764
[89,] 0.34991531 0.69983061 0.65008469
[90,] 0.28122764 0.56245528 0.71877236
[91,] 0.24425055 0.48850111 0.75574945
[92,] 0.18150041 0.36300081 0.81849959
[93,] 0.16389078 0.32778157 0.83610922
[94,] 0.11050849 0.22101698 0.88949151
[95,] 0.07084516 0.14169032 0.92915484
[96,] 0.04145680 0.08291361 0.95854320
[97,] 0.02475606 0.04951211 0.97524394
[98,] 0.06863303 0.13726605 0.93136697
[99,] 0.04170105 0.08340209 0.95829895
> postscript(file="/var/www/html/rcomp/tmp/1w9ce1291985984.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2pibz1291985984.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3pibz1291985984.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/4pibz1291985984.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/5iabk1291985984.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 120
Frequency = 1
1 2 3 4 5 6
-3.75363973 -6.19711151 2.91112678 -1.54394310 0.55594696 1.04378816
7 8 9 10 11 12
-3.34659421 1.70223326 1.87496026 -0.49080249 1.25313110 -2.20011044
13 14 15 16 17 18
-0.92744444 5.13176868 -4.78862883 5.08475056 -2.41771922 2.99751290
19 20 21 22 23 24
-2.09576633 -2.38511832 -0.41587404 1.82575631 3.42641563 0.10157048
25 26 27 28 29 30
2.38443073 1.93360980 -2.12770527 0.16147784 5.83668798 -1.53275615
31 32 33 34 35 36
3.38589477 -2.65666871 -3.84307415 0.79344023 -0.58958855 4.30187439
37 38 39 40 41 42
0.09498037 3.06918996 5.30011540 -2.78967733 -0.16009910 1.23996623
43 44 45 46 47 48
-3.58365109 4.96197323 -4.28318349 -0.13541155 0.14137274 -3.55941116
49 50 51 52 53 54
1.24468016 -0.28154714 -0.77750287 2.65174168 -1.86570660 -0.93260115
55 56 57 58 59 60
2.27759799 -4.48695396 1.95328381 -2.30290811 -2.66606865 1.04793713
61 62 63 64 65 66
-2.05798882 -0.86678983 -2.83636754 3.22443425 2.94009955 -0.83688601
67 68 69 70 71 72
3.60995111 1.08421154 -1.47064123 0.77180720 -0.48859153 -1.73172907
73 74 75 76 77 78
1.06587872 1.54795964 0.06449043 -1.71301336 2.30418398 -2.61466505
79 80 81 82 83 84
-0.80593368 3.49799322 -2.29785640 3.90370998 1.13884169 2.23702974
85 86 87 88 89 90
0.46575120 0.27317061 1.10998060 4.44585250 -1.58572385 -1.93736632
91 92 93 94 95 96
0.36204580 0.92607933 0.14019003 -0.05220784 -6.89624636 -1.74412150
97 98 99 100 101 102
2.20028572 -4.62715384 -1.48365831 -0.11861103 -1.31178235 1.35622633
103 104 105 106 107 108
-2.40375163 0.10195998 0.98795366 -0.35277683 0.15641055 5.64966950
109 110 111 112 113 114
-0.59742380 -4.45322912 -5.55624018 2.36969796 -0.53693834 1.82643239
115 116 117 118 119 120
-1.77164150 -3.23312861 3.51439586 2.05062578 -1.62102582 1.12422314
> postscript(file="/var/www/html/rcomp/tmp/6iabk1291985984.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 120
Frequency = 1
lag(myerror, k = 1) myerror
0 -3.75363973 NA
1 -6.19711151 -3.75363973
2 2.91112678 -6.19711151
3 -1.54394310 2.91112678
4 0.55594696 -1.54394310
5 1.04378816 0.55594696
6 -3.34659421 1.04378816
7 1.70223326 -3.34659421
8 1.87496026 1.70223326
9 -0.49080249 1.87496026
10 1.25313110 -0.49080249
11 -2.20011044 1.25313110
12 -0.92744444 -2.20011044
13 5.13176868 -0.92744444
14 -4.78862883 5.13176868
15 5.08475056 -4.78862883
16 -2.41771922 5.08475056
17 2.99751290 -2.41771922
18 -2.09576633 2.99751290
19 -2.38511832 -2.09576633
20 -0.41587404 -2.38511832
21 1.82575631 -0.41587404
22 3.42641563 1.82575631
23 0.10157048 3.42641563
24 2.38443073 0.10157048
25 1.93360980 2.38443073
26 -2.12770527 1.93360980
27 0.16147784 -2.12770527
28 5.83668798 0.16147784
29 -1.53275615 5.83668798
30 3.38589477 -1.53275615
31 -2.65666871 3.38589477
32 -3.84307415 -2.65666871
33 0.79344023 -3.84307415
34 -0.58958855 0.79344023
35 4.30187439 -0.58958855
36 0.09498037 4.30187439
37 3.06918996 0.09498037
38 5.30011540 3.06918996
39 -2.78967733 5.30011540
40 -0.16009910 -2.78967733
41 1.23996623 -0.16009910
42 -3.58365109 1.23996623
43 4.96197323 -3.58365109
44 -4.28318349 4.96197323
45 -0.13541155 -4.28318349
46 0.14137274 -0.13541155
47 -3.55941116 0.14137274
48 1.24468016 -3.55941116
49 -0.28154714 1.24468016
50 -0.77750287 -0.28154714
51 2.65174168 -0.77750287
52 -1.86570660 2.65174168
53 -0.93260115 -1.86570660
54 2.27759799 -0.93260115
55 -4.48695396 2.27759799
56 1.95328381 -4.48695396
57 -2.30290811 1.95328381
58 -2.66606865 -2.30290811
59 1.04793713 -2.66606865
60 -2.05798882 1.04793713
61 -0.86678983 -2.05798882
62 -2.83636754 -0.86678983
63 3.22443425 -2.83636754
64 2.94009955 3.22443425
65 -0.83688601 2.94009955
66 3.60995111 -0.83688601
67 1.08421154 3.60995111
68 -1.47064123 1.08421154
69 0.77180720 -1.47064123
70 -0.48859153 0.77180720
71 -1.73172907 -0.48859153
72 1.06587872 -1.73172907
73 1.54795964 1.06587872
74 0.06449043 1.54795964
75 -1.71301336 0.06449043
76 2.30418398 -1.71301336
77 -2.61466505 2.30418398
78 -0.80593368 -2.61466505
79 3.49799322 -0.80593368
80 -2.29785640 3.49799322
81 3.90370998 -2.29785640
82 1.13884169 3.90370998
83 2.23702974 1.13884169
84 0.46575120 2.23702974
85 0.27317061 0.46575120
86 1.10998060 0.27317061
87 4.44585250 1.10998060
88 -1.58572385 4.44585250
89 -1.93736632 -1.58572385
90 0.36204580 -1.93736632
91 0.92607933 0.36204580
92 0.14019003 0.92607933
93 -0.05220784 0.14019003
94 -6.89624636 -0.05220784
95 -1.74412150 -6.89624636
96 2.20028572 -1.74412150
97 -4.62715384 2.20028572
98 -1.48365831 -4.62715384
99 -0.11861103 -1.48365831
100 -1.31178235 -0.11861103
101 1.35622633 -1.31178235
102 -2.40375163 1.35622633
103 0.10195998 -2.40375163
104 0.98795366 0.10195998
105 -0.35277683 0.98795366
106 0.15641055 -0.35277683
107 5.64966950 0.15641055
108 -0.59742380 5.64966950
109 -4.45322912 -0.59742380
110 -5.55624018 -4.45322912
111 2.36969796 -5.55624018
112 -0.53693834 2.36969796
113 1.82643239 -0.53693834
114 -1.77164150 1.82643239
115 -3.23312861 -1.77164150
116 3.51439586 -3.23312861
117 2.05062578 3.51439586
118 -1.62102582 2.05062578
119 1.12422314 -1.62102582
120 NA 1.12422314
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -6.19711151 -3.75363973
[2,] 2.91112678 -6.19711151
[3,] -1.54394310 2.91112678
[4,] 0.55594696 -1.54394310
[5,] 1.04378816 0.55594696
[6,] -3.34659421 1.04378816
[7,] 1.70223326 -3.34659421
[8,] 1.87496026 1.70223326
[9,] -0.49080249 1.87496026
[10,] 1.25313110 -0.49080249
[11,] -2.20011044 1.25313110
[12,] -0.92744444 -2.20011044
[13,] 5.13176868 -0.92744444
[14,] -4.78862883 5.13176868
[15,] 5.08475056 -4.78862883
[16,] -2.41771922 5.08475056
[17,] 2.99751290 -2.41771922
[18,] -2.09576633 2.99751290
[19,] -2.38511832 -2.09576633
[20,] -0.41587404 -2.38511832
[21,] 1.82575631 -0.41587404
[22,] 3.42641563 1.82575631
[23,] 0.10157048 3.42641563
[24,] 2.38443073 0.10157048
[25,] 1.93360980 2.38443073
[26,] -2.12770527 1.93360980
[27,] 0.16147784 -2.12770527
[28,] 5.83668798 0.16147784
[29,] -1.53275615 5.83668798
[30,] 3.38589477 -1.53275615
[31,] -2.65666871 3.38589477
[32,] -3.84307415 -2.65666871
[33,] 0.79344023 -3.84307415
[34,] -0.58958855 0.79344023
[35,] 4.30187439 -0.58958855
[36,] 0.09498037 4.30187439
[37,] 3.06918996 0.09498037
[38,] 5.30011540 3.06918996
[39,] -2.78967733 5.30011540
[40,] -0.16009910 -2.78967733
[41,] 1.23996623 -0.16009910
[42,] -3.58365109 1.23996623
[43,] 4.96197323 -3.58365109
[44,] -4.28318349 4.96197323
[45,] -0.13541155 -4.28318349
[46,] 0.14137274 -0.13541155
[47,] -3.55941116 0.14137274
[48,] 1.24468016 -3.55941116
[49,] -0.28154714 1.24468016
[50,] -0.77750287 -0.28154714
[51,] 2.65174168 -0.77750287
[52,] -1.86570660 2.65174168
[53,] -0.93260115 -1.86570660
[54,] 2.27759799 -0.93260115
[55,] -4.48695396 2.27759799
[56,] 1.95328381 -4.48695396
[57,] -2.30290811 1.95328381
[58,] -2.66606865 -2.30290811
[59,] 1.04793713 -2.66606865
[60,] -2.05798882 1.04793713
[61,] -0.86678983 -2.05798882
[62,] -2.83636754 -0.86678983
[63,] 3.22443425 -2.83636754
[64,] 2.94009955 3.22443425
[65,] -0.83688601 2.94009955
[66,] 3.60995111 -0.83688601
[67,] 1.08421154 3.60995111
[68,] -1.47064123 1.08421154
[69,] 0.77180720 -1.47064123
[70,] -0.48859153 0.77180720
[71,] -1.73172907 -0.48859153
[72,] 1.06587872 -1.73172907
[73,] 1.54795964 1.06587872
[74,] 0.06449043 1.54795964
[75,] -1.71301336 0.06449043
[76,] 2.30418398 -1.71301336
[77,] -2.61466505 2.30418398
[78,] -0.80593368 -2.61466505
[79,] 3.49799322 -0.80593368
[80,] -2.29785640 3.49799322
[81,] 3.90370998 -2.29785640
[82,] 1.13884169 3.90370998
[83,] 2.23702974 1.13884169
[84,] 0.46575120 2.23702974
[85,] 0.27317061 0.46575120
[86,] 1.10998060 0.27317061
[87,] 4.44585250 1.10998060
[88,] -1.58572385 4.44585250
[89,] -1.93736632 -1.58572385
[90,] 0.36204580 -1.93736632
[91,] 0.92607933 0.36204580
[92,] 0.14019003 0.92607933
[93,] -0.05220784 0.14019003
[94,] -6.89624636 -0.05220784
[95,] -1.74412150 -6.89624636
[96,] 2.20028572 -1.74412150
[97,] -4.62715384 2.20028572
[98,] -1.48365831 -4.62715384
[99,] -0.11861103 -1.48365831
[100,] -1.31178235 -0.11861103
[101,] 1.35622633 -1.31178235
[102,] -2.40375163 1.35622633
[103,] 0.10195998 -2.40375163
[104,] 0.98795366 0.10195998
[105,] -0.35277683 0.98795366
[106,] 0.15641055 -0.35277683
[107,] 5.64966950 0.15641055
[108,] -0.59742380 5.64966950
[109,] -4.45322912 -0.59742380
[110,] -5.55624018 -4.45322912
[111,] 2.36969796 -5.55624018
[112,] -0.53693834 2.36969796
[113,] 1.82643239 -0.53693834
[114,] -1.77164150 1.82643239
[115,] -3.23312861 -1.77164150
[116,] 3.51439586 -3.23312861
[117,] 2.05062578 3.51439586
[118,] -1.62102582 2.05062578
[119,] 1.12422314 -1.62102582
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -6.19711151 -3.75363973
2 2.91112678 -6.19711151
3 -1.54394310 2.91112678
4 0.55594696 -1.54394310
5 1.04378816 0.55594696
6 -3.34659421 1.04378816
7 1.70223326 -3.34659421
8 1.87496026 1.70223326
9 -0.49080249 1.87496026
10 1.25313110 -0.49080249
11 -2.20011044 1.25313110
12 -0.92744444 -2.20011044
13 5.13176868 -0.92744444
14 -4.78862883 5.13176868
15 5.08475056 -4.78862883
16 -2.41771922 5.08475056
17 2.99751290 -2.41771922
18 -2.09576633 2.99751290
19 -2.38511832 -2.09576633
20 -0.41587404 -2.38511832
21 1.82575631 -0.41587404
22 3.42641563 1.82575631
23 0.10157048 3.42641563
24 2.38443073 0.10157048
25 1.93360980 2.38443073
26 -2.12770527 1.93360980
27 0.16147784 -2.12770527
28 5.83668798 0.16147784
29 -1.53275615 5.83668798
30 3.38589477 -1.53275615
31 -2.65666871 3.38589477
32 -3.84307415 -2.65666871
33 0.79344023 -3.84307415
34 -0.58958855 0.79344023
35 4.30187439 -0.58958855
36 0.09498037 4.30187439
37 3.06918996 0.09498037
38 5.30011540 3.06918996
39 -2.78967733 5.30011540
40 -0.16009910 -2.78967733
41 1.23996623 -0.16009910
42 -3.58365109 1.23996623
43 4.96197323 -3.58365109
44 -4.28318349 4.96197323
45 -0.13541155 -4.28318349
46 0.14137274 -0.13541155
47 -3.55941116 0.14137274
48 1.24468016 -3.55941116
49 -0.28154714 1.24468016
50 -0.77750287 -0.28154714
51 2.65174168 -0.77750287
52 -1.86570660 2.65174168
53 -0.93260115 -1.86570660
54 2.27759799 -0.93260115
55 -4.48695396 2.27759799
56 1.95328381 -4.48695396
57 -2.30290811 1.95328381
58 -2.66606865 -2.30290811
59 1.04793713 -2.66606865
60 -2.05798882 1.04793713
61 -0.86678983 -2.05798882
62 -2.83636754 -0.86678983
63 3.22443425 -2.83636754
64 2.94009955 3.22443425
65 -0.83688601 2.94009955
66 3.60995111 -0.83688601
67 1.08421154 3.60995111
68 -1.47064123 1.08421154
69 0.77180720 -1.47064123
70 -0.48859153 0.77180720
71 -1.73172907 -0.48859153
72 1.06587872 -1.73172907
73 1.54795964 1.06587872
74 0.06449043 1.54795964
75 -1.71301336 0.06449043
76 2.30418398 -1.71301336
77 -2.61466505 2.30418398
78 -0.80593368 -2.61466505
79 3.49799322 -0.80593368
80 -2.29785640 3.49799322
81 3.90370998 -2.29785640
82 1.13884169 3.90370998
83 2.23702974 1.13884169
84 0.46575120 2.23702974
85 0.27317061 0.46575120
86 1.10998060 0.27317061
87 4.44585250 1.10998060
88 -1.58572385 4.44585250
89 -1.93736632 -1.58572385
90 0.36204580 -1.93736632
91 0.92607933 0.36204580
92 0.14019003 0.92607933
93 -0.05220784 0.14019003
94 -6.89624636 -0.05220784
95 -1.74412150 -6.89624636
96 2.20028572 -1.74412150
97 -4.62715384 2.20028572
98 -1.48365831 -4.62715384
99 -0.11861103 -1.48365831
100 -1.31178235 -0.11861103
101 1.35622633 -1.31178235
102 -2.40375163 1.35622633
103 0.10195998 -2.40375163
104 0.98795366 0.10195998
105 -0.35277683 0.98795366
106 0.15641055 -0.35277683
107 5.64966950 0.15641055
108 -0.59742380 5.64966950
109 -4.45322912 -0.59742380
110 -5.55624018 -4.45322912
111 2.36969796 -5.55624018
112 -0.53693834 2.36969796
113 1.82643239 -0.53693834
114 -1.77164150 1.82643239
115 -3.23312861 -1.77164150
116 3.51439586 -3.23312861
117 2.05062578 3.51439586
118 -1.62102582 2.05062578
119 1.12422314 -1.62102582
> 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/7a1a51291985984.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8a1a51291985984.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9larq1291985984.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10larq1291985984.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/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/11obpv1291985984.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/12abo11291985984.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/13gc3d1291985984.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/14w79n1291985984.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/15um1m1291985984.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/169ehd1291985984.tab")
+ }
>
> try(system("convert tmp/1w9ce1291985984.ps tmp/1w9ce1291985984.png",intern=TRUE))
character(0)
> try(system("convert tmp/2pibz1291985984.ps tmp/2pibz1291985984.png",intern=TRUE))
character(0)
> try(system("convert tmp/3pibz1291985984.ps tmp/3pibz1291985984.png",intern=TRUE))
character(0)
> try(system("convert tmp/4pibz1291985984.ps tmp/4pibz1291985984.png",intern=TRUE))
character(0)
> try(system("convert tmp/5iabk1291985984.ps tmp/5iabk1291985984.png",intern=TRUE))
character(0)
> try(system("convert tmp/6iabk1291985984.ps tmp/6iabk1291985984.png",intern=TRUE))
character(0)
> try(system("convert tmp/7a1a51291985984.ps tmp/7a1a51291985984.png",intern=TRUE))
character(0)
> try(system("convert tmp/8a1a51291985984.ps tmp/8a1a51291985984.png",intern=TRUE))
character(0)
> try(system("convert tmp/9larq1291985984.ps tmp/9larq1291985984.png",intern=TRUE))
character(0)
> try(system("convert tmp/10larq1291985984.ps tmp/10larq1291985984.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.479 1.710 10.912