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(2490,0,3266,0,3475,0,3127,0,2955,0,3870,0,2852,0,3142,0,3029,0,3180,0,2560,0,2733,0,2452,0,2553,0,2777,0,2520,0,2318,0,2873,0,2311,0,2395,0,2099,0,2268,0,2316,0,2181,0,2175,0,2627,0,2578,0,3090,0,2634,0,3225,0,2938,0,3174,0,3350,0,2588,0,2061,0,2691,0,2061,0,2918,0,2223,0,2651,0,2379,0,3146,0,2883,0,2768,0,3258,0,2839,0,2470,0,5072,1,1463,1,1600,1,2203,1,2013,1,2169,1,2640,1,2411,1,2528,1,2292,1,1988,1,1774,1,2279,1),dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > 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 Y X 1 2490 0 2 3266 0 3 3475 0 4 3127 0 5 2955 0 6 3870 0 7 2852 0 8 3142 0 9 3029 0 10 3180 0 11 2560 0 12 2733 0 13 2452 0 14 2553 0 15 2777 0 16 2520 0 17 2318 0 18 2873 0 19 2311 0 20 2395 0 21 2099 0 22 2268 0 23 2316 0 24 2181 0 25 2175 0 26 2627 0 27 2578 0 28 3090 0 29 2634 0 30 3225 0 31 2938 0 32 3174 0 33 3350 0 34 2588 0 35 2061 0 36 2691 0 37 2061 0 38 2918 0 39 2223 0 40 2651 0 41 2379 0 42 3146 0 43 2883 0 44 2768 0 45 3258 0 46 2839 0 47 2470 0 48 5072 1 49 1463 1 50 1600 1 51 2203 1 52 2013 1 53 2169 1 54 2640 1 55 2411 1 56 2528 1 57 2292 1 58 1988 1 59 1774 1 60 2279 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 2733.4 -392.5 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -877.92 -342.02 -72.15 240.12 2731.08 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2733.38 79.87 34.221 <2e-16 *** X -392.46 171.60 -2.287 0.0259 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 547.6 on 58 degrees of freedom Multiple R-squared: 0.08273, Adjusted R-squared: 0.06691 F-statistic: 5.231 on 1 and 58 DF, p-value: 0.02586 > 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,] 3.848190e-01 0.7696379101 0.61518104 [2,] 5.647577e-01 0.8704845854 0.43524229 [3,] 4.646244e-01 0.9292487736 0.53537561 [4,] 3.398183e-01 0.6796365528 0.66018172 [5,] 2.391189e-01 0.4782377376 0.76088113 [6,] 1.624536e-01 0.3249072077 0.83754640 [7,] 1.800555e-01 0.3601109512 0.81994452 [8,] 1.428576e-01 0.2857151124 0.85714244 [9,] 1.605192e-01 0.3210384366 0.83948078 [10,] 1.424496e-01 0.2848991276 0.85755044 [11,] 1.002864e-01 0.2005727483 0.89971363 [12,] 8.699071e-02 0.1739814221 0.91300929 [13,] 9.828784e-02 0.1965756825 0.90171216 [14,] 6.555059e-02 0.1311011823 0.93444941 [15,] 6.998920e-02 0.1399783971 0.93001080 [16,] 6.209758e-02 0.1241951670 0.93790242 [17,] 8.666392e-02 0.1733278496 0.91333608 [18,] 8.418435e-02 0.1683687033 0.91581565 [19,] 7.494045e-02 0.1498808942 0.92505955 [20,] 7.841530e-02 0.1568305921 0.92158470 [21,] 8.085400e-02 0.1617079949 0.91914600 [22,] 5.578292e-02 0.1115658306 0.94421708 [23,] 3.807954e-02 0.0761590897 0.96192046 [24,] 3.014446e-02 0.0602889132 0.96985554 [25,] 1.932763e-02 0.0386552533 0.98067237 [26,] 1.804832e-02 0.0360966395 0.98195168 [27,] 1.186102e-02 0.0237220336 0.98813898 [28,] 1.006650e-02 0.0201329914 0.98993350 [29,] 1.192409e-02 0.0238481744 0.98807591 [30,] 7.397165e-03 0.0147943299 0.99260284 [31,] 9.576007e-03 0.0191520143 0.99042399 [32,] 5.630144e-03 0.0112602870 0.99436986 [33,] 7.256772e-03 0.0145135439 0.99274323 [34,] 4.421429e-03 0.0088428579 0.99557857 [35,] 4.077732e-03 0.0081554649 0.99592227 [36,] 2.297817e-03 0.0045956331 0.99770218 [37,] 1.678883e-03 0.0033577655 0.99832112 [38,] 1.153795e-03 0.0023075896 0.99884621 [39,] 5.982869e-04 0.0011965737 0.99940171 [40,] 2.894888e-04 0.0005789775 0.99971051 [41,] 2.416382e-04 0.0004832764 0.99975836 [42,] 1.176625e-04 0.0002353250 0.99988234 [43,] 5.498314e-05 0.0001099663 0.99994502 [44,] 5.945740e-01 0.8108520400 0.40542602 [45,] 9.510173e-01 0.0979653852 0.04898269 [46,] 9.841956e-01 0.0316087419 0.01580437 [47,] 9.659437e-01 0.0681125604 0.03405628 [48,] 9.442669e-01 0.1114661889 0.05573309 [49,] 8.899782e-01 0.2200435122 0.11002176 [50,] 8.744073e-01 0.2511854041 0.12559270 [51,] 7.804593e-01 0.4390813713 0.21954069 > postscript(file="/var/www/html/rcomp/tmp/1gveb1229781053.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/296p31229781053.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/3w56y1229781053.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/41cmn1229781053.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/5fto11229781053.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 -243.3829787 532.6170213 741.6170213 393.6170213 221.6170213 1136.6170213 7 8 9 10 11 12 118.6170213 408.6170213 295.6170213 446.6170213 -173.3829787 -0.3829787 13 14 15 16 17 18 -281.3829787 -180.3829787 43.6170213 -213.3829787 -415.3829787 139.6170213 19 20 21 22 23 24 -422.3829787 -338.3829787 -634.3829787 -465.3829787 -417.3829787 -552.3829787 25 26 27 28 29 30 -558.3829787 -106.3829787 -155.3829787 356.6170213 -99.3829787 491.6170213 31 32 33 34 35 36 204.6170213 440.6170213 616.6170213 -145.3829787 -672.3829787 -42.3829787 37 38 39 40 41 42 -672.3829787 184.6170213 -510.3829787 -82.3829787 -354.3829787 412.6170213 43 44 45 46 47 48 149.6170213 34.6170213 524.6170213 105.6170213 -263.3829787 2731.0769231 49 50 51 52 53 54 -877.9230769 -740.9230769 -137.9230769 -327.9230769 -171.9230769 299.0769231 55 56 57 58 59 60 70.0769231 187.0769231 -48.9230769 -352.9230769 -566.9230769 -61.9230769 > postscript(file="/var/www/html/rcomp/tmp/6kzrc1229781053.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 -243.3829787 NA 1 532.6170213 -243.3829787 2 741.6170213 532.6170213 3 393.6170213 741.6170213 4 221.6170213 393.6170213 5 1136.6170213 221.6170213 6 118.6170213 1136.6170213 7 408.6170213 118.6170213 8 295.6170213 408.6170213 9 446.6170213 295.6170213 10 -173.3829787 446.6170213 11 -0.3829787 -173.3829787 12 -281.3829787 -0.3829787 13 -180.3829787 -281.3829787 14 43.6170213 -180.3829787 15 -213.3829787 43.6170213 16 -415.3829787 -213.3829787 17 139.6170213 -415.3829787 18 -422.3829787 139.6170213 19 -338.3829787 -422.3829787 20 -634.3829787 -338.3829787 21 -465.3829787 -634.3829787 22 -417.3829787 -465.3829787 23 -552.3829787 -417.3829787 24 -558.3829787 -552.3829787 25 -106.3829787 -558.3829787 26 -155.3829787 -106.3829787 27 356.6170213 -155.3829787 28 -99.3829787 356.6170213 29 491.6170213 -99.3829787 30 204.6170213 491.6170213 31 440.6170213 204.6170213 32 616.6170213 440.6170213 33 -145.3829787 616.6170213 34 -672.3829787 -145.3829787 35 -42.3829787 -672.3829787 36 -672.3829787 -42.3829787 37 184.6170213 -672.3829787 38 -510.3829787 184.6170213 39 -82.3829787 -510.3829787 40 -354.3829787 -82.3829787 41 412.6170213 -354.3829787 42 149.6170213 412.6170213 43 34.6170213 149.6170213 44 524.6170213 34.6170213 45 105.6170213 524.6170213 46 -263.3829787 105.6170213 47 2731.0769231 -263.3829787 48 -877.9230769 2731.0769231 49 -740.9230769 -877.9230769 50 -137.9230769 -740.9230769 51 -327.9230769 -137.9230769 52 -171.9230769 -327.9230769 53 299.0769231 -171.9230769 54 70.0769231 299.0769231 55 187.0769231 70.0769231 56 -48.9230769 187.0769231 57 -352.9230769 -48.9230769 58 -566.9230769 -352.9230769 59 -61.9230769 -566.9230769 60 NA -61.9230769 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 532.6170213 -243.3829787 [2,] 741.6170213 532.6170213 [3,] 393.6170213 741.6170213 [4,] 221.6170213 393.6170213 [5,] 1136.6170213 221.6170213 [6,] 118.6170213 1136.6170213 [7,] 408.6170213 118.6170213 [8,] 295.6170213 408.6170213 [9,] 446.6170213 295.6170213 [10,] -173.3829787 446.6170213 [11,] -0.3829787 -173.3829787 [12,] -281.3829787 -0.3829787 [13,] -180.3829787 -281.3829787 [14,] 43.6170213 -180.3829787 [15,] -213.3829787 43.6170213 [16,] -415.3829787 -213.3829787 [17,] 139.6170213 -415.3829787 [18,] -422.3829787 139.6170213 [19,] -338.3829787 -422.3829787 [20,] -634.3829787 -338.3829787 [21,] -465.3829787 -634.3829787 [22,] -417.3829787 -465.3829787 [23,] -552.3829787 -417.3829787 [24,] -558.3829787 -552.3829787 [25,] -106.3829787 -558.3829787 [26,] -155.3829787 -106.3829787 [27,] 356.6170213 -155.3829787 [28,] -99.3829787 356.6170213 [29,] 491.6170213 -99.3829787 [30,] 204.6170213 491.6170213 [31,] 440.6170213 204.6170213 [32,] 616.6170213 440.6170213 [33,] -145.3829787 616.6170213 [34,] -672.3829787 -145.3829787 [35,] -42.3829787 -672.3829787 [36,] -672.3829787 -42.3829787 [37,] 184.6170213 -672.3829787 [38,] -510.3829787 184.6170213 [39,] -82.3829787 -510.3829787 [40,] -354.3829787 -82.3829787 [41,] 412.6170213 -354.3829787 [42,] 149.6170213 412.6170213 [43,] 34.6170213 149.6170213 [44,] 524.6170213 34.6170213 [45,] 105.6170213 524.6170213 [46,] -263.3829787 105.6170213 [47,] 2731.0769231 -263.3829787 [48,] -877.9230769 2731.0769231 [49,] -740.9230769 -877.9230769 [50,] -137.9230769 -740.9230769 [51,] -327.9230769 -137.9230769 [52,] -171.9230769 -327.9230769 [53,] 299.0769231 -171.9230769 [54,] 70.0769231 299.0769231 [55,] 187.0769231 70.0769231 [56,] -48.9230769 187.0769231 [57,] -352.9230769 -48.9230769 [58,] -566.9230769 -352.9230769 [59,] -61.9230769 -566.9230769 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 532.6170213 -243.3829787 2 741.6170213 532.6170213 3 393.6170213 741.6170213 4 221.6170213 393.6170213 5 1136.6170213 221.6170213 6 118.6170213 1136.6170213 7 408.6170213 118.6170213 8 295.6170213 408.6170213 9 446.6170213 295.6170213 10 -173.3829787 446.6170213 11 -0.3829787 -173.3829787 12 -281.3829787 -0.3829787 13 -180.3829787 -281.3829787 14 43.6170213 -180.3829787 15 -213.3829787 43.6170213 16 -415.3829787 -213.3829787 17 139.6170213 -415.3829787 18 -422.3829787 139.6170213 19 -338.3829787 -422.3829787 20 -634.3829787 -338.3829787 21 -465.3829787 -634.3829787 22 -417.3829787 -465.3829787 23 -552.3829787 -417.3829787 24 -558.3829787 -552.3829787 25 -106.3829787 -558.3829787 26 -155.3829787 -106.3829787 27 356.6170213 -155.3829787 28 -99.3829787 356.6170213 29 491.6170213 -99.3829787 30 204.6170213 491.6170213 31 440.6170213 204.6170213 32 616.6170213 440.6170213 33 -145.3829787 616.6170213 34 -672.3829787 -145.3829787 35 -42.3829787 -672.3829787 36 -672.3829787 -42.3829787 37 184.6170213 -672.3829787 38 -510.3829787 184.6170213 39 -82.3829787 -510.3829787 40 -354.3829787 -82.3829787 41 412.6170213 -354.3829787 42 149.6170213 412.6170213 43 34.6170213 149.6170213 44 524.6170213 34.6170213 45 105.6170213 524.6170213 46 -263.3829787 105.6170213 47 2731.0769231 -263.3829787 48 -877.9230769 2731.0769231 49 -740.9230769 -877.9230769 50 -137.9230769 -740.9230769 51 -327.9230769 -137.9230769 52 -171.9230769 -327.9230769 53 299.0769231 -171.9230769 54 70.0769231 299.0769231 55 187.0769231 70.0769231 56 -48.9230769 187.0769231 57 -352.9230769 -48.9230769 58 -566.9230769 -352.9230769 59 -61.9230769 -566.9230769 > 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/7fime1229781053.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/8vrht1229781053.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/94v5l1229781053.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/10m1dn1229781053.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/11hkgn1229781053.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/12lj431229781053.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/13x4l21229781054.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/1472bv1229781054.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/15xfyg1229781054.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/16243m1229781054.tab") + } > > system("convert tmp/1gveb1229781053.ps tmp/1gveb1229781053.png") > system("convert tmp/296p31229781053.ps tmp/296p31229781053.png") > system("convert tmp/3w56y1229781053.ps tmp/3w56y1229781053.png") > system("convert tmp/41cmn1229781053.ps tmp/41cmn1229781053.png") > system("convert tmp/5fto11229781053.ps tmp/5fto11229781053.png") > system("convert tmp/6kzrc1229781053.ps tmp/6kzrc1229781053.png") > system("convert tmp/7fime1229781053.ps tmp/7fime1229781053.png") > system("convert tmp/8vrht1229781053.ps tmp/8vrht1229781053.png") > system("convert tmp/94v5l1229781053.ps tmp/94v5l1229781053.png") > system("convert tmp/10m1dn1229781053.ps tmp/10m1dn1229781053.png") > > > proc.time() user system elapsed 2.499 1.585 3.650