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(627,0,696,0,825,0,677,0,656,0,785,0,412,0,352,0,839,0,729,0,696,0,641,0,695,0,638,0,762,0,635,0,721,0,854,0,418,0,367,0,824,0,687,0,601,0,676,0,740,0,691,0,683,0,594,0,729,0,731,0,386,0,331,0,707,0,715,0,657,0,653,0,642,0,643,0,718,0,654,0,632,0,731,0,392,0,344,0,792,0,852,0,649,0,629,0,685,1,617,1,715,1,715,1,629,1,916,1,531,1,357,1,917,1,828,1,708,1,858,1),dim=c(2,60),dimnames=list(c('Y','X'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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 Y X 1 627 0 2 696 0 3 825 0 4 677 0 5 656 0 6 785 0 7 412 0 8 352 0 9 839 0 10 729 0 11 696 0 12 641 0 13 695 0 14 638 0 15 762 0 16 635 0 17 721 0 18 854 0 19 418 0 20 367 0 21 824 0 22 687 0 23 601 0 24 676 0 25 740 0 26 691 0 27 683 0 28 594 0 29 729 0 30 731 0 31 386 0 32 331 0 33 707 0 34 715 0 35 657 0 36 653 0 37 642 0 38 643 0 39 718 0 40 654 0 41 632 0 42 731 0 43 392 0 44 344 0 45 792 0 46 852 0 47 649 0 48 629 0 49 685 1 50 617 1 51 715 1 52 715 1 53 629 1 54 916 1 55 531 1 56 357 1 57 917 1 58 828 1 59 708 1 60 858 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 648.08 58.25 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -349.333 -21.146 8.792 81.417 210.667 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 648.08 20.80 31.158 <2e-16 *** X 58.25 46.51 1.252 0.215 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 144.1 on 58 degrees of freedom Multiple R-squared: 0.02633, Adjusted R-squared: 0.009545 F-statistic: 1.569 on 1 and 58 DF, p-value: 0.2154 > 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.21309740 0.42619479 0.7869026 [2,] 0.14969205 0.29938410 0.8503080 [3,] 0.56866574 0.86266852 0.4313343 [4,] 0.83509520 0.32980960 0.1649048 [5,] 0.86469609 0.27060782 0.1353039 [6,] 0.81260599 0.37478801 0.1873940 [7,] 0.73919165 0.52161671 0.2608084 [8,] 0.65200814 0.69598372 0.3479919 [9,] 0.56312127 0.87375746 0.4368787 [10,] 0.46960525 0.93921049 0.5303948 [11,] 0.42197172 0.84394343 0.5780283 [12,] 0.33830945 0.67661891 0.6616905 [13,] 0.27365348 0.54730695 0.7263465 [14,] 0.33207007 0.66414013 0.6679299 [15,] 0.48251485 0.96502969 0.5174852 [16,] 0.69424064 0.61151873 0.3057594 [17,] 0.71714982 0.56570036 0.2828502 [18,] 0.65042799 0.69914402 0.3495720 [19,] 0.58367910 0.83264180 0.4163209 [20,] 0.50830905 0.98338191 0.4916910 [21,] 0.45944789 0.91889577 0.5405521 [22,] 0.38986077 0.77972154 0.6101392 [23,] 0.32234239 0.64468478 0.6776576 [24,] 0.26605050 0.53210101 0.7339495 [25,] 0.22494410 0.44988820 0.7750559 [26,] 0.18954659 0.37909318 0.8104534 [27,] 0.31938303 0.63876605 0.6806170 [28,] 0.58264427 0.83471147 0.4173557 [29,] 0.51838229 0.96323543 0.4816177 [30,] 0.45765652 0.91531305 0.5423435 [31,] 0.38243114 0.76486228 0.6175689 [32,] 0.31091842 0.62183684 0.6890816 [33,] 0.24544754 0.49089508 0.7545525 [34,] 0.18788247 0.37576494 0.8121175 [35,] 0.15067826 0.30135653 0.8493217 [36,] 0.10923270 0.21846541 0.8907673 [37,] 0.07622106 0.15244211 0.9237789 [38,] 0.06061081 0.12122163 0.9393892 [39,] 0.10991977 0.21983955 0.8900802 [40,] 0.33450827 0.66901654 0.6654917 [41,] 0.28981146 0.57962293 0.7101885 [42,] 0.32483943 0.64967886 0.6751606 [43,] 0.24584530 0.49169059 0.7541547 [44,] 0.17687806 0.35375611 0.8231219 [45,] 0.12082717 0.24165434 0.8791728 [46,] 0.08795368 0.17590736 0.9120463 [47,] 0.05344138 0.10688276 0.9465586 [48,] 0.02966145 0.05932290 0.9703386 [49,] 0.01755482 0.03510963 0.9824452 [50,] 0.02160134 0.04320268 0.9783987 [51,] 0.02037946 0.04075893 0.9796205 > postscript(file="/var/www/html/rcomp/tmp/1hf901259318410.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/2gf1g1259318410.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/312se1259318410.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/4bcxu1259318410.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/5tpk91259318410.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 -21.0833333 47.9166667 176.9166667 28.9166667 7.9166667 136.9166667 7 8 9 10 11 12 -236.0833333 -296.0833333 190.9166667 80.9166667 47.9166667 -7.0833333 13 14 15 16 17 18 46.9166667 -10.0833333 113.9166667 -13.0833333 72.9166667 205.9166667 19 20 21 22 23 24 -230.0833333 -281.0833333 175.9166667 38.9166667 -47.0833333 27.9166667 25 26 27 28 29 30 91.9166667 42.9166667 34.9166667 -54.0833333 80.9166667 82.9166667 31 32 33 34 35 36 -262.0833333 -317.0833333 58.9166667 66.9166667 8.9166667 4.9166667 37 38 39 40 41 42 -6.0833333 -5.0833333 69.9166667 5.9166667 -16.0833333 82.9166667 43 44 45 46 47 48 -256.0833333 -304.0833333 143.9166667 203.9166667 0.9166667 -19.0833333 49 50 51 52 53 54 -21.3333333 -89.3333333 8.6666667 8.6666667 -77.3333333 209.6666667 55 56 57 58 59 60 -175.3333333 -349.3333333 210.6666667 121.6666667 1.6666667 151.6666667 > postscript(file="/var/www/html/rcomp/tmp/6f2lh1259318410.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 -21.0833333 NA 1 47.9166667 -21.0833333 2 176.9166667 47.9166667 3 28.9166667 176.9166667 4 7.9166667 28.9166667 5 136.9166667 7.9166667 6 -236.0833333 136.9166667 7 -296.0833333 -236.0833333 8 190.9166667 -296.0833333 9 80.9166667 190.9166667 10 47.9166667 80.9166667 11 -7.0833333 47.9166667 12 46.9166667 -7.0833333 13 -10.0833333 46.9166667 14 113.9166667 -10.0833333 15 -13.0833333 113.9166667 16 72.9166667 -13.0833333 17 205.9166667 72.9166667 18 -230.0833333 205.9166667 19 -281.0833333 -230.0833333 20 175.9166667 -281.0833333 21 38.9166667 175.9166667 22 -47.0833333 38.9166667 23 27.9166667 -47.0833333 24 91.9166667 27.9166667 25 42.9166667 91.9166667 26 34.9166667 42.9166667 27 -54.0833333 34.9166667 28 80.9166667 -54.0833333 29 82.9166667 80.9166667 30 -262.0833333 82.9166667 31 -317.0833333 -262.0833333 32 58.9166667 -317.0833333 33 66.9166667 58.9166667 34 8.9166667 66.9166667 35 4.9166667 8.9166667 36 -6.0833333 4.9166667 37 -5.0833333 -6.0833333 38 69.9166667 -5.0833333 39 5.9166667 69.9166667 40 -16.0833333 5.9166667 41 82.9166667 -16.0833333 42 -256.0833333 82.9166667 43 -304.0833333 -256.0833333 44 143.9166667 -304.0833333 45 203.9166667 143.9166667 46 0.9166667 203.9166667 47 -19.0833333 0.9166667 48 -21.3333333 -19.0833333 49 -89.3333333 -21.3333333 50 8.6666667 -89.3333333 51 8.6666667 8.6666667 52 -77.3333333 8.6666667 53 209.6666667 -77.3333333 54 -175.3333333 209.6666667 55 -349.3333333 -175.3333333 56 210.6666667 -349.3333333 57 121.6666667 210.6666667 58 1.6666667 121.6666667 59 151.6666667 1.6666667 60 NA 151.6666667 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 47.9166667 -21.0833333 [2,] 176.9166667 47.9166667 [3,] 28.9166667 176.9166667 [4,] 7.9166667 28.9166667 [5,] 136.9166667 7.9166667 [6,] -236.0833333 136.9166667 [7,] -296.0833333 -236.0833333 [8,] 190.9166667 -296.0833333 [9,] 80.9166667 190.9166667 [10,] 47.9166667 80.9166667 [11,] -7.0833333 47.9166667 [12,] 46.9166667 -7.0833333 [13,] -10.0833333 46.9166667 [14,] 113.9166667 -10.0833333 [15,] -13.0833333 113.9166667 [16,] 72.9166667 -13.0833333 [17,] 205.9166667 72.9166667 [18,] -230.0833333 205.9166667 [19,] -281.0833333 -230.0833333 [20,] 175.9166667 -281.0833333 [21,] 38.9166667 175.9166667 [22,] -47.0833333 38.9166667 [23,] 27.9166667 -47.0833333 [24,] 91.9166667 27.9166667 [25,] 42.9166667 91.9166667 [26,] 34.9166667 42.9166667 [27,] -54.0833333 34.9166667 [28,] 80.9166667 -54.0833333 [29,] 82.9166667 80.9166667 [30,] -262.0833333 82.9166667 [31,] -317.0833333 -262.0833333 [32,] 58.9166667 -317.0833333 [33,] 66.9166667 58.9166667 [34,] 8.9166667 66.9166667 [35,] 4.9166667 8.9166667 [36,] -6.0833333 4.9166667 [37,] -5.0833333 -6.0833333 [38,] 69.9166667 -5.0833333 [39,] 5.9166667 69.9166667 [40,] -16.0833333 5.9166667 [41,] 82.9166667 -16.0833333 [42,] -256.0833333 82.9166667 [43,] -304.0833333 -256.0833333 [44,] 143.9166667 -304.0833333 [45,] 203.9166667 143.9166667 [46,] 0.9166667 203.9166667 [47,] -19.0833333 0.9166667 [48,] -21.3333333 -19.0833333 [49,] -89.3333333 -21.3333333 [50,] 8.6666667 -89.3333333 [51,] 8.6666667 8.6666667 [52,] -77.3333333 8.6666667 [53,] 209.6666667 -77.3333333 [54,] -175.3333333 209.6666667 [55,] -349.3333333 -175.3333333 [56,] 210.6666667 -349.3333333 [57,] 121.6666667 210.6666667 [58,] 1.6666667 121.6666667 [59,] 151.6666667 1.6666667 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 47.9166667 -21.0833333 2 176.9166667 47.9166667 3 28.9166667 176.9166667 4 7.9166667 28.9166667 5 136.9166667 7.9166667 6 -236.0833333 136.9166667 7 -296.0833333 -236.0833333 8 190.9166667 -296.0833333 9 80.9166667 190.9166667 10 47.9166667 80.9166667 11 -7.0833333 47.9166667 12 46.9166667 -7.0833333 13 -10.0833333 46.9166667 14 113.9166667 -10.0833333 15 -13.0833333 113.9166667 16 72.9166667 -13.0833333 17 205.9166667 72.9166667 18 -230.0833333 205.9166667 19 -281.0833333 -230.0833333 20 175.9166667 -281.0833333 21 38.9166667 175.9166667 22 -47.0833333 38.9166667 23 27.9166667 -47.0833333 24 91.9166667 27.9166667 25 42.9166667 91.9166667 26 34.9166667 42.9166667 27 -54.0833333 34.9166667 28 80.9166667 -54.0833333 29 82.9166667 80.9166667 30 -262.0833333 82.9166667 31 -317.0833333 -262.0833333 32 58.9166667 -317.0833333 33 66.9166667 58.9166667 34 8.9166667 66.9166667 35 4.9166667 8.9166667 36 -6.0833333 4.9166667 37 -5.0833333 -6.0833333 38 69.9166667 -5.0833333 39 5.9166667 69.9166667 40 -16.0833333 5.9166667 41 82.9166667 -16.0833333 42 -256.0833333 82.9166667 43 -304.0833333 -256.0833333 44 143.9166667 -304.0833333 45 203.9166667 143.9166667 46 0.9166667 203.9166667 47 -19.0833333 0.9166667 48 -21.3333333 -19.0833333 49 -89.3333333 -21.3333333 50 8.6666667 -89.3333333 51 8.6666667 8.6666667 52 -77.3333333 8.6666667 53 209.6666667 -77.3333333 54 -175.3333333 209.6666667 55 -349.3333333 -175.3333333 56 210.6666667 -349.3333333 57 121.6666667 210.6666667 58 1.6666667 121.6666667 59 151.6666667 1.6666667 > 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/78ysh1259318410.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/8jsok1259318410.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/9k2731259318410.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/10jnxq1259318410.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/11ot7s1259318410.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/12woei1259318411.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/13ut5x1259318411.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/1468pb1259318411.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/15kvpd1259318411.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/16q2v61259318411.tab") + } > > system("convert tmp/1hf901259318410.ps tmp/1hf901259318410.png") > system("convert tmp/2gf1g1259318410.ps tmp/2gf1g1259318410.png") > system("convert tmp/312se1259318410.ps tmp/312se1259318410.png") > system("convert tmp/4bcxu1259318410.ps tmp/4bcxu1259318410.png") > system("convert tmp/5tpk91259318410.ps tmp/5tpk91259318410.png") > system("convert tmp/6f2lh1259318410.ps tmp/6f2lh1259318410.png") > system("convert tmp/78ysh1259318410.ps tmp/78ysh1259318410.png") > system("convert tmp/8jsok1259318410.ps tmp/8jsok1259318410.png") > system("convert tmp/9k2731259318410.ps tmp/9k2731259318410.png") > system("convert tmp/10jnxq1259318410.ps tmp/10jnxq1259318410.png") > > > proc.time() user system elapsed 2.448 1.572 2.888