R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(2174.56,0,2196.72,0,2350.44,0,2440.25,0,2408.64,0,2472.81,0,2407.6,0,2454.62,0,2448.05,0,2497.84,0,2645.64,0,2756.76,0,2849.27,0,2921.44,0,2981.85,0,3080.58,0,3106.22,0,3119.31,0,3061.26,0,3097.31,0,3161.69,0,3257.16,0,3277.01,0,3295.32,0,3363.99,0,3494.17,0,3667.03,0,3813.06,0,3917.96,0,3895.51,0,3801.06,0,3570.12,0,3701.61,0,3862.27,0,3970.1,0,4138.52,0,4199.75,0,4290.89,0,4443.91,0,4502.64,0,4356.98,0,4591.27,0,4696.96,0,4621.4,0,4562.84,0,4202.52,0,4296.49,0,4435.23,0,4105.18,0,4116.68,0,3844.49,0,3720.98,0,3674.4,0,3857.62,0,3801.06,0,3504.37,1,3032.6,1,3047.03,1,2962.34,1,2197.82,1,2014.45,1),dim=c(2,61),dimnames=list(c('Bel_20','dummy'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Bel_20','dummy'),1:61)) > 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 Bel_20 dummy 1 2174.56 0 2 2196.72 0 3 2350.44 0 4 2440.25 0 5 2408.64 0 6 2472.81 0 7 2407.60 0 8 2454.62 0 9 2448.05 0 10 2497.84 0 11 2645.64 0 12 2756.76 0 13 2849.27 0 14 2921.44 0 15 2981.85 0 16 3080.58 0 17 3106.22 0 18 3119.31 0 19 3061.26 0 20 3097.31 0 21 3161.69 0 22 3257.16 0 23 3277.01 0 24 3295.32 0 25 3363.99 0 26 3494.17 0 27 3667.03 0 28 3813.06 0 29 3917.96 0 30 3895.51 0 31 3801.06 0 32 3570.12 0 33 3701.61 0 34 3862.27 0 35 3970.10 0 36 4138.52 0 37 4199.75 0 38 4290.89 0 39 4443.91 0 40 4502.64 0 41 4356.98 0 42 4591.27 0 43 4696.96 0 44 4621.40 0 45 4562.84 0 46 4202.52 0 47 4296.49 0 48 4435.23 0 49 4105.18 0 50 4116.68 0 51 3844.49 0 52 3720.98 0 53 3674.40 0 54 3857.62 0 55 3801.06 0 56 3504.37 1 57 3032.60 1 58 3047.03 1 59 2962.34 1 60 2197.82 1 61 2014.45 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) dummy 3490.5 -697.4 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1316.0 -569.1 176.5 614.7 1206.4 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3490.53 97.51 35.797 <2e-16 *** dummy -697.43 310.91 -2.243 0.0287 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 723.1 on 59 degrees of freedom Multiple R-squared: 0.07858, Adjusted R-squared: 0.06297 F-statistic: 5.032 on 1 and 59 DF, p-value: 0.02865 > 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,] 1.329236e-02 2.658471e-02 0.986707643 [2,] 4.595937e-03 9.191875e-03 0.995404063 [3,] 1.130303e-03 2.260606e-03 0.998869697 [4,] 3.427528e-04 6.855056e-04 0.999657247 [5,] 1.033540e-04 2.067080e-04 0.999896646 [6,] 4.406626e-05 8.813252e-05 0.999955934 [7,] 7.464024e-05 1.492805e-04 0.999925360 [8,] 2.310121e-04 4.620242e-04 0.999768988 [9,] 7.653570e-04 1.530714e-03 0.999234643 [10,] 2.198401e-03 4.396802e-03 0.997801599 [11,] 5.422542e-03 1.084508e-02 0.994577458 [12,] 1.378390e-02 2.756779e-02 0.986216104 [13,] 2.718590e-02 5.437180e-02 0.972814101 [14,] 4.551447e-02 9.102894e-02 0.954485529 [15,] 6.402359e-02 1.280472e-01 0.935976409 [16,] 9.211824e-02 1.842365e-01 0.907881756 [17,] 1.367647e-01 2.735293e-01 0.863235342 [18,] 2.070129e-01 4.140257e-01 0.792987134 [19,] 2.945571e-01 5.891142e-01 0.705442910 [20,] 3.989761e-01 7.979522e-01 0.601023901 [21,] 5.194075e-01 9.611850e-01 0.480592502 [22,] 6.454942e-01 7.090116e-01 0.354505816 [23,] 7.622039e-01 4.755921e-01 0.237796070 [24,] 8.509328e-01 2.981343e-01 0.149067167 [25,] 9.072875e-01 1.854250e-01 0.092712475 [26,] 9.342935e-01 1.314130e-01 0.065706485 [27,] 9.470496e-01 1.059009e-01 0.052950430 [28,] 9.596698e-01 8.066040e-02 0.040330199 [29,] 9.675744e-01 6.485121e-02 0.032425605 [30,] 9.721756e-01 5.564874e-02 0.027824370 [31,] 9.749976e-01 5.000474e-02 0.025002368 [32,] 9.775602e-01 4.487953e-02 0.022439766 [33,] 9.788608e-01 4.227843e-02 0.021139215 [34,] 9.799715e-01 4.005691e-02 0.020028454 [35,] 9.829938e-01 3.401248e-02 0.017006242 [36,] 9.856079e-01 2.878426e-02 0.014392129 [37,] 9.836243e-01 3.275135e-02 0.016375675 [38,] 9.866180e-01 2.676402e-02 0.013382010 [39,] 9.914400e-01 1.711994e-02 0.008559972 [40,] 9.936125e-01 1.277492e-02 0.006387459 [41,] 9.948052e-01 1.038959e-02 0.005194795 [42,] 9.914915e-01 1.701707e-02 0.008508536 [43,] 9.881213e-01 2.375740e-02 0.011878701 [44,] 9.885732e-01 2.285355e-02 0.011426776 [45,] 9.806953e-01 3.860947e-02 0.019304737 [46,] 9.697168e-01 6.056638e-02 0.030283190 [47,] 9.427040e-01 1.145921e-01 0.057296040 [48,] 8.958406e-01 2.083188e-01 0.104159382 [49,] 8.241128e-01 3.517743e-01 0.175887169 [50,] 7.172039e-01 5.655922e-01 0.282796122 [51,] 5.736331e-01 8.527339e-01 0.426366946 [52,] 6.039654e-01 7.920692e-01 0.396034616 > postscript(file="/var/www/html/rcomp/tmp/1qds71229719035.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/2jcy31229719035.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/3kybm1229719035.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/4oj1l1229719035.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/5nobe1229719035.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 = 61 Frequency = 1 1 2 3 4 5 6 7 -1315.9680 -1293.8080 -1140.0880 -1050.2780 -1081.8880 -1017.7180 -1082.9280 8 9 10 11 12 13 14 -1035.9080 -1042.4780 -992.6880 -844.8880 -733.7680 -641.2580 -569.0880 15 16 17 18 19 20 21 -508.6780 -409.9480 -384.3080 -371.2180 -429.2680 -393.2180 -328.8380 22 23 24 25 26 27 28 -233.3680 -213.5180 -195.2080 -126.5380 3.6420 176.5020 322.5320 29 30 31 32 33 34 35 427.4320 404.9820 310.5320 79.5920 211.0820 371.7420 479.5720 36 37 38 39 40 41 42 647.9920 709.2220 800.3620 953.3820 1012.1120 866.4520 1100.7420 43 44 45 46 47 48 49 1206.4320 1130.8720 1072.3120 711.9920 805.9620 944.7020 614.6520 50 51 52 53 54 55 56 626.1520 353.9620 230.4520 183.8720 367.0920 310.5320 711.2683 57 58 59 60 61 239.4983 253.9283 169.2383 -595.2817 -778.6517 > postscript(file="/var/www/html/rcomp/tmp/6a7vn1229719035.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 -1315.9680 NA 1 -1293.8080 -1315.9680 2 -1140.0880 -1293.8080 3 -1050.2780 -1140.0880 4 -1081.8880 -1050.2780 5 -1017.7180 -1081.8880 6 -1082.9280 -1017.7180 7 -1035.9080 -1082.9280 8 -1042.4780 -1035.9080 9 -992.6880 -1042.4780 10 -844.8880 -992.6880 11 -733.7680 -844.8880 12 -641.2580 -733.7680 13 -569.0880 -641.2580 14 -508.6780 -569.0880 15 -409.9480 -508.6780 16 -384.3080 -409.9480 17 -371.2180 -384.3080 18 -429.2680 -371.2180 19 -393.2180 -429.2680 20 -328.8380 -393.2180 21 -233.3680 -328.8380 22 -213.5180 -233.3680 23 -195.2080 -213.5180 24 -126.5380 -195.2080 25 3.6420 -126.5380 26 176.5020 3.6420 27 322.5320 176.5020 28 427.4320 322.5320 29 404.9820 427.4320 30 310.5320 404.9820 31 79.5920 310.5320 32 211.0820 79.5920 33 371.7420 211.0820 34 479.5720 371.7420 35 647.9920 479.5720 36 709.2220 647.9920 37 800.3620 709.2220 38 953.3820 800.3620 39 1012.1120 953.3820 40 866.4520 1012.1120 41 1100.7420 866.4520 42 1206.4320 1100.7420 43 1130.8720 1206.4320 44 1072.3120 1130.8720 45 711.9920 1072.3120 46 805.9620 711.9920 47 944.7020 805.9620 48 614.6520 944.7020 49 626.1520 614.6520 50 353.9620 626.1520 51 230.4520 353.9620 52 183.8720 230.4520 53 367.0920 183.8720 54 310.5320 367.0920 55 711.2683 310.5320 56 239.4983 711.2683 57 253.9283 239.4983 58 169.2383 253.9283 59 -595.2817 169.2383 60 -778.6517 -595.2817 61 NA -778.6517 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1293.8080 -1315.9680 [2,] -1140.0880 -1293.8080 [3,] -1050.2780 -1140.0880 [4,] -1081.8880 -1050.2780 [5,] -1017.7180 -1081.8880 [6,] -1082.9280 -1017.7180 [7,] -1035.9080 -1082.9280 [8,] -1042.4780 -1035.9080 [9,] -992.6880 -1042.4780 [10,] -844.8880 -992.6880 [11,] -733.7680 -844.8880 [12,] -641.2580 -733.7680 [13,] -569.0880 -641.2580 [14,] -508.6780 -569.0880 [15,] -409.9480 -508.6780 [16,] -384.3080 -409.9480 [17,] -371.2180 -384.3080 [18,] -429.2680 -371.2180 [19,] -393.2180 -429.2680 [20,] -328.8380 -393.2180 [21,] -233.3680 -328.8380 [22,] -213.5180 -233.3680 [23,] -195.2080 -213.5180 [24,] -126.5380 -195.2080 [25,] 3.6420 -126.5380 [26,] 176.5020 3.6420 [27,] 322.5320 176.5020 [28,] 427.4320 322.5320 [29,] 404.9820 427.4320 [30,] 310.5320 404.9820 [31,] 79.5920 310.5320 [32,] 211.0820 79.5920 [33,] 371.7420 211.0820 [34,] 479.5720 371.7420 [35,] 647.9920 479.5720 [36,] 709.2220 647.9920 [37,] 800.3620 709.2220 [38,] 953.3820 800.3620 [39,] 1012.1120 953.3820 [40,] 866.4520 1012.1120 [41,] 1100.7420 866.4520 [42,] 1206.4320 1100.7420 [43,] 1130.8720 1206.4320 [44,] 1072.3120 1130.8720 [45,] 711.9920 1072.3120 [46,] 805.9620 711.9920 [47,] 944.7020 805.9620 [48,] 614.6520 944.7020 [49,] 626.1520 614.6520 [50,] 353.9620 626.1520 [51,] 230.4520 353.9620 [52,] 183.8720 230.4520 [53,] 367.0920 183.8720 [54,] 310.5320 367.0920 [55,] 711.2683 310.5320 [56,] 239.4983 711.2683 [57,] 253.9283 239.4983 [58,] 169.2383 253.9283 [59,] -595.2817 169.2383 [60,] -778.6517 -595.2817 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1293.8080 -1315.9680 2 -1140.0880 -1293.8080 3 -1050.2780 -1140.0880 4 -1081.8880 -1050.2780 5 -1017.7180 -1081.8880 6 -1082.9280 -1017.7180 7 -1035.9080 -1082.9280 8 -1042.4780 -1035.9080 9 -992.6880 -1042.4780 10 -844.8880 -992.6880 11 -733.7680 -844.8880 12 -641.2580 -733.7680 13 -569.0880 -641.2580 14 -508.6780 -569.0880 15 -409.9480 -508.6780 16 -384.3080 -409.9480 17 -371.2180 -384.3080 18 -429.2680 -371.2180 19 -393.2180 -429.2680 20 -328.8380 -393.2180 21 -233.3680 -328.8380 22 -213.5180 -233.3680 23 -195.2080 -213.5180 24 -126.5380 -195.2080 25 3.6420 -126.5380 26 176.5020 3.6420 27 322.5320 176.5020 28 427.4320 322.5320 29 404.9820 427.4320 30 310.5320 404.9820 31 79.5920 310.5320 32 211.0820 79.5920 33 371.7420 211.0820 34 479.5720 371.7420 35 647.9920 479.5720 36 709.2220 647.9920 37 800.3620 709.2220 38 953.3820 800.3620 39 1012.1120 953.3820 40 866.4520 1012.1120 41 1100.7420 866.4520 42 1206.4320 1100.7420 43 1130.8720 1206.4320 44 1072.3120 1130.8720 45 711.9920 1072.3120 46 805.9620 711.9920 47 944.7020 805.9620 48 614.6520 944.7020 49 626.1520 614.6520 50 353.9620 626.1520 51 230.4520 353.9620 52 183.8720 230.4520 53 367.0920 183.8720 54 310.5320 367.0920 55 711.2683 310.5320 56 239.4983 711.2683 57 253.9283 239.4983 58 169.2383 253.9283 59 -595.2817 169.2383 60 -778.6517 -595.2817 > 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/76qav1229719035.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/8iho71229719035.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/948q81229719035.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/10t2cm1229719035.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/110xtt1229719035.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/12xgdi1229719035.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/132u431229719036.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/14h0wq1229719036.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/153yxa1229719036.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/16gkze1229719036.tab") + } > > system("convert tmp/1qds71229719035.ps tmp/1qds71229719035.png") > system("convert tmp/2jcy31229719035.ps tmp/2jcy31229719035.png") > system("convert tmp/3kybm1229719035.ps tmp/3kybm1229719035.png") > system("convert tmp/4oj1l1229719035.ps tmp/4oj1l1229719035.png") > system("convert tmp/5nobe1229719035.ps tmp/5nobe1229719035.png") > system("convert tmp/6a7vn1229719035.ps tmp/6a7vn1229719035.png") > system("convert tmp/76qav1229719035.ps tmp/76qav1229719035.png") > system("convert tmp/8iho71229719035.ps tmp/8iho71229719035.png") > system("convert tmp/948q81229719035.ps tmp/948q81229719035.png") > system("convert tmp/10t2cm1229719035.ps tmp/10t2cm1229719035.png") > > > proc.time() user system elapsed 2.492 1.564 4.552