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(100.0 + ,114.1 + ,141.7 + ,100.0 + ,93.5 + ,110.3 + ,153.4 + ,117.8 + ,88.2 + ,103.9 + ,145 + ,95.7 + ,89.2 + ,101.6 + ,137.7 + ,100.5 + ,91.4 + ,94.6 + ,148.3 + ,105.1 + ,92.5 + ,95.9 + ,152.2 + ,116.2 + ,91.4 + ,104.7 + ,169.4 + ,125.3 + ,88.2 + ,102.8 + ,168.6 + ,130.2 + ,87.1 + ,98.1 + ,161.1 + ,137.1 + ,84.9 + ,113.9 + ,174.1 + ,136.3 + ,92.5 + ,80.9 + ,179 + ,107.8 + ,93.5 + ,95.7 + ,190.6 + ,118.1 + ,93.5 + ,113.2 + ,190 + ,119.5 + ,91.4 + ,105.9 + ,181.6 + ,124.1 + ,90.3 + ,108.8 + ,174.8 + ,114.0 + ,91.4 + ,102.3 + ,180.5 + ,132.2 + ,93.5 + ,99 + ,196.8 + ,160.0 + ,93.5 + ,100.7 + ,193.8 + ,124.6 + ,92.5 + ,115.5 + ,197 + ,138.7 + ,91.4 + ,100.7 + ,216.3 + ,105.1 + ,89.2 + ,109.9 + ,221.4 + ,132.3 + ,86.0 + ,114.6 + ,217.9 + ,118.4 + ,88.2 + ,85.4 + ,229.7 + ,114.2 + ,87.1 + ,100.5 + ,227.4 + ,106.7 + ,87.1 + ,114.8 + ,204.2 + ,110.7 + ,86.0 + ,116.5 + ,196.6 + ,115.3 + ,84.9 + ,112.9 + ,198.8 + ,95.7 + ,84.9 + ,102 + ,207.5 + ,106.0 + ,86.0 + ,106 + ,190.7 + ,109.3 + ,86.0 + ,105.3 + ,201.6 + ,105.9 + ,84.9 + ,118.8 + ,210.5 + ,118.5 + ,86.0 + ,106.1 + ,223.5 + ,107.5 + ,82.8 + ,109.3 + ,223.8 + ,102.4 + ,77.4 + ,117.2 + ,231.2 + ,126.7 + ,80.6 + ,92.5 + ,244 + ,112.0 + ,78.5 + ,104.2 + ,234.7 + ,99.5 + ,75.3 + ,112.5 + ,250.2 + ,88.3 + ,75.3 + ,122.4 + ,265.7 + ,118.0 + ,75.3 + ,113.3 + ,287.6 + ,96.2 + ,77.4 + ,100 + ,283.3 + ,96.0 + ,78.5 + ,110.7 + ,295.4 + ,117.5 + ,76.3 + ,112.8 + ,312.3 + ,113.5 + ,73.1 + ,109.8 + ,333.8 + ,101.9 + ,68.8 + ,117.3 + ,347.7 + ,130.1 + ,65.6 + ,109.1 + ,383.2 + ,96.5 + ,69.9 + ,115.9 + ,407.1 + ,122.2 + ,82.8 + ,96 + ,413.6 + ,106.4 + ,84.9 + ,99.8 + ,362.7 + ,99.8 + ,80.6 + ,116.8 + ,321.9 + ,113.0 + ,74.2 + ,115.7 + ,239.4 + ,99.6 + ,71.0 + ,99.4 + ,191 + ,85.0 + ,74.2 + ,94.3 + ,159.7 + ,96.8 + ,82.8 + ,91 + ,163.4 + ,83.2 + ,86.0 + ,93.2 + ,157.6 + ,81.1 + ,86.0 + ,103.1 + ,166.2 + ,104.4 + ,82.8 + ,94.1 + ,176.7 + ,91.3 + ,78.5 + ,91.8 + ,198.3 + ,85.0 + ,79.6 + ,102.7 + ,226.2 + ,117.5 + ,87.1 + ,82.6 + ,216.2 + ,98.3 + ,89.2 + ,89.1 + ,235.9 + ,112.7) + ,dim=c(4 + ,60) + ,dimnames=list(c('WRKL' + ,'IND' + ,'GRON' + ,'BOUW') + ,1:60)) > y <- array(NA,dim=c(4,60),dimnames=list(c('WRKL','IND','GRON','BOUW'),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 WRKL IND GRON BOUW 1 100.0 114.1 141.7 100.0 2 93.5 110.3 153.4 117.8 3 88.2 103.9 145.0 95.7 4 89.2 101.6 137.7 100.5 5 91.4 94.6 148.3 105.1 6 92.5 95.9 152.2 116.2 7 91.4 104.7 169.4 125.3 8 88.2 102.8 168.6 130.2 9 87.1 98.1 161.1 137.1 10 84.9 113.9 174.1 136.3 11 92.5 80.9 179.0 107.8 12 93.5 95.7 190.6 118.1 13 93.5 113.2 190.0 119.5 14 91.4 105.9 181.6 124.1 15 90.3 108.8 174.8 114.0 16 91.4 102.3 180.5 132.2 17 93.5 99.0 196.8 160.0 18 93.5 100.7 193.8 124.6 19 92.5 115.5 197.0 138.7 20 91.4 100.7 216.3 105.1 21 89.2 109.9 221.4 132.3 22 86.0 114.6 217.9 118.4 23 88.2 85.4 229.7 114.2 24 87.1 100.5 227.4 106.7 25 87.1 114.8 204.2 110.7 26 86.0 116.5 196.6 115.3 27 84.9 112.9 198.8 95.7 28 84.9 102.0 207.5 106.0 29 86.0 106.0 190.7 109.3 30 86.0 105.3 201.6 105.9 31 84.9 118.8 210.5 118.5 32 86.0 106.1 223.5 107.5 33 82.8 109.3 223.8 102.4 34 77.4 117.2 231.2 126.7 35 80.6 92.5 244.0 112.0 36 78.5 104.2 234.7 99.5 37 75.3 112.5 250.2 88.3 38 75.3 122.4 265.7 118.0 39 75.3 113.3 287.6 96.2 40 77.4 100.0 283.3 96.0 41 78.5 110.7 295.4 117.5 42 76.3 112.8 312.3 113.5 43 73.1 109.8 333.8 101.9 44 68.8 117.3 347.7 130.1 45 65.6 109.1 383.2 96.5 46 69.9 115.9 407.1 122.2 47 82.8 96.0 413.6 106.4 48 84.9 99.8 362.7 99.8 49 80.6 116.8 321.9 113.0 50 74.2 115.7 239.4 99.6 51 71.0 99.4 191.0 85.0 52 74.2 94.3 159.7 96.8 53 82.8 91.0 163.4 83.2 54 86.0 93.2 157.6 81.1 55 86.0 103.1 166.2 104.4 56 82.8 94.1 176.7 91.3 57 78.5 91.8 198.3 85.0 58 79.6 102.7 226.2 117.5 59 87.1 82.6 216.2 98.3 60 89.2 89.1 235.9 112.7 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) IND GRON BOUW 96.01031 -0.16223 -0.06478 0.17759 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -13.3572 -2.6561 0.7497 2.6704 13.9207 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 96.01031 7.72954 12.421 < 2e-16 *** IND -0.16223 0.07370 -2.201 0.031843 * GRON -0.06478 0.01029 -6.299 4.95e-08 *** BOUW 0.17759 0.04453 3.989 0.000195 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5.033 on 56 degrees of freedom Multiple R-squared: 0.5562, Adjusted R-squared: 0.5324 F-statistic: 23.39 on 3 and 56 DF, p-value: 6.054e-10 > 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.449112540 0.89822508 0.5508875 [2,] 0.357411146 0.71482229 0.6425889 [3,] 0.283862505 0.56772501 0.7161375 [4,] 0.375948786 0.75189757 0.6240512 [5,] 0.326009001 0.65201800 0.6739910 [6,] 0.244205408 0.48841082 0.7557946 [7,] 0.188107270 0.37621454 0.8118927 [8,] 0.124882794 0.24976559 0.8751172 [9,] 0.099137315 0.19827463 0.9008627 [10,] 0.067776902 0.13555380 0.9322231 [11,] 0.101251354 0.20250271 0.8987486 [12,] 0.070619144 0.14123829 0.9293809 [13,] 0.047526315 0.09505263 0.9524737 [14,] 0.052360140 0.10472028 0.9476399 [15,] 0.042032215 0.08406443 0.9579678 [16,] 0.057057553 0.11411511 0.9429424 [17,] 0.040561592 0.08112318 0.9594384 [18,] 0.034101270 0.06820254 0.9658987 [19,] 0.033633021 0.06726604 0.9663670 [20,] 0.034484139 0.06896828 0.9655159 [21,] 0.043929846 0.08785969 0.9560702 [22,] 0.040096367 0.08019273 0.9599036 [23,] 0.036242348 0.07248470 0.9637577 [24,] 0.032616689 0.06523338 0.9673833 [25,] 0.039022847 0.07804569 0.9609772 [26,] 0.040911277 0.08182255 0.9590887 [27,] 0.046292980 0.09258596 0.9537070 [28,] 0.081391568 0.16278314 0.9186084 [29,] 0.083776898 0.16755380 0.9162231 [30,] 0.077964163 0.15592833 0.9220358 [31,] 0.071337183 0.14267437 0.9286628 [32,] 0.059658780 0.11931756 0.9403412 [33,] 0.044272712 0.08854542 0.9557273 [34,] 0.028292059 0.05658412 0.9717079 [35,] 0.018982828 0.03796566 0.9810172 [36,] 0.012192955 0.02438591 0.9878070 [37,] 0.006992064 0.01398413 0.9930079 [38,] 0.009321063 0.01864213 0.9906789 [39,] 0.018779395 0.03755879 0.9812206 [40,] 0.055986375 0.11197275 0.9440136 [41,] 0.160755962 0.32151192 0.8392440 [42,] 0.176617806 0.35323561 0.8233822 [43,] 0.168629844 0.33725969 0.8313702 [44,] 0.155037428 0.31007486 0.8449626 [45,] 0.277625994 0.55525199 0.7223740 [46,] 0.937898604 0.12420279 0.0621014 [47,] 0.898166187 0.20366763 0.1018338 > postscript(file="/var/www/html/rcomp/tmp/17erz1261145124.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/2hgjy1261145124.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/3ytnf1261145124.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/4ml311261145124.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/513ht1261145124.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 13.92069087 4.40096215 1.44332927 0.74483904 1.67894135 1.27119823 7 8 9 10 11 12 1.09698654 -3.33329416 -6.90705078 -5.55951971 2.06559462 4.38890497 13 14 15 16 17 18 6.94050933 2.29510634 3.01877626 0.20129198 -2.11526757 4.25301536 19 20 21 22 23 24 3.35731002 7.07366549 1.86604922 1.67037499 0.64343448 3.17613495 25 26 27 28 29 30 3.28279870 1.14933117 3.08864640 0.05466489 0.12922572 1.32559162 31 32 33 34 35 36 0.75462282 2.58992811 0.83424212 -7.12026072 -4.48762833 -3.07202093 37 38 39 40 41 42 -1.93231962 -4.59663646 -0.78272295 -1.08348087 -1.28199420 -1.33613050 43 44 45 46 47 48 -1.56995714 -8.76089517 -5.02434303 -2.63705245 10.26154013 10.85280956 49 50 51 52 53 54 4.32350018 -5.21961346 -11.60655448 -13.35719809 -2.63760514 0.91652962 55 56 57 58 59 60 -1.05817324 -2.71160479 -4.86663722 -5.96270090 1.03838130 2.91173410 > postscript(file="/var/www/html/rcomp/tmp/6jwpt1261145124.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 13.92069087 NA 1 4.40096215 13.92069087 2 1.44332927 4.40096215 3 0.74483904 1.44332927 4 1.67894135 0.74483904 5 1.27119823 1.67894135 6 1.09698654 1.27119823 7 -3.33329416 1.09698654 8 -6.90705078 -3.33329416 9 -5.55951971 -6.90705078 10 2.06559462 -5.55951971 11 4.38890497 2.06559462 12 6.94050933 4.38890497 13 2.29510634 6.94050933 14 3.01877626 2.29510634 15 0.20129198 3.01877626 16 -2.11526757 0.20129198 17 4.25301536 -2.11526757 18 3.35731002 4.25301536 19 7.07366549 3.35731002 20 1.86604922 7.07366549 21 1.67037499 1.86604922 22 0.64343448 1.67037499 23 3.17613495 0.64343448 24 3.28279870 3.17613495 25 1.14933117 3.28279870 26 3.08864640 1.14933117 27 0.05466489 3.08864640 28 0.12922572 0.05466489 29 1.32559162 0.12922572 30 0.75462282 1.32559162 31 2.58992811 0.75462282 32 0.83424212 2.58992811 33 -7.12026072 0.83424212 34 -4.48762833 -7.12026072 35 -3.07202093 -4.48762833 36 -1.93231962 -3.07202093 37 -4.59663646 -1.93231962 38 -0.78272295 -4.59663646 39 -1.08348087 -0.78272295 40 -1.28199420 -1.08348087 41 -1.33613050 -1.28199420 42 -1.56995714 -1.33613050 43 -8.76089517 -1.56995714 44 -5.02434303 -8.76089517 45 -2.63705245 -5.02434303 46 10.26154013 -2.63705245 47 10.85280956 10.26154013 48 4.32350018 10.85280956 49 -5.21961346 4.32350018 50 -11.60655448 -5.21961346 51 -13.35719809 -11.60655448 52 -2.63760514 -13.35719809 53 0.91652962 -2.63760514 54 -1.05817324 0.91652962 55 -2.71160479 -1.05817324 56 -4.86663722 -2.71160479 57 -5.96270090 -4.86663722 58 1.03838130 -5.96270090 59 2.91173410 1.03838130 60 NA 2.91173410 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 4.40096215 13.92069087 [2,] 1.44332927 4.40096215 [3,] 0.74483904 1.44332927 [4,] 1.67894135 0.74483904 [5,] 1.27119823 1.67894135 [6,] 1.09698654 1.27119823 [7,] -3.33329416 1.09698654 [8,] -6.90705078 -3.33329416 [9,] -5.55951971 -6.90705078 [10,] 2.06559462 -5.55951971 [11,] 4.38890497 2.06559462 [12,] 6.94050933 4.38890497 [13,] 2.29510634 6.94050933 [14,] 3.01877626 2.29510634 [15,] 0.20129198 3.01877626 [16,] -2.11526757 0.20129198 [17,] 4.25301536 -2.11526757 [18,] 3.35731002 4.25301536 [19,] 7.07366549 3.35731002 [20,] 1.86604922 7.07366549 [21,] 1.67037499 1.86604922 [22,] 0.64343448 1.67037499 [23,] 3.17613495 0.64343448 [24,] 3.28279870 3.17613495 [25,] 1.14933117 3.28279870 [26,] 3.08864640 1.14933117 [27,] 0.05466489 3.08864640 [28,] 0.12922572 0.05466489 [29,] 1.32559162 0.12922572 [30,] 0.75462282 1.32559162 [31,] 2.58992811 0.75462282 [32,] 0.83424212 2.58992811 [33,] -7.12026072 0.83424212 [34,] -4.48762833 -7.12026072 [35,] -3.07202093 -4.48762833 [36,] -1.93231962 -3.07202093 [37,] -4.59663646 -1.93231962 [38,] -0.78272295 -4.59663646 [39,] -1.08348087 -0.78272295 [40,] -1.28199420 -1.08348087 [41,] -1.33613050 -1.28199420 [42,] -1.56995714 -1.33613050 [43,] -8.76089517 -1.56995714 [44,] -5.02434303 -8.76089517 [45,] -2.63705245 -5.02434303 [46,] 10.26154013 -2.63705245 [47,] 10.85280956 10.26154013 [48,] 4.32350018 10.85280956 [49,] -5.21961346 4.32350018 [50,] -11.60655448 -5.21961346 [51,] -13.35719809 -11.60655448 [52,] -2.63760514 -13.35719809 [53,] 0.91652962 -2.63760514 [54,] -1.05817324 0.91652962 [55,] -2.71160479 -1.05817324 [56,] -4.86663722 -2.71160479 [57,] -5.96270090 -4.86663722 [58,] 1.03838130 -5.96270090 [59,] 2.91173410 1.03838130 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 4.40096215 13.92069087 2 1.44332927 4.40096215 3 0.74483904 1.44332927 4 1.67894135 0.74483904 5 1.27119823 1.67894135 6 1.09698654 1.27119823 7 -3.33329416 1.09698654 8 -6.90705078 -3.33329416 9 -5.55951971 -6.90705078 10 2.06559462 -5.55951971 11 4.38890497 2.06559462 12 6.94050933 4.38890497 13 2.29510634 6.94050933 14 3.01877626 2.29510634 15 0.20129198 3.01877626 16 -2.11526757 0.20129198 17 4.25301536 -2.11526757 18 3.35731002 4.25301536 19 7.07366549 3.35731002 20 1.86604922 7.07366549 21 1.67037499 1.86604922 22 0.64343448 1.67037499 23 3.17613495 0.64343448 24 3.28279870 3.17613495 25 1.14933117 3.28279870 26 3.08864640 1.14933117 27 0.05466489 3.08864640 28 0.12922572 0.05466489 29 1.32559162 0.12922572 30 0.75462282 1.32559162 31 2.58992811 0.75462282 32 0.83424212 2.58992811 33 -7.12026072 0.83424212 34 -4.48762833 -7.12026072 35 -3.07202093 -4.48762833 36 -1.93231962 -3.07202093 37 -4.59663646 -1.93231962 38 -0.78272295 -4.59663646 39 -1.08348087 -0.78272295 40 -1.28199420 -1.08348087 41 -1.33613050 -1.28199420 42 -1.56995714 -1.33613050 43 -8.76089517 -1.56995714 44 -5.02434303 -8.76089517 45 -2.63705245 -5.02434303 46 10.26154013 -2.63705245 47 10.85280956 10.26154013 48 4.32350018 10.85280956 49 -5.21961346 4.32350018 50 -11.60655448 -5.21961346 51 -13.35719809 -11.60655448 52 -2.63760514 -13.35719809 53 0.91652962 -2.63760514 54 -1.05817324 0.91652962 55 -2.71160479 -1.05817324 56 -4.86663722 -2.71160479 57 -5.96270090 -4.86663722 58 1.03838130 -5.96270090 59 2.91173410 1.03838130 > 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/7ulie1261145124.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/89mff1261145124.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/97cr11261145124.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/10br6s1261145124.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/11zpgq1261145124.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/12ag0g1261145124.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/13ueep1261145124.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/14o05l1261145124.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/1585m31261145125.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/16ddcr1261145125.tab") + } > > try(system("convert tmp/17erz1261145124.ps tmp/17erz1261145124.png",intern=TRUE)) character(0) > try(system("convert tmp/2hgjy1261145124.ps tmp/2hgjy1261145124.png",intern=TRUE)) character(0) > try(system("convert tmp/3ytnf1261145124.ps tmp/3ytnf1261145124.png",intern=TRUE)) character(0) > try(system("convert tmp/4ml311261145124.ps tmp/4ml311261145124.png",intern=TRUE)) character(0) > try(system("convert tmp/513ht1261145124.ps tmp/513ht1261145124.png",intern=TRUE)) character(0) > try(system("convert tmp/6jwpt1261145124.ps tmp/6jwpt1261145124.png",intern=TRUE)) character(0) > try(system("convert tmp/7ulie1261145124.ps tmp/7ulie1261145124.png",intern=TRUE)) character(0) > try(system("convert tmp/89mff1261145124.ps tmp/89mff1261145124.png",intern=TRUE)) character(0) > try(system("convert tmp/97cr11261145124.ps tmp/97cr11261145124.png",intern=TRUE)) character(0) > try(system("convert tmp/10br6s1261145124.ps tmp/10br6s1261145124.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.549 1.616 8.421