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. 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(4.8,19.2,5.5,26.6,5.4,26.6,5.9,31.4,5.8,31.2,5.1,26.4,4.1,20.7,4.4,20.7,3.6,15,3.5,13.3,3.1,8.7,2.9,10.2,2.2,4.3,1.4,-0.1,1.2,-4.6,1.3,-3.9,1.3,-3.5,1.3,-3.4,1.8,-2.5,1.8,-1.1,1.8,0.3,1.7,-0.9,2.1,3.6,2,2.7,1.7,-0.2,1.9,-1,2.3,5.8,2.4,6.4,2.5,9.6,2.8,13.2,2.6,10.6,2.2,10.9,2.8,12.9,2.8,15.9,2.8,12.2,2.3,9.1,2.2,9,3,17.4,2.9,14.7,2.7,17,2.7,13.7,2.3,9.5,2.4,14.8,2.8,13.6,2.3,12.6,2,8.9,1.9,10.2,2.3,12.7,2.7,16,1.8,10.4,2,9.9,2.1,9.5,2,8.6,2.4,10,1.7,3.5,1,-4.2,1.2,-4.4,1.4,-1.5,1.7,-0.1,1.8,0.8),dim=c(2,60),dimnames=list(c('Inflatie_België','Inflatie_energiedragers'),1:60)) > y <- array(NA,dim=c(2,60),dimnames=list(c('Inflatie_België','Inflatie_energiedragers'),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 Inflatie_Belgi\353 Inflatie_energiedragers 1 4.8 19.2 2 5.5 26.6 3 5.4 26.6 4 5.9 31.4 5 5.8 31.2 6 5.1 26.4 7 4.1 20.7 8 4.4 20.7 9 3.6 15.0 10 3.5 13.3 11 3.1 8.7 12 2.9 10.2 13 2.2 4.3 14 1.4 -0.1 15 1.2 -4.6 16 1.3 -3.9 17 1.3 -3.5 18 1.3 -3.4 19 1.8 -2.5 20 1.8 -1.1 21 1.8 0.3 22 1.7 -0.9 23 2.1 3.6 24 2.0 2.7 25 1.7 -0.2 26 1.9 -1.0 27 2.3 5.8 28 2.4 6.4 29 2.5 9.6 30 2.8 13.2 31 2.6 10.6 32 2.2 10.9 33 2.8 12.9 34 2.8 15.9 35 2.8 12.2 36 2.3 9.1 37 2.2 9.0 38 3.0 17.4 39 2.9 14.7 40 2.7 17.0 41 2.7 13.7 42 2.3 9.5 43 2.4 14.8 44 2.8 13.6 45 2.3 12.6 46 2.0 8.9 47 1.9 10.2 48 2.3 12.7 49 2.7 16.0 50 1.8 10.4 51 2.0 9.9 52 2.1 9.5 53 2.0 8.6 54 2.4 10.0 55 1.7 3.5 56 1.0 -4.2 57 1.2 -4.4 58 1.4 -1.5 59 1.7 -0.1 60 1.8 0.8 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Inflatie_energiedragers 1.4713 0.1183 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.9017 -0.3501 0.1243 0.2909 1.0572 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.471305 0.089396 16.46 <2e-16 *** Inflatie_energiedragers 0.118307 0.006903 17.14 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.4811 on 58 degrees of freedom Multiple R-squared: 0.8351, Adjusted R-squared: 0.8323 F-statistic: 293.7 on 1 and 58 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.00364599 0.0072919794 0.9963540103 [2,] 0.05912445 0.1182489082 0.9408755459 [3,] 0.44705091 0.8941018144 0.5529490928 [4,] 0.47672373 0.9534474512 0.5232762744 [5,] 0.48366409 0.9673281850 0.5163359075 [6,] 0.51051909 0.9789618153 0.4894809076 [7,] 0.60981287 0.7803742645 0.3901871323 [8,] 0.66873644 0.6625271181 0.3312635591 [9,] 0.61062875 0.7787425032 0.3893712516 [10,] 0.60856503 0.7828699456 0.3914349728 [11,] 0.57164563 0.8567087432 0.4283543716 [12,] 0.51092430 0.9781514094 0.4890757047 [13,] 0.43520325 0.8704065002 0.5647967499 [14,] 0.36263504 0.7252700817 0.6373649591 [15,] 0.48804744 0.9760948729 0.5119525636 [16,] 0.45869496 0.9173899160 0.5413050420 [17,] 0.38766091 0.7753218173 0.6123390914 [18,] 0.32121236 0.6424247179 0.6787876410 [19,] 0.29364965 0.5872992999 0.7063503501 [20,] 0.25781610 0.5156321906 0.7421839047 [21,] 0.20477679 0.4095535718 0.7952232141 [22,] 0.26934501 0.5386900120 0.7306549940 [23,] 0.30172364 0.6034472765 0.6982763617 [24,] 0.35811821 0.7162364127 0.6418817936 [25,] 0.53940336 0.9211932740 0.4605966370 [26,] 0.77792487 0.4441502634 0.2220751317 [27,] 0.85841148 0.2831770448 0.1415885224 [28,] 0.96233159 0.0753368255 0.0376684128 [29,] 0.97914004 0.0417199246 0.0208599623 [30,] 0.99199613 0.0160077347 0.0080038673 [31,] 0.99591010 0.0081797996 0.0040898998 [32,] 0.99556034 0.0088793229 0.0044396615 [33,] 0.99495340 0.0100932024 0.0050466012 [34,] 0.99725402 0.0054919571 0.0027459785 [35,] 0.99867759 0.0026448258 0.0013224129 [36,] 0.99904826 0.0019034864 0.0009517432 [37,] 0.99920340 0.0015932046 0.0007966023 [38,] 0.99886359 0.0022728168 0.0011364084 [39,] 0.99881850 0.0023630018 0.0011815009 [40,] 0.99959956 0.0008008758 0.0004004379 [41,] 0.99929908 0.0014018467 0.0007009233 [42,] 0.99859528 0.0028094315 0.0014047158 [43,] 0.99868389 0.0026322198 0.0013161099 [44,] 0.99729226 0.0054154888 0.0027077444 [45,] 0.99599605 0.0080078926 0.0040039463 [46,] 0.99837494 0.0032501277 0.0016250639 [47,] 0.99764993 0.0047001347 0.0023500674 [48,] 0.99448354 0.0110329230 0.0055164615 [49,] 0.99324322 0.0135135512 0.0067567756 [50,] 0.97699366 0.0460126771 0.0230063386 [51,] 0.98764143 0.0247171399 0.0123585700 > postscript(file="/var/www/html/freestat/rcomp/tmp/1up4v1227717732.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/freestat/rcomp/tmp/2x0ju1227717732.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/freestat/rcomp/tmp/3ht9c1227717732.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/freestat/rcomp/tmp/4rpbp1227717732.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/freestat/rcomp/tmp/5vdpf1227717732.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 1.05720325 0.88173241 0.78173241 0.71385944 0.63752081 0.50539379 7 8 9 10 11 12 0.17974295 0.47974295 0.35409211 0.45521379 0.59942539 0.22196509 13 14 15 16 17 18 0.21997562 -0.05947415 0.27290677 0.29009196 0.24276921 0.23093852 19 20 21 22 23 24 0.62446234 0.45883272 0.29320310 0.33517135 0.20279043 0.20926661 25 26 27 28 29 30 0.25235654 0.54700203 0.14251532 0.17153119 -0.10705079 -0.23295552 31 32 33 34 35 36 -0.12535766 -0.56084972 -0.19746346 -0.55238407 -0.11464865 -0.24789736 37 38 39 40 41 42 -0.33606667 -0.52984438 -0.31041583 -0.78252163 -0.39210896 -0.29522010 43 44 45 46 47 48 -0.82224652 -0.28027827 -0.66197140 -0.52423598 -0.77803491 -0.67380209 49 50 51 52 53 54 -0.66421476 -0.90169629 -0.64254285 -0.49522010 -0.48874392 -0.25437354 55 56 57 58 59 60 -0.18537888 0.02558402 0.24924539 0.10615547 0.24052585 0.23404967 > postscript(file="/var/www/html/freestat/rcomp/tmp/6cbr01227717732.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 1.05720325 NA 1 0.88173241 1.05720325 2 0.78173241 0.88173241 3 0.71385944 0.78173241 4 0.63752081 0.71385944 5 0.50539379 0.63752081 6 0.17974295 0.50539379 7 0.47974295 0.17974295 8 0.35409211 0.47974295 9 0.45521379 0.35409211 10 0.59942539 0.45521379 11 0.22196509 0.59942539 12 0.21997562 0.22196509 13 -0.05947415 0.21997562 14 0.27290677 -0.05947415 15 0.29009196 0.27290677 16 0.24276921 0.29009196 17 0.23093852 0.24276921 18 0.62446234 0.23093852 19 0.45883272 0.62446234 20 0.29320310 0.45883272 21 0.33517135 0.29320310 22 0.20279043 0.33517135 23 0.20926661 0.20279043 24 0.25235654 0.20926661 25 0.54700203 0.25235654 26 0.14251532 0.54700203 27 0.17153119 0.14251532 28 -0.10705079 0.17153119 29 -0.23295552 -0.10705079 30 -0.12535766 -0.23295552 31 -0.56084972 -0.12535766 32 -0.19746346 -0.56084972 33 -0.55238407 -0.19746346 34 -0.11464865 -0.55238407 35 -0.24789736 -0.11464865 36 -0.33606667 -0.24789736 37 -0.52984438 -0.33606667 38 -0.31041583 -0.52984438 39 -0.78252163 -0.31041583 40 -0.39210896 -0.78252163 41 -0.29522010 -0.39210896 42 -0.82224652 -0.29522010 43 -0.28027827 -0.82224652 44 -0.66197140 -0.28027827 45 -0.52423598 -0.66197140 46 -0.77803491 -0.52423598 47 -0.67380209 -0.77803491 48 -0.66421476 -0.67380209 49 -0.90169629 -0.66421476 50 -0.64254285 -0.90169629 51 -0.49522010 -0.64254285 52 -0.48874392 -0.49522010 53 -0.25437354 -0.48874392 54 -0.18537888 -0.25437354 55 0.02558402 -0.18537888 56 0.24924539 0.02558402 57 0.10615547 0.24924539 58 0.24052585 0.10615547 59 0.23404967 0.24052585 60 NA 0.23404967 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.88173241 1.05720325 [2,] 0.78173241 0.88173241 [3,] 0.71385944 0.78173241 [4,] 0.63752081 0.71385944 [5,] 0.50539379 0.63752081 [6,] 0.17974295 0.50539379 [7,] 0.47974295 0.17974295 [8,] 0.35409211 0.47974295 [9,] 0.45521379 0.35409211 [10,] 0.59942539 0.45521379 [11,] 0.22196509 0.59942539 [12,] 0.21997562 0.22196509 [13,] -0.05947415 0.21997562 [14,] 0.27290677 -0.05947415 [15,] 0.29009196 0.27290677 [16,] 0.24276921 0.29009196 [17,] 0.23093852 0.24276921 [18,] 0.62446234 0.23093852 [19,] 0.45883272 0.62446234 [20,] 0.29320310 0.45883272 [21,] 0.33517135 0.29320310 [22,] 0.20279043 0.33517135 [23,] 0.20926661 0.20279043 [24,] 0.25235654 0.20926661 [25,] 0.54700203 0.25235654 [26,] 0.14251532 0.54700203 [27,] 0.17153119 0.14251532 [28,] -0.10705079 0.17153119 [29,] -0.23295552 -0.10705079 [30,] -0.12535766 -0.23295552 [31,] -0.56084972 -0.12535766 [32,] -0.19746346 -0.56084972 [33,] -0.55238407 -0.19746346 [34,] -0.11464865 -0.55238407 [35,] -0.24789736 -0.11464865 [36,] -0.33606667 -0.24789736 [37,] -0.52984438 -0.33606667 [38,] -0.31041583 -0.52984438 [39,] -0.78252163 -0.31041583 [40,] -0.39210896 -0.78252163 [41,] -0.29522010 -0.39210896 [42,] -0.82224652 -0.29522010 [43,] -0.28027827 -0.82224652 [44,] -0.66197140 -0.28027827 [45,] -0.52423598 -0.66197140 [46,] -0.77803491 -0.52423598 [47,] -0.67380209 -0.77803491 [48,] -0.66421476 -0.67380209 [49,] -0.90169629 -0.66421476 [50,] -0.64254285 -0.90169629 [51,] -0.49522010 -0.64254285 [52,] -0.48874392 -0.49522010 [53,] -0.25437354 -0.48874392 [54,] -0.18537888 -0.25437354 [55,] 0.02558402 -0.18537888 [56,] 0.24924539 0.02558402 [57,] 0.10615547 0.24924539 [58,] 0.24052585 0.10615547 [59,] 0.23404967 0.24052585 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.88173241 1.05720325 2 0.78173241 0.88173241 3 0.71385944 0.78173241 4 0.63752081 0.71385944 5 0.50539379 0.63752081 6 0.17974295 0.50539379 7 0.47974295 0.17974295 8 0.35409211 0.47974295 9 0.45521379 0.35409211 10 0.59942539 0.45521379 11 0.22196509 0.59942539 12 0.21997562 0.22196509 13 -0.05947415 0.21997562 14 0.27290677 -0.05947415 15 0.29009196 0.27290677 16 0.24276921 0.29009196 17 0.23093852 0.24276921 18 0.62446234 0.23093852 19 0.45883272 0.62446234 20 0.29320310 0.45883272 21 0.33517135 0.29320310 22 0.20279043 0.33517135 23 0.20926661 0.20279043 24 0.25235654 0.20926661 25 0.54700203 0.25235654 26 0.14251532 0.54700203 27 0.17153119 0.14251532 28 -0.10705079 0.17153119 29 -0.23295552 -0.10705079 30 -0.12535766 -0.23295552 31 -0.56084972 -0.12535766 32 -0.19746346 -0.56084972 33 -0.55238407 -0.19746346 34 -0.11464865 -0.55238407 35 -0.24789736 -0.11464865 36 -0.33606667 -0.24789736 37 -0.52984438 -0.33606667 38 -0.31041583 -0.52984438 39 -0.78252163 -0.31041583 40 -0.39210896 -0.78252163 41 -0.29522010 -0.39210896 42 -0.82224652 -0.29522010 43 -0.28027827 -0.82224652 44 -0.66197140 -0.28027827 45 -0.52423598 -0.66197140 46 -0.77803491 -0.52423598 47 -0.67380209 -0.77803491 48 -0.66421476 -0.67380209 49 -0.90169629 -0.66421476 50 -0.64254285 -0.90169629 51 -0.49522010 -0.64254285 52 -0.48874392 -0.49522010 53 -0.25437354 -0.48874392 54 -0.18537888 -0.25437354 55 0.02558402 -0.18537888 56 0.24924539 0.02558402 57 0.10615547 0.24924539 58 0.24052585 0.10615547 59 0.23404967 0.24052585 > 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/7g7071227717732.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/freestat/rcomp/tmp/8klwl1227717732.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/freestat/rcomp/tmp/9c8cc1227717732.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/freestat/rcomp/tmp/10jz671227717733.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/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/115n6b1227717733.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/128ejv1227717733.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/13fejs1227717733.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/14zovo1227717733.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/15pxiu1227717733.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/16ynav1227717733.tab") + } > > system("convert tmp/1up4v1227717732.ps tmp/1up4v1227717732.png") > system("convert tmp/2x0ju1227717732.ps tmp/2x0ju1227717732.png") > system("convert tmp/3ht9c1227717732.ps tmp/3ht9c1227717732.png") > system("convert tmp/4rpbp1227717732.ps tmp/4rpbp1227717732.png") > system("convert tmp/5vdpf1227717732.ps tmp/5vdpf1227717732.png") > system("convert tmp/6cbr01227717732.ps tmp/6cbr01227717732.png") > system("convert tmp/7g7071227717732.ps tmp/7g7071227717732.png") > system("convert tmp/8klwl1227717732.ps tmp/8klwl1227717732.png") > system("convert tmp/9c8cc1227717732.ps tmp/9c8cc1227717732.png") > system("convert tmp/10jz671227717733.ps tmp/10jz671227717733.png") > > > proc.time() user system elapsed 3.629 2.461 4.049