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(0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,1 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,1 + ,1 + ,1 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,1 + ,0 + ,1 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,1 + ,1 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,1 + ,1 + ,1 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,1 + ,1 + ,1 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,1 + ,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,0 + ,1 + ,0 + ,0 + ,0) + ,dim=c(9 + ,154) + ,dimnames=list(c('CorrectAnalysis' + ,'T40Treatment' + ,'T40NoTreatment' + ,'T40NA' + ,'T20Treatment' + ,'T20NoTreatment' + ,'T20NA' + ,'Useful' + ,'Outcome') + ,1:154)) > y <- array(NA,dim=c(9,154),dimnames=list(c('CorrectAnalysis','T40Treatment','T40NoTreatment','T40NA','T20Treatment','T20NoTreatment','T20NA','Useful','Outcome'),1:154)) > 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 = '9' > par3 <- 'No Linear Trend' > par2 <- 'Do not include Seasonal Dummies' > par1 <- '9' > #'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 Outcome CorrectAnalysis T40Treatment T40NoTreatment T40NA T20Treatment 1 1 0 1 0 0 0 2 0 0 0 1 0 0 3 0 0 0 1 0 0 4 0 0 0 1 0 0 5 0 0 0 1 0 0 6 1 0 0 1 0 0 7 0 0 0 1 0 0 8 0 0 1 0 0 0 9 1 0 0 1 0 0 10 0 0 0 1 0 0 11 0 0 1 0 0 0 12 0 0 0 1 0 0 13 0 0 0 1 0 0 14 0 0 1 0 0 0 15 1 0 0 1 0 0 16 1 0 1 0 0 0 17 0 1 1 0 0 0 18 0 0 1 0 0 0 19 1 0 0 1 0 0 20 1 1 1 0 0 0 21 0 0 0 1 0 0 22 1 0 0 1 0 0 23 1 0 0 1 0 0 24 1 0 0 1 0 0 25 1 0 1 0 0 0 26 0 0 0 1 0 0 27 1 0 0 1 0 0 28 0 0 0 1 0 0 29 1 0 0 1 0 0 30 0 0 0 1 0 0 31 0 0 0 1 0 0 32 0 0 0 1 0 0 33 0 0 0 1 0 0 34 1 0 1 0 0 0 35 0 0 0 1 0 0 36 0 0 0 1 0 0 37 0 0 1 0 0 0 38 1 0 0 1 0 0 39 1 0 0 1 0 0 40 0 0 1 0 0 0 41 1 1 0 1 0 0 42 1 0 0 1 0 0 43 1 0 0 1 0 0 44 0 0 1 0 0 0 45 0 0 0 1 0 0 46 1 0 0 1 0 0 47 0 0 0 1 0 0 48 1 0 0 1 0 0 49 1 0 0 1 0 0 50 0 0 0 1 0 0 51 0 0 1 0 0 0 52 0 1 1 0 0 0 53 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0 0 0 1 1 127 0 0 0 0 1 0 128 1 0 0 0 1 0 129 0 0 0 0 1 0 130 1 0 0 0 1 0 131 0 0 0 0 1 0 132 1 0 0 0 1 0 133 0 0 0 0 1 0 134 0 0 0 0 1 0 135 0 0 0 0 1 0 136 0 0 0 0 1 0 137 1 0 0 0 1 0 138 1 0 0 0 1 1 139 0 0 0 0 1 1 140 0 0 0 0 1 0 141 1 1 0 0 1 0 142 1 0 0 0 1 1 143 0 0 0 0 1 0 144 1 0 0 0 1 0 145 0 0 0 0 1 0 146 1 0 0 0 1 1 147 0 0 0 0 1 1 148 0 0 0 0 1 1 149 0 0 0 0 1 0 150 1 0 0 0 1 0 151 1 0 0 0 1 0 152 0 1 0 0 1 0 153 0 1 0 0 1 0 154 0 0 0 0 1 0 T20NoTreatment T20NA Useful 1 0 1 0 2 0 1 0 3 0 1 0 4 0 1 0 5 0 1 0 6 0 1 1 7 0 1 0 8 0 1 0 9 0 1 0 10 0 1 0 11 0 1 0 12 0 1 0 13 0 1 1 14 0 1 0 15 0 1 1 16 0 1 1 17 0 1 1 18 0 1 0 19 0 1 0 20 0 1 1 21 0 1 1 22 0 1 1 23 0 1 1 24 0 1 1 25 0 1 0 26 0 1 1 27 0 1 0 28 0 1 0 29 0 1 0 30 0 1 1 31 0 1 0 32 0 1 0 33 0 1 1 34 0 1 0 35 0 1 0 36 0 1 0 37 0 1 1 38 0 1 0 39 0 1 1 40 0 1 1 41 0 1 1 42 0 1 0 43 0 1 1 44 0 1 0 45 0 1 1 46 0 1 1 47 0 1 0 48 0 1 0 49 0 1 1 50 0 1 0 51 0 1 0 52 0 1 1 53 0 1 0 54 0 1 0 55 0 1 0 56 0 1 0 57 0 1 1 58 0 1 0 59 0 1 0 60 0 1 1 61 0 1 0 62 0 1 1 63 0 1 0 64 0 1 0 65 0 1 0 66 0 1 0 67 0 1 1 68 0 1 0 69 0 1 0 70 0 1 0 71 0 1 0 72 0 1 0 73 0 1 0 74 0 1 0 75 0 1 0 76 0 1 1 77 0 1 0 78 0 1 1 79 0 1 0 80 0 1 1 81 0 1 0 82 0 1 0 83 0 1 0 84 0 1 0 85 0 1 1 86 0 1 0 87 1 0 0 88 0 0 0 89 1 0 0 90 1 0 0 91 1 0 1 92 0 0 0 93 1 0 1 94 1 0 0 95 0 0 0 96 1 0 0 97 0 0 0 98 1 0 0 99 1 0 0 100 1 0 0 101 1 0 0 102 1 0 0 103 1 0 0 104 1 0 0 105 0 0 0 106 1 0 0 107 1 0 0 108 0 0 0 109 1 0 0 110 1 0 0 111 0 0 1 112 0 0 0 113 1 0 0 114 0 0 0 115 1 0 0 116 1 0 0 117 1 0 0 118 1 0 0 119 1 0 0 120 1 0 0 121 1 0 0 122 1 0 0 123 0 0 0 124 1 0 1 125 1 0 0 126 0 0 0 127 1 0 1 128 1 0 0 129 1 0 0 130 1 0 0 131 1 0 0 132 1 0 0 133 1 0 0 134 1 0 0 135 1 0 0 136 1 0 0 137 1 0 1 138 0 0 1 139 0 0 0 140 1 0 0 141 1 0 0 142 0 0 0 143 1 0 0 144 1 0 1 145 1 0 1 146 0 0 0 147 0 0 0 148 0 0 0 149 1 0 0 150 1 0 1 151 1 0 0 152 1 0 0 153 1 0 1 154 1 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) CorrectAnalysis T40Treatment T40NoTreatment 0.30817 -0.07276 0.11653 0.10264 T40NA T20Treatment T20NoTreatment T20NA NA -0.09250 NA NA Useful 0.16686 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.5916 -0.4108 -0.3082 0.5753 0.7843 Coefficients: (3 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) 0.30817 0.07026 4.386 2.18e-05 *** CorrectAnalysis -0.07276 0.15521 -0.469 0.6399 T40Treatment 0.11653 0.12735 0.915 0.3617 T40NoTreatment 0.10264 0.09259 1.109 0.2694 T40NA NA NA NA NA T20Treatment -0.09250 0.13655 -0.677 0.4992 T20NoTreatment NA NA NA NA T20NA NA NA NA NA Useful 0.16686 0.09250 1.804 0.0733 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.4863 on 148 degrees of freedom Multiple R-squared: 0.04972, Adjusted R-squared: 0.01761 F-statistic: 1.549 on 5 and 148 DF, p-value: 0.1783 > 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.89727848 0.20544303 0.10272152 [2,] 0.91524343 0.16951314 0.08475657 [3,] 0.87123109 0.25753782 0.12876891 [4,] 0.83739894 0.32520212 0.16260106 [5,] 0.76880535 0.46238930 0.23119465 [6,] 0.68666704 0.62666592 0.31333296 [7,] 0.62003145 0.75993710 0.37996855 [8,] 0.74558840 0.50882320 0.25441160 [9,] 0.78903936 0.42192128 0.21096064 [10,] 0.81505850 0.36988300 0.18494150 [11,] 0.78668316 0.42663368 0.21331684 [12,] 0.74976145 0.50047711 0.25023855 [13,] 0.70653262 0.58693475 0.29346738 [14,] 0.74820150 0.50359700 0.25179850 [15,] 0.78228411 0.43543177 0.21771589 [16,] 0.82535324 0.34929353 0.17464676 [17,] 0.79333287 0.41333426 0.20666713 [18,] 0.82507898 0.34984204 0.17492102 [19,] 0.83850625 0.32298749 0.16149375 [20,] 0.81284705 0.37430590 0.18715295 [21,] 0.78440422 0.43119155 0.21559578 [22,] 0.79285814 0.41428373 0.20714186 [23,] 0.80088023 0.39823955 0.19911977 [24,] 0.77320088 0.45359823 0.22679912 [25,] 0.74368896 0.51262208 0.25631104 [26,] 0.77235411 0.45529177 0.22764589 [27,] 0.80033500 0.39932999 0.19966500 [28,] 0.79131304 0.41737392 0.20868696 [29,] 0.80240389 0.39519222 0.19759611 [30,] 0.79069086 0.41861828 0.20930914 [31,] 0.80660599 0.38678801 0.19339401 [32,] 0.79665519 0.40668962 0.20334481 [33,] 0.78086537 0.43826926 0.21913463 [34,] 0.78755209 0.42489581 0.21244791 [35,] 0.77720632 0.44558736 0.22279368 [36,] 0.76050028 0.47899945 0.23949972 [37,] 0.77583184 0.44833631 0.22416816 [38,] 0.76383442 0.47233115 0.23616558 [39,] 0.74778984 0.50442032 0.25221016 [40,] 0.73777231 0.52445537 0.26222769 [41,] 0.74966735 0.50066530 0.25033265 [42,] 0.76458910 0.47082181 0.23541090 [43,] 0.74072168 0.51855663 0.25927832 [44,] 0.72514547 0.54970906 0.27485453 [45,] 0.73901155 0.52197690 0.26098845 [46,] 0.72511591 0.54976817 0.27488409 [47,] 0.74034512 0.51930975 0.25965488 [48,] 0.75463943 0.49072113 0.24536057 [49,] 0.74852179 0.50295642 0.25147821 [50,] 0.75393254 0.49213491 0.24606746 [51,] 0.76256349 0.47487303 0.23743651 [52,] 0.74897703 0.50204594 0.25102297 [53,] 0.75629219 0.48741563 0.24370781 [54,] 0.74322853 0.51354294 0.25677147 [55,] 0.73089893 0.53820215 0.26910107 [56,] 0.73652893 0.52694215 0.26347107 [57,] 0.72579864 0.54840271 0.27420136 [58,] 0.73553054 0.52893893 0.26446946 [59,] 0.72545776 0.54908448 0.27454224 [60,] 0.71810127 0.56379746 0.28189873 [61,] 0.72491407 0.55017186 0.27508593 [62,] 0.73329153 0.53341693 0.26670847 [63,] 0.72423141 0.55153718 0.27576859 [64,] 0.73220216 0.53559567 0.26779784 [65,] 0.71286408 0.57427184 0.28713592 [66,] 0.72689676 0.54620649 0.27310324 [67,] 0.71837352 0.56325297 0.28162648 [68,] 0.77170232 0.45659535 0.22829768 [69,] 0.75566644 0.48866713 0.24433356 [70,] 0.73899540 0.52200920 0.26100460 [71,] 0.76348629 0.47302742 0.23651371 [72,] 0.74201025 0.51597950 0.25798975 [73,] 0.71647629 0.56704742 0.28352371 [74,] 0.71851267 0.56297465 0.28148733 [75,] 0.68749020 0.62501959 0.31250980 [76,] 0.69460148 0.61079703 0.30539852 [77,] 0.72031460 0.55937079 0.27968540 [78,] 0.71917989 0.56164021 0.28082011 [79,] 0.74159803 0.51680393 0.25840197 [80,] 0.75671014 0.48657972 0.24328986 [81,] 0.74770693 0.50458613 0.25229307 [82,] 0.75552480 0.48895039 0.24447520 [83,] 0.72918792 0.54162415 0.27081208 [84,] 0.69871332 0.60257336 0.30128668 [85,] 0.73896278 0.52207444 0.26103722 [86,] 0.70408230 0.59183540 0.29591770 [87,] 0.67580298 0.64839403 0.32419702 [88,] 0.64492890 0.71014221 0.35507110 [89,] 0.69011315 0.61977371 0.30988685 [90,] 0.73403394 0.53193213 0.26596606 [91,] 0.70622563 0.58754873 0.29377437 [92,] 0.67589799 0.64820401 0.32410201 [93,] 0.64348274 0.71303453 0.35651726 [94,] 0.60049095 0.79901810 0.39950905 [95,] 0.56513839 0.86972322 0.43486161 [96,] 0.52895003 0.94209994 0.47104997 [97,] 0.48309456 0.96618911 0.51690544 [98,] 0.44646774 0.89293547 0.55353226 [99,] 0.41044697 0.82089394 0.58955303 [100,] 0.40575407 0.81150813 0.59424593 [101,] 0.36458138 0.72916277 0.63541862 [102,] 0.32931676 0.65863352 0.67068324 [103,] 0.29334847 0.58669694 0.70665153 [104,] 0.26151267 0.52302534 0.73848733 [105,] 0.23210431 0.46420861 0.76789569 [106,] 0.26939000 0.53878000 0.73061000 [107,] 0.23792144 0.47584289 0.76207856 [108,] 0.20925718 0.41851437 0.79074282 [109,] 0.24400988 0.48801976 0.75599012 [110,] 0.21289088 0.42578176 0.78710912 [111,] 0.18503968 0.37007936 0.81496032 [112,] 0.15963854 0.31927708 0.84036146 [113,] 0.14827686 0.29655371 0.85172314 [114,] 0.17522654 0.35045308 0.82477346 [115,] 0.15489331 0.30978662 0.84510669 [116,] 0.16206564 0.32413129 0.83793436 [117,] 0.19871667 0.39743335 0.80128333 [118,] 0.16375590 0.32751181 0.83624410 [119,] 0.20946751 0.41893502 0.79053249 [120,] 0.16844364 0.33688728 0.83155636 [121,] 0.23059220 0.46118440 0.76940780 [122,] 0.18026109 0.36052218 0.81973891 [123,] 0.13708132 0.27416263 0.86291868 [124,] 0.10149215 0.20298430 0.89850785 [125,] 0.07343406 0.14686812 0.92656594 [126,] 0.05853670 0.11707340 0.94146330 [127,] 0.04315988 0.08631975 0.95684012 [128,] 0.03225898 0.06451795 0.96774102 [129,] 0.02004177 0.04008354 0.97995823 [130,] 0.04026020 0.08052039 0.95973980 [131,] 0.03576026 0.07152052 0.96423974 > postscript(file="/var/wessaorg/rcomp/tmp/1k6wu1356226693.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/20z961356226693.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/3jydn1356226693.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/4wsdt1356226693.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/5uoa61356226693.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 = 154 Frequency = 1 1 2 3 4 5 6 7 0.5753070 -0.4108100 -0.4108100 -0.4108100 -0.4108100 0.4223274 -0.4108100 8 9 10 11 12 13 14 -0.4246930 0.5891900 -0.4108100 -0.4246930 -0.4108100 -0.5776726 -0.4246930 15 16 17 18 19 20 21 0.4223274 0.4084445 -0.5187949 -0.4246930 0.5891900 0.4812051 -0.5776726 22 23 24 25 26 27 28 0.4223274 0.4223274 0.4223274 0.5753070 -0.5776726 0.5891900 -0.4108100 29 30 31 32 33 34 35 0.5891900 -0.5776726 -0.4108100 -0.4108100 -0.5776726 0.5753070 -0.4108100 36 37 38 39 40 41 42 -0.4108100 -0.5915555 0.5891900 0.4223274 -0.5915555 0.4950880 0.5891900 43 44 45 46 47 48 49 0.4223274 -0.4246930 -0.5776726 0.4223274 -0.4108100 0.5891900 0.4223274 50 51 52 53 54 55 56 -0.4108100 -0.4246930 -0.5187949 0.5891900 -0.3380495 -0.4108100 0.5753070 57 58 59 60 61 62 63 0.4223274 0.5891900 0.5891900 0.4812051 0.5753070 -0.5776726 -0.4108100 64 65 66 67 68 69 70 0.5753070 -0.4108100 -0.4108100 -0.5187949 -0.4108100 0.5891900 -0.4108100 71 72 73 74 75 76 77 -0.4108100 0.5891900 0.5891900 -0.4108100 0.5891900 0.4084445 0.5891900 78 79 80 81 82 83 84 0.4223274 0.6480676 -0.5915555 -0.4108100 0.5891900 -0.4108100 -0.3380495 85 86 87 88 89 90 91 0.4223274 -0.4108100 0.6918330 0.7843368 -0.3081670 0.6918330 -0.4750296 92 93 94 95 96 97 98 -0.2156632 -0.4750296 -0.3081670 -0.2156632 0.6918330 -0.2156632 -0.3081670 99 100 101 102 103 104 105 -0.3081670 0.6918330 0.6918330 -0.3081670 -0.3081670 -0.3081670 -0.2156632 106 107 108 109 110 111 112 -0.3081670 -0.3081670 -0.2156632 -0.3081670 -0.3081670 -0.3825258 -0.2156632 113 114 115 116 117 118 119 -0.3081670 -0.2156632 -0.3081670 -0.3081670 0.6918330 -0.3081670 -0.3081670 120 121 122 123 124 125 126 0.6918330 -0.3081670 -0.3081670 -0.2156632 0.5249704 0.6918330 -0.2156632 127 128 129 130 131 132 133 -0.4750296 0.6918330 -0.3081670 0.6918330 -0.3081670 0.6918330 -0.3081670 134 135 136 137 138 139 140 -0.3081670 -0.3081670 -0.3081670 0.5249704 0.6174742 -0.2156632 -0.3081670 141 142 143 144 145 146 147 0.7645935 0.7843368 -0.3081670 0.5249704 -0.4750296 0.7843368 -0.2156632 148 149 150 151 152 153 154 -0.2156632 -0.3081670 0.5249704 0.6918330 -0.2354065 -0.4022690 -0.3081670 > postscript(file="/var/wessaorg/rcomp/tmp/67wpf1356226693.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 = 154 Frequency = 1 lag(myerror, k = 1) myerror 0 0.5753070 NA 1 -0.4108100 0.5753070 2 -0.4108100 -0.4108100 3 -0.4108100 -0.4108100 4 -0.4108100 -0.4108100 5 0.4223274 -0.4108100 6 -0.4108100 0.4223274 7 -0.4246930 -0.4108100 8 0.5891900 -0.4246930 9 -0.4108100 0.5891900 10 -0.4246930 -0.4108100 11 -0.4108100 -0.4246930 12 -0.5776726 -0.4108100 13 -0.4246930 -0.5776726 14 0.4223274 -0.4246930 15 0.4084445 0.4223274 16 -0.5187949 0.4084445 17 -0.4246930 -0.5187949 18 0.5891900 -0.4246930 19 0.4812051 0.5891900 20 -0.5776726 0.4812051 21 0.4223274 -0.5776726 22 0.4223274 0.4223274 23 0.4223274 0.4223274 24 0.5753070 0.4223274 25 -0.5776726 0.5753070 26 0.5891900 -0.5776726 27 -0.4108100 0.5891900 28 0.5891900 -0.4108100 29 -0.5776726 0.5891900 30 -0.4108100 -0.5776726 31 -0.4108100 -0.4108100 32 -0.5776726 -0.4108100 33 0.5753070 -0.5776726 34 -0.4108100 0.5753070 35 -0.4108100 -0.4108100 36 -0.5915555 -0.4108100 37 0.5891900 -0.5915555 38 0.4223274 0.5891900 39 -0.5915555 0.4223274 40 0.4950880 -0.5915555 41 0.5891900 0.4950880 42 0.4223274 0.5891900 43 -0.4246930 0.4223274 44 -0.5776726 -0.4246930 45 0.4223274 -0.5776726 46 -0.4108100 0.4223274 47 0.5891900 -0.4108100 48 0.4223274 0.5891900 49 -0.4108100 0.4223274 50 -0.4246930 -0.4108100 51 -0.5187949 -0.4246930 52 0.5891900 -0.5187949 53 -0.3380495 0.5891900 54 -0.4108100 -0.3380495 55 0.5753070 -0.4108100 56 0.4223274 0.5753070 57 0.5891900 0.4223274 58 0.5891900 0.5891900 59 0.4812051 0.5891900 60 0.5753070 0.4812051 61 -0.5776726 0.5753070 62 -0.4108100 -0.5776726 63 0.5753070 -0.4108100 64 -0.4108100 0.5753070 65 -0.4108100 -0.4108100 66 -0.5187949 -0.4108100 67 -0.4108100 -0.5187949 68 0.5891900 -0.4108100 69 -0.4108100 0.5891900 70 -0.4108100 -0.4108100 71 0.5891900 -0.4108100 72 0.5891900 0.5891900 73 -0.4108100 0.5891900 74 0.5891900 -0.4108100 75 0.4084445 0.5891900 76 0.5891900 0.4084445 77 0.4223274 0.5891900 78 0.6480676 0.4223274 79 -0.5915555 0.6480676 80 -0.4108100 -0.5915555 81 0.5891900 -0.4108100 82 -0.4108100 0.5891900 83 -0.3380495 -0.4108100 84 0.4223274 -0.3380495 85 -0.4108100 0.4223274 86 0.6918330 -0.4108100 87 0.7843368 0.6918330 88 -0.3081670 0.7843368 89 0.6918330 -0.3081670 90 -0.4750296 0.6918330 91 -0.2156632 -0.4750296 92 -0.4750296 -0.2156632 93 -0.3081670 -0.4750296 94 -0.2156632 -0.3081670 95 0.6918330 -0.2156632 96 -0.2156632 0.6918330 97 -0.3081670 -0.2156632 98 -0.3081670 -0.3081670 99 0.6918330 -0.3081670 100 0.6918330 0.6918330 101 -0.3081670 0.6918330 102 -0.3081670 -0.3081670 103 -0.3081670 -0.3081670 104 -0.2156632 -0.3081670 105 -0.3081670 -0.2156632 106 -0.3081670 -0.3081670 107 -0.2156632 -0.3081670 108 -0.3081670 -0.2156632 109 -0.3081670 -0.3081670 110 -0.3825258 -0.3081670 111 -0.2156632 -0.3825258 112 -0.3081670 -0.2156632 113 -0.2156632 -0.3081670 114 -0.3081670 -0.2156632 115 -0.3081670 -0.3081670 116 0.6918330 -0.3081670 117 -0.3081670 0.6918330 118 -0.3081670 -0.3081670 119 0.6918330 -0.3081670 120 -0.3081670 0.6918330 121 -0.3081670 -0.3081670 122 -0.2156632 -0.3081670 123 0.5249704 -0.2156632 124 0.6918330 0.5249704 125 -0.2156632 0.6918330 126 -0.4750296 -0.2156632 127 0.6918330 -0.4750296 128 -0.3081670 0.6918330 129 0.6918330 -0.3081670 130 -0.3081670 0.6918330 131 0.6918330 -0.3081670 132 -0.3081670 0.6918330 133 -0.3081670 -0.3081670 134 -0.3081670 -0.3081670 135 -0.3081670 -0.3081670 136 0.5249704 -0.3081670 137 0.6174742 0.5249704 138 -0.2156632 0.6174742 139 -0.3081670 -0.2156632 140 0.7645935 -0.3081670 141 0.7843368 0.7645935 142 -0.3081670 0.7843368 143 0.5249704 -0.3081670 144 -0.4750296 0.5249704 145 0.7843368 -0.4750296 146 -0.2156632 0.7843368 147 -0.2156632 -0.2156632 148 -0.3081670 -0.2156632 149 0.5249704 -0.3081670 150 0.6918330 0.5249704 151 -0.2354065 0.6918330 152 -0.4022690 -0.2354065 153 -0.3081670 -0.4022690 154 NA -0.3081670 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.4108100 0.5753070 [2,] -0.4108100 -0.4108100 [3,] -0.4108100 -0.4108100 [4,] -0.4108100 -0.4108100 [5,] 0.4223274 -0.4108100 [6,] -0.4108100 0.4223274 [7,] -0.4246930 -0.4108100 [8,] 0.5891900 -0.4246930 [9,] -0.4108100 0.5891900 [10,] -0.4246930 -0.4108100 [11,] -0.4108100 -0.4246930 [12,] -0.5776726 -0.4108100 [13,] -0.4246930 -0.5776726 [14,] 0.4223274 -0.4246930 [15,] 0.4084445 0.4223274 [16,] -0.5187949 0.4084445 [17,] -0.4246930 -0.5187949 [18,] 0.5891900 -0.4246930 [19,] 0.4812051 0.5891900 [20,] -0.5776726 0.4812051 [21,] 0.4223274 -0.5776726 [22,] 0.4223274 0.4223274 [23,] 0.4223274 0.4223274 [24,] 0.5753070 0.4223274 [25,] -0.5776726 0.5753070 [26,] 0.5891900 -0.5776726 [27,] -0.4108100 0.5891900 [28,] 0.5891900 -0.4108100 [29,] -0.5776726 0.5891900 [30,] -0.4108100 -0.5776726 [31,] -0.4108100 -0.4108100 [32,] -0.5776726 -0.4108100 [33,] 0.5753070 -0.5776726 [34,] -0.4108100 0.5753070 [35,] -0.4108100 -0.4108100 [36,] -0.5915555 -0.4108100 [37,] 0.5891900 -0.5915555 [38,] 0.4223274 0.5891900 [39,] -0.5915555 0.4223274 [40,] 0.4950880 -0.5915555 [41,] 0.5891900 0.4950880 [42,] 0.4223274 0.5891900 [43,] -0.4246930 0.4223274 [44,] -0.5776726 -0.4246930 [45,] 0.4223274 -0.5776726 [46,] -0.4108100 0.4223274 [47,] 0.5891900 -0.4108100 [48,] 0.4223274 0.5891900 [49,] -0.4108100 0.4223274 [50,] -0.4246930 -0.4108100 [51,] -0.5187949 -0.4246930 [52,] 0.5891900 -0.5187949 [53,] -0.3380495 0.5891900 [54,] -0.4108100 -0.3380495 [55,] 0.5753070 -0.4108100 [56,] 0.4223274 0.5753070 [57,] 0.5891900 0.4223274 [58,] 0.5891900 0.5891900 [59,] 0.4812051 0.5891900 [60,] 0.5753070 0.4812051 [61,] -0.5776726 0.5753070 [62,] -0.4108100 -0.5776726 [63,] 0.5753070 -0.4108100 [64,] -0.4108100 0.5753070 [65,] -0.4108100 -0.4108100 [66,] -0.5187949 -0.4108100 [67,] -0.4108100 -0.5187949 [68,] 0.5891900 -0.4108100 [69,] -0.4108100 0.5891900 [70,] -0.4108100 -0.4108100 [71,] 0.5891900 -0.4108100 [72,] 0.5891900 0.5891900 [73,] -0.4108100 0.5891900 [74,] 0.5891900 -0.4108100 [75,] 0.4084445 0.5891900 [76,] 0.5891900 0.4084445 [77,] 0.4223274 0.5891900 [78,] 0.6480676 0.4223274 [79,] -0.5915555 0.6480676 [80,] -0.4108100 -0.5915555 [81,] 0.5891900 -0.4108100 [82,] -0.4108100 0.5891900 [83,] -0.3380495 -0.4108100 [84,] 0.4223274 -0.3380495 [85,] -0.4108100 0.4223274 [86,] 0.6918330 -0.4108100 [87,] 0.7843368 0.6918330 [88,] -0.3081670 0.7843368 [89,] 0.6918330 -0.3081670 [90,] -0.4750296 0.6918330 [91,] -0.2156632 -0.4750296 [92,] -0.4750296 -0.2156632 [93,] -0.3081670 -0.4750296 [94,] -0.2156632 -0.3081670 [95,] 0.6918330 -0.2156632 [96,] -0.2156632 0.6918330 [97,] -0.3081670 -0.2156632 [98,] -0.3081670 -0.3081670 [99,] 0.6918330 -0.3081670 [100,] 0.6918330 0.6918330 [101,] -0.3081670 0.6918330 [102,] -0.3081670 -0.3081670 [103,] -0.3081670 -0.3081670 [104,] -0.2156632 -0.3081670 [105,] -0.3081670 -0.2156632 [106,] -0.3081670 -0.3081670 [107,] -0.2156632 -0.3081670 [108,] -0.3081670 -0.2156632 [109,] -0.3081670 -0.3081670 [110,] -0.3825258 -0.3081670 [111,] -0.2156632 -0.3825258 [112,] -0.3081670 -0.2156632 [113,] -0.2156632 -0.3081670 [114,] -0.3081670 -0.2156632 [115,] -0.3081670 -0.3081670 [116,] 0.6918330 -0.3081670 [117,] -0.3081670 0.6918330 [118,] -0.3081670 -0.3081670 [119,] 0.6918330 -0.3081670 [120,] -0.3081670 0.6918330 [121,] -0.3081670 -0.3081670 [122,] -0.2156632 -0.3081670 [123,] 0.5249704 -0.2156632 [124,] 0.6918330 0.5249704 [125,] -0.2156632 0.6918330 [126,] -0.4750296 -0.2156632 [127,] 0.6918330 -0.4750296 [128,] -0.3081670 0.6918330 [129,] 0.6918330 -0.3081670 [130,] -0.3081670 0.6918330 [131,] 0.6918330 -0.3081670 [132,] -0.3081670 0.6918330 [133,] -0.3081670 -0.3081670 [134,] -0.3081670 -0.3081670 [135,] -0.3081670 -0.3081670 [136,] 0.5249704 -0.3081670 [137,] 0.6174742 0.5249704 [138,] -0.2156632 0.6174742 [139,] -0.3081670 -0.2156632 [140,] 0.7645935 -0.3081670 [141,] 0.7843368 0.7645935 [142,] -0.3081670 0.7843368 [143,] 0.5249704 -0.3081670 [144,] -0.4750296 0.5249704 [145,] 0.7843368 -0.4750296 [146,] -0.2156632 0.7843368 [147,] -0.2156632 -0.2156632 [148,] -0.3081670 -0.2156632 [149,] 0.5249704 -0.3081670 [150,] 0.6918330 0.5249704 [151,] -0.2354065 0.6918330 [152,] -0.4022690 -0.2354065 [153,] -0.3081670 -0.4022690 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.4108100 0.5753070 2 -0.4108100 -0.4108100 3 -0.4108100 -0.4108100 4 -0.4108100 -0.4108100 5 0.4223274 -0.4108100 6 -0.4108100 0.4223274 7 -0.4246930 -0.4108100 8 0.5891900 -0.4246930 9 -0.4108100 0.5891900 10 -0.4246930 -0.4108100 11 -0.4108100 -0.4246930 12 -0.5776726 -0.4108100 13 -0.4246930 -0.5776726 14 0.4223274 -0.4246930 15 0.4084445 0.4223274 16 -0.5187949 0.4084445 17 -0.4246930 -0.5187949 18 0.5891900 -0.4246930 19 0.4812051 0.5891900 20 -0.5776726 0.4812051 21 0.4223274 -0.5776726 22 0.4223274 0.4223274 23 0.4223274 0.4223274 24 0.5753070 0.4223274 25 -0.5776726 0.5753070 26 0.5891900 -0.5776726 27 -0.4108100 0.5891900 28 0.5891900 -0.4108100 29 -0.5776726 0.5891900 30 -0.4108100 -0.5776726 31 -0.4108100 -0.4108100 32 -0.5776726 -0.4108100 33 0.5753070 -0.5776726 34 -0.4108100 0.5753070 35 -0.4108100 -0.4108100 36 -0.5915555 -0.4108100 37 0.5891900 -0.5915555 38 0.4223274 0.5891900 39 -0.5915555 0.4223274 40 0.4950880 -0.5915555 41 0.5891900 0.4950880 42 0.4223274 0.5891900 43 -0.4246930 0.4223274 44 -0.5776726 -0.4246930 45 0.4223274 -0.5776726 46 -0.4108100 0.4223274 47 0.5891900 -0.4108100 48 0.4223274 0.5891900 49 -0.4108100 0.4223274 50 -0.4246930 -0.4108100 51 -0.5187949 -0.4246930 52 0.5891900 -0.5187949 53 -0.3380495 0.5891900 54 -0.4108100 -0.3380495 55 0.5753070 -0.4108100 56 0.4223274 0.5753070 57 0.5891900 0.4223274 58 0.5891900 0.5891900 59 0.4812051 0.5891900 60 0.5753070 0.4812051 61 -0.5776726 0.5753070 62 -0.4108100 -0.5776726 63 0.5753070 -0.4108100 64 -0.4108100 0.5753070 65 -0.4108100 -0.4108100 66 -0.5187949 -0.4108100 67 -0.4108100 -0.5187949 68 0.5891900 -0.4108100 69 -0.4108100 0.5891900 70 -0.4108100 -0.4108100 71 0.5891900 -0.4108100 72 0.5891900 0.5891900 73 -0.4108100 0.5891900 74 0.5891900 -0.4108100 75 0.4084445 0.5891900 76 0.5891900 0.4084445 77 0.4223274 0.5891900 78 0.6480676 0.4223274 79 -0.5915555 0.6480676 80 -0.4108100 -0.5915555 81 0.5891900 -0.4108100 82 -0.4108100 0.5891900 83 -0.3380495 -0.4108100 84 0.4223274 -0.3380495 85 -0.4108100 0.4223274 86 0.6918330 -0.4108100 87 0.7843368 0.6918330 88 -0.3081670 0.7843368 89 0.6918330 -0.3081670 90 -0.4750296 0.6918330 91 -0.2156632 -0.4750296 92 -0.4750296 -0.2156632 93 -0.3081670 -0.4750296 94 -0.2156632 -0.3081670 95 0.6918330 -0.2156632 96 -0.2156632 0.6918330 97 -0.3081670 -0.2156632 98 -0.3081670 -0.3081670 99 0.6918330 -0.3081670 100 0.6918330 0.6918330 101 -0.3081670 0.6918330 102 -0.3081670 -0.3081670 103 -0.3081670 -0.3081670 104 -0.2156632 -0.3081670 105 -0.3081670 -0.2156632 106 -0.3081670 -0.3081670 107 -0.2156632 -0.3081670 108 -0.3081670 -0.2156632 109 -0.3081670 -0.3081670 110 -0.3825258 -0.3081670 111 -0.2156632 -0.3825258 112 -0.3081670 -0.2156632 113 -0.2156632 -0.3081670 114 -0.3081670 -0.2156632 115 -0.3081670 -0.3081670 116 0.6918330 -0.3081670 117 -0.3081670 0.6918330 118 -0.3081670 -0.3081670 119 0.6918330 -0.3081670 120 -0.3081670 0.6918330 121 -0.3081670 -0.3081670 122 -0.2156632 -0.3081670 123 0.5249704 -0.2156632 124 0.6918330 0.5249704 125 -0.2156632 0.6918330 126 -0.4750296 -0.2156632 127 0.6918330 -0.4750296 128 -0.3081670 0.6918330 129 0.6918330 -0.3081670 130 -0.3081670 0.6918330 131 0.6918330 -0.3081670 132 -0.3081670 0.6918330 133 -0.3081670 -0.3081670 134 -0.3081670 -0.3081670 135 -0.3081670 -0.3081670 136 0.5249704 -0.3081670 137 0.6174742 0.5249704 138 -0.2156632 0.6174742 139 -0.3081670 -0.2156632 140 0.7645935 -0.3081670 141 0.7843368 0.7645935 142 -0.3081670 0.7843368 143 0.5249704 -0.3081670 144 -0.4750296 0.5249704 145 0.7843368 -0.4750296 146 -0.2156632 0.7843368 147 -0.2156632 -0.2156632 148 -0.3081670 -0.2156632 149 0.5249704 -0.3081670 150 0.6918330 0.5249704 151 -0.2354065 0.6918330 152 -0.4022690 -0.2354065 153 -0.3081670 -0.4022690 > 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/7owo01356226693.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/8rgbg1356226693.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/9abum1356226693.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/10diw61356226693.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