R version 2.7.0 (2008-04-22) 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(101,0,104,0,99,0,105,0,107,0,111,0,117,0,119,0,127,0,128,0,135,0,132,0,136,0,143,0,142,0,153,0,145,0,138,0,148,0,152,0,169,0,169,0,161,0,174,0,179,0,191,0,190,0,182,0,175,0,181,0,197,0,194,0,197,0,216,0,221,0,218,0,230,0,227,0,204,0,197,0,199,0,208,0,191,0,202,0,211,0,224,1,224,1,231,1,244,1,235,1,250,1,266,1,288,1,283,1,295,1,312,1,334,1,348,1,383,1,407,1),dim=c(2,60),dimnames=list(c('IGrSt','D'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('IGrSt','D'),1:60)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x IGrSt D 1 101 0 2 104 0 3 99 0 4 105 0 5 107 0 6 111 0 7 117 0 8 119 0 9 127 0 10 128 0 11 135 0 12 132 0 13 136 0 14 143 0 15 142 0 16 153 0 17 145 0 18 138 0 19 148 0 20 152 0 21 169 0 22 169 0 23 161 0 24 174 0 25 179 0 26 191 0 27 190 0 28 182 0 29 175 0 30 181 0 31 197 0 32 194 0 33 197 0 34 216 0 35 221 0 36 218 0 37 230 0 38 227 0 39 204 0 40 197 0 41 199 0 42 208 0 43 191 0 44 202 0 45 211 0 46 224 1 47 224 1 48 231 1 49 244 1 50 235 1 51 250 1 52 266 1 53 288 1 54 283 1 55 295 1 56 312 1 57 334 1 58 348 1 59 383 1 60 407 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) D 165.0 123.3 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -66.000 -37.250 1.867 32.000 118.733 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 165.000 6.609 24.965 < 2e-16 *** D 123.267 13.219 9.325 3.87e-13 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 44.34 on 58 degrees of freedom Multiple R-squared: 0.5999, Adjusted R-squared: 0.593 F-statistic: 86.96 on 1 and 58 DF, p-value: 3.87e-13 > 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.0009570972 0.0019141944 0.9990429 [2,] 0.0003673877 0.0007347754 0.9996326 [3,] 0.0003625048 0.0007250095 0.9996375 [4,] 0.0002394847 0.0004789694 0.9997605 [5,] 0.0003822141 0.0007644282 0.9996178 [6,] 0.0003583607 0.0007167214 0.9996416 [7,] 0.0005327899 0.0010655798 0.9994672 [8,] 0.0004156452 0.0008312904 0.9995844 [9,] 0.0003922971 0.0007845941 0.9996077 [10,] 0.0005458795 0.0010917589 0.9994541 [11,] 0.0005609993 0.0011219985 0.9994390 [12,] 0.0010469494 0.0020938987 0.9989531 [13,] 0.0009595829 0.0019191658 0.9990404 [14,] 0.0006829849 0.0013659698 0.9993170 [15,] 0.0006849719 0.0013699439 0.9993150 [16,] 0.0007772092 0.0015544185 0.9992228 [17,] 0.0019235605 0.0038471209 0.9980764 [18,] 0.0033483110 0.0066966220 0.9966517 [19,] 0.0036873239 0.0073746478 0.9963127 [20,] 0.0057875936 0.0115751871 0.9942124 [21,] 0.0090906535 0.0181813069 0.9909093 [22,] 0.0176903710 0.0353807420 0.9823096 [23,] 0.0259651106 0.0519302212 0.9740349 [24,] 0.0281315103 0.0562630205 0.9718685 [25,] 0.0265540457 0.0531080914 0.9734460 [26,] 0.0263589850 0.0527179700 0.9736410 [27,] 0.0325615442 0.0651230884 0.9674385 [28,] 0.0349649923 0.0699299846 0.9650350 [29,] 0.0370678067 0.0741356135 0.9629322 [30,] 0.0515705942 0.1031411884 0.9484294 [31,] 0.0692126479 0.1384252957 0.9307874 [32,] 0.0789017224 0.1578034448 0.9210983 [33,] 0.1022388764 0.2044777528 0.8977611 [34,] 0.1162150902 0.2324301804 0.8837849 [35,] 0.0972870277 0.1945740554 0.9027130 [36,] 0.0758103777 0.1516207554 0.9241896 [37,] 0.0580673270 0.1161346539 0.9419327 [38,] 0.0461155404 0.0922310808 0.9538845 [39,] 0.0322406975 0.0644813949 0.9677593 [40,] 0.0229263639 0.0458527278 0.9770736 [41,] 0.0167528015 0.0335056029 0.9832472 [42,] 0.0177963351 0.0355926703 0.9822037 [43,] 0.0217527524 0.0435055048 0.9782472 [44,] 0.0272795720 0.0545591439 0.9727204 [45,] 0.0310575621 0.0621151241 0.9689424 [46,] 0.0543309580 0.1086619161 0.9456690 [47,] 0.0860184470 0.1720368940 0.9139816 [48,] 0.1193373093 0.2386746185 0.8806627 [49,] 0.1258488129 0.2516976259 0.8741512 [50,] 0.1771716784 0.3543433567 0.8228283 [51,] 0.2510266536 0.5020533073 0.7489733 > postscript(file="/var/www/html/rcomp/tmp/1y25d1227523134.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/25gps1227523134.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/303ny1227523134.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/4c6dn1227523134.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/5hb8m1227523134.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 -64.0000000 -61.0000000 -66.0000000 -60.0000000 -58.0000000 -54.0000000 7 8 9 10 11 12 -48.0000000 -46.0000000 -38.0000000 -37.0000000 -30.0000000 -33.0000000 13 14 15 16 17 18 -29.0000000 -22.0000000 -23.0000000 -12.0000000 -20.0000000 -27.0000000 19 20 21 22 23 24 -17.0000000 -13.0000000 4.0000000 4.0000000 -4.0000000 9.0000000 25 26 27 28 29 30 14.0000000 26.0000000 25.0000000 17.0000000 10.0000000 16.0000000 31 32 33 34 35 36 32.0000000 29.0000000 32.0000000 51.0000000 56.0000000 53.0000000 37 38 39 40 41 42 65.0000000 62.0000000 39.0000000 32.0000000 34.0000000 43.0000000 43 44 45 46 47 48 26.0000000 37.0000000 46.0000000 -64.2666667 -64.2666667 -57.2666667 49 50 51 52 53 54 -44.2666667 -53.2666667 -38.2666667 -22.2666667 -0.2666667 -5.2666667 55 56 57 58 59 60 6.7333333 23.7333333 45.7333333 59.7333333 94.7333333 118.7333333 > postscript(file="/var/www/html/rcomp/tmp/62bxw1227523134.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 -64.0000000 NA 1 -61.0000000 -64.0000000 2 -66.0000000 -61.0000000 3 -60.0000000 -66.0000000 4 -58.0000000 -60.0000000 5 -54.0000000 -58.0000000 6 -48.0000000 -54.0000000 7 -46.0000000 -48.0000000 8 -38.0000000 -46.0000000 9 -37.0000000 -38.0000000 10 -30.0000000 -37.0000000 11 -33.0000000 -30.0000000 12 -29.0000000 -33.0000000 13 -22.0000000 -29.0000000 14 -23.0000000 -22.0000000 15 -12.0000000 -23.0000000 16 -20.0000000 -12.0000000 17 -27.0000000 -20.0000000 18 -17.0000000 -27.0000000 19 -13.0000000 -17.0000000 20 4.0000000 -13.0000000 21 4.0000000 4.0000000 22 -4.0000000 4.0000000 23 9.0000000 -4.0000000 24 14.0000000 9.0000000 25 26.0000000 14.0000000 26 25.0000000 26.0000000 27 17.0000000 25.0000000 28 10.0000000 17.0000000 29 16.0000000 10.0000000 30 32.0000000 16.0000000 31 29.0000000 32.0000000 32 32.0000000 29.0000000 33 51.0000000 32.0000000 34 56.0000000 51.0000000 35 53.0000000 56.0000000 36 65.0000000 53.0000000 37 62.0000000 65.0000000 38 39.0000000 62.0000000 39 32.0000000 39.0000000 40 34.0000000 32.0000000 41 43.0000000 34.0000000 42 26.0000000 43.0000000 43 37.0000000 26.0000000 44 46.0000000 37.0000000 45 -64.2666667 46.0000000 46 -64.2666667 -64.2666667 47 -57.2666667 -64.2666667 48 -44.2666667 -57.2666667 49 -53.2666667 -44.2666667 50 -38.2666667 -53.2666667 51 -22.2666667 -38.2666667 52 -0.2666667 -22.2666667 53 -5.2666667 -0.2666667 54 6.7333333 -5.2666667 55 23.7333333 6.7333333 56 45.7333333 23.7333333 57 59.7333333 45.7333333 58 94.7333333 59.7333333 59 118.7333333 94.7333333 60 NA 118.7333333 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -61.0000000 -64.0000000 [2,] -66.0000000 -61.0000000 [3,] -60.0000000 -66.0000000 [4,] -58.0000000 -60.0000000 [5,] -54.0000000 -58.0000000 [6,] -48.0000000 -54.0000000 [7,] -46.0000000 -48.0000000 [8,] -38.0000000 -46.0000000 [9,] -37.0000000 -38.0000000 [10,] -30.0000000 -37.0000000 [11,] -33.0000000 -30.0000000 [12,] -29.0000000 -33.0000000 [13,] -22.0000000 -29.0000000 [14,] -23.0000000 -22.0000000 [15,] -12.0000000 -23.0000000 [16,] -20.0000000 -12.0000000 [17,] -27.0000000 -20.0000000 [18,] -17.0000000 -27.0000000 [19,] -13.0000000 -17.0000000 [20,] 4.0000000 -13.0000000 [21,] 4.0000000 4.0000000 [22,] -4.0000000 4.0000000 [23,] 9.0000000 -4.0000000 [24,] 14.0000000 9.0000000 [25,] 26.0000000 14.0000000 [26,] 25.0000000 26.0000000 [27,] 17.0000000 25.0000000 [28,] 10.0000000 17.0000000 [29,] 16.0000000 10.0000000 [30,] 32.0000000 16.0000000 [31,] 29.0000000 32.0000000 [32,] 32.0000000 29.0000000 [33,] 51.0000000 32.0000000 [34,] 56.0000000 51.0000000 [35,] 53.0000000 56.0000000 [36,] 65.0000000 53.0000000 [37,] 62.0000000 65.0000000 [38,] 39.0000000 62.0000000 [39,] 32.0000000 39.0000000 [40,] 34.0000000 32.0000000 [41,] 43.0000000 34.0000000 [42,] 26.0000000 43.0000000 [43,] 37.0000000 26.0000000 [44,] 46.0000000 37.0000000 [45,] -64.2666667 46.0000000 [46,] -64.2666667 -64.2666667 [47,] -57.2666667 -64.2666667 [48,] -44.2666667 -57.2666667 [49,] -53.2666667 -44.2666667 [50,] -38.2666667 -53.2666667 [51,] -22.2666667 -38.2666667 [52,] -0.2666667 -22.2666667 [53,] -5.2666667 -0.2666667 [54,] 6.7333333 -5.2666667 [55,] 23.7333333 6.7333333 [56,] 45.7333333 23.7333333 [57,] 59.7333333 45.7333333 [58,] 94.7333333 59.7333333 [59,] 118.7333333 94.7333333 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -61.0000000 -64.0000000 2 -66.0000000 -61.0000000 3 -60.0000000 -66.0000000 4 -58.0000000 -60.0000000 5 -54.0000000 -58.0000000 6 -48.0000000 -54.0000000 7 -46.0000000 -48.0000000 8 -38.0000000 -46.0000000 9 -37.0000000 -38.0000000 10 -30.0000000 -37.0000000 11 -33.0000000 -30.0000000 12 -29.0000000 -33.0000000 13 -22.0000000 -29.0000000 14 -23.0000000 -22.0000000 15 -12.0000000 -23.0000000 16 -20.0000000 -12.0000000 17 -27.0000000 -20.0000000 18 -17.0000000 -27.0000000 19 -13.0000000 -17.0000000 20 4.0000000 -13.0000000 21 4.0000000 4.0000000 22 -4.0000000 4.0000000 23 9.0000000 -4.0000000 24 14.0000000 9.0000000 25 26.0000000 14.0000000 26 25.0000000 26.0000000 27 17.0000000 25.0000000 28 10.0000000 17.0000000 29 16.0000000 10.0000000 30 32.0000000 16.0000000 31 29.0000000 32.0000000 32 32.0000000 29.0000000 33 51.0000000 32.0000000 34 56.0000000 51.0000000 35 53.0000000 56.0000000 36 65.0000000 53.0000000 37 62.0000000 65.0000000 38 39.0000000 62.0000000 39 32.0000000 39.0000000 40 34.0000000 32.0000000 41 43.0000000 34.0000000 42 26.0000000 43.0000000 43 37.0000000 26.0000000 44 46.0000000 37.0000000 45 -64.2666667 46.0000000 46 -64.2666667 -64.2666667 47 -57.2666667 -64.2666667 48 -44.2666667 -57.2666667 49 -53.2666667 -44.2666667 50 -38.2666667 -53.2666667 51 -22.2666667 -38.2666667 52 -0.2666667 -22.2666667 53 -5.2666667 -0.2666667 54 6.7333333 -5.2666667 55 23.7333333 6.7333333 56 45.7333333 23.7333333 57 59.7333333 45.7333333 58 94.7333333 59.7333333 59 118.7333333 94.7333333 > 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/7gdpg1227523134.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/87yp01227523134.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/985er1227523134.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/10ij9g1227523134.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/114y321227523134.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/12u1671227523134.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/1389sx1227523134.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/143sjj1227523134.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/15tnvy1227523134.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/167yye1227523134.tab") + } > > system("convert tmp/1y25d1227523134.ps tmp/1y25d1227523134.png") > system("convert tmp/25gps1227523134.ps tmp/25gps1227523134.png") > system("convert tmp/303ny1227523134.ps tmp/303ny1227523134.png") > system("convert tmp/4c6dn1227523134.ps tmp/4c6dn1227523134.png") > system("convert tmp/5hb8m1227523134.ps tmp/5hb8m1227523134.png") > system("convert tmp/62bxw1227523134.ps tmp/62bxw1227523134.png") > system("convert tmp/7gdpg1227523134.ps tmp/7gdpg1227523134.png") > system("convert tmp/87yp01227523134.ps tmp/87yp01227523134.png") > system("convert tmp/985er1227523134.ps tmp/985er1227523134.png") > system("convert tmp/10ij9g1227523134.ps tmp/10ij9g1227523134.png") > > > proc.time() user system elapsed 4.993 2.702 5.376