R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(493,514,522,490,484,506,501,462,465,454,464,427,460,473,465,422,415,413,420,363,376,380,384,346,389,407,393,346,348,353,364,305,307,312,312,286,324,336,327,302,299,311,315,264,278,278,287,279,324,354,354,360,363,385,412,370,389,395,417,404),dim=c(1,60),dimnames=list(c('WLH'),1:60)) > y <- array(NA,dim=c(1,60),dimnames=list(c('WLH'),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 = 'Include Monthly Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x WLH M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 493 1 0 0 0 0 0 0 0 0 0 0 2 514 0 1 0 0 0 0 0 0 0 0 0 3 522 0 0 1 0 0 0 0 0 0 0 0 4 490 0 0 0 1 0 0 0 0 0 0 0 5 484 0 0 0 0 1 0 0 0 0 0 0 6 506 0 0 0 0 0 1 0 0 0 0 0 7 501 0 0 0 0 0 0 1 0 0 0 0 8 462 0 0 0 0 0 0 0 1 0 0 0 9 465 0 0 0 0 0 0 0 0 1 0 0 10 454 0 0 0 0 0 0 0 0 0 1 0 11 464 0 0 0 0 0 0 0 0 0 0 1 12 427 0 0 0 0 0 0 0 0 0 0 0 13 460 1 0 0 0 0 0 0 0 0 0 0 14 473 0 1 0 0 0 0 0 0 0 0 0 15 465 0 0 1 0 0 0 0 0 0 0 0 16 422 0 0 0 1 0 0 0 0 0 0 0 17 415 0 0 0 0 1 0 0 0 0 0 0 18 413 0 0 0 0 0 1 0 0 0 0 0 19 420 0 0 0 0 0 0 1 0 0 0 0 20 363 0 0 0 0 0 0 0 1 0 0 0 21 376 0 0 0 0 0 0 0 0 1 0 0 22 380 0 0 0 0 0 0 0 0 0 1 0 23 384 0 0 0 0 0 0 0 0 0 0 1 24 346 0 0 0 0 0 0 0 0 0 0 0 25 389 1 0 0 0 0 0 0 0 0 0 0 26 407 0 1 0 0 0 0 0 0 0 0 0 27 393 0 0 1 0 0 0 0 0 0 0 0 28 346 0 0 0 1 0 0 0 0 0 0 0 29 348 0 0 0 0 1 0 0 0 0 0 0 30 353 0 0 0 0 0 1 0 0 0 0 0 31 364 0 0 0 0 0 0 1 0 0 0 0 32 305 0 0 0 0 0 0 0 1 0 0 0 33 307 0 0 0 0 0 0 0 0 1 0 0 34 312 0 0 0 0 0 0 0 0 0 1 0 35 312 0 0 0 0 0 0 0 0 0 0 1 36 286 0 0 0 0 0 0 0 0 0 0 0 37 324 1 0 0 0 0 0 0 0 0 0 0 38 336 0 1 0 0 0 0 0 0 0 0 0 39 327 0 0 1 0 0 0 0 0 0 0 0 40 302 0 0 0 1 0 0 0 0 0 0 0 41 299 0 0 0 0 1 0 0 0 0 0 0 42 311 0 0 0 0 0 1 0 0 0 0 0 43 315 0 0 0 0 0 0 1 0 0 0 0 44 264 0 0 0 0 0 0 0 1 0 0 0 45 278 0 0 0 0 0 0 0 0 1 0 0 46 278 0 0 0 0 0 0 0 0 0 1 0 47 287 0 0 0 0 0 0 0 0 0 0 1 48 279 0 0 0 0 0 0 0 0 0 0 0 49 324 1 0 0 0 0 0 0 0 0 0 0 50 354 0 1 0 0 0 0 0 0 0 0 0 51 354 0 0 1 0 0 0 0 0 0 0 0 52 360 0 0 0 1 0 0 0 0 0 0 0 53 363 0 0 0 0 1 0 0 0 0 0 0 54 385 0 0 0 0 0 1 0 0 0 0 0 55 412 0 0 0 0 0 0 1 0 0 0 0 56 370 0 0 0 0 0 0 0 1 0 0 0 57 389 0 0 0 0 0 0 0 0 1 0 0 58 395 0 0 0 0 0 0 0 0 0 1 0 59 417 0 0 0 0 0 0 0 0 0 0 1 60 404 0 0 0 0 0 0 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) M1 M2 M3 M4 M5 348.4 49.6 68.4 63.8 35.6 33.4 M6 M7 M8 M9 M10 M11 45.2 54.0 4.4 14.6 15.4 24.4 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -88.8 -61.2 -5.5 53.5 112.4 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 348.40 32.79 10.626 3.34e-14 *** M1 49.60 46.37 1.070 0.290 M2 68.40 46.37 1.475 0.147 M3 63.80 46.37 1.376 0.175 M4 35.60 46.37 0.768 0.446 M5 33.40 46.37 0.720 0.475 M6 45.20 46.37 0.975 0.335 M7 54.00 46.37 1.165 0.250 M8 4.40 46.37 0.095 0.925 M9 14.60 46.37 0.315 0.754 M10 15.40 46.37 0.332 0.741 M11 24.40 46.37 0.526 0.601 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 73.32 on 48 degrees of freedom Multiple R-squared: 0.09931, Adjusted R-squared: -0.1071 F-statistic: 0.4811 on 11 and 48 DF, p-value: 0.9059 > 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.2502016 0.5004031 0.7497984 [2,] 0.3066715 0.6133429 0.6933285 [3,] 0.3498492 0.6996985 0.6501508 [4,] 0.4778943 0.9557886 0.5221057 [5,] 0.5223065 0.9553870 0.4776935 [6,] 0.6089146 0.7821708 0.3910854 [7,] 0.6452822 0.7094356 0.3547178 [8,] 0.6417948 0.7164104 0.3582052 [9,] 0.6430922 0.7138156 0.3569078 [10,] 0.6282682 0.7434636 0.3717318 [11,] 0.6782976 0.6434048 0.3217024 [12,] 0.7134282 0.5731437 0.2865718 [13,] 0.7555253 0.4889495 0.2444747 [14,] 0.7784347 0.4431307 0.2215653 [15,] 0.7781388 0.4437225 0.2218612 [16,] 0.7744342 0.4511317 0.2255658 [17,] 0.7519768 0.4960464 0.2480232 [18,] 0.7363308 0.5273383 0.2636692 [19,] 0.7247085 0.5505830 0.2752915 [20,] 0.6960208 0.6079583 0.3039792 [21,] 0.6764119 0.6471763 0.3235881 [22,] 0.6545446 0.6909107 0.3454554 [23,] 0.6214892 0.7570217 0.3785108 [24,] 0.5851546 0.8296909 0.4148454 [25,] 0.5443287 0.9113427 0.4556713 [26,] 0.4996470 0.9992940 0.5003530 [27,] 0.4509469 0.9018938 0.5490531 [28,] 0.4016554 0.8033108 0.5983446 [29,] 0.3742230 0.7484461 0.6257770 [30,] 0.3520875 0.7041750 0.6479125 [31,] 0.3258408 0.6516817 0.6741592 > postscript(file="/var/www/rcomp/tmp/1ju7t1293308476.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/2ju7t1293308476.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/3cmow1293308476.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/44d5z1293308476.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/54d5z1293308476.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 60 Frequency = 1 1 2 3 4 5 6 7 8 9 10 11 12 13 95.0 97.2 109.8 106.0 102.2 112.4 98.6 109.2 102.0 90.2 91.2 78.6 62.0 14 15 16 17 18 19 20 21 22 23 24 25 26 56.2 52.8 38.0 33.2 19.4 17.6 10.2 13.0 16.2 11.2 -2.4 -9.0 -9.8 27 28 29 30 31 32 33 34 35 36 37 38 39 -19.2 -38.0 -33.8 -40.6 -38.4 -47.8 -56.0 -51.8 -60.8 -62.4 -74.0 -80.8 -85.2 40 41 42 43 44 45 46 47 48 49 50 51 52 -82.0 -82.8 -82.6 -87.4 -88.8 -85.0 -85.8 -85.8 -69.4 -74.0 -62.8 -58.2 -24.0 53 54 55 56 57 58 59 60 -18.8 -8.6 9.6 17.2 26.0 31.2 44.2 55.6 > postscript(file="/var/www/rcomp/tmp/64d5z1293308476.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 95.0 NA 1 97.2 95.0 2 109.8 97.2 3 106.0 109.8 4 102.2 106.0 5 112.4 102.2 6 98.6 112.4 7 109.2 98.6 8 102.0 109.2 9 90.2 102.0 10 91.2 90.2 11 78.6 91.2 12 62.0 78.6 13 56.2 62.0 14 52.8 56.2 15 38.0 52.8 16 33.2 38.0 17 19.4 33.2 18 17.6 19.4 19 10.2 17.6 20 13.0 10.2 21 16.2 13.0 22 11.2 16.2 23 -2.4 11.2 24 -9.0 -2.4 25 -9.8 -9.0 26 -19.2 -9.8 27 -38.0 -19.2 28 -33.8 -38.0 29 -40.6 -33.8 30 -38.4 -40.6 31 -47.8 -38.4 32 -56.0 -47.8 33 -51.8 -56.0 34 -60.8 -51.8 35 -62.4 -60.8 36 -74.0 -62.4 37 -80.8 -74.0 38 -85.2 -80.8 39 -82.0 -85.2 40 -82.8 -82.0 41 -82.6 -82.8 42 -87.4 -82.6 43 -88.8 -87.4 44 -85.0 -88.8 45 -85.8 -85.0 46 -85.8 -85.8 47 -69.4 -85.8 48 -74.0 -69.4 49 -62.8 -74.0 50 -58.2 -62.8 51 -24.0 -58.2 52 -18.8 -24.0 53 -8.6 -18.8 54 9.6 -8.6 55 17.2 9.6 56 26.0 17.2 57 31.2 26.0 58 44.2 31.2 59 55.6 44.2 60 NA 55.6 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 97.2 95.0 [2,] 109.8 97.2 [3,] 106.0 109.8 [4,] 102.2 106.0 [5,] 112.4 102.2 [6,] 98.6 112.4 [7,] 109.2 98.6 [8,] 102.0 109.2 [9,] 90.2 102.0 [10,] 91.2 90.2 [11,] 78.6 91.2 [12,] 62.0 78.6 [13,] 56.2 62.0 [14,] 52.8 56.2 [15,] 38.0 52.8 [16,] 33.2 38.0 [17,] 19.4 33.2 [18,] 17.6 19.4 [19,] 10.2 17.6 [20,] 13.0 10.2 [21,] 16.2 13.0 [22,] 11.2 16.2 [23,] -2.4 11.2 [24,] -9.0 -2.4 [25,] -9.8 -9.0 [26,] -19.2 -9.8 [27,] -38.0 -19.2 [28,] -33.8 -38.0 [29,] -40.6 -33.8 [30,] -38.4 -40.6 [31,] -47.8 -38.4 [32,] -56.0 -47.8 [33,] -51.8 -56.0 [34,] -60.8 -51.8 [35,] -62.4 -60.8 [36,] -74.0 -62.4 [37,] -80.8 -74.0 [38,] -85.2 -80.8 [39,] -82.0 -85.2 [40,] -82.8 -82.0 [41,] -82.6 -82.8 [42,] -87.4 -82.6 [43,] -88.8 -87.4 [44,] -85.0 -88.8 [45,] -85.8 -85.0 [46,] -85.8 -85.8 [47,] -69.4 -85.8 [48,] -74.0 -69.4 [49,] -62.8 -74.0 [50,] -58.2 -62.8 [51,] -24.0 -58.2 [52,] -18.8 -24.0 [53,] -8.6 -18.8 [54,] 9.6 -8.6 [55,] 17.2 9.6 [56,] 26.0 17.2 [57,] 31.2 26.0 [58,] 44.2 31.2 [59,] 55.6 44.2 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 97.2 95.0 2 109.8 97.2 3 106.0 109.8 4 102.2 106.0 5 112.4 102.2 6 98.6 112.4 7 109.2 98.6 8 102.0 109.2 9 90.2 102.0 10 91.2 90.2 11 78.6 91.2 12 62.0 78.6 13 56.2 62.0 14 52.8 56.2 15 38.0 52.8 16 33.2 38.0 17 19.4 33.2 18 17.6 19.4 19 10.2 17.6 20 13.0 10.2 21 16.2 13.0 22 11.2 16.2 23 -2.4 11.2 24 -9.0 -2.4 25 -9.8 -9.0 26 -19.2 -9.8 27 -38.0 -19.2 28 -33.8 -38.0 29 -40.6 -33.8 30 -38.4 -40.6 31 -47.8 -38.4 32 -56.0 -47.8 33 -51.8 -56.0 34 -60.8 -51.8 35 -62.4 -60.8 36 -74.0 -62.4 37 -80.8 -74.0 38 -85.2 -80.8 39 -82.0 -85.2 40 -82.8 -82.0 41 -82.6 -82.8 42 -87.4 -82.6 43 -88.8 -87.4 44 -85.0 -88.8 45 -85.8 -85.0 46 -85.8 -85.8 47 -69.4 -85.8 48 -74.0 -69.4 49 -62.8 -74.0 50 -58.2 -62.8 51 -24.0 -58.2 52 -18.8 -24.0 53 -8.6 -18.8 54 9.6 -8.6 55 17.2 9.6 56 26.0 17.2 57 31.2 26.0 58 44.2 31.2 59 55.6 44.2 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/74d5z1293308476.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/8f4mk1293308476.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/9f4mk1293308476.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') hat values (leverages) are all = 0.2 and there are no factor predictors; no plot no. 5 > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/rcomp/tmp/108dm51293308476.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/11te2b1293308476.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/12fe1g1293308476.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/13tog71293308476.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/rcomp/tmp/14w7fv1293308476.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/15azyw1293308477.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/rcomp/tmp/16d0f21293308477.tab") + } > try(system("convert tmp/1ju7t1293308476.ps tmp/1ju7t1293308476.png",intern=TRUE)) character(0) > try(system("convert tmp/2ju7t1293308476.ps tmp/2ju7t1293308476.png",intern=TRUE)) character(0) > try(system("convert tmp/3cmow1293308476.ps tmp/3cmow1293308476.png",intern=TRUE)) character(0) > try(system("convert tmp/44d5z1293308476.ps tmp/44d5z1293308476.png",intern=TRUE)) character(0) > try(system("convert tmp/54d5z1293308476.ps tmp/54d5z1293308476.png",intern=TRUE)) character(0) > try(system("convert tmp/64d5z1293308476.ps tmp/64d5z1293308476.png",intern=TRUE)) character(0) > try(system("convert tmp/74d5z1293308476.ps tmp/74d5z1293308476.png",intern=TRUE)) character(0) > try(system("convert tmp/8f4mk1293308476.ps tmp/8f4mk1293308476.png",intern=TRUE)) character(0) > try(system("convert tmp/9f4mk1293308476.ps tmp/9f4mk1293308476.png",intern=TRUE)) character(0) > try(system("convert tmp/108dm51293308476.ps tmp/108dm51293308476.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.070 0.730 3.803