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(95.1,117.1,97,118.7,112.7,126.5,102.9,127.5,97.4,134.6,111.4,131.8,87.4,135.9,96.8,142.7,114.1,141.7,110.3,153.4,103.9,145,101.6,137.7,94.6,148.3,95.9,152.2,104.7,169.4,102.8,168.6,98.1,161.1,113.9,174.1,80.9,179,95.7,190.6,113.2,190,105.9,181.6,108.8,174.8,102.3,180.5,99,196.8,100.7,193.8,115.5,197,100.7,216.3,109.9,221.4,114.6,217.9,85.4,229.7,100.5,227.4,114.8,204.2,116.5,196.6,112.9,198.8,102,207.5,106,190.7,105.3,201.6,118.8,210.5,106.1,223.5,109.3,223.8,117.2,231.2,92.5,244,104.2,234.7,112.5,250.2,122.4,265.7,113.3,287.6,100,283.3,110.7,295.4,112.8,312.3,109.8,333.8,117.3,347.7,109.1,383.2,115.9,407.1,96,413.6,99.8,362.7,116.8,321.9,115.7,239.4,99.4,191,94.3,159.7,91,163.4),dim=c(2,61),dimnames=list(c('tot.ind.prod.index','prijsindex.grondst.incl.energie'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('tot.ind.prod.index','prijsindex.grondst.incl.energie'),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 tot.ind.prod.index prijsindex.grondst.incl.energie M1 M2 M3 M4 M5 M6 M7 M8 1 95.1 117.1 1 0 0 0 0 0 0 0 2 97.0 118.7 0 1 0 0 0 0 0 0 3 112.7 126.5 0 0 1 0 0 0 0 0 4 102.9 127.5 0 0 0 1 0 0 0 0 5 97.4 134.6 0 0 0 0 1 0 0 0 6 111.4 131.8 0 0 0 0 0 1 0 0 7 87.4 135.9 0 0 0 0 0 0 1 0 8 96.8 142.7 0 0 0 0 0 0 0 1 9 114.1 141.7 0 0 0 0 0 0 0 0 10 110.3 153.4 0 0 0 0 0 0 0 0 11 103.9 145.0 0 0 0 0 0 0 0 0 12 101.6 137.7 0 0 0 0 0 0 0 0 13 94.6 148.3 1 0 0 0 0 0 0 0 14 95.9 152.2 0 1 0 0 0 0 0 0 15 104.7 169.4 0 0 1 0 0 0 0 0 16 102.8 168.6 0 0 0 1 0 0 0 0 17 98.1 161.1 0 0 0 0 1 0 0 0 18 113.9 174.1 0 0 0 0 0 1 0 0 19 80.9 179.0 0 0 0 0 0 0 1 0 20 95.7 190.6 0 0 0 0 0 0 0 1 21 113.2 190.0 0 0 0 0 0 0 0 0 22 105.9 181.6 0 0 0 0 0 0 0 0 23 108.8 174.8 0 0 0 0 0 0 0 0 24 102.3 180.5 0 0 0 0 0 0 0 0 25 99.0 196.8 1 0 0 0 0 0 0 0 26 100.7 193.8 0 1 0 0 0 0 0 0 27 115.5 197.0 0 0 1 0 0 0 0 0 28 100.7 216.3 0 0 0 1 0 0 0 0 29 109.9 221.4 0 0 0 0 1 0 0 0 30 114.6 217.9 0 0 0 0 0 1 0 0 31 85.4 229.7 0 0 0 0 0 0 1 0 32 100.5 227.4 0 0 0 0 0 0 0 1 33 114.8 204.2 0 0 0 0 0 0 0 0 34 116.5 196.6 0 0 0 0 0 0 0 0 35 112.9 198.8 0 0 0 0 0 0 0 0 36 102.0 207.5 0 0 0 0 0 0 0 0 37 106.0 190.7 1 0 0 0 0 0 0 0 38 105.3 201.6 0 1 0 0 0 0 0 0 39 118.8 210.5 0 0 1 0 0 0 0 0 40 106.1 223.5 0 0 0 1 0 0 0 0 41 109.3 223.8 0 0 0 0 1 0 0 0 42 117.2 231.2 0 0 0 0 0 1 0 0 43 92.5 244.0 0 0 0 0 0 0 1 0 44 104.2 234.7 0 0 0 0 0 0 0 1 45 112.5 250.2 0 0 0 0 0 0 0 0 46 122.4 265.7 0 0 0 0 0 0 0 0 47 113.3 287.6 0 0 0 0 0 0 0 0 48 100.0 283.3 0 0 0 0 0 0 0 0 49 110.7 295.4 1 0 0 0 0 0 0 0 50 112.8 312.3 0 1 0 0 0 0 0 0 51 109.8 333.8 0 0 1 0 0 0 0 0 52 117.3 347.7 0 0 0 1 0 0 0 0 53 109.1 383.2 0 0 0 0 1 0 0 0 54 115.9 407.1 0 0 0 0 0 1 0 0 55 96.0 413.6 0 0 0 0 0 0 1 0 56 99.8 362.7 0 0 0 0 0 0 0 1 57 116.8 321.9 0 0 0 0 0 0 0 0 58 115.7 239.4 0 0 0 0 0 0 0 0 59 99.4 191.0 0 0 0 0 0 0 0 0 60 94.3 159.7 0 0 0 0 0 0 0 0 61 91.0 163.4 1 0 0 0 0 0 0 0 M9 M10 M11 t 1 0 0 0 1 2 0 0 0 2 3 0 0 0 3 4 0 0 0 4 5 0 0 0 5 6 0 0 0 6 7 0 0 0 7 8 0 0 0 8 9 1 0 0 9 10 0 1 0 10 11 0 0 1 11 12 0 0 0 12 13 0 0 0 13 14 0 0 0 14 15 0 0 0 15 16 0 0 0 16 17 0 0 0 17 18 0 0 0 18 19 0 0 0 19 20 0 0 0 20 21 1 0 0 21 22 0 1 0 22 23 0 0 1 23 24 0 0 0 24 25 0 0 0 25 26 0 0 0 26 27 0 0 0 27 28 0 0 0 28 29 0 0 0 29 30 0 0 0 30 31 0 0 0 31 32 0 0 0 32 33 1 0 0 33 34 0 1 0 34 35 0 0 1 35 36 0 0 0 36 37 0 0 0 37 38 0 0 0 38 39 0 0 0 39 40 0 0 0 40 41 0 0 0 41 42 0 0 0 42 43 0 0 0 43 44 0 0 0 44 45 1 0 0 45 46 0 1 0 46 47 0 0 1 47 48 0 0 0 48 49 0 0 0 49 50 0 0 0 50 51 0 0 0 51 52 0 0 0 52 53 0 0 0 53 54 0 0 0 54 55 0 0 0 55 56 0 0 0 56 57 1 0 0 57 58 0 1 0 58 59 0 0 1 59 60 0 0 0 60 61 0 0 0 61 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) prijsindex.grondst.incl.energie 91.82251 0.04658 M1 M2 -0.35816 1.98362 M3 M4 11.42012 4.67027 M5 M6 3.11538 12.62379 M7 M8 -13.88737 -2.49412 M9 M10 12.87503 13.44168 M11 t 7.33208 -0.02242 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -7.8479 -2.8432 0.5579 3.0038 6.6264 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 91.82251 2.60259 35.281 < 2e-16 *** prijsindex.grondst.incl.energie 0.04658 0.01450 3.213 0.002374 ** M1 -0.35816 2.75546 -0.130 0.897135 M2 1.98362 2.93332 0.676 0.502205 M3 11.42012 2.95321 3.867 0.000338 *** M4 4.67027 2.96968 1.573 0.122508 M5 3.11538 2.98442 1.044 0.301879 M6 12.62379 2.99903 4.209 0.000115 *** M7 -13.88737 3.01709 -4.603 3.18e-05 *** M8 -2.49412 2.96690 -0.841 0.404802 M9 12.87503 2.92346 4.404 6.10e-05 *** M10 13.44168 2.88577 4.658 2.65e-05 *** M11 7.33208 2.87329 2.552 0.014028 * t -0.02242 0.05818 -0.385 0.701795 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 4.538 on 47 degrees of freedom Multiple R-squared: 0.8058, Adjusted R-squared: 0.752 F-statistic: 15 on 13 and 47 DF, p-value: 1.482e-12 > 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.09377934 0.18755869 0.9062207 [2,] 0.11919618 0.23839236 0.8808038 [3,] 0.08596242 0.17192484 0.9140376 [4,] 0.05178696 0.10357391 0.9482130 [5,] 0.02649644 0.05299288 0.9735036 [6,] 0.03241225 0.06482451 0.9675877 [7,] 0.03913291 0.07826581 0.9608671 [8,] 0.02284128 0.04568255 0.9771587 [9,] 0.03967846 0.07935693 0.9603215 [10,] 0.05217972 0.10435943 0.9478203 [11,] 0.05424689 0.10849378 0.9457531 [12,] 0.08151674 0.16303348 0.9184833 [13,] 0.26117765 0.52235530 0.7388223 [14,] 0.18955342 0.37910685 0.8104466 [15,] 0.22860572 0.45721145 0.7713943 [16,] 0.19071888 0.38143777 0.8092811 [17,] 0.13654755 0.27309509 0.8634525 [18,] 0.18756663 0.37513326 0.8124334 [19,] 0.13595884 0.27191768 0.8640412 [20,] 0.10251857 0.20503714 0.8974814 [21,] 0.07120307 0.14240615 0.9287969 [22,] 0.07489532 0.14979065 0.9251047 [23,] 0.10658346 0.21316692 0.8934165 [24,] 0.27071365 0.54142729 0.7292864 [25,] 0.18423311 0.36846622 0.8157669 [26,] 0.14459023 0.28918046 0.8554098 [27,] 0.08470029 0.16940057 0.9152997 [28,] 0.15331835 0.30663670 0.8466816 > postscript(file="/var/www/html/rcomp/tmp/1p85f1258644475.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/2dl5b1258644475.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/3n0yx1258644475.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/4gm3a1258644475.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/5hysq1258644475.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 = 61 Frequency = 1 1 2 3 4 5 6 -1.79646511 -2.29036130 3.63223281 0.55791628 -3.69550359 0.94892977 7 8 9 10 11 12 3.29152388 1.00394225 3.00378947 -1.88543070 -1.76214064 3.63238757 13 14 15 16 17 18 -3.48078371 -4.68181420 -6.09707331 -1.18754560 -3.96089557 1.74757173 19 20 21 22 23 24 -4.94709827 -2.05826452 0.12295065 -7.33000891 2.01875295 2.60773946 25 26 27 28 29 30 -1.07093856 -1.55056615 3.68629656 -5.24043635 5.29930404 0.67634349 31 32 33 34 35 36 -2.53972940 1.29656815 1.33049426 2.84027060 5.26981128 1.31905741 37 38 39 40 41 42 6.48218169 2.95509029 6.62644626 0.09316818 4.85649319 2.92580922 43 44 45 46 47 48 4.16315620 4.92551466 -2.84321026 5.79056507 1.80247719 -3.94273499 49 50 51 52 53 54 6.57422354 5.56765136 -7.84790231 5.77689749 -2.49939808 -6.29865420 55 56 57 58 59 60 0.03214760 -5.16776053 -1.61402413 0.58460395 -7.32890079 -3.61644946 61 -6.70821784 > postscript(file="/var/www/html/rcomp/tmp/68jp21258644475.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 -1.79646511 NA 1 -2.29036130 -1.79646511 2 3.63223281 -2.29036130 3 0.55791628 3.63223281 4 -3.69550359 0.55791628 5 0.94892977 -3.69550359 6 3.29152388 0.94892977 7 1.00394225 3.29152388 8 3.00378947 1.00394225 9 -1.88543070 3.00378947 10 -1.76214064 -1.88543070 11 3.63238757 -1.76214064 12 -3.48078371 3.63238757 13 -4.68181420 -3.48078371 14 -6.09707331 -4.68181420 15 -1.18754560 -6.09707331 16 -3.96089557 -1.18754560 17 1.74757173 -3.96089557 18 -4.94709827 1.74757173 19 -2.05826452 -4.94709827 20 0.12295065 -2.05826452 21 -7.33000891 0.12295065 22 2.01875295 -7.33000891 23 2.60773946 2.01875295 24 -1.07093856 2.60773946 25 -1.55056615 -1.07093856 26 3.68629656 -1.55056615 27 -5.24043635 3.68629656 28 5.29930404 -5.24043635 29 0.67634349 5.29930404 30 -2.53972940 0.67634349 31 1.29656815 -2.53972940 32 1.33049426 1.29656815 33 2.84027060 1.33049426 34 5.26981128 2.84027060 35 1.31905741 5.26981128 36 6.48218169 1.31905741 37 2.95509029 6.48218169 38 6.62644626 2.95509029 39 0.09316818 6.62644626 40 4.85649319 0.09316818 41 2.92580922 4.85649319 42 4.16315620 2.92580922 43 4.92551466 4.16315620 44 -2.84321026 4.92551466 45 5.79056507 -2.84321026 46 1.80247719 5.79056507 47 -3.94273499 1.80247719 48 6.57422354 -3.94273499 49 5.56765136 6.57422354 50 -7.84790231 5.56765136 51 5.77689749 -7.84790231 52 -2.49939808 5.77689749 53 -6.29865420 -2.49939808 54 0.03214760 -6.29865420 55 -5.16776053 0.03214760 56 -1.61402413 -5.16776053 57 0.58460395 -1.61402413 58 -7.32890079 0.58460395 59 -3.61644946 -7.32890079 60 -6.70821784 -3.61644946 61 NA -6.70821784 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -2.29036130 -1.79646511 [2,] 3.63223281 -2.29036130 [3,] 0.55791628 3.63223281 [4,] -3.69550359 0.55791628 [5,] 0.94892977 -3.69550359 [6,] 3.29152388 0.94892977 [7,] 1.00394225 3.29152388 [8,] 3.00378947 1.00394225 [9,] -1.88543070 3.00378947 [10,] -1.76214064 -1.88543070 [11,] 3.63238757 -1.76214064 [12,] -3.48078371 3.63238757 [13,] -4.68181420 -3.48078371 [14,] -6.09707331 -4.68181420 [15,] -1.18754560 -6.09707331 [16,] -3.96089557 -1.18754560 [17,] 1.74757173 -3.96089557 [18,] -4.94709827 1.74757173 [19,] -2.05826452 -4.94709827 [20,] 0.12295065 -2.05826452 [21,] -7.33000891 0.12295065 [22,] 2.01875295 -7.33000891 [23,] 2.60773946 2.01875295 [24,] -1.07093856 2.60773946 [25,] -1.55056615 -1.07093856 [26,] 3.68629656 -1.55056615 [27,] -5.24043635 3.68629656 [28,] 5.29930404 -5.24043635 [29,] 0.67634349 5.29930404 [30,] -2.53972940 0.67634349 [31,] 1.29656815 -2.53972940 [32,] 1.33049426 1.29656815 [33,] 2.84027060 1.33049426 [34,] 5.26981128 2.84027060 [35,] 1.31905741 5.26981128 [36,] 6.48218169 1.31905741 [37,] 2.95509029 6.48218169 [38,] 6.62644626 2.95509029 [39,] 0.09316818 6.62644626 [40,] 4.85649319 0.09316818 [41,] 2.92580922 4.85649319 [42,] 4.16315620 2.92580922 [43,] 4.92551466 4.16315620 [44,] -2.84321026 4.92551466 [45,] 5.79056507 -2.84321026 [46,] 1.80247719 5.79056507 [47,] -3.94273499 1.80247719 [48,] 6.57422354 -3.94273499 [49,] 5.56765136 6.57422354 [50,] -7.84790231 5.56765136 [51,] 5.77689749 -7.84790231 [52,] -2.49939808 5.77689749 [53,] -6.29865420 -2.49939808 [54,] 0.03214760 -6.29865420 [55,] -5.16776053 0.03214760 [56,] -1.61402413 -5.16776053 [57,] 0.58460395 -1.61402413 [58,] -7.32890079 0.58460395 [59,] -3.61644946 -7.32890079 [60,] -6.70821784 -3.61644946 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -2.29036130 -1.79646511 2 3.63223281 -2.29036130 3 0.55791628 3.63223281 4 -3.69550359 0.55791628 5 0.94892977 -3.69550359 6 3.29152388 0.94892977 7 1.00394225 3.29152388 8 3.00378947 1.00394225 9 -1.88543070 3.00378947 10 -1.76214064 -1.88543070 11 3.63238757 -1.76214064 12 -3.48078371 3.63238757 13 -4.68181420 -3.48078371 14 -6.09707331 -4.68181420 15 -1.18754560 -6.09707331 16 -3.96089557 -1.18754560 17 1.74757173 -3.96089557 18 -4.94709827 1.74757173 19 -2.05826452 -4.94709827 20 0.12295065 -2.05826452 21 -7.33000891 0.12295065 22 2.01875295 -7.33000891 23 2.60773946 2.01875295 24 -1.07093856 2.60773946 25 -1.55056615 -1.07093856 26 3.68629656 -1.55056615 27 -5.24043635 3.68629656 28 5.29930404 -5.24043635 29 0.67634349 5.29930404 30 -2.53972940 0.67634349 31 1.29656815 -2.53972940 32 1.33049426 1.29656815 33 2.84027060 1.33049426 34 5.26981128 2.84027060 35 1.31905741 5.26981128 36 6.48218169 1.31905741 37 2.95509029 6.48218169 38 6.62644626 2.95509029 39 0.09316818 6.62644626 40 4.85649319 0.09316818 41 2.92580922 4.85649319 42 4.16315620 2.92580922 43 4.92551466 4.16315620 44 -2.84321026 4.92551466 45 5.79056507 -2.84321026 46 1.80247719 5.79056507 47 -3.94273499 1.80247719 48 6.57422354 -3.94273499 49 5.56765136 6.57422354 50 -7.84790231 5.56765136 51 5.77689749 -7.84790231 52 -2.49939808 5.77689749 53 -6.29865420 -2.49939808 54 0.03214760 -6.29865420 55 -5.16776053 0.03214760 56 -1.61402413 -5.16776053 57 0.58460395 -1.61402413 58 -7.32890079 0.58460395 59 -3.61644946 -7.32890079 60 -6.70821784 -3.61644946 > 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/7n2xt1258644475.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/8r8o21258644475.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/97khd1258644475.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/10v3c11258644475.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/11vcnx1258644475.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/1246qw1258644475.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/13wart1258644475.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/14p4a71258644475.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/156oqh1258644475.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/16sqpj1258644475.tab") + } > > system("convert tmp/1p85f1258644475.ps tmp/1p85f1258644475.png") > system("convert tmp/2dl5b1258644475.ps tmp/2dl5b1258644475.png") > system("convert tmp/3n0yx1258644475.ps tmp/3n0yx1258644475.png") > system("convert tmp/4gm3a1258644475.ps tmp/4gm3a1258644475.png") > system("convert tmp/5hysq1258644475.ps tmp/5hysq1258644475.png") > system("convert tmp/68jp21258644475.ps tmp/68jp21258644475.png") > system("convert tmp/7n2xt1258644475.ps tmp/7n2xt1258644475.png") > system("convert tmp/8r8o21258644475.ps tmp/8r8o21258644475.png") > system("convert tmp/97khd1258644475.ps tmp/97khd1258644475.png") > system("convert tmp/10v3c11258644475.ps tmp/10v3c11258644475.png") > > > proc.time() user system elapsed 2.352 1.535 2.850