R version 2.9.0 (2009-04-17) Copyright (C) 2009 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(261 + ,1 + ,49 + ,17 + ,0.012825155 + ,99 + ,0 + ,39 + ,7 + ,0.005280946 + ,23 + ,0 + ,62 + ,6 + ,0.004526525 + ,533 + ,1 + ,31 + ,13 + ,0.009807472 + ,71 + ,0 + ,47 + ,13 + ,0.009807472 + ,305 + ,0 + ,59 + ,20 + ,0.015088418 + ,82 + ,0 + ,58 + ,16 + ,0.012070735 + ,40 + ,0 + ,41 + ,16 + ,0.012070735 + ,70 + ,0 + ,61 + ,12 + ,0.009053051 + ,214 + ,0 + ,49 + ,5 + ,0.003772105 + ,955 + ,1 + ,55 + ,19 + ,0.014333997 + ,283 + ,1 + ,54 + ,22 + ,0.01659726 + ,153 + ,1 + ,47 + ,14 + ,0.010561893 + ,435 + ,1 + ,43 + ,20 + ,0.015088418 + ,135 + ,0 + ,46 + ,18 + ,0.013579576 + ,1953 + ,1 + ,35 + ,1 + ,0.000754421 + ,55 + ,0 + ,32 + ,15 + ,0.011316314 + ,298 + ,0 + ,51 + ,3 + ,0.002263263 + ,94 + ,0 + ,53 + ,10 + ,0.007544209 + ,176 + ,0 + ,43 + ,12 + ,0.009053051 + ,26 + ,0 + ,54 + ,11 + ,0.00829863 + ,124 + ,0 + ,38 + ,16 + ,0.012070735 + ,21 + ,0 + ,56 + ,14 + ,0.010561893 + ,105 + ,0 + ,43 + ,8 + ,0.006035367 + ,17 + ,0 + ,44 + ,10 + ,0.007544209 + ,372 + ,0 + ,40 + ,22 + ,0.01659726 + ,170 + ,0 + ,31 + ,19 + ,0.014333997 + ,27 + ,0 + ,52 + ,11 + ,0.00829863 + ,73 + ,0 + ,38 + ,16 + ,0.012070735 + ,27 + ,0 + ,64 + ,6 + ,0.004526525 + ,911 + ,1 + ,55 + ,11 + ,0.00829863 + ,208 + ,0 + ,54 + ,21 + ,0.015842839 + ,383 + ,1 + ,26 + ,18 + ,0.013579576 + ,69 + ,0 + ,47 + ,20 + ,0.015088418 + ,247 + ,0 + ,39 + ,18 + ,0.013579576 + ,287 + ,0 + ,25 + ,3 + ,0.002263263 + ,127 + ,0 + ,30 + ,9 + ,0.006789788 + ,205 + ,0 + ,29 + ,17 + ,0.012825155 + ,1209 + ,1 + ,46 + ,1 + ,0.000754421 + ,127 + ,0 + ,43 + ,10 + ,0.007544209 + ,643 + ,1 + ,31 + ,12 + ,0.009053051 + ,116 + ,0 + ,59 + ,21 + ,0.015842839 + ,694 + ,1 + ,46 + ,15 + ,0.011316314 + ,70 + ,0 + ,39 + ,9 + ,0.006789788 + ,414 + ,1 + ,51 + ,20 + ,0.015088418 + ,1746 + ,1 + ,51 + ,9 + ,0.006789788 + ,346 + ,0 + ,27 + ,22 + ,0.01659726 + ,137 + ,0 + ,68 + ,11 + ,0.00829863 + ,198 + ,0 + ,45 + ,15 + ,0.011316314 + ,837 + ,1 + ,45 + ,4 + ,0.003017684 + ,338 + ,0 + ,50 + ,19 + ,0.014333997 + ,65 + ,0 + ,43 + ,14 + ,0.010561893 + ,65 + ,0 + ,30 + ,4 + ,0.003017684 + ,284 + ,1 + ,24 + ,12 + ,0.009053051 + ,184 + ,0 + ,53 + ,3 + ,0.002263263 + ,98 + ,0 + ,47 + ,7 + ,0.005280946 + ,843 + ,1 + ,47 + ,8 + ,0.006035367 + ,122 + ,0 + ,56 + ,8 + ,0.006035367 + ,344 + ,0 + ,43 + ,6 + ,0.004526525 + ,64 + ,0 + ,42 + ,2 + ,0.001508842 + ,70 + ,0 + ,60 + ,17 + ,0.012825155 + ,142 + ,0 + ,57 + ,2 + ,0.001508842 + ,219 + ,0 + ,55 + ,6 + ,0.004526525 + ,2744 + ,0 + ,45 + ,1 + ,0.000754421 + ,227 + ,0 + ,62 + ,3 + ,0.002263263 + ,12 + ,0 + ,60 + ,15 + ,0.011316314 + ,113 + ,0 + ,37 + ,10 + ,0.007544209 + ,141 + ,0 + ,57 + ,21 + ,0.015842839 + ,424 + ,1 + ,57 + ,10 + ,0.007544209 + ,128 + ,0 + ,46 + ,4 + ,0.003017684 + ,156 + ,0 + ,30 + ,14 + ,0.010561893 + ,48 + ,0 + ,63 + ,5 + ,0.003772105 + ,172 + ,0 + ,52 + ,22 + ,0.01659726 + ,1941 + ,1 + ,51 + ,7 + ,0.005280946 + ,1487 + ,1 + ,58 + ,3 + ,0.002263263 + ,18 + ,0 + ,59 + ,17 + ,0.012825155 + ,84 + ,0 + ,65 + ,22 + ,0.01659726 + ,118 + ,0 + ,65 + ,19 + ,0.014333997 + ,88 + ,0 + ,56 + ,11 + ,0.00829863 + ,1847 + ,1 + ,49 + ,4 + ,0.003017684 + ,284 + ,0 + ,42 + ,21 + ,0.015842839 + ,156 + ,0 + ,34 + ,13 + ,0.009807472 + ,315 + ,0 + ,54 + ,21 + ,0.015842839 + ,194 + ,0 + ,55 + ,2 + ,0.001508842 + ,191 + ,0 + ,55 + ,5 + ,0.003772105 + ,188 + ,0 + ,56 + ,2 + ,0.001508842 + ,220 + ,0 + ,53 + ,5 + ,0.003772105 + ,77 + ,0 + ,45 + ,7 + ,0.005280946 + ,2089 + ,0 + ,53 + ,1 + ,0.000754421 + ,185 + ,0 + ,38 + ,19 + ,0.014333997 + ,69 + ,0 + ,58 + ,5 + ,0.003772105 + ,94 + ,0 + ,37 + ,18 + ,0.013579576 + ,94 + ,0 + ,48 + ,9 + ,0.006789788 + ,91 + ,0 + ,58 + ,6 + ,0.004526525 + ,72 + ,0 + ,27 + ,8 + ,0.006035367 + ,1071 + ,1 + ,56 + ,2 + ,0.001508842 + ,699 + ,1 + ,67 + ,20 + ,0.015088418 + ,373 + ,0 + ,45 + ,4 + ,0.003017684 + ,289 + ,0 + ,38 + ,1 + ,0.000754421 + ,678 + ,1 + ,36 + ,12 + ,0.009053051 + ,706 + ,1 + ,45 + ,14 + ,0.010561893 + ,24 + ,0 + ,55 + ,18 + ,0.013579576 + ,70 + ,0 + ,42 + ,13 + ,0.009807472 + ,55 + ,0 + ,51 + ,16 + ,0.012070735 + ,730 + ,1 + ,42 + ,13 + ,0.009807472 + ,115 + ,0 + ,40 + ,8 + ,0.006035367 + ,516 + ,1 + ,55 + ,15 + ,0.011316314 + ,209 + ,0 + ,60 + ,17 + ,0.012825155 + ,31 + ,0 + ,46 + ,9 + ,0.006789788 + ,68 + ,0 + ,56 + ,7 + ,0.005280946) + ,dim=c(5 + ,110) + ,dimnames=list(c('PrefUh' + ,'Prislus' + ,'Vek' + ,'Poradi' + ,'ZnaOST') + ,1:110)) > y <- array(NA,dim=c(5,110),dimnames=list(c('PrefUh','Prislus','Vek','Poradi','ZnaOST'),1:110)) > 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 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 PrefUh Prislus Vek Poradi ZnaOST 1 261 1 49 17 0.012825155 2 99 0 39 7 0.005280946 3 23 0 62 6 0.004526525 4 533 1 31 13 0.009807472 5 71 0 47 13 0.009807472 6 305 0 59 20 0.015088418 7 82 0 58 16 0.012070735 8 40 0 41 16 0.012070735 9 70 0 61 12 0.009053051 10 214 0 49 5 0.003772105 11 955 1 55 19 0.014333997 12 283 1 54 22 0.016597260 13 153 1 47 14 0.010561893 14 435 1 43 20 0.015088418 15 135 0 46 18 0.013579576 16 1953 1 35 1 0.000754421 17 55 0 32 15 0.011316314 18 298 0 51 3 0.002263263 19 94 0 53 10 0.007544209 20 176 0 43 12 0.009053051 21 26 0 54 11 0.008298630 22 124 0 38 16 0.012070735 23 21 0 56 14 0.010561893 24 105 0 43 8 0.006035367 25 17 0 44 10 0.007544209 26 372 0 40 22 0.016597260 27 170 0 31 19 0.014333997 28 27 0 52 11 0.008298630 29 73 0 38 16 0.012070735 30 27 0 64 6 0.004526525 31 911 1 55 11 0.008298630 32 208 0 54 21 0.015842839 33 383 1 26 18 0.013579576 34 69 0 47 20 0.015088418 35 247 0 39 18 0.013579576 36 287 0 25 3 0.002263263 37 127 0 30 9 0.006789788 38 205 0 29 17 0.012825155 39 1209 1 46 1 0.000754421 40 127 0 43 10 0.007544209 41 643 1 31 12 0.009053051 42 116 0 59 21 0.015842839 43 694 1 46 15 0.011316314 44 70 0 39 9 0.006789788 45 414 1 51 20 0.015088418 46 1746 1 51 9 0.006789788 47 346 0 27 22 0.016597260 48 137 0 68 11 0.008298630 49 198 0 45 15 0.011316314 50 837 1 45 4 0.003017684 51 338 0 50 19 0.014333997 52 65 0 43 14 0.010561893 53 65 0 30 4 0.003017684 54 284 1 24 12 0.009053051 55 184 0 53 3 0.002263263 56 98 0 47 7 0.005280946 57 843 1 47 8 0.006035367 58 122 0 56 8 0.006035367 59 344 0 43 6 0.004526525 60 64 0 42 2 0.001508842 61 70 0 60 17 0.012825155 62 142 0 57 2 0.001508842 63 219 0 55 6 0.004526525 64 2744 0 45 1 0.000754421 65 227 0 62 3 0.002263263 66 12 0 60 15 0.011316314 67 113 0 37 10 0.007544209 68 141 0 57 21 0.015842839 69 424 1 57 10 0.007544209 70 128 0 46 4 0.003017684 71 156 0 30 14 0.010561893 72 48 0 63 5 0.003772105 73 172 0 52 22 0.016597260 74 1941 1 51 7 0.005280946 75 1487 1 58 3 0.002263263 76 18 0 59 17 0.012825155 77 84 0 65 22 0.016597260 78 118 0 65 19 0.014333997 79 88 0 56 11 0.008298630 80 1847 1 49 4 0.003017684 81 284 0 42 21 0.015842839 82 156 0 34 13 0.009807472 83 315 0 54 21 0.015842839 84 194 0 55 2 0.001508842 85 191 0 55 5 0.003772105 86 188 0 56 2 0.001508842 87 220 0 53 5 0.003772105 88 77 0 45 7 0.005280946 89 2089 0 53 1 0.000754421 90 185 0 38 19 0.014333997 91 69 0 58 5 0.003772105 92 94 0 37 18 0.013579576 93 94 0 48 9 0.006789788 94 91 0 58 6 0.004526525 95 72 0 27 8 0.006035367 96 1071 1 56 2 0.001508842 97 699 1 67 20 0.015088418 98 373 0 45 4 0.003017684 99 289 0 38 1 0.000754421 100 678 1 36 12 0.009053051 101 706 1 45 14 0.010561893 102 24 0 55 18 0.013579576 103 70 0 42 13 0.009807472 104 55 0 51 16 0.012070735 105 730 1 42 13 0.009807472 106 115 0 40 8 0.006035367 107 516 1 55 15 0.011316314 108 209 0 60 17 0.012825155 109 31 0 46 9 0.006789788 110 68 0 56 7 0.005280946 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Prislus Vek Poradi ZnaOST 432.2197 652.4228 0.7503 -24.0150 NA > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -630.70 -192.87 -88.36 89.63 2302.03 Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) 432.2197 190.1961 2.272 0.0251 * Prislus 652.4228 86.0048 7.586 1.34e-11 *** Vek 0.7503 3.5820 0.209 0.8345 Poradi -24.0150 5.8212 -4.125 7.38e-05 *** ZnaOST NA NA NA NA --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 387.2 on 106 degrees of freedom Multiple R-squared: 0.4097, Adjusted R-squared: 0.393 F-statistic: 24.52 on 3 and 106 DF, p-value: 3.950e-12 > 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,] 7.738979e-02 1.547796e-01 9.226102e-01 [2,] 2.467379e-02 4.934757e-02 9.753262e-01 [3,] 1.224458e-02 2.448915e-02 9.877554e-01 [4,] 6.059030e-02 1.211806e-01 9.394097e-01 [5,] 6.032234e-02 1.206447e-01 9.396777e-01 [6,] 6.366809e-02 1.273362e-01 9.363319e-01 [7,] 3.448506e-02 6.897012e-02 9.655149e-01 [8,] 1.752761e-02 3.505523e-02 9.824724e-01 [9,] 5.499154e-01 9.001692e-01 4.500846e-01 [10,] 4.592386e-01 9.184773e-01 5.407614e-01 [11,] 3.822659e-01 7.645318e-01 6.177341e-01 [12,] 3.070504e-01 6.141007e-01 6.929496e-01 [13,] 2.374477e-01 4.748954e-01 7.625523e-01 [14,] 1.839539e-01 3.679078e-01 8.160461e-01 [15,] 1.372677e-01 2.745354e-01 8.627323e-01 [16,] 9.870537e-02 1.974107e-01 9.012946e-01 [17,] 7.403759e-02 1.480752e-01 9.259624e-01 [18,] 5.557575e-02 1.111515e-01 9.444242e-01 [19,] 7.279872e-02 1.455974e-01 9.272013e-01 [20,] 5.189659e-02 1.037932e-01 9.481034e-01 [21,] 3.676042e-02 7.352084e-02 9.632396e-01 [22,] 2.453499e-02 4.906998e-02 9.754650e-01 [23,] 1.756710e-02 3.513420e-02 9.824329e-01 [24,] 1.327915e-02 2.655831e-02 9.867208e-01 [25,] 1.169967e-02 2.339933e-02 9.883003e-01 [26,] 1.079682e-02 2.159364e-02 9.892032e-01 [27,] 7.011494e-03 1.402299e-02 9.929885e-01 [28,] 5.007199e-03 1.001440e-02 9.949928e-01 [29,] 3.215498e-03 6.430996e-03 9.967845e-01 [30,] 2.059852e-03 4.119704e-03 9.979401e-01 [31,] 1.279725e-03 2.559449e-03 9.987203e-01 [32,] 1.035045e-03 2.070091e-03 9.989650e-01 [33,] 6.127536e-04 1.225507e-03 9.993872e-01 [34,] 3.861953e-04 7.723906e-04 9.996138e-01 [35,] 2.498294e-04 4.996588e-04 9.997502e-01 [36,] 1.395459e-04 2.790918e-04 9.998605e-01 [37,] 8.589336e-05 1.717867e-04 9.999141e-01 [38,] 5.500642e-05 1.100128e-04 9.999450e-01 [39,] 1.447348e-03 2.894695e-03 9.985527e-01 [40,] 1.551757e-03 3.103513e-03 9.984482e-01 [41,] 9.596564e-04 1.919313e-03 9.990403e-01 [42,] 5.959956e-04 1.191991e-03 9.994040e-01 [43,] 3.814078e-04 7.628156e-04 9.996186e-01 [44,] 3.421108e-04 6.842217e-04 9.996579e-01 [45,] 2.010354e-04 4.020708e-04 9.997990e-01 [46,] 1.567540e-04 3.135079e-04 9.998432e-01 [47,] 2.849112e-04 5.698224e-04 9.997151e-01 [48,] 1.840152e-04 3.680305e-04 9.998160e-01 [49,] 1.181045e-04 2.362090e-04 9.998819e-01 [50,] 7.027817e-05 1.405563e-04 9.999297e-01 [51,] 4.141085e-05 8.282170e-05 9.999586e-01 [52,] 2.329000e-05 4.658001e-05 9.999767e-01 [53,] 1.957634e-05 3.915267e-05 9.999804e-01 [54,] 1.037641e-05 2.075283e-05 9.999896e-01 [55,] 7.024673e-06 1.404935e-05 9.999930e-01 [56,] 3.788120e-06 7.576240e-06 9.999962e-01 [57,] 6.906992e-01 6.186017e-01 3.093008e-01 [58,] 6.465684e-01 7.068631e-01 3.534316e-01 [59,] 5.947711e-01 8.104577e-01 4.052289e-01 [60,] 5.411370e-01 9.177260e-01 4.588630e-01 [61,] 4.926475e-01 9.852949e-01 5.073525e-01 [62,] 5.454901e-01 9.090198e-01 4.545099e-01 [63,] 5.067124e-01 9.865752e-01 4.932876e-01 [64,] 4.481745e-01 8.963490e-01 5.518255e-01 [65,] 4.279747e-01 8.559493e-01 5.720253e-01 [66,] 3.894558e-01 7.789115e-01 6.105442e-01 [67,] 6.531614e-01 6.936771e-01 3.468386e-01 [68,] 6.497848e-01 7.004304e-01 3.502152e-01 [69,] 5.915699e-01 8.168603e-01 4.084301e-01 [70,] 5.337320e-01 9.325359e-01 4.662680e-01 [71,] 4.723959e-01 9.447918e-01 5.276041e-01 [72,] 4.149960e-01 8.299920e-01 5.850040e-01 [73,] 6.449036e-01 7.101928e-01 3.550964e-01 [74,] 6.201184e-01 7.597632e-01 3.798816e-01 [75,] 5.552658e-01 8.894684e-01 4.447342e-01 [76,] 5.396711e-01 9.206578e-01 4.603289e-01 [77,] 4.950546e-01 9.901091e-01 5.049454e-01 [78,] 4.384598e-01 8.769196e-01 5.615402e-01 [79,] 4.051707e-01 8.103414e-01 5.948293e-01 [80,] 3.502515e-01 7.005030e-01 6.497485e-01 [81,] 3.060109e-01 6.120217e-01 6.939891e-01 [82,] 9.999994e-01 1.192818e-06 5.964090e-07 [83,] 9.999992e-01 1.601381e-06 8.006906e-07 [84,] 9.999985e-01 2.908366e-06 1.454183e-06 [85,] 9.999969e-01 6.221994e-06 3.110997e-06 [86,] 9.999890e-01 2.208811e-05 1.104405e-05 [87,] 9.999835e-01 3.309555e-05 1.654778e-05 [88,] 9.999364e-01 1.271321e-04 6.356604e-05 [89,] 9.998838e-01 2.324816e-04 1.162408e-04 [90,] 9.996866e-01 6.268812e-04 3.134406e-04 [91,] 9.996787e-01 6.426596e-04 3.213298e-04 [92,] 9.994665e-01 1.067026e-03 5.335132e-04 [93,] 9.975064e-01 4.987294e-03 2.493647e-03 [94,] 9.907649e-01 1.847013e-02 9.235065e-03 [95,] 9.688314e-01 6.233725e-02 3.116862e-02 > postscript(file="/var/www/html/rcomp/tmp/1bwo61284569983.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/2bwo61284569983.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/3bwo61284569983.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/44o591284569983.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/54o591284569983.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 = 110 Frequency = 1 1 2 3 4 5 6 -452.1528633 -194.3769291 -311.6491499 -262.7072116 -84.2894415 308.8117901 7 8 9 10 11 12 -9.4978954 -38.7425582 -119.8088367 -134.9100683 285.3752527 -313.8294338 13 14 15 16 17 18 -630.6972350 -201.6059800 100.5358718 866.1115342 -41.0047325 -100.4406960 19 20 21 22 23 24 -137.8363248 -0.3031856 -182.5716389 47.5083837 -117.0272672 -167.3631850 25 26 27 28 29 30 -208.0834992 438.0977549 170.8055809 -180.0710110 -3.4916163 -309.1497778 31 32 33 34 35 36 49.2552538 239.5783597 -288.8806425 81.8155575 217.7880694 -91.9325332 37 38 39 40 41 42 -111.5941038 159.2762091 113.8580807 -97.3331853 -176.7222115 143.8267900 43 44 45 46 47 48 -64.9319212 -175.3469293 -228.6084916 839.2265098 421.8518363 -82.0760343 49 50 51 52 53 54 92.2411861 -185.3466058 324.5496158 -63.2731858 -293.6691031 -530.4700138 55 56 57 58 59 60 -215.9413239 -201.3794407 -84.7872342 -160.1172664 23.6068152 -351.7028703 61 62 63 64 65 66 1.0164766 -284.9575796 -110.3969522 2302.0311880 -179.6941495 -105.0135232 67 68 69 70 71 72 -106.8313016 170.3274179 -463.2603740 -242.6741263 37.4808956 -311.4144637 73 74 75 76 77 78 229.0939875 986.1965101 430.8843130 -50.2332095 131.3399061 93.2949065 79 80 81 82 83 84 -122.0722668 821.6521384 324.5821272 10.4646399 346.5783597 -231.4569517 85 86 87 88 89 90 -162.4119521 -238.2072656 -131.9113242 -220.8788128 1641.0286764 180.5533833 91 92 93 94 95 96 -286.6628939 66.2886973 -158.0997549 -240.6478941 -188.3581618 -7.6300590 97 98 99 100 101 102 44.3864851 3.0761876 -147.7166143 -145.4737813 -76.1966071 -17.2169538 103 104 105 106 107 108 -81.5378717 -31.2456977 -73.9606651 -155.1122432 -249.6847468 140.0164766 109 110 -219.5991270 -238.1322663 > postscript(file="/var/www/html/rcomp/tmp/64o591284569983.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 = 110 Frequency = 1 lag(myerror, k = 1) myerror 0 -452.1528633 NA 1 -194.3769291 -452.1528633 2 -311.6491499 -194.3769291 3 -262.7072116 -311.6491499 4 -84.2894415 -262.7072116 5 308.8117901 -84.2894415 6 -9.4978954 308.8117901 7 -38.7425582 -9.4978954 8 -119.8088367 -38.7425582 9 -134.9100683 -119.8088367 10 285.3752527 -134.9100683 11 -313.8294338 285.3752527 12 -630.6972350 -313.8294338 13 -201.6059800 -630.6972350 14 100.5358718 -201.6059800 15 866.1115342 100.5358718 16 -41.0047325 866.1115342 17 -100.4406960 -41.0047325 18 -137.8363248 -100.4406960 19 -0.3031856 -137.8363248 20 -182.5716389 -0.3031856 21 47.5083837 -182.5716389 22 -117.0272672 47.5083837 23 -167.3631850 -117.0272672 24 -208.0834992 -167.3631850 25 438.0977549 -208.0834992 26 170.8055809 438.0977549 27 -180.0710110 170.8055809 28 -3.4916163 -180.0710110 29 -309.1497778 -3.4916163 30 49.2552538 -309.1497778 31 239.5783597 49.2552538 32 -288.8806425 239.5783597 33 81.8155575 -288.8806425 34 217.7880694 81.8155575 35 -91.9325332 217.7880694 36 -111.5941038 -91.9325332 37 159.2762091 -111.5941038 38 113.8580807 159.2762091 39 -97.3331853 113.8580807 40 -176.7222115 -97.3331853 41 143.8267900 -176.7222115 42 -64.9319212 143.8267900 43 -175.3469293 -64.9319212 44 -228.6084916 -175.3469293 45 839.2265098 -228.6084916 46 421.8518363 839.2265098 47 -82.0760343 421.8518363 48 92.2411861 -82.0760343 49 -185.3466058 92.2411861 50 324.5496158 -185.3466058 51 -63.2731858 324.5496158 52 -293.6691031 -63.2731858 53 -530.4700138 -293.6691031 54 -215.9413239 -530.4700138 55 -201.3794407 -215.9413239 56 -84.7872342 -201.3794407 57 -160.1172664 -84.7872342 58 23.6068152 -160.1172664 59 -351.7028703 23.6068152 60 1.0164766 -351.7028703 61 -284.9575796 1.0164766 62 -110.3969522 -284.9575796 63 2302.0311880 -110.3969522 64 -179.6941495 2302.0311880 65 -105.0135232 -179.6941495 66 -106.8313016 -105.0135232 67 170.3274179 -106.8313016 68 -463.2603740 170.3274179 69 -242.6741263 -463.2603740 70 37.4808956 -242.6741263 71 -311.4144637 37.4808956 72 229.0939875 -311.4144637 73 986.1965101 229.0939875 74 430.8843130 986.1965101 75 -50.2332095 430.8843130 76 131.3399061 -50.2332095 77 93.2949065 131.3399061 78 -122.0722668 93.2949065 79 821.6521384 -122.0722668 80 324.5821272 821.6521384 81 10.4646399 324.5821272 82 346.5783597 10.4646399 83 -231.4569517 346.5783597 84 -162.4119521 -231.4569517 85 -238.2072656 -162.4119521 86 -131.9113242 -238.2072656 87 -220.8788128 -131.9113242 88 1641.0286764 -220.8788128 89 180.5533833 1641.0286764 90 -286.6628939 180.5533833 91 66.2886973 -286.6628939 92 -158.0997549 66.2886973 93 -240.6478941 -158.0997549 94 -188.3581618 -240.6478941 95 -7.6300590 -188.3581618 96 44.3864851 -7.6300590 97 3.0761876 44.3864851 98 -147.7166143 3.0761876 99 -145.4737813 -147.7166143 100 -76.1966071 -145.4737813 101 -17.2169538 -76.1966071 102 -81.5378717 -17.2169538 103 -31.2456977 -81.5378717 104 -73.9606651 -31.2456977 105 -155.1122432 -73.9606651 106 -249.6847468 -155.1122432 107 140.0164766 -249.6847468 108 -219.5991270 140.0164766 109 -238.1322663 -219.5991270 110 NA -238.1322663 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -194.3769291 -452.1528633 [2,] -311.6491499 -194.3769291 [3,] -262.7072116 -311.6491499 [4,] -84.2894415 -262.7072116 [5,] 308.8117901 -84.2894415 [6,] -9.4978954 308.8117901 [7,] -38.7425582 -9.4978954 [8,] -119.8088367 -38.7425582 [9,] -134.9100683 -119.8088367 [10,] 285.3752527 -134.9100683 [11,] -313.8294338 285.3752527 [12,] -630.6972350 -313.8294338 [13,] -201.6059800 -630.6972350 [14,] 100.5358718 -201.6059800 [15,] 866.1115342 100.5358718 [16,] -41.0047325 866.1115342 [17,] -100.4406960 -41.0047325 [18,] -137.8363248 -100.4406960 [19,] -0.3031856 -137.8363248 [20,] -182.5716389 -0.3031856 [21,] 47.5083837 -182.5716389 [22,] -117.0272672 47.5083837 [23,] -167.3631850 -117.0272672 [24,] -208.0834992 -167.3631850 [25,] 438.0977549 -208.0834992 [26,] 170.8055809 438.0977549 [27,] -180.0710110 170.8055809 [28,] -3.4916163 -180.0710110 [29,] -309.1497778 -3.4916163 [30,] 49.2552538 -309.1497778 [31,] 239.5783597 49.2552538 [32,] -288.8806425 239.5783597 [33,] 81.8155575 -288.8806425 [34,] 217.7880694 81.8155575 [35,] -91.9325332 217.7880694 [36,] -111.5941038 -91.9325332 [37,] 159.2762091 -111.5941038 [38,] 113.8580807 159.2762091 [39,] -97.3331853 113.8580807 [40,] -176.7222115 -97.3331853 [41,] 143.8267900 -176.7222115 [42,] -64.9319212 143.8267900 [43,] -175.3469293 -64.9319212 [44,] -228.6084916 -175.3469293 [45,] 839.2265098 -228.6084916 [46,] 421.8518363 839.2265098 [47,] -82.0760343 421.8518363 [48,] 92.2411861 -82.0760343 [49,] -185.3466058 92.2411861 [50,] 324.5496158 -185.3466058 [51,] -63.2731858 324.5496158 [52,] -293.6691031 -63.2731858 [53,] -530.4700138 -293.6691031 [54,] -215.9413239 -530.4700138 [55,] -201.3794407 -215.9413239 [56,] -84.7872342 -201.3794407 [57,] -160.1172664 -84.7872342 [58,] 23.6068152 -160.1172664 [59,] -351.7028703 23.6068152 [60,] 1.0164766 -351.7028703 [61,] -284.9575796 1.0164766 [62,] -110.3969522 -284.9575796 [63,] 2302.0311880 -110.3969522 [64,] -179.6941495 2302.0311880 [65,] -105.0135232 -179.6941495 [66,] -106.8313016 -105.0135232 [67,] 170.3274179 -106.8313016 [68,] -463.2603740 170.3274179 [69,] -242.6741263 -463.2603740 [70,] 37.4808956 -242.6741263 [71,] -311.4144637 37.4808956 [72,] 229.0939875 -311.4144637 [73,] 986.1965101 229.0939875 [74,] 430.8843130 986.1965101 [75,] -50.2332095 430.8843130 [76,] 131.3399061 -50.2332095 [77,] 93.2949065 131.3399061 [78,] -122.0722668 93.2949065 [79,] 821.6521384 -122.0722668 [80,] 324.5821272 821.6521384 [81,] 10.4646399 324.5821272 [82,] 346.5783597 10.4646399 [83,] -231.4569517 346.5783597 [84,] -162.4119521 -231.4569517 [85,] -238.2072656 -162.4119521 [86,] -131.9113242 -238.2072656 [87,] -220.8788128 -131.9113242 [88,] 1641.0286764 -220.8788128 [89,] 180.5533833 1641.0286764 [90,] -286.6628939 180.5533833 [91,] 66.2886973 -286.6628939 [92,] -158.0997549 66.2886973 [93,] -240.6478941 -158.0997549 [94,] -188.3581618 -240.6478941 [95,] -7.6300590 -188.3581618 [96,] 44.3864851 -7.6300590 [97,] 3.0761876 44.3864851 [98,] -147.7166143 3.0761876 [99,] -145.4737813 -147.7166143 [100,] -76.1966071 -145.4737813 [101,] -17.2169538 -76.1966071 [102,] -81.5378717 -17.2169538 [103,] -31.2456977 -81.5378717 [104,] -73.9606651 -31.2456977 [105,] -155.1122432 -73.9606651 [106,] -249.6847468 -155.1122432 [107,] 140.0164766 -249.6847468 [108,] -219.5991270 140.0164766 [109,] -238.1322663 -219.5991270 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -194.3769291 -452.1528633 2 -311.6491499 -194.3769291 3 -262.7072116 -311.6491499 4 -84.2894415 -262.7072116 5 308.8117901 -84.2894415 6 -9.4978954 308.8117901 7 -38.7425582 -9.4978954 8 -119.8088367 -38.7425582 9 -134.9100683 -119.8088367 10 285.3752527 -134.9100683 11 -313.8294338 285.3752527 12 -630.6972350 -313.8294338 13 -201.6059800 -630.6972350 14 100.5358718 -201.6059800 15 866.1115342 100.5358718 16 -41.0047325 866.1115342 17 -100.4406960 -41.0047325 18 -137.8363248 -100.4406960 19 -0.3031856 -137.8363248 20 -182.5716389 -0.3031856 21 47.5083837 -182.5716389 22 -117.0272672 47.5083837 23 -167.3631850 -117.0272672 24 -208.0834992 -167.3631850 25 438.0977549 -208.0834992 26 170.8055809 438.0977549 27 -180.0710110 170.8055809 28 -3.4916163 -180.0710110 29 -309.1497778 -3.4916163 30 49.2552538 -309.1497778 31 239.5783597 49.2552538 32 -288.8806425 239.5783597 33 81.8155575 -288.8806425 34 217.7880694 81.8155575 35 -91.9325332 217.7880694 36 -111.5941038 -91.9325332 37 159.2762091 -111.5941038 38 113.8580807 159.2762091 39 -97.3331853 113.8580807 40 -176.7222115 -97.3331853 41 143.8267900 -176.7222115 42 -64.9319212 143.8267900 43 -175.3469293 -64.9319212 44 -228.6084916 -175.3469293 45 839.2265098 -228.6084916 46 421.8518363 839.2265098 47 -82.0760343 421.8518363 48 92.2411861 -82.0760343 49 -185.3466058 92.2411861 50 324.5496158 -185.3466058 51 -63.2731858 324.5496158 52 -293.6691031 -63.2731858 53 -530.4700138 -293.6691031 54 -215.9413239 -530.4700138 55 -201.3794407 -215.9413239 56 -84.7872342 -201.3794407 57 -160.1172664 -84.7872342 58 23.6068152 -160.1172664 59 -351.7028703 23.6068152 60 1.0164766 -351.7028703 61 -284.9575796 1.0164766 62 -110.3969522 -284.9575796 63 2302.0311880 -110.3969522 64 -179.6941495 2302.0311880 65 -105.0135232 -179.6941495 66 -106.8313016 -105.0135232 67 170.3274179 -106.8313016 68 -463.2603740 170.3274179 69 -242.6741263 -463.2603740 70 37.4808956 -242.6741263 71 -311.4144637 37.4808956 72 229.0939875 -311.4144637 73 986.1965101 229.0939875 74 430.8843130 986.1965101 75 -50.2332095 430.8843130 76 131.3399061 -50.2332095 77 93.2949065 131.3399061 78 -122.0722668 93.2949065 79 821.6521384 -122.0722668 80 324.5821272 821.6521384 81 10.4646399 324.5821272 82 346.5783597 10.4646399 83 -231.4569517 346.5783597 84 -162.4119521 -231.4569517 85 -238.2072656 -162.4119521 86 -131.9113242 -238.2072656 87 -220.8788128 -131.9113242 88 1641.0286764 -220.8788128 89 180.5533833 1641.0286764 90 -286.6628939 180.5533833 91 66.2886973 -286.6628939 92 -158.0997549 66.2886973 93 -240.6478941 -158.0997549 94 -188.3581618 -240.6478941 95 -7.6300590 -188.3581618 96 44.3864851 -7.6300590 97 3.0761876 44.3864851 98 -147.7166143 3.0761876 99 -145.4737813 -147.7166143 100 -76.1966071 -145.4737813 101 -17.2169538 -76.1966071 102 -81.5378717 -17.2169538 103 -31.2456977 -81.5378717 104 -73.9606651 -31.2456977 105 -155.1122432 -73.9606651 106 -249.6847468 -155.1122432 107 140.0164766 -249.6847468 108 -219.5991270 140.0164766 109 -238.1322663 -219.5991270 > 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/7wfmc1284569983.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/8po4x1284569983.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/9po4x1284569983.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') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/100f3z1284569983.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