R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(7 + ,7 + ,7 + ,7 + ,7 + ,5 + ,5 + ,5 + ,5 + ,5 + ,6 + ,5 + ,6 + ,4 + ,5 + ,5 + ,5 + ,6 + ,5 + ,6 + ,6 + ,7 + ,5 + ,6 + ,7 + ,6 + ,5 + ,6 + ,5 + ,7 + ,6 + ,3 + ,7 + ,7 + ,7 + ,6 + ,6 + ,6 + ,5 + ,6 + ,4 + ,5 + ,6 + ,4 + ,5 + ,6 + ,3 + ,6 + ,6 + ,6 + ,6 + ,7 + ,7 + ,7 + ,7 + ,3 + ,7 + ,7 + ,4 + ,7 + ,5 + ,6 + ,7 + ,6 + ,6 + ,5 + ,7 + ,7 + ,5 + ,7 + ,2 + ,4 + ,5 + ,2 + ,6 + ,3 + ,7 + ,7 + ,5 + ,7 + ,6 + ,7 + ,6 + ,6 + ,5 + ,6 + ,7 + ,6 + ,6 + ,5 + ,5 + ,3 + ,6 + ,5 + ,7 + ,7 + ,5 + ,6 + ,5 + ,6 + ,5 + ,5 + ,5 + ,6 + ,6 + ,5 + ,5 + ,3 + ,5 + ,1 + ,5 + ,7 + ,7 + ,5 + ,7 + ,5 + ,7 + ,6 + ,5 + ,6 + ,5 + ,6 + ,7 + ,5 + ,7 + ,6 + ,6 + ,7 + ,7 + ,6 + ,5 + ,7 + ,6 + ,5 + ,6 + ,5 + ,6 + ,6 + ,3 + ,6 + ,6 + ,5 + ,6 + ,5 + ,6 + ,4 + ,5 + ,6 + ,4 + ,5 + ,4 + ,3 + ,5 + ,6 + ,5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,7 + ,6 + ,6 + ,7 + ,6 + ,6 + ,5 + ,5 + ,6 + ,6 + ,6 + ,4 + ,5 + ,7 + ,6 + ,7 + ,7 + ,6 + ,6 + ,7 + ,5 + ,6 + ,6 + ,5 + ,5 + ,6 + ,5 + ,6 + ,4 + ,5 + ,5 + ,6 + ,7 + ,7 + ,7 + ,7 + ,6 + ,6 + ,6 + ,6 + ,6 + ,5 + ,6 + ,5 + ,5 + ,6 + ,5 + ,5 + ,5 + ,4 + ,5) + ,dim=c(5 + ,164) + ,dimnames=list(c('Q1' + ,'Q2' + ,'Q3' + ,'Q4' + ,'Q5') + ,1:164)) > y <- array(NA,dim=c(5,164),dimnames=list(c('Q1','Q2','Q3','Q4','Q5'),1:164)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Q1 Q2 Q3 Q4 Q5 1 7 7 7 7 7 2 5 5 5 5 5 3 6 5 6 4 5 4 5 5 6 5 6 5 6 7 5 6 7 6 6 5 6 5 7 7 6 3 7 7 7 8 6 6 6 5 6 9 4 5 6 4 5 10 6 3 6 6 6 11 6 7 7 7 7 12 3 7 7 4 7 13 5 6 7 6 6 14 5 7 7 5 7 15 2 4 5 2 6 16 3 7 7 5 7 17 6 7 6 6 5 18 6 7 6 6 5 19 5 3 6 5 7 20 7 5 6 5 6 21 5 5 5 6 6 22 5 5 3 5 1 23 5 7 7 5 7 24 5 7 6 5 6 25 5 6 7 5 7 26 6 6 7 7 6 27 5 7 6 5 6 28 5 6 6 3 6 29 6 5 6 5 6 30 4 5 6 4 5 31 4 3 5 6 5 32 6 7 7 5 7 33 3 6 4 4 3 34 6 5 5 5 6 35 5 5 6 5 5 36 6 7 7 6 6 37 7 6 7 5 7 38 4 6 6 5 6 39 5 7 6 5 5 40 4 5 4 4 5 41 5 6 7 5 6 42 3 5 7 5 7 43 5 5 7 5 7 44 6 6 5 6 5 45 6 7 7 6 7 46 4 6 5 4 5 47 4 5 5 4 5 48 6 6 6 5 5 49 6 6 6 6 6 50 5 7 6 6 6 51 6 7 7 6 7 52 4 5 5 4 7 53 4 3 7 6 7 54 5 6 6 5 7 55 3 6 5 4 2 56 6 6 7 6 6 57 6 6 7 6 6 58 4 6 6 4 6 59 5 7 7 5 7 60 5 6 5 5 5 61 4 6 6 6 7 62 6 5 6 6 6 63 5 6 6 6 6 64 4 6 5 5 5 65 6 6 7 5 6 66 5 4 7 7 7 67 6 6 6 6 6 68 5 7 7 7 7 69 6 7 7 6 7 70 5 5 4 5 5 71 4 5 5 4 6 72 6 7 7 6 7 73 5 7 7 3 7 74 5 5 6 5 7 75 3 5 7 5 7 76 5 3 0 5 7 77 4 6 6 5 6 78 5 5 6 5 5 79 5 4 3 3 5 80 7 7 7 7 7 81 7 7 7 6 6 82 5 2 6 4 6 83 4 6 6 4 6 84 6 4 6 6 6 85 5 7 7 5 7 86 5 6 7 6 6 87 4 2 6 5 7 88 5 7 7 5 5 89 2 7 7 2 5 90 7 5 7 6 7 91 4 6 6 5 5 92 5 5 7 5 7 93 5 6 7 6 7 94 7 7 5 7 5 95 2 6 6 6 6 96 4 7 7 4 7 97 6 6 7 6 6 98 5 5 6 6 5 99 5 5 6 5 5 100 4 4 5 5 7 101 4 4 6 5 7 102 4 5 6 5 6 103 7 7 7 7 6 104 5 7 7 4 7 105 5 6 7 6 7 106 5 5 6 6 6 107 7 7 7 6 7 108 3 7 7 6 7 109 3 5 5 4 4 110 6 7 6 6 7 111 5 7 6 5 6 112 6 7 6 6 6 113 4 4 3 4 5 114 4 5 5 6 7 115 6 6 6 5 5 116 5 5 7 5 5 117 7 7 7 7 7 118 6 7 6 7 5 119 7 6 5 6 6 120 5 4 6 4 5 121 5 7 7 6 7 122 2 6 7 4 7 123 6 6 7 6 6 124 1 7 7 6 6 125 5 7 7 6 7 126 6 7 6 5 4 127 6 7 6 5 6 128 6 6 6 6 6 129 5 5 7 6 7 130 6 6 7 6 7 131 5 6 6 6 6 132 6 7 7 5 6 133 7 7 7 6 7 134 4 6 2 3 3 135 5 7 6 7 4 136 3 6 5 5 6 137 7 7 6 6 6 138 7 5 6 7 5 139 6 6 6 6 5 140 6 6 5 4 6 141 6 7 6 7 6 142 5 5 6 5 4 143 5 6 5 5 5 144 4 5 5 5 5 145 4 3 7 4 7 146 6 7 5 5 5 147 5 6 6 6 7 148 4 5 5 4 6 149 6 6 6 6 6 150 4 6 7 6 6 151 4 2 6 2 5 152 4 6 7 5 6 153 6 7 6 5 7 154 3 7 7 4 7 155 6 6 7 6 6 156 5 5 6 6 6 157 4 5 7 6 7 158 7 6 6 7 5 159 6 6 5 5 6 160 5 6 4 5 5 161 6 7 7 7 7 162 6 6 6 6 6 163 5 6 5 5 6 164 5 5 5 4 5 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Q2 Q3 Q4 Q5 1.72352 0.10579 -0.06691 0.60265 -0.00752 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -4.5665 -0.4677 0.0436 0.5952 2.1808 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.72352 0.63031 2.734 0.00696 ** Q2 0.10579 0.07292 1.451 0.14878 Q3 -0.06691 0.09365 -0.714 0.47602 Q4 0.60265 0.08274 7.284 1.42e-11 *** Q5 -0.00752 0.09155 -0.082 0.93464 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.011 on 159 degrees of freedom Multiple R-squared: 0.2943, Adjusted R-squared: 0.2765 F-statistic: 16.57 on 4 and 159 DF, p-value: 2.264e-11 > 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.133820690 0.26764138 0.86617931 [2,] 0.319656374 0.63931275 0.68034363 [3,] 0.249974413 0.49994883 0.75002559 [4,] 0.199084072 0.39816814 0.80091593 [5,] 0.422044794 0.84408959 0.57795521 [6,] 0.357698680 0.71539736 0.64230132 [7,] 0.270453675 0.54090735 0.72954633 [8,] 0.272403104 0.54480621 0.72759690 [9,] 0.395946491 0.79189298 0.60405351 [10,] 0.321856206 0.64371241 0.67814379 [11,] 0.251292974 0.50258595 0.74870703 [12,] 0.189096683 0.37819337 0.81090332 [13,] 0.390156215 0.78031243 0.60984378 [14,] 0.443871250 0.88774250 0.55612875 [15,] 0.463417240 0.92683448 0.53658276 [16,] 0.394979963 0.78995993 0.60502004 [17,] 0.327603406 0.65520681 0.67239659 [18,] 0.267252540 0.53450508 0.73274746 [19,] 0.224683436 0.44936687 0.77531656 [20,] 0.176596848 0.35319370 0.82340315 [21,] 0.229363881 0.45872776 0.77063612 [22,] 0.224500113 0.44900023 0.77549989 [23,] 0.188737672 0.37747534 0.81126233 [24,] 0.296199542 0.59239908 0.70380046 [25,] 0.291098195 0.58219639 0.70890180 [26,] 0.343394657 0.68678931 0.65660534 [27,] 0.343120605 0.68624121 0.65687939 [28,] 0.290716983 0.58143397 0.70928302 [29,] 0.247553376 0.49510675 0.75244662 [30,] 0.382374125 0.76474825 0.61762587 [31,] 0.389333051 0.77866610 0.61066695 [32,] 0.336623559 0.67324712 0.66337644 [33,] 0.291355834 0.58271167 0.70864417 [34,] 0.246856308 0.49371262 0.75314369 [35,] 0.394632110 0.78926422 0.60536789 [36,] 0.345358045 0.69071609 0.65464195 [37,] 0.302867947 0.60573589 0.69713205 [38,] 0.261941513 0.52388303 0.73805849 [39,] 0.225862219 0.45172444 0.77413778 [40,] 0.190971063 0.38194213 0.80902894 [41,] 0.192839397 0.38567879 0.80716060 [42,] 0.163207334 0.32641467 0.83679267 [43,] 0.149473121 0.29894624 0.85052688 [44,] 0.124198271 0.24839654 0.87580173 [45,] 0.101733441 0.20346688 0.89826656 [46,] 0.124682869 0.24936574 0.87531713 [47,] 0.100809781 0.20161956 0.89919022 [48,] 0.118362165 0.23672433 0.88163783 [49,] 0.099787991 0.19957598 0.90021201 [50,] 0.083389098 0.16677820 0.91661090 [51,] 0.067795874 0.13559175 0.93220413 [52,] 0.053506272 0.10701254 0.94649373 [53,] 0.041439841 0.08287968 0.95856016 [54,] 0.065030526 0.13006105 0.93496947 [55,] 0.054511700 0.10902340 0.94548830 [56,] 0.046595221 0.09319044 0.95340478 [57,] 0.045977343 0.09195469 0.95402266 [58,] 0.047414510 0.09482902 0.95258549 [59,] 0.047792673 0.09558535 0.95220733 [60,] 0.039085131 0.07817026 0.96091487 [61,] 0.045409984 0.09081997 0.95459002 [62,] 0.036720283 0.07344057 0.96327972 [63,] 0.028594312 0.05718862 0.97140569 [64,] 0.022090366 0.04418073 0.97790963 [65,] 0.017419751 0.03483950 0.98258025 [66,] 0.019549912 0.03909982 0.98045009 [67,] 0.014841318 0.02968264 0.98515868 [68,] 0.028814914 0.05762983 0.97118509 [69,] 0.022758252 0.04551650 0.97724175 [70,] 0.022042725 0.04408545 0.97795727 [71,] 0.016790078 0.03358016 0.98320992 [72,] 0.020404888 0.04080978 0.97959511 [73,] 0.018707262 0.03741452 0.98129274 [74,] 0.024566270 0.04913254 0.97543373 [75,] 0.025689583 0.05137917 0.97431042 [76,] 0.020282509 0.04056502 0.97971749 [77,] 0.017353272 0.03470654 0.98264673 [78,] 0.013141383 0.02628277 0.98685862 [79,] 0.010447181 0.02089436 0.98955282 [80,] 0.008366266 0.01673253 0.99163373 [81,] 0.006088348 0.01217670 0.99391165 [82,] 0.006842508 0.01368502 0.99315749 [83,] 0.011923189 0.02384638 0.98807681 [84,] 0.011600161 0.02320032 0.98839984 [85,] 0.008923267 0.01784653 0.99107673 [86,] 0.007002928 0.01400586 0.99299707 [87,] 0.005802426 0.01160485 0.99419757 [88,] 0.100852093 0.20170419 0.89914791 [89,] 0.084078590 0.16815718 0.91592141 [90,] 0.072188049 0.14437610 0.92781195 [91,] 0.059871247 0.11974249 0.94012875 [92,] 0.047571099 0.09514220 0.95242890 [93,] 0.041580993 0.08316199 0.95841901 [94,] 0.035535641 0.07107128 0.96446436 [95,] 0.031952850 0.06390570 0.96804715 [96,] 0.029273581 0.05854716 0.97072642 [97,] 0.025312503 0.05062501 0.97468750 [98,] 0.020037047 0.04007409 0.97996295 [99,] 0.015686175 0.03137235 0.98431383 [100,] 0.022109335 0.04421867 0.97789066 [101,] 0.071356752 0.14271350 0.92864325 [102,] 0.087650095 0.17530019 0.91234991 [103,] 0.073661953 0.14732391 0.92633805 [104,] 0.058199438 0.11639888 0.94180056 [105,] 0.047057243 0.09411449 0.95294276 [106,] 0.039369983 0.07873997 0.96063002 [107,] 0.053766734 0.10753347 0.94623327 [108,] 0.053919892 0.10783978 0.94608011 [109,] 0.042485683 0.08497137 0.95751432 [110,] 0.041455324 0.08291065 0.95854468 [111,] 0.031908050 0.06381610 0.96809195 [112,] 0.036674953 0.07334991 0.96332505 [113,] 0.032181638 0.06436328 0.96781836 [114,] 0.025137447 0.05027489 0.97486255 [115,] 0.059058796 0.11811759 0.94094120 [116,] 0.049870639 0.09974128 0.95012936 [117,] 0.798164563 0.40367087 0.20183544 [118,] 0.773743665 0.45251267 0.22625634 [119,] 0.747199804 0.50560039 0.25280020 [120,] 0.730149467 0.53970107 0.26985053 [121,] 0.691104677 0.61779065 0.30889532 [122,] 0.642741997 0.71451601 0.35725800 [123,] 0.603827844 0.79234431 0.39617216 [124,] 0.561449629 0.87710074 0.43855037 [125,] 0.554689465 0.89062107 0.44531054 [126,] 0.643717125 0.71256575 0.35628288 [127,] 0.624610079 0.75077984 0.37538992 [128,] 0.692262105 0.61547579 0.30773790 [129,] 0.885490221 0.22901956 0.11450978 [130,] 0.919519597 0.16096081 0.08048040 [131,] 0.916746461 0.16650708 0.08325354 [132,] 0.892246140 0.21550772 0.10775386 [133,] 0.923869251 0.15226150 0.07613075 [134,] 0.893045845 0.21390831 0.10695415 [135,] 0.855378471 0.28924306 0.14462153 [136,] 0.814780132 0.37043974 0.18521987 [137,] 0.882569448 0.23486110 0.11743055 [138,] 0.850551211 0.29889758 0.14944879 [139,] 0.801709132 0.39658174 0.19829087 [140,] 0.737193495 0.52561301 0.26280651 [141,] 0.697204941 0.60559012 0.30279506 [142,] 0.627999950 0.74400010 0.37200005 [143,] 0.688288114 0.62342377 0.31171189 [144,] 0.797517656 0.40496469 0.20248234 [145,] 0.741701913 0.51659617 0.25829809 [146,] 0.839607133 0.32078573 0.16039287 [147,] 0.920367120 0.15926576 0.07963288 [148,] 0.843262474 0.31347505 0.15673753 [149,] 0.719764385 0.56047123 0.28023562 > postscript(file="/var/www/rcomp/tmp/1xkdr1322059309.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/2hsz51322059309.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/3vfsg1322059309.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/4cg9r1322059309.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/5o6ny1322059309.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 0.8383424266 0.1063820621 1.7759422899 0.1808091516 0.3071803180 6 7 8 9 10 1.1883287958 0.2615189265 1.0750150267 -0.2240577101 0.7897446192 11 12 13 14 15 -0.1616575734 -1.3536992264 -0.4607303102 0.0436479913 -0.9723458218 16 17 18 19 20 -1.9563520087 0.3590484753 0.3590484753 0.3999170457 2.1808091516 21 22 23 24 25 -0.4887510761 -0.0575114053 0.0436479913 -0.0307790983 0.1494421163 26 27 28 29 30 -0.0633830925 -0.0307790983 1.2803205914 1.1808091516 -0.2240577101 31 32 33 34 35 -1.2846824703 1.0436479913 -1.4787060142 1.1139017062 0.1732895075 36 37 38 39 40 0.4334755648 2.1494421163 -0.9249849733 -0.0382987424 -0.3578726010 41 42 43 44 45 0.1419224721 -1.7447637588 0.2552362412 0.3979351548 0.4409952090 46 47 48 49 50 -0.3967592805 -0.2909651556 1.0674953826 0.4723622443 -0.6334318806 51 52 53 54 55 0.4409952090 -0.2759258674 -1.1358282912 0.0825346708 -1.4193182129 56 57 58 59 60 0.5392696898 0.5392696898 -0.3223321910 0.0436479913 0.0005879371 61 62 63 64 65 -1.5201181115 0.5781563693 -0.5276377557 -0.9994120629 1.1419224721 66 67 68 69 70 -0.8442751985 0.4723622443 -1.1616575734 0.4409952090 0.0394746166 71 72 73 74 75 -0.2834455115 0.4409952090 1.2489535560 0.1883287958 -1.7447637588 76 77 78 79 80 -0.0015276270 -0.9249849733 0.1732895075 1.2836668608 0.8383424266 81 82 83 84 85 1.4334755648 1.1008443089 -0.3223321910 0.6839504943 0.0436479913 86 87 88 89 90 -0.4607303102 -0.4942888294 0.0286087031 -1.1634329499 1.6525834589 91 92 93 94 95 -0.9325046174 0.2552362412 -0.4532106661 0.6894882475 -3.5276377557 96 97 98 99 100 -0.3536992264 0.5392696898 -0.4293632748 0.1732895075 -0.7727845247 101 102 103 104 105 -0.7058770793 -0.8191908484 0.8308227825 0.6463007736 -0.4532106661 106 107 108 109 110 -0.4218436307 1.4409952090 -2.5590047910 -1.2984847997 0.3740877635 111 112 113 114 115 -0.0307790983 0.3665681194 -0.3189859215 -1.4812314320 1.0674953826 116 117 118 119 120 0.2401969530 0.8383424266 -0.2436043071 1.4054547989 0.8817364148 121 122 123 124 125 -0.5590047910 -2.2479051014 0.5392696898 -4.5665244352 -0.5590047910 126 127 128 129 130 0.9541816135 0.9692209017 0.4723622443 -0.3474165411 0.5467893339 131 132 133 134 135 -0.5276377557 1.0361283472 1.4409952090 -0.0098681228 -1.2511239512 136 137 138 139 140 -1.9918924188 1.3665681194 0.9679839429 0.4648426002 1.6107603636 141 142 143 144 145 -0.2360846629 0.1657698634 0.0005879371 -0.8936179379 0.0694772735 146 147 148 149 150 0.8947938122 -0.5201181115 -0.2834455115 0.4723622443 -1.4607303102 151 152 153 154 155 1.2986302294 -0.8580775279 0.9767405458 -1.3536992264 0.5392696898 156 157 158 159 160 -0.4218436307 -1.3474165411 0.8621898179 1.0081075812 -0.0663195083 161 162 163 164 -0.1616575734 0.4723622443 0.0081075812 0.7090348444 > postscript(file="/var/www/rcomp/tmp/64b7z1322059309.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 0.8383424266 NA 1 0.1063820621 0.8383424266 2 1.7759422899 0.1063820621 3 0.1808091516 1.7759422899 4 0.3071803180 0.1808091516 5 1.1883287958 0.3071803180 6 0.2615189265 1.1883287958 7 1.0750150267 0.2615189265 8 -0.2240577101 1.0750150267 9 0.7897446192 -0.2240577101 10 -0.1616575734 0.7897446192 11 -1.3536992264 -0.1616575734 12 -0.4607303102 -1.3536992264 13 0.0436479913 -0.4607303102 14 -0.9723458218 0.0436479913 15 -1.9563520087 -0.9723458218 16 0.3590484753 -1.9563520087 17 0.3590484753 0.3590484753 18 0.3999170457 0.3590484753 19 2.1808091516 0.3999170457 20 -0.4887510761 2.1808091516 21 -0.0575114053 -0.4887510761 22 0.0436479913 -0.0575114053 23 -0.0307790983 0.0436479913 24 0.1494421163 -0.0307790983 25 -0.0633830925 0.1494421163 26 -0.0307790983 -0.0633830925 27 1.2803205914 -0.0307790983 28 1.1808091516 1.2803205914 29 -0.2240577101 1.1808091516 30 -1.2846824703 -0.2240577101 31 1.0436479913 -1.2846824703 32 -1.4787060142 1.0436479913 33 1.1139017062 -1.4787060142 34 0.1732895075 1.1139017062 35 0.4334755648 0.1732895075 36 2.1494421163 0.4334755648 37 -0.9249849733 2.1494421163 38 -0.0382987424 -0.9249849733 39 -0.3578726010 -0.0382987424 40 0.1419224721 -0.3578726010 41 -1.7447637588 0.1419224721 42 0.2552362412 -1.7447637588 43 0.3979351548 0.2552362412 44 0.4409952090 0.3979351548 45 -0.3967592805 0.4409952090 46 -0.2909651556 -0.3967592805 47 1.0674953826 -0.2909651556 48 0.4723622443 1.0674953826 49 -0.6334318806 0.4723622443 50 0.4409952090 -0.6334318806 51 -0.2759258674 0.4409952090 52 -1.1358282912 -0.2759258674 53 0.0825346708 -1.1358282912 54 -1.4193182129 0.0825346708 55 0.5392696898 -1.4193182129 56 0.5392696898 0.5392696898 57 -0.3223321910 0.5392696898 58 0.0436479913 -0.3223321910 59 0.0005879371 0.0436479913 60 -1.5201181115 0.0005879371 61 0.5781563693 -1.5201181115 62 -0.5276377557 0.5781563693 63 -0.9994120629 -0.5276377557 64 1.1419224721 -0.9994120629 65 -0.8442751985 1.1419224721 66 0.4723622443 -0.8442751985 67 -1.1616575734 0.4723622443 68 0.4409952090 -1.1616575734 69 0.0394746166 0.4409952090 70 -0.2834455115 0.0394746166 71 0.4409952090 -0.2834455115 72 1.2489535560 0.4409952090 73 0.1883287958 1.2489535560 74 -1.7447637588 0.1883287958 75 -0.0015276270 -1.7447637588 76 -0.9249849733 -0.0015276270 77 0.1732895075 -0.9249849733 78 1.2836668608 0.1732895075 79 0.8383424266 1.2836668608 80 1.4334755648 0.8383424266 81 1.1008443089 1.4334755648 82 -0.3223321910 1.1008443089 83 0.6839504943 -0.3223321910 84 0.0436479913 0.6839504943 85 -0.4607303102 0.0436479913 86 -0.4942888294 -0.4607303102 87 0.0286087031 -0.4942888294 88 -1.1634329499 0.0286087031 89 1.6525834589 -1.1634329499 90 -0.9325046174 1.6525834589 91 0.2552362412 -0.9325046174 92 -0.4532106661 0.2552362412 93 0.6894882475 -0.4532106661 94 -3.5276377557 0.6894882475 95 -0.3536992264 -3.5276377557 96 0.5392696898 -0.3536992264 97 -0.4293632748 0.5392696898 98 0.1732895075 -0.4293632748 99 -0.7727845247 0.1732895075 100 -0.7058770793 -0.7727845247 101 -0.8191908484 -0.7058770793 102 0.8308227825 -0.8191908484 103 0.6463007736 0.8308227825 104 -0.4532106661 0.6463007736 105 -0.4218436307 -0.4532106661 106 1.4409952090 -0.4218436307 107 -2.5590047910 1.4409952090 108 -1.2984847997 -2.5590047910 109 0.3740877635 -1.2984847997 110 -0.0307790983 0.3740877635 111 0.3665681194 -0.0307790983 112 -0.3189859215 0.3665681194 113 -1.4812314320 -0.3189859215 114 1.0674953826 -1.4812314320 115 0.2401969530 1.0674953826 116 0.8383424266 0.2401969530 117 -0.2436043071 0.8383424266 118 1.4054547989 -0.2436043071 119 0.8817364148 1.4054547989 120 -0.5590047910 0.8817364148 121 -2.2479051014 -0.5590047910 122 0.5392696898 -2.2479051014 123 -4.5665244352 0.5392696898 124 -0.5590047910 -4.5665244352 125 0.9541816135 -0.5590047910 126 0.9692209017 0.9541816135 127 0.4723622443 0.9692209017 128 -0.3474165411 0.4723622443 129 0.5467893339 -0.3474165411 130 -0.5276377557 0.5467893339 131 1.0361283472 -0.5276377557 132 1.4409952090 1.0361283472 133 -0.0098681228 1.4409952090 134 -1.2511239512 -0.0098681228 135 -1.9918924188 -1.2511239512 136 1.3665681194 -1.9918924188 137 0.9679839429 1.3665681194 138 0.4648426002 0.9679839429 139 1.6107603636 0.4648426002 140 -0.2360846629 1.6107603636 141 0.1657698634 -0.2360846629 142 0.0005879371 0.1657698634 143 -0.8936179379 0.0005879371 144 0.0694772735 -0.8936179379 145 0.8947938122 0.0694772735 146 -0.5201181115 0.8947938122 147 -0.2834455115 -0.5201181115 148 0.4723622443 -0.2834455115 149 -1.4607303102 0.4723622443 150 1.2986302294 -1.4607303102 151 -0.8580775279 1.2986302294 152 0.9767405458 -0.8580775279 153 -1.3536992264 0.9767405458 154 0.5392696898 -1.3536992264 155 -0.4218436307 0.5392696898 156 -1.3474165411 -0.4218436307 157 0.8621898179 -1.3474165411 158 1.0081075812 0.8621898179 159 -0.0663195083 1.0081075812 160 -0.1616575734 -0.0663195083 161 0.4723622443 -0.1616575734 162 0.0081075812 0.4723622443 163 0.7090348444 0.0081075812 164 NA 0.7090348444 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.1063820621 0.8383424266 [2,] 1.7759422899 0.1063820621 [3,] 0.1808091516 1.7759422899 [4,] 0.3071803180 0.1808091516 [5,] 1.1883287958 0.3071803180 [6,] 0.2615189265 1.1883287958 [7,] 1.0750150267 0.2615189265 [8,] -0.2240577101 1.0750150267 [9,] 0.7897446192 -0.2240577101 [10,] -0.1616575734 0.7897446192 [11,] -1.3536992264 -0.1616575734 [12,] -0.4607303102 -1.3536992264 [13,] 0.0436479913 -0.4607303102 [14,] -0.9723458218 0.0436479913 [15,] -1.9563520087 -0.9723458218 [16,] 0.3590484753 -1.9563520087 [17,] 0.3590484753 0.3590484753 [18,] 0.3999170457 0.3590484753 [19,] 2.1808091516 0.3999170457 [20,] -0.4887510761 2.1808091516 [21,] -0.0575114053 -0.4887510761 [22,] 0.0436479913 -0.0575114053 [23,] -0.0307790983 0.0436479913 [24,] 0.1494421163 -0.0307790983 [25,] -0.0633830925 0.1494421163 [26,] -0.0307790983 -0.0633830925 [27,] 1.2803205914 -0.0307790983 [28,] 1.1808091516 1.2803205914 [29,] -0.2240577101 1.1808091516 [30,] -1.2846824703 -0.2240577101 [31,] 1.0436479913 -1.2846824703 [32,] -1.4787060142 1.0436479913 [33,] 1.1139017062 -1.4787060142 [34,] 0.1732895075 1.1139017062 [35,] 0.4334755648 0.1732895075 [36,] 2.1494421163 0.4334755648 [37,] -0.9249849733 2.1494421163 [38,] -0.0382987424 -0.9249849733 [39,] -0.3578726010 -0.0382987424 [40,] 0.1419224721 -0.3578726010 [41,] -1.7447637588 0.1419224721 [42,] 0.2552362412 -1.7447637588 [43,] 0.3979351548 0.2552362412 [44,] 0.4409952090 0.3979351548 [45,] -0.3967592805 0.4409952090 [46,] -0.2909651556 -0.3967592805 [47,] 1.0674953826 -0.2909651556 [48,] 0.4723622443 1.0674953826 [49,] -0.6334318806 0.4723622443 [50,] 0.4409952090 -0.6334318806 [51,] -0.2759258674 0.4409952090 [52,] -1.1358282912 -0.2759258674 [53,] 0.0825346708 -1.1358282912 [54,] -1.4193182129 0.0825346708 [55,] 0.5392696898 -1.4193182129 [56,] 0.5392696898 0.5392696898 [57,] -0.3223321910 0.5392696898 [58,] 0.0436479913 -0.3223321910 [59,] 0.0005879371 0.0436479913 [60,] -1.5201181115 0.0005879371 [61,] 0.5781563693 -1.5201181115 [62,] -0.5276377557 0.5781563693 [63,] -0.9994120629 -0.5276377557 [64,] 1.1419224721 -0.9994120629 [65,] -0.8442751985 1.1419224721 [66,] 0.4723622443 -0.8442751985 [67,] -1.1616575734 0.4723622443 [68,] 0.4409952090 -1.1616575734 [69,] 0.0394746166 0.4409952090 [70,] -0.2834455115 0.0394746166 [71,] 0.4409952090 -0.2834455115 [72,] 1.2489535560 0.4409952090 [73,] 0.1883287958 1.2489535560 [74,] -1.7447637588 0.1883287958 [75,] -0.0015276270 -1.7447637588 [76,] -0.9249849733 -0.0015276270 [77,] 0.1732895075 -0.9249849733 [78,] 1.2836668608 0.1732895075 [79,] 0.8383424266 1.2836668608 [80,] 1.4334755648 0.8383424266 [81,] 1.1008443089 1.4334755648 [82,] -0.3223321910 1.1008443089 [83,] 0.6839504943 -0.3223321910 [84,] 0.0436479913 0.6839504943 [85,] -0.4607303102 0.0436479913 [86,] -0.4942888294 -0.4607303102 [87,] 0.0286087031 -0.4942888294 [88,] -1.1634329499 0.0286087031 [89,] 1.6525834589 -1.1634329499 [90,] -0.9325046174 1.6525834589 [91,] 0.2552362412 -0.9325046174 [92,] -0.4532106661 0.2552362412 [93,] 0.6894882475 -0.4532106661 [94,] -3.5276377557 0.6894882475 [95,] -0.3536992264 -3.5276377557 [96,] 0.5392696898 -0.3536992264 [97,] -0.4293632748 0.5392696898 [98,] 0.1732895075 -0.4293632748 [99,] -0.7727845247 0.1732895075 [100,] -0.7058770793 -0.7727845247 [101,] -0.8191908484 -0.7058770793 [102,] 0.8308227825 -0.8191908484 [103,] 0.6463007736 0.8308227825 [104,] -0.4532106661 0.6463007736 [105,] -0.4218436307 -0.4532106661 [106,] 1.4409952090 -0.4218436307 [107,] -2.5590047910 1.4409952090 [108,] -1.2984847997 -2.5590047910 [109,] 0.3740877635 -1.2984847997 [110,] -0.0307790983 0.3740877635 [111,] 0.3665681194 -0.0307790983 [112,] -0.3189859215 0.3665681194 [113,] -1.4812314320 -0.3189859215 [114,] 1.0674953826 -1.4812314320 [115,] 0.2401969530 1.0674953826 [116,] 0.8383424266 0.2401969530 [117,] -0.2436043071 0.8383424266 [118,] 1.4054547989 -0.2436043071 [119,] 0.8817364148 1.4054547989 [120,] -0.5590047910 0.8817364148 [121,] -2.2479051014 -0.5590047910 [122,] 0.5392696898 -2.2479051014 [123,] -4.5665244352 0.5392696898 [124,] -0.5590047910 -4.5665244352 [125,] 0.9541816135 -0.5590047910 [126,] 0.9692209017 0.9541816135 [127,] 0.4723622443 0.9692209017 [128,] -0.3474165411 0.4723622443 [129,] 0.5467893339 -0.3474165411 [130,] -0.5276377557 0.5467893339 [131,] 1.0361283472 -0.5276377557 [132,] 1.4409952090 1.0361283472 [133,] -0.0098681228 1.4409952090 [134,] -1.2511239512 -0.0098681228 [135,] -1.9918924188 -1.2511239512 [136,] 1.3665681194 -1.9918924188 [137,] 0.9679839429 1.3665681194 [138,] 0.4648426002 0.9679839429 [139,] 1.6107603636 0.4648426002 [140,] -0.2360846629 1.6107603636 [141,] 0.1657698634 -0.2360846629 [142,] 0.0005879371 0.1657698634 [143,] -0.8936179379 0.0005879371 [144,] 0.0694772735 -0.8936179379 [145,] 0.8947938122 0.0694772735 [146,] -0.5201181115 0.8947938122 [147,] -0.2834455115 -0.5201181115 [148,] 0.4723622443 -0.2834455115 [149,] -1.4607303102 0.4723622443 [150,] 1.2986302294 -1.4607303102 [151,] -0.8580775279 1.2986302294 [152,] 0.9767405458 -0.8580775279 [153,] -1.3536992264 0.9767405458 [154,] 0.5392696898 -1.3536992264 [155,] -0.4218436307 0.5392696898 [156,] -1.3474165411 -0.4218436307 [157,] 0.8621898179 -1.3474165411 [158,] 1.0081075812 0.8621898179 [159,] -0.0663195083 1.0081075812 [160,] -0.1616575734 -0.0663195083 [161,] 0.4723622443 -0.1616575734 [162,] 0.0081075812 0.4723622443 [163,] 0.7090348444 0.0081075812 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.1063820621 0.8383424266 2 1.7759422899 0.1063820621 3 0.1808091516 1.7759422899 4 0.3071803180 0.1808091516 5 1.1883287958 0.3071803180 6 0.2615189265 1.1883287958 7 1.0750150267 0.2615189265 8 -0.2240577101 1.0750150267 9 0.7897446192 -0.2240577101 10 -0.1616575734 0.7897446192 11 -1.3536992264 -0.1616575734 12 -0.4607303102 -1.3536992264 13 0.0436479913 -0.4607303102 14 -0.9723458218 0.0436479913 15 -1.9563520087 -0.9723458218 16 0.3590484753 -1.9563520087 17 0.3590484753 0.3590484753 18 0.3999170457 0.3590484753 19 2.1808091516 0.3999170457 20 -0.4887510761 2.1808091516 21 -0.0575114053 -0.4887510761 22 0.0436479913 -0.0575114053 23 -0.0307790983 0.0436479913 24 0.1494421163 -0.0307790983 25 -0.0633830925 0.1494421163 26 -0.0307790983 -0.0633830925 27 1.2803205914 -0.0307790983 28 1.1808091516 1.2803205914 29 -0.2240577101 1.1808091516 30 -1.2846824703 -0.2240577101 31 1.0436479913 -1.2846824703 32 -1.4787060142 1.0436479913 33 1.1139017062 -1.4787060142 34 0.1732895075 1.1139017062 35 0.4334755648 0.1732895075 36 2.1494421163 0.4334755648 37 -0.9249849733 2.1494421163 38 -0.0382987424 -0.9249849733 39 -0.3578726010 -0.0382987424 40 0.1419224721 -0.3578726010 41 -1.7447637588 0.1419224721 42 0.2552362412 -1.7447637588 43 0.3979351548 0.2552362412 44 0.4409952090 0.3979351548 45 -0.3967592805 0.4409952090 46 -0.2909651556 -0.3967592805 47 1.0674953826 -0.2909651556 48 0.4723622443 1.0674953826 49 -0.6334318806 0.4723622443 50 0.4409952090 -0.6334318806 51 -0.2759258674 0.4409952090 52 -1.1358282912 -0.2759258674 53 0.0825346708 -1.1358282912 54 -1.4193182129 0.0825346708 55 0.5392696898 -1.4193182129 56 0.5392696898 0.5392696898 57 -0.3223321910 0.5392696898 58 0.0436479913 -0.3223321910 59 0.0005879371 0.0436479913 60 -1.5201181115 0.0005879371 61 0.5781563693 -1.5201181115 62 -0.5276377557 0.5781563693 63 -0.9994120629 -0.5276377557 64 1.1419224721 -0.9994120629 65 -0.8442751985 1.1419224721 66 0.4723622443 -0.8442751985 67 -1.1616575734 0.4723622443 68 0.4409952090 -1.1616575734 69 0.0394746166 0.4409952090 70 -0.2834455115 0.0394746166 71 0.4409952090 -0.2834455115 72 1.2489535560 0.4409952090 73 0.1883287958 1.2489535560 74 -1.7447637588 0.1883287958 75 -0.0015276270 -1.7447637588 76 -0.9249849733 -0.0015276270 77 0.1732895075 -0.9249849733 78 1.2836668608 0.1732895075 79 0.8383424266 1.2836668608 80 1.4334755648 0.8383424266 81 1.1008443089 1.4334755648 82 -0.3223321910 1.1008443089 83 0.6839504943 -0.3223321910 84 0.0436479913 0.6839504943 85 -0.4607303102 0.0436479913 86 -0.4942888294 -0.4607303102 87 0.0286087031 -0.4942888294 88 -1.1634329499 0.0286087031 89 1.6525834589 -1.1634329499 90 -0.9325046174 1.6525834589 91 0.2552362412 -0.9325046174 92 -0.4532106661 0.2552362412 93 0.6894882475 -0.4532106661 94 -3.5276377557 0.6894882475 95 -0.3536992264 -3.5276377557 96 0.5392696898 -0.3536992264 97 -0.4293632748 0.5392696898 98 0.1732895075 -0.4293632748 99 -0.7727845247 0.1732895075 100 -0.7058770793 -0.7727845247 101 -0.8191908484 -0.7058770793 102 0.8308227825 -0.8191908484 103 0.6463007736 0.8308227825 104 -0.4532106661 0.6463007736 105 -0.4218436307 -0.4532106661 106 1.4409952090 -0.4218436307 107 -2.5590047910 1.4409952090 108 -1.2984847997 -2.5590047910 109 0.3740877635 -1.2984847997 110 -0.0307790983 0.3740877635 111 0.3665681194 -0.0307790983 112 -0.3189859215 0.3665681194 113 -1.4812314320 -0.3189859215 114 1.0674953826 -1.4812314320 115 0.2401969530 1.0674953826 116 0.8383424266 0.2401969530 117 -0.2436043071 0.8383424266 118 1.4054547989 -0.2436043071 119 0.8817364148 1.4054547989 120 -0.5590047910 0.8817364148 121 -2.2479051014 -0.5590047910 122 0.5392696898 -2.2479051014 123 -4.5665244352 0.5392696898 124 -0.5590047910 -4.5665244352 125 0.9541816135 -0.5590047910 126 0.9692209017 0.9541816135 127 0.4723622443 0.9692209017 128 -0.3474165411 0.4723622443 129 0.5467893339 -0.3474165411 130 -0.5276377557 0.5467893339 131 1.0361283472 -0.5276377557 132 1.4409952090 1.0361283472 133 -0.0098681228 1.4409952090 134 -1.2511239512 -0.0098681228 135 -1.9918924188 -1.2511239512 136 1.3665681194 -1.9918924188 137 0.9679839429 1.3665681194 138 0.4648426002 0.9679839429 139 1.6107603636 0.4648426002 140 -0.2360846629 1.6107603636 141 0.1657698634 -0.2360846629 142 0.0005879371 0.1657698634 143 -0.8936179379 0.0005879371 144 0.0694772735 -0.8936179379 145 0.8947938122 0.0694772735 146 -0.5201181115 0.8947938122 147 -0.2834455115 -0.5201181115 148 0.4723622443 -0.2834455115 149 -1.4607303102 0.4723622443 150 1.2986302294 -1.4607303102 151 -0.8580775279 1.2986302294 152 0.9767405458 -0.8580775279 153 -1.3536992264 0.9767405458 154 0.5392696898 -1.3536992264 155 -0.4218436307 0.5392696898 156 -1.3474165411 -0.4218436307 157 0.8621898179 -1.3474165411 158 1.0081075812 0.8621898179 159 -0.0663195083 1.0081075812 160 -0.1616575734 -0.0663195083 161 0.4723622443 -0.1616575734 162 0.0081075812 0.4723622443 163 0.7090348444 0.0081075812 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/72jkr1322059309.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/8mbik1322059309.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/rcomp/tmp/9vwbd1322059309.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/rcomp/tmp/10obik1322059309.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > 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/www/rcomp/tmp/11qb131322059309.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/www/rcomp/tmp/12raug1322059309.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/www/rcomp/tmp/13hhem1322059309.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/www/rcomp/tmp/14tmlv1322059309.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/www/rcomp/tmp/1556ns1322059309.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/www/rcomp/tmp/16h5cd1322059309.tab") + } > > try(system("convert tmp/1xkdr1322059309.ps tmp/1xkdr1322059309.png",intern=TRUE)) character(0) > try(system("convert tmp/2hsz51322059309.ps tmp/2hsz51322059309.png",intern=TRUE)) character(0) > try(system("convert tmp/3vfsg1322059309.ps tmp/3vfsg1322059309.png",intern=TRUE)) character(0) > try(system("convert tmp/4cg9r1322059309.ps tmp/4cg9r1322059309.png",intern=TRUE)) character(0) > try(system("convert tmp/5o6ny1322059309.ps tmp/5o6ny1322059309.png",intern=TRUE)) character(0) > try(system("convert tmp/64b7z1322059309.ps tmp/64b7z1322059309.png",intern=TRUE)) character(0) > try(system("convert tmp/72jkr1322059309.ps tmp/72jkr1322059309.png",intern=TRUE)) character(0) > try(system("convert tmp/8mbik1322059309.ps tmp/8mbik1322059309.png",intern=TRUE)) character(0) > try(system("convert tmp/9vwbd1322059309.ps tmp/9vwbd1322059309.png",intern=TRUE)) character(0) > try(system("convert tmp/10obik1322059309.ps tmp/10obik1322059309.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.460 0.350 5.787