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(31/01/2007 + ,1 + ,1.2999 + ,28/02/2007 + ,1 + ,1.3074 + ,31/03/2007 + ,1 + ,1.3242 + ,30/04/2007 + ,1 + ,1.3516 + ,31/05/2007 + ,1 + ,1.3511 + ,30/06/2007 + ,1 + ,1.3419 + ,31/07/2007 + ,1 + ,1.3716 + ,31/08/2007 + ,1 + ,1.3622 + ,30/09/2007 + ,1 + ,1.3896 + ,31/10/2007 + ,1 + ,1.4227 + ,30/11/2007 + ,1 + ,1.4684 + ,31/12/2007 + ,1 + ,1.457 + ,31/01/2008 + ,1 + ,1.4718 + ,29/02/2008 + ,1 + ,1.4748 + ,31/03/2008 + ,1 + ,1.5527 + ,30/04/2008 + ,1 + ,1.575 + ,31/05/2008 + ,1 + ,1.5557 + ,30/06/2008 + ,1 + ,1.5553 + ,31/07/2008 + ,1 + ,1.577 + ,31/08/2008 + ,1 + ,1.4975 + ,30/09/2008 + ,1 + ,1.4369 + ,31/10/2008 + ,1 + ,1.3322 + ,30/11/2008 + ,1 + ,1.2732 + ,31/12/2008 + ,1 + ,1.3449 + ,31/01/2009 + ,1 + ,1.3239 + ,28/02/2009 + ,1 + ,1.2785 + ,31/03/2009 + ,1 + ,1.305 + ,30/04/2009 + ,1 + ,1.319 + ,31/05/2009 + ,1 + ,1.365 + ,30/06/2009 + ,1 + ,1.4016 + ,31/07/2009 + ,1 + ,1.4088 + ,31/08/2009 + ,1 + ,1.4268 + ,30/09/2009 + ,1 + ,1.4562 + ,31/10/2009 + ,1 + ,1.4816 + ,30/11/2009 + ,1 + ,1.4914 + ,31/12/2009 + ,1 + ,1.4614 + ,31/01/2010 + ,1 + ,1.4272 + ,28/02/2010 + ,1 + ,1.3686 + ,31/03/2010 + ,1 + ,1.3569 + ,30/04/2010 + ,1 + ,1.3406 + ,31/05/2010 + ,1 + ,1.2565 + ,30/06/2010 + ,1 + ,1.2208 + ,31/07/2010 + ,1 + ,1.277 + ,31/08/2010 + ,1 + ,1.2894 + ,30/09/2010 + ,1 + ,1.3067 + ,31/10/2010 + ,1 + ,1.3898 + ,30/11/2010 + ,1 + ,1.3661 + ,31/12/2010 + ,1 + ,1.322 + ,31/01/2011 + ,1 + ,1.336 + ,28/02/2011 + ,1 + ,1.3649 + ,31/03/2011 + ,1 + ,1.3999 + ,30/04/2011 + ,1 + ,1.4442 + ,31/05/2011 + ,1 + ,1.4349 + ,30/06/2011 + ,1 + ,1.4388 + ,31/07/2011 + ,1 + ,1.4264 + ,31/08/2011 + ,1 + ,1.4343 + ,30/09/2011 + ,1 + ,1.377 + ,31/10/2011 + ,1 + ,1.3706 + ,30/11/2011 + ,1 + ,1.3556 + ,31/12/2011 + ,1 + ,1.3179 + ,31/01/2012 + ,1 + ,1.2905 + ,29/02/2012 + ,1 + ,1.3224 + ,31/03/2012 + ,1 + ,1.3201 + ,30/04/2012 + ,1 + ,1.3162 + ,31/05/2012 + ,1 + ,1.2789 + ,30/06/2012 + ,1 + ,1.2526 + ,31/07/2012 + ,1 + ,1.2288 + ,31/08/2012 + ,1 + ,1.24 + ,30/09/2012 + ,1 + ,1.2856 + ,31/10/2012 + ,1 + ,1.2974) + ,dim=c(3 + ,70) + ,dimnames=list(c('data' + ,'euro' + ,'dollar') + ,1:70)) > y <- array(NA,dim=c(3,70),dimnames=list(c('data','euro','dollar'),1:70)) > 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' > 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 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 data euro dollar 1 0.015445939 1 1.2999 2 0.006975585 1 1.3074 3 0.005148646 1 1.3242 4 0.003736921 1 1.3516 5 0.003089188 1 1.3511 6 0.002491281 1 1.3419 7 0.002206563 1 1.3716 8 0.001930742 1 1.3622 9 0.001660854 1 1.3896 10 0.001544594 1 1.4227 11 0.001358880 1 1.4684 12 0.001287162 1 1.4570 13 0.015438247 1 1.4718 14 0.007221116 1 1.4748 15 0.005146082 1 1.5527 16 0.003735060 1 1.5750 17 0.003087649 1 1.5557 18 0.002490040 1 1.5553 19 0.002205464 1 1.5770 20 0.001929781 1 1.4975 21 0.001660027 1 1.4369 22 0.001543825 1 1.3322 23 0.001358204 1 1.2732 24 0.001286521 1 1.3449 25 0.015430562 1 1.3239 26 0.006968641 1 1.2785 27 0.005143521 1 1.3050 28 0.003733201 1 1.3190 29 0.003086112 1 1.3650 30 0.002488800 1 1.4016 31 0.002204366 1 1.4088 32 0.001928820 1 1.4268 33 0.001659200 1 1.4562 34 0.001543056 1 1.4816 35 0.001357527 1 1.4914 36 0.001285880 1 1.4614 37 0.015422886 1 1.4272 38 0.006965174 1 1.3686 39 0.005140962 1 1.3569 40 0.003731343 1 1.3406 41 0.003084577 1 1.2565 42 0.002487562 1 1.2208 43 0.002203269 1 1.2770 44 0.001927861 1 1.2894 45 0.001658375 1 1.3067 46 0.001542289 1 1.3898 47 0.001356852 1 1.3661 48 0.001285240 1 1.3220 49 0.015415216 1 1.3360 50 0.006961711 1 1.3649 51 0.005138405 1 1.3999 52 0.003729488 1 1.4442 53 0.003083043 1 1.4349 54 0.002486325 1 1.4388 55 0.002202174 1 1.4264 56 0.001926902 1 1.4343 57 0.001657550 1 1.3770 58 0.001541522 1 1.3706 59 0.001356177 1 1.3556 60 0.001284601 1 1.3179 61 0.015407555 1 1.2905 62 0.007206759 1 1.3224 63 0.005135852 1 1.3201 64 0.003727634 1 1.3162 65 0.003081511 1 1.2789 66 0.002485089 1 1.2526 67 0.002201079 1 1.2288 68 0.001925944 1 1.2400 69 0.001656726 1 1.2856 70 0.001540755 1 1.2974 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) euro dollar 0.009231 NA -0.003817 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.0030137 -0.0023057 -0.0015856 0.0007985 0.0118243 Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) 0.009231 0.007556 1.222 0.226 euro NA NA NA NA dollar -0.003817 0.005483 -0.696 0.489 Residual standard error: 0.00392 on 68 degrees of freedom Multiple R-squared: 0.007074, Adjusted R-squared: -0.007528 F-statistic: 0.4844 on 1 and 68 DF, p-value: 0.4888 > 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.4904841 0.98096816 0.509515919 [2,] 0.4043878 0.80877552 0.595612239 [3,] 0.2647097 0.52941944 0.735290281 [4,] 0.2375357 0.47507138 0.762464308 [5,] 0.2880086 0.57601724 0.711991380 [6,] 0.3386225 0.67724504 0.661377479 [7,] 0.2711118 0.54222351 0.728888247 [8,] 0.9640085 0.07198309 0.035991546 [9,] 0.9558987 0.08820267 0.044101333 [10,] 0.9343389 0.13132212 0.065661058 [11,] 0.9028828 0.19423441 0.097117207 [12,] 0.8630821 0.27383572 0.136917861 [13,] 0.8160101 0.36797981 0.183989903 [14,] 0.7603592 0.47928169 0.239640844 [15,] 0.7060202 0.58795969 0.293979844 [16,] 0.6597221 0.68055586 0.340277928 [17,] 0.6306219 0.73875625 0.369378126 [18,] 0.6074895 0.78502098 0.392510489 [19,] 0.5701336 0.85973279 0.429866395 [20,] 0.9070137 0.18597267 0.092986334 [21,] 0.8839110 0.23217795 0.116088973 [22,] 0.8463691 0.30726189 0.153630943 [23,] 0.8027780 0.39444403 0.197222015 [24,] 0.7542589 0.49148212 0.245741061 [25,] 0.7034873 0.59302530 0.296512652 [26,] 0.6514310 0.69713792 0.348568958 [27,] 0.5990468 0.80190635 0.400953174 [28,] 0.5473654 0.90526921 0.452634606 [29,] 0.4966819 0.99336371 0.503318147 [30,] 0.4532974 0.90659475 0.546702625 [31,] 0.4190490 0.83809793 0.580951034 [32,] 0.8529385 0.29412308 0.147061541 [33,] 0.8341319 0.33173613 0.165868065 [34,] 0.7903815 0.41923706 0.209618529 [35,] 0.7363500 0.52729991 0.263649955 [36,] 0.6838918 0.63221637 0.316108185 [37,] 0.6362162 0.72756768 0.363783839 [38,] 0.5846822 0.83063555 0.415317775 [39,] 0.5351090 0.92978195 0.464890976 [40,] 0.4886493 0.97729869 0.511350653 [41,] 0.4356673 0.87133451 0.564332743 [42,] 0.3904157 0.78083141 0.609584293 [43,] 0.3531482 0.70629643 0.646851783 [44,] 0.8545402 0.29091957 0.145459785 [45,] 0.8443021 0.31139571 0.155697854 [46,] 0.8032986 0.39340288 0.196701438 [47,] 0.7430052 0.51398955 0.256994777 [48,] 0.6693830 0.66123406 0.330617029 [49,] 0.5864212 0.82715763 0.413578814 [50,] 0.4986607 0.99732150 0.501339252 [51,] 0.4111539 0.82230781 0.588846094 [52,] 0.3383941 0.67678814 0.661605931 [53,] 0.2837645 0.56752904 0.716235479 [54,] 0.2655878 0.53117556 0.734412218 [55,] 0.2559700 0.51193994 0.744030030 [56,] 0.9871455 0.02570904 0.012854521 [57,] 0.9949560 0.01008793 0.005043963 [58,] 0.9952564 0.00948711 0.004743555 [59,] 0.9923182 0.01536370 0.007681849 > postscript(file="/var/wessaorg/rcomp/tmp/1fl581353443480.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/2p55p1353443480.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/37qtb1353443480.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/4u0sc1353443480.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/5sp261353443480.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 = 70 Frequency = 1 1 2 3 4 5 1.117594e-02 2.734208e-03 9.713862e-04 -3.357670e-04 -9.854082e-04 6 7 8 9 10 -1.618427e-03 -1.789795e-03 -2.101490e-03 -2.266807e-03 -2.256740e-03 11 12 13 14 15 -2.268039e-03 -2.383266e-03 1.182430e-02 3.618622e-03 1.840896e-03 16 17 18 19 20 5.149814e-04 -2.060877e-04 -8.052239e-04 -1.006982e-03 -1.586077e-03 21 22 23 24 25 -2.087113e-03 -2.602903e-03 -3.013699e-03 -2.811738e-03 1.125216e-02 26 27 28 29 30 2.616966e-03 8.929835e-04 -4.639055e-04 -9.354340e-04 -1.393062e-03 31 32 33 34 35 -1.650017e-03 -1.856866e-03 -2.014280e-03 -2.033485e-03 -2.181612e-03 36 37 38 39 40 -2.367754e-03 1.163873e-02 2.957367e-03 1.088502e-03 -3.833261e-04 41 42 43 44 45 -1.351061e-03 -2.084326e-03 -2.154130e-03 -2.382214e-03 -2.585674e-03 46 47 48 49 50 -2.384608e-03 -2.660496e-03 -2.900416e-03 1.128299e-02 2.939782e-03 51 52 53 54 55 1.250055e-03 1.020931e-05 -6.717288e-04 -1.253562e-03 -1.585039e-03 56 57 58 59 60 -1.830160e-03 -2.318198e-03 -2.458652e-03 -2.701244e-03 -2.916703e-03 61 62 63 64 65 1.110168e-02 3.022629e-03 9.429436e-04 -4.801582e-04 -1.268637e-03 66 67 68 69 70 -1.965433e-03 -2.340276e-03 -2.572666e-03 -2.667851e-03 -2.738787e-03 > postscript(file="/var/wessaorg/rcomp/tmp/67ty11353443480.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 = 70 Frequency = 1 lag(myerror, k = 1) myerror 0 1.117594e-02 NA 1 2.734208e-03 1.117594e-02 2 9.713862e-04 2.734208e-03 3 -3.357670e-04 9.713862e-04 4 -9.854082e-04 -3.357670e-04 5 -1.618427e-03 -9.854082e-04 6 -1.789795e-03 -1.618427e-03 7 -2.101490e-03 -1.789795e-03 8 -2.266807e-03 -2.101490e-03 9 -2.256740e-03 -2.266807e-03 10 -2.268039e-03 -2.256740e-03 11 -2.383266e-03 -2.268039e-03 12 1.182430e-02 -2.383266e-03 13 3.618622e-03 1.182430e-02 14 1.840896e-03 3.618622e-03 15 5.149814e-04 1.840896e-03 16 -2.060877e-04 5.149814e-04 17 -8.052239e-04 -2.060877e-04 18 -1.006982e-03 -8.052239e-04 19 -1.586077e-03 -1.006982e-03 20 -2.087113e-03 -1.586077e-03 21 -2.602903e-03 -2.087113e-03 22 -3.013699e-03 -2.602903e-03 23 -2.811738e-03 -3.013699e-03 24 1.125216e-02 -2.811738e-03 25 2.616966e-03 1.125216e-02 26 8.929835e-04 2.616966e-03 27 -4.639055e-04 8.929835e-04 28 -9.354340e-04 -4.639055e-04 29 -1.393062e-03 -9.354340e-04 30 -1.650017e-03 -1.393062e-03 31 -1.856866e-03 -1.650017e-03 32 -2.014280e-03 -1.856866e-03 33 -2.033485e-03 -2.014280e-03 34 -2.181612e-03 -2.033485e-03 35 -2.367754e-03 -2.181612e-03 36 1.163873e-02 -2.367754e-03 37 2.957367e-03 1.163873e-02 38 1.088502e-03 2.957367e-03 39 -3.833261e-04 1.088502e-03 40 -1.351061e-03 -3.833261e-04 41 -2.084326e-03 -1.351061e-03 42 -2.154130e-03 -2.084326e-03 43 -2.382214e-03 -2.154130e-03 44 -2.585674e-03 -2.382214e-03 45 -2.384608e-03 -2.585674e-03 46 -2.660496e-03 -2.384608e-03 47 -2.900416e-03 -2.660496e-03 48 1.128299e-02 -2.900416e-03 49 2.939782e-03 1.128299e-02 50 1.250055e-03 2.939782e-03 51 1.020931e-05 1.250055e-03 52 -6.717288e-04 1.020931e-05 53 -1.253562e-03 -6.717288e-04 54 -1.585039e-03 -1.253562e-03 55 -1.830160e-03 -1.585039e-03 56 -2.318198e-03 -1.830160e-03 57 -2.458652e-03 -2.318198e-03 58 -2.701244e-03 -2.458652e-03 59 -2.916703e-03 -2.701244e-03 60 1.110168e-02 -2.916703e-03 61 3.022629e-03 1.110168e-02 62 9.429436e-04 3.022629e-03 63 -4.801582e-04 9.429436e-04 64 -1.268637e-03 -4.801582e-04 65 -1.965433e-03 -1.268637e-03 66 -2.340276e-03 -1.965433e-03 67 -2.572666e-03 -2.340276e-03 68 -2.667851e-03 -2.572666e-03 69 -2.738787e-03 -2.667851e-03 70 NA -2.738787e-03 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 2.734208e-03 1.117594e-02 [2,] 9.713862e-04 2.734208e-03 [3,] -3.357670e-04 9.713862e-04 [4,] -9.854082e-04 -3.357670e-04 [5,] -1.618427e-03 -9.854082e-04 [6,] -1.789795e-03 -1.618427e-03 [7,] -2.101490e-03 -1.789795e-03 [8,] -2.266807e-03 -2.101490e-03 [9,] -2.256740e-03 -2.266807e-03 [10,] -2.268039e-03 -2.256740e-03 [11,] -2.383266e-03 -2.268039e-03 [12,] 1.182430e-02 -2.383266e-03 [13,] 3.618622e-03 1.182430e-02 [14,] 1.840896e-03 3.618622e-03 [15,] 5.149814e-04 1.840896e-03 [16,] -2.060877e-04 5.149814e-04 [17,] -8.052239e-04 -2.060877e-04 [18,] -1.006982e-03 -8.052239e-04 [19,] -1.586077e-03 -1.006982e-03 [20,] -2.087113e-03 -1.586077e-03 [21,] -2.602903e-03 -2.087113e-03 [22,] -3.013699e-03 -2.602903e-03 [23,] -2.811738e-03 -3.013699e-03 [24,] 1.125216e-02 -2.811738e-03 [25,] 2.616966e-03 1.125216e-02 [26,] 8.929835e-04 2.616966e-03 [27,] -4.639055e-04 8.929835e-04 [28,] -9.354340e-04 -4.639055e-04 [29,] -1.393062e-03 -9.354340e-04 [30,] -1.650017e-03 -1.393062e-03 [31,] -1.856866e-03 -1.650017e-03 [32,] -2.014280e-03 -1.856866e-03 [33,] -2.033485e-03 -2.014280e-03 [34,] -2.181612e-03 -2.033485e-03 [35,] -2.367754e-03 -2.181612e-03 [36,] 1.163873e-02 -2.367754e-03 [37,] 2.957367e-03 1.163873e-02 [38,] 1.088502e-03 2.957367e-03 [39,] -3.833261e-04 1.088502e-03 [40,] -1.351061e-03 -3.833261e-04 [41,] -2.084326e-03 -1.351061e-03 [42,] -2.154130e-03 -2.084326e-03 [43,] -2.382214e-03 -2.154130e-03 [44,] -2.585674e-03 -2.382214e-03 [45,] -2.384608e-03 -2.585674e-03 [46,] -2.660496e-03 -2.384608e-03 [47,] -2.900416e-03 -2.660496e-03 [48,] 1.128299e-02 -2.900416e-03 [49,] 2.939782e-03 1.128299e-02 [50,] 1.250055e-03 2.939782e-03 [51,] 1.020931e-05 1.250055e-03 [52,] -6.717288e-04 1.020931e-05 [53,] -1.253562e-03 -6.717288e-04 [54,] -1.585039e-03 -1.253562e-03 [55,] -1.830160e-03 -1.585039e-03 [56,] -2.318198e-03 -1.830160e-03 [57,] -2.458652e-03 -2.318198e-03 [58,] -2.701244e-03 -2.458652e-03 [59,] -2.916703e-03 -2.701244e-03 [60,] 1.110168e-02 -2.916703e-03 [61,] 3.022629e-03 1.110168e-02 [62,] 9.429436e-04 3.022629e-03 [63,] -4.801582e-04 9.429436e-04 [64,] -1.268637e-03 -4.801582e-04 [65,] -1.965433e-03 -1.268637e-03 [66,] -2.340276e-03 -1.965433e-03 [67,] -2.572666e-03 -2.340276e-03 [68,] -2.667851e-03 -2.572666e-03 [69,] -2.738787e-03 -2.667851e-03 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 2.734208e-03 1.117594e-02 2 9.713862e-04 2.734208e-03 3 -3.357670e-04 9.713862e-04 4 -9.854082e-04 -3.357670e-04 5 -1.618427e-03 -9.854082e-04 6 -1.789795e-03 -1.618427e-03 7 -2.101490e-03 -1.789795e-03 8 -2.266807e-03 -2.101490e-03 9 -2.256740e-03 -2.266807e-03 10 -2.268039e-03 -2.256740e-03 11 -2.383266e-03 -2.268039e-03 12 1.182430e-02 -2.383266e-03 13 3.618622e-03 1.182430e-02 14 1.840896e-03 3.618622e-03 15 5.149814e-04 1.840896e-03 16 -2.060877e-04 5.149814e-04 17 -8.052239e-04 -2.060877e-04 18 -1.006982e-03 -8.052239e-04 19 -1.586077e-03 -1.006982e-03 20 -2.087113e-03 -1.586077e-03 21 -2.602903e-03 -2.087113e-03 22 -3.013699e-03 -2.602903e-03 23 -2.811738e-03 -3.013699e-03 24 1.125216e-02 -2.811738e-03 25 2.616966e-03 1.125216e-02 26 8.929835e-04 2.616966e-03 27 -4.639055e-04 8.929835e-04 28 -9.354340e-04 -4.639055e-04 29 -1.393062e-03 -9.354340e-04 30 -1.650017e-03 -1.393062e-03 31 -1.856866e-03 -1.650017e-03 32 -2.014280e-03 -1.856866e-03 33 -2.033485e-03 -2.014280e-03 34 -2.181612e-03 -2.033485e-03 35 -2.367754e-03 -2.181612e-03 36 1.163873e-02 -2.367754e-03 37 2.957367e-03 1.163873e-02 38 1.088502e-03 2.957367e-03 39 -3.833261e-04 1.088502e-03 40 -1.351061e-03 -3.833261e-04 41 -2.084326e-03 -1.351061e-03 42 -2.154130e-03 -2.084326e-03 43 -2.382214e-03 -2.154130e-03 44 -2.585674e-03 -2.382214e-03 45 -2.384608e-03 -2.585674e-03 46 -2.660496e-03 -2.384608e-03 47 -2.900416e-03 -2.660496e-03 48 1.128299e-02 -2.900416e-03 49 2.939782e-03 1.128299e-02 50 1.250055e-03 2.939782e-03 51 1.020931e-05 1.250055e-03 52 -6.717288e-04 1.020931e-05 53 -1.253562e-03 -6.717288e-04 54 -1.585039e-03 -1.253562e-03 55 -1.830160e-03 -1.585039e-03 56 -2.318198e-03 -1.830160e-03 57 -2.458652e-03 -2.318198e-03 58 -2.701244e-03 -2.458652e-03 59 -2.916703e-03 -2.701244e-03 60 1.110168e-02 -2.916703e-03 61 3.022629e-03 1.110168e-02 62 9.429436e-04 3.022629e-03 63 -4.801582e-04 9.429436e-04 64 -1.268637e-03 -4.801582e-04 65 -1.965433e-03 -1.268637e-03 66 -2.340276e-03 -1.965433e-03 67 -2.572666e-03 -2.340276e-03 68 -2.667851e-03 -2.572666e-03 69 -2.738787e-03 -2.667851e-03 > 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/71z171353443480.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/82rv81353443480.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/9jd4j1353443480.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/10oete1353443480.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