R version 2.8.0 (2008-10-20) Copyright (C) 2008 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. Natural language support but running in an English locale 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 = '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 t 1 24 1 0 0 0 0 0 0 0 0 0 0 1 2 25 0 1 0 0 0 0 0 0 0 0 0 2 3 30 0 0 1 0 0 0 0 0 0 0 0 3 4 19 0 0 0 1 0 0 0 0 0 0 0 4 5 22 0 0 0 0 1 0 0 0 0 0 0 5 6 22 0 0 0 0 0 1 0 0 0 0 0 6 7 25 0 0 0 0 0 0 1 0 0 0 0 7 8 23 0 0 0 0 0 0 0 1 0 0 0 8 9 17 0 0 0 0 0 0 0 0 1 0 0 9 10 21 0 0 0 0 0 0 0 0 0 1 0 10 11 19 0 0 0 0 0 0 0 0 0 0 1 11 12 19 0 0 0 0 0 0 0 0 0 0 0 12 13 15 1 0 0 0 0 0 0 0 0 0 0 13 14 16 0 1 0 0 0 0 0 0 0 0 0 14 15 23 0 0 1 0 0 0 0 0 0 0 0 15 16 27 0 0 0 1 0 0 0 0 0 0 0 16 17 22 0 0 0 0 1 0 0 0 0 0 0 17 18 14 0 0 0 0 0 1 0 0 0 0 0 18 19 22 0 0 0 0 0 0 1 0 0 0 0 19 20 23 0 0 0 0 0 0 0 1 0 0 0 20 21 23 0 0 0 0 0 0 0 0 1 0 0 21 22 21 0 0 0 0 0 0 0 0 0 1 0 22 23 19 0 0 0 0 0 0 0 0 0 0 1 23 24 18 0 0 0 0 0 0 0 0 0 0 0 24 25 20 1 0 0 0 0 0 0 0 0 0 0 25 26 23 0 1 0 0 0 0 0 0 0 0 0 26 27 25 0 0 1 0 0 0 0 0 0 0 0 27 28 19 0 0 0 1 0 0 0 0 0 0 0 28 29 24 0 0 0 0 1 0 0 0 0 0 0 29 30 22 0 0 0 0 0 1 0 0 0 0 0 30 31 25 0 0 0 0 0 0 1 0 0 0 0 31 32 26 0 0 0 0 0 0 0 1 0 0 0 32 33 29 0 0 0 0 0 0 0 0 1 0 0 33 34 32 0 0 0 0 0 0 0 0 0 1 0 34 35 25 0 0 0 0 0 0 0 0 0 0 1 35 36 29 0 0 0 0 0 0 0 0 0 0 0 36 37 28 1 0 0 0 0 0 0 0 0 0 0 37 38 17 0 1 0 0 0 0 0 0 0 0 0 38 39 28 0 0 1 0 0 0 0 0 0 0 0 39 40 29 0 0 0 1 0 0 0 0 0 0 0 40 41 26 0 0 0 0 1 0 0 0 0 0 0 41 42 25 0 0 0 0 0 1 0 0 0 0 0 42 43 14 0 0 0 0 0 0 1 0 0 0 0 43 44 25 0 0 0 0 0 0 0 1 0 0 0 44 45 26 0 0 0 0 0 0 0 0 1 0 0 45 46 20 0 0 0 0 0 0 0 0 0 1 0 46 47 18 0 0 0 0 0 0 0 0 0 0 1 47 48 32 0 0 0 0 0 0 0 0 0 0 0 48 49 25 1 0 0 0 0 0 0 0 0 0 0 49 50 25 0 1 0 0 0 0 0 0 0 0 0 50 51 23 0 0 1 0 0 0 0 0 0 0 0 51 52 21 0 0 0 1 0 0 0 0 0 0 0 52 53 20 0 0 0 0 1 0 0 0 0 0 0 53 54 15 0 0 0 0 0 1 0 0 0 0 0 54 55 30 0 0 0 0 0 0 1 0 0 0 0 55 56 24 0 0 0 0 0 0 0 1 0 0 0 56 57 26 0 0 0 0 0 0 0 0 1 0 0 57 58 24 0 0 0 0 0 0 0 0 0 1 0 58 59 22 0 0 0 0 0 0 0 0 0 0 1 59 60 14 0 0 0 0 0 0 0 0 0 0 0 60 61 24 1 0 0 0 0 0 0 0 0 0 0 61 62 24 0 1 0 0 0 0 0 0 0 0 0 62 63 24 0 0 1 0 0 0 0 0 0 0 0 63 64 24 0 0 0 1 0 0 0 0 0 0 0 64 65 19 0 0 0 0 1 0 0 0 0 0 0 65 66 31 0 0 0 0 0 1 0 0 0 0 0 66 67 22 0 0 0 0 0 0 1 0 0 0 0 67 68 27 0 0 0 0 0 0 0 1 0 0 0 68 69 19 0 0 0 0 0 0 0 0 1 0 0 69 70 25 0 0 0 0 0 0 0 0 0 1 0 70 71 20 0 0 0 0 0 0 0 0 0 0 1 71 72 21 0 0 0 0 0 0 0 0 0 0 0 72 73 27 1 0 0 0 0 0 0 0 0 0 0 73 74 23 0 1 0 0 0 0 0 0 0 0 0 74 75 25 0 0 1 0 0 0 0 0 0 0 0 75 76 20 0 0 0 1 0 0 0 0 0 0 0 76 77 21 0 0 0 0 1 0 0 0 0 0 0 77 78 22 0 0 0 0 0 1 0 0 0 0 0 78 79 23 0 0 0 0 0 0 1 0 0 0 0 79 80 25 0 0 0 0 0 0 0 1 0 0 0 80 81 25 0 0 0 0 0 0 0 0 1 0 0 81 82 17 0 0 0 0 0 0 0 0 0 1 0 82 83 19 0 0 0 0 0 0 0 0 0 0 1 83 84 25 0 0 0 0 0 0 0 0 0 0 0 84 85 19 1 0 0 0 0 0 0 0 0 0 0 85 86 20 0 1 0 0 0 0 0 0 0 0 0 86 87 26 0 0 1 0 0 0 0 0 0 0 0 87 88 23 0 0 0 1 0 0 0 0 0 0 0 88 89 27 0 0 0 0 1 0 0 0 0 0 0 89 90 17 0 0 0 0 0 1 0 0 0 0 0 90 91 17 0 0 0 0 0 0 1 0 0 0 0 91 92 19 0 0 0 0 0 0 0 1 0 0 0 92 93 17 0 0 0 0 0 0 0 0 1 0 0 93 94 22 0 0 0 0 0 0 0 0 0 1 0 94 95 21 0 0 0 0 0 0 0 0 0 0 1 95 96 32 0 0 0 0 0 0 0 0 0 0 0 96 97 21 1 0 0 0 0 0 0 0 0 0 0 97 98 21 0 1 0 0 0 0 0 0 0 0 0 98 99 18 0 0 1 0 0 0 0 0 0 0 0 99 100 18 0 0 0 1 0 0 0 0 0 0 0 100 101 23 0 0 0 0 1 0 0 0 0 0 0 101 102 19 0 0 0 0 0 1 0 0 0 0 0 102 103 20 0 0 0 0 0 0 1 0 0 0 0 103 104 21 0 0 0 0 0 0 0 1 0 0 0 104 105 20 0 0 0 0 0 0 0 0 1 0 0 105 106 17 0 0 0 0 0 0 0 0 0 1 0 106 107 18 0 0 0 0 0 0 0 0 0 0 1 107 108 19 0 0 0 0 0 0 0 0 0 0 0 108 109 22 1 0 0 0 0 0 0 0 0 0 0 109 110 15 0 1 0 0 0 0 0 0 0 0 0 110 111 14 0 0 1 0 0 0 0 0 0 0 0 111 112 18 0 0 0 1 0 0 0 0 0 0 0 112 113 24 0 0 0 0 1 0 0 0 0 0 0 113 114 35 0 0 0 0 0 1 0 0 0 0 0 114 115 29 0 0 0 0 0 0 1 0 0 0 0 115 116 21 0 0 0 0 0 0 0 1 0 0 0 116 117 25 0 0 0 0 0 0 0 0 1 0 0 117 118 20 0 0 0 0 0 0 0 0 0 1 0 118 119 22 0 0 0 0 0 0 0 0 0 0 1 119 120 13 0 0 0 0 0 0 0 0 0 0 0 120 121 26 1 0 0 0 0 0 0 0 0 0 0 121 122 17 0 1 0 0 0 0 0 0 0 0 0 122 123 25 0 0 1 0 0 0 0 0 0 0 0 123 124 20 0 0 0 1 0 0 0 0 0 0 0 124 125 19 0 0 0 0 1 0 0 0 0 0 0 125 126 21 0 0 0 0 0 1 0 0 0 0 0 126 127 22 0 0 0 0 0 0 1 0 0 0 0 127 128 24 0 0 0 0 0 0 0 1 0 0 0 128 129 21 0 0 0 0 0 0 0 0 1 0 0 129 130 26 0 0 0 0 0 0 0 0 0 1 0 130 131 24 0 0 0 0 0 0 0 0 0 0 1 131 132 16 0 0 0 0 0 0 0 0 0 0 0 132 133 23 1 0 0 0 0 0 0 0 0 0 0 133 134 18 0 1 0 0 0 0 0 0 0 0 0 134 135 16 0 0 1 0 0 0 0 0 0 0 0 135 136 26 0 0 0 1 0 0 0 0 0 0 0 136 137 19 0 0 0 0 1 0 0 0 0 0 0 137 138 21 0 0 0 0 0 1 0 0 0 0 0 138 139 21 0 0 0 0 0 0 1 0 0 0 0 139 140 22 0 0 0 0 0 0 0 1 0 0 0 140 141 23 0 0 0 0 0 0 0 0 1 0 0 141 142 29 0 0 0 0 0 0 0 0 0 1 0 142 143 21 0 0 0 0 0 0 0 0 0 0 1 143 144 21 0 0 0 0 0 0 0 0 0 0 0 144 145 23 1 0 0 0 0 0 0 0 0 0 0 145 146 27 0 1 0 0 0 0 0 0 0 0 0 146 147 25 0 0 1 0 0 0 0 0 0 0 0 147 148 21 0 0 0 1 0 0 0 0 0 0 0 148 149 10 0 0 0 0 1 0 0 0 0 0 0 149 150 20 0 0 0 0 0 1 0 0 0 0 0 150 151 26 0 0 0 0 0 0 1 0 0 0 0 151 152 24 0 0 0 0 0 0 0 1 0 0 0 152 153 29 0 0 0 0 0 0 0 0 1 0 0 153 154 19 0 0 0 0 0 0 0 0 0 1 0 154 155 24 0 0 0 0 0 0 0 0 0 0 1 155 156 19 0 0 0 0 0 0 0 0 0 0 0 156 157 24 1 0 0 0 0 0 0 0 0 0 0 157 158 22 0 1 0 0 0 0 0 0 0 0 0 158 159 17 0 0 1 0 0 0 0 0 0 0 0 159 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) M1 M2 M3 M4 M5 22.182504 1.496463 -0.494039 1.372603 0.462472 -0.220337 M6 M7 M8 M9 M10 M11 0.404546 1.337122 1.962005 1.663812 1.134849 -0.471037 t -0.009499 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -10.5469 -2.5171 -0.2308 2.3304 13.4958 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 22.182504 1.338124 16.577 <2e-16 *** M1 1.496463 1.646464 0.909 0.365 M2 -0.494039 1.646315 -0.300 0.765 M3 1.372603 1.646198 0.834 0.406 M4 0.462472 1.677297 0.276 0.783 M5 -0.220337 1.677053 -0.131 0.896 M6 0.404546 1.676841 0.241 0.810 M7 1.337122 1.676662 0.797 0.426 M8 1.962005 1.676515 1.170 0.244 M9 1.663812 1.676401 0.992 0.323 M10 1.134849 1.676319 0.677 0.499 M11 -0.471037 1.676271 -0.281 0.779 t -0.009499 0.007393 -1.285 0.201 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 4.274 on 146 degrees of freedom Multiple R-squared: 0.05095, Adjusted R-squared: -0.02706 F-statistic: 0.6531 on 12 and 146 DF, p-value: 0.7934 > 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.8575615 0.2848769 0.14243847 [2,] 0.7849203 0.4301595 0.21507973 [3,] 0.7358669 0.5282661 0.26413305 [4,] 0.6277461 0.7445078 0.37225390 [5,] 0.5531538 0.8936923 0.44684617 [6,] 0.6513111 0.6973778 0.34868891 [7,] 0.5688122 0.8623755 0.43118776 [8,] 0.4863410 0.9726820 0.51365902 [9,] 0.4051739 0.8103478 0.59482608 [10,] 0.3570576 0.7141151 0.64294244 [11,] 0.3305472 0.6610944 0.66945282 [12,] 0.2572417 0.5144834 0.74275829 [13,] 0.2135992 0.4271983 0.78640083 [14,] 0.1850404 0.3700807 0.81495965 [15,] 0.1861452 0.3722905 0.81385475 [16,] 0.1470600 0.2941201 0.85293995 [17,] 0.1251182 0.2502363 0.87488184 [18,] 0.2212021 0.4424043 0.77879786 [19,] 0.4036512 0.8073024 0.59634881 [20,] 0.3866079 0.7732157 0.61339213 [21,] 0.4956002 0.9912003 0.50439983 [22,] 0.4968933 0.9937865 0.50310675 [23,] 0.5589155 0.8821690 0.44108449 [24,] 0.5149858 0.9700285 0.48501425 [25,] 0.5231530 0.9536939 0.47684695 [26,] 0.4777419 0.9554838 0.52225812 [27,] 0.4333847 0.8667695 0.56661527 [28,] 0.7229087 0.5541827 0.27709133 [29,] 0.6753611 0.6492779 0.32463893 [30,] 0.6265930 0.7468139 0.37340696 [31,] 0.6492576 0.7014847 0.35074237 [32,] 0.6419142 0.7161715 0.35808576 [33,] 0.7643672 0.4712656 0.23563280 [34,] 0.7213071 0.5573857 0.27869285 [35,] 0.6891225 0.6217550 0.31087749 [36,] 0.6940524 0.6118952 0.30594762 [37,] 0.6768801 0.6462399 0.32311994 [38,] 0.6686917 0.6626166 0.33130830 [39,] 0.7457025 0.5085949 0.25429746 [40,] 0.7905776 0.4188448 0.20942241 [41,] 0.7550625 0.4898750 0.24493748 [42,] 0.7203035 0.5593931 0.27969654 [43,] 0.6788825 0.6422351 0.32111754 [44,] 0.6314745 0.7370510 0.36852550 [45,] 0.7865279 0.4269443 0.21347214 [46,] 0.7476570 0.5046861 0.25234304 [47,] 0.7155243 0.5689514 0.28447570 [48,] 0.6891037 0.6217925 0.31089625 [49,] 0.6502605 0.6994790 0.34973952 [50,] 0.6347737 0.7304527 0.36522634 [51,] 0.7669333 0.4661335 0.23306673 [52,] 0.7338495 0.5323010 0.26615051 [53,] 0.7131262 0.5737477 0.28687384 [54,] 0.7252771 0.5494459 0.27472293 [55,] 0.6942732 0.6114536 0.30572680 [56,] 0.6539383 0.6921233 0.34606166 [57,] 0.6138054 0.7723893 0.38619465 [58,] 0.5984420 0.8031159 0.40155795 [59,] 0.5613731 0.8772537 0.43862686 [60,] 0.5463730 0.9072539 0.45362695 [61,] 0.5191158 0.9617684 0.48088419 [62,] 0.4767749 0.9535499 0.52322505 [63,] 0.4282642 0.8565285 0.57173577 [64,] 0.3825559 0.7651118 0.61744411 [65,] 0.3511929 0.7023857 0.64880715 [66,] 0.3175681 0.6351362 0.68243189 [67,] 0.3523005 0.7046010 0.64769948 [68,] 0.3160831 0.6321662 0.68391688 [69,] 0.3095111 0.6190222 0.69048888 [70,] 0.3016905 0.6033810 0.69830948 [71,] 0.2654998 0.5309996 0.73450022 [72,] 0.2822098 0.5644195 0.71779025 [73,] 0.2524610 0.5049221 0.74753897 [74,] 0.3155717 0.6311433 0.68442834 [75,] 0.3227082 0.6454165 0.67729177 [76,] 0.3507359 0.7014719 0.64926406 [77,] 0.3441411 0.6882821 0.65585893 [78,] 0.3784554 0.7569107 0.62154463 [79,] 0.3322657 0.6645314 0.66773428 [80,] 0.2884781 0.5769563 0.71152186 [81,] 0.6516606 0.6966787 0.34833937 [82,] 0.6084003 0.7831994 0.39159971 [83,] 0.5696613 0.8606773 0.43033865 [84,] 0.5676712 0.8646576 0.43232881 [85,] 0.5399635 0.9200731 0.46003653 [86,] 0.5506915 0.8986170 0.44930850 [87,] 0.5247884 0.9504232 0.47521159 [88,] 0.4926504 0.9853008 0.50734961 [89,] 0.4461381 0.8922762 0.55386188 [90,] 0.4175508 0.8351015 0.58244924 [91,] 0.4404594 0.8809188 0.55954058 [92,] 0.4205047 0.8410095 0.57949527 [93,] 0.3878113 0.7756227 0.61218866 [94,] 0.3407866 0.6815731 0.65921344 [95,] 0.3683624 0.7367247 0.63163764 [96,] 0.4698826 0.9397651 0.53011743 [97,] 0.4628430 0.9256860 0.53715699 [98,] 0.5104504 0.9790992 0.48954961 [99,] 0.9099942 0.1800116 0.09000582 [100,] 0.9386955 0.1226089 0.06130447 [101,] 0.9207119 0.1585763 0.07928813 [102,] 0.9001952 0.1996097 0.09980483 [103,] 0.8901396 0.2197208 0.10986040 [104,] 0.8596752 0.2806495 0.14032476 [105,] 0.8885992 0.2228015 0.11140076 [106,] 0.8711334 0.2577331 0.12886655 [107,] 0.8778461 0.2443079 0.12215394 [108,] 0.8910250 0.2179500 0.10897502 [109,] 0.8706162 0.2587676 0.12938379 [110,] 0.8669172 0.2661655 0.13308277 [111,] 0.8258561 0.3482878 0.17414392 [112,] 0.7770101 0.4459798 0.22298991 [113,] 0.7234910 0.5530179 0.27650897 [114,] 0.7092004 0.5815992 0.29079961 [115,] 0.6615501 0.6768998 0.33844988 [116,] 0.6043377 0.7913245 0.39566226 [117,] 0.5723129 0.8553742 0.42768711 [118,] 0.4902231 0.9804461 0.50977694 [119,] 0.5498404 0.9003192 0.45015962 [120,] 0.6305122 0.7389756 0.36948780 [121,] 0.5730362 0.8539277 0.42696384 [122,] 0.6336485 0.7327029 0.36635146 [123,] 0.5300585 0.9398830 0.46994150 [124,] 0.5335986 0.9328028 0.46640141 [125,] 0.4606872 0.9213743 0.53931283 [126,] 0.6095060 0.7809880 0.39049401 [127,] 0.7071290 0.5857420 0.29287102 [128,] 0.7435409 0.5129183 0.25645913 > postscript(file="/var/www/html/freestat/rcomp/tmp/10y3g1291023862.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/freestat/rcomp/tmp/20y3g1291023862.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/freestat/rcomp/tmp/30y3g1291023862.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/freestat/rcomp/tmp/4b7l11291023862.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/freestat/rcomp/tmp/5b7l11291023862.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 0.33053221 3.33053221 6.47338936 -3.60698125 0.08532644 -0.53005818 7 8 9 10 11 12 1.54686490 -1.06851972 -6.76082741 -2.22236587 -2.60698125 -3.06851972 13 14 15 16 17 18 -8.55548373 -5.55548373 -0.41262659 4.50700280 0.19931049 -8.41607412 19 20 21 22 23 24 -1.33915105 -0.95453566 -0.64684335 -2.10838181 -2.49299720 -3.95453566 25 26 27 28 29 30 -3.44149968 1.55850032 1.70135747 -3.37901314 2.31329455 -0.30209007 31 32 33 34 35 36 1.77483301 2.15944839 5.46714070 9.00560224 3.62098686 7.15944839 37 38 39 40 41 42 4.67248438 -4.32751562 4.81534152 6.73497091 4.42727860 2.81189399 43 44 45 46 47 48 -9.11118293 1.27343245 2.58112476 -2.88041370 -3.26502909 10.27343245 49 50 51 52 53 54 1.78646843 3.78646843 -0.07067442 -1.15104503 -1.45873734 -7.07412196 55 56 57 58 59 60 7.00280112 0.38741651 2.69510881 1.23357035 0.84895497 -7.61258349 61 62 63 64 65 66 0.90045249 2.90045249 1.04330963 1.96293902 -2.34475329 9.03986210 67 68 69 70 71 72 -0.88321482 3.50140056 -4.19090713 2.34755441 -1.03706098 -0.49859944 73 74 75 76 77 78 4.01443654 2.01443654 2.15729369 -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.87157940 -0.87157940 3.27127774 1.19090713 5.88321482 -4.73216979 91 92 93 94 95 96 -5.65524671 -4.27063133 -5.96293902 -0.42447748 0.19090713 10.72936867 97 98 99 100 101 102 -1.75759535 0.24240465 -4.61473820 -3.69510881 1.99719888 -2.61818574 103 104 105 106 107 108 -2.54126266 -2.15664727 -2.84895497 -5.31049343 -2.69510881 -2.15664727 109 110 111 112 113 114 -0.64361129 -5.64361129 -8.50075415 -3.58112476 3.11118293 13.49579832 115 116 117 118 119 120 6.57272140 -2.04266322 2.26502909 -2.19650937 1.41887524 -8.04266322 121 122 123 124 125 126 3.47037276 -3.52962724 2.61322991 -1.46714070 -1.77483301 -0.39021763 127 128 129 130 131 132 -0.31329455 1.07132084 -1.62098686 3.91747468 3.53285930 -4.92867916 133 134 135 136 137 138 0.58435682 -2.41564318 -6.27278604 4.64684335 -1.66084895 -0.27623357 139 140 141 142 143 144 -1.19931049 -0.81469511 0.49299720 7.03145874 0.64684335 0.18530489 145 146 147 148 149 150 0.69834087 6.69834087 2.84119802 -0.23917259 -10.54686490 -1.16224952 151 152 153 154 155 156 3.91467356 1.29928895 6.60698125 -2.85455721 3.76082741 -1.70071105 157 158 159 1.81232493 1.81232493 -5.04481793 > postscript(file="/var/www/html/freestat/rcomp/tmp/6b7l11291023862.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 0.33053221 NA 1 3.33053221 0.33053221 2 6.47338936 3.33053221 3 -3.60698125 6.47338936 4 0.08532644 -3.60698125 5 -0.53005818 0.08532644 6 1.54686490 -0.53005818 7 -1.06851972 1.54686490 8 -6.76082741 -1.06851972 9 -2.22236587 -6.76082741 10 -2.60698125 -2.22236587 11 -3.06851972 -2.60698125 12 -8.55548373 -3.06851972 13 -5.55548373 -8.55548373 14 -0.41262659 -5.55548373 15 4.50700280 -0.41262659 16 0.19931049 4.50700280 17 -8.41607412 0.19931049 18 -1.33915105 -8.41607412 19 -0.95453566 -1.33915105 20 -0.64684335 -0.95453566 21 -2.10838181 -0.64684335 22 -2.49299720 -2.10838181 23 -3.95453566 -2.49299720 24 -3.44149968 -3.95453566 25 1.55850032 -3.44149968 26 1.70135747 1.55850032 27 -3.37901314 1.70135747 28 2.31329455 -3.37901314 29 -0.30209007 2.31329455 30 1.77483301 -0.30209007 31 2.15944839 1.77483301 32 5.46714070 2.15944839 33 9.00560224 5.46714070 34 3.62098686 9.00560224 35 7.15944839 3.62098686 36 4.67248438 7.15944839 37 -4.32751562 4.67248438 38 4.81534152 -4.32751562 39 6.73497091 4.81534152 40 4.42727860 6.73497091 41 2.81189399 4.42727860 42 -9.11118293 2.81189399 43 1.27343245 -9.11118293 44 2.58112476 1.27343245 45 -2.88041370 2.58112476 46 -3.26502909 -2.88041370 47 10.27343245 -3.26502909 48 1.78646843 10.27343245 49 3.78646843 1.78646843 50 -0.07067442 3.78646843 51 -1.15104503 -0.07067442 52 -1.45873734 -1.15104503 53 -7.07412196 -1.45873734 54 7.00280112 -7.07412196 55 0.38741651 7.00280112 56 2.69510881 0.38741651 57 1.23357035 2.69510881 58 0.84895497 1.23357035 59 -7.61258349 0.84895497 60 0.90045249 -7.61258349 61 2.90045249 0.90045249 62 1.04330963 2.90045249 63 1.96293902 1.04330963 64 -2.34475329 1.96293902 65 9.03986210 -2.34475329 66 -0.88321482 9.03986210 67 3.50140056 -0.88321482 68 -4.19090713 3.50140056 69 2.34755441 -4.19090713 70 -1.03706098 2.34755441 71 -0.49859944 -1.03706098 72 4.01443654 -0.49859944 73 2.01443654 4.01443654 74 2.15729369 2.01443654 75 -1.92307692 2.15729369 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.87157940 3.61538462 85 -0.87157940 -3.87157940 86 3.27127774 -0.87157940 87 1.19090713 3.27127774 88 5.88321482 1.19090713 89 -4.73216979 5.88321482 90 -5.65524671 -4.73216979 91 -4.27063133 -5.65524671 92 -5.96293902 -4.27063133 93 -0.42447748 -5.96293902 94 0.19090713 -0.42447748 95 10.72936867 0.19090713 96 -1.75759535 10.72936867 97 0.24240465 -1.75759535 98 -4.61473820 0.24240465 99 -3.69510881 -4.61473820 100 1.99719888 -3.69510881 101 -2.61818574 1.99719888 102 -2.54126266 -2.61818574 103 -2.15664727 -2.54126266 104 -2.84895497 -2.15664727 105 -5.31049343 -2.84895497 106 -2.69510881 -5.31049343 107 -2.15664727 -2.69510881 108 -0.64361129 -2.15664727 109 -5.64361129 -0.64361129 110 -8.50075415 -5.64361129 111 -3.58112476 -8.50075415 112 3.11118293 -3.58112476 113 13.49579832 3.11118293 114 6.57272140 13.49579832 115 -2.04266322 6.57272140 116 2.26502909 -2.04266322 117 -2.19650937 2.26502909 118 1.41887524 -2.19650937 119 -8.04266322 1.41887524 120 3.47037276 -8.04266322 121 -3.52962724 3.47037276 122 2.61322991 -3.52962724 123 -1.46714070 2.61322991 124 -1.77483301 -1.46714070 125 -0.39021763 -1.77483301 126 -0.31329455 -0.39021763 127 1.07132084 -0.31329455 128 -1.62098686 1.07132084 129 3.91747468 -1.62098686 130 3.53285930 3.91747468 131 -4.92867916 3.53285930 132 0.58435682 -4.92867916 133 -2.41564318 0.58435682 134 -6.27278604 -2.41564318 135 4.64684335 -6.27278604 136 -1.66084895 4.64684335 137 -0.27623357 -1.66084895 138 -1.19931049 -0.27623357 139 -0.81469511 -1.19931049 140 0.49299720 -0.81469511 141 7.03145874 0.49299720 142 0.64684335 7.03145874 143 0.18530489 0.64684335 144 0.69834087 0.18530489 145 6.69834087 0.69834087 146 2.84119802 6.69834087 147 -0.23917259 2.84119802 148 -10.54686490 -0.23917259 149 -1.16224952 -10.54686490 150 3.91467356 -1.16224952 151 1.29928895 3.91467356 152 6.60698125 1.29928895 153 -2.85455721 6.60698125 154 3.76082741 -2.85455721 155 -1.70071105 3.76082741 156 1.81232493 -1.70071105 157 1.81232493 1.81232493 158 -5.04481793 1.81232493 159 NA -5.04481793 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 3.33053221 0.33053221 [2,] 6.47338936 3.33053221 [3,] -3.60698125 6.47338936 [4,] 0.08532644 -3.60698125 [5,] -0.53005818 0.08532644 [6,] 1.54686490 -0.53005818 [7,] -1.06851972 1.54686490 [8,] -6.76082741 -1.06851972 [9,] -2.22236587 -6.76082741 [10,] -2.60698125 -2.22236587 [11,] -3.06851972 -2.60698125 [12,] -8.55548373 -3.06851972 [13,] -5.55548373 -8.55548373 [14,] -0.41262659 -5.55548373 [15,] 4.50700280 -0.41262659 [16,] 0.19931049 4.50700280 [17,] -8.41607412 0.19931049 [18,] -1.33915105 -8.41607412 [19,] -0.95453566 -1.33915105 [20,] -0.64684335 -0.95453566 [21,] -2.10838181 -0.64684335 [22,] -2.49299720 -2.10838181 [23,] -3.95453566 -2.49299720 [24,] -3.44149968 -3.95453566 [25,] 1.55850032 -3.44149968 [26,] 1.70135747 1.55850032 [27,] -3.37901314 1.70135747 [28,] 2.31329455 -3.37901314 [29,] -0.30209007 2.31329455 [30,] 1.77483301 -0.30209007 [31,] 2.15944839 1.77483301 [32,] 5.46714070 2.15944839 [33,] 9.00560224 5.46714070 [34,] 3.62098686 9.00560224 [35,] 7.15944839 3.62098686 [36,] 4.67248438 7.15944839 [37,] -4.32751562 4.67248438 [38,] 4.81534152 -4.32751562 [39,] 6.73497091 4.81534152 [40,] 4.42727860 6.73497091 [41,] 2.81189399 4.42727860 [42,] -9.11118293 2.81189399 [43,] 1.27343245 -9.11118293 [44,] 2.58112476 1.27343245 [45,] -2.88041370 2.58112476 [46,] -3.26502909 -2.88041370 [47,] 10.27343245 -3.26502909 [48,] 1.78646843 10.27343245 [49,] 3.78646843 1.78646843 [50,] -0.07067442 3.78646843 [51,] -1.15104503 -0.07067442 [52,] -1.45873734 -1.15104503 [53,] -7.07412196 -1.45873734 [54,] 7.00280112 -7.07412196 [55,] 0.38741651 7.00280112 [56,] 2.69510881 0.38741651 [57,] 1.23357035 2.69510881 [58,] 0.84895497 1.23357035 [59,] -7.61258349 0.84895497 [60,] 0.90045249 -7.61258349 [61,] 2.90045249 0.90045249 [62,] 1.04330963 2.90045249 [63,] 1.96293902 1.04330963 [64,] -2.34475329 1.96293902 [65,] 9.03986210 -2.34475329 [66,] -0.88321482 9.03986210 [67,] 3.50140056 -0.88321482 [68,] -4.19090713 3.50140056 [69,] 2.34755441 -4.19090713 [70,] -1.03706098 2.34755441 [71,] -0.49859944 -1.03706098 [72,] 4.01443654 -0.49859944 [73,] 2.01443654 4.01443654 [74,] 2.15729369 2.01443654 [75,] -1.92307692 2.15729369 [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.87157940 3.61538462 [85,] -0.87157940 -3.87157940 [86,] 3.27127774 -0.87157940 [87,] 1.19090713 3.27127774 [88,] 5.88321482 1.19090713 [89,] -4.73216979 5.88321482 [90,] -5.65524671 -4.73216979 [91,] -4.27063133 -5.65524671 [92,] -5.96293902 -4.27063133 [93,] -0.42447748 -5.96293902 [94,] 0.19090713 -0.42447748 [95,] 10.72936867 0.19090713 [96,] -1.75759535 10.72936867 [97,] 0.24240465 -1.75759535 [98,] -4.61473820 0.24240465 [99,] -3.69510881 -4.61473820 [100,] 1.99719888 -3.69510881 [101,] -2.61818574 1.99719888 [102,] -2.54126266 -2.61818574 [103,] -2.15664727 -2.54126266 [104,] -2.84895497 -2.15664727 [105,] -5.31049343 -2.84895497 [106,] -2.69510881 -5.31049343 [107,] -2.15664727 -2.69510881 [108,] -0.64361129 -2.15664727 [109,] -5.64361129 -0.64361129 [110,] -8.50075415 -5.64361129 [111,] -3.58112476 -8.50075415 [112,] 3.11118293 -3.58112476 [113,] 13.49579832 3.11118293 [114,] 6.57272140 13.49579832 [115,] -2.04266322 6.57272140 [116,] 2.26502909 -2.04266322 [117,] -2.19650937 2.26502909 [118,] 1.41887524 -2.19650937 [119,] -8.04266322 1.41887524 [120,] 3.47037276 -8.04266322 [121,] -3.52962724 3.47037276 [122,] 2.61322991 -3.52962724 [123,] -1.46714070 2.61322991 [124,] -1.77483301 -1.46714070 [125,] -0.39021763 -1.77483301 [126,] -0.31329455 -0.39021763 [127,] 1.07132084 -0.31329455 [128,] -1.62098686 1.07132084 [129,] 3.91747468 -1.62098686 [130,] 3.53285930 3.91747468 [131,] -4.92867916 3.53285930 [132,] 0.58435682 -4.92867916 [133,] -2.41564318 0.58435682 [134,] -6.27278604 -2.41564318 [135,] 4.64684335 -6.27278604 [136,] -1.66084895 4.64684335 [137,] -0.27623357 -1.66084895 [138,] -1.19931049 -0.27623357 [139,] -0.81469511 -1.19931049 [140,] 0.49299720 -0.81469511 [141,] 7.03145874 0.49299720 [142,] 0.64684335 7.03145874 [143,] 0.18530489 0.64684335 [144,] 0.69834087 0.18530489 [145,] 6.69834087 0.69834087 [146,] 2.84119802 6.69834087 [147,] -0.23917259 2.84119802 [148,] -10.54686490 -0.23917259 [149,] -1.16224952 -10.54686490 [150,] 3.91467356 -1.16224952 [151,] 1.29928895 3.91467356 [152,] 6.60698125 1.29928895 [153,] -2.85455721 6.60698125 [154,] 3.76082741 -2.85455721 [155,] -1.70071105 3.76082741 [156,] 1.81232493 -1.70071105 [157,] 1.81232493 1.81232493 [158,] -5.04481793 1.81232493 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 3.33053221 0.33053221 2 6.47338936 3.33053221 3 -3.60698125 6.47338936 4 0.08532644 -3.60698125 5 -0.53005818 0.08532644 6 1.54686490 -0.53005818 7 -1.06851972 1.54686490 8 -6.76082741 -1.06851972 9 -2.22236587 -6.76082741 10 -2.60698125 -2.22236587 11 -3.06851972 -2.60698125 12 -8.55548373 -3.06851972 13 -5.55548373 -8.55548373 14 -0.41262659 -5.55548373 15 4.50700280 -0.41262659 16 0.19931049 4.50700280 17 -8.41607412 0.19931049 18 -1.33915105 -8.41607412 19 -0.95453566 -1.33915105 20 -0.64684335 -0.95453566 21 -2.10838181 -0.64684335 22 -2.49299720 -2.10838181 23 -3.95453566 -2.49299720 24 -3.44149968 -3.95453566 25 1.55850032 -3.44149968 26 1.70135747 1.55850032 27 -3.37901314 1.70135747 28 2.31329455 -3.37901314 29 -0.30209007 2.31329455 30 1.77483301 -0.30209007 31 2.15944839 1.77483301 32 5.46714070 2.15944839 33 9.00560224 5.46714070 34 3.62098686 9.00560224 35 7.15944839 3.62098686 36 4.67248438 7.15944839 37 -4.32751562 4.67248438 38 4.81534152 -4.32751562 39 6.73497091 4.81534152 40 4.42727860 6.73497091 41 2.81189399 4.42727860 42 -9.11118293 2.81189399 43 1.27343245 -9.11118293 44 2.58112476 1.27343245 45 -2.88041370 2.58112476 46 -3.26502909 -2.88041370 47 10.27343245 -3.26502909 48 1.78646843 10.27343245 49 3.78646843 1.78646843 50 -0.07067442 3.78646843 51 -1.15104503 -0.07067442 52 -1.45873734 -1.15104503 53 -7.07412196 -1.45873734 54 7.00280112 -7.07412196 55 0.38741651 7.00280112 56 2.69510881 0.38741651 57 1.23357035 2.69510881 58 0.84895497 1.23357035 59 -7.61258349 0.84895497 60 0.90045249 -7.61258349 61 2.90045249 0.90045249 62 1.04330963 2.90045249 63 1.96293902 1.04330963 64 -2.34475329 1.96293902 65 9.03986210 -2.34475329 66 -0.88321482 9.03986210 67 3.50140056 -0.88321482 68 -4.19090713 3.50140056 69 2.34755441 -4.19090713 70 -1.03706098 2.34755441 71 -0.49859944 -1.03706098 72 4.01443654 -0.49859944 73 2.01443654 4.01443654 74 2.15729369 2.01443654 75 -1.92307692 2.15729369 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.87157940 3.61538462 85 -0.87157940 -3.87157940 86 3.27127774 -0.87157940 87 1.19090713 3.27127774 88 5.88321482 1.19090713 89 -4.73216979 5.88321482 90 -5.65524671 -4.73216979 91 -4.27063133 -5.65524671 92 -5.96293902 -4.27063133 93 -0.42447748 -5.96293902 94 0.19090713 -0.42447748 95 10.72936867 0.19090713 96 -1.75759535 10.72936867 97 0.24240465 -1.75759535 98 -4.61473820 0.24240465 99 -3.69510881 -4.61473820 100 1.99719888 -3.69510881 101 -2.61818574 1.99719888 102 -2.54126266 -2.61818574 103 -2.15664727 -2.54126266 104 -2.84895497 -2.15664727 105 -5.31049343 -2.84895497 106 -2.69510881 -5.31049343 107 -2.15664727 -2.69510881 108 -0.64361129 -2.15664727 109 -5.64361129 -0.64361129 110 -8.50075415 -5.64361129 111 -3.58112476 -8.50075415 112 3.11118293 -3.58112476 113 13.49579832 3.11118293 114 6.57272140 13.49579832 115 -2.04266322 6.57272140 116 2.26502909 -2.04266322 117 -2.19650937 2.26502909 118 1.41887524 -2.19650937 119 -8.04266322 1.41887524 120 3.47037276 -8.04266322 121 -3.52962724 3.47037276 122 2.61322991 -3.52962724 123 -1.46714070 2.61322991 124 -1.77483301 -1.46714070 125 -0.39021763 -1.77483301 126 -0.31329455 -0.39021763 127 1.07132084 -0.31329455 128 -1.62098686 1.07132084 129 3.91747468 -1.62098686 130 3.53285930 3.91747468 131 -4.92867916 3.53285930 132 0.58435682 -4.92867916 133 -2.41564318 0.58435682 134 -6.27278604 -2.41564318 135 4.64684335 -6.27278604 136 -1.66084895 4.64684335 137 -0.27623357 -1.66084895 138 -1.19931049 -0.27623357 139 -0.81469511 -1.19931049 140 0.49299720 -0.81469511 141 7.03145874 0.49299720 142 0.64684335 7.03145874 143 0.18530489 0.64684335 144 0.69834087 0.18530489 145 6.69834087 0.69834087 146 2.84119802 6.69834087 147 -0.23917259 2.84119802 148 -10.54686490 -0.23917259 149 -1.16224952 -10.54686490 150 3.91467356 -1.16224952 151 1.29928895 3.91467356 152 6.60698125 1.29928895 153 -2.85455721 6.60698125 154 3.76082741 -2.85455721 155 -1.70071105 3.76082741 156 1.81232493 -1.70071105 157 1.81232493 1.81232493 158 -5.04481793 1.81232493 > 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/freestat/rcomp/tmp/73y241291023862.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/freestat/rcomp/tmp/83y241291023862.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/freestat/rcomp/tmp/9ep171291023862.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/freestat/rcomp/tmp/10ep171291023862.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11iqzv1291023862.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/freestat/rcomp/tmp/1239gj1291023862.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/freestat/rcomp/tmp/13hie91291023862.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/freestat/rcomp/tmp/1431ux1291023862.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/freestat/rcomp/tmp/15o1b31291023862.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/freestat/rcomp/tmp/162b8u1291023862.tab") + } > try(system("convert tmp/10y3g1291023862.ps tmp/10y3g1291023862.png",intern=TRUE)) character(0) > try(system("convert tmp/20y3g1291023862.ps tmp/20y3g1291023862.png",intern=TRUE)) character(0) > try(system("convert tmp/30y3g1291023862.ps tmp/30y3g1291023862.png",intern=TRUE)) character(0) > try(system("convert tmp/4b7l11291023862.ps tmp/4b7l11291023862.png",intern=TRUE)) character(0) > try(system("convert tmp/5b7l11291023862.ps tmp/5b7l11291023862.png",intern=TRUE)) character(0) > try(system("convert tmp/6b7l11291023862.ps tmp/6b7l11291023862.png",intern=TRUE)) character(0) > try(system("convert tmp/73y241291023862.ps tmp/73y241291023862.png",intern=TRUE)) character(0) > try(system("convert tmp/83y241291023862.ps tmp/83y241291023862.png",intern=TRUE)) character(0) > try(system("convert tmp/9ep171291023862.ps tmp/9ep171291023862.png",intern=TRUE)) character(0) > try(system("convert tmp/10ep171291023862.ps tmp/10ep171291023862.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.577 2.679 5.889