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,1,237080,1,237085,1,225554,1,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('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 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 1 43 237080 1 44 237085 1 45 225554 1 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) X 271008 -14710 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -35636 -11214 1824 11745 39584 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 271008 2615 103.640 < 2e-16 *** X -14710 4647 -3.166 0.00247 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 16740 on 58 degrees of freedom Multiple R-squared: 0.1473, Adjusted R-squared: 0.1326 F-statistic: 10.02 on 1 and 58 DF, p-value: 0.002466 > 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.237215e-02 6.474429e-02 0.9676279 [2,] 9.255015e-03 1.851003e-02 0.9907450 [3,] 3.327274e-03 6.654549e-03 0.9966727 [4,] 3.170822e-03 6.341644e-03 0.9968292 [5,] 3.794698e-03 7.589395e-03 0.9962053 [6,] 4.407133e-03 8.814266e-03 0.9955929 [7,] 4.711717e-03 9.423435e-03 0.9952883 [8,] 7.460744e-03 1.492149e-02 0.9925393 [9,] 1.046773e-02 2.093545e-02 0.9895323 [10,] 8.158824e-03 1.631765e-02 0.9918412 [11,] 4.207004e-03 8.414008e-03 0.9957930 [12,] 2.222220e-03 4.444439e-03 0.9977778 [13,] 1.078601e-03 2.157201e-03 0.9989214 [14,] 5.188971e-04 1.037794e-03 0.9994811 [15,] 2.485583e-04 4.971167e-04 0.9997514 [16,] 1.241109e-04 2.482217e-04 0.9998759 [17,] 6.365295e-05 1.273059e-04 0.9999363 [18,] 4.029626e-05 8.059251e-05 0.9999597 [19,] 5.993998e-05 1.198800e-04 0.9999401 [20,] 1.111807e-04 2.223615e-04 0.9998888 [21,] 3.081689e-04 6.163378e-04 0.9996918 [22,] 2.327752e-04 4.655504e-04 0.9997672 [23,] 2.390957e-04 4.781914e-04 0.9997609 [24,] 3.377043e-04 6.754087e-04 0.9996623 [25,] 3.514002e-04 7.028004e-04 0.9996486 [26,] 5.141430e-04 1.028286e-03 0.9994859 [27,] 1.688874e-03 3.377748e-03 0.9983111 [28,] 4.293686e-03 8.587371e-03 0.9957063 [29,] 1.497575e-02 2.995150e-02 0.9850242 [30,] 7.641567e-02 1.528313e-01 0.9235843 [31,] 6.820435e-02 1.364087e-01 0.9317957 [32,] 5.894586e-02 1.178917e-01 0.9410541 [33,] 5.559887e-02 1.111977e-01 0.9444011 [34,] 5.613315e-02 1.122663e-01 0.9438668 [35,] 6.857615e-02 1.371523e-01 0.9314239 [36,] 6.772523e-02 1.354505e-01 0.9322748 [37,] 6.134062e-02 1.226812e-01 0.9386594 [38,] 4.462835e-02 8.925669e-02 0.9553717 [39,] 4.070066e-02 8.140131e-02 0.9592993 [40,] 3.870434e-02 7.740868e-02 0.9612957 [41,] 8.090463e-02 1.618093e-01 0.9190954 [42,] 1.872544e-01 3.745088e-01 0.8127456 [43,] 1.839875e-01 3.679751e-01 0.8160125 [44,] 1.849633e-01 3.699267e-01 0.8150367 [45,] 2.088667e-01 4.177334e-01 0.7911333 [46,] 2.944413e-01 5.888827e-01 0.7055587 [47,] 4.709546e-01 9.419092e-01 0.5290454 [48,] 5.638973e-01 8.722055e-01 0.4361027 [49,] 5.541080e-01 8.917840e-01 0.4458920 [50,] 4.999659e-01 9.999317e-01 0.5000341 [51,] 3.918607e-01 7.837214e-01 0.6081393 > postscript(file="/var/www/html/rcomp/tmp/1kx001259332650.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/28z961259332650.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/30sfh1259332650.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/4o1uk1259332650.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/52zuo1259332650.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 15594.4878 12034.4878 5679.4878 6907.4878 6120.4878 6095.4878 7 8 9 10 11 12 4029.4878 -857.5122 -3867.5122 -6014.5122 16251.4878 20178.4878 13 14 15 16 17 18 21292.4878 17178.4878 10469.4878 11648.4878 9182.4878 9400.4878 19 20 21 22 23 24 5828.4878 4208.4878 3344.4878 303.4878 18794.4878 19718.4878 25 26 27 28 29 30 21292.4878 7498.4878 -1181.5122 -5146.5122 -1973.5122 -6831.5122 31 32 33 34 35 36 -15809.5122 -17654.5122 -24950.5122 -35635.5122 -12451.5122 -10014.5122 37 38 39 40 41 42 -16344.5122 -20364.5122 -27585.5122 -23902.5122 -22466.5122 -11258.2632 43 44 45 46 47 48 -19217.2632 -19212.2632 -30743.2632 -29458.2632 -8363.2632 -7964.2632 49 50 51 52 53 54 -9328.2632 -11199.2632 -10034.2632 -532.2632 8021.7368 12049.7368 55 56 57 58 59 60 16748.7368 17665.7368 11132.7368 15695.7368 36412.7368 39583.7368 > postscript(file="/var/www/html/rcomp/tmp/69o881259332650.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 15594.4878 NA 1 12034.4878 15594.4878 2 5679.4878 12034.4878 3 6907.4878 5679.4878 4 6120.4878 6907.4878 5 6095.4878 6120.4878 6 4029.4878 6095.4878 7 -857.5122 4029.4878 8 -3867.5122 -857.5122 9 -6014.5122 -3867.5122 10 16251.4878 -6014.5122 11 20178.4878 16251.4878 12 21292.4878 20178.4878 13 17178.4878 21292.4878 14 10469.4878 17178.4878 15 11648.4878 10469.4878 16 9182.4878 11648.4878 17 9400.4878 9182.4878 18 5828.4878 9400.4878 19 4208.4878 5828.4878 20 3344.4878 4208.4878 21 303.4878 3344.4878 22 18794.4878 303.4878 23 19718.4878 18794.4878 24 21292.4878 19718.4878 25 7498.4878 21292.4878 26 -1181.5122 7498.4878 27 -5146.5122 -1181.5122 28 -1973.5122 -5146.5122 29 -6831.5122 -1973.5122 30 -15809.5122 -6831.5122 31 -17654.5122 -15809.5122 32 -24950.5122 -17654.5122 33 -35635.5122 -24950.5122 34 -12451.5122 -35635.5122 35 -10014.5122 -12451.5122 36 -16344.5122 -10014.5122 37 -20364.5122 -16344.5122 38 -27585.5122 -20364.5122 39 -23902.5122 -27585.5122 40 -22466.5122 -23902.5122 41 -11258.2632 -22466.5122 42 -19217.2632 -11258.2632 43 -19212.2632 -19217.2632 44 -30743.2632 -19212.2632 45 -29458.2632 -30743.2632 46 -8363.2632 -29458.2632 47 -7964.2632 -8363.2632 48 -9328.2632 -7964.2632 49 -11199.2632 -9328.2632 50 -10034.2632 -11199.2632 51 -532.2632 -10034.2632 52 8021.7368 -532.2632 53 12049.7368 8021.7368 54 16748.7368 12049.7368 55 17665.7368 16748.7368 56 11132.7368 17665.7368 57 15695.7368 11132.7368 58 36412.7368 15695.7368 59 39583.7368 36412.7368 60 NA 39583.7368 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 12034.4878 15594.4878 [2,] 5679.4878 12034.4878 [3,] 6907.4878 5679.4878 [4,] 6120.4878 6907.4878 [5,] 6095.4878 6120.4878 [6,] 4029.4878 6095.4878 [7,] -857.5122 4029.4878 [8,] -3867.5122 -857.5122 [9,] -6014.5122 -3867.5122 [10,] 16251.4878 -6014.5122 [11,] 20178.4878 16251.4878 [12,] 21292.4878 20178.4878 [13,] 17178.4878 21292.4878 [14,] 10469.4878 17178.4878 [15,] 11648.4878 10469.4878 [16,] 9182.4878 11648.4878 [17,] 9400.4878 9182.4878 [18,] 5828.4878 9400.4878 [19,] 4208.4878 5828.4878 [20,] 3344.4878 4208.4878 [21,] 303.4878 3344.4878 [22,] 18794.4878 303.4878 [23,] 19718.4878 18794.4878 [24,] 21292.4878 19718.4878 [25,] 7498.4878 21292.4878 [26,] -1181.5122 7498.4878 [27,] -5146.5122 -1181.5122 [28,] -1973.5122 -5146.5122 [29,] -6831.5122 -1973.5122 [30,] -15809.5122 -6831.5122 [31,] -17654.5122 -15809.5122 [32,] -24950.5122 -17654.5122 [33,] -35635.5122 -24950.5122 [34,] -12451.5122 -35635.5122 [35,] -10014.5122 -12451.5122 [36,] -16344.5122 -10014.5122 [37,] -20364.5122 -16344.5122 [38,] -27585.5122 -20364.5122 [39,] -23902.5122 -27585.5122 [40,] -22466.5122 -23902.5122 [41,] -11258.2632 -22466.5122 [42,] -19217.2632 -11258.2632 [43,] -19212.2632 -19217.2632 [44,] -30743.2632 -19212.2632 [45,] -29458.2632 -30743.2632 [46,] -8363.2632 -29458.2632 [47,] -7964.2632 -8363.2632 [48,] -9328.2632 -7964.2632 [49,] -11199.2632 -9328.2632 [50,] -10034.2632 -11199.2632 [51,] -532.2632 -10034.2632 [52,] 8021.7368 -532.2632 [53,] 12049.7368 8021.7368 [54,] 16748.7368 12049.7368 [55,] 17665.7368 16748.7368 [56,] 11132.7368 17665.7368 [57,] 15695.7368 11132.7368 [58,] 36412.7368 15695.7368 [59,] 39583.7368 36412.7368 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 12034.4878 15594.4878 2 5679.4878 12034.4878 3 6907.4878 5679.4878 4 6120.4878 6907.4878 5 6095.4878 6120.4878 6 4029.4878 6095.4878 7 -857.5122 4029.4878 8 -3867.5122 -857.5122 9 -6014.5122 -3867.5122 10 16251.4878 -6014.5122 11 20178.4878 16251.4878 12 21292.4878 20178.4878 13 17178.4878 21292.4878 14 10469.4878 17178.4878 15 11648.4878 10469.4878 16 9182.4878 11648.4878 17 9400.4878 9182.4878 18 5828.4878 9400.4878 19 4208.4878 5828.4878 20 3344.4878 4208.4878 21 303.4878 3344.4878 22 18794.4878 303.4878 23 19718.4878 18794.4878 24 21292.4878 19718.4878 25 7498.4878 21292.4878 26 -1181.5122 7498.4878 27 -5146.5122 -1181.5122 28 -1973.5122 -5146.5122 29 -6831.5122 -1973.5122 30 -15809.5122 -6831.5122 31 -17654.5122 -15809.5122 32 -24950.5122 -17654.5122 33 -35635.5122 -24950.5122 34 -12451.5122 -35635.5122 35 -10014.5122 -12451.5122 36 -16344.5122 -10014.5122 37 -20364.5122 -16344.5122 38 -27585.5122 -20364.5122 39 -23902.5122 -27585.5122 40 -22466.5122 -23902.5122 41 -11258.2632 -22466.5122 42 -19217.2632 -11258.2632 43 -19212.2632 -19217.2632 44 -30743.2632 -19212.2632 45 -29458.2632 -30743.2632 46 -8363.2632 -29458.2632 47 -7964.2632 -8363.2632 48 -9328.2632 -7964.2632 49 -11199.2632 -9328.2632 50 -10034.2632 -11199.2632 51 -532.2632 -10034.2632 52 8021.7368 -532.2632 53 12049.7368 8021.7368 54 16748.7368 12049.7368 55 17665.7368 16748.7368 56 11132.7368 17665.7368 57 15695.7368 11132.7368 58 36412.7368 15695.7368 59 39583.7368 36412.7368 > 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/77t1b1259332650.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/8bwtl1259332650.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/9d3du1259332650.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/108cjr1259332650.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/117y9x1259332650.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/12wj1c1259332650.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/13lkcg1259332650.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/14989z1259332650.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/15hson1259332650.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/16xnuq1259332650.tab") + } > > system("convert tmp/1kx001259332650.ps tmp/1kx001259332650.png") > system("convert tmp/28z961259332650.ps tmp/28z961259332650.png") > system("convert tmp/30sfh1259332650.ps tmp/30sfh1259332650.png") > system("convert tmp/4o1uk1259332650.ps tmp/4o1uk1259332650.png") > system("convert tmp/52zuo1259332650.ps tmp/52zuo1259332650.png") > system("convert tmp/69o881259332650.ps tmp/69o881259332650.png") > system("convert tmp/77t1b1259332650.ps tmp/77t1b1259332650.png") > system("convert tmp/8bwtl1259332650.ps tmp/8bwtl1259332650.png") > system("convert tmp/9d3du1259332650.ps tmp/9d3du1259332650.png") > system("convert tmp/108cjr1259332650.ps tmp/108cjr1259332650.png") > > > proc.time() user system elapsed 2.489 1.578 2.924