R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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.
Natural language support but running in an English locale
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
+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1_12','Q1_16','Q1_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 = '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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 6 7
7 1 6 7
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_3 Q1_5 Q1_7 Q1_8 Q1_12
0.683448 0.198927 -0.092821 0.090500 -0.075972 0.116383
Q1_16 Q1_22 Q1_2v Q1_3v Q1_5v Q1_7v
0.580006 -0.009898 0.124131 -0.261297 0.227200 -0.128064
Q1_8v Q1_12v Q1_16v Q1_22v
0.308882 -0.158992 0.088978 -0.102927
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3.431948 -0.416419 -0.001297 0.497636 1.776013
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.683448 0.926271 0.738 0.4626
Q1_3 0.198927 0.106626 1.866 0.0655 .
Q1_5 -0.092821 0.140660 -0.660 0.5111
Q1_7 0.090500 0.086763 1.043 0.2999
Q1_8 -0.075972 0.111699 -0.680 0.4983
Q1_12 0.116383 0.125318 0.929 0.3557
Q1_16 0.580006 0.101982 5.687 1.78e-07 ***
Q1_22 -0.009898 0.112570 -0.088 0.9301
Q1_2v 0.124131 0.112668 1.102 0.2737
Q1_3v -0.261297 0.107925 -2.421 0.0176 *
Q1_5v 0.227200 0.239237 0.950 0.3450
Q1_7v -0.128064 0.129997 -0.985 0.3274
Q1_8v 0.308882 0.161301 1.915 0.0589 .
Q1_12v -0.158992 0.142698 -1.114 0.2683
Q1_16v 0.088978 0.161312 0.552 0.5827
Q1_22v -0.102927 0.153545 -0.670 0.5045
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.9039 on 85 degrees of freedom
Multiple R-squared: 0.4531, Adjusted R-squared: 0.3566
F-statistic: 4.695 on 15 and 85 DF, p-value: 1.813e-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.5289245606 0.9421508788 0.4710754
[2,] 0.4257719337 0.8515438673 0.5742281
[3,] 0.4618119030 0.9236238060 0.5381881
[4,] 0.3709452474 0.7418904948 0.6290548
[5,] 0.2659450772 0.5318901544 0.7340549
[6,] 0.2804636111 0.5609272223 0.7195364
[7,] 0.2284211227 0.4568422455 0.7715789
[8,] 0.1613666733 0.3227333467 0.8386333
[9,] 0.1141060682 0.2282121364 0.8858939
[10,] 0.1635964513 0.3271929026 0.8364035
[11,] 0.1446866789 0.2893733578 0.8553133
[12,] 0.1401563468 0.2803126937 0.8598437
[13,] 0.3245579839 0.6491159677 0.6754420
[14,] 0.2842798837 0.5685597673 0.7157201
[15,] 0.2196308253 0.4392616506 0.7803692
[16,] 0.2509240361 0.5018480722 0.7490760
[17,] 0.2174689807 0.4349379615 0.7825310
[18,] 0.1657463897 0.3314927794 0.8342536
[19,] 0.2674830227 0.5349660454 0.7325170
[20,] 0.5528016860 0.8943966280 0.4471983
[21,] 0.5267455074 0.9465089852 0.4732545
[22,] 0.5269010290 0.9461979420 0.4730990
[23,] 0.4554641810 0.9109283620 0.5445358
[24,] 0.5784724706 0.8430550588 0.4215275
[25,] 0.5089811786 0.9820376428 0.4910188
[26,] 0.4452933574 0.8905867147 0.5547066
[27,] 0.3926648335 0.7853296670 0.6073352
[28,] 0.3334758557 0.6669517113 0.6665241
[29,] 0.2760285793 0.5520571587 0.7239714
[30,] 0.2749923054 0.5499846109 0.7250077
[31,] 0.2206189267 0.4412378534 0.7793811
[32,] 0.1876959339 0.3753918677 0.8123041
[33,] 0.1473170730 0.2946341461 0.8526829
[34,] 0.1249880263 0.2499760526 0.8750120
[35,] 0.1119106264 0.2238212528 0.8880894
[36,] 0.0831148251 0.1662296502 0.9168852
[37,] 0.1159391853 0.2318783706 0.8840608
[38,] 0.0868206378 0.1736412756 0.9131794
[39,] 0.0625109961 0.1250219922 0.9374890
[40,] 0.0459391735 0.0918783469 0.9540608
[41,] 0.0326205102 0.0652410203 0.9673795
[42,] 0.0217643755 0.0435287510 0.9782356
[43,] 0.0194493629 0.0388987258 0.9805506
[44,] 0.0149079518 0.0298159035 0.9850920
[45,] 0.0113650614 0.0227301228 0.9886349
[46,] 0.0114200636 0.0228401272 0.9885799
[47,] 0.0157300331 0.0314600663 0.9842700
[48,] 0.0138807143 0.0277614285 0.9861193
[49,] 0.0102552269 0.0205104538 0.9897448
[50,] 0.0105440773 0.0210881546 0.9894559
[51,] 0.0071879609 0.0143759219 0.9928120
[52,] 0.0044095161 0.0088190322 0.9955905
[53,] 0.0024942280 0.0049884559 0.9975058
[54,] 0.0015331649 0.0030663297 0.9984668
[55,] 0.0035350549 0.0070701098 0.9964649
[56,] 0.0019480714 0.0038961427 0.9980519
[57,] 0.0014127204 0.0028254409 0.9985873
[58,] 0.0006845048 0.0013690095 0.9993155
[59,] 0.0004244825 0.0008489651 0.9995755
[60,] 0.0002006093 0.0004012186 0.9997994
[61,] 0.0007029230 0.0014058461 0.9992971
[62,] 0.0003737418 0.0007474836 0.9996263
[63,] 0.0010065754 0.0020131509 0.9989934
[64,] 0.0005887962 0.0011775923 0.9994112
> postscript(file="/var/www/html/freestat/rcomp/tmp/1uyf61290555959.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/freestat/rcomp/tmp/2uyf61290555959.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/freestat/rcomp/tmp/3n7w91290555959.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/freestat/rcomp/tmp/4n7w91290555959.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/freestat/rcomp/tmp/5n7w91290555959.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.441295290 -0.202806884 1.380224627 -0.089692285 0.076536943 0.885939344
7 8 9 10 11 12
0.363041059 0.666615103 0.078090273 0.497636251 -0.111384319 -0.505481056
13 14 15 16 17 18
-0.592988736 -0.244137925 -1.096301441 -2.225522511 0.538867330 -0.155424269
19 20 21 22 23 24
0.047316977 1.402921641 -0.268241073 -0.214894361 -0.162193151 -1.329085363
25 26 27 28 29 30
-0.699270393 0.518419924 -0.029876091 0.804632526 0.786176454 -0.154636989
31 32 33 34 35 36
-0.941807222 1.072660023 -0.035566530 1.041998290 0.707841229 -0.125631441
37 38 39 40 41 42
1.703518684 -0.594237485 0.510561265 -0.893150525 0.141653606 -1.857052737
43 44 45 46 47 48
-0.011737932 0.021614431 0.084642334 -0.144149852 -0.292733840 0.915295693
49 50 51 52 53 54
0.153988359 -0.001296881 -0.008764679 0.253211207 -0.738973027 -0.136055480
55 56 57 58 59 60
-1.079886956 -0.005506762 0.326485432 -0.203045359 0.279069681 0.225499994
61 62 63 64 65 66
-1.184690688 0.905843719 -0.797428811 -0.855267704 1.330135897 -0.920449231
67 68 69 70 71 72
0.591614058 -1.191948621 0.470601104 0.299204625 -0.058481118 0.388057383
73 74 75 76 77 78
1.502367277 -0.183236805 -0.962408613 0.007462222 -0.653014806 0.345043513
79 80 81 82 83 84
1.718369241 0.808051379 1.776013123 0.798315478 0.019812609 0.632669007
85 86 87 88 89 90
0.106582973 -0.355975446 -0.572866020 -0.075293745 -1.428097142 1.103524865
91 92 93 94 95 96
-0.639350946 0.231606702 -0.637825848 0.835238387 -3.431947559 0.074164786
97 98 99 100 101
0.235893367 -0.327783902 0.451148851 -0.713454699 -0.416419280
> postscript(file="/var/www/html/freestat/rcomp/tmp/6yhdc1290555959.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.441295290 NA
1 -0.202806884 0.441295290
2 1.380224627 -0.202806884
3 -0.089692285 1.380224627
4 0.076536943 -0.089692285
5 0.885939344 0.076536943
6 0.363041059 0.885939344
7 0.666615103 0.363041059
8 0.078090273 0.666615103
9 0.497636251 0.078090273
10 -0.111384319 0.497636251
11 -0.505481056 -0.111384319
12 -0.592988736 -0.505481056
13 -0.244137925 -0.592988736
14 -1.096301441 -0.244137925
15 -2.225522511 -1.096301441
16 0.538867330 -2.225522511
17 -0.155424269 0.538867330
18 0.047316977 -0.155424269
19 1.402921641 0.047316977
20 -0.268241073 1.402921641
21 -0.214894361 -0.268241073
22 -0.162193151 -0.214894361
23 -1.329085363 -0.162193151
24 -0.699270393 -1.329085363
25 0.518419924 -0.699270393
26 -0.029876091 0.518419924
27 0.804632526 -0.029876091
28 0.786176454 0.804632526
29 -0.154636989 0.786176454
30 -0.941807222 -0.154636989
31 1.072660023 -0.941807222
32 -0.035566530 1.072660023
33 1.041998290 -0.035566530
34 0.707841229 1.041998290
35 -0.125631441 0.707841229
36 1.703518684 -0.125631441
37 -0.594237485 1.703518684
38 0.510561265 -0.594237485
39 -0.893150525 0.510561265
40 0.141653606 -0.893150525
41 -1.857052737 0.141653606
42 -0.011737932 -1.857052737
43 0.021614431 -0.011737932
44 0.084642334 0.021614431
45 -0.144149852 0.084642334
46 -0.292733840 -0.144149852
47 0.915295693 -0.292733840
48 0.153988359 0.915295693
49 -0.001296881 0.153988359
50 -0.008764679 -0.001296881
51 0.253211207 -0.008764679
52 -0.738973027 0.253211207
53 -0.136055480 -0.738973027
54 -1.079886956 -0.136055480
55 -0.005506762 -1.079886956
56 0.326485432 -0.005506762
57 -0.203045359 0.326485432
58 0.279069681 -0.203045359
59 0.225499994 0.279069681
60 -1.184690688 0.225499994
61 0.905843719 -1.184690688
62 -0.797428811 0.905843719
63 -0.855267704 -0.797428811
64 1.330135897 -0.855267704
65 -0.920449231 1.330135897
66 0.591614058 -0.920449231
67 -1.191948621 0.591614058
68 0.470601104 -1.191948621
69 0.299204625 0.470601104
70 -0.058481118 0.299204625
71 0.388057383 -0.058481118
72 1.502367277 0.388057383
73 -0.183236805 1.502367277
74 -0.962408613 -0.183236805
75 0.007462222 -0.962408613
76 -0.653014806 0.007462222
77 0.345043513 -0.653014806
78 1.718369241 0.345043513
79 0.808051379 1.718369241
80 1.776013123 0.808051379
81 0.798315478 1.776013123
82 0.019812609 0.798315478
83 0.632669007 0.019812609
84 0.106582973 0.632669007
85 -0.355975446 0.106582973
86 -0.572866020 -0.355975446
87 -0.075293745 -0.572866020
88 -1.428097142 -0.075293745
89 1.103524865 -1.428097142
90 -0.639350946 1.103524865
91 0.231606702 -0.639350946
92 -0.637825848 0.231606702
93 0.835238387 -0.637825848
94 -3.431947559 0.835238387
95 0.074164786 -3.431947559
96 0.235893367 0.074164786
97 -0.327783902 0.235893367
98 0.451148851 -0.327783902
99 -0.713454699 0.451148851
100 -0.416419280 -0.713454699
101 NA -0.416419280
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.202806884 0.441295290
[2,] 1.380224627 -0.202806884
[3,] -0.089692285 1.380224627
[4,] 0.076536943 -0.089692285
[5,] 0.885939344 0.076536943
[6,] 0.363041059 0.885939344
[7,] 0.666615103 0.363041059
[8,] 0.078090273 0.666615103
[9,] 0.497636251 0.078090273
[10,] -0.111384319 0.497636251
[11,] -0.505481056 -0.111384319
[12,] -0.592988736 -0.505481056
[13,] -0.244137925 -0.592988736
[14,] -1.096301441 -0.244137925
[15,] -2.225522511 -1.096301441
[16,] 0.538867330 -2.225522511
[17,] -0.155424269 0.538867330
[18,] 0.047316977 -0.155424269
[19,] 1.402921641 0.047316977
[20,] -0.268241073 1.402921641
[21,] -0.214894361 -0.268241073
[22,] -0.162193151 -0.214894361
[23,] -1.329085363 -0.162193151
[24,] -0.699270393 -1.329085363
[25,] 0.518419924 -0.699270393
[26,] -0.029876091 0.518419924
[27,] 0.804632526 -0.029876091
[28,] 0.786176454 0.804632526
[29,] -0.154636989 0.786176454
[30,] -0.941807222 -0.154636989
[31,] 1.072660023 -0.941807222
[32,] -0.035566530 1.072660023
[33,] 1.041998290 -0.035566530
[34,] 0.707841229 1.041998290
[35,] -0.125631441 0.707841229
[36,] 1.703518684 -0.125631441
[37,] -0.594237485 1.703518684
[38,] 0.510561265 -0.594237485
[39,] -0.893150525 0.510561265
[40,] 0.141653606 -0.893150525
[41,] -1.857052737 0.141653606
[42,] -0.011737932 -1.857052737
[43,] 0.021614431 -0.011737932
[44,] 0.084642334 0.021614431
[45,] -0.144149852 0.084642334
[46,] -0.292733840 -0.144149852
[47,] 0.915295693 -0.292733840
[48,] 0.153988359 0.915295693
[49,] -0.001296881 0.153988359
[50,] -0.008764679 -0.001296881
[51,] 0.253211207 -0.008764679
[52,] -0.738973027 0.253211207
[53,] -0.136055480 -0.738973027
[54,] -1.079886956 -0.136055480
[55,] -0.005506762 -1.079886956
[56,] 0.326485432 -0.005506762
[57,] -0.203045359 0.326485432
[58,] 0.279069681 -0.203045359
[59,] 0.225499994 0.279069681
[60,] -1.184690688 0.225499994
[61,] 0.905843719 -1.184690688
[62,] -0.797428811 0.905843719
[63,] -0.855267704 -0.797428811
[64,] 1.330135897 -0.855267704
[65,] -0.920449231 1.330135897
[66,] 0.591614058 -0.920449231
[67,] -1.191948621 0.591614058
[68,] 0.470601104 -1.191948621
[69,] 0.299204625 0.470601104
[70,] -0.058481118 0.299204625
[71,] 0.388057383 -0.058481118
[72,] 1.502367277 0.388057383
[73,] -0.183236805 1.502367277
[74,] -0.962408613 -0.183236805
[75,] 0.007462222 -0.962408613
[76,] -0.653014806 0.007462222
[77,] 0.345043513 -0.653014806
[78,] 1.718369241 0.345043513
[79,] 0.808051379 1.718369241
[80,] 1.776013123 0.808051379
[81,] 0.798315478 1.776013123
[82,] 0.019812609 0.798315478
[83,] 0.632669007 0.019812609
[84,] 0.106582973 0.632669007
[85,] -0.355975446 0.106582973
[86,] -0.572866020 -0.355975446
[87,] -0.075293745 -0.572866020
[88,] -1.428097142 -0.075293745
[89,] 1.103524865 -1.428097142
[90,] -0.639350946 1.103524865
[91,] 0.231606702 -0.639350946
[92,] -0.637825848 0.231606702
[93,] 0.835238387 -0.637825848
[94,] -3.431947559 0.835238387
[95,] 0.074164786 -3.431947559
[96,] 0.235893367 0.074164786
[97,] -0.327783902 0.235893367
[98,] 0.451148851 -0.327783902
[99,] -0.713454699 0.451148851
[100,] -0.416419280 -0.713454699
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.202806884 0.441295290
2 1.380224627 -0.202806884
3 -0.089692285 1.380224627
4 0.076536943 -0.089692285
5 0.885939344 0.076536943
6 0.363041059 0.885939344
7 0.666615103 0.363041059
8 0.078090273 0.666615103
9 0.497636251 0.078090273
10 -0.111384319 0.497636251
11 -0.505481056 -0.111384319
12 -0.592988736 -0.505481056
13 -0.244137925 -0.592988736
14 -1.096301441 -0.244137925
15 -2.225522511 -1.096301441
16 0.538867330 -2.225522511
17 -0.155424269 0.538867330
18 0.047316977 -0.155424269
19 1.402921641 0.047316977
20 -0.268241073 1.402921641
21 -0.214894361 -0.268241073
22 -0.162193151 -0.214894361
23 -1.329085363 -0.162193151
24 -0.699270393 -1.329085363
25 0.518419924 -0.699270393
26 -0.029876091 0.518419924
27 0.804632526 -0.029876091
28 0.786176454 0.804632526
29 -0.154636989 0.786176454
30 -0.941807222 -0.154636989
31 1.072660023 -0.941807222
32 -0.035566530 1.072660023
33 1.041998290 -0.035566530
34 0.707841229 1.041998290
35 -0.125631441 0.707841229
36 1.703518684 -0.125631441
37 -0.594237485 1.703518684
38 0.510561265 -0.594237485
39 -0.893150525 0.510561265
40 0.141653606 -0.893150525
41 -1.857052737 0.141653606
42 -0.011737932 -1.857052737
43 0.021614431 -0.011737932
44 0.084642334 0.021614431
45 -0.144149852 0.084642334
46 -0.292733840 -0.144149852
47 0.915295693 -0.292733840
48 0.153988359 0.915295693
49 -0.001296881 0.153988359
50 -0.008764679 -0.001296881
51 0.253211207 -0.008764679
52 -0.738973027 0.253211207
53 -0.136055480 -0.738973027
54 -1.079886956 -0.136055480
55 -0.005506762 -1.079886956
56 0.326485432 -0.005506762
57 -0.203045359 0.326485432
58 0.279069681 -0.203045359
59 0.225499994 0.279069681
60 -1.184690688 0.225499994
61 0.905843719 -1.184690688
62 -0.797428811 0.905843719
63 -0.855267704 -0.797428811
64 1.330135897 -0.855267704
65 -0.920449231 1.330135897
66 0.591614058 -0.920449231
67 -1.191948621 0.591614058
68 0.470601104 -1.191948621
69 0.299204625 0.470601104
70 -0.058481118 0.299204625
71 0.388057383 -0.058481118
72 1.502367277 0.388057383
73 -0.183236805 1.502367277
74 -0.962408613 -0.183236805
75 0.007462222 -0.962408613
76 -0.653014806 0.007462222
77 0.345043513 -0.653014806
78 1.718369241 0.345043513
79 0.808051379 1.718369241
80 1.776013123 0.808051379
81 0.798315478 1.776013123
82 0.019812609 0.798315478
83 0.632669007 0.019812609
84 0.106582973 0.632669007
85 -0.355975446 0.106582973
86 -0.572866020 -0.355975446
87 -0.075293745 -0.572866020
88 -1.428097142 -0.075293745
89 1.103524865 -1.428097142
90 -0.639350946 1.103524865
91 0.231606702 -0.639350946
92 -0.637825848 0.231606702
93 0.835238387 -0.637825848
94 -3.431947559 0.835238387
95 0.074164786 -3.431947559
96 0.235893367 0.074164786
97 -0.327783902 0.235893367
98 0.451148851 -0.327783902
99 -0.713454699 0.451148851
100 -0.416419280 -0.713454699
> 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/freestat/rcomp/tmp/7qqcx1290555959.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/freestat/rcomp/tmp/8qqcx1290555959.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/freestat/rcomp/tmp/9qqcx1290555959.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/freestat/rcomp/tmp/101zc01290555959.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11m0so1290555959.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/freestat/rcomp/tmp/12q09b1290555959.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/freestat/rcomp/tmp/13fjon1290555959.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/freestat/rcomp/tmp/14pb5q1290555959.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/freestat/rcomp/tmp/15bt4e1290555959.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/freestat/rcomp/tmp/167l151290555959.tab")
+ }
>
> try(system("convert tmp/1uyf61290555959.ps tmp/1uyf61290555959.png",intern=TRUE))
character(0)
> try(system("convert tmp/2uyf61290555959.ps tmp/2uyf61290555959.png",intern=TRUE))
character(0)
> try(system("convert tmp/3n7w91290555959.ps tmp/3n7w91290555959.png",intern=TRUE))
character(0)
> try(system("convert tmp/4n7w91290555959.ps tmp/4n7w91290555959.png",intern=TRUE))
character(0)
> try(system("convert tmp/5n7w91290555959.ps tmp/5n7w91290555959.png",intern=TRUE))
character(0)
> try(system("convert tmp/6yhdc1290555959.ps tmp/6yhdc1290555959.png",intern=TRUE))
character(0)
> try(system("convert tmp/7qqcx1290555959.ps tmp/7qqcx1290555959.png",intern=TRUE))
character(0)
> try(system("convert tmp/8qqcx1290555959.ps tmp/8qqcx1290555959.png",intern=TRUE))
character(0)
> try(system("convert tmp/9qqcx1290555959.ps tmp/9qqcx1290555959.png",intern=TRUE))
character(0)
> try(system("convert tmp/101zc01290555959.ps tmp/101zc01290555959.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.330 2.609 5.866