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(8,5560,8.1,3922,7.7,3759,7.5,4138,7.6,4634,7.8,3996,7.8,4308,7.8,4143,7.5,4429,7.5,5219,7.1,4929,7.5,5755,7.5,5592,7.6,4163,7.7,4962,7.7,5208,7.9,4755,8.1,4491,8.2,5732,8.2,5731,8.2,5040,7.9,6102,7.3,4904,6.9,5369,6.7,5578,6.7,4619,6.9,4731,7,5011,7.1,5299,7.2,4146,7.1,4625,6.9,4736,7,4219,6.8,5116,6.4,4205,6.7,4121,6.6,5103,6.4,4300,6.3,4578,6.2,3809,6.5,5526,6.8,4247,6.8,3830,6.4,4394,6.1,4826,5.8,4409,6.1,4569,7.2,4106,7.3,4794,6.9,3914,6.1,3793,5.8,4405,6.2,4022,7.1,4100,7.7,4788,7.9,3163,7.7,3585,7.4,3903,7.5,4178,8,3863,8.1,4187),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 8.0 5560 2 8.1 3922 3 7.7 3759 4 7.5 4138 5 7.6 4634 6 7.8 3996 7 7.8 4308 8 7.8 4143 9 7.5 4429 10 7.5 5219 11 7.1 4929 12 7.5 5755 13 7.5 5592 14 7.6 4163 15 7.7 4962 16 7.7 5208 17 7.9 4755 18 8.1 4491 19 8.2 5732 20 8.2 5731 21 8.2 5040 22 7.9 6102 23 7.3 4904 24 6.9 5369 25 6.7 5578 26 6.7 4619 27 6.9 4731 28 7.0 5011 29 7.1 5299 30 7.2 4146 31 7.1 4625 32 6.9 4736 33 7.0 4219 34 6.8 5116 35 6.4 4205 36 6.7 4121 37 6.6 5103 38 6.4 4300 39 6.3 4578 40 6.2 3809 41 6.5 5526 42 6.8 4247 43 6.8 3830 44 6.4 4394 45 6.1 4826 46 5.8 4409 47 6.1 4569 48 7.2 4106 49 7.3 4794 50 6.9 3914 51 6.1 3793 52 5.8 4405 53 6.2 4022 54 7.1 4100 55 7.7 4788 56 7.9 3163 57 7.7 3585 58 7.4 3903 59 7.5 4178 60 8.0 3863 61 8.1 4187 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X 6.5720606 0.0001345 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.36496 -0.46003 0.07041 0.50738 1.00053 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.5720606 0.6239929 10.532 3.56e-15 *** X 0.0001345 0.0001349 0.997 0.323 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6616 on 59 degrees of freedom Multiple R-squared: 0.01657, Adjusted R-squared: -9.434e-05 F-statistic: 0.9943 on 1 and 59 DF, p-value: 0.3228 > 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,] 9.929856e-02 1.985971e-01 0.90070144 [2,] 3.657416e-02 7.314833e-02 0.96342584 [3,] 1.228895e-02 2.457790e-02 0.98771105 [4,] 3.937798e-03 7.875596e-03 0.99606220 [5,] 2.628571e-03 5.257142e-03 0.99737143 [6,] 1.516607e-03 3.033215e-03 0.99848339 [7,] 4.695256e-03 9.390511e-03 0.99530474 [8,] 1.803247e-03 3.606493e-03 0.99819675 [9,] 6.630540e-04 1.326108e-03 0.99933695 [10,] 2.691591e-04 5.383181e-04 0.99973084 [11,] 1.048250e-04 2.096501e-04 0.99989517 [12,] 4.082927e-05 8.165854e-05 0.99995917 [13,] 2.738935e-05 5.477869e-05 0.99997261 [14,] 4.787958e-05 9.575915e-05 0.99995212 [15,] 1.869124e-04 3.738248e-04 0.99981309 [16,] 4.070785e-04 8.141570e-04 0.99959292 [17,] 9.045483e-04 1.809097e-03 0.99909545 [18,] 9.749429e-04 1.949886e-03 0.99902506 [19,] 1.269826e-03 2.539652e-03 0.99873017 [20,] 5.841397e-03 1.168279e-02 0.99415860 [21,] 2.257171e-02 4.514342e-02 0.97742829 [22,] 5.002027e-02 1.000405e-01 0.94997973 [23,] 5.894444e-02 1.178889e-01 0.94105556 [24,] 5.914122e-02 1.182824e-01 0.94085878 [25,] 5.753206e-02 1.150641e-01 0.94246794 [26,] 4.634683e-02 9.269367e-02 0.95365317 [27,] 4.039402e-02 8.078805e-02 0.95960598 [28,] 3.982348e-02 7.964697e-02 0.96017652 [29,] 3.324372e-02 6.648744e-02 0.96675628 [30,] 3.538368e-02 7.076737e-02 0.96461632 [31,] 5.776423e-02 1.155285e-01 0.94223577 [32,] 5.386484e-02 1.077297e-01 0.94613516 [33,] 5.682544e-02 1.136509e-01 0.94317456 [34,] 6.773194e-02 1.354639e-01 0.93226806 [35,] 8.305368e-02 1.661074e-01 0.91694632 [36,] 1.240148e-01 2.480296e-01 0.87598518 [37,] 1.278922e-01 2.557844e-01 0.87210781 [38,] 9.629102e-02 1.925820e-01 0.90370898 [39,] 7.377746e-02 1.475549e-01 0.92622254 [40,] 6.822836e-02 1.364567e-01 0.93177164 [41,] 8.045244e-02 1.609049e-01 0.91954756 [42,] 1.673193e-01 3.346386e-01 0.83268071 [43,] 2.184281e-01 4.368562e-01 0.78157189 [44,] 1.573750e-01 3.147500e-01 0.84262500 [45,] 1.139875e-01 2.279749e-01 0.88601254 [46,] 7.949786e-02 1.589957e-01 0.92050214 [47,] 1.653518e-01 3.307036e-01 0.83464819 [48,] 5.027421e-01 9.945158e-01 0.49725791 [49,] 9.346804e-01 1.306393e-01 0.06531963 [50,] 9.654158e-01 6.916837e-02 0.03458418 [51,] 9.158294e-01 1.683413e-01 0.08417065 [52,] 8.350924e-01 3.298152e-01 0.16490761 > postscript(file="/var/www/html/rcomp/tmp/1u91a1258728493.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/29fn21258728493.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/3c6fq1258728493.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/4hfs11258728493.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/5ukt91258728493.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 6 0.68026141 1.00053057 0.62244990 0.37148409 0.40478475 0.69057946 7 8 9 10 11 12 0.64862343 0.67081171 0.33235202 0.22611720 -0.13488521 0.15403889 13 14 15 16 17 18 0.17595822 0.46812222 0.46067713 0.42759642 0.68851335 0.92401460 19 20 21 22 23 24 0.85713180 0.85726627 0.95018812 0.50737625 0.06847665 -0.39405397 25 26 27 28 29 30 -0.62215913 -0.49319813 -0.30825927 -0.24591212 -0.18464076 0.07040829 31 32 33 34 35 36 -0.09400498 -0.30893164 -0.13940835 -0.46003193 -0.73752570 -0.42622985 37 38 39 40 41 42 -0.65828377 -0.75030078 -0.88768468 -0.88427382 -0.81516646 -0.34317363 43 44 45 46 47 48 -0.28709778 -0.76294138 -1.12103434 -1.36495849 -1.08647441 0.07578727 49 50 51 52 53 54 0.08326884 -0.19839364 -0.98212223 -1.36442059 -0.91291688 -0.02340589 55 56 57 58 59 60 0.48407569 0.90259668 0.64584846 0.30308558 0.36610511 0.90846456 61 0.96489484 > postscript(file="/var/www/html/rcomp/tmp/6pth71258728493.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 0.68026141 NA 1 1.00053057 0.68026141 2 0.62244990 1.00053057 3 0.37148409 0.62244990 4 0.40478475 0.37148409 5 0.69057946 0.40478475 6 0.64862343 0.69057946 7 0.67081171 0.64862343 8 0.33235202 0.67081171 9 0.22611720 0.33235202 10 -0.13488521 0.22611720 11 0.15403889 -0.13488521 12 0.17595822 0.15403889 13 0.46812222 0.17595822 14 0.46067713 0.46812222 15 0.42759642 0.46067713 16 0.68851335 0.42759642 17 0.92401460 0.68851335 18 0.85713180 0.92401460 19 0.85726627 0.85713180 20 0.95018812 0.85726627 21 0.50737625 0.95018812 22 0.06847665 0.50737625 23 -0.39405397 0.06847665 24 -0.62215913 -0.39405397 25 -0.49319813 -0.62215913 26 -0.30825927 -0.49319813 27 -0.24591212 -0.30825927 28 -0.18464076 -0.24591212 29 0.07040829 -0.18464076 30 -0.09400498 0.07040829 31 -0.30893164 -0.09400498 32 -0.13940835 -0.30893164 33 -0.46003193 -0.13940835 34 -0.73752570 -0.46003193 35 -0.42622985 -0.73752570 36 -0.65828377 -0.42622985 37 -0.75030078 -0.65828377 38 -0.88768468 -0.75030078 39 -0.88427382 -0.88768468 40 -0.81516646 -0.88427382 41 -0.34317363 -0.81516646 42 -0.28709778 -0.34317363 43 -0.76294138 -0.28709778 44 -1.12103434 -0.76294138 45 -1.36495849 -1.12103434 46 -1.08647441 -1.36495849 47 0.07578727 -1.08647441 48 0.08326884 0.07578727 49 -0.19839364 0.08326884 50 -0.98212223 -0.19839364 51 -1.36442059 -0.98212223 52 -0.91291688 -1.36442059 53 -0.02340589 -0.91291688 54 0.48407569 -0.02340589 55 0.90259668 0.48407569 56 0.64584846 0.90259668 57 0.30308558 0.64584846 58 0.36610511 0.30308558 59 0.90846456 0.36610511 60 0.96489484 0.90846456 61 NA 0.96489484 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.00053057 0.68026141 [2,] 0.62244990 1.00053057 [3,] 0.37148409 0.62244990 [4,] 0.40478475 0.37148409 [5,] 0.69057946 0.40478475 [6,] 0.64862343 0.69057946 [7,] 0.67081171 0.64862343 [8,] 0.33235202 0.67081171 [9,] 0.22611720 0.33235202 [10,] -0.13488521 0.22611720 [11,] 0.15403889 -0.13488521 [12,] 0.17595822 0.15403889 [13,] 0.46812222 0.17595822 [14,] 0.46067713 0.46812222 [15,] 0.42759642 0.46067713 [16,] 0.68851335 0.42759642 [17,] 0.92401460 0.68851335 [18,] 0.85713180 0.92401460 [19,] 0.85726627 0.85713180 [20,] 0.95018812 0.85726627 [21,] 0.50737625 0.95018812 [22,] 0.06847665 0.50737625 [23,] -0.39405397 0.06847665 [24,] -0.62215913 -0.39405397 [25,] -0.49319813 -0.62215913 [26,] -0.30825927 -0.49319813 [27,] -0.24591212 -0.30825927 [28,] -0.18464076 -0.24591212 [29,] 0.07040829 -0.18464076 [30,] -0.09400498 0.07040829 [31,] -0.30893164 -0.09400498 [32,] -0.13940835 -0.30893164 [33,] -0.46003193 -0.13940835 [34,] -0.73752570 -0.46003193 [35,] -0.42622985 -0.73752570 [36,] -0.65828377 -0.42622985 [37,] -0.75030078 -0.65828377 [38,] -0.88768468 -0.75030078 [39,] -0.88427382 -0.88768468 [40,] -0.81516646 -0.88427382 [41,] -0.34317363 -0.81516646 [42,] -0.28709778 -0.34317363 [43,] -0.76294138 -0.28709778 [44,] -1.12103434 -0.76294138 [45,] -1.36495849 -1.12103434 [46,] -1.08647441 -1.36495849 [47,] 0.07578727 -1.08647441 [48,] 0.08326884 0.07578727 [49,] -0.19839364 0.08326884 [50,] -0.98212223 -0.19839364 [51,] -1.36442059 -0.98212223 [52,] -0.91291688 -1.36442059 [53,] -0.02340589 -0.91291688 [54,] 0.48407569 -0.02340589 [55,] 0.90259668 0.48407569 [56,] 0.64584846 0.90259668 [57,] 0.30308558 0.64584846 [58,] 0.36610511 0.30308558 [59,] 0.90846456 0.36610511 [60,] 0.96489484 0.90846456 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.00053057 0.68026141 2 0.62244990 1.00053057 3 0.37148409 0.62244990 4 0.40478475 0.37148409 5 0.69057946 0.40478475 6 0.64862343 0.69057946 7 0.67081171 0.64862343 8 0.33235202 0.67081171 9 0.22611720 0.33235202 10 -0.13488521 0.22611720 11 0.15403889 -0.13488521 12 0.17595822 0.15403889 13 0.46812222 0.17595822 14 0.46067713 0.46812222 15 0.42759642 0.46067713 16 0.68851335 0.42759642 17 0.92401460 0.68851335 18 0.85713180 0.92401460 19 0.85726627 0.85713180 20 0.95018812 0.85726627 21 0.50737625 0.95018812 22 0.06847665 0.50737625 23 -0.39405397 0.06847665 24 -0.62215913 -0.39405397 25 -0.49319813 -0.62215913 26 -0.30825927 -0.49319813 27 -0.24591212 -0.30825927 28 -0.18464076 -0.24591212 29 0.07040829 -0.18464076 30 -0.09400498 0.07040829 31 -0.30893164 -0.09400498 32 -0.13940835 -0.30893164 33 -0.46003193 -0.13940835 34 -0.73752570 -0.46003193 35 -0.42622985 -0.73752570 36 -0.65828377 -0.42622985 37 -0.75030078 -0.65828377 38 -0.88768468 -0.75030078 39 -0.88427382 -0.88768468 40 -0.81516646 -0.88427382 41 -0.34317363 -0.81516646 42 -0.28709778 -0.34317363 43 -0.76294138 -0.28709778 44 -1.12103434 -0.76294138 45 -1.36495849 -1.12103434 46 -1.08647441 -1.36495849 47 0.07578727 -1.08647441 48 0.08326884 0.07578727 49 -0.19839364 0.08326884 50 -0.98212223 -0.19839364 51 -1.36442059 -0.98212223 52 -0.91291688 -1.36442059 53 -0.02340589 -0.91291688 54 0.48407569 -0.02340589 55 0.90259668 0.48407569 56 0.64584846 0.90259668 57 0.30308558 0.64584846 58 0.36610511 0.30308558 59 0.90846456 0.36610511 60 0.96489484 0.90846456 > 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/7jq5l1258728493.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/8fpec1258728493.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/9cs0b1258728493.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/10xkpz1258728493.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/11vyn81258728493.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/12y1bf1258728493.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/13pet61258728493.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/14hlhm1258728493.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/15sfys1258728493.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/16zce41258728493.tab") + } > > system("convert tmp/1u91a1258728493.ps tmp/1u91a1258728493.png") > system("convert tmp/29fn21258728493.ps tmp/29fn21258728493.png") > system("convert tmp/3c6fq1258728493.ps tmp/3c6fq1258728493.png") > system("convert tmp/4hfs11258728493.ps tmp/4hfs11258728493.png") > system("convert tmp/5ukt91258728493.ps tmp/5ukt91258728493.png") > system("convert tmp/6pth71258728493.ps tmp/6pth71258728493.png") > system("convert tmp/7jq5l1258728493.ps tmp/7jq5l1258728493.png") > system("convert tmp/8fpec1258728493.ps tmp/8fpec1258728493.png") > system("convert tmp/9cs0b1258728493.ps tmp/9cs0b1258728493.png") > system("convert tmp/10xkpz1258728493.ps tmp/10xkpz1258728493.png") > > > proc.time() user system elapsed 2.522 1.565 5.316