R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(14 + ,13 + ,41 + ,12 + ,53 + ,18 + ,16 + ,39 + ,11 + ,86 + ,11 + ,19 + ,30 + ,14 + ,66 + ,12 + ,15 + ,31 + ,12 + ,67 + ,16 + ,14 + ,34 + ,21 + ,76 + ,18 + ,13 + ,35 + ,12 + ,78 + ,14 + ,19 + ,39 + ,22 + ,53 + ,14 + ,15 + ,34 + ,11 + ,80 + ,15 + ,14 + ,36 + ,10 + ,74 + ,15 + ,15 + ,37 + ,13 + ,76 + ,17 + ,16 + ,38 + ,10 + ,79 + ,19 + ,16 + ,36 + ,8 + ,54 + ,10 + ,16 + ,38 + ,15 + ,67 + ,16 + ,16 + ,39 + ,14 + ,54 + ,18 + ,17 + ,33 + ,10 + ,87 + ,14 + ,15 + ,32 + ,14 + ,58 + ,14 + ,15 + ,36 + ,14 + ,75 + ,17 + ,20 + ,38 + ,11 + ,88 + ,14 + ,18 + ,39 + ,10 + ,64 + ,16 + ,16 + ,32 + ,13 + ,57 + ,18 + ,16 + ,32 + ,7 + ,66 + ,11 + ,16 + ,31 + ,14 + ,68 + ,14 + ,19 + ,39 + ,12 + ,54 + ,12 + ,16 + ,37 + ,14 + ,56 + ,17 + ,17 + ,39 + ,11 + ,86 + ,9 + ,17 + ,41 + ,9 + ,80 + ,16 + ,16 + ,36 + ,11 + ,76 + ,14 + ,15 + ,33 + ,15 + ,69 + ,15 + ,16 + ,33 + ,14 + ,78 + ,11 + ,14 + ,34 + ,13 + ,67 + ,16 + ,15 + ,31 + ,9 + ,80 + ,13 + ,12 + ,27 + ,15 + ,54 + ,17 + ,14 + ,37 + ,10 + ,71 + ,15 + ,16 + ,34 + ,11 + ,84 + ,14 + ,14 + ,34 + ,13 + ,74 + ,16 + ,7 + ,32 + ,8 + ,71 + ,9 + ,10 + ,29 + ,20 + ,63 + ,15 + ,14 + ,36 + ,12 + ,71 + ,17 + ,16 + ,29 + ,10 + ,76 + ,13 + ,16 + ,35 + ,10 + ,69 + ,15 + ,16 + ,37 + ,9 + ,74 + ,16 + ,14 + ,34 + ,14 + ,75 + ,16 + ,20 + ,38 + ,8 + ,54 + ,12 + ,14 + ,35 + ,14 + ,52 + ,12 + ,14 + ,38 + ,11 + ,69 + ,11 + ,11 + ,37 + ,13 + ,68 + ,15 + ,14 + ,38 + ,9 + ,65 + ,15 + ,15 + ,33 + ,11 + ,75 + ,17 + ,16 + ,36 + ,15 + ,74 + ,13 + ,14 + ,38 + ,11 + ,75 + ,16 + ,16 + ,32 + ,10 + ,72 + ,14 + ,14 + ,32 + ,14 + ,67 + ,11 + ,12 + ,32 + ,18 + ,63 + ,12 + ,16 + ,34 + ,14 + ,62 + ,12 + ,9 + ,32 + ,11 + ,63 + ,15 + ,14 + ,37 + ,12 + ,76 + ,16 + ,16 + ,39 + ,13 + ,74 + ,15 + ,16 + ,29 + ,9 + ,67 + ,12 + ,15 + ,37 + ,10 + ,73 + ,12 + ,16 + ,35 + ,15 + ,70 + ,8 + ,12 + ,30 + ,20 + ,53 + ,13 + ,16 + ,38 + ,12 + ,77 + ,11 + ,16 + ,34 + ,12 + ,77 + ,14 + ,14 + ,31 + ,14 + ,52 + ,15 + ,16 + ,34 + ,13 + ,54 + ,10 + ,17 + ,35 + ,11 + ,80 + ,11 + ,18 + ,36 + ,17 + ,66 + ,12 + ,18 + ,30 + ,12 + ,73 + ,15 + ,12 + ,39 + ,13 + ,63 + ,15 + ,16 + ,35 + ,14 + ,69 + ,14 + ,10 + ,38 + ,13 + ,67 + ,16 + ,14 + ,31 + ,15 + ,54 + ,15 + ,18 + ,34 + ,13 + ,81 + ,15 + ,18 + ,38 + ,10 + ,69 + ,13 + ,16 + ,34 + ,11 + ,84 + ,12 + ,17 + ,39 + ,19 + ,80 + ,17 + ,16 + ,37 + ,13 + ,70 + ,13 + ,16 + ,34 + ,17 + ,69 + ,15 + ,13 + ,28 + ,13 + ,77 + ,13 + ,16 + ,37 + ,9 + ,54 + ,15 + ,16 + ,33 + ,11 + ,79 + ,16 + ,20 + ,37 + ,10 + ,30 + ,15 + ,16 + ,35 + ,9 + ,71 + ,16 + ,15 + ,37 + ,12 + ,73 + ,15 + ,15 + ,32 + ,12 + ,72 + ,14 + ,16 + ,33 + ,13 + ,77 + ,15 + ,14 + ,38 + ,13 + ,75 + ,14 + ,16 + ,33 + ,12 + ,69 + ,13 + ,16 + ,29 + ,15 + ,54 + ,7 + ,15 + ,33 + ,22 + ,70 + ,17 + ,12 + ,31 + ,13 + ,73 + ,13 + ,17 + ,36 + ,15 + ,54 + ,15 + ,16 + ,35 + ,13 + ,77 + ,14 + ,15 + ,32 + ,15 + ,82 + ,13 + ,13 + ,29 + ,10 + ,80 + ,16 + ,16 + ,39 + ,11 + ,80 + ,12 + ,16 + ,37 + ,16 + ,69 + ,14 + ,16 + ,35 + ,11 + ,78 + ,17 + ,16 + ,37 + ,11 + ,81 + ,15 + ,14 + ,32 + ,10 + ,76 + ,17 + ,16 + ,38 + ,10 + ,76 + ,12 + ,16 + ,37 + ,16 + ,73 + ,16 + ,20 + ,36 + ,12 + ,85 + ,11 + ,15 + ,32 + ,11 + ,66 + ,15 + ,16 + ,33 + ,16 + ,79 + ,9 + ,13 + ,40 + ,19 + ,68 + ,16 + ,17 + ,38 + ,11 + ,76 + ,15 + ,16 + ,41 + ,16 + ,71 + ,10 + ,16 + ,36 + ,15 + ,54 + ,10 + ,12 + ,43 + ,24 + ,46 + ,15 + ,16 + ,30 + ,14 + ,82 + ,11 + ,16 + ,31 + ,15 + ,74 + ,13 + ,17 + ,32 + ,11 + ,88 + ,14 + ,13 + ,32 + ,15 + ,38 + ,18 + ,12 + ,37 + ,12 + ,76 + ,16 + ,18 + ,37 + ,10 + ,86 + ,14 + ,14 + ,33 + ,14 + ,54 + ,14 + ,14 + ,34 + ,13 + ,70 + ,14 + ,13 + ,33 + ,9 + ,69 + ,14 + ,16 + ,38 + ,15 + ,90 + ,12 + ,13 + ,33 + ,15 + ,54 + ,14 + ,16 + ,31 + ,14 + ,76 + ,15 + ,13 + ,38 + ,11 + ,89 + ,15 + ,16 + ,37 + ,8 + ,76 + ,15 + ,15 + ,33 + ,11 + ,73 + ,13 + ,16 + ,31 + ,11 + ,79 + ,17 + ,15 + ,39 + ,8 + ,90 + ,17 + ,17 + ,44 + ,10 + ,74 + ,19 + ,15 + ,33 + ,11 + ,81 + ,15 + ,12 + ,35 + ,13 + ,72 + ,13 + ,16 + ,32 + ,11 + ,71 + ,9 + ,10 + ,28 + ,20 + ,66 + ,15 + ,16 + ,40 + ,10 + ,77 + ,15 + ,12 + ,27 + ,15 + ,65 + ,15 + ,14 + ,37 + ,12 + ,74 + ,16 + ,15 + ,32 + ,14 + ,82 + ,11 + ,13 + ,28 + ,23 + ,54 + ,14 + ,15 + ,34 + ,14 + ,63 + ,11 + ,11 + ,30 + ,16 + ,54 + ,15 + ,12 + ,35 + ,11 + ,64 + ,13 + ,8 + ,31 + ,12 + ,69 + ,15 + ,16 + ,32 + ,10 + ,54 + ,16 + ,15 + ,30 + ,14 + ,84 + ,14 + ,17 + ,30 + ,12 + ,86 + ,15 + ,16 + ,31 + ,12 + ,77 + ,16 + ,10 + ,40 + ,11 + ,89 + ,16 + ,18 + ,32 + ,12 + ,76 + ,11 + ,13 + ,36 + ,13 + ,60 + ,12 + ,16 + ,32 + ,11 + ,75 + ,9 + ,13 + ,35 + ,19 + ,73 + ,16 + ,10 + ,38 + ,12 + ,85 + ,13 + ,15 + ,42 + ,17 + ,79 + ,16 + ,16 + ,34 + ,9 + ,71 + ,12 + ,16 + ,35 + ,12 + ,72 + ,9 + ,14 + ,35 + ,19 + ,69 + ,13 + ,10 + ,33 + ,18 + ,78 + ,13 + ,17 + ,36 + ,15 + ,54 + ,14 + ,13 + ,32 + ,14 + ,69 + ,19 + ,15 + ,33 + ,11 + ,81 + ,13 + ,16 + ,34 + ,9 + ,84 + ,12 + ,12 + ,32 + ,18 + ,84 + ,13 + ,13 + ,34 + ,16 + ,69) + ,dim=c(5 + ,162) + ,dimnames=list(c('Happiness' + ,'Learning' + ,'Connected' + ,'Depression' + ,'Belonging ') + ,1:162)) > y <- array(NA,dim=c(5,162),dimnames=list(c('Happiness','Learning','Connected','Depression','Belonging '),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 = '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 > 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 Happiness Learning Connected Depression Belonging\r 1 14 13 41 12 53 2 18 16 39 11 86 3 11 19 30 14 66 4 12 15 31 12 67 5 16 14 34 21 76 6 18 13 35 12 78 7 14 19 39 22 53 8 14 15 34 11 80 9 15 14 36 10 74 10 15 15 37 13 76 11 17 16 38 10 79 12 19 16 36 8 54 13 10 16 38 15 67 14 16 16 39 14 54 15 18 17 33 10 87 16 14 15 32 14 58 17 14 15 36 14 75 18 17 20 38 11 88 19 14 18 39 10 64 20 16 16 32 13 57 21 18 16 32 7 66 22 11 16 31 14 68 23 14 19 39 12 54 24 12 16 37 14 56 25 17 17 39 11 86 26 9 17 41 9 80 27 16 16 36 11 76 28 14 15 33 15 69 29 15 16 33 14 78 30 11 14 34 13 67 31 16 15 31 9 80 32 13 12 27 15 54 33 17 14 37 10 71 34 15 16 34 11 84 35 14 14 34 13 74 36 16 7 32 8 71 37 9 10 29 20 63 38 15 14 36 12 71 39 17 16 29 10 76 40 13 16 35 10 69 41 15 16 37 9 74 42 16 14 34 14 75 43 16 20 38 8 54 44 12 14 35 14 52 45 12 14 38 11 69 46 11 11 37 13 68 47 15 14 38 9 65 48 15 15 33 11 75 49 17 16 36 15 74 50 13 14 38 11 75 51 16 16 32 10 72 52 14 14 32 14 67 53 11 12 32 18 63 54 12 16 34 14 62 55 12 9 32 11 63 56 15 14 37 12 76 57 16 16 39 13 74 58 15 16 29 9 67 59 12 15 37 10 73 60 12 16 35 15 70 61 8 12 30 20 53 62 13 16 38 12 77 63 11 16 34 12 77 64 14 14 31 14 52 65 15 16 34 13 54 66 10 17 35 11 80 67 11 18 36 17 66 68 12 18 30 12 73 69 15 12 39 13 63 70 15 16 35 14 69 71 14 10 38 13 67 72 16 14 31 15 54 73 15 18 34 13 81 74 15 18 38 10 69 75 13 16 34 11 84 76 12 17 39 19 80 77 17 16 37 13 70 78 13 16 34 17 69 79 15 13 28 13 77 80 13 16 37 9 54 81 15 16 33 11 79 82 16 20 37 10 30 83 15 16 35 9 71 84 16 15 37 12 73 85 15 15 32 12 72 86 14 16 33 13 77 87 15 14 38 13 75 88 14 16 33 12 69 89 13 16 29 15 54 90 7 15 33 22 70 91 17 12 31 13 73 92 13 17 36 15 54 93 15 16 35 13 77 94 14 15 32 15 82 95 13 13 29 10 80 96 16 16 39 11 80 97 12 16 37 16 69 98 14 16 35 11 78 99 17 16 37 11 81 100 15 14 32 10 76 101 17 16 38 10 76 102 12 16 37 16 73 103 16 20 36 12 85 104 11 15 32 11 66 105 15 16 33 16 79 106 9 13 40 19 68 107 16 17 38 11 76 108 15 16 41 16 71 109 10 16 36 15 54 110 10 12 43 24 46 111 15 16 30 14 82 112 11 16 31 15 74 113 13 17 32 11 88 114 14 13 32 15 38 115 18 12 37 12 76 116 16 18 37 10 86 117 14 14 33 14 54 118 14 14 34 13 70 119 14 13 33 9 69 120 14 16 38 15 90 121 12 13 33 15 54 122 14 16 31 14 76 123 15 13 38 11 89 124 15 16 37 8 76 125 15 15 33 11 73 126 13 16 31 11 79 127 17 15 39 8 90 128 17 17 44 10 74 129 19 15 33 11 81 130 15 12 35 13 72 131 13 16 32 11 71 132 9 10 28 20 66 133 15 16 40 10 77 134 15 12 27 15 65 135 15 14 37 12 74 136 16 15 32 14 82 137 11 13 28 23 54 138 14 15 34 14 63 139 11 11 30 16 54 140 15 12 35 11 64 141 13 8 31 12 69 142 15 16 32 10 54 143 16 15 30 14 84 144 14 17 30 12 86 145 15 16 31 12 77 146 16 10 40 11 89 147 16 18 32 12 76 148 11 13 36 13 60 149 12 16 32 11 75 150 9 13 35 19 73 151 16 10 38 12 85 152 13 15 42 17 79 153 16 16 34 9 71 154 12 16 35 12 72 155 9 14 35 19 69 156 13 10 33 18 78 157 13 17 36 15 54 158 14 13 32 14 69 159 19 15 33 11 81 160 13 16 34 9 84 161 12 12 32 18 84 162 13 13 34 16 69 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Learning Connected Depression `Belonging\r` 14.29138 0.04476 0.04386 -0.35981 0.03121 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -7.1087 -1.2283 0.2545 1.1682 4.7752 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 14.29138 2.29357 6.231 4.08e-09 *** Learning 0.04476 0.07129 0.628 0.5310 Connected 0.04386 0.04673 0.939 0.3494 Depression -0.35981 0.05174 -6.954 8.99e-11 *** `Belonging\r` 0.03121 0.01490 2.094 0.0379 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.948 on 157 degrees of freedom Multiple R-squared: 0.3231, Adjusted R-squared: 0.3058 F-statistic: 18.73 on 4 and 157 DF, p-value: 1.316e-12 > 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.3650860 0.730171930 0.634914035 [2,] 0.2121652 0.424330455 0.787834773 [3,] 0.1544831 0.308966117 0.845516942 [4,] 0.1014805 0.202961061 0.898519469 [5,] 0.8684485 0.263103006 0.131551503 [6,] 0.9819285 0.036142903 0.018071451 [7,] 0.9759132 0.048173519 0.024086760 [8,] 0.9775859 0.044828244 0.022414122 [9,] 0.9661153 0.067769338 0.033884669 [10,] 0.9539835 0.092032933 0.046016466 [11,] 0.9337540 0.132492055 0.066246027 [12,] 0.9231999 0.153600105 0.076800052 [13,] 0.9320464 0.135907209 0.067953604 [14,] 0.9342752 0.131449540 0.065724770 [15,] 0.9523283 0.095343336 0.047671668 [16,] 0.9350379 0.129924255 0.064962127 [17,] 0.9328369 0.134326222 0.067163111 [18,] 0.9125073 0.174985368 0.087492684 [19,] 0.9987961 0.002407896 0.001203948 [20,] 0.9981600 0.003679908 0.001839954 [21,] 0.9971739 0.005652205 0.002826102 [22,] 0.9958080 0.008383966 0.004191983 [23,] 0.9978947 0.004210501 0.002105250 [24,] 0.9967551 0.006489782 0.003244891 [25,] 0.9952062 0.009587621 0.004793811 [26,] 0.9943498 0.011300348 0.005650174 [27,] 0.9918142 0.016371529 0.008185764 [28,] 0.9886425 0.022715087 0.011357544 [29,] 0.9840432 0.031913700 0.015956850 [30,] 0.9880884 0.023823126 0.011911563 [31,] 0.9834720 0.033055965 0.016527982 [32,] 0.9822794 0.035441209 0.017720604 [33,] 0.9828831 0.034233781 0.017116891 [34,] 0.9774220 0.045155995 0.022577997 [35,] 0.9767132 0.046573606 0.023286803 [36,] 0.9694584 0.061083168 0.030541584 [37,] 0.9631799 0.073640156 0.036820078 [38,] 0.9718411 0.056317709 0.028158855 [39,] 0.9787978 0.042404306 0.021202153 [40,] 0.9717989 0.056402171 0.028201086 [41,] 0.9627793 0.074441436 0.037220718 [42,] 0.9758042 0.048391648 0.024195824 [43,] 0.9753948 0.049210401 0.024605201 [44,] 0.9688199 0.062360143 0.031180071 [45,] 0.9598372 0.080325627 0.040162814 [46,] 0.9515485 0.096902982 0.048451491 [47,] 0.9466292 0.106741514 0.053370757 [48,] 0.9465023 0.106995337 0.053497669 [49,] 0.9325982 0.134803542 0.067401771 [50,] 0.9263078 0.147384498 0.073692249 [51,] 0.9083921 0.183215758 0.091607879 [52,] 0.9374185 0.125163015 0.062581507 [53,] 0.9319472 0.136105678 0.068052839 [54,] 0.9438079 0.112384142 0.056192071 [55,] 0.9420697 0.115860563 0.057930282 [56,] 0.9690060 0.061988040 0.030994020 [57,] 0.9632970 0.073406040 0.036703020 [58,] 0.9589951 0.082009784 0.041004892 [59,] 0.9923500 0.015300089 0.007650044 [60,] 0.9916669 0.016666293 0.008333147 [61,] 0.9928974 0.014205217 0.007102608 [62,] 0.9912720 0.017456051 0.008728025 [63,] 0.9896645 0.020670945 0.010335472 [64,] 0.9861432 0.027713659 0.013856830 [65,] 0.9925187 0.014962590 0.007481295 [66,] 0.9900625 0.019874944 0.009937472 [67,] 0.9866827 0.026634669 0.013317334 [68,] 0.9875588 0.024882415 0.012441208 [69,] 0.9835872 0.032825505 0.016412753 [70,] 0.9883081 0.023383797 0.011691899 [71,] 0.9847087 0.030582624 0.015291312 [72,] 0.9816188 0.036762477 0.018381239 [73,] 0.9830524 0.033895184 0.016947592 [74,] 0.9775629 0.044874145 0.022437072 [75,] 0.9770080 0.045984081 0.022992041 [76,] 0.9706576 0.058684813 0.029342407 [77,] 0.9670219 0.065956148 0.032978074 [78,] 0.9588739 0.082252147 0.041126073 [79,] 0.9476152 0.104769638 0.052384819 [80,] 0.9360053 0.127989332 0.063994666 [81,] 0.9203863 0.159227412 0.079613706 [82,] 0.9044140 0.191171956 0.095585978 [83,] 0.9433793 0.113241314 0.056620657 [84,] 0.9629916 0.074016892 0.037008446 [85,] 0.9528086 0.094382801 0.047191400 [86,] 0.9421139 0.115772106 0.057886053 [87,] 0.9281058 0.143788346 0.071894173 [88,] 0.9313141 0.137371750 0.068685875 [89,] 0.9168097 0.166380563 0.083190281 [90,] 0.9018219 0.196356295 0.098178147 [91,] 0.8861737 0.227652637 0.113826319 [92,] 0.8824561 0.235087701 0.117543851 [93,] 0.8572640 0.285471909 0.142735955 [94,] 0.8475905 0.304818935 0.152409468 [95,] 0.8267111 0.346577872 0.173288936 [96,] 0.8033342 0.393331508 0.196665754 [97,] 0.8680553 0.263889423 0.131944712 [98,] 0.8688860 0.262228092 0.131114046 [99,] 0.8977371 0.204525775 0.102262888 [100,] 0.8796251 0.240749793 0.120374896 [101,] 0.8796682 0.240663682 0.120331841 [102,] 0.9029447 0.194110615 0.097055307 [103,] 0.8824847 0.235030593 0.117515296 [104,] 0.8677758 0.264448378 0.132224189 [105,] 0.8746510 0.250698035 0.125349018 [106,] 0.8859676 0.228064773 0.114032387 [107,] 0.8934959 0.213008179 0.106504090 [108,] 0.9404251 0.119149873 0.059574936 [109,] 0.9229200 0.154160096 0.077080048 [110,] 0.9129969 0.174006199 0.087003100 [111,] 0.8896799 0.220640133 0.110320067 [112,] 0.8756405 0.248719070 0.124359535 [113,] 0.8452658 0.309468480 0.154734240 [114,] 0.8110144 0.377971214 0.188985607 [115,] 0.7714149 0.457170157 0.228585079 [116,] 0.7317761 0.536447894 0.268223947 [117,] 0.7034663 0.593067407 0.296533703 [118,] 0.6525668 0.694866400 0.347433200 [119,] 0.6737199 0.652560228 0.326280114 [120,] 0.6210554 0.757889205 0.378944602 [121,] 0.6158418 0.768316495 0.384158247 [122,] 0.7557242 0.488551513 0.244275757 [123,] 0.7246183 0.550763311 0.275381655 [124,] 0.7179552 0.564089550 0.282044775 [125,] 0.7324634 0.535073149 0.267536574 [126,] 0.6784443 0.643111381 0.321555691 [127,] 0.6713830 0.657234085 0.328617042 [128,] 0.6196648 0.760670337 0.380335169 [129,] 0.6155972 0.768805687 0.384402844 [130,] 0.6310064 0.737987130 0.368993565 [131,] 0.5914425 0.817115080 0.408557540 [132,] 0.5241312 0.951737609 0.475868804 [133,] 0.4656818 0.931363506 0.534318247 [134,] 0.4254351 0.850870205 0.574564897 [135,] 0.3729526 0.745905153 0.627047424 [136,] 0.3695721 0.739144290 0.630427855 [137,] 0.3081524 0.616304875 0.691847562 [138,] 0.2456000 0.491199920 0.754400040 [139,] 0.1841589 0.368317810 0.815841095 [140,] 0.1965979 0.393195842 0.803402079 [141,] 0.2682849 0.536569827 0.731715086 [142,] 0.2723082 0.544616445 0.727691778 [143,] 0.2660208 0.532041530 0.733979235 [144,] 0.2006217 0.401243377 0.799378312 [145,] 0.2423069 0.484613769 0.757693116 [146,] 0.1503314 0.300662856 0.849668572 [147,] 0.1036909 0.207381858 0.896309071 > postscript(file="/var/wessaorg/rcomp/tmp/1vfjl1322149723.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/wessaorg/rcomp/tmp/27y7s1322149723.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/wessaorg/rcomp/tmp/3nwmw1322149723.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/wessaorg/rcomp/tmp/4e8kj1322149723.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/wessaorg/rcomp/tmp/59rez1322149723.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 = 162 Frequency = 1 1 2 3 4 5 6 -0.007710717 2.556138131 -2.479829427 -2.095487863 4.775169277 3.475323294 7 8 9 10 11 12 3.409602857 -0.992559766 -0.208105726 0.720306000 1.458623763 3.606855483 13 14 15 16 17 18 -3.367836560 2.634158243 2.383529693 0.861129189 0.155188144 1.358550590 19 20 21 22 23 24 -1.206674923 2.487760328 2.048022395 -2.451823483 -0.219750085 -1.340528944 25 26 27 28 29 30 1.511378519 -7.108741799 0.999778801 0.833821573 1.148397750 -2.822499213 31 32 33 34 35 36 0.419396453 0.699354270 1.841648860 -0.162141363 -0.040937687 0.654646174 37 38 39 40 41 42 -1.780626052 0.605140252 1.946997374 -2.097735568 -0.701301598 2.287671562 43 44 45 46 47 48 0.340093227 -1.038463929 -2.779987305 -2.851011579 -0.374794810 0.207329618 49 50 51 52 53 54 3.501448772 -1.967220282 0.940233651 0.625039336 -0.721360475 -1.396176214 55 56 57 58 59 60 -2.105784848 0.405250869 1.650233575 -0.131967905 -3.265521745 -1.329867341 61 62 63 64 65 66 -2.601952219 -1.759335756 -3.583888146 1.136983682 1.493653011 -5.125940894 67 68 69 70 71 72 -1.618796996 -2.373137776 1.172532484 1.341523410 0.181091628 3.434387434 73 74 75 76 77 78 0.561585389 -0.318840501 -2.162141363 -0.422870548 2.862779365 0.464829547 79 80 81 82 83 84 1.173376853 -2.077191675 0.037748020 1.852516527 -0.519961305 1.454107744 85 86 87 88 89 90 0.704622753 -0.180211498 0.752409207 -0.290382274 0.432592013 -3.678680711 91 92 93 94 95 96 3.211372743 0.080799082 0.732064696 0.472012025 -2.043545772 0.743371109 97 98 99 100 101 102 -1.026570906 -1.018770289 1.799889417 -0.095069108 1.552240251 -1.151392890 103 104 105 106 107 108 0.899705628 -3.467959014 1.836821743 -2.913228045 0.867295383 1.735570492 109 110 111 112 113 114 -2.874441305 0.485540499 1.155161473 -2.279241716 -2.243999156 1.934573083 115 116 117 118 119 120 3.494770094 0.194527966 0.986848884 0.083884298 -1.235547669 -0.085562972 121 122 123 124 125 126 -0.608576759 0.298532547 -0.359337616 -1.123527335 0.269740610 -1.874528175 127 128 129 130 131 132 0.396631526 1.306720215 4.020096641 1.067130629 -1.668746108 -1.830380638 133 134 135 136 137 138 -0.566689050 2.356093812 0.467661861 2.112197281 1.489250711 0.617377903 139 140 141 142 143 144 -1.027657080 0.597145109 -0.844581565 0.501932583 2.137510094 -0.734049614 145 146 147 148 149 150 0.547697562 0.687217418 1.445521930 -2.647024932 -2.793568093 -2.849946013 151 152 153 154 155 156 1.259577952 -0.153361023 0.523900598 -2.471722567 -2.769883641 0.856214406 157 158 159 160 161 162 0.080799082 0.607387957 4.020096641 -2.881770852 -0.376675895 0.239293641 > postscript(file="/var/wessaorg/rcomp/tmp/6ewp21322149723.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 = 162 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.007710717 NA 1 2.556138131 -0.007710717 2 -2.479829427 2.556138131 3 -2.095487863 -2.479829427 4 4.775169277 -2.095487863 5 3.475323294 4.775169277 6 3.409602857 3.475323294 7 -0.992559766 3.409602857 8 -0.208105726 -0.992559766 9 0.720306000 -0.208105726 10 1.458623763 0.720306000 11 3.606855483 1.458623763 12 -3.367836560 3.606855483 13 2.634158243 -3.367836560 14 2.383529693 2.634158243 15 0.861129189 2.383529693 16 0.155188144 0.861129189 17 1.358550590 0.155188144 18 -1.206674923 1.358550590 19 2.487760328 -1.206674923 20 2.048022395 2.487760328 21 -2.451823483 2.048022395 22 -0.219750085 -2.451823483 23 -1.340528944 -0.219750085 24 1.511378519 -1.340528944 25 -7.108741799 1.511378519 26 0.999778801 -7.108741799 27 0.833821573 0.999778801 28 1.148397750 0.833821573 29 -2.822499213 1.148397750 30 0.419396453 -2.822499213 31 0.699354270 0.419396453 32 1.841648860 0.699354270 33 -0.162141363 1.841648860 34 -0.040937687 -0.162141363 35 0.654646174 -0.040937687 36 -1.780626052 0.654646174 37 0.605140252 -1.780626052 38 1.946997374 0.605140252 39 -2.097735568 1.946997374 40 -0.701301598 -2.097735568 41 2.287671562 -0.701301598 42 0.340093227 2.287671562 43 -1.038463929 0.340093227 44 -2.779987305 -1.038463929 45 -2.851011579 -2.779987305 46 -0.374794810 -2.851011579 47 0.207329618 -0.374794810 48 3.501448772 0.207329618 49 -1.967220282 3.501448772 50 0.940233651 -1.967220282 51 0.625039336 0.940233651 52 -0.721360475 0.625039336 53 -1.396176214 -0.721360475 54 -2.105784848 -1.396176214 55 0.405250869 -2.105784848 56 1.650233575 0.405250869 57 -0.131967905 1.650233575 58 -3.265521745 -0.131967905 59 -1.329867341 -3.265521745 60 -2.601952219 -1.329867341 61 -1.759335756 -2.601952219 62 -3.583888146 -1.759335756 63 1.136983682 -3.583888146 64 1.493653011 1.136983682 65 -5.125940894 1.493653011 66 -1.618796996 -5.125940894 67 -2.373137776 -1.618796996 68 1.172532484 -2.373137776 69 1.341523410 1.172532484 70 0.181091628 1.341523410 71 3.434387434 0.181091628 72 0.561585389 3.434387434 73 -0.318840501 0.561585389 74 -2.162141363 -0.318840501 75 -0.422870548 -2.162141363 76 2.862779365 -0.422870548 77 0.464829547 2.862779365 78 1.173376853 0.464829547 79 -2.077191675 1.173376853 80 0.037748020 -2.077191675 81 1.852516527 0.037748020 82 -0.519961305 1.852516527 83 1.454107744 -0.519961305 84 0.704622753 1.454107744 85 -0.180211498 0.704622753 86 0.752409207 -0.180211498 87 -0.290382274 0.752409207 88 0.432592013 -0.290382274 89 -3.678680711 0.432592013 90 3.211372743 -3.678680711 91 0.080799082 3.211372743 92 0.732064696 0.080799082 93 0.472012025 0.732064696 94 -2.043545772 0.472012025 95 0.743371109 -2.043545772 96 -1.026570906 0.743371109 97 -1.018770289 -1.026570906 98 1.799889417 -1.018770289 99 -0.095069108 1.799889417 100 1.552240251 -0.095069108 101 -1.151392890 1.552240251 102 0.899705628 -1.151392890 103 -3.467959014 0.899705628 104 1.836821743 -3.467959014 105 -2.913228045 1.836821743 106 0.867295383 -2.913228045 107 1.735570492 0.867295383 108 -2.874441305 1.735570492 109 0.485540499 -2.874441305 110 1.155161473 0.485540499 111 -2.279241716 1.155161473 112 -2.243999156 -2.279241716 113 1.934573083 -2.243999156 114 3.494770094 1.934573083 115 0.194527966 3.494770094 116 0.986848884 0.194527966 117 0.083884298 0.986848884 118 -1.235547669 0.083884298 119 -0.085562972 -1.235547669 120 -0.608576759 -0.085562972 121 0.298532547 -0.608576759 122 -0.359337616 0.298532547 123 -1.123527335 -0.359337616 124 0.269740610 -1.123527335 125 -1.874528175 0.269740610 126 0.396631526 -1.874528175 127 1.306720215 0.396631526 128 4.020096641 1.306720215 129 1.067130629 4.020096641 130 -1.668746108 1.067130629 131 -1.830380638 -1.668746108 132 -0.566689050 -1.830380638 133 2.356093812 -0.566689050 134 0.467661861 2.356093812 135 2.112197281 0.467661861 136 1.489250711 2.112197281 137 0.617377903 1.489250711 138 -1.027657080 0.617377903 139 0.597145109 -1.027657080 140 -0.844581565 0.597145109 141 0.501932583 -0.844581565 142 2.137510094 0.501932583 143 -0.734049614 2.137510094 144 0.547697562 -0.734049614 145 0.687217418 0.547697562 146 1.445521930 0.687217418 147 -2.647024932 1.445521930 148 -2.793568093 -2.647024932 149 -2.849946013 -2.793568093 150 1.259577952 -2.849946013 151 -0.153361023 1.259577952 152 0.523900598 -0.153361023 153 -2.471722567 0.523900598 154 -2.769883641 -2.471722567 155 0.856214406 -2.769883641 156 0.080799082 0.856214406 157 0.607387957 0.080799082 158 4.020096641 0.607387957 159 -2.881770852 4.020096641 160 -0.376675895 -2.881770852 161 0.239293641 -0.376675895 162 NA 0.239293641 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 2.55613813 -0.007710717 [2,] -2.47982943 2.556138131 [3,] -2.09548786 -2.479829427 [4,] 4.77516928 -2.095487863 [5,] 3.47532329 4.775169277 [6,] 3.40960286 3.475323294 [7,] -0.99255977 3.409602857 [8,] -0.20810573 -0.992559766 [9,] 0.72030600 -0.208105726 [10,] 1.45862376 0.720306000 [11,] 3.60685548 1.458623763 [12,] -3.36783656 3.606855483 [13,] 2.63415824 -3.367836560 [14,] 2.38352969 2.634158243 [15,] 0.86112919 2.383529693 [16,] 0.15518814 0.861129189 [17,] 1.35855059 0.155188144 [18,] -1.20667492 1.358550590 [19,] 2.48776033 -1.206674923 [20,] 2.04802239 2.487760328 [21,] -2.45182348 2.048022395 [22,] -0.21975008 -2.451823483 [23,] -1.34052894 -0.219750085 [24,] 1.51137852 -1.340528944 [25,] -7.10874180 1.511378519 [26,] 0.99977880 -7.108741799 [27,] 0.83382157 0.999778801 [28,] 1.14839775 0.833821573 [29,] -2.82249921 1.148397750 [30,] 0.41939645 -2.822499213 [31,] 0.69935427 0.419396453 [32,] 1.84164886 0.699354270 [33,] -0.16214136 1.841648860 [34,] -0.04093769 -0.162141363 [35,] 0.65464617 -0.040937687 [36,] -1.78062605 0.654646174 [37,] 0.60514025 -1.780626052 [38,] 1.94699737 0.605140252 [39,] -2.09773557 1.946997374 [40,] -0.70130160 -2.097735568 [41,] 2.28767156 -0.701301598 [42,] 0.34009323 2.287671562 [43,] -1.03846393 0.340093227 [44,] -2.77998731 -1.038463929 [45,] -2.85101158 -2.779987305 [46,] -0.37479481 -2.851011579 [47,] 0.20732962 -0.374794810 [48,] 3.50144877 0.207329618 [49,] -1.96722028 3.501448772 [50,] 0.94023365 -1.967220282 [51,] 0.62503934 0.940233651 [52,] -0.72136047 0.625039336 [53,] -1.39617621 -0.721360475 [54,] -2.10578485 -1.396176214 [55,] 0.40525087 -2.105784848 [56,] 1.65023357 0.405250869 [57,] -0.13196790 1.650233575 [58,] -3.26552174 -0.131967905 [59,] -1.32986734 -3.265521745 [60,] -2.60195222 -1.329867341 [61,] -1.75933576 -2.601952219 [62,] -3.58388815 -1.759335756 [63,] 1.13698368 -3.583888146 [64,] 1.49365301 1.136983682 [65,] -5.12594089 1.493653011 [66,] -1.61879700 -5.125940894 [67,] -2.37313778 -1.618796996 [68,] 1.17253248 -2.373137776 [69,] 1.34152341 1.172532484 [70,] 0.18109163 1.341523410 [71,] 3.43438743 0.181091628 [72,] 0.56158539 3.434387434 [73,] -0.31884050 0.561585389 [74,] -2.16214136 -0.318840501 [75,] -0.42287055 -2.162141363 [76,] 2.86277936 -0.422870548 [77,] 0.46482955 2.862779365 [78,] 1.17337685 0.464829547 [79,] -2.07719167 1.173376853 [80,] 0.03774802 -2.077191675 [81,] 1.85251653 0.037748020 [82,] -0.51996130 1.852516527 [83,] 1.45410774 -0.519961305 [84,] 0.70462275 1.454107744 [85,] -0.18021150 0.704622753 [86,] 0.75240921 -0.180211498 [87,] -0.29038227 0.752409207 [88,] 0.43259201 -0.290382274 [89,] -3.67868071 0.432592013 [90,] 3.21137274 -3.678680711 [91,] 0.08079908 3.211372743 [92,] 0.73206470 0.080799082 [93,] 0.47201203 0.732064696 [94,] -2.04354577 0.472012025 [95,] 0.74337111 -2.043545772 [96,] -1.02657091 0.743371109 [97,] -1.01877029 -1.026570906 [98,] 1.79988942 -1.018770289 [99,] -0.09506911 1.799889417 [100,] 1.55224025 -0.095069108 [101,] -1.15139289 1.552240251 [102,] 0.89970563 -1.151392890 [103,] -3.46795901 0.899705628 [104,] 1.83682174 -3.467959014 [105,] -2.91322804 1.836821743 [106,] 0.86729538 -2.913228045 [107,] 1.73557049 0.867295383 [108,] -2.87444130 1.735570492 [109,] 0.48554050 -2.874441305 [110,] 1.15516147 0.485540499 [111,] -2.27924172 1.155161473 [112,] -2.24399916 -2.279241716 [113,] 1.93457308 -2.243999156 [114,] 3.49477009 1.934573083 [115,] 0.19452797 3.494770094 [116,] 0.98684888 0.194527966 [117,] 0.08388430 0.986848884 [118,] -1.23554767 0.083884298 [119,] -0.08556297 -1.235547669 [120,] -0.60857676 -0.085562972 [121,] 0.29853255 -0.608576759 [122,] -0.35933762 0.298532547 [123,] -1.12352734 -0.359337616 [124,] 0.26974061 -1.123527335 [125,] -1.87452817 0.269740610 [126,] 0.39663153 -1.874528175 [127,] 1.30672022 0.396631526 [128,] 4.02009664 1.306720215 [129,] 1.06713063 4.020096641 [130,] -1.66874611 1.067130629 [131,] -1.83038064 -1.668746108 [132,] -0.56668905 -1.830380638 [133,] 2.35609381 -0.566689050 [134,] 0.46766186 2.356093812 [135,] 2.11219728 0.467661861 [136,] 1.48925071 2.112197281 [137,] 0.61737790 1.489250711 [138,] -1.02765708 0.617377903 [139,] 0.59714511 -1.027657080 [140,] -0.84458157 0.597145109 [141,] 0.50193258 -0.844581565 [142,] 2.13751009 0.501932583 [143,] -0.73404961 2.137510094 [144,] 0.54769756 -0.734049614 [145,] 0.68721742 0.547697562 [146,] 1.44552193 0.687217418 [147,] -2.64702493 1.445521930 [148,] -2.79356809 -2.647024932 [149,] -2.84994601 -2.793568093 [150,] 1.25957795 -2.849946013 [151,] -0.15336102 1.259577952 [152,] 0.52390060 -0.153361023 [153,] -2.47172257 0.523900598 [154,] -2.76988364 -2.471722567 [155,] 0.85621441 -2.769883641 [156,] 0.08079908 0.856214406 [157,] 0.60738796 0.080799082 [158,] 4.02009664 0.607387957 [159,] -2.88177085 4.020096641 [160,] -0.37667589 -2.881770852 [161,] 0.23929364 -0.376675895 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 2.55613813 -0.007710717 2 -2.47982943 2.556138131 3 -2.09548786 -2.479829427 4 4.77516928 -2.095487863 5 3.47532329 4.775169277 6 3.40960286 3.475323294 7 -0.99255977 3.409602857 8 -0.20810573 -0.992559766 9 0.72030600 -0.208105726 10 1.45862376 0.720306000 11 3.60685548 1.458623763 12 -3.36783656 3.606855483 13 2.63415824 -3.367836560 14 2.38352969 2.634158243 15 0.86112919 2.383529693 16 0.15518814 0.861129189 17 1.35855059 0.155188144 18 -1.20667492 1.358550590 19 2.48776033 -1.206674923 20 2.04802239 2.487760328 21 -2.45182348 2.048022395 22 -0.21975008 -2.451823483 23 -1.34052894 -0.219750085 24 1.51137852 -1.340528944 25 -7.10874180 1.511378519 26 0.99977880 -7.108741799 27 0.83382157 0.999778801 28 1.14839775 0.833821573 29 -2.82249921 1.148397750 30 0.41939645 -2.822499213 31 0.69935427 0.419396453 32 1.84164886 0.699354270 33 -0.16214136 1.841648860 34 -0.04093769 -0.162141363 35 0.65464617 -0.040937687 36 -1.78062605 0.654646174 37 0.60514025 -1.780626052 38 1.94699737 0.605140252 39 -2.09773557 1.946997374 40 -0.70130160 -2.097735568 41 2.28767156 -0.701301598 42 0.34009323 2.287671562 43 -1.03846393 0.340093227 44 -2.77998731 -1.038463929 45 -2.85101158 -2.779987305 46 -0.37479481 -2.851011579 47 0.20732962 -0.374794810 48 3.50144877 0.207329618 49 -1.96722028 3.501448772 50 0.94023365 -1.967220282 51 0.62503934 0.940233651 52 -0.72136047 0.625039336 53 -1.39617621 -0.721360475 54 -2.10578485 -1.396176214 55 0.40525087 -2.105784848 56 1.65023357 0.405250869 57 -0.13196790 1.650233575 58 -3.26552174 -0.131967905 59 -1.32986734 -3.265521745 60 -2.60195222 -1.329867341 61 -1.75933576 -2.601952219 62 -3.58388815 -1.759335756 63 1.13698368 -3.583888146 64 1.49365301 1.136983682 65 -5.12594089 1.493653011 66 -1.61879700 -5.125940894 67 -2.37313778 -1.618796996 68 1.17253248 -2.373137776 69 1.34152341 1.172532484 70 0.18109163 1.341523410 71 3.43438743 0.181091628 72 0.56158539 3.434387434 73 -0.31884050 0.561585389 74 -2.16214136 -0.318840501 75 -0.42287055 -2.162141363 76 2.86277936 -0.422870548 77 0.46482955 2.862779365 78 1.17337685 0.464829547 79 -2.07719167 1.173376853 80 0.03774802 -2.077191675 81 1.85251653 0.037748020 82 -0.51996130 1.852516527 83 1.45410774 -0.519961305 84 0.70462275 1.454107744 85 -0.18021150 0.704622753 86 0.75240921 -0.180211498 87 -0.29038227 0.752409207 88 0.43259201 -0.290382274 89 -3.67868071 0.432592013 90 3.21137274 -3.678680711 91 0.08079908 3.211372743 92 0.73206470 0.080799082 93 0.47201203 0.732064696 94 -2.04354577 0.472012025 95 0.74337111 -2.043545772 96 -1.02657091 0.743371109 97 -1.01877029 -1.026570906 98 1.79988942 -1.018770289 99 -0.09506911 1.799889417 100 1.55224025 -0.095069108 101 -1.15139289 1.552240251 102 0.89970563 -1.151392890 103 -3.46795901 0.899705628 104 1.83682174 -3.467959014 105 -2.91322804 1.836821743 106 0.86729538 -2.913228045 107 1.73557049 0.867295383 108 -2.87444130 1.735570492 109 0.48554050 -2.874441305 110 1.15516147 0.485540499 111 -2.27924172 1.155161473 112 -2.24399916 -2.279241716 113 1.93457308 -2.243999156 114 3.49477009 1.934573083 115 0.19452797 3.494770094 116 0.98684888 0.194527966 117 0.08388430 0.986848884 118 -1.23554767 0.083884298 119 -0.08556297 -1.235547669 120 -0.60857676 -0.085562972 121 0.29853255 -0.608576759 122 -0.35933762 0.298532547 123 -1.12352734 -0.359337616 124 0.26974061 -1.123527335 125 -1.87452817 0.269740610 126 0.39663153 -1.874528175 127 1.30672022 0.396631526 128 4.02009664 1.306720215 129 1.06713063 4.020096641 130 -1.66874611 1.067130629 131 -1.83038064 -1.668746108 132 -0.56668905 -1.830380638 133 2.35609381 -0.566689050 134 0.46766186 2.356093812 135 2.11219728 0.467661861 136 1.48925071 2.112197281 137 0.61737790 1.489250711 138 -1.02765708 0.617377903 139 0.59714511 -1.027657080 140 -0.84458157 0.597145109 141 0.50193258 -0.844581565 142 2.13751009 0.501932583 143 -0.73404961 2.137510094 144 0.54769756 -0.734049614 145 0.68721742 0.547697562 146 1.44552193 0.687217418 147 -2.64702493 1.445521930 148 -2.79356809 -2.647024932 149 -2.84994601 -2.793568093 150 1.25957795 -2.849946013 151 -0.15336102 1.259577952 152 0.52390060 -0.153361023 153 -2.47172257 0.523900598 154 -2.76988364 -2.471722567 155 0.85621441 -2.769883641 156 0.08079908 0.856214406 157 0.60738796 0.080799082 158 4.02009664 0.607387957 159 -2.88177085 4.020096641 160 -0.37667589 -2.881770852 161 0.23929364 -0.376675895 > 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/wessaorg/rcomp/tmp/7jifc1322149723.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/wessaorg/rcomp/tmp/8g3tb1322149723.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/wessaorg/rcomp/tmp/9jdxq1322149723.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/wessaorg/rcomp/tmp/10b4jz1322149723.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/1105vf1322149723.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/wessaorg/rcomp/tmp/12dgzm1322149723.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/wessaorg/rcomp/tmp/138dmm1322149723.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/wessaorg/rcomp/tmp/14abot1322149723.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/wessaorg/rcomp/tmp/15t3691322149723.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/wessaorg/rcomp/tmp/1670lq1322149723.tab") + } > > try(system("convert tmp/1vfjl1322149723.ps tmp/1vfjl1322149723.png",intern=TRUE)) character(0) > try(system("convert tmp/27y7s1322149723.ps tmp/27y7s1322149723.png",intern=TRUE)) character(0) > try(system("convert tmp/3nwmw1322149723.ps tmp/3nwmw1322149723.png",intern=TRUE)) character(0) > try(system("convert tmp/4e8kj1322149723.ps tmp/4e8kj1322149723.png",intern=TRUE)) character(0) > try(system("convert tmp/59rez1322149723.ps tmp/59rez1322149723.png",intern=TRUE)) character(0) > try(system("convert tmp/6ewp21322149723.ps tmp/6ewp21322149723.png",intern=TRUE)) character(0) > try(system("convert tmp/7jifc1322149723.ps tmp/7jifc1322149723.png",intern=TRUE)) character(0) > try(system("convert tmp/8g3tb1322149723.ps tmp/8g3tb1322149723.png",intern=TRUE)) character(0) > try(system("convert tmp/9jdxq1322149723.ps tmp/9jdxq1322149723.png",intern=TRUE)) character(0) > try(system("convert tmp/10b4jz1322149723.ps tmp/10b4jz1322149723.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.797 0.709 5.914