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(94.6,116.1,95.9,107.5,104.7,116.7,102.8,112.5,98.1,113,113.9,126.4,80.9,114.1,95.7,112.5,113.2,112.4,105.9,113.1,108.8,116.3,102.3,111.7,99,118.8,100.7,116.5,115.5,125.1,100.7,113.1,109.9,119.6,114.6,114.4,85.4,114,100.5,117.8,114.8,117,116.5,120.9,112.9,115,102,117.3,106,119.4,105.3,114.9,118.8,125.8,106.1,117.6,109.3,117.6,117.2,114.9,92.5,121.9,104.2,117,112.5,106.4,122.4,110.5,113.3,113.6,100,114.2,110.7,125.4,112.8,124.6,109.8,120.2,117.3,120.8,109.1,111.4,115.9,124.1,96,120.2,99.8,125.5,116.8,116,115.7,117,99.4,105.7,94.3,102,91,106.4,93.2,96.9,103.1,107.6,94.1,98.8,91.8,101.1,102.7,105.7,82.6,104.6,89.1,103.2,104.5,101.6,105.1,106.7,95.1,99.5,88.7,101),dim=c(2,60),dimnames=list(c('T.I.P.','I.P.C.N.'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('T.I.P.','I.P.C.N.'),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 = '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 I.P.C.N. T.I.P. 1 116.1 94.6 2 107.5 95.9 3 116.7 104.7 4 112.5 102.8 5 113.0 98.1 6 126.4 113.9 7 114.1 80.9 8 112.5 95.7 9 112.4 113.2 10 113.1 105.9 11 116.3 108.8 12 111.7 102.3 13 118.8 99.0 14 116.5 100.7 15 125.1 115.5 16 113.1 100.7 17 119.6 109.9 18 114.4 114.6 19 114.0 85.4 20 117.8 100.5 21 117.0 114.8 22 120.9 116.5 23 115.0 112.9 24 117.3 102.0 25 119.4 106.0 26 114.9 105.3 27 125.8 118.8 28 117.6 106.1 29 117.6 109.3 30 114.9 117.2 31 121.9 92.5 32 117.0 104.2 33 106.4 112.5 34 110.5 122.4 35 113.6 113.3 36 114.2 100.0 37 125.4 110.7 38 124.6 112.8 39 120.2 109.8 40 120.8 117.3 41 111.4 109.1 42 124.1 115.9 43 120.2 96.0 44 125.5 99.8 45 116.0 116.8 46 117.0 115.7 47 105.7 99.4 48 102.0 94.3 49 106.4 91.0 50 96.9 93.2 51 107.6 103.1 52 98.8 94.1 53 101.1 91.8 54 105.7 102.7 55 104.6 82.6 56 103.2 89.1 57 101.6 104.5 58 106.7 105.1 59 99.5 95.1 60 101.0 88.7 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) T.I.P. 72.8392 0.3931 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -12.5772 -4.4121 0.6703 4.4953 13.4283 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 72.83918 8.99661 8.096 4.22e-11 *** T.I.P. 0.39311 0.08619 4.561 2.69e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 6.479 on 58 degrees of freedom Multiple R-squared: 0.264, Adjusted R-squared: 0.2513 F-statistic: 20.8 on 1 and 58 DF, p-value: 2.687e-05 > 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.2107206540 0.4214413080 0.78927935 [2,] 0.1774642616 0.3549285233 0.82253574 [3,] 0.3128030644 0.6256061288 0.68719694 [4,] 0.2063462955 0.4126925909 0.79365370 [5,] 0.2160985236 0.4321970471 0.78390148 [6,] 0.1493843202 0.2987686404 0.85061568 [7,] 0.0907279992 0.1814559984 0.90927200 [8,] 0.0611007153 0.1222014305 0.93889928 [9,] 0.0564593635 0.1129187270 0.94354064 [10,] 0.0357852851 0.0715705702 0.96421471 [11,] 0.0472756129 0.0945512257 0.95272439 [12,] 0.0295378298 0.0590756596 0.97046217 [13,] 0.0185613393 0.0371226786 0.98143866 [14,] 0.0148125967 0.0296251933 0.98518740 [15,] 0.0120800528 0.0241601057 0.98791995 [16,] 0.0087593375 0.0175186750 0.99124066 [17,] 0.0048636803 0.0097273605 0.99513632 [18,] 0.0028576018 0.0057152036 0.99714240 [19,] 0.0017621258 0.0035242515 0.99823787 [20,] 0.0010861253 0.0021722507 0.99891387 [21,] 0.0007671187 0.0015342373 0.99923288 [22,] 0.0003959536 0.0007919071 0.99960405 [23,] 0.0005700698 0.0011401395 0.99942993 [24,] 0.0003138502 0.0006277004 0.99968615 [25,] 0.0001573345 0.0003146690 0.99984267 [26,] 0.0001227915 0.0002455831 0.99987721 [27,] 0.0010380159 0.0020760319 0.99896198 [28,] 0.0006621787 0.0013243574 0.99933782 [29,] 0.0045032641 0.0090065281 0.99549674 [30,] 0.0127959862 0.0255919725 0.98720401 [31,] 0.0096945881 0.0193891761 0.99030541 [32,] 0.0067925514 0.0135851027 0.99320745 [33,] 0.0156558424 0.0313116849 0.98434416 [34,] 0.0237527691 0.0475055382 0.97624723 [35,] 0.0209721526 0.0419443052 0.97902785 [36,] 0.0146720057 0.0293440115 0.98532799 [37,] 0.0115628557 0.0231257114 0.98843714 [38,] 0.0159863892 0.0319727783 0.98401361 [39,] 0.0708195603 0.1416391206 0.92918044 [40,] 0.8215542551 0.3568914899 0.17844574 [41,] 0.8031588929 0.3936822142 0.19684111 [42,] 0.9235527038 0.1528945923 0.07644730 [43,] 0.9226877109 0.1546245782 0.07731229 [44,] 0.9178986683 0.1642026634 0.08210133 [45,] 0.9276309048 0.1447381905 0.07236910 [46,] 0.9718038984 0.0563922031 0.02819610 [47,] 0.9725781300 0.0548437401 0.02742187 [48,] 0.9778629206 0.0442741587 0.02213708 [49,] 0.9580826101 0.0838347797 0.04191739 [50,] 0.9260747805 0.1478504390 0.07392522 [51,] 0.8876043393 0.2247913214 0.11239566 > postscript(file="/var/www/html/rcomp/tmp/18vja1292667414.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/html/rcomp/tmp/2j4iv1292667414.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/html/rcomp/tmp/3j4iv1292667414.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/html/rcomp/tmp/4j4iv1292667414.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/html/rcomp/tmp/5j4iv1292667414.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 60 Frequency = 1 1 2 3 4 5 6 6.0724349 -3.0386105 2.7020050 -0.7510825 1.5965434 8.7853757 7 8 9 10 11 12 9.4580677 2.0400119 -4.9394460 -1.3697293 0.6902463 -1.3545265 13 14 15 16 17 18 7.0427427 4.0744525 6.8563967 0.6744525 3.5578232 -3.4898026 19 20 21 22 23 24 7.5890642 5.4530749 -0.9684250 2.2632848 -2.2215124 4.3634070 25 26 27 28 29 30 4.8909595 0.6661378 6.2591275 3.0516483 1.7936903 -4.0118935 31 32 33 34 35 36 12.6979699 3.1985609 -10.6642677 -10.4560753 -3.7787572 2.0496308 37 38 39 40 41 42 9.0433337 7.4177987 4.1971344 1.8487953 -4.3276873 5.6991519 43 44 45 46 47 48 9.6220783 13.4282532 -2.7546488 -1.3222257 -6.2145021 -7.9096315 49 50 51 52 53 54 -2.2123623 -12.5772084 -5.7690160 -11.0310091 -7.8268518 -7.5117713 55 56 57 58 59 60 -0.7102225 -4.6654497 -12.3193727 -7.4552398 -10.7241210 -6.7082050 > postscript(file="/var/www/html/rcomp/tmp/6cvhg1292667414.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 60 Frequency = 1 lag(myerror, k = 1) myerror 0 6.0724349 NA 1 -3.0386105 6.0724349 2 2.7020050 -3.0386105 3 -0.7510825 2.7020050 4 1.5965434 -0.7510825 5 8.7853757 1.5965434 6 9.4580677 8.7853757 7 2.0400119 9.4580677 8 -4.9394460 2.0400119 9 -1.3697293 -4.9394460 10 0.6902463 -1.3697293 11 -1.3545265 0.6902463 12 7.0427427 -1.3545265 13 4.0744525 7.0427427 14 6.8563967 4.0744525 15 0.6744525 6.8563967 16 3.5578232 0.6744525 17 -3.4898026 3.5578232 18 7.5890642 -3.4898026 19 5.4530749 7.5890642 20 -0.9684250 5.4530749 21 2.2632848 -0.9684250 22 -2.2215124 2.2632848 23 4.3634070 -2.2215124 24 4.8909595 4.3634070 25 0.6661378 4.8909595 26 6.2591275 0.6661378 27 3.0516483 6.2591275 28 1.7936903 3.0516483 29 -4.0118935 1.7936903 30 12.6979699 -4.0118935 31 3.1985609 12.6979699 32 -10.6642677 3.1985609 33 -10.4560753 -10.6642677 34 -3.7787572 -10.4560753 35 2.0496308 -3.7787572 36 9.0433337 2.0496308 37 7.4177987 9.0433337 38 4.1971344 7.4177987 39 1.8487953 4.1971344 40 -4.3276873 1.8487953 41 5.6991519 -4.3276873 42 9.6220783 5.6991519 43 13.4282532 9.6220783 44 -2.7546488 13.4282532 45 -1.3222257 -2.7546488 46 -6.2145021 -1.3222257 47 -7.9096315 -6.2145021 48 -2.2123623 -7.9096315 49 -12.5772084 -2.2123623 50 -5.7690160 -12.5772084 51 -11.0310091 -5.7690160 52 -7.8268518 -11.0310091 53 -7.5117713 -7.8268518 54 -0.7102225 -7.5117713 55 -4.6654497 -0.7102225 56 -12.3193727 -4.6654497 57 -7.4552398 -12.3193727 58 -10.7241210 -7.4552398 59 -6.7082050 -10.7241210 60 NA -6.7082050 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -3.0386105 6.0724349 [2,] 2.7020050 -3.0386105 [3,] -0.7510825 2.7020050 [4,] 1.5965434 -0.7510825 [5,] 8.7853757 1.5965434 [6,] 9.4580677 8.7853757 [7,] 2.0400119 9.4580677 [8,] -4.9394460 2.0400119 [9,] -1.3697293 -4.9394460 [10,] 0.6902463 -1.3697293 [11,] -1.3545265 0.6902463 [12,] 7.0427427 -1.3545265 [13,] 4.0744525 7.0427427 [14,] 6.8563967 4.0744525 [15,] 0.6744525 6.8563967 [16,] 3.5578232 0.6744525 [17,] -3.4898026 3.5578232 [18,] 7.5890642 -3.4898026 [19,] 5.4530749 7.5890642 [20,] -0.9684250 5.4530749 [21,] 2.2632848 -0.9684250 [22,] -2.2215124 2.2632848 [23,] 4.3634070 -2.2215124 [24,] 4.8909595 4.3634070 [25,] 0.6661378 4.8909595 [26,] 6.2591275 0.6661378 [27,] 3.0516483 6.2591275 [28,] 1.7936903 3.0516483 [29,] -4.0118935 1.7936903 [30,] 12.6979699 -4.0118935 [31,] 3.1985609 12.6979699 [32,] -10.6642677 3.1985609 [33,] -10.4560753 -10.6642677 [34,] -3.7787572 -10.4560753 [35,] 2.0496308 -3.7787572 [36,] 9.0433337 2.0496308 [37,] 7.4177987 9.0433337 [38,] 4.1971344 7.4177987 [39,] 1.8487953 4.1971344 [40,] -4.3276873 1.8487953 [41,] 5.6991519 -4.3276873 [42,] 9.6220783 5.6991519 [43,] 13.4282532 9.6220783 [44,] -2.7546488 13.4282532 [45,] -1.3222257 -2.7546488 [46,] -6.2145021 -1.3222257 [47,] -7.9096315 -6.2145021 [48,] -2.2123623 -7.9096315 [49,] -12.5772084 -2.2123623 [50,] -5.7690160 -12.5772084 [51,] -11.0310091 -5.7690160 [52,] -7.8268518 -11.0310091 [53,] -7.5117713 -7.8268518 [54,] -0.7102225 -7.5117713 [55,] -4.6654497 -0.7102225 [56,] -12.3193727 -4.6654497 [57,] -7.4552398 -12.3193727 [58,] -10.7241210 -7.4552398 [59,] -6.7082050 -10.7241210 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -3.0386105 6.0724349 2 2.7020050 -3.0386105 3 -0.7510825 2.7020050 4 1.5965434 -0.7510825 5 8.7853757 1.5965434 6 9.4580677 8.7853757 7 2.0400119 9.4580677 8 -4.9394460 2.0400119 9 -1.3697293 -4.9394460 10 0.6902463 -1.3697293 11 -1.3545265 0.6902463 12 7.0427427 -1.3545265 13 4.0744525 7.0427427 14 6.8563967 4.0744525 15 0.6744525 6.8563967 16 3.5578232 0.6744525 17 -3.4898026 3.5578232 18 7.5890642 -3.4898026 19 5.4530749 7.5890642 20 -0.9684250 5.4530749 21 2.2632848 -0.9684250 22 -2.2215124 2.2632848 23 4.3634070 -2.2215124 24 4.8909595 4.3634070 25 0.6661378 4.8909595 26 6.2591275 0.6661378 27 3.0516483 6.2591275 28 1.7936903 3.0516483 29 -4.0118935 1.7936903 30 12.6979699 -4.0118935 31 3.1985609 12.6979699 32 -10.6642677 3.1985609 33 -10.4560753 -10.6642677 34 -3.7787572 -10.4560753 35 2.0496308 -3.7787572 36 9.0433337 2.0496308 37 7.4177987 9.0433337 38 4.1971344 7.4177987 39 1.8487953 4.1971344 40 -4.3276873 1.8487953 41 5.6991519 -4.3276873 42 9.6220783 5.6991519 43 13.4282532 9.6220783 44 -2.7546488 13.4282532 45 -1.3222257 -2.7546488 46 -6.2145021 -1.3222257 47 -7.9096315 -6.2145021 48 -2.2123623 -7.9096315 49 -12.5772084 -2.2123623 50 -5.7690160 -12.5772084 51 -11.0310091 -5.7690160 52 -7.8268518 -11.0310091 53 -7.5117713 -7.8268518 54 -0.7102225 -7.5117713 55 -4.6654497 -0.7102225 56 -12.3193727 -4.6654497 57 -7.4552398 -12.3193727 58 -10.7241210 -7.4552398 59 -6.7082050 -10.7241210 > 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/7m5hj1292667414.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/html/rcomp/tmp/8m5hj1292667414.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/html/rcomp/tmp/9feg41292667414.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/html/rcomp/tmp/10feg41292667414.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/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/11iwwr1292667414.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/12mfvx1292667414.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/13ipbo1292667414.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/143pru1292667414.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/157q8i1292667414.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/16a8661292667414.tab") + } > > try(system("convert tmp/18vja1292667414.ps tmp/18vja1292667414.png",intern=TRUE)) character(0) > try(system("convert tmp/2j4iv1292667414.ps tmp/2j4iv1292667414.png",intern=TRUE)) character(0) > try(system("convert tmp/3j4iv1292667414.ps tmp/3j4iv1292667414.png",intern=TRUE)) character(0) > try(system("convert tmp/4j4iv1292667414.ps tmp/4j4iv1292667414.png",intern=TRUE)) character(0) > try(system("convert tmp/5j4iv1292667414.ps tmp/5j4iv1292667414.png",intern=TRUE)) character(0) > try(system("convert tmp/6cvhg1292667414.ps tmp/6cvhg1292667414.png",intern=TRUE)) character(0) > try(system("convert tmp/7m5hj1292667414.ps tmp/7m5hj1292667414.png",intern=TRUE)) character(0) > try(system("convert tmp/8m5hj1292667414.ps tmp/8m5hj1292667414.png",intern=TRUE)) character(0) > try(system("convert tmp/9feg41292667414.ps tmp/9feg41292667414.png",intern=TRUE)) character(0) > try(system("convert tmp/10feg41292667414.ps tmp/10feg41292667414.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.552 1.648 24.714