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(555,0,562,0,561,0,555,0,544,0,537,0,543,0,594,0,611,0,613,0,611,0,594,0,595,0,591,0,589,0,584,0,573,0,567,0,569,0,621,0,629,0,628,0,612,0,595,0,597,0,593,0,590,0,580,0,574,0,573,0,573,0,620,0,626,0,620,0,588,0,566,0,557,0,561,0,549,0,532,0,526,0,511,0,499,0,555,0,565,0,542,0,527,0,510,0,514,0,517,0,508,0,493,0,490,1,469,1,478,1,528,1,534,1,518,1,506,1,502,1,516,1,528,1,533,1,536,1,537,1,524,1,536,1,587,1,597,1,581,1),dim=c(2,70),dimnames=list(c('Y','X'),1:70)) > y <- array(NA,dim=c(2,70),dimnames=list(c('Y','X'),1:70)) > 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 Y X 1 555 0 2 562 0 3 561 0 4 555 0 5 544 0 6 537 0 7 543 0 8 594 0 9 611 0 10 613 0 11 611 0 12 594 0 13 595 0 14 591 0 15 589 0 16 584 0 17 573 0 18 567 0 19 569 0 20 621 0 21 629 0 22 628 0 23 612 0 24 595 0 25 597 0 26 593 0 27 590 0 28 580 0 29 574 0 30 573 0 31 573 0 32 620 0 33 626 0 34 620 0 35 588 0 36 566 0 37 557 0 38 561 0 39 549 0 40 532 0 41 526 0 42 511 0 43 499 0 44 555 0 45 565 0 46 542 0 47 527 0 48 510 0 49 514 0 50 517 0 51 508 0 52 493 0 53 490 1 54 469 1 55 478 1 56 528 1 57 534 1 58 518 1 59 506 1 60 502 1 61 516 1 62 528 1 63 533 1 64 536 1 65 537 1 66 524 1 67 536 1 68 587 1 69 597 1 70 581 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 569.21 -41.43 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -76.2115 -24.3531 0.2222 24.5385 69.2222 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 569.212 4.992 114.021 < 2e-16 *** X -41.434 9.845 -4.209 7.7e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 36 on 68 degrees of freedom Multiple R-squared: 0.2067, Adjusted R-squared: 0.195 F-statistic: 17.71 on 1 and 68 DF, p-value: 7.706e-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.014748604 0.02949721 0.9852514 [2,] 0.014169060 0.02833812 0.9858309 [3,] 0.005017763 0.01003553 0.9949822 [4,] 0.046038138 0.09207628 0.9539619 [5,] 0.163315300 0.32663060 0.8366847 [6,] 0.258073857 0.51614771 0.7419261 [7,] 0.300850214 0.60170043 0.6991498 [8,] 0.248006787 0.49601357 0.7519932 [9,] 0.201912270 0.40382454 0.7980877 [10,] 0.153146120 0.30629224 0.8468539 [11,] 0.110889395 0.22177879 0.8891106 [12,] 0.074901560 0.14980312 0.9250984 [13,] 0.047849826 0.09569965 0.9521502 [14,] 0.030538532 0.06107706 0.9694615 [15,] 0.018585697 0.03717139 0.9814143 [16,] 0.032411607 0.06482321 0.9675884 [17,] 0.066188655 0.13237731 0.9338113 [18,] 0.110710532 0.22142106 0.8892895 [19,] 0.116507512 0.23301502 0.8834925 [20,] 0.094905552 0.18981110 0.9050944 [21,] 0.079524121 0.15904824 0.9204759 [22,] 0.064053678 0.12810736 0.9359463 [23,] 0.050341390 0.10068278 0.9496586 [24,] 0.037222447 0.07444489 0.9627776 [25,] 0.027254102 0.05450820 0.9727459 [26,] 0.019804548 0.03960910 0.9801955 [27,] 0.014273806 0.02854761 0.9857262 [28,] 0.029113106 0.05822621 0.9708869 [29,] 0.080854788 0.16170958 0.9191452 [30,] 0.184878678 0.36975736 0.8151213 [31,] 0.212890286 0.42578057 0.7871097 [32,] 0.214874747 0.42974949 0.7851253 [33,] 0.219599925 0.43919985 0.7804001 [34,] 0.227625148 0.45525030 0.7723749 [35,] 0.240274266 0.48054853 0.7597257 [36,] 0.278451112 0.55690222 0.7215489 [37,] 0.322874664 0.64574933 0.6771253 [38,] 0.414174479 0.82834896 0.5858255 [39,] 0.550080591 0.89983882 0.4499194 [40,] 0.534398058 0.93120388 0.4656019 [41,] 0.565400071 0.86919986 0.4345999 [42,] 0.560932834 0.87813433 0.4390672 [43,] 0.555875364 0.88824927 0.4441246 [44,] 0.568604033 0.86279193 0.4313960 [45,] 0.562015135 0.87596973 0.4379849 [46,] 0.547156430 0.90568714 0.4528436 [47,] 0.538546653 0.92290669 0.4614533 [48,] 0.544967483 0.91006503 0.4550325 [49,] 0.534985057 0.93002989 0.4650149 [50,] 0.664037928 0.67192414 0.3359621 [51,] 0.773002144 0.45399571 0.2269979 [52,] 0.720484892 0.55903022 0.2795151 [53,] 0.650577457 0.69884509 0.3494225 [54,] 0.589489009 0.82102198 0.4105110 [55,] 0.581903254 0.83619349 0.4180967 [56,] 0.628292236 0.74341553 0.3717078 [57,] 0.617155336 0.76568933 0.3828447 [58,] 0.557764409 0.88447118 0.4422356 [59,] 0.480350251 0.96070050 0.5196497 [60,] 0.394119843 0.78823969 0.6058802 [61,] 0.312625123 0.62525025 0.6873749 > postscript(file="/var/www/html/rcomp/tmp/1vjcb1258728538.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/2bj0w1258728538.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/3czwj1258728538.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/4tfqz1258728538.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/5ba2j1258728538.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 = 70 Frequency = 1 1 2 3 4 5 6 -14.2115385 -7.2115385 -8.2115385 -14.2115385 -25.2115385 -32.2115385 7 8 9 10 11 12 -26.2115385 24.7884615 41.7884615 43.7884615 41.7884615 24.7884615 13 14 15 16 17 18 25.7884615 21.7884615 19.7884615 14.7884615 3.7884615 -2.2115385 19 20 21 22 23 24 -0.2115385 51.7884615 59.7884615 58.7884615 42.7884615 25.7884615 25 26 27 28 29 30 27.7884615 23.7884615 20.7884615 10.7884615 4.7884615 3.7884615 31 32 33 34 35 36 3.7884615 50.7884615 56.7884615 50.7884615 18.7884615 -3.2115385 37 38 39 40 41 42 -12.2115385 -8.2115385 -20.2115385 -37.2115385 -43.2115385 -58.2115385 43 44 45 46 47 48 -70.2115385 -14.2115385 -4.2115385 -27.2115385 -42.2115385 -59.2115385 49 50 51 52 53 54 -55.2115385 -52.2115385 -61.2115385 -76.2115385 -37.7777778 -58.7777778 55 56 57 58 59 60 -49.7777778 0.2222222 6.2222222 -9.7777778 -21.7777778 -25.7777778 61 62 63 64 65 66 -11.7777778 0.2222222 5.2222222 8.2222222 9.2222222 -3.7777778 67 68 69 70 8.2222222 59.2222222 69.2222222 53.2222222 > postscript(file="/var/www/html/rcomp/tmp/63i311258728538.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 = 70 Frequency = 1 lag(myerror, k = 1) myerror 0 -14.2115385 NA 1 -7.2115385 -14.2115385 2 -8.2115385 -7.2115385 3 -14.2115385 -8.2115385 4 -25.2115385 -14.2115385 5 -32.2115385 -25.2115385 6 -26.2115385 -32.2115385 7 24.7884615 -26.2115385 8 41.7884615 24.7884615 9 43.7884615 41.7884615 10 41.7884615 43.7884615 11 24.7884615 41.7884615 12 25.7884615 24.7884615 13 21.7884615 25.7884615 14 19.7884615 21.7884615 15 14.7884615 19.7884615 16 3.7884615 14.7884615 17 -2.2115385 3.7884615 18 -0.2115385 -2.2115385 19 51.7884615 -0.2115385 20 59.7884615 51.7884615 21 58.7884615 59.7884615 22 42.7884615 58.7884615 23 25.7884615 42.7884615 24 27.7884615 25.7884615 25 23.7884615 27.7884615 26 20.7884615 23.7884615 27 10.7884615 20.7884615 28 4.7884615 10.7884615 29 3.7884615 4.7884615 30 3.7884615 3.7884615 31 50.7884615 3.7884615 32 56.7884615 50.7884615 33 50.7884615 56.7884615 34 18.7884615 50.7884615 35 -3.2115385 18.7884615 36 -12.2115385 -3.2115385 37 -8.2115385 -12.2115385 38 -20.2115385 -8.2115385 39 -37.2115385 -20.2115385 40 -43.2115385 -37.2115385 41 -58.2115385 -43.2115385 42 -70.2115385 -58.2115385 43 -14.2115385 -70.2115385 44 -4.2115385 -14.2115385 45 -27.2115385 -4.2115385 46 -42.2115385 -27.2115385 47 -59.2115385 -42.2115385 48 -55.2115385 -59.2115385 49 -52.2115385 -55.2115385 50 -61.2115385 -52.2115385 51 -76.2115385 -61.2115385 52 -37.7777778 -76.2115385 53 -58.7777778 -37.7777778 54 -49.7777778 -58.7777778 55 0.2222222 -49.7777778 56 6.2222222 0.2222222 57 -9.7777778 6.2222222 58 -21.7777778 -9.7777778 59 -25.7777778 -21.7777778 60 -11.7777778 -25.7777778 61 0.2222222 -11.7777778 62 5.2222222 0.2222222 63 8.2222222 5.2222222 64 9.2222222 8.2222222 65 -3.7777778 9.2222222 66 8.2222222 -3.7777778 67 59.2222222 8.2222222 68 69.2222222 59.2222222 69 53.2222222 69.2222222 70 NA 53.2222222 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -7.2115385 -14.2115385 [2,] -8.2115385 -7.2115385 [3,] -14.2115385 -8.2115385 [4,] -25.2115385 -14.2115385 [5,] -32.2115385 -25.2115385 [6,] -26.2115385 -32.2115385 [7,] 24.7884615 -26.2115385 [8,] 41.7884615 24.7884615 [9,] 43.7884615 41.7884615 [10,] 41.7884615 43.7884615 [11,] 24.7884615 41.7884615 [12,] 25.7884615 24.7884615 [13,] 21.7884615 25.7884615 [14,] 19.7884615 21.7884615 [15,] 14.7884615 19.7884615 [16,] 3.7884615 14.7884615 [17,] -2.2115385 3.7884615 [18,] -0.2115385 -2.2115385 [19,] 51.7884615 -0.2115385 [20,] 59.7884615 51.7884615 [21,] 58.7884615 59.7884615 [22,] 42.7884615 58.7884615 [23,] 25.7884615 42.7884615 [24,] 27.7884615 25.7884615 [25,] 23.7884615 27.7884615 [26,] 20.7884615 23.7884615 [27,] 10.7884615 20.7884615 [28,] 4.7884615 10.7884615 [29,] 3.7884615 4.7884615 [30,] 3.7884615 3.7884615 [31,] 50.7884615 3.7884615 [32,] 56.7884615 50.7884615 [33,] 50.7884615 56.7884615 [34,] 18.7884615 50.7884615 [35,] -3.2115385 18.7884615 [36,] -12.2115385 -3.2115385 [37,] -8.2115385 -12.2115385 [38,] -20.2115385 -8.2115385 [39,] -37.2115385 -20.2115385 [40,] -43.2115385 -37.2115385 [41,] -58.2115385 -43.2115385 [42,] -70.2115385 -58.2115385 [43,] -14.2115385 -70.2115385 [44,] -4.2115385 -14.2115385 [45,] -27.2115385 -4.2115385 [46,] -42.2115385 -27.2115385 [47,] -59.2115385 -42.2115385 [48,] -55.2115385 -59.2115385 [49,] -52.2115385 -55.2115385 [50,] -61.2115385 -52.2115385 [51,] -76.2115385 -61.2115385 [52,] -37.7777778 -76.2115385 [53,] -58.7777778 -37.7777778 [54,] -49.7777778 -58.7777778 [55,] 0.2222222 -49.7777778 [56,] 6.2222222 0.2222222 [57,] -9.7777778 6.2222222 [58,] -21.7777778 -9.7777778 [59,] -25.7777778 -21.7777778 [60,] -11.7777778 -25.7777778 [61,] 0.2222222 -11.7777778 [62,] 5.2222222 0.2222222 [63,] 8.2222222 5.2222222 [64,] 9.2222222 8.2222222 [65,] -3.7777778 9.2222222 [66,] 8.2222222 -3.7777778 [67,] 59.2222222 8.2222222 [68,] 69.2222222 59.2222222 [69,] 53.2222222 69.2222222 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -7.2115385 -14.2115385 2 -8.2115385 -7.2115385 3 -14.2115385 -8.2115385 4 -25.2115385 -14.2115385 5 -32.2115385 -25.2115385 6 -26.2115385 -32.2115385 7 24.7884615 -26.2115385 8 41.7884615 24.7884615 9 43.7884615 41.7884615 10 41.7884615 43.7884615 11 24.7884615 41.7884615 12 25.7884615 24.7884615 13 21.7884615 25.7884615 14 19.7884615 21.7884615 15 14.7884615 19.7884615 16 3.7884615 14.7884615 17 -2.2115385 3.7884615 18 -0.2115385 -2.2115385 19 51.7884615 -0.2115385 20 59.7884615 51.7884615 21 58.7884615 59.7884615 22 42.7884615 58.7884615 23 25.7884615 42.7884615 24 27.7884615 25.7884615 25 23.7884615 27.7884615 26 20.7884615 23.7884615 27 10.7884615 20.7884615 28 4.7884615 10.7884615 29 3.7884615 4.7884615 30 3.7884615 3.7884615 31 50.7884615 3.7884615 32 56.7884615 50.7884615 33 50.7884615 56.7884615 34 18.7884615 50.7884615 35 -3.2115385 18.7884615 36 -12.2115385 -3.2115385 37 -8.2115385 -12.2115385 38 -20.2115385 -8.2115385 39 -37.2115385 -20.2115385 40 -43.2115385 -37.2115385 41 -58.2115385 -43.2115385 42 -70.2115385 -58.2115385 43 -14.2115385 -70.2115385 44 -4.2115385 -14.2115385 45 -27.2115385 -4.2115385 46 -42.2115385 -27.2115385 47 -59.2115385 -42.2115385 48 -55.2115385 -59.2115385 49 -52.2115385 -55.2115385 50 -61.2115385 -52.2115385 51 -76.2115385 -61.2115385 52 -37.7777778 -76.2115385 53 -58.7777778 -37.7777778 54 -49.7777778 -58.7777778 55 0.2222222 -49.7777778 56 6.2222222 0.2222222 57 -9.7777778 6.2222222 58 -21.7777778 -9.7777778 59 -25.7777778 -21.7777778 60 -11.7777778 -25.7777778 61 0.2222222 -11.7777778 62 5.2222222 0.2222222 63 8.2222222 5.2222222 64 9.2222222 8.2222222 65 -3.7777778 9.2222222 66 8.2222222 -3.7777778 67 59.2222222 8.2222222 68 69.2222222 59.2222222 69 53.2222222 69.2222222 > 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/78fnb1258728538.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/8tcpx1258728538.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/9n2nn1258728538.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/10odyf1258728538.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/115qso1258728538.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/12kvii1258728538.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/135ant1258728538.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/14mxt21258728538.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/152ap41258728538.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/16dvdw1258728538.tab") + } > > system("convert tmp/1vjcb1258728538.ps tmp/1vjcb1258728538.png") > system("convert tmp/2bj0w1258728538.ps tmp/2bj0w1258728538.png") > system("convert tmp/3czwj1258728538.ps tmp/3czwj1258728538.png") > system("convert tmp/4tfqz1258728538.ps tmp/4tfqz1258728538.png") > system("convert tmp/5ba2j1258728538.ps tmp/5ba2j1258728538.png") > system("convert tmp/63i311258728538.ps tmp/63i311258728538.png") > system("convert tmp/78fnb1258728538.ps tmp/78fnb1258728538.png") > system("convert tmp/8tcpx1258728538.ps tmp/8tcpx1258728538.png") > system("convert tmp/9n2nn1258728538.ps tmp/9n2nn1258728538.png") > system("convert tmp/10odyf1258728538.ps tmp/10odyf1258728538.png") > > > proc.time() user system elapsed 2.531 1.561 2.940