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,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,1,3813.06,1,3917.96,1,3895.51,1,3801.06,1,3570.12,0,3701.61,1,3862.27,1,3970.1,1,4138.52,1,4199.75,1,4290.89,1,4443.91,1,4502.64,1,4356.98,1,4591.27,1,4696.96,1,4621.4,1,4562.84,1,4202.52,1,4296.49,1,4435.23,1,4105.18,1,4116.68,1,3844.49,1,3720.98,1,3674.4,1,3857.62,1,3801.06,1,3504.37,1,3032.6,1,3047.03,0,2962.34,1,2197.82,1,2014.45,1,1862.83,0,1905.41,0,1810.99,0,1670.07,0,1864.44,0,2052.02,0,2029.6,0,2070.83,0,2293.41,0,2443.27,0),dim=c(2,60),dimnames=list(c('BEL20','X '),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('BEL20','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]) + } + } > 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 X\r 1 2756.76 0 2 2849.27 0 3 2921.44 0 4 2981.85 0 5 3080.58 0 6 3106.22 0 7 3119.31 0 8 3061.26 0 9 3097.31 0 10 3161.69 0 11 3257.16 0 12 3277.01 0 13 3295.32 0 14 3363.99 0 15 3494.17 0 16 3667.03 1 17 3813.06 1 18 3917.96 1 19 3895.51 1 20 3801.06 1 21 3570.12 0 22 3701.61 1 23 3862.27 1 24 3970.10 1 25 4138.52 1 26 4199.75 1 27 4290.89 1 28 4443.91 1 29 4502.64 1 30 4356.98 1 31 4591.27 1 32 4696.96 1 33 4621.40 1 34 4562.84 1 35 4202.52 1 36 4296.49 1 37 4435.23 1 38 4105.18 1 39 4116.68 1 40 3844.49 1 41 3720.98 1 42 3674.40 1 43 3857.62 1 44 3801.06 1 45 3504.37 1 46 3032.60 1 47 3047.03 0 48 2962.34 1 49 2197.82 1 50 2014.45 1 51 1862.83 0 52 1905.41 0 53 1810.99 0 54 1670.07 0 55 1864.44 0 56 2052.02 0 57 2029.60 0 58 2070.83 0 59 2293.41 0 60 2443.27 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `X\r` 2720 1183 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1888.6 -246.2 165.2 409.8 850.0 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2720.1 117.9 23.07 < 2e-16 *** `X\r` 1182.9 159.0 7.44 5.35e-10 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 612.7 on 58 degrees of freedom Multiple R-squared: 0.4883, Adjusted R-squared: 0.4795 F-statistic: 55.35 on 1 and 58 DF, p-value: 5.349e-10 > 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.511238e-02 3.022477e-02 0.98488762 [2,] 5.901290e-03 1.180258e-02 0.99409871 [3,] 2.123534e-03 4.247067e-03 0.99787647 [4,] 5.211286e-04 1.042257e-03 0.99947887 [5,] 1.415153e-04 2.830307e-04 0.99985848 [6,] 5.457897e-05 1.091579e-04 0.99994542 [7,] 4.203199e-05 8.406398e-05 0.99995797 [8,] 3.043454e-05 6.086908e-05 0.99996957 [9,] 2.206299e-05 4.412598e-05 0.99997794 [10,] 2.488699e-05 4.977399e-05 0.99997511 [11,] 7.260981e-05 1.452196e-04 0.99992739 [12,] 2.313453e-05 4.626907e-05 0.99997687 [13,] 7.891364e-06 1.578273e-05 0.99999211 [14,] 2.974324e-06 5.948647e-06 0.99999703 [15,] 9.195314e-07 1.839063e-06 0.99999908 [16,] 2.538537e-07 5.077074e-07 0.99999975 [17,] 2.179077e-06 4.358154e-06 0.99999782 [18,] 7.911715e-07 1.582343e-06 0.99999921 [19,] 2.486747e-07 4.973494e-07 0.99999975 [20,] 9.540462e-08 1.908092e-07 0.99999990 [21,] 7.650082e-08 1.530016e-07 0.99999992 [22,] 7.176494e-08 1.435299e-07 0.99999993 [23,] 9.748505e-08 1.949701e-07 0.99999990 [24,] 3.028547e-07 6.057095e-07 0.99999970 [25,] 9.017096e-07 1.803419e-06 0.99999910 [26,] 8.203370e-07 1.640674e-06 0.99999918 [27,] 2.762844e-06 5.525688e-06 0.99999724 [28,] 1.472151e-05 2.944301e-05 0.99998528 [29,] 4.059918e-05 8.119837e-05 0.99995940 [30,] 8.605045e-05 1.721009e-04 0.99991395 [31,] 6.265420e-05 1.253084e-04 0.99993735 [32,] 6.389027e-05 1.277805e-04 0.99993611 [33,] 1.391629e-04 2.783258e-04 0.99986084 [34,] 1.485886e-04 2.971772e-04 0.99985141 [35,] 2.098764e-04 4.197529e-04 0.99979012 [36,] 2.787381e-04 5.574763e-04 0.99972126 [37,] 4.283969e-04 8.567937e-04 0.99957160 [38,] 7.316561e-04 1.463312e-03 0.99926834 [39,] 2.009981e-03 4.019963e-03 0.99799002 [40,] 1.016990e-02 2.033979e-02 0.98983010 [41,] 5.349621e-02 1.069924e-01 0.94650379 [42,] 1.795981e-01 3.591961e-01 0.82040194 [43,] 6.347588e-01 7.304823e-01 0.36524117 [44,] 9.527429e-01 9.451425e-02 0.04725713 [45,] 9.802138e-01 3.957239e-02 0.01978620 [46,] 9.853920e-01 2.921596e-02 0.01460798 [47,] 9.787242e-01 4.255156e-02 0.02127578 [48,] 9.632913e-01 7.341744e-02 0.03670872 [49,] 9.467703e-01 1.064594e-01 0.05322970 [50,] 9.629261e-01 7.414784e-02 0.03707392 [51,] 9.488467e-01 1.023066e-01 0.05115329 > postscript(file="/var/www/html/rcomp/tmp/1wyu91258815972.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/2jc5w1258815972.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/35s2c1258815972.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/4wsee1258815972.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/59ow11258815972.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 36.63556 129.14556 201.31556 261.72556 360.45556 386.09556 7 8 9 10 11 12 399.18556 341.13556 377.18556 441.56556 537.03556 556.88556 13 14 15 16 17 18 575.19556 643.86556 774.04556 -236.00000 -89.97000 14.93000 19 20 21 22 23 24 -7.52000 -101.97000 849.99556 -201.42000 -40.76000 67.07000 25 26 27 28 29 30 235.49000 296.72000 387.86000 540.88000 599.61000 453.95000 31 32 33 34 35 36 688.24000 793.93000 718.37000 659.81000 299.49000 393.46000 37 38 39 40 41 42 532.20000 202.15000 213.65000 -58.54000 -182.05000 -228.63000 43 44 45 46 47 48 -45.41000 -101.97000 -398.66000 -870.43000 326.90556 -940.69000 49 50 51 52 53 54 -1705.21000 -1888.58000 -857.29444 -814.71444 -909.13444 -1050.05444 55 56 57 58 59 60 -855.68444 -668.10444 -690.52444 -649.29444 -426.71444 -276.85444 > postscript(file="/var/www/html/rcomp/tmp/6npwq1258815972.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 36.63556 NA 1 129.14556 36.63556 2 201.31556 129.14556 3 261.72556 201.31556 4 360.45556 261.72556 5 386.09556 360.45556 6 399.18556 386.09556 7 341.13556 399.18556 8 377.18556 341.13556 9 441.56556 377.18556 10 537.03556 441.56556 11 556.88556 537.03556 12 575.19556 556.88556 13 643.86556 575.19556 14 774.04556 643.86556 15 -236.00000 774.04556 16 -89.97000 -236.00000 17 14.93000 -89.97000 18 -7.52000 14.93000 19 -101.97000 -7.52000 20 849.99556 -101.97000 21 -201.42000 849.99556 22 -40.76000 -201.42000 23 67.07000 -40.76000 24 235.49000 67.07000 25 296.72000 235.49000 26 387.86000 296.72000 27 540.88000 387.86000 28 599.61000 540.88000 29 453.95000 599.61000 30 688.24000 453.95000 31 793.93000 688.24000 32 718.37000 793.93000 33 659.81000 718.37000 34 299.49000 659.81000 35 393.46000 299.49000 36 532.20000 393.46000 37 202.15000 532.20000 38 213.65000 202.15000 39 -58.54000 213.65000 40 -182.05000 -58.54000 41 -228.63000 -182.05000 42 -45.41000 -228.63000 43 -101.97000 -45.41000 44 -398.66000 -101.97000 45 -870.43000 -398.66000 46 326.90556 -870.43000 47 -940.69000 326.90556 48 -1705.21000 -940.69000 49 -1888.58000 -1705.21000 50 -857.29444 -1888.58000 51 -814.71444 -857.29444 52 -909.13444 -814.71444 53 -1050.05444 -909.13444 54 -855.68444 -1050.05444 55 -668.10444 -855.68444 56 -690.52444 -668.10444 57 -649.29444 -690.52444 58 -426.71444 -649.29444 59 -276.85444 -426.71444 60 NA -276.85444 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 129.1456 36.63556 [2,] 201.3156 129.14556 [3,] 261.7256 201.31556 [4,] 360.4556 261.72556 [5,] 386.0956 360.45556 [6,] 399.1856 386.09556 [7,] 341.1356 399.18556 [8,] 377.1856 341.13556 [9,] 441.5656 377.18556 [10,] 537.0356 441.56556 [11,] 556.8856 537.03556 [12,] 575.1956 556.88556 [13,] 643.8656 575.19556 [14,] 774.0456 643.86556 [15,] -236.0000 774.04556 [16,] -89.9700 -236.00000 [17,] 14.9300 -89.97000 [18,] -7.5200 14.93000 [19,] -101.9700 -7.52000 [20,] 849.9956 -101.97000 [21,] -201.4200 849.99556 [22,] -40.7600 -201.42000 [23,] 67.0700 -40.76000 [24,] 235.4900 67.07000 [25,] 296.7200 235.49000 [26,] 387.8600 296.72000 [27,] 540.8800 387.86000 [28,] 599.6100 540.88000 [29,] 453.9500 599.61000 [30,] 688.2400 453.95000 [31,] 793.9300 688.24000 [32,] 718.3700 793.93000 [33,] 659.8100 718.37000 [34,] 299.4900 659.81000 [35,] 393.4600 299.49000 [36,] 532.2000 393.46000 [37,] 202.1500 532.20000 [38,] 213.6500 202.15000 [39,] -58.5400 213.65000 [40,] -182.0500 -58.54000 [41,] -228.6300 -182.05000 [42,] -45.4100 -228.63000 [43,] -101.9700 -45.41000 [44,] -398.6600 -101.97000 [45,] -870.4300 -398.66000 [46,] 326.9056 -870.43000 [47,] -940.6900 326.90556 [48,] -1705.2100 -940.69000 [49,] -1888.5800 -1705.21000 [50,] -857.2944 -1888.58000 [51,] -814.7144 -857.29444 [52,] -909.1344 -814.71444 [53,] -1050.0544 -909.13444 [54,] -855.6844 -1050.05444 [55,] -668.1044 -855.68444 [56,] -690.5244 -668.10444 [57,] -649.2944 -690.52444 [58,] -426.7144 -649.29444 [59,] -276.8544 -426.71444 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 129.1456 36.63556 2 201.3156 129.14556 3 261.7256 201.31556 4 360.4556 261.72556 5 386.0956 360.45556 6 399.1856 386.09556 7 341.1356 399.18556 8 377.1856 341.13556 9 441.5656 377.18556 10 537.0356 441.56556 11 556.8856 537.03556 12 575.1956 556.88556 13 643.8656 575.19556 14 774.0456 643.86556 15 -236.0000 774.04556 16 -89.9700 -236.00000 17 14.9300 -89.97000 18 -7.5200 14.93000 19 -101.9700 -7.52000 20 849.9956 -101.97000 21 -201.4200 849.99556 22 -40.7600 -201.42000 23 67.0700 -40.76000 24 235.4900 67.07000 25 296.7200 235.49000 26 387.8600 296.72000 27 540.8800 387.86000 28 599.6100 540.88000 29 453.9500 599.61000 30 688.2400 453.95000 31 793.9300 688.24000 32 718.3700 793.93000 33 659.8100 718.37000 34 299.4900 659.81000 35 393.4600 299.49000 36 532.2000 393.46000 37 202.1500 532.20000 38 213.6500 202.15000 39 -58.5400 213.65000 40 -182.0500 -58.54000 41 -228.6300 -182.05000 42 -45.4100 -228.63000 43 -101.9700 -45.41000 44 -398.6600 -101.97000 45 -870.4300 -398.66000 46 326.9056 -870.43000 47 -940.6900 326.90556 48 -1705.2100 -940.69000 49 -1888.5800 -1705.21000 50 -857.2944 -1888.58000 51 -814.7144 -857.29444 52 -909.1344 -814.71444 53 -1050.0544 -909.13444 54 -855.6844 -1050.05444 55 -668.1044 -855.68444 56 -690.5244 -668.10444 57 -649.2944 -690.52444 58 -426.7144 -649.29444 59 -276.8544 -426.71444 > 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/7l38z1258815972.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/8ijy51258815972.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/9i19k1258815972.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/10k1261258815972.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/11ne1b1258815972.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/1252vh1258815972.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/13bc2k1258815972.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/14bfq91258815972.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/152mqr1258815972.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/16mwk21258815972.tab") + } > > system("convert tmp/1wyu91258815972.ps tmp/1wyu91258815972.png") > system("convert tmp/2jc5w1258815972.ps tmp/2jc5w1258815972.png") > system("convert tmp/35s2c1258815972.ps tmp/35s2c1258815972.png") > system("convert tmp/4wsee1258815972.ps tmp/4wsee1258815972.png") > system("convert tmp/59ow11258815972.ps tmp/59ow11258815972.png") > system("convert tmp/6npwq1258815972.ps tmp/6npwq1258815972.png") > system("convert tmp/7l38z1258815972.ps tmp/7l38z1258815972.png") > system("convert tmp/8ijy51258815972.ps tmp/8ijy51258815972.png") > system("convert tmp/9i19k1258815972.ps tmp/9i19k1258815972.png") > system("convert tmp/10k1261258815972.ps tmp/10k1261258815972.png") > > > proc.time() user system elapsed 2.436 1.546 3.069