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(3,0,3.21,0,3.37,0,3.51,0,3.75,0,4.11,0,4.25,0,4.25,0,4.5,0,4.7,0,4.75,0,4.75,0,4.75,0,4.75,0,4.75,0,4.75,0,4.58,0,4.5,0,4.5,0,4.49,0,4.03,0,3.75,0,3.39,0,3.25,0,3.25,0,3.25,0,3.25,0,3.25,0,3.25,0,3.25,0,3.25,0,3.25,0,3.25,0,3.25,0,3.25,0,2.85,0,2.75,0,2.75,0,2.55,0,2.5,0,2.5,0,2.1,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2,0,2.21,0,2.25,0,2.25,0,2.45,0,2.5,0,2.5,0,2.64,0,2.75,0,2.93,0,3,0,3.17,0,3.25,0,3.39,0,3.5,0,3.5,0,3.65,0,3.75,0,3.75,0,3.9,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4,0,4.18,0,4.25,0,4.25,0,3.97,1,3.42,1,2.75,1,2.31,1,2,1,1.66,1,1.31,1,1.09,1,1,1,1,1,1,1,1,1,1,1),dim=c(2,118),dimnames=list(c('Rente','Crisis'),1:118)) > y <- array(NA,dim=c(2,118),dimnames=list(c('Rente','Crisis'),1:118)) > 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 Rente Crisis 1 3.00 0 2 3.21 0 3 3.37 0 4 3.51 0 5 3.75 0 6 4.11 0 7 4.25 0 8 4.25 0 9 4.50 0 10 4.70 0 11 4.75 0 12 4.75 0 13 4.75 0 14 4.75 0 15 4.75 0 16 4.75 0 17 4.58 0 18 4.50 0 19 4.50 0 20 4.49 0 21 4.03 0 22 3.75 0 23 3.39 0 24 3.25 0 25 3.25 0 26 3.25 0 27 3.25 0 28 3.25 0 29 3.25 0 30 3.25 0 31 3.25 0 32 3.25 0 33 3.25 0 34 3.25 0 35 3.25 0 36 2.85 0 37 2.75 0 38 2.75 0 39 2.55 0 40 2.50 0 41 2.50 0 42 2.10 0 43 2.00 0 44 2.00 0 45 2.00 0 46 2.00 0 47 2.00 0 48 2.00 0 49 2.00 0 50 2.00 0 51 2.00 0 52 2.00 0 53 2.00 0 54 2.00 0 55 2.00 0 56 2.00 0 57 2.00 0 58 2.00 0 59 2.00 0 60 2.00 0 61 2.00 0 62 2.00 0 63 2.00 0 64 2.00 0 65 2.00 0 66 2.00 0 67 2.00 0 68 2.00 0 69 2.00 0 70 2.00 0 71 2.00 0 72 2.21 0 73 2.25 0 74 2.25 0 75 2.45 0 76 2.50 0 77 2.50 0 78 2.64 0 79 2.75 0 80 2.93 0 81 3.00 0 82 3.17 0 83 3.25 0 84 3.39 0 85 3.50 0 86 3.50 0 87 3.65 0 88 3.75 0 89 3.75 0 90 3.90 0 91 4.00 0 92 4.00 0 93 4.00 0 94 4.00 0 95 4.00 0 96 4.00 0 97 4.00 0 98 4.00 0 99 4.00 0 100 4.00 0 101 4.00 0 102 4.00 0 103 4.18 0 104 4.25 0 105 4.25 0 106 3.97 1 107 3.42 1 108 2.75 1 109 2.31 1 110 2.00 1 111 1.66 1 112 1.31 1 113 1.09 1 114 1.00 1 115 1.00 1 116 1.00 1 117 1.00 1 118 1.00 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Crisis 3.137 -1.329 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.1372 -1.0097 0.1128 0.8628 2.1615 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.13724 0.09248 33.924 < 2e-16 *** Crisis -1.32878 0.27862 -4.769 5.42e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.9476 on 116 degrees of freedom Multiple R-squared: 0.1639, Adjusted R-squared: 0.1567 F-statistic: 22.75 on 1 and 116 DF, p-value: 5.424e-06 > 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.04982274 9.964548e-02 9.501773e-01 [2,] 0.06788632 1.357726e-01 9.321137e-01 [3,] 0.07412821 1.482564e-01 9.258718e-01 [4,] 0.06273027 1.254605e-01 9.372697e-01 [5,] 0.07136448 1.427290e-01 9.286355e-01 [6,] 0.09304698 1.860940e-01 9.069530e-01 [7,] 0.10885849 2.177170e-01 8.911415e-01 [8,] 0.11526034 2.305207e-01 8.847397e-01 [9,] 0.11590267 2.318053e-01 8.840973e-01 [10,] 0.11333995 2.266799e-01 8.866601e-01 [11,] 0.10928364 2.185673e-01 8.907164e-01 [12,] 0.10487169 2.097434e-01 8.951283e-01 [13,] 0.08897760 1.779552e-01 9.110224e-01 [14,] 0.07247455 1.449491e-01 9.275254e-01 [15,] 0.05950579 1.190116e-01 9.404942e-01 [16,] 0.04913816 9.827633e-02 9.508618e-01 [17,] 0.03720893 7.441786e-02 9.627911e-01 [18,] 0.03144985 6.289970e-02 9.685501e-01 [19,] 0.03596458 7.192917e-02 9.640354e-01 [20,] 0.04489622 8.979244e-02 9.551038e-01 [21,] 0.05171283 1.034257e-01 9.482872e-01 [22,] 0.05622303 1.124461e-01 9.437770e-01 [23,] 0.05853048 1.170610e-01 9.414695e-01 [24,] 0.05889745 1.177949e-01 9.411026e-01 [25,] 0.05765603 1.153121e-01 9.423440e-01 [26,] 0.05515428 1.103086e-01 9.448457e-01 [27,] 0.05172510 1.034502e-01 9.482749e-01 [28,] 0.04766936 9.533871e-02 9.523306e-01 [29,] 0.04324767 8.649535e-02 9.567523e-01 [30,] 0.03867758 7.735516e-02 9.613224e-01 [31,] 0.03413394 6.826787e-02 9.658661e-01 [32,] 0.03905238 7.810476e-02 9.609476e-01 [33,] 0.04644561 9.289122e-02 9.535544e-01 [34,] 0.05252375 1.050475e-01 9.474762e-01 [35,] 0.06688506 1.337701e-01 9.331149e-01 [36,] 0.08325370 1.665074e-01 9.167463e-01 [37,] 0.09808271 1.961654e-01 9.019173e-01 [38,] 0.14839988 2.967998e-01 8.516001e-01 [39,] 0.21590993 4.318199e-01 7.840901e-01 [40,] 0.28472948 5.694590e-01 7.152705e-01 [41,] 0.35065893 7.013179e-01 6.493411e-01 [42,] 0.41132601 8.226520e-01 5.886740e-01 [43,] 0.46573560 9.314712e-01 5.342644e-01 [44,] 0.51377608 9.724478e-01 4.862239e-01 [45,] 0.55583311 8.883338e-01 4.441669e-01 [46,] 0.59253109 8.149378e-01 4.074689e-01 [47,] 0.62457693 7.508461e-01 3.754231e-01 [48,] 0.65267380 6.946524e-01 3.473262e-01 [49,] 0.67747867 6.450427e-01 3.225213e-01 [50,] 0.69958528 6.008294e-01 3.004147e-01 [51,] 0.71952096 5.609581e-01 2.804790e-01 [52,] 0.73775014 5.244997e-01 2.622499e-01 [53,] 0.75468065 4.906387e-01 2.453194e-01 [54,] 0.77067030 4.586594e-01 2.293297e-01 [55,] 0.78603252 4.279350e-01 2.139675e-01 [56,] 0.80104033 3.979193e-01 1.989597e-01 [57,] 0.81592794 3.681441e-01 1.840721e-01 [58,] 0.83088984 3.382203e-01 1.691102e-01 [59,] 0.84607667 3.078467e-01 1.539233e-01 [60,] 0.86158764 2.768247e-01 1.384124e-01 [61,] 0.87745918 2.450816e-01 1.225408e-01 [62,] 0.89364971 2.127006e-01 1.063503e-01 [63,] 0.91002158 1.799568e-01 8.997842e-02 [64,] 0.92632246 1.473551e-01 7.367754e-02 [65,] 0.94217157 1.156569e-01 5.782843e-02 [66,] 0.95706044 8.587913e-02 4.293956e-02 [67,] 0.97038332 5.923336e-02 2.961668e-02 [68,] 0.97663417 4.673167e-02 2.336583e-02 [69,] 0.98199676 3.600649e-02 1.800324e-02 [70,] 0.98716832 2.566336e-02 1.283168e-02 [71,] 0.98943910 2.112179e-02 1.056090e-02 [72,] 0.99141083 1.717835e-02 8.589173e-03 [73,] 0.99354627 1.290746e-02 6.453729e-03 [74,] 0.99471119 1.057763e-02 5.288814e-03 [75,] 0.99540718 9.185640e-03 4.592820e-03 [76,] 0.99541186 9.176275e-03 4.588137e-03 [77,] 0.99530212 9.395754e-03 4.697877e-03 [78,] 0.99460014 1.079972e-02 5.399860e-03 [79,] 0.99358721 1.282559e-02 6.412794e-03 [80,] 0.99186070 1.627861e-02 8.139304e-03 [81,] 0.98929857 2.140287e-02 1.070143e-02 [82,] 0.98616883 2.766234e-02 1.383117e-02 [83,] 0.98146138 3.707723e-02 1.853862e-02 [84,] 0.97497810 5.004380e-02 2.502190e-02 [85,] 0.96663218 6.673564e-02 3.336782e-02 [86,] 0.95552156 8.895688e-02 4.447844e-02 [87,] 0.94156429 1.168714e-01 5.843571e-02 [88,] 0.92386305 1.522739e-01 7.613695e-02 [89,] 0.90171972 1.965606e-01 9.828028e-02 [90,] 0.87443406 2.511319e-01 1.255659e-01 [91,] 0.84136171 3.172766e-01 1.586383e-01 [92,] 0.80198993 3.960201e-01 1.980101e-01 [93,] 0.75602833 4.879433e-01 2.439717e-01 [94,] 0.70350827 5.929835e-01 2.964917e-01 [95,] 0.64488149 7.102370e-01 3.551185e-01 [96,] 0.58110911 8.377818e-01 4.188909e-01 [97,] 0.51374342 9.725132e-01 4.862566e-01 [98,] 0.44506334 8.901267e-01 5.549367e-01 [99,] 0.37681843 7.536369e-01 6.231816e-01 [100,] 0.31103122 6.220624e-01 6.889688e-01 [101,] 0.24836316 4.967263e-01 7.516368e-01 [102,] 0.58787851 8.242430e-01 4.121215e-01 [103,] 0.87151712 2.569658e-01 1.284829e-01 [104,] 0.96303123 7.393754e-02 3.696877e-02 [105,] 0.98980909 2.038182e-02 1.019091e-02 [106,] 0.99823887 3.522268e-03 1.761134e-03 [107,] 0.99986047 2.790639e-04 1.395319e-04 [108,] 0.99999258 1.483139e-05 7.415693e-06 [109,] 1.00000000 5.580344e-47 2.790172e-47 > postscript(file="/var/www/html/rcomp/tmp/1gh8p1258734625.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/2vq5w1258734625.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/3fgai1258734625.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/4cxmo1258734625.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/5vv9o1258734625.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 = 118 Frequency = 1 1 2 3 4 5 6 -0.13723810 0.07276190 0.23276190 0.37276190 0.61276190 0.97276190 7 8 9 10 11 12 1.11276190 1.11276190 1.36276190 1.56276190 1.61276190 1.61276190 13 14 15 16 17 18 1.61276190 1.61276190 1.61276190 1.61276190 1.44276190 1.36276190 19 20 21 22 23 24 1.36276190 1.35276190 0.89276190 0.61276190 0.25276190 0.11276190 25 26 27 28 29 30 0.11276190 0.11276190 0.11276190 0.11276190 0.11276190 0.11276190 31 32 33 34 35 36 0.11276190 0.11276190 0.11276190 0.11276190 0.11276190 -0.28723810 37 38 39 40 41 42 -0.38723810 -0.38723810 -0.58723810 -0.63723810 -0.63723810 -1.03723810 43 44 45 46 47 48 -1.13723810 -1.13723810 -1.13723810 -1.13723810 -1.13723810 -1.13723810 49 50 51 52 53 54 -1.13723810 -1.13723810 -1.13723810 -1.13723810 -1.13723810 -1.13723810 55 56 57 58 59 60 -1.13723810 -1.13723810 -1.13723810 -1.13723810 -1.13723810 -1.13723810 61 62 63 64 65 66 -1.13723810 -1.13723810 -1.13723810 -1.13723810 -1.13723810 -1.13723810 67 68 69 70 71 72 -1.13723810 -1.13723810 -1.13723810 -1.13723810 -1.13723810 -0.92723810 73 74 75 76 77 78 -0.88723810 -0.88723810 -0.68723810 -0.63723810 -0.63723810 -0.49723810 79 80 81 82 83 84 -0.38723810 -0.20723810 -0.13723810 0.03276190 0.11276190 0.25276190 85 86 87 88 89 90 0.36276190 0.36276190 0.51276190 0.61276190 0.61276190 0.76276190 91 92 93 94 95 96 0.86276190 0.86276190 0.86276190 0.86276190 0.86276190 0.86276190 97 98 99 100 101 102 0.86276190 0.86276190 0.86276190 0.86276190 0.86276190 0.86276190 103 104 105 106 107 108 1.04276190 1.11276190 1.11276190 2.16153846 1.61153846 0.94153846 109 110 111 112 113 114 0.50153846 0.19153846 -0.14846154 -0.49846154 -0.71846154 -0.80846154 115 116 117 118 -0.80846154 -0.80846154 -0.80846154 -0.80846154 > postscript(file="/var/www/html/rcomp/tmp/6wccv1258734625.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 = 118 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.13723810 NA 1 0.07276190 -0.13723810 2 0.23276190 0.07276190 3 0.37276190 0.23276190 4 0.61276190 0.37276190 5 0.97276190 0.61276190 6 1.11276190 0.97276190 7 1.11276190 1.11276190 8 1.36276190 1.11276190 9 1.56276190 1.36276190 10 1.61276190 1.56276190 11 1.61276190 1.61276190 12 1.61276190 1.61276190 13 1.61276190 1.61276190 14 1.61276190 1.61276190 15 1.61276190 1.61276190 16 1.44276190 1.61276190 17 1.36276190 1.44276190 18 1.36276190 1.36276190 19 1.35276190 1.36276190 20 0.89276190 1.35276190 21 0.61276190 0.89276190 22 0.25276190 0.61276190 23 0.11276190 0.25276190 24 0.11276190 0.11276190 25 0.11276190 0.11276190 26 0.11276190 0.11276190 27 0.11276190 0.11276190 28 0.11276190 0.11276190 29 0.11276190 0.11276190 30 0.11276190 0.11276190 31 0.11276190 0.11276190 32 0.11276190 0.11276190 33 0.11276190 0.11276190 34 0.11276190 0.11276190 35 -0.28723810 0.11276190 36 -0.38723810 -0.28723810 37 -0.38723810 -0.38723810 38 -0.58723810 -0.38723810 39 -0.63723810 -0.58723810 40 -0.63723810 -0.63723810 41 -1.03723810 -0.63723810 42 -1.13723810 -1.03723810 43 -1.13723810 -1.13723810 44 -1.13723810 -1.13723810 45 -1.13723810 -1.13723810 46 -1.13723810 -1.13723810 47 -1.13723810 -1.13723810 48 -1.13723810 -1.13723810 49 -1.13723810 -1.13723810 50 -1.13723810 -1.13723810 51 -1.13723810 -1.13723810 52 -1.13723810 -1.13723810 53 -1.13723810 -1.13723810 54 -1.13723810 -1.13723810 55 -1.13723810 -1.13723810 56 -1.13723810 -1.13723810 57 -1.13723810 -1.13723810 58 -1.13723810 -1.13723810 59 -1.13723810 -1.13723810 60 -1.13723810 -1.13723810 61 -1.13723810 -1.13723810 62 -1.13723810 -1.13723810 63 -1.13723810 -1.13723810 64 -1.13723810 -1.13723810 65 -1.13723810 -1.13723810 66 -1.13723810 -1.13723810 67 -1.13723810 -1.13723810 68 -1.13723810 -1.13723810 69 -1.13723810 -1.13723810 70 -1.13723810 -1.13723810 71 -0.92723810 -1.13723810 72 -0.88723810 -0.92723810 73 -0.88723810 -0.88723810 74 -0.68723810 -0.88723810 75 -0.63723810 -0.68723810 76 -0.63723810 -0.63723810 77 -0.49723810 -0.63723810 78 -0.38723810 -0.49723810 79 -0.20723810 -0.38723810 80 -0.13723810 -0.20723810 81 0.03276190 -0.13723810 82 0.11276190 0.03276190 83 0.25276190 0.11276190 84 0.36276190 0.25276190 85 0.36276190 0.36276190 86 0.51276190 0.36276190 87 0.61276190 0.51276190 88 0.61276190 0.61276190 89 0.76276190 0.61276190 90 0.86276190 0.76276190 91 0.86276190 0.86276190 92 0.86276190 0.86276190 93 0.86276190 0.86276190 94 0.86276190 0.86276190 95 0.86276190 0.86276190 96 0.86276190 0.86276190 97 0.86276190 0.86276190 98 0.86276190 0.86276190 99 0.86276190 0.86276190 100 0.86276190 0.86276190 101 0.86276190 0.86276190 102 1.04276190 0.86276190 103 1.11276190 1.04276190 104 1.11276190 1.11276190 105 2.16153846 1.11276190 106 1.61153846 2.16153846 107 0.94153846 1.61153846 108 0.50153846 0.94153846 109 0.19153846 0.50153846 110 -0.14846154 0.19153846 111 -0.49846154 -0.14846154 112 -0.71846154 -0.49846154 113 -0.80846154 -0.71846154 114 -0.80846154 -0.80846154 115 -0.80846154 -0.80846154 116 -0.80846154 -0.80846154 117 -0.80846154 -0.80846154 118 NA -0.80846154 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.07276190 -0.13723810 [2,] 0.23276190 0.07276190 [3,] 0.37276190 0.23276190 [4,] 0.61276190 0.37276190 [5,] 0.97276190 0.61276190 [6,] 1.11276190 0.97276190 [7,] 1.11276190 1.11276190 [8,] 1.36276190 1.11276190 [9,] 1.56276190 1.36276190 [10,] 1.61276190 1.56276190 [11,] 1.61276190 1.61276190 [12,] 1.61276190 1.61276190 [13,] 1.61276190 1.61276190 [14,] 1.61276190 1.61276190 [15,] 1.61276190 1.61276190 [16,] 1.44276190 1.61276190 [17,] 1.36276190 1.44276190 [18,] 1.36276190 1.36276190 [19,] 1.35276190 1.36276190 [20,] 0.89276190 1.35276190 [21,] 0.61276190 0.89276190 [22,] 0.25276190 0.61276190 [23,] 0.11276190 0.25276190 [24,] 0.11276190 0.11276190 [25,] 0.11276190 0.11276190 [26,] 0.11276190 0.11276190 [27,] 0.11276190 0.11276190 [28,] 0.11276190 0.11276190 [29,] 0.11276190 0.11276190 [30,] 0.11276190 0.11276190 [31,] 0.11276190 0.11276190 [32,] 0.11276190 0.11276190 [33,] 0.11276190 0.11276190 [34,] 0.11276190 0.11276190 [35,] -0.28723810 0.11276190 [36,] -0.38723810 -0.28723810 [37,] -0.38723810 -0.38723810 [38,] -0.58723810 -0.38723810 [39,] -0.63723810 -0.58723810 [40,] -0.63723810 -0.63723810 [41,] -1.03723810 -0.63723810 [42,] -1.13723810 -1.03723810 [43,] -1.13723810 -1.13723810 [44,] -1.13723810 -1.13723810 [45,] -1.13723810 -1.13723810 [46,] -1.13723810 -1.13723810 [47,] -1.13723810 -1.13723810 [48,] -1.13723810 -1.13723810 [49,] -1.13723810 -1.13723810 [50,] -1.13723810 -1.13723810 [51,] -1.13723810 -1.13723810 [52,] -1.13723810 -1.13723810 [53,] -1.13723810 -1.13723810 [54,] -1.13723810 -1.13723810 [55,] -1.13723810 -1.13723810 [56,] -1.13723810 -1.13723810 [57,] -1.13723810 -1.13723810 [58,] -1.13723810 -1.13723810 [59,] -1.13723810 -1.13723810 [60,] -1.13723810 -1.13723810 [61,] -1.13723810 -1.13723810 [62,] -1.13723810 -1.13723810 [63,] -1.13723810 -1.13723810 [64,] -1.13723810 -1.13723810 [65,] -1.13723810 -1.13723810 [66,] -1.13723810 -1.13723810 [67,] -1.13723810 -1.13723810 [68,] -1.13723810 -1.13723810 [69,] -1.13723810 -1.13723810 [70,] -1.13723810 -1.13723810 [71,] -0.92723810 -1.13723810 [72,] -0.88723810 -0.92723810 [73,] -0.88723810 -0.88723810 [74,] -0.68723810 -0.88723810 [75,] -0.63723810 -0.68723810 [76,] -0.63723810 -0.63723810 [77,] -0.49723810 -0.63723810 [78,] -0.38723810 -0.49723810 [79,] -0.20723810 -0.38723810 [80,] -0.13723810 -0.20723810 [81,] 0.03276190 -0.13723810 [82,] 0.11276190 0.03276190 [83,] 0.25276190 0.11276190 [84,] 0.36276190 0.25276190 [85,] 0.36276190 0.36276190 [86,] 0.51276190 0.36276190 [87,] 0.61276190 0.51276190 [88,] 0.61276190 0.61276190 [89,] 0.76276190 0.61276190 [90,] 0.86276190 0.76276190 [91,] 0.86276190 0.86276190 [92,] 0.86276190 0.86276190 [93,] 0.86276190 0.86276190 [94,] 0.86276190 0.86276190 [95,] 0.86276190 0.86276190 [96,] 0.86276190 0.86276190 [97,] 0.86276190 0.86276190 [98,] 0.86276190 0.86276190 [99,] 0.86276190 0.86276190 [100,] 0.86276190 0.86276190 [101,] 0.86276190 0.86276190 [102,] 1.04276190 0.86276190 [103,] 1.11276190 1.04276190 [104,] 1.11276190 1.11276190 [105,] 2.16153846 1.11276190 [106,] 1.61153846 2.16153846 [107,] 0.94153846 1.61153846 [108,] 0.50153846 0.94153846 [109,] 0.19153846 0.50153846 [110,] -0.14846154 0.19153846 [111,] -0.49846154 -0.14846154 [112,] -0.71846154 -0.49846154 [113,] -0.80846154 -0.71846154 [114,] -0.80846154 -0.80846154 [115,] -0.80846154 -0.80846154 [116,] -0.80846154 -0.80846154 [117,] -0.80846154 -0.80846154 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.07276190 -0.13723810 2 0.23276190 0.07276190 3 0.37276190 0.23276190 4 0.61276190 0.37276190 5 0.97276190 0.61276190 6 1.11276190 0.97276190 7 1.11276190 1.11276190 8 1.36276190 1.11276190 9 1.56276190 1.36276190 10 1.61276190 1.56276190 11 1.61276190 1.61276190 12 1.61276190 1.61276190 13 1.61276190 1.61276190 14 1.61276190 1.61276190 15 1.61276190 1.61276190 16 1.44276190 1.61276190 17 1.36276190 1.44276190 18 1.36276190 1.36276190 19 1.35276190 1.36276190 20 0.89276190 1.35276190 21 0.61276190 0.89276190 22 0.25276190 0.61276190 23 0.11276190 0.25276190 24 0.11276190 0.11276190 25 0.11276190 0.11276190 26 0.11276190 0.11276190 27 0.11276190 0.11276190 28 0.11276190 0.11276190 29 0.11276190 0.11276190 30 0.11276190 0.11276190 31 0.11276190 0.11276190 32 0.11276190 0.11276190 33 0.11276190 0.11276190 34 0.11276190 0.11276190 35 -0.28723810 0.11276190 36 -0.38723810 -0.28723810 37 -0.38723810 -0.38723810 38 -0.58723810 -0.38723810 39 -0.63723810 -0.58723810 40 -0.63723810 -0.63723810 41 -1.03723810 -0.63723810 42 -1.13723810 -1.03723810 43 -1.13723810 -1.13723810 44 -1.13723810 -1.13723810 45 -1.13723810 -1.13723810 46 -1.13723810 -1.13723810 47 -1.13723810 -1.13723810 48 -1.13723810 -1.13723810 49 -1.13723810 -1.13723810 50 -1.13723810 -1.13723810 51 -1.13723810 -1.13723810 52 -1.13723810 -1.13723810 53 -1.13723810 -1.13723810 54 -1.13723810 -1.13723810 55 -1.13723810 -1.13723810 56 -1.13723810 -1.13723810 57 -1.13723810 -1.13723810 58 -1.13723810 -1.13723810 59 -1.13723810 -1.13723810 60 -1.13723810 -1.13723810 61 -1.13723810 -1.13723810 62 -1.13723810 -1.13723810 63 -1.13723810 -1.13723810 64 -1.13723810 -1.13723810 65 -1.13723810 -1.13723810 66 -1.13723810 -1.13723810 67 -1.13723810 -1.13723810 68 -1.13723810 -1.13723810 69 -1.13723810 -1.13723810 70 -1.13723810 -1.13723810 71 -0.92723810 -1.13723810 72 -0.88723810 -0.92723810 73 -0.88723810 -0.88723810 74 -0.68723810 -0.88723810 75 -0.63723810 -0.68723810 76 -0.63723810 -0.63723810 77 -0.49723810 -0.63723810 78 -0.38723810 -0.49723810 79 -0.20723810 -0.38723810 80 -0.13723810 -0.20723810 81 0.03276190 -0.13723810 82 0.11276190 0.03276190 83 0.25276190 0.11276190 84 0.36276190 0.25276190 85 0.36276190 0.36276190 86 0.51276190 0.36276190 87 0.61276190 0.51276190 88 0.61276190 0.61276190 89 0.76276190 0.61276190 90 0.86276190 0.76276190 91 0.86276190 0.86276190 92 0.86276190 0.86276190 93 0.86276190 0.86276190 94 0.86276190 0.86276190 95 0.86276190 0.86276190 96 0.86276190 0.86276190 97 0.86276190 0.86276190 98 0.86276190 0.86276190 99 0.86276190 0.86276190 100 0.86276190 0.86276190 101 0.86276190 0.86276190 102 1.04276190 0.86276190 103 1.11276190 1.04276190 104 1.11276190 1.11276190 105 2.16153846 1.11276190 106 1.61153846 2.16153846 107 0.94153846 1.61153846 108 0.50153846 0.94153846 109 0.19153846 0.50153846 110 -0.14846154 0.19153846 111 -0.49846154 -0.14846154 112 -0.71846154 -0.49846154 113 -0.80846154 -0.71846154 114 -0.80846154 -0.80846154 115 -0.80846154 -0.80846154 116 -0.80846154 -0.80846154 117 -0.80846154 -0.80846154 > 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/78d0z1258734625.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/8itze1258734625.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/9otfk1258734625.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/10y24c1258734625.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/11s8tn1258734625.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/12njyp1258734625.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/136qlb1258734625.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/145sxp1258734625.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/15r0np1258734625.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/16jx821258734625.tab") + } > > system("convert tmp/1gh8p1258734625.ps tmp/1gh8p1258734625.png") > system("convert tmp/2vq5w1258734625.ps tmp/2vq5w1258734625.png") > system("convert tmp/3fgai1258734625.ps tmp/3fgai1258734625.png") > system("convert tmp/4cxmo1258734625.ps tmp/4cxmo1258734625.png") > system("convert tmp/5vv9o1258734625.ps tmp/5vv9o1258734625.png") > system("convert tmp/6wccv1258734625.ps tmp/6wccv1258734625.png") > system("convert tmp/78d0z1258734625.ps tmp/78d0z1258734625.png") > system("convert tmp/8itze1258734625.ps tmp/8itze1258734625.png") > system("convert tmp/9otfk1258734625.ps tmp/9otfk1258734625.png") > system("convert tmp/10y24c1258734625.ps tmp/10y24c1258734625.png") > > > proc.time() user system elapsed 3.137 1.626 3.592