R version 2.7.0 (2008-04-22) Copyright (C) 2008 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(91.2,0,99.2,0,108.2,0,101.5,0,106.9,0,104.4,0,77.9,0,60,0,99.5,0,95,0,105.6,0,102.5,0,93.3,0,97.3,0,127,0,111.7,0,96.4,0,133,0,72.2,0,95.8,0,124.1,0,127.6,0,110.7,0,104.6,0,112.7,0,115.3,0,139.4,0,119,0,97.4,0,154,0,81.5,0,88.8,0,127.7,1,105.1,1,114.9,1,106.4,1,104.5,1,121.6,1,141.4,1,99,1,126.7,1,134.1,1,81.3,1,88.6,1,132.7,1,132.9,1,134.4,1,103.7,1,119.7,1,115,1,132.9,1,108.5,1,113.9,1,142,1,97.7,1,92.2,1,128.8,1,134.9,1,128.2,1,114.8,1),dim=c(2,60),dimnames=list(c('Transportmiddelen','Conjunctuur'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Transportmiddelen','Conjunctuur'),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Include Monthly Dummies' > par1 = '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 Transportmiddelen Conjunctuur M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 91.2 0 1 0 0 0 0 0 0 0 0 0 0 2 99.2 0 0 1 0 0 0 0 0 0 0 0 0 3 108.2 0 0 0 1 0 0 0 0 0 0 0 0 4 101.5 0 0 0 0 1 0 0 0 0 0 0 0 5 106.9 0 0 0 0 0 1 0 0 0 0 0 0 6 104.4 0 0 0 0 0 0 1 0 0 0 0 0 7 77.9 0 0 0 0 0 0 0 1 0 0 0 0 8 60.0 0 0 0 0 0 0 0 0 1 0 0 0 9 99.5 0 0 0 0 0 0 0 0 0 1 0 0 10 95.0 0 0 0 0 0 0 0 0 0 0 1 0 11 105.6 0 0 0 0 0 0 0 0 0 0 0 1 12 102.5 0 0 0 0 0 0 0 0 0 0 0 0 13 93.3 0 1 0 0 0 0 0 0 0 0 0 0 14 97.3 0 0 1 0 0 0 0 0 0 0 0 0 15 127.0 0 0 0 1 0 0 0 0 0 0 0 0 16 111.7 0 0 0 0 1 0 0 0 0 0 0 0 17 96.4 0 0 0 0 0 1 0 0 0 0 0 0 18 133.0 0 0 0 0 0 0 1 0 0 0 0 0 19 72.2 0 0 0 0 0 0 0 1 0 0 0 0 20 95.8 0 0 0 0 0 0 0 0 1 0 0 0 21 124.1 0 0 0 0 0 0 0 0 0 1 0 0 22 127.6 0 0 0 0 0 0 0 0 0 0 1 0 23 110.7 0 0 0 0 0 0 0 0 0 0 0 1 24 104.6 0 0 0 0 0 0 0 0 0 0 0 0 25 112.7 0 1 0 0 0 0 0 0 0 0 0 0 26 115.3 0 0 1 0 0 0 0 0 0 0 0 0 27 139.4 0 0 0 1 0 0 0 0 0 0 0 0 28 119.0 0 0 0 0 1 0 0 0 0 0 0 0 29 97.4 0 0 0 0 0 1 0 0 0 0 0 0 30 154.0 0 0 0 0 0 0 1 0 0 0 0 0 31 81.5 0 0 0 0 0 0 0 1 0 0 0 0 32 88.8 0 0 0 0 0 0 0 0 1 0 0 0 33 127.7 1 0 0 0 0 0 0 0 0 1 0 0 34 105.1 1 0 0 0 0 0 0 0 0 0 1 0 35 114.9 1 0 0 0 0 0 0 0 0 0 0 1 36 106.4 1 0 0 0 0 0 0 0 0 0 0 0 37 104.5 1 1 0 0 0 0 0 0 0 0 0 0 38 121.6 1 0 1 0 0 0 0 0 0 0 0 0 39 141.4 1 0 0 1 0 0 0 0 0 0 0 0 40 99.0 1 0 0 0 1 0 0 0 0 0 0 0 41 126.7 1 0 0 0 0 1 0 0 0 0 0 0 42 134.1 1 0 0 0 0 0 1 0 0 0 0 0 43 81.3 1 0 0 0 0 0 0 1 0 0 0 0 44 88.6 1 0 0 0 0 0 0 0 1 0 0 0 45 132.7 1 0 0 0 0 0 0 0 0 1 0 0 46 132.9 1 0 0 0 0 0 0 0 0 0 1 0 47 134.4 1 0 0 0 0 0 0 0 0 0 0 1 48 103.7 1 0 0 0 0 0 0 0 0 0 0 0 49 119.7 1 1 0 0 0 0 0 0 0 0 0 0 50 115.0 1 0 1 0 0 0 0 0 0 0 0 0 51 132.9 1 0 0 1 0 0 0 0 0 0 0 0 52 108.5 1 0 0 0 1 0 0 0 0 0 0 0 53 113.9 1 0 0 0 0 1 0 0 0 0 0 0 54 142.0 1 0 0 0 0 0 1 0 0 0 0 0 55 97.7 1 0 0 0 0 0 0 1 0 0 0 0 56 92.2 1 0 0 0 0 0 0 0 1 0 0 0 57 128.8 1 0 0 0 0 0 0 0 0 1 0 0 58 134.9 1 0 0 0 0 0 0 0 0 0 1 0 59 128.2 1 0 0 0 0 0 0 0 0 0 0 1 60 114.8 1 0 0 0 0 0 0 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Conjunctuur M1 M2 M3 M4 99.6558 11.2403 0.1281 5.5281 25.6281 3.7881 M5 M6 M7 M8 M9 M10 4.1081 29.3481 -22.0319 -19.0719 16.1600 12.7000 M11 12.3600 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -24.6039 -6.4328 0.5099 8.2261 24.9961 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 99.6558 5.3784 18.529 < 2e-16 *** Conjunctuur 11.2403 2.9880 3.762 0.000467 *** M1 0.1281 7.1961 0.018 0.985878 M2 5.5281 7.1961 0.768 0.446208 M3 25.6281 7.1961 3.561 0.000858 *** M4 3.7881 7.1961 0.526 0.601081 M5 4.1081 7.1961 0.571 0.570804 M6 29.3481 7.1961 4.078 0.000174 *** M7 -22.0319 7.1961 -3.062 0.003634 ** M8 -19.0719 7.1961 -2.650 0.010922 * M9 16.1600 7.1712 2.253 0.028936 * M10 12.7000 7.1712 1.771 0.083050 . M11 12.3600 7.1712 1.724 0.091361 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 11.34 on 47 degrees of freedom Multiple R-squared: 0.7176, Adjusted R-squared: 0.6455 F-statistic: 9.954 on 12 and 47 DF, p-value: 2.775e-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,] 0.5610891 0.87782179 0.438910893 [2,] 0.5146958 0.97060833 0.485304164 [3,] 0.8323253 0.33534947 0.167674734 [4,] 0.7778205 0.44435910 0.222179548 [5,] 0.9487018 0.10259637 0.051298185 [6,] 0.9593921 0.08121579 0.040607895 [7,] 0.9791880 0.04162402 0.020812012 [8,] 0.9724637 0.05507265 0.027536325 [9,] 0.9524570 0.09508594 0.047542972 [10,] 0.9509828 0.09803442 0.049017209 [11,] 0.9405709 0.11885824 0.059429122 [12,] 0.9380475 0.12390499 0.061952495 [13,] 0.9413751 0.11724982 0.058624911 [14,] 0.9553283 0.08934348 0.044671742 [15,] 0.9849383 0.03012341 0.015061705 [16,] 0.9741787 0.05164255 0.025821273 [17,] 0.9578054 0.08438912 0.042194558 [18,] 0.9298371 0.14032581 0.070162905 [19,] 0.9878352 0.02432958 0.012164790 [20,] 0.9921495 0.01570107 0.007850536 [21,] 0.9838999 0.03220029 0.016100143 [22,] 0.9855682 0.02886354 0.014431770 [23,] 0.9759461 0.04810775 0.024053873 [24,] 0.9631477 0.07370469 0.036852346 [25,] 0.9536079 0.09278416 0.046392078 [26,] 0.9555245 0.08895101 0.044475507 [27,] 0.9246355 0.15072907 0.075364535 [28,] 0.9628616 0.07427688 0.037138439 [29,] 0.9029971 0.19400574 0.097002872 > postscript(file="/var/www/html/rcomp/tmp/1tk9p1229093694.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/24h7c1229093694.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/3oc791229093694.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/49om51229093694.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/5on4s1229093694.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 = 60 Frequency = 1 1 2 3 4 5 6 -8.5838889 -5.9838889 -17.0838889 -1.9438889 3.1361111 -24.6038889 7 8 9 10 11 12 0.2761111 -20.5838889 -16.3158333 -17.3558333 -6.4158333 2.8441667 13 14 15 16 17 18 -6.4838889 -7.8838889 1.7161111 8.2561111 -7.3638889 3.9961111 19 20 21 22 23 24 -5.4238889 15.2161111 8.2841667 15.2441667 -1.3158333 4.9441667 25 26 27 28 29 30 12.9161111 10.1161111 14.1161111 15.5561111 -6.3638889 24.9961111 31 32 33 34 35 36 3.8761111 8.2161111 0.6438889 -18.4961111 -8.3561111 -4.4961111 37 38 39 40 41 42 -6.5241667 5.1758333 4.8758333 -15.6841667 11.6958333 -6.1441667 43 44 45 46 47 48 -7.5641667 -3.2241667 5.6438889 9.3038889 11.1438889 -7.1961111 49 50 51 52 53 54 8.6758333 -1.4241667 -3.6241667 -6.1841667 -1.1041667 1.7558333 55 56 57 58 59 60 8.8358333 0.3758333 1.7438889 11.3038889 4.9438889 3.9038889 > postscript(file="/var/www/html/rcomp/tmp/627ao1229093694.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 = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 -8.5838889 NA 1 -5.9838889 -8.5838889 2 -17.0838889 -5.9838889 3 -1.9438889 -17.0838889 4 3.1361111 -1.9438889 5 -24.6038889 3.1361111 6 0.2761111 -24.6038889 7 -20.5838889 0.2761111 8 -16.3158333 -20.5838889 9 -17.3558333 -16.3158333 10 -6.4158333 -17.3558333 11 2.8441667 -6.4158333 12 -6.4838889 2.8441667 13 -7.8838889 -6.4838889 14 1.7161111 -7.8838889 15 8.2561111 1.7161111 16 -7.3638889 8.2561111 17 3.9961111 -7.3638889 18 -5.4238889 3.9961111 19 15.2161111 -5.4238889 20 8.2841667 15.2161111 21 15.2441667 8.2841667 22 -1.3158333 15.2441667 23 4.9441667 -1.3158333 24 12.9161111 4.9441667 25 10.1161111 12.9161111 26 14.1161111 10.1161111 27 15.5561111 14.1161111 28 -6.3638889 15.5561111 29 24.9961111 -6.3638889 30 3.8761111 24.9961111 31 8.2161111 3.8761111 32 0.6438889 8.2161111 33 -18.4961111 0.6438889 34 -8.3561111 -18.4961111 35 -4.4961111 -8.3561111 36 -6.5241667 -4.4961111 37 5.1758333 -6.5241667 38 4.8758333 5.1758333 39 -15.6841667 4.8758333 40 11.6958333 -15.6841667 41 -6.1441667 11.6958333 42 -7.5641667 -6.1441667 43 -3.2241667 -7.5641667 44 5.6438889 -3.2241667 45 9.3038889 5.6438889 46 11.1438889 9.3038889 47 -7.1961111 11.1438889 48 8.6758333 -7.1961111 49 -1.4241667 8.6758333 50 -3.6241667 -1.4241667 51 -6.1841667 -3.6241667 52 -1.1041667 -6.1841667 53 1.7558333 -1.1041667 54 8.8358333 1.7558333 55 0.3758333 8.8358333 56 1.7438889 0.3758333 57 11.3038889 1.7438889 58 4.9438889 11.3038889 59 3.9038889 4.9438889 60 NA 3.9038889 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -5.9838889 -8.5838889 [2,] -17.0838889 -5.9838889 [3,] -1.9438889 -17.0838889 [4,] 3.1361111 -1.9438889 [5,] -24.6038889 3.1361111 [6,] 0.2761111 -24.6038889 [7,] -20.5838889 0.2761111 [8,] -16.3158333 -20.5838889 [9,] -17.3558333 -16.3158333 [10,] -6.4158333 -17.3558333 [11,] 2.8441667 -6.4158333 [12,] -6.4838889 2.8441667 [13,] -7.8838889 -6.4838889 [14,] 1.7161111 -7.8838889 [15,] 8.2561111 1.7161111 [16,] -7.3638889 8.2561111 [17,] 3.9961111 -7.3638889 [18,] -5.4238889 3.9961111 [19,] 15.2161111 -5.4238889 [20,] 8.2841667 15.2161111 [21,] 15.2441667 8.2841667 [22,] -1.3158333 15.2441667 [23,] 4.9441667 -1.3158333 [24,] 12.9161111 4.9441667 [25,] 10.1161111 12.9161111 [26,] 14.1161111 10.1161111 [27,] 15.5561111 14.1161111 [28,] -6.3638889 15.5561111 [29,] 24.9961111 -6.3638889 [30,] 3.8761111 24.9961111 [31,] 8.2161111 3.8761111 [32,] 0.6438889 8.2161111 [33,] -18.4961111 0.6438889 [34,] -8.3561111 -18.4961111 [35,] -4.4961111 -8.3561111 [36,] -6.5241667 -4.4961111 [37,] 5.1758333 -6.5241667 [38,] 4.8758333 5.1758333 [39,] -15.6841667 4.8758333 [40,] 11.6958333 -15.6841667 [41,] -6.1441667 11.6958333 [42,] -7.5641667 -6.1441667 [43,] -3.2241667 -7.5641667 [44,] 5.6438889 -3.2241667 [45,] 9.3038889 5.6438889 [46,] 11.1438889 9.3038889 [47,] -7.1961111 11.1438889 [48,] 8.6758333 -7.1961111 [49,] -1.4241667 8.6758333 [50,] -3.6241667 -1.4241667 [51,] -6.1841667 -3.6241667 [52,] -1.1041667 -6.1841667 [53,] 1.7558333 -1.1041667 [54,] 8.8358333 1.7558333 [55,] 0.3758333 8.8358333 [56,] 1.7438889 0.3758333 [57,] 11.3038889 1.7438889 [58,] 4.9438889 11.3038889 [59,] 3.9038889 4.9438889 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -5.9838889 -8.5838889 2 -17.0838889 -5.9838889 3 -1.9438889 -17.0838889 4 3.1361111 -1.9438889 5 -24.6038889 3.1361111 6 0.2761111 -24.6038889 7 -20.5838889 0.2761111 8 -16.3158333 -20.5838889 9 -17.3558333 -16.3158333 10 -6.4158333 -17.3558333 11 2.8441667 -6.4158333 12 -6.4838889 2.8441667 13 -7.8838889 -6.4838889 14 1.7161111 -7.8838889 15 8.2561111 1.7161111 16 -7.3638889 8.2561111 17 3.9961111 -7.3638889 18 -5.4238889 3.9961111 19 15.2161111 -5.4238889 20 8.2841667 15.2161111 21 15.2441667 8.2841667 22 -1.3158333 15.2441667 23 4.9441667 -1.3158333 24 12.9161111 4.9441667 25 10.1161111 12.9161111 26 14.1161111 10.1161111 27 15.5561111 14.1161111 28 -6.3638889 15.5561111 29 24.9961111 -6.3638889 30 3.8761111 24.9961111 31 8.2161111 3.8761111 32 0.6438889 8.2161111 33 -18.4961111 0.6438889 34 -8.3561111 -18.4961111 35 -4.4961111 -8.3561111 36 -6.5241667 -4.4961111 37 5.1758333 -6.5241667 38 4.8758333 5.1758333 39 -15.6841667 4.8758333 40 11.6958333 -15.6841667 41 -6.1441667 11.6958333 42 -7.5641667 -6.1441667 43 -3.2241667 -7.5641667 44 5.6438889 -3.2241667 45 9.3038889 5.6438889 46 11.1438889 9.3038889 47 -7.1961111 11.1438889 48 8.6758333 -7.1961111 49 -1.4241667 8.6758333 50 -3.6241667 -1.4241667 51 -6.1841667 -3.6241667 52 -1.1041667 -6.1841667 53 1.7558333 -1.1041667 54 8.8358333 1.7558333 55 0.3758333 8.8358333 56 1.7438889 0.3758333 57 11.3038889 1.7438889 58 4.9438889 11.3038889 59 3.9038889 4.9438889 > 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/7obr81229093694.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/8opfe1229093694.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/9cdak1229093694.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/10fv7i1229093694.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/11c88e1229093694.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/12y3vc1229093694.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/137q9c1229093694.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/14hjb91229093694.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/150ya31229093694.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/16u0dz1229093694.tab") + } > > system("convert tmp/1tk9p1229093694.ps tmp/1tk9p1229093694.png") > system("convert tmp/24h7c1229093694.ps tmp/24h7c1229093694.png") > system("convert tmp/3oc791229093694.ps tmp/3oc791229093694.png") > system("convert tmp/49om51229093694.ps tmp/49om51229093694.png") > system("convert tmp/5on4s1229093694.ps tmp/5on4s1229093694.png") > system("convert tmp/627ao1229093694.ps tmp/627ao1229093694.png") > system("convert tmp/7obr81229093694.ps tmp/7obr81229093694.png") > system("convert tmp/8opfe1229093694.ps tmp/8opfe1229093694.png") > system("convert tmp/9cdak1229093694.ps tmp/9cdak1229093694.png") > system("convert tmp/10fv7i1229093694.ps tmp/10fv7i1229093694.png") > > > proc.time() user system elapsed 4.940 2.722 5.357