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(1940 + ,56.521 + ,53.802 + ,110.323 + ,1941 + ,50.599 + ,47.818 + ,98.417 + ,1942 + ,54.751 + ,50.998 + ,105.749 + ,1943 + ,62.227 + ,58.438 + ,120.665 + ,1944 + ,63.932 + ,60.143 + ,124.075 + ,1945 + ,65.391 + ,61.854 + ,127.245 + ,1946 + ,75.744 + ,70.987 + ,146.731 + ,1947 + ,74.590 + ,70.389 + ,144.979 + ,1948 + ,76.035 + ,72.175 + ,148.210 + ,1949 + ,74.427 + ,70.243 + ,144.670 + ,1950 + ,73.354 + ,69.616 + ,142.970 + ,1951 + ,73.081 + ,69.443 + ,142.524 + ,1952 + ,75.309 + ,70.833 + ,146.142 + ,1953 + ,75.463 + ,71.059 + ,146.522 + ,1954 + ,75.910 + ,72.218 + ,148.128 + ,1955 + ,76.151 + ,72.647 + ,148.798 + ,1956 + ,76.882 + ,73.299 + ,150.181 + ,1957 + ,78.632 + ,73.756 + ,152.388 + ,1958 + ,80.137 + ,75.557 + ,155.694 + ,1959 + ,82.490 + ,78.172 + ,160.662 + ,1960 + ,79.896 + ,75.624 + ,155.520 + ,1961 + ,81.303 + ,76.959 + ,158.262 + ,1962 + ,79.344 + ,74.994 + ,154.338 + ,1963 + ,81.355 + ,76.841 + ,158.196 + ,1964 + ,82.328 + ,78.043 + ,160.371 + ,1965 + ,79.669 + ,75.187 + ,154.856 + ,1966 + ,77.249 + ,73.387 + ,150.636 + ,1967 + ,75.101 + ,70.798 + ,145.899 + ,1968 + ,72.520 + ,68.722 + ,141.242 + ,1969 + ,72.438 + ,68.396 + ,140.834 + ,1970 + ,72.653 + ,68.466 + ,141.119 + ,1971 + ,71.429 + ,67.675 + ,139.104 + ,1972 + ,69.189 + ,65.248 + ,134.437 + ,1973 + ,66.451 + ,62.974 + ,129.425 + ,1974 + ,63.354 + ,59.801 + ,123.155 + ,1975 + ,61.379 + ,57.894 + ,119.273 + ,1976 + ,61.880 + ,58.592 + ,120.472 + ,1977 + ,62.274 + ,59.249 + ,121.523 + ,1978 + ,62.429 + ,59.554 + ,121.983 + ,1979 + ,63.905 + ,59.753 + ,123.658 + ,1980 + ,63.917 + ,60.877 + ,124.794 + ,1981 + ,64.295 + ,60.532 + ,124.827 + ,1982 + ,61.930 + ,58.452 + ,120.382 + ,1983 + ,60.440 + ,56.955 + ,117.395 + ,1984 + ,59.353 + ,56.437 + ,115.790 + ,1985 + ,58.695 + ,55.588 + ,114.283 + ,1986 + ,60.569 + ,56.702 + ,117.271 + ,1987 + ,60.386 + ,57.062 + ,117.448 + ,1988 + ,60.938 + ,57.826 + ,118.764 + ,1989 + ,61.795 + ,58.755 + ,120.550 + ,1990 + ,63.304 + ,60.250 + ,123.554 + ,1991 + ,64.270 + ,61.142 + ,125.412 + ,1992 + ,63.492 + ,60.690 + ,124.182 + ,1993 + ,61.333 + ,58.495 + ,119.828 + ,1994 + ,59.341 + ,56.020 + ,115.361 + ,1995 + ,58.412 + ,55.814 + ,114.226 + ,1996 + ,58.725 + ,56.489 + ,115.214 + ,1997 + ,59.277 + ,56.587 + ,115.864 + ,1998 + ,58.562 + ,55.714 + ,114.276 + ,1999 + ,57.858 + ,55.611 + ,113.469 + ,2000 + ,58.790 + ,56.093 + ,114.883 + ,2001 + ,58.243 + ,55.929 + ,114.172 + ,2002 + ,57.044 + ,54.181 + ,111.225 + ,2003 + ,57.339 + ,54.810 + ,112.149 + ,2004 + ,59.429 + ,56.189 + ,115.618 + ,2005 + ,60.575 + ,57.427 + ,118.002 + ,2006 + ,61.950 + ,59.432 + ,121.382 + ,2007 + ,61.712 + ,58.951 + ,120.663 + ,2008 + ,65.731 + ,62.318 + ,128.049) + ,dim=c(4 + ,69) + ,dimnames=list(c('Jaar' + ,'Jongens' + ,'Meisjes' + ,'Totaal') + ,1:69)) > y <- array(NA,dim=c(4,69),dimnames=list(c('Jaar','Jongens','Meisjes','Totaal'),1:69)) > 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 Jaar Jongens Meisjes Totaal 1 1940 56.521 53.802 110.323 2 1941 50.599 47.818 98.417 3 1942 54.751 50.998 105.749 4 1943 62.227 58.438 120.665 5 1944 63.932 60.143 124.075 6 1945 65.391 61.854 127.245 7 1946 75.744 70.987 146.731 8 1947 74.590 70.389 144.979 9 1948 76.035 72.175 148.210 10 1949 74.427 70.243 144.670 11 1950 73.354 69.616 142.970 12 1951 73.081 69.443 142.524 13 1952 75.309 70.833 146.142 14 1953 75.463 71.059 146.522 15 1954 75.910 72.218 148.128 16 1955 76.151 72.647 148.798 17 1956 76.882 73.299 150.181 18 1957 78.632 73.756 152.388 19 1958 80.137 75.557 155.694 20 1959 82.490 78.172 160.662 21 1960 79.896 75.624 155.520 22 1961 81.303 76.959 158.262 23 1962 79.344 74.994 154.338 24 1963 81.355 76.841 158.196 25 1964 82.328 78.043 160.371 26 1965 79.669 75.187 154.856 27 1966 77.249 73.387 150.636 28 1967 75.101 70.798 145.899 29 1968 72.520 68.722 141.242 30 1969 72.438 68.396 140.834 31 1970 72.653 68.466 141.119 32 1971 71.429 67.675 139.104 33 1972 69.189 65.248 134.437 34 1973 66.451 62.974 129.425 35 1974 63.354 59.801 123.155 36 1975 61.379 57.894 119.273 37 1976 61.880 58.592 120.472 38 1977 62.274 59.249 121.523 39 1978 62.429 59.554 121.983 40 1979 63.905 59.753 123.658 41 1980 63.917 60.877 124.794 42 1981 64.295 60.532 124.827 43 1982 61.930 58.452 120.382 44 1983 60.440 56.955 117.395 45 1984 59.353 56.437 115.790 46 1985 58.695 55.588 114.283 47 1986 60.569 56.702 117.271 48 1987 60.386 57.062 117.448 49 1988 60.938 57.826 118.764 50 1989 61.795 58.755 120.550 51 1990 63.304 60.250 123.554 52 1991 64.270 61.142 125.412 53 1992 63.492 60.690 124.182 54 1993 61.333 58.495 119.828 55 1994 59.341 56.020 115.361 56 1995 58.412 55.814 114.226 57 1996 58.725 56.489 115.214 58 1997 59.277 56.587 115.864 59 1998 58.562 55.714 114.276 60 1999 57.858 55.611 113.469 61 2000 58.790 56.093 114.883 62 2001 58.243 55.929 114.172 63 2002 57.044 54.181 111.225 64 2003 57.339 54.810 112.149 65 2004 59.429 56.189 115.618 66 2005 60.575 57.427 118.002 67 2006 61.950 59.432 121.382 68 2007 61.712 58.951 120.663 69 2008 65.731 62.318 128.049 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Jongens Meisjes Totaal 2045.22 -19.39 19.34 NA > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -49.901 -3.393 3.348 9.019 31.968 Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) 2045.222 15.616 130.973 < 2e-16 *** Jongens -19.392 4.581 -4.233 7.29e-05 *** Meisjes 19.344 4.896 3.951 0.000192 *** Totaal NA NA NA NA --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 15.35 on 66 degrees of freedom Multiple R-squared: 0.4319, Adjusted R-squared: 0.4147 F-statistic: 25.09 on 2 and 66 DF, p-value: 7.874e-09 > 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,] 3.160490e-03 6.320980e-03 9.968395e-01 [2,] 5.293363e-04 1.058673e-03 9.994707e-01 [3,] 1.186078e-04 2.372156e-04 9.998814e-01 [4,] 6.229510e-05 1.245902e-04 9.999377e-01 [5,] 6.697898e-05 1.339580e-04 9.999330e-01 [6,] 7.786756e-05 1.557351e-04 9.999221e-01 [7,] 9.666939e-05 1.933388e-04 9.999033e-01 [8,] 1.097346e-04 2.194691e-04 9.998903e-01 [9,] 1.116416e-04 2.232833e-04 9.998884e-01 [10,] 1.067910e-04 2.135821e-04 9.998932e-01 [11,] 1.044385e-04 2.088771e-04 9.998956e-01 [12,] 2.342729e-04 4.685459e-04 9.997657e-01 [13,] 2.060639e-04 4.121277e-04 9.997939e-01 [14,] 1.155458e-04 2.310916e-04 9.998845e-01 [15,] 1.336616e-04 2.673231e-04 9.998663e-01 [16,] 1.246885e-04 2.493771e-04 9.998753e-01 [17,] 2.207636e-04 4.415271e-04 9.997792e-01 [18,] 2.683747e-04 5.367494e-04 9.997316e-01 [19,] 2.675338e-04 5.350676e-04 9.997325e-01 [20,] 6.333967e-04 1.266793e-03 9.993666e-01 [21,] 1.754308e-03 3.508616e-03 9.982457e-01 [22,] 7.891763e-03 1.578353e-02 9.921082e-01 [23,] 3.029088e-02 6.058176e-02 9.697091e-01 [24,] 7.742616e-02 1.548523e-01 9.225738e-01 [25,] 1.470919e-01 2.941839e-01 8.529081e-01 [26,] 2.386003e-01 4.772007e-01 7.613997e-01 [27,] 3.678961e-01 7.357921e-01 6.321039e-01 [28,] 5.419573e-01 9.160854e-01 4.580427e-01 [29,] 7.156035e-01 5.687930e-01 2.843965e-01 [30,] 8.416046e-01 3.167907e-01 1.583954e-01 [31,] 9.144670e-01 1.710660e-01 8.553300e-02 [32,] 9.582586e-01 8.348287e-02 4.174144e-02 [33,] 9.829786e-01 3.404276e-02 1.702138e-02 [34,] 9.873964e-01 2.520720e-02 1.260360e-02 [35,] 9.942709e-01 1.145829e-02 5.729144e-03 [36,] 9.954794e-01 9.041245e-03 4.520623e-03 [37,] 9.966606e-01 6.678857e-03 3.339428e-03 [38,] 9.972350e-01 5.530021e-03 2.765010e-03 [39,] 9.983688e-01 3.262330e-03 1.631165e-03 [40,] 9.988181e-01 2.363788e-03 1.181894e-03 [41,] 9.988091e-01 2.381716e-03 1.190858e-03 [42,] 9.991041e-01 1.791841e-03 8.959203e-04 [43,] 9.993636e-01 1.272881e-03 6.364406e-04 [44,] 9.995133e-01 9.734907e-04 4.867454e-04 [45,] 9.996085e-01 7.829276e-04 3.914638e-04 [46,] 9.997654e-01 4.691806e-04 2.345903e-04 [47,] 9.999121e-01 1.757848e-04 8.789242e-05 [48,] 9.999717e-01 5.667380e-05 2.833690e-05 [49,] 9.999878e-01 2.434447e-05 1.217224e-05 [50,] 9.999847e-01 3.063233e-05 1.531616e-05 [51,] 9.999709e-01 5.810312e-05 2.905156e-05 [52,] 9.999755e-01 4.895355e-05 2.447678e-05 [53,] 9.999751e-01 4.973013e-05 2.486506e-05 [54,] 9.999065e-01 1.870410e-04 9.352049e-05 [55,] 9.998683e-01 2.634629e-04 1.317315e-04 [56,] 9.998281e-01 3.438767e-04 1.719384e-04 > postscript(file="/var/www/rcomp/tmp/1e9eg1322143395.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/29cv31322143395.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/3cx1u1322143395.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/40yvp1322143395.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/57bd91322143395.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 = 69 Frequency = 1 1 2 3 4 5 6 -49.90060538 -47.98690951 -27.98449444 -25.92754925 -24.84531681 -28.64958394 7 8 9 10 11 12 -3.55083378 -13.36163836 -18.88817798 -11.69834430 -19.37742539 -20.32497118 13 14 15 16 17 18 -3.00741875 -3.39274415 -16.14396339 -18.76897234 -16.20555671 9.89036591 19 20 21 22 23 24 5.23719063 1.28260337 1.26767999 3.72829269 4.74987252 9.01924487 25 26 27 28 29 30 5.63644503 10.31892754 -0.79093897 8.63607379 -0.25702198 5.45890778 31 32 33 34 35 36 9.27412675 1.83923216 6.34848521 -1.75908733 0.56167183 0.15103956 37 38 39 40 41 42 -2.63552366 -6.70393761 -8.59803036 17.17517657 -3.33453859 11.66925222 43 44 45 46 47 48 7.04220785 8.10575142 -1.95329100 2.70963734 18.50130071 8.98879689 49 50 51 52 53 54 5.91453657 5.56311698 6.90670936 9.38474013 4.04114168 5.63338916 55 56 57 58 59 60 15.88036499 2.84999935 -3.13735641 6.67134708 10.69318125 0.03360972 61 62 63 64 65 66 9.78326551 3.34821223 14.91012469 9.46352690 24.31776229 23.59340544 67 68 69 12.47313454 18.16219661 31.96818442 > postscript(file="/var/www/rcomp/tmp/6vboq1322143395.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 = 69 Frequency = 1 lag(myerror, k = 1) myerror 0 -49.90060538 NA 1 -47.98690951 -49.90060538 2 -27.98449444 -47.98690951 3 -25.92754925 -27.98449444 4 -24.84531681 -25.92754925 5 -28.64958394 -24.84531681 6 -3.55083378 -28.64958394 7 -13.36163836 -3.55083378 8 -18.88817798 -13.36163836 9 -11.69834430 -18.88817798 10 -19.37742539 -11.69834430 11 -20.32497118 -19.37742539 12 -3.00741875 -20.32497118 13 -3.39274415 -3.00741875 14 -16.14396339 -3.39274415 15 -18.76897234 -16.14396339 16 -16.20555671 -18.76897234 17 9.89036591 -16.20555671 18 5.23719063 9.89036591 19 1.28260337 5.23719063 20 1.26767999 1.28260337 21 3.72829269 1.26767999 22 4.74987252 3.72829269 23 9.01924487 4.74987252 24 5.63644503 9.01924487 25 10.31892754 5.63644503 26 -0.79093897 10.31892754 27 8.63607379 -0.79093897 28 -0.25702198 8.63607379 29 5.45890778 -0.25702198 30 9.27412675 5.45890778 31 1.83923216 9.27412675 32 6.34848521 1.83923216 33 -1.75908733 6.34848521 34 0.56167183 -1.75908733 35 0.15103956 0.56167183 36 -2.63552366 0.15103956 37 -6.70393761 -2.63552366 38 -8.59803036 -6.70393761 39 17.17517657 -8.59803036 40 -3.33453859 17.17517657 41 11.66925222 -3.33453859 42 7.04220785 11.66925222 43 8.10575142 7.04220785 44 -1.95329100 8.10575142 45 2.70963734 -1.95329100 46 18.50130071 2.70963734 47 8.98879689 18.50130071 48 5.91453657 8.98879689 49 5.56311698 5.91453657 50 6.90670936 5.56311698 51 9.38474013 6.90670936 52 4.04114168 9.38474013 53 5.63338916 4.04114168 54 15.88036499 5.63338916 55 2.84999935 15.88036499 56 -3.13735641 2.84999935 57 6.67134708 -3.13735641 58 10.69318125 6.67134708 59 0.03360972 10.69318125 60 9.78326551 0.03360972 61 3.34821223 9.78326551 62 14.91012469 3.34821223 63 9.46352690 14.91012469 64 24.31776229 9.46352690 65 23.59340544 24.31776229 66 12.47313454 23.59340544 67 18.16219661 12.47313454 68 31.96818442 18.16219661 69 NA 31.96818442 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -47.98690951 -49.90060538 [2,] -27.98449444 -47.98690951 [3,] -25.92754925 -27.98449444 [4,] -24.84531681 -25.92754925 [5,] -28.64958394 -24.84531681 [6,] -3.55083378 -28.64958394 [7,] -13.36163836 -3.55083378 [8,] -18.88817798 -13.36163836 [9,] -11.69834430 -18.88817798 [10,] -19.37742539 -11.69834430 [11,] -20.32497118 -19.37742539 [12,] -3.00741875 -20.32497118 [13,] -3.39274415 -3.00741875 [14,] -16.14396339 -3.39274415 [15,] -18.76897234 -16.14396339 [16,] -16.20555671 -18.76897234 [17,] 9.89036591 -16.20555671 [18,] 5.23719063 9.89036591 [19,] 1.28260337 5.23719063 [20,] 1.26767999 1.28260337 [21,] 3.72829269 1.26767999 [22,] 4.74987252 3.72829269 [23,] 9.01924487 4.74987252 [24,] 5.63644503 9.01924487 [25,] 10.31892754 5.63644503 [26,] -0.79093897 10.31892754 [27,] 8.63607379 -0.79093897 [28,] -0.25702198 8.63607379 [29,] 5.45890778 -0.25702198 [30,] 9.27412675 5.45890778 [31,] 1.83923216 9.27412675 [32,] 6.34848521 1.83923216 [33,] -1.75908733 6.34848521 [34,] 0.56167183 -1.75908733 [35,] 0.15103956 0.56167183 [36,] -2.63552366 0.15103956 [37,] -6.70393761 -2.63552366 [38,] -8.59803036 -6.70393761 [39,] 17.17517657 -8.59803036 [40,] -3.33453859 17.17517657 [41,] 11.66925222 -3.33453859 [42,] 7.04220785 11.66925222 [43,] 8.10575142 7.04220785 [44,] -1.95329100 8.10575142 [45,] 2.70963734 -1.95329100 [46,] 18.50130071 2.70963734 [47,] 8.98879689 18.50130071 [48,] 5.91453657 8.98879689 [49,] 5.56311698 5.91453657 [50,] 6.90670936 5.56311698 [51,] 9.38474013 6.90670936 [52,] 4.04114168 9.38474013 [53,] 5.63338916 4.04114168 [54,] 15.88036499 5.63338916 [55,] 2.84999935 15.88036499 [56,] -3.13735641 2.84999935 [57,] 6.67134708 -3.13735641 [58,] 10.69318125 6.67134708 [59,] 0.03360972 10.69318125 [60,] 9.78326551 0.03360972 [61,] 3.34821223 9.78326551 [62,] 14.91012469 3.34821223 [63,] 9.46352690 14.91012469 [64,] 24.31776229 9.46352690 [65,] 23.59340544 24.31776229 [66,] 12.47313454 23.59340544 [67,] 18.16219661 12.47313454 [68,] 31.96818442 18.16219661 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -47.98690951 -49.90060538 2 -27.98449444 -47.98690951 3 -25.92754925 -27.98449444 4 -24.84531681 -25.92754925 5 -28.64958394 -24.84531681 6 -3.55083378 -28.64958394 7 -13.36163836 -3.55083378 8 -18.88817798 -13.36163836 9 -11.69834430 -18.88817798 10 -19.37742539 -11.69834430 11 -20.32497118 -19.37742539 12 -3.00741875 -20.32497118 13 -3.39274415 -3.00741875 14 -16.14396339 -3.39274415 15 -18.76897234 -16.14396339 16 -16.20555671 -18.76897234 17 9.89036591 -16.20555671 18 5.23719063 9.89036591 19 1.28260337 5.23719063 20 1.26767999 1.28260337 21 3.72829269 1.26767999 22 4.74987252 3.72829269 23 9.01924487 4.74987252 24 5.63644503 9.01924487 25 10.31892754 5.63644503 26 -0.79093897 10.31892754 27 8.63607379 -0.79093897 28 -0.25702198 8.63607379 29 5.45890778 -0.25702198 30 9.27412675 5.45890778 31 1.83923216 9.27412675 32 6.34848521 1.83923216 33 -1.75908733 6.34848521 34 0.56167183 -1.75908733 35 0.15103956 0.56167183 36 -2.63552366 0.15103956 37 -6.70393761 -2.63552366 38 -8.59803036 -6.70393761 39 17.17517657 -8.59803036 40 -3.33453859 17.17517657 41 11.66925222 -3.33453859 42 7.04220785 11.66925222 43 8.10575142 7.04220785 44 -1.95329100 8.10575142 45 2.70963734 -1.95329100 46 18.50130071 2.70963734 47 8.98879689 18.50130071 48 5.91453657 8.98879689 49 5.56311698 5.91453657 50 6.90670936 5.56311698 51 9.38474013 6.90670936 52 4.04114168 9.38474013 53 5.63338916 4.04114168 54 15.88036499 5.63338916 55 2.84999935 15.88036499 56 -3.13735641 2.84999935 57 6.67134708 -3.13735641 58 10.69318125 6.67134708 59 0.03360972 10.69318125 60 9.78326551 0.03360972 61 3.34821223 9.78326551 62 14.91012469 3.34821223 63 9.46352690 14.91012469 64 24.31776229 9.46352690 65 23.59340544 24.31776229 66 12.47313454 23.59340544 67 18.16219661 12.47313454 68 31.96818442 18.16219661 > 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/7tl3a1322143395.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/8culq1322143395.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/9407e1322143395.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/10d2ip1322143395.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='') + } + } Error: subscript out of bounds Execution halted