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(2360,2,2214,2,2825,2,2355,2,2333,2,3016,2,2155,2,2172,2,2150,2,2533,2,2058,2,2160,2,2260,2,2498,2,2695,2,2799,2,2947,2,2930,2,2318,2,2540,2,2570,2,2669,2,2450,2,2842,2,3440,2,2678,2,2981,2,2260,2.21,2844,2.25,2546,2.25,2456,2.45,2295,2.5,2379,2.5,2479,2.64,2057,2.75,2280,2.93,2351,3,2276,3.17,2548,3.25,2311,3.39,2201,3.5,2725,3.5,2408,3.65,2139,3.75,1898,3.75,2537,3.9,2069,4,2063,4,2524,4,2437,4,2189,4,2793,4,2074,4,2622,4,2278,4,2144,4,2427,4,2139,4,1828,4.18,2072,4.25,1800,4.25),dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Y X 1 2360 2.00 2 2214 2.00 3 2825 2.00 4 2355 2.00 5 2333 2.00 6 3016 2.00 7 2155 2.00 8 2172 2.00 9 2150 2.00 10 2533 2.00 11 2058 2.00 12 2160 2.00 13 2260 2.00 14 2498 2.00 15 2695 2.00 16 2799 2.00 17 2947 2.00 18 2930 2.00 19 2318 2.00 20 2540 2.00 21 2570 2.00 22 2669 2.00 23 2450 2.00 24 2842 2.00 25 3440 2.00 26 2678 2.00 27 2981 2.00 28 2260 2.21 29 2844 2.25 30 2546 2.25 31 2456 2.45 32 2295 2.50 33 2379 2.50 34 2479 2.64 35 2057 2.75 36 2280 2.93 37 2351 3.00 38 2276 3.17 39 2548 3.25 40 2311 3.39 41 2201 3.50 42 2725 3.50 43 2408 3.65 44 2139 3.75 45 1898 3.75 46 2537 3.90 47 2069 4.00 48 2063 4.00 49 2524 4.00 50 2437 4.00 51 2189 4.00 52 2793 4.00 53 2074 4.00 54 2622 4.00 55 2278 4.00 56 2144 4.00 57 2427 4.00 58 2139 4.00 59 1828 4.18 60 2072 4.25 61 1800 4.25 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 2861.3 -157.8 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -487.74 -185.74 -41.15 199.51 894.26 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2861.33 123.83 23.106 < 2e-16 *** X -157.80 41.91 -3.765 0.000386 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 288.5 on 59 degrees of freedom Multiple R-squared: 0.1937, Adjusted R-squared: 0.18 F-statistic: 14.17 on 1 and 59 DF, p-value: 0.0003863 > 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.5372874 0.92542520 0.46271260 [2,] 0.8048136 0.39037281 0.19518641 [3,] 0.8119234 0.37615316 0.18807658 [4,] 0.7972935 0.40541308 0.20270654 [5,] 0.7883262 0.42334757 0.21167378 [6,] 0.7141169 0.57176629 0.28588315 [7,] 0.7695895 0.46082105 0.23041053 [8,] 0.7667418 0.46651631 0.23325816 [9,] 0.7311538 0.53769234 0.26884617 [10,] 0.6730808 0.65383850 0.32691925 [11,] 0.6715439 0.65691220 0.32845610 [12,] 0.7098760 0.58024809 0.29012404 [13,] 0.8081701 0.38365981 0.19182991 [14,] 0.8575721 0.28485571 0.14242786 [15,] 0.8393214 0.32135721 0.16067860 [16,] 0.7915176 0.41696490 0.20848245 [17,] 0.7376270 0.52474597 0.26237299 [18,] 0.6882407 0.62351864 0.31175932 [19,] 0.6366700 0.72666001 0.36333001 [20,] 0.6362866 0.72742688 0.36371344 [21,] 0.9655330 0.06893408 0.03446704 [22,] 0.9513231 0.09735372 0.04867686 [23,] 0.9706035 0.05879308 0.02939654 [24,] 0.9622549 0.07549020 0.03774510 [25,] 0.9728526 0.05429473 0.02714737 [26,] 0.9600559 0.07988820 0.03994410 [27,] 0.9417681 0.11646372 0.05823186 [28,] 0.9216773 0.15664547 0.07832274 [29,] 0.8900860 0.21982790 0.10991395 [30,] 0.8533846 0.29323078 0.14661539 [31,] 0.8691398 0.26172044 0.13086022 [32,] 0.8384353 0.32312934 0.16156467 [33,] 0.7998667 0.40026654 0.20013327 [34,] 0.7715822 0.45683564 0.22841782 [35,] 0.7300654 0.53986916 0.26993458 [36,] 0.6796890 0.64062193 0.32031097 [37,] 0.6705226 0.65895480 0.32947740 [38,] 0.6688131 0.66237376 0.33118688 [39,] 0.5909803 0.81803936 0.40901968 [40,] 0.5573669 0.88526610 0.44263305 [41,] 0.8547090 0.29058192 0.14529096 [42,] 0.8110017 0.37799652 0.18899826 [43,] 0.7972465 0.40550700 0.20275350 [44,] 0.7977650 0.40446998 0.20223499 [45,] 0.7641555 0.47168904 0.23584452 [46,] 0.6922705 0.61545892 0.30772946 [47,] 0.6156247 0.76875064 0.38437532 [48,] 0.8466578 0.30668446 0.15334223 [49,] 0.8274435 0.34511292 0.17255646 [50,] 0.9200105 0.15997890 0.07998945 [51,] 0.8397518 0.32049637 0.16024819 [52,] 0.7234957 0.55300856 0.27650428 > postscript(file="/var/www/html/rcomp/tmp/1akuu1258652704.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/2usio1258652704.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/3zci71258652704.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/4xosu1258652704.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/56mwo1258652704.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 61 Frequency = 1 1 2 3 4 5 6 -185.736686 -331.736686 279.263314 -190.736686 -212.736686 470.263314 7 8 9 10 11 12 -390.736686 -373.736686 -395.736686 -12.736686 -487.736686 -385.736686 13 14 15 16 17 18 -285.736686 -47.736686 149.263314 253.263314 401.263314 384.263314 19 20 21 22 23 24 -227.736686 -5.736686 24.263314 123.263314 -95.736686 296.263314 25 26 27 28 29 30 894.263314 132.263314 435.263314 -252.599602 337.712224 39.712224 31 32 33 34 35 36 -18.728649 -171.838867 -87.838867 34.252523 -370.389957 -118.986742 37 38 39 40 41 42 -36.941047 -85.115789 199.507862 -15.400748 -108.043228 415.956772 43 44 45 46 47 48 122.626118 -130.594318 -371.594318 291.075028 -161.145409 -167.145409 49 50 51 52 53 54 293.854591 206.854591 -41.145409 562.854591 -156.145409 391.854591 55 56 57 58 59 60 47.854591 -86.145409 196.854591 -91.145409 -373.742194 -118.696499 61 -390.696499 > postscript(file="/var/www/html/rcomp/tmp/606n41258652704.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 -185.736686 NA 1 -331.736686 -185.736686 2 279.263314 -331.736686 3 -190.736686 279.263314 4 -212.736686 -190.736686 5 470.263314 -212.736686 6 -390.736686 470.263314 7 -373.736686 -390.736686 8 -395.736686 -373.736686 9 -12.736686 -395.736686 10 -487.736686 -12.736686 11 -385.736686 -487.736686 12 -285.736686 -385.736686 13 -47.736686 -285.736686 14 149.263314 -47.736686 15 253.263314 149.263314 16 401.263314 253.263314 17 384.263314 401.263314 18 -227.736686 384.263314 19 -5.736686 -227.736686 20 24.263314 -5.736686 21 123.263314 24.263314 22 -95.736686 123.263314 23 296.263314 -95.736686 24 894.263314 296.263314 25 132.263314 894.263314 26 435.263314 132.263314 27 -252.599602 435.263314 28 337.712224 -252.599602 29 39.712224 337.712224 30 -18.728649 39.712224 31 -171.838867 -18.728649 32 -87.838867 -171.838867 33 34.252523 -87.838867 34 -370.389957 34.252523 35 -118.986742 -370.389957 36 -36.941047 -118.986742 37 -85.115789 -36.941047 38 199.507862 -85.115789 39 -15.400748 199.507862 40 -108.043228 -15.400748 41 415.956772 -108.043228 42 122.626118 415.956772 43 -130.594318 122.626118 44 -371.594318 -130.594318 45 291.075028 -371.594318 46 -161.145409 291.075028 47 -167.145409 -161.145409 48 293.854591 -167.145409 49 206.854591 293.854591 50 -41.145409 206.854591 51 562.854591 -41.145409 52 -156.145409 562.854591 53 391.854591 -156.145409 54 47.854591 391.854591 55 -86.145409 47.854591 56 196.854591 -86.145409 57 -91.145409 196.854591 58 -373.742194 -91.145409 59 -118.696499 -373.742194 60 -390.696499 -118.696499 61 NA -390.696499 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -331.736686 -185.736686 [2,] 279.263314 -331.736686 [3,] -190.736686 279.263314 [4,] -212.736686 -190.736686 [5,] 470.263314 -212.736686 [6,] -390.736686 470.263314 [7,] -373.736686 -390.736686 [8,] -395.736686 -373.736686 [9,] -12.736686 -395.736686 [10,] -487.736686 -12.736686 [11,] -385.736686 -487.736686 [12,] -285.736686 -385.736686 [13,] -47.736686 -285.736686 [14,] 149.263314 -47.736686 [15,] 253.263314 149.263314 [16,] 401.263314 253.263314 [17,] 384.263314 401.263314 [18,] -227.736686 384.263314 [19,] -5.736686 -227.736686 [20,] 24.263314 -5.736686 [21,] 123.263314 24.263314 [22,] -95.736686 123.263314 [23,] 296.263314 -95.736686 [24,] 894.263314 296.263314 [25,] 132.263314 894.263314 [26,] 435.263314 132.263314 [27,] -252.599602 435.263314 [28,] 337.712224 -252.599602 [29,] 39.712224 337.712224 [30,] -18.728649 39.712224 [31,] -171.838867 -18.728649 [32,] -87.838867 -171.838867 [33,] 34.252523 -87.838867 [34,] -370.389957 34.252523 [35,] -118.986742 -370.389957 [36,] -36.941047 -118.986742 [37,] -85.115789 -36.941047 [38,] 199.507862 -85.115789 [39,] -15.400748 199.507862 [40,] -108.043228 -15.400748 [41,] 415.956772 -108.043228 [42,] 122.626118 415.956772 [43,] -130.594318 122.626118 [44,] -371.594318 -130.594318 [45,] 291.075028 -371.594318 [46,] -161.145409 291.075028 [47,] -167.145409 -161.145409 [48,] 293.854591 -167.145409 [49,] 206.854591 293.854591 [50,] -41.145409 206.854591 [51,] 562.854591 -41.145409 [52,] -156.145409 562.854591 [53,] 391.854591 -156.145409 [54,] 47.854591 391.854591 [55,] -86.145409 47.854591 [56,] 196.854591 -86.145409 [57,] -91.145409 196.854591 [58,] -373.742194 -91.145409 [59,] -118.696499 -373.742194 [60,] -390.696499 -118.696499 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -331.736686 -185.736686 2 279.263314 -331.736686 3 -190.736686 279.263314 4 -212.736686 -190.736686 5 470.263314 -212.736686 6 -390.736686 470.263314 7 -373.736686 -390.736686 8 -395.736686 -373.736686 9 -12.736686 -395.736686 10 -487.736686 -12.736686 11 -385.736686 -487.736686 12 -285.736686 -385.736686 13 -47.736686 -285.736686 14 149.263314 -47.736686 15 253.263314 149.263314 16 401.263314 253.263314 17 384.263314 401.263314 18 -227.736686 384.263314 19 -5.736686 -227.736686 20 24.263314 -5.736686 21 123.263314 24.263314 22 -95.736686 123.263314 23 296.263314 -95.736686 24 894.263314 296.263314 25 132.263314 894.263314 26 435.263314 132.263314 27 -252.599602 435.263314 28 337.712224 -252.599602 29 39.712224 337.712224 30 -18.728649 39.712224 31 -171.838867 -18.728649 32 -87.838867 -171.838867 33 34.252523 -87.838867 34 -370.389957 34.252523 35 -118.986742 -370.389957 36 -36.941047 -118.986742 37 -85.115789 -36.941047 38 199.507862 -85.115789 39 -15.400748 199.507862 40 -108.043228 -15.400748 41 415.956772 -108.043228 42 122.626118 415.956772 43 -130.594318 122.626118 44 -371.594318 -130.594318 45 291.075028 -371.594318 46 -161.145409 291.075028 47 -167.145409 -161.145409 48 293.854591 -167.145409 49 206.854591 293.854591 50 -41.145409 206.854591 51 562.854591 -41.145409 52 -156.145409 562.854591 53 391.854591 -156.145409 54 47.854591 391.854591 55 -86.145409 47.854591 56 196.854591 -86.145409 57 -91.145409 196.854591 58 -373.742194 -91.145409 59 -118.696499 -373.742194 60 -390.696499 -118.696499 > 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/7eigt1258652704.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/8pcdo1258652704.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/9vy9e1258652704.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/10kot81258652704.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/118ipb1258652704.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/126ye91258652704.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/13qso41258652704.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/14seop1258652704.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/15rv2x1258652704.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/16vgbq1258652704.tab") + } > system("convert tmp/1akuu1258652704.ps tmp/1akuu1258652704.png") > system("convert tmp/2usio1258652704.ps tmp/2usio1258652704.png") > system("convert tmp/3zci71258652704.ps tmp/3zci71258652704.png") > system("convert tmp/4xosu1258652704.ps tmp/4xosu1258652704.png") > system("convert tmp/56mwo1258652704.ps tmp/56mwo1258652704.png") > system("convert tmp/606n41258652704.ps tmp/606n41258652704.png") > system("convert tmp/7eigt1258652704.ps tmp/7eigt1258652704.png") > system("convert tmp/8pcdo1258652704.ps tmp/8pcdo1258652704.png") > system("convert tmp/9vy9e1258652704.ps tmp/9vy9e1258652704.png") > system("convert tmp/10kot81258652704.ps tmp/10kot81258652704.png") > > > proc.time() user system elapsed 2.556 1.616 5.769