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(3030.29,101.2,2803.47,101.1,2767.63,100.7,2882.6,100.1,2863.36,99.9,2897.06,99.7,3012.61,99.5,3142.95,99.2,3032.93,99,3045.78,99,3110.52,99.3,3013.24,99.5,2987.1,99.7,2995.55,100,2833.18,100.4,2848.96,100.6,2794.83,100.7,2845.26,100.7,2915.02,100.6,2892.63,100.5,2604.42,100.6,2641.65,100.5,2659.81,100.4,2638.53,100.3,2720.25,100.4,2745.88,100.4,2735.7,100.4,2811.7,100.4,2799.43,100.4,2555.28,100.5,2304.98,100.6,2214.95,100.6,2065.81,100.5,1940.49,100.5,2042.00,100.7,1995.37,101.1,1946.81,101.5,1765.9,101.9,1635.25,102.1,1833.42,102.1,1910.43,102.1,1959.67,102.4,1969.6,102.8,2061.41,103.1,2093.48,103.1,2120.88,102.9,2174.56,102.4,2196.72,101.9,2350.44,101.3,2440.25,100.7,2408.64,100.6,2472.81,101,2407.6,101.5,2454.62,101.9,2448.05,102.1,2497.84,102.3,2645.64,102.5,2756.76,102.9,2849.27,103.6,2921.44,104.3),dim=c(2,60),dimnames=list(c('Bel20','Gzhidx'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Bel20','Gzhidx'),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 = 'Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '2' > #'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 Gzhidx Bel20 t 1 101.2 3030.29 1 2 101.1 2803.47 2 3 100.7 2767.63 3 4 100.1 2882.60 4 5 99.9 2863.36 5 6 99.7 2897.06 6 7 99.5 3012.61 7 8 99.2 3142.95 8 9 99.0 3032.93 9 10 99.0 3045.78 10 11 99.3 3110.52 11 12 99.5 3013.24 12 13 99.7 2987.10 13 14 100.0 2995.55 14 15 100.4 2833.18 15 16 100.6 2848.96 16 17 100.7 2794.83 17 18 100.7 2845.26 18 19 100.6 2915.02 19 20 100.5 2892.63 20 21 100.6 2604.42 21 22 100.5 2641.65 22 23 100.4 2659.81 23 24 100.3 2638.53 24 25 100.4 2720.25 25 26 100.4 2745.88 26 27 100.4 2735.70 27 28 100.4 2811.70 28 29 100.4 2799.43 29 30 100.5 2555.28 30 31 100.6 2304.98 31 32 100.6 2214.95 32 33 100.5 2065.81 33 34 100.5 1940.49 34 35 100.7 2042.00 35 36 101.1 1995.37 36 37 101.5 1946.81 37 38 101.9 1765.90 38 39 102.1 1635.25 39 40 102.1 1833.42 40 41 102.1 1910.43 41 42 102.4 1959.67 42 43 102.8 1969.60 43 44 103.1 2061.41 44 45 103.1 2093.48 45 46 102.9 2120.88 46 47 102.4 2174.56 47 48 101.9 2196.72 48 49 101.3 2350.44 49 50 100.7 2440.25 50 51 100.6 2408.64 51 52 101.0 2472.81 52 53 101.5 2407.60 53 54 101.9 2454.62 54 55 102.1 2448.05 55 56 102.3 2497.84 56 57 102.5 2645.64 57 58 102.9 2756.76 58 59 103.6 2849.27 59 60 104.3 2921.44 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Bel20 t 1.004e+02 -3.449e-04 4.839e-02 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.48294 -0.49446 -0.09469 0.36305 1.95842 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.004e+02 9.007e-01 111.514 < 2e-16 *** Bel20 -3.449e-04 2.981e-04 -1.157 0.252 t 4.839e-02 6.859e-03 7.055 2.58e-09 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.7492 on 57 degrees of freedom Multiple R-squared: 0.6158, Adjusted R-squared: 0.6023 F-statistic: 45.68 on 2 and 57 DF, p-value: 1.443e-12 > 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.0107768402 0.0215536805 0.989223160 [2,] 0.0060883855 0.0121767711 0.993911614 [3,] 0.0015578370 0.0031156740 0.998442163 [4,] 0.0004772870 0.0009545741 0.999522713 [5,] 0.0006452738 0.0012905476 0.999354726 [6,] 0.0077001872 0.0154003744 0.992299813 [7,] 0.0318209203 0.0636418406 0.968179080 [8,] 0.0630880485 0.1261760970 0.936911951 [9,] 0.1135605888 0.2271211777 0.886439411 [10,] 0.1144095043 0.2288190085 0.885590496 [11,] 0.1148537746 0.2297075493 0.885146225 [12,] 0.0915666895 0.1831333791 0.908433310 [13,] 0.0799874164 0.1599748328 0.920012584 [14,] 0.0763138750 0.1526277500 0.923686125 [15,] 0.0570226934 0.1140453868 0.942977307 [16,] 0.0643204448 0.1286408897 0.935679555 [17,] 0.0522827634 0.1045655267 0.947717237 [18,] 0.0388294861 0.0776589721 0.961170514 [19,] 0.0292549182 0.0585098364 0.970745082 [20,] 0.0184310272 0.0368620545 0.981568973 [21,] 0.0113781618 0.0227563236 0.988621838 [22,] 0.0067858754 0.0135717507 0.993214125 [23,] 0.0044425849 0.0088851697 0.995557415 [24,] 0.0028482672 0.0056965344 0.997151733 [25,] 0.0020491753 0.0040983506 0.997950825 [26,] 0.0025066582 0.0050133163 0.997493342 [27,] 0.0024557477 0.0049114955 0.997544252 [28,] 0.0025462873 0.0050925747 0.997453713 [29,] 0.0024857919 0.0049715838 0.997514208 [30,] 0.0015859687 0.0031719375 0.998414031 [31,] 0.0009733769 0.0019467538 0.999026623 [32,] 0.0006926264 0.0013852528 0.999307374 [33,] 0.0004742260 0.0009484520 0.999525774 [34,] 0.0002994263 0.0005988525 0.999700574 [35,] 0.0002256613 0.0004513225 0.999774339 [36,] 0.0001744509 0.0003489019 0.999825549 [37,] 0.0002260310 0.0004520620 0.999773969 [38,] 0.0006938449 0.0013876898 0.999306155 [39,] 0.0047616831 0.0095233661 0.995238317 [40,] 0.0312403786 0.0624807571 0.968759621 [41,] 0.1746178381 0.3492356762 0.825382162 [42,] 0.5362260595 0.9275478810 0.463773941 [43,] 0.9494177331 0.1011645338 0.050582267 [44,] 0.9972655105 0.0054689791 0.002734490 [45,] 0.9952904538 0.0094190924 0.004709546 [46,] 0.9884420298 0.0231159405 0.011557970 [47,] 0.9765265867 0.0469468267 0.023473413 [48,] 0.9364122645 0.1271754709 0.063587735 [49,] 0.9087016459 0.1825967082 0.091298354 > postscript(file="/var/www/html/rcomp/tmp/17b3e1258570010.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/2d1i11258570010.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/322ps1258570010.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/4hz301258570010.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/5k1cg1258570010.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 1.750944006 1.524324513 1.063573798 0.454837276 0.199811881 -0.036954569 7 8 9 10 11 12 -0.245491050 -0.548926478 -0.835261788 -0.879219378 -0.605280169 -0.487221468 13 14 15 16 17 18 -0.344626664 -0.090101810 0.205507427 0.362560390 0.395501476 0.364505183 19 20 21 22 23 24 0.240175784 0.084063959 0.036271127 -0.099277830 -0.241404008 -0.397132996 25 26 27 28 29 30 -0.317337405 -0.356887189 -0.408787799 -0.430965029 -0.483586479 -0.516183068 31 32 33 34 35 36 -0.550900785 -0.630341567 -0.830169319 -0.921781581 -0.735160441 -0.399632614 37 38 39 40 41 42 -0.064770442 0.224444370 0.330993798 0.350952858 0.329123975 0.597717253 43 44 45 46 47 48 0.952752557 1.236028178 1.198699543 0.959760230 0.429884858 -0.110861725 49 50 51 52 53 54 -0.706233418 -1.323647595 -1.482939388 -1.109196771 -0.680077164 -0.312249562 55 56 57 58 59 60 -0.162905088 0.005877884 0.208464390 0.598400006 1.281917056 1.958418864 > postscript(file="/var/www/html/rcomp/tmp/6wirj1258570010.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 1.750944006 NA 1 1.524324513 1.750944006 2 1.063573798 1.524324513 3 0.454837276 1.063573798 4 0.199811881 0.454837276 5 -0.036954569 0.199811881 6 -0.245491050 -0.036954569 7 -0.548926478 -0.245491050 8 -0.835261788 -0.548926478 9 -0.879219378 -0.835261788 10 -0.605280169 -0.879219378 11 -0.487221468 -0.605280169 12 -0.344626664 -0.487221468 13 -0.090101810 -0.344626664 14 0.205507427 -0.090101810 15 0.362560390 0.205507427 16 0.395501476 0.362560390 17 0.364505183 0.395501476 18 0.240175784 0.364505183 19 0.084063959 0.240175784 20 0.036271127 0.084063959 21 -0.099277830 0.036271127 22 -0.241404008 -0.099277830 23 -0.397132996 -0.241404008 24 -0.317337405 -0.397132996 25 -0.356887189 -0.317337405 26 -0.408787799 -0.356887189 27 -0.430965029 -0.408787799 28 -0.483586479 -0.430965029 29 -0.516183068 -0.483586479 30 -0.550900785 -0.516183068 31 -0.630341567 -0.550900785 32 -0.830169319 -0.630341567 33 -0.921781581 -0.830169319 34 -0.735160441 -0.921781581 35 -0.399632614 -0.735160441 36 -0.064770442 -0.399632614 37 0.224444370 -0.064770442 38 0.330993798 0.224444370 39 0.350952858 0.330993798 40 0.329123975 0.350952858 41 0.597717253 0.329123975 42 0.952752557 0.597717253 43 1.236028178 0.952752557 44 1.198699543 1.236028178 45 0.959760230 1.198699543 46 0.429884858 0.959760230 47 -0.110861725 0.429884858 48 -0.706233418 -0.110861725 49 -1.323647595 -0.706233418 50 -1.482939388 -1.323647595 51 -1.109196771 -1.482939388 52 -0.680077164 -1.109196771 53 -0.312249562 -0.680077164 54 -0.162905088 -0.312249562 55 0.005877884 -0.162905088 56 0.208464390 0.005877884 57 0.598400006 0.208464390 58 1.281917056 0.598400006 59 1.958418864 1.281917056 60 NA 1.958418864 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.524324513 1.750944006 [2,] 1.063573798 1.524324513 [3,] 0.454837276 1.063573798 [4,] 0.199811881 0.454837276 [5,] -0.036954569 0.199811881 [6,] -0.245491050 -0.036954569 [7,] -0.548926478 -0.245491050 [8,] -0.835261788 -0.548926478 [9,] -0.879219378 -0.835261788 [10,] -0.605280169 -0.879219378 [11,] -0.487221468 -0.605280169 [12,] -0.344626664 -0.487221468 [13,] -0.090101810 -0.344626664 [14,] 0.205507427 -0.090101810 [15,] 0.362560390 0.205507427 [16,] 0.395501476 0.362560390 [17,] 0.364505183 0.395501476 [18,] 0.240175784 0.364505183 [19,] 0.084063959 0.240175784 [20,] 0.036271127 0.084063959 [21,] -0.099277830 0.036271127 [22,] -0.241404008 -0.099277830 [23,] -0.397132996 -0.241404008 [24,] -0.317337405 -0.397132996 [25,] -0.356887189 -0.317337405 [26,] -0.408787799 -0.356887189 [27,] -0.430965029 -0.408787799 [28,] -0.483586479 -0.430965029 [29,] -0.516183068 -0.483586479 [30,] -0.550900785 -0.516183068 [31,] -0.630341567 -0.550900785 [32,] -0.830169319 -0.630341567 [33,] -0.921781581 -0.830169319 [34,] -0.735160441 -0.921781581 [35,] -0.399632614 -0.735160441 [36,] -0.064770442 -0.399632614 [37,] 0.224444370 -0.064770442 [38,] 0.330993798 0.224444370 [39,] 0.350952858 0.330993798 [40,] 0.329123975 0.350952858 [41,] 0.597717253 0.329123975 [42,] 0.952752557 0.597717253 [43,] 1.236028178 0.952752557 [44,] 1.198699543 1.236028178 [45,] 0.959760230 1.198699543 [46,] 0.429884858 0.959760230 [47,] -0.110861725 0.429884858 [48,] -0.706233418 -0.110861725 [49,] -1.323647595 -0.706233418 [50,] -1.482939388 -1.323647595 [51,] -1.109196771 -1.482939388 [52,] -0.680077164 -1.109196771 [53,] -0.312249562 -0.680077164 [54,] -0.162905088 -0.312249562 [55,] 0.005877884 -0.162905088 [56,] 0.208464390 0.005877884 [57,] 0.598400006 0.208464390 [58,] 1.281917056 0.598400006 [59,] 1.958418864 1.281917056 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.524324513 1.750944006 2 1.063573798 1.524324513 3 0.454837276 1.063573798 4 0.199811881 0.454837276 5 -0.036954569 0.199811881 6 -0.245491050 -0.036954569 7 -0.548926478 -0.245491050 8 -0.835261788 -0.548926478 9 -0.879219378 -0.835261788 10 -0.605280169 -0.879219378 11 -0.487221468 -0.605280169 12 -0.344626664 -0.487221468 13 -0.090101810 -0.344626664 14 0.205507427 -0.090101810 15 0.362560390 0.205507427 16 0.395501476 0.362560390 17 0.364505183 0.395501476 18 0.240175784 0.364505183 19 0.084063959 0.240175784 20 0.036271127 0.084063959 21 -0.099277830 0.036271127 22 -0.241404008 -0.099277830 23 -0.397132996 -0.241404008 24 -0.317337405 -0.397132996 25 -0.356887189 -0.317337405 26 -0.408787799 -0.356887189 27 -0.430965029 -0.408787799 28 -0.483586479 -0.430965029 29 -0.516183068 -0.483586479 30 -0.550900785 -0.516183068 31 -0.630341567 -0.550900785 32 -0.830169319 -0.630341567 33 -0.921781581 -0.830169319 34 -0.735160441 -0.921781581 35 -0.399632614 -0.735160441 36 -0.064770442 -0.399632614 37 0.224444370 -0.064770442 38 0.330993798 0.224444370 39 0.350952858 0.330993798 40 0.329123975 0.350952858 41 0.597717253 0.329123975 42 0.952752557 0.597717253 43 1.236028178 0.952752557 44 1.198699543 1.236028178 45 0.959760230 1.198699543 46 0.429884858 0.959760230 47 -0.110861725 0.429884858 48 -0.706233418 -0.110861725 49 -1.323647595 -0.706233418 50 -1.482939388 -1.323647595 51 -1.109196771 -1.482939388 52 -0.680077164 -1.109196771 53 -0.312249562 -0.680077164 54 -0.162905088 -0.312249562 55 0.005877884 -0.162905088 56 0.208464390 0.005877884 57 0.598400006 0.208464390 58 1.281917056 0.598400006 59 1.958418864 1.281917056 > 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/7e3q71258570010.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/828p81258570010.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/9cyj71258570010.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/10xef01258570010.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/1166y91258570010.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/12vq2y1258570010.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/13q8dn1258570010.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/14y2ag1258570010.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/15k9yx1258570010.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/16e23o1258570010.tab") + } > system("convert tmp/17b3e1258570010.ps tmp/17b3e1258570010.png") > system("convert tmp/2d1i11258570010.ps tmp/2d1i11258570010.png") > system("convert tmp/322ps1258570010.ps tmp/322ps1258570010.png") > system("convert tmp/4hz301258570010.ps tmp/4hz301258570010.png") > system("convert tmp/5k1cg1258570010.ps tmp/5k1cg1258570010.png") > system("convert tmp/6wirj1258570010.ps tmp/6wirj1258570010.png") > system("convert tmp/7e3q71258570010.ps tmp/7e3q71258570010.png") > system("convert tmp/828p81258570010.ps tmp/828p81258570010.png") > system("convert tmp/9cyj71258570010.ps tmp/9cyj71258570010.png") > system("convert tmp/10xef01258570010.ps tmp/10xef01258570010.png") > > > proc.time() user system elapsed 2.509 1.584 2.882