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(1 + ,591 + ,1.3119 + ,0.69867 + ,135.63 + ,2 + ,589 + ,1.3014 + ,0.68968 + ,136.55 + ,3 + ,584 + ,1.3201 + ,0.69233 + ,138.83 + ,4 + ,573 + ,1.2938 + ,0.68293 + ,138.84 + ,5 + ,567 + ,1.2694 + ,0.68399 + ,135.37 + ,6 + ,569 + ,1.2165 + ,0.66895 + ,132.22 + ,7 + ,621 + ,1.2037 + ,0.68756 + ,134.75 + ,8 + ,629 + ,1.2292 + ,0.68527 + ,135.98 + ,9 + ,628 + ,1.2256 + ,0.6776 + ,136.06 + ,10 + ,612 + ,1.2015 + ,0.68137 + ,138.05 + ,11 + ,595 + ,1.1786 + ,0.67933 + ,139.59 + ,12 + ,597 + ,1.1856 + ,0.67922 + ,140.58 + ,13 + ,593 + ,1.2103 + ,0.68598 + ,139.81 + ,14 + ,590 + ,1.1938 + ,0.68297 + ,140.77 + ,15 + ,580 + ,1.202 + ,0.68935 + ,140.96 + ,16 + ,574 + ,1.2271 + ,0.69463 + ,143.59 + ,17 + ,573 + ,1.277 + ,0.6833 + ,142.7 + ,18 + ,573 + ,1.265 + ,0.68666 + ,145.11 + ,19 + ,620 + ,1.2684 + ,0.68782 + ,146.7 + ,20 + ,626 + ,1.2811 + ,0.67669 + ,148.53 + ,21 + ,620 + ,1.2727 + ,0.67511 + ,148.99 + ,22 + ,588 + ,1.2611 + ,0.67254 + ,149.65 + ,23 + ,566 + ,1.2881 + ,0.67397 + ,151.11 + ,24 + ,557 + ,1.3213 + ,0.67286 + ,154.82 + ,25 + ,561 + ,1.2999 + ,0.66341 + ,156.56 + ,26 + ,549 + ,1.3074 + ,0.668 + ,157.6 + ,27 + ,532 + ,1.3242 + ,0.68021 + ,155.24 + ,28 + ,526 + ,1.3516 + ,0.67934 + ,160.68 + ,29 + ,511 + ,1.3511 + ,0.68136 + ,163.22 + ,30 + ,499 + ,1.3419 + ,0.67562 + ,164.55 + ,31 + ,555 + ,1.3716 + ,0.6744 + ,166.76 + ,32 + ,565 + ,1.3622 + ,0.67766 + ,159.05 + ,33 + ,542 + ,1.3896 + ,0.68887 + ,159.82 + ,34 + ,527 + ,1.4227 + ,0.69614 + ,164.95 + ,35 + ,510 + ,1.4684 + ,0.70896 + ,162.89 + ,36 + ,514 + ,1.457 + ,0.72064 + ,163.55 + ,37 + ,517 + ,1.4718 + ,0.74725 + ,158.68 + ,38 + ,508 + ,1.4748 + ,0.75094 + ,157.97 + ,39 + ,493 + ,1.5527 + ,0.77494 + ,156.59 + ,40 + ,490 + ,1.575 + ,0.79487 + ,161.56 + ,41 + ,469 + ,1.5557 + ,0.79209 + ,162.31 + ,42 + ,478 + ,1.5553 + ,0.79152 + ,166.26 + ,43 + ,528 + ,1.577 + ,0.79308 + ,168.45 + ,44 + ,534 + ,1.4975 + ,0.79279 + ,163.63 + ,45 + ,518 + ,1.4369 + ,0.79924 + ,153.2 + ,46 + ,506 + ,1.3322 + ,0.78668 + ,133.52 + ,47 + ,502 + ,1.2732 + ,0.83063 + ,123.28 + ,48 + ,516 + ,1.3449 + ,0.90448 + ,122.51 + ,49 + ,528 + ,1.3239 + ,0.91819 + ,119.73 + ,50 + ,533 + ,1.2785 + ,0.88691 + ,118.3 + ,51 + ,536 + ,1.305 + ,0.91966 + ,127.65 + ,52 + ,537 + ,1.319 + ,0.89756 + ,130.25 + ,53 + ,524 + ,1.365 + ,0.88444 + ,131.85 + ,54 + ,536 + ,1.4016 + ,0.8567 + ,135.39 + ,55 + ,587 + ,1.4088 + ,0.86092 + ,133.09 + ,56 + ,597 + ,1.4268 + ,0.86265 + ,135.31 + ,57 + ,581 + ,1.4562 + ,0.89135 + ,133.14 + ,58 + ,564 + ,1.4816 + ,0.91557 + ,133.91 + ,59 + ,558 + ,1.4914 + ,0.89892 + ,132.97 + ,60 + ,575 + ,1.4614 + ,0.89972 + ,131.21 + ,61 + ,580 + ,1.4272 + ,0.88305 + ,130.34) + ,dim=c(5 + ,61) + ,dimnames=list(c('Maand' + ,'Werkloosheidsgraad' + ,'Dollar/euro' + ,'Pond/euro' + ,'Yen/euro') + ,1:61)) > y <- array(NA,dim=c(5,61),dimnames=list(c('Maand','Werkloosheidsgraad','Dollar/euro','Pond/euro','Yen/euro'),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 = 'Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '2' > 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 Werkloosheidsgraad Maand Dollar/euro Pond/euro Yen/euro t 1 591 1 1.3119 0.69867 135.63 1 2 589 2 1.3014 0.68968 136.55 2 3 584 3 1.3201 0.69233 138.83 3 4 573 4 1.2938 0.68293 138.84 4 5 567 5 1.2694 0.68399 135.37 5 6 569 6 1.2165 0.66895 132.22 6 7 621 7 1.2037 0.68756 134.75 7 8 629 8 1.2292 0.68527 135.98 8 9 628 9 1.2256 0.67760 136.06 9 10 612 10 1.2015 0.68137 138.05 10 11 595 11 1.1786 0.67933 139.59 11 12 597 12 1.1856 0.67922 140.58 12 13 593 13 1.2103 0.68598 139.81 13 14 590 14 1.1938 0.68297 140.77 14 15 580 15 1.2020 0.68935 140.96 15 16 574 16 1.2271 0.69463 143.59 16 17 573 17 1.2770 0.68330 142.70 17 18 573 18 1.2650 0.68666 145.11 18 19 620 19 1.2684 0.68782 146.70 19 20 626 20 1.2811 0.67669 148.53 20 21 620 21 1.2727 0.67511 148.99 21 22 588 22 1.2611 0.67254 149.65 22 23 566 23 1.2881 0.67397 151.11 23 24 557 24 1.3213 0.67286 154.82 24 25 561 25 1.2999 0.66341 156.56 25 26 549 26 1.3074 0.66800 157.60 26 27 532 27 1.3242 0.68021 155.24 27 28 526 28 1.3516 0.67934 160.68 28 29 511 29 1.3511 0.68136 163.22 29 30 499 30 1.3419 0.67562 164.55 30 31 555 31 1.3716 0.67440 166.76 31 32 565 32 1.3622 0.67766 159.05 32 33 542 33 1.3896 0.68887 159.82 33 34 527 34 1.4227 0.69614 164.95 34 35 510 35 1.4684 0.70896 162.89 35 36 514 36 1.4570 0.72064 163.55 36 37 517 37 1.4718 0.74725 158.68 37 38 508 38 1.4748 0.75094 157.97 38 39 493 39 1.5527 0.77494 156.59 39 40 490 40 1.5750 0.79487 161.56 40 41 469 41 1.5557 0.79209 162.31 41 42 478 42 1.5553 0.79152 166.26 42 43 528 43 1.5770 0.79308 168.45 43 44 534 44 1.4975 0.79279 163.63 44 45 518 45 1.4369 0.79924 153.20 45 46 506 46 1.3322 0.78668 133.52 46 47 502 47 1.2732 0.83063 123.28 47 48 516 48 1.3449 0.90448 122.51 48 49 528 49 1.3239 0.91819 119.73 49 50 533 50 1.2785 0.88691 118.30 50 51 536 51 1.3050 0.91966 127.65 51 52 537 52 1.3190 0.89756 130.25 52 53 524 53 1.3650 0.88444 131.85 53 54 536 54 1.4016 0.85670 135.39 54 55 587 55 1.4088 0.86092 133.09 55 56 597 56 1.4268 0.86265 135.31 56 57 581 57 1.4562 0.89135 133.14 57 58 564 58 1.4816 0.91557 133.91 58 59 558 59 1.4914 0.89892 132.97 59 60 575 60 1.4614 0.89972 131.21 60 61 580 61 1.4272 0.88305 130.34 61 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Maand `Dollar/euro` `Pond/euro` `Yen/euro` 1102.88085 0.03561 -3.11091 -315.95467 -2.11670 t NA > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -75.206 -18.922 -2.479 21.342 55.532 Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) 1102.88085 177.37973 6.218 6.71e-08 *** Maand 0.03561 0.67109 0.053 0.9579 `Dollar/euro` -3.11091 90.98633 -0.034 0.9728 `Pond/euro` -315.95467 206.02942 -1.534 0.1308 `Yen/euro` -2.11670 0.88798 -2.384 0.0206 * t NA NA NA NA --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 29.62 on 56 degrees of freedom Multiple R-squared: 0.4991, Adjusted R-squared: 0.4633 F-statistic: 13.95 on 4 and 56 DF, p-value: 5.882e-08 > 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.21190473 0.42380947 0.7880953 [2,] 0.15268289 0.30536577 0.8473171 [3,] 0.10324295 0.20648589 0.8967571 [4,] 0.06180937 0.12361874 0.9381906 [5,] 0.11710472 0.23420944 0.8828953 [6,] 0.08337002 0.16674005 0.9166300 [7,] 0.07676075 0.15352149 0.9232393 [8,] 0.04756704 0.09513408 0.9524330 [9,] 0.03286782 0.06573564 0.9671322 [10,] 0.01804620 0.03609241 0.9819538 [11,] 0.06560303 0.13120607 0.9343970 [12,] 0.15145940 0.30291879 0.8485406 [13,] 0.23190293 0.46380587 0.7680971 [14,] 0.27895640 0.55791281 0.7210436 [15,] 0.35688472 0.71376945 0.6431153 [16,] 0.43124319 0.86248637 0.5687568 [17,] 0.46980138 0.93960275 0.5301986 [18,] 0.50016190 0.99967619 0.4998381 [19,] 0.59125948 0.81748105 0.4087405 [20,] 0.58604400 0.82791199 0.4139560 [21,] 0.55551547 0.88896906 0.4444845 [22,] 0.56782148 0.86435704 0.4321785 [23,] 0.63363333 0.73273333 0.3663667 [24,] 0.74130420 0.51739160 0.2586958 [25,] 0.78555195 0.42889609 0.2144480 [26,] 0.78372157 0.43255687 0.2162784 [27,] 0.75678518 0.48642963 0.2432148 [28,] 0.73542203 0.52915594 0.2645780 [29,] 0.77412657 0.45174686 0.2258734 [30,] 0.77886090 0.44227819 0.2211391 [31,] 0.73861128 0.52277744 0.2613887 [32,] 0.67737567 0.64524866 0.3226243 [33,] 0.68158592 0.63682815 0.3184141 [34,] 0.78885983 0.42228034 0.2111402 [35,] 0.81406469 0.37187062 0.1859353 [36,] 0.78121400 0.43757199 0.2187860 [37,] 0.70554974 0.58890052 0.2944503 [38,] 0.66501277 0.66997446 0.3349872 [39,] 0.69101717 0.61796567 0.3089828 [40,] 0.59266652 0.81466696 0.4073335 [41,] 0.47274162 0.94548324 0.5272584 [42,] 0.35383164 0.70766329 0.6461684 [43,] 0.27048259 0.54096519 0.7295174 [44,] 0.21889493 0.43778986 0.7811051 > postscript(file="/var/wessaorg/rcomp/tmp/1v0821353352989.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/wessaorg/rcomp/tmp/25lyf1353352989.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/wessaorg/rcomp/tmp/3cpl51353352989.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/wessaorg/rcomp/tmp/49xhm1353352989.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/wessaorg/rcomp/tmp/5bh0c1353352989.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 4.037739e-04 -2.960944e+00 -2.275032e+00 -1.634127e+01 -2.946281e+01 6 7 8 9 10 -3.908254e+01 2.407718e+01 3.400090e+01 3.070005e+01 1.999284e+01 11 12 13 14 15 5.501159e+00 9.548099e+00 6.095323e+00 4.089387e+00 -3.502752e+00 16 17 18 19 20 -2.225126e+00 -8.569130e+00 -2.479225e+00 4.822780e+01 5.458867e+01 21 22 23 24 25 4.900140e+01 1.751472e+01 -8.947046e-01 -2.324798e+00 2.270298e+00 26 27 28 29 30 -6.090385e+00 -2.421133e+01 -1.892175e+01 -2.794428e+01 -3.900689e+01 31 32 33 34 35 2.134233e+01 1.598776e+01 -1.790909e+00 -3.567904e+00 -2.077120e+01 36 37 38 39 40 -1.175491e+01 -1.064524e+01 -2.000850e+01 -3.013990e+01 -1.628918e+01 41 42 43 44 45 -3.667567e+01 -1.953166e+01 3.562869e+01 3.105165e+01 -5.211722e+00 46 47 48 49 50 -6.319803e+01 -7.520596e+01 -3.931512e+01 -2.896874e+01 -3.705553e+01 51 52 53 54 55 -3.870069e+00 -4.341314e+00 -1.799243e+01 -7.185661e+00 4.026605e+01 56 57 58 59 60 5.553210e+01 4.406262e+01 3.638830e+01 2.313284e+01 3.653128e+01 61 3.428078e+01 > postscript(file="/var/wessaorg/rcomp/tmp/6ylfn1353352989.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 4.037739e-04 NA 1 -2.960944e+00 4.037739e-04 2 -2.275032e+00 -2.960944e+00 3 -1.634127e+01 -2.275032e+00 4 -2.946281e+01 -1.634127e+01 5 -3.908254e+01 -2.946281e+01 6 2.407718e+01 -3.908254e+01 7 3.400090e+01 2.407718e+01 8 3.070005e+01 3.400090e+01 9 1.999284e+01 3.070005e+01 10 5.501159e+00 1.999284e+01 11 9.548099e+00 5.501159e+00 12 6.095323e+00 9.548099e+00 13 4.089387e+00 6.095323e+00 14 -3.502752e+00 4.089387e+00 15 -2.225126e+00 -3.502752e+00 16 -8.569130e+00 -2.225126e+00 17 -2.479225e+00 -8.569130e+00 18 4.822780e+01 -2.479225e+00 19 5.458867e+01 4.822780e+01 20 4.900140e+01 5.458867e+01 21 1.751472e+01 4.900140e+01 22 -8.947046e-01 1.751472e+01 23 -2.324798e+00 -8.947046e-01 24 2.270298e+00 -2.324798e+00 25 -6.090385e+00 2.270298e+00 26 -2.421133e+01 -6.090385e+00 27 -1.892175e+01 -2.421133e+01 28 -2.794428e+01 -1.892175e+01 29 -3.900689e+01 -2.794428e+01 30 2.134233e+01 -3.900689e+01 31 1.598776e+01 2.134233e+01 32 -1.790909e+00 1.598776e+01 33 -3.567904e+00 -1.790909e+00 34 -2.077120e+01 -3.567904e+00 35 -1.175491e+01 -2.077120e+01 36 -1.064524e+01 -1.175491e+01 37 -2.000850e+01 -1.064524e+01 38 -3.013990e+01 -2.000850e+01 39 -1.628918e+01 -3.013990e+01 40 -3.667567e+01 -1.628918e+01 41 -1.953166e+01 -3.667567e+01 42 3.562869e+01 -1.953166e+01 43 3.105165e+01 3.562869e+01 44 -5.211722e+00 3.105165e+01 45 -6.319803e+01 -5.211722e+00 46 -7.520596e+01 -6.319803e+01 47 -3.931512e+01 -7.520596e+01 48 -2.896874e+01 -3.931512e+01 49 -3.705553e+01 -2.896874e+01 50 -3.870069e+00 -3.705553e+01 51 -4.341314e+00 -3.870069e+00 52 -1.799243e+01 -4.341314e+00 53 -7.185661e+00 -1.799243e+01 54 4.026605e+01 -7.185661e+00 55 5.553210e+01 4.026605e+01 56 4.406262e+01 5.553210e+01 57 3.638830e+01 4.406262e+01 58 2.313284e+01 3.638830e+01 59 3.653128e+01 2.313284e+01 60 3.428078e+01 3.653128e+01 61 NA 3.428078e+01 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -2.9609437 4.037739e-04 [2,] -2.2750324 -2.960944e+00 [3,] -16.3412679 -2.275032e+00 [4,] -29.4628125 -1.634127e+01 [5,] -39.0825450 -2.946281e+01 [6,] 24.0771834 -3.908254e+01 [7,] 34.0009010 2.407718e+01 [8,] 30.7000534 3.400090e+01 [9,] 19.9928450 3.070005e+01 [10,] 5.5011593 1.999284e+01 [11,] 9.5480990 5.501159e+00 [12,] 6.0953235 9.548099e+00 [13,] 4.0893874 6.095323e+00 [14,] -3.5027517 4.089387e+00 [15,] -2.2251259 -3.502752e+00 [16,] -8.5691301 -2.225126e+00 [17,] -2.4792252 -8.569130e+00 [18,] 48.2277958 -2.479225e+00 [19,] 54.5886727 4.822780e+01 [20,] 49.0014016 5.458867e+01 [21,] 17.5147198 4.900140e+01 [22,] -0.8947046 1.751472e+01 [23,] -2.3247979 -8.947046e-01 [24,] 2.2702981 -2.324798e+00 [25,] -6.0903850 2.270298e+00 [26,] -24.2113320 -6.090385e+00 [27,] -18.9217537 -2.421133e+01 [28,] -27.9442820 -1.892175e+01 [29,] -39.0068869 -2.794428e+01 [30,] 21.3423311 -3.900689e+01 [31,] 15.9877550 2.134233e+01 [32,] -1.7909093 1.598776e+01 [33,] -3.5679039 -1.790909e+00 [34,] -20.7712042 -3.567904e+00 [35,] -11.7549098 -2.077120e+01 [36,] -10.6452409 -1.175491e+01 [37,] -20.0085020 -1.064524e+01 [38,] -30.1399040 -2.000850e+01 [39,] -16.2891818 -3.013990e+01 [40,] -36.6756653 -1.628918e+01 [41,] -19.5316624 -3.667567e+01 [42,] 35.6286883 -1.953166e+01 [43,] 31.0516530 3.562869e+01 [44,] -5.2117220 3.105165e+01 [45,] -63.1980336 -5.211722e+00 [46,] -75.2059587 -6.319803e+01 [47,] -39.3151230 -7.520596e+01 [48,] -28.9687430 -3.931512e+01 [49,] -37.0555286 -2.896874e+01 [50,] -3.8700690 -3.705553e+01 [51,] -4.3413139 -3.870069e+00 [52,] -17.9924339 -4.341314e+00 [53,] -7.1856614 -1.799243e+01 [54,] 40.2660510 -7.185661e+00 [55,] 55.5321045 4.026605e+01 [56,] 44.0626199 5.553210e+01 [57,] 36.3883039 4.406262e+01 [58,] 23.1328387 3.638830e+01 [59,] 36.5312767 2.313284e+01 [60,] 34.2807812 3.653128e+01 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -2.9609437 4.037739e-04 2 -2.2750324 -2.960944e+00 3 -16.3412679 -2.275032e+00 4 -29.4628125 -1.634127e+01 5 -39.0825450 -2.946281e+01 6 24.0771834 -3.908254e+01 7 34.0009010 2.407718e+01 8 30.7000534 3.400090e+01 9 19.9928450 3.070005e+01 10 5.5011593 1.999284e+01 11 9.5480990 5.501159e+00 12 6.0953235 9.548099e+00 13 4.0893874 6.095323e+00 14 -3.5027517 4.089387e+00 15 -2.2251259 -3.502752e+00 16 -8.5691301 -2.225126e+00 17 -2.4792252 -8.569130e+00 18 48.2277958 -2.479225e+00 19 54.5886727 4.822780e+01 20 49.0014016 5.458867e+01 21 17.5147198 4.900140e+01 22 -0.8947046 1.751472e+01 23 -2.3247979 -8.947046e-01 24 2.2702981 -2.324798e+00 25 -6.0903850 2.270298e+00 26 -24.2113320 -6.090385e+00 27 -18.9217537 -2.421133e+01 28 -27.9442820 -1.892175e+01 29 -39.0068869 -2.794428e+01 30 21.3423311 -3.900689e+01 31 15.9877550 2.134233e+01 32 -1.7909093 1.598776e+01 33 -3.5679039 -1.790909e+00 34 -20.7712042 -3.567904e+00 35 -11.7549098 -2.077120e+01 36 -10.6452409 -1.175491e+01 37 -20.0085020 -1.064524e+01 38 -30.1399040 -2.000850e+01 39 -16.2891818 -3.013990e+01 40 -36.6756653 -1.628918e+01 41 -19.5316624 -3.667567e+01 42 35.6286883 -1.953166e+01 43 31.0516530 3.562869e+01 44 -5.2117220 3.105165e+01 45 -63.1980336 -5.211722e+00 46 -75.2059587 -6.319803e+01 47 -39.3151230 -7.520596e+01 48 -28.9687430 -3.931512e+01 49 -37.0555286 -2.896874e+01 50 -3.8700690 -3.705553e+01 51 -4.3413139 -3.870069e+00 52 -17.9924339 -4.341314e+00 53 -7.1856614 -1.799243e+01 54 40.2660510 -7.185661e+00 55 55.5321045 4.026605e+01 56 44.0626199 5.553210e+01 57 36.3883039 4.406262e+01 58 23.1328387 3.638830e+01 59 36.5312767 2.313284e+01 60 34.2807812 3.653128e+01 > 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/wessaorg/rcomp/tmp/73cns1353352989.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/wessaorg/rcomp/tmp/8bybm1353352989.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/wessaorg/rcomp/tmp/9o2g81353352989.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/wessaorg/rcomp/tmp/10nwov1353352989.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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