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(4 + ,2 + ,5 + ,4 + ,3 + ,4 + ,2 + ,4 + ,3 + ,2 + ,5 + ,4 + ,4 + ,2 + ,2 + ,3 + ,2 + ,4 + ,2 + ,2 + ,4 + ,3 + ,2 + ,2 + ,2 + ,3 + ,4 + ,5 + ,2 + ,2 + ,4 + ,3 + ,5 + ,3 + ,2 + ,3 + ,3 + ,4 + ,2 + ,1 + ,2 + ,3 + ,3 + ,1 + ,2 + ,4 + ,2 + ,4 + ,2 + ,2 + ,2 + ,4 + ,4 + ,2 + ,2 + ,2 + ,3 + ,3 + ,2 + ,2 + ,1 + ,3 + ,3 + ,2 + ,2 + ,4 + ,4 + ,4 + ,2 + ,2 + ,4 + ,4 + ,5 + ,1 + ,1 + ,2 + ,3 + ,4 + ,2 + ,2 + ,2 + ,3 + ,2 + ,2 + ,1 + ,3 + ,3 + ,4 + ,3 + ,2 + ,3 + ,4 + ,4 + ,4 + ,2 + ,3 + ,2 + ,4 + ,4 + ,2 + ,4 + ,5 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,4 + ,2 + ,2 + ,2 + ,4 + ,4 + ,4 + ,2 + ,3 + ,5 + ,2 + ,2 + ,4 + ,4 + ,4 + ,2 + ,2 + ,4 + ,4 + ,4 + ,4 + ,2 + ,3 + ,3 + ,4 + ,2 + ,2 + ,4 + ,4 + ,4 + ,3 + ,2 + ,2 + ,4 + ,4 + ,2 + ,2 + ,4 + ,1 + ,4 + ,4 + ,2 + ,4 + ,4 + ,4 + ,3 + ,3 + ,5 + ,5 + ,2 + ,4 +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3 + ,2 + ,4 + ,4 + ,4 + ,3 + ,3 + ,2 + ,4 + ,3 + ,2 + ,5) + ,dim=c(5 + ,157) + ,dimnames=list(c('YT' + ,'X1' + ,'X2' + ,'X3' + ,'X4') + ,1:157)) > y <- array(NA,dim=c(5,157),dimnames=list(c('YT','X1','X2','X3','X4'),1:157)) > 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 YT X1 X2 X3 X4 1 4 2 5 4 3 2 4 2 4 3 2 3 5 4 4 2 2 4 3 2 4 2 2 5 4 3 2 2 2 6 3 4 5 2 2 7 4 3 5 3 2 8 3 3 4 2 1 9 2 3 3 1 2 10 4 2 4 2 2 11 2 4 4 2 2 12 2 3 3 2 2 13 1 3 3 2 2 14 4 4 4 2 2 15 4 4 5 1 1 16 2 3 4 2 2 17 2 3 2 2 1 18 3 3 4 3 2 19 3 4 4 4 2 20 3 2 4 4 2 21 4 5 4 4 4 22 3 4 4 4 2 23 2 2 4 4 4 24 2 3 5 2 2 25 4 4 4 2 2 26 4 4 4 4 2 27 3 3 4 2 2 28 4 4 4 3 2 29 2 4 4 2 2 30 4 1 4 4 2 31 4 4 4 3 3 32 5 5 2 4 2 33 5 2 4 2 2 34 4 4 4 2 2 35 4 3 5 4 3 36 4 2 5 5 4 37 2 4 4 2 1 38 4 5 3 4 2 39 4 4 4 4 3 40 4 4 5 5 3 41 3 4 4 3 2 42 2 3 4 2 2 43 3 4 5 3 2 44 4 2 4 2 2 45 3 2 5 1 2 46 2 4 4 2 2 47 4 2 4 4 4 48 4 4 4 4 4 49 3 4 3 4 2 50 4 1 4 4 3 51 3 4 4 2 2 52 4 2 4 2 2 53 2 1 2 1 1 54 4 4 3 4 3 55 4 3 5 2 4 56 4 2 4 4 2 57 4 4 4 2 2 58 3 3 5 2 1 59 1 2 3 1 2 60 3 2 5 2 2 61 3 3 4 2 2 62 4 2 5 2 2 63 2 1 4 2 2 64 3 3 4 1 1 65 5 2 5 5 2 66 4 3 4 3 3 67 4 3 4 2 2 68 3 3 5 1 1 69 4 2 4 2 2 70 2 3 3 4 4 71 3 2 4 2 2 72 4 4 5 5 3 73 3 4 5 4 4 74 4 4 5 3 2 75 4 2 4 2 4 76 3 3 4 2 1 77 3 4 5 2 2 78 2 3 5 2 2 79 4 4 4 4 4 80 3 2 5 2 3 81 2 3 3 2 2 82 2 3 4 4 2 83 3 4 4 4 2 84 2 2 4 2 3 85 2 4 4 2 2 86 4 2 4 3 2 87 4 2 5 2 1 88 4 4 4 4 2 89 2 3 4 2 2 90 2 4 4 4 4 91 4 2 5 1 1 92 2 2 3 2 2 93 3 3 3 3 2 94 3 3 5 2 2 95 5 5 5 4 4 96 3 2 4 2 4 97 4 3 4 3 3 98 3 4 4 2 2 99 2 3 4 2 3 100 4 4 4 2 2 101 3 3 4 2 1 102 3 3 4 2 2 103 3 2 4 2 2 104 4 3 5 3 2 105 1 2 2 2 4 106 3 3 4 2 2 107 2 2 2 4 3 108 3 4 4 3 3 109 2 2 5 2 2 110 2 4 3 1 1 111 2 4 4 2 4 112 4 1 3 2 2 113 5 5 4 5 2 114 5 2 4 1 1 115 3 3 4 2 2 116 4 4 2 2 2 117 4 1 1 2 2 118 3 5 4 2 3 119 2 3 3 2 1 120 4 3 4 5 3 121 2 3 3 2 2 122 3 3 3 2 3 123 2 2 5 2 1 124 2 2 4 2 2 125 2 4 3 2 3 126 4 4 4 2 1 127 4 3 4 3 2 128 4 3 4 2 2 129 4 3 4 4 3 130 3 4 3 4 2 131 2 3 4 2 2 132 4 4 4 4 2 133 3 4 4 4 2 134 2 2 4 2 2 135 4 4 4 4 2 136 3 2 3 3 3 137 3 4 4 2 2 138 3 3 4 2 2 139 3 3 2 3 3 140 3 2 2 4 2 141 4 2 4 4 2 142 5 5 2 5 1 143 2 2 4 2 1 144 4 3 4 3 4 145 3 3 3 5 3 146 3 3 2 2 3 147 1 3 2 2 2 148 2 4 4 2 2 149 4 4 3 2 2 150 4 4 4 2 4 151 5 4 4 5 3 152 2 4 2 3 3 153 4 5 5 2 2 154 3 3 4 2 2 155 2 3 4 3 2 156 4 4 4 3 3 157 2 4 3 2 5 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X1 X2 X3 X4 1.29605 0.06892 0.25292 0.36383 -0.11842 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1.75239 -0.75239 -0.00531 0.68036 2.30902 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.29605 0.43198 3.000 0.00315 ** X1 0.06892 0.07362 0.936 0.35063 X2 0.25292 0.08260 3.062 0.00260 ** X3 0.36383 0.07244 5.022 1.42e-06 *** X4 -0.11842 0.08978 -1.319 0.18916 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.8666 on 152 degrees of freedom Multiple R-squared: 0.2088, Adjusted R-squared: 0.1879 F-statistic: 10.03 on 4 and 152 DF, p-value: 3.151e-07 > 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.4722296 0.94445924 0.52777038 [2,] 0.4172436 0.83448722 0.58275639 [3,] 0.5815136 0.83697276 0.41848638 [4,] 0.7734985 0.45300300 0.22650150 [5,] 0.8399074 0.32018523 0.16009261 [6,] 0.9585674 0.08286525 0.04143263 [7,] 0.9536793 0.09264133 0.04632066 [8,] 0.9447369 0.11052625 0.05526312 [9,] 0.9500541 0.09989178 0.04994589 [10,] 0.9376405 0.12471908 0.06235954 [11,] 0.9165927 0.16681451 0.08340726 [12,] 0.8967141 0.20657186 0.10328593 [13,] 0.8680597 0.26388066 0.13194033 [14,] 0.8327059 0.33458817 0.16729409 [15,] 0.7953581 0.40928388 0.20464194 [16,] 0.8396607 0.32067864 0.16033932 [17,] 0.8868690 0.22626196 0.11313098 [18,] 0.8809990 0.23800193 0.11900096 [19,] 0.8530517 0.29389655 0.14694828 [20,] 0.8126912 0.37461753 0.18730876 [21,] 0.7849274 0.43014516 0.21507258 [22,] 0.8137956 0.37240887 0.18620444 [23,] 0.7990037 0.40199252 0.20099626 [24,] 0.7862680 0.42746396 0.21373198 [25,] 0.8478407 0.30431858 0.15215929 [26,] 0.9532372 0.09352552 0.04676276 [27,] 0.9502236 0.09955278 0.04977639 [28,] 0.9350280 0.12994400 0.06497200 [29,] 0.9166627 0.16667451 0.08333726 [30,] 0.9348527 0.13029455 0.06514728 [31,] 0.9177114 0.16457718 0.08228859 [32,] 0.8968715 0.20625706 0.10312853 [33,] 0.8733891 0.25322186 0.12661093 [34,] 0.8521764 0.29564721 0.14782360 [35,] 0.8598521 0.28029578 0.14014789 [36,] 0.8443157 0.31136856 0.15568428 [37,] 0.8565779 0.28684423 0.14342211 [38,] 0.8267347 0.34653051 0.17326526 [39,] 0.8421922 0.31561566 0.15780783 [40,] 0.8188315 0.36233710 0.18116855 [41,] 0.7883265 0.42334695 0.21167347 [42,] 0.7659994 0.46800115 0.23400057 [43,] 0.7366663 0.52666731 0.26333366 [44,] 0.6943854 0.61122917 0.30561458 [45,] 0.7063250 0.58735000 0.29367500 [46,] 0.6691648 0.66167045 0.33083522 [47,] 0.6364854 0.72702914 0.36351457 [48,] 0.6273151 0.74536972 0.37268486 [49,] 0.5896551 0.82068979 0.41034489 [50,] 0.5902476 0.81950476 0.40975238 [51,] 0.5466507 0.90669869 0.45334934 [52,] 0.6306153 0.73876939 0.36938470 [53,] 0.5856568 0.82868646 0.41434323 [54,] 0.5381186 0.92376283 0.46188142 [55,] 0.5328273 0.93434533 0.46717266 [56,] 0.5323456 0.93530874 0.46765437 [57,] 0.4895596 0.97911916 0.51044042 [58,] 0.4823489 0.96469790 0.51765105 [59,] 0.4647520 0.92950397 0.53524801 [60,] 0.4754783 0.95095650 0.52452175 [61,] 0.4286588 0.85731760 0.57134120 [62,] 0.4491082 0.89821644 0.55089178 [63,] 0.5124172 0.97516553 0.48758276 [64,] 0.4660862 0.93217240 0.53391380 [65,] 0.4251353 0.85027054 0.57486473 [66,] 0.4213550 0.84270997 0.57864501 [67,] 0.3820352 0.76407036 0.61796482 [68,] 0.4310999 0.86219988 0.56890006 [69,] 0.3861947 0.77238933 0.61380534 [70,] 0.3483382 0.69667636 0.65166182 [71,] 0.3928492 0.78569843 0.60715078 [72,] 0.3592821 0.71856419 0.64071791 [73,] 0.3186276 0.63725518 0.68137241 [74,] 0.3110965 0.62219294 0.68890353 [75,] 0.4297237 0.85944740 0.57027630 [76,] 0.4207126 0.84142525 0.57928738 [77,] 0.4174349 0.83486975 0.58256512 [78,] 0.4431550 0.88631004 0.55684498 [79,] 0.4287067 0.85741348 0.57129326 [80,] 0.4149691 0.82993813 0.58503093 [81,] 0.3725990 0.74519799 0.62740100 [82,] 0.3861072 0.77221444 0.61389278 [83,] 0.4867031 0.97340630 0.51329685 [84,] 0.5168017 0.96639651 0.48319825 [85,] 0.4946233 0.98924650 0.50537675 [86,] 0.4481507 0.89630147 0.55184927 [87,] 0.4045036 0.80900720 0.59549640 [88,] 0.4286870 0.85737409 0.57131295 [89,] 0.3947200 0.78944009 0.60527996 [90,] 0.3879264 0.77585274 0.61207363 [91,] 0.3429541 0.68590811 0.65704594 [92,] 0.3376524 0.67530481 0.66234759 [93,] 0.3405009 0.68100171 0.65949914 [94,] 0.2976115 0.59522302 0.70238849 [95,] 0.2566845 0.51336901 0.74331550 [96,] 0.2202188 0.44043765 0.77978118 [97,] 0.1952064 0.39041281 0.80479360 [98,] 0.2191537 0.43830740 0.78084630 [99,] 0.1843094 0.36861884 0.81569058 [100,] 0.2036926 0.40738520 0.79630740 [101,] 0.1732357 0.34647145 0.82676427 [102,] 0.1875169 0.37503381 0.81248309 [103,] 0.1704654 0.34093090 0.82953455 [104,] 0.1660053 0.33201064 0.83399468 [105,] 0.2222081 0.44441612 0.77779194 [106,] 0.2076837 0.41536736 0.79231632 [107,] 0.5668592 0.86628165 0.43314083 [108,] 0.5163181 0.96736386 0.48368193 [109,] 0.5873186 0.82536284 0.41268142 [110,] 0.8790880 0.24182390 0.12091195 [111,] 0.8577064 0.28458722 0.14229361 [112,] 0.8365534 0.32689321 0.16344661 [113,] 0.8005421 0.39891583 0.19945791 [114,] 0.7723749 0.45525017 0.22762509 [115,] 0.7454239 0.50915214 0.25457607 [116,] 0.7499593 0.50008132 0.25004066 [117,] 0.7246898 0.55062045 0.27531022 [118,] 0.7158959 0.56820819 0.28410410 [119,] 0.7222724 0.55545520 0.27772760 [120,] 0.7105272 0.57894560 0.28947280 [121,] 0.7807181 0.43856372 0.21928186 [122,] 0.7347161 0.53056772 0.26528386 [123,] 0.7158743 0.56825148 0.28412574 [124,] 0.6979811 0.60403775 0.30201888 [125,] 0.6353725 0.72925505 0.36462752 [126,] 0.6784600 0.64307995 0.32153998 [127,] 0.6308752 0.73824966 0.36912483 [128,] 0.5638491 0.87230178 0.43615089 [129,] 0.5060108 0.98797831 0.49398916 [130,] 0.4311525 0.86230503 0.56884749 [131,] 0.3618461 0.72369221 0.63815390 [132,] 0.3079121 0.61582411 0.69208794 [133,] 0.2582399 0.51647985 0.74176008 [134,] 0.2509931 0.50198617 0.74900692 [135,] 0.2607728 0.52154561 0.73922719 [136,] 0.1991848 0.39836953 0.80081524 [137,] 0.1731594 0.34631889 0.82684056 [138,] 0.1257389 0.25147776 0.87426112 [139,] 0.2027312 0.40546240 0.79726880 [140,] 0.1418616 0.28372317 0.85813841 [141,] 0.1866466 0.37329312 0.81335344 [142,] 0.3670527 0.73410544 0.63294728 > postscript(file="/var/www/html/rcomp/tmp/1x1st1290525433.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/2qs9w1290525433.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/3qs9w1290525433.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/4qs9w1290525433.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/5qs9w1290525433.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 = 157 Frequency = 1 1 2 3 4 5 6 0.201461330 0.699786286 1.925764933 0.063614662 1.500523230 -0.327151783 7 8 9 10 11 12 0.377944705 -0.123730338 -0.388565110 1.063614662 -1.074235067 -0.752393486 13 14 15 16 17 18 -1.752393486 0.925764933 0.918256457 -1.005310202 -0.617896906 -0.369138578 19 20 21 22 23 24 -0.801891818 -0.664042090 0.366023589 -0.801891818 -1.427201818 -1.258226919 25 26 27 28 29 30 0.925764933 0.198108182 -0.005310202 0.561936558 -1.074235067 0.404882774 31 32 33 34 35 36 0.680356694 1.635016750 2.063614662 0.925764933 0.132536466 -0.043946910 37 38 39 40 41 42 -1.192655203 0.382100034 0.316528318 -0.300216775 -0.438063442 -1.005310202 43 44 45 46 47 48 -0.690980159 1.063614662 0.174526322 -1.074235067 0.572798182 0.434948454 49 50 51 52 53 54 -0.548975102 0.523302910 -0.074235067 1.063614662 -0.116218801 0.569445034 55 56 57 58 59 60 0.978613354 0.335957910 0.925764933 -0.376647055 -1.319640246 -0.189302054 61 62 63 64 65 66 -0.005310202 0.810697946 -0.867460474 0.240098038 0.719212818 0.749281558 67 68 69 70 71 72 0.994689798 -0.012818679 1.063614662 -1.243209966 0.063614662 -0.300216775 73 74 75 76 77 78 -0.817968263 0.309019841 1.300454934 -0.123730338 -0.327151783 -1.258226919 79 80 81 82 83 84 0.434948454 -0.070881918 -0.752393486 -1.732966954 -0.801891818 -0.817965202 85 86 87 88 89 90 -1.074235067 0.699786286 0.692277810 0.198108182 -1.005310202 -1.565051546 91 92 93 94 95 96 1.056106186 -0.683468622 -0.116221862 -0.258226919 1.113106873 0.300454934 97 98 99 100 101 102 0.749281558 -0.074235067 -0.886890066 0.925764933 -0.123730338 -0.005310202 103 104 105 106 107 108 0.063614662 0.377944705 -1.193711633 -0.005310202 -1.039788521 -0.319643306 109 110 111 112 113 114 -1.189302054 -0.575910110 -0.837394794 1.385456243 0.765354941 2.309022902 115 116 117 118 119 120 -0.005310202 1.431598366 1.891289675 -0.024739795 -0.870813622 0.021624806 121 122 123 124 125 126 -0.752393486 0.366026650 -1.307722190 -0.936385338 -0.702898214 0.807344797 127 128 129 130 131 132 0.630861422 0.994689798 0.385453182 -0.548975102 -1.005310202 0.198108182 133 134 135 136 137 138 -0.801891818 -0.936385338 0.198108182 0.071123138 -0.074235067 -0.005310202 139 140 141 142 143 144 0.255114990 -0.158208657 0.335957910 1.152768238 -1.054805474 0.867701694 145 146 147 148 149 150 -0.725458478 0.618943366 -1.499476770 -1.074235067 1.178681650 1.162605206 151 152 153 154 155 156 0.952699942 -0.813809874 0.603923353 -0.005310202 -1.369138578 0.680356694 157 -0.466057942 > postscript(file="/var/www/html/rcomp/tmp/61j9h1290525433.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 = 157 Frequency = 1 lag(myerror, k = 1) myerror 0 0.201461330 NA 1 0.699786286 0.201461330 2 1.925764933 0.699786286 3 0.063614662 1.925764933 4 1.500523230 0.063614662 5 -0.327151783 1.500523230 6 0.377944705 -0.327151783 7 -0.123730338 0.377944705 8 -0.388565110 -0.123730338 9 1.063614662 -0.388565110 10 -1.074235067 1.063614662 11 -0.752393486 -1.074235067 12 -1.752393486 -0.752393486 13 0.925764933 -1.752393486 14 0.918256457 0.925764933 15 -1.005310202 0.918256457 16 -0.617896906 -1.005310202 17 -0.369138578 -0.617896906 18 -0.801891818 -0.369138578 19 -0.664042090 -0.801891818 20 0.366023589 -0.664042090 21 -0.801891818 0.366023589 22 -1.427201818 -0.801891818 23 -1.258226919 -1.427201818 24 0.925764933 -1.258226919 25 0.198108182 0.925764933 26 -0.005310202 0.198108182 27 0.561936558 -0.005310202 28 -1.074235067 0.561936558 29 0.404882774 -1.074235067 30 0.680356694 0.404882774 31 1.635016750 0.680356694 32 2.063614662 1.635016750 33 0.925764933 2.063614662 34 0.132536466 0.925764933 35 -0.043946910 0.132536466 36 -1.192655203 -0.043946910 37 0.382100034 -1.192655203 38 0.316528318 0.382100034 39 -0.300216775 0.316528318 40 -0.438063442 -0.300216775 41 -1.005310202 -0.438063442 42 -0.690980159 -1.005310202 43 1.063614662 -0.690980159 44 0.174526322 1.063614662 45 -1.074235067 0.174526322 46 0.572798182 -1.074235067 47 0.434948454 0.572798182 48 -0.548975102 0.434948454 49 0.523302910 -0.548975102 50 -0.074235067 0.523302910 51 1.063614662 -0.074235067 52 -0.116218801 1.063614662 53 0.569445034 -0.116218801 54 0.978613354 0.569445034 55 0.335957910 0.978613354 56 0.925764933 0.335957910 57 -0.376647055 0.925764933 58 -1.319640246 -0.376647055 59 -0.189302054 -1.319640246 60 -0.005310202 -0.189302054 61 0.810697946 -0.005310202 62 -0.867460474 0.810697946 63 0.240098038 -0.867460474 64 0.719212818 0.240098038 65 0.749281558 0.719212818 66 0.994689798 0.749281558 67 -0.012818679 0.994689798 68 1.063614662 -0.012818679 69 -1.243209966 1.063614662 70 0.063614662 -1.243209966 71 -0.300216775 0.063614662 72 -0.817968263 -0.300216775 73 0.309019841 -0.817968263 74 1.300454934 0.309019841 75 -0.123730338 1.300454934 76 -0.327151783 -0.123730338 77 -1.258226919 -0.327151783 78 0.434948454 -1.258226919 79 -0.070881918 0.434948454 80 -0.752393486 -0.070881918 81 -1.732966954 -0.752393486 82 -0.801891818 -1.732966954 83 -0.817965202 -0.801891818 84 -1.074235067 -0.817965202 85 0.699786286 -1.074235067 86 0.692277810 0.699786286 87 0.198108182 0.692277810 88 -1.005310202 0.198108182 89 -1.565051546 -1.005310202 90 1.056106186 -1.565051546 91 -0.683468622 1.056106186 92 -0.116221862 -0.683468622 93 -0.258226919 -0.116221862 94 1.113106873 -0.258226919 95 0.300454934 1.113106873 96 0.749281558 0.300454934 97 -0.074235067 0.749281558 98 -0.886890066 -0.074235067 99 0.925764933 -0.886890066 100 -0.123730338 0.925764933 101 -0.005310202 -0.123730338 102 0.063614662 -0.005310202 103 0.377944705 0.063614662 104 -1.193711633 0.377944705 105 -0.005310202 -1.193711633 106 -1.039788521 -0.005310202 107 -0.319643306 -1.039788521 108 -1.189302054 -0.319643306 109 -0.575910110 -1.189302054 110 -0.837394794 -0.575910110 111 1.385456243 -0.837394794 112 0.765354941 1.385456243 113 2.309022902 0.765354941 114 -0.005310202 2.309022902 115 1.431598366 -0.005310202 116 1.891289675 1.431598366 117 -0.024739795 1.891289675 118 -0.870813622 -0.024739795 119 0.021624806 -0.870813622 120 -0.752393486 0.021624806 121 0.366026650 -0.752393486 122 -1.307722190 0.366026650 123 -0.936385338 -1.307722190 124 -0.702898214 -0.936385338 125 0.807344797 -0.702898214 126 0.630861422 0.807344797 127 0.994689798 0.630861422 128 0.385453182 0.994689798 129 -0.548975102 0.385453182 130 -1.005310202 -0.548975102 131 0.198108182 -1.005310202 132 -0.801891818 0.198108182 133 -0.936385338 -0.801891818 134 0.198108182 -0.936385338 135 0.071123138 0.198108182 136 -0.074235067 0.071123138 137 -0.005310202 -0.074235067 138 0.255114990 -0.005310202 139 -0.158208657 0.255114990 140 0.335957910 -0.158208657 141 1.152768238 0.335957910 142 -1.054805474 1.152768238 143 0.867701694 -1.054805474 144 -0.725458478 0.867701694 145 0.618943366 -0.725458478 146 -1.499476770 0.618943366 147 -1.074235067 -1.499476770 148 1.178681650 -1.074235067 149 1.162605206 1.178681650 150 0.952699942 1.162605206 151 -0.813809874 0.952699942 152 0.603923353 -0.813809874 153 -0.005310202 0.603923353 154 -1.369138578 -0.005310202 155 0.680356694 -1.369138578 156 -0.466057942 0.680356694 157 NA -0.466057942 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.699786286 0.201461330 [2,] 1.925764933 0.699786286 [3,] 0.063614662 1.925764933 [4,] 1.500523230 0.063614662 [5,] -0.327151783 1.500523230 [6,] 0.377944705 -0.327151783 [7,] -0.123730338 0.377944705 [8,] -0.388565110 -0.123730338 [9,] 1.063614662 -0.388565110 [10,] -1.074235067 1.063614662 [11,] -0.752393486 -1.074235067 [12,] -1.752393486 -0.752393486 [13,] 0.925764933 -1.752393486 [14,] 0.918256457 0.925764933 [15,] -1.005310202 0.918256457 [16,] -0.617896906 -1.005310202 [17,] -0.369138578 -0.617896906 [18,] -0.801891818 -0.369138578 [19,] -0.664042090 -0.801891818 [20,] 0.366023589 -0.664042090 [21,] -0.801891818 0.366023589 [22,] -1.427201818 -0.801891818 [23,] -1.258226919 -1.427201818 [24,] 0.925764933 -1.258226919 [25,] 0.198108182 0.925764933 [26,] -0.005310202 0.198108182 [27,] 0.561936558 -0.005310202 [28,] -1.074235067 0.561936558 [29,] 0.404882774 -1.074235067 [30,] 0.680356694 0.404882774 [31,] 1.635016750 0.680356694 [32,] 2.063614662 1.635016750 [33,] 0.925764933 2.063614662 [34,] 0.132536466 0.925764933 [35,] -0.043946910 0.132536466 [36,] -1.192655203 -0.043946910 [37,] 0.382100034 -1.192655203 [38,] 0.316528318 0.382100034 [39,] -0.300216775 0.316528318 [40,] -0.438063442 -0.300216775 [41,] -1.005310202 -0.438063442 [42,] -0.690980159 -1.005310202 [43,] 1.063614662 -0.690980159 [44,] 0.174526322 1.063614662 [45,] -1.074235067 0.174526322 [46,] 0.572798182 -1.074235067 [47,] 0.434948454 0.572798182 [48,] -0.548975102 0.434948454 [49,] 0.523302910 -0.548975102 [50,] -0.074235067 0.523302910 [51,] 1.063614662 -0.074235067 [52,] -0.116218801 1.063614662 [53,] 0.569445034 -0.116218801 [54,] 0.978613354 0.569445034 [55,] 0.335957910 0.978613354 [56,] 0.925764933 0.335957910 [57,] -0.376647055 0.925764933 [58,] -1.319640246 -0.376647055 [59,] -0.189302054 -1.319640246 [60,] -0.005310202 -0.189302054 [61,] 0.810697946 -0.005310202 [62,] -0.867460474 0.810697946 [63,] 0.240098038 -0.867460474 [64,] 0.719212818 0.240098038 [65,] 0.749281558 0.719212818 [66,] 0.994689798 0.749281558 [67,] -0.012818679 0.994689798 [68,] 1.063614662 -0.012818679 [69,] -1.243209966 1.063614662 [70,] 0.063614662 -1.243209966 [71,] -0.300216775 0.063614662 [72,] -0.817968263 -0.300216775 [73,] 0.309019841 -0.817968263 [74,] 1.300454934 0.309019841 [75,] -0.123730338 1.300454934 [76,] -0.327151783 -0.123730338 [77,] -1.258226919 -0.327151783 [78,] 0.434948454 -1.258226919 [79,] -0.070881918 0.434948454 [80,] -0.752393486 -0.070881918 [81,] -1.732966954 -0.752393486 [82,] -0.801891818 -1.732966954 [83,] -0.817965202 -0.801891818 [84,] -1.074235067 -0.817965202 [85,] 0.699786286 -1.074235067 [86,] 0.692277810 0.699786286 [87,] 0.198108182 0.692277810 [88,] -1.005310202 0.198108182 [89,] -1.565051546 -1.005310202 [90,] 1.056106186 -1.565051546 [91,] -0.683468622 1.056106186 [92,] -0.116221862 -0.683468622 [93,] -0.258226919 -0.116221862 [94,] 1.113106873 -0.258226919 [95,] 0.300454934 1.113106873 [96,] 0.749281558 0.300454934 [97,] -0.074235067 0.749281558 [98,] -0.886890066 -0.074235067 [99,] 0.925764933 -0.886890066 [100,] -0.123730338 0.925764933 [101,] -0.005310202 -0.123730338 [102,] 0.063614662 -0.005310202 [103,] 0.377944705 0.063614662 [104,] -1.193711633 0.377944705 [105,] -0.005310202 -1.193711633 [106,] -1.039788521 -0.005310202 [107,] -0.319643306 -1.039788521 [108,] -1.189302054 -0.319643306 [109,] -0.575910110 -1.189302054 [110,] -0.837394794 -0.575910110 [111,] 1.385456243 -0.837394794 [112,] 0.765354941 1.385456243 [113,] 2.309022902 0.765354941 [114,] -0.005310202 2.309022902 [115,] 1.431598366 -0.005310202 [116,] 1.891289675 1.431598366 [117,] -0.024739795 1.891289675 [118,] -0.870813622 -0.024739795 [119,] 0.021624806 -0.870813622 [120,] -0.752393486 0.021624806 [121,] 0.366026650 -0.752393486 [122,] -1.307722190 0.366026650 [123,] -0.936385338 -1.307722190 [124,] -0.702898214 -0.936385338 [125,] 0.807344797 -0.702898214 [126,] 0.630861422 0.807344797 [127,] 0.994689798 0.630861422 [128,] 0.385453182 0.994689798 [129,] -0.548975102 0.385453182 [130,] -1.005310202 -0.548975102 [131,] 0.198108182 -1.005310202 [132,] -0.801891818 0.198108182 [133,] -0.936385338 -0.801891818 [134,] 0.198108182 -0.936385338 [135,] 0.071123138 0.198108182 [136,] -0.074235067 0.071123138 [137,] -0.005310202 -0.074235067 [138,] 0.255114990 -0.005310202 [139,] -0.158208657 0.255114990 [140,] 0.335957910 -0.158208657 [141,] 1.152768238 0.335957910 [142,] -1.054805474 1.152768238 [143,] 0.867701694 -1.054805474 [144,] -0.725458478 0.867701694 [145,] 0.618943366 -0.725458478 [146,] -1.499476770 0.618943366 [147,] -1.074235067 -1.499476770 [148,] 1.178681650 -1.074235067 [149,] 1.162605206 1.178681650 [150,] 0.952699942 1.162605206 [151,] -0.813809874 0.952699942 [152,] 0.603923353 -0.813809874 [153,] -0.005310202 0.603923353 [154,] -1.369138578 -0.005310202 [155,] 0.680356694 -1.369138578 [156,] -0.466057942 0.680356694 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.699786286 0.201461330 2 1.925764933 0.699786286 3 0.063614662 1.925764933 4 1.500523230 0.063614662 5 -0.327151783 1.500523230 6 0.377944705 -0.327151783 7 -0.123730338 0.377944705 8 -0.388565110 -0.123730338 9 1.063614662 -0.388565110 10 -1.074235067 1.063614662 11 -0.752393486 -1.074235067 12 -1.752393486 -0.752393486 13 0.925764933 -1.752393486 14 0.918256457 0.925764933 15 -1.005310202 0.918256457 16 -0.617896906 -1.005310202 17 -0.369138578 -0.617896906 18 -0.801891818 -0.369138578 19 -0.664042090 -0.801891818 20 0.366023589 -0.664042090 21 -0.801891818 0.366023589 22 -1.427201818 -0.801891818 23 -1.258226919 -1.427201818 24 0.925764933 -1.258226919 25 0.198108182 0.925764933 26 -0.005310202 0.198108182 27 0.561936558 -0.005310202 28 -1.074235067 0.561936558 29 0.404882774 -1.074235067 30 0.680356694 0.404882774 31 1.635016750 0.680356694 32 2.063614662 1.635016750 33 0.925764933 2.063614662 34 0.132536466 0.925764933 35 -0.043946910 0.132536466 36 -1.192655203 -0.043946910 37 0.382100034 -1.192655203 38 0.316528318 0.382100034 39 -0.300216775 0.316528318 40 -0.438063442 -0.300216775 41 -1.005310202 -0.438063442 42 -0.690980159 -1.005310202 43 1.063614662 -0.690980159 44 0.174526322 1.063614662 45 -1.074235067 0.174526322 46 0.572798182 -1.074235067 47 0.434948454 0.572798182 48 -0.548975102 0.434948454 49 0.523302910 -0.548975102 50 -0.074235067 0.523302910 51 1.063614662 -0.074235067 52 -0.116218801 1.063614662 53 0.569445034 -0.116218801 54 0.978613354 0.569445034 55 0.335957910 0.978613354 56 0.925764933 0.335957910 57 -0.376647055 0.925764933 58 -1.319640246 -0.376647055 59 -0.189302054 -1.319640246 60 -0.005310202 -0.189302054 61 0.810697946 -0.005310202 62 -0.867460474 0.810697946 63 0.240098038 -0.867460474 64 0.719212818 0.240098038 65 0.749281558 0.719212818 66 0.994689798 0.749281558 67 -0.012818679 0.994689798 68 1.063614662 -0.012818679 69 -1.243209966 1.063614662 70 0.063614662 -1.243209966 71 -0.300216775 0.063614662 72 -0.817968263 -0.300216775 73 0.309019841 -0.817968263 74 1.300454934 0.309019841 75 -0.123730338 1.300454934 76 -0.327151783 -0.123730338 77 -1.258226919 -0.327151783 78 0.434948454 -1.258226919 79 -0.070881918 0.434948454 80 -0.752393486 -0.070881918 81 -1.732966954 -0.752393486 82 -0.801891818 -1.732966954 83 -0.817965202 -0.801891818 84 -1.074235067 -0.817965202 85 0.699786286 -1.074235067 86 0.692277810 0.699786286 87 0.198108182 0.692277810 88 -1.005310202 0.198108182 89 -1.565051546 -1.005310202 90 1.056106186 -1.565051546 91 -0.683468622 1.056106186 92 -0.116221862 -0.683468622 93 -0.258226919 -0.116221862 94 1.113106873 -0.258226919 95 0.300454934 1.113106873 96 0.749281558 0.300454934 97 -0.074235067 0.749281558 98 -0.886890066 -0.074235067 99 0.925764933 -0.886890066 100 -0.123730338 0.925764933 101 -0.005310202 -0.123730338 102 0.063614662 -0.005310202 103 0.377944705 0.063614662 104 -1.193711633 0.377944705 105 -0.005310202 -1.193711633 106 -1.039788521 -0.005310202 107 -0.319643306 -1.039788521 108 -1.189302054 -0.319643306 109 -0.575910110 -1.189302054 110 -0.837394794 -0.575910110 111 1.385456243 -0.837394794 112 0.765354941 1.385456243 113 2.309022902 0.765354941 114 -0.005310202 2.309022902 115 1.431598366 -0.005310202 116 1.891289675 1.431598366 117 -0.024739795 1.891289675 118 -0.870813622 -0.024739795 119 0.021624806 -0.870813622 120 -0.752393486 0.021624806 121 0.366026650 -0.752393486 122 -1.307722190 0.366026650 123 -0.936385338 -1.307722190 124 -0.702898214 -0.936385338 125 0.807344797 -0.702898214 126 0.630861422 0.807344797 127 0.994689798 0.630861422 128 0.385453182 0.994689798 129 -0.548975102 0.385453182 130 -1.005310202 -0.548975102 131 0.198108182 -1.005310202 132 -0.801891818 0.198108182 133 -0.936385338 -0.801891818 134 0.198108182 -0.936385338 135 0.071123138 0.198108182 136 -0.074235067 0.071123138 137 -0.005310202 -0.074235067 138 0.255114990 -0.005310202 139 -0.158208657 0.255114990 140 0.335957910 -0.158208657 141 1.152768238 0.335957910 142 -1.054805474 1.152768238 143 0.867701694 -1.054805474 144 -0.725458478 0.867701694 145 0.618943366 -0.725458478 146 -1.499476770 0.618943366 147 -1.074235067 -1.499476770 148 1.178681650 -1.074235067 149 1.162605206 1.178681650 150 0.952699942 1.162605206 151 -0.813809874 0.952699942 152 0.603923353 -0.813809874 153 -0.005310202 0.603923353 154 -1.369138578 -0.005310202 155 0.680356694 -1.369138578 156 -0.466057942 0.680356694 > 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/7bb821290525433.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/8bb821290525433.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/9bb821290525433.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/10mkpn1290525433.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='') + } + } > 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/html/rcomp/tmp/11pk6t1290525433.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/html/rcomp/tmp/12tl4h1290525433.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/html/rcomp/tmp/137v2p1290525433.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/html/rcomp/tmp/14sdjv1290525433.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/html/rcomp/tmp/15vwzj1290525433.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/html/rcomp/tmp/16sofa1290525433.tab") + } > > try(system("convert tmp/1x1st1290525433.ps tmp/1x1st1290525433.png",intern=TRUE)) character(0) > try(system("convert tmp/2qs9w1290525433.ps tmp/2qs9w1290525433.png",intern=TRUE)) character(0) > try(system("convert tmp/3qs9w1290525433.ps tmp/3qs9w1290525433.png",intern=TRUE)) character(0) > try(system("convert tmp/4qs9w1290525433.ps tmp/4qs9w1290525433.png",intern=TRUE)) character(0) > try(system("convert tmp/5qs9w1290525433.ps tmp/5qs9w1290525433.png",intern=TRUE)) character(0) > try(system("convert tmp/61j9h1290525433.ps tmp/61j9h1290525433.png",intern=TRUE)) character(0) > try(system("convert tmp/7bb821290525433.ps tmp/7bb821290525433.png",intern=TRUE)) character(0) > try(system("convert tmp/8bb821290525433.ps tmp/8bb821290525433.png",intern=TRUE)) character(0) > try(system("convert tmp/9bb821290525433.ps tmp/9bb821290525433.png",intern=TRUE)) character(0) > try(system("convert tmp/10mkpn1290525433.ps tmp/10mkpn1290525433.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.887 1.682 22.005