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(-22,46,-20,50,-17,49,-21,48,-16,50,-11,47,-19,50,-31,49,-36,51,-33,52,-26,48,-38,55,-27,56,-21,43,-17,44,-14,50,-16,49,-16,47,-15,46,-7,50,-9,49,2,53,-6,54,0,56,7,56,4,58,-5,53,2,51,0,52,3,53,10,56,4,54,5,54,7,56,1,59,-8,62,-3,62,-16,73,-22,76,-32,80,-30,77,-32,81,-38,80,-41,80,-46,81,-58,80,-55,77,-48,71,-58,71,-58,64,-68,64,-75,47,-77,41,-75,35,-71,34,-63,33,-61,23,-53,16,-41,16,-35,8,-33,9),dim=c(2,61),dimnames=list(c('Econ','Price'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Econ','Price'),1:61)) > 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 Econ Price 1 -22 46 2 -20 50 3 -17 49 4 -21 48 5 -16 50 6 -11 47 7 -19 50 8 -31 49 9 -36 51 10 -33 52 11 -26 48 12 -38 55 13 -27 56 14 -21 43 15 -17 44 16 -14 50 17 -16 49 18 -16 47 19 -15 46 20 -7 50 21 -9 49 22 2 53 23 -6 54 24 0 56 25 7 56 26 4 58 27 -5 53 28 2 51 29 0 52 30 3 53 31 10 56 32 4 54 33 5 54 34 7 56 35 1 59 36 -8 62 37 -3 62 38 -16 73 39 -22 76 40 -32 80 41 -30 77 42 -32 81 43 -38 80 44 -41 80 45 -46 81 46 -58 80 47 -55 77 48 -48 71 49 -58 71 50 -58 64 51 -68 64 52 -75 47 53 -77 41 54 -75 35 55 -71 34 56 -63 33 57 -61 23 58 -53 16 59 -41 16 60 -35 8 61 -33 9 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Price -33.2695 0.1343 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -49.237 -15.474 5.823 19.555 35.749 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -33.2695 10.2684 -3.240 0.00197 ** Price 0.1343 0.1846 0.727 0.46989 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 24.15 on 59 degrees of freedom Multiple R-squared: 0.008887, Adjusted R-squared: -0.007911 F-statistic: 0.529 on 1 and 59 DF, p-value: 0.4699 > 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,] 7.578893e-04 1.515779e-03 0.9992421107 [2,] 2.078794e-03 4.157588e-03 0.9979212059 [3,] 3.275182e-04 6.550363e-04 0.9996724818 [4,] 8.547156e-04 1.709431e-03 0.9991452844 [5,] 1.084248e-03 2.168495e-03 0.9989157524 [6,] 3.375309e-04 6.750618e-04 0.9996624691 [7,] 1.167857e-04 2.335714e-04 0.9998832143 [8,] 2.938796e-05 5.877592e-05 0.9999706120 [9,] 1.706414e-05 3.412828e-05 0.9999829359 [10,] 6.350327e-06 1.270065e-05 0.9999936497 [11,] 1.537729e-06 3.075458e-06 0.9999984623 [12,] 1.077921e-06 2.155842e-06 0.9999989221 [13,] 3.986132e-07 7.972264e-07 0.9999996014 [14,] 1.107348e-07 2.214697e-07 0.9999998893 [15,] 2.916449e-08 5.832898e-08 0.9999999708 [16,] 7.855413e-08 1.571083e-07 0.9999999214 [17,] 6.706888e-08 1.341378e-07 0.9999999329 [18,] 1.334084e-06 2.668169e-06 0.9999986659 [19,] 1.588998e-06 3.177997e-06 0.9999984110 [20,] 3.191340e-06 6.382680e-06 0.9999968087 [21,] 1.007803e-05 2.015605e-05 0.9999899220 [22,] 1.149312e-05 2.298623e-05 0.9999885069 [23,] 7.516366e-06 1.503273e-05 0.9999924836 [24,] 1.155092e-05 2.310183e-05 0.9999884491 [25,] 1.313745e-05 2.627490e-05 0.9999868626 [26,] 1.979561e-05 3.959121e-05 0.9999802044 [27,] 5.351625e-05 1.070325e-04 0.9999464838 [28,] 9.978893e-05 1.995779e-04 0.9999002111 [29,] 2.512888e-04 5.025776e-04 0.9997487112 [30,] 8.761657e-04 1.752331e-03 0.9991238343 [31,] 2.277326e-03 4.554652e-03 0.9977226741 [32,] 5.599406e-03 1.119881e-02 0.9944005937 [33,] 2.159340e-02 4.318680e-02 0.9784065996 [34,] 7.473498e-02 1.494700e-01 0.9252650204 [35,] 1.518774e-01 3.037548e-01 0.8481226100 [36,] 2.170581e-01 4.341163e-01 0.7829418748 [37,] 2.806380e-01 5.612760e-01 0.7193619895 [38,] 3.549991e-01 7.099981e-01 0.6450009394 [39,] 4.178661e-01 8.357323e-01 0.5821338646 [40,] 4.853382e-01 9.706763e-01 0.5146618452 [41,] 5.440574e-01 9.118853e-01 0.4559426274 [42,] 5.605596e-01 8.788808e-01 0.4394404240 [43,] 5.813570e-01 8.372859e-01 0.4186429665 [44,] 7.103314e-01 5.793372e-01 0.2896686189 [45,] 8.072869e-01 3.854262e-01 0.1927131196 [46,] 9.357921e-01 1.284159e-01 0.0642079277 [47,] 9.984227e-01 3.154591e-03 0.0015772954 [48,] 9.994900e-01 1.020063e-03 0.0005100313 [49,] 9.990415e-01 1.917017e-03 0.0009585083 [50,] 9.976344e-01 4.731169e-03 0.0023655846 [51,] 9.918435e-01 1.631294e-02 0.0081564680 [52,] 9.871466e-01 2.570684e-02 0.0128534218 > postscript(file="/var/www/html/rcomp/tmp/1rgxq1258813962.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/2zduk1258813962.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/3qg521258813962.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/4ki4m1258813962.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/58rev1258813962.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 = 61 Frequency = 1 1 2 3 4 5 6 5.0920006 6.5548254 9.6891192 5.8234130 10.5548254 15.9577068 7 8 9 10 11 12 7.5548254 -4.3108808 -9.5794684 -6.7137622 0.8234130 -12.1166435 13 14 15 16 17 18 -1.2509373 6.4948819 10.3605882 12.5548254 10.6891192 10.9577068 19 20 21 22 23 24 12.0920006 19.5548254 17.6891192 28.1519441 20.0176503 25.7490627 25 26 27 28 29 30 32.7490627 29.4804751 21.1519441 28.4205316 26.2862378 29.1519441 31 32 33 34 35 36 35.7490627 30.0176503 31.0176503 32.7490627 26.3461813 16.9433000 37 38 39 40 41 42 21.9433000 7.4660683 1.0631869 -9.4739882 -7.0711069 -9.6082820 43 44 45 46 47 48 -15.4739882 -18.4739882 -23.6082820 -35.4739882 -32.0711069 -24.2653441 49 50 51 52 53 54 -34.2653441 -33.3252876 -43.3252876 -48.0422932 -49.2365305 -46.4307678 55 56 57 58 59 60 -42.2964740 -34.1621802 -30.8192423 -21.8791858 -9.8791858 -2.8048355 61 -0.9391293 > postscript(file="/var/www/html/rcomp/tmp/698oy1258813962.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 5.0920006 NA 1 6.5548254 5.0920006 2 9.6891192 6.5548254 3 5.8234130 9.6891192 4 10.5548254 5.8234130 5 15.9577068 10.5548254 6 7.5548254 15.9577068 7 -4.3108808 7.5548254 8 -9.5794684 -4.3108808 9 -6.7137622 -9.5794684 10 0.8234130 -6.7137622 11 -12.1166435 0.8234130 12 -1.2509373 -12.1166435 13 6.4948819 -1.2509373 14 10.3605882 6.4948819 15 12.5548254 10.3605882 16 10.6891192 12.5548254 17 10.9577068 10.6891192 18 12.0920006 10.9577068 19 19.5548254 12.0920006 20 17.6891192 19.5548254 21 28.1519441 17.6891192 22 20.0176503 28.1519441 23 25.7490627 20.0176503 24 32.7490627 25.7490627 25 29.4804751 32.7490627 26 21.1519441 29.4804751 27 28.4205316 21.1519441 28 26.2862378 28.4205316 29 29.1519441 26.2862378 30 35.7490627 29.1519441 31 30.0176503 35.7490627 32 31.0176503 30.0176503 33 32.7490627 31.0176503 34 26.3461813 32.7490627 35 16.9433000 26.3461813 36 21.9433000 16.9433000 37 7.4660683 21.9433000 38 1.0631869 7.4660683 39 -9.4739882 1.0631869 40 -7.0711069 -9.4739882 41 -9.6082820 -7.0711069 42 -15.4739882 -9.6082820 43 -18.4739882 -15.4739882 44 -23.6082820 -18.4739882 45 -35.4739882 -23.6082820 46 -32.0711069 -35.4739882 47 -24.2653441 -32.0711069 48 -34.2653441 -24.2653441 49 -33.3252876 -34.2653441 50 -43.3252876 -33.3252876 51 -48.0422932 -43.3252876 52 -49.2365305 -48.0422932 53 -46.4307678 -49.2365305 54 -42.2964740 -46.4307678 55 -34.1621802 -42.2964740 56 -30.8192423 -34.1621802 57 -21.8791858 -30.8192423 58 -9.8791858 -21.8791858 59 -2.8048355 -9.8791858 60 -0.9391293 -2.8048355 61 NA -0.9391293 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 6.5548254 5.092001 [2,] 9.6891192 6.554825 [3,] 5.8234130 9.689119 [4,] 10.5548254 5.823413 [5,] 15.9577068 10.554825 [6,] 7.5548254 15.957707 [7,] -4.3108808 7.554825 [8,] -9.5794684 -4.310881 [9,] -6.7137622 -9.579468 [10,] 0.8234130 -6.713762 [11,] -12.1166435 0.823413 [12,] -1.2509373 -12.116644 [13,] 6.4948819 -1.250937 [14,] 10.3605882 6.494882 [15,] 12.5548254 10.360588 [16,] 10.6891192 12.554825 [17,] 10.9577068 10.689119 [18,] 12.0920006 10.957707 [19,] 19.5548254 12.092001 [20,] 17.6891192 19.554825 [21,] 28.1519441 17.689119 [22,] 20.0176503 28.151944 [23,] 25.7490627 20.017650 [24,] 32.7490627 25.749063 [25,] 29.4804751 32.749063 [26,] 21.1519441 29.480475 [27,] 28.4205316 21.151944 [28,] 26.2862378 28.420532 [29,] 29.1519441 26.286238 [30,] 35.7490627 29.151944 [31,] 30.0176503 35.749063 [32,] 31.0176503 30.017650 [33,] 32.7490627 31.017650 [34,] 26.3461813 32.749063 [35,] 16.9433000 26.346181 [36,] 21.9433000 16.943300 [37,] 7.4660683 21.943300 [38,] 1.0631869 7.466068 [39,] -9.4739882 1.063187 [40,] -7.0711069 -9.473988 [41,] -9.6082820 -7.071107 [42,] -15.4739882 -9.608282 [43,] -18.4739882 -15.473988 [44,] -23.6082820 -18.473988 [45,] -35.4739882 -23.608282 [46,] -32.0711069 -35.473988 [47,] -24.2653441 -32.071107 [48,] -34.2653441 -24.265344 [49,] -33.3252876 -34.265344 [50,] -43.3252876 -33.325288 [51,] -48.0422932 -43.325288 [52,] -49.2365305 -48.042293 [53,] -46.4307678 -49.236530 [54,] -42.2964740 -46.430768 [55,] -34.1621802 -42.296474 [56,] -30.8192423 -34.162180 [57,] -21.8791858 -30.819242 [58,] -9.8791858 -21.879186 [59,] -2.8048355 -9.879186 [60,] -0.9391293 -2.804835 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 6.5548254 5.092001 2 9.6891192 6.554825 3 5.8234130 9.689119 4 10.5548254 5.823413 5 15.9577068 10.554825 6 7.5548254 15.957707 7 -4.3108808 7.554825 8 -9.5794684 -4.310881 9 -6.7137622 -9.579468 10 0.8234130 -6.713762 11 -12.1166435 0.823413 12 -1.2509373 -12.116644 13 6.4948819 -1.250937 14 10.3605882 6.494882 15 12.5548254 10.360588 16 10.6891192 12.554825 17 10.9577068 10.689119 18 12.0920006 10.957707 19 19.5548254 12.092001 20 17.6891192 19.554825 21 28.1519441 17.689119 22 20.0176503 28.151944 23 25.7490627 20.017650 24 32.7490627 25.749063 25 29.4804751 32.749063 26 21.1519441 29.480475 27 28.4205316 21.151944 28 26.2862378 28.420532 29 29.1519441 26.286238 30 35.7490627 29.151944 31 30.0176503 35.749063 32 31.0176503 30.017650 33 32.7490627 31.017650 34 26.3461813 32.749063 35 16.9433000 26.346181 36 21.9433000 16.943300 37 7.4660683 21.943300 38 1.0631869 7.466068 39 -9.4739882 1.063187 40 -7.0711069 -9.473988 41 -9.6082820 -7.071107 42 -15.4739882 -9.608282 43 -18.4739882 -15.473988 44 -23.6082820 -18.473988 45 -35.4739882 -23.608282 46 -32.0711069 -35.473988 47 -24.2653441 -32.071107 48 -34.2653441 -24.265344 49 -33.3252876 -34.265344 50 -43.3252876 -33.325288 51 -48.0422932 -43.325288 52 -49.2365305 -48.042293 53 -46.4307678 -49.236530 54 -42.2964740 -46.430768 55 -34.1621802 -42.296474 56 -30.8192423 -34.162180 57 -21.8791858 -30.819242 58 -9.8791858 -21.879186 59 -2.8048355 -9.879186 60 -0.9391293 -2.804835 > 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/7wcer1258813962.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/8yz8d1258813962.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/9rx8w1258813962.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/10i4eg1258813962.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/11umyl1258813962.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/12g3pt1258813962.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/13uzbs1258813963.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/14sma21258813963.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/1555ev1258813963.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/16e75m1258813963.tab") + } > > system("convert tmp/1rgxq1258813962.ps tmp/1rgxq1258813962.png") > system("convert tmp/2zduk1258813962.ps tmp/2zduk1258813962.png") > system("convert tmp/3qg521258813962.ps tmp/3qg521258813962.png") > system("convert tmp/4ki4m1258813962.ps tmp/4ki4m1258813962.png") > system("convert tmp/58rev1258813962.ps tmp/58rev1258813962.png") > system("convert tmp/698oy1258813962.ps tmp/698oy1258813962.png") > system("convert tmp/7wcer1258813962.ps tmp/7wcer1258813962.png") > system("convert tmp/8yz8d1258813962.ps tmp/8yz8d1258813962.png") > system("convert tmp/9rx8w1258813962.ps tmp/9rx8w1258813962.png") > system("convert tmp/10i4eg1258813962.ps tmp/10i4eg1258813962.png") > > > proc.time() user system elapsed 2.455 1.554 2.918