R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(10540.05,0,10601.61,0,10323.73,0,10418.4,0,10092.96,0,10364.91,0,10152.09,0,10032.8,0,10204.59,0,10001.6,0,10411.75,0,10673.38,0,10539.51,0,10723.78,0,10682.06,0,10283.19,0,10377.18,0,10486.64,0,10545.38,0,10554.27,0,10532.54,0,10324.31,0,10695.25,0,10827.81,0,10872.48,0,10971.19,0,11145.65,0,11234.68,0,11333.88,0,10997.97,0,11036.89,0,11257.35,0,11533.59,0,11963.12,0,12185.15,0,12377.62,0,12512.89,0,12631.48,0,12268.53,0,12754.8,1,13407.75,1,13480.21,1,13673.28,1,13239.71,1,13557.69,1,13901.28,1,13200.58,1,13406.97,1,12538.12,1,12419.57,1,12193.88,1,12656.63,1,12812.48,1,12056.67,1,11322.38,1,11530.75,1,11114.08,1,9181.73,1,8614.55,1),dim=c(2,59),dimnames=list(c('DowJones','Dummy'),1:59)) > y <- array(NA,dim=c(2,59),dimnames=list(c('DowJones','Dummy'),1:59)) > 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 DowJones Dummy 1 10540.05 0 2 10601.61 0 3 10323.73 0 4 10418.40 0 5 10092.96 0 6 10364.91 0 7 10152.09 0 8 10032.80 0 9 10204.59 0 10 10001.60 0 11 10411.75 0 12 10673.38 0 13 10539.51 0 14 10723.78 0 15 10682.06 0 16 10283.19 0 17 10377.18 0 18 10486.64 0 19 10545.38 0 20 10554.27 0 21 10532.54 0 22 10324.31 0 23 10695.25 0 24 10827.81 0 25 10872.48 0 26 10971.19 0 27 11145.65 0 28 11234.68 0 29 11333.88 0 30 10997.97 0 31 11036.89 0 32 11257.35 0 33 11533.59 0 34 11963.12 0 35 12185.15 0 36 12377.62 0 37 12512.89 0 38 12631.48 0 39 12268.53 0 40 12754.80 1 41 13407.75 1 42 13480.21 1 43 13673.28 1 44 13239.71 1 45 13557.69 1 46 13901.28 1 47 13200.58 1 48 13406.97 1 49 12538.12 1 50 12419.57 1 51 12193.88 1 52 12656.63 1 53 12812.48 1 54 12056.67 1 55 11322.38 1 56 11530.75 1 57 11114.08 1 58 9181.73 1 59 8614.55 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Dummy 10890 1463 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -3738.6 -495.6 -159.3 551.4 1741.4 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 10890.1 161.9 67.261 < 2e-16 *** Dummy 1463.1 278.1 5.261 2.25e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1011 on 57 degrees of freedom Multiple R-squared: 0.3269, Adjusted R-squared: 0.3151 F-statistic: 27.68 on 1 and 57 DF, p-value: 2.246e-06 > 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,] 1.455050e-02 2.910101e-02 0.9854495 [2,] 2.629940e-03 5.259880e-03 0.9973701 [3,] 8.223839e-04 1.644768e-03 0.9991776 [4,] 4.137843e-04 8.275686e-04 0.9995862 [5,] 9.080888e-05 1.816178e-04 0.9999092 [6,] 4.303255e-05 8.606510e-05 0.9999570 [7,] 1.018301e-05 2.036603e-05 0.9999898 [8,] 7.528902e-06 1.505780e-05 0.9999925 [9,] 2.357694e-06 4.715387e-06 0.9999976 [10,] 1.588926e-06 3.177853e-06 0.9999984 [11,] 7.223445e-07 1.444689e-06 0.9999993 [12,] 1.854073e-07 3.708146e-07 0.9999998 [13,] 4.262262e-08 8.524523e-08 1.0000000 [14,] 1.035681e-08 2.071361e-08 1.0000000 [15,] 2.793472e-09 5.586943e-09 1.0000000 [16,] 7.576537e-10 1.515307e-09 1.0000000 [17,] 1.930758e-10 3.861516e-10 1.0000000 [18,] 4.947666e-11 9.895333e-11 1.0000000 [19,] 2.402749e-11 4.805499e-11 1.0000000 [20,] 2.363333e-11 4.726666e-11 1.0000000 [21,] 2.530005e-11 5.060011e-11 1.0000000 [22,] 4.072609e-11 8.145218e-11 1.0000000 [23,] 1.472027e-10 2.944055e-10 1.0000000 [24,] 5.269212e-10 1.053842e-09 1.0000000 [25,] 1.913591e-09 3.827181e-09 1.0000000 [26,] 1.326777e-09 2.653555e-09 1.0000000 [27,] 1.027204e-09 2.054408e-09 1.0000000 [28,] 1.548052e-09 3.096104e-09 1.0000000 [29,] 5.731608e-09 1.146322e-08 1.0000000 [30,] 8.079610e-08 1.615922e-07 0.9999999 [31,] 9.369591e-07 1.873918e-06 0.9999991 [32,] 7.525654e-06 1.505131e-05 0.9999925 [33,] 3.799309e-05 7.598619e-05 0.9999620 [34,] 1.347580e-04 2.695160e-04 0.9998652 [35,] 1.743305e-04 3.486610e-04 0.9998257 [36,] 8.376802e-05 1.675360e-04 0.9999162 [37,] 5.823746e-05 1.164749e-04 0.9999418 [38,] 4.196842e-05 8.393684e-05 0.9999580 [39,] 3.981815e-05 7.963631e-05 0.9999602 [40,] 2.627756e-05 5.255513e-05 0.9999737 [41,] 2.674416e-05 5.348833e-05 0.9999733 [42,] 6.418271e-05 1.283654e-04 0.9999358 [43,] 6.905087e-05 1.381017e-04 0.9999309 [44,] 1.341306e-04 2.682612e-04 0.9998659 [45,] 1.344846e-04 2.689692e-04 0.9998655 [46,] 1.341362e-04 2.682723e-04 0.9998659 [47,] 1.268370e-04 2.536740e-04 0.9998732 [48,] 2.213596e-04 4.427192e-04 0.9997786 [49,] 1.171586e-03 2.343172e-03 0.9988284 [50,] 3.206617e-03 6.413233e-03 0.9967934 > postscript(file="/var/www/html/rcomp/tmp/1vo8g1229173804.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/2uo5m1229173804.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/3ig4b1229173804.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/4xvyf1229173804.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/5aykt1229173804.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 = 59 Frequency = 1 1 2 3 4 5 6 -350.00795 -288.44795 -566.32795 -471.65795 -797.09795 -525.14795 7 8 9 10 11 12 -737.96795 -857.25795 -685.46795 -888.45795 -478.30795 -216.67795 13 14 15 16 17 18 -350.54795 -166.27795 -207.99795 -606.86795 -512.87795 -403.41795 19 20 21 22 23 24 -344.67795 -335.78795 -357.51795 -565.74795 -194.80795 -62.24795 25 26 27 28 29 30 -17.57795 81.13205 255.59205 344.62205 443.82205 107.91205 31 32 33 34 35 36 146.83205 367.29205 643.53205 1073.06205 1295.09205 1487.56205 37 38 39 40 41 42 1622.83205 1741.42205 1378.47205 401.64450 1054.59450 1127.05450 43 44 45 46 47 48 1320.12450 886.55450 1204.53450 1548.12450 847.42450 1053.81450 49 50 51 52 53 54 184.96450 66.41450 -159.27550 303.47450 459.32450 -296.48550 55 56 57 58 59 -1030.77550 -822.40550 -1239.07550 -3171.42550 -3738.60550 > postscript(file="/var/www/html/rcomp/tmp/6pc3w1229173804.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 = 59 Frequency = 1 lag(myerror, k = 1) myerror 0 -350.00795 NA 1 -288.44795 -350.00795 2 -566.32795 -288.44795 3 -471.65795 -566.32795 4 -797.09795 -471.65795 5 -525.14795 -797.09795 6 -737.96795 -525.14795 7 -857.25795 -737.96795 8 -685.46795 -857.25795 9 -888.45795 -685.46795 10 -478.30795 -888.45795 11 -216.67795 -478.30795 12 -350.54795 -216.67795 13 -166.27795 -350.54795 14 -207.99795 -166.27795 15 -606.86795 -207.99795 16 -512.87795 -606.86795 17 -403.41795 -512.87795 18 -344.67795 -403.41795 19 -335.78795 -344.67795 20 -357.51795 -335.78795 21 -565.74795 -357.51795 22 -194.80795 -565.74795 23 -62.24795 -194.80795 24 -17.57795 -62.24795 25 81.13205 -17.57795 26 255.59205 81.13205 27 344.62205 255.59205 28 443.82205 344.62205 29 107.91205 443.82205 30 146.83205 107.91205 31 367.29205 146.83205 32 643.53205 367.29205 33 1073.06205 643.53205 34 1295.09205 1073.06205 35 1487.56205 1295.09205 36 1622.83205 1487.56205 37 1741.42205 1622.83205 38 1378.47205 1741.42205 39 401.64450 1378.47205 40 1054.59450 401.64450 41 1127.05450 1054.59450 42 1320.12450 1127.05450 43 886.55450 1320.12450 44 1204.53450 886.55450 45 1548.12450 1204.53450 46 847.42450 1548.12450 47 1053.81450 847.42450 48 184.96450 1053.81450 49 66.41450 184.96450 50 -159.27550 66.41450 51 303.47450 -159.27550 52 459.32450 303.47450 53 -296.48550 459.32450 54 -1030.77550 -296.48550 55 -822.40550 -1030.77550 56 -1239.07550 -822.40550 57 -3171.42550 -1239.07550 58 -3738.60550 -3171.42550 59 NA -3738.60550 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -288.44795 -350.00795 [2,] -566.32795 -288.44795 [3,] -471.65795 -566.32795 [4,] -797.09795 -471.65795 [5,] -525.14795 -797.09795 [6,] -737.96795 -525.14795 [7,] -857.25795 -737.96795 [8,] -685.46795 -857.25795 [9,] -888.45795 -685.46795 [10,] -478.30795 -888.45795 [11,] -216.67795 -478.30795 [12,] -350.54795 -216.67795 [13,] -166.27795 -350.54795 [14,] -207.99795 -166.27795 [15,] -606.86795 -207.99795 [16,] -512.87795 -606.86795 [17,] -403.41795 -512.87795 [18,] -344.67795 -403.41795 [19,] -335.78795 -344.67795 [20,] -357.51795 -335.78795 [21,] -565.74795 -357.51795 [22,] -194.80795 -565.74795 [23,] -62.24795 -194.80795 [24,] -17.57795 -62.24795 [25,] 81.13205 -17.57795 [26,] 255.59205 81.13205 [27,] 344.62205 255.59205 [28,] 443.82205 344.62205 [29,] 107.91205 443.82205 [30,] 146.83205 107.91205 [31,] 367.29205 146.83205 [32,] 643.53205 367.29205 [33,] 1073.06205 643.53205 [34,] 1295.09205 1073.06205 [35,] 1487.56205 1295.09205 [36,] 1622.83205 1487.56205 [37,] 1741.42205 1622.83205 [38,] 1378.47205 1741.42205 [39,] 401.64450 1378.47205 [40,] 1054.59450 401.64450 [41,] 1127.05450 1054.59450 [42,] 1320.12450 1127.05450 [43,] 886.55450 1320.12450 [44,] 1204.53450 886.55450 [45,] 1548.12450 1204.53450 [46,] 847.42450 1548.12450 [47,] 1053.81450 847.42450 [48,] 184.96450 1053.81450 [49,] 66.41450 184.96450 [50,] -159.27550 66.41450 [51,] 303.47450 -159.27550 [52,] 459.32450 303.47450 [53,] -296.48550 459.32450 [54,] -1030.77550 -296.48550 [55,] -822.40550 -1030.77550 [56,] -1239.07550 -822.40550 [57,] -3171.42550 -1239.07550 [58,] -3738.60550 -3171.42550 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -288.44795 -350.00795 2 -566.32795 -288.44795 3 -471.65795 -566.32795 4 -797.09795 -471.65795 5 -525.14795 -797.09795 6 -737.96795 -525.14795 7 -857.25795 -737.96795 8 -685.46795 -857.25795 9 -888.45795 -685.46795 10 -478.30795 -888.45795 11 -216.67795 -478.30795 12 -350.54795 -216.67795 13 -166.27795 -350.54795 14 -207.99795 -166.27795 15 -606.86795 -207.99795 16 -512.87795 -606.86795 17 -403.41795 -512.87795 18 -344.67795 -403.41795 19 -335.78795 -344.67795 20 -357.51795 -335.78795 21 -565.74795 -357.51795 22 -194.80795 -565.74795 23 -62.24795 -194.80795 24 -17.57795 -62.24795 25 81.13205 -17.57795 26 255.59205 81.13205 27 344.62205 255.59205 28 443.82205 344.62205 29 107.91205 443.82205 30 146.83205 107.91205 31 367.29205 146.83205 32 643.53205 367.29205 33 1073.06205 643.53205 34 1295.09205 1073.06205 35 1487.56205 1295.09205 36 1622.83205 1487.56205 37 1741.42205 1622.83205 38 1378.47205 1741.42205 39 401.64450 1378.47205 40 1054.59450 401.64450 41 1127.05450 1054.59450 42 1320.12450 1127.05450 43 886.55450 1320.12450 44 1204.53450 886.55450 45 1548.12450 1204.53450 46 847.42450 1548.12450 47 1053.81450 847.42450 48 184.96450 1053.81450 49 66.41450 184.96450 50 -159.27550 66.41450 51 303.47450 -159.27550 52 459.32450 303.47450 53 -296.48550 459.32450 54 -1030.77550 -296.48550 55 -822.40550 -1030.77550 56 -1239.07550 -822.40550 57 -3171.42550 -1239.07550 58 -3738.60550 -3171.42550 > 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/7e77d1229173805.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/8jpsz1229173805.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/921081229173805.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/102s1x1229173805.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/11k6yd1229173805.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/12fyb01229173805.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/133gtt1229173805.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/1462t71229173805.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/15utjh1229173805.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/16238w1229173805.tab") + } > > system("convert tmp/1vo8g1229173804.ps tmp/1vo8g1229173804.png") > system("convert tmp/2uo5m1229173804.ps tmp/2uo5m1229173804.png") > system("convert tmp/3ig4b1229173804.ps tmp/3ig4b1229173804.png") > system("convert tmp/4xvyf1229173804.ps tmp/4xvyf1229173804.png") > system("convert tmp/5aykt1229173804.ps tmp/5aykt1229173804.png") > system("convert tmp/6pc3w1229173804.ps tmp/6pc3w1229173804.png") > system("convert tmp/7e77d1229173805.ps tmp/7e77d1229173805.png") > system("convert tmp/8jpsz1229173805.ps tmp/8jpsz1229173805.png") > system("convert tmp/921081229173805.ps tmp/921081229173805.png") > system("convert tmp/102s1x1229173805.ps tmp/102s1x1229173805.png") > > > proc.time() user system elapsed 2.482 1.602 2.970