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(11 + ,14 + ,11 + ,12 + ,12 + ,11 + ,11 + ,7 + ,8 + ,11 + ,11 + ,6 + ,17 + ,8 + ,14 + ,11 + ,12 + ,10 + ,8 + ,12 + ,11 + ,8 + ,12 + ,9 + ,21 + ,11 + ,10 + ,12 + ,7 + ,12 + ,11 + ,10 + ,11 + ,4 + ,22 + ,11 + ,11 + ,11 + ,11 + ,11 + ,11 + ,16 + ,12 + ,7 + ,10 + ,11 + ,11 + ,13 + ,7 + ,13 + ,11 + ,13 + ,14 + ,12 + ,10 + ,11 + ,12 + ,16 + ,10 + ,8 + ,11 + ,8 + ,11 + ,10 + ,15 + ,11 + ,12 + ,10 + ,8 + ,14 + ,11 + ,11 + ,11 + ,8 + ,10 + ,11 + ,4 + ,15 + ,4 + ,14 + ,11 + ,9 + ,9 + ,9 + ,14 + ,11 + ,8 + ,11 + ,8 + ,11 + ,11 + ,8 + ,17 + ,7 + ,10 + ,11 + ,14 + ,17 + ,11 + ,13 + ,11 + ,15 + ,11 + ,9 + ,7 + ,11 + ,16 + ,18 + ,11 + ,14 + ,11 + ,9 + ,14 + ,13 + ,12 + ,11 + ,14 + ,10 + ,8 + ,14 + ,11 + ,11 + ,11 + ,8 + ,11 + ,11 + ,8 + ,15 + ,9 + ,9 + ,11 + ,9 + ,15 + ,6 + ,11 + ,11 + ,9 + ,13 + ,9 + ,15 + ,11 + ,9 + ,16 + ,9 + ,14 + ,11 + ,9 + ,13 + ,6 + ,13 + ,11 + ,10 + ,9 + ,6 + ,9 + ,11 + ,16 + ,18 + ,16 + ,15 + ,11 + ,11 + ,18 + ,5 + ,10 + ,11 + ,8 + ,12 + ,7 + ,11 + ,11 + ,9 + ,17 + ,9 + ,13 + ,11 + ,16 + ,9 + ,6 + ,8 + ,11 + ,11 + ,9 + ,6 + ,20 + ,11 + ,16 + ,12 + ,5 + ,12 + ,11 + ,12 + ,18 + ,12 + ,10 + ,11 + ,12 + ,12 + ,7 + ,10 + ,11 + ,14 + ,18 + ,10 + ,9 + ,11 + ,9 + ,14 + ,9 + ,14 + ,11 + ,10 + ,15 + ,8 + ,8 + ,11 + ,9 + ,16 + ,5 + ,14 + ,11 + ,10 + ,10 + ,8 + ,11 + ,11 + ,12 + ,11 + ,8 + ,13 + ,11 + ,14 + ,14 + ,10 + ,9 + ,11 + ,14 + ,9 + ,6 + ,11 + ,11 + ,10 + ,12 + ,8 + ,15 + ,11 + ,14 + ,17 + ,7 + ,11 + ,11 + ,16 + ,5 + ,4 + ,10 + ,11 + ,9 + ,12 + ,8 + ,14 + ,11 + ,10 + ,12 + ,8 + ,18 + ,11 + ,6 + ,6 + ,4 + ,14 + ,11 + ,8 + ,24 + ,20 + ,11 + ,11 + ,13 + ,12 + ,8 + ,12 + ,11 + ,10 + ,12 + ,8 + ,13 + ,11 + ,8 + ,14 + ,6 + ,9 + ,11 + ,7 + ,7 + ,4 + ,10 + ,11 + ,15 + ,13 + ,8 + ,15 + ,11 + ,9 + ,12 + ,9 + ,20 + ,11 + ,10 + ,13 + ,6 + ,12 + ,11 + ,12 + ,14 + ,7 + ,12 + ,11 + ,13 + ,8 + ,9 + ,14 + ,11 + ,10 + ,11 + ,5 + ,13 + ,11 + ,11 + ,9 + ,5 + ,11 + ,11 + ,8 + ,11 + ,8 + ,17 + ,11 + ,9 + ,13 + ,8 + ,12 + ,11 + ,13 + ,10 + ,6 + ,13 + ,11 + ,11 + ,11 + ,8 + ,14 + ,11 + ,8 + ,12 + ,7 + ,13 + ,11 + ,9 + ,9 + ,7 + ,15 + ,11 + ,9 + ,15 + ,9 + ,13 + ,11 + ,15 + ,18 + ,11 + ,10 + ,11 + ,9 + ,15 + ,6 + ,11 + ,11 + ,10 + ,12 + ,8 + ,19 + ,11 + ,14 + ,13 + ,6 + ,13 + ,11 + ,12 + ,14 + ,9 + ,17 + ,11 + ,12 + ,10 + ,8 + ,13 + ,11 + ,11 + ,13 + ,6 + ,9 + ,11 + ,14 + ,13 + ,10 + ,11 + ,11 + ,6 + ,11 + ,8 + ,10 + ,11 + ,12 + ,13 + ,8 + ,9 + ,11 + ,8 + ,16 + ,10 + ,12 + ,11 + ,14 + ,8 + ,5 + ,12 + ,11 + ,11 + ,16 + ,7 + ,13 + ,11 + ,10 + ,11 + ,5 + ,13 + ,11 + ,14 + ,9 + ,8 + ,12 + ,11 + ,12 + ,16 + ,14 + ,15 + ,11 + ,10 + ,12 + ,7 + ,22 + ,11 + ,14 + ,14 + ,8 + ,13 + ,11 + ,5 + ,8 + ,6 + ,15 + ,11 + ,11 + ,9 + ,5 + ,13 + ,11 + ,10 + ,15 + ,6 + ,15 + ,11 + ,9 + ,11 + ,10 + ,10 + ,11 + ,10 + ,21 + ,12 + ,11 + ,11 + ,16 + ,14 + ,9 + ,16 + ,11 + ,13 + ,18 + ,12 + ,11 + ,11 + ,9 + ,12 + ,7 + ,11 + ,11 + ,10 + ,13 + ,8 + ,10 + ,11 + ,10 + ,15 + ,10 + ,10 + ,11 + ,7 + ,12 + ,6 + ,16 + ,11 + ,9 + ,19 + ,10 + ,12 + ,11 + ,8 + ,15 + ,10 + ,11 + ,11 + ,14 + ,11 + ,10 + ,16 + ,11 + ,14 + ,11 + ,5 + ,19 + ,11 + ,8 + ,10 + ,7 + ,11 + ,11 + ,9 + ,13 + ,10 + ,16 + ,11 + ,14 + ,15 + ,11 + ,15 + ,11 + ,14 + ,12 + ,6 + ,24 + ,11 + ,8 + ,12 + ,7 + ,14 + ,11 + ,8 + ,16 + ,12 + ,15 + ,11 + ,8 + ,9 + ,11 + ,11 + ,11 + ,7 + ,18 + ,11 + ,15 + ,11 + ,6 + ,8 + ,11 + ,12 + ,11 + ,8 + ,13 + ,5 + ,10 + ,11 + ,6 + ,17 + ,8 + ,14 + ,11 + ,11 + ,9 + ,6 + ,13 + ,11 + ,14 + ,15 + ,9 + ,9 + ,11 + ,11 + ,8 + ,4 + ,15 + ,11 + ,11 + ,7 + ,4 + ,15 + ,11 + ,11 + ,12 + ,7 + ,14 + ,11 + ,14 + ,14 + ,11 + ,11 + ,11 + ,8 + ,6 + ,6 + ,8 + ,11 + ,20 + ,8 + ,7 + ,11 + ,11 + ,11 + ,17 + ,8 + ,11 + ,11 + ,8 + ,10 + ,4 + ,8 + ,11 + ,11 + ,11 + ,8 + ,10 + ,11 + ,10 + ,14 + ,9 + ,11 + ,11 + ,14 + ,11 + ,8 + ,13 + ,11 + ,11 + ,13 + ,11 + ,11 + ,11 + ,9 + ,12 + ,8 + ,20 + ,11 + ,9 + ,11 + ,5 + ,10 + ,11 + ,8 + ,9 + ,4 + ,15 + ,11 + ,10 + ,12 + ,8 + ,12 + ,11 + ,13 + ,20 + ,10 + ,14 + ,11 + ,13 + ,12 + ,6 + ,23 + ,11 + ,12 + ,13 + ,9 + ,14 + ,11 + ,8 + ,12 + ,9 + ,16 + ,11 + ,13 + ,12 + ,13 + ,11 + ,11 + ,14 + ,9 + ,9 + ,12 + ,11 + ,12 + ,15 + ,10 + ,10 + ,11 + ,14 + ,24 + ,20 + ,14 + ,11 + ,15 + ,7 + ,5 + ,12 + ,11 + ,13 + ,17 + ,11 + ,12 + ,11 + ,16 + ,11 + ,6 + ,11 + ,11 + ,9 + ,17 + ,9 + ,12 + ,11 + ,9 + ,11 + ,7 + ,13 + ,11 + ,9 + ,12 + ,9 + ,11 + ,11 + ,8 + ,14 + ,10 + ,19 + ,11 + ,7 + ,11 + ,9 + ,12 + ,11 + ,16 + ,16 + ,8 + ,17 + ,11 + ,11 + ,21 + ,7 + ,9 + ,11 + ,9 + ,14 + ,6 + ,12 + ,11 + ,11 + ,20 + ,13 + ,19 + ,11 + ,9 + ,13 + ,6 + ,18 + ,11 + ,14 + ,11 + ,8 + ,15 + ,11 + ,13 + ,15 + ,10 + ,14 + ,11 + ,16 + ,19 + ,16 + ,11 + ,11 + ,9 + ,11 + ,18 + ,11 + ,16) + ,dim=c(5 + ,162) + ,dimnames=list(c('Month' + ,'Doubts' + ,'Expectations' + ,'Criticism' + ,'Depression') + ,1:162)) > y <- array(NA,dim=c(5,162),dimnames=list(c('Month','Doubts','Expectations','Criticism','Depression'),1:162)) > 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 = '5' > #'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 Depression Month Doubts Expectations Criticism 1 12 11 14 11 12 2 11 11 11 7 8 3 14 11 6 17 8 4 12 11 12 10 8 5 21 11 8 12 9 6 12 11 10 12 7 7 22 11 10 11 4 8 11 11 11 11 11 9 10 11 16 12 7 10 13 11 11 13 7 11 10 11 13 14 12 12 8 11 12 16 10 13 15 11 8 11 10 14 14 11 12 10 8 15 10 11 11 11 8 16 14 11 4 15 4 17 14 11 9 9 9 18 11 11 8 11 8 19 10 11 8 17 7 20 13 11 14 17 11 21 7 11 15 11 9 22 14 11 16 18 11 23 12 11 9 14 13 24 14 11 14 10 8 25 11 11 11 11 8 26 9 11 8 15 9 27 11 11 9 15 6 28 15 11 9 13 9 29 14 11 9 16 9 30 13 11 9 13 6 31 9 11 10 9 6 32 15 11 16 18 16 33 10 11 11 18 5 34 11 11 8 12 7 35 13 11 9 17 9 36 8 11 16 9 6 37 20 11 11 9 6 38 12 11 16 12 5 39 10 11 12 18 12 40 10 11 12 12 7 41 9 11 14 18 10 42 14 11 9 14 9 43 8 11 10 15 8 44 14 11 9 16 5 45 11 11 10 10 8 46 13 11 12 11 8 47 9 11 14 14 10 48 11 11 14 9 6 49 15 11 10 12 8 50 11 11 14 17 7 51 10 11 16 5 4 52 14 11 9 12 8 53 18 11 10 12 8 54 14 11 6 6 4 55 11 11 8 24 20 56 12 11 13 12 8 57 13 11 10 12 8 58 9 11 8 14 6 59 10 11 7 7 4 60 15 11 15 13 8 61 20 11 9 12 9 62 12 11 10 13 6 63 12 11 12 14 7 64 14 11 13 8 9 65 13 11 10 11 5 66 11 11 11 9 5 67 17 11 8 11 8 68 12 11 9 13 8 69 13 11 13 10 6 70 14 11 11 11 8 71 13 11 8 12 7 72 15 11 9 9 7 73 13 11 9 15 9 74 10 11 15 18 11 75 11 11 9 15 6 76 19 11 10 12 8 77 13 11 14 13 6 78 17 11 12 14 9 79 13 11 12 10 8 80 9 11 11 13 6 81 11 11 14 13 10 82 10 11 6 11 8 83 9 11 12 13 8 84 12 11 8 16 10 85 12 11 14 8 5 86 13 11 11 16 7 87 13 11 10 11 5 88 12 11 14 9 8 89 15 11 12 16 14 90 22 11 10 12 7 91 13 11 14 14 8 92 15 11 5 8 6 93 13 11 11 9 5 94 15 11 10 15 6 95 10 11 9 11 10 96 11 11 10 21 12 97 16 11 16 14 9 98 11 11 13 18 12 99 11 11 9 12 7 100 10 11 10 13 8 101 10 11 10 15 10 102 16 11 7 12 6 103 12 11 9 19 10 104 11 11 8 15 10 105 16 11 14 11 10 106 19 11 14 11 5 107 11 11 8 10 7 108 16 11 9 13 10 109 15 11 14 15 11 110 24 11 14 12 6 111 14 11 8 12 7 112 15 11 8 16 12 113 11 11 8 9 11 114 15 11 7 18 11 115 12 11 6 8 11 116 10 11 8 13 5 117 14 11 6 17 8 118 13 11 11 9 6 119 9 11 14 15 9 120 15 11 11 8 4 121 15 11 11 7 4 122 14 11 11 12 7 123 11 11 14 14 11 124 8 11 8 6 6 125 11 11 20 8 7 126 11 11 11 17 8 127 8 11 8 10 4 128 10 11 11 11 8 129 11 11 10 14 9 130 13 11 14 11 8 131 11 11 11 13 11 132 20 11 9 12 8 133 10 11 9 11 5 134 15 11 8 9 4 135 12 11 10 12 8 136 14 11 13 20 10 137 23 11 13 12 6 138 14 11 12 13 9 139 16 11 8 12 9 140 11 11 13 12 13 141 12 11 14 9 9 142 10 11 12 15 10 143 14 11 14 24 20 144 12 11 15 7 5 145 12 11 13 17 11 146 11 11 16 11 6 147 12 11 9 17 9 148 13 11 9 11 7 149 11 11 9 12 9 150 19 11 8 14 10 151 12 11 7 11 9 152 17 11 16 16 8 153 9 11 11 21 7 154 12 11 9 14 6 155 19 11 11 20 13 156 18 11 9 13 6 157 15 11 14 11 8 158 14 11 13 15 10 159 11 11 16 19 16 160 11 11 9 11 18 161 12 16 11 14 11 162 8 12 11 11 7 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Month Doubts Expectations Criticism 17.77691 -0.32976 -0.07540 -0.01160 -0.03884 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5.5414 -2.0199 -0.6249 1.4365 11.2782 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 17.77691 7.01238 2.535 0.0122 * Month -0.32976 0.62584 -0.527 0.5990 Doubts -0.07540 0.09084 -0.830 0.4078 Expectations -0.01160 0.08821 -0.131 0.8956 Criticism -0.03884 0.10894 -0.356 0.7220 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 3.169 on 157 degrees of freedom Multiple R-squared: 0.008946, Adjusted R-squared: -0.0163 F-statistic: 0.3543 on 4 and 157 DF, p-value: 0.8407 > 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.97677099 0.04645802 0.02322901 [2,] 0.95529308 0.08941385 0.04470692 [3,] 0.92134905 0.15730190 0.07865095 [4,] 0.87244988 0.25510024 0.12755012 [5,] 0.84895617 0.30208765 0.15104383 [6,] 0.78201087 0.43597826 0.21798913 [7,] 0.70511770 0.58976461 0.29488230 [8,] 0.72514056 0.54971888 0.27485944 [9,] 0.78160843 0.43678314 0.21839157 [10,] 0.71836904 0.56326192 0.28163096 [11,] 0.73064583 0.53870834 0.26935417 [12,] 0.70691434 0.58617132 0.29308566 [13,] 0.73382733 0.53234533 0.26617267 [14,] 0.77042504 0.45914991 0.22957496 [15,] 0.81490065 0.37019870 0.18509935 [16,] 0.76461263 0.47077473 0.23538737 [17,] 0.72626527 0.54746946 0.27373473 [18,] 0.68725485 0.62549031 0.31274515 [19,] 0.71345897 0.57308206 0.28654103 [20,] 0.68303508 0.63392985 0.31696492 [21,] 0.65139875 0.69720250 0.34860125 [22,] 0.60360998 0.79278004 0.39639002 [23,] 0.54348226 0.91303549 0.45651774 [24,] 0.59356428 0.81287144 0.40643572 [25,] 0.62750922 0.74498156 0.37249078 [26,] 0.60001839 0.79996322 0.39998161 [27,] 0.56514177 0.86971646 0.43485823 [28,] 0.50741848 0.98516305 0.49258152 [29,] 0.50939653 0.98120693 0.49060347 [30,] 0.74091168 0.51817665 0.25908832 [31,] 0.69877133 0.60245735 0.30122867 [32,] 0.66999065 0.66001870 0.33000935 [33,] 0.64735530 0.70528941 0.35264470 [34,] 0.62961951 0.74076097 0.37038049 [35,] 0.58423806 0.83152387 0.41576194 [36,] 0.63388920 0.73222160 0.36611080 [37,] 0.59488525 0.81022950 0.40511475 [38,] 0.56241234 0.87517532 0.43758766 [39,] 0.51312534 0.97374932 0.48687466 [40,] 0.50316147 0.99367705 0.49683853 [41,] 0.46065069 0.92130137 0.53934931 [42,] 0.43536479 0.87072959 0.56463521 [43,] 0.39429617 0.78859233 0.60570383 [44,] 0.36949122 0.73898245 0.63050878 [45,] 0.32741956 0.65483912 0.67258044 [46,] 0.40809058 0.81618116 0.59190942 [47,] 0.36370881 0.72741762 0.63629119 [48,] 0.32766626 0.65533253 0.67233374 [49,] 0.28674434 0.57348868 0.71325566 [50,] 0.24654568 0.49309135 0.75345432 [51,] 0.27536719 0.55073439 0.72463281 [52,] 0.29227225 0.58454451 0.70772775 [53,] 0.29685003 0.59370006 0.70314997 [54,] 0.47565050 0.95130101 0.52434950 [55,] 0.43202398 0.86404796 0.56797602 [56,] 0.38914649 0.77829299 0.61085351 [57,] 0.35217060 0.70434120 0.64782940 [58,] 0.30978901 0.61957801 0.69021099 [59,] 0.28428339 0.56856677 0.71571661 [60,] 0.30039377 0.60078754 0.69960623 [61,] 0.26471695 0.52943390 0.73528305 [62,] 0.23010855 0.46021710 0.76989145 [63,] 0.20063088 0.40126175 0.79936912 [64,] 0.16959588 0.33919176 0.83040412 [65,] 0.14982205 0.29964410 0.85017795 [66,] 0.12433684 0.24867368 0.87566316 [67,] 0.11310029 0.22620058 0.88689971 [68,] 0.10001081 0.20002161 0.89998919 [69,] 0.16842595 0.33685190 0.83157405 [70,] 0.14616179 0.29232359 0.85383821 [71,] 0.17433025 0.34866051 0.82566975 [72,] 0.14628562 0.29257125 0.85371438 [73,] 0.16042324 0.32084647 0.83957676 [74,] 0.14030042 0.28060084 0.85969958 [75,] 0.14849223 0.29698446 0.85150777 [76,] 0.16058312 0.32116625 0.83941688 [77,] 0.13657658 0.27315316 0.86342342 [78,] 0.11565611 0.23131223 0.88434389 [79,] 0.09707615 0.19415230 0.90292385 [80,] 0.07916507 0.15833015 0.92083493 [81,] 0.06463384 0.12926768 0.93536616 [82,] 0.05938537 0.11877074 0.94061463 [83,] 0.22811065 0.45622131 0.77188935 [84,] 0.19861579 0.39723157 0.80138421 [85,] 0.17857293 0.35714586 0.82142707 [86,] 0.15008337 0.30016673 0.84991663 [87,] 0.13514643 0.27029286 0.86485357 [88,] 0.13270637 0.26541274 0.86729363 [89,] 0.11694198 0.23388396 0.88305802 [90,] 0.12282896 0.24565793 0.87717104 [91,] 0.10790526 0.21581051 0.89209474 [92,] 0.09616661 0.19233322 0.90383339 [93,] 0.09436768 0.18873536 0.90563232 [94,] 0.09179625 0.18359250 0.90820375 [95,] 0.08631426 0.17262852 0.91368574 [96,] 0.07184473 0.14368947 0.92815527 [97,] 0.06292826 0.12585651 0.93707174 [98,] 0.06366081 0.12732161 0.93633919 [99,] 0.10933693 0.21867386 0.89066307 [100,] 0.09714930 0.19429859 0.90285070 [101,] 0.09432752 0.18865504 0.90567248 [102,] 0.08461809 0.16923618 0.91538191 [103,] 0.48052041 0.96104082 0.51947959 [104,] 0.43465385 0.86930770 0.56534615 [105,] 0.40355762 0.80711525 0.59644238 [106,] 0.36936441 0.73872883 0.63063559 [107,] 0.33632888 0.67265777 0.66367112 [108,] 0.29486861 0.58973723 0.70513139 [109,] 0.29638780 0.59277561 0.70361220 [110,] 0.25472276 0.50944552 0.74527724 [111,] 0.21517938 0.43035876 0.78482062 [112,] 0.23106037 0.46212075 0.76893963 [113,] 0.20878007 0.41756014 0.79121993 [114,] 0.19189673 0.38379346 0.80810327 [115,] 0.16137364 0.32274728 0.83862636 [116,] 0.13811896 0.27623791 0.86188104 [117,] 0.16846588 0.33693177 0.83153412 [118,] 0.14008717 0.28017434 0.85991283 [119,] 0.12593043 0.25186086 0.87406957 [120,] 0.18157271 0.36314543 0.81842729 [121,] 0.17753509 0.35507017 0.82246491 [122,] 0.16140187 0.32280374 0.83859813 [123,] 0.12839126 0.25678251 0.87160874 [124,] 0.11089837 0.22179675 0.88910163 [125,] 0.21163011 0.42326022 0.78836989 [126,] 0.22232112 0.44464223 0.77767888 [127,] 0.18402656 0.36805312 0.81597344 [128,] 0.15179751 0.30359502 0.84820249 [129,] 0.11927564 0.23855128 0.88072436 [130,] 0.55243318 0.89513365 0.44756682 [131,] 0.49145504 0.98291007 0.50854496 [132,] 0.47395060 0.94790119 0.52604940 [133,] 0.41552681 0.83105363 0.58447319 [134,] 0.34534214 0.69068429 0.65465786 [135,] 0.33625587 0.67251174 0.66374413 [136,] 0.27261120 0.54522240 0.72738880 [137,] 0.21097861 0.42195723 0.78902139 [138,] 0.16542114 0.33084228 0.83457886 [139,] 0.13136523 0.26273047 0.86863477 [140,] 0.09978364 0.19956728 0.90021636 [141,] 0.06605700 0.13211401 0.93394300 [142,] 0.05133075 0.10266150 0.94866925 [143,] 0.09465331 0.18930662 0.90534669 [144,] 0.05806349 0.11612698 0.94193651 [145,] 0.05355952 0.10711904 0.94644048 [146,] 0.16632792 0.33265583 0.83367208 [147,] 0.21078976 0.42157952 0.78921024 > postscript(file="/var/www/html/freestat/rcomp/tmp/16hmf1290547088.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/2zq301290547088.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/3zq301290547088.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/4zq301290547088.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/5zq301290547088.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 = 162 Frequency = 1 1 2 3 4 5 6 -0.50034036 -1.92828845 0.81069225 -0.81808949 7.94233753 -0.98453183 7 8 9 10 11 12 8.88735942 -1.76538263 -2.53212043 0.10246909 -2.54094519 -4.67082221 13 14 15 16 17 18 1.96957509 1.18191051 -2.88189237 0.48134410 0.98294237 -2.10809807 19 20 21 22 23 24 -3.07734053 0.53041719 -5.54144819 1.69282001 -0.80371622 1.33271431 25 26 27 28 29 30 -1.88189237 -4.02286541 -2.06397325 2.02933845 1.06413551 -0.08717129 31 32 33 34 35 36 -4.05816547 2.88700290 -2.91720896 -2.13533563 0.07573453 -4.60575407 37 38 39 40 41 42 7.01723643 -0.60979358 -2.56995101 -2.83372803 -3.49682037 1.04093747 43 44 45 46 47 48 -4.91089819 0.90878920 -1.96889329 0.19350953 -3.54321645 -1.75655787 49 50 51 52 53 54 2.05430475 -1.62492913 -2.72982330 0.97890285 5.05430475 0.52775671 55 56 57 58 59 60 -1.49127187 -0.71948955 0.05430475 -4.15097417 -3.38524236 2.44291327 61 62 63 64 65 66 7.01773943 -1.01176939 -0.81052999 1.27295095 -0.07380401 -2.02160015 67 68 69 70 71 72 3.89190193 -1.00949813 0.17963925 1.11810763 -0.13533563 1.90526921 73 74 75 76 77 78 0.05253649 -2.38258189 -2.06397325 6.05430475 0.28983821 4.26714317 79 80 81 82 83 84 0.18191051 -3.93636749 -1.55481547 -3.25890187 -3.78329243 -0.97242981 85 86 87 88 89 90 -0.80699347 0.13726615 -0.07380401 -0.67888471 2.48452410 9.01546817 91 92 93 94 95 96 0.37911039 1.55322601 -0.02160015 2.01142865 -2.95502301 -1.68595775 97 98 99 100 101 102 3.56875077 -1.49454911 -2.05993373 -2.93409623 -2.83322503 2.75042589 103 104 105 106 107 108 -0.86223085 -1.98402883 3.42198649 6.22780360 -2.15853367 3.06817503 109 110 111 112 113 114 2.50721915 11.27823919 0.86466437 2.10524335 -2.01478637 2.01420291 115 116 117 118 119 120 -1.17718919 -3.20140977 0.81069225 0.01723643 -3.57045401 1.92796426 121 122 123 124 125 126 1.91636524 1.09087007 -1.50437987 -5.24376633 -1.27690891 -1.81229825 127 128 129 130 131 132 -5.27504340 -2.88189237 -1.88366063 0.34431333 -1.74218459 6.97890285 133 134 135 136 137 138 -3.14920591 1.71335758 -0.94569525 1.45097577 10.20283729 1.25554415 139 140 141 142 143 144 2.94233753 -1.52530666 -0.64004813 -2.68242123 1.96113954 -0.74319059 145 146 147 148 149 150 -0.54498471 -1.58255603 -0.92426547 -0.07153275 -1.98226057 6.00437215 151 152 153 154 155 156 -1.14466339 4.55311223 -3.80473875 -1.07557227 6.41668170 4.91282871 157 158 159 160 161 162 2.34431333 1.39298067 -1.10139808 -1.64433038 0.91819458 -4.59097292 > postscript(file="/var/www/html/freestat/rcomp/tmp/6rz2l1290547088.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 = 162 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.50034036 NA 1 -1.92828845 -0.50034036 2 0.81069225 -1.92828845 3 -0.81808949 0.81069225 4 7.94233753 -0.81808949 5 -0.98453183 7.94233753 6 8.88735942 -0.98453183 7 -1.76538263 8.88735942 8 -2.53212043 -1.76538263 9 0.10246909 -2.53212043 10 -2.54094519 0.10246909 11 -4.67082221 -2.54094519 12 1.96957509 -4.67082221 13 1.18191051 1.96957509 14 -2.88189237 1.18191051 15 0.48134410 -2.88189237 16 0.98294237 0.48134410 17 -2.10809807 0.98294237 18 -3.07734053 -2.10809807 19 0.53041719 -3.07734053 20 -5.54144819 0.53041719 21 1.69282001 -5.54144819 22 -0.80371622 1.69282001 23 1.33271431 -0.80371622 24 -1.88189237 1.33271431 25 -4.02286541 -1.88189237 26 -2.06397325 -4.02286541 27 2.02933845 -2.06397325 28 1.06413551 2.02933845 29 -0.08717129 1.06413551 30 -4.05816547 -0.08717129 31 2.88700290 -4.05816547 32 -2.91720896 2.88700290 33 -2.13533563 -2.91720896 34 0.07573453 -2.13533563 35 -4.60575407 0.07573453 36 7.01723643 -4.60575407 37 -0.60979358 7.01723643 38 -2.56995101 -0.60979358 39 -2.83372803 -2.56995101 40 -3.49682037 -2.83372803 41 1.04093747 -3.49682037 42 -4.91089819 1.04093747 43 0.90878920 -4.91089819 44 -1.96889329 0.90878920 45 0.19350953 -1.96889329 46 -3.54321645 0.19350953 47 -1.75655787 -3.54321645 48 2.05430475 -1.75655787 49 -1.62492913 2.05430475 50 -2.72982330 -1.62492913 51 0.97890285 -2.72982330 52 5.05430475 0.97890285 53 0.52775671 5.05430475 54 -1.49127187 0.52775671 55 -0.71948955 -1.49127187 56 0.05430475 -0.71948955 57 -4.15097417 0.05430475 58 -3.38524236 -4.15097417 59 2.44291327 -3.38524236 60 7.01773943 2.44291327 61 -1.01176939 7.01773943 62 -0.81052999 -1.01176939 63 1.27295095 -0.81052999 64 -0.07380401 1.27295095 65 -2.02160015 -0.07380401 66 3.89190193 -2.02160015 67 -1.00949813 3.89190193 68 0.17963925 -1.00949813 69 1.11810763 0.17963925 70 -0.13533563 1.11810763 71 1.90526921 -0.13533563 72 0.05253649 1.90526921 73 -2.38258189 0.05253649 74 -2.06397325 -2.38258189 75 6.05430475 -2.06397325 76 0.28983821 6.05430475 77 4.26714317 0.28983821 78 0.18191051 4.26714317 79 -3.93636749 0.18191051 80 -1.55481547 -3.93636749 81 -3.25890187 -1.55481547 82 -3.78329243 -3.25890187 83 -0.97242981 -3.78329243 84 -0.80699347 -0.97242981 85 0.13726615 -0.80699347 86 -0.07380401 0.13726615 87 -0.67888471 -0.07380401 88 2.48452410 -0.67888471 89 9.01546817 2.48452410 90 0.37911039 9.01546817 91 1.55322601 0.37911039 92 -0.02160015 1.55322601 93 2.01142865 -0.02160015 94 -2.95502301 2.01142865 95 -1.68595775 -2.95502301 96 3.56875077 -1.68595775 97 -1.49454911 3.56875077 98 -2.05993373 -1.49454911 99 -2.93409623 -2.05993373 100 -2.83322503 -2.93409623 101 2.75042589 -2.83322503 102 -0.86223085 2.75042589 103 -1.98402883 -0.86223085 104 3.42198649 -1.98402883 105 6.22780360 3.42198649 106 -2.15853367 6.22780360 107 3.06817503 -2.15853367 108 2.50721915 3.06817503 109 11.27823919 2.50721915 110 0.86466437 11.27823919 111 2.10524335 0.86466437 112 -2.01478637 2.10524335 113 2.01420291 -2.01478637 114 -1.17718919 2.01420291 115 -3.20140977 -1.17718919 116 0.81069225 -3.20140977 117 0.01723643 0.81069225 118 -3.57045401 0.01723643 119 1.92796426 -3.57045401 120 1.91636524 1.92796426 121 1.09087007 1.91636524 122 -1.50437987 1.09087007 123 -5.24376633 -1.50437987 124 -1.27690891 -5.24376633 125 -1.81229825 -1.27690891 126 -5.27504340 -1.81229825 127 -2.88189237 -5.27504340 128 -1.88366063 -2.88189237 129 0.34431333 -1.88366063 130 -1.74218459 0.34431333 131 6.97890285 -1.74218459 132 -3.14920591 6.97890285 133 1.71335758 -3.14920591 134 -0.94569525 1.71335758 135 1.45097577 -0.94569525 136 10.20283729 1.45097577 137 1.25554415 10.20283729 138 2.94233753 1.25554415 139 -1.52530666 2.94233753 140 -0.64004813 -1.52530666 141 -2.68242123 -0.64004813 142 1.96113954 -2.68242123 143 -0.74319059 1.96113954 144 -0.54498471 -0.74319059 145 -1.58255603 -0.54498471 146 -0.92426547 -1.58255603 147 -0.07153275 -0.92426547 148 -1.98226057 -0.07153275 149 6.00437215 -1.98226057 150 -1.14466339 6.00437215 151 4.55311223 -1.14466339 152 -3.80473875 4.55311223 153 -1.07557227 -3.80473875 154 6.41668170 -1.07557227 155 4.91282871 6.41668170 156 2.34431333 4.91282871 157 1.39298067 2.34431333 158 -1.10139808 1.39298067 159 -1.64433038 -1.10139808 160 0.91819458 -1.64433038 161 -4.59097292 0.91819458 162 NA -4.59097292 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.92828845 -0.50034036 [2,] 0.81069225 -1.92828845 [3,] -0.81808949 0.81069225 [4,] 7.94233753 -0.81808949 [5,] -0.98453183 7.94233753 [6,] 8.88735942 -0.98453183 [7,] -1.76538263 8.88735942 [8,] -2.53212043 -1.76538263 [9,] 0.10246909 -2.53212043 [10,] -2.54094519 0.10246909 [11,] -4.67082221 -2.54094519 [12,] 1.96957509 -4.67082221 [13,] 1.18191051 1.96957509 [14,] -2.88189237 1.18191051 [15,] 0.48134410 -2.88189237 [16,] 0.98294237 0.48134410 [17,] -2.10809807 0.98294237 [18,] -3.07734053 -2.10809807 [19,] 0.53041719 -3.07734053 [20,] -5.54144819 0.53041719 [21,] 1.69282001 -5.54144819 [22,] -0.80371622 1.69282001 [23,] 1.33271431 -0.80371622 [24,] -1.88189237 1.33271431 [25,] -4.02286541 -1.88189237 [26,] -2.06397325 -4.02286541 [27,] 2.02933845 -2.06397325 [28,] 1.06413551 2.02933845 [29,] -0.08717129 1.06413551 [30,] -4.05816547 -0.08717129 [31,] 2.88700290 -4.05816547 [32,] -2.91720896 2.88700290 [33,] -2.13533563 -2.91720896 [34,] 0.07573453 -2.13533563 [35,] -4.60575407 0.07573453 [36,] 7.01723643 -4.60575407 [37,] -0.60979358 7.01723643 [38,] -2.56995101 -0.60979358 [39,] -2.83372803 -2.56995101 [40,] -3.49682037 -2.83372803 [41,] 1.04093747 -3.49682037 [42,] -4.91089819 1.04093747 [43,] 0.90878920 -4.91089819 [44,] -1.96889329 0.90878920 [45,] 0.19350953 -1.96889329 [46,] -3.54321645 0.19350953 [47,] -1.75655787 -3.54321645 [48,] 2.05430475 -1.75655787 [49,] -1.62492913 2.05430475 [50,] -2.72982330 -1.62492913 [51,] 0.97890285 -2.72982330 [52,] 5.05430475 0.97890285 [53,] 0.52775671 5.05430475 [54,] -1.49127187 0.52775671 [55,] -0.71948955 -1.49127187 [56,] 0.05430475 -0.71948955 [57,] -4.15097417 0.05430475 [58,] -3.38524236 -4.15097417 [59,] 2.44291327 -3.38524236 [60,] 7.01773943 2.44291327 [61,] -1.01176939 7.01773943 [62,] -0.81052999 -1.01176939 [63,] 1.27295095 -0.81052999 [64,] -0.07380401 1.27295095 [65,] -2.02160015 -0.07380401 [66,] 3.89190193 -2.02160015 [67,] -1.00949813 3.89190193 [68,] 0.17963925 -1.00949813 [69,] 1.11810763 0.17963925 [70,] -0.13533563 1.11810763 [71,] 1.90526921 -0.13533563 [72,] 0.05253649 1.90526921 [73,] -2.38258189 0.05253649 [74,] -2.06397325 -2.38258189 [75,] 6.05430475 -2.06397325 [76,] 0.28983821 6.05430475 [77,] 4.26714317 0.28983821 [78,] 0.18191051 4.26714317 [79,] -3.93636749 0.18191051 [80,] -1.55481547 -3.93636749 [81,] -3.25890187 -1.55481547 [82,] -3.78329243 -3.25890187 [83,] -0.97242981 -3.78329243 [84,] -0.80699347 -0.97242981 [85,] 0.13726615 -0.80699347 [86,] -0.07380401 0.13726615 [87,] -0.67888471 -0.07380401 [88,] 2.48452410 -0.67888471 [89,] 9.01546817 2.48452410 [90,] 0.37911039 9.01546817 [91,] 1.55322601 0.37911039 [92,] -0.02160015 1.55322601 [93,] 2.01142865 -0.02160015 [94,] -2.95502301 2.01142865 [95,] -1.68595775 -2.95502301 [96,] 3.56875077 -1.68595775 [97,] -1.49454911 3.56875077 [98,] -2.05993373 -1.49454911 [99,] -2.93409623 -2.05993373 [100,] -2.83322503 -2.93409623 [101,] 2.75042589 -2.83322503 [102,] -0.86223085 2.75042589 [103,] -1.98402883 -0.86223085 [104,] 3.42198649 -1.98402883 [105,] 6.22780360 3.42198649 [106,] -2.15853367 6.22780360 [107,] 3.06817503 -2.15853367 [108,] 2.50721915 3.06817503 [109,] 11.27823919 2.50721915 [110,] 0.86466437 11.27823919 [111,] 2.10524335 0.86466437 [112,] -2.01478637 2.10524335 [113,] 2.01420291 -2.01478637 [114,] -1.17718919 2.01420291 [115,] -3.20140977 -1.17718919 [116,] 0.81069225 -3.20140977 [117,] 0.01723643 0.81069225 [118,] -3.57045401 0.01723643 [119,] 1.92796426 -3.57045401 [120,] 1.91636524 1.92796426 [121,] 1.09087007 1.91636524 [122,] -1.50437987 1.09087007 [123,] -5.24376633 -1.50437987 [124,] -1.27690891 -5.24376633 [125,] -1.81229825 -1.27690891 [126,] -5.27504340 -1.81229825 [127,] -2.88189237 -5.27504340 [128,] -1.88366063 -2.88189237 [129,] 0.34431333 -1.88366063 [130,] -1.74218459 0.34431333 [131,] 6.97890285 -1.74218459 [132,] -3.14920591 6.97890285 [133,] 1.71335758 -3.14920591 [134,] -0.94569525 1.71335758 [135,] 1.45097577 -0.94569525 [136,] 10.20283729 1.45097577 [137,] 1.25554415 10.20283729 [138,] 2.94233753 1.25554415 [139,] -1.52530666 2.94233753 [140,] -0.64004813 -1.52530666 [141,] -2.68242123 -0.64004813 [142,] 1.96113954 -2.68242123 [143,] -0.74319059 1.96113954 [144,] -0.54498471 -0.74319059 [145,] -1.58255603 -0.54498471 [146,] -0.92426547 -1.58255603 [147,] -0.07153275 -0.92426547 [148,] -1.98226057 -0.07153275 [149,] 6.00437215 -1.98226057 [150,] -1.14466339 6.00437215 [151,] 4.55311223 -1.14466339 [152,] -3.80473875 4.55311223 [153,] -1.07557227 -3.80473875 [154,] 6.41668170 -1.07557227 [155,] 4.91282871 6.41668170 [156,] 2.34431333 4.91282871 [157,] 1.39298067 2.34431333 [158,] -1.10139808 1.39298067 [159,] -1.64433038 -1.10139808 [160,] 0.91819458 -1.64433038 [161,] -4.59097292 0.91819458 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.92828845 -0.50034036 2 0.81069225 -1.92828845 3 -0.81808949 0.81069225 4 7.94233753 -0.81808949 5 -0.98453183 7.94233753 6 8.88735942 -0.98453183 7 -1.76538263 8.88735942 8 -2.53212043 -1.76538263 9 0.10246909 -2.53212043 10 -2.54094519 0.10246909 11 -4.67082221 -2.54094519 12 1.96957509 -4.67082221 13 1.18191051 1.96957509 14 -2.88189237 1.18191051 15 0.48134410 -2.88189237 16 0.98294237 0.48134410 17 -2.10809807 0.98294237 18 -3.07734053 -2.10809807 19 0.53041719 -3.07734053 20 -5.54144819 0.53041719 21 1.69282001 -5.54144819 22 -0.80371622 1.69282001 23 1.33271431 -0.80371622 24 -1.88189237 1.33271431 25 -4.02286541 -1.88189237 26 -2.06397325 -4.02286541 27 2.02933845 -2.06397325 28 1.06413551 2.02933845 29 -0.08717129 1.06413551 30 -4.05816547 -0.08717129 31 2.88700290 -4.05816547 32 -2.91720896 2.88700290 33 -2.13533563 -2.91720896 34 0.07573453 -2.13533563 35 -4.60575407 0.07573453 36 7.01723643 -4.60575407 37 -0.60979358 7.01723643 38 -2.56995101 -0.60979358 39 -2.83372803 -2.56995101 40 -3.49682037 -2.83372803 41 1.04093747 -3.49682037 42 -4.91089819 1.04093747 43 0.90878920 -4.91089819 44 -1.96889329 0.90878920 45 0.19350953 -1.96889329 46 -3.54321645 0.19350953 47 -1.75655787 -3.54321645 48 2.05430475 -1.75655787 49 -1.62492913 2.05430475 50 -2.72982330 -1.62492913 51 0.97890285 -2.72982330 52 5.05430475 0.97890285 53 0.52775671 5.05430475 54 -1.49127187 0.52775671 55 -0.71948955 -1.49127187 56 0.05430475 -0.71948955 57 -4.15097417 0.05430475 58 -3.38524236 -4.15097417 59 2.44291327 -3.38524236 60 7.01773943 2.44291327 61 -1.01176939 7.01773943 62 -0.81052999 -1.01176939 63 1.27295095 -0.81052999 64 -0.07380401 1.27295095 65 -2.02160015 -0.07380401 66 3.89190193 -2.02160015 67 -1.00949813 3.89190193 68 0.17963925 -1.00949813 69 1.11810763 0.17963925 70 -0.13533563 1.11810763 71 1.90526921 -0.13533563 72 0.05253649 1.90526921 73 -2.38258189 0.05253649 74 -2.06397325 -2.38258189 75 6.05430475 -2.06397325 76 0.28983821 6.05430475 77 4.26714317 0.28983821 78 0.18191051 4.26714317 79 -3.93636749 0.18191051 80 -1.55481547 -3.93636749 81 -3.25890187 -1.55481547 82 -3.78329243 -3.25890187 83 -0.97242981 -3.78329243 84 -0.80699347 -0.97242981 85 0.13726615 -0.80699347 86 -0.07380401 0.13726615 87 -0.67888471 -0.07380401 88 2.48452410 -0.67888471 89 9.01546817 2.48452410 90 0.37911039 9.01546817 91 1.55322601 0.37911039 92 -0.02160015 1.55322601 93 2.01142865 -0.02160015 94 -2.95502301 2.01142865 95 -1.68595775 -2.95502301 96 3.56875077 -1.68595775 97 -1.49454911 3.56875077 98 -2.05993373 -1.49454911 99 -2.93409623 -2.05993373 100 -2.83322503 -2.93409623 101 2.75042589 -2.83322503 102 -0.86223085 2.75042589 103 -1.98402883 -0.86223085 104 3.42198649 -1.98402883 105 6.22780360 3.42198649 106 -2.15853367 6.22780360 107 3.06817503 -2.15853367 108 2.50721915 3.06817503 109 11.27823919 2.50721915 110 0.86466437 11.27823919 111 2.10524335 0.86466437 112 -2.01478637 2.10524335 113 2.01420291 -2.01478637 114 -1.17718919 2.01420291 115 -3.20140977 -1.17718919 116 0.81069225 -3.20140977 117 0.01723643 0.81069225 118 -3.57045401 0.01723643 119 1.92796426 -3.57045401 120 1.91636524 1.92796426 121 1.09087007 1.91636524 122 -1.50437987 1.09087007 123 -5.24376633 -1.50437987 124 -1.27690891 -5.24376633 125 -1.81229825 -1.27690891 126 -5.27504340 -1.81229825 127 -2.88189237 -5.27504340 128 -1.88366063 -2.88189237 129 0.34431333 -1.88366063 130 -1.74218459 0.34431333 131 6.97890285 -1.74218459 132 -3.14920591 6.97890285 133 1.71335758 -3.14920591 134 -0.94569525 1.71335758 135 1.45097577 -0.94569525 136 10.20283729 1.45097577 137 1.25554415 10.20283729 138 2.94233753 1.25554415 139 -1.52530666 2.94233753 140 -0.64004813 -1.52530666 141 -2.68242123 -0.64004813 142 1.96113954 -2.68242123 143 -0.74319059 1.96113954 144 -0.54498471 -0.74319059 145 -1.58255603 -0.54498471 146 -0.92426547 -1.58255603 147 -0.07153275 -0.92426547 148 -1.98226057 -0.07153275 149 6.00437215 -1.98226057 150 -1.14466339 6.00437215 151 4.55311223 -1.14466339 152 -3.80473875 4.55311223 153 -1.07557227 -3.80473875 154 6.41668170 -1.07557227 155 4.91282871 6.41668170 156 2.34431333 4.91282871 157 1.39298067 2.34431333 158 -1.10139808 1.39298067 159 -1.64433038 -1.10139808 160 0.91819458 -1.64433038 161 -4.59097292 0.91819458 > 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/7k91o1290547088.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/8k91o1290547088.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/9k91o1290547088.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') Warning messages: 1: In sqrt(crit * p * (1 - hh)/hh) : NaNs produced 2: In sqrt(crit * p * (1 - hh)/hh) : NaNs produced > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/freestat/rcomp/tmp/10d0191290547088.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/11g0hf1290547088.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/12jjyk1290547088.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/1382vw1290547088.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/14jbcz1290547088.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/15mus51290547088.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/160mqe1290547088.tab") + } > > try(system("convert tmp/16hmf1290547088.ps tmp/16hmf1290547088.png",intern=TRUE)) character(0) > try(system("convert tmp/2zq301290547088.ps tmp/2zq301290547088.png",intern=TRUE)) character(0) > try(system("convert tmp/3zq301290547088.ps tmp/3zq301290547088.png",intern=TRUE)) character(0) > try(system("convert tmp/4zq301290547088.ps tmp/4zq301290547088.png",intern=TRUE)) character(0) > try(system("convert tmp/5zq301290547088.ps tmp/5zq301290547088.png",intern=TRUE)) character(0) > try(system("convert tmp/6rz2l1290547088.ps tmp/6rz2l1290547088.png",intern=TRUE)) character(0) > try(system("convert tmp/7k91o1290547088.ps tmp/7k91o1290547088.png",intern=TRUE)) character(0) > try(system("convert tmp/8k91o1290547088.ps tmp/8k91o1290547088.png",intern=TRUE)) character(0) > try(system("convert tmp/9k91o1290547088.ps tmp/9k91o1290547088.png",intern=TRUE)) character(0) > try(system("convert tmp/10d0191290547088.ps tmp/10d0191290547088.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.647 2.619 6.314