R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale 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(-5,-6,33,5,15,-1,-3,24,6,17,-2,-4,24,6,13,-5,-7,31,5,12,-4,-7,25,5,13,-6,-7,28,3,10,-2,-3,24,5,14,-2,0,25,5,13,-2,-5,16,5,10,-2,-3,17,3,11,2,3,11,6,12,1,2,12,6,7,-8,-7,39,4,11,-1,-1,19,6,9,1,0,14,5,13,-1,-3,15,4,12,2,4,7,5,5,2,2,12,5,13,1,3,12,4,11,-1,0,14,3,8,-2,-10,9,2,8,-2,-10,8,3,8,-1,-9,4,2,8,-8,-22,7,-1,0,-4,-16,3,0,3,-6,-18,5,-2,0,-3,-14,0,1,-1,-3,-12,-2,-2,-1,-7,-17,6,-2,-4,-9,-23,11,-2,1,-11,-28,9,-6,-1,-13,-31,17,-4,0,-11,-21,21,-2,-1,-9,-19,21,0,6,-17,-22,41,-5,0,-22,-22,57,-4,-3,-25,-25,65,-5,-3,-20,-16,68,-1,4,-24,-22,73,-2,1,-24,-21,71,-4,0,-22,-10,71,-1,-4,-19,-7,70,1,-2,-18,-5,69,1,3,-17,-4,65,-2,2,-11,7,57,1,5,-11,6,57,1,6,-12,3,57,3,6,-10,10,55,3,3,-15,0,65,1,4,-15,-2,65,1,7,-15,-1,64,0,5,-13,2,60,2,6,-8,8,43,2,1,-13,-6,47,-1,3,-9,-4,40,1,6,-7,4,31,0,0,-4,7,27,1,3,-4,3,24,1,4,-2,3,23,3,7,0,8,17,2,6),dim=c(5,60),dimnames=list(c('indicator','vooruitzichten','werkloosheid','financiën','spaarvermogen'),1:60)) > y <- array(NA,dim=c(5,60),dimnames=list(c('indicator','vooruitzichten','werkloosheid','financiën','spaarvermogen'),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 = '3' > #'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 werkloosheid indicator vooruitzichten financiën spaarvermogen 1 33 -5 -6 5 15 2 24 -1 -3 6 17 3 24 -2 -4 6 13 4 31 -5 -7 5 12 5 25 -4 -7 5 13 6 28 -6 -7 3 10 7 24 -2 -3 5 14 8 25 -2 0 5 13 9 16 -2 -5 5 10 10 17 -2 -3 3 11 11 11 2 3 6 12 12 12 1 2 6 7 13 39 -8 -7 4 11 14 19 -1 -1 6 9 15 14 1 0 5 13 16 15 -1 -3 4 12 17 7 2 4 5 5 18 12 2 2 5 13 19 12 1 3 4 11 20 14 -1 0 3 8 21 9 -2 -10 2 8 22 8 -2 -10 3 8 23 4 -1 -9 2 8 24 7 -8 -22 -1 0 25 3 -4 -16 0 3 26 5 -6 -18 -2 0 27 0 -3 -14 1 -1 28 -2 -3 -12 -2 -1 29 6 -7 -17 -2 -4 30 11 -9 -23 -2 1 31 9 -11 -28 -6 -1 32 17 -13 -31 -4 0 33 21 -11 -21 -2 -1 34 21 -9 -19 0 6 35 41 -17 -22 -5 0 36 57 -22 -22 -4 -3 37 65 -25 -25 -5 -3 38 68 -20 -16 -1 4 39 73 -24 -22 -2 1 40 71 -24 -21 -4 0 41 71 -22 -10 -1 -4 42 70 -19 -7 1 -2 43 69 -18 -5 1 3 44 65 -17 -4 -2 2 45 57 -11 7 1 5 46 57 -11 6 1 6 47 57 -12 3 3 6 48 55 -10 10 3 3 49 65 -15 0 1 4 50 65 -15 -2 1 7 51 64 -15 -1 0 5 52 60 -13 2 2 6 53 43 -8 8 2 1 54 47 -13 -6 -1 3 55 40 -9 -4 1 6 56 31 -7 4 0 0 57 27 -4 7 1 3 58 24 -4 3 1 4 59 23 -2 3 3 7 60 17 0 8 2 6 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) indicator vooruitzichten financiën spaarvermogen 0.6639 -3.9411 1.0008 1.0374 0.8881 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2.3999 -1.1801 0.1226 0.8558 2.2002 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.66391 0.46210 1.437 0.156 indicator -3.94106 0.03100 -127.139 < 2e-16 *** vooruitzichten 1.00077 0.02299 43.533 < 2e-16 *** financiën 1.03741 0.13360 7.765 2.11e-10 *** spaarvermogen 0.88812 0.05912 15.022 < 2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 1.228 on 55 degrees of freedom Multiple R-squared: 0.9974, Adjusted R-squared: 0.9972 F-statistic: 5209 on 4 and 55 DF, p-value: < 2.2e-16 > 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.6198933 0.76021350 0.380106748 [2,] 0.6326305 0.73473901 0.367369503 [3,] 0.5689213 0.86215737 0.431078685 [4,] 0.5632580 0.87348405 0.436742023 [5,] 0.5996343 0.80073136 0.400365678 [6,] 0.5085230 0.98295402 0.491477010 [7,] 0.4464475 0.89289506 0.553552470 [8,] 0.4377117 0.87542334 0.562288329 [9,] 0.3623278 0.72465562 0.637672188 [10,] 0.3411978 0.68239559 0.658802207 [11,] 0.2988903 0.59778056 0.701109721 [12,] 0.2736064 0.54721287 0.726393565 [13,] 0.2364808 0.47296156 0.763519221 [14,] 0.3513429 0.70268585 0.648657076 [15,] 0.3336210 0.66724192 0.666379041 [16,] 0.2766733 0.55334666 0.723326672 [17,] 0.3174583 0.63491661 0.682541697 [18,] 0.2936986 0.58739716 0.706301419 [19,] 0.3909136 0.78182727 0.609086367 [20,] 0.3880500 0.77610004 0.611949980 [21,] 0.3746810 0.74936195 0.625319023 [22,] 0.3226807 0.64536130 0.677319350 [23,] 0.2822322 0.56446440 0.717767801 [24,] 0.2512031 0.50240615 0.748796925 [25,] 0.1950613 0.39012257 0.804938715 [26,] 0.1774562 0.35491244 0.822543781 [27,] 0.2625734 0.52514679 0.737426603 [28,] 0.2211883 0.44237655 0.778811726 [29,] 0.2539785 0.50795699 0.746021506 [30,] 0.3097186 0.61943726 0.690281371 [31,] 0.3915574 0.78311488 0.608442562 [32,] 0.3234761 0.64695214 0.676523929 [33,] 0.2638090 0.52761809 0.736190956 [34,] 0.3498153 0.69963053 0.650184736 [35,] 0.7364381 0.52712379 0.263561895 [36,] 0.6754699 0.64906022 0.324530108 [37,] 0.7468121 0.50637576 0.253187880 [38,] 0.6712435 0.65751305 0.328756526 [39,] 0.5892197 0.82156060 0.410780302 [40,] 0.8838585 0.23228297 0.116141486 [41,] 0.8195580 0.36088407 0.180442034 [42,] 0.8026885 0.39462310 0.197311548 [43,] 0.6936920 0.61261597 0.306307987 [44,] 0.9206033 0.15879341 0.079396705 [45,] 0.9929912 0.01401755 0.007008777 > postscript(file="/var/www/html/freestat/rcomp/tmp/1ja5y1291202512.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/2ja5y1291202512.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/3c1mj1291202512.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/4c1mj1291202512.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/5c1mj1291202512.ps",horizontal=F,onefile=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.12660922 1.07487779 1.68707041 1.79173986 -1.15532213 -1.29826510 7 8 9 10 11 12 0.83558564 -0.27861066 -1.61039220 -1.42524218 -1.66598341 0.83432878 13 14 15 16 17 18 -0.10590656 1.17829037 0.54456206 -1.40971092 0.58748831 0.48407573 19 20 21 22 23 24 -1.64410793 -0.82214179 1.28192693 -0.75547981 -0.77778745 -2.13797833 25 26 27 28 29 30 -0.08014519 0.77845574 1.37443998 0.48511630 0.38910446 -0.92897677 31 32 33 34 35 36 0.11863396 0.27590162 0.96360330 -1.44747589 0.54213048 -1.53620546 37 38 39 40 41 42 -1.31965557 2.01222080 0.95438766 0.91654875 -1.76956959 2.20023466 43 44 45 46 47 48 -1.30084949 1.63977593 0.50105096 0.61370335 -2.39985185 -0.85878170 49 50 51 52 53 54 0.63034390 -0.03247087 0.78040304 -1.30273073 -0.16147677 -0.51997617 55 56 57 58 59 60 1.50353805 -1.25439833 -0.13530690 -0.02033864 2.12260433 0.92638602 > postscript(file="/var/www/html/freestat/rcomp/tmp/65a3m1291202512.ps",horizontal=F,onefile=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.12660922 NA 1 1.07487779 0.12660922 2 1.68707041 1.07487779 3 1.79173986 1.68707041 4 -1.15532213 1.79173986 5 -1.29826510 -1.15532213 6 0.83558564 -1.29826510 7 -0.27861066 0.83558564 8 -1.61039220 -0.27861066 9 -1.42524218 -1.61039220 10 -1.66598341 -1.42524218 11 0.83432878 -1.66598341 12 -0.10590656 0.83432878 13 1.17829037 -0.10590656 14 0.54456206 1.17829037 15 -1.40971092 0.54456206 16 0.58748831 -1.40971092 17 0.48407573 0.58748831 18 -1.64410793 0.48407573 19 -0.82214179 -1.64410793 20 1.28192693 -0.82214179 21 -0.75547981 1.28192693 22 -0.77778745 -0.75547981 23 -2.13797833 -0.77778745 24 -0.08014519 -2.13797833 25 0.77845574 -0.08014519 26 1.37443998 0.77845574 27 0.48511630 1.37443998 28 0.38910446 0.48511630 29 -0.92897677 0.38910446 30 0.11863396 -0.92897677 31 0.27590162 0.11863396 32 0.96360330 0.27590162 33 -1.44747589 0.96360330 34 0.54213048 -1.44747589 35 -1.53620546 0.54213048 36 -1.31965557 -1.53620546 37 2.01222080 -1.31965557 38 0.95438766 2.01222080 39 0.91654875 0.95438766 40 -1.76956959 0.91654875 41 2.20023466 -1.76956959 42 -1.30084949 2.20023466 43 1.63977593 -1.30084949 44 0.50105096 1.63977593 45 0.61370335 0.50105096 46 -2.39985185 0.61370335 47 -0.85878170 -2.39985185 48 0.63034390 -0.85878170 49 -0.03247087 0.63034390 50 0.78040304 -0.03247087 51 -1.30273073 0.78040304 52 -0.16147677 -1.30273073 53 -0.51997617 -0.16147677 54 1.50353805 -0.51997617 55 -1.25439833 1.50353805 56 -0.13530690 -1.25439833 57 -0.02033864 -0.13530690 58 2.12260433 -0.02033864 59 0.92638602 2.12260433 60 NA 0.92638602 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.07487779 0.12660922 [2,] 1.68707041 1.07487779 [3,] 1.79173986 1.68707041 [4,] -1.15532213 1.79173986 [5,] -1.29826510 -1.15532213 [6,] 0.83558564 -1.29826510 [7,] -0.27861066 0.83558564 [8,] -1.61039220 -0.27861066 [9,] -1.42524218 -1.61039220 [10,] -1.66598341 -1.42524218 [11,] 0.83432878 -1.66598341 [12,] -0.10590656 0.83432878 [13,] 1.17829037 -0.10590656 [14,] 0.54456206 1.17829037 [15,] -1.40971092 0.54456206 [16,] 0.58748831 -1.40971092 [17,] 0.48407573 0.58748831 [18,] -1.64410793 0.48407573 [19,] -0.82214179 -1.64410793 [20,] 1.28192693 -0.82214179 [21,] -0.75547981 1.28192693 [22,] -0.77778745 -0.75547981 [23,] -2.13797833 -0.77778745 [24,] -0.08014519 -2.13797833 [25,] 0.77845574 -0.08014519 [26,] 1.37443998 0.77845574 [27,] 0.48511630 1.37443998 [28,] 0.38910446 0.48511630 [29,] -0.92897677 0.38910446 [30,] 0.11863396 -0.92897677 [31,] 0.27590162 0.11863396 [32,] 0.96360330 0.27590162 [33,] -1.44747589 0.96360330 [34,] 0.54213048 -1.44747589 [35,] -1.53620546 0.54213048 [36,] -1.31965557 -1.53620546 [37,] 2.01222080 -1.31965557 [38,] 0.95438766 2.01222080 [39,] 0.91654875 0.95438766 [40,] -1.76956959 0.91654875 [41,] 2.20023466 -1.76956959 [42,] -1.30084949 2.20023466 [43,] 1.63977593 -1.30084949 [44,] 0.50105096 1.63977593 [45,] 0.61370335 0.50105096 [46,] -2.39985185 0.61370335 [47,] -0.85878170 -2.39985185 [48,] 0.63034390 -0.85878170 [49,] -0.03247087 0.63034390 [50,] 0.78040304 -0.03247087 [51,] -1.30273073 0.78040304 [52,] -0.16147677 -1.30273073 [53,] -0.51997617 -0.16147677 [54,] 1.50353805 -0.51997617 [55,] -1.25439833 1.50353805 [56,] -0.13530690 -1.25439833 [57,] -0.02033864 -0.13530690 [58,] 2.12260433 -0.02033864 [59,] 0.92638602 2.12260433 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.07487779 0.12660922 2 1.68707041 1.07487779 3 1.79173986 1.68707041 4 -1.15532213 1.79173986 5 -1.29826510 -1.15532213 6 0.83558564 -1.29826510 7 -0.27861066 0.83558564 8 -1.61039220 -0.27861066 9 -1.42524218 -1.61039220 10 -1.66598341 -1.42524218 11 0.83432878 -1.66598341 12 -0.10590656 0.83432878 13 1.17829037 -0.10590656 14 0.54456206 1.17829037 15 -1.40971092 0.54456206 16 0.58748831 -1.40971092 17 0.48407573 0.58748831 18 -1.64410793 0.48407573 19 -0.82214179 -1.64410793 20 1.28192693 -0.82214179 21 -0.75547981 1.28192693 22 -0.77778745 -0.75547981 23 -2.13797833 -0.77778745 24 -0.08014519 -2.13797833 25 0.77845574 -0.08014519 26 1.37443998 0.77845574 27 0.48511630 1.37443998 28 0.38910446 0.48511630 29 -0.92897677 0.38910446 30 0.11863396 -0.92897677 31 0.27590162 0.11863396 32 0.96360330 0.27590162 33 -1.44747589 0.96360330 34 0.54213048 -1.44747589 35 -1.53620546 0.54213048 36 -1.31965557 -1.53620546 37 2.01222080 -1.31965557 38 0.95438766 2.01222080 39 0.91654875 0.95438766 40 -1.76956959 0.91654875 41 2.20023466 -1.76956959 42 -1.30084949 2.20023466 43 1.63977593 -1.30084949 44 0.50105096 1.63977593 45 0.61370335 0.50105096 46 -2.39985185 0.61370335 47 -0.85878170 -2.39985185 48 0.63034390 -0.85878170 49 -0.03247087 0.63034390 50 0.78040304 -0.03247087 51 -1.30273073 0.78040304 52 -0.16147677 -1.30273073 53 -0.51997617 -0.16147677 54 1.50353805 -0.51997617 55 -1.25439833 1.50353805 56 -0.13530690 -1.25439833 57 -0.02033864 -0.13530690 58 2.12260433 -0.02033864 59 0.92638602 2.12260433 > 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/freestat/rcomp/tmp/7f2371291202512.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/8f2371291202512.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/9f2371291202512.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/10qb2a1291202512.ps",horizontal=F,onefile=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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11tuig1291202512.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/freestat/rcomp/tmp/12fuh41291202512.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/freestat/rcomp/tmp/13bmfc1291202512.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/freestat/rcomp/tmp/14282p1291202512.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/freestat/rcomp/tmp/1505c61291202512.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/freestat/rcomp/tmp/16loac1291202512.tab") + } > > try(system("convert tmp/1ja5y1291202512.ps tmp/1ja5y1291202512.png",intern=TRUE)) character(0) > try(system("convert tmp/2ja5y1291202512.ps tmp/2ja5y1291202512.png",intern=TRUE)) character(0) > try(system("convert tmp/3c1mj1291202512.ps tmp/3c1mj1291202512.png",intern=TRUE)) character(0) > try(system("convert tmp/4c1mj1291202512.ps tmp/4c1mj1291202512.png",intern=TRUE)) character(0) > try(system("convert tmp/5c1mj1291202512.ps tmp/5c1mj1291202512.png",intern=TRUE)) character(0) > try(system("convert tmp/65a3m1291202512.ps tmp/65a3m1291202512.png",intern=TRUE)) character(0) > try(system("convert tmp/7f2371291202512.ps tmp/7f2371291202512.png",intern=TRUE)) character(0) > try(system("convert tmp/8f2371291202512.ps tmp/8f2371291202512.png",intern=TRUE)) character(0) > try(system("convert tmp/9f2371291202512.ps tmp/9f2371291202512.png",intern=TRUE)) character(0) > try(system("convert tmp/10qb2a1291202512.ps tmp/10qb2a1291202512.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.827 2.466 4.123