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(23,25.7,19,24.7,18,24.2,19,23.6,19,24.4,22,22.5,23,19.4,20,18.1,14,18.1,14,20.7,14,19.1,15,18.3,11,16.9,17,17.9,16,20.2,20,21.2,24,23.8,23,24,20,26.6,21,25.3,19,27.6,23,24.7,23,26.6,23,24.4,23,24.6,27,26,26,24.8,17,24,24,22.7,26,23,24,24.1,27,24,27,22.7,26,22.6,24,23.1,23,24.4,23,23,24,22,17,21.3,21,21.5,19,21.3,22,23.2,22,21.8,18,23.3,16,21,14,22.4,12,20.4,14,19.9,16,21.3,8,18.9,3,15.6,0,12.5,5,7.8,1,5.5,1,4,3,3.3,6,3.7,7,3.1,8,5,14,6.3),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 23 25.7 2 19 24.7 3 18 24.2 4 19 23.6 5 19 24.4 6 22 22.5 7 23 19.4 8 20 18.1 9 14 18.1 10 14 20.7 11 14 19.1 12 15 18.3 13 11 16.9 14 17 17.9 15 16 20.2 16 20 21.2 17 24 23.8 18 23 24.0 19 20 26.6 20 21 25.3 21 19 27.6 22 23 24.7 23 23 26.6 24 23 24.4 25 23 24.6 26 27 26.0 27 26 24.8 28 17 24.0 29 24 22.7 30 26 23.0 31 24 24.1 32 27 24.0 33 27 22.7 34 26 22.6 35 24 23.1 36 23 24.4 37 23 23.0 38 24 22.0 39 17 21.3 40 21 21.5 41 19 21.3 42 22 23.2 43 22 21.8 44 18 23.3 45 16 21.0 46 14 22.4 47 12 20.4 48 14 19.9 49 16 21.3 50 8 18.9 51 3 15.6 52 0 12.5 53 5 7.8 54 1 5.5 55 1 4.0 56 3 3.3 57 6 3.7 58 7 3.1 59 8 5.0 60 14 6.3 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X -0.3809 0.8983 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -10.8477 -2.7587 0.3557 3.0155 8.7217 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -0.3809 1.7463 -0.218 0.828 X 0.8983 0.0835 10.758 1.93e-15 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 4.222 on 58 degrees of freedom Multiple R-squared: 0.6661, Adjusted R-squared: 0.6604 F-statistic: 115.7 on 1 and 58 DF, p-value: 1.933e-15 > 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.029640796 0.059281592 0.9703592 [2,] 0.096657629 0.193315259 0.9033424 [3,] 0.057138901 0.114277803 0.9428611 [4,] 0.035237127 0.070474254 0.9647629 [5,] 0.129753664 0.259507329 0.8702463 [6,] 0.182690574 0.365381148 0.8173094 [7,] 0.172431504 0.344863008 0.8275685 [8,] 0.120715763 0.241431526 0.8792842 [9,] 0.129329052 0.258658104 0.8706709 [10,] 0.088845069 0.177690137 0.9111549 [11,] 0.058233362 0.116466725 0.9417666 [12,] 0.040809527 0.081619053 0.9591905 [13,] 0.041899251 0.083798502 0.9581007 [14,] 0.030672315 0.061344631 0.9693277 [15,] 0.024221041 0.048442083 0.9757790 [16,] 0.014342989 0.028685979 0.9856570 [17,] 0.016076163 0.032152326 0.9839238 [18,] 0.011506736 0.023013471 0.9884933 [19,] 0.006846884 0.013693768 0.9931531 [20,] 0.004718121 0.009436242 0.9952819 [21,] 0.003048582 0.006097163 0.9969514 [22,] 0.004184921 0.008369842 0.9958151 [23,] 0.004945184 0.009890368 0.9950548 [24,] 0.005135534 0.010271069 0.9948645 [25,] 0.005349728 0.010699456 0.9946503 [26,] 0.009437107 0.018874214 0.9905629 [27,] 0.007083617 0.014167233 0.9929164 [28,] 0.012046969 0.024093937 0.9879530 [29,] 0.028581595 0.057163190 0.9714184 [30,] 0.047831264 0.095662527 0.9521687 [31,] 0.047128298 0.094256595 0.9528717 [32,] 0.036056694 0.072113389 0.9639433 [33,] 0.033011658 0.066023315 0.9669883 [34,] 0.048917400 0.097834799 0.9510826 [35,] 0.035877388 0.071754775 0.9641226 [36,] 0.034275866 0.068551732 0.9657241 [37,] 0.027210615 0.054421230 0.9727894 [38,] 0.031534187 0.063068374 0.9684658 [39,] 0.060907701 0.121815403 0.9390923 [40,] 0.062010241 0.124020482 0.9379898 [41,] 0.061339594 0.122679188 0.9386604 [42,] 0.064358851 0.128717702 0.9356411 [43,] 0.061362676 0.122725353 0.9386373 [44,] 0.060718033 0.121436065 0.9392820 [45,] 0.168640168 0.337280337 0.8313598 [46,] 0.235623753 0.471247507 0.7643762 [47,] 0.221127318 0.442254636 0.7788727 [48,] 0.277069977 0.554139954 0.7229300 [49,] 0.273665465 0.547330931 0.7263345 [50,] 0.605421852 0.789156297 0.3945781 [51,] 0.825098682 0.349802637 0.1749013 > postscript(file="/var/www/html/rcomp/tmp/1613t1258563178.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/26sq71258563178.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/3r0dq1258563178.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/4y4dq1258563178.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/51uzi1258563178.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 0.2947835 -2.8069227 -3.3577758 -1.8187996 -2.5374346 2.1693236 7 8 9 10 11 12 5.9540342 4.1218161 -1.8781839 -4.2137476 -2.7764776 -1.0578426 13 14 15 16 17 18 -3.8002313 1.3014749 -1.7646008 1.3371055 3.0015417 1.8218829 19 20 21 22 23 24 -3.5136808 -1.3458990 -5.4119746 1.1930773 -0.5136808 1.4625654 25 26 27 28 29 30 1.2829067 4.0252954 4.1032479 -4.1781171 3.9896648 5.7201767 31 32 33 34 35 36 2.7320536 5.8218829 6.9896648 6.0794942 3.6303473 1.4625654 37 38 39 40 41 42 2.7201767 4.6184705 -1.7527239 2.0676173 0.2472761 1.5405179 43 44 45 46 47 48 2.7981292 -2.5493114 -2.4832358 -5.7408470 -5.9442595 -3.4951126 49 50 51 52 53 54 -2.7527239 -8.5968189 -10.6324495 -10.8477388 -1.6257581 -3.5596825 55 56 57 58 59 60 -2.2122418 0.4165638 3.0572463 4.5962226 3.8894644 8.7216825 > postscript(file="/var/www/html/rcomp/tmp/6xuz71258563178.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 0.2947835 NA 1 -2.8069227 0.2947835 2 -3.3577758 -2.8069227 3 -1.8187996 -3.3577758 4 -2.5374346 -1.8187996 5 2.1693236 -2.5374346 6 5.9540342 2.1693236 7 4.1218161 5.9540342 8 -1.8781839 4.1218161 9 -4.2137476 -1.8781839 10 -2.7764776 -4.2137476 11 -1.0578426 -2.7764776 12 -3.8002313 -1.0578426 13 1.3014749 -3.8002313 14 -1.7646008 1.3014749 15 1.3371055 -1.7646008 16 3.0015417 1.3371055 17 1.8218829 3.0015417 18 -3.5136808 1.8218829 19 -1.3458990 -3.5136808 20 -5.4119746 -1.3458990 21 1.1930773 -5.4119746 22 -0.5136808 1.1930773 23 1.4625654 -0.5136808 24 1.2829067 1.4625654 25 4.0252954 1.2829067 26 4.1032479 4.0252954 27 -4.1781171 4.1032479 28 3.9896648 -4.1781171 29 5.7201767 3.9896648 30 2.7320536 5.7201767 31 5.8218829 2.7320536 32 6.9896648 5.8218829 33 6.0794942 6.9896648 34 3.6303473 6.0794942 35 1.4625654 3.6303473 36 2.7201767 1.4625654 37 4.6184705 2.7201767 38 -1.7527239 4.6184705 39 2.0676173 -1.7527239 40 0.2472761 2.0676173 41 1.5405179 0.2472761 42 2.7981292 1.5405179 43 -2.5493114 2.7981292 44 -2.4832358 -2.5493114 45 -5.7408470 -2.4832358 46 -5.9442595 -5.7408470 47 -3.4951126 -5.9442595 48 -2.7527239 -3.4951126 49 -8.5968189 -2.7527239 50 -10.6324495 -8.5968189 51 -10.8477388 -10.6324495 52 -1.6257581 -10.8477388 53 -3.5596825 -1.6257581 54 -2.2122418 -3.5596825 55 0.4165638 -2.2122418 56 3.0572463 0.4165638 57 4.5962226 3.0572463 58 3.8894644 4.5962226 59 8.7216825 3.8894644 60 NA 8.7216825 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -2.8069227 0.2947835 [2,] -3.3577758 -2.8069227 [3,] -1.8187996 -3.3577758 [4,] -2.5374346 -1.8187996 [5,] 2.1693236 -2.5374346 [6,] 5.9540342 2.1693236 [7,] 4.1218161 5.9540342 [8,] -1.8781839 4.1218161 [9,] -4.2137476 -1.8781839 [10,] -2.7764776 -4.2137476 [11,] -1.0578426 -2.7764776 [12,] -3.8002313 -1.0578426 [13,] 1.3014749 -3.8002313 [14,] -1.7646008 1.3014749 [15,] 1.3371055 -1.7646008 [16,] 3.0015417 1.3371055 [17,] 1.8218829 3.0015417 [18,] -3.5136808 1.8218829 [19,] -1.3458990 -3.5136808 [20,] -5.4119746 -1.3458990 [21,] 1.1930773 -5.4119746 [22,] -0.5136808 1.1930773 [23,] 1.4625654 -0.5136808 [24,] 1.2829067 1.4625654 [25,] 4.0252954 1.2829067 [26,] 4.1032479 4.0252954 [27,] -4.1781171 4.1032479 [28,] 3.9896648 -4.1781171 [29,] 5.7201767 3.9896648 [30,] 2.7320536 5.7201767 [31,] 5.8218829 2.7320536 [32,] 6.9896648 5.8218829 [33,] 6.0794942 6.9896648 [34,] 3.6303473 6.0794942 [35,] 1.4625654 3.6303473 [36,] 2.7201767 1.4625654 [37,] 4.6184705 2.7201767 [38,] -1.7527239 4.6184705 [39,] 2.0676173 -1.7527239 [40,] 0.2472761 2.0676173 [41,] 1.5405179 0.2472761 [42,] 2.7981292 1.5405179 [43,] -2.5493114 2.7981292 [44,] -2.4832358 -2.5493114 [45,] -5.7408470 -2.4832358 [46,] -5.9442595 -5.7408470 [47,] -3.4951126 -5.9442595 [48,] -2.7527239 -3.4951126 [49,] -8.5968189 -2.7527239 [50,] -10.6324495 -8.5968189 [51,] -10.8477388 -10.6324495 [52,] -1.6257581 -10.8477388 [53,] -3.5596825 -1.6257581 [54,] -2.2122418 -3.5596825 [55,] 0.4165638 -2.2122418 [56,] 3.0572463 0.4165638 [57,] 4.5962226 3.0572463 [58,] 3.8894644 4.5962226 [59,] 8.7216825 3.8894644 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -2.8069227 0.2947835 2 -3.3577758 -2.8069227 3 -1.8187996 -3.3577758 4 -2.5374346 -1.8187996 5 2.1693236 -2.5374346 6 5.9540342 2.1693236 7 4.1218161 5.9540342 8 -1.8781839 4.1218161 9 -4.2137476 -1.8781839 10 -2.7764776 -4.2137476 11 -1.0578426 -2.7764776 12 -3.8002313 -1.0578426 13 1.3014749 -3.8002313 14 -1.7646008 1.3014749 15 1.3371055 -1.7646008 16 3.0015417 1.3371055 17 1.8218829 3.0015417 18 -3.5136808 1.8218829 19 -1.3458990 -3.5136808 20 -5.4119746 -1.3458990 21 1.1930773 -5.4119746 22 -0.5136808 1.1930773 23 1.4625654 -0.5136808 24 1.2829067 1.4625654 25 4.0252954 1.2829067 26 4.1032479 4.0252954 27 -4.1781171 4.1032479 28 3.9896648 -4.1781171 29 5.7201767 3.9896648 30 2.7320536 5.7201767 31 5.8218829 2.7320536 32 6.9896648 5.8218829 33 6.0794942 6.9896648 34 3.6303473 6.0794942 35 1.4625654 3.6303473 36 2.7201767 1.4625654 37 4.6184705 2.7201767 38 -1.7527239 4.6184705 39 2.0676173 -1.7527239 40 0.2472761 2.0676173 41 1.5405179 0.2472761 42 2.7981292 1.5405179 43 -2.5493114 2.7981292 44 -2.4832358 -2.5493114 45 -5.7408470 -2.4832358 46 -5.9442595 -5.7408470 47 -3.4951126 -5.9442595 48 -2.7527239 -3.4951126 49 -8.5968189 -2.7527239 50 -10.6324495 -8.5968189 51 -10.8477388 -10.6324495 52 -1.6257581 -10.8477388 53 -3.5596825 -1.6257581 54 -2.2122418 -3.5596825 55 0.4165638 -2.2122418 56 3.0572463 0.4165638 57 4.5962226 3.0572463 58 3.8894644 4.5962226 59 8.7216825 3.8894644 > 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/77f4u1258563178.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/8eokg1258563178.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/965h71258563178.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/108thz1258563178.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/11crz61258563178.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/12qx4b1258563178.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/13si9c1258563178.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/14cbox1258563178.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/15d0ow1258563178.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/162tz91258563178.tab") + } > > system("convert tmp/1613t1258563178.ps tmp/1613t1258563178.png") > system("convert tmp/26sq71258563178.ps tmp/26sq71258563178.png") > system("convert tmp/3r0dq1258563178.ps tmp/3r0dq1258563178.png") > system("convert tmp/4y4dq1258563178.ps tmp/4y4dq1258563178.png") > system("convert tmp/51uzi1258563178.ps tmp/51uzi1258563178.png") > system("convert tmp/6xuz71258563178.ps tmp/6xuz71258563178.png") > system("convert tmp/77f4u1258563178.ps tmp/77f4u1258563178.png") > system("convert tmp/8eokg1258563178.ps tmp/8eokg1258563178.png") > system("convert tmp/965h71258563178.ps tmp/965h71258563178.png") > system("convert tmp/108thz1258563178.ps tmp/108thz1258563178.png") > > > proc.time() user system elapsed 2.458 1.558 2.875