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(4223.4,401,4627.3,394,5175.3,372,4550.7,334,4639.3,320,5498.7,334,5031.0,400,4033.3,427,4643.5,423,4873.2,395,4608.7,373,4733.5,377,3955.6,391,4590.9,398,5127.5,393,5257.3,375,5416.9,371,5813.3,364,5261.9,400,4669.2,406,5855.8,407,5274.6,397,5516.7,389,5819.5,394,5156.0,399,5377.3,401,6386.8,396,5144.0,392,6138.5,384,5567.8,370,5822.6,380,5145.5,376,5706.6,378,6078.5,376,6074.5,373,5577.6,374,5727.5,379,6067.0,376,7069.9,371,5490.0,375,5948.3,360,6177.5,338,6890.1,352,5756.2,344,6528.8,330,6792.0,334,6657.4,333,5753.7,343,5750.9,350,5968.4,341,5871.7,320,7004.9,302,6363.4,287,6694.7,304,7101.6,370,5364.0,385,6958.6,365,6503.3,333,5316.0,313,5312.7,330,4478.0,367),dim=c(2,61),dimnames=list(c('Export','Werkloosheid'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Export','Werkloosheid'),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 = 'Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '2' > #'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 Werkloosheid Export t 1 401 4223.4 1 2 394 4627.3 2 3 372 5175.3 3 4 334 4550.7 4 5 320 4639.3 5 6 334 5498.7 6 7 400 5031.0 7 8 427 4033.3 8 9 423 4643.5 9 10 395 4873.2 10 11 373 4608.7 11 12 377 4733.5 12 13 391 3955.6 13 14 398 4590.9 14 15 393 5127.5 15 16 375 5257.3 16 17 371 5416.9 17 18 364 5813.3 18 19 400 5261.9 19 20 406 4669.2 20 21 407 5855.8 21 22 397 5274.6 22 23 389 5516.7 23 24 394 5819.5 24 25 399 5156.0 25 26 401 5377.3 26 27 396 6386.8 27 28 392 5144.0 28 29 384 6138.5 29 30 370 5567.8 30 31 380 5822.6 31 32 376 5145.5 32 33 378 5706.6 33 34 376 6078.5 34 35 373 6074.5 35 36 374 5577.6 36 37 379 5727.5 37 38 376 6067.0 38 39 371 7069.9 39 40 375 5490.0 40 41 360 5948.3 41 42 338 6177.5 42 43 352 6890.1 43 44 344 5756.2 44 45 330 6528.8 45 46 334 6792.0 46 47 333 6657.4 47 48 343 5753.7 48 49 350 5750.9 49 50 341 5968.4 50 51 320 5871.7 51 52 302 7004.9 52 53 287 6363.4 53 54 304 6694.7 54 55 370 7101.6 55 56 385 5364.0 56 57 365 6958.6 57 58 333 6503.3 58 59 313 5316.0 59 60 330 5312.7 60 61 367 4478.0 61 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Export t 434.393785 -0.007544 -0.788029 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -75.455 -12.354 5.249 18.477 35.201 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 434.393785 27.049263 16.059 < 2e-16 *** Export -0.007544 0.005609 -1.345 0.18384 t -0.788029 0.247405 -3.185 0.00233 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 25.38 on 58 degrees of freedom Multiple R-squared: 0.3537, Adjusted R-squared: 0.3314 F-statistic: 15.87 on 2 and 58 DF, p-value: 3.178e-06 > 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.12857674 0.257153481 0.871423260 [2,] 0.99237586 0.015248273 0.007624137 [3,] 0.99607746 0.007845076 0.003922538 [4,] 0.99587099 0.008258019 0.004129010 [5,] 0.99142162 0.017156766 0.008578383 [6,] 0.99319065 0.013618702 0.006809351 [7,] 0.99148870 0.017022590 0.008511295 [8,] 0.99055478 0.018890438 0.009445219 [9,] 0.98405884 0.031882328 0.015941164 [10,] 0.97577105 0.048457891 0.024228945 [11,] 0.96952506 0.060949884 0.030474942 [12,] 0.96543301 0.069133978 0.034566989 [13,] 0.96586196 0.068276082 0.034138041 [14,] 0.95333001 0.093339989 0.046669994 [15,] 0.93017930 0.139641392 0.069820696 [16,] 0.93178545 0.136429105 0.068214552 [17,] 0.90161393 0.196772144 0.098386072 [18,] 0.86571700 0.268566003 0.134283001 [19,] 0.82028840 0.359423204 0.179711602 [20,] 0.76777383 0.464452349 0.232226174 [21,] 0.70894467 0.582110657 0.291055328 [22,] 0.67465011 0.650699778 0.325349889 [23,] 0.63074721 0.738505588 0.369252794 [24,] 0.56444193 0.871116147 0.435558074 [25,] 0.57217597 0.855648064 0.427824032 [26,] 0.51240416 0.975191675 0.487595837 [27,] 0.50050287 0.998994261 0.499497130 [28,] 0.44049047 0.880980946 0.559509527 [29,] 0.37676804 0.753536072 0.623231964 [30,] 0.31922490 0.638449804 0.680775098 [31,] 0.27452264 0.549045271 0.725477364 [32,] 0.23051866 0.461037327 0.769481336 [33,] 0.19771338 0.395426759 0.802286620 [34,] 0.19359282 0.387185642 0.806407179 [35,] 0.18398305 0.367966104 0.816016948 [36,] 0.17390141 0.347802823 0.826098588 [37,] 0.18056820 0.361136402 0.819431799 [38,] 0.16322419 0.326448385 0.836775807 [39,] 0.15367810 0.307356190 0.846321905 [40,] 0.13912732 0.278254645 0.860872677 [41,] 0.11132099 0.222641976 0.888679012 [42,] 0.08623537 0.172470735 0.913764633 [43,] 0.06731872 0.134637435 0.932681282 [44,] 0.05937943 0.118758865 0.940620567 [45,] 0.05556909 0.111138177 0.944430911 [46,] 0.04645034 0.092900670 0.953549665 [47,] 0.03819540 0.076390808 0.961804596 [48,] 0.10093143 0.201862860 0.899068570 [49,] 0.40827470 0.816549405 0.591725298 [50,] 0.27780895 0.555617893 0.722191053 > postscript(file="/var/www/html/rcomp/tmp/12j9v1262190354.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/2h4ze1262190354.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/3rekx1262190354.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/4z9sb1262190354.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/5e4fo1262190354.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 -0.7448968 -3.9098912 -20.9878112 -62.9116950 -75.4552774 -54.1840305 7 8 9 10 11 12 9.0757218 29.3372133 30.7285231 5.2493833 -17.9579462 -12.2284398 13 14 15 16 17 18 -3.3088017 9.2718597 9.1079394 -7.1248348 -9.1328012 -12.3543747 19 20 21 22 23 24 20.2739542 22.5907204 33.3303276 19.7338486 14.3482531 22.4205716 25 26 27 28 29 30 23.2032306 27.6607222 31.0643067 18.4767910 18.7672172 1.2499491 31 32 33 34 35 36 13.9601609 5.6402230 12.6611279 14.2547291 12.0125826 10.0520534 37 38 39 40 41 42 16.9709113 17.3200905 20.6738854 13.5433249 2.7887181 -16.6941936 43 44 45 46 47 48 3.4696104 -12.2963758 -19.6799385 -12.9063580 -14.1337363 -10.1631194 49 50 51 52 53 54 -2.3962132 -8.9673884 -29.9088534 -38.5720899 -57.6234653 -37.3361460 55 56 57 58 59 60 32.5214913 35.2012596 28.0187733 -6.6279301 -34.7967600 -17.0336258 61 14.4575195 > postscript(file="/var/www/html/rcomp/tmp/60q5p1262190354.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 -0.7448968 NA 1 -3.9098912 -0.7448968 2 -20.9878112 -3.9098912 3 -62.9116950 -20.9878112 4 -75.4552774 -62.9116950 5 -54.1840305 -75.4552774 6 9.0757218 -54.1840305 7 29.3372133 9.0757218 8 30.7285231 29.3372133 9 5.2493833 30.7285231 10 -17.9579462 5.2493833 11 -12.2284398 -17.9579462 12 -3.3088017 -12.2284398 13 9.2718597 -3.3088017 14 9.1079394 9.2718597 15 -7.1248348 9.1079394 16 -9.1328012 -7.1248348 17 -12.3543747 -9.1328012 18 20.2739542 -12.3543747 19 22.5907204 20.2739542 20 33.3303276 22.5907204 21 19.7338486 33.3303276 22 14.3482531 19.7338486 23 22.4205716 14.3482531 24 23.2032306 22.4205716 25 27.6607222 23.2032306 26 31.0643067 27.6607222 27 18.4767910 31.0643067 28 18.7672172 18.4767910 29 1.2499491 18.7672172 30 13.9601609 1.2499491 31 5.6402230 13.9601609 32 12.6611279 5.6402230 33 14.2547291 12.6611279 34 12.0125826 14.2547291 35 10.0520534 12.0125826 36 16.9709113 10.0520534 37 17.3200905 16.9709113 38 20.6738854 17.3200905 39 13.5433249 20.6738854 40 2.7887181 13.5433249 41 -16.6941936 2.7887181 42 3.4696104 -16.6941936 43 -12.2963758 3.4696104 44 -19.6799385 -12.2963758 45 -12.9063580 -19.6799385 46 -14.1337363 -12.9063580 47 -10.1631194 -14.1337363 48 -2.3962132 -10.1631194 49 -8.9673884 -2.3962132 50 -29.9088534 -8.9673884 51 -38.5720899 -29.9088534 52 -57.6234653 -38.5720899 53 -37.3361460 -57.6234653 54 32.5214913 -37.3361460 55 35.2012596 32.5214913 56 28.0187733 35.2012596 57 -6.6279301 28.0187733 58 -34.7967600 -6.6279301 59 -17.0336258 -34.7967600 60 14.4575195 -17.0336258 61 NA 14.4575195 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -3.909891 -0.7448968 [2,] -20.987811 -3.9098912 [3,] -62.911695 -20.9878112 [4,] -75.455277 -62.9116950 [5,] -54.184031 -75.4552774 [6,] 9.075722 -54.1840305 [7,] 29.337213 9.0757218 [8,] 30.728523 29.3372133 [9,] 5.249383 30.7285231 [10,] -17.957946 5.2493833 [11,] -12.228440 -17.9579462 [12,] -3.308802 -12.2284398 [13,] 9.271860 -3.3088017 [14,] 9.107939 9.2718597 [15,] -7.124835 9.1079394 [16,] -9.132801 -7.1248348 [17,] -12.354375 -9.1328012 [18,] 20.273954 -12.3543747 [19,] 22.590720 20.2739542 [20,] 33.330328 22.5907204 [21,] 19.733849 33.3303276 [22,] 14.348253 19.7338486 [23,] 22.420572 14.3482531 [24,] 23.203231 22.4205716 [25,] 27.660722 23.2032306 [26,] 31.064307 27.6607222 [27,] 18.476791 31.0643067 [28,] 18.767217 18.4767910 [29,] 1.249949 18.7672172 [30,] 13.960161 1.2499491 [31,] 5.640223 13.9601609 [32,] 12.661128 5.6402230 [33,] 14.254729 12.6611279 [34,] 12.012583 14.2547291 [35,] 10.052053 12.0125826 [36,] 16.970911 10.0520534 [37,] 17.320091 16.9709113 [38,] 20.673885 17.3200905 [39,] 13.543325 20.6738854 [40,] 2.788718 13.5433249 [41,] -16.694194 2.7887181 [42,] 3.469610 -16.6941936 [43,] -12.296376 3.4696104 [44,] -19.679938 -12.2963758 [45,] -12.906358 -19.6799385 [46,] -14.133736 -12.9063580 [47,] -10.163119 -14.1337363 [48,] -2.396213 -10.1631194 [49,] -8.967388 -2.3962132 [50,] -29.908853 -8.9673884 [51,] -38.572090 -29.9088534 [52,] -57.623465 -38.5720899 [53,] -37.336146 -57.6234653 [54,] 32.521491 -37.3361460 [55,] 35.201260 32.5214913 [56,] 28.018773 35.2012596 [57,] -6.627930 28.0187733 [58,] -34.796760 -6.6279301 [59,] -17.033626 -34.7967600 [60,] 14.457519 -17.0336258 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -3.909891 -0.7448968 2 -20.987811 -3.9098912 3 -62.911695 -20.9878112 4 -75.455277 -62.9116950 5 -54.184031 -75.4552774 6 9.075722 -54.1840305 7 29.337213 9.0757218 8 30.728523 29.3372133 9 5.249383 30.7285231 10 -17.957946 5.2493833 11 -12.228440 -17.9579462 12 -3.308802 -12.2284398 13 9.271860 -3.3088017 14 9.107939 9.2718597 15 -7.124835 9.1079394 16 -9.132801 -7.1248348 17 -12.354375 -9.1328012 18 20.273954 -12.3543747 19 22.590720 20.2739542 20 33.330328 22.5907204 21 19.733849 33.3303276 22 14.348253 19.7338486 23 22.420572 14.3482531 24 23.203231 22.4205716 25 27.660722 23.2032306 26 31.064307 27.6607222 27 18.476791 31.0643067 28 18.767217 18.4767910 29 1.249949 18.7672172 30 13.960161 1.2499491 31 5.640223 13.9601609 32 12.661128 5.6402230 33 14.254729 12.6611279 34 12.012583 14.2547291 35 10.052053 12.0125826 36 16.970911 10.0520534 37 17.320091 16.9709113 38 20.673885 17.3200905 39 13.543325 20.6738854 40 2.788718 13.5433249 41 -16.694194 2.7887181 42 3.469610 -16.6941936 43 -12.296376 3.4696104 44 -19.679938 -12.2963758 45 -12.906358 -19.6799385 46 -14.133736 -12.9063580 47 -10.163119 -14.1337363 48 -2.396213 -10.1631194 49 -8.967388 -2.3962132 50 -29.908853 -8.9673884 51 -38.572090 -29.9088534 52 -57.623465 -38.5720899 53 -37.336146 -57.6234653 54 32.521491 -37.3361460 55 35.201260 32.5214913 56 28.018773 35.2012596 57 -6.627930 28.0187733 58 -34.796760 -6.6279301 59 -17.033626 -34.7967600 60 14.457519 -17.0336258 > 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/7vnke1262190354.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/85gsz1262190354.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/9b1dd1262190354.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/106no11262190354.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/11qvey1262190354.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/1265a81262190354.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/1317ap1262190354.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/14qa4n1262190354.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/154apj1262190354.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/16tal71262190354.tab") + } > > try(system("convert tmp/12j9v1262190354.ps tmp/12j9v1262190354.png",intern=TRUE)) character(0) > try(system("convert tmp/2h4ze1262190354.ps tmp/2h4ze1262190354.png",intern=TRUE)) character(0) > try(system("convert tmp/3rekx1262190354.ps tmp/3rekx1262190354.png",intern=TRUE)) character(0) > try(system("convert tmp/4z9sb1262190354.ps tmp/4z9sb1262190354.png",intern=TRUE)) character(0) > try(system("convert tmp/5e4fo1262190354.ps tmp/5e4fo1262190354.png",intern=TRUE)) character(0) > try(system("convert tmp/60q5p1262190354.ps tmp/60q5p1262190354.png",intern=TRUE)) character(0) > try(system("convert tmp/7vnke1262190354.ps tmp/7vnke1262190354.png",intern=TRUE)) character(0) > try(system("convert tmp/85gsz1262190354.ps tmp/85gsz1262190354.png",intern=TRUE)) character(0) > try(system("convert tmp/9b1dd1262190354.ps tmp/9b1dd1262190354.png",intern=TRUE)) character(0) > try(system("convert tmp/106no11262190354.ps tmp/106no11262190354.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.457 1.549 3.701