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(10.9,96.8,10,114.1,9.2,110.3,9.2,103.9,9.5,101.6,9.6,94.6,9.5,95.9,9.1,104.7,8.9,102.8,9,98.1,10.1,113.9,10.3,80.9,10.2,95.7,9.6,113.2,9.2,105.9,9.3,108.8,9.4,102.3,9.4,99,9.2,100.7,9,115.5,9,100.7,9,109.9,9.8,114.6,10,85.4,9.8,100.5,9.3,114.8,9,116.5,9,112.9,9.1,102,9.1,106,9.1,105.3,9.2,118.8,8.8,106.1,8.3,109.3,8.4,117.2,8.1,92.5,7.7,104.2,7.9,112.5,7.9,122.4,8,113.3,7.9,100,7.6,110.7,7.1,112.8,6.8,109.8,6.5,117.3,6.9,109.1,8.2,115.9,8.7,96,8.3,99.8,7.9,116.8,7.5,115.7,7.8,99.4,8.3,94.3,8.4,91,8.2,93.2,7.7,103.1,7.2,94.1,7.3,91.8,8.1,102.7,8.5,82.6),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 10.9 96.8 2 10.0 114.1 3 9.2 110.3 4 9.2 103.9 5 9.5 101.6 6 9.6 94.6 7 9.5 95.9 8 9.1 104.7 9 8.9 102.8 10 9.0 98.1 11 10.1 113.9 12 10.3 80.9 13 10.2 95.7 14 9.6 113.2 15 9.2 105.9 16 9.3 108.8 17 9.4 102.3 18 9.4 99.0 19 9.2 100.7 20 9.0 115.5 21 9.0 100.7 22 9.0 109.9 23 9.8 114.6 24 10.0 85.4 25 9.8 100.5 26 9.3 114.8 27 9.0 116.5 28 9.0 112.9 29 9.1 102.0 30 9.1 106.0 31 9.1 105.3 32 9.2 118.8 33 8.8 106.1 34 8.3 109.3 35 8.4 117.2 36 8.1 92.5 37 7.7 104.2 38 7.9 112.5 39 7.9 122.4 40 8.0 113.3 41 7.9 100.0 42 7.6 110.7 43 7.1 112.8 44 6.8 109.8 45 6.5 117.3 46 6.9 109.1 47 8.2 115.9 48 8.7 96.0 49 8.3 99.8 50 7.9 116.8 51 7.5 115.7 52 7.8 99.4 53 8.3 94.3 54 8.4 91.0 55 8.2 93.2 56 7.7 103.1 57 7.2 94.1 58 7.3 91.8 59 8.1 102.7 60 8.5 82.6 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 10.82904 -0.02034 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.9429 -0.6426 0.1930 0.6293 2.0401 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 10.82904 1.35771 7.976 6.72e-11 *** X -0.02034 0.01292 -1.574 0.121 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.9395 on 58 degrees of freedom Multiple R-squared: 0.04099, Adjusted R-squared: 0.02445 F-statistic: 2.479 on 1 and 58 DF, p-value: 0.1208 > 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.431984301 0.86396860 0.568015699 [2,] 0.321057441 0.64211488 0.678942559 [3,] 0.220058191 0.44011638 0.779941809 [4,] 0.165711587 0.33142317 0.834288413 [5,] 0.145678829 0.29135766 0.854321171 [6,] 0.116031976 0.23206395 0.883968024 [7,] 0.116775853 0.23355171 0.883224147 [8,] 0.108543273 0.21708655 0.891456727 [9,] 0.102706646 0.20541329 0.897293354 [10,] 0.076247283 0.15249457 0.923752717 [11,] 0.056759848 0.11351970 0.943240152 [12,] 0.039723230 0.07944646 0.960276770 [13,] 0.028100846 0.05620169 0.971899154 [14,] 0.020308307 0.04061661 0.979691693 [15,] 0.015644040 0.03128808 0.984355960 [16,] 0.011077185 0.02215437 0.988922815 [17,] 0.009817137 0.01963427 0.990182863 [18,] 0.007243892 0.01448778 0.992756108 [19,] 0.011044245 0.02208849 0.988955755 [20,] 0.013615467 0.02723093 0.986384533 [21,] 0.019777336 0.03955467 0.980222664 [22,] 0.020409017 0.04081803 0.979590983 [23,] 0.019792515 0.03958503 0.980207485 [24,] 0.021009557 0.04201911 0.978990443 [25,] 0.025953007 0.05190601 0.974046993 [26,] 0.033871059 0.06774212 0.966128941 [27,] 0.049037607 0.09807521 0.950962393 [28,] 0.115141121 0.23028224 0.884858879 [29,] 0.181935066 0.36387013 0.818064934 [30,] 0.276306838 0.55261368 0.723693162 [31,] 0.374157194 0.74831439 0.625842806 [32,] 0.565099195 0.86980161 0.434900805 [33,] 0.706953429 0.58609314 0.293046571 [34,] 0.742308085 0.51538383 0.257691915 [35,] 0.772654047 0.45469191 0.227345953 [36,] 0.794496837 0.41100633 0.205503163 [37,] 0.812621466 0.37475707 0.187378534 [38,] 0.816613773 0.36677245 0.183386227 [39,] 0.850902296 0.29819541 0.149097704 [40,] 0.923722808 0.15255438 0.076277192 [41,] 0.974916565 0.05016687 0.025083435 [42,] 0.991822487 0.01635503 0.008177513 [43,] 0.987654031 0.02469194 0.012345969 [44,] 0.989923761 0.02015248 0.010076239 [45,] 0.985192060 0.02961588 0.014807940 [46,] 0.975495461 0.04900908 0.024504539 [47,] 0.951960869 0.09607826 0.048039131 [48,] 0.914162031 0.17167594 0.085837969 [49,] 0.868272750 0.26345450 0.131727250 [50,] 0.812498210 0.37500358 0.187501790 [51,] 0.709722347 0.58055531 0.290277653 > postscript(file="/var/www/html/rcomp/tmp/1b1jk1258643665.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/2hjkr1258643665.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/3y2tn1258643665.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/44hbs1258643665.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/55pr01258643665.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 2.04007710 1.49199563 0.61469560 0.48450609 0.73771924 0.69532446 7 8 9 10 11 12 0.62176920 0.40077978 0.16212977 0.16652185 1.58792720 1.11663753 13 14 15 16 17 18 1.31770078 1.07368773 0.52519031 0.68418244 0.65195871 0.58482975 19 20 21 22 23 24 0.41941134 0.52047458 0.21941134 0.40655876 1.30216668 0.90817703 25 26 27 28 29 30 1.01534291 0.80623510 0.54081669 0.46758509 0.34585608 0.42722453 31 32 33 34 35 36 0.41298505 0.78760355 0.12925874 -0.30564651 -0.04494383 -0.84739398 37 38 39 40 41 42 -1.00939127 -0.64055175 -0.43916485 -0.52427806 -0.89482814 -0.97716755 43 44 45 46 47 48 -1.43444912 -1.79547545 -1.94290962 -1.70971493 -0.27138857 -0.17619659 49 50 51 52 53 54 -0.49889656 -0.55308067 -0.97545700 -1.00703341 -0.61077818 -0.57790714 55 56 57 58 59 60 -0.73315450 -1.03176760 -1.71484660 -1.66163345 -0.63990444 -0.64878088 > postscript(file="/var/www/html/rcomp/tmp/6p2hz1258643665.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 2.04007710 NA 1 1.49199563 2.04007710 2 0.61469560 1.49199563 3 0.48450609 0.61469560 4 0.73771924 0.48450609 5 0.69532446 0.73771924 6 0.62176920 0.69532446 7 0.40077978 0.62176920 8 0.16212977 0.40077978 9 0.16652185 0.16212977 10 1.58792720 0.16652185 11 1.11663753 1.58792720 12 1.31770078 1.11663753 13 1.07368773 1.31770078 14 0.52519031 1.07368773 15 0.68418244 0.52519031 16 0.65195871 0.68418244 17 0.58482975 0.65195871 18 0.41941134 0.58482975 19 0.52047458 0.41941134 20 0.21941134 0.52047458 21 0.40655876 0.21941134 22 1.30216668 0.40655876 23 0.90817703 1.30216668 24 1.01534291 0.90817703 25 0.80623510 1.01534291 26 0.54081669 0.80623510 27 0.46758509 0.54081669 28 0.34585608 0.46758509 29 0.42722453 0.34585608 30 0.41298505 0.42722453 31 0.78760355 0.41298505 32 0.12925874 0.78760355 33 -0.30564651 0.12925874 34 -0.04494383 -0.30564651 35 -0.84739398 -0.04494383 36 -1.00939127 -0.84739398 37 -0.64055175 -1.00939127 38 -0.43916485 -0.64055175 39 -0.52427806 -0.43916485 40 -0.89482814 -0.52427806 41 -0.97716755 -0.89482814 42 -1.43444912 -0.97716755 43 -1.79547545 -1.43444912 44 -1.94290962 -1.79547545 45 -1.70971493 -1.94290962 46 -0.27138857 -1.70971493 47 -0.17619659 -0.27138857 48 -0.49889656 -0.17619659 49 -0.55308067 -0.49889656 50 -0.97545700 -0.55308067 51 -1.00703341 -0.97545700 52 -0.61077818 -1.00703341 53 -0.57790714 -0.61077818 54 -0.73315450 -0.57790714 55 -1.03176760 -0.73315450 56 -1.71484660 -1.03176760 57 -1.66163345 -1.71484660 58 -0.63990444 -1.66163345 59 -0.64878088 -0.63990444 60 NA -0.64878088 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.49199563 2.04007710 [2,] 0.61469560 1.49199563 [3,] 0.48450609 0.61469560 [4,] 0.73771924 0.48450609 [5,] 0.69532446 0.73771924 [6,] 0.62176920 0.69532446 [7,] 0.40077978 0.62176920 [8,] 0.16212977 0.40077978 [9,] 0.16652185 0.16212977 [10,] 1.58792720 0.16652185 [11,] 1.11663753 1.58792720 [12,] 1.31770078 1.11663753 [13,] 1.07368773 1.31770078 [14,] 0.52519031 1.07368773 [15,] 0.68418244 0.52519031 [16,] 0.65195871 0.68418244 [17,] 0.58482975 0.65195871 [18,] 0.41941134 0.58482975 [19,] 0.52047458 0.41941134 [20,] 0.21941134 0.52047458 [21,] 0.40655876 0.21941134 [22,] 1.30216668 0.40655876 [23,] 0.90817703 1.30216668 [24,] 1.01534291 0.90817703 [25,] 0.80623510 1.01534291 [26,] 0.54081669 0.80623510 [27,] 0.46758509 0.54081669 [28,] 0.34585608 0.46758509 [29,] 0.42722453 0.34585608 [30,] 0.41298505 0.42722453 [31,] 0.78760355 0.41298505 [32,] 0.12925874 0.78760355 [33,] -0.30564651 0.12925874 [34,] -0.04494383 -0.30564651 [35,] -0.84739398 -0.04494383 [36,] -1.00939127 -0.84739398 [37,] -0.64055175 -1.00939127 [38,] -0.43916485 -0.64055175 [39,] -0.52427806 -0.43916485 [40,] -0.89482814 -0.52427806 [41,] -0.97716755 -0.89482814 [42,] -1.43444912 -0.97716755 [43,] -1.79547545 -1.43444912 [44,] -1.94290962 -1.79547545 [45,] -1.70971493 -1.94290962 [46,] -0.27138857 -1.70971493 [47,] -0.17619659 -0.27138857 [48,] -0.49889656 -0.17619659 [49,] -0.55308067 -0.49889656 [50,] -0.97545700 -0.55308067 [51,] -1.00703341 -0.97545700 [52,] -0.61077818 -1.00703341 [53,] -0.57790714 -0.61077818 [54,] -0.73315450 -0.57790714 [55,] -1.03176760 -0.73315450 [56,] -1.71484660 -1.03176760 [57,] -1.66163345 -1.71484660 [58,] -0.63990444 -1.66163345 [59,] -0.64878088 -0.63990444 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.49199563 2.04007710 2 0.61469560 1.49199563 3 0.48450609 0.61469560 4 0.73771924 0.48450609 5 0.69532446 0.73771924 6 0.62176920 0.69532446 7 0.40077978 0.62176920 8 0.16212977 0.40077978 9 0.16652185 0.16212977 10 1.58792720 0.16652185 11 1.11663753 1.58792720 12 1.31770078 1.11663753 13 1.07368773 1.31770078 14 0.52519031 1.07368773 15 0.68418244 0.52519031 16 0.65195871 0.68418244 17 0.58482975 0.65195871 18 0.41941134 0.58482975 19 0.52047458 0.41941134 20 0.21941134 0.52047458 21 0.40655876 0.21941134 22 1.30216668 0.40655876 23 0.90817703 1.30216668 24 1.01534291 0.90817703 25 0.80623510 1.01534291 26 0.54081669 0.80623510 27 0.46758509 0.54081669 28 0.34585608 0.46758509 29 0.42722453 0.34585608 30 0.41298505 0.42722453 31 0.78760355 0.41298505 32 0.12925874 0.78760355 33 -0.30564651 0.12925874 34 -0.04494383 -0.30564651 35 -0.84739398 -0.04494383 36 -1.00939127 -0.84739398 37 -0.64055175 -1.00939127 38 -0.43916485 -0.64055175 39 -0.52427806 -0.43916485 40 -0.89482814 -0.52427806 41 -0.97716755 -0.89482814 42 -1.43444912 -0.97716755 43 -1.79547545 -1.43444912 44 -1.94290962 -1.79547545 45 -1.70971493 -1.94290962 46 -0.27138857 -1.70971493 47 -0.17619659 -0.27138857 48 -0.49889656 -0.17619659 49 -0.55308067 -0.49889656 50 -0.97545700 -0.55308067 51 -1.00703341 -0.97545700 52 -0.61077818 -1.00703341 53 -0.57790714 -0.61077818 54 -0.73315450 -0.57790714 55 -1.03176760 -0.73315450 56 -1.71484660 -1.03176760 57 -1.66163345 -1.71484660 58 -0.63990444 -1.66163345 59 -0.64878088 -0.63990444 > 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/7vppe1258643665.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/86io11258643665.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/99myb1258643665.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/10fhfn1258643665.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/11b7bq1258643665.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/12smli1258643665.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/13i28s1258643665.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/143yb41258643665.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/15zhdc1258643665.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/16g9dm1258643665.tab") + } > > system("convert tmp/1b1jk1258643665.ps tmp/1b1jk1258643665.png") > system("convert tmp/2hjkr1258643665.ps tmp/2hjkr1258643665.png") > system("convert tmp/3y2tn1258643665.ps tmp/3y2tn1258643665.png") > system("convert tmp/44hbs1258643665.ps tmp/44hbs1258643665.png") > system("convert tmp/55pr01258643665.ps tmp/55pr01258643665.png") > system("convert tmp/6p2hz1258643665.ps tmp/6p2hz1258643665.png") > system("convert tmp/7vppe1258643665.ps tmp/7vppe1258643665.png") > system("convert tmp/86io11258643665.ps tmp/86io11258643665.png") > system("convert tmp/99myb1258643665.ps tmp/99myb1258643665.png") > system("convert tmp/10fhfn1258643665.ps tmp/10fhfn1258643665.png") > > > proc.time() user system elapsed 2.512 1.574 3.527