R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(95.2,0,95.00,0,94.00,0,92.2,0,91.00,0,91.2,0,103.4,1,105.00,1,104.6,1,103.8,0,101.8,0,102.4,0,103.8,0,103.4,0,102.00,0,101.8,0,100.2,0,101.4,0,113.8,1,116.00,1,115.6,1,113.00,0,109.4,0,111.00,0,112.4,0,112.2,0,111.00,0,108.8,0,107.4,0,108.6,0,118.8,1,122.2,1,122.6,1,122.2,0,118.8,0,119.00,0,118.2,0,117.8,0,116.8,0,114.6,0,113.4,0,113.8,0,124.2,1,125.8,1,125.6,1,122.4,0,119.00,0,119.4,0,118.6,0,118.00,0,116.00,0,114.8,0,114.6,0,114.6,0,124.00,1,125.2,1,124.00,1,117.6,0,113.2,0,111.4,0,112.2,0,109.8,0,106.4,0,105.2,0,102.2,0,99.8,0,111.00,1,113.00,1,108.4,1,105.4,0,102.00,0,102.8,0),dim=c(2,72),dimnames=list(c('Werkloosheid','Dummy'),1:72)) > y <- array(NA,dim=c(2,72),dimnames=list(c('Werkloosheid','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 = 'Include Monthly 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 Werkloosheid Dummy M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 95.2 0 1 0 0 0 0 0 0 0 0 0 0 2 95.0 0 0 1 0 0 0 0 0 0 0 0 0 3 94.0 0 0 0 1 0 0 0 0 0 0 0 0 4 92.2 0 0 0 0 1 0 0 0 0 0 0 0 5 91.0 0 0 0 0 0 1 0 0 0 0 0 0 6 91.2 0 0 0 0 0 0 1 0 0 0 0 0 7 103.4 1 0 0 0 0 0 0 1 0 0 0 0 8 105.0 1 0 0 0 0 0 0 0 1 0 0 0 9 104.6 1 0 0 0 0 0 0 0 0 1 0 0 10 103.8 0 0 0 0 0 0 0 0 0 0 1 0 11 101.8 0 0 0 0 0 0 0 0 0 0 0 1 12 102.4 0 0 0 0 0 0 0 0 0 0 0 0 13 103.8 0 1 0 0 0 0 0 0 0 0 0 0 14 103.4 0 0 1 0 0 0 0 0 0 0 0 0 15 102.0 0 0 0 1 0 0 0 0 0 0 0 0 16 101.8 0 0 0 0 1 0 0 0 0 0 0 0 17 100.2 0 0 0 0 0 1 0 0 0 0 0 0 18 101.4 0 0 0 0 0 0 1 0 0 0 0 0 19 113.8 1 0 0 0 0 0 0 1 0 0 0 0 20 116.0 1 0 0 0 0 0 0 0 1 0 0 0 21 115.6 1 0 0 0 0 0 0 0 0 1 0 0 22 113.0 0 0 0 0 0 0 0 0 0 0 1 0 23 109.4 0 0 0 0 0 0 0 0 0 0 0 1 24 111.0 0 0 0 0 0 0 0 0 0 0 0 0 25 112.4 0 1 0 0 0 0 0 0 0 0 0 0 26 112.2 0 0 1 0 0 0 0 0 0 0 0 0 27 111.0 0 0 0 1 0 0 0 0 0 0 0 0 28 108.8 0 0 0 0 1 0 0 0 0 0 0 0 29 107.4 0 0 0 0 0 1 0 0 0 0 0 0 30 108.6 0 0 0 0 0 0 1 0 0 0 0 0 31 118.8 1 0 0 0 0 0 0 1 0 0 0 0 32 122.2 1 0 0 0 0 0 0 0 1 0 0 0 33 122.6 1 0 0 0 0 0 0 0 0 1 0 0 34 122.2 0 0 0 0 0 0 0 0 0 0 1 0 35 118.8 0 0 0 0 0 0 0 0 0 0 0 1 36 119.0 0 0 0 0 0 0 0 0 0 0 0 0 37 118.2 0 1 0 0 0 0 0 0 0 0 0 0 38 117.8 0 0 1 0 0 0 0 0 0 0 0 0 39 116.8 0 0 0 1 0 0 0 0 0 0 0 0 40 114.6 0 0 0 0 1 0 0 0 0 0 0 0 41 113.4 0 0 0 0 0 1 0 0 0 0 0 0 42 113.8 0 0 0 0 0 0 1 0 0 0 0 0 43 124.2 1 0 0 0 0 0 0 1 0 0 0 0 44 125.8 1 0 0 0 0 0 0 0 1 0 0 0 45 125.6 1 0 0 0 0 0 0 0 0 1 0 0 46 122.4 0 0 0 0 0 0 0 0 0 0 1 0 47 119.0 0 0 0 0 0 0 0 0 0 0 0 1 48 119.4 0 0 0 0 0 0 0 0 0 0 0 0 49 118.6 0 1 0 0 0 0 0 0 0 0 0 0 50 118.0 0 0 1 0 0 0 0 0 0 0 0 0 51 116.0 0 0 0 1 0 0 0 0 0 0 0 0 52 114.8 0 0 0 0 1 0 0 0 0 0 0 0 53 114.6 0 0 0 0 0 1 0 0 0 0 0 0 54 114.6 0 0 0 0 0 0 1 0 0 0 0 0 55 124.0 1 0 0 0 0 0 0 1 0 0 0 0 56 125.2 1 0 0 0 0 0 0 0 1 0 0 0 57 124.0 1 0 0 0 0 0 0 0 0 1 0 0 58 117.6 0 0 0 0 0 0 0 0 0 0 1 0 59 113.2 0 0 0 0 0 0 0 0 0 0 0 1 60 111.4 0 0 0 0 0 0 0 0 0 0 0 0 61 112.2 0 1 0 0 0 0 0 0 0 0 0 0 62 109.8 0 0 1 0 0 0 0 0 0 0 0 0 63 106.4 0 0 0 1 0 0 0 0 0 0 0 0 64 105.2 0 0 0 0 1 0 0 0 0 0 0 0 65 102.2 0 0 0 0 0 1 0 0 0 0 0 0 66 99.8 0 0 0 0 0 0 1 0 0 0 0 0 67 111.0 1 0 0 0 0 0 0 1 0 0 0 0 68 113.0 1 0 0 0 0 0 0 0 1 0 0 0 69 108.4 1 0 0 0 0 0 0 0 0 1 0 0 70 105.4 0 0 0 0 0 0 0 0 0 0 1 0 71 102.0 0 0 0 0 0 0 0 0 0 0 0 1 72 102.8 0 0 0 0 0 0 0 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Dummy M1 M2 M3 M4 111.0000 5.8000 -0.9333 -1.6333 -3.3000 -4.7667 M5 M6 M7 M8 M9 M10 -6.2000 -6.1000 -0.9333 1.0667 NA 3.0667 M11 -0.3000 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -14.867 -5.767 1.283 8.133 9.800 Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) 111.0000 3.4592 32.088 <2e-16 *** Dummy 5.8000 4.8921 1.186 0.240 M1 -0.9333 4.8921 -0.191 0.849 M2 -1.6333 4.8921 -0.334 0.740 M3 -3.3000 4.8921 -0.675 0.503 M4 -4.7667 4.8921 -0.974 0.334 M5 -6.2000 4.8921 -1.267 0.210 M6 -6.1000 4.8921 -1.247 0.217 M7 -0.9333 4.8921 -0.191 0.849 M8 1.0667 4.8921 0.218 0.828 M9 NA NA NA NA M10 3.0667 4.8921 0.627 0.533 M11 -0.3000 4.8921 -0.061 0.951 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 8.473 on 60 degrees of freedom Multiple R-squared: 0.2396, Adjusted R-squared: 0.1002 F-statistic: 1.718 on 11 and 60 DF, p-value: 0.09093 > 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.7161150 0.5677700 0.2838850 [2,] 0.7073587 0.5852827 0.2926413 [3,] 0.7217441 0.5565117 0.2782559 [4,] 0.7309273 0.5381455 0.2690727 [5,] 0.7474545 0.5050910 0.2525455 [6,] 0.7561216 0.4877568 0.2438784 [7,] 0.7346710 0.5306581 0.2653290 [8,] 0.6932421 0.6135157 0.3067579 [9,] 0.6582533 0.6834934 0.3417467 [10,] 0.7207518 0.5584964 0.2792482 [11,] 0.7627432 0.4745136 0.2372568 [12,] 0.7892287 0.4215427 0.2107713 [13,] 0.7940201 0.4119598 0.2059799 [14,] 0.7943042 0.4113917 0.2056958 [15,] 0.7931419 0.4137162 0.2068581 [16,] 0.7701067 0.4597865 0.2298933 [17,] 0.7565383 0.4869234 0.2434617 [18,] 0.7504282 0.4991437 0.2495718 [19,] 0.7676345 0.4647310 0.2323655 [20,] 0.7773799 0.4452402 0.2226201 [21,] 0.7804135 0.4391730 0.2195865 [22,] 0.7791169 0.4417661 0.2208831 [23,] 0.7742872 0.4514255 0.2257128 [24,] 0.7721555 0.4556891 0.2278445 [25,] 0.7565319 0.4869362 0.2434681 [26,] 0.7393774 0.5212451 0.2606226 [27,] 0.7229035 0.5541931 0.2770965 [28,] 0.6967576 0.6064849 0.3032424 [29,] 0.6628582 0.6742837 0.3371418 [30,] 0.6462889 0.7074222 0.3537111 [31,] 0.6360158 0.7279685 0.3639842 [32,] 0.6309931 0.7380138 0.3690069 [33,] 0.6391567 0.7216866 0.3608433 [34,] 0.5820026 0.8359948 0.4179974 [35,] 0.5301581 0.9396838 0.4698419 [36,] 0.4825076 0.9650152 0.5174924 [37,] 0.4313883 0.8627767 0.5686117 [38,] 0.4117809 0.8235618 0.5882191 [39,] 0.4249672 0.8499345 0.5750328 [40,] 0.4012414 0.8024828 0.5987586 [41,] 0.3545651 0.7091302 0.6454349 > postscript(file="/var/www/html/rcomp/tmp/173en1228772387.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/27izt1228772387.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/33duy1228772387.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4vi7y1228772387.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5516t1228772387.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 72 Frequency = 1 1 2 3 4 5 -1.486667e+01 -1.436667e+01 -1.370000e+01 -1.403333e+01 -1.380000e+01 6 7 8 9 10 -1.370000e+01 -1.246667e+01 -1.286667e+01 -1.220000e+01 -1.026667e+01 11 12 13 14 15 -8.900000e+00 -8.600000e+00 -6.266667e+00 -5.966667e+00 -5.700000e+00 16 17 18 19 20 -4.433333e+00 -4.600000e+00 -3.500000e+00 -2.066667e+00 -1.866667e+00 21 22 23 24 25 -1.200000e+00 -1.066667e+00 -1.300000e+00 1.443290e-14 2.333333e+00 26 27 28 29 30 2.833333e+00 3.300000e+00 2.566667e+00 2.600000e+00 3.700000e+00 31 32 33 34 35 2.933333e+00 4.333333e+00 5.800000e+00 8.133333e+00 8.100000e+00 36 37 38 39 40 8.000000e+00 8.133333e+00 8.433333e+00 9.100000e+00 8.366667e+00 41 42 43 44 45 8.600000e+00 8.900000e+00 8.333333e+00 7.933333e+00 8.800000e+00 46 47 48 49 50 8.333333e+00 8.300000e+00 8.400000e+00 8.533333e+00 8.633333e+00 51 52 53 54 55 8.300000e+00 8.566667e+00 9.800000e+00 9.700000e+00 8.133333e+00 56 57 58 59 60 7.333333e+00 7.200000e+00 3.533333e+00 2.500000e+00 4.000000e-01 61 62 63 64 65 2.133333e+00 4.333333e-01 -1.300000e+00 -1.033333e+00 -2.600000e+00 66 67 68 69 70 -5.100000e+00 -4.866667e+00 -4.866667e+00 -8.400000e+00 -8.666667e+00 71 72 -8.700000e+00 -8.200000e+00 > postscript(file="/var/www/html/rcomp/tmp/6gh731228772387.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 72 Frequency = 1 lag(myerror, k = 1) myerror 0 -1.486667e+01 NA 1 -1.436667e+01 -1.486667e+01 2 -1.370000e+01 -1.436667e+01 3 -1.403333e+01 -1.370000e+01 4 -1.380000e+01 -1.403333e+01 5 -1.370000e+01 -1.380000e+01 6 -1.246667e+01 -1.370000e+01 7 -1.286667e+01 -1.246667e+01 8 -1.220000e+01 -1.286667e+01 9 -1.026667e+01 -1.220000e+01 10 -8.900000e+00 -1.026667e+01 11 -8.600000e+00 -8.900000e+00 12 -6.266667e+00 -8.600000e+00 13 -5.966667e+00 -6.266667e+00 14 -5.700000e+00 -5.966667e+00 15 -4.433333e+00 -5.700000e+00 16 -4.600000e+00 -4.433333e+00 17 -3.500000e+00 -4.600000e+00 18 -2.066667e+00 -3.500000e+00 19 -1.866667e+00 -2.066667e+00 20 -1.200000e+00 -1.866667e+00 21 -1.066667e+00 -1.200000e+00 22 -1.300000e+00 -1.066667e+00 23 1.443290e-14 -1.300000e+00 24 2.333333e+00 1.443290e-14 25 2.833333e+00 2.333333e+00 26 3.300000e+00 2.833333e+00 27 2.566667e+00 3.300000e+00 28 2.600000e+00 2.566667e+00 29 3.700000e+00 2.600000e+00 30 2.933333e+00 3.700000e+00 31 4.333333e+00 2.933333e+00 32 5.800000e+00 4.333333e+00 33 8.133333e+00 5.800000e+00 34 8.100000e+00 8.133333e+00 35 8.000000e+00 8.100000e+00 36 8.133333e+00 8.000000e+00 37 8.433333e+00 8.133333e+00 38 9.100000e+00 8.433333e+00 39 8.366667e+00 9.100000e+00 40 8.600000e+00 8.366667e+00 41 8.900000e+00 8.600000e+00 42 8.333333e+00 8.900000e+00 43 7.933333e+00 8.333333e+00 44 8.800000e+00 7.933333e+00 45 8.333333e+00 8.800000e+00 46 8.300000e+00 8.333333e+00 47 8.400000e+00 8.300000e+00 48 8.533333e+00 8.400000e+00 49 8.633333e+00 8.533333e+00 50 8.300000e+00 8.633333e+00 51 8.566667e+00 8.300000e+00 52 9.800000e+00 8.566667e+00 53 9.700000e+00 9.800000e+00 54 8.133333e+00 9.700000e+00 55 7.333333e+00 8.133333e+00 56 7.200000e+00 7.333333e+00 57 3.533333e+00 7.200000e+00 58 2.500000e+00 3.533333e+00 59 4.000000e-01 2.500000e+00 60 2.133333e+00 4.000000e-01 61 4.333333e-01 2.133333e+00 62 -1.300000e+00 4.333333e-01 63 -1.033333e+00 -1.300000e+00 64 -2.600000e+00 -1.033333e+00 65 -5.100000e+00 -2.600000e+00 66 -4.866667e+00 -5.100000e+00 67 -4.866667e+00 -4.866667e+00 68 -8.400000e+00 -4.866667e+00 69 -8.666667e+00 -8.400000e+00 70 -8.700000e+00 -8.666667e+00 71 -8.200000e+00 -8.700000e+00 72 NA -8.200000e+00 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.436667e+01 -1.486667e+01 [2,] -1.370000e+01 -1.436667e+01 [3,] -1.403333e+01 -1.370000e+01 [4,] -1.380000e+01 -1.403333e+01 [5,] -1.370000e+01 -1.380000e+01 [6,] -1.246667e+01 -1.370000e+01 [7,] -1.286667e+01 -1.246667e+01 [8,] -1.220000e+01 -1.286667e+01 [9,] -1.026667e+01 -1.220000e+01 [10,] -8.900000e+00 -1.026667e+01 [11,] -8.600000e+00 -8.900000e+00 [12,] -6.266667e+00 -8.600000e+00 [13,] -5.966667e+00 -6.266667e+00 [14,] -5.700000e+00 -5.966667e+00 [15,] -4.433333e+00 -5.700000e+00 [16,] -4.600000e+00 -4.433333e+00 [17,] -3.500000e+00 -4.600000e+00 [18,] -2.066667e+00 -3.500000e+00 [19,] -1.866667e+00 -2.066667e+00 [20,] -1.200000e+00 -1.866667e+00 [21,] -1.066667e+00 -1.200000e+00 [22,] -1.300000e+00 -1.066667e+00 [23,] 1.443290e-14 -1.300000e+00 [24,] 2.333333e+00 1.443290e-14 [25,] 2.833333e+00 2.333333e+00 [26,] 3.300000e+00 2.833333e+00 [27,] 2.566667e+00 3.300000e+00 [28,] 2.600000e+00 2.566667e+00 [29,] 3.700000e+00 2.600000e+00 [30,] 2.933333e+00 3.700000e+00 [31,] 4.333333e+00 2.933333e+00 [32,] 5.800000e+00 4.333333e+00 [33,] 8.133333e+00 5.800000e+00 [34,] 8.100000e+00 8.133333e+00 [35,] 8.000000e+00 8.100000e+00 [36,] 8.133333e+00 8.000000e+00 [37,] 8.433333e+00 8.133333e+00 [38,] 9.100000e+00 8.433333e+00 [39,] 8.366667e+00 9.100000e+00 [40,] 8.600000e+00 8.366667e+00 [41,] 8.900000e+00 8.600000e+00 [42,] 8.333333e+00 8.900000e+00 [43,] 7.933333e+00 8.333333e+00 [44,] 8.800000e+00 7.933333e+00 [45,] 8.333333e+00 8.800000e+00 [46,] 8.300000e+00 8.333333e+00 [47,] 8.400000e+00 8.300000e+00 [48,] 8.533333e+00 8.400000e+00 [49,] 8.633333e+00 8.533333e+00 [50,] 8.300000e+00 8.633333e+00 [51,] 8.566667e+00 8.300000e+00 [52,] 9.800000e+00 8.566667e+00 [53,] 9.700000e+00 9.800000e+00 [54,] 8.133333e+00 9.700000e+00 [55,] 7.333333e+00 8.133333e+00 [56,] 7.200000e+00 7.333333e+00 [57,] 3.533333e+00 7.200000e+00 [58,] 2.500000e+00 3.533333e+00 [59,] 4.000000e-01 2.500000e+00 [60,] 2.133333e+00 4.000000e-01 [61,] 4.333333e-01 2.133333e+00 [62,] -1.300000e+00 4.333333e-01 [63,] -1.033333e+00 -1.300000e+00 [64,] -2.600000e+00 -1.033333e+00 [65,] -5.100000e+00 -2.600000e+00 [66,] -4.866667e+00 -5.100000e+00 [67,] -4.866667e+00 -4.866667e+00 [68,] -8.400000e+00 -4.866667e+00 [69,] -8.666667e+00 -8.400000e+00 [70,] -8.700000e+00 -8.666667e+00 [71,] -8.200000e+00 -8.700000e+00 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.436667e+01 -1.486667e+01 2 -1.370000e+01 -1.436667e+01 3 -1.403333e+01 -1.370000e+01 4 -1.380000e+01 -1.403333e+01 5 -1.370000e+01 -1.380000e+01 6 -1.246667e+01 -1.370000e+01 7 -1.286667e+01 -1.246667e+01 8 -1.220000e+01 -1.286667e+01 9 -1.026667e+01 -1.220000e+01 10 -8.900000e+00 -1.026667e+01 11 -8.600000e+00 -8.900000e+00 12 -6.266667e+00 -8.600000e+00 13 -5.966667e+00 -6.266667e+00 14 -5.700000e+00 -5.966667e+00 15 -4.433333e+00 -5.700000e+00 16 -4.600000e+00 -4.433333e+00 17 -3.500000e+00 -4.600000e+00 18 -2.066667e+00 -3.500000e+00 19 -1.866667e+00 -2.066667e+00 20 -1.200000e+00 -1.866667e+00 21 -1.066667e+00 -1.200000e+00 22 -1.300000e+00 -1.066667e+00 23 1.443290e-14 -1.300000e+00 24 2.333333e+00 1.443290e-14 25 2.833333e+00 2.333333e+00 26 3.300000e+00 2.833333e+00 27 2.566667e+00 3.300000e+00 28 2.600000e+00 2.566667e+00 29 3.700000e+00 2.600000e+00 30 2.933333e+00 3.700000e+00 31 4.333333e+00 2.933333e+00 32 5.800000e+00 4.333333e+00 33 8.133333e+00 5.800000e+00 34 8.100000e+00 8.133333e+00 35 8.000000e+00 8.100000e+00 36 8.133333e+00 8.000000e+00 37 8.433333e+00 8.133333e+00 38 9.100000e+00 8.433333e+00 39 8.366667e+00 9.100000e+00 40 8.600000e+00 8.366667e+00 41 8.900000e+00 8.600000e+00 42 8.333333e+00 8.900000e+00 43 7.933333e+00 8.333333e+00 44 8.800000e+00 7.933333e+00 45 8.333333e+00 8.800000e+00 46 8.300000e+00 8.333333e+00 47 8.400000e+00 8.300000e+00 48 8.533333e+00 8.400000e+00 49 8.633333e+00 8.533333e+00 50 8.300000e+00 8.633333e+00 51 8.566667e+00 8.300000e+00 52 9.800000e+00 8.566667e+00 53 9.700000e+00 9.800000e+00 54 8.133333e+00 9.700000e+00 55 7.333333e+00 8.133333e+00 56 7.200000e+00 7.333333e+00 57 3.533333e+00 7.200000e+00 58 2.500000e+00 3.533333e+00 59 4.000000e-01 2.500000e+00 60 2.133333e+00 4.000000e-01 61 4.333333e-01 2.133333e+00 62 -1.300000e+00 4.333333e-01 63 -1.033333e+00 -1.300000e+00 64 -2.600000e+00 -1.033333e+00 65 -5.100000e+00 -2.600000e+00 66 -4.866667e+00 -5.100000e+00 67 -4.866667e+00 -4.866667e+00 68 -8.400000e+00 -4.866667e+00 69 -8.666667e+00 -8.400000e+00 70 -8.700000e+00 -8.666667e+00 71 -8.200000e+00 -8.700000e+00 > 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/7lguz1228772387.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/889451228772387.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/9bkn01228772387.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') hat values (leverages) are all = 0.1666667 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/10j2u91228772387.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } Error: subscript out of bounds Execution halted