R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(10554.27 + ,2.08 + ,83.9 + ,61.2 + ,10532.54 + ,2.09 + ,85.6 + ,62 + ,10324.31 + ,2.07 + ,87.5 + ,65.1 + ,10695.25 + ,2.04 + ,88.5 + ,63.2 + ,10827.81 + ,2.35 + ,91 + ,66.3 + ,10872.48 + ,2.33 + ,90.6 + ,61.9 + ,10971.19 + ,2.37 + ,91.2 + ,62.1 + ,11145.65 + ,2.59 + ,93.2 + ,66.3 + ,11234.68 + ,2.62 + ,90.1 + ,72 + ,11333.88 + ,2.6 + ,95 + ,65.3 + ,10997.97 + ,2.83 + ,95.4 + ,67.6 + ,11036.89 + ,2.78 + ,93.7 + ,70.5 + ,11257.35 + ,3.01 + ,93.9 + ,74.2 + ,11533.59 + ,3.06 + ,92.5 + ,77.8 + ,11963.12 + ,3.33 + ,89.2 + ,78.5 + ,12185.15 + ,3.32 + ,93.3 + ,77.8 + ,12377.62 + ,3.6 + ,93 + ,81.4 + ,12512.89 + ,3.57 + ,96.1 + ,84.5 + ,12631.48 + ,3.57 + ,96.7 + ,88 + ,12268.53 + ,3.83 + ,97.6 + ,93.9 + ,12754.8 + ,3.84 + ,102.6 + ,98.9 + ,13407.75 + ,3.8 + ,107.6 + ,96.7 + ,13480.21 + ,4.07 + ,103.5 + ,98.9 + ,13673.28 + ,4.05 + ,100.8 + ,102.2 + ,13239.71 + ,4.272 + ,94.5 + ,105.4 + ,13557.69 + ,3.858 + ,100.1 + ,105.1 + ,13901.28 + ,4.067 + ,97.4 + ,116.6 + ,13200.58 + ,3.964 + ,103 + ,112 + ,13406.97 + ,3.782 + ,100.2 + ,108.8 + ,12538.12 + ,4.114 + ,100.2 + ,106.9 + ,12419.57 + ,4.009 + ,99 + ,109.5 + ,12193.88 + ,4.025 + ,102.4 + ,106.7 + ,12656.63 + ,4.082 + ,99 + ,118.9 + ,12812.48 + ,4.044 + ,103.7 + ,117.5 + ,12056.67 + ,3.916 + ,103.4 + ,113.7 + ,11322.38 + ,4.289 + ,95.3 + ,119.6 + ,11530.75 + ,4.296 + ,93.6 + ,120.6 + ,11114.08 + ,4.193 + ,102.4 + ,117.5 + ,9181.73 + ,3.48 + ,110.5 + ,120.3 + ,8614.55 + ,2.934 + ,109.1 + ,119.8 + ,8595.56 + ,2.221 + ,100.9 + ,108 + ,8396.2 + ,1.211 + ,108.1 + ,98.8 + ,7690.5 + ,1.28 + ,105 + ,94.6 + ,7235.47 + ,0.96 + ,111.5 + ,84.6 + ,7992.12 + ,0.5 + ,109.5 + ,84.4 + ,8398.37 + ,0.687 + ,110.5 + ,79.1 + ,8593 + ,0.344 + ,114 + ,73.3 + ,8679.75 + ,0.346 + ,108.2 + ,74.3 + ,9374.63 + ,0.334 + ,110.3 + ,67.8 + ,9634.97 + ,0.34 + ,111.8 + ,64.8 + ,9857.34 + ,0.328 + ,107.5 + ,66.5 + ,10238.83 + ,0.344 + ,114.1 + ,57.7 + ,10433.44 + ,0.341 + ,113.8 + ,53.8 + ,10471.24 + ,0.32 + ,114.5 + ,51.8 + ,10214.51 + ,0.314 + ,114.8 + ,50.9 + ,10677.52 + ,0.325 + ,117.8 + ,49 + ,11052.15 + ,0.339 + ,116.7 + ,48.1 + ,10500.19 + ,0.329 + ,122.8 + ,42.6 + ,10159.27 + ,0.48 + ,122.3 + ,40.9 + ,10222.24 + ,0.399 + ,115 + ,43.3 + ,10350.4 + ,0.37 + ,118.5 + ,43.7) + ,dim=c(4 + ,61) + ,dimnames=list(c('DowJones' + ,'Eonia' + ,'deposits' + ,'2JAAR') + ,1:61)) > y <- array(NA,dim=c(4,61),dimnames=list(c('DowJones','Eonia','deposits','2JAAR'),1:61)) > 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 > 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 DowJones Eonia deposits 2JAAR 1 10554.27 2.080 83.9 61.2 2 10532.54 2.090 85.6 62.0 3 10324.31 2.070 87.5 65.1 4 10695.25 2.040 88.5 63.2 5 10827.81 2.350 91.0 66.3 6 10872.48 2.330 90.6 61.9 7 10971.19 2.370 91.2 62.1 8 11145.65 2.590 93.2 66.3 9 11234.68 2.620 90.1 72.0 10 11333.88 2.600 95.0 65.3 11 10997.97 2.830 95.4 67.6 12 11036.89 2.780 93.7 70.5 13 11257.35 3.010 93.9 74.2 14 11533.59 3.060 92.5 77.8 15 11963.12 3.330 89.2 78.5 16 12185.15 3.320 93.3 77.8 17 12377.62 3.600 93.0 81.4 18 12512.89 3.570 96.1 84.5 19 12631.48 3.570 96.7 88.0 20 12268.53 3.830 97.6 93.9 21 12754.80 3.840 102.6 98.9 22 13407.75 3.800 107.6 96.7 23 13480.21 4.070 103.5 98.9 24 13673.28 4.050 100.8 102.2 25 13239.71 4.272 94.5 105.4 26 13557.69 3.858 100.1 105.1 27 13901.28 4.067 97.4 116.6 28 13200.58 3.964 103.0 112.0 29 13406.97 3.782 100.2 108.8 30 12538.12 4.114 100.2 106.9 31 12419.57 4.009 99.0 109.5 32 12193.88 4.025 102.4 106.7 33 12656.63 4.082 99.0 118.9 34 12812.48 4.044 103.7 117.5 35 12056.67 3.916 103.4 113.7 36 11322.38 4.289 95.3 119.6 37 11530.75 4.296 93.6 120.6 38 11114.08 4.193 102.4 117.5 39 9181.73 3.480 110.5 120.3 40 8614.55 2.934 109.1 119.8 41 8595.56 2.221 100.9 108.0 42 8396.20 1.211 108.1 98.8 43 7690.50 1.280 105.0 94.6 44 7235.47 0.960 111.5 84.6 45 7992.12 0.500 109.5 84.4 46 8398.37 0.687 110.5 79.1 47 8593.00 0.344 114.0 73.3 48 8679.75 0.346 108.2 74.3 49 9374.63 0.334 110.3 67.8 50 9634.97 0.340 111.8 64.8 51 9857.34 0.328 107.5 66.5 52 10238.83 0.344 114.1 57.7 53 10433.44 0.341 113.8 53.8 54 10471.24 0.320 114.5 51.8 55 10214.51 0.314 114.8 50.9 56 10677.52 0.325 117.8 49.0 57 11052.15 0.339 116.7 48.1 58 10500.19 0.329 122.8 42.6 59 10159.27 0.480 122.3 40.9 60 10222.24 0.399 115.0 43.3 61 10350.40 0.370 118.5 43.7 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Eonia deposits `2JAAR` 4279.82 1787.89 68.49 -55.27 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2239.13 -359.94 -40.99 477.27 2123.64 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 4279.821 1566.402 2.732 0.00836 ** Eonia 1787.889 151.596 11.794 < 2e-16 *** deposits 68.489 15.151 4.520 3.17e-05 *** `2JAAR` -55.269 7.631 -7.243 1.25e-09 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 803.3 on 57 degrees of freedom Multiple R-squared: 0.7726, Adjusted R-squared: 0.7607 F-statistic: 64.57 on 3 and 57 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,] 4.090413e-03 8.180826e-03 0.9959095870 [2,] 6.374616e-04 1.274923e-03 0.9993625384 [3,] 2.455445e-04 4.910890e-04 0.9997544555 [4,] 4.145824e-05 8.291648e-05 0.9999585418 [5,] 2.309898e-04 4.619796e-04 0.9997690102 [6,] 8.115018e-05 1.623004e-04 0.9999188498 [7,] 2.090269e-05 4.180538e-05 0.9999790973 [8,] 8.276179e-06 1.655236e-05 0.9999917238 [9,] 4.449539e-06 8.899078e-06 0.9999955505 [10,] 5.541547e-06 1.108309e-05 0.9999944585 [11,] 2.634942e-06 5.269884e-06 0.9999973651 [12,] 2.962678e-06 5.925356e-06 0.9999970373 [13,] 2.355132e-06 4.710265e-06 0.9999976449 [14,] 5.753932e-06 1.150786e-05 0.9999942461 [15,] 2.171174e-06 4.342348e-06 0.9999978288 [16,] 8.490280e-06 1.698056e-05 0.9999915097 [17,] 4.673168e-06 9.346336e-06 0.9999953268 [18,] 4.439151e-06 8.878301e-06 0.9999955608 [19,] 2.126942e-06 4.253884e-06 0.9999978731 [20,] 1.569161e-06 3.138323e-06 0.9999984308 [21,] 2.949108e-06 5.898216e-06 0.9999970509 [22,] 9.673385e-06 1.934677e-05 0.9999903266 [23,] 1.822316e-05 3.644632e-05 0.9999817768 [24,] 2.155308e-04 4.310617e-04 0.9997844692 [25,] 9.349629e-04 1.869926e-03 0.9990650371 [26,] 4.250438e-03 8.500875e-03 0.9957495623 [27,] 1.111512e-02 2.223024e-02 0.9888848815 [28,] 8.049674e-02 1.609935e-01 0.9195032642 [29,] 2.587266e-01 5.174533e-01 0.7412733557 [30,] 5.494187e-01 9.011626e-01 0.4505813196 [31,] 5.838129e-01 8.323743e-01 0.4161871312 [32,] 7.728805e-01 4.542390e-01 0.2271195090 [33,] 9.240157e-01 1.519685e-01 0.0759842572 [34,] 9.561564e-01 8.768728e-02 0.0438436421 [35,] 9.615680e-01 7.686390e-02 0.0384319511 [36,] 9.982511e-01 3.497882e-03 0.0017489409 [37,] 9.992187e-01 1.562596e-03 0.0007812978 [38,] 9.981446e-01 3.710890e-03 0.0018554451 [39,] 9.971322e-01 5.735637e-03 0.0028678184 [40,] 9.988897e-01 2.220603e-03 0.0011103016 [41,] 9.981178e-01 3.764352e-03 0.0018821761 [42,] 9.984739e-01 3.052273e-03 0.0015261366 [43,] 9.979552e-01 4.089666e-03 0.0020448329 [44,] 9.968059e-01 6.388141e-03 0.0031940704 [45,] 9.939274e-01 1.214530e-02 0.0060726486 [46,] 9.845008e-01 3.099847e-02 0.0154992370 [47,] 9.558121e-01 8.837584e-02 0.0441879221 [48,] 8.853448e-01 2.293104e-01 0.1146552219 > postscript(file="/var/www/rcomp/tmp/1650p1293375110.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/rcomp/tmp/2650p1293375110.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/rcomp/tmp/3650p1293375110.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/rcomp/tmp/4yezs1293375110.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/rcomp/tmp/5yezs1293375110.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 = 61 Frequency = 1 1 2 3 4 5 6 191.855991 80.030486 -51.236895 199.838719 -221.735729 -357.096992 7 8 9 10 11 12 -359.942361 -483.665867 79.079579 -491.865014 -1139.265946 -734.238552 13 14 15 16 17 18 -734.194609 -252.494462 -40.990901 -120.577177 -209.199902 -61.275711 19 20 21 22 23 24 209.663098 -353.689826 48.600504 309.026496 301.155519 897.293384 25 26 27 28 29 30 675.157113 1333.201599 2123.640928 969.314010 1516.008553 -51.432258 31 32 33 34 35 36 243.633538 -398.280735 869.708836 694.221301 -22.215315 -542.534815 37 38 39 40 41 42 -174.978727 -1181.537914 -2239.133406 -1761.875384 -596.664567 8.142173 43 44 45 46 47 48 -840.735898 -1721.515464 -16.511462 -306.013327 -58.412182 477.270026 49 50 51 52 53 54 690.526587 671.597272 1303.884273 718.368154 723.338471 640.202985 55 56 57 58 59 60 323.911141 456.774436 831.970016 -423.877656 -1094.481966 -254.073825 61 -291.670344 > postscript(file="/var/www/rcomp/tmp/6rohd1293375110.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 191.855991 NA 1 80.030486 191.855991 2 -51.236895 80.030486 3 199.838719 -51.236895 4 -221.735729 199.838719 5 -357.096992 -221.735729 6 -359.942361 -357.096992 7 -483.665867 -359.942361 8 79.079579 -483.665867 9 -491.865014 79.079579 10 -1139.265946 -491.865014 11 -734.238552 -1139.265946 12 -734.194609 -734.238552 13 -252.494462 -734.194609 14 -40.990901 -252.494462 15 -120.577177 -40.990901 16 -209.199902 -120.577177 17 -61.275711 -209.199902 18 209.663098 -61.275711 19 -353.689826 209.663098 20 48.600504 -353.689826 21 309.026496 48.600504 22 301.155519 309.026496 23 897.293384 301.155519 24 675.157113 897.293384 25 1333.201599 675.157113 26 2123.640928 1333.201599 27 969.314010 2123.640928 28 1516.008553 969.314010 29 -51.432258 1516.008553 30 243.633538 -51.432258 31 -398.280735 243.633538 32 869.708836 -398.280735 33 694.221301 869.708836 34 -22.215315 694.221301 35 -542.534815 -22.215315 36 -174.978727 -542.534815 37 -1181.537914 -174.978727 38 -2239.133406 -1181.537914 39 -1761.875384 -2239.133406 40 -596.664567 -1761.875384 41 8.142173 -596.664567 42 -840.735898 8.142173 43 -1721.515464 -840.735898 44 -16.511462 -1721.515464 45 -306.013327 -16.511462 46 -58.412182 -306.013327 47 477.270026 -58.412182 48 690.526587 477.270026 49 671.597272 690.526587 50 1303.884273 671.597272 51 718.368154 1303.884273 52 723.338471 718.368154 53 640.202985 723.338471 54 323.911141 640.202985 55 456.774436 323.911141 56 831.970016 456.774436 57 -423.877656 831.970016 58 -1094.481966 -423.877656 59 -254.073825 -1094.481966 60 -291.670344 -254.073825 61 NA -291.670344 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 80.030486 191.855991 [2,] -51.236895 80.030486 [3,] 199.838719 -51.236895 [4,] -221.735729 199.838719 [5,] -357.096992 -221.735729 [6,] -359.942361 -357.096992 [7,] -483.665867 -359.942361 [8,] 79.079579 -483.665867 [9,] -491.865014 79.079579 [10,] -1139.265946 -491.865014 [11,] -734.238552 -1139.265946 [12,] -734.194609 -734.238552 [13,] -252.494462 -734.194609 [14,] -40.990901 -252.494462 [15,] -120.577177 -40.990901 [16,] -209.199902 -120.577177 [17,] -61.275711 -209.199902 [18,] 209.663098 -61.275711 [19,] -353.689826 209.663098 [20,] 48.600504 -353.689826 [21,] 309.026496 48.600504 [22,] 301.155519 309.026496 [23,] 897.293384 301.155519 [24,] 675.157113 897.293384 [25,] 1333.201599 675.157113 [26,] 2123.640928 1333.201599 [27,] 969.314010 2123.640928 [28,] 1516.008553 969.314010 [29,] -51.432258 1516.008553 [30,] 243.633538 -51.432258 [31,] -398.280735 243.633538 [32,] 869.708836 -398.280735 [33,] 694.221301 869.708836 [34,] -22.215315 694.221301 [35,] -542.534815 -22.215315 [36,] -174.978727 -542.534815 [37,] -1181.537914 -174.978727 [38,] -2239.133406 -1181.537914 [39,] -1761.875384 -2239.133406 [40,] -596.664567 -1761.875384 [41,] 8.142173 -596.664567 [42,] -840.735898 8.142173 [43,] -1721.515464 -840.735898 [44,] -16.511462 -1721.515464 [45,] -306.013327 -16.511462 [46,] -58.412182 -306.013327 [47,] 477.270026 -58.412182 [48,] 690.526587 477.270026 [49,] 671.597272 690.526587 [50,] 1303.884273 671.597272 [51,] 718.368154 1303.884273 [52,] 723.338471 718.368154 [53,] 640.202985 723.338471 [54,] 323.911141 640.202985 [55,] 456.774436 323.911141 [56,] 831.970016 456.774436 [57,] -423.877656 831.970016 [58,] -1094.481966 -423.877656 [59,] -254.073825 -1094.481966 [60,] -291.670344 -254.073825 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 80.030486 191.855991 2 -51.236895 80.030486 3 199.838719 -51.236895 4 -221.735729 199.838719 5 -357.096992 -221.735729 6 -359.942361 -357.096992 7 -483.665867 -359.942361 8 79.079579 -483.665867 9 -491.865014 79.079579 10 -1139.265946 -491.865014 11 -734.238552 -1139.265946 12 -734.194609 -734.238552 13 -252.494462 -734.194609 14 -40.990901 -252.494462 15 -120.577177 -40.990901 16 -209.199902 -120.577177 17 -61.275711 -209.199902 18 209.663098 -61.275711 19 -353.689826 209.663098 20 48.600504 -353.689826 21 309.026496 48.600504 22 301.155519 309.026496 23 897.293384 301.155519 24 675.157113 897.293384 25 1333.201599 675.157113 26 2123.640928 1333.201599 27 969.314010 2123.640928 28 1516.008553 969.314010 29 -51.432258 1516.008553 30 243.633538 -51.432258 31 -398.280735 243.633538 32 869.708836 -398.280735 33 694.221301 869.708836 34 -22.215315 694.221301 35 -542.534815 -22.215315 36 -174.978727 -542.534815 37 -1181.537914 -174.978727 38 -2239.133406 -1181.537914 39 -1761.875384 -2239.133406 40 -596.664567 -1761.875384 41 8.142173 -596.664567 42 -840.735898 8.142173 43 -1721.515464 -840.735898 44 -16.511462 -1721.515464 45 -306.013327 -16.511462 46 -58.412182 -306.013327 47 477.270026 -58.412182 48 690.526587 477.270026 49 671.597272 690.526587 50 1303.884273 671.597272 51 718.368154 1303.884273 52 723.338471 718.368154 53 640.202985 723.338471 54 323.911141 640.202985 55 456.774436 323.911141 56 831.970016 456.774436 57 -423.877656 831.970016 58 -1094.481966 -423.877656 59 -254.073825 -1094.481966 60 -291.670344 -254.073825 > 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/rcomp/tmp/7kxyy1293375110.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/rcomp/tmp/8kxyy1293375110.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/rcomp/tmp/9kxyy1293375110.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/rcomp/tmp/10cof11293375110.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/11g7w71293375110.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/rcomp/tmp/12jpcd1293375110.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/rcomp/tmp/1388rp1293375110.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/rcomp/tmp/14jzqr1293375110.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/rcomp/tmp/15m0px1293375110.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/rcomp/tmp/16ia561293375110.tab") + } > > try(system("convert tmp/1650p1293375110.ps tmp/1650p1293375110.png",intern=TRUE)) character(0) > try(system("convert tmp/2650p1293375110.ps tmp/2650p1293375110.png",intern=TRUE)) character(0) > try(system("convert tmp/3650p1293375110.ps tmp/3650p1293375110.png",intern=TRUE)) character(0) > try(system("convert tmp/4yezs1293375110.ps tmp/4yezs1293375110.png",intern=TRUE)) character(0) > try(system("convert tmp/5yezs1293375110.ps tmp/5yezs1293375110.png",intern=TRUE)) character(0) > try(system("convert tmp/6rohd1293375110.ps tmp/6rohd1293375110.png",intern=TRUE)) character(0) > try(system("convert tmp/7kxyy1293375110.ps tmp/7kxyy1293375110.png",intern=TRUE)) character(0) > try(system("convert tmp/8kxyy1293375110.ps tmp/8kxyy1293375110.png",intern=TRUE)) character(0) > try(system("convert tmp/9kxyy1293375110.ps tmp/9kxyy1293375110.png",intern=TRUE)) character(0) > try(system("convert tmp/10cof11293375110.ps tmp/10cof11293375110.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.030 1.170 4.161