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(17823.2,0,17872,0,17420.4,0,16704.4,0,15991.2,0,15583.6,0,19123.5,0,17838.7,0,17209.4,0,18586.5,0,16258.1,0,15141.6,0,19202.1,0,17746.5,0,19090.1,1,18040.3,1,17515.5,1,17751.8,1,21072.4,1,17170,1,19439.5,1,19795.4,1,17574.9,1,16165.4,1,19464.6,1,19932.1,1,19961.2,1,17343.4,1,18924.2,1,18574.1,1,21350.6,1,18594.6,1,19832.1,1,20844.4,1,19640.2,1,17735.4,1,19813.6,1,22160,1,20664.3,1,17877.4,1,20906.5,1,21164.1,1,21374.4,1,22952.3,1,21343.5,1,23899.3,1,22392.9,1,18274.1,1,22786.7,1,22321.5,1,17842.2,1,16373.5,1,15933.8,0,16446.1,0,17729,0,16643,0,16196.7,0,18252.1,0,17570.4,0,15836.8,0),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 17823.2 0 2 17872.0 0 3 17420.4 0 4 16704.4 0 5 15991.2 0 6 15583.6 0 7 19123.5 0 8 17838.7 0 9 17209.4 0 10 18586.5 0 11 16258.1 0 12 15141.6 0 13 19202.1 0 14 17746.5 0 15 19090.1 1 16 18040.3 1 17 17515.5 1 18 17751.8 1 19 21072.4 1 20 17170.0 1 21 19439.5 1 22 19795.4 1 23 17574.9 1 24 16165.4 1 25 19464.6 1 26 19932.1 1 27 19961.2 1 28 17343.4 1 29 18924.2 1 30 18574.1 1 31 21350.6 1 32 18594.6 1 33 19832.1 1 34 20844.4 1 35 19640.2 1 36 17735.4 1 37 19813.6 1 38 22160.0 1 39 20664.3 1 40 17877.4 1 41 20906.5 1 42 21164.1 1 43 21374.4 1 44 22952.3 1 45 21343.5 1 46 23899.3 1 47 22392.9 1 48 18274.1 1 49 22786.7 1 50 22321.5 1 51 17842.2 1 52 16373.5 1 53 15933.8 0 54 16446.1 0 55 17729.0 0 56 16643.0 0 57 16196.7 0 58 18252.1 0 59 17570.4 0 60 15836.8 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 17141 2542 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -3517.72 -1231.77 90.18 1176.81 4216.18 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 17141.3 364.0 47.088 < 2e-16 *** X 2541.8 457.4 5.557 7.24e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1707 on 58 degrees of freedom Multiple R-squared: 0.3474, Adjusted R-squared: 0.3362 F-statistic: 30.88 on 1 and 58 DF, p-value: 7.238e-07 > 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.15656741 0.31313481 0.84343259 [2,] 0.17101242 0.34202484 0.82898758 [3,] 0.27542546 0.55085092 0.72457454 [4,] 0.18202787 0.36405573 0.81797213 [5,] 0.10593615 0.21187230 0.89406385 [6,] 0.09185928 0.18371857 0.90814072 [7,] 0.07131831 0.14263662 0.92868169 [8,] 0.11271624 0.22543248 0.88728376 [9,] 0.14947666 0.29895333 0.85052334 [10,] 0.10248078 0.20496157 0.89751922 [11,] 0.06520547 0.13041094 0.93479453 [12,] 0.04767529 0.09535058 0.95232471 [13,] 0.03862796 0.07725592 0.96137204 [14,] 0.02742389 0.05484779 0.97257611 [15,] 0.06219848 0.12439695 0.93780152 [16,] 0.06821322 0.13642643 0.93178678 [17,] 0.05071372 0.10142744 0.94928628 [18,] 0.03930611 0.07861222 0.96069389 [19,] 0.03778312 0.07556623 0.96221688 [20,] 0.09519014 0.19038027 0.90480986 [21,] 0.07617400 0.15234800 0.92382600 [22,] 0.06529916 0.13059832 0.93470084 [23,] 0.05390047 0.10780094 0.94609953 [24,] 0.06726237 0.13452473 0.93273763 [25,] 0.05143989 0.10287977 0.94856011 [26,] 0.04179605 0.08359211 0.95820395 [27,] 0.06241504 0.12483007 0.93758496 [28,] 0.05236424 0.10472848 0.94763576 [29,] 0.04023067 0.08046134 0.95976933 [30,] 0.03938942 0.07877884 0.96061058 [31,] 0.02852717 0.05705434 0.97147283 [32,] 0.03986297 0.07972594 0.96013703 [33,] 0.03013811 0.06027621 0.96986189 [34,] 0.05343939 0.10687878 0.94656061 [35,] 0.04257553 0.08515105 0.95742447 [36,] 0.06269820 0.12539640 0.93730180 [37,] 0.05190373 0.10380746 0.94809627 [38,] 0.04413669 0.08827337 0.95586331 [39,] 0.03842539 0.07685078 0.96157461 [40,] 0.07453422 0.14906844 0.92546578 [41,] 0.06064719 0.12129438 0.93935281 [42,] 0.21727974 0.43455948 0.78272026 [43,] 0.30155548 0.60311095 0.69844452 [44,] 0.26755636 0.53511272 0.73244364 [45,] 0.51099558 0.97800884 0.48900442 [46,] 0.96986588 0.06026824 0.03013412 [47,] 0.96384341 0.07231317 0.03615659 [48,] 0.93614052 0.12771897 0.06385948 [49,] 0.90981168 0.18037664 0.09018832 [50,] 0.83660674 0.32678652 0.16339326 [51,] 0.73545331 0.52909339 0.26454669 > postscript(file="/var/www/html/rcomp/tmp/10pzf1258560166.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/2c0k31258560166.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/3l2at1258560166.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/4aepv1258560166.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/5e3u31258560166.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 681.87727 730.67727 279.07727 -436.92273 -1150.12273 -1557.72273 7 8 9 10 11 12 1982.17727 697.37727 68.07727 1445.17727 -883.22273 -1999.72273 13 14 15 16 17 18 2060.77727 605.17727 -593.01842 -1642.81842 -2167.61842 -1931.31842 19 20 21 22 23 24 1389.28158 -2513.11842 -243.61842 112.28158 -2108.21842 -3517.71842 25 26 27 28 29 30 -218.51842 248.98158 278.08158 -2339.71842 -758.91842 -1109.01842 31 32 33 34 35 36 1667.48158 -1088.51842 148.98158 1161.28158 -42.91842 -1947.71842 37 38 39 40 41 42 130.48158 2476.88158 981.18158 -1805.71842 1223.38158 1480.98158 43 44 45 46 47 48 1691.28158 3269.18158 1660.38158 4216.18158 2709.78158 -1409.01842 49 50 51 52 53 54 3103.58158 2638.38158 -1840.91842 -3309.61842 -1207.52273 -695.22273 55 56 57 58 59 60 587.67727 -498.32273 -944.62273 1110.77727 429.07727 -1304.52273 > postscript(file="/var/www/html/rcomp/tmp/6mhuf1258560166.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 681.87727 NA 1 730.67727 681.87727 2 279.07727 730.67727 3 -436.92273 279.07727 4 -1150.12273 -436.92273 5 -1557.72273 -1150.12273 6 1982.17727 -1557.72273 7 697.37727 1982.17727 8 68.07727 697.37727 9 1445.17727 68.07727 10 -883.22273 1445.17727 11 -1999.72273 -883.22273 12 2060.77727 -1999.72273 13 605.17727 2060.77727 14 -593.01842 605.17727 15 -1642.81842 -593.01842 16 -2167.61842 -1642.81842 17 -1931.31842 -2167.61842 18 1389.28158 -1931.31842 19 -2513.11842 1389.28158 20 -243.61842 -2513.11842 21 112.28158 -243.61842 22 -2108.21842 112.28158 23 -3517.71842 -2108.21842 24 -218.51842 -3517.71842 25 248.98158 -218.51842 26 278.08158 248.98158 27 -2339.71842 278.08158 28 -758.91842 -2339.71842 29 -1109.01842 -758.91842 30 1667.48158 -1109.01842 31 -1088.51842 1667.48158 32 148.98158 -1088.51842 33 1161.28158 148.98158 34 -42.91842 1161.28158 35 -1947.71842 -42.91842 36 130.48158 -1947.71842 37 2476.88158 130.48158 38 981.18158 2476.88158 39 -1805.71842 981.18158 40 1223.38158 -1805.71842 41 1480.98158 1223.38158 42 1691.28158 1480.98158 43 3269.18158 1691.28158 44 1660.38158 3269.18158 45 4216.18158 1660.38158 46 2709.78158 4216.18158 47 -1409.01842 2709.78158 48 3103.58158 -1409.01842 49 2638.38158 3103.58158 50 -1840.91842 2638.38158 51 -3309.61842 -1840.91842 52 -1207.52273 -3309.61842 53 -695.22273 -1207.52273 54 587.67727 -695.22273 55 -498.32273 587.67727 56 -944.62273 -498.32273 57 1110.77727 -944.62273 58 429.07727 1110.77727 59 -1304.52273 429.07727 60 NA -1304.52273 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 730.67727 681.87727 [2,] 279.07727 730.67727 [3,] -436.92273 279.07727 [4,] -1150.12273 -436.92273 [5,] -1557.72273 -1150.12273 [6,] 1982.17727 -1557.72273 [7,] 697.37727 1982.17727 [8,] 68.07727 697.37727 [9,] 1445.17727 68.07727 [10,] -883.22273 1445.17727 [11,] -1999.72273 -883.22273 [12,] 2060.77727 -1999.72273 [13,] 605.17727 2060.77727 [14,] -593.01842 605.17727 [15,] -1642.81842 -593.01842 [16,] -2167.61842 -1642.81842 [17,] -1931.31842 -2167.61842 [18,] 1389.28158 -1931.31842 [19,] -2513.11842 1389.28158 [20,] -243.61842 -2513.11842 [21,] 112.28158 -243.61842 [22,] -2108.21842 112.28158 [23,] -3517.71842 -2108.21842 [24,] -218.51842 -3517.71842 [25,] 248.98158 -218.51842 [26,] 278.08158 248.98158 [27,] -2339.71842 278.08158 [28,] -758.91842 -2339.71842 [29,] -1109.01842 -758.91842 [30,] 1667.48158 -1109.01842 [31,] -1088.51842 1667.48158 [32,] 148.98158 -1088.51842 [33,] 1161.28158 148.98158 [34,] -42.91842 1161.28158 [35,] -1947.71842 -42.91842 [36,] 130.48158 -1947.71842 [37,] 2476.88158 130.48158 [38,] 981.18158 2476.88158 [39,] -1805.71842 981.18158 [40,] 1223.38158 -1805.71842 [41,] 1480.98158 1223.38158 [42,] 1691.28158 1480.98158 [43,] 3269.18158 1691.28158 [44,] 1660.38158 3269.18158 [45,] 4216.18158 1660.38158 [46,] 2709.78158 4216.18158 [47,] -1409.01842 2709.78158 [48,] 3103.58158 -1409.01842 [49,] 2638.38158 3103.58158 [50,] -1840.91842 2638.38158 [51,] -3309.61842 -1840.91842 [52,] -1207.52273 -3309.61842 [53,] -695.22273 -1207.52273 [54,] 587.67727 -695.22273 [55,] -498.32273 587.67727 [56,] -944.62273 -498.32273 [57,] 1110.77727 -944.62273 [58,] 429.07727 1110.77727 [59,] -1304.52273 429.07727 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 730.67727 681.87727 2 279.07727 730.67727 3 -436.92273 279.07727 4 -1150.12273 -436.92273 5 -1557.72273 -1150.12273 6 1982.17727 -1557.72273 7 697.37727 1982.17727 8 68.07727 697.37727 9 1445.17727 68.07727 10 -883.22273 1445.17727 11 -1999.72273 -883.22273 12 2060.77727 -1999.72273 13 605.17727 2060.77727 14 -593.01842 605.17727 15 -1642.81842 -593.01842 16 -2167.61842 -1642.81842 17 -1931.31842 -2167.61842 18 1389.28158 -1931.31842 19 -2513.11842 1389.28158 20 -243.61842 -2513.11842 21 112.28158 -243.61842 22 -2108.21842 112.28158 23 -3517.71842 -2108.21842 24 -218.51842 -3517.71842 25 248.98158 -218.51842 26 278.08158 248.98158 27 -2339.71842 278.08158 28 -758.91842 -2339.71842 29 -1109.01842 -758.91842 30 1667.48158 -1109.01842 31 -1088.51842 1667.48158 32 148.98158 -1088.51842 33 1161.28158 148.98158 34 -42.91842 1161.28158 35 -1947.71842 -42.91842 36 130.48158 -1947.71842 37 2476.88158 130.48158 38 981.18158 2476.88158 39 -1805.71842 981.18158 40 1223.38158 -1805.71842 41 1480.98158 1223.38158 42 1691.28158 1480.98158 43 3269.18158 1691.28158 44 1660.38158 3269.18158 45 4216.18158 1660.38158 46 2709.78158 4216.18158 47 -1409.01842 2709.78158 48 3103.58158 -1409.01842 49 2638.38158 3103.58158 50 -1840.91842 2638.38158 51 -3309.61842 -1840.91842 52 -1207.52273 -3309.61842 53 -695.22273 -1207.52273 54 587.67727 -695.22273 55 -498.32273 587.67727 56 -944.62273 -498.32273 57 1110.77727 -944.62273 58 429.07727 1110.77727 59 -1304.52273 429.07727 > 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/7pfrf1258560166.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/8saxc1258560166.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/9cm0y1258560166.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/10q14e1258560166.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/11bu9y1258560166.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/12k2t81258560166.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/1360sd1258560166.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/14t50m1258560166.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/15qnr11258560166.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/16jpbv1258560166.tab") + } > system("convert tmp/10pzf1258560166.ps tmp/10pzf1258560166.png") > system("convert tmp/2c0k31258560166.ps tmp/2c0k31258560166.png") > system("convert tmp/3l2at1258560166.ps tmp/3l2at1258560166.png") > system("convert tmp/4aepv1258560166.ps tmp/4aepv1258560166.png") > system("convert tmp/5e3u31258560166.ps tmp/5e3u31258560166.png") > system("convert tmp/6mhuf1258560166.ps tmp/6mhuf1258560166.png") > system("convert tmp/7pfrf1258560166.ps tmp/7pfrf1258560166.png") > system("convert tmp/8saxc1258560166.ps tmp/8saxc1258560166.png") > system("convert tmp/9cm0y1258560166.ps tmp/9cm0y1258560166.png") > system("convert tmp/10q14e1258560166.ps tmp/10q14e1258560166.png") > > > proc.time() user system elapsed 2.498 1.598 3.436