R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(97.3,0,97.4,0,97.5,0,95.5,0,95.3,0,95.4,0,95.4,0,95.4,0,95.5,0,94.6,0,95.2,0,95.2,0,94.7,0,94.7,0,94.7,0,95.3,0,94.7,0,94.8,0,94.9,0,95.4,0,96,0,95.9,0,95.8,0,95.8,0,95.1,0,95.2,0,95.2,0,95.3,0,95.4,0,95.3,0,95.3,0,95,0,94.9,0,95.7,0,95.7,0,96.3,0,91.7,1,92.2,1,92.2,1,92.6,1,93,1,93,1,93,1,93.7,1,93.1,1,93.1,1,93.2,1,93.2,1,93,1,93.7,1,94,1,93.1,1,94.2,1,94.2,1,93.5,1,95,1,93.7,1,93.9,1,94.6,1,93.8,1,91.2,1,91.4,1,91.3,1,91.5,1,91.5,1,91.5,1,91.3,1,92.8,1),dim=c(2,68),dimnames=list(c('X','Y'),1:68)) > y <- array(NA,dim=c(2,68),dimnames=list(c('X','Y'),1:68)) > 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 = '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 X Y t 1 97.3 0 1 2 97.4 0 2 3 97.5 0 3 4 95.5 0 4 5 95.3 0 5 6 95.4 0 6 7 95.4 0 7 8 95.4 0 8 9 95.5 0 9 10 94.6 0 10 11 95.2 0 11 12 95.2 0 12 13 94.7 0 13 14 94.7 0 14 15 94.7 0 15 16 95.3 0 16 17 94.7 0 17 18 94.8 0 18 19 94.9 0 19 20 95.4 0 20 21 96.0 0 21 22 95.9 0 22 23 95.8 0 23 24 95.8 0 24 25 95.1 0 25 26 95.2 0 26 27 95.2 0 27 28 95.3 0 28 29 95.4 0 29 30 95.3 0 30 31 95.3 0 31 32 95.0 0 32 33 94.9 0 33 34 95.7 0 34 35 95.7 0 35 36 96.3 0 36 37 91.7 1 37 38 92.2 1 38 39 92.2 1 39 40 92.6 1 40 41 93.0 1 41 42 93.0 1 42 43 93.0 1 43 44 93.7 1 44 45 93.1 1 45 46 93.1 1 46 47 93.2 1 47 48 93.2 1 48 49 93.0 1 49 50 93.7 1 50 51 94.0 1 51 52 93.1 1 52 53 94.2 1 53 54 94.2 1 54 55 93.5 1 55 56 95.0 1 56 57 93.7 1 57 58 93.9 1 58 59 94.6 1 59 60 93.8 1 60 61 91.2 1 61 62 91.4 1 62 63 91.3 1 63 64 91.5 1 64 65 91.5 1 65 66 91.5 1 66 67 91.3 1 67 68 92.8 1 68 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Y t 95.83118 -1.88424 -0.01970 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.54502 -0.55731 -0.09944 0.54367 2.15646 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 95.8312 0.2477 386.950 < 2e-16 *** Y -1.8842 0.4247 -4.437 3.60e-05 *** t -0.0197 0.0108 -1.825 0.0727 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.8782 on 65 degrees of freedom Multiple R-squared: 0.6929, Adjusted R-squared: 0.6834 F-statistic: 73.32 on 2 and 65 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.466844142 0.93368828 0.5331559 [2,] 0.379092755 0.75818551 0.6209072 [3,] 0.328274411 0.65654882 0.6717256 [4,] 0.311585158 0.62317032 0.6884148 [5,] 0.212150455 0.42430091 0.7878495 [6,] 0.200618916 0.40123783 0.7993811 [7,] 0.186142891 0.37228578 0.8138571 [8,] 0.132648955 0.26529791 0.8673510 [9,] 0.098433613 0.19686723 0.9015664 [10,] 0.076920348 0.15384070 0.9230797 [11,] 0.107233377 0.21446675 0.8927666 [12,] 0.084263040 0.16852608 0.9157370 [13,] 0.071614416 0.14322883 0.9283856 [14,] 0.065651750 0.13130350 0.9343483 [15,] 0.089565900 0.17913180 0.9104341 [16,] 0.179739805 0.35947961 0.8202602 [17,] 0.224397237 0.44879447 0.7756028 [18,] 0.229943358 0.45988672 0.7700566 [19,] 0.220866580 0.44173316 0.7791334 [20,] 0.171429380 0.34285876 0.8285706 [21,] 0.131206373 0.26241275 0.8687936 [22,] 0.098420899 0.19684180 0.9015791 [23,] 0.073380254 0.14676051 0.9266197 [24,] 0.054726281 0.10945256 0.9452737 [25,] 0.038868969 0.07773794 0.9611310 [26,] 0.026995825 0.05399165 0.9730042 [27,] 0.018604044 0.03720809 0.9813960 [28,] 0.013685672 0.02737134 0.9863143 [29,] 0.011251074 0.02250215 0.9887489 [30,] 0.009009781 0.01801956 0.9909902 [31,] 0.010653182 0.02130636 0.9893468 [32,] 0.012171713 0.02434343 0.9878283 [33,] 0.012168145 0.02433629 0.9878319 [34,] 0.013439154 0.02687831 0.9865608 [35,] 0.013952692 0.02790538 0.9860473 [36,] 0.013996889 0.02799378 0.9860031 [37,] 0.013582913 0.02716583 0.9864171 [38,] 0.013380843 0.02676169 0.9866192 [39,] 0.014217638 0.02843528 0.9857824 [40,] 0.013121734 0.02624347 0.9868783 [41,] 0.012810689 0.02562138 0.9871893 [42,] 0.012798489 0.02559698 0.9872015 [43,] 0.013811414 0.02762283 0.9861886 [44,] 0.020515982 0.04103196 0.9794840 [45,] 0.021918243 0.04383649 0.9780818 [46,] 0.021643636 0.04328727 0.9783564 [47,] 0.034341114 0.06868223 0.9656589 [48,] 0.032577291 0.06515458 0.9674227 [49,] 0.027196348 0.05439270 0.9728037 [50,] 0.022785131 0.04557026 0.9772149 [51,] 0.039732513 0.07946503 0.9602675 [52,] 0.023706476 0.04741295 0.9762935 [53,] 0.016710240 0.03342048 0.9832898 [54,] 0.108166269 0.21633254 0.8918337 [55,] 0.850379653 0.29924069 0.1496203 [56,] 0.787980867 0.42403827 0.2120191 [57,] 0.698590232 0.60281954 0.3014098 > postscript(file="/var/www/html/rcomp/tmp/1rcst1227789504.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/2b6qa1227789504.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/3hnr51227789504.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/4ob7m1227789504.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/51axq1227789504.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 = 68 Frequency = 1 1 2 3 4 5 6 1.48852009 1.60822370 1.72792731 -0.25236907 -0.43266546 -0.31296184 7 8 9 10 11 12 -0.29325823 -0.27355461 -0.15385100 -1.03414739 -0.41444377 -0.39474016 13 14 15 16 17 18 -0.87503654 -0.85533293 -0.83562932 -0.21592570 -0.79622209 -0.67651847 19 20 21 22 23 24 -0.55681486 -0.03711125 0.58259237 0.50229598 0.42199960 0.44170321 25 26 27 28 29 30 -0.23859318 -0.11888956 -0.09918595 0.02051767 0.14022128 0.05992490 31 32 33 34 35 36 0.07962851 -0.20066788 -0.28096426 0.53873935 0.55844297 1.17814658 37 38 39 40 41 42 -1.51790602 -0.99820240 -0.97849879 -0.55879518 -0.13909156 -0.11938795 43 44 45 46 47 48 -0.09968433 0.62001928 0.03972289 0.05942651 0.17913012 0.19883374 49 50 51 52 53 54 0.01853735 0.73824096 1.05794458 0.17764819 1.29735181 1.31705542 55 56 57 58 59 60 0.63675904 2.15646265 0.87616626 1.09586988 1.81557349 1.03527711 61 62 63 64 65 66 -1.54501928 -1.32531567 -1.40561205 -1.18590844 -1.16620482 -1.14650121 67 68 -1.32679760 0.19290602 > postscript(file="/var/www/html/rcomp/tmp/6p5bf1227789504.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 = 68 Frequency = 1 lag(myerror, k = 1) myerror 0 1.48852009 NA 1 1.60822370 1.48852009 2 1.72792731 1.60822370 3 -0.25236907 1.72792731 4 -0.43266546 -0.25236907 5 -0.31296184 -0.43266546 6 -0.29325823 -0.31296184 7 -0.27355461 -0.29325823 8 -0.15385100 -0.27355461 9 -1.03414739 -0.15385100 10 -0.41444377 -1.03414739 11 -0.39474016 -0.41444377 12 -0.87503654 -0.39474016 13 -0.85533293 -0.87503654 14 -0.83562932 -0.85533293 15 -0.21592570 -0.83562932 16 -0.79622209 -0.21592570 17 -0.67651847 -0.79622209 18 -0.55681486 -0.67651847 19 -0.03711125 -0.55681486 20 0.58259237 -0.03711125 21 0.50229598 0.58259237 22 0.42199960 0.50229598 23 0.44170321 0.42199960 24 -0.23859318 0.44170321 25 -0.11888956 -0.23859318 26 -0.09918595 -0.11888956 27 0.02051767 -0.09918595 28 0.14022128 0.02051767 29 0.05992490 0.14022128 30 0.07962851 0.05992490 31 -0.20066788 0.07962851 32 -0.28096426 -0.20066788 33 0.53873935 -0.28096426 34 0.55844297 0.53873935 35 1.17814658 0.55844297 36 -1.51790602 1.17814658 37 -0.99820240 -1.51790602 38 -0.97849879 -0.99820240 39 -0.55879518 -0.97849879 40 -0.13909156 -0.55879518 41 -0.11938795 -0.13909156 42 -0.09968433 -0.11938795 43 0.62001928 -0.09968433 44 0.03972289 0.62001928 45 0.05942651 0.03972289 46 0.17913012 0.05942651 47 0.19883374 0.17913012 48 0.01853735 0.19883374 49 0.73824096 0.01853735 50 1.05794458 0.73824096 51 0.17764819 1.05794458 52 1.29735181 0.17764819 53 1.31705542 1.29735181 54 0.63675904 1.31705542 55 2.15646265 0.63675904 56 0.87616626 2.15646265 57 1.09586988 0.87616626 58 1.81557349 1.09586988 59 1.03527711 1.81557349 60 -1.54501928 1.03527711 61 -1.32531567 -1.54501928 62 -1.40561205 -1.32531567 63 -1.18590844 -1.40561205 64 -1.16620482 -1.18590844 65 -1.14650121 -1.16620482 66 -1.32679760 -1.14650121 67 0.19290602 -1.32679760 68 NA 0.19290602 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.60822370 1.48852009 [2,] 1.72792731 1.60822370 [3,] -0.25236907 1.72792731 [4,] -0.43266546 -0.25236907 [5,] -0.31296184 -0.43266546 [6,] -0.29325823 -0.31296184 [7,] -0.27355461 -0.29325823 [8,] -0.15385100 -0.27355461 [9,] -1.03414739 -0.15385100 [10,] -0.41444377 -1.03414739 [11,] -0.39474016 -0.41444377 [12,] -0.87503654 -0.39474016 [13,] -0.85533293 -0.87503654 [14,] -0.83562932 -0.85533293 [15,] -0.21592570 -0.83562932 [16,] -0.79622209 -0.21592570 [17,] -0.67651847 -0.79622209 [18,] -0.55681486 -0.67651847 [19,] -0.03711125 -0.55681486 [20,] 0.58259237 -0.03711125 [21,] 0.50229598 0.58259237 [22,] 0.42199960 0.50229598 [23,] 0.44170321 0.42199960 [24,] -0.23859318 0.44170321 [25,] -0.11888956 -0.23859318 [26,] -0.09918595 -0.11888956 [27,] 0.02051767 -0.09918595 [28,] 0.14022128 0.02051767 [29,] 0.05992490 0.14022128 [30,] 0.07962851 0.05992490 [31,] -0.20066788 0.07962851 [32,] -0.28096426 -0.20066788 [33,] 0.53873935 -0.28096426 [34,] 0.55844297 0.53873935 [35,] 1.17814658 0.55844297 [36,] -1.51790602 1.17814658 [37,] -0.99820240 -1.51790602 [38,] -0.97849879 -0.99820240 [39,] -0.55879518 -0.97849879 [40,] -0.13909156 -0.55879518 [41,] -0.11938795 -0.13909156 [42,] -0.09968433 -0.11938795 [43,] 0.62001928 -0.09968433 [44,] 0.03972289 0.62001928 [45,] 0.05942651 0.03972289 [46,] 0.17913012 0.05942651 [47,] 0.19883374 0.17913012 [48,] 0.01853735 0.19883374 [49,] 0.73824096 0.01853735 [50,] 1.05794458 0.73824096 [51,] 0.17764819 1.05794458 [52,] 1.29735181 0.17764819 [53,] 1.31705542 1.29735181 [54,] 0.63675904 1.31705542 [55,] 2.15646265 0.63675904 [56,] 0.87616626 2.15646265 [57,] 1.09586988 0.87616626 [58,] 1.81557349 1.09586988 [59,] 1.03527711 1.81557349 [60,] -1.54501928 1.03527711 [61,] -1.32531567 -1.54501928 [62,] -1.40561205 -1.32531567 [63,] -1.18590844 -1.40561205 [64,] -1.16620482 -1.18590844 [65,] -1.14650121 -1.16620482 [66,] -1.32679760 -1.14650121 [67,] 0.19290602 -1.32679760 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.60822370 1.48852009 2 1.72792731 1.60822370 3 -0.25236907 1.72792731 4 -0.43266546 -0.25236907 5 -0.31296184 -0.43266546 6 -0.29325823 -0.31296184 7 -0.27355461 -0.29325823 8 -0.15385100 -0.27355461 9 -1.03414739 -0.15385100 10 -0.41444377 -1.03414739 11 -0.39474016 -0.41444377 12 -0.87503654 -0.39474016 13 -0.85533293 -0.87503654 14 -0.83562932 -0.85533293 15 -0.21592570 -0.83562932 16 -0.79622209 -0.21592570 17 -0.67651847 -0.79622209 18 -0.55681486 -0.67651847 19 -0.03711125 -0.55681486 20 0.58259237 -0.03711125 21 0.50229598 0.58259237 22 0.42199960 0.50229598 23 0.44170321 0.42199960 24 -0.23859318 0.44170321 25 -0.11888956 -0.23859318 26 -0.09918595 -0.11888956 27 0.02051767 -0.09918595 28 0.14022128 0.02051767 29 0.05992490 0.14022128 30 0.07962851 0.05992490 31 -0.20066788 0.07962851 32 -0.28096426 -0.20066788 33 0.53873935 -0.28096426 34 0.55844297 0.53873935 35 1.17814658 0.55844297 36 -1.51790602 1.17814658 37 -0.99820240 -1.51790602 38 -0.97849879 -0.99820240 39 -0.55879518 -0.97849879 40 -0.13909156 -0.55879518 41 -0.11938795 -0.13909156 42 -0.09968433 -0.11938795 43 0.62001928 -0.09968433 44 0.03972289 0.62001928 45 0.05942651 0.03972289 46 0.17913012 0.05942651 47 0.19883374 0.17913012 48 0.01853735 0.19883374 49 0.73824096 0.01853735 50 1.05794458 0.73824096 51 0.17764819 1.05794458 52 1.29735181 0.17764819 53 1.31705542 1.29735181 54 0.63675904 1.31705542 55 2.15646265 0.63675904 56 0.87616626 2.15646265 57 1.09586988 0.87616626 58 1.81557349 1.09586988 59 1.03527711 1.81557349 60 -1.54501928 1.03527711 61 -1.32531567 -1.54501928 62 -1.40561205 -1.32531567 63 -1.18590844 -1.40561205 64 -1.16620482 -1.18590844 65 -1.14650121 -1.16620482 66 -1.32679760 -1.14650121 67 0.19290602 -1.32679760 > 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/7bpay1227789504.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/8zf8o1227789504.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/913yy1227789504.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/100bkq1227789504.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/119hqn1227789504.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/12zxgv1227789504.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/130sm21227789505.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/149z4e1227789505.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/15bort1227789505.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/160lhc1227789505.tab") + } > system("convert tmp/1rcst1227789504.ps tmp/1rcst1227789504.png") > system("convert tmp/2b6qa1227789504.ps tmp/2b6qa1227789504.png") > system("convert tmp/3hnr51227789504.ps tmp/3hnr51227789504.png") > system("convert tmp/4ob7m1227789504.ps tmp/4ob7m1227789504.png") > system("convert tmp/51axq1227789504.ps tmp/51axq1227789504.png") > system("convert tmp/6p5bf1227789504.ps tmp/6p5bf1227789504.png") > system("convert tmp/7bpay1227789504.ps tmp/7bpay1227789504.png") > system("convert tmp/8zf8o1227789504.ps tmp/8zf8o1227789504.png") > system("convert tmp/913yy1227789504.ps tmp/913yy1227789504.png") > system("convert tmp/100bkq1227789504.ps tmp/100bkq1227789504.png") > > > proc.time() user system elapsed 2.793 1.744 3.390