R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(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,0,3032.6,0,3047.03,0,2962.34,1,2197.82,1,2014.45,1,1862.83,1,1905.41,1,1810.99,1,1670.07,1,1864.44,1,2052.02,1,2029.6,1,2070.83,1,2293.41,1,2443.27,1,2513.17,1,2466.92,1,2502.66,1,2539.91,1,2482.6,1,2626.15,1,2656.32,1,2446.66,1,2467.38,1,2462.32,1,2504.58,1,2579.39,1,2649.24,1,2636.87,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 > 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 3494.17 0 2 3667.03 0 3 3813.06 0 4 3917.96 0 5 3895.51 0 6 3801.06 0 7 3570.12 0 8 3701.61 0 9 3862.27 0 10 3970.10 0 11 4138.52 0 12 4199.75 0 13 4290.89 0 14 4443.91 0 15 4502.64 0 16 4356.98 0 17 4591.27 0 18 4696.96 0 19 4621.40 0 20 4562.84 0 21 4202.52 0 22 4296.49 0 23 4435.23 0 24 4105.18 0 25 4116.68 0 26 3844.49 0 27 3720.98 0 28 3674.40 0 29 3857.62 0 30 3801.06 0 31 3504.37 0 32 3032.60 0 33 3047.03 0 34 2962.34 1 35 2197.82 1 36 2014.45 1 37 1862.83 1 38 1905.41 1 39 1810.99 1 40 1670.07 1 41 1864.44 1 42 2052.02 1 43 2029.60 1 44 2070.83 1 45 2293.41 1 46 2443.27 1 47 2513.17 1 48 2466.92 1 49 2502.66 1 50 2539.91 1 51 2482.60 1 52 2626.15 1 53 2656.32 1 54 2446.66 1 55 2467.38 1 56 2462.32 1 57 2504.58 1 58 2579.39 1 59 2649.24 1 60 2636.87 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 3992 -1669 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -959.4 -275.9 116.9 267.3 704.9 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3992.02 66.55 59.98 <2e-16 *** X -1669.37 99.21 -16.83 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 382.3 on 58 degrees of freedom Multiple R-squared: 0.83, Adjusted R-squared: 0.8271 F-statistic: 283.1 on 1 and 58 DF, p-value: < 2.2e-16 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 0.157540946 3.150819e-01 8.424591e-01 [2,] 0.066645454 1.332909e-01 9.333545e-01 [3,] 0.043305276 8.661055e-02 9.566947e-01 [4,] 0.017849064 3.569813e-02 9.821509e-01 [5,] 0.008648991 1.729798e-02 9.913510e-01 [6,] 0.006747343 1.349469e-02 9.932527e-01 [7,] 0.013142257 2.628451e-02 9.868577e-01 [8,] 0.022010133 4.402027e-02 9.779899e-01 [9,] 0.039432318 7.886464e-02 9.605677e-01 [10,] 0.091626512 1.832530e-01 9.083735e-01 [11,] 0.166641531 3.332831e-01 8.333585e-01 [12,] 0.173066273 3.461325e-01 8.269337e-01 [13,] 0.278165953 5.563319e-01 7.218340e-01 [14,] 0.456468869 9.129377e-01 5.435311e-01 [15,] 0.579194065 8.416119e-01 4.208059e-01 [16,] 0.668411832 6.631763e-01 3.315882e-01 [17,] 0.626009514 7.479810e-01 3.739905e-01 [18,] 0.618583596 7.628328e-01 3.814164e-01 [19,] 0.692539776 6.149204e-01 3.074602e-01 [20,] 0.671596217 6.568076e-01 3.284038e-01 [21,] 0.670683184 6.586336e-01 3.293168e-01 [22,] 0.649861596 7.002768e-01 3.501384e-01 [23,] 0.639455770 7.210885e-01 3.605442e-01 [24,] 0.633418439 7.331631e-01 3.665816e-01 [25,] 0.639049247 7.219015e-01 3.609508e-01 [26,] 0.676924181 6.461516e-01 3.230758e-01 [27,] 0.733666799 5.326664e-01 2.663332e-01 [28,] 0.851560793 2.968784e-01 1.484392e-01 [29,] 0.902486204 1.950276e-01 9.751380e-02 [30,] 0.935157440 1.296851e-01 6.484256e-02 [31,] 0.926490046 1.470199e-01 7.350995e-02 [32,] 0.923011790 1.539764e-01 7.698821e-02 [33,] 0.938022635 1.239547e-01 6.197737e-02 [34,] 0.945040532 1.099189e-01 5.495947e-02 [35,] 0.967246084 6.550783e-02 3.275392e-02 [36,] 0.994964302 1.007140e-02 5.035698e-03 [37,] 0.999006681 1.986639e-03 9.933193e-04 [38,] 0.999572242 8.555165e-04 4.277582e-04 [39,] 0.999946349 1.073011e-04 5.365053e-05 [40,] 0.999999288 1.424570e-06 7.122851e-07 [41,] 0.999999859 2.814404e-07 1.407202e-07 [42,] 0.999999646 7.072613e-07 3.536307e-07 [43,] 0.999998450 3.099907e-06 1.549953e-06 [44,] 0.999995088 9.824775e-06 4.912388e-06 [45,] 0.999980041 3.991706e-05 1.995853e-05 [46,] 0.999911273 1.774548e-04 8.872742e-05 [47,] 0.999703916 5.921689e-04 2.960845e-04 [48,] 0.999039483 1.921034e-03 9.605171e-04 [49,] 0.997871045 4.257910e-03 2.128955e-03 [50,] 0.993924601 1.215080e-02 6.075399e-03 [51,] 0.981360921 3.727816e-02 1.863908e-02 > postscript(file="/var/www/rcomp/tmp/1xi7y1292765146.ps",horizontal=F,onefile=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/rcomp/tmp/27a6j1292765146.ps",horizontal=F,onefile=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/rcomp/tmp/37a6j1292765146.ps",horizontal=F,onefile=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/rcomp/tmp/47a6j1292765146.ps",horizontal=F,onefile=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/rcomp/tmp/50j541292765146.ps",horizontal=F,onefile=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 7 -497.85121 -324.99121 -178.96121 -74.06121 -96.51121 -190.96121 -421.90121 8 9 10 11 12 13 14 -290.41121 -129.75121 -21.92121 146.49879 207.72879 298.86879 451.88879 15 16 17 18 19 20 21 510.61879 364.95879 599.24879 704.93879 629.37879 570.81879 210.49879 22 23 24 25 26 27 28 304.46879 443.20879 113.15879 124.65879 -147.53121 -271.04121 -317.62121 29 30 31 32 33 34 35 -134.40121 -190.96121 -487.65121 -959.42121 -944.99121 639.68630 -124.83370 36 37 38 39 40 41 42 -308.20370 -459.82370 -417.24370 -511.66370 -652.58370 -458.21370 -270.63370 43 44 45 46 47 48 49 -293.05370 -251.82370 -29.24370 120.61630 190.51630 144.26630 180.00630 50 51 52 53 54 55 56 217.25630 159.94630 303.49630 333.66630 124.00630 144.72630 139.66630 57 58 59 60 181.92630 256.73630 326.58630 314.21630 > postscript(file="/var/www/rcomp/tmp/60j541292765146.ps",horizontal=F,onefile=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 -497.85121 NA 1 -324.99121 -497.85121 2 -178.96121 -324.99121 3 -74.06121 -178.96121 4 -96.51121 -74.06121 5 -190.96121 -96.51121 6 -421.90121 -190.96121 7 -290.41121 -421.90121 8 -129.75121 -290.41121 9 -21.92121 -129.75121 10 146.49879 -21.92121 11 207.72879 146.49879 12 298.86879 207.72879 13 451.88879 298.86879 14 510.61879 451.88879 15 364.95879 510.61879 16 599.24879 364.95879 17 704.93879 599.24879 18 629.37879 704.93879 19 570.81879 629.37879 20 210.49879 570.81879 21 304.46879 210.49879 22 443.20879 304.46879 23 113.15879 443.20879 24 124.65879 113.15879 25 -147.53121 124.65879 26 -271.04121 -147.53121 27 -317.62121 -271.04121 28 -134.40121 -317.62121 29 -190.96121 -134.40121 30 -487.65121 -190.96121 31 -959.42121 -487.65121 32 -944.99121 -959.42121 33 639.68630 -944.99121 34 -124.83370 639.68630 35 -308.20370 -124.83370 36 -459.82370 -308.20370 37 -417.24370 -459.82370 38 -511.66370 -417.24370 39 -652.58370 -511.66370 40 -458.21370 -652.58370 41 -270.63370 -458.21370 42 -293.05370 -270.63370 43 -251.82370 -293.05370 44 -29.24370 -251.82370 45 120.61630 -29.24370 46 190.51630 120.61630 47 144.26630 190.51630 48 180.00630 144.26630 49 217.25630 180.00630 50 159.94630 217.25630 51 303.49630 159.94630 52 333.66630 303.49630 53 124.00630 333.66630 54 144.72630 124.00630 55 139.66630 144.72630 56 181.92630 139.66630 57 256.73630 181.92630 58 326.58630 256.73630 59 314.21630 326.58630 60 NA 314.21630 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -324.99121 -497.85121 [2,] -178.96121 -324.99121 [3,] -74.06121 -178.96121 [4,] -96.51121 -74.06121 [5,] -190.96121 -96.51121 [6,] -421.90121 -190.96121 [7,] -290.41121 -421.90121 [8,] -129.75121 -290.41121 [9,] -21.92121 -129.75121 [10,] 146.49879 -21.92121 [11,] 207.72879 146.49879 [12,] 298.86879 207.72879 [13,] 451.88879 298.86879 [14,] 510.61879 451.88879 [15,] 364.95879 510.61879 [16,] 599.24879 364.95879 [17,] 704.93879 599.24879 [18,] 629.37879 704.93879 [19,] 570.81879 629.37879 [20,] 210.49879 570.81879 [21,] 304.46879 210.49879 [22,] 443.20879 304.46879 [23,] 113.15879 443.20879 [24,] 124.65879 113.15879 [25,] -147.53121 124.65879 [26,] -271.04121 -147.53121 [27,] -317.62121 -271.04121 [28,] -134.40121 -317.62121 [29,] -190.96121 -134.40121 [30,] -487.65121 -190.96121 [31,] -959.42121 -487.65121 [32,] -944.99121 -959.42121 [33,] 639.68630 -944.99121 [34,] -124.83370 639.68630 [35,] -308.20370 -124.83370 [36,] -459.82370 -308.20370 [37,] -417.24370 -459.82370 [38,] -511.66370 -417.24370 [39,] -652.58370 -511.66370 [40,] -458.21370 -652.58370 [41,] -270.63370 -458.21370 [42,] -293.05370 -270.63370 [43,] -251.82370 -293.05370 [44,] -29.24370 -251.82370 [45,] 120.61630 -29.24370 [46,] 190.51630 120.61630 [47,] 144.26630 190.51630 [48,] 180.00630 144.26630 [49,] 217.25630 180.00630 [50,] 159.94630 217.25630 [51,] 303.49630 159.94630 [52,] 333.66630 303.49630 [53,] 124.00630 333.66630 [54,] 144.72630 124.00630 [55,] 139.66630 144.72630 [56,] 181.92630 139.66630 [57,] 256.73630 181.92630 [58,] 326.58630 256.73630 [59,] 314.21630 326.58630 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -324.99121 -497.85121 2 -178.96121 -324.99121 3 -74.06121 -178.96121 4 -96.51121 -74.06121 5 -190.96121 -96.51121 6 -421.90121 -190.96121 7 -290.41121 -421.90121 8 -129.75121 -290.41121 9 -21.92121 -129.75121 10 146.49879 -21.92121 11 207.72879 146.49879 12 298.86879 207.72879 13 451.88879 298.86879 14 510.61879 451.88879 15 364.95879 510.61879 16 599.24879 364.95879 17 704.93879 599.24879 18 629.37879 704.93879 19 570.81879 629.37879 20 210.49879 570.81879 21 304.46879 210.49879 22 443.20879 304.46879 23 113.15879 443.20879 24 124.65879 113.15879 25 -147.53121 124.65879 26 -271.04121 -147.53121 27 -317.62121 -271.04121 28 -134.40121 -317.62121 29 -190.96121 -134.40121 30 -487.65121 -190.96121 31 -959.42121 -487.65121 32 -944.99121 -959.42121 33 639.68630 -944.99121 34 -124.83370 639.68630 35 -308.20370 -124.83370 36 -459.82370 -308.20370 37 -417.24370 -459.82370 38 -511.66370 -417.24370 39 -652.58370 -511.66370 40 -458.21370 -652.58370 41 -270.63370 -458.21370 42 -293.05370 -270.63370 43 -251.82370 -293.05370 44 -29.24370 -251.82370 45 120.61630 -29.24370 46 190.51630 120.61630 47 144.26630 190.51630 48 180.00630 144.26630 49 217.25630 180.00630 50 159.94630 217.25630 51 303.49630 159.94630 52 333.66630 303.49630 53 124.00630 333.66630 54 144.72630 124.00630 55 139.66630 144.72630 56 181.92630 139.66630 57 256.73630 181.92630 58 326.58630 256.73630 59 314.21630 326.58630 > 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/rcomp/tmp/7bsn71292765146.ps",horizontal=F,onefile=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/rcomp/tmp/8bsn71292765146.ps",horizontal=F,onefile=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/rcomp/tmp/9l2ma1292765146.ps",horizontal=F,onefile=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/rcomp/tmp/10l2ma1292765146.ps",horizontal=F,onefile=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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/11723g1292765146.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/rcomp/tmp/12al141292765146.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/rcomp/tmp/13z4yf1292765146.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/rcomp/tmp/149df01292765146.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/rcomp/tmp/15vvwo1292765146.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/rcomp/tmp/16yecc1292765146.tab") + } > > try(system("convert tmp/1xi7y1292765146.ps tmp/1xi7y1292765146.png",intern=TRUE)) character(0) > try(system("convert tmp/27a6j1292765146.ps tmp/27a6j1292765146.png",intern=TRUE)) character(0) > try(system("convert tmp/37a6j1292765146.ps tmp/37a6j1292765146.png",intern=TRUE)) character(0) > try(system("convert tmp/47a6j1292765146.ps tmp/47a6j1292765146.png",intern=TRUE)) character(0) > try(system("convert tmp/50j541292765146.ps tmp/50j541292765146.png",intern=TRUE)) character(0) > try(system("convert tmp/60j541292765146.ps tmp/60j541292765146.png",intern=TRUE)) character(0) > try(system("convert tmp/7bsn71292765146.ps tmp/7bsn71292765146.png",intern=TRUE)) character(0) > try(system("convert tmp/8bsn71292765146.ps tmp/8bsn71292765146.png",intern=TRUE)) character(0) > try(system("convert tmp/9l2ma1292765146.ps tmp/9l2ma1292765146.png",intern=TRUE)) character(0) > try(system("convert tmp/10l2ma1292765146.ps tmp/10l2ma1292765146.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.180 1.670 4.828