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(81.71,84.86,87.703,85.03,90.09,85.61,100.639,85.52,83.042,86.51,89.956,86.66,89.561,87.27,105.38,87.62,86.554,88.17,93.131,87.99,92.812,88.83,102.195,88.75,88.925,88.81,94.184,89.43,94.196,89.5,108.932,89.34,91.134,89.75,97.149,90.26,96.415,90.32,112.432,90.76,92.47,91.53,98.61410515,92.35,97.80117197,93.04,111.8560178,93.35,95.63981455,93.54,104.1120262,95.07,104.0148224,95.39,118.1743476,95.43,102.033431,96.09,109.3138852,96.35,108.1523649,96.6,121.30381,96.62,103.8725146,97.6,112.7185207,97.67,109.0381253,98.23,122.4434864,98.29,106.6325686,98.89,113.8153852,99.88,111.1071252,100.42,130.039536,100.81,109.6121057,101.5,116.8592117,102.59,113.8982545,103.58,128.9375926,103.47,111.8120023,103.77,119.9689463,104.65,117.018539,105.12,132.4743387,104.97,116.3369106,105.58,124.6405636,106.17,121.025249,106.52,137.2054829,107.87,120.0187687,109.63,127.0443429,111.54,124.349043,112.47,143.6114438,111.63),dim=c(2,56),dimnames=list(c('LKI','CPI'),1:56)) > y <- array(NA,dim=c(2,56),dimnames=list(c('LKI','CPI'),1:56)) > 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 LKI CPI 1 81.71000 84.86 2 87.70300 85.03 3 90.09000 85.61 4 100.63900 85.52 5 83.04200 86.51 6 89.95600 86.66 7 89.56100 87.27 8 105.38000 87.62 9 86.55400 88.17 10 93.13100 87.99 11 92.81200 88.83 12 102.19500 88.75 13 88.92500 88.81 14 94.18400 89.43 15 94.19600 89.50 16 108.93200 89.34 17 91.13400 89.75 18 97.14900 90.26 19 96.41500 90.32 20 112.43200 90.76 21 92.47000 91.53 22 98.61411 92.35 23 97.80117 93.04 24 111.85602 93.35 25 95.63981 93.54 26 104.11203 95.07 27 104.01482 95.39 28 118.17435 95.43 29 102.03343 96.09 30 109.31389 96.35 31 108.15236 96.60 32 121.30381 96.62 33 103.87251 97.60 34 112.71852 97.67 35 109.03813 98.23 36 122.44349 98.29 37 106.63257 98.89 38 113.81539 99.88 39 111.10713 100.42 40 130.03954 100.81 41 109.61211 101.50 42 116.85921 102.59 43 113.89825 103.58 44 128.93759 103.47 45 111.81200 103.77 46 119.96895 104.65 47 117.01854 105.12 48 132.47434 104.97 49 116.33691 105.58 50 124.64056 106.17 51 121.02525 106.52 52 137.20548 107.87 53 120.01877 109.63 54 127.04434 111.54 55 124.34904 112.47 56 143.61144 111.63 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) CPI -47.776 1.614 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -9.431 -5.361 -1.970 3.799 15.082 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -47.7763 12.1170 -3.943 0.000234 *** CPI 1.6143 0.1255 12.862 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 7.253 on 54 degrees of freedom Multiple R-squared: 0.7539, Adjusted R-squared: 0.7494 F-statistic: 165.4 on 1 and 54 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.75346623 0.4930675 0.2465338 [2,] 0.61166762 0.7766648 0.3883324 [3,] 0.46755421 0.9351084 0.5324458 [4,] 0.65934024 0.6813195 0.3406598 [5,] 0.69157976 0.6168405 0.3084202 [6,] 0.58606097 0.8278781 0.4139390 [7,] 0.48473327 0.9694665 0.5152667 [8,] 0.47468432 0.9493686 0.5253157 [9,] 0.45330982 0.9066196 0.5466902 [10,] 0.36492645 0.7298529 0.6350735 [11,] 0.28565939 0.5713188 0.7143406 [12,] 0.45784320 0.9156864 0.5421568 [13,] 0.43588676 0.8717735 0.5641132 [14,] 0.35345393 0.7069079 0.6465461 [15,] 0.28190680 0.5638136 0.7180932 [16,] 0.44540690 0.8908138 0.5545931 [17,] 0.47769413 0.9553883 0.5223059 [18,] 0.41401349 0.8280270 0.5859865 [19,] 0.37364788 0.7472958 0.6263521 [20,] 0.39309355 0.7861871 0.6069064 [21,] 0.41970538 0.8394108 0.5802946 [22,] 0.35295025 0.7059005 0.6470498 [23,] 0.29593713 0.5918743 0.7040629 [24,] 0.38014297 0.7602859 0.6198570 [25,] 0.36677310 0.7335462 0.6332269 [26,] 0.29613119 0.5922624 0.7038688 [27,] 0.23495385 0.4699077 0.7650462 [28,] 0.32910765 0.6582153 0.6708923 [29,] 0.32959288 0.6591858 0.6704071 [30,] 0.26164553 0.5232911 0.7383545 [31,] 0.21205580 0.4241116 0.7879442 [32,] 0.26190786 0.5238157 0.7380921 [33,] 0.24556973 0.4911395 0.7544303 [34,] 0.18537612 0.3707522 0.8146239 [35,] 0.15294501 0.3058900 0.8470550 [36,] 0.30869659 0.6173932 0.6913034 [37,] 0.29673820 0.5934764 0.7032618 [38,] 0.22631045 0.4526209 0.7736895 [39,] 0.20343969 0.4068794 0.7965603 [40,] 0.23067245 0.4613449 0.7693275 [41,] 0.24025380 0.4805076 0.7597462 [42,] 0.17105254 0.3421051 0.8289475 [43,] 0.14653315 0.2930663 0.8534669 [44,] 0.17491018 0.3498204 0.8250898 [45,] 0.15167031 0.3033406 0.8483297 [46,] 0.08603473 0.1720695 0.9139653 [47,] 0.06848632 0.1369726 0.9315137 > postscript(file="/var/www/rcomp/tmp/1zhkf1293190838.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/2a81i1293190838.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/3a81i1293190838.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/4a81i1293190838.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/53h031293190838.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 = 56 Frequency = 1 1 2 3 4 5 6 -7.499945276 -1.781369670 -0.330641133 10.363642370 -8.831476162 -2.159615333 7 8 9 10 11 12 -3.539314631 11.714693969 -7.999149659 -1.131582654 -2.806562014 6.705578878 13 14 15 16 17 18 -6.661276791 -2.403118700 -2.504116980 12.490164803 -5.969682266 -0.777955449 19 20 21 22 23 24 -1.608811117 13.697913980 -7.507067100 -2.686656088 -4.613429457 8.940995419 25 26 27 28 29 30 -7.581917448 -1.579525347 -2.193292713 11.901662041 -5.304666913 1.556079390 31 32 33 34 35 36 -0.009006196 13.110153681 -5.903117639 2.829890181 -1.754491460 11.554013972 37 38 39 40 41 42 -5.225460514 0.359237554 -3.220723463 15.082125491 -6.459144998 -0.971583644 43 44 45 46 47 48 -5.530659376 9.686247450 -7.923621193 -1.187226999 -4.896337036 10.801601835 49 50 51 52 53 54 -6.320525562 1.030713364 -3.149592636 10.851388720 -9.176425092 -5.234089675 55 56 -9.430652438 11.187727722 > postscript(file="/var/www/rcomp/tmp/63h031293190838.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 = 56 Frequency = 1 lag(myerror, k = 1) myerror 0 -7.499945276 NA 1 -1.781369670 -7.499945276 2 -0.330641133 -1.781369670 3 10.363642370 -0.330641133 4 -8.831476162 10.363642370 5 -2.159615333 -8.831476162 6 -3.539314631 -2.159615333 7 11.714693969 -3.539314631 8 -7.999149659 11.714693969 9 -1.131582654 -7.999149659 10 -2.806562014 -1.131582654 11 6.705578878 -2.806562014 12 -6.661276791 6.705578878 13 -2.403118700 -6.661276791 14 -2.504116980 -2.403118700 15 12.490164803 -2.504116980 16 -5.969682266 12.490164803 17 -0.777955449 -5.969682266 18 -1.608811117 -0.777955449 19 13.697913980 -1.608811117 20 -7.507067100 13.697913980 21 -2.686656088 -7.507067100 22 -4.613429457 -2.686656088 23 8.940995419 -4.613429457 24 -7.581917448 8.940995419 25 -1.579525347 -7.581917448 26 -2.193292713 -1.579525347 27 11.901662041 -2.193292713 28 -5.304666913 11.901662041 29 1.556079390 -5.304666913 30 -0.009006196 1.556079390 31 13.110153681 -0.009006196 32 -5.903117639 13.110153681 33 2.829890181 -5.903117639 34 -1.754491460 2.829890181 35 11.554013972 -1.754491460 36 -5.225460514 11.554013972 37 0.359237554 -5.225460514 38 -3.220723463 0.359237554 39 15.082125491 -3.220723463 40 -6.459144998 15.082125491 41 -0.971583644 -6.459144998 42 -5.530659376 -0.971583644 43 9.686247450 -5.530659376 44 -7.923621193 9.686247450 45 -1.187226999 -7.923621193 46 -4.896337036 -1.187226999 47 10.801601835 -4.896337036 48 -6.320525562 10.801601835 49 1.030713364 -6.320525562 50 -3.149592636 1.030713364 51 10.851388720 -3.149592636 52 -9.176425092 10.851388720 53 -5.234089675 -9.176425092 54 -9.430652438 -5.234089675 55 11.187727722 -9.430652438 56 NA 11.187727722 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.781369670 -7.499945276 [2,] -0.330641133 -1.781369670 [3,] 10.363642370 -0.330641133 [4,] -8.831476162 10.363642370 [5,] -2.159615333 -8.831476162 [6,] -3.539314631 -2.159615333 [7,] 11.714693969 -3.539314631 [8,] -7.999149659 11.714693969 [9,] -1.131582654 -7.999149659 [10,] -2.806562014 -1.131582654 [11,] 6.705578878 -2.806562014 [12,] -6.661276791 6.705578878 [13,] -2.403118700 -6.661276791 [14,] -2.504116980 -2.403118700 [15,] 12.490164803 -2.504116980 [16,] -5.969682266 12.490164803 [17,] -0.777955449 -5.969682266 [18,] -1.608811117 -0.777955449 [19,] 13.697913980 -1.608811117 [20,] -7.507067100 13.697913980 [21,] -2.686656088 -7.507067100 [22,] -4.613429457 -2.686656088 [23,] 8.940995419 -4.613429457 [24,] -7.581917448 8.940995419 [25,] -1.579525347 -7.581917448 [26,] -2.193292713 -1.579525347 [27,] 11.901662041 -2.193292713 [28,] -5.304666913 11.901662041 [29,] 1.556079390 -5.304666913 [30,] -0.009006196 1.556079390 [31,] 13.110153681 -0.009006196 [32,] -5.903117639 13.110153681 [33,] 2.829890181 -5.903117639 [34,] -1.754491460 2.829890181 [35,] 11.554013972 -1.754491460 [36,] -5.225460514 11.554013972 [37,] 0.359237554 -5.225460514 [38,] -3.220723463 0.359237554 [39,] 15.082125491 -3.220723463 [40,] -6.459144998 15.082125491 [41,] -0.971583644 -6.459144998 [42,] -5.530659376 -0.971583644 [43,] 9.686247450 -5.530659376 [44,] -7.923621193 9.686247450 [45,] -1.187226999 -7.923621193 [46,] -4.896337036 -1.187226999 [47,] 10.801601835 -4.896337036 [48,] -6.320525562 10.801601835 [49,] 1.030713364 -6.320525562 [50,] -3.149592636 1.030713364 [51,] 10.851388720 -3.149592636 [52,] -9.176425092 10.851388720 [53,] -5.234089675 -9.176425092 [54,] -9.430652438 -5.234089675 [55,] 11.187727722 -9.430652438 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.781369670 -7.499945276 2 -0.330641133 -1.781369670 3 10.363642370 -0.330641133 4 -8.831476162 10.363642370 5 -2.159615333 -8.831476162 6 -3.539314631 -2.159615333 7 11.714693969 -3.539314631 8 -7.999149659 11.714693969 9 -1.131582654 -7.999149659 10 -2.806562014 -1.131582654 11 6.705578878 -2.806562014 12 -6.661276791 6.705578878 13 -2.403118700 -6.661276791 14 -2.504116980 -2.403118700 15 12.490164803 -2.504116980 16 -5.969682266 12.490164803 17 -0.777955449 -5.969682266 18 -1.608811117 -0.777955449 19 13.697913980 -1.608811117 20 -7.507067100 13.697913980 21 -2.686656088 -7.507067100 22 -4.613429457 -2.686656088 23 8.940995419 -4.613429457 24 -7.581917448 8.940995419 25 -1.579525347 -7.581917448 26 -2.193292713 -1.579525347 27 11.901662041 -2.193292713 28 -5.304666913 11.901662041 29 1.556079390 -5.304666913 30 -0.009006196 1.556079390 31 13.110153681 -0.009006196 32 -5.903117639 13.110153681 33 2.829890181 -5.903117639 34 -1.754491460 2.829890181 35 11.554013972 -1.754491460 36 -5.225460514 11.554013972 37 0.359237554 -5.225460514 38 -3.220723463 0.359237554 39 15.082125491 -3.220723463 40 -6.459144998 15.082125491 41 -0.971583644 -6.459144998 42 -5.530659376 -0.971583644 43 9.686247450 -5.530659376 44 -7.923621193 9.686247450 45 -1.187226999 -7.923621193 46 -4.896337036 -1.187226999 47 10.801601835 -4.896337036 48 -6.320525562 10.801601835 49 1.030713364 -6.320525562 50 -3.149592636 1.030713364 51 10.851388720 -3.149592636 52 -9.176425092 10.851388720 53 -5.234089675 -9.176425092 54 -9.430652438 -5.234089675 55 11.187727722 -9.430652438 > 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/7drz51293190838.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/8drz51293190838.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/9drz51293190838.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/10oizr1293190838.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/11rjxw1293190838.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/12v1d21293190838.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/1322tw1293190838.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/14utaz1293190838.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/15gu8n1293190838.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/16c46w1293190838.tab") + } > > try(system("convert tmp/1zhkf1293190838.ps tmp/1zhkf1293190838.png",intern=TRUE)) character(0) > try(system("convert tmp/2a81i1293190838.ps tmp/2a81i1293190838.png",intern=TRUE)) character(0) > try(system("convert tmp/3a81i1293190838.ps tmp/3a81i1293190838.png",intern=TRUE)) character(0) > try(system("convert tmp/4a81i1293190838.ps tmp/4a81i1293190838.png",intern=TRUE)) character(0) > try(system("convert tmp/53h031293190838.ps tmp/53h031293190838.png",intern=TRUE)) character(0) > try(system("convert tmp/63h031293190838.ps tmp/63h031293190838.png",intern=TRUE)) character(0) > try(system("convert tmp/7drz51293190838.ps tmp/7drz51293190838.png",intern=TRUE)) character(0) > try(system("convert tmp/8drz51293190838.ps tmp/8drz51293190838.png",intern=TRUE)) character(0) > try(system("convert tmp/9drz51293190838.ps tmp/9drz51293190838.png",intern=TRUE)) character(0) > try(system("convert tmp/10oizr1293190838.ps tmp/10oizr1293190838.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.080 1.640 4.708