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.08,2.09,2.07,2.04,2.35,2.33,2.37,2.59,2.62,2.6,2.83,2.78,3.01,3.06,3.33,3.32,3.6,3.57,3.57,3.83,3.84,3.8,4.07,4.05,4.272,3.858,4.067,3.964,3.782,4.114,4.009,4.025,4.082,4.044,3.916,4.289,4.296,4.193,3.48,2.934,2.221,1.211,1.28,0.96,0.5,0.687,0.344,0.346,0.334,0.34,0.328,0.344,0.341,0.32,0.314,0.325,0.339,0.329,0.48,0.399,0.37),dim=c(1,61),dimnames=list(c('eonia'),1:61)) > y <- array(NA,dim=c(1,61),dimnames=list(c('eonia'),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 = 'Include Monthly Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x eonia M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 2.080 1 0 0 0 0 0 0 0 0 0 0 1 2 2.090 0 1 0 0 0 0 0 0 0 0 0 2 3 2.070 0 0 1 0 0 0 0 0 0 0 0 3 4 2.040 0 0 0 1 0 0 0 0 0 0 0 4 5 2.350 0 0 0 0 1 0 0 0 0 0 0 5 6 2.330 0 0 0 0 0 1 0 0 0 0 0 6 7 2.370 0 0 0 0 0 0 1 0 0 0 0 7 8 2.590 0 0 0 0 0 0 0 1 0 0 0 8 9 2.620 0 0 0 0 0 0 0 0 1 0 0 9 10 2.600 0 0 0 0 0 0 0 0 0 1 0 10 11 2.830 0 0 0 0 0 0 0 0 0 0 1 11 12 2.780 0 0 0 0 0 0 0 0 0 0 0 12 13 3.010 1 0 0 0 0 0 0 0 0 0 0 13 14 3.060 0 1 0 0 0 0 0 0 0 0 0 14 15 3.330 0 0 1 0 0 0 0 0 0 0 0 15 16 3.320 0 0 0 1 0 0 0 0 0 0 0 16 17 3.600 0 0 0 0 1 0 0 0 0 0 0 17 18 3.570 0 0 0 0 0 1 0 0 0 0 0 18 19 3.570 0 0 0 0 0 0 1 0 0 0 0 19 20 3.830 0 0 0 0 0 0 0 1 0 0 0 20 21 3.840 0 0 0 0 0 0 0 0 1 0 0 21 22 3.800 0 0 0 0 0 0 0 0 0 1 0 22 23 4.070 0 0 0 0 0 0 0 0 0 0 1 23 24 4.050 0 0 0 0 0 0 0 0 0 0 0 24 25 4.272 1 0 0 0 0 0 0 0 0 0 0 25 26 3.858 0 1 0 0 0 0 0 0 0 0 0 26 27 4.067 0 0 1 0 0 0 0 0 0 0 0 27 28 3.964 0 0 0 1 0 0 0 0 0 0 0 28 29 3.782 0 0 0 0 1 0 0 0 0 0 0 29 30 4.114 0 0 0 0 0 1 0 0 0 0 0 30 31 4.009 0 0 0 0 0 0 1 0 0 0 0 31 32 4.025 0 0 0 0 0 0 0 1 0 0 0 32 33 4.082 0 0 0 0 0 0 0 0 1 0 0 33 34 4.044 0 0 0 0 0 0 0 0 0 1 0 34 35 3.916 0 0 0 0 0 0 0 0 0 0 1 35 36 4.289 0 0 0 0 0 0 0 0 0 0 0 36 37 4.296 1 0 0 0 0 0 0 0 0 0 0 37 38 4.193 0 1 0 0 0 0 0 0 0 0 0 38 39 3.480 0 0 1 0 0 0 0 0 0 0 0 39 40 2.934 0 0 0 1 0 0 0 0 0 0 0 40 41 2.221 0 0 0 0 1 0 0 0 0 0 0 41 42 1.211 0 0 0 0 0 1 0 0 0 0 0 42 43 1.280 0 0 0 0 0 0 1 0 0 0 0 43 44 0.960 0 0 0 0 0 0 0 1 0 0 0 44 45 0.500 0 0 0 0 0 0 0 0 1 0 0 45 46 0.687 0 0 0 0 0 0 0 0 0 1 0 46 47 0.344 0 0 0 0 0 0 0 0 0 0 1 47 48 0.346 0 0 0 0 0 0 0 0 0 0 0 48 49 0.334 1 0 0 0 0 0 0 0 0 0 0 49 50 0.340 0 1 0 0 0 0 0 0 0 0 0 50 51 0.328 0 0 1 0 0 0 0 0 0 0 0 51 52 0.344 0 0 0 1 0 0 0 0 0 0 0 52 53 0.341 0 0 0 0 1 0 0 0 0 0 0 53 54 0.320 0 0 0 0 0 1 0 0 0 0 0 54 55 0.314 0 0 0 0 0 0 1 0 0 0 0 55 56 0.325 0 0 0 0 0 0 0 1 0 0 0 56 57 0.339 0 0 0 0 0 0 0 0 1 0 0 57 58 0.329 0 0 0 0 0 0 0 0 0 1 0 58 59 0.480 0 0 0 0 0 0 0 0 0 0 1 59 60 0.399 0 0 0 0 0 0 0 0 0 0 0 60 61 0.370 1 0 0 0 0 0 0 0 0 0 0 61 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) M1 M2 M3 M4 M5 4.15593 -0.22679 -0.15991 -0.16358 -0.24865 -0.26072 M6 M7 M8 M9 M10 M11 -0.36099 -0.31186 -0.22493 -0.24519 -0.17986 -0.09433 t -0.04953 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.8070 -0.9448 -0.5036 1.1476 2.1995 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 4.15593 0.70413 5.902 3.53e-07 *** M1 -0.22679 0.82117 -0.276 0.784 M2 -0.15991 0.86191 -0.186 0.854 M3 -0.16358 0.86081 -0.190 0.850 M4 -0.24865 0.85982 -0.289 0.774 M5 -0.26072 0.85895 -0.304 0.763 M6 -0.36099 0.85820 -0.421 0.676 M7 -0.31186 0.85756 -0.364 0.718 M8 -0.22493 0.85703 -0.262 0.794 M9 -0.24519 0.85663 -0.286 0.776 M10 -0.17986 0.85633 -0.210 0.835 M11 -0.09433 0.85616 -0.110 0.913 t -0.04953 0.00999 -4.958 9.29e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.354 on 48 degrees of freedom Multiple R-squared: 0.3443, Adjusted R-squared: 0.1804 F-statistic: 2.101 on 12 and 48 DF, p-value: 0.03482 > 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,] 4.067427e-03 8.134854e-03 0.9959325730 [2,] 6.810334e-04 1.362067e-03 0.9993189666 [3,] 1.019635e-04 2.039269e-04 0.9998980365 [4,] 1.348937e-05 2.697875e-05 0.9999865106 [5,] 1.803723e-06 3.607447e-06 0.9999981963 [6,] 2.153938e-07 4.307875e-07 0.9999997846 [7,] 2.556132e-08 5.112263e-08 0.9999999744 [8,] 2.997122e-09 5.994245e-09 0.9999999970 [9,] 4.349217e-10 8.698435e-10 0.9999999996 [10,] 5.523443e-11 1.104689e-10 0.9999999999 [11,] 4.438184e-09 8.876368e-09 0.9999999956 [12,] 3.769477e-09 7.538954e-09 0.9999999962 [13,] 3.609261e-09 7.218522e-09 0.9999999964 [14,] 1.439291e-07 2.878583e-07 0.9999998561 [15,] 6.760641e-08 1.352128e-07 0.9999999324 [16,] 4.488537e-08 8.977073e-08 0.9999999551 [17,] 7.510867e-08 1.502173e-07 0.9999999249 [18,] 7.852909e-08 1.570582e-07 0.9999999215 [19,] 6.655918e-08 1.331184e-07 0.9999999334 [20,] 2.590677e-07 5.181354e-07 0.9999997409 [21,] 3.141760e-07 6.283521e-07 0.9999996858 [22,] 1.250176e-06 2.500351e-06 0.9999987498 [23,] 3.972797e-05 7.945594e-05 0.9999602720 [24,] 9.635503e-03 1.927101e-02 0.9903644972 [25,] 3.698670e-01 7.397340e-01 0.6301330226 [26,] 9.464017e-01 1.071966e-01 0.0535983013 [27,] 9.876962e-01 2.460764e-02 0.0123038205 [28,] 9.974905e-01 5.019078e-03 0.0025095390 [29,] 9.990927e-01 1.814697e-03 0.0009073487 [30,] 9.959436e-01 8.112849e-03 0.0040564246 > postscript(file="/var/www/html/rcomp/tmp/1ltl31293385069.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/2ltl31293385069.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/3ltl31293385069.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/4w3ko1293385069.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/5w3ko1293385069.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 -1.79960784 -1.80695294 -1.77375294 -1.66915294 -1.29755294 -1.16775294 7 8 9 10 11 12 -1.12735294 -0.94475294 -0.84495294 -0.88075294 -0.68675294 -0.78155294 13 14 15 16 17 18 -0.27523137 -0.24257647 0.08062353 0.20522353 0.54682353 0.66662353 19 20 21 22 23 24 0.66702353 0.88962353 0.96942353 0.91362353 1.14762353 1.08282353 25 26 27 28 29 30 1.58114510 1.14980000 1.41200000 1.44360000 1.32320000 1.80500000 31 32 33 34 35 36 1.70040000 1.67900000 1.80580000 1.75200000 1.58800000 1.91620000 37 38 39 40 41 42 2.19952157 2.07917647 1.41937647 1.00797647 0.35657647 -0.50362353 43 44 45 46 47 48 -0.43422353 -0.79162353 -1.18182353 -1.01062353 -1.38962353 -1.43242353 49 50 51 52 53 54 -1.16810196 -1.17944706 -1.13824706 -0.98764706 -0.92904706 -0.80024706 55 56 57 58 59 60 -0.80584706 -0.83224706 -0.74844706 -0.77424706 -0.65924706 -0.78504706 61 -0.53772549 > postscript(file="/var/www/html/rcomp/tmp/6w3ko1293385069.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 -1.79960784 NA 1 -1.80695294 -1.79960784 2 -1.77375294 -1.80695294 3 -1.66915294 -1.77375294 4 -1.29755294 -1.66915294 5 -1.16775294 -1.29755294 6 -1.12735294 -1.16775294 7 -0.94475294 -1.12735294 8 -0.84495294 -0.94475294 9 -0.88075294 -0.84495294 10 -0.68675294 -0.88075294 11 -0.78155294 -0.68675294 12 -0.27523137 -0.78155294 13 -0.24257647 -0.27523137 14 0.08062353 -0.24257647 15 0.20522353 0.08062353 16 0.54682353 0.20522353 17 0.66662353 0.54682353 18 0.66702353 0.66662353 19 0.88962353 0.66702353 20 0.96942353 0.88962353 21 0.91362353 0.96942353 22 1.14762353 0.91362353 23 1.08282353 1.14762353 24 1.58114510 1.08282353 25 1.14980000 1.58114510 26 1.41200000 1.14980000 27 1.44360000 1.41200000 28 1.32320000 1.44360000 29 1.80500000 1.32320000 30 1.70040000 1.80500000 31 1.67900000 1.70040000 32 1.80580000 1.67900000 33 1.75200000 1.80580000 34 1.58800000 1.75200000 35 1.91620000 1.58800000 36 2.19952157 1.91620000 37 2.07917647 2.19952157 38 1.41937647 2.07917647 39 1.00797647 1.41937647 40 0.35657647 1.00797647 41 -0.50362353 0.35657647 42 -0.43422353 -0.50362353 43 -0.79162353 -0.43422353 44 -1.18182353 -0.79162353 45 -1.01062353 -1.18182353 46 -1.38962353 -1.01062353 47 -1.43242353 -1.38962353 48 -1.16810196 -1.43242353 49 -1.17944706 -1.16810196 50 -1.13824706 -1.17944706 51 -0.98764706 -1.13824706 52 -0.92904706 -0.98764706 53 -0.80024706 -0.92904706 54 -0.80584706 -0.80024706 55 -0.83224706 -0.80584706 56 -0.74844706 -0.83224706 57 -0.77424706 -0.74844706 58 -0.65924706 -0.77424706 59 -0.78504706 -0.65924706 60 -0.53772549 -0.78504706 61 NA -0.53772549 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.80695294 -1.79960784 [2,] -1.77375294 -1.80695294 [3,] -1.66915294 -1.77375294 [4,] -1.29755294 -1.66915294 [5,] -1.16775294 -1.29755294 [6,] -1.12735294 -1.16775294 [7,] -0.94475294 -1.12735294 [8,] -0.84495294 -0.94475294 [9,] -0.88075294 -0.84495294 [10,] -0.68675294 -0.88075294 [11,] -0.78155294 -0.68675294 [12,] -0.27523137 -0.78155294 [13,] -0.24257647 -0.27523137 [14,] 0.08062353 -0.24257647 [15,] 0.20522353 0.08062353 [16,] 0.54682353 0.20522353 [17,] 0.66662353 0.54682353 [18,] 0.66702353 0.66662353 [19,] 0.88962353 0.66702353 [20,] 0.96942353 0.88962353 [21,] 0.91362353 0.96942353 [22,] 1.14762353 0.91362353 [23,] 1.08282353 1.14762353 [24,] 1.58114510 1.08282353 [25,] 1.14980000 1.58114510 [26,] 1.41200000 1.14980000 [27,] 1.44360000 1.41200000 [28,] 1.32320000 1.44360000 [29,] 1.80500000 1.32320000 [30,] 1.70040000 1.80500000 [31,] 1.67900000 1.70040000 [32,] 1.80580000 1.67900000 [33,] 1.75200000 1.80580000 [34,] 1.58800000 1.75200000 [35,] 1.91620000 1.58800000 [36,] 2.19952157 1.91620000 [37,] 2.07917647 2.19952157 [38,] 1.41937647 2.07917647 [39,] 1.00797647 1.41937647 [40,] 0.35657647 1.00797647 [41,] -0.50362353 0.35657647 [42,] -0.43422353 -0.50362353 [43,] -0.79162353 -0.43422353 [44,] -1.18182353 -0.79162353 [45,] -1.01062353 -1.18182353 [46,] -1.38962353 -1.01062353 [47,] -1.43242353 -1.38962353 [48,] -1.16810196 -1.43242353 [49,] -1.17944706 -1.16810196 [50,] -1.13824706 -1.17944706 [51,] -0.98764706 -1.13824706 [52,] -0.92904706 -0.98764706 [53,] -0.80024706 -0.92904706 [54,] -0.80584706 -0.80024706 [55,] -0.83224706 -0.80584706 [56,] -0.74844706 -0.83224706 [57,] -0.77424706 -0.74844706 [58,] -0.65924706 -0.77424706 [59,] -0.78504706 -0.65924706 [60,] -0.53772549 -0.78504706 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.80695294 -1.79960784 2 -1.77375294 -1.80695294 3 -1.66915294 -1.77375294 4 -1.29755294 -1.66915294 5 -1.16775294 -1.29755294 6 -1.12735294 -1.16775294 7 -0.94475294 -1.12735294 8 -0.84495294 -0.94475294 9 -0.88075294 -0.84495294 10 -0.68675294 -0.88075294 11 -0.78155294 -0.68675294 12 -0.27523137 -0.78155294 13 -0.24257647 -0.27523137 14 0.08062353 -0.24257647 15 0.20522353 0.08062353 16 0.54682353 0.20522353 17 0.66662353 0.54682353 18 0.66702353 0.66662353 19 0.88962353 0.66702353 20 0.96942353 0.88962353 21 0.91362353 0.96942353 22 1.14762353 0.91362353 23 1.08282353 1.14762353 24 1.58114510 1.08282353 25 1.14980000 1.58114510 26 1.41200000 1.14980000 27 1.44360000 1.41200000 28 1.32320000 1.44360000 29 1.80500000 1.32320000 30 1.70040000 1.80500000 31 1.67900000 1.70040000 32 1.80580000 1.67900000 33 1.75200000 1.80580000 34 1.58800000 1.75200000 35 1.91620000 1.58800000 36 2.19952157 1.91620000 37 2.07917647 2.19952157 38 1.41937647 2.07917647 39 1.00797647 1.41937647 40 0.35657647 1.00797647 41 -0.50362353 0.35657647 42 -0.43422353 -0.50362353 43 -0.79162353 -0.43422353 44 -1.18182353 -0.79162353 45 -1.01062353 -1.18182353 46 -1.38962353 -1.01062353 47 -1.43242353 -1.38962353 48 -1.16810196 -1.43242353 49 -1.17944706 -1.16810196 50 -1.13824706 -1.17944706 51 -0.98764706 -1.13824706 52 -0.92904706 -0.98764706 53 -0.80024706 -0.92904706 54 -0.80584706 -0.80024706 55 -0.83224706 -0.80584706 56 -0.74844706 -0.83224706 57 -0.77424706 -0.74844706 58 -0.65924706 -0.77424706 59 -0.78504706 -0.65924706 60 -0.53772549 -0.78504706 > 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/76u1q1293385069.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/8zl1c1293385069.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/9zl1c1293385069.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/10acie1293385069.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/11vdgk1293385069.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/12zdxq1293385069.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/13vnvz1293385069.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/14y6tn1293385069.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/15k6at1293385069.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/16npqz1293385069.tab") + } > try(system("convert tmp/1ltl31293385069.ps tmp/1ltl31293385069.png",intern=TRUE)) character(0) > try(system("convert tmp/2ltl31293385069.ps tmp/2ltl31293385069.png",intern=TRUE)) character(0) > try(system("convert tmp/3ltl31293385069.ps tmp/3ltl31293385069.png",intern=TRUE)) character(0) > try(system("convert tmp/4w3ko1293385069.ps tmp/4w3ko1293385069.png",intern=TRUE)) character(0) > try(system("convert tmp/5w3ko1293385069.ps tmp/5w3ko1293385069.png",intern=TRUE)) character(0) > try(system("convert tmp/6w3ko1293385069.ps tmp/6w3ko1293385069.png",intern=TRUE)) character(0) > try(system("convert tmp/76u1q1293385069.ps tmp/76u1q1293385069.png",intern=TRUE)) character(0) > try(system("convert tmp/8zl1c1293385069.ps tmp/8zl1c1293385069.png",intern=TRUE)) character(0) > try(system("convert tmp/9zl1c1293385069.ps tmp/9zl1c1293385069.png",intern=TRUE)) character(0) > try(system("convert tmp/10acie1293385069.ps tmp/10acie1293385069.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.432 1.603 5.628