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(7
+ ,7
+ ,1
+ ,7
+ ,7
+ ,1
+ ,7
+ ,7
+ ,4
+ ,5
+ ,2
+ ,5
+ ,6
+ ,2
+ ,5
+ ,6
+ ,5
+ ,6
+ ,1
+ ,5
+ ,5
+ ,1
+ ,5
+ ,5
+ ,7
+ ,7
+ ,1
+ ,7
+ ,7
+ ,1
+ ,7
+ ,6
+ ,6
+ ,6
+ ,2
+ ,5
+ ,6
+ ,1
+ ,4
+ ,5
+ ,5
+ ,4
+ ,1
+ ,7
+ ,7
+ ,1
+ ,4
+ ,7
+ ,5
+ ,6
+ ,2
+ ,5
+ ,6
+ ,2
+ ,5
+ ,6
+ ,5
+ ,6
+ ,1
+ ,6
+ ,7
+ ,1
+ ,6
+ ,7
+ ,6
+ ,7
+ ,1
+ ,7
+ ,5
+ ,1
+ ,6
+ ,7
+ ,5
+ ,6
+ ,2
+ ,5
+ ,6
+ ,3
+ ,6
+ ,6
+ ,6
+ ,7
+ ,1
+ ,5
+ ,6
+ ,1
+ ,5
+ ,7
+ ,7
+ ,7
+ ,1
+ ,7
+ ,7
+ ,1
+ ,6
+ ,7
+ ,6
+ ,7
+ ,1
+ ,3
+ ,7
+ ,2
+ ,7
+ ,7
+ ,3
+ ,7
+ ,1
+ ,7
+ ,7
+ ,1
+ ,6
+ ,7
+ ,6
+ ,6
+ ,1
+ ,6
+ ,6
+ ,1
+ ,5
+ ,6
+ ,3
+ ,3
+ ,1
+ ,5
+ ,5
+ ,1
+ ,4
+ ,4
+ ,4
+ ,6
+ ,1
+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_22','Q1_2v','Q1_3v','Q1_5v','Q1_7v','Q1_8v','Q1_12v','Q1_16v','Q1_22v'),1:101))
> 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 = '8'
> #'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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8 1 4 4
9 1 6 7
10 1 5 6
11 1 6 6
12 3 4 5
13 1 6 7
14 2 5 5
15 1 5 5
16 1 7 7
17 2 7 5
18 1 6 6
19 2 4 5
20 3 6 7
21 2 4 7
22 1 6 6
23 1 6 6
24 1 6 7
25 1 5 4
26 1 5 6
27 2 6 6
28 1 6 7
29 1 6 7
30 2 6 6
31 2 5 6
32 1 6 7
33 1 3 3
34 1 7 4
35 2 5 6
36 1 6 6
37 1 7 5
38 1 6 5
39 1 4 6
40 2 7 6
41 1 5 4
42 1 5 5
43 2 5 5
44 2 4 7
45 2 5 5
46 1 6 7
47 1 4 6
48 1 6 6
49 2 6 6
50 7 2 5
51 1 5 6
52 2 5 7
53 4 4 7
54 1 6 6
55 1 6 6
56 3 6 7
57 2 7 5
58 1 5 6
59 3 5 5
60 1 7 7
61 1 6 6
62 1 5 6
63 1 4 5
64 0 0 0
65 0 0 0
66 0 0 0
67 0 0 0
68 0 0 0
69 0 0 0
70 0 0 0
71 0 0 0
72 0 0 0
73 0 0 0
74 0 0 0
75 0 0 0
76 0 0 0
77 0 0 0
78 0 0 0
79 0 0 0
80 0 0 0
81 0 0 0
82 0 0 0
83 0 0 0
84 0 0 0
85 0 0 0
86 0 0 0
87 0 0 0
88 0 0 0
89 0 0 0
90 0 0 0
91 0 0 0
92 0 0 0
93 0 0 0
94 0 0 0
95 0 0 0
96 0 0 0
97 0 0 0
98 0 0 0
99 0 0 0
100 0 0 0
101 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Q1_2 Q1_3 Q1_5 Q1_7 Q1_8
1.619688 -0.009188 0.340656 0.356235 -0.159352 0.484171
Q1_12 Q1_16 Q1_2v Q1_3v Q1_5v Q1_7v
-0.300030 0.097133 0.024840 -0.035112 0.331623 -0.128426
Q1_8v Q1_12v Q1_16v Q1_22v
0.142270 -0.045101 0.042863 -0.141231
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.5275 -0.4601 -0.0251 0.5480 2.3216
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.619688 0.877904 1.845 0.068528 .
Q1_2 -0.009188 0.104501 -0.088 0.930143
Q1_3 0.340656 0.098087 3.473 0.000812 ***
Q1_5 0.356235 0.130262 2.735 0.007596 **
Q1_7 -0.159352 0.082334 -1.935 0.056263 .
Q1_8 0.484171 0.094273 5.136 1.76e-06 ***
Q1_12 -0.300030 0.116909 -2.566 0.012030 *
Q1_16 0.097133 0.114969 0.845 0.400560
Q1_2v 0.024840 0.109294 0.227 0.820754
Q1_3v -0.035112 0.107443 -0.327 0.744629
Q1_5v 0.331623 0.228915 1.449 0.151108
Q1_7v -0.128426 0.125192 -1.026 0.307880
Q1_8v 0.142270 0.157977 0.901 0.370361
Q1_12v -0.045101 0.138402 -0.326 0.745327
Q1_16v 0.042863 0.155632 0.275 0.783665
Q1_22v -0.141231 0.147537 -0.957 0.341153
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.8709 on 85 degrees of freedom
Multiple R-squared: 0.4343, Adjusted R-squared: 0.3344
F-statistic: 4.35 on 15 and 85 DF, p-value: 5.898e-06
> 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.29880848 0.59761697 0.7011915
[2,] 0.27025464 0.54050929 0.7297454
[3,] 0.15539293 0.31078587 0.8446071
[4,] 0.34860961 0.69721922 0.6513904
[5,] 0.27536813 0.55073625 0.7246319
[6,] 0.18830682 0.37661365 0.8116932
[7,] 0.14610029 0.29220059 0.8538997
[8,] 0.09447924 0.18895848 0.9055208
[9,] 0.06297226 0.12594452 0.9370277
[10,] 0.10036811 0.20073621 0.8996319
[11,] 0.06716830 0.13433660 0.9328317
[12,] 0.06637047 0.13274094 0.9336295
[13,] 0.05093328 0.10186657 0.9490667
[14,] 0.03912358 0.07824716 0.9608764
[15,] 0.03345858 0.06691716 0.9665414
[16,] 0.04225558 0.08451116 0.9577444
[17,] 0.06110427 0.12220854 0.9388957
[18,] 0.05925873 0.11851746 0.9407413
[19,] 0.06058363 0.12116726 0.9394164
[20,] 0.05465011 0.10930022 0.9453499
[21,] 0.04562692 0.09125385 0.9543731
[22,] 0.07247856 0.14495711 0.9275214
[23,] 0.21489104 0.42978207 0.7851090
[24,] 0.19951336 0.39902673 0.8004866
[25,] 0.17429700 0.34859400 0.8257030
[26,] 0.13433529 0.26867058 0.8656647
[27,] 0.14862801 0.29725603 0.8513720
[28,] 0.11661078 0.23322155 0.8833892
[29,] 0.13173758 0.26347517 0.8682624
[30,] 0.12656446 0.25312893 0.8734355
[31,] 0.09738043 0.19476087 0.9026196
[32,] 0.08728179 0.17456359 0.9127182
[33,] 0.09464783 0.18929566 0.9053522
[34,] 0.33852422 0.67704843 0.6614758
[35,] 0.40867051 0.81734103 0.5913295
[36,] 0.38609453 0.77218905 0.6139055
[37,] 0.53712230 0.92575540 0.4628777
[38,] 0.50369588 0.99260825 0.4963041
[39,] 0.48320492 0.96640984 0.5167951
[40,] 0.41815631 0.83631262 0.5818437
[41,] 0.35174672 0.70349343 0.6482533
[42,] 0.28874965 0.57749930 0.7112504
[43,] 0.28828314 0.57656627 0.7117169
[44,] 0.23148322 0.46296644 0.7685168
[45,] 0.18007621 0.36015242 0.8199238
[46,] 0.16532268 0.33064535 0.8346773
[47,] 0.12354543 0.24709085 0.8764546
[48,] 0.09283263 0.18566526 0.9071674
[49,] 0.06556269 0.13112539 0.9344373
[50,] 0.05072638 0.10145275 0.9492736
[51,] 0.04720617 0.09441233 0.9527938
[52,] 0.04029390 0.08058780 0.9597061
[53,] 0.02924037 0.05848074 0.9707596
[54,] 0.02675457 0.05350914 0.9732454
[55,] 0.04744953 0.09489905 0.9525505
[56,] 0.03563187 0.07126375 0.9643681
[57,] 0.04112020 0.08224040 0.9588798
[58,] 0.19221188 0.38442377 0.8077881
[59,] 0.13306911 0.26613822 0.8669309
[60,] 0.15750174 0.31500349 0.8424983
[61,] 0.10064511 0.20129022 0.8993549
[62,] 0.10114480 0.20228960 0.8988552
[63,] 0.06573356 0.13146713 0.9342664
[64,] 0.03805566 0.07611131 0.9619443
> postscript(file="/var/www/html/rcomp/tmp/1dfgn1290555401.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/2dfgn1290555401.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/3dfgn1290555401.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/456fq1290555401.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/556fq1290555401.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 = 101
Frequency = 1
1 2 3 4 5 6
-0.025100771 -0.547835552 -1.067753623 -0.017975058 1.043694771 0.820619562
7 8 9 10 11 12
0.222867640 -0.030736403 -0.592857603 -0.571858632 0.792310277 1.165008610
13 14 15 16 17 18
-0.329196680 -0.176613726 0.634627127 1.225411078 -0.424722706 -0.402059988
19 20 21 22 23 24
0.418197364 -0.458235061 0.308025103 -2.527458607 0.889095384 -0.292253512
25 26 27 28 29 30
0.167558929 0.051589375 0.322028918 0.094807645 -0.033626707 -0.883890401
31 32 33 34 35 36
-0.476537781 0.639574393 -1.114806990 0.670870982 -1.012440336 -0.511164257
37 38 39 40 41 42
1.016827844 -0.007794954 -0.098213863 -0.630481307 -0.618462625 0.845542424
43 44 45 46 47 48
-0.166875942 -0.035743480 0.867597202 -0.100092260 0.255568431 -0.817030594
49 50 51 52 53 54
0.012268716 -0.267855169 0.976209260 1.816177393 -0.260040045 1.010417896
55 56 57 58 59 60
-2.039363573 -0.460138277 -0.867713067 -0.250031979 0.442784948 -0.237991289
61 62 63 64 65 66
1.443227427 0.089285712 -0.010395605 -0.049004261 0.057235435 -0.446266381
67 68 69 70 71 72
-0.196413325 0.031789981 0.778797914 0.041177679 0.588746887 0.138111542
73 74 75 76 77 78
1.045430919 0.935378287 0.895366289 2.321579343 0.166794850 -1.624055355
79 80 81 82 83 84
0.432274681 0.050166557 -0.171387433 -0.689369915 -0.092306772 -0.271292454
85 86 87 88 89 90
-0.598823044 -0.745977389 0.544964893 -1.830148364 -1.210078514 1.028715602
91 92 93 94 95 96
-0.777000259 0.548038658 0.269601137 -0.640835304 -0.289371368 1.167355945
97 98 99 100 101
-0.421180572 -1.364953734 -0.927164092 1.047810016 0.379445932
> postscript(file="/var/www/html/rcomp/tmp/656fq1290555401.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 = 101
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.025100771 NA
1 -0.547835552 -0.025100771
2 -1.067753623 -0.547835552
3 -0.017975058 -1.067753623
4 1.043694771 -0.017975058
5 0.820619562 1.043694771
6 0.222867640 0.820619562
7 -0.030736403 0.222867640
8 -0.592857603 -0.030736403
9 -0.571858632 -0.592857603
10 0.792310277 -0.571858632
11 1.165008610 0.792310277
12 -0.329196680 1.165008610
13 -0.176613726 -0.329196680
14 0.634627127 -0.176613726
15 1.225411078 0.634627127
16 -0.424722706 1.225411078
17 -0.402059988 -0.424722706
18 0.418197364 -0.402059988
19 -0.458235061 0.418197364
20 0.308025103 -0.458235061
21 -2.527458607 0.308025103
22 0.889095384 -2.527458607
23 -0.292253512 0.889095384
24 0.167558929 -0.292253512
25 0.051589375 0.167558929
26 0.322028918 0.051589375
27 0.094807645 0.322028918
28 -0.033626707 0.094807645
29 -0.883890401 -0.033626707
30 -0.476537781 -0.883890401
31 0.639574393 -0.476537781
32 -1.114806990 0.639574393
33 0.670870982 -1.114806990
34 -1.012440336 0.670870982
35 -0.511164257 -1.012440336
36 1.016827844 -0.511164257
37 -0.007794954 1.016827844
38 -0.098213863 -0.007794954
39 -0.630481307 -0.098213863
40 -0.618462625 -0.630481307
41 0.845542424 -0.618462625
42 -0.166875942 0.845542424
43 -0.035743480 -0.166875942
44 0.867597202 -0.035743480
45 -0.100092260 0.867597202
46 0.255568431 -0.100092260
47 -0.817030594 0.255568431
48 0.012268716 -0.817030594
49 -0.267855169 0.012268716
50 0.976209260 -0.267855169
51 1.816177393 0.976209260
52 -0.260040045 1.816177393
53 1.010417896 -0.260040045
54 -2.039363573 1.010417896
55 -0.460138277 -2.039363573
56 -0.867713067 -0.460138277
57 -0.250031979 -0.867713067
58 0.442784948 -0.250031979
59 -0.237991289 0.442784948
60 1.443227427 -0.237991289
61 0.089285712 1.443227427
62 -0.010395605 0.089285712
63 -0.049004261 -0.010395605
64 0.057235435 -0.049004261
65 -0.446266381 0.057235435
66 -0.196413325 -0.446266381
67 0.031789981 -0.196413325
68 0.778797914 0.031789981
69 0.041177679 0.778797914
70 0.588746887 0.041177679
71 0.138111542 0.588746887
72 1.045430919 0.138111542
73 0.935378287 1.045430919
74 0.895366289 0.935378287
75 2.321579343 0.895366289
76 0.166794850 2.321579343
77 -1.624055355 0.166794850
78 0.432274681 -1.624055355
79 0.050166557 0.432274681
80 -0.171387433 0.050166557
81 -0.689369915 -0.171387433
82 -0.092306772 -0.689369915
83 -0.271292454 -0.092306772
84 -0.598823044 -0.271292454
85 -0.745977389 -0.598823044
86 0.544964893 -0.745977389
87 -1.830148364 0.544964893
88 -1.210078514 -1.830148364
89 1.028715602 -1.210078514
90 -0.777000259 1.028715602
91 0.548038658 -0.777000259
92 0.269601137 0.548038658
93 -0.640835304 0.269601137
94 -0.289371368 -0.640835304
95 1.167355945 -0.289371368
96 -0.421180572 1.167355945
97 -1.364953734 -0.421180572
98 -0.927164092 -1.364953734
99 1.047810016 -0.927164092
100 0.379445932 1.047810016
101 NA 0.379445932
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.547835552 -0.025100771
[2,] -1.067753623 -0.547835552
[3,] -0.017975058 -1.067753623
[4,] 1.043694771 -0.017975058
[5,] 0.820619562 1.043694771
[6,] 0.222867640 0.820619562
[7,] -0.030736403 0.222867640
[8,] -0.592857603 -0.030736403
[9,] -0.571858632 -0.592857603
[10,] 0.792310277 -0.571858632
[11,] 1.165008610 0.792310277
[12,] -0.329196680 1.165008610
[13,] -0.176613726 -0.329196680
[14,] 0.634627127 -0.176613726
[15,] 1.225411078 0.634627127
[16,] -0.424722706 1.225411078
[17,] -0.402059988 -0.424722706
[18,] 0.418197364 -0.402059988
[19,] -0.458235061 0.418197364
[20,] 0.308025103 -0.458235061
[21,] -2.527458607 0.308025103
[22,] 0.889095384 -2.527458607
[23,] -0.292253512 0.889095384
[24,] 0.167558929 -0.292253512
[25,] 0.051589375 0.167558929
[26,] 0.322028918 0.051589375
[27,] 0.094807645 0.322028918
[28,] -0.033626707 0.094807645
[29,] -0.883890401 -0.033626707
[30,] -0.476537781 -0.883890401
[31,] 0.639574393 -0.476537781
[32,] -1.114806990 0.639574393
[33,] 0.670870982 -1.114806990
[34,] -1.012440336 0.670870982
[35,] -0.511164257 -1.012440336
[36,] 1.016827844 -0.511164257
[37,] -0.007794954 1.016827844
[38,] -0.098213863 -0.007794954
[39,] -0.630481307 -0.098213863
[40,] -0.618462625 -0.630481307
[41,] 0.845542424 -0.618462625
[42,] -0.166875942 0.845542424
[43,] -0.035743480 -0.166875942
[44,] 0.867597202 -0.035743480
[45,] -0.100092260 0.867597202
[46,] 0.255568431 -0.100092260
[47,] -0.817030594 0.255568431
[48,] 0.012268716 -0.817030594
[49,] -0.267855169 0.012268716
[50,] 0.976209260 -0.267855169
[51,] 1.816177393 0.976209260
[52,] -0.260040045 1.816177393
[53,] 1.010417896 -0.260040045
[54,] -2.039363573 1.010417896
[55,] -0.460138277 -2.039363573
[56,] -0.867713067 -0.460138277
[57,] -0.250031979 -0.867713067
[58,] 0.442784948 -0.250031979
[59,] -0.237991289 0.442784948
[60,] 1.443227427 -0.237991289
[61,] 0.089285712 1.443227427
[62,] -0.010395605 0.089285712
[63,] -0.049004261 -0.010395605
[64,] 0.057235435 -0.049004261
[65,] -0.446266381 0.057235435
[66,] -0.196413325 -0.446266381
[67,] 0.031789981 -0.196413325
[68,] 0.778797914 0.031789981
[69,] 0.041177679 0.778797914
[70,] 0.588746887 0.041177679
[71,] 0.138111542 0.588746887
[72,] 1.045430919 0.138111542
[73,] 0.935378287 1.045430919
[74,] 0.895366289 0.935378287
[75,] 2.321579343 0.895366289
[76,] 0.166794850 2.321579343
[77,] -1.624055355 0.166794850
[78,] 0.432274681 -1.624055355
[79,] 0.050166557 0.432274681
[80,] -0.171387433 0.050166557
[81,] -0.689369915 -0.171387433
[82,] -0.092306772 -0.689369915
[83,] -0.271292454 -0.092306772
[84,] -0.598823044 -0.271292454
[85,] -0.745977389 -0.598823044
[86,] 0.544964893 -0.745977389
[87,] -1.830148364 0.544964893
[88,] -1.210078514 -1.830148364
[89,] 1.028715602 -1.210078514
[90,] -0.777000259 1.028715602
[91,] 0.548038658 -0.777000259
[92,] 0.269601137 0.548038658
[93,] -0.640835304 0.269601137
[94,] -0.289371368 -0.640835304
[95,] 1.167355945 -0.289371368
[96,] -0.421180572 1.167355945
[97,] -1.364953734 -0.421180572
[98,] -0.927164092 -1.364953734
[99,] 1.047810016 -0.927164092
[100,] 0.379445932 1.047810016
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.547835552 -0.025100771
2 -1.067753623 -0.547835552
3 -0.017975058 -1.067753623
4 1.043694771 -0.017975058
5 0.820619562 1.043694771
6 0.222867640 0.820619562
7 -0.030736403 0.222867640
8 -0.592857603 -0.030736403
9 -0.571858632 -0.592857603
10 0.792310277 -0.571858632
11 1.165008610 0.792310277
12 -0.329196680 1.165008610
13 -0.176613726 -0.329196680
14 0.634627127 -0.176613726
15 1.225411078 0.634627127
16 -0.424722706 1.225411078
17 -0.402059988 -0.424722706
18 0.418197364 -0.402059988
19 -0.458235061 0.418197364
20 0.308025103 -0.458235061
21 -2.527458607 0.308025103
22 0.889095384 -2.527458607
23 -0.292253512 0.889095384
24 0.167558929 -0.292253512
25 0.051589375 0.167558929
26 0.322028918 0.051589375
27 0.094807645 0.322028918
28 -0.033626707 0.094807645
29 -0.883890401 -0.033626707
30 -0.476537781 -0.883890401
31 0.639574393 -0.476537781
32 -1.114806990 0.639574393
33 0.670870982 -1.114806990
34 -1.012440336 0.670870982
35 -0.511164257 -1.012440336
36 1.016827844 -0.511164257
37 -0.007794954 1.016827844
38 -0.098213863 -0.007794954
39 -0.630481307 -0.098213863
40 -0.618462625 -0.630481307
41 0.845542424 -0.618462625
42 -0.166875942 0.845542424
43 -0.035743480 -0.166875942
44 0.867597202 -0.035743480
45 -0.100092260 0.867597202
46 0.255568431 -0.100092260
47 -0.817030594 0.255568431
48 0.012268716 -0.817030594
49 -0.267855169 0.012268716
50 0.976209260 -0.267855169
51 1.816177393 0.976209260
52 -0.260040045 1.816177393
53 1.010417896 -0.260040045
54 -2.039363573 1.010417896
55 -0.460138277 -2.039363573
56 -0.867713067 -0.460138277
57 -0.250031979 -0.867713067
58 0.442784948 -0.250031979
59 -0.237991289 0.442784948
60 1.443227427 -0.237991289
61 0.089285712 1.443227427
62 -0.010395605 0.089285712
63 -0.049004261 -0.010395605
64 0.057235435 -0.049004261
65 -0.446266381 0.057235435
66 -0.196413325 -0.446266381
67 0.031789981 -0.196413325
68 0.778797914 0.031789981
69 0.041177679 0.778797914
70 0.588746887 0.041177679
71 0.138111542 0.588746887
72 1.045430919 0.138111542
73 0.935378287 1.045430919
74 0.895366289 0.935378287
75 2.321579343 0.895366289
76 0.166794850 2.321579343
77 -1.624055355 0.166794850
78 0.432274681 -1.624055355
79 0.050166557 0.432274681
80 -0.171387433 0.050166557
81 -0.689369915 -0.171387433
82 -0.092306772 -0.689369915
83 -0.271292454 -0.092306772
84 -0.598823044 -0.271292454
85 -0.745977389 -0.598823044
86 0.544964893 -0.745977389
87 -1.830148364 0.544964893
88 -1.210078514 -1.830148364
89 1.028715602 -1.210078514
90 -0.777000259 1.028715602
91 0.548038658 -0.777000259
92 0.269601137 0.548038658
93 -0.640835304 0.269601137
94 -0.289371368 -0.640835304
95 1.167355945 -0.289371368
96 -0.421180572 1.167355945
97 -1.364953734 -0.421180572
98 -0.927164092 -1.364953734
99 1.047810016 -0.927164092
100 0.379445932 1.047810016
> 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/7ygfb1290555401.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/89pee1290555401.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/99pee1290555401.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/102ydh1290555401.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/11nyt51290555401.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/12qzas1290555401.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/13m9811290555401.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/14x0pm1290555401.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/15jjns1290555401.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/16xal11290555401.tab")
+ }
>
> try(system("convert tmp/1dfgn1290555401.ps tmp/1dfgn1290555401.png",intern=TRUE))
character(0)
> try(system("convert tmp/2dfgn1290555401.ps tmp/2dfgn1290555401.png",intern=TRUE))
character(0)
> try(system("convert tmp/3dfgn1290555401.ps tmp/3dfgn1290555401.png",intern=TRUE))
character(0)
> try(system("convert tmp/456fq1290555401.ps tmp/456fq1290555401.png",intern=TRUE))
character(0)
> try(system("convert tmp/556fq1290555401.ps tmp/556fq1290555401.png",intern=TRUE))
character(0)
> try(system("convert tmp/656fq1290555401.ps tmp/656fq1290555401.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ygfb1290555401.ps tmp/7ygfb1290555401.png",intern=TRUE))
character(0)
> try(system("convert tmp/89pee1290555401.ps tmp/89pee1290555401.png",intern=TRUE))
character(0)
> try(system("convert tmp/99pee1290555401.ps tmp/99pee1290555401.png",intern=TRUE))
character(0)
> try(system("convert tmp/102ydh1290555401.ps tmp/102ydh1290555401.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.351 1.609 8.786