R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(54156,53661,52441,50648,48141,46127,45623,56527,60205,61321,58088,54623,53495,51824,50518,49050,47111,45264,44357,54862,57871,59070,56273,52837,51702,49447,48965,46922,46256,45200,44471,53119,55016,56641,51847,47990,45744,46390,44461,41582,40813,38096,35461,44375,46255,45610,43375,40167,40628,40590,39473,36735,36634,32806,32907,41076,42254,43215,41116,40373),dim=c(1,60),dimnames=list(c('R(1)'),1:60)) > y <- array(NA,dim=c(1,60),dimnames=list(c('R(1)'),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 = '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 R(1) t 1 54156 1 2 53661 2 3 52441 3 4 50648 4 5 48141 5 6 46127 6 7 45623 7 8 56527 8 9 60205 9 10 61321 10 11 58088 11 12 54623 12 13 53495 13 14 51824 14 15 50518 15 16 49050 16 17 47111 17 18 45264 18 19 44357 19 20 54862 20 21 57871 21 22 59070 22 23 56273 23 24 52837 24 25 51702 25 26 49447 26 27 48965 27 28 46922 28 29 46256 29 30 45200 30 31 44471 31 32 53119 32 33 55016 33 34 56641 34 35 51847 35 36 47990 36 37 45744 37 38 46390 38 39 44461 39 40 41582 40 41 40813 41 42 38096 42 43 35461 43 44 44375 44 45 46255 45 46 45610 46 47 43375 47 48 40167 48 49 40628 49 50 40590 50 51 39473 51 52 36735 52 53 36634 53 54 32806 54 55 32907 55 56 41076 56 57 42254 57 58 43215 58 59 41116 59 60 40373 60 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) t 56288.3 -292.6 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -8617.00 -2977.49 -42.52 2742.43 10301.76 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 56288.34 1239.46 45.41 < 2e-16 *** t -292.62 35.34 -8.28 2.08e-11 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 4741 on 58 degrees of freedom Multiple R-squared: 0.5417, Adjusted R-squared: 0.5338 F-statistic: 68.57 on 1 and 58 DF, p-value: 2.078e-11 > 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.0045717391 0.0091434781 0.99542826 [2,] 0.0013217592 0.0026435183 0.99867824 [3,] 0.0002947039 0.0005894079 0.99970530 [4,] 0.4584780626 0.9169561252 0.54152194 [5,] 0.7504295866 0.4991408269 0.24957041 [6,] 0.8104181241 0.3791637518 0.18958188 [7,] 0.7433636878 0.5132726244 0.25663631 [8,] 0.6796823721 0.6406352559 0.32031763 [9,] 0.6274900809 0.7450198382 0.37250992 [10,] 0.6014381674 0.7971236652 0.39856183 [11,] 0.5896796176 0.8206407649 0.41032038 [12,] 0.5979303966 0.8041392067 0.40206960 [13,] 0.6474451778 0.7051096445 0.35255482 [14,] 0.7394021685 0.5211956630 0.26059783 [15,] 0.8367799052 0.3264401896 0.16322009 [16,] 0.8253337716 0.3493324569 0.17466623 [17,] 0.8595751530 0.2808496940 0.14042485 [18,] 0.9018389576 0.1963220848 0.09816104 [19,] 0.8917190035 0.2165619931 0.10828100 [20,] 0.8544618179 0.2910763641 0.14553818 [21,] 0.8100039197 0.3799921605 0.18999608 [22,] 0.7698948389 0.4602103222 0.23010516 [23,] 0.7254656382 0.5490687236 0.27453436 [24,] 0.7053454831 0.5893090338 0.29465452 [25,] 0.6890265164 0.6219469672 0.31097348 [26,] 0.6909771159 0.6180457682 0.30902288 [27,] 0.7082585873 0.5834828254 0.29174141 [28,] 0.6850489750 0.6299020500 0.31495103 [29,] 0.7385141207 0.5229717586 0.26148588 [30,] 0.8870746244 0.2258507511 0.11292538 [31,] 0.9131737095 0.1736525809 0.08682629 [32,] 0.9050899632 0.1898200737 0.09491004 [33,] 0.8885731347 0.2228537306 0.11142687 [34,] 0.8804902385 0.2390195230 0.11950976 [35,] 0.8639031154 0.2721937692 0.13609688 [36,] 0.8442610849 0.3114778301 0.15573892 [37,] 0.8194472590 0.3611054821 0.18055274 [38,] 0.8318231398 0.3363537204 0.16817686 [39,] 0.9188606021 0.1622787959 0.08113940 [40,] 0.8835087956 0.2329824089 0.11649120 [41,] 0.8811363960 0.2377272080 0.11886360 [42,] 0.8995533231 0.2008933538 0.10044668 [43,] 0.9037401802 0.1925196395 0.09625982 [44,] 0.8713699050 0.2572601899 0.12863009 [45,] 0.8523331909 0.2953336182 0.14766681 [46,] 0.8630036303 0.2739927393 0.13699637 [47,] 0.8839142619 0.2321714762 0.11608574 [48,] 0.8470926629 0.3058146742 0.15290734 [49,] 0.7956323655 0.4087352691 0.20436763 [50,] 0.7341629902 0.5316740196 0.26583701 [51,] 0.9797644270 0.0404711460 0.02023557 > postscript(file="/var/www/html/freestat/rcomp/tmp/1qsog1230127605.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/freestat/rcomp/tmp/2gvpj1230127605.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/freestat/rcomp/tmp/3qqrg1230127605.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/freestat/rcomp/tmp/4xad01230127605.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/freestat/rcomp/tmp/5qaw31230127605.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 60 Frequency = 1 1 2 3 4 5 6 7 -1839.7240 -2042.1035 -2969.4829 -4469.8623 -6684.2417 -8405.6211 -8617.0005 8 9 10 11 12 13 14 2579.6201 6550.2407 7958.8613 5018.4818 1846.1024 1010.7230 -367.6564 15 16 17 18 19 20 21 -1381.0358 -2556.4152 -4202.7946 -5757.1740 -6371.5534 4426.0671 7727.6877 22 23 24 25 26 27 28 9219.3083 6714.9289 3571.5495 2729.1701 766.7907 577.4113 -1172.9681 29 30 31 32 33 34 35 -1546.3476 -2309.7270 -2746.1064 6194.5142 8384.1348 10301.7554 5800.3760 36 37 38 39 40 41 42 2235.9966 282.6172 1221.2378 -415.1417 -3001.5211 -3477.9005 -5902.2799 43 44 45 46 47 48 49 -8244.6593 961.9613 3134.5819 2782.2025 839.8231 -2075.5564 -1321.9358 50 51 52 53 54 55 56 -1067.3152 -1891.6946 -4337.0740 -4145.4534 -7680.8328 -7287.2122 1174.4084 57 58 59 60 2645.0289 3898.6495 2092.2701 1641.8907 > postscript(file="/var/www/html/freestat/rcomp/tmp/6c62y1230127605.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 -1839.7240 NA 1 -2042.1035 -1839.7240 2 -2969.4829 -2042.1035 3 -4469.8623 -2969.4829 4 -6684.2417 -4469.8623 5 -8405.6211 -6684.2417 6 -8617.0005 -8405.6211 7 2579.6201 -8617.0005 8 6550.2407 2579.6201 9 7958.8613 6550.2407 10 5018.4818 7958.8613 11 1846.1024 5018.4818 12 1010.7230 1846.1024 13 -367.6564 1010.7230 14 -1381.0358 -367.6564 15 -2556.4152 -1381.0358 16 -4202.7946 -2556.4152 17 -5757.1740 -4202.7946 18 -6371.5534 -5757.1740 19 4426.0671 -6371.5534 20 7727.6877 4426.0671 21 9219.3083 7727.6877 22 6714.9289 9219.3083 23 3571.5495 6714.9289 24 2729.1701 3571.5495 25 766.7907 2729.1701 26 577.4113 766.7907 27 -1172.9681 577.4113 28 -1546.3476 -1172.9681 29 -2309.7270 -1546.3476 30 -2746.1064 -2309.7270 31 6194.5142 -2746.1064 32 8384.1348 6194.5142 33 10301.7554 8384.1348 34 5800.3760 10301.7554 35 2235.9966 5800.3760 36 282.6172 2235.9966 37 1221.2378 282.6172 38 -415.1417 1221.2378 39 -3001.5211 -415.1417 40 -3477.9005 -3001.5211 41 -5902.2799 -3477.9005 42 -8244.6593 -5902.2799 43 961.9613 -8244.6593 44 3134.5819 961.9613 45 2782.2025 3134.5819 46 839.8231 2782.2025 47 -2075.5564 839.8231 48 -1321.9358 -2075.5564 49 -1067.3152 -1321.9358 50 -1891.6946 -1067.3152 51 -4337.0740 -1891.6946 52 -4145.4534 -4337.0740 53 -7680.8328 -4145.4534 54 -7287.2122 -7680.8328 55 1174.4084 -7287.2122 56 2645.0289 1174.4084 57 3898.6495 2645.0289 58 2092.2701 3898.6495 59 1641.8907 2092.2701 60 NA 1641.8907 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -2042.1035 -1839.7240 [2,] -2969.4829 -2042.1035 [3,] -4469.8623 -2969.4829 [4,] -6684.2417 -4469.8623 [5,] -8405.6211 -6684.2417 [6,] -8617.0005 -8405.6211 [7,] 2579.6201 -8617.0005 [8,] 6550.2407 2579.6201 [9,] 7958.8613 6550.2407 [10,] 5018.4818 7958.8613 [11,] 1846.1024 5018.4818 [12,] 1010.7230 1846.1024 [13,] -367.6564 1010.7230 [14,] -1381.0358 -367.6564 [15,] -2556.4152 -1381.0358 [16,] -4202.7946 -2556.4152 [17,] -5757.1740 -4202.7946 [18,] -6371.5534 -5757.1740 [19,] 4426.0671 -6371.5534 [20,] 7727.6877 4426.0671 [21,] 9219.3083 7727.6877 [22,] 6714.9289 9219.3083 [23,] 3571.5495 6714.9289 [24,] 2729.1701 3571.5495 [25,] 766.7907 2729.1701 [26,] 577.4113 766.7907 [27,] -1172.9681 577.4113 [28,] -1546.3476 -1172.9681 [29,] -2309.7270 -1546.3476 [30,] -2746.1064 -2309.7270 [31,] 6194.5142 -2746.1064 [32,] 8384.1348 6194.5142 [33,] 10301.7554 8384.1348 [34,] 5800.3760 10301.7554 [35,] 2235.9966 5800.3760 [36,] 282.6172 2235.9966 [37,] 1221.2378 282.6172 [38,] -415.1417 1221.2378 [39,] -3001.5211 -415.1417 [40,] -3477.9005 -3001.5211 [41,] -5902.2799 -3477.9005 [42,] -8244.6593 -5902.2799 [43,] 961.9613 -8244.6593 [44,] 3134.5819 961.9613 [45,] 2782.2025 3134.5819 [46,] 839.8231 2782.2025 [47,] -2075.5564 839.8231 [48,] -1321.9358 -2075.5564 [49,] -1067.3152 -1321.9358 [50,] -1891.6946 -1067.3152 [51,] -4337.0740 -1891.6946 [52,] -4145.4534 -4337.0740 [53,] -7680.8328 -4145.4534 [54,] -7287.2122 -7680.8328 [55,] 1174.4084 -7287.2122 [56,] 2645.0289 1174.4084 [57,] 3898.6495 2645.0289 [58,] 2092.2701 3898.6495 [59,] 1641.8907 2092.2701 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -2042.1035 -1839.7240 2 -2969.4829 -2042.1035 3 -4469.8623 -2969.4829 4 -6684.2417 -4469.8623 5 -8405.6211 -6684.2417 6 -8617.0005 -8405.6211 7 2579.6201 -8617.0005 8 6550.2407 2579.6201 9 7958.8613 6550.2407 10 5018.4818 7958.8613 11 1846.1024 5018.4818 12 1010.7230 1846.1024 13 -367.6564 1010.7230 14 -1381.0358 -367.6564 15 -2556.4152 -1381.0358 16 -4202.7946 -2556.4152 17 -5757.1740 -4202.7946 18 -6371.5534 -5757.1740 19 4426.0671 -6371.5534 20 7727.6877 4426.0671 21 9219.3083 7727.6877 22 6714.9289 9219.3083 23 3571.5495 6714.9289 24 2729.1701 3571.5495 25 766.7907 2729.1701 26 577.4113 766.7907 27 -1172.9681 577.4113 28 -1546.3476 -1172.9681 29 -2309.7270 -1546.3476 30 -2746.1064 -2309.7270 31 6194.5142 -2746.1064 32 8384.1348 6194.5142 33 10301.7554 8384.1348 34 5800.3760 10301.7554 35 2235.9966 5800.3760 36 282.6172 2235.9966 37 1221.2378 282.6172 38 -415.1417 1221.2378 39 -3001.5211 -415.1417 40 -3477.9005 -3001.5211 41 -5902.2799 -3477.9005 42 -8244.6593 -5902.2799 43 961.9613 -8244.6593 44 3134.5819 961.9613 45 2782.2025 3134.5819 46 839.8231 2782.2025 47 -2075.5564 839.8231 48 -1321.9358 -2075.5564 49 -1067.3152 -1321.9358 50 -1891.6946 -1067.3152 51 -4337.0740 -1891.6946 52 -4145.4534 -4337.0740 53 -7680.8328 -4145.4534 54 -7287.2122 -7680.8328 55 1174.4084 -7287.2122 56 2645.0289 1174.4084 57 3898.6495 2645.0289 58 2092.2701 3898.6495 59 1641.8907 2092.2701 > 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/freestat/rcomp/tmp/7iv381230127605.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/freestat/rcomp/tmp/87d351230127605.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/freestat/rcomp/tmp/90z1x1230127605.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/freestat/rcomp/tmp/10r9o31230127605.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11b49f1230127605.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/freestat/rcomp/tmp/12kxoz1230127605.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/freestat/rcomp/tmp/13kq6m1230127605.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/freestat/rcomp/tmp/14l7851230127605.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/freestat/rcomp/tmp/15jhbc1230127605.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/freestat/rcomp/tmp/16g9jg1230127605.tab") + } > > system("convert tmp/1qsog1230127605.ps tmp/1qsog1230127605.png") > system("convert tmp/2gvpj1230127605.ps tmp/2gvpj1230127605.png") > system("convert tmp/3qqrg1230127605.ps tmp/3qqrg1230127605.png") > system("convert tmp/4xad01230127605.ps tmp/4xad01230127605.png") > system("convert tmp/5qaw31230127605.ps tmp/5qaw31230127605.png") > system("convert tmp/6c62y1230127605.ps tmp/6c62y1230127605.png") > system("convert tmp/7iv381230127605.ps tmp/7iv381230127605.png") > system("convert tmp/87d351230127605.ps tmp/87d351230127605.png") > system("convert tmp/90z1x1230127605.ps tmp/90z1x1230127605.png") > system("convert tmp/10r9o31230127605.ps tmp/10r9o31230127605.png") > > > proc.time() user system elapsed 3.649 2.450 4.084