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(4.24,0,4.15,0,3.93,0,3.7,0,3.7,0,3.65,0,3.55,0,3.43,0,3.47,0,3.58,0,3.67,0,3.72,0,3.8,0,3.76,0,3.63,0,3.48,0,3.41,0,3.43,0,3.5,0,3.62,0,3.58,0,3.52,0,3.45,0,3.36,0,3.27,0,3.21,0,3.19,0,3.16,0,3.12,0,3.06,0,3.01,0,2.98,0,2.97,0,3.02,0,3.07,0,3.18,0,3.29,1,3.43,1,3.61,1,3.74,1,3.87,1,3.88,1,4.09,1,4.19,1,4.2,1,4.29,1,4.37,1,4.47,1,4.61,1,4.65,1,4.69,1,4.82,1,4.86,1,4.87,1,5.01,1,5.03,1,5.13,1,5.18,1,5.21,1,5.26,1,5.25,1,5.2,1,5.16,1,5.19,1,5.39,1,5.58,1,5.76,1,5.89,1,5.98,1,6.02,1,5.62,1,4.87,1),dim=c(2,72),dimnames=list(c('Rente','dummy'),1:72)) > y <- array(NA,dim=c(2,72),dimnames=list(c('Rente','dummy'),1:72)) > 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 dummy 1 4.24 0 2 4.15 0 3 3.93 0 4 3.70 0 5 3.70 0 6 3.65 0 7 3.55 0 8 3.43 0 9 3.47 0 10 3.58 0 11 3.67 0 12 3.72 0 13 3.80 0 14 3.76 0 15 3.63 0 16 3.48 0 17 3.41 0 18 3.43 0 19 3.50 0 20 3.62 0 21 3.58 0 22 3.52 0 23 3.45 0 24 3.36 0 25 3.27 0 26 3.21 0 27 3.19 0 28 3.16 0 29 3.12 0 30 3.06 0 31 3.01 0 32 2.98 0 33 2.97 0 34 3.02 0 35 3.07 0 36 3.18 0 37 3.29 1 38 3.43 1 39 3.61 1 40 3.74 1 41 3.87 1 42 3.88 1 43 4.09 1 44 4.19 1 45 4.20 1 46 4.29 1 47 4.37 1 48 4.47 1 49 4.61 1 50 4.65 1 51 4.69 1 52 4.82 1 53 4.86 1 54 4.87 1 55 5.01 1 56 5.03 1 57 5.13 1 58 5.18 1 59 5.21 1 60 5.26 1 61 5.25 1 62 5.20 1 63 5.16 1 64 5.19 1 65 5.39 1 66 5.58 1 67 5.76 1 68 5.89 1 69 5.98 1 70 6.02 1 71 5.62 1 72 4.87 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) dummy 3.460 1.336 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.50611 -0.32965 0.04972 0.33535 1.22389 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.4603 0.0930 37.21 < 2e-16 *** dummy 1.3358 0.1315 10.16 2.08e-15 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.558 on 70 degrees of freedom Multiple R-squared: 0.5957, Adjusted R-squared: 0.59 F-statistic: 103.2 on 1 and 70 DF, p-value: 2.085e-15 > 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,] 1.514764e-01 3.029528e-01 0.8485236 [2,] 9.480993e-02 1.896199e-01 0.9051901 [3,] 6.980736e-02 1.396147e-01 0.9301926 [4,] 6.328500e-02 1.265700e-01 0.9367150 [5,] 4.457983e-02 8.915967e-02 0.9554202 [6,] 2.402056e-02 4.804112e-02 0.9759794 [7,] 1.131113e-02 2.262226e-02 0.9886889 [8,] 5.021730e-03 1.004346e-02 0.9949783 [9,] 2.235129e-03 4.470258e-03 0.9977649 [10,] 9.354694e-04 1.870939e-03 0.9990645 [11,] 4.004421e-04 8.008841e-04 0.9995996 [12,] 2.388452e-04 4.776904e-04 0.9997612 [13,] 1.737105e-04 3.474211e-04 0.9998263 [14,] 1.081819e-04 2.163638e-04 0.9998918 [15,] 5.238169e-05 1.047634e-04 0.9999476 [16,] 2.087676e-05 4.175351e-05 0.9999791 [17,] 8.434379e-06 1.686876e-05 0.9999916 [18,] 3.681499e-06 7.362998e-06 0.9999963 [19,] 1.888499e-06 3.776997e-06 0.9999981 [20,] 1.311526e-06 2.623053e-06 0.9999987 [21,] 1.298685e-06 2.597369e-06 0.9999987 [22,] 1.540795e-06 3.081589e-06 0.9999985 [23,] 1.728533e-06 3.457067e-06 0.9999983 [24,] 1.946279e-06 3.892557e-06 0.9999981 [25,] 2.299684e-06 4.599369e-06 0.9999977 [26,] 3.092952e-06 6.185904e-06 0.9999969 [27,] 4.417096e-06 8.834193e-06 0.9999956 [28,] 6.068674e-06 1.213735e-05 0.9999939 [29,] 7.487898e-06 1.497580e-05 0.9999925 [30,] 6.933190e-06 1.386638e-05 0.9999931 [31,] 5.189836e-06 1.037967e-05 0.9999948 [32,] 2.891744e-06 5.783488e-06 0.9999971 [33,] 6.229777e-06 1.245955e-05 0.9999938 [34,] 1.420375e-05 2.840749e-05 0.9999858 [35,] 3.233836e-05 6.467672e-05 0.9999677 [36,] 7.666292e-05 1.533258e-04 0.9999233 [37,] 1.864871e-04 3.729742e-04 0.9998135 [38,] 5.151773e-04 1.030355e-03 0.9994848 [39,] 1.347605e-03 2.695209e-03 0.9986524 [40,] 3.373633e-03 6.747267e-03 0.9966264 [41,] 8.477735e-03 1.695547e-02 0.9915223 [42,] 2.032688e-02 4.065376e-02 0.9796731 [43,] 4.548859e-02 9.097719e-02 0.9545114 [44,] 9.096000e-02 1.819200e-01 0.9090400 [45,] 1.553115e-01 3.106229e-01 0.8446885 [46,] 2.400601e-01 4.801202e-01 0.7599399 [47,] 3.425797e-01 6.851595e-01 0.6574203 [48,] 4.345629e-01 8.691259e-01 0.5654371 [49,] 5.191666e-01 9.616668e-01 0.4808334 [50,] 6.015732e-01 7.968536e-01 0.3984268 [51,] 6.499040e-01 7.001920e-01 0.3500960 [52,] 6.872537e-01 6.254926e-01 0.3127463 [53,] 7.016919e-01 5.966161e-01 0.2983081 [54,] 7.017363e-01 5.965275e-01 0.2982637 [55,] 6.905076e-01 6.189847e-01 0.3094924 [56,] 6.657458e-01 6.685083e-01 0.3342542 [57,] 6.345773e-01 7.308454e-01 0.3654227 [58,] 6.101299e-01 7.797401e-01 0.3898701 [59,] 6.039591e-01 7.920817e-01 0.3960409 [60,] 6.018775e-01 7.962449e-01 0.3981225 [61,] 5.379160e-01 9.241681e-01 0.4620840 [62,] 4.312762e-01 8.625524e-01 0.5687238 [63,] 3.160852e-01 6.321704e-01 0.6839148 > postscript(file="/var/www/html/rcomp/tmp/1gj0h1293565576.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/rcomp/tmp/2gj0h1293565576.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/rcomp/tmp/3rbzk1293565576.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/rcomp/tmp/4rbzk1293565576.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/rcomp/tmp/5rbzk1293565576.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 = 72 Frequency = 1 1 2 3 4 5 6 0.779722222 0.689722222 0.469722222 0.239722222 0.239722222 0.189722222 7 8 9 10 11 12 0.089722222 -0.030277778 0.009722222 0.119722222 0.209722222 0.259722222 13 14 15 16 17 18 0.339722222 0.299722222 0.169722222 0.019722222 -0.050277778 -0.030277778 19 20 21 22 23 24 0.039722222 0.159722222 0.119722222 0.059722222 -0.010277778 -0.100277778 25 26 27 28 29 30 -0.190277778 -0.250277778 -0.270277778 -0.300277778 -0.340277778 -0.400277778 31 32 33 34 35 36 -0.450277778 -0.480277778 -0.490277778 -0.440277778 -0.390277778 -0.280277778 37 38 39 40 41 42 -1.506111111 -1.366111111 -1.186111111 -1.056111111 -0.926111111 -0.916111111 43 44 45 46 47 48 -0.706111111 -0.606111111 -0.596111111 -0.506111111 -0.426111111 -0.326111111 49 50 51 52 53 54 -0.186111111 -0.146111111 -0.106111111 0.023888889 0.063888889 0.073888889 55 56 57 58 59 60 0.213888889 0.233888889 0.333888889 0.383888889 0.413888889 0.463888889 61 62 63 64 65 66 0.453888889 0.403888889 0.363888889 0.393888889 0.593888889 0.783888889 67 68 69 70 71 72 0.963888889 1.093888889 1.183888889 1.223888889 0.823888889 0.073888889 > postscript(file="/var/www/html/rcomp/tmp/622y51293565576.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 = 72 Frequency = 1 lag(myerror, k = 1) myerror 0 0.779722222 NA 1 0.689722222 0.779722222 2 0.469722222 0.689722222 3 0.239722222 0.469722222 4 0.239722222 0.239722222 5 0.189722222 0.239722222 6 0.089722222 0.189722222 7 -0.030277778 0.089722222 8 0.009722222 -0.030277778 9 0.119722222 0.009722222 10 0.209722222 0.119722222 11 0.259722222 0.209722222 12 0.339722222 0.259722222 13 0.299722222 0.339722222 14 0.169722222 0.299722222 15 0.019722222 0.169722222 16 -0.050277778 0.019722222 17 -0.030277778 -0.050277778 18 0.039722222 -0.030277778 19 0.159722222 0.039722222 20 0.119722222 0.159722222 21 0.059722222 0.119722222 22 -0.010277778 0.059722222 23 -0.100277778 -0.010277778 24 -0.190277778 -0.100277778 25 -0.250277778 -0.190277778 26 -0.270277778 -0.250277778 27 -0.300277778 -0.270277778 28 -0.340277778 -0.300277778 29 -0.400277778 -0.340277778 30 -0.450277778 -0.400277778 31 -0.480277778 -0.450277778 32 -0.490277778 -0.480277778 33 -0.440277778 -0.490277778 34 -0.390277778 -0.440277778 35 -0.280277778 -0.390277778 36 -1.506111111 -0.280277778 37 -1.366111111 -1.506111111 38 -1.186111111 -1.366111111 39 -1.056111111 -1.186111111 40 -0.926111111 -1.056111111 41 -0.916111111 -0.926111111 42 -0.706111111 -0.916111111 43 -0.606111111 -0.706111111 44 -0.596111111 -0.606111111 45 -0.506111111 -0.596111111 46 -0.426111111 -0.506111111 47 -0.326111111 -0.426111111 48 -0.186111111 -0.326111111 49 -0.146111111 -0.186111111 50 -0.106111111 -0.146111111 51 0.023888889 -0.106111111 52 0.063888889 0.023888889 53 0.073888889 0.063888889 54 0.213888889 0.073888889 55 0.233888889 0.213888889 56 0.333888889 0.233888889 57 0.383888889 0.333888889 58 0.413888889 0.383888889 59 0.463888889 0.413888889 60 0.453888889 0.463888889 61 0.403888889 0.453888889 62 0.363888889 0.403888889 63 0.393888889 0.363888889 64 0.593888889 0.393888889 65 0.783888889 0.593888889 66 0.963888889 0.783888889 67 1.093888889 0.963888889 68 1.183888889 1.093888889 69 1.223888889 1.183888889 70 0.823888889 1.223888889 71 0.073888889 0.823888889 72 NA 0.073888889 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.689722222 0.779722222 [2,] 0.469722222 0.689722222 [3,] 0.239722222 0.469722222 [4,] 0.239722222 0.239722222 [5,] 0.189722222 0.239722222 [6,] 0.089722222 0.189722222 [7,] -0.030277778 0.089722222 [8,] 0.009722222 -0.030277778 [9,] 0.119722222 0.009722222 [10,] 0.209722222 0.119722222 [11,] 0.259722222 0.209722222 [12,] 0.339722222 0.259722222 [13,] 0.299722222 0.339722222 [14,] 0.169722222 0.299722222 [15,] 0.019722222 0.169722222 [16,] -0.050277778 0.019722222 [17,] -0.030277778 -0.050277778 [18,] 0.039722222 -0.030277778 [19,] 0.159722222 0.039722222 [20,] 0.119722222 0.159722222 [21,] 0.059722222 0.119722222 [22,] -0.010277778 0.059722222 [23,] -0.100277778 -0.010277778 [24,] -0.190277778 -0.100277778 [25,] -0.250277778 -0.190277778 [26,] -0.270277778 -0.250277778 [27,] -0.300277778 -0.270277778 [28,] -0.340277778 -0.300277778 [29,] -0.400277778 -0.340277778 [30,] -0.450277778 -0.400277778 [31,] -0.480277778 -0.450277778 [32,] -0.490277778 -0.480277778 [33,] -0.440277778 -0.490277778 [34,] -0.390277778 -0.440277778 [35,] -0.280277778 -0.390277778 [36,] -1.506111111 -0.280277778 [37,] -1.366111111 -1.506111111 [38,] -1.186111111 -1.366111111 [39,] -1.056111111 -1.186111111 [40,] -0.926111111 -1.056111111 [41,] -0.916111111 -0.926111111 [42,] -0.706111111 -0.916111111 [43,] -0.606111111 -0.706111111 [44,] -0.596111111 -0.606111111 [45,] -0.506111111 -0.596111111 [46,] -0.426111111 -0.506111111 [47,] -0.326111111 -0.426111111 [48,] -0.186111111 -0.326111111 [49,] -0.146111111 -0.186111111 [50,] -0.106111111 -0.146111111 [51,] 0.023888889 -0.106111111 [52,] 0.063888889 0.023888889 [53,] 0.073888889 0.063888889 [54,] 0.213888889 0.073888889 [55,] 0.233888889 0.213888889 [56,] 0.333888889 0.233888889 [57,] 0.383888889 0.333888889 [58,] 0.413888889 0.383888889 [59,] 0.463888889 0.413888889 [60,] 0.453888889 0.463888889 [61,] 0.403888889 0.453888889 [62,] 0.363888889 0.403888889 [63,] 0.393888889 0.363888889 [64,] 0.593888889 0.393888889 [65,] 0.783888889 0.593888889 [66,] 0.963888889 0.783888889 [67,] 1.093888889 0.963888889 [68,] 1.183888889 1.093888889 [69,] 1.223888889 1.183888889 [70,] 0.823888889 1.223888889 [71,] 0.073888889 0.823888889 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.689722222 0.779722222 2 0.469722222 0.689722222 3 0.239722222 0.469722222 4 0.239722222 0.239722222 5 0.189722222 0.239722222 6 0.089722222 0.189722222 7 -0.030277778 0.089722222 8 0.009722222 -0.030277778 9 0.119722222 0.009722222 10 0.209722222 0.119722222 11 0.259722222 0.209722222 12 0.339722222 0.259722222 13 0.299722222 0.339722222 14 0.169722222 0.299722222 15 0.019722222 0.169722222 16 -0.050277778 0.019722222 17 -0.030277778 -0.050277778 18 0.039722222 -0.030277778 19 0.159722222 0.039722222 20 0.119722222 0.159722222 21 0.059722222 0.119722222 22 -0.010277778 0.059722222 23 -0.100277778 -0.010277778 24 -0.190277778 -0.100277778 25 -0.250277778 -0.190277778 26 -0.270277778 -0.250277778 27 -0.300277778 -0.270277778 28 -0.340277778 -0.300277778 29 -0.400277778 -0.340277778 30 -0.450277778 -0.400277778 31 -0.480277778 -0.450277778 32 -0.490277778 -0.480277778 33 -0.440277778 -0.490277778 34 -0.390277778 -0.440277778 35 -0.280277778 -0.390277778 36 -1.506111111 -0.280277778 37 -1.366111111 -1.506111111 38 -1.186111111 -1.366111111 39 -1.056111111 -1.186111111 40 -0.926111111 -1.056111111 41 -0.916111111 -0.926111111 42 -0.706111111 -0.916111111 43 -0.606111111 -0.706111111 44 -0.596111111 -0.606111111 45 -0.506111111 -0.596111111 46 -0.426111111 -0.506111111 47 -0.326111111 -0.426111111 48 -0.186111111 -0.326111111 49 -0.146111111 -0.186111111 50 -0.106111111 -0.146111111 51 0.023888889 -0.106111111 52 0.063888889 0.023888889 53 0.073888889 0.063888889 54 0.213888889 0.073888889 55 0.233888889 0.213888889 56 0.333888889 0.233888889 57 0.383888889 0.333888889 58 0.413888889 0.383888889 59 0.463888889 0.413888889 60 0.453888889 0.463888889 61 0.403888889 0.453888889 62 0.363888889 0.403888889 63 0.393888889 0.363888889 64 0.593888889 0.393888889 65 0.783888889 0.593888889 66 0.963888889 0.783888889 67 1.093888889 0.963888889 68 1.183888889 1.093888889 69 1.223888889 1.183888889 70 0.823888889 1.223888889 71 0.073888889 0.823888889 > 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/7vbgq1293565576.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/rcomp/tmp/8vbgq1293565576.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/rcomp/tmp/9vbgq1293565576.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') hat values (leverages) are all = 0.02777778 and there are no factor predictors; no plot no. 5 > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/105lft1293565576.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/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/11rley1293565576.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/12u3cm1293565576.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/138dsv1293565576.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/14ce8j1293565576.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/15xw7p1293565576.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/160xnd1293565576.tab") + } > > try(system("convert tmp/1gj0h1293565576.ps tmp/1gj0h1293565576.png",intern=TRUE)) character(0) > try(system("convert tmp/2gj0h1293565576.ps tmp/2gj0h1293565576.png",intern=TRUE)) character(0) > try(system("convert tmp/3rbzk1293565576.ps tmp/3rbzk1293565576.png",intern=TRUE)) character(0) > try(system("convert tmp/4rbzk1293565576.ps tmp/4rbzk1293565576.png",intern=TRUE)) character(0) > try(system("convert tmp/5rbzk1293565576.ps tmp/5rbzk1293565576.png",intern=TRUE)) character(0) > try(system("convert tmp/622y51293565576.ps tmp/622y51293565576.png",intern=TRUE)) character(0) > try(system("convert tmp/7vbgq1293565576.ps tmp/7vbgq1293565576.png",intern=TRUE)) character(0) > try(system("convert tmp/8vbgq1293565576.ps tmp/8vbgq1293565576.png",intern=TRUE)) character(0) > try(system("convert tmp/9vbgq1293565576.ps tmp/9vbgq1293565576.png",intern=TRUE)) character(0) > try(system("convert tmp/105lft1293565576.ps tmp/105lft1293565576.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.672 1.649 6.343