R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) 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(1 + ,2981.85 + ,10407 + ,0.762253 + ,14448.9 + ,13953.3 + ,2 + ,3080.58 + ,10463 + ,0.768403 + ,15023.9 + ,14657.7 + ,3 + ,3106.22 + ,10556 + ,0.757518 + ,17319.2 + ,16686.2 + ,4 + ,3119.31 + ,10646 + ,0.772917 + ,16080.7 + ,15232.4 + ,5 + ,3061.26 + ,10702 + ,0.787774 + ,15486.3 + ,15014.1 + ,6 + ,3097.31 + ,11353 + ,0.82203 + ,17046.4 + ,16688.6 + ,7 + ,3161.69 + ,11346 + ,0.830772 + ,14793.9 + ,13969.6 + ,8 + ,3257.16 + ,11451 + ,0.813537 + ,13666.7 + ,14546.8 + ,9 + ,3277.01 + ,11964 + ,0.815927 + ,17358.8 + ,16292 + ,10 + ,3295.32 + ,12574 + ,0.832293 + ,16091.8 + ,15039 + ,11 + ,3363.99 + ,13031 + ,0.848464 + ,17401.7 + ,17433.8 + ,12 + ,3494.17 + ,13812 + ,0.843455 + ,16467 + ,17798.4 + ,13 + ,3667.03 + ,14544 + ,0.826241 + ,16103.8 + ,16870.9 + ,14 + ,3813.06 + ,14931 + ,0.837661 + ,16422.6 + ,16659.3 + ,15 + ,3917.96 + ,14886 + ,0.831947 + ,19435.5 + ,19620.4 + ,16 + ,3895.51 + ,16005 + ,0.81493 + ,15810.1 + ,15953.5 + ,17 + ,3801.06 + ,17064 + ,0.783085 + ,17914.8 + ,17420.9 + ,18 + ,3570.12 + ,15168 + ,0.790514 + ,18197.2 + ,17647.5 + ,19 + ,3701.61 + ,16050 + ,0.788395 + ,16183.5 + ,15200.8 + ,20 + ,3862.27 + ,15839 + ,0.780579 + ,14781 + ,15637.3 + ,21 + ,3970.1 + ,15137 + ,0.785731 + ,18091.5 + ,17124.5 + ,22 + ,4138.52 + ,14954 + ,0.792959 + ,18318.8 + ,17659.4 + ,23 + ,4199.75 + ,15648 + ,0.776337 + ,18392.2 + ,17815 + ,24 + ,4290.89 + ,15305 + ,0.75683 + ,15952.5 + ,16165.6 + ,25 + ,4443.91 + ,15579 + ,0.76929 + ,17434.3 + ,17416.6 + ,26 + ,4502.64 + ,16348 + ,0.764877 + ,17214 + ,16823.9 + ,27 + ,4356.98 + ,15928 + ,0.755173 + ,19680.5 + ,19171.2 + ,28 + ,4591.27 + ,16171 + ,0.739864 + ,17216.8 + ,16806.8 + ,29 + ,4696.96 + ,15937 + ,0.740138 + ,18325.3 + ,18112.8 + ,30 + ,4621.4 + ,15713 + ,0.745212 + ,19303.5 + ,18485.5 + ,31 + ,4562.84 + ,15594 + ,0.729076 + ,18090.7 + ,17668 + ,32 + ,4202.52 + ,15683 + ,0.734107 + ,16166.3 + ,16324.3 + ,33 + ,4296.49 + ,16438 + ,0.719632 + ,18304.7 + ,17877.5 + ,34 + ,4435.23 + ,17032 + ,0.702889 + ,20380.1 + ,20136.7 + ,35 + ,4105.18 + ,17696 + ,0.681013 + ,18887.7 + ,19307 + ,36 + ,4116.68 + ,17745 + ,0.686342 + ,16316.5 + ,17776.3 + ,37 + ,3844.49 + ,19394 + ,0.67944 + ,18471.5 + ,19861.3 + ,38 + ,3720.98 + ,20148 + ,0.678058 + ,18754.9 + ,18757 + ,39 + ,3674.4 + ,20108 + ,0.644039 + ,18940.7 + ,19879.3 + ,40 + ,3857.62 + ,18584 + ,0.63488 + ,20228.5 + ,21068.4 + ,41 + ,3801.06 + ,18441 + ,0.642797 + ,19060.4 + ,19358 + ,42 + ,3504.37 + ,18391 + ,0.642963 + ,20262.9 + ,20639.2 + ,43 + ,3032.6 + ,19178 + ,0.634115 + ,19928.7 + ,20008.1 + ,44 + ,3047.03 + ,18079 + ,0.66778 + ,16058.8 + ,18150.1 + ,45 + ,2962.34 + ,18483 + ,0.695894 + ,20157.4 + ,21180.4 + ,46 + ,2197.82 + ,19644 + ,0.750638 + ,19663.3 + ,20428.9 + ,47 + ,2014.45 + ,19195 + ,0.785423 + ,15648.9 + ,17241.2 + ,48 + ,1862.83 + ,19650 + ,0.74355 + ,14380.5 + ,15969.3 + ,49 + ,1905.41 + ,20830 + ,0.755344 + ,13654.4 + ,14972.4 + ,50 + ,1810.99 + ,23595 + ,0.782167 + ,14085.9 + ,14488.3 + ,51 + ,1670.07 + ,22937 + ,0.766284 + ,15070.6 + ,15885.1 + ,52 + ,1864.44 + ,21814 + ,0.75815 + ,14206.9 + ,14305.3 + ,53 + ,2052.02 + ,21928 + ,0.732601 + ,13585.6 + ,13891.5 + ,54 + ,2029.6 + ,21777 + ,0.71347 + ,15413.2 + ,15431.6 + ,55 + ,2070.83 + ,21383 + ,0.709824 + ,14809.6 + ,14199.3 + ,56 + ,2293.41 + ,21467 + ,0.700869 + ,12625.3 + ,13542.6 + ,57 + ,2443.27 + ,22052 + ,0.686719 + ,16314.7 + ,16226.3 + ,58 + ,2513.17 + ,22680 + ,0.674946 + ,16045.9 + ,16786.1 + ,59 + ,2466.92 + ,24320 + ,0.670511 + ,16063.6 + ,16034.3 + ,60 + ,2502.66 + ,24977 + ,0.684275 + ,15851.3 + ,16744.5 + ,61 + ,2539.91 + ,25204 + ,0.700673 + ,14925.2 + ,15955.4) + ,dim=c(6 + ,61) + ,dimnames=list(c('Periode' + ,'BEL20' + ,'GoudkoersTeBrusse' + ,'EurosPerUSdollar' + ,'Uitvoer' + ,'Invoer') + ,1:61)) > y <- array(NA,dim=c(6,61),dimnames=list(c('Periode','BEL20','GoudkoersTeBrusse','EurosPerUSdollar','Uitvoer','Invoer'),1:61)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '2' > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, 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 BEL20 Periode GoudkoersTeBrusse EurosPerUSdollar Uitvoer Invoer t 1 2981.85 1 10407 0.762253 14448.9 13953.3 1 2 3080.58 2 10463 0.768403 15023.9 14657.7 2 3 3106.22 3 10556 0.757518 17319.2 16686.2 3 4 3119.31 4 10646 0.772917 16080.7 15232.4 4 5 3061.26 5 10702 0.787774 15486.3 15014.1 5 6 3097.31 6 11353 0.822030 17046.4 16688.6 6 7 3161.69 7 11346 0.830772 14793.9 13969.6 7 8 3257.16 8 11451 0.813537 13666.7 14546.8 8 9 3277.01 9 11964 0.815927 17358.8 16292.0 9 10 3295.32 10 12574 0.832293 16091.8 15039.0 10 11 3363.99 11 13031 0.848464 17401.7 17433.8 11 12 3494.17 12 13812 0.843455 16467.0 17798.4 12 13 3667.03 13 14544 0.826241 16103.8 16870.9 13 14 3813.06 14 14931 0.837661 16422.6 16659.3 14 15 3917.96 15 14886 0.831947 19435.5 19620.4 15 16 3895.51 16 16005 0.814930 15810.1 15953.5 16 17 3801.06 17 17064 0.783085 17914.8 17420.9 17 18 3570.12 18 15168 0.790514 18197.2 17647.5 18 19 3701.61 19 16050 0.788395 16183.5 15200.8 19 20 3862.27 20 15839 0.780579 14781.0 15637.3 20 21 3970.10 21 15137 0.785731 18091.5 17124.5 21 22 4138.52 22 14954 0.792959 18318.8 17659.4 22 23 4199.75 23 15648 0.776337 18392.2 17815.0 23 24 4290.89 24 15305 0.756830 15952.5 16165.6 24 25 4443.91 25 15579 0.769290 17434.3 17416.6 25 26 4502.64 26 16348 0.764877 17214.0 16823.9 26 27 4356.98 27 15928 0.755173 19680.5 19171.2 27 28 4591.27 28 16171 0.739864 17216.8 16806.8 28 29 4696.96 29 15937 0.740138 18325.3 18112.8 29 30 4621.40 30 15713 0.745212 19303.5 18485.5 30 31 4562.84 31 15594 0.729076 18090.7 17668.0 31 32 4202.52 32 15683 0.734107 16166.3 16324.3 32 33 4296.49 33 16438 0.719632 18304.7 17877.5 33 34 4435.23 34 17032 0.702889 20380.1 20136.7 34 35 4105.18 35 17696 0.681013 18887.7 19307.0 35 36 4116.68 36 17745 0.686342 16316.5 17776.3 36 37 3844.49 37 19394 0.679440 18471.5 19861.3 37 38 3720.98 38 20148 0.678058 18754.9 18757.0 38 39 3674.40 39 20108 0.644039 18940.7 19879.3 39 40 3857.62 40 18584 0.634880 20228.5 21068.4 40 41 3801.06 41 18441 0.642797 19060.4 19358.0 41 42 3504.37 42 18391 0.642963 20262.9 20639.2 42 43 3032.60 43 19178 0.634115 19928.7 20008.1 43 44 3047.03 44 18079 0.667780 16058.8 18150.1 44 45 2962.34 45 18483 0.695894 20157.4 21180.4 45 46 2197.82 46 19644 0.750638 19663.3 20428.9 46 47 2014.45 47 19195 0.785423 15648.9 17241.2 47 48 1862.83 48 19650 0.743550 14380.5 15969.3 48 49 1905.41 49 20830 0.755344 13654.4 14972.4 49 50 1810.99 50 23595 0.782167 14085.9 14488.3 50 51 1670.07 51 22937 0.766284 15070.6 15885.1 51 52 1864.44 52 21814 0.758150 14206.9 14305.3 52 53 2052.02 53 21928 0.732601 13585.6 13891.5 53 54 2029.60 54 21777 0.713470 15413.2 15431.6 54 55 2070.83 55 21383 0.709824 14809.6 14199.3 55 56 2293.41 56 21467 0.700869 12625.3 13542.6 56 57 2443.27 57 22052 0.686719 16314.7 16226.3 57 58 2513.17 58 22680 0.674946 16045.9 16786.1 58 59 2466.92 59 24320 0.670511 16063.6 16034.3 59 60 2502.66 60 24977 0.684275 15851.3 16744.5 60 61 2539.91 61 25204 0.700673 14925.2 15955.4 61 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Periode GoudkoersTeBrusse EurosPerUSdollar 2.720e+03 -3.390e+01 2.785e-02 -3.113e+03 Uitvoer Invoer t 2.514e-01 -4.235e-02 NA > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1251.45 -363.94 -81.89 336.33 1056.70 Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) 2.720e+03 2.222e+03 1.224 0.2261 Periode -3.390e+01 1.856e+01 -1.826 0.0732 . GoudkoersTeBrusse 2.785e-02 7.490e-02 0.372 0.7114 EurosPerUSdollar -3.113e+03 2.179e+03 -1.429 0.1587 Uitvoer 2.514e-01 1.178e-01 2.135 0.0372 * Invoer -4.235e-02 1.176e-01 -0.360 0.7200 t NA NA NA NA --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 597.3 on 55 degrees of freedom Multiple R-squared: 0.5604, Adjusted R-squared: 0.5204 F-statistic: 14.02 on 5 and 55 DF, p-value: 7.749e-09 > 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,] 2.707323e-03 5.414646e-03 9.972927e-01 [2,] 3.198403e-04 6.396805e-04 9.996802e-01 [3,] 3.074331e-05 6.148662e-05 9.999693e-01 [4,] 3.760081e-06 7.520161e-06 9.999962e-01 [5,] 3.590228e-06 7.180457e-06 9.999964e-01 [6,] 3.787120e-06 7.574240e-06 9.999962e-01 [7,] 1.955943e-06 3.911886e-06 9.999980e-01 [8,] 2.842368e-05 5.684737e-05 9.999716e-01 [9,] 3.431768e-05 6.863535e-05 9.999657e-01 [10,] 1.910554e-05 3.821108e-05 9.999809e-01 [11,] 8.677769e-06 1.735554e-05 9.999913e-01 [12,] 3.277608e-05 6.555216e-05 9.999672e-01 [13,] 5.949446e-05 1.189889e-04 9.999405e-01 [14,] 4.029232e-05 8.058464e-05 9.999597e-01 [15,] 2.542384e-05 5.084767e-05 9.999746e-01 [16,] 1.756499e-05 3.512999e-05 9.999824e-01 [17,] 1.178087e-05 2.356175e-05 9.999882e-01 [18,] 5.171323e-06 1.034265e-05 9.999948e-01 [19,] 2.242342e-06 4.484685e-06 9.999978e-01 [20,] 1.353895e-06 2.707790e-06 9.999986e-01 [21,] 8.037784e-07 1.607557e-06 9.999992e-01 [22,] 9.953364e-07 1.990673e-06 9.999990e-01 [23,] 4.008521e-05 8.017042e-05 9.999599e-01 [24,] 4.556164e-04 9.112328e-04 9.995444e-01 [25,] 1.221637e-02 2.443274e-02 9.877836e-01 [26,] 9.960115e-02 1.992023e-01 9.003989e-01 [27,] 3.728932e-01 7.457865e-01 6.271068e-01 [28,] 5.746826e-01 8.506348e-01 4.253174e-01 [29,] 8.296036e-01 3.407927e-01 1.703964e-01 [30,] 8.101225e-01 3.797551e-01 1.898775e-01 [31,] 8.002187e-01 3.995626e-01 1.997813e-01 [32,] 9.572957e-01 8.540856e-02 4.270428e-02 [33,] 9.887693e-01 2.246147e-02 1.123074e-02 [34,] 9.948370e-01 1.032591e-02 5.162957e-03 [35,] 9.960431e-01 7.913839e-03 3.956920e-03 [36,] 9.997963e-01 4.074902e-04 2.037451e-04 [37,] 9.999424e-01 1.152463e-04 5.762314e-05 [38,] 9.999719e-01 5.619272e-05 2.809636e-05 [39,] 9.998707e-01 2.586745e-04 1.293373e-04 [40,] 9.994840e-01 1.032085e-03 5.160427e-04 [41,] 9.993589e-01 1.282108e-03 6.410540e-04 [42,] 9.968632e-01 6.273655e-03 3.136828e-03 > postscript(file="/var/fisher/rcomp/tmp/1if441353252786.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/fisher/rcomp/tmp/2k9um1353252786.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/fisher/rcomp/tmp/3a7rb1353252786.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/fisher/rcomp/tmp/48k4q1353252786.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/fisher/rcomp/tmp/5xdt01353252786.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 = 61 Frequency = 1 1 2 3 4 5 6 -662.68936 -627.20606 -1095.30453 -753.07989 -592.34517 -755.19928 7 8 9 10 11 12 -178.35682 202.27351 -605.16106 -253.51881 -341.23931 35.93279 13 14 15 16 17 18 220.74679 336.33480 -173.47968 510.00403 -146.18319 -328.69528 19 20 21 22 23 24 208.18121 755.38010 163.37573 358.79951 370.98926 988.37343 25 26 27 28 29 30 886.88573 974.64235 323.66779 1056.70178 980.27890 730.50190 31 32 33 34 35 36 929.21391 1042.88847 632.82343 310.69208 268.01658 910.24810 37 38 39 40 41 42 151.04939 -81.88582 -198.53848 -240.89908 -13.69459 -522.64161 43 44 45 46 47 48 -952.68302 125.31434 -751.31614 -1251.45448 -405.86054 -401.58289 49 50 51 52 53 54 -180.92252 -363.93883 -690.49023 -306.02937 -28.58426 -466.71591 55 56 57 58 59 60 -292.40233 455.21092 -235.28251 -94.33608 -202.46121 -24.81867 61 290.47019 > postscript(file="/var/fisher/rcomp/tmp/6epxb1353252786.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 -662.68936 NA 1 -627.20606 -662.68936 2 -1095.30453 -627.20606 3 -753.07989 -1095.30453 4 -592.34517 -753.07989 5 -755.19928 -592.34517 6 -178.35682 -755.19928 7 202.27351 -178.35682 8 -605.16106 202.27351 9 -253.51881 -605.16106 10 -341.23931 -253.51881 11 35.93279 -341.23931 12 220.74679 35.93279 13 336.33480 220.74679 14 -173.47968 336.33480 15 510.00403 -173.47968 16 -146.18319 510.00403 17 -328.69528 -146.18319 18 208.18121 -328.69528 19 755.38010 208.18121 20 163.37573 755.38010 21 358.79951 163.37573 22 370.98926 358.79951 23 988.37343 370.98926 24 886.88573 988.37343 25 974.64235 886.88573 26 323.66779 974.64235 27 1056.70178 323.66779 28 980.27890 1056.70178 29 730.50190 980.27890 30 929.21391 730.50190 31 1042.88847 929.21391 32 632.82343 1042.88847 33 310.69208 632.82343 34 268.01658 310.69208 35 910.24810 268.01658 36 151.04939 910.24810 37 -81.88582 151.04939 38 -198.53848 -81.88582 39 -240.89908 -198.53848 40 -13.69459 -240.89908 41 -522.64161 -13.69459 42 -952.68302 -522.64161 43 125.31434 -952.68302 44 -751.31614 125.31434 45 -1251.45448 -751.31614 46 -405.86054 -1251.45448 47 -401.58289 -405.86054 48 -180.92252 -401.58289 49 -363.93883 -180.92252 50 -690.49023 -363.93883 51 -306.02937 -690.49023 52 -28.58426 -306.02937 53 -466.71591 -28.58426 54 -292.40233 -466.71591 55 455.21092 -292.40233 56 -235.28251 455.21092 57 -94.33608 -235.28251 58 -202.46121 -94.33608 59 -24.81867 -202.46121 60 290.47019 -24.81867 61 NA 290.47019 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -627.20606 -662.68936 [2,] -1095.30453 -627.20606 [3,] -753.07989 -1095.30453 [4,] -592.34517 -753.07989 [5,] -755.19928 -592.34517 [6,] -178.35682 -755.19928 [7,] 202.27351 -178.35682 [8,] -605.16106 202.27351 [9,] -253.51881 -605.16106 [10,] -341.23931 -253.51881 [11,] 35.93279 -341.23931 [12,] 220.74679 35.93279 [13,] 336.33480 220.74679 [14,] -173.47968 336.33480 [15,] 510.00403 -173.47968 [16,] -146.18319 510.00403 [17,] -328.69528 -146.18319 [18,] 208.18121 -328.69528 [19,] 755.38010 208.18121 [20,] 163.37573 755.38010 [21,] 358.79951 163.37573 [22,] 370.98926 358.79951 [23,] 988.37343 370.98926 [24,] 886.88573 988.37343 [25,] 974.64235 886.88573 [26,] 323.66779 974.64235 [27,] 1056.70178 323.66779 [28,] 980.27890 1056.70178 [29,] 730.50190 980.27890 [30,] 929.21391 730.50190 [31,] 1042.88847 929.21391 [32,] 632.82343 1042.88847 [33,] 310.69208 632.82343 [34,] 268.01658 310.69208 [35,] 910.24810 268.01658 [36,] 151.04939 910.24810 [37,] -81.88582 151.04939 [38,] -198.53848 -81.88582 [39,] -240.89908 -198.53848 [40,] -13.69459 -240.89908 [41,] -522.64161 -13.69459 [42,] -952.68302 -522.64161 [43,] 125.31434 -952.68302 [44,] -751.31614 125.31434 [45,] -1251.45448 -751.31614 [46,] -405.86054 -1251.45448 [47,] -401.58289 -405.86054 [48,] -180.92252 -401.58289 [49,] -363.93883 -180.92252 [50,] -690.49023 -363.93883 [51,] -306.02937 -690.49023 [52,] -28.58426 -306.02937 [53,] -466.71591 -28.58426 [54,] -292.40233 -466.71591 [55,] 455.21092 -292.40233 [56,] -235.28251 455.21092 [57,] -94.33608 -235.28251 [58,] -202.46121 -94.33608 [59,] -24.81867 -202.46121 [60,] 290.47019 -24.81867 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -627.20606 -662.68936 2 -1095.30453 -627.20606 3 -753.07989 -1095.30453 4 -592.34517 -753.07989 5 -755.19928 -592.34517 6 -178.35682 -755.19928 7 202.27351 -178.35682 8 -605.16106 202.27351 9 -253.51881 -605.16106 10 -341.23931 -253.51881 11 35.93279 -341.23931 12 220.74679 35.93279 13 336.33480 220.74679 14 -173.47968 336.33480 15 510.00403 -173.47968 16 -146.18319 510.00403 17 -328.69528 -146.18319 18 208.18121 -328.69528 19 755.38010 208.18121 20 163.37573 755.38010 21 358.79951 163.37573 22 370.98926 358.79951 23 988.37343 370.98926 24 886.88573 988.37343 25 974.64235 886.88573 26 323.66779 974.64235 27 1056.70178 323.66779 28 980.27890 1056.70178 29 730.50190 980.27890 30 929.21391 730.50190 31 1042.88847 929.21391 32 632.82343 1042.88847 33 310.69208 632.82343 34 268.01658 310.69208 35 910.24810 268.01658 36 151.04939 910.24810 37 -81.88582 151.04939 38 -198.53848 -81.88582 39 -240.89908 -198.53848 40 -13.69459 -240.89908 41 -522.64161 -13.69459 42 -952.68302 -522.64161 43 125.31434 -952.68302 44 -751.31614 125.31434 45 -1251.45448 -751.31614 46 -405.86054 -1251.45448 47 -401.58289 -405.86054 48 -180.92252 -401.58289 49 -363.93883 -180.92252 50 -690.49023 -363.93883 51 -306.02937 -690.49023 52 -28.58426 -306.02937 53 -466.71591 -28.58426 54 -292.40233 -466.71591 55 455.21092 -292.40233 56 -235.28251 455.21092 57 -94.33608 -235.28251 58 -202.46121 -94.33608 59 -24.81867 -202.46121 60 290.47019 -24.81867 > 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/fisher/rcomp/tmp/7orsq1353252786.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/fisher/rcomp/tmp/8ag651353252786.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/fisher/rcomp/tmp/9tfnl1353252786.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/fisher/rcomp/tmp/103pqh1353252786.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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='') + } + } Error: subscript out of bounds Execution halted