R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(132838 + ,312991 + ,5599 + ,78051 + ,47645 + ,30406 + ,15545 + ,35668 + ,575093 + ,129842 + ,301647 + ,5234 + ,75481 + ,45970 + ,29511 + ,15001 + ,35589 + ,557560 + ,129694 + ,305353 + ,5279 + ,78926 + ,48069 + ,30857 + ,14961 + ,35544 + ,564478 + ,130080 + ,313665 + ,5391 + ,86241 + ,53080 + ,33161 + ,15245 + ,35292 + ,580523 + ,131496 + ,322402 + ,5280 + ,91993 + ,57896 + ,34097 + ,15656 + ,35047 + ,596594 + ,131556 + ,318280 + ,5173 + ,86452 + ,54344 + ,32108 + ,15577 + ,34705 + ,586570 + ,128925 + ,292852 + ,4724 + ,65271 + ,40482 + ,24789 + ,14630 + ,34536 + ,536214 + ,127836 + ,287481 + ,4554 + ,60348 + ,37110 + ,23238 + ,14336 + ,33596 + ,523597 + ,129164 + ,295210 + ,4713 + ,63178 + ,39263 + ,23915 + ,14834 + ,34149 + ,536535 + ,129531 + ,295650 + ,4811 + ,62653 + ,38889 + ,23764 + ,14921 + ,33567 + ,536322 + ,128548 + ,292919 + ,4668 + ,63583 + ,39593 + ,23990 + ,14707 + ,32881 + ,532638 + ,127330 + ,290649 + ,4516 + ,63376 + ,39305 + ,24071 + ,14516 + ,32351 + ,528222 + ,123815 + ,281687 + ,4203 + ,65008 + ,40560 + ,24448 + ,14055 + ,31576 + ,516141 + ,124393 + ,270336 + ,4016 + ,62100 + ,38306 + ,23794 + ,13493 + ,31544 + ,501866 + ,123707 + ,271420 + ,3993 + ,65936 + ,40911 + ,25025 + ,13528 + ,31583 + ,506174 + ,123736 + ,278183 + ,3971 + ,71621 + ,44700 + ,26921 + ,13719 + ,30686 + ,517945 + ,124507 + ,284913 + ,3838 + ,78903 + ,50328 + ,28575 + ,14170 + ,31097 + ,533590 + ,125005 + ,283487 + ,3891 + ,74755 + ,47499 + ,27256 + ,14009 + ,31123 + ,528379 + ,121383 + ,256677 + ,3306 + ,55511 + ,34446 + ,21065 + ,13159 + ,30850 + ,477580 + ,121200 + ,252945 + ,3235 + ,51888 + ,31434 + ,20454 + ,12927 + ,30397 + ,469357 + ,125249 + ,264963 + ,3404 + ,55738 + ,34066 + ,21672 + ,13510 + ,30783 + ,490243 + ,125253 + ,265988 + ,3400 + ,57261 + ,35044 + ,22217 + ,13520 + ,30600 + ,492622 + ,127977 + ,274857 + ,3447 + ,60086 + ,37040 + ,23046 + ,14089 + ,30552 + ,507561 + ,128984 + ,279650 + ,3431 + ,63070 + ,38706 + ,24364 + ,14251 + ,30967 + ,516922 + ,126770 + ,276715 + ,3321 + ,66061 + ,40430 + ,25631 + ,13980 + ,30732 + ,514258 + ,126448 + ,273887 + ,3189 + ,64973 + ,39613 + ,25360 + ,13715 + ,30823 + ,509846 + ,127845 + ,282308 + ,3256 + ,71770 + ,44236 + ,27534 + ,14112 + ,31035 + ,527070 + ,128818 + ,289847 + ,3290 + ,77712 + ,47859 + ,29853 + ,14289 + ,30991 + ,541657 + ,132127 + ,301101 + ,3475 + ,85265 + ,53711 + ,31554 + ,15020 + ,31078 + ,564591 + ,132338 + ,297008 + ,3454 + ,80140 + ,50352 + ,29788 + ,14860 + ,31016 + ,555362 + ,126645 + ,268909 + ,2806 + ,58921 + ,36142 + ,22779 + ,13800 + ,30387 + ,498662 + ,130625 + ,278383 + ,2777 + ,57395 + ,34819 + ,22576 + ,14431 + ,30204 + ,511038 + ,133506 + ,286226 + ,2865 + ,60925 + ,37353 + ,23572 + ,14944 + ,30318 + ,525919 + ,135277 + ,288936 + ,2924 + ,61682 + ,37550 + ,24132 + ,15083 + ,30695 + ,531673 + ,137664 + ,298953 + ,3011 + ,66161 + ,40462 + ,25699 + ,15707 + ,30369 + ,548854 + ,139821 + ,305837 + ,3099 + ,68713 + ,41753 + ,26960 + ,15954 + ,30251 + ,560576 + ,138440 + ,301979 + ,2988 + ,71442 + ,43437 + ,28005 + ,15631 + ,29782 + ,557274 + ,139879 + ,306281 + ,3032 + ,73898 + ,44784 + ,29114 + ,15813 + ,29871 + ,565742 + ,142256 + ,317057 + ,3131 + ,81482 + ,49537 + ,31945 + ,16356 + ,30474 + ,587625 + ,146322 + ,334780 + ,3343 + ,90533 + ,54974 + ,35559 + ,17086 + ,31195 + ,619916 + ,146389 + ,335895 + ,3275 + ,94794 + ,58535 + ,36259 + ,17302 + ,31429 + ,625809 + ,147841 + ,333874 + ,3243 + ,88780 + ,54762 + ,34018 + ,17247 + ,31825 + ,619567 + ,146449 + ,311028 + ,2897 + ,67281 + ,40738 + ,26543 + ,16398 + ,31786 + ,572942 + ,147960 + ,311767 + ,2818 + ,63724 + ,38052 + ,25672 + ,16590 + ,32734 + ,572775 + ,148487 + ,312575 + ,2836 + ,64361 + ,38436 + ,25925 + ,16673 + ,32109 + ,574205 + ,149802 + ,315040 + ,2721 + ,65465 + ,36993 + ,28472 + ,16962 + ,32530 + ,579799 + ,151387 + ,320325 + ,2742 + ,68725 + ,39056 + ,29669 + ,17278 + ,32357 + ,590072 + ,151936 + ,321178 + ,2707 + ,70782 + ,39996 + ,30786 + ,17224 + ,32288 + ,593408) + ,dim=c(9 + ,48) + ,dimnames=list(c('Basisonderwijs(lager_1ste_graad_secundair)' + ,'Secundair_onderwijs(2de + ,3de + ,4de_graad)' + ,'Duaal_onderwijs' + ,'Hoger_onderwijs' + ,'Hoger_onderwijs(Bachelor)' + ,'Hoger_onderwijs(Masters_doctoraten)' + ,'Leercontract' + ,'Andere_studies' + ,'Werkloosheid_totaal') + ,1:48)) > y <- array(NA,dim=c(9,48),dimnames=list(c('Basisonderwijs(lager_1ste_graad_secundair)','Secundair_onderwijs(2de,3de,4de_graad)','Duaal_onderwijs','Hoger_onderwijs','Hoger_onderwijs(Bachelor)','Hoger_onderwijs(Masters_doctoraten)','Leercontract','Andere_studies','Werkloosheid_totaal'),1:48)) > 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 = '9' > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, 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 Werkloosheid_totaal Basisonderwijs(lager_1ste_graad_secundair) 1 575093 132838 2 557560 129842 3 564478 129694 4 580523 130080 5 596594 131496 6 586570 131556 7 536214 128925 8 523597 127836 9 536535 129164 10 536322 129531 11 532638 128548 12 528222 127330 13 516141 123815 14 501866 124393 15 506174 123707 16 517945 123736 17 533590 124507 18 528379 125005 19 477580 121383 20 469357 121200 21 490243 125249 22 492622 125253 23 507561 127977 24 516922 128984 25 514258 126770 26 509846 126448 27 527070 127845 28 541657 128818 29 564591 132127 30 555362 132338 31 498662 126645 32 511038 130625 33 525919 133506 34 531673 135277 35 548854 137664 36 560576 139821 37 557274 138440 38 565742 139879 39 587625 142256 40 619916 146322 41 625809 146389 42 619567 147841 43 572942 146449 44 572775 147960 45 574205 148487 46 579799 149802 47 590072 151387 48 593408 151936 Secundair_onderwijs(2de,3de,4de_graad) Duaal_onderwijs Hoger_onderwijs 1 312991 5599 78051 2 301647 5234 75481 3 305353 5279 78926 4 313665 5391 86241 5 322402 5280 91993 6 318280 5173 86452 7 292852 4724 65271 8 287481 4554 60348 9 295210 4713 63178 10 295650 4811 62653 11 292919 4668 63583 12 290649 4516 63376 13 281687 4203 65008 14 270336 4016 62100 15 271420 3993 65936 16 278183 3971 71621 17 284913 3838 78903 18 283487 3891 74755 19 256677 3306 55511 20 252945 3235 51888 21 264963 3404 55738 22 265988 3400 57261 23 274857 3447 60086 24 279650 3431 63070 25 276715 3321 66061 26 273887 3189 64973 27 282308 3256 71770 28 289847 3290 77712 29 301101 3475 85265 30 297008 3454 80140 31 268909 2806 58921 32 278383 2777 57395 33 286226 2865 60925 34 288936 2924 61682 35 298953 3011 66161 36 305837 3099 68713 37 301979 2988 71442 38 306281 3032 73898 39 317057 3131 81482 40 334780 3343 90533 41 335895 3275 94794 42 333874 3243 88780 43 311028 2897 67281 44 311767 2818 63724 45 312575 2836 64361 46 315040 2721 65465 47 320325 2742 68725 48 321178 2707 70782 Hoger_onderwijs(Bachelor) Hoger_onderwijs(Masters_doctoraten) Leercontract 1 47645 30406 15545 2 45970 29511 15001 3 48069 30857 14961 4 53080 33161 15245 5 57896 34097 15656 6 54344 32108 15577 7 40482 24789 14630 8 37110 23238 14336 9 39263 23915 14834 10 38889 23764 14921 11 39593 23990 14707 12 39305 24071 14516 13 40560 24448 14055 14 38306 23794 13493 15 40911 25025 13528 16 44700 26921 13719 17 50328 28575 14170 18 47499 27256 14009 19 34446 21065 13159 20 31434 20454 12927 21 34066 21672 13510 22 35044 22217 13520 23 37040 23046 14089 24 38706 24364 14251 25 40430 25631 13980 26 39613 25360 13715 27 44236 27534 14112 28 47859 29853 14289 29 53711 31554 15020 30 50352 29788 14860 31 36142 22779 13800 32 34819 22576 14431 33 37353 23572 14944 34 37550 24132 15083 35 40462 25699 15707 36 41753 26960 15954 37 43437 28005 15631 38 44784 29114 15813 39 49537 31945 16356 40 54974 35559 17086 41 58535 36259 17302 42 54762 34018 17247 43 40738 26543 16398 44 38052 25672 16590 45 38436 25925 16673 46 36993 28472 16962 47 39056 29669 17278 48 39996 30786 17224 Andere_studies 1 35668 2 35589 3 35544 4 35292 5 35047 6 34705 7 34536 8 33596 9 34149 10 33567 11 32881 12 32351 13 31576 14 31544 15 31583 16 30686 17 31097 18 31123 19 30850 20 30397 21 30783 22 30600 23 30552 24 30967 25 30732 26 30823 27 31035 28 30991 29 31078 30 31016 31 30387 32 30204 33 30318 34 30695 35 30369 36 30251 37 29782 38 29871 39 30474 40 31195 41 31429 42 31825 43 31786 44 32734 45 32109 46 32530 47 32357 48 32288 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) 3.079e-11 `Basisonderwijs(lager_1ste_graad_secundair)` 1.000e+00 `Secundair_onderwijs(2de,3de,4de_graad)` 1.000e+00 Duaal_onderwijs 4.377e-14 Hoger_onderwijs 1.000e+00 `Hoger_onderwijs(Bachelor)` -2.545e-15 `Hoger_onderwijs(Masters_doctoraten)` NA Leercontract 1.000e+00 Andere_studies 1.000e+00 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -3.098e-11 -6.729e-12 -1.832e-12 2.484e-12 1.171e-10 Coefficients: (1 not defined because of singularities) Estimate Std. Error t value (Intercept) 3.079e-11 1.826e-10 1.690e-01 `Basisonderwijs(lager_1ste_graad_secundair)` 1.000e+00 3.856e-15 2.594e+14 `Secundair_onderwijs(2de,3de,4de_graad)` 1.000e+00 2.218e-15 4.508e+14 Duaal_onderwijs 4.377e-14 2.045e-14 2.140e+00 Hoger_onderwijs 1.000e+00 3.714e-15 2.692e+14 `Hoger_onderwijs(Bachelor)` -2.545e-15 5.885e-15 -4.320e-01 `Hoger_onderwijs(Masters_doctoraten)` NA NA NA Leercontract 1.000e+00 3.831e-14 2.610e+13 Andere_studies 1.000e+00 5.823e-15 1.717e+14 Pr(>|t|) (Intercept) 0.8670 `Basisonderwijs(lager_1ste_graad_secundair)` <2e-16 *** `Secundair_onderwijs(2de,3de,4de_graad)` <2e-16 *** Duaal_onderwijs 0.0385 * Hoger_onderwijs <2e-16 *** `Hoger_onderwijs(Bachelor)` 0.6677 `Hoger_onderwijs(Masters_doctoraten)` NA Leercontract <2e-16 *** Andere_studies <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.121e-11 on 40 degrees of freedom Multiple R-squared: 1, Adjusted R-squared: 1 F-statistic: 2.126e+31 on 7 and 40 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,] 9.114482e-01 1.771036e-01 8.855181e-02 [2,] 9.999999e-01 2.053116e-07 1.026558e-07 [3,] 7.303294e-01 5.393413e-01 2.696706e-01 [4,] 9.999868e-01 2.645495e-05 1.322748e-05 [5,] 9.999999e-01 2.274284e-07 1.137142e-07 [6,] 7.860709e-01 4.278582e-01 2.139291e-01 [7,] 1.192026e-01 2.384051e-01 8.807974e-01 [8,] 9.999987e-01 2.673251e-06 1.336625e-06 [9,] 1.000000e+00 3.577657e-08 1.788828e-08 [10,] 8.136074e-03 1.627215e-02 9.918639e-01 [11,] 5.547979e-04 1.109596e-03 9.994452e-01 [12,] 3.307482e-12 6.614963e-12 1.000000e+00 [13,] 9.787056e-05 1.957411e-04 9.999021e-01 [14,] 7.741424e-01 4.517153e-01 2.258576e-01 [15,] 5.089296e-03 1.017859e-02 9.949107e-01 [16,] 4.407960e-01 8.815919e-01 5.592040e-01 [17,] 4.092430e-01 8.184860e-01 5.907570e-01 [18,] 1.094415e-02 2.188830e-02 9.890559e-01 [19,] 1.730781e-01 3.461563e-01 8.269219e-01 [20,] 1.111142e-03 2.222285e-03 9.988889e-01 [21,] 9.700942e-01 5.981156e-02 2.990578e-02 [22,] 9.998148e-01 3.704594e-04 1.852297e-04 [23,] 7.069015e-01 5.861970e-01 2.930985e-01 [24,] 8.185147e-01 3.629705e-01 1.814853e-01 [25,] 5.895377e-01 8.209246e-01 4.104623e-01 > postscript(file="/var/fisher/rcomp/tmp/1fdck1353245349.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/fisher/rcomp/tmp/2gjvd1353245349.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/fisher/rcomp/tmp/390p41353245349.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/fisher/rcomp/tmp/4deei1353245349.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/fisher/rcomp/tmp/5hyib1353245349.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 = 48 Frequency = 1 1 2 3 4 5 1.170547e-10 -3.098400e-11 -1.428165e-11 -1.630650e-11 -1.437349e-11 6 7 8 9 10 -1.513666e-11 -6.259773e-12 -3.160587e-12 -3.359262e-12 -1.336082e-11 11 12 13 14 15 -1.046276e-11 -4.052549e-12 5.602780e-14 -1.577355e-11 -1.243953e-11 16 17 18 19 20 -3.952677e-12 2.190257e-12 1.683306e-12 -1.818244e-12 -5.742636e-12 21 22 23 24 25 -1.618374e-12 -4.882997e-12 -8.138566e-12 9.699249e-13 2.627181e-12 26 27 28 29 30 8.170460e-12 1.356480e-11 1.469271e-11 5.288731e-12 2.436109e-12 31 32 33 34 35 1.382232e-11 1.458919e-11 1.252284e-11 8.541233e-12 2.637130e-12 36 37 38 39 40 -1.453627e-12 -1.845403e-12 -2.367700e-12 -3.467314e-12 -3.383714e-12 41 42 43 44 45 -1.630244e-12 -2.467825e-12 -8.773768e-13 6.797475e-12 -1.119087e-12 46 47 48 1.757458e-13 -1.144057e-11 -1.166266e-11 > postscript(file="/var/fisher/rcomp/tmp/6hzvu1353245349.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 = 48 Frequency = 1 lag(myerror, k = 1) myerror 0 1.170547e-10 NA 1 -3.098400e-11 1.170547e-10 2 -1.428165e-11 -3.098400e-11 3 -1.630650e-11 -1.428165e-11 4 -1.437349e-11 -1.630650e-11 5 -1.513666e-11 -1.437349e-11 6 -6.259773e-12 -1.513666e-11 7 -3.160587e-12 -6.259773e-12 8 -3.359262e-12 -3.160587e-12 9 -1.336082e-11 -3.359262e-12 10 -1.046276e-11 -1.336082e-11 11 -4.052549e-12 -1.046276e-11 12 5.602780e-14 -4.052549e-12 13 -1.577355e-11 5.602780e-14 14 -1.243953e-11 -1.577355e-11 15 -3.952677e-12 -1.243953e-11 16 2.190257e-12 -3.952677e-12 17 1.683306e-12 2.190257e-12 18 -1.818244e-12 1.683306e-12 19 -5.742636e-12 -1.818244e-12 20 -1.618374e-12 -5.742636e-12 21 -4.882997e-12 -1.618374e-12 22 -8.138566e-12 -4.882997e-12 23 9.699249e-13 -8.138566e-12 24 2.627181e-12 9.699249e-13 25 8.170460e-12 2.627181e-12 26 1.356480e-11 8.170460e-12 27 1.469271e-11 1.356480e-11 28 5.288731e-12 1.469271e-11 29 2.436109e-12 5.288731e-12 30 1.382232e-11 2.436109e-12 31 1.458919e-11 1.382232e-11 32 1.252284e-11 1.458919e-11 33 8.541233e-12 1.252284e-11 34 2.637130e-12 8.541233e-12 35 -1.453627e-12 2.637130e-12 36 -1.845403e-12 -1.453627e-12 37 -2.367700e-12 -1.845403e-12 38 -3.467314e-12 -2.367700e-12 39 -3.383714e-12 -3.467314e-12 40 -1.630244e-12 -3.383714e-12 41 -2.467825e-12 -1.630244e-12 42 -8.773768e-13 -2.467825e-12 43 6.797475e-12 -8.773768e-13 44 -1.119087e-12 6.797475e-12 45 1.757458e-13 -1.119087e-12 46 -1.144057e-11 1.757458e-13 47 -1.166266e-11 -1.144057e-11 48 NA -1.166266e-11 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -3.098400e-11 1.170547e-10 [2,] -1.428165e-11 -3.098400e-11 [3,] -1.630650e-11 -1.428165e-11 [4,] -1.437349e-11 -1.630650e-11 [5,] -1.513666e-11 -1.437349e-11 [6,] -6.259773e-12 -1.513666e-11 [7,] -3.160587e-12 -6.259773e-12 [8,] -3.359262e-12 -3.160587e-12 [9,] -1.336082e-11 -3.359262e-12 [10,] -1.046276e-11 -1.336082e-11 [11,] -4.052549e-12 -1.046276e-11 [12,] 5.602780e-14 -4.052549e-12 [13,] -1.577355e-11 5.602780e-14 [14,] -1.243953e-11 -1.577355e-11 [15,] -3.952677e-12 -1.243953e-11 [16,] 2.190257e-12 -3.952677e-12 [17,] 1.683306e-12 2.190257e-12 [18,] -1.818244e-12 1.683306e-12 [19,] -5.742636e-12 -1.818244e-12 [20,] -1.618374e-12 -5.742636e-12 [21,] -4.882997e-12 -1.618374e-12 [22,] -8.138566e-12 -4.882997e-12 [23,] 9.699249e-13 -8.138566e-12 [24,] 2.627181e-12 9.699249e-13 [25,] 8.170460e-12 2.627181e-12 [26,] 1.356480e-11 8.170460e-12 [27,] 1.469271e-11 1.356480e-11 [28,] 5.288731e-12 1.469271e-11 [29,] 2.436109e-12 5.288731e-12 [30,] 1.382232e-11 2.436109e-12 [31,] 1.458919e-11 1.382232e-11 [32,] 1.252284e-11 1.458919e-11 [33,] 8.541233e-12 1.252284e-11 [34,] 2.637130e-12 8.541233e-12 [35,] -1.453627e-12 2.637130e-12 [36,] -1.845403e-12 -1.453627e-12 [37,] -2.367700e-12 -1.845403e-12 [38,] -3.467314e-12 -2.367700e-12 [39,] -3.383714e-12 -3.467314e-12 [40,] -1.630244e-12 -3.383714e-12 [41,] -2.467825e-12 -1.630244e-12 [42,] -8.773768e-13 -2.467825e-12 [43,] 6.797475e-12 -8.773768e-13 [44,] -1.119087e-12 6.797475e-12 [45,] 1.757458e-13 -1.119087e-12 [46,] -1.144057e-11 1.757458e-13 [47,] -1.166266e-11 -1.144057e-11 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -3.098400e-11 1.170547e-10 2 -1.428165e-11 -3.098400e-11 3 -1.630650e-11 -1.428165e-11 4 -1.437349e-11 -1.630650e-11 5 -1.513666e-11 -1.437349e-11 6 -6.259773e-12 -1.513666e-11 7 -3.160587e-12 -6.259773e-12 8 -3.359262e-12 -3.160587e-12 9 -1.336082e-11 -3.359262e-12 10 -1.046276e-11 -1.336082e-11 11 -4.052549e-12 -1.046276e-11 12 5.602780e-14 -4.052549e-12 13 -1.577355e-11 5.602780e-14 14 -1.243953e-11 -1.577355e-11 15 -3.952677e-12 -1.243953e-11 16 2.190257e-12 -3.952677e-12 17 1.683306e-12 2.190257e-12 18 -1.818244e-12 1.683306e-12 19 -5.742636e-12 -1.818244e-12 20 -1.618374e-12 -5.742636e-12 21 -4.882997e-12 -1.618374e-12 22 -8.138566e-12 -4.882997e-12 23 9.699249e-13 -8.138566e-12 24 2.627181e-12 9.699249e-13 25 8.170460e-12 2.627181e-12 26 1.356480e-11 8.170460e-12 27 1.469271e-11 1.356480e-11 28 5.288731e-12 1.469271e-11 29 2.436109e-12 5.288731e-12 30 1.382232e-11 2.436109e-12 31 1.458919e-11 1.382232e-11 32 1.252284e-11 1.458919e-11 33 8.541233e-12 1.252284e-11 34 2.637130e-12 8.541233e-12 35 -1.453627e-12 2.637130e-12 36 -1.845403e-12 -1.453627e-12 37 -2.367700e-12 -1.845403e-12 38 -3.467314e-12 -2.367700e-12 39 -3.383714e-12 -3.467314e-12 40 -1.630244e-12 -3.383714e-12 41 -2.467825e-12 -1.630244e-12 42 -8.773768e-13 -2.467825e-12 43 6.797475e-12 -8.773768e-13 44 -1.119087e-12 6.797475e-12 45 1.757458e-13 -1.119087e-12 46 -1.144057e-11 1.757458e-13 47 -1.166266e-11 -1.144057e-11 > 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/fisher/rcomp/tmp/7mlno1353245349.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/fisher/rcomp/tmp/87ssv1353245349.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/fisher/rcomp/tmp/9kqv01353245349.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/fisher/rcomp/tmp/10e08h1353245349.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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='') + } + } Error: subscript out of bounds Execution halted