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(13768040.14 + ,14731798.37 + ,17487530.67 + ,16471559.62 + ,16198106.13 + ,15213975.95 + ,17535166.38 + ,17637387.4 + ,16571771.60 + ,17972385.83 + ,16198892.67 + ,16896235.55 + ,16554237.93 + ,16697955.94 + ,19554176.37 + ,19691579.52 + ,15903762.33 + ,15930700.75 + ,18003781.65 + ,17444615.98 + ,18329610.38 + ,17699369.88 + ,16260733.42 + ,15189796.81 + ,14851949.20 + ,15672722.75 + ,18174068.44 + ,17180794.3 + ,18406552.23 + ,17664893.45 + ,18466459.42 + ,17862884.98 + ,16016524.60 + ,16162288.88 + ,17428458.32 + ,17463628.82 + ,17167191.42 + ,16772112.17 + ,19629987.60 + ,19106861.48 + ,17183629.01 + ,16721314.25 + ,18344657.85 + ,18161267.85 + ,19301440.71 + ,18509941.2 + ,18147463.68 + ,17802737.97 + ,16192909.22 + ,16409869.75 + ,18374420.60 + ,17967742.04 + ,20515191.95 + ,20286602.27 + ,18957217.20 + ,19537280.81 + ,16471529.53 + ,18021889.62 + ,18746813.27 + ,20194317.23 + ,19009453.59 + ,19049596.62 + ,19211178.55 + ,20244720.94 + ,20547653.75 + ,21473302.24 + ,19325754.03 + ,19673603.19 + ,20605542.58 + ,21053177.29 + ,20056915.06 + ,20159479.84 + ,16141449.72 + ,18203628.31 + ,20359793.22 + ,21289464.94 + ,19711553.27 + ,20432335.71 + ,15638580.70 + ,17180395.07 + ,14384486.00 + ,15816786.32 + ,13855616.12 + ,15071819.75 + ,14308336.46 + ,14521120.61 + ,15290621.44 + ,15668789.39 + ,14423755.53 + ,14346884.11 + ,13779681.49 + ,13881008.13 + ,15686348.94 + ,15465943.69 + ,14733828.17 + ,14238232.92 + ,12522497.94 + ,13557713.21 + ,16189383.57 + ,16127590.29 + ,16059123.25 + ,16793894.2 + ,16007123.26 + ,16014007.43 + ,15806842.33 + ,16867867.15 + ,15159951.13 + ,16014583.21 + ,15692144.17 + ,15878594.85 + ,18908869.11 + ,18664899.14 + ,16969881.42 + ,17962530.06 + ,16997477.78 + ,17332692.2 + ,19858875.65 + ,19542066.35 + ,17681170.13 + ,17203555.19) + ,dim=c(2 + ,60) + ,dimnames=list(c('Uitvoer' + ,'Invoer') + ,1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Uitvoer','Invoer'),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '2' > ylab = '' > xlab = '' > main = '' > #'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 Invoer Uitvoer 1 14731798 13768040 2 16471560 17487531 3 15213976 16198106 4 17637387 17535166 5 17972386 16571772 6 16896236 16198893 7 16697956 16554238 8 19691580 19554176 9 15930701 15903762 10 17444616 18003782 11 17699370 18329610 12 15189797 16260733 13 15672723 14851949 14 17180794 18174068 15 17664893 18406552 16 17862885 18466459 17 16162289 16016525 18 17463629 17428458 19 16772112 17167191 20 19106861 19629988 21 16721314 17183629 22 18161268 18344658 23 18509941 19301441 24 17802738 18147464 25 16409870 16192909 26 17967742 18374421 27 20286602 20515192 28 19537281 18957217 29 18021890 16471530 30 20194317 18746813 31 19049597 19009454 32 20244721 19211179 33 21473302 20547654 34 19673603 19325754 35 21053177 20605543 36 20159480 20056915 37 18203628 16141450 38 21289465 20359793 39 20432336 19711553 40 17180395 15638581 41 15816786 14384486 42 15071820 13855616 43 14521121 14308336 44 15668789 15290621 45 14346884 14423756 46 13881008 13779681 47 15465944 15686349 48 14238233 14733828 49 13557713 12522498 50 16127590 16189384 51 16793894 16059123 52 16014007 16007123 53 16867867 15806842 54 16014583 15159951 55 15878595 15692144 56 18664899 18908869 57 17962530 16969881 58 17332692 16997478 59 19542066 19858876 60 17203555 17681170 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Uitvoer 1.841e+06 9.055e-01 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1375030 -521914 -131644 467584 1746814 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.841e+06 8.229e+05 2.237 0.0292 * Uitvoer 9.055e-01 4.764e-02 19.008 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 728000 on 58 degrees of freedom Multiple R-squared: 0.8617, Adjusted R-squared: 0.8593 F-statistic: 361.3 on 1 and 58 DF, p-value: < 2.2e-16 > 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.9397157 0.12056861 0.06028430 [2,] 0.9022520 0.19549602 0.09774801 [3,] 0.8305125 0.33897491 0.16948746 [4,] 0.7944851 0.41102979 0.20551489 [5,] 0.7132356 0.57352881 0.28676441 [6,] 0.6555055 0.68898902 0.34449451 [7,] 0.5930825 0.81383510 0.40691755 [8,] 0.7425348 0.51493042 0.25746521 [9,] 0.6864176 0.62716480 0.31358240 [10,] 0.6993614 0.60127724 0.30063862 [11,] 0.6614054 0.67718921 0.33859460 [12,] 0.6096911 0.78061780 0.39030890 [13,] 0.5276985 0.94460291 0.47230145 [14,] 0.4565338 0.91306755 0.54346623 [15,] 0.4085329 0.81706575 0.59146713 [16,] 0.3663515 0.73270306 0.63364847 [17,] 0.3388672 0.67773430 0.66113285 [18,] 0.2903063 0.58061253 0.70969373 [19,] 0.2889647 0.57792940 0.71103530 [20,] 0.2561902 0.51238042 0.74380979 [21,] 0.2034957 0.40699132 0.79650434 [22,] 0.1858955 0.37179093 0.81410454 [23,] 0.1958689 0.39173783 0.80413108 [24,] 0.2379180 0.47583599 0.76208200 [25,] 0.4462975 0.89259509 0.55370246 [26,] 0.6999569 0.60008621 0.30004311 [27,] 0.6508854 0.69822915 0.34911458 [28,] 0.7166107 0.56677859 0.28338930 [29,] 0.7595998 0.48080046 0.24040023 [30,] 0.7057081 0.58858381 0.29429191 [31,] 0.6584521 0.68309570 0.34154785 [32,] 0.5874620 0.82507592 0.41253796 [33,] 0.8717290 0.25654195 0.12827097 [34,] 0.8974459 0.20510819 0.10255410 [35,] 0.9082386 0.18352278 0.09176139 [36,] 0.9612691 0.07746188 0.03873094 [37,] 0.9768808 0.04623843 0.02311921 [38,] 0.9797212 0.04055763 0.02027881 [39,] 0.9673596 0.06528087 0.03264043 [40,] 0.9462714 0.10745725 0.05372863 [41,] 0.9352386 0.12952272 0.06476136 [42,] 0.9186532 0.16269353 0.08134676 [43,] 0.9101037 0.17979268 0.08989634 [44,] 0.9737755 0.05244892 0.02622446 [45,] 0.9541996 0.09160085 0.04580042 [46,] 0.9469798 0.10604044 0.05302022 [47,] 0.9100248 0.17995048 0.08997524 [48,] 0.8992954 0.20140918 0.10070459 [49,] 0.8702126 0.25957474 0.12978737 [50,] 0.7754658 0.44906844 0.22453422 [51,] 0.6907458 0.61850832 0.30925416 > postscript(file="/var/www/html/rcomp/tmp/14qd11290501644.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/2xzul1290501644.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/3xzul1290501644.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/4xzul1290501644.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/589tp1290501644.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 424112.641 -1204135.031 -1294141.228 -81441.518 1125913.539 387406.158 7 8 9 10 11 12 -132639.564 144531.494 -310887.306 -698545.356 -738830.269 -1375029.552 13 14 15 16 17 18 383554.381 -1116562.194 -842977.756 -699232.352 -181405.722 -158575.656 19 20 21 22 23 24 -613514.408 -508833.824 -679196.611 -290557.824 -808253.990 -470527.840 25 26 27 28 29 30 -93541.612 -511033.886 -130648.012 530780.957 1266186.800 1378338.715 31 32 33 34 35 36 -4203.428 1008258.385 1026657.709 333392.222 554114.264 157200.545 37 38 39 40 41 42 1746813.667 1012928.636 742782.467 1178929.710 950907.166 684833.730 43 44 45 46 47 48 -275804.926 -17597.901 -554553.711 -437218.874 -578775.943 -943976.531 49 50 51 52 53 54 377869.374 -372628.586 411626.403 -321174.233 714040.421 446518.245 55 56 57 58 59 60 -171372.379 -297821.385 755568.231 100741.791 -280887.714 -647480.526 > postscript(file="/var/www/html/rcomp/tmp/689tp1290501644.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 424112.641 NA 1 -1204135.031 424112.641 2 -1294141.228 -1204135.031 3 -81441.518 -1294141.228 4 1125913.539 -81441.518 5 387406.158 1125913.539 6 -132639.564 387406.158 7 144531.494 -132639.564 8 -310887.306 144531.494 9 -698545.356 -310887.306 10 -738830.269 -698545.356 11 -1375029.552 -738830.269 12 383554.381 -1375029.552 13 -1116562.194 383554.381 14 -842977.756 -1116562.194 15 -699232.352 -842977.756 16 -181405.722 -699232.352 17 -158575.656 -181405.722 18 -613514.408 -158575.656 19 -508833.824 -613514.408 20 -679196.611 -508833.824 21 -290557.824 -679196.611 22 -808253.990 -290557.824 23 -470527.840 -808253.990 24 -93541.612 -470527.840 25 -511033.886 -93541.612 26 -130648.012 -511033.886 27 530780.957 -130648.012 28 1266186.800 530780.957 29 1378338.715 1266186.800 30 -4203.428 1378338.715 31 1008258.385 -4203.428 32 1026657.709 1008258.385 33 333392.222 1026657.709 34 554114.264 333392.222 35 157200.545 554114.264 36 1746813.667 157200.545 37 1012928.636 1746813.667 38 742782.467 1012928.636 39 1178929.710 742782.467 40 950907.166 1178929.710 41 684833.730 950907.166 42 -275804.926 684833.730 43 -17597.901 -275804.926 44 -554553.711 -17597.901 45 -437218.874 -554553.711 46 -578775.943 -437218.874 47 -943976.531 -578775.943 48 377869.374 -943976.531 49 -372628.586 377869.374 50 411626.403 -372628.586 51 -321174.233 411626.403 52 714040.421 -321174.233 53 446518.245 714040.421 54 -171372.379 446518.245 55 -297821.385 -171372.379 56 755568.231 -297821.385 57 100741.791 755568.231 58 -280887.714 100741.791 59 -647480.526 -280887.714 60 NA -647480.526 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1204135.031 424112.641 [2,] -1294141.228 -1204135.031 [3,] -81441.518 -1294141.228 [4,] 1125913.539 -81441.518 [5,] 387406.158 1125913.539 [6,] -132639.564 387406.158 [7,] 144531.494 -132639.564 [8,] -310887.306 144531.494 [9,] -698545.356 -310887.306 [10,] -738830.269 -698545.356 [11,] -1375029.552 -738830.269 [12,] 383554.381 -1375029.552 [13,] -1116562.194 383554.381 [14,] -842977.756 -1116562.194 [15,] -699232.352 -842977.756 [16,] -181405.722 -699232.352 [17,] -158575.656 -181405.722 [18,] -613514.408 -158575.656 [19,] -508833.824 -613514.408 [20,] -679196.611 -508833.824 [21,] -290557.824 -679196.611 [22,] -808253.990 -290557.824 [23,] -470527.840 -808253.990 [24,] -93541.612 -470527.840 [25,] -511033.886 -93541.612 [26,] -130648.012 -511033.886 [27,] 530780.957 -130648.012 [28,] 1266186.800 530780.957 [29,] 1378338.715 1266186.800 [30,] -4203.428 1378338.715 [31,] 1008258.385 -4203.428 [32,] 1026657.709 1008258.385 [33,] 333392.222 1026657.709 [34,] 554114.264 333392.222 [35,] 157200.545 554114.264 [36,] 1746813.667 157200.545 [37,] 1012928.636 1746813.667 [38,] 742782.467 1012928.636 [39,] 1178929.710 742782.467 [40,] 950907.166 1178929.710 [41,] 684833.730 950907.166 [42,] -275804.926 684833.730 [43,] -17597.901 -275804.926 [44,] -554553.711 -17597.901 [45,] -437218.874 -554553.711 [46,] -578775.943 -437218.874 [47,] -943976.531 -578775.943 [48,] 377869.374 -943976.531 [49,] -372628.586 377869.374 [50,] 411626.403 -372628.586 [51,] -321174.233 411626.403 [52,] 714040.421 -321174.233 [53,] 446518.245 714040.421 [54,] -171372.379 446518.245 [55,] -297821.385 -171372.379 [56,] 755568.231 -297821.385 [57,] 100741.791 755568.231 [58,] -280887.714 100741.791 [59,] -647480.526 -280887.714 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1204135.031 424112.641 2 -1294141.228 -1204135.031 3 -81441.518 -1294141.228 4 1125913.539 -81441.518 5 387406.158 1125913.539 6 -132639.564 387406.158 7 144531.494 -132639.564 8 -310887.306 144531.494 9 -698545.356 -310887.306 10 -738830.269 -698545.356 11 -1375029.552 -738830.269 12 383554.381 -1375029.552 13 -1116562.194 383554.381 14 -842977.756 -1116562.194 15 -699232.352 -842977.756 16 -181405.722 -699232.352 17 -158575.656 -181405.722 18 -613514.408 -158575.656 19 -508833.824 -613514.408 20 -679196.611 -508833.824 21 -290557.824 -679196.611 22 -808253.990 -290557.824 23 -470527.840 -808253.990 24 -93541.612 -470527.840 25 -511033.886 -93541.612 26 -130648.012 -511033.886 27 530780.957 -130648.012 28 1266186.800 530780.957 29 1378338.715 1266186.800 30 -4203.428 1378338.715 31 1008258.385 -4203.428 32 1026657.709 1008258.385 33 333392.222 1026657.709 34 554114.264 333392.222 35 157200.545 554114.264 36 1746813.667 157200.545 37 1012928.636 1746813.667 38 742782.467 1012928.636 39 1178929.710 742782.467 40 950907.166 1178929.710 41 684833.730 950907.166 42 -275804.926 684833.730 43 -17597.901 -275804.926 44 -554553.711 -17597.901 45 -437218.874 -554553.711 46 -578775.943 -437218.874 47 -943976.531 -578775.943 48 377869.374 -943976.531 49 -372628.586 377869.374 50 411626.403 -372628.586 51 -321174.233 411626.403 52 714040.421 -321174.233 53 446518.245 714040.421 54 -171372.379 446518.245 55 -297821.385 -171372.379 56 755568.231 -297821.385 57 100741.791 755568.231 58 -280887.714 100741.791 59 -647480.526 -280887.714 > 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/7j0br1290501644.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/8j0br1290501644.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/9brac1290501644.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/10brac1290501644.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/11xaq01290501644.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/120spo1290501644.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/137tm01290501644.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/14ill31290501644.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/153lkr1290501644.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/16hdh01290501644.tab") + } > > try(system("convert tmp/14qd11290501644.ps tmp/14qd11290501644.png",intern=TRUE)) character(0) > try(system("convert tmp/2xzul1290501644.ps tmp/2xzul1290501644.png",intern=TRUE)) character(0) > try(system("convert tmp/3xzul1290501644.ps tmp/3xzul1290501644.png",intern=TRUE)) character(0) > try(system("convert tmp/4xzul1290501644.ps tmp/4xzul1290501644.png",intern=TRUE)) character(0) > try(system("convert tmp/589tp1290501644.ps tmp/589tp1290501644.png",intern=TRUE)) character(0) > try(system("convert tmp/689tp1290501644.ps tmp/689tp1290501644.png",intern=TRUE)) character(0) > try(system("convert tmp/7j0br1290501644.ps tmp/7j0br1290501644.png",intern=TRUE)) character(0) > try(system("convert tmp/8j0br1290501644.ps tmp/8j0br1290501644.png",intern=TRUE)) character(0) > try(system("convert tmp/9brac1290501644.ps tmp/9brac1290501644.png",intern=TRUE)) character(0) > try(system("convert tmp/10brac1290501644.ps tmp/10brac1290501644.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.532 1.603 6.857