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(24,25,30,19,22,22,25,23,17,21,19,19,15,16,23,27,22,14,22,23,23,21,19,18,20,23,25,19,24,22,25,26,29,32,25,29,28,17,28,29,26,25,14,25,26,20,18,32,25,25,23,21,20,15,30,24,26,24,22,14,24,24,24,24,19,31,22,27,19,25,20,21,27,23,25,20,21,22,23,25,25,17,19,25,19,20,26,23,27,17,17,19,17,22,21,32,21,21,18,18,23,19,20,21,20,17,18,19,22,15,14,18,24,35,29,21,25,20,22,13,26,17,25,20,19,21,22,24,21,26,24,16,23,18,16,26,19,21,21,22,23,29,21,21,23,27,25,21,10,20,26,24,29,19,24,19,24,22,17),dim=c(1,159),dimnames=list(c('PS'),1:159)) > y <- array(NA,dim=c(1,159),dimnames=list(c('PS'),1:159)) > 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 = 'Include Monthly 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 PS M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 24 1 0 0 0 0 0 0 0 0 0 0 2 25 0 1 0 0 0 0 0 0 0 0 0 3 30 0 0 1 0 0 0 0 0 0 0 0 4 19 0 0 0 1 0 0 0 0 0 0 0 5 22 0 0 0 0 1 0 0 0 0 0 0 6 22 0 0 0 0 0 1 0 0 0 0 0 7 25 0 0 0 0 0 0 1 0 0 0 0 8 23 0 0 0 0 0 0 0 1 0 0 0 9 17 0 0 0 0 0 0 0 0 1 0 0 10 21 0 0 0 0 0 0 0 0 0 1 0 11 19 0 0 0 0 0 0 0 0 0 0 1 12 19 0 0 0 0 0 0 0 0 0 0 0 13 15 1 0 0 0 0 0 0 0 0 0 0 14 16 0 1 0 0 0 0 0 0 0 0 0 15 23 0 0 1 0 0 0 0 0 0 0 0 16 27 0 0 0 1 0 0 0 0 0 0 0 17 22 0 0 0 0 1 0 0 0 0 0 0 18 14 0 0 0 0 0 1 0 0 0 0 0 19 22 0 0 0 0 0 0 1 0 0 0 0 20 23 0 0 0 0 0 0 0 1 0 0 0 21 23 0 0 0 0 0 0 0 0 1 0 0 22 21 0 0 0 0 0 0 0 0 0 1 0 23 19 0 0 0 0 0 0 0 0 0 0 1 24 18 0 0 0 0 0 0 0 0 0 0 0 25 20 1 0 0 0 0 0 0 0 0 0 0 26 23 0 1 0 0 0 0 0 0 0 0 0 27 25 0 0 1 0 0 0 0 0 0 0 0 28 19 0 0 0 1 0 0 0 0 0 0 0 29 24 0 0 0 0 1 0 0 0 0 0 0 30 22 0 0 0 0 0 1 0 0 0 0 0 31 25 0 0 0 0 0 0 1 0 0 0 0 32 26 0 0 0 0 0 0 0 1 0 0 0 33 29 0 0 0 0 0 0 0 0 1 0 0 34 32 0 0 0 0 0 0 0 0 0 1 0 35 25 0 0 0 0 0 0 0 0 0 0 1 36 29 0 0 0 0 0 0 0 0 0 0 0 37 28 1 0 0 0 0 0 0 0 0 0 0 38 17 0 1 0 0 0 0 0 0 0 0 0 39 28 0 0 1 0 0 0 0 0 0 0 0 40 29 0 0 0 1 0 0 0 0 0 0 0 41 26 0 0 0 0 1 0 0 0 0 0 0 42 25 0 0 0 0 0 1 0 0 0 0 0 43 14 0 0 0 0 0 0 1 0 0 0 0 44 25 0 0 0 0 0 0 0 1 0 0 0 45 26 0 0 0 0 0 0 0 0 1 0 0 46 20 0 0 0 0 0 0 0 0 0 1 0 47 18 0 0 0 0 0 0 0 0 0 0 1 48 32 0 0 0 0 0 0 0 0 0 0 0 49 25 1 0 0 0 0 0 0 0 0 0 0 50 25 0 1 0 0 0 0 0 0 0 0 0 51 23 0 0 1 0 0 0 0 0 0 0 0 52 21 0 0 0 1 0 0 0 0 0 0 0 53 20 0 0 0 0 1 0 0 0 0 0 0 54 15 0 0 0 0 0 1 0 0 0 0 0 55 30 0 0 0 0 0 0 1 0 0 0 0 56 24 0 0 0 0 0 0 0 1 0 0 0 57 26 0 0 0 0 0 0 0 0 1 0 0 58 24 0 0 0 0 0 0 0 0 0 1 0 59 22 0 0 0 0 0 0 0 0 0 0 1 60 14 0 0 0 0 0 0 0 0 0 0 0 61 24 1 0 0 0 0 0 0 0 0 0 0 62 24 0 1 0 0 0 0 0 0 0 0 0 63 24 0 0 1 0 0 0 0 0 0 0 0 64 24 0 0 0 1 0 0 0 0 0 0 0 65 19 0 0 0 0 1 0 0 0 0 0 0 66 31 0 0 0 0 0 1 0 0 0 0 0 67 22 0 0 0 0 0 0 1 0 0 0 0 68 27 0 0 0 0 0 0 0 1 0 0 0 69 19 0 0 0 0 0 0 0 0 1 0 0 70 25 0 0 0 0 0 0 0 0 0 1 0 71 20 0 0 0 0 0 0 0 0 0 0 1 72 21 0 0 0 0 0 0 0 0 0 0 0 73 27 1 0 0 0 0 0 0 0 0 0 0 74 23 0 1 0 0 0 0 0 0 0 0 0 75 25 0 0 1 0 0 0 0 0 0 0 0 76 20 0 0 0 1 0 0 0 0 0 0 0 77 21 0 0 0 0 1 0 0 0 0 0 0 78 22 0 0 0 0 0 1 0 0 0 0 0 79 23 0 0 0 0 0 0 1 0 0 0 0 80 25 0 0 0 0 0 0 0 1 0 0 0 81 25 0 0 0 0 0 0 0 0 1 0 0 82 17 0 0 0 0 0 0 0 0 0 1 0 83 19 0 0 0 0 0 0 0 0 0 0 1 84 25 0 0 0 0 0 0 0 0 0 0 0 85 19 1 0 0 0 0 0 0 0 0 0 0 86 20 0 1 0 0 0 0 0 0 0 0 0 87 26 0 0 1 0 0 0 0 0 0 0 0 88 23 0 0 0 1 0 0 0 0 0 0 0 89 27 0 0 0 0 1 0 0 0 0 0 0 90 17 0 0 0 0 0 1 0 0 0 0 0 91 17 0 0 0 0 0 0 1 0 0 0 0 92 19 0 0 0 0 0 0 0 1 0 0 0 93 17 0 0 0 0 0 0 0 0 1 0 0 94 22 0 0 0 0 0 0 0 0 0 1 0 95 21 0 0 0 0 0 0 0 0 0 0 1 96 32 0 0 0 0 0 0 0 0 0 0 0 97 21 1 0 0 0 0 0 0 0 0 0 0 98 21 0 1 0 0 0 0 0 0 0 0 0 99 18 0 0 1 0 0 0 0 0 0 0 0 100 18 0 0 0 1 0 0 0 0 0 0 0 101 23 0 0 0 0 1 0 0 0 0 0 0 102 19 0 0 0 0 0 1 0 0 0 0 0 103 20 0 0 0 0 0 0 1 0 0 0 0 104 21 0 0 0 0 0 0 0 1 0 0 0 105 20 0 0 0 0 0 0 0 0 1 0 0 106 17 0 0 0 0 0 0 0 0 0 1 0 107 18 0 0 0 0 0 0 0 0 0 0 1 108 19 0 0 0 0 0 0 0 0 0 0 0 109 22 1 0 0 0 0 0 0 0 0 0 0 110 15 0 1 0 0 0 0 0 0 0 0 0 111 14 0 0 1 0 0 0 0 0 0 0 0 112 18 0 0 0 1 0 0 0 0 0 0 0 113 24 0 0 0 0 1 0 0 0 0 0 0 114 35 0 0 0 0 0 1 0 0 0 0 0 115 29 0 0 0 0 0 0 1 0 0 0 0 116 21 0 0 0 0 0 0 0 1 0 0 0 117 25 0 0 0 0 0 0 0 0 1 0 0 118 20 0 0 0 0 0 0 0 0 0 1 0 119 22 0 0 0 0 0 0 0 0 0 0 1 120 13 0 0 0 0 0 0 0 0 0 0 0 121 26 1 0 0 0 0 0 0 0 0 0 0 122 17 0 1 0 0 0 0 0 0 0 0 0 123 25 0 0 1 0 0 0 0 0 0 0 0 124 20 0 0 0 1 0 0 0 0 0 0 0 125 19 0 0 0 0 1 0 0 0 0 0 0 126 21 0 0 0 0 0 1 0 0 0 0 0 127 22 0 0 0 0 0 0 1 0 0 0 0 128 24 0 0 0 0 0 0 0 1 0 0 0 129 21 0 0 0 0 0 0 0 0 1 0 0 130 26 0 0 0 0 0 0 0 0 0 1 0 131 24 0 0 0 0 0 0 0 0 0 0 1 132 16 0 0 0 0 0 0 0 0 0 0 0 133 23 1 0 0 0 0 0 0 0 0 0 0 134 18 0 1 0 0 0 0 0 0 0 0 0 135 16 0 0 1 0 0 0 0 0 0 0 0 136 26 0 0 0 1 0 0 0 0 0 0 0 137 19 0 0 0 0 1 0 0 0 0 0 0 138 21 0 0 0 0 0 1 0 0 0 0 0 139 21 0 0 0 0 0 0 1 0 0 0 0 140 22 0 0 0 0 0 0 0 1 0 0 0 141 23 0 0 0 0 0 0 0 0 1 0 0 142 29 0 0 0 0 0 0 0 0 0 1 0 143 21 0 0 0 0 0 0 0 0 0 0 1 144 21 0 0 0 0 0 0 0 0 0 0 0 145 23 1 0 0 0 0 0 0 0 0 0 0 146 27 0 1 0 0 0 0 0 0 0 0 0 147 25 0 0 1 0 0 0 0 0 0 0 0 148 21 0 0 0 1 0 0 0 0 0 0 0 149 10 0 0 0 0 1 0 0 0 0 0 0 150 20 0 0 0 0 0 1 0 0 0 0 0 151 26 0 0 0 0 0 0 1 0 0 0 0 152 24 0 0 0 0 0 0 0 1 0 0 0 153 29 0 0 0 0 0 0 0 0 1 0 0 154 19 0 0 0 0 0 0 0 0 0 1 0 155 24 0 0 0 0 0 0 0 0 0 0 1 156 19 0 0 0 0 0 0 0 0 0 0 0 157 24 1 0 0 0 0 0 0 0 0 0 0 158 22 0 1 0 0 0 0 0 0 0 0 0 159 17 0 0 1 0 0 0 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) M1 M2 M3 M4 M5 21.3846 1.5440 -0.4560 1.4011 0.5385 -0.1538 M6 M7 M8 M9 M10 M11 0.4615 1.3846 2.0000 1.6923 1.1538 -0.4615 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -11.23077 -2.46154 0.07143 2.34615 13.15385 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 21.3846 1.1879 18.002 <2e-16 *** M1 1.5440 1.6497 0.936 0.351 M2 -0.4560 1.6497 -0.276 0.783 M3 1.4011 1.6497 0.849 0.397 M4 0.5385 1.6800 0.321 0.749 M5 -0.1538 1.6800 -0.092 0.927 M6 0.4615 1.6800 0.275 0.784 M7 1.3846 1.6800 0.824 0.411 M8 2.0000 1.6800 1.191 0.236 M9 1.6923 1.6800 1.007 0.315 M10 1.1538 1.6800 0.687 0.493 M11 -0.4615 1.6800 -0.275 0.784 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 4.283 on 147 degrees of freedom Multiple R-squared: 0.04022, Adjusted R-squared: -0.0316 F-statistic: 0.56 on 11 and 147 DF, p-value: 0.8585 > 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.86475180 0.2704964 0.13524820 [2,] 0.87643122 0.2471376 0.12356878 [3,] 0.79506819 0.4098636 0.20493181 [4,] 0.82913678 0.3417264 0.17086322 [5,] 0.76452351 0.4709530 0.23547649 [6,] 0.67516369 0.6496726 0.32483631 [7,] 0.65667359 0.6866528 0.34332641 [8,] 0.56490285 0.8701943 0.43509715 [9,] 0.47331626 0.9466325 0.52668374 [10,] 0.39139463 0.7827893 0.60860537 [11,] 0.31485359 0.6297072 0.68514641 [12,] 0.25961764 0.5192353 0.74038236 [13,] 0.20381603 0.4076321 0.79618397 [14,] 0.18384654 0.3676931 0.81615346 [15,] 0.14455632 0.2891126 0.85544368 [16,] 0.12832784 0.2566557 0.87167216 [17,] 0.09649454 0.1929891 0.90350546 [18,] 0.07861171 0.1572234 0.92138829 [19,] 0.15732312 0.3146462 0.84267688 [20,] 0.36041181 0.7208236 0.63958819 [21,] 0.37599696 0.7519939 0.62400304 [22,] 0.55218741 0.8956252 0.44781259 [23,] 0.63385406 0.7322919 0.36614594 [24,] 0.61762281 0.7647544 0.38237719 [25,] 0.59085260 0.8182948 0.40914740 [26,] 0.66071503 0.6785699 0.33928497 [27,] 0.64311768 0.7137646 0.35688232 [28,] 0.64453353 0.7109329 0.35546647 [29,] 0.78308481 0.4338304 0.21691519 [30,] 0.74237097 0.5152581 0.25762903 [31,] 0.71314934 0.5737013 0.28685066 [32,] 0.69669246 0.6066151 0.30330754 [33,] 0.66597463 0.6680507 0.33402537 [34,] 0.82520341 0.3495932 0.17479659 [35,] 0.80123850 0.3975230 0.19876150 [36,] 0.79732302 0.4053540 0.20267698 [37,] 0.77365768 0.4526846 0.22634232 [38,] 0.73921695 0.5215661 0.26078305 [39,] 0.71006312 0.5798738 0.28993688 [40,] 0.75288985 0.4942203 0.24711015 [41,] 0.82330666 0.3533867 0.17669334 [42,] 0.78856478 0.4228704 0.21143522 [43,] 0.76395300 0.4720940 0.23604700 [44,] 0.72626131 0.5474774 0.27373869 [45,] 0.68636441 0.6272712 0.31363559 [46,] 0.79505876 0.4098825 0.20494124 [47,] 0.76040288 0.4791942 0.23959712 [48,] 0.73829346 0.5234131 0.26170654 [49,] 0.70816713 0.5836657 0.29183287 [50,] 0.67335814 0.6532837 0.32664186 [51,] 0.64640829 0.7071834 0.35359171 [52,] 0.80080460 0.3983908 0.19919540 [53,] 0.76589427 0.4682115 0.23410573 [54,] 0.75214103 0.4957179 0.24785897 [55,] 0.75004938 0.4999012 0.24995062 [56,] 0.72246303 0.5550739 0.27753697 [57,] 0.68163360 0.6367328 0.31836640 [58,] 0.63870170 0.7225966 0.36129830 [59,] 0.63276742 0.7344652 0.36723258 [60,] 0.59701233 0.8059753 0.40298767 [61,] 0.57435194 0.8512961 0.42564806 [62,] 0.53851253 0.9229749 0.46148747 [63,] 0.49171778 0.9834356 0.50828222 [64,] 0.44334163 0.8866833 0.55665837 [65,] 0.39575918 0.7915184 0.60424082 [66,] 0.35959082 0.7191816 0.64040918 [67,] 0.32380201 0.6476040 0.67619799 [68,] 0.35434186 0.7086837 0.64565814 [69,] 0.31910642 0.6382128 0.68089358 [70,] 0.30834531 0.6166906 0.69165469 [71,] 0.30076765 0.6015353 0.69923235 [72,] 0.26261674 0.5252335 0.73738326 [73,] 0.26694498 0.5338900 0.73305502 [74,] 0.23319397 0.4663879 0.76680603 [75,] 0.27603863 0.5520773 0.72396137 [76,] 0.29305349 0.5861070 0.70694651 [77,] 0.33133399 0.6626680 0.66866601 [78,] 0.33041004 0.6608201 0.66958996 [79,] 0.37724561 0.7544912 0.62275439 [80,] 0.33154895 0.6630979 0.66845105 [81,] 0.28862352 0.5772470 0.71137648 [82,] 0.60689096 0.7862181 0.39310904 [83,] 0.57055855 0.8588829 0.42944145 [84,] 0.52271915 0.9545617 0.47728085 [85,] 0.52602891 0.9479422 0.47397109 [86,] 0.51063369 0.9787326 0.48936631 [87,] 0.49721390 0.9944278 0.50278610 [88,] 0.49169145 0.9833829 0.50830855 [89,] 0.47608134 0.9521627 0.52391866 [90,] 0.43667630 0.8733526 0.56332370 [91,] 0.42332174 0.8466435 0.57667826 [92,] 0.46726857 0.9345371 0.53273143 [93,] 0.45685752 0.9137150 0.54314248 [94,] 0.42701095 0.8540219 0.57298905 [95,] 0.38149563 0.7629913 0.61850437 [96,] 0.42256171 0.8451234 0.57743829 [97,] 0.53431913 0.9313617 0.46568087 [98,] 0.52379376 0.9524125 0.47620624 [99,] 0.58308123 0.8338375 0.41691877 [100,] 0.92810048 0.1437990 0.07189952 [101,] 0.94512804 0.1097439 0.05487196 [102,] 0.93201546 0.1359691 0.06798454 [103,] 0.91138555 0.1772289 0.08861445 [104,] 0.90931157 0.1813769 0.09068843 [105,] 0.88310832 0.2337834 0.11689168 [106,] 0.91516990 0.1696602 0.08483010 [107,] 0.89851638 0.2029672 0.10148362 [108,] 0.90640067 0.1871987 0.09359933 [109,] 0.91634062 0.1673188 0.08365938 [110,] 0.90205025 0.1958995 0.09794975 [111,] 0.89806554 0.2038689 0.10193446 [112,] 0.86357333 0.2728533 0.13642667 [113,] 0.82436733 0.3512653 0.17563267 [114,] 0.77527713 0.4494457 0.22472287 [115,] 0.77116973 0.4576605 0.22883027 [116,] 0.72484608 0.5503078 0.27515392 [117,] 0.66721885 0.6655623 0.33278115 [118,] 0.64887030 0.7022594 0.35112970 [119,] 0.57122230 0.8575554 0.42877770 [120,] 0.60997591 0.7800482 0.39002409 [121,] 0.61985759 0.7602848 0.38014241 [122,] 0.59557334 0.8088533 0.40442666 [123,] 0.70725416 0.5854917 0.29274584 [124,] 0.61729606 0.7654079 0.38270394 [125,] 0.58527228 0.8294554 0.41472772 [126,] 0.48605509 0.9721102 0.51394491 [127,] 0.47702112 0.9540422 0.52297888 [128,] 0.73068450 0.5386310 0.26931550 [129,] 0.63250472 0.7349906 0.36749528 [130,] 0.48097131 0.9619426 0.51902869 > postscript(file="/var/www/html/rcomp/tmp/1szdw1291026316.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/2szdw1291026316.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/3szdw1291026316.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/438uz1291026316.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/538uz1291026316.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 = 159 Frequency = 1 1 2 3 4 5 6 1.07142857 4.07142857 7.21428571 -2.92307692 0.76923077 0.15384615 7 8 9 10 11 12 2.23076923 -0.38461538 -6.07692308 -1.53846154 -1.92307692 -2.38461538 13 14 15 16 17 18 -7.92857143 -4.92857143 0.21428571 5.07692308 0.76923077 -7.84615385 19 20 21 22 23 24 -0.76923077 -0.38461538 -0.07692308 -1.53846154 -1.92307692 -3.38461538 25 26 27 28 29 30 -2.92857143 2.07142857 2.21428571 -2.92307692 2.76923077 0.15384615 31 32 33 34 35 36 2.23076923 2.61538462 5.92307692 9.46153846 4.07692308 7.61538462 37 38 39 40 41 42 5.07142857 -3.92857143 5.21428571 7.07692308 4.76923077 3.15384615 43 44 45 46 47 48 -8.76923077 1.61538462 2.92307692 -2.53846154 -2.92307692 10.61538462 49 50 51 52 53 54 2.07142857 4.07142857 0.21428571 -0.92307692 -1.23076923 -6.84615385 55 56 57 58 59 60 7.23076923 0.61538462 2.92307692 1.46153846 1.07692308 -7.38461538 61 62 63 64 65 66 1.07142857 3.07142857 1.21428571 2.07692308 -2.23076923 9.15384615 67 68 69 70 71 72 -0.76923077 3.61538462 -4.07692308 2.46153846 -0.92307692 -0.38461538 73 74 75 76 77 78 4.07142857 2.07142857 2.21428571 -1.92307692 -0.23076923 0.15384615 79 80 81 82 83 84 0.23076923 1.61538462 1.92307692 -5.53846154 -1.92307692 3.61538462 85 86 87 88 89 90 -3.92857143 -0.92857143 3.21428571 1.07692308 5.76923077 -4.84615385 91 92 93 94 95 96 -5.76923077 -4.38461538 -6.07692308 -0.53846154 0.07692308 10.61538462 97 98 99 100 101 102 -1.92857143 0.07142857 -4.78571429 -3.92307692 1.76923077 -2.84615385 103 104 105 106 107 108 -2.76923077 -2.38461538 -3.07692308 -5.53846154 -2.92307692 -2.38461538 109 110 111 112 113 114 -0.92857143 -5.92857143 -8.78571429 -3.92307692 2.76923077 13.15384615 115 116 117 118 119 120 6.23076923 -2.38461538 1.92307692 -2.53846154 1.07692308 -8.38461538 121 122 123 124 125 126 3.07142857 -3.92857143 2.21428571 -1.92307692 -2.23076923 -0.84615385 127 128 129 130 131 132 -0.76923077 0.61538462 -2.07692308 3.46153846 3.07692308 -5.38461538 133 134 135 136 137 138 0.07142857 -2.92857143 -6.78571429 4.07692308 -2.23076923 -0.84615385 139 140 141 142 143 144 -1.76923077 -1.38461538 -0.07692308 6.46153846 0.07692308 -0.38461538 145 146 147 148 149 150 0.07142857 6.07142857 2.21428571 -0.92307692 -11.23076923 -1.84615385 151 152 153 154 155 156 3.23076923 0.61538462 5.92307692 -3.53846154 3.07692308 -2.38461538 157 158 159 1.07142857 1.07142857 -5.78571429 > postscript(file="/var/www/html/rcomp/tmp/638uz1291026316.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 = 159 Frequency = 1 lag(myerror, k = 1) myerror 0 1.07142857 NA 1 4.07142857 1.07142857 2 7.21428571 4.07142857 3 -2.92307692 7.21428571 4 0.76923077 -2.92307692 5 0.15384615 0.76923077 6 2.23076923 0.15384615 7 -0.38461538 2.23076923 8 -6.07692308 -0.38461538 9 -1.53846154 -6.07692308 10 -1.92307692 -1.53846154 11 -2.38461538 -1.92307692 12 -7.92857143 -2.38461538 13 -4.92857143 -7.92857143 14 0.21428571 -4.92857143 15 5.07692308 0.21428571 16 0.76923077 5.07692308 17 -7.84615385 0.76923077 18 -0.76923077 -7.84615385 19 -0.38461538 -0.76923077 20 -0.07692308 -0.38461538 21 -1.53846154 -0.07692308 22 -1.92307692 -1.53846154 23 -3.38461538 -1.92307692 24 -2.92857143 -3.38461538 25 2.07142857 -2.92857143 26 2.21428571 2.07142857 27 -2.92307692 2.21428571 28 2.76923077 -2.92307692 29 0.15384615 2.76923077 30 2.23076923 0.15384615 31 2.61538462 2.23076923 32 5.92307692 2.61538462 33 9.46153846 5.92307692 34 4.07692308 9.46153846 35 7.61538462 4.07692308 36 5.07142857 7.61538462 37 -3.92857143 5.07142857 38 5.21428571 -3.92857143 39 7.07692308 5.21428571 40 4.76923077 7.07692308 41 3.15384615 4.76923077 42 -8.76923077 3.15384615 43 1.61538462 -8.76923077 44 2.92307692 1.61538462 45 -2.53846154 2.92307692 46 -2.92307692 -2.53846154 47 10.61538462 -2.92307692 48 2.07142857 10.61538462 49 4.07142857 2.07142857 50 0.21428571 4.07142857 51 -0.92307692 0.21428571 52 -1.23076923 -0.92307692 53 -6.84615385 -1.23076923 54 7.23076923 -6.84615385 55 0.61538462 7.23076923 56 2.92307692 0.61538462 57 1.46153846 2.92307692 58 1.07692308 1.46153846 59 -7.38461538 1.07692308 60 1.07142857 -7.38461538 61 3.07142857 1.07142857 62 1.21428571 3.07142857 63 2.07692308 1.21428571 64 -2.23076923 2.07692308 65 9.15384615 -2.23076923 66 -0.76923077 9.15384615 67 3.61538462 -0.76923077 68 -4.07692308 3.61538462 69 2.46153846 -4.07692308 70 -0.92307692 2.46153846 71 -0.38461538 -0.92307692 72 4.07142857 -0.38461538 73 2.07142857 4.07142857 74 2.21428571 2.07142857 75 -1.92307692 2.21428571 76 -0.23076923 -1.92307692 77 0.15384615 -0.23076923 78 0.23076923 0.15384615 79 1.61538462 0.23076923 80 1.92307692 1.61538462 81 -5.53846154 1.92307692 82 -1.92307692 -5.53846154 83 3.61538462 -1.92307692 84 -3.92857143 3.61538462 85 -0.92857143 -3.92857143 86 3.21428571 -0.92857143 87 1.07692308 3.21428571 88 5.76923077 1.07692308 89 -4.84615385 5.76923077 90 -5.76923077 -4.84615385 91 -4.38461538 -5.76923077 92 -6.07692308 -4.38461538 93 -0.53846154 -6.07692308 94 0.07692308 -0.53846154 95 10.61538462 0.07692308 96 -1.92857143 10.61538462 97 0.07142857 -1.92857143 98 -4.78571429 0.07142857 99 -3.92307692 -4.78571429 100 1.76923077 -3.92307692 101 -2.84615385 1.76923077 102 -2.76923077 -2.84615385 103 -2.38461538 -2.76923077 104 -3.07692308 -2.38461538 105 -5.53846154 -3.07692308 106 -2.92307692 -5.53846154 107 -2.38461538 -2.92307692 108 -0.92857143 -2.38461538 109 -5.92857143 -0.92857143 110 -8.78571429 -5.92857143 111 -3.92307692 -8.78571429 112 2.76923077 -3.92307692 113 13.15384615 2.76923077 114 6.23076923 13.15384615 115 -2.38461538 6.23076923 116 1.92307692 -2.38461538 117 -2.53846154 1.92307692 118 1.07692308 -2.53846154 119 -8.38461538 1.07692308 120 3.07142857 -8.38461538 121 -3.92857143 3.07142857 122 2.21428571 -3.92857143 123 -1.92307692 2.21428571 124 -2.23076923 -1.92307692 125 -0.84615385 -2.23076923 126 -0.76923077 -0.84615385 127 0.61538462 -0.76923077 128 -2.07692308 0.61538462 129 3.46153846 -2.07692308 130 3.07692308 3.46153846 131 -5.38461538 3.07692308 132 0.07142857 -5.38461538 133 -2.92857143 0.07142857 134 -6.78571429 -2.92857143 135 4.07692308 -6.78571429 136 -2.23076923 4.07692308 137 -0.84615385 -2.23076923 138 -1.76923077 -0.84615385 139 -1.38461538 -1.76923077 140 -0.07692308 -1.38461538 141 6.46153846 -0.07692308 142 0.07692308 6.46153846 143 -0.38461538 0.07692308 144 0.07142857 -0.38461538 145 6.07142857 0.07142857 146 2.21428571 6.07142857 147 -0.92307692 2.21428571 148 -11.23076923 -0.92307692 149 -1.84615385 -11.23076923 150 3.23076923 -1.84615385 151 0.61538462 3.23076923 152 5.92307692 0.61538462 153 -3.53846154 5.92307692 154 3.07692308 -3.53846154 155 -2.38461538 3.07692308 156 1.07142857 -2.38461538 157 1.07142857 1.07142857 158 -5.78571429 1.07142857 159 NA -5.78571429 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 4.07142857 1.07142857 [2,] 7.21428571 4.07142857 [3,] -2.92307692 7.21428571 [4,] 0.76923077 -2.92307692 [5,] 0.15384615 0.76923077 [6,] 2.23076923 0.15384615 [7,] -0.38461538 2.23076923 [8,] -6.07692308 -0.38461538 [9,] -1.53846154 -6.07692308 [10,] -1.92307692 -1.53846154 [11,] -2.38461538 -1.92307692 [12,] -7.92857143 -2.38461538 [13,] -4.92857143 -7.92857143 [14,] 0.21428571 -4.92857143 [15,] 5.07692308 0.21428571 [16,] 0.76923077 5.07692308 [17,] -7.84615385 0.76923077 [18,] -0.76923077 -7.84615385 [19,] -0.38461538 -0.76923077 [20,] -0.07692308 -0.38461538 [21,] -1.53846154 -0.07692308 [22,] -1.92307692 -1.53846154 [23,] -3.38461538 -1.92307692 [24,] -2.92857143 -3.38461538 [25,] 2.07142857 -2.92857143 [26,] 2.21428571 2.07142857 [27,] -2.92307692 2.21428571 [28,] 2.76923077 -2.92307692 [29,] 0.15384615 2.76923077 [30,] 2.23076923 0.15384615 [31,] 2.61538462 2.23076923 [32,] 5.92307692 2.61538462 [33,] 9.46153846 5.92307692 [34,] 4.07692308 9.46153846 [35,] 7.61538462 4.07692308 [36,] 5.07142857 7.61538462 [37,] -3.92857143 5.07142857 [38,] 5.21428571 -3.92857143 [39,] 7.07692308 5.21428571 [40,] 4.76923077 7.07692308 [41,] 3.15384615 4.76923077 [42,] -8.76923077 3.15384615 [43,] 1.61538462 -8.76923077 [44,] 2.92307692 1.61538462 [45,] -2.53846154 2.92307692 [46,] -2.92307692 -2.53846154 [47,] 10.61538462 -2.92307692 [48,] 2.07142857 10.61538462 [49,] 4.07142857 2.07142857 [50,] 0.21428571 4.07142857 [51,] -0.92307692 0.21428571 [52,] -1.23076923 -0.92307692 [53,] -6.84615385 -1.23076923 [54,] 7.23076923 -6.84615385 [55,] 0.61538462 7.23076923 [56,] 2.92307692 0.61538462 [57,] 1.46153846 2.92307692 [58,] 1.07692308 1.46153846 [59,] -7.38461538 1.07692308 [60,] 1.07142857 -7.38461538 [61,] 3.07142857 1.07142857 [62,] 1.21428571 3.07142857 [63,] 2.07692308 1.21428571 [64,] -2.23076923 2.07692308 [65,] 9.15384615 -2.23076923 [66,] -0.76923077 9.15384615 [67,] 3.61538462 -0.76923077 [68,] -4.07692308 3.61538462 [69,] 2.46153846 -4.07692308 [70,] -0.92307692 2.46153846 [71,] -0.38461538 -0.92307692 [72,] 4.07142857 -0.38461538 [73,] 2.07142857 4.07142857 [74,] 2.21428571 2.07142857 [75,] -1.92307692 2.21428571 [76,] -0.23076923 -1.92307692 [77,] 0.15384615 -0.23076923 [78,] 0.23076923 0.15384615 [79,] 1.61538462 0.23076923 [80,] 1.92307692 1.61538462 [81,] -5.53846154 1.92307692 [82,] -1.92307692 -5.53846154 [83,] 3.61538462 -1.92307692 [84,] -3.92857143 3.61538462 [85,] -0.92857143 -3.92857143 [86,] 3.21428571 -0.92857143 [87,] 1.07692308 3.21428571 [88,] 5.76923077 1.07692308 [89,] -4.84615385 5.76923077 [90,] -5.76923077 -4.84615385 [91,] -4.38461538 -5.76923077 [92,] -6.07692308 -4.38461538 [93,] -0.53846154 -6.07692308 [94,] 0.07692308 -0.53846154 [95,] 10.61538462 0.07692308 [96,] -1.92857143 10.61538462 [97,] 0.07142857 -1.92857143 [98,] -4.78571429 0.07142857 [99,] -3.92307692 -4.78571429 [100,] 1.76923077 -3.92307692 [101,] -2.84615385 1.76923077 [102,] -2.76923077 -2.84615385 [103,] -2.38461538 -2.76923077 [104,] -3.07692308 -2.38461538 [105,] -5.53846154 -3.07692308 [106,] -2.92307692 -5.53846154 [107,] -2.38461538 -2.92307692 [108,] -0.92857143 -2.38461538 [109,] -5.92857143 -0.92857143 [110,] -8.78571429 -5.92857143 [111,] -3.92307692 -8.78571429 [112,] 2.76923077 -3.92307692 [113,] 13.15384615 2.76923077 [114,] 6.23076923 13.15384615 [115,] -2.38461538 6.23076923 [116,] 1.92307692 -2.38461538 [117,] -2.53846154 1.92307692 [118,] 1.07692308 -2.53846154 [119,] -8.38461538 1.07692308 [120,] 3.07142857 -8.38461538 [121,] -3.92857143 3.07142857 [122,] 2.21428571 -3.92857143 [123,] -1.92307692 2.21428571 [124,] -2.23076923 -1.92307692 [125,] -0.84615385 -2.23076923 [126,] -0.76923077 -0.84615385 [127,] 0.61538462 -0.76923077 [128,] -2.07692308 0.61538462 [129,] 3.46153846 -2.07692308 [130,] 3.07692308 3.46153846 [131,] -5.38461538 3.07692308 [132,] 0.07142857 -5.38461538 [133,] -2.92857143 0.07142857 [134,] -6.78571429 -2.92857143 [135,] 4.07692308 -6.78571429 [136,] -2.23076923 4.07692308 [137,] -0.84615385 -2.23076923 [138,] -1.76923077 -0.84615385 [139,] -1.38461538 -1.76923077 [140,] -0.07692308 -1.38461538 [141,] 6.46153846 -0.07692308 [142,] 0.07692308 6.46153846 [143,] -0.38461538 0.07692308 [144,] 0.07142857 -0.38461538 [145,] 6.07142857 0.07142857 [146,] 2.21428571 6.07142857 [147,] -0.92307692 2.21428571 [148,] -11.23076923 -0.92307692 [149,] -1.84615385 -11.23076923 [150,] 3.23076923 -1.84615385 [151,] 0.61538462 3.23076923 [152,] 5.92307692 0.61538462 [153,] -3.53846154 5.92307692 [154,] 3.07692308 -3.53846154 [155,] -2.38461538 3.07692308 [156,] 1.07142857 -2.38461538 [157,] 1.07142857 1.07142857 [158,] -5.78571429 1.07142857 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 4.07142857 1.07142857 2 7.21428571 4.07142857 3 -2.92307692 7.21428571 4 0.76923077 -2.92307692 5 0.15384615 0.76923077 6 2.23076923 0.15384615 7 -0.38461538 2.23076923 8 -6.07692308 -0.38461538 9 -1.53846154 -6.07692308 10 -1.92307692 -1.53846154 11 -2.38461538 -1.92307692 12 -7.92857143 -2.38461538 13 -4.92857143 -7.92857143 14 0.21428571 -4.92857143 15 5.07692308 0.21428571 16 0.76923077 5.07692308 17 -7.84615385 0.76923077 18 -0.76923077 -7.84615385 19 -0.38461538 -0.76923077 20 -0.07692308 -0.38461538 21 -1.53846154 -0.07692308 22 -1.92307692 -1.53846154 23 -3.38461538 -1.92307692 24 -2.92857143 -3.38461538 25 2.07142857 -2.92857143 26 2.21428571 2.07142857 27 -2.92307692 2.21428571 28 2.76923077 -2.92307692 29 0.15384615 2.76923077 30 2.23076923 0.15384615 31 2.61538462 2.23076923 32 5.92307692 2.61538462 33 9.46153846 5.92307692 34 4.07692308 9.46153846 35 7.61538462 4.07692308 36 5.07142857 7.61538462 37 -3.92857143 5.07142857 38 5.21428571 -3.92857143 39 7.07692308 5.21428571 40 4.76923077 7.07692308 41 3.15384615 4.76923077 42 -8.76923077 3.15384615 43 1.61538462 -8.76923077 44 2.92307692 1.61538462 45 -2.53846154 2.92307692 46 -2.92307692 -2.53846154 47 10.61538462 -2.92307692 48 2.07142857 10.61538462 49 4.07142857 2.07142857 50 0.21428571 4.07142857 51 -0.92307692 0.21428571 52 -1.23076923 -0.92307692 53 -6.84615385 -1.23076923 54 7.23076923 -6.84615385 55 0.61538462 7.23076923 56 2.92307692 0.61538462 57 1.46153846 2.92307692 58 1.07692308 1.46153846 59 -7.38461538 1.07692308 60 1.07142857 -7.38461538 61 3.07142857 1.07142857 62 1.21428571 3.07142857 63 2.07692308 1.21428571 64 -2.23076923 2.07692308 65 9.15384615 -2.23076923 66 -0.76923077 9.15384615 67 3.61538462 -0.76923077 68 -4.07692308 3.61538462 69 2.46153846 -4.07692308 70 -0.92307692 2.46153846 71 -0.38461538 -0.92307692 72 4.07142857 -0.38461538 73 2.07142857 4.07142857 74 2.21428571 2.07142857 75 -1.92307692 2.21428571 76 -0.23076923 -1.92307692 77 0.15384615 -0.23076923 78 0.23076923 0.15384615 79 1.61538462 0.23076923 80 1.92307692 1.61538462 81 -5.53846154 1.92307692 82 -1.92307692 -5.53846154 83 3.61538462 -1.92307692 84 -3.92857143 3.61538462 85 -0.92857143 -3.92857143 86 3.21428571 -0.92857143 87 1.07692308 3.21428571 88 5.76923077 1.07692308 89 -4.84615385 5.76923077 90 -5.76923077 -4.84615385 91 -4.38461538 -5.76923077 92 -6.07692308 -4.38461538 93 -0.53846154 -6.07692308 94 0.07692308 -0.53846154 95 10.61538462 0.07692308 96 -1.92857143 10.61538462 97 0.07142857 -1.92857143 98 -4.78571429 0.07142857 99 -3.92307692 -4.78571429 100 1.76923077 -3.92307692 101 -2.84615385 1.76923077 102 -2.76923077 -2.84615385 103 -2.38461538 -2.76923077 104 -3.07692308 -2.38461538 105 -5.53846154 -3.07692308 106 -2.92307692 -5.53846154 107 -2.38461538 -2.92307692 108 -0.92857143 -2.38461538 109 -5.92857143 -0.92857143 110 -8.78571429 -5.92857143 111 -3.92307692 -8.78571429 112 2.76923077 -3.92307692 113 13.15384615 2.76923077 114 6.23076923 13.15384615 115 -2.38461538 6.23076923 116 1.92307692 -2.38461538 117 -2.53846154 1.92307692 118 1.07692308 -2.53846154 119 -8.38461538 1.07692308 120 3.07142857 -8.38461538 121 -3.92857143 3.07142857 122 2.21428571 -3.92857143 123 -1.92307692 2.21428571 124 -2.23076923 -1.92307692 125 -0.84615385 -2.23076923 126 -0.76923077 -0.84615385 127 0.61538462 -0.76923077 128 -2.07692308 0.61538462 129 3.46153846 -2.07692308 130 3.07692308 3.46153846 131 -5.38461538 3.07692308 132 0.07142857 -5.38461538 133 -2.92857143 0.07142857 134 -6.78571429 -2.92857143 135 4.07692308 -6.78571429 136 -2.23076923 4.07692308 137 -0.84615385 -2.23076923 138 -1.76923077 -0.84615385 139 -1.38461538 -1.76923077 140 -0.07692308 -1.38461538 141 6.46153846 -0.07692308 142 0.07692308 6.46153846 143 -0.38461538 0.07692308 144 0.07142857 -0.38461538 145 6.07142857 0.07142857 146 2.21428571 6.07142857 147 -0.92307692 2.21428571 148 -11.23076923 -0.92307692 149 -1.84615385 -11.23076923 150 3.23076923 -1.84615385 151 0.61538462 3.23076923 152 5.92307692 0.61538462 153 -3.53846154 5.92307692 154 3.07692308 -3.53846154 155 -2.38461538 3.07692308 156 1.07142857 -2.38461538 157 1.07142857 1.07142857 158 -5.78571429 1.07142857 > 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/7ehb21291026316.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/879tn1291026316.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/979tn1291026316.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/10ziaq1291026316.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/11308e1291026316.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/12ojpk1291026316.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/132b5a1291026316.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/146t3g1291026316.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/159ck41291026316.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/16uu0s1291026316.tab") + } > try(system("convert tmp/1szdw1291026316.ps tmp/1szdw1291026316.png",intern=TRUE)) character(0) > try(system("convert tmp/2szdw1291026316.ps tmp/2szdw1291026316.png",intern=TRUE)) character(0) > try(system("convert tmp/3szdw1291026316.ps tmp/3szdw1291026316.png",intern=TRUE)) character(0) > try(system("convert tmp/438uz1291026316.ps tmp/438uz1291026316.png",intern=TRUE)) character(0) > try(system("convert tmp/538uz1291026316.ps tmp/538uz1291026316.png",intern=TRUE)) character(0) > try(system("convert tmp/638uz1291026316.ps tmp/638uz1291026316.png",intern=TRUE)) character(0) > try(system("convert tmp/7ehb21291026316.ps tmp/7ehb21291026316.png",intern=TRUE)) character(0) > try(system("convert tmp/879tn1291026316.ps tmp/879tn1291026316.png",intern=TRUE)) character(0) > try(system("convert tmp/979tn1291026316.ps tmp/979tn1291026316.png",intern=TRUE)) character(0) > try(system("convert tmp/10ziaq1291026316.ps tmp/10ziaq1291026316.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.927 1.727 9.773