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('Y' + ,'X') + ,1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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 = '1' > 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 Y X 1 13768040 14731798 2 17487531 16471560 3 16198106 15213976 4 17535166 17637387 5 16571772 17972386 6 16198893 16896236 7 16554238 16697956 8 19554176 19691580 9 15903762 15930701 10 18003782 17444616 11 18329610 17699370 12 16260733 15189797 13 14851949 15672723 14 18174068 17180794 15 18406552 17664893 16 18466459 17862885 17 16016525 16162289 18 17428458 17463629 19 17167191 16772112 20 19629988 19106861 21 17183629 16721314 22 18344658 18161268 23 19301441 18509941 24 18147464 17802738 25 16192909 16409870 26 18374421 17967742 27 20515192 20286602 28 18957217 19537281 29 16471530 18021890 30 18746813 20194317 31 19009454 19049597 32 19211179 20244721 33 20547654 21473302 34 19325754 19673603 35 20605543 21053177 36 20056915 20159480 37 16141450 18203628 38 20359793 21289465 39 19711553 20432336 40 15638581 17180395 41 14384486 15816786 42 13855616 15071820 43 14308336 14521121 44 15290621 15668789 45 14423756 14346884 46 13779681 13881008 47 15686349 15465944 48 14733828 14238233 49 12522498 13557713 50 16189384 16127590 51 16059123 16793894 52 16007123 16014007 53 15806842 16867867 54 15159951 16014583 55 15692144 15878595 56 18908869 18664899 57 16969881 17962530 58 16997478 17332692 59 19858876 19542066 60 17681170 17203555 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 6.223e+05 9.516e-01 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1803304 -527101 82091 585567 1202636 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.223e+05 8.754e+05 0.711 0.48 X 9.516e-01 5.006e-02 19.008 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 746300 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.9544378 0.09112436 0.04556218 [2,] 0.9202123 0.15957541 0.07978770 [3,] 0.8584024 0.28319522 0.14159761 [4,] 0.8071063 0.38578734 0.19289367 [5,] 0.7168160 0.56636801 0.28318400 [6,] 0.7043982 0.59120357 0.29560179 [7,] 0.6983461 0.60330777 0.30165389 [8,] 0.7428456 0.51430877 0.25715439 [9,] 0.7633824 0.47323521 0.23661760 [10,] 0.8186084 0.36278330 0.18139165 [11,] 0.8239569 0.35208613 0.17604306 [12,] 0.8103636 0.37927274 0.18963637 [13,] 0.7543627 0.49127461 0.24563730 [14,] 0.6894345 0.62113094 0.31056547 [15,] 0.6447663 0.71046730 0.35523365 [16,] 0.6260378 0.74792444 0.37396222 [17,] 0.5947874 0.81042522 0.40521261 [18,] 0.5383259 0.92334813 0.46167406 [19,] 0.5915607 0.81687861 0.40843931 [20,] 0.5618310 0.87633794 0.43816897 [21,] 0.5021690 0.99566199 0.49783099 [22,] 0.4903565 0.98071296 0.50964352 [23,] 0.4766062 0.95321239 0.52339381 [24,] 0.4643961 0.92879216 0.53560392 [25,] 0.6939767 0.61204656 0.30602328 [26,] 0.7851767 0.42964651 0.21482326 [27,] 0.7461565 0.50768696 0.25384348 [28,] 0.7282296 0.54354088 0.27177044 [29,] 0.6783532 0.64329355 0.32164678 [30,] 0.6102384 0.77952322 0.38976161 [31,] 0.5371615 0.92567704 0.46283852 [32,] 0.4919186 0.98383727 0.50808137 [33,] 0.8173993 0.36520139 0.18260070 [34,] 0.7781854 0.44362925 0.22181463 [35,] 0.7265471 0.54690588 0.27345294 [36,] 0.8668382 0.26632359 0.13316179 [37,] 0.9418531 0.11629382 0.05814691 [38,] 0.9677227 0.06455452 0.03227726 [39,] 0.9478497 0.10430065 0.05215033 [40,] 0.9202537 0.15949269 0.07974634 [41,] 0.8892880 0.22142391 0.11071195 [42,] 0.8432292 0.31354163 0.15677081 [43,] 0.8152995 0.36940108 0.18470054 [44,] 0.8994921 0.20101572 0.10050786 [45,] 0.8628473 0.27430530 0.13715265 [46,] 0.8324058 0.33518842 0.16759421 [47,] 0.7745256 0.45094879 0.22547439 [48,] 0.7284221 0.54315590 0.27157795 [49,] 0.7344249 0.53115019 0.26557510 [50,] 0.6670020 0.66599605 0.33299803 [51,] 0.4994438 0.99888755 0.50055623 > postscript(file="/var/www/html/rcomp/tmp/1gaft1291201631.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/2gaft1291201631.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/38jee1291201631.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/48jee1291201631.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/58jee1291201631.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 = 60 Frequency = 1 1 2 3 4 5 6 -872943.72 1191001.55 1098285.29 129243.28 -1152933.78 -501755.25 7 8 9 10 11 12 42271.58 193497.68 121910.92 781298.56 864705.17 1183921.29 13 14 15 16 17 18 -684412.05 1202636.31 974454.56 845954.32 14295.46 187882.73 19 20 21 22 23 24 584658.49 825722.72 649435.04 440213.59 1065201.21 584194.08 25 26 27 28 29 30 -44916.23 654134.22 588293.56 -256631.86 -1300283.33 -1092267.29 31 32 33 34 35 36 259681.57 -675865.84 -508500.45 -17818.50 -50823.51 250985.53 37 38 39 40 41 42 -1803304.47 -521422.63 -354024.09 -1332471.53 -1288965.19 -1108929.83 43 44 45 46 47 48 -132167.84 -241996.86 149053.53 -51696.02 346757.27 562517.92 49 50 51 52 53 54 -1001234.27 220173.38 -544137.32 145997.77 -866810.40 -701722.27 55 56 57 58 59 60 -40123.61 525172.66 -745445.28 -118499.39 640472.70 688078.88 > postscript(file="/var/www/html/rcomp/tmp/6jtdz1291201631.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 = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 -872943.72 NA 1 1191001.55 -872943.72 2 1098285.29 1191001.55 3 129243.28 1098285.29 4 -1152933.78 129243.28 5 -501755.25 -1152933.78 6 42271.58 -501755.25 7 193497.68 42271.58 8 121910.92 193497.68 9 781298.56 121910.92 10 864705.17 781298.56 11 1183921.29 864705.17 12 -684412.05 1183921.29 13 1202636.31 -684412.05 14 974454.56 1202636.31 15 845954.32 974454.56 16 14295.46 845954.32 17 187882.73 14295.46 18 584658.49 187882.73 19 825722.72 584658.49 20 649435.04 825722.72 21 440213.59 649435.04 22 1065201.21 440213.59 23 584194.08 1065201.21 24 -44916.23 584194.08 25 654134.22 -44916.23 26 588293.56 654134.22 27 -256631.86 588293.56 28 -1300283.33 -256631.86 29 -1092267.29 -1300283.33 30 259681.57 -1092267.29 31 -675865.84 259681.57 32 -508500.45 -675865.84 33 -17818.50 -508500.45 34 -50823.51 -17818.50 35 250985.53 -50823.51 36 -1803304.47 250985.53 37 -521422.63 -1803304.47 38 -354024.09 -521422.63 39 -1332471.53 -354024.09 40 -1288965.19 -1332471.53 41 -1108929.83 -1288965.19 42 -132167.84 -1108929.83 43 -241996.86 -132167.84 44 149053.53 -241996.86 45 -51696.02 149053.53 46 346757.27 -51696.02 47 562517.92 346757.27 48 -1001234.27 562517.92 49 220173.38 -1001234.27 50 -544137.32 220173.38 51 145997.77 -544137.32 52 -866810.40 145997.77 53 -701722.27 -866810.40 54 -40123.61 -701722.27 55 525172.66 -40123.61 56 -745445.28 525172.66 57 -118499.39 -745445.28 58 640472.70 -118499.39 59 688078.88 640472.70 60 NA 688078.88 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1191001.55 -872943.72 [2,] 1098285.29 1191001.55 [3,] 129243.28 1098285.29 [4,] -1152933.78 129243.28 [5,] -501755.25 -1152933.78 [6,] 42271.58 -501755.25 [7,] 193497.68 42271.58 [8,] 121910.92 193497.68 [9,] 781298.56 121910.92 [10,] 864705.17 781298.56 [11,] 1183921.29 864705.17 [12,] -684412.05 1183921.29 [13,] 1202636.31 -684412.05 [14,] 974454.56 1202636.31 [15,] 845954.32 974454.56 [16,] 14295.46 845954.32 [17,] 187882.73 14295.46 [18,] 584658.49 187882.73 [19,] 825722.72 584658.49 [20,] 649435.04 825722.72 [21,] 440213.59 649435.04 [22,] 1065201.21 440213.59 [23,] 584194.08 1065201.21 [24,] -44916.23 584194.08 [25,] 654134.22 -44916.23 [26,] 588293.56 654134.22 [27,] -256631.86 588293.56 [28,] -1300283.33 -256631.86 [29,] -1092267.29 -1300283.33 [30,] 259681.57 -1092267.29 [31,] -675865.84 259681.57 [32,] -508500.45 -675865.84 [33,] -17818.50 -508500.45 [34,] -50823.51 -17818.50 [35,] 250985.53 -50823.51 [36,] -1803304.47 250985.53 [37,] -521422.63 -1803304.47 [38,] -354024.09 -521422.63 [39,] -1332471.53 -354024.09 [40,] -1288965.19 -1332471.53 [41,] -1108929.83 -1288965.19 [42,] -132167.84 -1108929.83 [43,] -241996.86 -132167.84 [44,] 149053.53 -241996.86 [45,] -51696.02 149053.53 [46,] 346757.27 -51696.02 [47,] 562517.92 346757.27 [48,] -1001234.27 562517.92 [49,] 220173.38 -1001234.27 [50,] -544137.32 220173.38 [51,] 145997.77 -544137.32 [52,] -866810.40 145997.77 [53,] -701722.27 -866810.40 [54,] -40123.61 -701722.27 [55,] 525172.66 -40123.61 [56,] -745445.28 525172.66 [57,] -118499.39 -745445.28 [58,] 640472.70 -118499.39 [59,] 688078.88 640472.70 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1191001.55 -872943.72 2 1098285.29 1191001.55 3 129243.28 1098285.29 4 -1152933.78 129243.28 5 -501755.25 -1152933.78 6 42271.58 -501755.25 7 193497.68 42271.58 8 121910.92 193497.68 9 781298.56 121910.92 10 864705.17 781298.56 11 1183921.29 864705.17 12 -684412.05 1183921.29 13 1202636.31 -684412.05 14 974454.56 1202636.31 15 845954.32 974454.56 16 14295.46 845954.32 17 187882.73 14295.46 18 584658.49 187882.73 19 825722.72 584658.49 20 649435.04 825722.72 21 440213.59 649435.04 22 1065201.21 440213.59 23 584194.08 1065201.21 24 -44916.23 584194.08 25 654134.22 -44916.23 26 588293.56 654134.22 27 -256631.86 588293.56 28 -1300283.33 -256631.86 29 -1092267.29 -1300283.33 30 259681.57 -1092267.29 31 -675865.84 259681.57 32 -508500.45 -675865.84 33 -17818.50 -508500.45 34 -50823.51 -17818.50 35 250985.53 -50823.51 36 -1803304.47 250985.53 37 -521422.63 -1803304.47 38 -354024.09 -521422.63 39 -1332471.53 -354024.09 40 -1288965.19 -1332471.53 41 -1108929.83 -1288965.19 42 -132167.84 -1108929.83 43 -241996.86 -132167.84 44 149053.53 -241996.86 45 -51696.02 149053.53 46 346757.27 -51696.02 47 562517.92 346757.27 48 -1001234.27 562517.92 49 220173.38 -1001234.27 50 -544137.32 220173.38 51 145997.77 -544137.32 52 -866810.40 145997.77 53 -701722.27 -866810.40 54 -40123.61 -701722.27 55 525172.66 -40123.61 56 -745445.28 525172.66 57 -118499.39 -745445.28 58 640472.70 -118499.39 59 688078.88 640472.70 > 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/7u2uj1291201631.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/8u2uj1291201631.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/9u2uj1291201631.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/10mtum1291201631.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/11qcss1291201631.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/12tu9g1291201631.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/13p46p1291201631.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/14t4nd1291201631.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/15enmj1291201631.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/1606271291201631.tab") + } > > try(system("convert tmp/1gaft1291201631.ps tmp/1gaft1291201631.png",intern=TRUE)) character(0) > try(system("convert tmp/2gaft1291201631.ps tmp/2gaft1291201631.png",intern=TRUE)) character(0) > try(system("convert tmp/38jee1291201631.ps tmp/38jee1291201631.png",intern=TRUE)) character(0) > try(system("convert tmp/48jee1291201631.ps tmp/48jee1291201631.png",intern=TRUE)) character(0) > try(system("convert tmp/58jee1291201631.ps tmp/58jee1291201631.png",intern=TRUE)) character(0) > try(system("convert tmp/6jtdz1291201631.ps tmp/6jtdz1291201631.png",intern=TRUE)) character(0) > try(system("convert tmp/7u2uj1291201631.ps tmp/7u2uj1291201631.png",intern=TRUE)) character(0) > try(system("convert tmp/8u2uj1291201631.ps tmp/8u2uj1291201631.png",intern=TRUE)) character(0) > try(system("convert tmp/9u2uj1291201631.ps tmp/9u2uj1291201631.png",intern=TRUE)) character(0) > try(system("convert tmp/10mtum1291201631.ps tmp/10mtum1291201631.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.563 1.670 5.826