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(130,87.1,136.7,110.5,138.1,110.8,139.5,104.2,140.4,88.9,144.6,89.8,151.4,90,147.9,93.9,141.5,91.3,143.8,87.8,143.6,99.7,150.5,73.5,150.1,79.2,154.9,96.9,162.1,95.2,176.7,95.6,186.6,89.7,194.8,92.8,196.3,88,228.8,101.1,267.2,92.7,237.2,95.8,254.7,103.8,258.2,81.8,257.9,87.1,269.6,105.9,266.9,108.1,269.6,102.6,253.9,93.7,258.6,103.5,274.2,100.6,301.5,113.3,304.5,102.4,285.1,102.1,287.7,106.9,265.5,87.3,264.1,93.1,276.1,109.1,258.9,120.3,239.1,104.9,250.1,92.6,276.8,109.8,297.6,111.4,295.4,117.9,283,121.6,275.8,117.8,279.7,124.2,254.6,106.8,234.6,102.7,176.9,116.8,148.1,113.6,122.7,96.1,124.9,85,121.6,83.2,128.4,84.9,144.5,83,151.8,79.6,167.1,83.2,173.8,83.8,203.7,82.8,199.8,71.4),dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Y','X'),1:61)) > 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 130.0 87.1 2 136.7 110.5 3 138.1 110.8 4 139.5 104.2 5 140.4 88.9 6 144.6 89.8 7 151.4 90.0 8 147.9 93.9 9 141.5 91.3 10 143.8 87.8 11 143.6 99.7 12 150.5 73.5 13 150.1 79.2 14 154.9 96.9 15 162.1 95.2 16 176.7 95.6 17 186.6 89.7 18 194.8 92.8 19 196.3 88.0 20 228.8 101.1 21 267.2 92.7 22 237.2 95.8 23 254.7 103.8 24 258.2 81.8 25 257.9 87.1 26 269.6 105.9 27 266.9 108.1 28 269.6 102.6 29 253.9 93.7 30 258.6 103.5 31 274.2 100.6 32 301.5 113.3 33 304.5 102.4 34 285.1 102.1 35 287.7 106.9 36 265.5 87.3 37 264.1 93.1 38 276.1 109.1 39 258.9 120.3 40 239.1 104.9 41 250.1 92.6 42 276.8 109.8 43 297.6 111.4 44 295.4 117.9 45 283.0 121.6 46 275.8 117.8 47 279.7 124.2 48 254.6 106.8 49 234.6 102.7 50 176.9 116.8 51 148.1 113.6 52 122.7 96.1 53 124.9 85.0 54 121.6 83.2 55 128.4 84.9 56 144.5 83.0 57 151.8 79.6 58 167.1 83.2 59 173.8 83.8 60 203.7 82.8 61 199.8 71.4 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X -32.126 2.484 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -105.685 -46.361 9.767 38.642 87.113 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -32.1257 53.3655 -0.602 0.55 X 2.4843 0.5428 4.577 2.48e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 52.7 on 59 degrees of freedom Multiple R-squared: 0.262, Adjusted R-squared: 0.2495 F-statistic: 20.95 on 1 and 59 DF, p-value: 2.482e-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,] 1.069250e-03 2.138500e-03 0.99893075 [2,] 3.260394e-04 6.520789e-04 0.99967396 [3,] 2.177573e-04 4.355145e-04 0.99978224 [4,] 5.023915e-05 1.004783e-04 0.99994976 [5,] 7.381104e-06 1.476221e-05 0.99999262 [6,] 1.023793e-06 2.047586e-06 0.99999898 [7,] 1.820019e-07 3.640038e-07 0.99999982 [8,] 2.745694e-08 5.491387e-08 0.99999997 [9,] 4.023443e-09 8.046887e-09 1.00000000 [10,] 5.595128e-09 1.119026e-08 0.99999999 [11,] 2.287868e-08 4.575737e-08 0.99999998 [12,] 7.607926e-07 1.521585e-06 0.99999924 [13,] 9.703635e-06 1.940727e-05 0.99999030 [14,] 7.815549e-05 1.563110e-04 0.99992184 [15,] 2.075953e-04 4.151905e-04 0.99979240 [16,] 4.143302e-03 8.286605e-03 0.99585670 [17,] 8.072268e-02 1.614454e-01 0.91927732 [18,] 1.274700e-01 2.549399e-01 0.87253003 [19,] 2.061133e-01 4.122265e-01 0.79388674 [20,] 3.519081e-01 7.038163e-01 0.64809187 [21,] 4.582665e-01 9.165330e-01 0.54173349 [22,] 5.444768e-01 9.110464e-01 0.45552322 [23,] 5.709155e-01 8.581690e-01 0.42908450 [24,] 5.996510e-01 8.006980e-01 0.40034902 [25,] 6.116118e-01 7.767765e-01 0.38838823 [26,] 5.890656e-01 8.218689e-01 0.41093444 [27,] 6.130586e-01 7.738827e-01 0.38694137 [28,] 6.297782e-01 7.404435e-01 0.37022175 [29,] 7.235828e-01 5.528345e-01 0.27641723 [30,] 7.480136e-01 5.039729e-01 0.25198644 [31,] 7.487804e-01 5.024392e-01 0.25121962 [32,] 8.240512e-01 3.518976e-01 0.17594881 [33,] 8.552323e-01 2.895355e-01 0.14476774 [34,] 8.355173e-01 3.289654e-01 0.16448271 [35,] 7.812894e-01 4.374211e-01 0.21871056 [36,] 7.218896e-01 5.562209e-01 0.27811044 [37,] 7.382546e-01 5.234909e-01 0.26174544 [38,] 7.159797e-01 5.680406e-01 0.28402031 [39,] 7.512598e-01 4.974805e-01 0.24874023 [40,] 7.531123e-01 4.937754e-01 0.24688772 [41,] 7.267320e-01 5.465360e-01 0.27326798 [42,] 7.283022e-01 5.433955e-01 0.27169776 [43,] 7.806703e-01 4.386595e-01 0.21932973 [44,] 8.873205e-01 2.253591e-01 0.11267954 [45,] 9.617453e-01 7.650938e-02 0.03825469 [46,] 9.688997e-01 6.220061e-02 0.03110031 [47,] 9.824801e-01 3.503987e-02 0.01751994 [48,] 9.705777e-01 5.884468e-02 0.02942234 [49,] 9.515498e-01 9.690045e-02 0.04845023 [50,] 9.485548e-01 1.028903e-01 0.05144516 [51,] 9.346761e-01 1.306478e-01 0.06532389 [52,] 8.998465e-01 2.003071e-01 0.10015354 > postscript(file="/var/www/html/rcomp/tmp/1np2l1258731654.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/2zdlp1258731654.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/3kemt1258731654.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/4hbyv1258731654.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/5o7qv1258731654.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 = 61 Frequency = 1 1 2 3 4 5 -54.25346947 -105.68517467 -105.03045295 -87.23433096 -48.32513910 6 7 8 9 10 -46.36097391 -40.05782610 -53.24644363 -53.18736527 -42.19245210 11 12 13 14 15 -71.95515689 0.03247886 -14.52780831 -53.69922635 -42.27598281 16 17 18 19 20 -28.66968717 -4.11254782 -3.61375663 9.81069572 9.76687784 21 22 23 24 25 69.03466946 31.33346065 28.95937340 87.11311333 73.64653053 26 27 28 29 30 38.64242549 30.47705150 46.84048649 53.25040855 33.60465167 31 32 33 34 35 56.40900830 52.15889479 82.23733867 63.58261694 54.25816459 36 37 38 39 40 80.74967835 64.94096509 37.19279060 -7.83093155 10.62668640 41 42 43 44 45 52.18309555 36.15380796 52.97899051 34.63129462 13.03952927 46 47 48 49 50 15.27972071 3.28045091 21.40659068 11.59206039 -81.13601838 51 52 53 54 55 -101.98638348 -83.91181762 -54.13652156 -52.96485193 -50.38809547 56 57 58 59 60 -29.56799975 -13.82151267 -7.46485193 -2.25540848 30.12885243 61 54.54942676 > postscript(file="/var/www/html/rcomp/tmp/64uzu1258731655.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 -54.25346947 NA 1 -105.68517467 -54.25346947 2 -105.03045295 -105.68517467 3 -87.23433096 -105.03045295 4 -48.32513910 -87.23433096 5 -46.36097391 -48.32513910 6 -40.05782610 -46.36097391 7 -53.24644363 -40.05782610 8 -53.18736527 -53.24644363 9 -42.19245210 -53.18736527 10 -71.95515689 -42.19245210 11 0.03247886 -71.95515689 12 -14.52780831 0.03247886 13 -53.69922635 -14.52780831 14 -42.27598281 -53.69922635 15 -28.66968717 -42.27598281 16 -4.11254782 -28.66968717 17 -3.61375663 -4.11254782 18 9.81069572 -3.61375663 19 9.76687784 9.81069572 20 69.03466946 9.76687784 21 31.33346065 69.03466946 22 28.95937340 31.33346065 23 87.11311333 28.95937340 24 73.64653053 87.11311333 25 38.64242549 73.64653053 26 30.47705150 38.64242549 27 46.84048649 30.47705150 28 53.25040855 46.84048649 29 33.60465167 53.25040855 30 56.40900830 33.60465167 31 52.15889479 56.40900830 32 82.23733867 52.15889479 33 63.58261694 82.23733867 34 54.25816459 63.58261694 35 80.74967835 54.25816459 36 64.94096509 80.74967835 37 37.19279060 64.94096509 38 -7.83093155 37.19279060 39 10.62668640 -7.83093155 40 52.18309555 10.62668640 41 36.15380796 52.18309555 42 52.97899051 36.15380796 43 34.63129462 52.97899051 44 13.03952927 34.63129462 45 15.27972071 13.03952927 46 3.28045091 15.27972071 47 21.40659068 3.28045091 48 11.59206039 21.40659068 49 -81.13601838 11.59206039 50 -101.98638348 -81.13601838 51 -83.91181762 -101.98638348 52 -54.13652156 -83.91181762 53 -52.96485193 -54.13652156 54 -50.38809547 -52.96485193 55 -29.56799975 -50.38809547 56 -13.82151267 -29.56799975 57 -7.46485193 -13.82151267 58 -2.25540848 -7.46485193 59 30.12885243 -2.25540848 60 54.54942676 30.12885243 61 NA 54.54942676 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -105.68517467 -54.25346947 [2,] -105.03045295 -105.68517467 [3,] -87.23433096 -105.03045295 [4,] -48.32513910 -87.23433096 [5,] -46.36097391 -48.32513910 [6,] -40.05782610 -46.36097391 [7,] -53.24644363 -40.05782610 [8,] -53.18736527 -53.24644363 [9,] -42.19245210 -53.18736527 [10,] -71.95515689 -42.19245210 [11,] 0.03247886 -71.95515689 [12,] -14.52780831 0.03247886 [13,] -53.69922635 -14.52780831 [14,] -42.27598281 -53.69922635 [15,] -28.66968717 -42.27598281 [16,] -4.11254782 -28.66968717 [17,] -3.61375663 -4.11254782 [18,] 9.81069572 -3.61375663 [19,] 9.76687784 9.81069572 [20,] 69.03466946 9.76687784 [21,] 31.33346065 69.03466946 [22,] 28.95937340 31.33346065 [23,] 87.11311333 28.95937340 [24,] 73.64653053 87.11311333 [25,] 38.64242549 73.64653053 [26,] 30.47705150 38.64242549 [27,] 46.84048649 30.47705150 [28,] 53.25040855 46.84048649 [29,] 33.60465167 53.25040855 [30,] 56.40900830 33.60465167 [31,] 52.15889479 56.40900830 [32,] 82.23733867 52.15889479 [33,] 63.58261694 82.23733867 [34,] 54.25816459 63.58261694 [35,] 80.74967835 54.25816459 [36,] 64.94096509 80.74967835 [37,] 37.19279060 64.94096509 [38,] -7.83093155 37.19279060 [39,] 10.62668640 -7.83093155 [40,] 52.18309555 10.62668640 [41,] 36.15380796 52.18309555 [42,] 52.97899051 36.15380796 [43,] 34.63129462 52.97899051 [44,] 13.03952927 34.63129462 [45,] 15.27972071 13.03952927 [46,] 3.28045091 15.27972071 [47,] 21.40659068 3.28045091 [48,] 11.59206039 21.40659068 [49,] -81.13601838 11.59206039 [50,] -101.98638348 -81.13601838 [51,] -83.91181762 -101.98638348 [52,] -54.13652156 -83.91181762 [53,] -52.96485193 -54.13652156 [54,] -50.38809547 -52.96485193 [55,] -29.56799975 -50.38809547 [56,] -13.82151267 -29.56799975 [57,] -7.46485193 -13.82151267 [58,] -2.25540848 -7.46485193 [59,] 30.12885243 -2.25540848 [60,] 54.54942676 30.12885243 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -105.68517467 -54.25346947 2 -105.03045295 -105.68517467 3 -87.23433096 -105.03045295 4 -48.32513910 -87.23433096 5 -46.36097391 -48.32513910 6 -40.05782610 -46.36097391 7 -53.24644363 -40.05782610 8 -53.18736527 -53.24644363 9 -42.19245210 -53.18736527 10 -71.95515689 -42.19245210 11 0.03247886 -71.95515689 12 -14.52780831 0.03247886 13 -53.69922635 -14.52780831 14 -42.27598281 -53.69922635 15 -28.66968717 -42.27598281 16 -4.11254782 -28.66968717 17 -3.61375663 -4.11254782 18 9.81069572 -3.61375663 19 9.76687784 9.81069572 20 69.03466946 9.76687784 21 31.33346065 69.03466946 22 28.95937340 31.33346065 23 87.11311333 28.95937340 24 73.64653053 87.11311333 25 38.64242549 73.64653053 26 30.47705150 38.64242549 27 46.84048649 30.47705150 28 53.25040855 46.84048649 29 33.60465167 53.25040855 30 56.40900830 33.60465167 31 52.15889479 56.40900830 32 82.23733867 52.15889479 33 63.58261694 82.23733867 34 54.25816459 63.58261694 35 80.74967835 54.25816459 36 64.94096509 80.74967835 37 37.19279060 64.94096509 38 -7.83093155 37.19279060 39 10.62668640 -7.83093155 40 52.18309555 10.62668640 41 36.15380796 52.18309555 42 52.97899051 36.15380796 43 34.63129462 52.97899051 44 13.03952927 34.63129462 45 15.27972071 13.03952927 46 3.28045091 15.27972071 47 21.40659068 3.28045091 48 11.59206039 21.40659068 49 -81.13601838 11.59206039 50 -101.98638348 -81.13601838 51 -83.91181762 -101.98638348 52 -54.13652156 -83.91181762 53 -52.96485193 -54.13652156 54 -50.38809547 -52.96485193 55 -29.56799975 -50.38809547 56 -13.82151267 -29.56799975 57 -7.46485193 -13.82151267 58 -2.25540848 -7.46485193 59 30.12885243 -2.25540848 60 54.54942676 30.12885243 > 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/7x8hg1258731655.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/8ufjh1258731655.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/9zi6m1258731655.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/103ahj1258731655.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/11n3z51258731655.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/12o0uc1258731655.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/1303nv1258731655.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/14tpq51258731655.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/15izaq1258731655.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/16lkhe1258731655.tab") + } > > system("convert tmp/1np2l1258731654.ps tmp/1np2l1258731654.png") > system("convert tmp/2zdlp1258731654.ps tmp/2zdlp1258731654.png") > system("convert tmp/3kemt1258731654.ps tmp/3kemt1258731654.png") > system("convert tmp/4hbyv1258731654.ps tmp/4hbyv1258731654.png") > system("convert tmp/5o7qv1258731654.ps tmp/5o7qv1258731654.png") > system("convert tmp/64uzu1258731655.ps tmp/64uzu1258731655.png") > system("convert tmp/7x8hg1258731655.ps tmp/7x8hg1258731655.png") > system("convert tmp/8ufjh1258731655.ps tmp/8ufjh1258731655.png") > system("convert tmp/9zi6m1258731655.ps tmp/9zi6m1258731655.png") > system("convert tmp/103ahj1258731655.ps tmp/103ahj1258731655.png") > > > proc.time() user system elapsed 2.437 1.508 2.858