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(36700,0,35600,0,80900,0,174000,0,169422,0,153452,0,173570,0,193036,0,174652,0,105367,0,95963,0,82896,0,121747,0,120196,0,103983,0,81103,0,70944,0,57248,0,47830,0,60095,0,60931,0,82955,0,99559,0,77911,0,70753,0,69287,0,88426,0,91756,1,96933,1,174484,1,232595,1,266197,1,290435,1,304296,1,322310,1,415555,1,490042,1,545109,1,545720,1,505944,1,477930,1,466106,1,424476,1,383018,1,364696,1,391116,1,435721,1,511435,1,553997,1,555252,1,544897,1,540562,1,505282,1,507626,1,474427,1,469740,1,491480,1,538974,1,576612,1),dim=c(2,59),dimnames=list(c('Werklozen','Oliecrisis'),1:59)) > y <- array(NA,dim=c(2,59),dimnames=list(c('Werklozen','Oliecrisis'),1:59)) > 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 > 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 Werklozen Oliecrisis 1 36700 0 2 35600 0 3 80900 0 4 174000 0 5 169422 0 6 153452 0 7 173570 0 8 193036 0 9 174652 0 10 105367 0 11 95963 0 12 82896 0 13 121747 0 14 120196 0 15 103983 0 16 81103 0 17 70944 0 18 57248 0 19 47830 0 20 60095 0 21 60931 0 22 82955 0 23 99559 0 24 77911 0 25 70753 0 26 69287 0 27 88426 0 28 91756 1 29 96933 1 30 174484 1 31 232595 1 32 266197 1 33 290435 1 34 304296 1 35 322310 1 36 415555 1 37 490042 1 38 545109 1 39 545720 1 40 505944 1 41 477930 1 42 466106 1 43 424476 1 44 383018 1 45 364696 1 46 391116 1 47 435721 1 48 511435 1 49 553997 1 50 555252 1 51 544897 1 52 540562 1 53 505282 1 54 507626 1 55 474427 1 56 469740 1 57 491480 1 58 538974 1 59 576612 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Oliecrisis 99575 322135 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -329954 -38668 2766 74210 154902 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 99575 20049 4.967 6.54e-06 *** Oliecrisis 322135 27224 11.833 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 104200 on 57 degrees of freedom Multiple R-squared: 0.7107, Adjusted R-squared: 0.7056 F-statistic: 140 on 1 and 57 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,] 3.453941e-01 6.907883e-01 0.654605854 [2,] 2.310497e-01 4.620994e-01 0.768950314 [3,] 1.685135e-01 3.370271e-01 0.831486462 [4,] 1.381742e-01 2.763484e-01 0.861825787 [5,] 9.165383e-02 1.833077e-01 0.908346165 [6,] 5.172800e-02 1.034560e-01 0.948271999 [7,] 2.902835e-02 5.805669e-02 0.970971653 [8,] 1.703463e-02 3.406925e-02 0.982965375 [9,] 8.141146e-03 1.628229e-02 0.991858854 [10,] 3.720450e-03 7.440899e-03 0.996279550 [11,] 1.688699e-03 3.377397e-03 0.998311301 [12,] 8.803342e-04 1.760668e-03 0.999119666 [13,] 4.978666e-04 9.957331e-04 0.999502133 [14,] 3.296583e-04 6.593167e-04 0.999670342 [15,] 2.409552e-04 4.819103e-04 0.999759045 [16,] 1.356377e-04 2.712754e-04 0.999864362 [17,] 7.232073e-05 1.446415e-04 0.999927679 [18,] 2.986524e-05 5.973048e-05 0.999970135 [19,] 1.122123e-05 2.244245e-05 0.999988779 [20,] 4.491365e-06 8.982730e-06 0.999995509 [21,] 1.860004e-06 3.720008e-06 0.999998140 [22,] 7.572237e-07 1.514447e-06 0.999999243 [23,] 2.560693e-07 5.121386e-07 0.999999744 [24,] 8.477994e-07 1.695599e-06 0.999999152 [25,] 6.409850e-06 1.281970e-05 0.999993590 [26,] 6.413589e-05 1.282718e-04 0.999935864 [27,] 7.553773e-04 1.510755e-03 0.999244623 [28,] 6.440136e-03 1.288027e-02 0.993559864 [29,] 3.663375e-02 7.326750e-02 0.963366249 [30,] 1.450083e-01 2.900165e-01 0.854991741 [31,] 3.977673e-01 7.955346e-01 0.602232702 [32,] 6.441720e-01 7.116561e-01 0.355828049 [33,] 8.271229e-01 3.457542e-01 0.172877109 [34,] 9.359387e-01 1.281226e-01 0.064061304 [35,] 9.672813e-01 6.543741e-02 0.032718703 [36,] 9.672751e-01 6.544981e-02 0.032724903 [37,] 9.583796e-01 8.324075e-02 0.041620376 [38,] 9.441567e-01 1.116865e-01 0.055843264 [39,] 9.335118e-01 1.329765e-01 0.066488236 [40,] 9.516416e-01 9.671673e-02 0.048358363 [41,] 9.853385e-01 2.932302e-02 0.014661510 [42,] 9.971121e-01 5.775714e-03 0.002887857 [43,] 9.989360e-01 2.127964e-03 0.001063982 [44,] 9.976562e-01 4.687678e-03 0.002343839 [45,] 9.962945e-01 7.410944e-03 0.003705472 [46,] 9.942063e-01 1.158732e-02 0.005793661 [47,] 9.887268e-01 2.254645e-02 0.011273223 [48,] 9.767491e-01 4.650174e-02 0.023250869 [49,] 9.392000e-01 1.216000e-01 0.060800000 [50,] 8.527561e-01 2.944878e-01 0.147243914 > postscript(file="/var/www/rcomp/tmp/1ryy61292676689.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/228f91292676689.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/328f91292676689.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/4uzwu1292676689.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/5uzwu1292676689.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 = 59 Frequency = 1 1 2 3 4 5 -62875.03704 -63975.03704 -18675.03704 74424.96296 69846.96296 6 7 8 9 10 53876.96296 73994.96296 93460.96296 75076.96296 5791.96296 11 12 13 14 15 -3612.03704 -16679.03704 22171.96296 20620.96296 4407.96296 16 17 18 19 20 -18472.03704 -28631.03704 -42327.03704 -51745.03704 -39480.03704 21 22 23 24 25 -38644.03704 -16620.03704 -16.03704 -21664.03704 -28822.03704 26 27 28 29 30 -30288.03704 -11149.03704 -329954.09375 -324777.09375 -247226.09375 31 32 33 34 35 -189115.09375 -155513.09375 -131275.09375 -117414.09375 -99400.09375 36 37 38 39 40 -6155.09375 68331.90625 123398.90625 124009.90625 84233.90625 41 42 43 44 45 56219.90625 44395.90625 2765.90625 -38692.09375 -57014.09375 46 47 48 49 50 -30594.09375 14010.90625 89724.90625 132286.90625 133541.90625 51 52 53 54 55 123186.90625 118851.90625 83571.90625 85915.90625 52716.90625 56 57 58 59 48029.90625 69769.90625 117263.90625 154901.90625 > postscript(file="/var/www/rcomp/tmp/6uzwu1292676689.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 = 59 Frequency = 1 lag(myerror, k = 1) myerror 0 -62875.03704 NA 1 -63975.03704 -62875.03704 2 -18675.03704 -63975.03704 3 74424.96296 -18675.03704 4 69846.96296 74424.96296 5 53876.96296 69846.96296 6 73994.96296 53876.96296 7 93460.96296 73994.96296 8 75076.96296 93460.96296 9 5791.96296 75076.96296 10 -3612.03704 5791.96296 11 -16679.03704 -3612.03704 12 22171.96296 -16679.03704 13 20620.96296 22171.96296 14 4407.96296 20620.96296 15 -18472.03704 4407.96296 16 -28631.03704 -18472.03704 17 -42327.03704 -28631.03704 18 -51745.03704 -42327.03704 19 -39480.03704 -51745.03704 20 -38644.03704 -39480.03704 21 -16620.03704 -38644.03704 22 -16.03704 -16620.03704 23 -21664.03704 -16.03704 24 -28822.03704 -21664.03704 25 -30288.03704 -28822.03704 26 -11149.03704 -30288.03704 27 -329954.09375 -11149.03704 28 -324777.09375 -329954.09375 29 -247226.09375 -324777.09375 30 -189115.09375 -247226.09375 31 -155513.09375 -189115.09375 32 -131275.09375 -155513.09375 33 -117414.09375 -131275.09375 34 -99400.09375 -117414.09375 35 -6155.09375 -99400.09375 36 68331.90625 -6155.09375 37 123398.90625 68331.90625 38 124009.90625 123398.90625 39 84233.90625 124009.90625 40 56219.90625 84233.90625 41 44395.90625 56219.90625 42 2765.90625 44395.90625 43 -38692.09375 2765.90625 44 -57014.09375 -38692.09375 45 -30594.09375 -57014.09375 46 14010.90625 -30594.09375 47 89724.90625 14010.90625 48 132286.90625 89724.90625 49 133541.90625 132286.90625 50 123186.90625 133541.90625 51 118851.90625 123186.90625 52 83571.90625 118851.90625 53 85915.90625 83571.90625 54 52716.90625 85915.90625 55 48029.90625 52716.90625 56 69769.90625 48029.90625 57 117263.90625 69769.90625 58 154901.90625 117263.90625 59 NA 154901.90625 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -63975.03704 -62875.03704 [2,] -18675.03704 -63975.03704 [3,] 74424.96296 -18675.03704 [4,] 69846.96296 74424.96296 [5,] 53876.96296 69846.96296 [6,] 73994.96296 53876.96296 [7,] 93460.96296 73994.96296 [8,] 75076.96296 93460.96296 [9,] 5791.96296 75076.96296 [10,] -3612.03704 5791.96296 [11,] -16679.03704 -3612.03704 [12,] 22171.96296 -16679.03704 [13,] 20620.96296 22171.96296 [14,] 4407.96296 20620.96296 [15,] -18472.03704 4407.96296 [16,] -28631.03704 -18472.03704 [17,] -42327.03704 -28631.03704 [18,] -51745.03704 -42327.03704 [19,] -39480.03704 -51745.03704 [20,] -38644.03704 -39480.03704 [21,] -16620.03704 -38644.03704 [22,] -16.03704 -16620.03704 [23,] -21664.03704 -16.03704 [24,] -28822.03704 -21664.03704 [25,] -30288.03704 -28822.03704 [26,] -11149.03704 -30288.03704 [27,] -329954.09375 -11149.03704 [28,] -324777.09375 -329954.09375 [29,] -247226.09375 -324777.09375 [30,] -189115.09375 -247226.09375 [31,] -155513.09375 -189115.09375 [32,] -131275.09375 -155513.09375 [33,] -117414.09375 -131275.09375 [34,] -99400.09375 -117414.09375 [35,] -6155.09375 -99400.09375 [36,] 68331.90625 -6155.09375 [37,] 123398.90625 68331.90625 [38,] 124009.90625 123398.90625 [39,] 84233.90625 124009.90625 [40,] 56219.90625 84233.90625 [41,] 44395.90625 56219.90625 [42,] 2765.90625 44395.90625 [43,] -38692.09375 2765.90625 [44,] -57014.09375 -38692.09375 [45,] -30594.09375 -57014.09375 [46,] 14010.90625 -30594.09375 [47,] 89724.90625 14010.90625 [48,] 132286.90625 89724.90625 [49,] 133541.90625 132286.90625 [50,] 123186.90625 133541.90625 [51,] 118851.90625 123186.90625 [52,] 83571.90625 118851.90625 [53,] 85915.90625 83571.90625 [54,] 52716.90625 85915.90625 [55,] 48029.90625 52716.90625 [56,] 69769.90625 48029.90625 [57,] 117263.90625 69769.90625 [58,] 154901.90625 117263.90625 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -63975.03704 -62875.03704 2 -18675.03704 -63975.03704 3 74424.96296 -18675.03704 4 69846.96296 74424.96296 5 53876.96296 69846.96296 6 73994.96296 53876.96296 7 93460.96296 73994.96296 8 75076.96296 93460.96296 9 5791.96296 75076.96296 10 -3612.03704 5791.96296 11 -16679.03704 -3612.03704 12 22171.96296 -16679.03704 13 20620.96296 22171.96296 14 4407.96296 20620.96296 15 -18472.03704 4407.96296 16 -28631.03704 -18472.03704 17 -42327.03704 -28631.03704 18 -51745.03704 -42327.03704 19 -39480.03704 -51745.03704 20 -38644.03704 -39480.03704 21 -16620.03704 -38644.03704 22 -16.03704 -16620.03704 23 -21664.03704 -16.03704 24 -28822.03704 -21664.03704 25 -30288.03704 -28822.03704 26 -11149.03704 -30288.03704 27 -329954.09375 -11149.03704 28 -324777.09375 -329954.09375 29 -247226.09375 -324777.09375 30 -189115.09375 -247226.09375 31 -155513.09375 -189115.09375 32 -131275.09375 -155513.09375 33 -117414.09375 -131275.09375 34 -99400.09375 -117414.09375 35 -6155.09375 -99400.09375 36 68331.90625 -6155.09375 37 123398.90625 68331.90625 38 124009.90625 123398.90625 39 84233.90625 124009.90625 40 56219.90625 84233.90625 41 44395.90625 56219.90625 42 2765.90625 44395.90625 43 -38692.09375 2765.90625 44 -57014.09375 -38692.09375 45 -30594.09375 -57014.09375 46 14010.90625 -30594.09375 47 89724.90625 14010.90625 48 132286.90625 89724.90625 49 133541.90625 132286.90625 50 123186.90625 133541.90625 51 118851.90625 123186.90625 52 83571.90625 118851.90625 53 85915.90625 83571.90625 54 52716.90625 85915.90625 55 48029.90625 52716.90625 56 69769.90625 48029.90625 57 117263.90625 69769.90625 58 154901.90625 117263.90625 > 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/758ef1292676689.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/8yzdi1292676689.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/9yzdi1292676689.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') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/rcomp/tmp/10yzdi1292676689.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/11j0t61292676689.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/12xsrf1292676689.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/13b2751292676689.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/14x2ot1292676689.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/150l4z1292676689.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/1633ln1292676689.tab") + } > > try(system("convert tmp/1ryy61292676689.ps tmp/1ryy61292676689.png",intern=TRUE)) character(0) > try(system("convert tmp/228f91292676689.ps tmp/228f91292676689.png",intern=TRUE)) character(0) > try(system("convert tmp/328f91292676689.ps tmp/328f91292676689.png",intern=TRUE)) character(0) > try(system("convert tmp/4uzwu1292676689.ps tmp/4uzwu1292676689.png",intern=TRUE)) character(0) > try(system("convert tmp/5uzwu1292676689.ps tmp/5uzwu1292676689.png",intern=TRUE)) character(0) > try(system("convert tmp/6uzwu1292676689.ps tmp/6uzwu1292676689.png",intern=TRUE)) character(0) > try(system("convert tmp/758ef1292676689.ps tmp/758ef1292676689.png",intern=TRUE)) character(0) > try(system("convert tmp/8yzdi1292676689.ps tmp/8yzdi1292676689.png",intern=TRUE)) character(0) > try(system("convert tmp/9yzdi1292676689.ps tmp/9yzdi1292676689.png",intern=TRUE)) character(0) > try(system("convert tmp/10yzdi1292676689.ps tmp/10yzdi1292676689.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.030 1.680 4.705