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(562000,4814,561000,3908,555000,5250,544000,3937,537000,4004,543000,5560,594000,3922,611000,3759,613000,4138,611000,4634,594000,3996,595000,4308,591000,4143,589000,4429,584000,5219,573000,4929,567000,5755,569000,5592,621000,4163,629000,4962,628000,5208,612000,4755,595000,4491,597000,5732,593000,5731,590000,5040,580000,6102,574000,4904,573000,5369,573000,5578,620000,4619,626000,4731,620000,5011,588000,5299,566000,4146,557000,4625,561000,4736,549000,4219,532000,5116,526000,4205,511000,4121,499000,5103,555000,4300,565000,4578,542000,3809,527000,5526,510000,4247,514000,3830,517000,4394,508000,4826,493000,4409,490000,4569,469000,4106,478000,4794,528000,3914,534000,3793,518000,4405,506000,4022,502000,4100,516000,4788),dim=c(2,60),dimnames=list(c('werkloos','bouw'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('werkloos','bouw'),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 = 'Do not include Seasonal 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 werkloos bouw 1 562000 4814 2 561000 3908 3 555000 5250 4 544000 3937 5 537000 4004 6 543000 5560 7 594000 3922 8 611000 3759 9 613000 4138 10 611000 4634 11 594000 3996 12 595000 4308 13 591000 4143 14 589000 4429 15 584000 5219 16 573000 4929 17 567000 5755 18 569000 5592 19 621000 4163 20 629000 4962 21 628000 5208 22 612000 4755 23 595000 4491 24 597000 5732 25 593000 5731 26 590000 5040 27 580000 6102 28 574000 4904 29 573000 5369 30 573000 5578 31 620000 4619 32 626000 4731 33 620000 5011 34 588000 5299 35 566000 4146 36 557000 4625 37 561000 4736 38 549000 4219 39 532000 5116 40 526000 4205 41 511000 4121 42 499000 5103 43 555000 4300 44 565000 4578 45 542000 3809 46 527000 5526 47 510000 4247 48 514000 3830 49 517000 4394 50 508000 4826 51 493000 4409 52 490000 4569 53 469000 4106 54 478000 4794 55 528000 3914 56 534000 3793 57 518000 4405 58 506000 4022 59 502000 4100 60 516000 4788 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) bouw 488516.20 15.34 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -84042.1 -33688.1 -707.6 33818.2 68635.6 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 4.885e+05 4.197e+04 11.641 <2e-16 *** bouw 1.534e+01 8.962e+00 1.711 0.0924 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 41300 on 58 degrees of freedom Multiple R-squared: 0.04806, Adjusted R-squared: 0.03165 F-statistic: 2.928 on 1 and 58 DF, p-value: 0.09238 > 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.023861208 0.04772242 0.97613879 [2,] 0.009727995 0.01945599 0.99027201 [3,] 0.046496583 0.09299317 0.95350342 [4,] 0.098212521 0.19642504 0.90178748 [5,] 0.144884928 0.28976986 0.85511507 [6,] 0.191852430 0.38370486 0.80814757 [7,] 0.143848269 0.28769654 0.85615173 [8,] 0.111438789 0.22287758 0.88856121 [9,] 0.080399458 0.16079892 0.91960054 [10,] 0.056641880 0.11328376 0.94335812 [11,] 0.039314084 0.07862817 0.96068592 [12,] 0.022705246 0.04541049 0.97729475 [13,] 0.012967344 0.02593469 0.98703266 [14,] 0.007015183 0.01403037 0.99298482 [15,] 0.014957264 0.02991453 0.98504274 [16,] 0.043462431 0.08692486 0.95653757 [17,] 0.084843985 0.16968797 0.91515601 [18,] 0.098514719 0.19702944 0.90148528 [19,] 0.091606942 0.18321388 0.90839306 [20,] 0.070534984 0.14106997 0.92946502 [21,] 0.050604516 0.10120903 0.94939548 [22,] 0.039166690 0.07833338 0.96083331 [23,] 0.025095313 0.05019063 0.97490469 [24,] 0.018074767 0.03614953 0.98192523 [25,] 0.011838966 0.02367793 0.98816103 [26,] 0.007394546 0.01478909 0.99260545 [27,] 0.020864784 0.04172957 0.97913522 [28,] 0.085479610 0.17095922 0.91452039 [29,] 0.265182206 0.53036441 0.73481779 [30,] 0.382606671 0.76521334 0.61739333 [31,] 0.459418523 0.91883705 0.54058148 [32,] 0.524749839 0.95050032 0.47525016 [33,] 0.624291003 0.75141799 0.37570900 [34,] 0.687487493 0.62502501 0.31251251 [35,] 0.736128547 0.52774291 0.26387145 [36,] 0.766080048 0.46783990 0.23391995 [37,] 0.805542454 0.38891509 0.19445755 [38,] 0.853730220 0.29253956 0.14626978 [39,] 0.890534400 0.21893120 0.10946560 [40,] 0.968309175 0.06338165 0.03169082 [41,] 0.977123587 0.04575283 0.02287641 [42,] 0.986985838 0.02602832 0.01301416 [43,] 0.982004163 0.03599167 0.01799584 [44,] 0.971899832 0.05620034 0.02810017 [45,] 0.961652366 0.07669527 0.03834763 [46,] 0.951538351 0.09692330 0.04846165 [47,] 0.930093760 0.13981248 0.06990624 [48,] 0.896831333 0.20633733 0.10316867 [49,] 0.974674386 0.05065123 0.02532561 [50,] 0.981960317 0.03607937 0.01803968 [51,] 0.949377848 0.10124430 0.05062215 > postscript(file="/var/www/html/rcomp/tmp/1vdji1258815078.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/22q141258815078.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/3d64f1258815078.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/42u911258815078.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/5ekcp1258815078.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 -348.8669 12546.5205 -14035.8304 -4898.2546 -12925.8384 -30790.3227 7 8 9 10 11 12 45331.8015 64831.7443 61018.9939 51411.8061 44196.8582 40411.6916 13 14 15 16 17 18 38942.3086 32555.9059 15439.6189 8887.3698 -9781.0518 -5281.1090 19 20 21 22 23 24 68635.5671 64381.2464 59608.3267 50556.0204 37605.0074 20571.7009 25 26 27 28 29 30 16587.0379 24184.9548 -2103.0158 10270.7966 2139.0581 -1066.3900 31 32 33 34 35 36 60641.8622 64924.1101 54629.7299 18212.6531 13896.2973 -2450.1602 37 38 39 40 41 42 -152.5753 -4223.3089 -34980.6627 -27008.5899 -40720.2759 -67781.2807 43 44 45 46 47 48 534.3882 6270.6822 -4935.1093 -46268.8623 -43652.7470 -33257.1879 49 50 51 52 53 54 -38907.2966 -54532.9117 -63137.3526 -68591.2842 -82490.2198 -84042.1254 55 56 57 58 59 60 -20545.5019 -12689.7162 -38076.0044 -44201.9057 -49398.1973 -45950.1030 > postscript(file="/var/www/html/rcomp/tmp/637861258815078.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 -348.8669 NA 1 12546.5205 -348.8669 2 -14035.8304 12546.5205 3 -4898.2546 -14035.8304 4 -12925.8384 -4898.2546 5 -30790.3227 -12925.8384 6 45331.8015 -30790.3227 7 64831.7443 45331.8015 8 61018.9939 64831.7443 9 51411.8061 61018.9939 10 44196.8582 51411.8061 11 40411.6916 44196.8582 12 38942.3086 40411.6916 13 32555.9059 38942.3086 14 15439.6189 32555.9059 15 8887.3698 15439.6189 16 -9781.0518 8887.3698 17 -5281.1090 -9781.0518 18 68635.5671 -5281.1090 19 64381.2464 68635.5671 20 59608.3267 64381.2464 21 50556.0204 59608.3267 22 37605.0074 50556.0204 23 20571.7009 37605.0074 24 16587.0379 20571.7009 25 24184.9548 16587.0379 26 -2103.0158 24184.9548 27 10270.7966 -2103.0158 28 2139.0581 10270.7966 29 -1066.3900 2139.0581 30 60641.8622 -1066.3900 31 64924.1101 60641.8622 32 54629.7299 64924.1101 33 18212.6531 54629.7299 34 13896.2973 18212.6531 35 -2450.1602 13896.2973 36 -152.5753 -2450.1602 37 -4223.3089 -152.5753 38 -34980.6627 -4223.3089 39 -27008.5899 -34980.6627 40 -40720.2759 -27008.5899 41 -67781.2807 -40720.2759 42 534.3882 -67781.2807 43 6270.6822 534.3882 44 -4935.1093 6270.6822 45 -46268.8623 -4935.1093 46 -43652.7470 -46268.8623 47 -33257.1879 -43652.7470 48 -38907.2966 -33257.1879 49 -54532.9117 -38907.2966 50 -63137.3526 -54532.9117 51 -68591.2842 -63137.3526 52 -82490.2198 -68591.2842 53 -84042.1254 -82490.2198 54 -20545.5019 -84042.1254 55 -12689.7162 -20545.5019 56 -38076.0044 -12689.7162 57 -44201.9057 -38076.0044 58 -49398.1973 -44201.9057 59 -45950.1030 -49398.1973 60 NA -45950.1030 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 12546.5205 -348.8669 [2,] -14035.8304 12546.5205 [3,] -4898.2546 -14035.8304 [4,] -12925.8384 -4898.2546 [5,] -30790.3227 -12925.8384 [6,] 45331.8015 -30790.3227 [7,] 64831.7443 45331.8015 [8,] 61018.9939 64831.7443 [9,] 51411.8061 61018.9939 [10,] 44196.8582 51411.8061 [11,] 40411.6916 44196.8582 [12,] 38942.3086 40411.6916 [13,] 32555.9059 38942.3086 [14,] 15439.6189 32555.9059 [15,] 8887.3698 15439.6189 [16,] -9781.0518 8887.3698 [17,] -5281.1090 -9781.0518 [18,] 68635.5671 -5281.1090 [19,] 64381.2464 68635.5671 [20,] 59608.3267 64381.2464 [21,] 50556.0204 59608.3267 [22,] 37605.0074 50556.0204 [23,] 20571.7009 37605.0074 [24,] 16587.0379 20571.7009 [25,] 24184.9548 16587.0379 [26,] -2103.0158 24184.9548 [27,] 10270.7966 -2103.0158 [28,] 2139.0581 10270.7966 [29,] -1066.3900 2139.0581 [30,] 60641.8622 -1066.3900 [31,] 64924.1101 60641.8622 [32,] 54629.7299 64924.1101 [33,] 18212.6531 54629.7299 [34,] 13896.2973 18212.6531 [35,] -2450.1602 13896.2973 [36,] -152.5753 -2450.1602 [37,] -4223.3089 -152.5753 [38,] -34980.6627 -4223.3089 [39,] -27008.5899 -34980.6627 [40,] -40720.2759 -27008.5899 [41,] -67781.2807 -40720.2759 [42,] 534.3882 -67781.2807 [43,] 6270.6822 534.3882 [44,] -4935.1093 6270.6822 [45,] -46268.8623 -4935.1093 [46,] -43652.7470 -46268.8623 [47,] -33257.1879 -43652.7470 [48,] -38907.2966 -33257.1879 [49,] -54532.9117 -38907.2966 [50,] -63137.3526 -54532.9117 [51,] -68591.2842 -63137.3526 [52,] -82490.2198 -68591.2842 [53,] -84042.1254 -82490.2198 [54,] -20545.5019 -84042.1254 [55,] -12689.7162 -20545.5019 [56,] -38076.0044 -12689.7162 [57,] -44201.9057 -38076.0044 [58,] -49398.1973 -44201.9057 [59,] -45950.1030 -49398.1973 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 12546.5205 -348.8669 2 -14035.8304 12546.5205 3 -4898.2546 -14035.8304 4 -12925.8384 -4898.2546 5 -30790.3227 -12925.8384 6 45331.8015 -30790.3227 7 64831.7443 45331.8015 8 61018.9939 64831.7443 9 51411.8061 61018.9939 10 44196.8582 51411.8061 11 40411.6916 44196.8582 12 38942.3086 40411.6916 13 32555.9059 38942.3086 14 15439.6189 32555.9059 15 8887.3698 15439.6189 16 -9781.0518 8887.3698 17 -5281.1090 -9781.0518 18 68635.5671 -5281.1090 19 64381.2464 68635.5671 20 59608.3267 64381.2464 21 50556.0204 59608.3267 22 37605.0074 50556.0204 23 20571.7009 37605.0074 24 16587.0379 20571.7009 25 24184.9548 16587.0379 26 -2103.0158 24184.9548 27 10270.7966 -2103.0158 28 2139.0581 10270.7966 29 -1066.3900 2139.0581 30 60641.8622 -1066.3900 31 64924.1101 60641.8622 32 54629.7299 64924.1101 33 18212.6531 54629.7299 34 13896.2973 18212.6531 35 -2450.1602 13896.2973 36 -152.5753 -2450.1602 37 -4223.3089 -152.5753 38 -34980.6627 -4223.3089 39 -27008.5899 -34980.6627 40 -40720.2759 -27008.5899 41 -67781.2807 -40720.2759 42 534.3882 -67781.2807 43 6270.6822 534.3882 44 -4935.1093 6270.6822 45 -46268.8623 -4935.1093 46 -43652.7470 -46268.8623 47 -33257.1879 -43652.7470 48 -38907.2966 -33257.1879 49 -54532.9117 -38907.2966 50 -63137.3526 -54532.9117 51 -68591.2842 -63137.3526 52 -82490.2198 -68591.2842 53 -84042.1254 -82490.2198 54 -20545.5019 -84042.1254 55 -12689.7162 -20545.5019 56 -38076.0044 -12689.7162 57 -44201.9057 -38076.0044 58 -49398.1973 -44201.9057 59 -45950.1030 -49398.1973 > 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/77bsx1258815078.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/8wn4p1258815078.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/9u3g51258815078.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/1006d51258815078.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/11h3et1258815078.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/125e0n1258815079.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/131ax61258815079.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/14c6571258815079.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/15ikzo1258815079.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/167ghe1258815079.tab") + } > > system("convert tmp/1vdji1258815078.ps tmp/1vdji1258815078.png") > system("convert tmp/22q141258815078.ps tmp/22q141258815078.png") > system("convert tmp/3d64f1258815078.ps tmp/3d64f1258815078.png") > system("convert tmp/42u911258815078.ps tmp/42u911258815078.png") > system("convert tmp/5ekcp1258815078.ps tmp/5ekcp1258815078.png") > system("convert tmp/637861258815078.ps tmp/637861258815078.png") > system("convert tmp/77bsx1258815078.ps tmp/77bsx1258815078.png") > system("convert tmp/8wn4p1258815078.ps tmp/8wn4p1258815078.png") > system("convert tmp/9u3g51258815078.ps tmp/9u3g51258815078.png") > system("convert tmp/1006d51258815078.ps tmp/1006d51258815078.png") > > > proc.time() user system elapsed 2.496 1.559 2.903