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(216.234,627,213.586,696,209.465,825,204.045,677,200.237,656,203.666,785,241.476,412,260.307,352,243.324,839,244.460,729,233.575,696,237.217,641,235.243,695,230.354,638,227.184,762,221.678,635,217.142,721,219.452,854,256.446,418,265.845,367,248.624,824,241.114,687,229.245,601,231.805,676,219.277,740,219.313,691,212.610,683,214.771,594,211.142,729,211.457,731,240.048,386,240.636,331,230.580,707,208.795,715,197.922,657,194.596,653,194.581,642,185.686,643,178.106,718,172.608,654,167.302,632,168.053,731,202.300,392,202.388,344,182.516,792,173.476,852,166.444,649,171.297,629,169.701,685,164.182,617,161.914,715,159.612,715,151.001,629,158.114,916,186.530,531,187.069,357,174.330,917,169.362,828,166.827,708,178.037,858,186.413,775,189.226,785,191.563,1006,188.906,789,186.005,734,195.309,906,223.532,532,226.899,387,214.126,991,206.903,841,204.442,892,220.375,782),dim=c(2,72),dimnames=list(c('werlozen','faillissementen'),1:72)) > y <- array(NA,dim=c(2,72),dimnames=list(c('werlozen','faillissementen'),1:72)) > 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 = 'Do not include Seasonal Dummies' > par1 = '2' > #'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 faillissementen werlozen 1 627 216.234 2 696 213.586 3 825 209.465 4 677 204.045 5 656 200.237 6 785 203.666 7 412 241.476 8 352 260.307 9 839 243.324 10 729 244.460 11 696 233.575 12 641 237.217 13 695 235.243 14 638 230.354 15 762 227.184 16 635 221.678 17 721 217.142 18 854 219.452 19 418 256.446 20 367 265.845 21 824 248.624 22 687 241.114 23 601 229.245 24 676 231.805 25 740 219.277 26 691 219.313 27 683 212.610 28 594 214.771 29 729 211.142 30 731 211.457 31 386 240.048 32 331 240.636 33 707 230.580 34 715 208.795 35 657 197.922 36 653 194.596 37 642 194.581 38 643 185.686 39 718 178.106 40 654 172.608 41 632 167.302 42 731 168.053 43 392 202.300 44 344 202.388 45 792 182.516 46 852 173.476 47 649 166.444 48 629 171.297 49 685 169.701 50 617 164.182 51 715 161.914 52 715 159.612 53 629 151.001 54 916 158.114 55 531 186.530 56 357 187.069 57 917 174.330 58 828 169.362 59 708 166.827 60 858 178.037 61 775 186.413 62 785 189.226 63 1006 191.563 64 789 188.906 65 734 186.005 66 906 195.309 67 532 223.532 68 387 226.899 69 991 214.126 70 841 206.903 71 892 204.442 72 782 220.375 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) werlozen 1063.988 -1.870 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -357.10 -77.05 17.29 82.12 327.51 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1063.9877 130.0180 8.183 8.4e-12 *** werlozen -1.8704 0.6285 -2.976 0.00401 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 148.5 on 70 degrees of freedom Multiple R-squared: 0.1123, Adjusted R-squared: 0.09961 F-statistic: 8.855 on 1 and 70 DF, p-value: 0.00401 > 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.198908572 0.39781714 0.8010914 [2,] 0.130098235 0.26019647 0.8699018 [3,] 0.100968622 0.20193724 0.8990314 [4,] 0.055531725 0.11106345 0.9444683 [5,] 0.531693669 0.93661266 0.4683063 [6,] 0.546250009 0.90749998 0.4537500 [7,] 0.461473938 0.92294788 0.5385261 [8,] 0.362805237 0.72561047 0.6371948 [9,] 0.291140316 0.58228063 0.7088597 [10,] 0.213859876 0.42771975 0.7861401 [11,] 0.183450656 0.36690131 0.8165493 [12,] 0.133870634 0.26774127 0.8661294 [13,] 0.093248066 0.18649613 0.9067519 [14,] 0.112528441 0.22505688 0.8874716 [15,] 0.110925460 0.22185092 0.8890745 [16,] 0.107325779 0.21465156 0.8926742 [17,] 0.217749320 0.43549864 0.7822507 [18,] 0.179197061 0.35839412 0.8208029 [19,] 0.139517112 0.27903422 0.8604829 [20,] 0.103409961 0.20681992 0.8965900 [21,] 0.077832665 0.15566533 0.9221673 [22,] 0.055044282 0.11008856 0.9449557 [23,] 0.039141753 0.07828351 0.9608582 [24,] 0.034133669 0.06826734 0.9658663 [25,] 0.023281803 0.04656361 0.9767182 [26,] 0.015661937 0.03132387 0.9843381 [27,] 0.029473572 0.05894714 0.9705264 [28,] 0.079853363 0.15970673 0.9201466 [29,] 0.060948312 0.12189662 0.9390517 [30,] 0.043064764 0.08612953 0.9569352 [31,] 0.035888925 0.07177785 0.9641111 [32,] 0.030053764 0.06010753 0.9699462 [33,] 0.024868835 0.04973767 0.9751312 [34,] 0.021541197 0.04308239 0.9784588 [35,] 0.014954312 0.02990862 0.9850457 [36,] 0.012605831 0.02521166 0.9873942 [37,] 0.011498006 0.02299601 0.9885020 [38,] 0.007279032 0.01455806 0.9927210 [39,] 0.027401537 0.05480307 0.9725985 [40,] 0.128843708 0.25768742 0.8711563 [41,] 0.102009624 0.20401925 0.8979904 [42,] 0.089426672 0.17885334 0.9105733 [43,] 0.072919266 0.14583853 0.9270807 [44,] 0.061598910 0.12319782 0.9384011 [45,] 0.044889607 0.08977921 0.9551104 [46,] 0.040994056 0.08198811 0.9590059 [47,] 0.028497164 0.05699433 0.9715028 [48,] 0.019676202 0.03935240 0.9803238 [49,] 0.022348578 0.04469716 0.9776514 [50,] 0.019650524 0.03930105 0.9803495 [51,] 0.030449811 0.06089962 0.9695502 [52,] 0.290633379 0.58126676 0.7093666 [53,] 0.265381357 0.53076271 0.7346186 [54,] 0.211442873 0.42288575 0.7885571 [55,] 0.254250726 0.50850145 0.7457493 [56,] 0.206552692 0.41310538 0.7934473 [57,] 0.173928208 0.34785642 0.8260718 [58,] 0.141915097 0.28383019 0.8580849 [59,] 0.155385718 0.31077144 0.8446143 [60,] 0.117974993 0.23594999 0.8820250 [61,] 0.279320984 0.55864197 0.7206790 [62,] 0.311518978 0.62303796 0.6884810 [63,] 0.206361206 0.41272241 0.7936388 > postscript(file="/var/www/html/rcomp/tmp/14a571291991616.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/2ej5a1291991616.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/3ej5a1291991616.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/4ej5a1291991616.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/5pa4d1291991616.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 = 72 Frequency = 1 1 2 3 4 5 6 -32.547434 31.499793 152.791946 -5.345527 -33.467944 101.945598 7 8 9 10 11 12 -200.335237 -225.114062 230.121230 122.245985 68.886870 20.698804 13 14 15 16 17 18 71.006669 4.862368 122.933255 -14.365071 63.150873 200.471457 19 20 21 22 23 24 -166.335610 -199.755884 225.034258 73.987685 -34.211886 45.576293 25 26 27 28 29 30 86.144140 37.211474 16.674300 -68.283804 59.928578 62.517748 31 32 33 34 35 36 -229.006143 -282.906358 74.285075 41.538790 -36.797880 -47.018772 37 38 39 40 41 42 -58.046828 -73.683881 -12.861381 -87.144745 -119.068994 -18.664337 43 44 45 46 47 48 -293.609345 -341.444751 69.387006 112.478748 -103.673783 -114.596816 49 50 51 52 53 54 -61.581947 -139.904588 -46.146616 -50.452237 -152.558101 147.745930 55 56 57 58 59 60 -184.105278 -357.097142 179.076054 80.783994 -43.957426 127.009563 61 62 63 64 65 66 59.675887 74.937273 300.308357 78.338751 17.912771 207.314810 67 68 69 70 71 72 -113.897382 -252.599804 327.509800 164.000026 210.397015 130.197820 > postscript(file="/var/www/html/rcomp/tmp/6pa4d1291991616.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 = 72 Frequency = 1 lag(myerror, k = 1) myerror 0 -32.547434 NA 1 31.499793 -32.547434 2 152.791946 31.499793 3 -5.345527 152.791946 4 -33.467944 -5.345527 5 101.945598 -33.467944 6 -200.335237 101.945598 7 -225.114062 -200.335237 8 230.121230 -225.114062 9 122.245985 230.121230 10 68.886870 122.245985 11 20.698804 68.886870 12 71.006669 20.698804 13 4.862368 71.006669 14 122.933255 4.862368 15 -14.365071 122.933255 16 63.150873 -14.365071 17 200.471457 63.150873 18 -166.335610 200.471457 19 -199.755884 -166.335610 20 225.034258 -199.755884 21 73.987685 225.034258 22 -34.211886 73.987685 23 45.576293 -34.211886 24 86.144140 45.576293 25 37.211474 86.144140 26 16.674300 37.211474 27 -68.283804 16.674300 28 59.928578 -68.283804 29 62.517748 59.928578 30 -229.006143 62.517748 31 -282.906358 -229.006143 32 74.285075 -282.906358 33 41.538790 74.285075 34 -36.797880 41.538790 35 -47.018772 -36.797880 36 -58.046828 -47.018772 37 -73.683881 -58.046828 38 -12.861381 -73.683881 39 -87.144745 -12.861381 40 -119.068994 -87.144745 41 -18.664337 -119.068994 42 -293.609345 -18.664337 43 -341.444751 -293.609345 44 69.387006 -341.444751 45 112.478748 69.387006 46 -103.673783 112.478748 47 -114.596816 -103.673783 48 -61.581947 -114.596816 49 -139.904588 -61.581947 50 -46.146616 -139.904588 51 -50.452237 -46.146616 52 -152.558101 -50.452237 53 147.745930 -152.558101 54 -184.105278 147.745930 55 -357.097142 -184.105278 56 179.076054 -357.097142 57 80.783994 179.076054 58 -43.957426 80.783994 59 127.009563 -43.957426 60 59.675887 127.009563 61 74.937273 59.675887 62 300.308357 74.937273 63 78.338751 300.308357 64 17.912771 78.338751 65 207.314810 17.912771 66 -113.897382 207.314810 67 -252.599804 -113.897382 68 327.509800 -252.599804 69 164.000026 327.509800 70 210.397015 164.000026 71 130.197820 210.397015 72 NA 130.197820 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 31.499793 -32.547434 [2,] 152.791946 31.499793 [3,] -5.345527 152.791946 [4,] -33.467944 -5.345527 [5,] 101.945598 -33.467944 [6,] -200.335237 101.945598 [7,] -225.114062 -200.335237 [8,] 230.121230 -225.114062 [9,] 122.245985 230.121230 [10,] 68.886870 122.245985 [11,] 20.698804 68.886870 [12,] 71.006669 20.698804 [13,] 4.862368 71.006669 [14,] 122.933255 4.862368 [15,] -14.365071 122.933255 [16,] 63.150873 -14.365071 [17,] 200.471457 63.150873 [18,] -166.335610 200.471457 [19,] -199.755884 -166.335610 [20,] 225.034258 -199.755884 [21,] 73.987685 225.034258 [22,] -34.211886 73.987685 [23,] 45.576293 -34.211886 [24,] 86.144140 45.576293 [25,] 37.211474 86.144140 [26,] 16.674300 37.211474 [27,] -68.283804 16.674300 [28,] 59.928578 -68.283804 [29,] 62.517748 59.928578 [30,] -229.006143 62.517748 [31,] -282.906358 -229.006143 [32,] 74.285075 -282.906358 [33,] 41.538790 74.285075 [34,] -36.797880 41.538790 [35,] -47.018772 -36.797880 [36,] -58.046828 -47.018772 [37,] -73.683881 -58.046828 [38,] -12.861381 -73.683881 [39,] -87.144745 -12.861381 [40,] -119.068994 -87.144745 [41,] -18.664337 -119.068994 [42,] -293.609345 -18.664337 [43,] -341.444751 -293.609345 [44,] 69.387006 -341.444751 [45,] 112.478748 69.387006 [46,] -103.673783 112.478748 [47,] -114.596816 -103.673783 [48,] -61.581947 -114.596816 [49,] -139.904588 -61.581947 [50,] -46.146616 -139.904588 [51,] -50.452237 -46.146616 [52,] -152.558101 -50.452237 [53,] 147.745930 -152.558101 [54,] -184.105278 147.745930 [55,] -357.097142 -184.105278 [56,] 179.076054 -357.097142 [57,] 80.783994 179.076054 [58,] -43.957426 80.783994 [59,] 127.009563 -43.957426 [60,] 59.675887 127.009563 [61,] 74.937273 59.675887 [62,] 300.308357 74.937273 [63,] 78.338751 300.308357 [64,] 17.912771 78.338751 [65,] 207.314810 17.912771 [66,] -113.897382 207.314810 [67,] -252.599804 -113.897382 [68,] 327.509800 -252.599804 [69,] 164.000026 327.509800 [70,] 210.397015 164.000026 [71,] 130.197820 210.397015 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 31.499793 -32.547434 2 152.791946 31.499793 3 -5.345527 152.791946 4 -33.467944 -5.345527 5 101.945598 -33.467944 6 -200.335237 101.945598 7 -225.114062 -200.335237 8 230.121230 -225.114062 9 122.245985 230.121230 10 68.886870 122.245985 11 20.698804 68.886870 12 71.006669 20.698804 13 4.862368 71.006669 14 122.933255 4.862368 15 -14.365071 122.933255 16 63.150873 -14.365071 17 200.471457 63.150873 18 -166.335610 200.471457 19 -199.755884 -166.335610 20 225.034258 -199.755884 21 73.987685 225.034258 22 -34.211886 73.987685 23 45.576293 -34.211886 24 86.144140 45.576293 25 37.211474 86.144140 26 16.674300 37.211474 27 -68.283804 16.674300 28 59.928578 -68.283804 29 62.517748 59.928578 30 -229.006143 62.517748 31 -282.906358 -229.006143 32 74.285075 -282.906358 33 41.538790 74.285075 34 -36.797880 41.538790 35 -47.018772 -36.797880 36 -58.046828 -47.018772 37 -73.683881 -58.046828 38 -12.861381 -73.683881 39 -87.144745 -12.861381 40 -119.068994 -87.144745 41 -18.664337 -119.068994 42 -293.609345 -18.664337 43 -341.444751 -293.609345 44 69.387006 -341.444751 45 112.478748 69.387006 46 -103.673783 112.478748 47 -114.596816 -103.673783 48 -61.581947 -114.596816 49 -139.904588 -61.581947 50 -46.146616 -139.904588 51 -50.452237 -46.146616 52 -152.558101 -50.452237 53 147.745930 -152.558101 54 -184.105278 147.745930 55 -357.097142 -184.105278 56 179.076054 -357.097142 57 80.783994 179.076054 58 -43.957426 80.783994 59 127.009563 -43.957426 60 59.675887 127.009563 61 74.937273 59.675887 62 300.308357 74.937273 63 78.338751 300.308357 64 17.912771 78.338751 65 207.314810 17.912771 66 -113.897382 207.314810 67 -252.599804 -113.897382 68 327.509800 -252.599804 69 164.000026 327.509800 70 210.397015 164.000026 71 130.197820 210.397015 > 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/702ly1291991616.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/802ly1291991616.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/9tb2j1291991616.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/10tb2j1291991616.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/11wb171291991616.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/12iciv1291991616.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/13dmxm1291991616.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/14rwg41291991617.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/15vffs1291991617.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/1697v11291991617.tab") + } > try(system("convert tmp/14a571291991616.ps tmp/14a571291991616.png",intern=TRUE)) character(0) > try(system("convert tmp/2ej5a1291991616.ps tmp/2ej5a1291991616.png",intern=TRUE)) character(0) > try(system("convert tmp/3ej5a1291991616.ps tmp/3ej5a1291991616.png",intern=TRUE)) character(0) > try(system("convert tmp/4ej5a1291991616.ps tmp/4ej5a1291991616.png",intern=TRUE)) character(0) > try(system("convert tmp/5pa4d1291991616.ps tmp/5pa4d1291991616.png",intern=TRUE)) character(0) > try(system("convert tmp/6pa4d1291991616.ps tmp/6pa4d1291991616.png",intern=TRUE)) character(0) > try(system("convert tmp/702ly1291991616.ps tmp/702ly1291991616.png",intern=TRUE)) character(0) > try(system("convert tmp/802ly1291991616.ps tmp/802ly1291991616.png",intern=TRUE)) character(0) > try(system("convert tmp/9tb2j1291991616.ps tmp/9tb2j1291991616.png",intern=TRUE)) character(0) > try(system("convert tmp/10tb2j1291991616.ps tmp/10tb2j1291991616.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.671 1.673 6.227