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,14,2,18,2,11,1,12,2,16,2,18,2,14,2,14,2,15,2,15,1,17,2,19,1,10,2,16,2,18,1,14,1,14,2,17,1,14,2,16,1,18,2,11,2,14,2,12,1,17,2,9,1,16,2,14,2,15,1,11,2,16,1,13,2,17,2,15,1,14,1,16,1,9,1,15,2,17,1,13,1,15,2,16,1,16,1,12,2,12,2,11,2,15,2,15,2,17,1,13,2,16,1,14,1,11,2,12,1,12,2,15,2,16,2,15,1,12,2,12,1,8,1,13,2,11,2,14,2,15,1,10,2,11,1,12,2,15,1,15,1,14,2,16,2,15,1,15,1,13,2,12,2,17,2,13,1,15,1,13,1,15,1,16,2,15,1,16,2,15,2,14,1,15,2,14,2,13,2,7,2,17,2,13,2,15,2,14,2,13,2,16,2,12,2,14,1,17,1,15,2,17,1,12,2,16,1,11,2,15,1,9,2,16,1,15,1,10,2,10,2,15,2,11,2,13,1,14,2,18,1,16,2,14,2,14,2,14,2,14,2,12,2,14,2,15,2,15,2,15,2,13,1,17,2,17,2,19,2,15,1,13,1,9,2,15,1,15,1,15,2,16,1,11,1,14,2,11,2,15,1,13,2,15,1,16,2,14,1,15,2,16,2,16,1,11,1,12,1,9,2,16,2,13,1,16,2,12,2,9,2,13,2,13,2,14,2,19,2,13,2,12,2,13),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])
+ }
+ }
> par20 = ''
> par19 = ''
> par18 = ''
> par17 = ''
> par16 = ''
> par15 = ''
> par14 = ''
> par13 = ''
> par12 = ''
> par11 = ''
> par10 = ''
> par9 = ''
> par8 = ''
> par7 = ''
> par6 = ''
> par5 = ''
> par4 = ''
> par3 = 'No Linear Trend'
> par2 = 'Include Monthly Dummies'
> par1 = '2'
> ylab = ''
> xlab = ''
> main = ''
> #'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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0 0 0 1 0 0
106 9 1 0 0 0 0 0 0 0 0 0 1 0
107 16 2 0 0 0 0 0 0 0 0 0 0 1
108 15 1 0 0 0 0 0 0 0 0 0 0 0
109 10 1 1 0 0 0 0 0 0 0 0 0 0
110 10 2 0 1 0 0 0 0 0 0 0 0 0
111 15 2 0 0 1 0 0 0 0 0 0 0 0
112 11 2 0 0 0 1 0 0 0 0 0 0 0
113 13 2 0 0 0 0 1 0 0 0 0 0 0
114 14 1 0 0 0 0 0 1 0 0 0 0 0
115 18 2 0 0 0 0 0 0 1 0 0 0 0
116 16 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 14 2 0 0 0 0 0 0 0 0 0 1 0
119 14 2 0 0 0 0 0 0 0 0 0 0 1
120 14 2 0 0 0 0 0 0 0 0 0 0 0
121 12 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 15 2 0 0 1 0 0 0 0 0 0 0 0
124 15 2 0 0 0 1 0 0 0 0 0 0 0
125 15 2 0 0 0 0 1 0 0 0 0 0 0
126 13 2 0 0 0 0 0 1 0 0 0 0 0
127 17 1 0 0 0 0 0 0 1 0 0 0 0
128 17 2 0 0 0 0 0 0 0 1 0 0 0
129 19 2 0 0 0 0 0 0 0 0 1 0 0
130 15 2 0 0 0 0 0 0 0 0 0 1 0
131 13 1 0 0 0 0 0 0 0 0 0 0 1
132 9 1 0 0 0 0 0 0 0 0 0 0 0
133 15 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 15 1 0 0 1 0 0 0 0 0 0 0 0
136 16 2 0 0 0 1 0 0 0 0 0 0 0
137 11 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 11 2 0 0 0 0 0 0 1 0 0 0 0
140 15 2 0 0 0 0 0 0 0 1 0 0 0
141 13 1 0 0 0 0 0 0 0 0 1 0 0
142 15 2 0 0 0 0 0 0 0 0 0 1 0
143 16 1 0 0 0 0 0 0 0 0 0 0 1
144 14 2 0 0 0 0 0 0 0 0 0 0 0
145 15 1 1 0 0 0 0 0 0 0 0 0 0
146 16 2 0 1 0 0 0 0 0 0 0 0 0
147 16 2 0 0 1 0 0 0 0 0 0 0 0
148 11 1 0 0 0 1 0 0 0 0 0 0 0
149 12 1 0 0 0 0 1 0 0 0 0 0 0
150 9 1 0 0 0 0 0 1 0 0 0 0 0
151 16 2 0 0 0 0 0 0 1 0 0 0 0
152 13 2 0 0 0 0 0 0 0 1 0 0 0
153 16 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 9 2 0 0 0 0 0 0 0 0 0 0 1
156 13 2 0 0 0 0 0 0 0 0 0 0 0
157 13 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 19 2 0 0 1 0 0 0 0 0 0 0 0
160 13 2 0 0 0 1 0 0 0 0 0 0 0
161 12 2 0 0 0 0 1 0 0 0 0 0 0
162 13 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
13.0265 0.8025 -1.2876 -0.3449 0.9408 -0.8590
M5 M6 M7 M8 M9 M10
-0.3449 -1.5019 0.5233 -0.4150 1.0000 -0.8310
M11
-0.2611
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.1297 -1.3397 0.2275 1.5159 4.8703
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 13.0265 0.8826 14.760 <2e-16 ***
x 0.8025 0.3686 2.177 0.0310 *
M1 -1.2876 0.8683 -1.483 0.1402
M2 -0.3449 0.8673 -0.398 0.6914
M3 0.9408 0.8673 1.085 0.2798
M4 -0.8590 0.8683 -0.989 0.3241
M5 -0.3449 0.8673 -0.398 0.6914
M6 -1.5019 0.8683 -1.730 0.0858 .
M7 0.5233 0.8835 0.592 0.5546
M8 -0.4150 0.8849 -0.469 0.6398
M9 1.0000 0.8831 1.132 0.2593
M10 -0.8310 0.8835 -0.941 0.3485
M11 -0.2611 0.8849 -0.295 0.7683
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.251 on 149 degrees of freedom
Multiple R-squared: 0.1416, Adjusted R-squared: 0.07244
F-statistic: 2.048 on 12 and 149 DF, p-value: 0.02382
> 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.8822039 0.23559225 0.117796123
[2,] 0.8051346 0.38973081 0.194865407
[3,] 0.7248172 0.55036567 0.275182837
[4,] 0.6723384 0.65532312 0.327661558
[5,] 0.6068247 0.78635052 0.393175258
[6,] 0.6872652 0.62546962 0.312734812
[7,] 0.7293328 0.54133434 0.270667172
[8,] 0.7255991 0.54880186 0.274400930
[9,] 0.8936575 0.21268510 0.106342549
[10,] 0.9435267 0.11294667 0.056473336
[11,] 0.9948108 0.01037847 0.005189237
[12,] 0.9916754 0.01664910 0.008324552
[13,] 0.9878714 0.02425725 0.012128626
[14,] 0.9813128 0.03737433 0.018687163
[15,] 0.9934818 0.01303638 0.006518190
[16,] 0.9907751 0.01844978 0.009224889
[17,] 0.9865832 0.02683362 0.013416811
[18,] 0.9807247 0.03855054 0.019275271
[19,] 0.9754278 0.04914431 0.024572154
[20,] 0.9662292 0.06754159 0.033770796
[21,] 0.9582983 0.08340348 0.041701740
[22,] 0.9730567 0.05388657 0.026943284
[23,] 0.9658316 0.06833673 0.034168367
[24,] 0.9580649 0.08387012 0.041935062
[25,] 0.9430484 0.11390321 0.056951604
[26,] 0.9282123 0.14357544 0.071787719
[27,] 0.9220486 0.15590272 0.077951359
[28,] 0.9098466 0.18030689 0.090153444
[29,] 0.8959336 0.20813275 0.104066376
[30,] 0.9357683 0.12846332 0.064231658
[31,] 0.9384873 0.12302539 0.061512693
[32,] 0.9214312 0.15713761 0.078568804
[33,] 0.9018646 0.19627087 0.098135437
[34,] 0.9304998 0.13900044 0.069500218
[35,] 0.9124074 0.17518524 0.087592620
[36,] 0.8897764 0.22044729 0.110223645
[37,] 0.8675571 0.26488575 0.132442874
[38,] 0.8811929 0.23761426 0.118807131
[39,] 0.8887751 0.22244985 0.111224923
[40,] 0.8883167 0.22336652 0.111683258
[41,] 0.8645673 0.27086534 0.135432671
[42,] 0.8351454 0.32970925 0.164854623
[43,] 0.8162801 0.36743980 0.183719899
[44,] 0.8045822 0.39083564 0.195417822
[45,] 0.8257542 0.34849158 0.174245790
[46,] 0.9021760 0.19564792 0.097823961
[47,] 0.8798378 0.24032446 0.120162232
[48,] 0.9349430 0.13011402 0.065057009
[49,] 0.9180716 0.16385675 0.081928377
[50,] 0.8996253 0.20074944 0.100374718
[51,] 0.9076658 0.18466835 0.092334173
[52,] 0.9452324 0.10953517 0.054767584
[53,] 0.9358014 0.12839711 0.064198555
[54,] 0.9202691 0.15946174 0.079730870
[55,] 0.9176863 0.16462743 0.082313714
[56,] 0.8983457 0.20330861 0.101654304
[57,] 0.8838619 0.23227624 0.116138121
[58,] 0.8709837 0.25803270 0.129016349
[59,] 0.8554899 0.28902025 0.144510123
[60,] 0.8459298 0.30814036 0.154070182
[61,] 0.8355100 0.32897992 0.164489961
[62,] 0.8489440 0.30211190 0.151055951
[63,] 0.8258791 0.34824185 0.174120927
[64,] 0.8008808 0.39823839 0.199119196
[65,] 0.7674947 0.46501065 0.232505325
[66,] 0.7290220 0.54195596 0.270977981
[67,] 0.7565186 0.48696283 0.243481416
[68,] 0.7229836 0.55403289 0.277016445
[69,] 0.7231497 0.55370069 0.276850346
[70,] 0.7045176 0.59096473 0.295482363
[71,] 0.6623234 0.67535311 0.337676555
[72,] 0.6226128 0.75477446 0.377387232
[73,] 0.5757725 0.84845504 0.424227518
[74,] 0.5438313 0.91233741 0.456168707
[75,] 0.7994306 0.40113882 0.200569412
[76,] 0.7841063 0.43178746 0.215893731
[77,] 0.7603558 0.47928849 0.239644244
[78,] 0.7235172 0.55296564 0.276482818
[79,] 0.6834026 0.63319484 0.316597420
[80,] 0.6517586 0.69648289 0.348241443
[81,] 0.6387580 0.72248400 0.361242001
[82,] 0.6061316 0.78773678 0.393868388
[83,] 0.5575683 0.88486332 0.442431662
[84,] 0.5461419 0.90771620 0.453858102
[85,] 0.5420052 0.91598957 0.457994783
[86,] 0.5891567 0.82168669 0.410843343
[87,] 0.5396964 0.92060722 0.460303612
[88,] 0.4936943 0.98738859 0.506305703
[89,] 0.5224906 0.95501878 0.477509390
[90,] 0.4759203 0.95184067 0.524079665
[91,] 0.5796194 0.84076115 0.420380573
[92,] 0.5749646 0.85007086 0.425035430
[93,] 0.5711432 0.85771360 0.428856802
[94,] 0.6022208 0.79555835 0.397779175
[95,] 0.7358809 0.52823823 0.264119117
[96,] 0.7003503 0.59929936 0.299649679
[97,] 0.7200740 0.55985205 0.279926025
[98,] 0.6803420 0.63931596 0.319657978
[99,] 0.6613163 0.67736744 0.338683718
[100,] 0.6886070 0.62278607 0.311393033
[101,] 0.6731397 0.65372063 0.326860317
[102,] 0.6646852 0.67062958 0.335314789
[103,] 0.6099675 0.78006502 0.390032509
[104,] 0.5573371 0.88532585 0.442662927
[105,] 0.5229744 0.95405116 0.477025579
[106,] 0.5123390 0.97532199 0.487660993
[107,] 0.4633235 0.92664703 0.536676483
[108,] 0.4299618 0.85992360 0.570038201
[109,] 0.3858870 0.77177397 0.614113013
[110,] 0.3791045 0.75820894 0.620895529
[111,] 0.3216512 0.64330236 0.678348818
[112,] 0.3964061 0.79281212 0.603593942
[113,] 0.4124135 0.82482690 0.587586550
[114,] 0.4614024 0.92280471 0.538597643
[115,] 0.4124422 0.82488449 0.587557757
[116,] 0.3520259 0.70405181 0.647974095
[117,] 0.4510308 0.90206158 0.548969208
[118,] 0.3900023 0.78000458 0.609997710
[119,] 0.3237284 0.64745688 0.676271560
[120,] 0.3001807 0.60036150 0.699819252
[121,] 0.3755782 0.75115634 0.624421828
[122,] 0.3262252 0.65245044 0.673774778
[123,] 0.3077271 0.61545427 0.692272867
[124,] 0.4214686 0.84293719 0.578531405
[125,] 0.3599878 0.71997565 0.640012177
[126,] 0.3385520 0.67710406 0.661447968
[127,] 0.3131907 0.62638138 0.686809310
[128,] 0.7657687 0.46846255 0.234231276
[129,] 0.6619146 0.67617082 0.338085412
[130,] 0.7240434 0.55191329 0.275956643
[131,] 0.6432312 0.71353758 0.356768789
> postscript(file="/var/www/html/rcomp/tmp/1l6on1291034755.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/2l6on1291034755.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/3ef6q1291034755.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/4ef6q1291034755.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/5ef6q1291034755.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 = 162
Frequency = 1
1 2 3 4 5 6
0.65605739 3.71338116 -4.57233313 -0.96998128 1.71338116 4.87034310
7 8 9 10 11 12
-1.15482029 -0.21655358 -0.63154854 1.19941552 3.43213303 4.36845146
13 14 15 16 17 18
-2.54140985 1.71338116 2.42766687 1.03001872 0.51591392 3.87034310
19 20 21 22 23 24
-0.35228753 1.78344642 3.17098422 -2.80058448 -0.37039974 -2.63154854
25 26 27 28 29 30
4.45859015 -5.28661884 1.23019963 0.22748596 0.71338116 -1.32712413
31 32 33 34 35 36
0.84517971 -0.41402082 1.36845146 1.19941552 0.43213303 2.17098422
37 38 39 40 41 42
-3.54140985 1.51591392 1.42766687 0.03001872 1.51591392 2.87034310
43 44 45 46 47 48
1.64771247 -1.41402082 -3.63154854 -2.80058448 0.62960026 0.36845146
49 50 51 52 53 54
3.65605739 -0.48408608 0.42766687 1.03001872 -2.48408608 -1.12965690
55 56 57 58 59 60
-2.35228753 0.78344642 0.36845146 1.19941552 -1.56786697 -2.63154854
61 62 63 64 65 66
-4.54140985 -0.48408608 -4.57233313 0.22748596 0.71338116 -2.32712413
67 68 69 70 71 72
-4.15482029 -1.41402082 -0.63154854 2.00194828 0.43213303 1.36845146
73 74 75 76 77 78
1.65605739 1.51591392 -1.76980037 -1.77251404 2.71338116 -0.12965690
79 80 81 82 83 84
0.64771247 -0.41402082 0.17098422 3.00194828 0.62960026 2.17098422
85 86 87 88 89 90
1.65605739 -0.28661884 0.23019963 0.22748596 -1.28661884 -6.12965690
91 92 93 94 95 96
1.84517971 -1.21655358 -0.63154854 0.19941552 -1.37039974 1.36845146
97 98 99 100 101 102
-1.34394261 -0.28661884 2.23019963 2.03001872 2.71338116 -0.32712413
103 104 105 106 107 108
0.84517971 -2.41402082 -0.63154854 -3.99805172 1.62960026 1.17098422
109 110 111 112 113 114
-2.54140985 -4.28661884 -0.57233313 -2.77251404 -1.28661884 1.67287587
115 116 117 118 119 120
2.84517971 2.58597918 -1.63154854 0.19941552 -0.37039974 -0.63154854
121 122 123 124 125 126
-1.34394261 -0.28661884 -0.57233313 1.22748596 0.71338116 -0.12965690
127 128 129 130 131 132
2.64771247 2.78344642 3.36845146 1.19941552 -0.56786697 -4.82901578
133 134 135 136 137 138
1.65605739 1.51591392 0.23019963 2.22748596 -2.48408608 1.67287587
139 140 141 142 143 144
-4.15482029 0.78344642 -1.82901578 1.19941552 2.43213303 -0.63154854
145 146 147 148 149 150
2.45859015 1.71338116 0.42766687 -1.96998128 -1.48408608 -3.32712413
151 152 153 154 155 156
0.84517971 -1.21655358 1.17098422 -1.80058448 -5.37039974 -1.63154854
157 158 159 160 161 162
-0.34394261 -0.28661884 3.42766687 -0.77251404 -2.28661884 -0.12965690
> postscript(file="/var/www/html/rcomp/tmp/66ons1291034755.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 = 162
Frequency = 1
lag(myerror, k = 1) myerror
0 0.65605739 NA
1 3.71338116 0.65605739
2 -4.57233313 3.71338116
3 -0.96998128 -4.57233313
4 1.71338116 -0.96998128
5 4.87034310 1.71338116
6 -1.15482029 4.87034310
7 -0.21655358 -1.15482029
8 -0.63154854 -0.21655358
9 1.19941552 -0.63154854
10 3.43213303 1.19941552
11 4.36845146 3.43213303
12 -2.54140985 4.36845146
13 1.71338116 -2.54140985
14 2.42766687 1.71338116
15 1.03001872 2.42766687
16 0.51591392 1.03001872
17 3.87034310 0.51591392
18 -0.35228753 3.87034310
19 1.78344642 -0.35228753
20 3.17098422 1.78344642
21 -2.80058448 3.17098422
22 -0.37039974 -2.80058448
23 -2.63154854 -0.37039974
24 4.45859015 -2.63154854
25 -5.28661884 4.45859015
26 1.23019963 -5.28661884
27 0.22748596 1.23019963
28 0.71338116 0.22748596
29 -1.32712413 0.71338116
30 0.84517971 -1.32712413
31 -0.41402082 0.84517971
32 1.36845146 -0.41402082
33 1.19941552 1.36845146
34 0.43213303 1.19941552
35 2.17098422 0.43213303
36 -3.54140985 2.17098422
37 1.51591392 -3.54140985
38 1.42766687 1.51591392
39 0.03001872 1.42766687
40 1.51591392 0.03001872
41 2.87034310 1.51591392
42 1.64771247 2.87034310
43 -1.41402082 1.64771247
44 -3.63154854 -1.41402082
45 -2.80058448 -3.63154854
46 0.62960026 -2.80058448
47 0.36845146 0.62960026
48 3.65605739 0.36845146
49 -0.48408608 3.65605739
50 0.42766687 -0.48408608
51 1.03001872 0.42766687
52 -2.48408608 1.03001872
53 -1.12965690 -2.48408608
54 -2.35228753 -1.12965690
55 0.78344642 -2.35228753
56 0.36845146 0.78344642
57 1.19941552 0.36845146
58 -1.56786697 1.19941552
59 -2.63154854 -1.56786697
60 -4.54140985 -2.63154854
61 -0.48408608 -4.54140985
62 -4.57233313 -0.48408608
63 0.22748596 -4.57233313
64 0.71338116 0.22748596
65 -2.32712413 0.71338116
66 -4.15482029 -2.32712413
67 -1.41402082 -4.15482029
68 -0.63154854 -1.41402082
69 2.00194828 -0.63154854
70 0.43213303 2.00194828
71 1.36845146 0.43213303
72 1.65605739 1.36845146
73 1.51591392 1.65605739
74 -1.76980037 1.51591392
75 -1.77251404 -1.76980037
76 2.71338116 -1.77251404
77 -0.12965690 2.71338116
78 0.64771247 -0.12965690
79 -0.41402082 0.64771247
80 0.17098422 -0.41402082
81 3.00194828 0.17098422
82 0.62960026 3.00194828
83 2.17098422 0.62960026
84 1.65605739 2.17098422
85 -0.28661884 1.65605739
86 0.23019963 -0.28661884
87 0.22748596 0.23019963
88 -1.28661884 0.22748596
89 -6.12965690 -1.28661884
90 1.84517971 -6.12965690
91 -1.21655358 1.84517971
92 -0.63154854 -1.21655358
93 0.19941552 -0.63154854
94 -1.37039974 0.19941552
95 1.36845146 -1.37039974
96 -1.34394261 1.36845146
97 -0.28661884 -1.34394261
98 2.23019963 -0.28661884
99 2.03001872 2.23019963
100 2.71338116 2.03001872
101 -0.32712413 2.71338116
102 0.84517971 -0.32712413
103 -2.41402082 0.84517971
104 -0.63154854 -2.41402082
105 -3.99805172 -0.63154854
106 1.62960026 -3.99805172
107 1.17098422 1.62960026
108 -2.54140985 1.17098422
109 -4.28661884 -2.54140985
110 -0.57233313 -4.28661884
111 -2.77251404 -0.57233313
112 -1.28661884 -2.77251404
113 1.67287587 -1.28661884
114 2.84517971 1.67287587
115 2.58597918 2.84517971
116 -1.63154854 2.58597918
117 0.19941552 -1.63154854
118 -0.37039974 0.19941552
119 -0.63154854 -0.37039974
120 -1.34394261 -0.63154854
121 -0.28661884 -1.34394261
122 -0.57233313 -0.28661884
123 1.22748596 -0.57233313
124 0.71338116 1.22748596
125 -0.12965690 0.71338116
126 2.64771247 -0.12965690
127 2.78344642 2.64771247
128 3.36845146 2.78344642
129 1.19941552 3.36845146
130 -0.56786697 1.19941552
131 -4.82901578 -0.56786697
132 1.65605739 -4.82901578
133 1.51591392 1.65605739
134 0.23019963 1.51591392
135 2.22748596 0.23019963
136 -2.48408608 2.22748596
137 1.67287587 -2.48408608
138 -4.15482029 1.67287587
139 0.78344642 -4.15482029
140 -1.82901578 0.78344642
141 1.19941552 -1.82901578
142 2.43213303 1.19941552
143 -0.63154854 2.43213303
144 2.45859015 -0.63154854
145 1.71338116 2.45859015
146 0.42766687 1.71338116
147 -1.96998128 0.42766687
148 -1.48408608 -1.96998128
149 -3.32712413 -1.48408608
150 0.84517971 -3.32712413
151 -1.21655358 0.84517971
152 1.17098422 -1.21655358
153 -1.80058448 1.17098422
154 -5.37039974 -1.80058448
155 -1.63154854 -5.37039974
156 -0.34394261 -1.63154854
157 -0.28661884 -0.34394261
158 3.42766687 -0.28661884
159 -0.77251404 3.42766687
160 -2.28661884 -0.77251404
161 -0.12965690 -2.28661884
162 NA -0.12965690
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.71338116 0.65605739
[2,] -4.57233313 3.71338116
[3,] -0.96998128 -4.57233313
[4,] 1.71338116 -0.96998128
[5,] 4.87034310 1.71338116
[6,] -1.15482029 4.87034310
[7,] -0.21655358 -1.15482029
[8,] -0.63154854 -0.21655358
[9,] 1.19941552 -0.63154854
[10,] 3.43213303 1.19941552
[11,] 4.36845146 3.43213303
[12,] -2.54140985 4.36845146
[13,] 1.71338116 -2.54140985
[14,] 2.42766687 1.71338116
[15,] 1.03001872 2.42766687
[16,] 0.51591392 1.03001872
[17,] 3.87034310 0.51591392
[18,] -0.35228753 3.87034310
[19,] 1.78344642 -0.35228753
[20,] 3.17098422 1.78344642
[21,] -2.80058448 3.17098422
[22,] -0.37039974 -2.80058448
[23,] -2.63154854 -0.37039974
[24,] 4.45859015 -2.63154854
[25,] -5.28661884 4.45859015
[26,] 1.23019963 -5.28661884
[27,] 0.22748596 1.23019963
[28,] 0.71338116 0.22748596
[29,] -1.32712413 0.71338116
[30,] 0.84517971 -1.32712413
[31,] -0.41402082 0.84517971
[32,] 1.36845146 -0.41402082
[33,] 1.19941552 1.36845146
[34,] 0.43213303 1.19941552
[35,] 2.17098422 0.43213303
[36,] -3.54140985 2.17098422
[37,] 1.51591392 -3.54140985
[38,] 1.42766687 1.51591392
[39,] 0.03001872 1.42766687
[40,] 1.51591392 0.03001872
[41,] 2.87034310 1.51591392
[42,] 1.64771247 2.87034310
[43,] -1.41402082 1.64771247
[44,] -3.63154854 -1.41402082
[45,] -2.80058448 -3.63154854
[46,] 0.62960026 -2.80058448
[47,] 0.36845146 0.62960026
[48,] 3.65605739 0.36845146
[49,] -0.48408608 3.65605739
[50,] 0.42766687 -0.48408608
[51,] 1.03001872 0.42766687
[52,] -2.48408608 1.03001872
[53,] -1.12965690 -2.48408608
[54,] -2.35228753 -1.12965690
[55,] 0.78344642 -2.35228753
[56,] 0.36845146 0.78344642
[57,] 1.19941552 0.36845146
[58,] -1.56786697 1.19941552
[59,] -2.63154854 -1.56786697
[60,] -4.54140985 -2.63154854
[61,] -0.48408608 -4.54140985
[62,] -4.57233313 -0.48408608
[63,] 0.22748596 -4.57233313
[64,] 0.71338116 0.22748596
[65,] -2.32712413 0.71338116
[66,] -4.15482029 -2.32712413
[67,] -1.41402082 -4.15482029
[68,] -0.63154854 -1.41402082
[69,] 2.00194828 -0.63154854
[70,] 0.43213303 2.00194828
[71,] 1.36845146 0.43213303
[72,] 1.65605739 1.36845146
[73,] 1.51591392 1.65605739
[74,] -1.76980037 1.51591392
[75,] -1.77251404 -1.76980037
[76,] 2.71338116 -1.77251404
[77,] -0.12965690 2.71338116
[78,] 0.64771247 -0.12965690
[79,] -0.41402082 0.64771247
[80,] 0.17098422 -0.41402082
[81,] 3.00194828 0.17098422
[82,] 0.62960026 3.00194828
[83,] 2.17098422 0.62960026
[84,] 1.65605739 2.17098422
[85,] -0.28661884 1.65605739
[86,] 0.23019963 -0.28661884
[87,] 0.22748596 0.23019963
[88,] -1.28661884 0.22748596
[89,] -6.12965690 -1.28661884
[90,] 1.84517971 -6.12965690
[91,] -1.21655358 1.84517971
[92,] -0.63154854 -1.21655358
[93,] 0.19941552 -0.63154854
[94,] -1.37039974 0.19941552
[95,] 1.36845146 -1.37039974
[96,] -1.34394261 1.36845146
[97,] -0.28661884 -1.34394261
[98,] 2.23019963 -0.28661884
[99,] 2.03001872 2.23019963
[100,] 2.71338116 2.03001872
[101,] -0.32712413 2.71338116
[102,] 0.84517971 -0.32712413
[103,] -2.41402082 0.84517971
[104,] -0.63154854 -2.41402082
[105,] -3.99805172 -0.63154854
[106,] 1.62960026 -3.99805172
[107,] 1.17098422 1.62960026
[108,] -2.54140985 1.17098422
[109,] -4.28661884 -2.54140985
[110,] -0.57233313 -4.28661884
[111,] -2.77251404 -0.57233313
[112,] -1.28661884 -2.77251404
[113,] 1.67287587 -1.28661884
[114,] 2.84517971 1.67287587
[115,] 2.58597918 2.84517971
[116,] -1.63154854 2.58597918
[117,] 0.19941552 -1.63154854
[118,] -0.37039974 0.19941552
[119,] -0.63154854 -0.37039974
[120,] -1.34394261 -0.63154854
[121,] -0.28661884 -1.34394261
[122,] -0.57233313 -0.28661884
[123,] 1.22748596 -0.57233313
[124,] 0.71338116 1.22748596
[125,] -0.12965690 0.71338116
[126,] 2.64771247 -0.12965690
[127,] 2.78344642 2.64771247
[128,] 3.36845146 2.78344642
[129,] 1.19941552 3.36845146
[130,] -0.56786697 1.19941552
[131,] -4.82901578 -0.56786697
[132,] 1.65605739 -4.82901578
[133,] 1.51591392 1.65605739
[134,] 0.23019963 1.51591392
[135,] 2.22748596 0.23019963
[136,] -2.48408608 2.22748596
[137,] 1.67287587 -2.48408608
[138,] -4.15482029 1.67287587
[139,] 0.78344642 -4.15482029
[140,] -1.82901578 0.78344642
[141,] 1.19941552 -1.82901578
[142,] 2.43213303 1.19941552
[143,] -0.63154854 2.43213303
[144,] 2.45859015 -0.63154854
[145,] 1.71338116 2.45859015
[146,] 0.42766687 1.71338116
[147,] -1.96998128 0.42766687
[148,] -1.48408608 -1.96998128
[149,] -3.32712413 -1.48408608
[150,] 0.84517971 -3.32712413
[151,] -1.21655358 0.84517971
[152,] 1.17098422 -1.21655358
[153,] -1.80058448 1.17098422
[154,] -5.37039974 -1.80058448
[155,] -1.63154854 -5.37039974
[156,] -0.34394261 -1.63154854
[157,] -0.28661884 -0.34394261
[158,] 3.42766687 -0.28661884
[159,] -0.77251404 3.42766687
[160,] -2.28661884 -0.77251404
[161,] -0.12965690 -2.28661884
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.71338116 0.65605739
2 -4.57233313 3.71338116
3 -0.96998128 -4.57233313
4 1.71338116 -0.96998128
5 4.87034310 1.71338116
6 -1.15482029 4.87034310
7 -0.21655358 -1.15482029
8 -0.63154854 -0.21655358
9 1.19941552 -0.63154854
10 3.43213303 1.19941552
11 4.36845146 3.43213303
12 -2.54140985 4.36845146
13 1.71338116 -2.54140985
14 2.42766687 1.71338116
15 1.03001872 2.42766687
16 0.51591392 1.03001872
17 3.87034310 0.51591392
18 -0.35228753 3.87034310
19 1.78344642 -0.35228753
20 3.17098422 1.78344642
21 -2.80058448 3.17098422
22 -0.37039974 -2.80058448
23 -2.63154854 -0.37039974
24 4.45859015 -2.63154854
25 -5.28661884 4.45859015
26 1.23019963 -5.28661884
27 0.22748596 1.23019963
28 0.71338116 0.22748596
29 -1.32712413 0.71338116
30 0.84517971 -1.32712413
31 -0.41402082 0.84517971
32 1.36845146 -0.41402082
33 1.19941552 1.36845146
34 0.43213303 1.19941552
35 2.17098422 0.43213303
36 -3.54140985 2.17098422
37 1.51591392 -3.54140985
38 1.42766687 1.51591392
39 0.03001872 1.42766687
40 1.51591392 0.03001872
41 2.87034310 1.51591392
42 1.64771247 2.87034310
43 -1.41402082 1.64771247
44 -3.63154854 -1.41402082
45 -2.80058448 -3.63154854
46 0.62960026 -2.80058448
47 0.36845146 0.62960026
48 3.65605739 0.36845146
49 -0.48408608 3.65605739
50 0.42766687 -0.48408608
51 1.03001872 0.42766687
52 -2.48408608 1.03001872
53 -1.12965690 -2.48408608
54 -2.35228753 -1.12965690
55 0.78344642 -2.35228753
56 0.36845146 0.78344642
57 1.19941552 0.36845146
58 -1.56786697 1.19941552
59 -2.63154854 -1.56786697
60 -4.54140985 -2.63154854
61 -0.48408608 -4.54140985
62 -4.57233313 -0.48408608
63 0.22748596 -4.57233313
64 0.71338116 0.22748596
65 -2.32712413 0.71338116
66 -4.15482029 -2.32712413
67 -1.41402082 -4.15482029
68 -0.63154854 -1.41402082
69 2.00194828 -0.63154854
70 0.43213303 2.00194828
71 1.36845146 0.43213303
72 1.65605739 1.36845146
73 1.51591392 1.65605739
74 -1.76980037 1.51591392
75 -1.77251404 -1.76980037
76 2.71338116 -1.77251404
77 -0.12965690 2.71338116
78 0.64771247 -0.12965690
79 -0.41402082 0.64771247
80 0.17098422 -0.41402082
81 3.00194828 0.17098422
82 0.62960026 3.00194828
83 2.17098422 0.62960026
84 1.65605739 2.17098422
85 -0.28661884 1.65605739
86 0.23019963 -0.28661884
87 0.22748596 0.23019963
88 -1.28661884 0.22748596
89 -6.12965690 -1.28661884
90 1.84517971 -6.12965690
91 -1.21655358 1.84517971
92 -0.63154854 -1.21655358
93 0.19941552 -0.63154854
94 -1.37039974 0.19941552
95 1.36845146 -1.37039974
96 -1.34394261 1.36845146
97 -0.28661884 -1.34394261
98 2.23019963 -0.28661884
99 2.03001872 2.23019963
100 2.71338116 2.03001872
101 -0.32712413 2.71338116
102 0.84517971 -0.32712413
103 -2.41402082 0.84517971
104 -0.63154854 -2.41402082
105 -3.99805172 -0.63154854
106 1.62960026 -3.99805172
107 1.17098422 1.62960026
108 -2.54140985 1.17098422
109 -4.28661884 -2.54140985
110 -0.57233313 -4.28661884
111 -2.77251404 -0.57233313
112 -1.28661884 -2.77251404
113 1.67287587 -1.28661884
114 2.84517971 1.67287587
115 2.58597918 2.84517971
116 -1.63154854 2.58597918
117 0.19941552 -1.63154854
118 -0.37039974 0.19941552
119 -0.63154854 -0.37039974
120 -1.34394261 -0.63154854
121 -0.28661884 -1.34394261
122 -0.57233313 -0.28661884
123 1.22748596 -0.57233313
124 0.71338116 1.22748596
125 -0.12965690 0.71338116
126 2.64771247 -0.12965690
127 2.78344642 2.64771247
128 3.36845146 2.78344642
129 1.19941552 3.36845146
130 -0.56786697 1.19941552
131 -4.82901578 -0.56786697
132 1.65605739 -4.82901578
133 1.51591392 1.65605739
134 0.23019963 1.51591392
135 2.22748596 0.23019963
136 -2.48408608 2.22748596
137 1.67287587 -2.48408608
138 -4.15482029 1.67287587
139 0.78344642 -4.15482029
140 -1.82901578 0.78344642
141 1.19941552 -1.82901578
142 2.43213303 1.19941552
143 -0.63154854 2.43213303
144 2.45859015 -0.63154854
145 1.71338116 2.45859015
146 0.42766687 1.71338116
147 -1.96998128 0.42766687
148 -1.48408608 -1.96998128
149 -3.32712413 -1.48408608
150 0.84517971 -3.32712413
151 -1.21655358 0.84517971
152 1.17098422 -1.21655358
153 -1.80058448 1.17098422
154 -5.37039974 -1.80058448
155 -1.63154854 -5.37039974
156 -0.34394261 -1.63154854
157 -0.28661884 -0.34394261
158 3.42766687 -0.28661884
159 -0.77251404 3.42766687
160 -2.28661884 -0.77251404
161 -0.12965690 -2.28661884
> 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/76ons1291034755.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/8zx4d1291034755.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/9zx4d1291034755.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/10zx4d1291034755.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/11oznz1291034756.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/1290351291034756.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/13nrje1291034756.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/148azj1291034756.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/151jgm1291034756.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/16ftwd1291034756.tab")
+ }
>
> try(system("convert tmp/1l6on1291034755.ps tmp/1l6on1291034755.png",intern=TRUE))
character(0)
> try(system("convert tmp/2l6on1291034755.ps tmp/2l6on1291034755.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ef6q1291034755.ps tmp/3ef6q1291034755.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ef6q1291034755.ps tmp/4ef6q1291034755.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ef6q1291034755.ps tmp/5ef6q1291034755.png",intern=TRUE))
character(0)
> try(system("convert tmp/66ons1291034755.ps tmp/66ons1291034755.png",intern=TRUE))
character(0)
> try(system("convert tmp/76ons1291034755.ps tmp/76ons1291034755.png",intern=TRUE))
character(0)
> try(system("convert tmp/8zx4d1291034755.ps tmp/8zx4d1291034755.png",intern=TRUE))
character(0)
> try(system("convert tmp/9zx4d1291034755.ps tmp/9zx4d1291034755.png",intern=TRUE))
character(0)
> try(system("convert tmp/10zx4d1291034755.ps tmp/10zx4d1291034755.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.035 1.793 9.405