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(2,12,2,11,2,14,1,12,2,21,2,12,2,22,2,11,2,10,2,13,1,10,2,8,1,15,2,14,2,10,1,14,1,14,2,11,1,10,2,13,1,7,2,14,2,12,2,14,1,11,2,9,1,11,2,15,2,14,1,13,2,9,1,15,2,10,2,11,1,13,1,8,1,20,1,12,2,10,1,10,1,9,2,14,1,8,1,14,2,11,2,13,2,9,2,11,2,15,1,11,2,10,1,14,1,18,2,14,1,11,2,12,2,13,2,9,1,10,2,15,1,20,1,12,2,12,2,14,2,13,1,11,2,17,1,12,2,13,1,14,1,13,2,15,2,13,1,10,1,11,2,19,2,13,2,17,1,13,1,9,1,11,1,10,2,9,1,12,2,12,2,13,1,13,2,12,2,15,2,22,2,13,2,15,2,13,2,15,2,10,2,11,2,16,2,11,1,11,1,10,2,10,1,16,2,12,1,11,2,16,1,19,2,11,1,16,1,15,2,24,2,14,2,15,2,11,1,15,2,12,1,10,2,14,2,13,2,9,2,15,2,15,2,14,2,11,2,8,2,11,2,11,1,8,2,10,2,11,2,13,1,11,1,20,2,10,1,15,1,12,2,14,1,23,1,14,2,16,2,11,1,12,2,10,1,14,2,12,1,12,2,11,2,12,1,13,1,11,1,19,2,12,2,17,1,9,2,12,2,19,2,18,2,15,2,14,2,11,2,9,2,18,2,16),dim=c(2,162),dimnames=list(c('x','y'),1:162))
> y <- array(NA,dim=c(2,162),dimnames=list(c('x','y'),1:162))
> 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 = 'Include Monthly Dummies'
> par1 = '2'
> #'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 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 12 2 1 0 0 0 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0 0 1 0 0 0 0 0 0 0 0
112 15 2 0 0 0 1 0 0 0 0 0 0 0
113 11 2 0 0 0 0 1 0 0 0 0 0 0
114 15 1 0 0 0 0 0 1 0 0 0 0 0
115 12 2 0 0 0 0 0 0 1 0 0 0 0
116 10 1 0 0 0 0 0 0 0 1 0 0 0
117 14 2 0 0 0 0 0 0 0 0 1 0 0
118 13 2 0 0 0 0 0 0 0 0 0 1 0
119 9 2 0 0 0 0 0 0 0 0 0 0 1
120 15 2 0 0 0 0 0 0 0 0 0 0 0
121 15 2 1 0 0 0 0 0 0 0 0 0 0
122 14 2 0 1 0 0 0 0 0 0 0 0 0
123 11 2 0 0 1 0 0 0 0 0 0 0 0
124 8 2 0 0 0 1 0 0 0 0 0 0 0
125 11 2 0 0 0 0 1 0 0 0 0 0 0
126 11 2 0 0 0 0 0 1 0 0 0 0 0
127 8 1 0 0 0 0 0 0 1 0 0 0 0
128 10 2 0 0 0 0 0 0 0 1 0 0 0
129 11 2 0 0 0 0 0 0 0 0 1 0 0
130 13 2 0 0 0 0 0 0 0 0 0 1 0
131 11 1 0 0 0 0 0 0 0 0 0 0 1
132 20 1 0 0 0 0 0 0 0 0 0 0 0
133 10 2 1 0 0 0 0 0 0 0 0 0 0
134 15 1 0 1 0 0 0 0 0 0 0 0 0
135 12 1 0 0 1 0 0 0 0 0 0 0 0
136 14 2 0 0 0 1 0 0 0 0 0 0 0
137 23 1 0 0 0 0 1 0 0 0 0 0 0
138 14 1 0 0 0 0 0 1 0 0 0 0 0
139 16 2 0 0 0 0 0 0 1 0 0 0 0
140 11 2 0 0 0 0 0 0 0 1 0 0 0
141 12 1 0 0 0 0 0 0 0 0 1 0 0
142 10 2 0 0 0 0 0 0 0 0 0 1 0
143 14 1 0 0 0 0 0 0 0 0 0 0 1
144 12 2 0 0 0 0 0 0 0 0 0 0 0
145 12 1 1 0 0 0 0 0 0 0 0 0 0
146 11 2 0 1 0 0 0 0 0 0 0 0 0
147 12 2 0 0 1 0 0 0 0 0 0 0 0
148 13 1 0 0 0 1 0 0 0 0 0 0 0
149 11 1 0 0 0 0 1 0 0 0 0 0 0
150 19 1 0 0 0 0 0 1 0 0 0 0 0
151 12 2 0 0 0 0 0 0 1 0 0 0 0
152 17 2 0 0 0 0 0 0 0 1 0 0 0
153 9 1 0 0 0 0 0 0 0 0 1 0 0
154 12 2 0 0 0 0 0 0 0 0 0 1 0
155 19 2 0 0 0 0 0 0 0 0 0 0 1
156 18 2 0 0 0 0 0 0 0 0 0 0 0
157 15 2 1 0 0 0 0 0 0 0 0 0 0
158 14 2 0 1 0 0 0 0 0 0 0 0 0
159 11 2 0 0 1 0 0 0 0 0 0 0 0
160 9 2 0 0 0 1 0 0 0 0 0 0 0
161 18 2 0 0 0 0 1 0 0 0 0 0 0
162 16 2 0 0 0 0 0 1 0 0 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) x M1 M2 M3 M4
12.9138 0.3237 0.9347 -0.5170 -1.8741 -0.6367
M5 M6 M7 M8 M9 M10
0.9116 1.2204 -0.8982 -1.1041 -1.9231 -0.7172
M11
-1.8733
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.5611 -2.0442 -0.3638 1.4290 10.9558
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 12.9138 1.2121 10.654 <2e-16 ***
x 0.3237 0.5062 0.639 0.524
M1 0.9347 1.1925 0.784 0.434
M2 -0.5170 1.1912 -0.434 0.665
M3 -1.8741 1.1912 -1.573 0.118
M4 -0.6367 1.1925 -0.534 0.594
M5 0.9116 1.1912 0.765 0.445
M6 1.2204 1.1925 1.023 0.308
M7 -0.8982 1.2134 -0.740 0.460
M8 -1.1041 1.2153 -0.908 0.365
M9 -1.9231 1.2128 -1.586 0.115
M10 -0.7172 1.2134 -0.591 0.555
M11 -1.8733 1.2153 -1.541 0.125
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.092 on 149 degrees of freedom
Multiple R-squared: 0.1174, Adjusted R-squared: 0.04634
F-statistic: 1.652 on 12 and 149 DF, p-value: 0.08326
> 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.33778083 0.67556166 0.6622192
[2,] 0.62871857 0.74256287 0.3712814
[3,] 0.50167142 0.99665715 0.4983286
[4,] 0.75294475 0.49411049 0.2470552
[5,] 0.67251252 0.65497496 0.3274875
[6,] 0.60338715 0.79322569 0.3966128
[7,] 0.50731787 0.98536426 0.4926821
[8,] 0.43921517 0.87843035 0.5607848
[9,] 0.51545188 0.96909624 0.4845481
[10,] 0.43609067 0.87218134 0.5639093
[11,] 0.43592050 0.87184101 0.5640795
[12,] 0.40107128 0.80214255 0.5989287
[13,] 0.33933101 0.67866201 0.6606690
[14,] 0.39518962 0.79037925 0.6048104
[15,] 0.40725150 0.81450300 0.5927485
[16,] 0.62657327 0.74685347 0.3734267
[17,] 0.64292361 0.71415278 0.3570764
[18,] 0.58447351 0.83105297 0.4155265
[19,] 0.54449642 0.91100715 0.4555036
[20,] 0.50607430 0.98785141 0.4939257
[21,] 0.49326478 0.98652955 0.5067352
[22,] 0.69879397 0.60241207 0.3012060
[23,] 0.65265444 0.69469113 0.3473456
[24,] 0.61092279 0.77815441 0.3890772
[25,] 0.60082865 0.79834271 0.3991714
[26,] 0.71658644 0.56682713 0.2834136
[27,] 0.67448614 0.65102772 0.3255139
[28,] 0.71055842 0.57888315 0.2894416
[29,] 0.67704843 0.64590314 0.3229516
[30,] 0.63336347 0.73327306 0.3666365
[31,] 0.57890186 0.84219628 0.4210981
[32,] 0.57611397 0.84777206 0.4238860
[33,] 0.54245633 0.91508734 0.4575437
[34,] 0.48862877 0.97725754 0.5113712
[35,] 0.44442357 0.88884715 0.5555764
[36,] 0.40416340 0.80832679 0.5958366
[37,] 0.36297395 0.72594791 0.6370260
[38,] 0.39060429 0.78120857 0.6093957
[39,] 0.34924129 0.69848258 0.6507587
[40,] 0.30589630 0.61179260 0.6941037
[41,] 0.26985947 0.53971895 0.7301405
[42,] 0.25520272 0.51040544 0.7447973
[43,] 0.27283509 0.54567018 0.7271649
[44,] 0.23533980 0.47067960 0.7646602
[45,] 0.24388928 0.48777855 0.7561107
[46,] 0.35596297 0.71192594 0.6440370
[47,] 0.31737769 0.63475538 0.6826223
[48,] 0.27496981 0.54993961 0.7250302
[49,] 0.23666781 0.47333562 0.7633322
[50,] 0.21784502 0.43569004 0.7821550
[51,] 0.21450517 0.42901034 0.7854948
[52,] 0.24754584 0.49509167 0.7524542
[53,] 0.20998097 0.41996195 0.7900190
[54,] 0.18906827 0.37813654 0.8109317
[55,] 0.17578132 0.35156265 0.8242187
[56,] 0.15880794 0.31761588 0.8411921
[57,] 0.15128077 0.30256154 0.8487192
[58,] 0.13934387 0.27868774 0.8606561
[59,] 0.13225276 0.26450553 0.8677472
[60,] 0.10872296 0.21744591 0.8912770
[61,] 0.18061934 0.36123867 0.8193807
[62,] 0.16066607 0.32133213 0.8393339
[63,] 0.15986927 0.31973855 0.8401307
[64,] 0.13341930 0.26683860 0.8665807
[65,] 0.13363364 0.26726729 0.8663664
[66,] 0.11307112 0.22614223 0.8869289
[67,] 0.10570118 0.21140236 0.8942988
[68,] 0.10295652 0.20591305 0.8970435
[69,] 0.09353875 0.18707749 0.9064613
[70,] 0.09046502 0.18093003 0.9095350
[71,] 0.07570911 0.15141822 0.9242909
[72,] 0.06530868 0.13061736 0.9346913
[73,] 0.05550255 0.11100510 0.9444975
[74,] 0.04363300 0.08726600 0.9563670
[75,] 0.13030343 0.26060687 0.8696966
[76,] 0.10742729 0.21485458 0.8925727
[77,] 0.10148058 0.20296116 0.8985194
[78,] 0.08539122 0.17078243 0.9146088
[79,] 0.07552704 0.15105408 0.9244730
[80,] 0.06521150 0.13042300 0.9347885
[81,] 0.06808965 0.13617929 0.9319104
[82,] 0.05863700 0.11727400 0.9413630
[83,] 0.05845736 0.11691472 0.9415426
[84,] 0.04642281 0.09284563 0.9535772
[85,] 0.04302377 0.08604754 0.9569762
[86,] 0.05653455 0.11306911 0.9434654
[87,] 0.04686830 0.09373660 0.9531317
[88,] 0.03645387 0.07290774 0.9635461
[89,] 0.02865161 0.05730322 0.9713484
[90,] 0.03801256 0.07602512 0.9619874
[91,] 0.08179538 0.16359076 0.9182046
[92,] 0.06765039 0.13530078 0.9323496
[93,] 0.06420013 0.12840025 0.9357999
[94,] 0.05176734 0.10353468 0.9482327
[95,] 0.35242939 0.70485878 0.6475706
[96,] 0.32871495 0.65742991 0.6712850
[97,] 0.32808414 0.65616829 0.6719159
[98,] 0.35257684 0.70515369 0.6474232
[99,] 0.30425597 0.60851195 0.6957440
[100,] 0.25891442 0.51782884 0.7410856
[101,] 0.24213640 0.48427280 0.7578636
[102,] 0.23764989 0.47529978 0.7623501
[103,] 0.19982752 0.39965504 0.8001725
[104,] 0.22531583 0.45063165 0.7746842
[105,] 0.19483472 0.38966944 0.8051653
[106,] 0.17294530 0.34589059 0.8270547
[107,] 0.13959972 0.27919944 0.8604003
[108,] 0.10985956 0.21971912 0.8901404
[109,] 0.12552287 0.25104573 0.8744771
[110,] 0.17250566 0.34501131 0.8274943
[111,] 0.21635527 0.43271054 0.7836447
[112,] 0.27497731 0.54995462 0.7250227
[113,] 0.27435851 0.54871702 0.7256415
[114,] 0.22341950 0.44683900 0.7765805
[115,] 0.18557696 0.37115393 0.8144230
[116,] 0.22456369 0.44912737 0.7754363
[117,] 0.28723878 0.57447756 0.7127612
[118,] 0.29010015 0.58020031 0.7098998
[119,] 0.26381486 0.52762973 0.7361851
[120,] 0.21116972 0.42233944 0.7888303
[121,] 0.17555491 0.35110983 0.8244451
[122,] 0.52550700 0.94898600 0.4744930
[123,] 0.47447539 0.94895077 0.5255246
[124,] 0.45984841 0.91969683 0.5401516
[125,] 0.53308877 0.93382246 0.4669112
[126,] 0.47503732 0.95007463 0.5249627
[127,] 0.39262122 0.78524243 0.6073788
[128,] 0.36015714 0.72031428 0.6398429
[129,] 0.44500973 0.89001947 0.5549903
[130,] 0.35270331 0.70540662 0.6472967
[131,] 0.26667199 0.53334398 0.7333280
> postscript(file="/var/www/html/rcomp/tmp/10n4k1291124741.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/20n4k1291124741.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/3seln1291124741.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/4seln1291124741.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/5seln1291124741.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 = 162
Frequency = 1
1 2 3 4 5 6 7
-2.4958559 -2.0441656 2.3129773 -0.6007636 6.5272630 -2.7815701 9.3370524
8 9 10 11 12 13 14
-1.4570755 -1.6380504 0.1560776 -1.3641811 -5.5611273 0.8278078 0.9558344
15 16 17 18 19 20 21
-1.6870227 1.3992364 -0.1490734 -3.7815701 -2.3392839 0.5429245 -4.3143867
22 23 24 25 26 27 28
1.1560776 0.3121552 0.4388727 -3.1721922 -4.0441656 -0.3633591 2.0755727
29 30 31 32 33 34 35
-0.4727370 -1.4579065 -3.6629476 2.8665881 -1.6380504 -1.8439224 1.6358189
36 37 38 39 40 41 42
-5.2374636 5.8278078 -0.7205019 -1.6870227 -2.6007636 -5.1490734 -0.7815701
43 44 45 46 47 48 49
-4.3392839 1.8665881 -0.6380504 0.1560776 -2.6878448 -2.5611273 0.5041441
50 51 52 53 54 55 56
-1.7205019 -1.6870227 1.3992364 3.8509266 -0.7815701 -1.3392839 -0.4570755
57 58 59 60 61 62 63
1.3619496 -3.8439224 -1.3641811 1.4388727 5.8278078 -0.7205019 0.3129773
64 65 66 67 68 69 70
1.0755727 -1.4727370 -3.4579065 4.3370524 -0.1334119 1.3619496 1.4797413
71 72 73 74 75 76 77
1.6358189 1.4388727 -1.4958559 -2.7205019 -0.3633591 6.0755727 -1.4727370
78 79 80 81 82 83 84
2.2184299 0.6607161 -3.1334119 -0.3143867 -2.5202587 -2.6878448 -1.2374636
85 86 87 88 89 90 91
-2.4958559 -0.0441656 1.6366409 -0.9244273 0.5272630 7.2184299 0.3370524
92 93 94 95 96 97 98
2.5429245 1.3619496 2.1560776 -1.6878448 -2.5611273 1.5041441 -2.0441656
99 100 101 102 103 104 105
-0.3633591 -2.6007636 -4.4727370 1.5420935 -0.6629476 -1.1334119 4.3619496
106 107 108 109 110 111 112
6.4797413 -0.6878448 2.7625364 0.8278078 10.9558344 2.3129773 2.0755727
113 114 115 116 117 118 119
-3.4727370 0.5420935 -0.6629476 -2.1334119 2.3619496 0.1560776 -2.6878448
120 121 122 123 124 125 126
1.4388727 0.5041441 0.9558344 -0.6870227 -4.9244273 -3.4727370 -3.7815701
127 128 129 130 131 132 133
-4.3392839 -2.4570755 -0.6380504 0.1560776 -0.3641811 6.7625364 -4.4958559
134 135 136 137 138 139 140
2.2794981 0.6366409 1.0755727 8.8509266 -0.4579065 3.3370524 -1.4570755
141 142 143 144 145 146 147
0.6856133 -2.8439224 2.6358189 -1.5611273 -2.1721922 -2.0441656 0.3129773
148 149 150 151 152 153 154
0.3992364 -3.1490734 4.5420935 -0.6629476 4.5429245 -2.3143867 -0.8439224
155 156 157 158 159 160 161
7.3121552 4.4388727 0.5041441 0.9558344 -0.6870227 -3.9244273 3.5272630
162
1.2184299
> postscript(file="/var/www/html/rcomp/tmp/63nk81291124741.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 = 162
Frequency = 1
lag(myerror, k = 1) myerror
0 -2.4958559 NA
1 -2.0441656 -2.4958559
2 2.3129773 -2.0441656
3 -0.6007636 2.3129773
4 6.5272630 -0.6007636
5 -2.7815701 6.5272630
6 9.3370524 -2.7815701
7 -1.4570755 9.3370524
8 -1.6380504 -1.4570755
9 0.1560776 -1.6380504
10 -1.3641811 0.1560776
11 -5.5611273 -1.3641811
12 0.8278078 -5.5611273
13 0.9558344 0.8278078
14 -1.6870227 0.9558344
15 1.3992364 -1.6870227
16 -0.1490734 1.3992364
17 -3.7815701 -0.1490734
18 -2.3392839 -3.7815701
19 0.5429245 -2.3392839
20 -4.3143867 0.5429245
21 1.1560776 -4.3143867
22 0.3121552 1.1560776
23 0.4388727 0.3121552
24 -3.1721922 0.4388727
25 -4.0441656 -3.1721922
26 -0.3633591 -4.0441656
27 2.0755727 -0.3633591
28 -0.4727370 2.0755727
29 -1.4579065 -0.4727370
30 -3.6629476 -1.4579065
31 2.8665881 -3.6629476
32 -1.6380504 2.8665881
33 -1.8439224 -1.6380504
34 1.6358189 -1.8439224
35 -5.2374636 1.6358189
36 5.8278078 -5.2374636
37 -0.7205019 5.8278078
38 -1.6870227 -0.7205019
39 -2.6007636 -1.6870227
40 -5.1490734 -2.6007636
41 -0.7815701 -5.1490734
42 -4.3392839 -0.7815701
43 1.8665881 -4.3392839
44 -0.6380504 1.8665881
45 0.1560776 -0.6380504
46 -2.6878448 0.1560776
47 -2.5611273 -2.6878448
48 0.5041441 -2.5611273
49 -1.7205019 0.5041441
50 -1.6870227 -1.7205019
51 1.3992364 -1.6870227
52 3.8509266 1.3992364
53 -0.7815701 3.8509266
54 -1.3392839 -0.7815701
55 -0.4570755 -1.3392839
56 1.3619496 -0.4570755
57 -3.8439224 1.3619496
58 -1.3641811 -3.8439224
59 1.4388727 -1.3641811
60 5.8278078 1.4388727
61 -0.7205019 5.8278078
62 0.3129773 -0.7205019
63 1.0755727 0.3129773
64 -1.4727370 1.0755727
65 -3.4579065 -1.4727370
66 4.3370524 -3.4579065
67 -0.1334119 4.3370524
68 1.3619496 -0.1334119
69 1.4797413 1.3619496
70 1.6358189 1.4797413
71 1.4388727 1.6358189
72 -1.4958559 1.4388727
73 -2.7205019 -1.4958559
74 -0.3633591 -2.7205019
75 6.0755727 -0.3633591
76 -1.4727370 6.0755727
77 2.2184299 -1.4727370
78 0.6607161 2.2184299
79 -3.1334119 0.6607161
80 -0.3143867 -3.1334119
81 -2.5202587 -0.3143867
82 -2.6878448 -2.5202587
83 -1.2374636 -2.6878448
84 -2.4958559 -1.2374636
85 -0.0441656 -2.4958559
86 1.6366409 -0.0441656
87 -0.9244273 1.6366409
88 0.5272630 -0.9244273
89 7.2184299 0.5272630
90 0.3370524 7.2184299
91 2.5429245 0.3370524
92 1.3619496 2.5429245
93 2.1560776 1.3619496
94 -1.6878448 2.1560776
95 -2.5611273 -1.6878448
96 1.5041441 -2.5611273
97 -2.0441656 1.5041441
98 -0.3633591 -2.0441656
99 -2.6007636 -0.3633591
100 -4.4727370 -2.6007636
101 1.5420935 -4.4727370
102 -0.6629476 1.5420935
103 -1.1334119 -0.6629476
104 4.3619496 -1.1334119
105 6.4797413 4.3619496
106 -0.6878448 6.4797413
107 2.7625364 -0.6878448
108 0.8278078 2.7625364
109 10.9558344 0.8278078
110 2.3129773 10.9558344
111 2.0755727 2.3129773
112 -3.4727370 2.0755727
113 0.5420935 -3.4727370
114 -0.6629476 0.5420935
115 -2.1334119 -0.6629476
116 2.3619496 -2.1334119
117 0.1560776 2.3619496
118 -2.6878448 0.1560776
119 1.4388727 -2.6878448
120 0.5041441 1.4388727
121 0.9558344 0.5041441
122 -0.6870227 0.9558344
123 -4.9244273 -0.6870227
124 -3.4727370 -4.9244273
125 -3.7815701 -3.4727370
126 -4.3392839 -3.7815701
127 -2.4570755 -4.3392839
128 -0.6380504 -2.4570755
129 0.1560776 -0.6380504
130 -0.3641811 0.1560776
131 6.7625364 -0.3641811
132 -4.4958559 6.7625364
133 2.2794981 -4.4958559
134 0.6366409 2.2794981
135 1.0755727 0.6366409
136 8.8509266 1.0755727
137 -0.4579065 8.8509266
138 3.3370524 -0.4579065
139 -1.4570755 3.3370524
140 0.6856133 -1.4570755
141 -2.8439224 0.6856133
142 2.6358189 -2.8439224
143 -1.5611273 2.6358189
144 -2.1721922 -1.5611273
145 -2.0441656 -2.1721922
146 0.3129773 -2.0441656
147 0.3992364 0.3129773
148 -3.1490734 0.3992364
149 4.5420935 -3.1490734
150 -0.6629476 4.5420935
151 4.5429245 -0.6629476
152 -2.3143867 4.5429245
153 -0.8439224 -2.3143867
154 7.3121552 -0.8439224
155 4.4388727 7.3121552
156 0.5041441 4.4388727
157 0.9558344 0.5041441
158 -0.6870227 0.9558344
159 -3.9244273 -0.6870227
160 3.5272630 -3.9244273
161 1.2184299 3.5272630
162 NA 1.2184299
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.0441656 -2.4958559
[2,] 2.3129773 -2.0441656
[3,] -0.6007636 2.3129773
[4,] 6.5272630 -0.6007636
[5,] -2.7815701 6.5272630
[6,] 9.3370524 -2.7815701
[7,] -1.4570755 9.3370524
[8,] -1.6380504 -1.4570755
[9,] 0.1560776 -1.6380504
[10,] -1.3641811 0.1560776
[11,] -5.5611273 -1.3641811
[12,] 0.8278078 -5.5611273
[13,] 0.9558344 0.8278078
[14,] -1.6870227 0.9558344
[15,] 1.3992364 -1.6870227
[16,] -0.1490734 1.3992364
[17,] -3.7815701 -0.1490734
[18,] -2.3392839 -3.7815701
[19,] 0.5429245 -2.3392839
[20,] -4.3143867 0.5429245
[21,] 1.1560776 -4.3143867
[22,] 0.3121552 1.1560776
[23,] 0.4388727 0.3121552
[24,] -3.1721922 0.4388727
[25,] -4.0441656 -3.1721922
[26,] -0.3633591 -4.0441656
[27,] 2.0755727 -0.3633591
[28,] -0.4727370 2.0755727
[29,] -1.4579065 -0.4727370
[30,] -3.6629476 -1.4579065
[31,] 2.8665881 -3.6629476
[32,] -1.6380504 2.8665881
[33,] -1.8439224 -1.6380504
[34,] 1.6358189 -1.8439224
[35,] -5.2374636 1.6358189
[36,] 5.8278078 -5.2374636
[37,] -0.7205019 5.8278078
[38,] -1.6870227 -0.7205019
[39,] -2.6007636 -1.6870227
[40,] -5.1490734 -2.6007636
[41,] -0.7815701 -5.1490734
[42,] -4.3392839 -0.7815701
[43,] 1.8665881 -4.3392839
[44,] -0.6380504 1.8665881
[45,] 0.1560776 -0.6380504
[46,] -2.6878448 0.1560776
[47,] -2.5611273 -2.6878448
[48,] 0.5041441 -2.5611273
[49,] -1.7205019 0.5041441
[50,] -1.6870227 -1.7205019
[51,] 1.3992364 -1.6870227
[52,] 3.8509266 1.3992364
[53,] -0.7815701 3.8509266
[54,] -1.3392839 -0.7815701
[55,] -0.4570755 -1.3392839
[56,] 1.3619496 -0.4570755
[57,] -3.8439224 1.3619496
[58,] -1.3641811 -3.8439224
[59,] 1.4388727 -1.3641811
[60,] 5.8278078 1.4388727
[61,] -0.7205019 5.8278078
[62,] 0.3129773 -0.7205019
[63,] 1.0755727 0.3129773
[64,] -1.4727370 1.0755727
[65,] -3.4579065 -1.4727370
[66,] 4.3370524 -3.4579065
[67,] -0.1334119 4.3370524
[68,] 1.3619496 -0.1334119
[69,] 1.4797413 1.3619496
[70,] 1.6358189 1.4797413
[71,] 1.4388727 1.6358189
[72,] -1.4958559 1.4388727
[73,] -2.7205019 -1.4958559
[74,] -0.3633591 -2.7205019
[75,] 6.0755727 -0.3633591
[76,] -1.4727370 6.0755727
[77,] 2.2184299 -1.4727370
[78,] 0.6607161 2.2184299
[79,] -3.1334119 0.6607161
[80,] -0.3143867 -3.1334119
[81,] -2.5202587 -0.3143867
[82,] -2.6878448 -2.5202587
[83,] -1.2374636 -2.6878448
[84,] -2.4958559 -1.2374636
[85,] -0.0441656 -2.4958559
[86,] 1.6366409 -0.0441656
[87,] -0.9244273 1.6366409
[88,] 0.5272630 -0.9244273
[89,] 7.2184299 0.5272630
[90,] 0.3370524 7.2184299
[91,] 2.5429245 0.3370524
[92,] 1.3619496 2.5429245
[93,] 2.1560776 1.3619496
[94,] -1.6878448 2.1560776
[95,] -2.5611273 -1.6878448
[96,] 1.5041441 -2.5611273
[97,] -2.0441656 1.5041441
[98,] -0.3633591 -2.0441656
[99,] -2.6007636 -0.3633591
[100,] -4.4727370 -2.6007636
[101,] 1.5420935 -4.4727370
[102,] -0.6629476 1.5420935
[103,] -1.1334119 -0.6629476
[104,] 4.3619496 -1.1334119
[105,] 6.4797413 4.3619496
[106,] -0.6878448 6.4797413
[107,] 2.7625364 -0.6878448
[108,] 0.8278078 2.7625364
[109,] 10.9558344 0.8278078
[110,] 2.3129773 10.9558344
[111,] 2.0755727 2.3129773
[112,] -3.4727370 2.0755727
[113,] 0.5420935 -3.4727370
[114,] -0.6629476 0.5420935
[115,] -2.1334119 -0.6629476
[116,] 2.3619496 -2.1334119
[117,] 0.1560776 2.3619496
[118,] -2.6878448 0.1560776
[119,] 1.4388727 -2.6878448
[120,] 0.5041441 1.4388727
[121,] 0.9558344 0.5041441
[122,] -0.6870227 0.9558344
[123,] -4.9244273 -0.6870227
[124,] -3.4727370 -4.9244273
[125,] -3.7815701 -3.4727370
[126,] -4.3392839 -3.7815701
[127,] -2.4570755 -4.3392839
[128,] -0.6380504 -2.4570755
[129,] 0.1560776 -0.6380504
[130,] -0.3641811 0.1560776
[131,] 6.7625364 -0.3641811
[132,] -4.4958559 6.7625364
[133,] 2.2794981 -4.4958559
[134,] 0.6366409 2.2794981
[135,] 1.0755727 0.6366409
[136,] 8.8509266 1.0755727
[137,] -0.4579065 8.8509266
[138,] 3.3370524 -0.4579065
[139,] -1.4570755 3.3370524
[140,] 0.6856133 -1.4570755
[141,] -2.8439224 0.6856133
[142,] 2.6358189 -2.8439224
[143,] -1.5611273 2.6358189
[144,] -2.1721922 -1.5611273
[145,] -2.0441656 -2.1721922
[146,] 0.3129773 -2.0441656
[147,] 0.3992364 0.3129773
[148,] -3.1490734 0.3992364
[149,] 4.5420935 -3.1490734
[150,] -0.6629476 4.5420935
[151,] 4.5429245 -0.6629476
[152,] -2.3143867 4.5429245
[153,] -0.8439224 -2.3143867
[154,] 7.3121552 -0.8439224
[155,] 4.4388727 7.3121552
[156,] 0.5041441 4.4388727
[157,] 0.9558344 0.5041441
[158,] -0.6870227 0.9558344
[159,] -3.9244273 -0.6870227
[160,] 3.5272630 -3.9244273
[161,] 1.2184299 3.5272630
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.0441656 -2.4958559
2 2.3129773 -2.0441656
3 -0.6007636 2.3129773
4 6.5272630 -0.6007636
5 -2.7815701 6.5272630
6 9.3370524 -2.7815701
7 -1.4570755 9.3370524
8 -1.6380504 -1.4570755
9 0.1560776 -1.6380504
10 -1.3641811 0.1560776
11 -5.5611273 -1.3641811
12 0.8278078 -5.5611273
13 0.9558344 0.8278078
14 -1.6870227 0.9558344
15 1.3992364 -1.6870227
16 -0.1490734 1.3992364
17 -3.7815701 -0.1490734
18 -2.3392839 -3.7815701
19 0.5429245 -2.3392839
20 -4.3143867 0.5429245
21 1.1560776 -4.3143867
22 0.3121552 1.1560776
23 0.4388727 0.3121552
24 -3.1721922 0.4388727
25 -4.0441656 -3.1721922
26 -0.3633591 -4.0441656
27 2.0755727 -0.3633591
28 -0.4727370 2.0755727
29 -1.4579065 -0.4727370
30 -3.6629476 -1.4579065
31 2.8665881 -3.6629476
32 -1.6380504 2.8665881
33 -1.8439224 -1.6380504
34 1.6358189 -1.8439224
35 -5.2374636 1.6358189
36 5.8278078 -5.2374636
37 -0.7205019 5.8278078
38 -1.6870227 -0.7205019
39 -2.6007636 -1.6870227
40 -5.1490734 -2.6007636
41 -0.7815701 -5.1490734
42 -4.3392839 -0.7815701
43 1.8665881 -4.3392839
44 -0.6380504 1.8665881
45 0.1560776 -0.6380504
46 -2.6878448 0.1560776
47 -2.5611273 -2.6878448
48 0.5041441 -2.5611273
49 -1.7205019 0.5041441
50 -1.6870227 -1.7205019
51 1.3992364 -1.6870227
52 3.8509266 1.3992364
53 -0.7815701 3.8509266
54 -1.3392839 -0.7815701
55 -0.4570755 -1.3392839
56 1.3619496 -0.4570755
57 -3.8439224 1.3619496
58 -1.3641811 -3.8439224
59 1.4388727 -1.3641811
60 5.8278078 1.4388727
61 -0.7205019 5.8278078
62 0.3129773 -0.7205019
63 1.0755727 0.3129773
64 -1.4727370 1.0755727
65 -3.4579065 -1.4727370
66 4.3370524 -3.4579065
67 -0.1334119 4.3370524
68 1.3619496 -0.1334119
69 1.4797413 1.3619496
70 1.6358189 1.4797413
71 1.4388727 1.6358189
72 -1.4958559 1.4388727
73 -2.7205019 -1.4958559
74 -0.3633591 -2.7205019
75 6.0755727 -0.3633591
76 -1.4727370 6.0755727
77 2.2184299 -1.4727370
78 0.6607161 2.2184299
79 -3.1334119 0.6607161
80 -0.3143867 -3.1334119
81 -2.5202587 -0.3143867
82 -2.6878448 -2.5202587
83 -1.2374636 -2.6878448
84 -2.4958559 -1.2374636
85 -0.0441656 -2.4958559
86 1.6366409 -0.0441656
87 -0.9244273 1.6366409
88 0.5272630 -0.9244273
89 7.2184299 0.5272630
90 0.3370524 7.2184299
91 2.5429245 0.3370524
92 1.3619496 2.5429245
93 2.1560776 1.3619496
94 -1.6878448 2.1560776
95 -2.5611273 -1.6878448
96 1.5041441 -2.5611273
97 -2.0441656 1.5041441
98 -0.3633591 -2.0441656
99 -2.6007636 -0.3633591
100 -4.4727370 -2.6007636
101 1.5420935 -4.4727370
102 -0.6629476 1.5420935
103 -1.1334119 -0.6629476
104 4.3619496 -1.1334119
105 6.4797413 4.3619496
106 -0.6878448 6.4797413
107 2.7625364 -0.6878448
108 0.8278078 2.7625364
109 10.9558344 0.8278078
110 2.3129773 10.9558344
111 2.0755727 2.3129773
112 -3.4727370 2.0755727
113 0.5420935 -3.4727370
114 -0.6629476 0.5420935
115 -2.1334119 -0.6629476
116 2.3619496 -2.1334119
117 0.1560776 2.3619496
118 -2.6878448 0.1560776
119 1.4388727 -2.6878448
120 0.5041441 1.4388727
121 0.9558344 0.5041441
122 -0.6870227 0.9558344
123 -4.9244273 -0.6870227
124 -3.4727370 -4.9244273
125 -3.7815701 -3.4727370
126 -4.3392839 -3.7815701
127 -2.4570755 -4.3392839
128 -0.6380504 -2.4570755
129 0.1560776 -0.6380504
130 -0.3641811 0.1560776
131 6.7625364 -0.3641811
132 -4.4958559 6.7625364
133 2.2794981 -4.4958559
134 0.6366409 2.2794981
135 1.0755727 0.6366409
136 8.8509266 1.0755727
137 -0.4579065 8.8509266
138 3.3370524 -0.4579065
139 -1.4570755 3.3370524
140 0.6856133 -1.4570755
141 -2.8439224 0.6856133
142 2.6358189 -2.8439224
143 -1.5611273 2.6358189
144 -2.1721922 -1.5611273
145 -2.0441656 -2.1721922
146 0.3129773 -2.0441656
147 0.3992364 0.3129773
148 -3.1490734 0.3992364
149 4.5420935 -3.1490734
150 -0.6629476 4.5420935
151 4.5429245 -0.6629476
152 -2.3143867 4.5429245
153 -0.8439224 -2.3143867
154 7.3121552 -0.8439224
155 4.4388727 7.3121552
156 0.5041441 4.4388727
157 0.9558344 0.5041441
158 -0.6870227 0.9558344
159 -3.9244273 -0.6870227
160 3.5272630 -3.9244273
161 1.2184299 3.5272630
> 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/73nk81291124741.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/8ee1s1291124741.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/9ee1s1291124741.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/1076je1291124741.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/11s6z11291124741.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/12vpx71291124741.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/13rgvg1291124741.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/14vzc41291124741.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/15yits1291124741.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/1620ry1291124741.tab")
+ }
>
> try(system("convert tmp/10n4k1291124741.ps tmp/10n4k1291124741.png",intern=TRUE))
character(0)
> try(system("convert tmp/20n4k1291124741.ps tmp/20n4k1291124741.png",intern=TRUE))
character(0)
> try(system("convert tmp/3seln1291124741.ps tmp/3seln1291124741.png",intern=TRUE))
character(0)
> try(system("convert tmp/4seln1291124741.ps tmp/4seln1291124741.png",intern=TRUE))
character(0)
> try(system("convert tmp/5seln1291124741.ps tmp/5seln1291124741.png",intern=TRUE))
character(0)
> try(system("convert tmp/63nk81291124741.ps tmp/63nk81291124741.png",intern=TRUE))
character(0)
> try(system("convert tmp/73nk81291124741.ps tmp/73nk81291124741.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ee1s1291124741.ps tmp/8ee1s1291124741.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ee1s1291124741.ps tmp/9ee1s1291124741.png",intern=TRUE))
character(0)
> try(system("convert tmp/1076je1291124741.ps tmp/1076je1291124741.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.037 1.817 9.801