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(286602,0,283042,0,276687,0,277915,0,277128,0,277103,0,275037,0,270150,0,267140,0,264993,0,287259,0,291186,0,292300,0,288186,0,281477,0,282656,0,280190,0,280408,0,276836,0,275216,0,274352,0,271311,0,289802,0,290726,0,292300,0,278506,0,269826,0,265861,0,269034,0,264176,0,255198,0,253353,0,246057,0,235372,0,258556,0,260993,0,254663,0,250643,0,243422,0,247105,0,248541,0,245039,0,237080,0,237085,0,225554,0,226839,1,247934,1,248333,1,246969,1,245098,1,246263,1,255765,1,264319,1,268347,1,273046,1,273963,1,267430,1,271993,1,292710,1,295881,1),dim=c(2,60),dimnames=list(c('nwwmb','dummy_variable'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('nwwmb','dummy_variable'),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 nwwmb dummy_variable 1 286602 0 2 283042 0 3 276687 0 4 277915 0 5 277128 0 6 277103 0 7 275037 0 8 270150 0 9 267140 0 10 264993 0 11 287259 0 12 291186 0 13 292300 0 14 288186 0 15 281477 0 16 282656 0 17 280190 0 18 280408 0 19 276836 0 20 275216 0 21 274352 0 22 271311 0 23 289802 0 24 290726 0 25 292300 0 26 278506 0 27 269826 0 28 265861 0 29 269034 0 30 264176 0 31 255198 0 32 253353 0 33 246057 0 34 235372 0 35 258556 0 36 260993 0 37 254663 0 38 250643 0 39 243422 0 40 247105 0 41 248541 0 42 245039 0 43 237080 0 44 237085 0 45 225554 0 46 226839 1 47 247934 1 48 248333 1 49 246969 1 50 245098 1 51 246263 1 52 255765 1 53 264319 1 54 268347 1 55 273046 1 56 273963 1 57 267430 1 58 271993 1 59 292710 1 60 295881 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) dummy_variable 267913 -6253 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -42359 -13934 3029 12284 34222 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 267913 2672 100.28 <2e-16 *** dummy_variable -6253 5343 -1.17 0.247 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 17920 on 58 degrees of freedom Multiple R-squared: 0.02307, Adjusted R-squared: 0.006225 F-statistic: 1.37 on 1 and 58 DF, p-value: 0.2467 > 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,] 2.728951e-02 5.457903e-02 0.9727105 [2,] 7.408117e-03 1.481623e-02 0.9925919 [3,] 2.537023e-03 5.074046e-03 0.9974630 [4,] 2.314437e-03 4.628873e-03 0.9976856 [5,] 2.657268e-03 5.314537e-03 0.9973427 [6,] 2.959502e-03 5.919004e-03 0.9970405 [7,] 3.130453e-03 6.260906e-03 0.9968695 [8,] 5.009179e-03 1.001836e-02 0.9949908 [9,] 7.176212e-03 1.435242e-02 0.9928238 [10,] 5.664211e-03 1.132842e-02 0.9943358 [11,] 2.930321e-03 5.860643e-03 0.9970697 [12,] 1.575665e-03 3.151329e-03 0.9984243 [13,] 7.830873e-04 1.566175e-03 0.9992169 [14,] 3.914015e-04 7.828029e-04 0.9996086 [15,] 1.953145e-04 3.906290e-04 0.9998047 [16,] 1.023789e-04 2.047577e-04 0.9998976 [17,] 5.568540e-05 1.113708e-04 0.9999443 [18,] 3.733137e-05 7.466274e-05 0.9999627 [19,] 6.696547e-05 1.339309e-04 0.9999330 [20,] 1.581683e-04 3.163366e-04 0.9998418 [21,] 6.018688e-04 1.203738e-03 0.9993981 [22,] 5.953514e-04 1.190703e-03 0.9994046 [23,] 7.425658e-04 1.485132e-03 0.9992574 [24,] 1.215656e-03 2.431313e-03 0.9987843 [25,] 1.604137e-03 3.208274e-03 0.9983959 [26,] 2.751997e-03 5.503995e-03 0.9972480 [27,] 8.522470e-03 1.704494e-02 0.9914775 [28,] 2.011969e-02 4.023938e-02 0.9798803 [29,] 5.618469e-02 1.123694e-01 0.9438153 [30,] 1.901133e-01 3.802267e-01 0.8098867 [31,] 1.889390e-01 3.778780e-01 0.8110610 [32,] 1.918364e-01 3.836728e-01 0.8081636 [33,] 1.982246e-01 3.964492e-01 0.8017754 [34,] 2.092776e-01 4.185551e-01 0.7907224 [35,] 2.376764e-01 4.753529e-01 0.7623236 [36,] 2.424010e-01 4.848020e-01 0.7575990 [37,] 2.427432e-01 4.854863e-01 0.7572568 [38,] 2.476897e-01 4.953793e-01 0.7523103 [39,] 2.654179e-01 5.308358e-01 0.7345821 [40,] 2.761077e-01 5.522155e-01 0.7238923 [41,] 3.145047e-01 6.290094e-01 0.6854953 [42,] 4.837178e-01 9.674355e-01 0.5162822 [43,] 4.692650e-01 9.385300e-01 0.5307350 [44,] 4.546767e-01 9.093533e-01 0.5453233 [45,] 4.709182e-01 9.418365e-01 0.5290818 [46,] 5.547706e-01 8.904588e-01 0.4452294 [47,] 6.994233e-01 6.011534e-01 0.3005767 [48,] 7.504145e-01 4.991711e-01 0.2495855 [49,] 7.180675e-01 5.638650e-01 0.2819325 [50,] 6.450791e-01 7.098417e-01 0.3549209 [51,] 5.136394e-01 9.727213e-01 0.4863606 > postscript(file="/var/www/html/rcomp/tmp/12ark1258740167.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/2uliy1258740167.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/326351258740167.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/4fzbm1258740167.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/5v38q1258740167.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 18689.4222 15129.4222 8774.4222 10002.4222 9215.4222 9190.4222 7 8 9 10 11 12 7124.4222 2237.4222 -772.5778 -2919.5778 19346.4222 23273.4222 13 14 15 16 17 18 24387.4222 20273.4222 13564.4222 14743.4222 12277.4222 12495.4222 19 20 21 22 23 24 8923.4222 7303.4222 6439.4222 3398.4222 21889.4222 22813.4222 25 26 27 28 29 30 24387.4222 10593.4222 1913.4222 -2051.5778 1121.4222 -3736.5778 31 32 33 34 35 36 -12714.5778 -14559.5778 -21855.5778 -32540.5778 -9356.5778 -6919.5778 37 38 39 40 41 42 -13249.5778 -17269.5778 -24490.5778 -20807.5778 -19371.5778 -22873.5778 43 44 45 46 47 48 -30832.5778 -30827.5778 -42358.5778 -34820.3333 -13725.3333 -13326.3333 49 50 51 52 53 54 -14690.3333 -16561.3333 -15396.3333 -5894.3333 2659.6667 6687.6667 55 56 57 58 59 60 11386.6667 12303.6667 5770.6667 10333.6667 31050.6667 34221.6667 > postscript(file="/var/www/html/rcomp/tmp/69unh1258740167.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 18689.4222 NA 1 15129.4222 18689.4222 2 8774.4222 15129.4222 3 10002.4222 8774.4222 4 9215.4222 10002.4222 5 9190.4222 9215.4222 6 7124.4222 9190.4222 7 2237.4222 7124.4222 8 -772.5778 2237.4222 9 -2919.5778 -772.5778 10 19346.4222 -2919.5778 11 23273.4222 19346.4222 12 24387.4222 23273.4222 13 20273.4222 24387.4222 14 13564.4222 20273.4222 15 14743.4222 13564.4222 16 12277.4222 14743.4222 17 12495.4222 12277.4222 18 8923.4222 12495.4222 19 7303.4222 8923.4222 20 6439.4222 7303.4222 21 3398.4222 6439.4222 22 21889.4222 3398.4222 23 22813.4222 21889.4222 24 24387.4222 22813.4222 25 10593.4222 24387.4222 26 1913.4222 10593.4222 27 -2051.5778 1913.4222 28 1121.4222 -2051.5778 29 -3736.5778 1121.4222 30 -12714.5778 -3736.5778 31 -14559.5778 -12714.5778 32 -21855.5778 -14559.5778 33 -32540.5778 -21855.5778 34 -9356.5778 -32540.5778 35 -6919.5778 -9356.5778 36 -13249.5778 -6919.5778 37 -17269.5778 -13249.5778 38 -24490.5778 -17269.5778 39 -20807.5778 -24490.5778 40 -19371.5778 -20807.5778 41 -22873.5778 -19371.5778 42 -30832.5778 -22873.5778 43 -30827.5778 -30832.5778 44 -42358.5778 -30827.5778 45 -34820.3333 -42358.5778 46 -13725.3333 -34820.3333 47 -13326.3333 -13725.3333 48 -14690.3333 -13326.3333 49 -16561.3333 -14690.3333 50 -15396.3333 -16561.3333 51 -5894.3333 -15396.3333 52 2659.6667 -5894.3333 53 6687.6667 2659.6667 54 11386.6667 6687.6667 55 12303.6667 11386.6667 56 5770.6667 12303.6667 57 10333.6667 5770.6667 58 31050.6667 10333.6667 59 34221.6667 31050.6667 60 NA 34221.6667 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 15129.4222 18689.4222 [2,] 8774.4222 15129.4222 [3,] 10002.4222 8774.4222 [4,] 9215.4222 10002.4222 [5,] 9190.4222 9215.4222 [6,] 7124.4222 9190.4222 [7,] 2237.4222 7124.4222 [8,] -772.5778 2237.4222 [9,] -2919.5778 -772.5778 [10,] 19346.4222 -2919.5778 [11,] 23273.4222 19346.4222 [12,] 24387.4222 23273.4222 [13,] 20273.4222 24387.4222 [14,] 13564.4222 20273.4222 [15,] 14743.4222 13564.4222 [16,] 12277.4222 14743.4222 [17,] 12495.4222 12277.4222 [18,] 8923.4222 12495.4222 [19,] 7303.4222 8923.4222 [20,] 6439.4222 7303.4222 [21,] 3398.4222 6439.4222 [22,] 21889.4222 3398.4222 [23,] 22813.4222 21889.4222 [24,] 24387.4222 22813.4222 [25,] 10593.4222 24387.4222 [26,] 1913.4222 10593.4222 [27,] -2051.5778 1913.4222 [28,] 1121.4222 -2051.5778 [29,] -3736.5778 1121.4222 [30,] -12714.5778 -3736.5778 [31,] -14559.5778 -12714.5778 [32,] -21855.5778 -14559.5778 [33,] -32540.5778 -21855.5778 [34,] -9356.5778 -32540.5778 [35,] -6919.5778 -9356.5778 [36,] -13249.5778 -6919.5778 [37,] -17269.5778 -13249.5778 [38,] -24490.5778 -17269.5778 [39,] -20807.5778 -24490.5778 [40,] -19371.5778 -20807.5778 [41,] -22873.5778 -19371.5778 [42,] -30832.5778 -22873.5778 [43,] -30827.5778 -30832.5778 [44,] -42358.5778 -30827.5778 [45,] -34820.3333 -42358.5778 [46,] -13725.3333 -34820.3333 [47,] -13326.3333 -13725.3333 [48,] -14690.3333 -13326.3333 [49,] -16561.3333 -14690.3333 [50,] -15396.3333 -16561.3333 [51,] -5894.3333 -15396.3333 [52,] 2659.6667 -5894.3333 [53,] 6687.6667 2659.6667 [54,] 11386.6667 6687.6667 [55,] 12303.6667 11386.6667 [56,] 5770.6667 12303.6667 [57,] 10333.6667 5770.6667 [58,] 31050.6667 10333.6667 [59,] 34221.6667 31050.6667 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 15129.4222 18689.4222 2 8774.4222 15129.4222 3 10002.4222 8774.4222 4 9215.4222 10002.4222 5 9190.4222 9215.4222 6 7124.4222 9190.4222 7 2237.4222 7124.4222 8 -772.5778 2237.4222 9 -2919.5778 -772.5778 10 19346.4222 -2919.5778 11 23273.4222 19346.4222 12 24387.4222 23273.4222 13 20273.4222 24387.4222 14 13564.4222 20273.4222 15 14743.4222 13564.4222 16 12277.4222 14743.4222 17 12495.4222 12277.4222 18 8923.4222 12495.4222 19 7303.4222 8923.4222 20 6439.4222 7303.4222 21 3398.4222 6439.4222 22 21889.4222 3398.4222 23 22813.4222 21889.4222 24 24387.4222 22813.4222 25 10593.4222 24387.4222 26 1913.4222 10593.4222 27 -2051.5778 1913.4222 28 1121.4222 -2051.5778 29 -3736.5778 1121.4222 30 -12714.5778 -3736.5778 31 -14559.5778 -12714.5778 32 -21855.5778 -14559.5778 33 -32540.5778 -21855.5778 34 -9356.5778 -32540.5778 35 -6919.5778 -9356.5778 36 -13249.5778 -6919.5778 37 -17269.5778 -13249.5778 38 -24490.5778 -17269.5778 39 -20807.5778 -24490.5778 40 -19371.5778 -20807.5778 41 -22873.5778 -19371.5778 42 -30832.5778 -22873.5778 43 -30827.5778 -30832.5778 44 -42358.5778 -30827.5778 45 -34820.3333 -42358.5778 46 -13725.3333 -34820.3333 47 -13326.3333 -13725.3333 48 -14690.3333 -13326.3333 49 -16561.3333 -14690.3333 50 -15396.3333 -16561.3333 51 -5894.3333 -15396.3333 52 2659.6667 -5894.3333 53 6687.6667 2659.6667 54 11386.6667 6687.6667 55 12303.6667 11386.6667 56 5770.6667 12303.6667 57 10333.6667 5770.6667 58 31050.6667 10333.6667 59 34221.6667 31050.6667 > 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/7l5id1258740167.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/8pswr1258740167.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/993x21258740167.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/10j5ol1258740167.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/11r9ki1258740167.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/12bzhj1258740167.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/13gbma1258740167.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/142pmq1258740167.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/154efv1258740167.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/16i6ah1258740167.tab") + } > > system("convert tmp/12ark1258740167.ps tmp/12ark1258740167.png") > system("convert tmp/2uliy1258740167.ps tmp/2uliy1258740167.png") > system("convert tmp/326351258740167.ps tmp/326351258740167.png") > system("convert tmp/4fzbm1258740167.ps tmp/4fzbm1258740167.png") > system("convert tmp/5v38q1258740167.ps tmp/5v38q1258740167.png") > system("convert tmp/69unh1258740167.ps tmp/69unh1258740167.png") > system("convert tmp/7l5id1258740167.ps tmp/7l5id1258740167.png") > system("convert tmp/8pswr1258740167.ps tmp/8pswr1258740167.png") > system("convert tmp/993x21258740167.ps tmp/993x21258740167.png") > system("convert tmp/10j5ol1258740167.ps tmp/10j5ol1258740167.png") > > > proc.time() user system elapsed 2.440 1.551 2.849