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(46 + ,26 + ,95556 + ,47.38555556 + ,48 + ,20 + ,54565 + ,24.06138889 + ,37 + ,24 + ,63016 + ,31.4825 + ,75 + ,25 + ,79774 + ,42.36388889 + ,31 + ,15 + ,31258 + ,23.94611111 + ,18 + ,16 + ,52491 + ,10.34916667 + ,79 + ,20 + ,91256 + ,85.01527778 + ,16 + ,18 + ,22807 + ,9.097222222 + ,38 + ,19 + ,77411 + ,32.36166667 + ,24 + ,20 + ,48821 + ,36.26083333 + ,65 + ,30 + ,52295 + ,44.96555556 + ,74 + ,37 + ,63262 + ,35.63166667 + ,43 + ,23 + ,50466 + ,28.43055556 + ,42 + ,36 + ,62932 + ,53.61777778 + ,55 + ,29 + ,38439 + ,39.32611111 + ,121 + ,35 + ,70817 + ,70.43305556 + ,42 + ,24 + ,105965 + ,50.30833333 + ,102 + ,22 + ,73795 + ,55.12 + ,36 + ,19 + ,82043 + ,31.62583333 + ,50 + ,30 + ,74349 + ,44.42777778 + ,48 + ,27 + ,82204 + ,46.33944444 + ,56 + ,26 + ,55709 + ,79.63194444 + ,19 + ,15 + ,37137 + ,25.46027778 + ,32 + ,30 + ,70780 + ,30.07722222 + ,77 + ,28 + ,55027 + ,40.65055556 + ,90 + ,24 + ,56699 + ,40.31722222 + ,81 + ,21 + ,65911 + ,44.92777778 + ,55 + ,27 + ,56316 + ,44.69583333 + ,34 + ,21 + ,26982 + ,29.69111111 + ,38 + ,30 + ,54628 + ,52.26388889 + ,53 + ,30 + ,96750 + ,52.61138889 + ,48 + ,33 + ,53009 + ,35.96777778 + ,63 + ,30 + ,64664 + ,56.675 + ,25 + ,20 + ,36990 + ,17.42527778 + ,56 + ,27 + ,85224 + ,67.67361111 + ,37 + ,25 + ,37048 + ,46.45972222 + ,83 + ,30 + ,59635 + ,73.48 + ,50 + ,20 + ,42051 + ,33.89555556 + ,26 + ,8 + ,26998 + ,22.49 + ,108 + ,24 + ,63717 + ,58.27638889 + ,55 + ,25 + ,55071 + ,62.27916667 + ,41 + ,25 + ,40001 + ,32.21416667 + ,49 + ,21 + ,54506 + ,38.38638889 + ,31 + ,21 + ,35838 + ,22.52944444 + ,49 + ,21 + ,50838 + ,25.86805556 + ,96 + ,26 + ,86997 + ,84.93222222 + ,42 + ,26 + ,33032 + ,21.88888889 + ,55 + ,30 + ,61704 + ,44.12083333 + ,70 + ,34 + ,117986 + ,61.59583333 + ,39 + ,30 + ,56733 + ,36.41888889 + ,53 + ,18 + ,55064 + ,35.75944444 + ,24 + ,4 + ,5950 + ,6.718888889 + ,209 + ,31 + ,84607 + ,71.57277778 + ,17 + ,18 + ,32551 + ,18.06361111 + ,58 + ,14 + ,31701 + ,27.24055556 + ,27 + ,20 + ,71170 + ,48.21861111 + ,58 + ,36 + ,101773 + ,50.01166667 + ,114 + ,24 + ,101653 + ,54.79611111 + ,75 + ,26 + ,81493 + ,58.90555556 + ,51 + ,22 + ,55901 + ,39.32833333 + ,86 + ,31 + ,109104 + ,68.08527778 + ,77 + ,21 + ,114425 + ,57.46638889 + ,62 + ,31 + ,36311 + ,40.47111111 + ,60 + ,26 + ,70027 + ,47.39861111 + ,39 + ,24 + ,73713 + ,39.46222222 + ,35 + ,15 + ,40671 + ,31.89444444 + ,86 + ,19 + ,89041 + ,31.51694444 + ,102 + ,28 + ,57231 + ,40.35694444 + ,49 + ,24 + ,68608 + ,41.94416667 + ,35 + ,18 + ,59155 + ,25.50333333 + ,33 + ,25 + ,55827 + ,33.00194444 + ,28 + ,20 + ,22618 + ,19.2975 + ,44 + ,25 + ,58425 + ,35.175 + ,37 + ,24 + ,65724 + ,40.53 + ,33 + ,23 + ,56979 + ,27.33138889 + ,45 + ,25 + ,72369 + ,53.035 + ,57 + ,20 + ,79194 + ,55.22138889 + ,58 + ,23 + ,202316 + ,29.49805556 + ,36 + ,22 + ,44970 + ,24.81055556 + ,42 + ,25 + ,49319 + ,33.43388889 + ,30 + ,18 + ,36252 + ,27.44194444 + ,67 + ,30 + ,75741 + ,76.37583333 + ,53 + ,22 + ,38417 + ,36.88833333 + ,59 + ,25 + ,64102 + ,37.56972222 + ,25 + ,8 + ,56622 + ,22.48694444 + ,39 + ,21 + ,15430 + ,30.34361111 + ,36 + ,22 + ,72571 + ,26.84277778 + ,114 + ,24 + ,67271 + ,62.83083333 + ,54 + ,30 + ,43460 + ,47.57944444 + ,70 + ,27 + ,99501 + ,32.72638889 + ,51 + ,24 + ,28340 + ,37.10027778 + ,49 + ,25 + ,76013 + ,42.27583333 + ,42 + ,21 + ,37361 + ,31.11222222 + ,51 + ,24 + ,48204 + ,47.11472222 + ,51 + ,24 + ,76168 + ,52.07861111 + ,27 + ,20 + ,85168 + ,36.25916667 + ,29 + ,20 + ,125410 + ,39.53861111 + ,54 + ,24 + ,123328 + ,52.71222222 + ,92 + ,40 + ,83038 + ,56.00083333 + ,72 + ,22 + ,120087 + ,68.565 + ,63 + ,31 + ,91939 + ,43.31861111 + ,41 + ,26 + ,103646 + ,50.71694444 + ,111 + ,20 + ,29467 + ,29.54194444 + ,14 + ,19 + ,43750 + ,12.02416667 + ,45 + ,15 + ,34497 + ,35.41472222 + ,91 + ,21 + ,66477 + ,35.53611111 + ,29 + ,22 + ,71181 + ,41.39055556 + ,64 + ,24 + ,74482 + ,52.12583333 + ,32 + ,19 + ,174949 + ,20.58666667 + ,65 + ,24 + ,46765 + ,26.11277778 + ,42 + ,23 + ,90257 + ,49.0625 + ,55 + ,27 + ,51370 + ,39.42583333 + ,10 + ,1 + ,1168 + ,6.371666667 + ,53 + ,24 + ,51360 + ,34.97972222 + ,25 + ,11 + ,25162 + ,17.1825 + ,33 + ,27 + ,21067 + ,25.35833333 + ,66 + ,22 + ,58233 + ,70.86111111 + ,16 + ,0 + ,855 + ,5.848333333 + ,35 + ,17 + ,85903 + ,46.97027778 + ,19 + ,8 + ,14116 + ,8.726111111 + ,76 + ,24 + ,57637 + ,52.41694444 + ,35 + ,31 + ,94137 + ,38.20666667 + ,46 + ,24 + ,62147 + ,21.435 + ,29 + ,20 + ,62832 + ,20.71305556 + ,34 + ,8 + ,8773 + ,10.615 + ,25 + ,22 + ,63785 + ,25.26694444 + ,48 + ,33 + ,65196 + ,53.95111111 + ,38 + ,33 + ,73087 + ,37.5725 + ,50 + ,31 + ,72631 + ,67.85333333 + ,65 + ,33 + ,86281 + ,56.04111111 + ,72 + ,35 + ,162365 + ,71.22277778 + ,23 + ,21 + ,56530 + ,38.65111111 + ,29 + ,20 + ,35606 + ,21.24166667 + ,194 + ,24 + ,70111 + ,52.63944444 + ,114 + ,29 + ,92046 + ,77.87055556 + ,15 + ,20 + ,63989 + ,14.16638889 + ,86 + ,27 + ,104911 + ,70.35388889 + ,50 + ,24 + ,43448 + ,28.6775 + ,33 + ,26 + ,60029 + ,46.68305556 + ,50 + ,26 + ,38650 + ,35.76888889 + ,72 + ,12 + ,47261 + ,21.04055556 + ,81 + ,21 + ,73586 + ,69.23111111 + ,54 + ,24 + ,83042 + ,42.32388889 + ,63 + ,21 + ,37238 + ,48.12777778 + ,69 + ,30 + ,63958 + ,54.77694444 + ,39 + ,32 + ,78956 + ,18.75194444 + ,49 + ,24 + ,99518 + ,38.72472222 + ,67 + ,29 + ,111436 + ,51.49055556 + ,0 + ,0 + ,0 + ,0 + ,10 + ,0 + ,6023 + ,4.08 + ,1 + ,0 + ,0 + ,0.027222222 + ,2 + ,0 + ,0 + ,0.126388889 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,58 + ,20 + ,42564 + ,38.30138889 + ,72 + ,27 + ,38885 + ,51.46888889 + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,0 + ,0.056388889 + ,5 + ,0 + ,1644 + ,1.999722222 + ,20 + ,5 + ,6179 + ,12.96111111 + ,5 + ,1 + ,3926 + ,4.874166667 + ,27 + ,23 + ,23238 + ,20.43527778 + ,2 + ,0 + ,0 + ,0.269166667 + ,33 + ,16 + ,49288 + ,29.29916667) + ,dim=c(4 + ,164) + ,dimnames=list(c('#logins' + ,'otaal#peer_reviews' + ,'totaal#karakterscompendium' + ,'AantalurenRFC') + ,1:164)) > y <- array(NA,dim=c(4,164),dimnames=list(c('#logins','otaal#peer_reviews','totaal#karakterscompendium','AantalurenRFC'),1:164)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '4' > 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 AantalurenRFC #logins otaal#peer_reviews totaal#karakterscompendium 1 47.38555556 46 26 95556 2 24.06138889 48 20 54565 3 31.48250000 37 24 63016 4 42.36388889 75 25 79774 5 23.94611111 31 15 31258 6 10.34916667 18 16 52491 7 85.01527778 79 20 91256 8 9.09722222 16 18 22807 9 32.36166667 38 19 77411 10 36.26083333 24 20 48821 11 44.96555556 65 30 52295 12 35.63166667 74 37 63262 13 28.43055556 43 23 50466 14 53.61777778 42 36 62932 15 39.32611111 55 29 38439 16 70.43305556 121 35 70817 17 50.30833333 42 24 105965 18 55.12000000 102 22 73795 19 31.62583333 36 19 82043 20 44.42777778 50 30 74349 21 46.33944444 48 27 82204 22 79.63194444 56 26 55709 23 25.46027778 19 15 37137 24 30.07722222 32 30 70780 25 40.65055556 77 28 55027 26 40.31722222 90 24 56699 27 44.92777778 81 21 65911 28 44.69583333 55 27 56316 29 29.69111111 34 21 26982 30 52.26388889 38 30 54628 31 52.61138889 53 30 96750 32 35.96777778 48 33 53009 33 56.67500000 63 30 64664 34 17.42527778 25 20 36990 35 67.67361111 56 27 85224 36 46.45972222 37 25 37048 37 73.48000000 83 30 59635 38 33.89555556 50 20 42051 39 22.49000000 26 8 26998 40 58.27638889 108 24 63717 41 62.27916667 55 25 55071 42 32.21416667 41 25 40001 43 38.38638889 49 21 54506 44 22.52944444 31 21 35838 45 25.86805556 49 21 50838 46 84.93222222 96 26 86997 47 21.88888889 42 26 33032 48 44.12083333 55 30 61704 49 61.59583333 70 34 117986 50 36.41888889 39 30 56733 51 35.75944444 53 18 55064 52 6.71888889 24 4 5950 53 71.57277778 209 31 84607 54 18.06361111 17 18 32551 55 27.24055556 58 14 31701 56 48.21861111 27 20 71170 57 50.01166667 58 36 101773 58 54.79611111 114 24 101653 59 58.90555556 75 26 81493 60 39.32833333 51 22 55901 61 68.08527778 86 31 109104 62 57.46638889 77 21 114425 63 40.47111111 62 31 36311 64 47.39861111 60 26 70027 65 39.46222222 39 24 73713 66 31.89444444 35 15 40671 67 31.51694444 86 19 89041 68 40.35694444 102 28 57231 69 41.94416667 49 24 68608 70 25.50333333 35 18 59155 71 33.00194444 33 25 55827 72 19.29750000 28 20 22618 73 35.17500000 44 25 58425 74 40.53000000 37 24 65724 75 27.33138889 33 23 56979 76 53.03500000 45 25 72369 77 55.22138889 57 20 79194 78 29.49805556 58 23 202316 79 24.81055556 36 22 44970 80 33.43388889 42 25 49319 81 27.44194444 30 18 36252 82 76.37583333 67 30 75741 83 36.88833333 53 22 38417 84 37.56972222 59 25 64102 85 22.48694444 25 8 56622 86 30.34361111 39 21 15430 87 26.84277778 36 22 72571 88 62.83083333 114 24 67271 89 47.57944444 54 30 43460 90 32.72638889 70 27 99501 91 37.10027778 51 24 28340 92 42.27583333 49 25 76013 93 31.11222222 42 21 37361 94 47.11472222 51 24 48204 95 52.07861111 51 24 76168 96 36.25916667 27 20 85168 97 39.53861111 29 20 125410 98 52.71222222 54 24 123328 99 56.00083333 92 40 83038 100 68.56500000 72 22 120087 101 43.31861111 63 31 91939 102 50.71694444 41 26 103646 103 29.54194444 111 20 29467 104 12.02416667 14 19 43750 105 35.41472222 45 15 34497 106 35.53611111 91 21 66477 107 41.39055556 29 22 71181 108 52.12583333 64 24 74482 109 20.58666667 32 19 174949 110 26.11277778 65 24 46765 111 49.06250000 42 23 90257 112 39.42583333 55 27 51370 113 6.37166667 10 1 1168 114 34.97972222 53 24 51360 115 17.18250000 25 11 25162 116 25.35833333 33 27 21067 117 70.86111111 66 22 58233 118 5.84833333 16 0 855 119 46.97027778 35 17 85903 120 8.72611111 19 8 14116 121 52.41694444 76 24 57637 122 38.20666667 35 31 94137 123 21.43500000 46 24 62147 124 20.71305556 29 20 62832 125 10.61500000 34 8 8773 126 25.26694444 25 22 63785 127 53.95111111 48 33 65196 128 37.57250000 38 33 73087 129 67.85333333 50 31 72631 130 56.04111111 65 33 86281 131 71.22277778 72 35 162365 132 38.65111111 23 21 56530 133 21.24166667 29 20 35606 134 52.63944444 194 24 70111 135 77.87055556 114 29 92046 136 14.16638889 15 20 63989 137 70.35388889 86 27 104911 138 28.67750000 50 24 43448 139 46.68305556 33 26 60029 140 35.76888889 50 26 38650 141 21.04055556 72 12 47261 142 69.23111111 81 21 73586 143 42.32388889 54 24 83042 144 48.12777778 63 21 37238 145 54.77694444 69 30 63958 146 18.75194444 39 32 78956 147 38.72472222 49 24 99518 148 51.49055556 67 29 111436 149 0.00000000 0 0 0 150 4.08000000 10 0 6023 151 0.02722222 1 0 0 152 0.12638889 2 0 0 153 0.00000000 0 0 0 154 0.00000000 0 0 0 155 38.30138889 58 20 42564 156 51.46888889 72 27 38885 157 0.00000000 0 0 0 158 0.05638889 4 0 0 159 1.99972222 5 0 1644 160 12.96111111 20 5 6179 161 4.87416667 5 1 3926 162 20.43527778 27 23 23238 163 0.26916667 2 0 0 164 29.29916667 33 16 49288 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `#logins` -0.0992742 0.2469667 `otaal#peer_reviews` `totaal#karakterscompendium` 0.8049378 0.0001331 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -30.171 -6.711 0.099 5.888 37.557 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -9.927e-02 2.355e+00 -0.042 0.966 `#logins` 2.470e-01 3.427e-02 7.206 2.14e-11 *** `otaal#peer_reviews` 8.049e-01 1.359e-01 5.921 1.89e-08 *** `totaal#karakterscompendium` 1.331e-04 3.291e-05 4.045 8.13e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 11.05 on 160 degrees of freedom Multiple R-squared: 0.6786, Adjusted R-squared: 0.6726 F-statistic: 112.6 on 3 and 160 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,] 0.8007618 3.984765e-01 1.992382e-01 [2,] 0.7872238 4.255523e-01 2.127762e-01 [3,] 0.7282222 5.435556e-01 2.717778e-01 [4,] 0.8415322 3.169357e-01 1.584678e-01 [5,] 0.7889459 4.221081e-01 2.110541e-01 [6,] 0.7506922 4.986156e-01 2.493078e-01 [7,] 0.6682996 6.634009e-01 3.317004e-01 [8,] 0.8597866 2.804268e-01 1.402134e-01 [9,] 0.8243343 3.513313e-01 1.756657e-01 [10,] 0.7659645 4.680711e-01 2.340355e-01 [11,] 0.7015701 5.968598e-01 2.984299e-01 [12,] 0.6538600 6.922801e-01 3.461400e-01 [13,] 0.6084040 7.831920e-01 3.915960e-01 [14,] 0.5336196 9.327608e-01 4.663804e-01 [15,] 0.4594880 9.189761e-01 5.405120e-01 [16,] 0.9594478 8.110431e-02 4.055216e-02 [17,] 0.9480792 1.038417e-01 5.192084e-02 [18,] 0.9383359 1.233283e-01 6.166414e-02 [19,] 0.9284205 1.431589e-01 7.157946e-02 [20,] 0.9263289 1.473422e-01 7.367109e-02 [21,] 0.9055216 1.889567e-01 9.447837e-02 [22,] 0.8807678 2.384643e-01 1.192322e-01 [23,] 0.8570528 2.858944e-01 1.429472e-01 [24,] 0.8761479 2.477041e-01 1.238521e-01 [25,] 0.8438760 3.122479e-01 1.561240e-01 [26,] 0.8192973 3.614053e-01 1.807027e-01 [27,] 0.8037497 3.925005e-01 1.962503e-01 [28,] 0.7789852 4.420295e-01 2.210148e-01 [29,] 0.8371695 3.256611e-01 1.628305e-01 [30,] 0.8637167 2.725665e-01 1.362833e-01 [31,] 0.9138818 1.722363e-01 8.611817e-02 [32,] 0.8906896 2.186208e-01 1.093104e-01 [33,] 0.8728672 2.542657e-01 1.271328e-01 [34,] 0.8461643 3.076714e-01 1.538357e-01 [35,] 0.9060903 1.878195e-01 9.390975e-02 [36,] 0.8833913 2.332175e-01 1.166087e-01 [37,] 0.8566030 2.867939e-01 1.433970e-01 [38,] 0.8332065 3.335870e-01 1.667935e-01 [39,] 0.8288706 3.422587e-01 1.711294e-01 [40,] 0.9172559 1.654881e-01 8.274407e-02 [41,] 0.9178814 1.642373e-01 8.211863e-02 [42,] 0.8980177 2.039645e-01 1.019823e-01 [43,] 0.8826810 2.346380e-01 1.173190e-01 [44,] 0.8596143 2.807713e-01 1.403857e-01 [45,] 0.8318064 3.363871e-01 1.681936e-01 [46,] 0.8004504 3.990992e-01 1.995496e-01 [47,] 0.8862269 2.275463e-01 1.137731e-01 [48,] 0.8649136 2.701729e-01 1.350864e-01 [49,] 0.8377646 3.244708e-01 1.622354e-01 [50,] 0.8518889 2.962221e-01 1.481111e-01 [51,] 0.8460840 3.078319e-01 1.539160e-01 [52,] 0.8433181 3.133638e-01 1.566819e-01 [53,] 0.8268794 3.462411e-01 1.731206e-01 [54,] 0.7955818 4.088364e-01 2.044182e-01 [55,] 0.7712036 4.575928e-01 2.287964e-01 [56,] 0.7480856 5.038288e-01 2.519144e-01 [57,] 0.7134949 5.730102e-01 2.865051e-01 [58,] 0.6740734 6.518532e-01 3.259266e-01 [59,] 0.6328796 7.342407e-01 3.671204e-01 [60,] 0.5998846 8.002308e-01 4.001154e-01 [61,] 0.6870012 6.259976e-01 3.129988e-01 [62,] 0.7090145 5.819709e-01 2.909855e-01 [63,] 0.6690451 6.619098e-01 3.309549e-01 [64,] 0.6412071 7.175858e-01 3.587929e-01 [65,] 0.6004628 7.990744e-01 3.995372e-01 [66,] 0.5678232 8.643537e-01 4.321768e-01 [67,] 0.5275720 9.448561e-01 4.724280e-01 [68,] 0.4848870 9.697740e-01 5.151130e-01 [69,] 0.4590632 9.181264e-01 5.409368e-01 [70,] 0.4623467 9.246935e-01 5.376533e-01 [71,] 0.4855661 9.711321e-01 5.144339e-01 [72,] 0.8169812 3.660375e-01 1.830188e-01 [73,] 0.8004838 3.990324e-01 1.995162e-01 [74,] 0.7705504 4.588991e-01 2.294496e-01 [75,] 0.7347985 5.304029e-01 2.652015e-01 [76,] 0.8684232 2.631536e-01 1.315768e-01 [77,] 0.8429668 3.140664e-01 1.570332e-01 [78,] 0.8210903 3.578194e-01 1.789097e-01 [79,] 0.7913613 4.172775e-01 2.086387e-01 [80,] 0.7583694 4.832612e-01 2.416306e-01 [81,] 0.7468308 5.063385e-01 2.531692e-01 [82,] 0.7238556 5.522888e-01 2.761444e-01 [83,] 0.6917531 6.164937e-01 3.082469e-01 [84,] 0.7663647 4.672706e-01 2.336353e-01 [85,] 0.7310267 5.379466e-01 2.689733e-01 [86,] 0.6917965 6.164070e-01 3.082035e-01 [87,] 0.6504763 6.990475e-01 3.495237e-01 [88,] 0.6369885 7.260229e-01 3.630115e-01 [89,] 0.6311803 7.376393e-01 3.688197e-01 [90,] 0.5886747 8.226506e-01 4.113253e-01 [91,] 0.5433124 9.133751e-01 4.566876e-01 [92,] 0.5021486 9.957029e-01 4.978514e-01 [93,] 0.4862614 9.725229e-01 5.137386e-01 [94,] 0.5556986 8.886028e-01 4.443014e-01 [95,] 0.5377550 9.244901e-01 4.622450e-01 [96,] 0.5073234 9.853533e-01 4.926766e-01 [97,] 0.5796253 8.407495e-01 4.203747e-01 [98,] 0.5893772 8.212456e-01 4.106228e-01 [99,] 0.5651922 8.696156e-01 4.348078e-01 [100,] 0.5768781 8.462439e-01 4.231219e-01 [101,] 0.5522788 8.954424e-01 4.477212e-01 [102,] 0.5260358 9.479284e-01 4.739642e-01 [103,] 0.7419790 5.160421e-01 2.580210e-01 [104,] 0.7712424 4.575152e-01 2.287576e-01 [105,] 0.7484764 5.030471e-01 2.515236e-01 [106,] 0.7085747 5.828506e-01 2.914253e-01 [107,] 0.6676576 6.646847e-01 3.323424e-01 [108,] 0.6264914 7.470171e-01 3.735086e-01 [109,] 0.5783407 8.433186e-01 4.216593e-01 [110,] 0.5415942 9.168117e-01 4.584058e-01 [111,] 0.8096586 3.806828e-01 1.903414e-01 [112,] 0.7737083 4.525833e-01 2.262917e-01 [113,] 0.7863689 4.272623e-01 2.136311e-01 [114,] 0.7510043 4.979913e-01 2.489957e-01 [115,] 0.7279152 5.441696e-01 2.720848e-01 [116,] 0.7053563 5.892874e-01 2.946437e-01 [117,] 0.7709307 4.581386e-01 2.290693e-01 [118,] 0.7749412 4.501175e-01 2.250588e-01 [119,] 0.7396951 5.206098e-01 2.603049e-01 [120,] 0.7184963 5.630073e-01 2.815037e-01 [121,] 0.6878719 6.242563e-01 3.121281e-01 [122,] 0.6709411 6.581177e-01 3.290589e-01 [123,] 0.7941119 4.117762e-01 2.058881e-01 [124,] 0.7520418 4.959165e-01 2.479582e-01 [125,] 0.7038656 5.922689e-01 2.961344e-01 [126,] 0.6850629 6.298741e-01 3.149371e-01 [127,] 0.6443181 7.113638e-01 3.556819e-01 [128,] 0.9835198 3.296041e-02 1.648020e-02 [129,] 0.9774269 4.514615e-02 2.257308e-02 [130,] 0.9712104 5.757912e-02 2.878956e-02 [131,] 0.9711736 5.765286e-02 2.882643e-02 [132,] 0.9688619 6.227620e-02 3.113810e-02 [133,] 0.9884476 2.310484e-02 1.155242e-02 [134,] 0.9815146 3.697083e-02 1.848541e-02 [135,] 1.0000000 9.627439e-08 4.813720e-08 [136,] 0.9999999 1.153924e-07 5.769619e-08 [137,] 0.9999998 3.865891e-07 1.932946e-07 [138,] 0.9999994 1.250310e-06 6.251548e-07 [139,] 0.9999993 1.470600e-06 7.353001e-07 [140,] 1.0000000 3.795758e-10 1.897879e-10 [141,] 1.0000000 2.182661e-09 1.091331e-09 [142,] 1.0000000 3.547968e-09 1.773984e-09 [143,] 1.0000000 2.600605e-08 1.300303e-08 [144,] 0.9999999 1.001686e-07 5.008432e-08 [145,] 0.9999996 7.701908e-07 3.850954e-07 [146,] 0.9999973 5.337904e-06 2.668952e-06 [147,] 0.9999820 3.603107e-05 1.801554e-05 [148,] 0.9998862 2.275887e-04 1.137943e-04 [149,] 0.9999637 7.258015e-05 3.629007e-05 [150,] 0.9996426 7.148949e-04 3.574474e-04 [151,] 0.9971417 5.716592e-03 2.858296e-03 > postscript(file="/var/fisher/rcomp/tmp/19akb1352132022.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/2nxaq1352132022.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/3fmut1352132022.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/414gk1352132022.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/51dep1352132022.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 = 164 Frequency = 1 1 2 3 4 5 6 2.47610574 -11.05587780 -5.26283368 -6.80184660 0.15446291 -13.86326904 7 8 9 10 11 12 37.35794595 -12.27978998 -2.52212534 7.83537579 -2.09735353 -20.74837225 13 14 15 16 17 18 -7.32105555 5.98953834 -2.61776113 3.04977934 6.61103883 2.49686809 19 20 21 22 23 24 -3.38061089 -1.86633448 1.90846596 37.55703450 3.84965065 -11.29640467 25 26 27 28 29 30 -8.12974644 -8.67646253 -0.65464254 1.98215185 0.89813276 11.55852456 31 32 33 34 35 36 2.59448245 -9.40655478 8.45953312 -9.67227079 20.86489387 12.36616365 37 38 39 40 41 42 20.99463140 -0.04985177 6.13481707 3.90310744 21.34108819 -3.26034526 43 44 45 46 47 48 2.22507143 -6.70149436 -9.80499853 28.81376371 -13.70985378 -1.72488165 49 50 51 52 53 54 1.33392600 -4.81364779 0.95079593 -3.12081892 -16.15946202 -4.85743381 55 56 57 58 59 60 -2.47322495 16.07728134 -6.73833345 -6.10879571 8.70605871 1.68245018 61 62 63 64 65 66 7.46903846 6.41392667 -4.52813629 2.42990345 0.79903117 5.86192431 67 68 69 70 71 72 -16.76936812 -14.89090867 1.49085743 -5.40448558 -2.60350140 -6.62782947 73 74 75 76 77 78 -3.49291041 3.42419271 -6.81752901 12.26397668 14.60294918 -30.17146695 79 80 81 82 83 84 -7.67575457 -3.52794905 0.81767647 25.69799227 1.07588777 -5.55837852 85 86 87 88 89 90 2.43534927 1.85353609 -9.31762099 6.50266344 4.40923400 -19.44033523 91 92 93 94 95 96 1.51328304 0.03187465 -1.03808324 8.88354442 10.12502416 2.25450250 97 98 99 100 101 102 -0.31677333 3.74006338 -9.87188841 17.18874003 -9.33248697 5.96543310 103 104 105 106 107 108 -17.79331993 -12.45166342 7.73438312 -12.59131877 7.14395251 7.18611024 109 110 111 112 113 114 -25.79903083 -15.38438209 8.26110324 -2.62946467 3.04085866 -4.16549778 115 116 117 118 119 120 -1.09613181 -7.22993403 29.20030507 1.88232783 13.30685458 -4.18552621 121 122 123 124 125 126 6.75593203 -7.82194953 -17.41735749 -10.81230029 -5.28990773 -7.00727828 127 128 129 130 131 132 6.95451420 -8.00483525 20.98297366 2.03936489 3.75451837 8.64150405 133 134 135 136 137 138 -6.65951841 -23.82410495 14.21978898 -14.05544665 13.51554928 -8.67361936 139 140 141 142 143 144 9.71332547 -2.55342357 -12.59214187 22.62703830 -1.28562602 10.80754500 145 146 147 148 149 150 5.17365617 -27.04866767 -5.84315098 -3.13386370 0.09927421 0.90785975 151 152 153 154 155 156 -0.12047025 -0.26827027 0.09927421 0.09927421 2.31196043 6.87708967 157 158 159 160 161 162 0.09927421 -0.83220364 0.64532305 3.27384903 2.41106276 -7.74042937 163 164 -0.12549249 1.80859589 > postscript(file="/var/fisher/rcomp/tmp/651t61352132022.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 = 164 Frequency = 1 lag(myerror, k = 1) myerror 0 2.47610574 NA 1 -11.05587780 2.47610574 2 -5.26283368 -11.05587780 3 -6.80184660 -5.26283368 4 0.15446291 -6.80184660 5 -13.86326904 0.15446291 6 37.35794595 -13.86326904 7 -12.27978998 37.35794595 8 -2.52212534 -12.27978998 9 7.83537579 -2.52212534 10 -2.09735353 7.83537579 11 -20.74837225 -2.09735353 12 -7.32105555 -20.74837225 13 5.98953834 -7.32105555 14 -2.61776113 5.98953834 15 3.04977934 -2.61776113 16 6.61103883 3.04977934 17 2.49686809 6.61103883 18 -3.38061089 2.49686809 19 -1.86633448 -3.38061089 20 1.90846596 -1.86633448 21 37.55703450 1.90846596 22 3.84965065 37.55703450 23 -11.29640467 3.84965065 24 -8.12974644 -11.29640467 25 -8.67646253 -8.12974644 26 -0.65464254 -8.67646253 27 1.98215185 -0.65464254 28 0.89813276 1.98215185 29 11.55852456 0.89813276 30 2.59448245 11.55852456 31 -9.40655478 2.59448245 32 8.45953312 -9.40655478 33 -9.67227079 8.45953312 34 20.86489387 -9.67227079 35 12.36616365 20.86489387 36 20.99463140 12.36616365 37 -0.04985177 20.99463140 38 6.13481707 -0.04985177 39 3.90310744 6.13481707 40 21.34108819 3.90310744 41 -3.26034526 21.34108819 42 2.22507143 -3.26034526 43 -6.70149436 2.22507143 44 -9.80499853 -6.70149436 45 28.81376371 -9.80499853 46 -13.70985378 28.81376371 47 -1.72488165 -13.70985378 48 1.33392600 -1.72488165 49 -4.81364779 1.33392600 50 0.95079593 -4.81364779 51 -3.12081892 0.95079593 52 -16.15946202 -3.12081892 53 -4.85743381 -16.15946202 54 -2.47322495 -4.85743381 55 16.07728134 -2.47322495 56 -6.73833345 16.07728134 57 -6.10879571 -6.73833345 58 8.70605871 -6.10879571 59 1.68245018 8.70605871 60 7.46903846 1.68245018 61 6.41392667 7.46903846 62 -4.52813629 6.41392667 63 2.42990345 -4.52813629 64 0.79903117 2.42990345 65 5.86192431 0.79903117 66 -16.76936812 5.86192431 67 -14.89090867 -16.76936812 68 1.49085743 -14.89090867 69 -5.40448558 1.49085743 70 -2.60350140 -5.40448558 71 -6.62782947 -2.60350140 72 -3.49291041 -6.62782947 73 3.42419271 -3.49291041 74 -6.81752901 3.42419271 75 12.26397668 -6.81752901 76 14.60294918 12.26397668 77 -30.17146695 14.60294918 78 -7.67575457 -30.17146695 79 -3.52794905 -7.67575457 80 0.81767647 -3.52794905 81 25.69799227 0.81767647 82 1.07588777 25.69799227 83 -5.55837852 1.07588777 84 2.43534927 -5.55837852 85 1.85353609 2.43534927 86 -9.31762099 1.85353609 87 6.50266344 -9.31762099 88 4.40923400 6.50266344 89 -19.44033523 4.40923400 90 1.51328304 -19.44033523 91 0.03187465 1.51328304 92 -1.03808324 0.03187465 93 8.88354442 -1.03808324 94 10.12502416 8.88354442 95 2.25450250 10.12502416 96 -0.31677333 2.25450250 97 3.74006338 -0.31677333 98 -9.87188841 3.74006338 99 17.18874003 -9.87188841 100 -9.33248697 17.18874003 101 5.96543310 -9.33248697 102 -17.79331993 5.96543310 103 -12.45166342 -17.79331993 104 7.73438312 -12.45166342 105 -12.59131877 7.73438312 106 7.14395251 -12.59131877 107 7.18611024 7.14395251 108 -25.79903083 7.18611024 109 -15.38438209 -25.79903083 110 8.26110324 -15.38438209 111 -2.62946467 8.26110324 112 3.04085866 -2.62946467 113 -4.16549778 3.04085866 114 -1.09613181 -4.16549778 115 -7.22993403 -1.09613181 116 29.20030507 -7.22993403 117 1.88232783 29.20030507 118 13.30685458 1.88232783 119 -4.18552621 13.30685458 120 6.75593203 -4.18552621 121 -7.82194953 6.75593203 122 -17.41735749 -7.82194953 123 -10.81230029 -17.41735749 124 -5.28990773 -10.81230029 125 -7.00727828 -5.28990773 126 6.95451420 -7.00727828 127 -8.00483525 6.95451420 128 20.98297366 -8.00483525 129 2.03936489 20.98297366 130 3.75451837 2.03936489 131 8.64150405 3.75451837 132 -6.65951841 8.64150405 133 -23.82410495 -6.65951841 134 14.21978898 -23.82410495 135 -14.05544665 14.21978898 136 13.51554928 -14.05544665 137 -8.67361936 13.51554928 138 9.71332547 -8.67361936 139 -2.55342357 9.71332547 140 -12.59214187 -2.55342357 141 22.62703830 -12.59214187 142 -1.28562602 22.62703830 143 10.80754500 -1.28562602 144 5.17365617 10.80754500 145 -27.04866767 5.17365617 146 -5.84315098 -27.04866767 147 -3.13386370 -5.84315098 148 0.09927421 -3.13386370 149 0.90785975 0.09927421 150 -0.12047025 0.90785975 151 -0.26827027 -0.12047025 152 0.09927421 -0.26827027 153 0.09927421 0.09927421 154 2.31196043 0.09927421 155 6.87708967 2.31196043 156 0.09927421 6.87708967 157 -0.83220364 0.09927421 158 0.64532305 -0.83220364 159 3.27384903 0.64532305 160 2.41106276 3.27384903 161 -7.74042937 2.41106276 162 -0.12549249 -7.74042937 163 1.80859589 -0.12549249 164 NA 1.80859589 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -11.05587780 2.47610574 [2,] -5.26283368 -11.05587780 [3,] -6.80184660 -5.26283368 [4,] 0.15446291 -6.80184660 [5,] -13.86326904 0.15446291 [6,] 37.35794595 -13.86326904 [7,] -12.27978998 37.35794595 [8,] -2.52212534 -12.27978998 [9,] 7.83537579 -2.52212534 [10,] -2.09735353 7.83537579 [11,] -20.74837225 -2.09735353 [12,] -7.32105555 -20.74837225 [13,] 5.98953834 -7.32105555 [14,] -2.61776113 5.98953834 [15,] 3.04977934 -2.61776113 [16,] 6.61103883 3.04977934 [17,] 2.49686809 6.61103883 [18,] -3.38061089 2.49686809 [19,] -1.86633448 -3.38061089 [20,] 1.90846596 -1.86633448 [21,] 37.55703450 1.90846596 [22,] 3.84965065 37.55703450 [23,] -11.29640467 3.84965065 [24,] -8.12974644 -11.29640467 [25,] -8.67646253 -8.12974644 [26,] -0.65464254 -8.67646253 [27,] 1.98215185 -0.65464254 [28,] 0.89813276 1.98215185 [29,] 11.55852456 0.89813276 [30,] 2.59448245 11.55852456 [31,] -9.40655478 2.59448245 [32,] 8.45953312 -9.40655478 [33,] -9.67227079 8.45953312 [34,] 20.86489387 -9.67227079 [35,] 12.36616365 20.86489387 [36,] 20.99463140 12.36616365 [37,] -0.04985177 20.99463140 [38,] 6.13481707 -0.04985177 [39,] 3.90310744 6.13481707 [40,] 21.34108819 3.90310744 [41,] -3.26034526 21.34108819 [42,] 2.22507143 -3.26034526 [43,] -6.70149436 2.22507143 [44,] -9.80499853 -6.70149436 [45,] 28.81376371 -9.80499853 [46,] -13.70985378 28.81376371 [47,] -1.72488165 -13.70985378 [48,] 1.33392600 -1.72488165 [49,] -4.81364779 1.33392600 [50,] 0.95079593 -4.81364779 [51,] -3.12081892 0.95079593 [52,] -16.15946202 -3.12081892 [53,] -4.85743381 -16.15946202 [54,] -2.47322495 -4.85743381 [55,] 16.07728134 -2.47322495 [56,] -6.73833345 16.07728134 [57,] -6.10879571 -6.73833345 [58,] 8.70605871 -6.10879571 [59,] 1.68245018 8.70605871 [60,] 7.46903846 1.68245018 [61,] 6.41392667 7.46903846 [62,] -4.52813629 6.41392667 [63,] 2.42990345 -4.52813629 [64,] 0.79903117 2.42990345 [65,] 5.86192431 0.79903117 [66,] -16.76936812 5.86192431 [67,] -14.89090867 -16.76936812 [68,] 1.49085743 -14.89090867 [69,] -5.40448558 1.49085743 [70,] -2.60350140 -5.40448558 [71,] -6.62782947 -2.60350140 [72,] -3.49291041 -6.62782947 [73,] 3.42419271 -3.49291041 [74,] -6.81752901 3.42419271 [75,] 12.26397668 -6.81752901 [76,] 14.60294918 12.26397668 [77,] -30.17146695 14.60294918 [78,] -7.67575457 -30.17146695 [79,] -3.52794905 -7.67575457 [80,] 0.81767647 -3.52794905 [81,] 25.69799227 0.81767647 [82,] 1.07588777 25.69799227 [83,] -5.55837852 1.07588777 [84,] 2.43534927 -5.55837852 [85,] 1.85353609 2.43534927 [86,] -9.31762099 1.85353609 [87,] 6.50266344 -9.31762099 [88,] 4.40923400 6.50266344 [89,] -19.44033523 4.40923400 [90,] 1.51328304 -19.44033523 [91,] 0.03187465 1.51328304 [92,] -1.03808324 0.03187465 [93,] 8.88354442 -1.03808324 [94,] 10.12502416 8.88354442 [95,] 2.25450250 10.12502416 [96,] -0.31677333 2.25450250 [97,] 3.74006338 -0.31677333 [98,] -9.87188841 3.74006338 [99,] 17.18874003 -9.87188841 [100,] -9.33248697 17.18874003 [101,] 5.96543310 -9.33248697 [102,] -17.79331993 5.96543310 [103,] -12.45166342 -17.79331993 [104,] 7.73438312 -12.45166342 [105,] -12.59131877 7.73438312 [106,] 7.14395251 -12.59131877 [107,] 7.18611024 7.14395251 [108,] -25.79903083 7.18611024 [109,] -15.38438209 -25.79903083 [110,] 8.26110324 -15.38438209 [111,] -2.62946467 8.26110324 [112,] 3.04085866 -2.62946467 [113,] -4.16549778 3.04085866 [114,] -1.09613181 -4.16549778 [115,] -7.22993403 -1.09613181 [116,] 29.20030507 -7.22993403 [117,] 1.88232783 29.20030507 [118,] 13.30685458 1.88232783 [119,] -4.18552621 13.30685458 [120,] 6.75593203 -4.18552621 [121,] -7.82194953 6.75593203 [122,] -17.41735749 -7.82194953 [123,] -10.81230029 -17.41735749 [124,] -5.28990773 -10.81230029 [125,] -7.00727828 -5.28990773 [126,] 6.95451420 -7.00727828 [127,] -8.00483525 6.95451420 [128,] 20.98297366 -8.00483525 [129,] 2.03936489 20.98297366 [130,] 3.75451837 2.03936489 [131,] 8.64150405 3.75451837 [132,] -6.65951841 8.64150405 [133,] -23.82410495 -6.65951841 [134,] 14.21978898 -23.82410495 [135,] -14.05544665 14.21978898 [136,] 13.51554928 -14.05544665 [137,] -8.67361936 13.51554928 [138,] 9.71332547 -8.67361936 [139,] -2.55342357 9.71332547 [140,] -12.59214187 -2.55342357 [141,] 22.62703830 -12.59214187 [142,] -1.28562602 22.62703830 [143,] 10.80754500 -1.28562602 [144,] 5.17365617 10.80754500 [145,] -27.04866767 5.17365617 [146,] -5.84315098 -27.04866767 [147,] -3.13386370 -5.84315098 [148,] 0.09927421 -3.13386370 [149,] 0.90785975 0.09927421 [150,] -0.12047025 0.90785975 [151,] -0.26827027 -0.12047025 [152,] 0.09927421 -0.26827027 [153,] 0.09927421 0.09927421 [154,] 2.31196043 0.09927421 [155,] 6.87708967 2.31196043 [156,] 0.09927421 6.87708967 [157,] -0.83220364 0.09927421 [158,] 0.64532305 -0.83220364 [159,] 3.27384903 0.64532305 [160,] 2.41106276 3.27384903 [161,] -7.74042937 2.41106276 [162,] -0.12549249 -7.74042937 [163,] 1.80859589 -0.12549249 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -11.05587780 2.47610574 2 -5.26283368 -11.05587780 3 -6.80184660 -5.26283368 4 0.15446291 -6.80184660 5 -13.86326904 0.15446291 6 37.35794595 -13.86326904 7 -12.27978998 37.35794595 8 -2.52212534 -12.27978998 9 7.83537579 -2.52212534 10 -2.09735353 7.83537579 11 -20.74837225 -2.09735353 12 -7.32105555 -20.74837225 13 5.98953834 -7.32105555 14 -2.61776113 5.98953834 15 3.04977934 -2.61776113 16 6.61103883 3.04977934 17 2.49686809 6.61103883 18 -3.38061089 2.49686809 19 -1.86633448 -3.38061089 20 1.90846596 -1.86633448 21 37.55703450 1.90846596 22 3.84965065 37.55703450 23 -11.29640467 3.84965065 24 -8.12974644 -11.29640467 25 -8.67646253 -8.12974644 26 -0.65464254 -8.67646253 27 1.98215185 -0.65464254 28 0.89813276 1.98215185 29 11.55852456 0.89813276 30 2.59448245 11.55852456 31 -9.40655478 2.59448245 32 8.45953312 -9.40655478 33 -9.67227079 8.45953312 34 20.86489387 -9.67227079 35 12.36616365 20.86489387 36 20.99463140 12.36616365 37 -0.04985177 20.99463140 38 6.13481707 -0.04985177 39 3.90310744 6.13481707 40 21.34108819 3.90310744 41 -3.26034526 21.34108819 42 2.22507143 -3.26034526 43 -6.70149436 2.22507143 44 -9.80499853 -6.70149436 45 28.81376371 -9.80499853 46 -13.70985378 28.81376371 47 -1.72488165 -13.70985378 48 1.33392600 -1.72488165 49 -4.81364779 1.33392600 50 0.95079593 -4.81364779 51 -3.12081892 0.95079593 52 -16.15946202 -3.12081892 53 -4.85743381 -16.15946202 54 -2.47322495 -4.85743381 55 16.07728134 -2.47322495 56 -6.73833345 16.07728134 57 -6.10879571 -6.73833345 58 8.70605871 -6.10879571 59 1.68245018 8.70605871 60 7.46903846 1.68245018 61 6.41392667 7.46903846 62 -4.52813629 6.41392667 63 2.42990345 -4.52813629 64 0.79903117 2.42990345 65 5.86192431 0.79903117 66 -16.76936812 5.86192431 67 -14.89090867 -16.76936812 68 1.49085743 -14.89090867 69 -5.40448558 1.49085743 70 -2.60350140 -5.40448558 71 -6.62782947 -2.60350140 72 -3.49291041 -6.62782947 73 3.42419271 -3.49291041 74 -6.81752901 3.42419271 75 12.26397668 -6.81752901 76 14.60294918 12.26397668 77 -30.17146695 14.60294918 78 -7.67575457 -30.17146695 79 -3.52794905 -7.67575457 80 0.81767647 -3.52794905 81 25.69799227 0.81767647 82 1.07588777 25.69799227 83 -5.55837852 1.07588777 84 2.43534927 -5.55837852 85 1.85353609 2.43534927 86 -9.31762099 1.85353609 87 6.50266344 -9.31762099 88 4.40923400 6.50266344 89 -19.44033523 4.40923400 90 1.51328304 -19.44033523 91 0.03187465 1.51328304 92 -1.03808324 0.03187465 93 8.88354442 -1.03808324 94 10.12502416 8.88354442 95 2.25450250 10.12502416 96 -0.31677333 2.25450250 97 3.74006338 -0.31677333 98 -9.87188841 3.74006338 99 17.18874003 -9.87188841 100 -9.33248697 17.18874003 101 5.96543310 -9.33248697 102 -17.79331993 5.96543310 103 -12.45166342 -17.79331993 104 7.73438312 -12.45166342 105 -12.59131877 7.73438312 106 7.14395251 -12.59131877 107 7.18611024 7.14395251 108 -25.79903083 7.18611024 109 -15.38438209 -25.79903083 110 8.26110324 -15.38438209 111 -2.62946467 8.26110324 112 3.04085866 -2.62946467 113 -4.16549778 3.04085866 114 -1.09613181 -4.16549778 115 -7.22993403 -1.09613181 116 29.20030507 -7.22993403 117 1.88232783 29.20030507 118 13.30685458 1.88232783 119 -4.18552621 13.30685458 120 6.75593203 -4.18552621 121 -7.82194953 6.75593203 122 -17.41735749 -7.82194953 123 -10.81230029 -17.41735749 124 -5.28990773 -10.81230029 125 -7.00727828 -5.28990773 126 6.95451420 -7.00727828 127 -8.00483525 6.95451420 128 20.98297366 -8.00483525 129 2.03936489 20.98297366 130 3.75451837 2.03936489 131 8.64150405 3.75451837 132 -6.65951841 8.64150405 133 -23.82410495 -6.65951841 134 14.21978898 -23.82410495 135 -14.05544665 14.21978898 136 13.51554928 -14.05544665 137 -8.67361936 13.51554928 138 9.71332547 -8.67361936 139 -2.55342357 9.71332547 140 -12.59214187 -2.55342357 141 22.62703830 -12.59214187 142 -1.28562602 22.62703830 143 10.80754500 -1.28562602 144 5.17365617 10.80754500 145 -27.04866767 5.17365617 146 -5.84315098 -27.04866767 147 -3.13386370 -5.84315098 148 0.09927421 -3.13386370 149 0.90785975 0.09927421 150 -0.12047025 0.90785975 151 -0.26827027 -0.12047025 152 0.09927421 -0.26827027 153 0.09927421 0.09927421 154 2.31196043 0.09927421 155 6.87708967 2.31196043 156 0.09927421 6.87708967 157 -0.83220364 0.09927421 158 0.64532305 -0.83220364 159 3.27384903 0.64532305 160 2.41106276 3.27384903 161 -7.74042937 2.41106276 162 -0.12549249 -7.74042937 163 1.80859589 -0.12549249 > 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/7p2hd1352132022.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/8bl9t1352132022.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/9mspp1352132022.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/10796x1352132022.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='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/118xot1352132022.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/1262af1352132022.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/13idzo1352132022.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/fisher/rcomp/tmp/14t6tl1352132022.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/fisher/rcomp/tmp/15vnf01352132022.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/fisher/rcomp/tmp/16u6lz1352132022.tab") + } > > try(system("convert tmp/19akb1352132022.ps tmp/19akb1352132022.png",intern=TRUE)) character(0) > try(system("convert tmp/2nxaq1352132022.ps tmp/2nxaq1352132022.png",intern=TRUE)) character(0) > try(system("convert tmp/3fmut1352132022.ps tmp/3fmut1352132022.png",intern=TRUE)) character(0) > try(system("convert tmp/414gk1352132022.ps tmp/414gk1352132022.png",intern=TRUE)) character(0) > try(system("convert tmp/51dep1352132022.ps tmp/51dep1352132022.png",intern=TRUE)) character(0) > try(system("convert tmp/651t61352132022.ps tmp/651t61352132022.png",intern=TRUE)) character(0) > try(system("convert tmp/7p2hd1352132022.ps tmp/7p2hd1352132022.png",intern=TRUE)) character(0) > try(system("convert tmp/8bl9t1352132022.ps tmp/8bl9t1352132022.png",intern=TRUE)) character(0) > try(system("convert tmp/9mspp1352132022.ps tmp/9mspp1352132022.png",intern=TRUE)) character(0) > try(system("convert tmp/10796x1352132022.ps tmp/10796x1352132022.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.775 1.087 8.861