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(6.3
+ ,101.9
+ ,6.3
+ ,6.1
+ ,6.1
+ ,6.3
+ ,6
+ ,106.2
+ ,6.3
+ ,6.3
+ ,6.1
+ ,6.1
+ ,6.2
+ ,81
+ ,6
+ ,6.3
+ ,6.3
+ ,6.1
+ ,6.4
+ ,94.7
+ ,6.2
+ ,6
+ ,6.3
+ ,6.3
+ ,6.8
+ ,101
+ ,6.4
+ ,6.2
+ ,6
+ ,6.3
+ ,7.5
+ ,109.4
+ ,6.8
+ ,6.4
+ ,6.2
+ ,6
+ ,7.5
+ ,102.3
+ ,7.5
+ ,6.8
+ ,6.4
+ ,6.2
+ ,7.6
+ ,90.7
+ ,7.5
+ ,7.5
+ ,6.8
+ ,6.4
+ ,7.6
+ ,96.2
+ ,7.6
+ ,7.5
+ ,7.5
+ ,6.8
+ ,7.4
+ ,96.1
+ ,7.6
+ ,7.6
+ ,7.5
+ ,7.5
+ ,7.3
+ ,106
+ ,7.4
+ ,7.6
+ ,7.6
+ ,7.5
+ ,7.1
+ ,103.1
+ ,7.3
+ ,7.4
+ ,7.6
+ ,7.6
+ ,6.9
+ ,102
+ ,7.1
+ ,7.3
+ ,7.4
+ ,7.6
+ ,6.8
+ ,104.7
+ ,6.9
+ ,7.1
+ ,7.3
+ ,7.4
+ ,7.5
+ ,86
+ ,6.8
+ ,6.9
+ ,7.1
+ ,7.3
+ ,7.6
+ ,92.1
+ ,7.5
+ ,6.8
+ ,6.9
+ ,7.1
+ ,7.8
+ ,106.9
+ ,7.6
+ ,7.5
+ ,6.8
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,117.3
+ ,6.8
+ ,7.1
+ ,7.3
+ ,7.2
+ ,6.1
+ ,109.1
+ ,6.4
+ ,6.8
+ ,7.1
+ ,7.3
+ ,6.5
+ ,115.9
+ ,6.1
+ ,6.4
+ ,6.8
+ ,7.1
+ ,7.7
+ ,96
+ ,6.5
+ ,6.1
+ ,6.4
+ ,6.8
+ ,7.9
+ ,99.8
+ ,7.7
+ ,6.5
+ ,6.1
+ ,6.4
+ ,7.5
+ ,116.8
+ ,7.9
+ ,7.7
+ ,6.5
+ ,6.1
+ ,6.9
+ ,115.7
+ ,7.5
+ ,7.9
+ ,7.7
+ ,6.5
+ ,6.6
+ ,99.4
+ ,6.9
+ ,7.5
+ ,7.9
+ ,7.7
+ ,6.9
+ ,94.3
+ ,6.6
+ ,6.9
+ ,7.5
+ ,7.9
+ ,7.7
+ ,91
+ ,6.9
+ ,6.6
+ ,6.9
+ ,7.5)
+ ,dim=c(6
+ ,93)
+ ,dimnames=list(c('Y'
+ ,'X'
+ ,'Y1'
+ ,'Y2'
+ ,'Y3'
+ ,'Y4')
+ ,1:93))
> y <- array(NA,dim=c(6,93),dimnames=list(c('Y','X','Y1','Y2','Y3','Y4'),1:93))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Include Monthly 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
Y X Y1 Y2 Y3 Y4 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 6.3 101.9 6.3 6.1 6.1 6.3 1 0 0 0 0 0 0 0 0 0 0 1
2 6.0 106.2 6.3 6.3 6.1 6.1 0 1 0 0 0 0 0 0 0 0 0 2
3 6.2 81.0 6.0 6.3 6.3 6.1 0 0 1 0 0 0 0 0 0 0 0 3
4 6.4 94.7 6.2 6.0 6.3 6.3 0 0 0 1 0 0 0 0 0 0 0 4
5 6.8 101.0 6.4 6.2 6.0 6.3 0 0 0 0 1 0 0 0 0 0 0 5
6 7.5 109.4 6.8 6.4 6.2 6.0 0 0 0 0 0 1 0 0 0 0 0 6
7 7.5 102.3 7.5 6.8 6.4 6.2 0 0 0 0 0 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0 1 0 0 0 0 0 0 89
90 6.9 115.7 7.5 7.9 7.7 6.5 0 0 0 0 0 1 0 0 0 0 0 90
91 6.6 99.4 6.9 7.5 7.9 7.7 0 0 0 0 0 0 1 0 0 0 0 91
92 6.9 94.3 6.6 6.9 7.5 7.9 0 0 0 0 0 0 0 1 0 0 0 92
93 7.7 91.0 6.9 6.6 6.9 7.5 0 0 0 0 0 0 0 0 1 0 0 93
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X Y1 Y2 Y3 Y4
0.9331420 -0.0059945 1.5540936 -0.8627432 -0.1331707 0.3948808
M1 M2 M3 M4 M5 M6
-0.1078359 0.0086587 0.5551323 -0.3585617 0.1941642 0.3772110
M7 M8 M9 M10 M11 t
0.0719094 0.2283123 0.1458014 -0.0769332 0.0653510 -0.0006445
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.359367 -0.089211 -0.004558 0.076578 0.451875
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.9331420 0.5003748 1.865 0.066109 .
X -0.0059945 0.0043930 -1.365 0.176479
Y1 1.5540936 0.1074217 14.467 < 2e-16 ***
Y2 -0.8627432 0.2081985 -4.144 8.88e-05 ***
Y3 -0.1331707 0.2083696 -0.639 0.524700
Y4 0.3948808 0.1064105 3.711 0.000394 ***
M1 -0.1078359 0.0864340 -1.248 0.216055
M2 0.0086587 0.0938057 0.092 0.926702
M3 0.5551323 0.1173537 4.730 1.03e-05 ***
M4 -0.3585617 0.1216420 -2.948 0.004266 **
M5 0.1941642 0.1254271 1.548 0.125826
M6 0.3772110 0.1039356 3.629 0.000516 ***
M7 0.0719094 0.0845635 0.850 0.397832
M8 0.2283123 0.0916222 2.492 0.014915 *
M9 0.1458014 0.0947447 1.539 0.128040
M10 -0.0769332 0.0939454 -0.819 0.415430
M11 0.0653510 0.0923641 0.708 0.481426
t -0.0006445 0.0008777 -0.734 0.465076
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.1624 on 75 degrees of freedom
Multiple R-squared: 0.9609, Adjusted R-squared: 0.952
F-statistic: 108.4 on 17 and 75 DF, p-value: < 2.2e-16
> 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.53515043 0.9296991 0.4648496
[2,] 0.57971603 0.8405679 0.4202840
[3,] 0.43643699 0.8728740 0.5635630
[4,] 0.38929271 0.7785854 0.6107073
[5,] 0.30733286 0.6146657 0.6926671
[6,] 0.25074153 0.5014831 0.7492585
[7,] 0.19710403 0.3942081 0.8028960
[8,] 0.13189043 0.2637809 0.8681096
[9,] 0.12044486 0.2408897 0.8795551
[10,] 0.16239924 0.3247985 0.8376008
[11,] 0.11959855 0.2391971 0.8804014
[12,] 0.15649982 0.3129996 0.8435002
[13,] 0.11039618 0.2207924 0.8896038
[14,] 0.07937874 0.1587575 0.9206213
[15,] 0.09569508 0.1913902 0.9043049
[16,] 0.22440184 0.4488037 0.7755982
[17,] 0.18930398 0.3786080 0.8106960
[18,] 0.14182590 0.2836518 0.8581741
[19,] 0.21714791 0.4342958 0.7828521
[20,] 0.21506155 0.4301231 0.7849385
[21,] 0.21169138 0.4233828 0.7883086
[22,] 0.16939919 0.3387984 0.8306008
[23,] 0.12596100 0.2519220 0.8740390
[24,] 0.11865271 0.2373054 0.8813473
[25,] 0.51364601 0.9727080 0.4863540
[26,] 0.45136982 0.9027396 0.5486302
[27,] 0.44045171 0.8809034 0.5595483
[28,] 0.44160787 0.8832157 0.5583921
[29,] 0.51362860 0.9727428 0.4863714
[30,] 0.56262874 0.8747425 0.4373713
[31,] 0.49445551 0.9889110 0.5055445
[32,] 0.43217932 0.8643586 0.5678207
[33,] 0.41324022 0.8264804 0.5867598
[34,] 0.46462539 0.9292508 0.5353746
[35,] 0.42571603 0.8514321 0.5742840
[36,] 0.36232516 0.7246503 0.6376748
[37,] 0.29657166 0.5931433 0.7034283
[38,] 0.23896061 0.4779212 0.7610394
[39,] 0.21425779 0.4285156 0.7857422
[40,] 0.19611904 0.3922381 0.8038810
[41,] 0.20918933 0.4183787 0.7908107
[42,] 0.18551072 0.3710214 0.8144893
[43,] 0.31283262 0.6256652 0.6871674
[44,] 0.32209913 0.6441983 0.6779009
[45,] 0.28289966 0.5657993 0.7171003
[46,] 0.37208373 0.7441675 0.6279163
[47,] 0.36282647 0.7256529 0.6371735
[48,] 0.27097695 0.5419539 0.7290231
[49,] 0.19548680 0.3909736 0.8045132
[50,] 0.12775725 0.2555145 0.8722427
[51,] 0.30018296 0.6003659 0.6998170
[52,] 0.38591236 0.7718247 0.6140876
> postscript(file="/var/www/html/rcomp/tmp/1tq5e1258650986.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/2ft1o1258650986.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/3e7a91258650986.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/4vepk1258650986.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/5qkvf1258650986.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 = 93
Frequency = 1
1 2 3 4 5 6
-0.117289103 -0.255838221 -0.259865649 0.287979122 -0.004558417 0.259402254
7 8 9 10 11 12
-0.272322590 0.180595673 0.076578364 -0.090784218 0.051057040 -0.156958837
13 14 15 16 17 18
-0.057162129 -0.052898040 -0.015109010 -0.086002131 0.164804534 0.124733727
19 20 21 22 23 24
0.063970615 -0.045648680 0.048399705 0.034586869 -0.041186676 0.106997089
25 26 27 28 29 30
-0.182041516 0.133280629 -0.008217740 -0.067221747 0.066961825 0.075442694
31 32 33 34 35 36
0.039761828 0.034324815 0.095871397 -0.063039478 -0.169699648 -0.310702444
37 38 39 40 41 42
0.144930308 0.061938902 0.293504779 0.036962247 0.164477191 -0.101869765
43 44 45 46 47 48
0.111920158 0.104335003 -0.321154293 -0.044183697 -0.005175395 -0.021739700
49 50 51 52 53 54
0.272861346 -0.104494999 0.075939816 0.023729346 0.037915921 -0.129776124
55 56 57 58 59 60
0.141273140 -0.010076590 -0.015020804 0.059663544 0.132095684 0.151928474
61 62 63 64 65 66
0.105716782 -0.070732027 -0.271749084 0.076318028 -0.023059581 -0.236447362
67 68 69 70 71 72
0.011034774 -0.101440121 0.006101672 0.096046265 0.061094211 0.319686383
73 74 75 76 77 78
-0.133822729 -0.163131248 0.014005304 -0.178559984 -0.359366752 0.048647032
79 80 81 82 83 84
-0.103877854 -0.100337620 -0.045396017 0.007710714 -0.028185216 -0.089210966
85 86 87 88 89 90
-0.033192960 0.451875004 0.171491584 -0.093204881 -0.047174720 -0.040132455
91 92 93
0.008239930 -0.061752479 0.154619976
> postscript(file="/var/www/html/rcomp/tmp/66c411258650986.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 = 93
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.117289103 NA
1 -0.255838221 -0.117289103
2 -0.259865649 -0.255838221
3 0.287979122 -0.259865649
4 -0.004558417 0.287979122
5 0.259402254 -0.004558417
6 -0.272322590 0.259402254
7 0.180595673 -0.272322590
8 0.076578364 0.180595673
9 -0.090784218 0.076578364
10 0.051057040 -0.090784218
11 -0.156958837 0.051057040
12 -0.057162129 -0.156958837
13 -0.052898040 -0.057162129
14 -0.015109010 -0.052898040
15 -0.086002131 -0.015109010
16 0.164804534 -0.086002131
17 0.124733727 0.164804534
18 0.063970615 0.124733727
19 -0.045648680 0.063970615
20 0.048399705 -0.045648680
21 0.034586869 0.048399705
22 -0.041186676 0.034586869
23 0.106997089 -0.041186676
24 -0.182041516 0.106997089
25 0.133280629 -0.182041516
26 -0.008217740 0.133280629
27 -0.067221747 -0.008217740
28 0.066961825 -0.067221747
29 0.075442694 0.066961825
30 0.039761828 0.075442694
31 0.034324815 0.039761828
32 0.095871397 0.034324815
33 -0.063039478 0.095871397
34 -0.169699648 -0.063039478
35 -0.310702444 -0.169699648
36 0.144930308 -0.310702444
37 0.061938902 0.144930308
38 0.293504779 0.061938902
39 0.036962247 0.293504779
40 0.164477191 0.036962247
41 -0.101869765 0.164477191
42 0.111920158 -0.101869765
43 0.104335003 0.111920158
44 -0.321154293 0.104335003
45 -0.044183697 -0.321154293
46 -0.005175395 -0.044183697
47 -0.021739700 -0.005175395
48 0.272861346 -0.021739700
49 -0.104494999 0.272861346
50 0.075939816 -0.104494999
51 0.023729346 0.075939816
52 0.037915921 0.023729346
53 -0.129776124 0.037915921
54 0.141273140 -0.129776124
55 -0.010076590 0.141273140
56 -0.015020804 -0.010076590
57 0.059663544 -0.015020804
58 0.132095684 0.059663544
59 0.151928474 0.132095684
60 0.105716782 0.151928474
61 -0.070732027 0.105716782
62 -0.271749084 -0.070732027
63 0.076318028 -0.271749084
64 -0.023059581 0.076318028
65 -0.236447362 -0.023059581
66 0.011034774 -0.236447362
67 -0.101440121 0.011034774
68 0.006101672 -0.101440121
69 0.096046265 0.006101672
70 0.061094211 0.096046265
71 0.319686383 0.061094211
72 -0.133822729 0.319686383
73 -0.163131248 -0.133822729
74 0.014005304 -0.163131248
75 -0.178559984 0.014005304
76 -0.359366752 -0.178559984
77 0.048647032 -0.359366752
78 -0.103877854 0.048647032
79 -0.100337620 -0.103877854
80 -0.045396017 -0.100337620
81 0.007710714 -0.045396017
82 -0.028185216 0.007710714
83 -0.089210966 -0.028185216
84 -0.033192960 -0.089210966
85 0.451875004 -0.033192960
86 0.171491584 0.451875004
87 -0.093204881 0.171491584
88 -0.047174720 -0.093204881
89 -0.040132455 -0.047174720
90 0.008239930 -0.040132455
91 -0.061752479 0.008239930
92 0.154619976 -0.061752479
93 NA 0.154619976
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.255838221 -0.117289103
[2,] -0.259865649 -0.255838221
[3,] 0.287979122 -0.259865649
[4,] -0.004558417 0.287979122
[5,] 0.259402254 -0.004558417
[6,] -0.272322590 0.259402254
[7,] 0.180595673 -0.272322590
[8,] 0.076578364 0.180595673
[9,] -0.090784218 0.076578364
[10,] 0.051057040 -0.090784218
[11,] -0.156958837 0.051057040
[12,] -0.057162129 -0.156958837
[13,] -0.052898040 -0.057162129
[14,] -0.015109010 -0.052898040
[15,] -0.086002131 -0.015109010
[16,] 0.164804534 -0.086002131
[17,] 0.124733727 0.164804534
[18,] 0.063970615 0.124733727
[19,] -0.045648680 0.063970615
[20,] 0.048399705 -0.045648680
[21,] 0.034586869 0.048399705
[22,] -0.041186676 0.034586869
[23,] 0.106997089 -0.041186676
[24,] -0.182041516 0.106997089
[25,] 0.133280629 -0.182041516
[26,] -0.008217740 0.133280629
[27,] -0.067221747 -0.008217740
[28,] 0.066961825 -0.067221747
[29,] 0.075442694 0.066961825
[30,] 0.039761828 0.075442694
[31,] 0.034324815 0.039761828
[32,] 0.095871397 0.034324815
[33,] -0.063039478 0.095871397
[34,] -0.169699648 -0.063039478
[35,] -0.310702444 -0.169699648
[36,] 0.144930308 -0.310702444
[37,] 0.061938902 0.144930308
[38,] 0.293504779 0.061938902
[39,] 0.036962247 0.293504779
[40,] 0.164477191 0.036962247
[41,] -0.101869765 0.164477191
[42,] 0.111920158 -0.101869765
[43,] 0.104335003 0.111920158
[44,] -0.321154293 0.104335003
[45,] -0.044183697 -0.321154293
[46,] -0.005175395 -0.044183697
[47,] -0.021739700 -0.005175395
[48,] 0.272861346 -0.021739700
[49,] -0.104494999 0.272861346
[50,] 0.075939816 -0.104494999
[51,] 0.023729346 0.075939816
[52,] 0.037915921 0.023729346
[53,] -0.129776124 0.037915921
[54,] 0.141273140 -0.129776124
[55,] -0.010076590 0.141273140
[56,] -0.015020804 -0.010076590
[57,] 0.059663544 -0.015020804
[58,] 0.132095684 0.059663544
[59,] 0.151928474 0.132095684
[60,] 0.105716782 0.151928474
[61,] -0.070732027 0.105716782
[62,] -0.271749084 -0.070732027
[63,] 0.076318028 -0.271749084
[64,] -0.023059581 0.076318028
[65,] -0.236447362 -0.023059581
[66,] 0.011034774 -0.236447362
[67,] -0.101440121 0.011034774
[68,] 0.006101672 -0.101440121
[69,] 0.096046265 0.006101672
[70,] 0.061094211 0.096046265
[71,] 0.319686383 0.061094211
[72,] -0.133822729 0.319686383
[73,] -0.163131248 -0.133822729
[74,] 0.014005304 -0.163131248
[75,] -0.178559984 0.014005304
[76,] -0.359366752 -0.178559984
[77,] 0.048647032 -0.359366752
[78,] -0.103877854 0.048647032
[79,] -0.100337620 -0.103877854
[80,] -0.045396017 -0.100337620
[81,] 0.007710714 -0.045396017
[82,] -0.028185216 0.007710714
[83,] -0.089210966 -0.028185216
[84,] -0.033192960 -0.089210966
[85,] 0.451875004 -0.033192960
[86,] 0.171491584 0.451875004
[87,] -0.093204881 0.171491584
[88,] -0.047174720 -0.093204881
[89,] -0.040132455 -0.047174720
[90,] 0.008239930 -0.040132455
[91,] -0.061752479 0.008239930
[92,] 0.154619976 -0.061752479
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.255838221 -0.117289103
2 -0.259865649 -0.255838221
3 0.287979122 -0.259865649
4 -0.004558417 0.287979122
5 0.259402254 -0.004558417
6 -0.272322590 0.259402254
7 0.180595673 -0.272322590
8 0.076578364 0.180595673
9 -0.090784218 0.076578364
10 0.051057040 -0.090784218
11 -0.156958837 0.051057040
12 -0.057162129 -0.156958837
13 -0.052898040 -0.057162129
14 -0.015109010 -0.052898040
15 -0.086002131 -0.015109010
16 0.164804534 -0.086002131
17 0.124733727 0.164804534
18 0.063970615 0.124733727
19 -0.045648680 0.063970615
20 0.048399705 -0.045648680
21 0.034586869 0.048399705
22 -0.041186676 0.034586869
23 0.106997089 -0.041186676
24 -0.182041516 0.106997089
25 0.133280629 -0.182041516
26 -0.008217740 0.133280629
27 -0.067221747 -0.008217740
28 0.066961825 -0.067221747
29 0.075442694 0.066961825
30 0.039761828 0.075442694
31 0.034324815 0.039761828
32 0.095871397 0.034324815
33 -0.063039478 0.095871397
34 -0.169699648 -0.063039478
35 -0.310702444 -0.169699648
36 0.144930308 -0.310702444
37 0.061938902 0.144930308
38 0.293504779 0.061938902
39 0.036962247 0.293504779
40 0.164477191 0.036962247
41 -0.101869765 0.164477191
42 0.111920158 -0.101869765
43 0.104335003 0.111920158
44 -0.321154293 0.104335003
45 -0.044183697 -0.321154293
46 -0.005175395 -0.044183697
47 -0.021739700 -0.005175395
48 0.272861346 -0.021739700
49 -0.104494999 0.272861346
50 0.075939816 -0.104494999
51 0.023729346 0.075939816
52 0.037915921 0.023729346
53 -0.129776124 0.037915921
54 0.141273140 -0.129776124
55 -0.010076590 0.141273140
56 -0.015020804 -0.010076590
57 0.059663544 -0.015020804
58 0.132095684 0.059663544
59 0.151928474 0.132095684
60 0.105716782 0.151928474
61 -0.070732027 0.105716782
62 -0.271749084 -0.070732027
63 0.076318028 -0.271749084
64 -0.023059581 0.076318028
65 -0.236447362 -0.023059581
66 0.011034774 -0.236447362
67 -0.101440121 0.011034774
68 0.006101672 -0.101440121
69 0.096046265 0.006101672
70 0.061094211 0.096046265
71 0.319686383 0.061094211
72 -0.133822729 0.319686383
73 -0.163131248 -0.133822729
74 0.014005304 -0.163131248
75 -0.178559984 0.014005304
76 -0.359366752 -0.178559984
77 0.048647032 -0.359366752
78 -0.103877854 0.048647032
79 -0.100337620 -0.103877854
80 -0.045396017 -0.100337620
81 0.007710714 -0.045396017
82 -0.028185216 0.007710714
83 -0.089210966 -0.028185216
84 -0.033192960 -0.089210966
85 0.451875004 -0.033192960
86 0.171491584 0.451875004
87 -0.093204881 0.171491584
88 -0.047174720 -0.093204881
89 -0.040132455 -0.047174720
90 0.008239930 -0.040132455
91 -0.061752479 0.008239930
92 0.154619976 -0.061752479
> 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/7d9hf1258650986.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/8h42g1258650986.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/9x60q1258650986.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/1036ex1258650986.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/11w4z41258650986.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/12jve11258650986.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/131n4k1258650986.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/14zpuj1258650986.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/15111d1258650986.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/16wo911258650986.tab")
+ }
>
> system("convert tmp/1tq5e1258650986.ps tmp/1tq5e1258650986.png")
> system("convert tmp/2ft1o1258650986.ps tmp/2ft1o1258650986.png")
> system("convert tmp/3e7a91258650986.ps tmp/3e7a91258650986.png")
> system("convert tmp/4vepk1258650986.ps tmp/4vepk1258650986.png")
> system("convert tmp/5qkvf1258650986.ps tmp/5qkvf1258650986.png")
> system("convert tmp/66c411258650986.ps tmp/66c411258650986.png")
> system("convert tmp/7d9hf1258650986.ps tmp/7d9hf1258650986.png")
> system("convert tmp/8h42g1258650986.ps tmp/8h42g1258650986.png")
> system("convert tmp/9x60q1258650986.ps tmp/9x60q1258650986.png")
> system("convert tmp/1036ex1258650986.ps tmp/1036ex1258650986.png")
>
>
> proc.time()
user system elapsed
2.911 1.608 3.365