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(13132.1 + ,12002.4 + ,17665.9 + ,15525.5 + ,16913 + ,14247.9 + ,17318.8 + ,15000.7 + ,16224.2 + ,14931.4 + ,15469.6 + ,13333.7 + ,16557.5 + ,14711.2 + ,19414.8 + ,17197.3 + ,17335 + ,14985.2 + ,16525.2 + ,14734.4 + ,18160.4 + ,15937.8 + ,15553.8 + ,13028.1 + ,15262.2 + ,13836.8 + ,18581 + ,16677.5 + ,17564.1 + ,15130 + ,18948.6 + ,17504 + ,17187.8 + ,16979.9 + ,17564.8 + ,16012.5 + ,17668.4 + ,16247.7 + ,20811.7 + ,19268.2 + ,17257.8 + ,15533 + ,18984.2 + ,16803.3 + ,20532.6 + ,17396.1 + ,17082.3 + ,15155.4 + ,16894.9 + ,15692.4 + ,20274.9 + ,18063.7 + ,20078.6 + ,17568.6 + ,19900.9 + ,18154.3 + ,17012.2 + ,15467.4 + ,19642.9 + ,16956.1 + ,19024 + ,16854 + ,21691 + ,19396.4 + ,18835.9 + ,16457.6 + ,19873.4 + ,17284.5 + ,21468.2 + ,18395.3 + ,19406.8 + ,16938.7 + ,18385.3 + ,16414.3 + ,20739.3 + ,18173.4 + ,22268.3 + ,19919.7 + ,21569 + ,19623.8 + ,17514.8 + ,17228.1 + ,21124.7 + ,18730.3 + ,21251 + ,19039.1 + ,21393 + ,19413.3 + ,22145.2 + ,20013.6 + ,20310.5 + ,17917.2 + ,23466.9 + ,21270.3 + ,21264.6 + ,18766.1 + ,18388.1 + ,16790.8 + ,22635.4 + ,19960.6 + ,22014.3 + ,19586.7 + ,18422.7 + ,17179 + ,16120.2 + ,14964.9 + ,16037.7 + ,13918.5 + ,16410.7 + ,14401.3 + ,17749.8 + ,15994.6 + ,16349.8 + ,14521.1 + ,15662.3 + ,13746.5 + ,17782.3 + ,15956 + ,16398.9 + ,14332.2) + ,dim=c(2 + ,60) + ,dimnames=list(c('Uitvoer' + ,'Invoer') + ,1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Uitvoer','Invoer'),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 = '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 Uitvoer Invoer 1 13132.1 12002.4 2 17665.9 15525.5 3 16913.0 14247.9 4 17318.8 15000.7 5 16224.2 14931.4 6 15469.6 13333.7 7 16557.5 14711.2 8 19414.8 17197.3 9 17335.0 14985.2 10 16525.2 14734.4 11 18160.4 15937.8 12 15553.8 13028.1 13 15262.2 13836.8 14 18581.0 16677.5 15 17564.1 15130.0 16 18948.6 17504.0 17 17187.8 16979.9 18 17564.8 16012.5 19 17668.4 16247.7 20 20811.7 19268.2 21 17257.8 15533.0 22 18984.2 16803.3 23 20532.6 17396.1 24 17082.3 15155.4 25 16894.9 15692.4 26 20274.9 18063.7 27 20078.6 17568.6 28 19900.9 18154.3 29 17012.2 15467.4 30 19642.9 16956.1 31 19024.0 16854.0 32 21691.0 19396.4 33 18835.9 16457.6 34 19873.4 17284.5 35 21468.2 18395.3 36 19406.8 16938.7 37 18385.3 16414.3 38 20739.3 18173.4 39 22268.3 19919.7 40 21569.0 19623.8 41 17514.8 17228.1 42 21124.7 18730.3 43 21251.0 19039.1 44 21393.0 19413.3 45 22145.2 20013.6 46 20310.5 17917.2 47 23466.9 21270.3 48 21264.6 18766.1 49 18388.1 16790.8 50 22635.4 19960.6 51 22014.3 19586.7 52 18422.7 17179.0 53 16120.2 14964.9 54 16037.7 13918.5 55 16410.7 14401.3 56 17749.8 15994.6 57 16349.8 14521.1 58 15662.3 13746.5 59 17782.3 15956.0 60 16398.9 14332.2 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Invoer 899.268 1.066 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1815.1 -278.1 109.3 355.0 1086.0 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 899.26790 588.47226 1.528 0.132 Invoer 1.06618 0.03515 30.334 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 548.7 on 58 degrees of freedom Multiple R-squared: 0.9407, Adjusted R-squared: 0.9397 F-statistic: 920.2 on 1 and 58 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,] 0.7577836 0.484432734 0.2422163670 [2,] 0.6821215 0.635757044 0.3178785220 [3,] 0.5568753 0.886249382 0.4431246910 [4,] 0.4381908 0.876381643 0.5618091785 [5,] 0.3605456 0.721091257 0.6394543717 [6,] 0.2705319 0.541063817 0.7294680913 [7,] 0.1870647 0.374129378 0.8129353110 [8,] 0.2686545 0.537309008 0.7313454961 [9,] 0.2593112 0.518622458 0.7406887710 [10,] 0.2048004 0.409600705 0.7951996475 [11,] 0.1848019 0.369603814 0.8151980931 [12,] 0.2369314 0.473862815 0.7630685923 [13,] 0.8712983 0.257403431 0.1287017153 [14,] 0.8372661 0.325467752 0.1627338760 [15,] 0.8151498 0.369700447 0.1848502237 [16,] 0.7960372 0.407925620 0.2039628098 [17,] 0.7385392 0.522921666 0.2614608328 [18,] 0.7011032 0.597793534 0.2988967670 [19,] 0.9030090 0.193982044 0.0969910219 [20,] 0.8656415 0.268716930 0.1343584650 [21,] 0.8880281 0.223943843 0.1119719213 [22,] 0.8574194 0.285161123 0.1425805615 [23,] 0.8520026 0.295994848 0.1479974240 [24,] 0.8200973 0.359805419 0.1799027097 [25,] 0.7903846 0.419230757 0.2096153783 [26,] 0.8218070 0.356385990 0.1781929952 [27,] 0.7738473 0.452305389 0.2261526946 [28,] 0.7194255 0.561148932 0.2805744660 [29,] 0.6882444 0.623511235 0.3117556175 [30,] 0.6902212 0.619557533 0.3097787667 [31,] 0.8164261 0.367147743 0.1835738717 [32,] 0.8048943 0.390211388 0.1951056942 [33,] 0.7461800 0.507640010 0.2538200048 [34,] 0.7352817 0.529436685 0.2647183426 [35,] 0.6712538 0.657492343 0.3287461716 [36,] 0.6077449 0.784510115 0.3922550575 [37,] 0.9926236 0.014752766 0.0073763832 [38,] 0.9885846 0.022830724 0.0114153622 [39,] 0.9795502 0.040899542 0.0204497711 [40,] 0.9679366 0.064126891 0.0320634455 [41,] 0.9478182 0.104363548 0.0521817739 [42,] 0.9298687 0.140262626 0.0701313129 [43,] 0.8944432 0.211113563 0.1055567815 [44,] 0.8674190 0.265161933 0.1325809665 [45,] 0.8401080 0.319783973 0.1598919866 [46,] 0.8525952 0.294809601 0.1474048004 [47,] 0.9715999 0.056800108 0.0284000540 [48,] 0.9495978 0.100804334 0.0504021671 [49,] 0.9994719 0.001056176 0.0005280879 [50,] 0.9983187 0.003362671 0.0016813353 [51,] 0.9919579 0.016084183 0.0080420913 > postscript(file="/var/www/html/rcomp/tmp/1jo4x1258577119.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/225l41258577119.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/3rmkq1258577119.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/4eswq1258577119.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/5oibc1258577119.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 -563.86833 213.67831 822.92792 426.10877 -594.60506 354.22828 7 8 9 10 11 12 -26.53256 180.14115 458.83454 -83.56790 268.59293 764.25242 13 14 15 16 17 18 -389.56611 -99.45928 533.55190 -613.05578 -1815.07165 -406.65060 19 20 21 22 23 24 -553.81577 -630.90783 -202.41802 169.61547 1085.98487 24.67097 25 26 27 28 29 30 -735.26687 116.50413 448.06909 -354.09164 -378.07672 665.40340 31 32 33 34 35 36 155.36022 111.70809 389.89337 545.77039 956.25935 447.85491 37 38 39 40 41 42 -14.54111 463.94435 131.07690 -252.74090 -1752.69714 255.58956 43 44 45 46 47 48 52.65365 -204.31033 -92.13726 308.29928 -110.30374 357.32038 49 50 51 52 53 54 -413.15730 454.57020 232.11433 -792.44778 -734.32204 298.82711 55 56 57 58 59 60 157.07615 -202.56600 -31.55203 106.80981 -128.91152 218.94908 > postscript(file="/var/www/html/rcomp/tmp/6foyd1258577119.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 -563.86833 NA 1 213.67831 -563.86833 2 822.92792 213.67831 3 426.10877 822.92792 4 -594.60506 426.10877 5 354.22828 -594.60506 6 -26.53256 354.22828 7 180.14115 -26.53256 8 458.83454 180.14115 9 -83.56790 458.83454 10 268.59293 -83.56790 11 764.25242 268.59293 12 -389.56611 764.25242 13 -99.45928 -389.56611 14 533.55190 -99.45928 15 -613.05578 533.55190 16 -1815.07165 -613.05578 17 -406.65060 -1815.07165 18 -553.81577 -406.65060 19 -630.90783 -553.81577 20 -202.41802 -630.90783 21 169.61547 -202.41802 22 1085.98487 169.61547 23 24.67097 1085.98487 24 -735.26687 24.67097 25 116.50413 -735.26687 26 448.06909 116.50413 27 -354.09164 448.06909 28 -378.07672 -354.09164 29 665.40340 -378.07672 30 155.36022 665.40340 31 111.70809 155.36022 32 389.89337 111.70809 33 545.77039 389.89337 34 956.25935 545.77039 35 447.85491 956.25935 36 -14.54111 447.85491 37 463.94435 -14.54111 38 131.07690 463.94435 39 -252.74090 131.07690 40 -1752.69714 -252.74090 41 255.58956 -1752.69714 42 52.65365 255.58956 43 -204.31033 52.65365 44 -92.13726 -204.31033 45 308.29928 -92.13726 46 -110.30374 308.29928 47 357.32038 -110.30374 48 -413.15730 357.32038 49 454.57020 -413.15730 50 232.11433 454.57020 51 -792.44778 232.11433 52 -734.32204 -792.44778 53 298.82711 -734.32204 54 157.07615 298.82711 55 -202.56600 157.07615 56 -31.55203 -202.56600 57 106.80981 -31.55203 58 -128.91152 106.80981 59 218.94908 -128.91152 60 NA 218.94908 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 213.67831 -563.86833 [2,] 822.92792 213.67831 [3,] 426.10877 822.92792 [4,] -594.60506 426.10877 [5,] 354.22828 -594.60506 [6,] -26.53256 354.22828 [7,] 180.14115 -26.53256 [8,] 458.83454 180.14115 [9,] -83.56790 458.83454 [10,] 268.59293 -83.56790 [11,] 764.25242 268.59293 [12,] -389.56611 764.25242 [13,] -99.45928 -389.56611 [14,] 533.55190 -99.45928 [15,] -613.05578 533.55190 [16,] -1815.07165 -613.05578 [17,] -406.65060 -1815.07165 [18,] -553.81577 -406.65060 [19,] -630.90783 -553.81577 [20,] -202.41802 -630.90783 [21,] 169.61547 -202.41802 [22,] 1085.98487 169.61547 [23,] 24.67097 1085.98487 [24,] -735.26687 24.67097 [25,] 116.50413 -735.26687 [26,] 448.06909 116.50413 [27,] -354.09164 448.06909 [28,] -378.07672 -354.09164 [29,] 665.40340 -378.07672 [30,] 155.36022 665.40340 [31,] 111.70809 155.36022 [32,] 389.89337 111.70809 [33,] 545.77039 389.89337 [34,] 956.25935 545.77039 [35,] 447.85491 956.25935 [36,] -14.54111 447.85491 [37,] 463.94435 -14.54111 [38,] 131.07690 463.94435 [39,] -252.74090 131.07690 [40,] -1752.69714 -252.74090 [41,] 255.58956 -1752.69714 [42,] 52.65365 255.58956 [43,] -204.31033 52.65365 [44,] -92.13726 -204.31033 [45,] 308.29928 -92.13726 [46,] -110.30374 308.29928 [47,] 357.32038 -110.30374 [48,] -413.15730 357.32038 [49,] 454.57020 -413.15730 [50,] 232.11433 454.57020 [51,] -792.44778 232.11433 [52,] -734.32204 -792.44778 [53,] 298.82711 -734.32204 [54,] 157.07615 298.82711 [55,] -202.56600 157.07615 [56,] -31.55203 -202.56600 [57,] 106.80981 -31.55203 [58,] -128.91152 106.80981 [59,] 218.94908 -128.91152 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 213.67831 -563.86833 2 822.92792 213.67831 3 426.10877 822.92792 4 -594.60506 426.10877 5 354.22828 -594.60506 6 -26.53256 354.22828 7 180.14115 -26.53256 8 458.83454 180.14115 9 -83.56790 458.83454 10 268.59293 -83.56790 11 764.25242 268.59293 12 -389.56611 764.25242 13 -99.45928 -389.56611 14 533.55190 -99.45928 15 -613.05578 533.55190 16 -1815.07165 -613.05578 17 -406.65060 -1815.07165 18 -553.81577 -406.65060 19 -630.90783 -553.81577 20 -202.41802 -630.90783 21 169.61547 -202.41802 22 1085.98487 169.61547 23 24.67097 1085.98487 24 -735.26687 24.67097 25 116.50413 -735.26687 26 448.06909 116.50413 27 -354.09164 448.06909 28 -378.07672 -354.09164 29 665.40340 -378.07672 30 155.36022 665.40340 31 111.70809 155.36022 32 389.89337 111.70809 33 545.77039 389.89337 34 956.25935 545.77039 35 447.85491 956.25935 36 -14.54111 447.85491 37 463.94435 -14.54111 38 131.07690 463.94435 39 -252.74090 131.07690 40 -1752.69714 -252.74090 41 255.58956 -1752.69714 42 52.65365 255.58956 43 -204.31033 52.65365 44 -92.13726 -204.31033 45 308.29928 -92.13726 46 -110.30374 308.29928 47 357.32038 -110.30374 48 -413.15730 357.32038 49 454.57020 -413.15730 50 232.11433 454.57020 51 -792.44778 232.11433 52 -734.32204 -792.44778 53 298.82711 -734.32204 54 157.07615 298.82711 55 -202.56600 157.07615 56 -31.55203 -202.56600 57 106.80981 -31.55203 58 -128.91152 106.80981 59 218.94908 -128.91152 > 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/75jz91258577119.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/8fic81258577119.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/9x0qw1258577119.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/10dk4p1258577119.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/114sji1258577119.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/125ntx1258577119.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/13qqp51258577119.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/14nuky1258577119.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/15c1o31258577119.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/16rb5c1258577120.tab") + } > > system("convert tmp/1jo4x1258577119.ps tmp/1jo4x1258577119.png") > system("convert tmp/225l41258577119.ps tmp/225l41258577119.png") > system("convert tmp/3rmkq1258577119.ps tmp/3rmkq1258577119.png") > system("convert tmp/4eswq1258577119.ps tmp/4eswq1258577119.png") > system("convert tmp/5oibc1258577119.ps tmp/5oibc1258577119.png") > system("convert tmp/6foyd1258577119.ps tmp/6foyd1258577119.png") > system("convert tmp/75jz91258577119.ps tmp/75jz91258577119.png") > system("convert tmp/8fic81258577119.ps tmp/8fic81258577119.png") > system("convert tmp/9x0qw1258577119.ps tmp/9x0qw1258577119.png") > system("convert tmp/10dk4p1258577119.ps tmp/10dk4p1258577119.png") > > > proc.time() user system elapsed 2.482 1.630 4.216