R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(24 + ,14 + ,11 + ,12 + ,24 + ,26 + ,25 + ,11 + ,7 + ,8 + ,25 + ,23 + ,17 + ,6 + ,17 + ,8 + ,30 + ,25 + ,18 + ,12 + ,10 + ,8 + ,19 + ,23 + ,18 + ,8 + ,12 + ,9 + ,22 + ,19 + ,16 + ,10 + ,12 + ,7 + ,22 + ,29 + ,20 + ,10 + ,11 + ,4 + ,25 + ,25 + ,16 + ,11 + ,11 + ,11 + ,23 + ,21 + ,18 + ,16 + ,12 + ,7 + ,17 + ,22 + ,17 + ,11 + ,13 + ,7 + ,21 + ,25 + ,23 + ,13 + ,14 + ,12 + ,19 + ,24 + ,30 + ,12 + ,16 + ,10 + ,19 + ,18 + ,23 + ,8 + ,11 + ,10 + ,15 + ,22 + ,18 + ,12 + ,10 + ,8 + ,16 + ,15 + ,15 + ,11 + ,11 + ,8 + ,23 + ,22 + ,12 + ,4 + ,15 + ,4 + ,27 + ,28 + ,21 + ,9 + ,9 + ,9 + ,22 + ,20 + ,15 + ,8 + ,11 + ,8 + ,14 + ,12 + ,20 + ,8 + ,17 + ,7 + ,22 + ,24 + ,31 + ,14 + ,17 + ,11 + ,23 + ,20 + ,27 + ,15 + ,11 + ,9 + ,23 + ,21 + ,34 + ,16 + ,18 + ,11 + ,21 + ,20 + ,21 + ,9 + ,14 + ,13 + ,19 + ,21 + ,31 + ,14 + ,10 + ,8 + ,18 + ,23 + ,19 + ,11 + ,11 + ,8 + ,20 + ,28 + ,16 + ,8 + ,15 + ,9 + ,23 + ,24 + ,20 + ,9 + ,15 + ,6 + ,25 + ,24 + ,21 + ,9 + ,13 + ,9 + ,19 + ,24 + ,22 + ,9 + ,16 + ,9 + ,24 + ,23 + ,17 + ,9 + ,13 + ,6 + ,22 + ,23 + ,24 + ,10 + ,9 + ,6 + ,25 + ,29 + ,25 + ,16 + ,18 + ,16 + ,26 + ,24 + ,26 + ,11 + ,18 + ,5 + ,29 + ,18 + ,25 + ,8 + ,12 + ,7 + ,32 + ,25 + ,17 + ,9 + ,17 + ,9 + ,25 + ,21 + ,32 + ,16 + ,9 + ,6 + ,29 + ,26 + ,33 + ,11 + ,9 + ,6 + ,28 + ,22 + ,13 + ,16 + ,12 + ,5 + ,17 + ,22 + ,32 + ,12 + ,18 + ,12 + ,28 + ,22 + ,25 + ,12 + ,12 + ,7 + ,29 + ,23 + ,29 + ,14 + ,18 + ,10 + ,26 + ,30 + ,22 + ,9 + ,14 + ,9 + ,25 + ,23 + ,18 + ,10 + ,15 + ,8 + ,14 + ,17 + ,17 + ,9 + ,16 + ,5 + ,25 + ,23 + ,20 + ,10 + ,10 + ,8 + ,26 + ,23 + ,15 + ,12 + ,11 + ,8 + ,20 + ,25 + ,20 + ,14 + ,14 + ,10 + ,18 + ,24 + ,33 + ,14 + ,9 + ,6 + ,32 + ,24 + ,29 + ,10 + ,12 + ,8 + ,25 + ,23 + ,23 + ,14 + ,17 + ,7 + ,25 + ,21 + ,26 + ,16 + ,5 + ,4 + ,23 + ,24 + ,18 + ,9 + ,12 + ,8 + ,21 + ,24 + ,20 + ,10 + ,12 + ,8 + ,20 + ,28 + ,11 + ,6 + ,6 + ,4 + ,15 + ,16 + ,28 + ,8 + ,24 + ,20 + ,30 + ,20 + ,26 + ,13 + ,12 + ,8 + ,24 + ,29 + ,22 + ,10 + ,12 + ,8 + ,26 + ,27 + ,17 + ,8 + ,14 + ,6 + ,24 + ,22 + ,12 + ,7 + ,7 + ,4 + ,22 + ,28 + ,14 + ,15 + ,13 + ,8 + ,14 + ,16 + ,17 + ,9 + ,12 + ,9 + ,24 + ,25 + ,21 + ,10 + ,13 + ,6 + ,24 + ,24 + ,19 + ,12 + ,14 + ,7 + ,24 + ,28 + ,18 + ,13 + ,8 + ,9 + ,24 + ,24 + ,10 + ,10 + ,11 + ,5 + ,19 + ,23 + ,29 + ,11 + ,9 + ,5 + ,31 + ,30 + ,31 + ,8 + ,11 + ,8 + ,22 + ,24 + ,19 + ,9 + ,13 + ,8 + ,27 + ,21 + ,9 + ,13 + ,10 + ,6 + ,19 + ,25 + ,20 + ,11 + ,11 + ,8 + ,25 + ,25 + ,28 + ,8 + ,12 + ,7 + ,20 + ,22 + ,19 + ,9 + ,9 + ,7 + ,21 + ,23 + ,30 + ,9 + ,15 + ,9 + ,27 + ,26 + ,29 + ,15 + ,18 + ,11 + ,23 + ,23 + ,26 + ,9 + ,15 + ,6 + ,25 + ,25 + ,23 + ,10 + ,12 + ,8 + ,20 + ,21 + ,13 + ,14 + ,13 + ,6 + ,21 + ,25 + ,21 + ,12 + ,14 + ,9 + ,22 + ,24 + ,19 + ,12 + ,10 + ,8 + ,23 + ,29 + ,28 + ,11 + ,13 + ,6 + ,25 + ,22 + ,23 + ,14 + ,13 + ,10 + ,25 + ,27 + ,18 + ,6 + ,11 + ,8 + ,17 + ,26 + ,21 + ,12 + ,13 + ,8 + ,19 + ,22 + ,20 + ,8 + ,16 + ,10 + ,25 + ,24 + ,23 + ,14 + ,8 + ,5 + ,19 + ,27 + ,21 + ,11 + ,16 + ,7 + ,20 + ,24 + ,21 + ,10 + ,11 + ,5 + ,26 + ,24 + ,15 + ,14 + ,9 + ,8 + ,23 + ,29 + ,28 + ,12 + ,16 + ,14 + ,27 + ,22 + ,19 + ,10 + ,12 + ,7 + ,17 + ,21 + ,26 + ,14 + ,14 + ,8 + ,17 + ,24 + ,10 + ,5 + ,8 + ,6 + ,19 + ,24 + ,16 + ,11 + ,9 + ,5 + ,17 + ,23 + ,22 + ,10 + ,15 + ,6 + ,22 + ,20 + ,19 + ,9 + ,11 + ,10 + ,21 + ,27 + ,31 + ,10 + ,21 + ,12 + ,32 + ,26 + ,31 + ,16 + ,14 + ,9 + ,21 + ,25 + ,29 + ,13 + ,18 + ,12 + ,21 + ,21 + ,19 + ,9 + ,12 + ,7 + ,18 + ,21 + ,22 + ,10 + ,13 + ,8 + ,18 + ,19 + ,23 + ,10 + ,15 + ,10 + ,23 + ,21 + ,15 + ,7 + ,12 + ,6 + ,19 + ,21 + ,20 + ,9 + ,19 + ,10 + ,20 + ,16 + ,18 + ,8 + ,15 + ,10 + ,21 + ,22 + ,23 + ,14 + ,11 + ,10 + ,20 + ,29 + ,25 + ,14 + ,11 + ,5 + ,17 + ,15 + ,21 + ,8 + ,10 + ,7 + ,18 + ,17 + ,24 + ,9 + ,13 + ,10 + ,19 + ,15 + ,25 + ,14 + ,15 + ,11 + ,22 + ,21 + ,17 + ,14 + ,12 + ,6 + ,15 + ,21 + ,13 + ,8 + ,12 + ,7 + ,14 + ,19 + ,28 + ,8 + ,16 + ,12 + ,18 + ,24 + ,21 + ,8 + ,9 + ,11 + ,24 + ,20 + ,25 + ,7 + ,18 + ,11 + ,35 + ,17 + ,9 + ,6 + ,8 + ,11 + ,29 + ,23 + ,16 + ,8 + ,13 + ,5 + ,21 + ,24 + ,19 + ,6 + ,17 + ,8 + ,25 + ,14 + ,17 + ,11 + ,9 + ,6 + ,20 + ,19 + ,25 + ,14 + ,15 + ,9 + ,22 + ,24 + ,20 + ,11 + ,8 + ,4 + ,13 + ,13 + ,29 + ,11 + ,7 + ,4 + ,26 + ,22 + ,14 + ,11 + ,12 + ,7 + ,17 + ,16 + ,22 + ,14 + ,14 + ,11 + ,25 + ,19 + ,15 + ,8 + ,6 + ,6 + ,20 + ,25 + ,19 + ,20 + ,8 + ,7 + ,19 + ,25 + ,20 + ,11 + ,17 + ,8 + ,21 + ,23 + ,15 + ,8 + ,10 + ,4 + ,22 + ,24 + ,20 + ,11 + ,11 + ,8 + ,24 + ,26 + ,18 + ,10 + ,14 + ,9 + ,21 + ,26 + ,33 + ,14 + ,11 + ,8 + ,26 + ,25 + ,22 + ,11 + ,13 + ,11 + ,24 + ,18 + ,16 + ,9 + ,12 + ,8 + ,16 + ,21 + ,17 + ,9 + ,11 + ,5 + ,23 + ,26 + ,16 + ,8 + ,9 + ,4 + ,18 + ,23 + ,21 + ,10 + ,12 + ,8 + ,16 + ,23 + ,26 + ,13 + ,20 + ,10 + ,26 + ,22 + ,18 + ,13 + ,12 + ,6 + ,19 + ,20 + ,18 + ,12 + ,13 + ,9 + ,21 + ,13 + ,17 + ,8 + ,12 + ,9 + ,21 + ,24 + ,22 + ,13 + ,12 + ,13 + ,22 + ,15 + ,30 + ,14 + ,9 + ,9 + ,23 + ,14 + ,30 + ,12 + ,15 + ,10 + ,29 + ,22 + ,24 + ,14 + ,24 + ,20 + ,21 + ,10 + ,21 + ,15 + ,7 + ,5 + ,21 + ,24 + ,21 + ,13 + ,17 + ,11 + ,23 + ,22 + ,29 + ,16 + ,11 + ,6 + ,27 + ,24 + ,31 + ,9 + ,17 + ,9 + ,25 + ,19 + ,20 + ,9 + ,11 + ,7 + ,21 + ,20 + ,16 + ,9 + ,12 + ,9 + ,10 + ,13 + ,22 + ,8 + ,14 + ,10 + ,20 + ,20 + ,20 + ,7 + ,11 + ,9 + ,26 + ,22 + ,28 + ,16 + ,16 + ,8 + ,24 + ,24 + ,38 + ,11 + ,21 + ,7 + ,29 + ,29 + ,22 + ,9 + ,14 + ,6 + ,19 + ,12 + ,20 + ,11 + ,20 + ,13 + ,24 + ,20 + ,17 + ,9 + ,13 + ,6 + ,19 + ,21 + ,28 + ,14 + ,11 + ,8 + ,24 + ,24 + ,22 + ,13 + ,15 + ,10 + ,22 + ,22 + ,31 + ,16 + ,19 + ,16 + ,17 + ,20) + ,dim=c(6 + ,159) + ,dimnames=list(c('YT' + ,'X1' + ,'X2' + ,'X3' + ,'X4' + ,'X5 ') + ,1:159)) > y <- array(NA,dim=c(6,159),dimnames=list(c('YT','X1','X2','X3','X4','X5 '),1:159)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '2' > #'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 X1 YT X2 X3 X4 X5\r t 1 14 24 11 12 24 26 1 2 11 25 7 8 25 23 2 3 6 17 17 8 30 25 3 4 12 18 10 8 19 23 4 5 8 18 12 9 22 19 5 6 10 16 12 7 22 29 6 7 10 20 11 4 25 25 7 8 11 16 11 11 23 21 8 9 16 18 12 7 17 22 9 10 11 17 13 7 21 25 10 11 13 23 14 12 19 24 11 12 12 30 16 10 19 18 12 13 8 23 11 10 15 22 13 14 12 18 10 8 16 15 14 15 11 15 11 8 23 22 15 16 4 12 15 4 27 28 16 17 9 21 9 9 22 20 17 18 8 15 11 8 14 12 18 19 8 20 17 7 22 24 19 20 14 31 17 11 23 20 20 21 15 27 11 9 23 21 21 22 16 34 18 11 21 20 22 23 9 21 14 13 19 21 23 24 14 31 10 8 18 23 24 25 11 19 11 8 20 28 25 26 8 16 15 9 23 24 26 27 9 20 15 6 25 24 27 28 9 21 13 9 19 24 28 29 9 22 16 9 24 23 29 30 9 17 13 6 22 23 30 31 10 24 9 6 25 29 31 32 16 25 18 16 26 24 32 33 11 26 18 5 29 18 33 34 8 25 12 7 32 25 34 35 9 17 17 9 25 21 35 36 16 32 9 6 29 26 36 37 11 33 9 6 28 22 37 38 16 13 12 5 17 22 38 39 12 32 18 12 28 22 39 40 12 25 12 7 29 23 40 41 14 29 18 10 26 30 41 42 9 22 14 9 25 23 42 43 10 18 15 8 14 17 43 44 9 17 16 5 25 23 44 45 10 20 10 8 26 23 45 46 12 15 11 8 20 25 46 47 14 20 14 10 18 24 47 48 14 33 9 6 32 24 48 49 10 29 12 8 25 23 49 50 14 23 17 7 25 21 50 51 16 26 5 4 23 24 51 52 9 18 12 8 21 24 52 53 10 20 12 8 20 28 53 54 6 11 6 4 15 16 54 55 8 28 24 20 30 20 55 56 13 26 12 8 24 29 56 57 10 22 12 8 26 27 57 58 8 17 14 6 24 22 58 59 7 12 7 4 22 28 59 60 15 14 13 8 14 16 60 61 9 17 12 9 24 25 61 62 10 21 13 6 24 24 62 63 12 19 14 7 24 28 63 64 13 18 8 9 24 24 64 65 10 10 11 5 19 23 65 66 11 29 9 5 31 30 66 67 8 31 11 8 22 24 67 68 9 19 13 8 27 21 68 69 13 9 10 6 19 25 69 70 11 20 11 8 25 25 70 71 8 28 12 7 20 22 71 72 9 19 9 7 21 23 72 73 9 30 15 9 27 26 73 74 15 29 18 11 23 23 74 75 9 26 15 6 25 25 75 76 10 23 12 8 20 21 76 77 14 13 13 6 21 25 77 78 12 21 14 9 22 24 78 79 12 19 10 8 23 29 79 80 11 28 13 6 25 22 80 81 14 23 13 10 25 27 81 82 6 18 11 8 17 26 82 83 12 21 13 8 19 22 83 84 8 20 16 10 25 24 84 85 14 23 8 5 19 27 85 86 11 21 16 7 20 24 86 87 10 21 11 5 26 24 87 88 14 15 9 8 23 29 88 89 12 28 16 14 27 22 89 90 10 19 12 7 17 21 90 91 14 26 14 8 17 24 91 92 5 10 8 6 19 24 92 93 11 16 9 5 17 23 93 94 10 22 15 6 22 20 94 95 9 19 11 10 21 27 95 96 10 31 21 12 32 26 96 97 16 31 14 9 21 25 97 98 13 29 18 12 21 21 98 99 9 19 12 7 18 21 99 100 10 22 13 8 18 19 100 101 10 23 15 10 23 21 101 102 7 15 12 6 19 21 102 103 9 20 19 10 20 16 103 104 8 18 15 10 21 22 104 105 14 23 11 10 20 29 105 106 14 25 11 5 17 15 106 107 8 21 10 7 18 17 107 108 9 24 13 10 19 15 108 109 14 25 15 11 22 21 109 110 14 17 12 6 15 21 110 111 8 13 12 7 14 19 111 112 8 28 16 12 18 24 112 113 8 21 9 11 24 20 113 114 7 25 18 11 35 17 114 115 6 9 8 11 29 23 115 116 8 16 13 5 21 24 116 117 6 19 17 8 25 14 117 118 11 17 9 6 20 19 118 119 14 25 15 9 22 24 119 120 11 20 8 4 13 13 120 121 11 29 7 4 26 22 121 122 11 14 12 7 17 16 122 123 14 22 14 11 25 19 123 124 8 15 6 6 20 25 124 125 20 19 8 7 19 25 125 126 11 20 17 8 21 23 126 127 8 15 10 4 22 24 127 128 11 20 11 8 24 26 128 129 10 18 14 9 21 26 129 130 14 33 11 8 26 25 130 131 11 22 13 11 24 18 131 132 9 16 12 8 16 21 132 133 9 17 11 5 23 26 133 134 8 16 9 4 18 23 134 135 10 21 12 8 16 23 135 136 13 26 20 10 26 22 136 137 13 18 12 6 19 20 137 138 12 18 13 9 21 13 138 139 8 17 12 9 21 24 139 140 13 22 12 13 22 15 140 141 14 30 9 9 23 14 141 142 12 30 15 10 29 22 142 143 14 24 24 20 21 10 143 144 15 21 7 5 21 24 144 145 13 21 17 11 23 22 145 146 16 29 11 6 27 24 146 147 9 31 17 9 25 19 147 148 9 20 11 7 21 20 148 149 9 16 12 9 10 13 149 150 8 22 14 10 20 20 150 151 7 20 11 9 26 22 151 152 16 28 16 8 24 24 152 153 11 38 21 7 29 29 153 154 9 22 14 6 19 12 154 155 11 20 20 13 24 20 155 156 9 17 13 6 19 21 156 157 14 28 11 8 24 24 157 158 13 22 15 10 22 22 158 159 16 31 19 16 17 20 159 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) YT X2 X3 X4 `X5\r` 7.284567 0.247876 -0.106836 0.148172 -0.191083 0.113320 t 0.001416 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5.7326 -1.7386 -0.2116 1.6972 8.4438 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 7.284567 1.697185 4.292 3.14e-05 *** YT 0.247876 0.040274 6.155 6.39e-09 *** X2 -0.106836 0.074214 -1.440 0.15204 X3 0.148172 0.093171 1.590 0.11384 X4 -0.191083 0.057040 -3.350 0.00102 ** `X5\r` 0.113320 0.057918 1.957 0.05223 . t 0.001416 0.004447 0.318 0.75062 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.489 on 152 degrees of freedom Multiple R-squared: 0.2401, Adjusted R-squared: 0.2101 F-statistic: 8.002 on 6 and 152 DF, p-value: 1.634e-07 > 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.3474228 0.6948456 0.6525772 [2,] 0.4650419 0.9300837 0.5349581 [3,] 0.3464959 0.6929918 0.6535041 [4,] 0.8247635 0.3504730 0.1752365 [5,] 0.7633543 0.4732915 0.2366457 [6,] 0.7187443 0.5625114 0.2812557 [7,] 0.7081502 0.5836995 0.2918498 [8,] 0.6275973 0.7448054 0.3724027 [9,] 0.6076290 0.7847420 0.3923710 [10,] 0.5276542 0.9446916 0.4723458 [11,] 0.6031666 0.7936667 0.3968334 [12,] 0.6454199 0.7091601 0.3545801 [13,] 0.6159398 0.7681205 0.3840602 [14,] 0.6022763 0.7954474 0.3977237 [15,] 0.5393113 0.9213773 0.4606887 [16,] 0.4692161 0.9384322 0.5307839 [17,] 0.4015275 0.8030550 0.5984725 [18,] 0.3372684 0.6745369 0.6627316 [19,] 0.3072441 0.6144882 0.6927559 [20,] 0.2531294 0.5062588 0.7468706 [21,] 0.2087548 0.4175095 0.7912452 [22,] 0.1724851 0.3449702 0.8275149 [23,] 0.2836470 0.5672939 0.7163530 [24,] 0.2609655 0.5219311 0.7390345 [25,] 0.2458753 0.4917506 0.7541247 [26,] 0.2037825 0.4075651 0.7962175 [27,] 0.2367413 0.4734825 0.7632587 [28,] 0.2268650 0.4537300 0.7731350 [29,] 0.6224550 0.7550900 0.3775450 [30,] 0.5725859 0.8548282 0.4274141 [31,] 0.5327906 0.9344189 0.4672094 [32,] 0.4884043 0.9768087 0.5115957 [33,] 0.4643532 0.9287063 0.5356468 [34,] 0.4219509 0.8439018 0.5780491 [35,] 0.3706773 0.7413545 0.6293227 [36,] 0.3211738 0.6423476 0.6788262 [37,] 0.2937007 0.5874014 0.7062993 [38,] 0.2747359 0.5494718 0.7252641 [39,] 0.2487038 0.4974077 0.7512962 [40,] 0.2624001 0.5248002 0.7375999 [41,] 0.3180589 0.6361179 0.6819411 [42,] 0.3542763 0.7085526 0.6457237 [43,] 0.3434501 0.6869002 0.6565499 [44,] 0.3295784 0.6591568 0.6704216 [45,] 0.3571970 0.7143940 0.6428030 [46,] 0.3772813 0.7545626 0.6227187 [47,] 0.3330958 0.6661916 0.6669042 [48,] 0.2938367 0.5876734 0.7061633 [49,] 0.2567729 0.5135459 0.7432271 [50,] 0.2415007 0.4830015 0.7584993 [51,] 0.3896325 0.7792650 0.6103675 [52,] 0.3463802 0.6927603 0.6536198 [53,] 0.3045151 0.6090303 0.6954849 [54,] 0.2837138 0.5674276 0.7162862 [55,] 0.2933225 0.5866450 0.7066775 [56,] 0.2686565 0.5373131 0.7313435 [57,] 0.2373163 0.4746326 0.7626837 [58,] 0.4206837 0.8413675 0.5793163 [59,] 0.3752325 0.7504649 0.6247675 [60,] 0.4729918 0.9459836 0.5270082 [61,] 0.4309976 0.8619952 0.5690024 [62,] 0.5496010 0.9007980 0.4503990 [63,] 0.5225497 0.9549005 0.4774503 [64,] 0.5460923 0.9078155 0.4539077 [65,] 0.5544398 0.8911203 0.4455602 [66,] 0.5360622 0.9278756 0.4639378 [67,] 0.5029308 0.9941385 0.4970692 [68,] 0.6671006 0.6657989 0.3328994 [69,] 0.6361210 0.7277580 0.3638790 [70,] 0.6000958 0.7998085 0.3999042 [71,] 0.5547954 0.8904092 0.4452046 [72,] 0.5647033 0.8705934 0.4352967 [73,] 0.7194968 0.5610064 0.2805032 [74,] 0.6859938 0.6280123 0.3140062 [75,] 0.6630913 0.6738174 0.3369087 [76,] 0.6402618 0.7194765 0.3597382 [77,] 0.5997696 0.8004609 0.4002304 [78,] 0.5567924 0.8864152 0.4432076 [79,] 0.6439900 0.7120200 0.3560100 [80,] 0.5993238 0.8013524 0.4006762 [81,] 0.5573479 0.8853041 0.4426521 [82,] 0.5240917 0.9518166 0.4759083 [83,] 0.5686906 0.8626188 0.4313094 [84,] 0.5317954 0.9364093 0.4682046 [85,] 0.4877584 0.9755169 0.5122416 [86,] 0.4704154 0.9408309 0.5295846 [87,] 0.4289976 0.8579952 0.5710024 [88,] 0.4291753 0.8583505 0.5708247 [89,] 0.3849513 0.7699026 0.6150487 [90,] 0.3514278 0.7028555 0.6485722 [91,] 0.3125972 0.6251945 0.6874028 [92,] 0.2719548 0.5439096 0.7280452 [93,] 0.2538156 0.5076313 0.7461844 [94,] 0.2162299 0.4324599 0.7837701 [95,] 0.1967947 0.3935894 0.8032053 [96,] 0.1727959 0.3455918 0.8272041 [97,] 0.1806144 0.3612288 0.8193856 [98,] 0.1811123 0.3622246 0.8188877 [99,] 0.1740473 0.3480946 0.8259527 [100,] 0.1712347 0.3424695 0.8287653 [101,] 0.2166968 0.4333937 0.7833032 [102,] 0.1878011 0.3756021 0.8121989 [103,] 0.3729959 0.7459919 0.6270041 [104,] 0.4352384 0.8704768 0.5647616 [105,] 0.4042445 0.8084889 0.5957555 [106,] 0.3984470 0.7968939 0.6015530 [107,] 0.3576691 0.7153382 0.6423309 [108,] 0.3609397 0.7218793 0.6390603 [109,] 0.3182321 0.6364641 0.6817679 [110,] 0.2889469 0.5778937 0.7110531 [111,] 0.2434425 0.4868850 0.7565575 [112,] 0.2293675 0.4587350 0.7706325 [113,] 0.2060183 0.4120366 0.7939817 [114,] 0.2105543 0.4211085 0.7894457 [115,] 0.2280426 0.4560851 0.7719574 [116,] 0.7593834 0.4812332 0.2406166 [117,] 0.7197675 0.5604650 0.2802325 [118,] 0.6678588 0.6642825 0.3321412 [119,] 0.6079095 0.7841810 0.3920905 [120,] 0.5453568 0.9092864 0.4546432 [121,] 0.4827112 0.9654223 0.5172888 [122,] 0.4274796 0.8549592 0.5725204 [123,] 0.3745502 0.7491005 0.6254498 [124,] 0.3149158 0.6298317 0.6850842 [125,] 0.2832496 0.5664991 0.7167504 [126,] 0.2857470 0.5714940 0.7142530 [127,] 0.2413916 0.4827833 0.7586084 [128,] 0.2502191 0.5004382 0.7497809 [129,] 0.2575096 0.5150193 0.7424904 [130,] 0.2874911 0.5749821 0.7125089 [131,] 0.2271001 0.4542002 0.7728999 [132,] 0.1730739 0.3461479 0.8269261 [133,] 0.1318546 0.2637093 0.8681454 [134,] 0.1370435 0.2740870 0.8629565 [135,] 0.1275009 0.2550019 0.8724991 [136,] 0.1441704 0.2883409 0.8558296 [137,] 0.4157265 0.8314529 0.5842735 [138,] 0.3052196 0.6104392 0.6947804 [139,] 0.2117381 0.4234762 0.7882619 [140,] 0.1234477 0.2468954 0.8765523 > postscript(file="/var/www/html/rcomp/tmp/1b6in1290372194.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/23fzq1290372194.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/33fzq1290372194.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/43fzq1290372194.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5wozt1290372194.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 159 Frequency = 1 1 2 3 4 5 6 1.80180144 -0.75110417 -1.97236889 1.15520717 -1.75417943 -0.09669580 7 8 9 10 11 12 0.27459259 1.29858793 5.24112503 1.01879574 0.62724915 -0.91936543 13 14 15 16 17 18 -4.93744104 1.47435490 1.86774927 -3.28558824 -1.94862979 -1.72305123 19 20 21 22 23 24 -2.00582933 1.31778767 2.84988407 2.29599612 -2.70220367 -0.28658977 25 26 27 28 29 30 -0.39108531 -1.34317018 -0.50940792 -2.56339012 -1.42343705 -0.44362988 31 32 33 34 35 36 -1.71419437 4.27399882 1.90777101 -2.00311970 0.33200773 3.40000723 37 38 39 40 41 42 -1.58708942 6.73578630 -0.26955236 1.64177354 1.47886444 -1.46443491 43 44 45 46 47 48 -0.64133500 0.57847688 -0.06101990 1.91064255 2.42516203 1.93502794 49 50 51 52 53 54 -2.27498205 4.11985361 3.81516364 -1.43024335 -1.57177457 -2.98621129 55 56 57 58 59 60 -3.23625825 0.58773273 -0.81337161 -0.88095630 -2.15658543 5.22574485 61 62 63 64 65 66 -0.88335346 -0.21160180 1.78811975 2.55049653 1.60319281 -0.82178504 67 68 69 70 71 72 -5.58962970 -0.10748067 4.36375677 0.59269243 -4.75218325 -1.76545742 73 74 75 76 77 78 -3.34229947 2.50395104 -2.17795596 -1.55473423 5.06359864 1.04589407 79 80 81 82 83 84 0.88554228 -0.55450222 2.52417525 -5.57053392 0.73353939 -2.07597549 85 86 87 88 89 90 1.57869115 0.16241638 0.06966352 3.75746702 -0.04994978 -1.00813107 91 92 93 94 95 96 0.98085930 -4.01704146 0.48044607 -0.22000650 -2.48214994 -1.47082722 97 98 99 100 101 102 2.23582249 0.16626650 -1.82979212 -1.38953373 -0.99272101 -2.50327909 103 104 105 106 107 108 -0.83122988 -2.25307380 1.09446127 2.35138109 -3.09726673 -2.54859706 109 110 111 112 113 114 2.16094221 3.22530644 -1.89722030 -5.73256376 -2.99874797 -1.58826641 115 116 117 118 119 120 -1.51844261 -1.47376402 -2.33844977 1.07552542 2.10316716 -0.13909215 121 122 123 124 125 126 -1.01402625 1.75253623 3.57779997 -2.43764574 8.44384971 0.61671810 127 128 129 130 131 132 -1.22271740 0.20615879 -0.70041796 0.47642045 0.38187173 -1.66323151 133 134 135 136 137 138 -0.80385862 -2.23835601 -2.13350101 2.20820026 2.81685007 2.65315842 139 140 141 142 143 144 -2.45373512 1.92373894 1.51589556 0.24726698 3.04408301 3.60618701 145 146 147 148 149 150 2.39290632 4.04601704 -3.07021867 -1.56732111 -2.07541848 -3.38099737 151 152 153 154 155 156 -3.13913676 3.94998401 -2.45902384 -1.07849727 1.06850941 -0.96866184 157 158 159 1.40872218 1.87003775 1.44726842 > postscript(file="/var/www/html/rcomp/tmp/6wozt1290372194.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 159 Frequency = 1 lag(myerror, k = 1) myerror 0 1.80180144 NA 1 -0.75110417 1.80180144 2 -1.97236889 -0.75110417 3 1.15520717 -1.97236889 4 -1.75417943 1.15520717 5 -0.09669580 -1.75417943 6 0.27459259 -0.09669580 7 1.29858793 0.27459259 8 5.24112503 1.29858793 9 1.01879574 5.24112503 10 0.62724915 1.01879574 11 -0.91936543 0.62724915 12 -4.93744104 -0.91936543 13 1.47435490 -4.93744104 14 1.86774927 1.47435490 15 -3.28558824 1.86774927 16 -1.94862979 -3.28558824 17 -1.72305123 -1.94862979 18 -2.00582933 -1.72305123 19 1.31778767 -2.00582933 20 2.84988407 1.31778767 21 2.29599612 2.84988407 22 -2.70220367 2.29599612 23 -0.28658977 -2.70220367 24 -0.39108531 -0.28658977 25 -1.34317018 -0.39108531 26 -0.50940792 -1.34317018 27 -2.56339012 -0.50940792 28 -1.42343705 -2.56339012 29 -0.44362988 -1.42343705 30 -1.71419437 -0.44362988 31 4.27399882 -1.71419437 32 1.90777101 4.27399882 33 -2.00311970 1.90777101 34 0.33200773 -2.00311970 35 3.40000723 0.33200773 36 -1.58708942 3.40000723 37 6.73578630 -1.58708942 38 -0.26955236 6.73578630 39 1.64177354 -0.26955236 40 1.47886444 1.64177354 41 -1.46443491 1.47886444 42 -0.64133500 -1.46443491 43 0.57847688 -0.64133500 44 -0.06101990 0.57847688 45 1.91064255 -0.06101990 46 2.42516203 1.91064255 47 1.93502794 2.42516203 48 -2.27498205 1.93502794 49 4.11985361 -2.27498205 50 3.81516364 4.11985361 51 -1.43024335 3.81516364 52 -1.57177457 -1.43024335 53 -2.98621129 -1.57177457 54 -3.23625825 -2.98621129 55 0.58773273 -3.23625825 56 -0.81337161 0.58773273 57 -0.88095630 -0.81337161 58 -2.15658543 -0.88095630 59 5.22574485 -2.15658543 60 -0.88335346 5.22574485 61 -0.21160180 -0.88335346 62 1.78811975 -0.21160180 63 2.55049653 1.78811975 64 1.60319281 2.55049653 65 -0.82178504 1.60319281 66 -5.58962970 -0.82178504 67 -0.10748067 -5.58962970 68 4.36375677 -0.10748067 69 0.59269243 4.36375677 70 -4.75218325 0.59269243 71 -1.76545742 -4.75218325 72 -3.34229947 -1.76545742 73 2.50395104 -3.34229947 74 -2.17795596 2.50395104 75 -1.55473423 -2.17795596 76 5.06359864 -1.55473423 77 1.04589407 5.06359864 78 0.88554228 1.04589407 79 -0.55450222 0.88554228 80 2.52417525 -0.55450222 81 -5.57053392 2.52417525 82 0.73353939 -5.57053392 83 -2.07597549 0.73353939 84 1.57869115 -2.07597549 85 0.16241638 1.57869115 86 0.06966352 0.16241638 87 3.75746702 0.06966352 88 -0.04994978 3.75746702 89 -1.00813107 -0.04994978 90 0.98085930 -1.00813107 91 -4.01704146 0.98085930 92 0.48044607 -4.01704146 93 -0.22000650 0.48044607 94 -2.48214994 -0.22000650 95 -1.47082722 -2.48214994 96 2.23582249 -1.47082722 97 0.16626650 2.23582249 98 -1.82979212 0.16626650 99 -1.38953373 -1.82979212 100 -0.99272101 -1.38953373 101 -2.50327909 -0.99272101 102 -0.83122988 -2.50327909 103 -2.25307380 -0.83122988 104 1.09446127 -2.25307380 105 2.35138109 1.09446127 106 -3.09726673 2.35138109 107 -2.54859706 -3.09726673 108 2.16094221 -2.54859706 109 3.22530644 2.16094221 110 -1.89722030 3.22530644 111 -5.73256376 -1.89722030 112 -2.99874797 -5.73256376 113 -1.58826641 -2.99874797 114 -1.51844261 -1.58826641 115 -1.47376402 -1.51844261 116 -2.33844977 -1.47376402 117 1.07552542 -2.33844977 118 2.10316716 1.07552542 119 -0.13909215 2.10316716 120 -1.01402625 -0.13909215 121 1.75253623 -1.01402625 122 3.57779997 1.75253623 123 -2.43764574 3.57779997 124 8.44384971 -2.43764574 125 0.61671810 8.44384971 126 -1.22271740 0.61671810 127 0.20615879 -1.22271740 128 -0.70041796 0.20615879 129 0.47642045 -0.70041796 130 0.38187173 0.47642045 131 -1.66323151 0.38187173 132 -0.80385862 -1.66323151 133 -2.23835601 -0.80385862 134 -2.13350101 -2.23835601 135 2.20820026 -2.13350101 136 2.81685007 2.20820026 137 2.65315842 2.81685007 138 -2.45373512 2.65315842 139 1.92373894 -2.45373512 140 1.51589556 1.92373894 141 0.24726698 1.51589556 142 3.04408301 0.24726698 143 3.60618701 3.04408301 144 2.39290632 3.60618701 145 4.04601704 2.39290632 146 -3.07021867 4.04601704 147 -1.56732111 -3.07021867 148 -2.07541848 -1.56732111 149 -3.38099737 -2.07541848 150 -3.13913676 -3.38099737 151 3.94998401 -3.13913676 152 -2.45902384 3.94998401 153 -1.07849727 -2.45902384 154 1.06850941 -1.07849727 155 -0.96866184 1.06850941 156 1.40872218 -0.96866184 157 1.87003775 1.40872218 158 1.44726842 1.87003775 159 NA 1.44726842 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.75110417 1.80180144 [2,] -1.97236889 -0.75110417 [3,] 1.15520717 -1.97236889 [4,] -1.75417943 1.15520717 [5,] -0.09669580 -1.75417943 [6,] 0.27459259 -0.09669580 [7,] 1.29858793 0.27459259 [8,] 5.24112503 1.29858793 [9,] 1.01879574 5.24112503 [10,] 0.62724915 1.01879574 [11,] -0.91936543 0.62724915 [12,] -4.93744104 -0.91936543 [13,] 1.47435490 -4.93744104 [14,] 1.86774927 1.47435490 [15,] -3.28558824 1.86774927 [16,] -1.94862979 -3.28558824 [17,] -1.72305123 -1.94862979 [18,] -2.00582933 -1.72305123 [19,] 1.31778767 -2.00582933 [20,] 2.84988407 1.31778767 [21,] 2.29599612 2.84988407 [22,] -2.70220367 2.29599612 [23,] -0.28658977 -2.70220367 [24,] -0.39108531 -0.28658977 [25,] -1.34317018 -0.39108531 [26,] -0.50940792 -1.34317018 [27,] -2.56339012 -0.50940792 [28,] -1.42343705 -2.56339012 [29,] -0.44362988 -1.42343705 [30,] -1.71419437 -0.44362988 [31,] 4.27399882 -1.71419437 [32,] 1.90777101 4.27399882 [33,] -2.00311970 1.90777101 [34,] 0.33200773 -2.00311970 [35,] 3.40000723 0.33200773 [36,] -1.58708942 3.40000723 [37,] 6.73578630 -1.58708942 [38,] -0.26955236 6.73578630 [39,] 1.64177354 -0.26955236 [40,] 1.47886444 1.64177354 [41,] -1.46443491 1.47886444 [42,] -0.64133500 -1.46443491 [43,] 0.57847688 -0.64133500 [44,] -0.06101990 0.57847688 [45,] 1.91064255 -0.06101990 [46,] 2.42516203 1.91064255 [47,] 1.93502794 2.42516203 [48,] -2.27498205 1.93502794 [49,] 4.11985361 -2.27498205 [50,] 3.81516364 4.11985361 [51,] -1.43024335 3.81516364 [52,] -1.57177457 -1.43024335 [53,] -2.98621129 -1.57177457 [54,] -3.23625825 -2.98621129 [55,] 0.58773273 -3.23625825 [56,] -0.81337161 0.58773273 [57,] -0.88095630 -0.81337161 [58,] -2.15658543 -0.88095630 [59,] 5.22574485 -2.15658543 [60,] -0.88335346 5.22574485 [61,] -0.21160180 -0.88335346 [62,] 1.78811975 -0.21160180 [63,] 2.55049653 1.78811975 [64,] 1.60319281 2.55049653 [65,] -0.82178504 1.60319281 [66,] -5.58962970 -0.82178504 [67,] -0.10748067 -5.58962970 [68,] 4.36375677 -0.10748067 [69,] 0.59269243 4.36375677 [70,] -4.75218325 0.59269243 [71,] -1.76545742 -4.75218325 [72,] -3.34229947 -1.76545742 [73,] 2.50395104 -3.34229947 [74,] -2.17795596 2.50395104 [75,] -1.55473423 -2.17795596 [76,] 5.06359864 -1.55473423 [77,] 1.04589407 5.06359864 [78,] 0.88554228 1.04589407 [79,] -0.55450222 0.88554228 [80,] 2.52417525 -0.55450222 [81,] -5.57053392 2.52417525 [82,] 0.73353939 -5.57053392 [83,] -2.07597549 0.73353939 [84,] 1.57869115 -2.07597549 [85,] 0.16241638 1.57869115 [86,] 0.06966352 0.16241638 [87,] 3.75746702 0.06966352 [88,] -0.04994978 3.75746702 [89,] -1.00813107 -0.04994978 [90,] 0.98085930 -1.00813107 [91,] -4.01704146 0.98085930 [92,] 0.48044607 -4.01704146 [93,] -0.22000650 0.48044607 [94,] -2.48214994 -0.22000650 [95,] -1.47082722 -2.48214994 [96,] 2.23582249 -1.47082722 [97,] 0.16626650 2.23582249 [98,] -1.82979212 0.16626650 [99,] -1.38953373 -1.82979212 [100,] -0.99272101 -1.38953373 [101,] -2.50327909 -0.99272101 [102,] -0.83122988 -2.50327909 [103,] -2.25307380 -0.83122988 [104,] 1.09446127 -2.25307380 [105,] 2.35138109 1.09446127 [106,] -3.09726673 2.35138109 [107,] -2.54859706 -3.09726673 [108,] 2.16094221 -2.54859706 [109,] 3.22530644 2.16094221 [110,] -1.89722030 3.22530644 [111,] -5.73256376 -1.89722030 [112,] -2.99874797 -5.73256376 [113,] -1.58826641 -2.99874797 [114,] -1.51844261 -1.58826641 [115,] -1.47376402 -1.51844261 [116,] -2.33844977 -1.47376402 [117,] 1.07552542 -2.33844977 [118,] 2.10316716 1.07552542 [119,] -0.13909215 2.10316716 [120,] -1.01402625 -0.13909215 [121,] 1.75253623 -1.01402625 [122,] 3.57779997 1.75253623 [123,] -2.43764574 3.57779997 [124,] 8.44384971 -2.43764574 [125,] 0.61671810 8.44384971 [126,] -1.22271740 0.61671810 [127,] 0.20615879 -1.22271740 [128,] -0.70041796 0.20615879 [129,] 0.47642045 -0.70041796 [130,] 0.38187173 0.47642045 [131,] -1.66323151 0.38187173 [132,] -0.80385862 -1.66323151 [133,] -2.23835601 -0.80385862 [134,] -2.13350101 -2.23835601 [135,] 2.20820026 -2.13350101 [136,] 2.81685007 2.20820026 [137,] 2.65315842 2.81685007 [138,] -2.45373512 2.65315842 [139,] 1.92373894 -2.45373512 [140,] 1.51589556 1.92373894 [141,] 0.24726698 1.51589556 [142,] 3.04408301 0.24726698 [143,] 3.60618701 3.04408301 [144,] 2.39290632 3.60618701 [145,] 4.04601704 2.39290632 [146,] -3.07021867 4.04601704 [147,] -1.56732111 -3.07021867 [148,] -2.07541848 -1.56732111 [149,] -3.38099737 -2.07541848 [150,] -3.13913676 -3.38099737 [151,] 3.94998401 -3.13913676 [152,] -2.45902384 3.94998401 [153,] -1.07849727 -2.45902384 [154,] 1.06850941 -1.07849727 [155,] -0.96866184 1.06850941 [156,] 1.40872218 -0.96866184 [157,] 1.87003775 1.40872218 [158,] 1.44726842 1.87003775 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.75110417 1.80180144 2 -1.97236889 -0.75110417 3 1.15520717 -1.97236889 4 -1.75417943 1.15520717 5 -0.09669580 -1.75417943 6 0.27459259 -0.09669580 7 1.29858793 0.27459259 8 5.24112503 1.29858793 9 1.01879574 5.24112503 10 0.62724915 1.01879574 11 -0.91936543 0.62724915 12 -4.93744104 -0.91936543 13 1.47435490 -4.93744104 14 1.86774927 1.47435490 15 -3.28558824 1.86774927 16 -1.94862979 -3.28558824 17 -1.72305123 -1.94862979 18 -2.00582933 -1.72305123 19 1.31778767 -2.00582933 20 2.84988407 1.31778767 21 2.29599612 2.84988407 22 -2.70220367 2.29599612 23 -0.28658977 -2.70220367 24 -0.39108531 -0.28658977 25 -1.34317018 -0.39108531 26 -0.50940792 -1.34317018 27 -2.56339012 -0.50940792 28 -1.42343705 -2.56339012 29 -0.44362988 -1.42343705 30 -1.71419437 -0.44362988 31 4.27399882 -1.71419437 32 1.90777101 4.27399882 33 -2.00311970 1.90777101 34 0.33200773 -2.00311970 35 3.40000723 0.33200773 36 -1.58708942 3.40000723 37 6.73578630 -1.58708942 38 -0.26955236 6.73578630 39 1.64177354 -0.26955236 40 1.47886444 1.64177354 41 -1.46443491 1.47886444 42 -0.64133500 -1.46443491 43 0.57847688 -0.64133500 44 -0.06101990 0.57847688 45 1.91064255 -0.06101990 46 2.42516203 1.91064255 47 1.93502794 2.42516203 48 -2.27498205 1.93502794 49 4.11985361 -2.27498205 50 3.81516364 4.11985361 51 -1.43024335 3.81516364 52 -1.57177457 -1.43024335 53 -2.98621129 -1.57177457 54 -3.23625825 -2.98621129 55 0.58773273 -3.23625825 56 -0.81337161 0.58773273 57 -0.88095630 -0.81337161 58 -2.15658543 -0.88095630 59 5.22574485 -2.15658543 60 -0.88335346 5.22574485 61 -0.21160180 -0.88335346 62 1.78811975 -0.21160180 63 2.55049653 1.78811975 64 1.60319281 2.55049653 65 -0.82178504 1.60319281 66 -5.58962970 -0.82178504 67 -0.10748067 -5.58962970 68 4.36375677 -0.10748067 69 0.59269243 4.36375677 70 -4.75218325 0.59269243 71 -1.76545742 -4.75218325 72 -3.34229947 -1.76545742 73 2.50395104 -3.34229947 74 -2.17795596 2.50395104 75 -1.55473423 -2.17795596 76 5.06359864 -1.55473423 77 1.04589407 5.06359864 78 0.88554228 1.04589407 79 -0.55450222 0.88554228 80 2.52417525 -0.55450222 81 -5.57053392 2.52417525 82 0.73353939 -5.57053392 83 -2.07597549 0.73353939 84 1.57869115 -2.07597549 85 0.16241638 1.57869115 86 0.06966352 0.16241638 87 3.75746702 0.06966352 88 -0.04994978 3.75746702 89 -1.00813107 -0.04994978 90 0.98085930 -1.00813107 91 -4.01704146 0.98085930 92 0.48044607 -4.01704146 93 -0.22000650 0.48044607 94 -2.48214994 -0.22000650 95 -1.47082722 -2.48214994 96 2.23582249 -1.47082722 97 0.16626650 2.23582249 98 -1.82979212 0.16626650 99 -1.38953373 -1.82979212 100 -0.99272101 -1.38953373 101 -2.50327909 -0.99272101 102 -0.83122988 -2.50327909 103 -2.25307380 -0.83122988 104 1.09446127 -2.25307380 105 2.35138109 1.09446127 106 -3.09726673 2.35138109 107 -2.54859706 -3.09726673 108 2.16094221 -2.54859706 109 3.22530644 2.16094221 110 -1.89722030 3.22530644 111 -5.73256376 -1.89722030 112 -2.99874797 -5.73256376 113 -1.58826641 -2.99874797 114 -1.51844261 -1.58826641 115 -1.47376402 -1.51844261 116 -2.33844977 -1.47376402 117 1.07552542 -2.33844977 118 2.10316716 1.07552542 119 -0.13909215 2.10316716 120 -1.01402625 -0.13909215 121 1.75253623 -1.01402625 122 3.57779997 1.75253623 123 -2.43764574 3.57779997 124 8.44384971 -2.43764574 125 0.61671810 8.44384971 126 -1.22271740 0.61671810 127 0.20615879 -1.22271740 128 -0.70041796 0.20615879 129 0.47642045 -0.70041796 130 0.38187173 0.47642045 131 -1.66323151 0.38187173 132 -0.80385862 -1.66323151 133 -2.23835601 -0.80385862 134 -2.13350101 -2.23835601 135 2.20820026 -2.13350101 136 2.81685007 2.20820026 137 2.65315842 2.81685007 138 -2.45373512 2.65315842 139 1.92373894 -2.45373512 140 1.51589556 1.92373894 141 0.24726698 1.51589556 142 3.04408301 0.24726698 143 3.60618701 3.04408301 144 2.39290632 3.60618701 145 4.04601704 2.39290632 146 -3.07021867 4.04601704 147 -1.56732111 -3.07021867 148 -2.07541848 -1.56732111 149 -3.38099737 -2.07541848 150 -3.13913676 -3.38099737 151 3.94998401 -3.13913676 152 -2.45902384 3.94998401 153 -1.07849727 -2.45902384 154 1.06850941 -1.07849727 155 -0.96866184 1.06850941 156 1.40872218 -0.96866184 157 1.87003775 1.40872218 158 1.44726842 1.87003775 > 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/77fyw1290372194.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/87fyw1290372194.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/90pfz1290372194.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/100pfz1290372194.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/11l7e51290372194.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/1268cs1290372194.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/13dr9m1290372194.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/14oi8p1290372194.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/15ripd1290372194.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/166s5m1290372194.tab") + } > > try(system("convert tmp/1b6in1290372194.ps tmp/1b6in1290372194.png",intern=TRUE)) character(0) > try(system("convert tmp/23fzq1290372194.ps tmp/23fzq1290372194.png",intern=TRUE)) character(0) > try(system("convert tmp/33fzq1290372194.ps tmp/33fzq1290372194.png",intern=TRUE)) character(0) > try(system("convert tmp/43fzq1290372194.ps tmp/43fzq1290372194.png",intern=TRUE)) character(0) > try(system("convert tmp/5wozt1290372194.ps tmp/5wozt1290372194.png",intern=TRUE)) character(0) > try(system("convert tmp/6wozt1290372194.ps tmp/6wozt1290372194.png",intern=TRUE)) character(0) > try(system("convert tmp/77fyw1290372194.ps tmp/77fyw1290372194.png",intern=TRUE)) character(0) > try(system("convert tmp/87fyw1290372194.ps tmp/87fyw1290372194.png",intern=TRUE)) character(0) > try(system("convert tmp/90pfz1290372194.ps tmp/90pfz1290372194.png",intern=TRUE)) character(0) > try(system("convert tmp/100pfz1290372194.ps tmp/100pfz1290372194.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.035 1.746 9.365