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(1 + ,4 + ,4 + ,2 + ,1 + ,2 + ,2 + ,2 + ,1 + ,5 + ,5 + ,4 + ,1 + ,4 + ,5 + ,3 + ,2 + ,1 + ,1 + ,2 + ,1 + ,2 + ,4 + ,1 + ,4 + ,5 + ,6 + ,4 + ,1 + ,1 + ,5 + ,3 + ,1 + ,3 + ,4 + ,1 + ,2 + ,5 + ,5 + ,4 + ,1 + ,2 + ,7 + ,4 + ,1 + ,2 + ,2 + ,4 + ,2 + ,2 + ,7 + ,3 + ,1 + ,2 + ,5 + ,4 + ,1 + ,1 + ,5 + ,1 + ,1 + ,4 + ,7 + ,4 + ,1 + ,3 + ,3 + ,1 + ,1 + ,6 + ,6 + ,4 + ,1 + ,1 + ,2 + ,4 + ,2 + ,3 + ,6 + ,3 + ,1 + ,2 + ,1 + ,2 + ,2 + ,5 + ,5 + ,6 + ,1 + ,5 + ,4 + ,5 + ,2 + ,3 + ,4 + ,4 + ,1 + ,3 + ,7 + ,6 + ,1 + ,5 + ,7 + ,1 + ,1 + ,5 + ,5 + ,2 + ,2 + ,4 + ,6 + ,4 + ,1 + ,2 + ,5 + ,4 + ,1 + ,1 + ,1 + ,1 + ,2 + ,4 + ,6 + ,2 + ,1 + ,6 + ,4 + ,1 + ,1 + ,2 + ,2 + ,2 + ,1 + ,3 + ,2 + ,2 + ,1 + ,2 + ,6 + ,2 + ,2 + ,4 + ,6 + ,6 + ,1 + ,2 + ,6 + ,2 + ,1 + ,1 + ,1 + ,1 + ,1 + ,5 + ,6 + ,4 + ,1 + ,5 + ,6 + ,3 + ,1 + ,1 + ,1 + ,3 + ,1 + ,1 + ,1 + ,1 + ,1 + ,2 + ,7 + ,4 + ,1 + ,4 + ,2 + ,3 + ,1 + ,5 + ,3 + ,4 + ,1 + ,3 + ,5 + ,3 + ,1 + ,3 + ,3 + ,2 + ,1 + ,1 + ,4 + ,1 + ,1 + ,2 + ,2 + ,5 + ,1 + ,3 + ,3 + ,4 + ,2 + ,2 + ,7 + ,1 + ,2 + ,5 + ,7 + ,2 + ,1 + ,4 + ,5 + ,4 + ,1 + ,4 + ,1 + ,3 + ,1 + ,2 + ,2 + ,2 + ,2 + ,3 + ,5 + ,3 + ,1 + ,6 + ,2 + ,3 + ,1 + ,2 + ,4 + ,2 + ,2 + ,3 + ,7 + ,2 + ,1 + ,2 + ,2 + ,4 + ,1 + ,5 + ,5 + ,4 + ,1 + ,5 + ,6 + ,2 + ,1 + ,5 + ,3 + ,2 + ,1 + ,6 + ,7 + ,5 + ,2 + ,4 + ,4 + ,4 + ,1 + ,2 + ,3 + ,5 + ,1 + ,5 + ,5 + ,5 + ,2 + ,2 + ,3 + ,2 + ,1 + ,1 + ,2 + ,3 + ,1 + ,6 + ,6 + ,4 + ,1 + ,6 + ,6 + ,2 + ,1 + ,3 + ,5 + ,2 + ,1 + ,4 + ,2 + ,2 + ,3 + ,5 + ,3 + ,5 + ,2 + ,2 + ,4 + ,2 + ,2 + ,4 + ,6 + ,3 + ,1 + ,3 + ,5 + ,2 + ,1 + ,2 + ,2 + ,2 + ,1 + ,2 + ,5 + ,2 + ,1 + ,3 + ,2 + ,2 + ,1 + ,3 + ,1 + ,2 + ,1 + ,7 + ,2 + ,1 + ,1 + ,2 + ,4 + ,3 + ,1 + ,2 + ,5 + ,3 + ,1 + ,2 + ,5 + ,3 + ,1 + ,5 + ,3 + ,3 + ,1 + ,1 + ,2 + ,1 + ,3 + ,5 + ,7 + ,4 + ,1 + ,2 + ,1 + ,1 + ,1 + ,1 + ,5 + ,1 + ,1 + ,2 + ,5 + ,1 + ,1 + ,2 + ,2 + ,3 + ,1 + ,0 + ,6 + ,2 + ,1 + ,5 + ,2 + ,3 + ,1 + ,3 + ,5 + ,5 + ,1 + ,2 + ,3 + ,3 + ,1 + ,4 + ,3 + ,2 + ,1 + ,2 + ,5 + ,2 + ,1 + ,2 + ,5 + ,3 + ,2 + ,4 + ,5 + ,4 + ,1 + ,1 + ,6 + ,4 + ,1 + ,5 + ,5 + ,3 + ,1 + ,4 + ,5 + ,2 + ,2 + ,6 + ,6 + ,3 + ,1 + ,2 + ,2 + ,3 + ,2 + ,5 + ,5 + ,4 + ,2 + ,1 + ,5 + ,2 + ,3 + ,7 + ,1 + ,5 + ,2 + ,5 + ,5 + ,2 + ,2 + ,3 + ,6 + ,2 + ,1 + ,4 + ,6 + ,4 + ,1 + ,4 + ,3 + ,5 + ,1 + ,2 + ,3 + ,0 + ,1 + ,1 + ,3 + ,1 + ,1 + ,6 + ,5 + ,6 + ,1 + ,4 + ,5 + ,1 + ,1 + ,2 + ,2 + ,2 + ,2 + ,7 + ,3 + ,1 + ,1 + ,4 + ,3 + ,4 + ,1 + ,4 + ,6 + ,2 + ,1 + ,4 + ,5 + ,4 + ,1 + ,2 + ,2 + ,1 + ,1 + ,5 + ,4 + ,4 + ,1 + ,3 + ,2 + ,3 + ,1 + ,2 + ,2 + ,1 + ,1 + ,3 + ,5 + ,2 + ,1 + ,4 + ,5 + ,5 + ,2 + ,5 + ,4 + ,3 + ,2 + ,6 + ,5 + ,2 + ,1 + ,2 + ,1 + ,2 + ,1 + ,2 + ,5 + ,4 + ,1 + ,2 + ,5 + ,4 + ,1 + ,2 + ,5 + ,4 + ,4 + ,2 + ,6 + ,4 + ,1 + ,5 + ,5 + ,4 + ,2 + ,2 + ,5 + ,4 + ,1 + ,3 + ,6 + ,2 + ,1 + ,6 + ,5 + ,4 + ,1 + ,4 + ,5 + ,2 + ,1 + ,5 + ,7 + ,2 + ,1 + ,1 + ,1 + ,1 + ,1 + ,2 + ,3 + ,3 + ,1 + ,2 + ,5 + ,2 + ,1 + ,2 + ,5 + ,1 + ,1 + ,6 + ,6 + ,3 + ,1 + ,2 + ,4 + ,3 + ,1 + ,2 + ,2 + ,2 + ,2 + ,1 + ,4 + ,5 + ,1 + ,5 + ,5 + ,2 + ,1 + ,3 + ,5 + ,5 + ,3 + ,6 + ,5 + ,4 + ,1 + ,1 + ,5 + ,1 + ,1 + ,2 + ,2 + ,2 + ,1 + ,3 + ,5 + ,2 + ,1 + ,2 + ,1 + ,3 + ,2 + ,3 + ,3 + ,4 + ,1 + ,7 + ,7 + ,2) + ,dim=c(4 + ,157) + ,dimnames=list(c('Depressed' + ,'cannotdo' + ,'worrytoomuch' + ,'limitactivity') + ,1:157)) > y <- array(NA,dim=c(4,157),dimnames=list(c('Depressed','cannotdo','worrytoomuch','limitactivity'),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 Depressed cannotdo worrytoomuch limitactivity 1 1 4 4 2 2 1 2 2 2 3 1 5 5 4 4 1 4 5 3 5 2 1 1 2 6 1 2 4 1 7 4 5 6 4 8 1 1 5 3 9 1 3 4 1 10 2 5 5 4 11 1 2 7 4 12 1 2 2 4 13 2 2 7 3 14 1 2 5 4 15 1 1 5 1 16 1 4 7 4 17 1 3 3 1 18 1 6 6 4 19 1 1 2 4 20 2 3 6 3 21 1 2 1 2 22 2 5 5 6 23 1 5 4 5 24 2 3 4 4 25 1 3 7 6 26 1 5 7 1 27 1 5 5 2 28 2 4 6 4 29 1 2 5 4 30 1 1 1 1 31 2 4 6 2 32 1 6 4 1 33 1 2 2 2 34 1 3 2 2 35 1 2 6 2 36 2 4 6 6 37 1 2 6 2 38 1 1 1 1 39 1 5 6 4 40 1 5 6 3 41 1 1 1 3 42 1 1 1 1 43 1 2 7 4 44 1 4 2 3 45 1 5 3 4 46 1 3 5 3 47 1 3 3 2 48 1 1 4 1 49 1 2 2 5 50 1 3 3 4 51 2 2 7 1 52 2 5 7 2 53 1 4 5 4 54 1 4 1 3 55 1 2 2 2 56 2 3 5 3 57 1 6 2 3 58 1 2 4 2 59 2 3 7 2 60 1 2 2 4 61 1 5 5 4 62 1 5 6 2 63 1 5 3 2 64 1 6 7 5 65 2 4 4 4 66 1 2 3 5 67 1 5 5 5 68 2 2 3 2 69 1 1 2 3 70 1 6 6 4 71 1 6 6 2 72 1 3 5 2 73 1 4 2 2 74 3 5 3 5 75 2 2 4 2 76 2 4 6 3 77 1 3 5 2 78 1 2 2 2 79 1 2 5 2 80 1 3 2 2 81 1 3 1 2 82 1 7 2 1 83 1 2 4 3 84 1 2 5 3 85 1 2 5 3 86 1 5 3 3 87 1 1 2 1 88 3 5 7 4 89 1 2 1 1 90 1 1 5 1 91 1 2 5 1 92 1 2 2 3 93 1 0 6 2 94 1 5 2 3 95 1 3 5 5 96 1 2 3 3 97 1 4 3 2 98 1 2 5 2 99 1 2 5 3 100 2 4 5 4 101 1 1 6 4 102 1 5 5 3 103 1 4 5 2 104 2 6 6 3 105 1 2 2 3 106 2 5 5 4 107 2 1 5 2 108 3 7 1 5 109 2 5 5 2 110 2 3 6 2 111 1 4 6 4 112 1 4 3 5 113 1 2 3 0 114 1 1 3 1 115 1 6 5 6 116 1 4 5 1 117 1 2 2 2 118 2 7 3 1 119 1 4 3 4 120 1 4 6 2 121 1 4 5 4 122 1 2 2 1 123 1 5 4 4 124 1 3 2 3 125 1 2 2 1 126 1 3 5 2 127 1 4 5 5 128 2 5 4 3 129 2 6 5 2 130 1 2 1 2 131 1 2 5 4 132 1 2 5 4 133 1 2 5 4 134 4 2 6 4 135 1 5 5 4 136 2 2 5 4 137 1 3 6 2 138 1 6 5 4 139 1 4 5 2 140 1 5 7 2 141 1 1 1 1 142 1 2 3 3 143 1 2 5 2 144 1 2 5 1 145 1 6 6 3 146 1 2 4 3 147 1 2 2 2 148 2 1 4 5 149 1 5 5 2 150 1 3 5 5 151 3 6 5 4 152 1 1 5 1 153 1 2 2 2 154 1 3 5 2 155 1 2 1 3 156 2 3 3 4 157 1 7 7 2 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) cannotdo worrytoomuch limitactivity 0.74432 0.04318 0.04488 0.07083 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.6717 -0.3350 -0.1778 0.0536 2.6167 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.74432 0.14215 5.236 5.33e-07 *** cannotdo 0.04318 0.02878 1.500 0.1356 worrytoomuch 0.04488 0.02636 1.703 0.0907 . limitactivity 0.07083 0.03526 2.009 0.0463 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.5513 on 153 degrees of freedom Multiple R-squared: 0.09227, Adjusted R-squared: 0.07447 F-statistic: 5.184 on 3 and 153 DF, p-value: 0.001941 > 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.99913313 0.0017337345 0.0008668672 [2,] 0.99981921 0.0003615854 0.0001807927 [3,] 0.99953143 0.0009371430 0.0004685715 [4,] 0.99897762 0.0020447585 0.0010223792 [5,] 0.99844419 0.0031116264 0.0015558132 [6,] 0.99833400 0.0033319921 0.0016659961 [7,] 0.99833192 0.0033361557 0.0016680778 [8,] 0.99758262 0.0048347567 0.0024173783 [9,] 0.99560473 0.0087905380 0.0043952690 [10,] 0.99591265 0.0081746930 0.0040873465 [11,] 0.99329341 0.0134131804 0.0067065902 [12,] 0.99459869 0.0108026195 0.0054013098 [13,] 0.99160531 0.0167893898 0.0083946949 [14,] 0.99136678 0.0172664427 0.0086332214 [15,] 0.98652194 0.0269561245 0.0134780623 [16,] 0.98085711 0.0382857733 0.0191428867 [17,] 0.98066204 0.0386759144 0.0193379572 [18,] 0.98056584 0.0388683197 0.0194341598 [19,] 0.98061000 0.0387800094 0.0193900047 [20,] 0.97625700 0.0474860058 0.0237430029 [21,] 0.97011583 0.0597683341 0.0298841670 [22,] 0.96718128 0.0656374307 0.0328187153 [23,] 0.95917678 0.0816464375 0.0408232187 [24,] 0.94462421 0.1107515747 0.0553757874 [25,] 0.94754977 0.1049004643 0.0524502322 [26,] 0.93625153 0.1274969439 0.0637484720 [27,] 0.91697363 0.1660527419 0.0830263709 [28,] 0.89456691 0.2108661883 0.1054330942 [29,] 0.87154539 0.2569092251 0.1284546125 [30,] 0.85123771 0.2975245778 0.1487622889 [31,] 0.82203364 0.3559327267 0.1779663633 [32,] 0.78510834 0.4297833148 0.2148916574 [33,] 0.78088661 0.4382267841 0.2191133921 [34,] 0.76356644 0.4728671258 0.2364335629 [35,] 0.72190543 0.5561891486 0.2780945743 [36,] 0.67657986 0.6468402797 0.3234201398 [37,] 0.65227457 0.6954508686 0.3477254343 [38,] 0.61370887 0.7725822693 0.3862911346 [39,] 0.58843539 0.8231292184 0.4115646092 [40,] 0.55145411 0.8970917773 0.4485458887 [41,] 0.50327243 0.9934551320 0.4967275660 [42,] 0.45223393 0.9044678671 0.5477660664 [43,] 0.41557218 0.8311443682 0.5844278159 [44,] 0.37905775 0.7581154980 0.6209422510 [45,] 0.42583387 0.8516677376 0.5741661312 [46,] 0.42803179 0.8560635769 0.5719682116 [47,] 0.40514687 0.8102937315 0.5948531343 [48,] 0.36074853 0.7214970591 0.6392514704 [49,] 0.31588225 0.6317645028 0.6841177486 [50,] 0.34012423 0.6802484603 0.6598757698 [51,] 0.30584286 0.6116857254 0.6941571373 [52,] 0.26797887 0.5359577380 0.7320211310 [53,] 0.28042942 0.5608588444 0.7195705778 [54,] 0.24538664 0.4907732774 0.7546133613 [55,] 0.23168953 0.4633790610 0.7683104695 [56,] 0.21271810 0.4254362089 0.7872818955 [57,] 0.18379239 0.3675847897 0.8162076052 [58,] 0.19318729 0.3863745816 0.8068127092 [59,] 0.20932254 0.4186450712 0.7906774644 [60,] 0.18668329 0.3733665719 0.8133167140 [61,] 0.18179950 0.3635990006 0.8182004997 [62,] 0.23556391 0.4711278140 0.7644360930 [63,] 0.20198507 0.4039701439 0.7980149280 [64,] 0.19912069 0.3982413722 0.8008793139 [65,] 0.18297983 0.3659596604 0.8170201698 [66,] 0.15966476 0.3193295103 0.8403352449 [67,] 0.13428633 0.2685726587 0.8657136707 [68,] 0.40427835 0.8085566966 0.5957216517 [69,] 0.46230339 0.9246067889 0.5376966055 [70,] 0.46925583 0.9385116583 0.5307441708 [71,] 0.43233152 0.8646630467 0.5676684766 [72,] 0.38778616 0.7755723249 0.6122138375 [73,] 0.35050641 0.7010128260 0.6494935870 [74,] 0.30967183 0.6193436522 0.6903281739 [75,] 0.27022609 0.5404521826 0.7297739087 [76,] 0.23867479 0.4773495889 0.7613252056 [77,] 0.20983203 0.4196640595 0.7901679702 [78,] 0.18544235 0.3708847084 0.8145576458 [79,] 0.16278863 0.3255772648 0.8372113676 [80,] 0.14421208 0.2884241682 0.8557879159 [81,] 0.11967755 0.2393550965 0.8803224517 [82,] 0.30538980 0.6107796083 0.6946101958 [83,] 0.26590763 0.5318152509 0.7340923745 [84,] 0.23056607 0.4611321467 0.7694339266 [85,] 0.19823927 0.3964785473 0.8017607263 [86,] 0.16942469 0.3388493842 0.8305753079 [87,] 0.14397997 0.2879599448 0.8560200276 [88,] 0.12685709 0.2537141791 0.8731429104 [89,] 0.11838574 0.2367714842 0.8816142579 [90,] 0.09903746 0.1980749246 0.9009625377 [91,] 0.08280245 0.1656049025 0.9171975488 [92,] 0.06776585 0.1355316939 0.9322341531 [93,] 0.05626016 0.1125203191 0.9437398404 [94,] 0.05645292 0.1129058336 0.9435470832 [95,] 0.04767350 0.0953470093 0.9523264954 [96,] 0.04215417 0.0843083396 0.9578458302 [97,] 0.03463959 0.0692791888 0.9653604056 [98,] 0.03291988 0.0658397680 0.9670801160 [99,] 0.02581927 0.0516385457 0.9741807272 [100,] 0.02460915 0.0492182970 0.9753908515 [101,] 0.03578175 0.0715635016 0.9642182492 [102,] 0.14141209 0.2828241885 0.8585879058 [103,] 0.15631927 0.3126385362 0.8436807319 [104,] 0.17637150 0.3527429961 0.8236285019 [105,] 0.16300763 0.3260152678 0.8369923661 [106,] 0.14781289 0.2956257834 0.8521871083 [107,] 0.12034467 0.2406893403 0.8796553298 [108,] 0.09637327 0.1927465428 0.9036267286 [109,] 0.10520377 0.2104075414 0.8947962293 [110,] 0.08489101 0.1697820180 0.9151089910 [111,] 0.06646208 0.1329241620 0.9335379190 [112,] 0.09491601 0.1898320128 0.9050839936 [113,] 0.08156697 0.1631339351 0.9184330324 [114,] 0.06652725 0.1330544952 0.9334727524 [115,] 0.06048440 0.1209687912 0.9395156044 [116,] 0.04617476 0.0923495108 0.9538252446 [117,] 0.04112302 0.0822460495 0.9588769753 [118,] 0.03154597 0.0630919359 0.9684540321 [119,] 0.02305340 0.0461067972 0.9769466014 [120,] 0.01691941 0.0338388254 0.9830805873 [121,] 0.01961675 0.0392334906 0.9803832547 [122,] 0.02104348 0.0420869543 0.9789565229 [123,] 0.03112061 0.0622412244 0.9688793878 [124,] 0.02212117 0.0442423471 0.9778788264 [125,] 0.02250057 0.0450011477 0.9774994262 [126,] 0.02531666 0.0506333271 0.9746833365 [127,] 0.03311273 0.0662254630 0.9668872685 [128,] 0.79678250 0.4064349916 0.2032174958 [129,] 0.79844957 0.4031008654 0.2015504327 [130,] 0.80271848 0.3945630450 0.1972815225 [131,] 0.74610873 0.5077825443 0.2538912722 [132,] 0.77622499 0.4475500127 0.2237750063 [133,] 0.71404193 0.5719161326 0.2859580663 [134,] 0.64507778 0.7098444443 0.3549222222 [135,] 0.57380951 0.8523809749 0.4261904875 [136,] 0.50618878 0.9876224357 0.4938112178 [137,] 0.41498127 0.8299625428 0.5850187286 [138,] 0.35197559 0.7039511879 0.6480244061 [139,] 0.34004627 0.6800925444 0.6599537278 [140,] 0.26309055 0.5261810995 0.7369094503 [141,] 0.18048986 0.3609797180 0.8195101410 [142,] 0.13950595 0.2790119061 0.8604940470 [143,] 0.09675844 0.1935168772 0.9032415614 [144,] 0.46010905 0.9202181075 0.5398909463 > postscript(file="/var/www/html/rcomp/tmp/1u7rl1292759235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2nhq61292759235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3nhq61292759235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4nhq61292759235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5f8791292759235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 157 Frequency = 1 1 2 3 4 5 6 -0.238232389 -0.062111959 -0.467961795 -0.353944299 1.025948256 -0.081031991 7 8 9 10 11 12 2.487160890 -0.224395596 -0.124214892 0.532038205 -0.428167721 -0.203781151 13 14 15 16 17 18 0.642666875 -0.338413093 -0.082726405 -0.514533523 -0.079337578 -0.556022010 19 20 21 22 23 24 -0.160598250 0.644361288 -0.017234645 0.390369013 -0.493919077 0.663281320 25 26 27 28 29 30 -0.613019814 -0.345212636 -0.326292604 0.530343791 -0.338413093 0.096782852 31 32 33 34 35 36 0.672012983 -0.253763595 -0.062111959 -0.105294860 -0.241621215 0.388674600 37 38 39 40 41 42 -0.241621215 0.096782852 -0.512839110 -0.442004514 -0.044886340 0.096782852 43 44 45 46 47 48 -0.428167721 -0.219312357 -0.378207167 -0.310761398 -0.150172174 -0.037849091 49 50 51 52 53 54 -0.274615747 -0.291841366 0.784336066 0.583952768 -0.424778895 -0.174435043 55 56 57 58 59 60 -0.062111959 0.689238602 -0.305678158 -0.151866587 0.670318570 -0.203781151 61 62 63 64 65 66 -0.467961795 -0.371169918 -0.236537976 -0.671733920 0.620098419 -0.319493061 67 68 69 70 71 72 -0.538796391 0.893010727 -0.089763654 -0.556022010 -0.414352819 -0.239926802 73 74 75 76 77 78 -0.148477761 1.550958237 0.848133413 0.601178387 -0.239926802 -0.062111959 79 80 81 82 83 84 -0.196743901 -0.105294860 -0.060417546 -0.207191867 -0.222701183 -0.267578497 85 86 87 88 89 90 -0.267578497 -0.307372571 0.051905538 1.442283576 0.053599951 -0.082726405 91 92 93 94 95 96 -0.125909305 -0.132946555 -0.155255414 -0.262495257 -0.452430590 -0.177823869 97 98 99 100 101 102 -0.193355075 -0.196743901 -0.267578497 0.575221105 -0.340107506 -0.397127200 103 104 105 106 107 108 -0.283109703 0.514812585 -0.132946555 0.532038205 0.846439000 1.554347063 109 110 111 112 113 114 0.673707396 0.715195884 -0.469656209 -0.405858862 0.034679919 0.007028224 115 116 117 118 119 120 -0.652813888 -0.212275107 -0.062111959 0.747930818 -0.335024266 -0.327987017 121 122 123 124 125 126 -0.424778895 0.008722637 -0.423084481 -0.176129456 0.008722637 -0.239926802 127 128 129 130 131 132 -0.495613490 0.647750114 0.630524495 -0.017234645 -0.338413093 -0.338413093 133 134 135 136 137 138 -0.338413093 2.616709593 -0.467961795 0.661586907 -0.284804116 -0.511144696 139 140 141 142 143 144 -0.283109703 -0.416047232 0.096782852 -0.177823869 -0.196743901 -0.125909305 145 146 147 148 149 150 -0.485187415 -0.222701183 -0.062111959 0.678812526 -0.326292604 -0.452430590 151 152 153 154 155 156 1.488855304 -0.082726405 -0.062111959 -0.239926802 -0.088069241 0.708158634 157 -0.502413034 > postscript(file="/var/www/html/rcomp/tmp/6f8791292759235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 157 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.238232389 NA 1 -0.062111959 -0.238232389 2 -0.467961795 -0.062111959 3 -0.353944299 -0.467961795 4 1.025948256 -0.353944299 5 -0.081031991 1.025948256 6 2.487160890 -0.081031991 7 -0.224395596 2.487160890 8 -0.124214892 -0.224395596 9 0.532038205 -0.124214892 10 -0.428167721 0.532038205 11 -0.203781151 -0.428167721 12 0.642666875 -0.203781151 13 -0.338413093 0.642666875 14 -0.082726405 -0.338413093 15 -0.514533523 -0.082726405 16 -0.079337578 -0.514533523 17 -0.556022010 -0.079337578 18 -0.160598250 -0.556022010 19 0.644361288 -0.160598250 20 -0.017234645 0.644361288 21 0.390369013 -0.017234645 22 -0.493919077 0.390369013 23 0.663281320 -0.493919077 24 -0.613019814 0.663281320 25 -0.345212636 -0.613019814 26 -0.326292604 -0.345212636 27 0.530343791 -0.326292604 28 -0.338413093 0.530343791 29 0.096782852 -0.338413093 30 0.672012983 0.096782852 31 -0.253763595 0.672012983 32 -0.062111959 -0.253763595 33 -0.105294860 -0.062111959 34 -0.241621215 -0.105294860 35 0.388674600 -0.241621215 36 -0.241621215 0.388674600 37 0.096782852 -0.241621215 38 -0.512839110 0.096782852 39 -0.442004514 -0.512839110 40 -0.044886340 -0.442004514 41 0.096782852 -0.044886340 42 -0.428167721 0.096782852 43 -0.219312357 -0.428167721 44 -0.378207167 -0.219312357 45 -0.310761398 -0.378207167 46 -0.150172174 -0.310761398 47 -0.037849091 -0.150172174 48 -0.274615747 -0.037849091 49 -0.291841366 -0.274615747 50 0.784336066 -0.291841366 51 0.583952768 0.784336066 52 -0.424778895 0.583952768 53 -0.174435043 -0.424778895 54 -0.062111959 -0.174435043 55 0.689238602 -0.062111959 56 -0.305678158 0.689238602 57 -0.151866587 -0.305678158 58 0.670318570 -0.151866587 59 -0.203781151 0.670318570 60 -0.467961795 -0.203781151 61 -0.371169918 -0.467961795 62 -0.236537976 -0.371169918 63 -0.671733920 -0.236537976 64 0.620098419 -0.671733920 65 -0.319493061 0.620098419 66 -0.538796391 -0.319493061 67 0.893010727 -0.538796391 68 -0.089763654 0.893010727 69 -0.556022010 -0.089763654 70 -0.414352819 -0.556022010 71 -0.239926802 -0.414352819 72 -0.148477761 -0.239926802 73 1.550958237 -0.148477761 74 0.848133413 1.550958237 75 0.601178387 0.848133413 76 -0.239926802 0.601178387 77 -0.062111959 -0.239926802 78 -0.196743901 -0.062111959 79 -0.105294860 -0.196743901 80 -0.060417546 -0.105294860 81 -0.207191867 -0.060417546 82 -0.222701183 -0.207191867 83 -0.267578497 -0.222701183 84 -0.267578497 -0.267578497 85 -0.307372571 -0.267578497 86 0.051905538 -0.307372571 87 1.442283576 0.051905538 88 0.053599951 1.442283576 89 -0.082726405 0.053599951 90 -0.125909305 -0.082726405 91 -0.132946555 -0.125909305 92 -0.155255414 -0.132946555 93 -0.262495257 -0.155255414 94 -0.452430590 -0.262495257 95 -0.177823869 -0.452430590 96 -0.193355075 -0.177823869 97 -0.196743901 -0.193355075 98 -0.267578497 -0.196743901 99 0.575221105 -0.267578497 100 -0.340107506 0.575221105 101 -0.397127200 -0.340107506 102 -0.283109703 -0.397127200 103 0.514812585 -0.283109703 104 -0.132946555 0.514812585 105 0.532038205 -0.132946555 106 0.846439000 0.532038205 107 1.554347063 0.846439000 108 0.673707396 1.554347063 109 0.715195884 0.673707396 110 -0.469656209 0.715195884 111 -0.405858862 -0.469656209 112 0.034679919 -0.405858862 113 0.007028224 0.034679919 114 -0.652813888 0.007028224 115 -0.212275107 -0.652813888 116 -0.062111959 -0.212275107 117 0.747930818 -0.062111959 118 -0.335024266 0.747930818 119 -0.327987017 -0.335024266 120 -0.424778895 -0.327987017 121 0.008722637 -0.424778895 122 -0.423084481 0.008722637 123 -0.176129456 -0.423084481 124 0.008722637 -0.176129456 125 -0.239926802 0.008722637 126 -0.495613490 -0.239926802 127 0.647750114 -0.495613490 128 0.630524495 0.647750114 129 -0.017234645 0.630524495 130 -0.338413093 -0.017234645 131 -0.338413093 -0.338413093 132 -0.338413093 -0.338413093 133 2.616709593 -0.338413093 134 -0.467961795 2.616709593 135 0.661586907 -0.467961795 136 -0.284804116 0.661586907 137 -0.511144696 -0.284804116 138 -0.283109703 -0.511144696 139 -0.416047232 -0.283109703 140 0.096782852 -0.416047232 141 -0.177823869 0.096782852 142 -0.196743901 -0.177823869 143 -0.125909305 -0.196743901 144 -0.485187415 -0.125909305 145 -0.222701183 -0.485187415 146 -0.062111959 -0.222701183 147 0.678812526 -0.062111959 148 -0.326292604 0.678812526 149 -0.452430590 -0.326292604 150 1.488855304 -0.452430590 151 -0.082726405 1.488855304 152 -0.062111959 -0.082726405 153 -0.239926802 -0.062111959 154 -0.088069241 -0.239926802 155 0.708158634 -0.088069241 156 -0.502413034 0.708158634 157 NA -0.502413034 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.062111959 -0.238232389 [2,] -0.467961795 -0.062111959 [3,] -0.353944299 -0.467961795 [4,] 1.025948256 -0.353944299 [5,] -0.081031991 1.025948256 [6,] 2.487160890 -0.081031991 [7,] -0.224395596 2.487160890 [8,] -0.124214892 -0.224395596 [9,] 0.532038205 -0.124214892 [10,] -0.428167721 0.532038205 [11,] -0.203781151 -0.428167721 [12,] 0.642666875 -0.203781151 [13,] -0.338413093 0.642666875 [14,] -0.082726405 -0.338413093 [15,] -0.514533523 -0.082726405 [16,] -0.079337578 -0.514533523 [17,] -0.556022010 -0.079337578 [18,] -0.160598250 -0.556022010 [19,] 0.644361288 -0.160598250 [20,] -0.017234645 0.644361288 [21,] 0.390369013 -0.017234645 [22,] -0.493919077 0.390369013 [23,] 0.663281320 -0.493919077 [24,] -0.613019814 0.663281320 [25,] -0.345212636 -0.613019814 [26,] -0.326292604 -0.345212636 [27,] 0.530343791 -0.326292604 [28,] -0.338413093 0.530343791 [29,] 0.096782852 -0.338413093 [30,] 0.672012983 0.096782852 [31,] -0.253763595 0.672012983 [32,] -0.062111959 -0.253763595 [33,] -0.105294860 -0.062111959 [34,] -0.241621215 -0.105294860 [35,] 0.388674600 -0.241621215 [36,] -0.241621215 0.388674600 [37,] 0.096782852 -0.241621215 [38,] -0.512839110 0.096782852 [39,] -0.442004514 -0.512839110 [40,] -0.044886340 -0.442004514 [41,] 0.096782852 -0.044886340 [42,] -0.428167721 0.096782852 [43,] -0.219312357 -0.428167721 [44,] -0.378207167 -0.219312357 [45,] -0.310761398 -0.378207167 [46,] -0.150172174 -0.310761398 [47,] -0.037849091 -0.150172174 [48,] -0.274615747 -0.037849091 [49,] -0.291841366 -0.274615747 [50,] 0.784336066 -0.291841366 [51,] 0.583952768 0.784336066 [52,] -0.424778895 0.583952768 [53,] -0.174435043 -0.424778895 [54,] -0.062111959 -0.174435043 [55,] 0.689238602 -0.062111959 [56,] -0.305678158 0.689238602 [57,] -0.151866587 -0.305678158 [58,] 0.670318570 -0.151866587 [59,] -0.203781151 0.670318570 [60,] -0.467961795 -0.203781151 [61,] -0.371169918 -0.467961795 [62,] -0.236537976 -0.371169918 [63,] -0.671733920 -0.236537976 [64,] 0.620098419 -0.671733920 [65,] -0.319493061 0.620098419 [66,] -0.538796391 -0.319493061 [67,] 0.893010727 -0.538796391 [68,] -0.089763654 0.893010727 [69,] -0.556022010 -0.089763654 [70,] -0.414352819 -0.556022010 [71,] -0.239926802 -0.414352819 [72,] -0.148477761 -0.239926802 [73,] 1.550958237 -0.148477761 [74,] 0.848133413 1.550958237 [75,] 0.601178387 0.848133413 [76,] -0.239926802 0.601178387 [77,] -0.062111959 -0.239926802 [78,] -0.196743901 -0.062111959 [79,] -0.105294860 -0.196743901 [80,] -0.060417546 -0.105294860 [81,] -0.207191867 -0.060417546 [82,] -0.222701183 -0.207191867 [83,] -0.267578497 -0.222701183 [84,] -0.267578497 -0.267578497 [85,] -0.307372571 -0.267578497 [86,] 0.051905538 -0.307372571 [87,] 1.442283576 0.051905538 [88,] 0.053599951 1.442283576 [89,] -0.082726405 0.053599951 [90,] -0.125909305 -0.082726405 [91,] -0.132946555 -0.125909305 [92,] -0.155255414 -0.132946555 [93,] -0.262495257 -0.155255414 [94,] -0.452430590 -0.262495257 [95,] -0.177823869 -0.452430590 [96,] -0.193355075 -0.177823869 [97,] -0.196743901 -0.193355075 [98,] -0.267578497 -0.196743901 [99,] 0.575221105 -0.267578497 [100,] -0.340107506 0.575221105 [101,] -0.397127200 -0.340107506 [102,] -0.283109703 -0.397127200 [103,] 0.514812585 -0.283109703 [104,] -0.132946555 0.514812585 [105,] 0.532038205 -0.132946555 [106,] 0.846439000 0.532038205 [107,] 1.554347063 0.846439000 [108,] 0.673707396 1.554347063 [109,] 0.715195884 0.673707396 [110,] -0.469656209 0.715195884 [111,] -0.405858862 -0.469656209 [112,] 0.034679919 -0.405858862 [113,] 0.007028224 0.034679919 [114,] -0.652813888 0.007028224 [115,] -0.212275107 -0.652813888 [116,] -0.062111959 -0.212275107 [117,] 0.747930818 -0.062111959 [118,] -0.335024266 0.747930818 [119,] -0.327987017 -0.335024266 [120,] -0.424778895 -0.327987017 [121,] 0.008722637 -0.424778895 [122,] -0.423084481 0.008722637 [123,] -0.176129456 -0.423084481 [124,] 0.008722637 -0.176129456 [125,] -0.239926802 0.008722637 [126,] -0.495613490 -0.239926802 [127,] 0.647750114 -0.495613490 [128,] 0.630524495 0.647750114 [129,] -0.017234645 0.630524495 [130,] -0.338413093 -0.017234645 [131,] -0.338413093 -0.338413093 [132,] -0.338413093 -0.338413093 [133,] 2.616709593 -0.338413093 [134,] -0.467961795 2.616709593 [135,] 0.661586907 -0.467961795 [136,] -0.284804116 0.661586907 [137,] -0.511144696 -0.284804116 [138,] -0.283109703 -0.511144696 [139,] -0.416047232 -0.283109703 [140,] 0.096782852 -0.416047232 [141,] -0.177823869 0.096782852 [142,] -0.196743901 -0.177823869 [143,] -0.125909305 -0.196743901 [144,] -0.485187415 -0.125909305 [145,] -0.222701183 -0.485187415 [146,] -0.062111959 -0.222701183 [147,] 0.678812526 -0.062111959 [148,] -0.326292604 0.678812526 [149,] -0.452430590 -0.326292604 [150,] 1.488855304 -0.452430590 [151,] -0.082726405 1.488855304 [152,] -0.062111959 -0.082726405 [153,] -0.239926802 -0.062111959 [154,] -0.088069241 -0.239926802 [155,] 0.708158634 -0.088069241 [156,] -0.502413034 0.708158634 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.062111959 -0.238232389 2 -0.467961795 -0.062111959 3 -0.353944299 -0.467961795 4 1.025948256 -0.353944299 5 -0.081031991 1.025948256 6 2.487160890 -0.081031991 7 -0.224395596 2.487160890 8 -0.124214892 -0.224395596 9 0.532038205 -0.124214892 10 -0.428167721 0.532038205 11 -0.203781151 -0.428167721 12 0.642666875 -0.203781151 13 -0.338413093 0.642666875 14 -0.082726405 -0.338413093 15 -0.514533523 -0.082726405 16 -0.079337578 -0.514533523 17 -0.556022010 -0.079337578 18 -0.160598250 -0.556022010 19 0.644361288 -0.160598250 20 -0.017234645 0.644361288 21 0.390369013 -0.017234645 22 -0.493919077 0.390369013 23 0.663281320 -0.493919077 24 -0.613019814 0.663281320 25 -0.345212636 -0.613019814 26 -0.326292604 -0.345212636 27 0.530343791 -0.326292604 28 -0.338413093 0.530343791 29 0.096782852 -0.338413093 30 0.672012983 0.096782852 31 -0.253763595 0.672012983 32 -0.062111959 -0.253763595 33 -0.105294860 -0.062111959 34 -0.241621215 -0.105294860 35 0.388674600 -0.241621215 36 -0.241621215 0.388674600 37 0.096782852 -0.241621215 38 -0.512839110 0.096782852 39 -0.442004514 -0.512839110 40 -0.044886340 -0.442004514 41 0.096782852 -0.044886340 42 -0.428167721 0.096782852 43 -0.219312357 -0.428167721 44 -0.378207167 -0.219312357 45 -0.310761398 -0.378207167 46 -0.150172174 -0.310761398 47 -0.037849091 -0.150172174 48 -0.274615747 -0.037849091 49 -0.291841366 -0.274615747 50 0.784336066 -0.291841366 51 0.583952768 0.784336066 52 -0.424778895 0.583952768 53 -0.174435043 -0.424778895 54 -0.062111959 -0.174435043 55 0.689238602 -0.062111959 56 -0.305678158 0.689238602 57 -0.151866587 -0.305678158 58 0.670318570 -0.151866587 59 -0.203781151 0.670318570 60 -0.467961795 -0.203781151 61 -0.371169918 -0.467961795 62 -0.236537976 -0.371169918 63 -0.671733920 -0.236537976 64 0.620098419 -0.671733920 65 -0.319493061 0.620098419 66 -0.538796391 -0.319493061 67 0.893010727 -0.538796391 68 -0.089763654 0.893010727 69 -0.556022010 -0.089763654 70 -0.414352819 -0.556022010 71 -0.239926802 -0.414352819 72 -0.148477761 -0.239926802 73 1.550958237 -0.148477761 74 0.848133413 1.550958237 75 0.601178387 0.848133413 76 -0.239926802 0.601178387 77 -0.062111959 -0.239926802 78 -0.196743901 -0.062111959 79 -0.105294860 -0.196743901 80 -0.060417546 -0.105294860 81 -0.207191867 -0.060417546 82 -0.222701183 -0.207191867 83 -0.267578497 -0.222701183 84 -0.267578497 -0.267578497 85 -0.307372571 -0.267578497 86 0.051905538 -0.307372571 87 1.442283576 0.051905538 88 0.053599951 1.442283576 89 -0.082726405 0.053599951 90 -0.125909305 -0.082726405 91 -0.132946555 -0.125909305 92 -0.155255414 -0.132946555 93 -0.262495257 -0.155255414 94 -0.452430590 -0.262495257 95 -0.177823869 -0.452430590 96 -0.193355075 -0.177823869 97 -0.196743901 -0.193355075 98 -0.267578497 -0.196743901 99 0.575221105 -0.267578497 100 -0.340107506 0.575221105 101 -0.397127200 -0.340107506 102 -0.283109703 -0.397127200 103 0.514812585 -0.283109703 104 -0.132946555 0.514812585 105 0.532038205 -0.132946555 106 0.846439000 0.532038205 107 1.554347063 0.846439000 108 0.673707396 1.554347063 109 0.715195884 0.673707396 110 -0.469656209 0.715195884 111 -0.405858862 -0.469656209 112 0.034679919 -0.405858862 113 0.007028224 0.034679919 114 -0.652813888 0.007028224 115 -0.212275107 -0.652813888 116 -0.062111959 -0.212275107 117 0.747930818 -0.062111959 118 -0.335024266 0.747930818 119 -0.327987017 -0.335024266 120 -0.424778895 -0.327987017 121 0.008722637 -0.424778895 122 -0.423084481 0.008722637 123 -0.176129456 -0.423084481 124 0.008722637 -0.176129456 125 -0.239926802 0.008722637 126 -0.495613490 -0.239926802 127 0.647750114 -0.495613490 128 0.630524495 0.647750114 129 -0.017234645 0.630524495 130 -0.338413093 -0.017234645 131 -0.338413093 -0.338413093 132 -0.338413093 -0.338413093 133 2.616709593 -0.338413093 134 -0.467961795 2.616709593 135 0.661586907 -0.467961795 136 -0.284804116 0.661586907 137 -0.511144696 -0.284804116 138 -0.283109703 -0.511144696 139 -0.416047232 -0.283109703 140 0.096782852 -0.416047232 141 -0.177823869 0.096782852 142 -0.196743901 -0.177823869 143 -0.125909305 -0.196743901 144 -0.485187415 -0.125909305 145 -0.222701183 -0.485187415 146 -0.062111959 -0.222701183 147 0.678812526 -0.062111959 148 -0.326292604 0.678812526 149 -0.452430590 -0.326292604 150 1.488855304 -0.452430590 151 -0.082726405 1.488855304 152 -0.062111959 -0.082726405 153 -0.239926802 -0.062111959 154 -0.088069241 -0.239926802 155 0.708158634 -0.088069241 156 -0.502413034 0.708158634 > 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/78zpc1292759235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/88zpc1292759235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/9186f1292759235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/10186f1292759235.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/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/114r431292759235.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/128r3q1292759235.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/13mj0h1292759235.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/14p2zn1292759235.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/15s2ft1292759235.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/16elwh1292759235.tab") + } > > try(system("convert tmp/1u7rl1292759235.ps tmp/1u7rl1292759235.png",intern=TRUE)) character(0) > try(system("convert tmp/2nhq61292759235.ps tmp/2nhq61292759235.png",intern=TRUE)) character(0) > try(system("convert tmp/3nhq61292759235.ps tmp/3nhq61292759235.png",intern=TRUE)) character(0) > try(system("convert tmp/4nhq61292759235.ps tmp/4nhq61292759235.png",intern=TRUE)) character(0) > try(system("convert tmp/5f8791292759235.ps tmp/5f8791292759235.png",intern=TRUE)) character(0) > try(system("convert tmp/6f8791292759235.ps tmp/6f8791292759235.png",intern=TRUE)) character(0) > try(system("convert tmp/78zpc1292759235.ps tmp/78zpc1292759235.png",intern=TRUE)) character(0) > try(system("convert tmp/88zpc1292759235.ps tmp/88zpc1292759235.png",intern=TRUE)) character(0) > try(system("convert tmp/9186f1292759235.ps tmp/9186f1292759235.png",intern=TRUE)) character(0) > try(system("convert tmp/10186f1292759235.ps tmp/10186f1292759235.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.870 1.763 9.265