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(2756.76 + ,3016.70 + ,2849.27 + ,3052.40 + ,2921.44 + ,3099.60 + ,2981.85 + ,3103.30 + ,3080.58 + ,3119.80 + ,3106.22 + ,3093.70 + ,3119.31 + ,3164.90 + ,3061.26 + ,3311.50 + ,3097.31 + ,3410.60 + ,3161.69 + ,3392.60 + ,3257.16 + ,3338.20 + ,3277.01 + ,3285.10 + ,3295.32 + ,3294.80 + ,3363.99 + ,3611.20 + ,3494.17 + ,3611.30 + ,3667.03 + ,3521.00 + ,3813.06 + ,3519.30 + ,3917.96 + ,3438.30 + ,3895.51 + ,3534.90 + ,3801.06 + ,3705.80 + ,3570.12 + ,3807.60 + ,3701.61 + ,3663.00 + ,3862.27 + ,3604.50 + ,3970.10 + ,3563.80 + ,4138.52 + ,3511.40 + ,4199.75 + ,3546.50 + ,4290.89 + ,3525.40 + ,4443.91 + ,3529.90 + ,4502.64 + ,3591.60 + ,4356.98 + ,3668.30 + ,4591.27 + ,3728.80 + ,4696.96 + ,3853.60 + ,4621.40 + ,3897.70 + ,4562.84 + ,3640.70 + ,4202.52 + ,3495.50 + ,4296.49 + ,3495.10 + ,4435.23 + ,3268.00 + ,4105.18 + ,3479.10 + ,4116.68 + ,3417.80 + ,3844.49 + ,3521.30 + ,3720.98 + ,3487.10 + ,3674.40 + ,3529.90 + ,3857.62 + ,3544.30 + ,3801.06 + ,3710.80 + ,3504.37 + ,3641.90 + ,3032.60 + ,3447.10 + ,3047.03 + ,3386.80 + ,2962.34 + ,3438.50 + ,2197.82 + ,3364.30 + ,2014.45 + ,3462.70 + ,1862.83 + ,3291.90 + ,1905.41 + ,3550.00 + ,1810.99 + ,3611.00 + ,1670.07 + ,3708.60 + ,1864.44 + ,3771.10 + ,2052.02 + ,4042.70 + ,2029.60 + ,3988.40 + ,2070.83 + ,3851.20 + ,2293.41 + ,3876.70) + ,dim=c(2 + ,59) + ,dimnames=list(c('Bel20' + ,'Zichtrekeningen ') + ,1:59)) > y <- array(NA,dim=c(2,59),dimnames=list(c('Bel20','Zichtrekeningen '),1:59)) > 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 Bel20 Zichtrekeningen\r 1 2756.76 3016.7 2 2849.27 3052.4 3 2921.44 3099.6 4 2981.85 3103.3 5 3080.58 3119.8 6 3106.22 3093.7 7 3119.31 3164.9 8 3061.26 3311.5 9 3097.31 3410.6 10 3161.69 3392.6 11 3257.16 3338.2 12 3277.01 3285.1 13 3295.32 3294.8 14 3363.99 3611.2 15 3494.17 3611.3 16 3667.03 3521.0 17 3813.06 3519.3 18 3917.96 3438.3 19 3895.51 3534.9 20 3801.06 3705.8 21 3570.12 3807.6 22 3701.61 3663.0 23 3862.27 3604.5 24 3970.10 3563.8 25 4138.52 3511.4 26 4199.75 3546.5 27 4290.89 3525.4 28 4443.91 3529.9 29 4502.64 3591.6 30 4356.98 3668.3 31 4591.27 3728.8 32 4696.96 3853.6 33 4621.40 3897.7 34 4562.84 3640.7 35 4202.52 3495.5 36 4296.49 3495.1 37 4435.23 3268.0 38 4105.18 3479.1 39 4116.68 3417.8 40 3844.49 3521.3 41 3720.98 3487.1 42 3674.40 3529.9 43 3857.62 3544.3 44 3801.06 3710.8 45 3504.37 3641.9 46 3032.60 3447.1 47 3047.03 3386.8 48 2962.34 3438.5 49 2197.82 3364.3 50 2014.45 3462.7 51 1862.83 3291.9 52 1905.41 3550.0 53 1810.99 3611.0 54 1670.07 3708.6 55 1864.44 3771.1 56 2052.02 4042.7 57 2029.60 3988.4 58 2070.83 3851.2 59 2293.41 3876.7 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `Zichtrekeningen\r` 2724.0442 0.1887 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1753.7 -364.6 93.2 649.2 1245.8 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2724.0442 1711.2043 1.592 0.117 `Zichtrekeningen\r` 0.1887 0.4864 0.388 0.700 Residual standard error: 854 on 57 degrees of freedom Multiple R-squared: 0.002633, Adjusted R-squared: -0.01486 F-statistic: 0.1505 on 1 and 57 DF, p-value: 0.6995 > 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.602609e-04 3.205217e-04 0.999839739 [2,] 1.075906e-04 2.151811e-04 0.999892409 [3,] 1.092165e-05 2.184329e-05 0.999989078 [4,] 1.758158e-05 3.516316e-05 0.999982418 [5,] 2.939947e-06 5.879894e-06 0.999997060 [6,] 3.245018e-07 6.490037e-07 0.999999675 [7,] 7.205807e-08 1.441161e-07 0.999999928 [8,] 2.412269e-08 4.824539e-08 0.999999976 [9,] 6.888320e-09 1.377664e-08 0.999999993 [10,] 8.602181e-10 1.720436e-09 0.999999999 [11,] 1.222527e-10 2.445054e-10 1.000000000 [12,] 2.468929e-10 4.937857e-10 1.000000000 [13,] 9.947947e-10 1.989589e-09 0.999999999 [14,] 1.001799e-08 2.003597e-08 0.999999990 [15,] 7.009958e-09 1.401992e-08 0.999999993 [16,] 1.468966e-09 2.937932e-09 0.999999999 [17,] 9.777086e-10 1.955417e-09 0.999999999 [18,] 1.998812e-10 3.997624e-10 1.000000000 [19,] 7.300719e-11 1.460144e-10 1.000000000 [20,] 6.103012e-11 1.220602e-10 1.000000000 [21,] 2.461306e-10 4.922613e-10 1.000000000 [22,] 5.824697e-10 1.164939e-09 0.999999999 [23,] 2.020231e-09 4.040461e-09 0.999999998 [24,] 1.125437e-08 2.250873e-08 0.999999989 [25,] 3.208879e-08 6.417757e-08 0.999999968 [26,] 2.622025e-08 5.244049e-08 0.999999974 [27,] 4.127257e-08 8.254513e-08 0.999999959 [28,] 7.997742e-08 1.599548e-07 0.999999920 [29,] 2.468911e-07 4.937822e-07 0.999999753 [30,] 1.116749e-06 2.233497e-06 0.999998883 [31,] 1.576113e-06 3.152226e-06 0.999998424 [32,] 3.683550e-06 7.367100e-06 0.999996316 [33,] 4.533938e-05 9.067876e-05 0.999954661 [34,] 6.763382e-05 1.352676e-04 0.999932366 [35,] 1.354492e-04 2.708984e-04 0.999864551 [36,] 1.900918e-04 3.801835e-04 0.999809908 [37,] 2.548625e-04 5.097250e-04 0.999745137 [38,] 4.702210e-04 9.404420e-04 0.999529779 [39,] 2.231106e-03 4.462212e-03 0.997768894 [40,] 3.083176e-02 6.166351e-02 0.969168243 [41,] 2.159150e-01 4.318301e-01 0.784084960 [42,] 3.782495e-01 7.564989e-01 0.621750525 [43,] 6.824199e-01 6.351602e-01 0.317580117 [44,] 9.923099e-01 1.538022e-02 0.007690108 [45,] 9.973067e-01 5.386676e-03 0.002693338 [46,] 9.976029e-01 4.794206e-03 0.002397103 [47,] 9.964707e-01 7.058686e-03 0.003529343 [48,] 9.945888e-01 1.082233e-02 0.005411163 [49,] 9.869331e-01 2.613375e-02 0.013066876 [50,] 9.815391e-01 3.692184e-02 0.018460922 > postscript(file="/var/www/html/rcomp/tmp/127u01258732597.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/2g8ad1258732597.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/37hpa1258732597.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/4nicp1258732597.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/54izr1258732597.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 = 59 Frequency = 1 1 2 3 4 5 6 -536.45146 -450.67705 -387.41238 -327.70046 -232.08355 -201.51921 7 8 9 10 11 12 -201.86267 -287.57200 -270.21941 -202.44331 -96.70955 -66.84106 13 14 15 16 17 18 -50.36118 -41.38704 88.77409 278.67119 425.02193 545.20437 19 20 21 22 23 24 504.52864 377.83457 127.68775 286.45974 458.15706 573.66602 25 26 27 28 29 30 751.97244 806.58005 901.70103 1053.87200 1100.96093 940.82978 31 32 33 34 35 36 1163.70512 1245.84883 1161.96839 1151.89713 818.97232 913.01779 37 38 39 40 41 42 1094.60524 724.72655 747.79215 456.07458 339.01717 284.36200 43 44 45 46 47 48 464.86512 376.89121 93.20072 -341.81594 -316.00901 -410.45336 49 50 51 52 53 54 -1160.97389 -1362.90923 -1482.30403 -1488.42031 -1594.34931 -1753.68371 55 56 57 58 59 -1571.10572 -1434.76907 -1446.94417 -1379.82835 -1162.05949 > postscript(file="/var/www/html/rcomp/tmp/65imb1258732597.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 = 59 Frequency = 1 lag(myerror, k = 1) myerror 0 -536.45146 NA 1 -450.67705 -536.45146 2 -387.41238 -450.67705 3 -327.70046 -387.41238 4 -232.08355 -327.70046 5 -201.51921 -232.08355 6 -201.86267 -201.51921 7 -287.57200 -201.86267 8 -270.21941 -287.57200 9 -202.44331 -270.21941 10 -96.70955 -202.44331 11 -66.84106 -96.70955 12 -50.36118 -66.84106 13 -41.38704 -50.36118 14 88.77409 -41.38704 15 278.67119 88.77409 16 425.02193 278.67119 17 545.20437 425.02193 18 504.52864 545.20437 19 377.83457 504.52864 20 127.68775 377.83457 21 286.45974 127.68775 22 458.15706 286.45974 23 573.66602 458.15706 24 751.97244 573.66602 25 806.58005 751.97244 26 901.70103 806.58005 27 1053.87200 901.70103 28 1100.96093 1053.87200 29 940.82978 1100.96093 30 1163.70512 940.82978 31 1245.84883 1163.70512 32 1161.96839 1245.84883 33 1151.89713 1161.96839 34 818.97232 1151.89713 35 913.01779 818.97232 36 1094.60524 913.01779 37 724.72655 1094.60524 38 747.79215 724.72655 39 456.07458 747.79215 40 339.01717 456.07458 41 284.36200 339.01717 42 464.86512 284.36200 43 376.89121 464.86512 44 93.20072 376.89121 45 -341.81594 93.20072 46 -316.00901 -341.81594 47 -410.45336 -316.00901 48 -1160.97389 -410.45336 49 -1362.90923 -1160.97389 50 -1482.30403 -1362.90923 51 -1488.42031 -1482.30403 52 -1594.34931 -1488.42031 53 -1753.68371 -1594.34931 54 -1571.10572 -1753.68371 55 -1434.76907 -1571.10572 56 -1446.94417 -1434.76907 57 -1379.82835 -1446.94417 58 -1162.05949 -1379.82835 59 NA -1162.05949 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -450.67705 -536.45146 [2,] -387.41238 -450.67705 [3,] -327.70046 -387.41238 [4,] -232.08355 -327.70046 [5,] -201.51921 -232.08355 [6,] -201.86267 -201.51921 [7,] -287.57200 -201.86267 [8,] -270.21941 -287.57200 [9,] -202.44331 -270.21941 [10,] -96.70955 -202.44331 [11,] -66.84106 -96.70955 [12,] -50.36118 -66.84106 [13,] -41.38704 -50.36118 [14,] 88.77409 -41.38704 [15,] 278.67119 88.77409 [16,] 425.02193 278.67119 [17,] 545.20437 425.02193 [18,] 504.52864 545.20437 [19,] 377.83457 504.52864 [20,] 127.68775 377.83457 [21,] 286.45974 127.68775 [22,] 458.15706 286.45974 [23,] 573.66602 458.15706 [24,] 751.97244 573.66602 [25,] 806.58005 751.97244 [26,] 901.70103 806.58005 [27,] 1053.87200 901.70103 [28,] 1100.96093 1053.87200 [29,] 940.82978 1100.96093 [30,] 1163.70512 940.82978 [31,] 1245.84883 1163.70512 [32,] 1161.96839 1245.84883 [33,] 1151.89713 1161.96839 [34,] 818.97232 1151.89713 [35,] 913.01779 818.97232 [36,] 1094.60524 913.01779 [37,] 724.72655 1094.60524 [38,] 747.79215 724.72655 [39,] 456.07458 747.79215 [40,] 339.01717 456.07458 [41,] 284.36200 339.01717 [42,] 464.86512 284.36200 [43,] 376.89121 464.86512 [44,] 93.20072 376.89121 [45,] -341.81594 93.20072 [46,] -316.00901 -341.81594 [47,] -410.45336 -316.00901 [48,] -1160.97389 -410.45336 [49,] -1362.90923 -1160.97389 [50,] -1482.30403 -1362.90923 [51,] -1488.42031 -1482.30403 [52,] -1594.34931 -1488.42031 [53,] -1753.68371 -1594.34931 [54,] -1571.10572 -1753.68371 [55,] -1434.76907 -1571.10572 [56,] -1446.94417 -1434.76907 [57,] -1379.82835 -1446.94417 [58,] -1162.05949 -1379.82835 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -450.67705 -536.45146 2 -387.41238 -450.67705 3 -327.70046 -387.41238 4 -232.08355 -327.70046 5 -201.51921 -232.08355 6 -201.86267 -201.51921 7 -287.57200 -201.86267 8 -270.21941 -287.57200 9 -202.44331 -270.21941 10 -96.70955 -202.44331 11 -66.84106 -96.70955 12 -50.36118 -66.84106 13 -41.38704 -50.36118 14 88.77409 -41.38704 15 278.67119 88.77409 16 425.02193 278.67119 17 545.20437 425.02193 18 504.52864 545.20437 19 377.83457 504.52864 20 127.68775 377.83457 21 286.45974 127.68775 22 458.15706 286.45974 23 573.66602 458.15706 24 751.97244 573.66602 25 806.58005 751.97244 26 901.70103 806.58005 27 1053.87200 901.70103 28 1100.96093 1053.87200 29 940.82978 1100.96093 30 1163.70512 940.82978 31 1245.84883 1163.70512 32 1161.96839 1245.84883 33 1151.89713 1161.96839 34 818.97232 1151.89713 35 913.01779 818.97232 36 1094.60524 913.01779 37 724.72655 1094.60524 38 747.79215 724.72655 39 456.07458 747.79215 40 339.01717 456.07458 41 284.36200 339.01717 42 464.86512 284.36200 43 376.89121 464.86512 44 93.20072 376.89121 45 -341.81594 93.20072 46 -316.00901 -341.81594 47 -410.45336 -316.00901 48 -1160.97389 -410.45336 49 -1362.90923 -1160.97389 50 -1482.30403 -1362.90923 51 -1488.42031 -1482.30403 52 -1594.34931 -1488.42031 53 -1753.68371 -1594.34931 54 -1571.10572 -1753.68371 55 -1434.76907 -1571.10572 56 -1446.94417 -1434.76907 57 -1379.82835 -1446.94417 58 -1162.05949 -1379.82835 > 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/76nxt1258732597.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/8a8fe1258732597.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/92tqf1258732597.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/10mpkz1258732597.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/11kwl71258732597.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/12gkao1258732597.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/13jn701258732597.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/14rwoe1258732598.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/15ip6c1258732598.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/16un741258732598.tab") + } > > system("convert tmp/127u01258732597.ps tmp/127u01258732597.png") > system("convert tmp/2g8ad1258732597.ps tmp/2g8ad1258732597.png") > system("convert tmp/37hpa1258732597.ps tmp/37hpa1258732597.png") > system("convert tmp/4nicp1258732597.ps tmp/4nicp1258732597.png") > system("convert tmp/54izr1258732597.ps tmp/54izr1258732597.png") > system("convert tmp/65imb1258732597.ps tmp/65imb1258732597.png") > system("convert tmp/76nxt1258732597.ps tmp/76nxt1258732597.png") > system("convert tmp/8a8fe1258732597.ps tmp/8a8fe1258732597.png") > system("convert tmp/92tqf1258732597.ps tmp/92tqf1258732597.png") > system("convert tmp/10mpkz1258732597.ps tmp/10mpkz1258732597.png") > > > proc.time() user system elapsed 2.455 1.555 2.818