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(100.00 + ,100.00 + ,103.53 + ,102.62 + ,108.36 + ,107.62 + ,115.20 + ,103.46 + ,123.51 + ,103.61 + ,132.87 + ,106.10 + ,130.55 + ,107.13 + ,136.68 + ,108.82 + ,140.63 + ,112.93 + ,143.47 + ,109.35 + ,124.10 + ,108.75 + ,111.49 + ,110.83 + ,119.93 + ,110.95 + ,131.79 + ,114.96 + ,136.61 + ,120.45 + ,141.79 + ,122.89 + ,142.23 + ,120.43 + ,146.74 + ,121.76 + ,154.85 + ,122.78 + ,148.44 + ,125.32 + ,154.18 + ,128.68 + ,149.10 + ,127.91 + ,152.22 + ,125.52 + ,149.34 + ,127.56 + ,160.94 + ,127.90 + ,176.16 + ,130.75 + ,195.12 + ,133.57 + ,186.07 + ,135.83 + ,200.78 + ,135.26 + ,208.15 + ,135.99 + ,209.56 + ,139.12 + ,203.33 + ,137.64 + ,198.84 + ,138.59 + ,200.63 + ,138.32 + ,206.47 + ,135.99 + ,196.68 + ,136.96 + ,203.81 + ,137.13 + ,190.18 + ,138.67 + ,187.50 + ,143.04 + ,187.62 + ,143.98 + ,168.92 + ,144.09 + ,164.78 + ,144.97 + ,175.98 + ,147.77 + ,174.70 + ,149.73 + ,166.95 + ,153.11 + ,161.76 + ,151.58 + ,149.65 + ,149.04 + ,137.42 + ,154.70 + ,142.60 + ,154.91 + ,146.94 + ,159.08 + ,152.52 + ,168.01 + ,147.47 + ,164.17 + ,146.15 + ,163.77 + ,152.04 + ,163.49 + ,144.42 + ,166.13 + ,138.15 + ,166.15 + ,125.94 + ,170.05 + ,112.61 + ,167.37 + ,111.48 + ,164.80 + ,95.25 + ,169.53 + ,105.38 + ,168.17 + ,109.59 + ,172.45 + ,99.07 + ,177.81 + ,92.07 + ,175.38 + ,89.10 + ,175.64 + ,86.36 + ,178.80 + ,95.39 + ,180.49 + ,95.27 + ,182.71 + ,98.56 + ,185.73 + ,101.79 + ,183.17 + ,102.02 + ,182.11 + ,98.21 + ,185.43 + ,104.42 + ,185.29 + ,105.62 + ,188.55 + ,109.46 + ,191.89 + ,110.94 + ,190.62 + ,113.09 + ,190.29 + ,109.58 + ,193.27 + ,111.41 + ,194.54 + ,109.83 + ,195.42 + ,110.58 + ,198.58 + ,109.04 + ,197.60 + ,107.80 + ,194.62 + ,109.79 + ,199.30 + ,110.76 + ,199.51 + ,112.64 + ,203.08 + ,114.17 + ,204.36 + ,115.99 + ,206.47 + ,119.01 + ,206.51 + ,117.92 + ,208.09 + ,115.92 + ,210.08 + ,120.75 + ,212.42 + ,124.94 + ,231.32 + ,129.17 + ,231.94 + ,128.14 + ,228.02 + ,134.18 + ,231.95 + ,131.74 + ,233.88 + ,134.32 + ,235.95 + ,137.80 + ,242.92 + ,141.79 + ,240.80 + ,142.75 + ,240.34 + ,144.30 + ,241.95 + ,145.49 + ,246.61 + ,138.21 + ,247.80 + ,139.02 + ,250.97 + ,141.91 + ,248.11 + ,144.95 + ,243.75 + ,146.11 + ,248.79 + ,150.96 + ,247.03 + ,148.20 + ,250.49 + ,152.12 + ,260.83 + ,154.74 + ,256.22 + ,150.80 + ,255.33 + ,152.60 + ,259.54 + ,158.74 + ,260.64 + ,161.83 + ,262.20 + ,162.40 + ,267.29 + ,156.11 + ,265.55 + ,154.93 + ,258.99 + ,157.18 + ,265.04 + ,159.85 + ,262.18 + ,154.40 + ,265.05 + ,151.57 + ,268.78 + ,133.34 + ,265.93 + ,131.20 + ,261.30 + ,124.17 + ,265.20 + ,133.19 + ,263.26 + ,130.94 + ,265.41 + ,119.58 + ,268.75 + ,118.55 + ,261.95 + ,119.96 + ,258.16 + ,108.42 + ,265.22 + ,95.93 + ,267.34 + ,88.83 + ,269.01 + ,84.98 + ,272.90 + ,81.61 + ,278.76 + ,72.84 + ,278.98 + ,74.72 + ,281.03 + ,83.40 + ,285.65 + ,87.42 + ,287.34 + ,86.33 + ,294.57 + ,94.28 + ,294.24 + ,98.81 + ,295.13 + ,100.96 + ,299.65 + ,99.14 + ,303.59) + ,dim=c(2 + ,145) + ,dimnames=list(c('Y' + ,'X') + ,1:145)) > y <- array(NA,dim=c(2,145),dimnames=list(c('Y','X'),1:145)) > 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 = 'Include Monthly Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Y X M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 100.00 100.00 1 0 0 0 0 0 0 0 0 0 0 2 103.53 102.62 0 1 0 0 0 0 0 0 0 0 0 3 108.36 107.62 0 0 1 0 0 0 0 0 0 0 0 4 115.20 103.46 0 0 0 1 0 0 0 0 0 0 0 5 123.51 103.61 0 0 0 0 1 0 0 0 0 0 0 6 132.87 106.10 0 0 0 0 0 1 0 0 0 0 0 7 130.55 107.13 0 0 0 0 0 0 1 0 0 0 0 8 136.68 108.82 0 0 0 0 0 0 0 1 0 0 0 9 140.63 112.93 0 0 0 0 0 0 0 0 1 0 0 10 143.47 109.35 0 0 0 0 0 0 0 0 0 1 0 11 124.10 108.75 0 0 0 0 0 0 0 0 0 0 1 12 111.49 110.83 0 0 0 0 0 0 0 0 0 0 0 13 119.93 110.95 1 0 0 0 0 0 0 0 0 0 0 14 131.79 114.96 0 1 0 0 0 0 0 0 0 0 0 15 136.61 120.45 0 0 1 0 0 0 0 0 0 0 0 16 141.79 122.89 0 0 0 1 0 0 0 0 0 0 0 17 142.23 120.43 0 0 0 0 1 0 0 0 0 0 0 18 146.74 121.76 0 0 0 0 0 1 0 0 0 0 0 19 154.85 122.78 0 0 0 0 0 0 1 0 0 0 0 20 148.44 125.32 0 0 0 0 0 0 0 1 0 0 0 21 154.18 128.68 0 0 0 0 0 0 0 0 1 0 0 22 149.10 127.91 0 0 0 0 0 0 0 0 0 1 0 23 152.22 125.52 0 0 0 0 0 0 0 0 0 0 1 24 149.34 127.56 0 0 0 0 0 0 0 0 0 0 0 25 160.94 127.90 1 0 0 0 0 0 0 0 0 0 0 26 176.16 130.75 0 1 0 0 0 0 0 0 0 0 0 27 195.12 133.57 0 0 1 0 0 0 0 0 0 0 0 28 186.07 135.83 0 0 0 1 0 0 0 0 0 0 0 29 200.78 135.26 0 0 0 0 1 0 0 0 0 0 0 30 208.15 135.99 0 0 0 0 0 1 0 0 0 0 0 31 209.56 139.12 0 0 0 0 0 0 1 0 0 0 0 32 203.33 137.64 0 0 0 0 0 0 0 1 0 0 0 33 198.84 138.59 0 0 0 0 0 0 0 0 1 0 0 34 200.63 138.32 0 0 0 0 0 0 0 0 0 1 0 35 206.47 135.99 0 0 0 0 0 0 0 0 0 0 1 36 196.68 136.96 0 0 0 0 0 0 0 0 0 0 0 37 203.81 137.13 1 0 0 0 0 0 0 0 0 0 0 38 190.18 138.67 0 1 0 0 0 0 0 0 0 0 0 39 187.50 143.04 0 0 1 0 0 0 0 0 0 0 0 40 187.62 143.98 0 0 0 1 0 0 0 0 0 0 0 41 168.92 144.09 0 0 0 0 1 0 0 0 0 0 0 42 164.78 144.97 0 0 0 0 0 1 0 0 0 0 0 43 175.98 147.77 0 0 0 0 0 0 1 0 0 0 0 44 174.70 149.73 0 0 0 0 0 0 0 1 0 0 0 45 166.95 153.11 0 0 0 0 0 0 0 0 1 0 0 46 161.76 151.58 0 0 0 0 0 0 0 0 0 1 0 47 149.65 149.04 0 0 0 0 0 0 0 0 0 0 1 48 137.42 154.70 0 0 0 0 0 0 0 0 0 0 0 49 142.60 154.91 1 0 0 0 0 0 0 0 0 0 0 50 146.94 159.08 0 1 0 0 0 0 0 0 0 0 0 51 152.52 168.01 0 0 1 0 0 0 0 0 0 0 0 52 147.47 164.17 0 0 0 1 0 0 0 0 0 0 0 53 146.15 163.77 0 0 0 0 1 0 0 0 0 0 0 54 152.04 163.49 0 0 0 0 0 1 0 0 0 0 0 55 144.42 166.13 0 0 0 0 0 0 1 0 0 0 0 56 138.15 166.15 0 0 0 0 0 0 0 1 0 0 0 57 125.94 170.05 0 0 0 0 0 0 0 0 1 0 0 58 112.61 167.37 0 0 0 0 0 0 0 0 0 1 0 59 111.48 164.80 0 0 0 0 0 0 0 0 0 0 1 60 95.25 169.53 0 0 0 0 0 0 0 0 0 0 0 61 105.38 168.17 1 0 0 0 0 0 0 0 0 0 0 62 109.59 172.45 0 1 0 0 0 0 0 0 0 0 0 63 99.07 177.81 0 0 1 0 0 0 0 0 0 0 0 64 92.07 175.38 0 0 0 1 0 0 0 0 0 0 0 65 89.10 175.64 0 0 0 0 1 0 0 0 0 0 0 66 86.36 178.80 0 0 0 0 0 1 0 0 0 0 0 67 95.39 180.49 0 0 0 0 0 0 1 0 0 0 0 68 95.27 182.71 0 0 0 0 0 0 0 1 0 0 0 69 98.56 185.73 0 0 0 0 0 0 0 0 1 0 0 70 101.79 183.17 0 0 0 0 0 0 0 0 0 1 0 71 102.02 182.11 0 0 0 0 0 0 0 0 0 0 1 72 98.21 185.43 0 0 0 0 0 0 0 0 0 0 0 73 104.42 185.29 1 0 0 0 0 0 0 0 0 0 0 74 105.62 188.55 0 1 0 0 0 0 0 0 0 0 0 75 109.46 191.89 0 0 1 0 0 0 0 0 0 0 0 76 110.94 190.62 0 0 0 1 0 0 0 0 0 0 0 77 113.09 190.29 0 0 0 0 1 0 0 0 0 0 0 78 109.58 193.27 0 0 0 0 0 1 0 0 0 0 0 79 111.41 194.54 0 0 0 0 0 0 1 0 0 0 0 80 109.83 195.42 0 0 0 0 0 0 0 1 0 0 0 81 110.58 198.58 0 0 0 0 0 0 0 0 1 0 0 82 109.04 197.60 0 0 0 0 0 0 0 0 0 1 0 83 107.80 194.62 0 0 0 0 0 0 0 0 0 0 1 84 109.79 199.30 0 0 0 0 0 0 0 0 0 0 0 85 110.76 199.51 1 0 0 0 0 0 0 0 0 0 0 86 112.64 203.08 0 1 0 0 0 0 0 0 0 0 0 87 114.17 204.36 0 0 1 0 0 0 0 0 0 0 0 88 115.99 206.47 0 0 0 1 0 0 0 0 0 0 0 89 119.01 206.51 0 0 0 0 1 0 0 0 0 0 0 90 117.92 208.09 0 0 0 0 0 1 0 0 0 0 0 91 115.92 210.08 0 0 0 0 0 0 1 0 0 0 0 92 120.75 212.42 0 0 0 0 0 0 0 1 0 0 0 93 124.94 231.32 0 0 0 0 0 0 0 0 1 0 0 94 129.17 231.94 0 0 0 0 0 0 0 0 0 1 0 95 128.14 228.02 0 0 0 0 0 0 0 0 0 0 1 96 134.18 231.95 0 0 0 0 0 0 0 0 0 0 0 97 131.74 233.88 1 0 0 0 0 0 0 0 0 0 0 98 134.32 235.95 0 1 0 0 0 0 0 0 0 0 0 99 137.80 242.92 0 0 1 0 0 0 0 0 0 0 0 100 141.79 240.80 0 0 0 1 0 0 0 0 0 0 0 101 142.75 240.34 0 0 0 0 1 0 0 0 0 0 0 102 144.30 241.95 0 0 0 0 0 1 0 0 0 0 0 103 145.49 246.61 0 0 0 0 0 0 1 0 0 0 0 104 138.21 247.80 0 0 0 0 0 0 0 1 0 0 0 105 139.02 250.97 0 0 0 0 0 0 0 0 1 0 0 106 141.91 248.11 0 0 0 0 0 0 0 0 0 1 0 107 144.95 243.75 0 0 0 0 0 0 0 0 0 0 1 108 146.11 248.79 0 0 0 0 0 0 0 0 0 0 0 109 150.96 247.03 1 0 0 0 0 0 0 0 0 0 0 110 148.20 250.49 0 1 0 0 0 0 0 0 0 0 0 111 152.12 260.83 0 0 1 0 0 0 0 0 0 0 0 112 154.74 256.22 0 0 0 1 0 0 0 0 0 0 0 113 150.80 255.33 0 0 0 0 1 0 0 0 0 0 0 114 152.60 259.54 0 0 0 0 0 1 0 0 0 0 0 115 158.74 260.64 0 0 0 0 0 0 1 0 0 0 0 116 161.83 262.20 0 0 0 0 0 0 0 1 0 0 0 117 162.40 267.29 0 0 0 0 0 0 0 0 1 0 0 118 156.11 265.55 0 0 0 0 0 0 0 0 0 1 0 119 154.93 258.99 0 0 0 0 0 0 0 0 0 0 1 120 157.18 265.04 0 0 0 0 0 0 0 0 0 0 0 121 159.85 262.18 1 0 0 0 0 0 0 0 0 0 0 122 154.40 265.05 0 1 0 0 0 0 0 0 0 0 0 123 151.57 268.78 0 0 1 0 0 0 0 0 0 0 0 124 133.34 265.93 0 0 0 1 0 0 0 0 0 0 0 125 131.20 261.30 0 0 0 0 1 0 0 0 0 0 0 126 124.17 265.20 0 0 0 0 0 1 0 0 0 0 0 127 133.19 263.26 0 0 0 0 0 0 1 0 0 0 0 128 130.94 265.41 0 0 0 0 0 0 0 1 0 0 0 129 119.58 268.75 0 0 0 0 0 0 0 0 1 0 0 130 118.55 261.95 0 0 0 0 0 0 0 0 0 1 0 131 119.96 258.16 0 0 0 0 0 0 0 0 0 0 1 132 108.42 265.22 0 0 0 0 0 0 0 0 0 0 0 133 95.93 267.34 1 0 0 0 0 0 0 0 0 0 0 134 88.83 269.01 0 1 0 0 0 0 0 0 0 0 0 135 84.98 272.90 0 0 1 0 0 0 0 0 0 0 0 136 81.61 278.76 0 0 0 1 0 0 0 0 0 0 0 137 72.84 278.98 0 0 0 0 1 0 0 0 0 0 0 138 74.72 281.03 0 0 0 0 0 1 0 0 0 0 0 139 83.40 285.65 0 0 0 0 0 0 1 0 0 0 0 140 87.42 287.34 0 0 0 0 0 0 0 1 0 0 0 141 86.33 294.57 0 0 0 0 0 0 0 0 1 0 0 142 94.28 294.24 0 0 0 0 0 0 0 0 0 1 0 143 98.81 295.13 0 0 0 0 0 0 0 0 0 0 1 144 100.96 299.65 0 0 0 0 0 0 0 0 0 0 0 145 99.14 303.59 1 0 0 0 0 0 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X M1 M2 M3 M4 166.0033 -0.1866 -0.4895 2.2087 5.4222 3.5821 M5 M6 M7 M8 M9 M10 2.7552 4.2926 8.3886 7.5368 6.9973 5.8379 M11 3.8461 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -50.564 -25.452 -1.705 20.596 63.891 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 166.00335 12.45867 13.324 < 2e-16 *** X -0.18665 0.04387 -4.255 3.93e-05 *** M1 -0.48952 12.29673 -0.040 0.968 M2 2.20867 12.55022 0.176 0.861 M3 5.42221 12.54147 0.432 0.666 M4 3.58208 12.54234 0.286 0.776 M5 2.75521 12.54343 0.220 0.826 M6 4.29263 12.54062 0.342 0.733 M7 8.38858 12.53851 0.669 0.505 M8 7.53676 12.53739 0.601 0.549 M9 6.99726 12.53585 0.558 0.578 M10 5.83789 12.53601 0.466 0.642 M11 3.84606 12.53717 0.307 0.759 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 30.71 on 132 degrees of freedom Multiple R-squared: 0.1268, Adjusted R-squared: 0.04743 F-statistic: 1.598 on 12 and 132 DF, p-value: 0.0996 > 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,] 5.092333e-03 1.018467e-02 0.994907667 [2,] 1.806201e-03 3.612402e-03 0.998193799 [3,] 6.723427e-04 1.344685e-03 0.999327657 [4,] 1.109628e-04 2.219256e-04 0.999889037 [5,] 5.599204e-05 1.119841e-04 0.999944008 [6,] 1.483364e-05 2.966727e-05 0.999985166 [7,] 1.795997e-05 3.591994e-05 0.999982040 [8,] 5.164635e-06 1.032927e-05 0.999994835 [9,] 4.190301e-06 8.380602e-06 0.999995810 [10,] 6.802884e-06 1.360577e-05 0.999993197 [11,] 1.605652e-05 3.211304e-05 0.999983943 [12,] 1.860508e-04 3.721017e-04 0.999813949 [13,] 1.063581e-04 2.127163e-04 0.999893642 [14,] 1.044976e-04 2.089952e-04 0.999895502 [15,] 1.135480e-04 2.270960e-04 0.999886452 [16,] 7.991788e-05 1.598358e-04 0.999920082 [17,] 5.738905e-05 1.147781e-04 0.999942611 [18,] 3.571078e-05 7.142155e-05 0.999964289 [19,] 2.226832e-05 4.453663e-05 0.999977732 [20,] 3.577843e-05 7.155687e-05 0.999964222 [21,] 5.181814e-05 1.036363e-04 0.999948182 [22,] 6.205289e-05 1.241058e-04 0.999937947 [23,] 4.137131e-05 8.274262e-05 0.999958629 [24,] 3.969691e-05 7.939383e-05 0.999960303 [25,] 4.630536e-05 9.261072e-05 0.999953695 [26,] 4.092431e-04 8.184862e-04 0.999590757 [27,] 3.290680e-03 6.581361e-03 0.996709320 [28,] 9.242802e-03 1.848560e-02 0.990757198 [29,] 2.074024e-02 4.148047e-02 0.979259764 [30,] 5.236685e-02 1.047337e-01 0.947633150 [31,] 1.110671e-01 2.221343e-01 0.888932868 [32,] 2.032064e-01 4.064129e-01 0.796793552 [33,] 3.435642e-01 6.871283e-01 0.656435847 [34,] 4.653114e-01 9.306229e-01 0.534688554 [35,] 5.644626e-01 8.710747e-01 0.435537357 [36,] 6.674449e-01 6.651101e-01 0.332555050 [37,] 7.389784e-01 5.220431e-01 0.261021560 [38,] 7.974063e-01 4.051874e-01 0.202593684 [39,] 8.437170e-01 3.125660e-01 0.156282982 [40,] 8.863842e-01 2.272317e-01 0.113615834 [41,] 9.152381e-01 1.695237e-01 0.084761865 [42,] 9.423248e-01 1.153505e-01 0.057675231 [43,] 9.646424e-01 7.071526e-02 0.035357629 [44,] 9.738744e-01 5.225112e-02 0.026125560 [45,] 9.827552e-01 3.448965e-02 0.017244826 [46,] 9.844331e-01 3.113383e-02 0.015566913 [47,] 9.851206e-01 2.975879e-02 0.014879393 [48,] 9.890229e-01 2.195418e-02 0.010977088 [49,] 9.925063e-01 1.498745e-02 0.007493725 [50,] 9.949502e-01 1.009958e-02 0.005049791 [51,] 9.968731e-01 6.253859e-03 0.003126929 [52,] 9.975166e-01 4.966727e-03 0.002483363 [53,] 9.978430e-01 4.313948e-03 0.002156974 [54,] 9.977898e-01 4.420406e-03 0.002210203 [55,] 9.974717e-01 5.056668e-03 0.002528334 [56,] 9.969912e-01 6.017564e-03 0.003008782 [57,] 9.964629e-01 7.074201e-03 0.003537101 [58,] 9.953820e-01 9.236068e-03 0.004618034 [59,] 9.941988e-01 1.160246e-02 0.005801229 [60,] 9.925739e-01 1.485226e-02 0.007426130 [61,] 9.902053e-01 1.958938e-02 0.009794688 [62,] 9.868116e-01 2.637675e-02 0.013188375 [63,] 9.830747e-01 3.385068e-02 0.016925339 [64,] 9.791492e-01 4.170161e-02 0.020850803 [65,] 9.751444e-01 4.971122e-02 0.024855609 [66,] 9.702892e-01 5.942151e-02 0.029710756 [67,] 9.662582e-01 6.748369e-02 0.033741845 [68,] 9.639137e-01 7.217260e-02 0.036086299 [69,] 9.619853e-01 7.602944e-02 0.038014719 [70,] 9.605380e-01 7.892399e-02 0.039461995 [71,] 9.595170e-01 8.096596e-02 0.040482981 [72,] 9.609022e-01 7.819569e-02 0.039097844 [73,] 9.604627e-01 7.907469e-02 0.039537345 [74,] 9.578202e-01 8.435967e-02 0.042179836 [75,] 9.582076e-01 8.358487e-02 0.041792437 [76,] 9.687758e-01 6.244834e-02 0.031224171 [77,] 9.780937e-01 4.381264e-02 0.021906319 [78,] 9.795032e-01 4.099355e-02 0.020496777 [79,] 9.798005e-01 4.039903e-02 0.020199514 [80,] 9.826443e-01 3.471132e-02 0.017355662 [81,] 9.853301e-01 2.933976e-02 0.014669878 [82,] 9.881724e-01 2.365529e-02 0.011827646 [83,] 9.877378e-01 2.452433e-02 0.012262164 [84,] 9.861402e-01 2.771966e-02 0.013859828 [85,] 9.828723e-01 3.425534e-02 0.017127669 [86,] 9.774464e-01 4.510729e-02 0.022553647 [87,] 9.703007e-01 5.939865e-02 0.029699326 [88,] 9.615639e-01 7.687216e-02 0.038436078 [89,] 9.545088e-01 9.098241e-02 0.045491204 [90,] 9.459243e-01 1.081515e-01 0.054075727 [91,] 9.353299e-01 1.293402e-01 0.064670117 [92,] 9.255792e-01 1.488416e-01 0.074420780 [93,] 9.158371e-01 1.683257e-01 0.084162854 [94,] 9.037148e-01 1.925704e-01 0.096285200 [95,] 8.758091e-01 2.483819e-01 0.124190928 [96,] 8.500090e-01 2.999821e-01 0.149991034 [97,] 8.241249e-01 3.517502e-01 0.175875112 [98,] 7.991442e-01 4.017116e-01 0.200855803 [99,] 7.863954e-01 4.272093e-01 0.213604637 [100,] 7.680161e-01 4.639678e-01 0.231983904 [101,] 7.562589e-01 4.874822e-01 0.243741113 [102,] 7.677319e-01 4.645362e-01 0.232268102 [103,] 7.568797e-01 4.862405e-01 0.243120268 [104,] 7.164684e-01 5.670631e-01 0.283531564 [105,] 6.997227e-01 6.005545e-01 0.300277263 [106,] 7.021751e-01 5.956498e-01 0.297824897 [107,] 7.954349e-01 4.091301e-01 0.204565053 [108,] 8.935433e-01 2.129134e-01 0.106456684 [109,] 9.017591e-01 1.964818e-01 0.098240923 [110,] 9.269464e-01 1.461073e-01 0.073053634 [111,] 9.399400e-01 1.201201e-01 0.060060043 [112,] 9.535421e-01 9.291589e-02 0.046457946 [113,] 9.677653e-01 6.446939e-02 0.032234696 [114,] 9.643609e-01 7.127811e-02 0.035639056 > postscript(file="/var/www/html/rcomp/tmp/1eu4d1260702576.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/2kk271260702576.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/39lof1260702576.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/4idme1260702576.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/5touf1260702576.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 = 145 Frequency = 1 1 2 3 4 5 6 -46.8492118 -45.5283849 -42.9786934 -35.0750103 -25.9101509 -17.6228153 7 8 9 10 11 12 -23.8465177 -16.5492681 -11.2926506 -7.9614729 -25.4516378 -33.8273505 13 14 15 16 17 18 -24.8754359 -14.9651708 -12.3340227 -4.8584746 -4.0507617 -0.8299358 19 20 21 22 23 24 3.3744954 -1.7096058 5.1970271 1.1326806 5.7984190 7.1452405 25 26 27 28 29 30 19.2982172 32.3519728 48.6247755 41.8367273 57.2672015 63.2360397 31 32 33 34 35 36 61.1342943 55.4798754 51.7066910 54.6056676 62.0026048 56.2397148 37 38 39 40 41 42 63.8909617 47.8502107 42.7723151 44.9078939 27.0552874 21.5421226 43 44 45 46 47 48 29.1687840 29.1064280 22.5267938 18.2105962 7.6183377 0.2908184 49 50 51 52 53 54 5.9995312 8.4196597 12.4528708 8.5262807 7.9584847 12.2588103 55 56 57 58 59 60 1.0356083 -4.3788413 -15.3214195 -27.9922602 -27.6101181 -39.1112184 61 62 63 64 65 66 -28.7455402 -26.4348806 -39.1679964 -44.7814154 -46.8760248 -50.5636364 67 68 69 70 71 72 -45.3141522 -44.1679802 -39.7748070 -35.8632502 -33.8392723 -33.1835438 73 74 75 76 77 78 -26.5101572 -27.3998767 -26.1500179 -23.0669272 -20.1516580 -24.6428658 79 80 81 82 83 84 -26.6717731 -27.2357070 -25.3564033 -25.9199455 -25.7243283 -19.0147609 85 86 87 88 89 90 -17.5160482 -17.6679074 -19.1125398 -15.0585849 -11.2042566 -13.5367691 91 92 93 94 95 96 -19.2612911 -13.1427215 -4.8856066 0.6194851 0.8496548 11.4692376 97 98 99 100 101 102 9.8789818 10.1471533 11.7145378 17.1489793 18.8499845 19.1630713 103 104 105 106 107 108 17.1268947 10.9208212 12.8619913 16.3775542 20.5955996 26.5423597 109 110 111 112 113 114 31.5533794 26.7409891 29.3773713 32.9770637 29.6978111 30.7461781 115 116 117 118 119 120 32.9955409 37.2285265 39.2880573 33.8326640 33.4200877 40.6453605 121 122 123 124 125 126 43.2710694 35.6585578 30.3112087 13.3893983 11.2120889 3.3725956 127 128 129 130 131 132 7.9345540 6.9376608 -3.2594392 -4.3992623 -1.7048286 -8.0810432 133 134 135 136 137 138 -19.6858362 -29.1723232 -35.5098090 -35.9459309 -43.8480062 -43.1227950 139 140 141 142 143 144 -37.6764375 -32.4891880 -31.6902343 -22.6424564 -15.9545185 -9.1148145 145 -9.7099113 > postscript(file="/var/www/html/rcomp/tmp/63x271260702576.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 = 145 Frequency = 1 lag(myerror, k = 1) myerror 0 -46.8492118 NA 1 -45.5283849 -46.8492118 2 -42.9786934 -45.5283849 3 -35.0750103 -42.9786934 4 -25.9101509 -35.0750103 5 -17.6228153 -25.9101509 6 -23.8465177 -17.6228153 7 -16.5492681 -23.8465177 8 -11.2926506 -16.5492681 9 -7.9614729 -11.2926506 10 -25.4516378 -7.9614729 11 -33.8273505 -25.4516378 12 -24.8754359 -33.8273505 13 -14.9651708 -24.8754359 14 -12.3340227 -14.9651708 15 -4.8584746 -12.3340227 16 -4.0507617 -4.8584746 17 -0.8299358 -4.0507617 18 3.3744954 -0.8299358 19 -1.7096058 3.3744954 20 5.1970271 -1.7096058 21 1.1326806 5.1970271 22 5.7984190 1.1326806 23 7.1452405 5.7984190 24 19.2982172 7.1452405 25 32.3519728 19.2982172 26 48.6247755 32.3519728 27 41.8367273 48.6247755 28 57.2672015 41.8367273 29 63.2360397 57.2672015 30 61.1342943 63.2360397 31 55.4798754 61.1342943 32 51.7066910 55.4798754 33 54.6056676 51.7066910 34 62.0026048 54.6056676 35 56.2397148 62.0026048 36 63.8909617 56.2397148 37 47.8502107 63.8909617 38 42.7723151 47.8502107 39 44.9078939 42.7723151 40 27.0552874 44.9078939 41 21.5421226 27.0552874 42 29.1687840 21.5421226 43 29.1064280 29.1687840 44 22.5267938 29.1064280 45 18.2105962 22.5267938 46 7.6183377 18.2105962 47 0.2908184 7.6183377 48 5.9995312 0.2908184 49 8.4196597 5.9995312 50 12.4528708 8.4196597 51 8.5262807 12.4528708 52 7.9584847 8.5262807 53 12.2588103 7.9584847 54 1.0356083 12.2588103 55 -4.3788413 1.0356083 56 -15.3214195 -4.3788413 57 -27.9922602 -15.3214195 58 -27.6101181 -27.9922602 59 -39.1112184 -27.6101181 60 -28.7455402 -39.1112184 61 -26.4348806 -28.7455402 62 -39.1679964 -26.4348806 63 -44.7814154 -39.1679964 64 -46.8760248 -44.7814154 65 -50.5636364 -46.8760248 66 -45.3141522 -50.5636364 67 -44.1679802 -45.3141522 68 -39.7748070 -44.1679802 69 -35.8632502 -39.7748070 70 -33.8392723 -35.8632502 71 -33.1835438 -33.8392723 72 -26.5101572 -33.1835438 73 -27.3998767 -26.5101572 74 -26.1500179 -27.3998767 75 -23.0669272 -26.1500179 76 -20.1516580 -23.0669272 77 -24.6428658 -20.1516580 78 -26.6717731 -24.6428658 79 -27.2357070 -26.6717731 80 -25.3564033 -27.2357070 81 -25.9199455 -25.3564033 82 -25.7243283 -25.9199455 83 -19.0147609 -25.7243283 84 -17.5160482 -19.0147609 85 -17.6679074 -17.5160482 86 -19.1125398 -17.6679074 87 -15.0585849 -19.1125398 88 -11.2042566 -15.0585849 89 -13.5367691 -11.2042566 90 -19.2612911 -13.5367691 91 -13.1427215 -19.2612911 92 -4.8856066 -13.1427215 93 0.6194851 -4.8856066 94 0.8496548 0.6194851 95 11.4692376 0.8496548 96 9.8789818 11.4692376 97 10.1471533 9.8789818 98 11.7145378 10.1471533 99 17.1489793 11.7145378 100 18.8499845 17.1489793 101 19.1630713 18.8499845 102 17.1268947 19.1630713 103 10.9208212 17.1268947 104 12.8619913 10.9208212 105 16.3775542 12.8619913 106 20.5955996 16.3775542 107 26.5423597 20.5955996 108 31.5533794 26.5423597 109 26.7409891 31.5533794 110 29.3773713 26.7409891 111 32.9770637 29.3773713 112 29.6978111 32.9770637 113 30.7461781 29.6978111 114 32.9955409 30.7461781 115 37.2285265 32.9955409 116 39.2880573 37.2285265 117 33.8326640 39.2880573 118 33.4200877 33.8326640 119 40.6453605 33.4200877 120 43.2710694 40.6453605 121 35.6585578 43.2710694 122 30.3112087 35.6585578 123 13.3893983 30.3112087 124 11.2120889 13.3893983 125 3.3725956 11.2120889 126 7.9345540 3.3725956 127 6.9376608 7.9345540 128 -3.2594392 6.9376608 129 -4.3992623 -3.2594392 130 -1.7048286 -4.3992623 131 -8.0810432 -1.7048286 132 -19.6858362 -8.0810432 133 -29.1723232 -19.6858362 134 -35.5098090 -29.1723232 135 -35.9459309 -35.5098090 136 -43.8480062 -35.9459309 137 -43.1227950 -43.8480062 138 -37.6764375 -43.1227950 139 -32.4891880 -37.6764375 140 -31.6902343 -32.4891880 141 -22.6424564 -31.6902343 142 -15.9545185 -22.6424564 143 -9.1148145 -15.9545185 144 -9.7099113 -9.1148145 145 NA -9.7099113 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -45.5283849 -46.8492118 [2,] -42.9786934 -45.5283849 [3,] -35.0750103 -42.9786934 [4,] -25.9101509 -35.0750103 [5,] -17.6228153 -25.9101509 [6,] -23.8465177 -17.6228153 [7,] -16.5492681 -23.8465177 [8,] -11.2926506 -16.5492681 [9,] -7.9614729 -11.2926506 [10,] -25.4516378 -7.9614729 [11,] -33.8273505 -25.4516378 [12,] -24.8754359 -33.8273505 [13,] -14.9651708 -24.8754359 [14,] -12.3340227 -14.9651708 [15,] -4.8584746 -12.3340227 [16,] -4.0507617 -4.8584746 [17,] -0.8299358 -4.0507617 [18,] 3.3744954 -0.8299358 [19,] -1.7096058 3.3744954 [20,] 5.1970271 -1.7096058 [21,] 1.1326806 5.1970271 [22,] 5.7984190 1.1326806 [23,] 7.1452405 5.7984190 [24,] 19.2982172 7.1452405 [25,] 32.3519728 19.2982172 [26,] 48.6247755 32.3519728 [27,] 41.8367273 48.6247755 [28,] 57.2672015 41.8367273 [29,] 63.2360397 57.2672015 [30,] 61.1342943 63.2360397 [31,] 55.4798754 61.1342943 [32,] 51.7066910 55.4798754 [33,] 54.6056676 51.7066910 [34,] 62.0026048 54.6056676 [35,] 56.2397148 62.0026048 [36,] 63.8909617 56.2397148 [37,] 47.8502107 63.8909617 [38,] 42.7723151 47.8502107 [39,] 44.9078939 42.7723151 [40,] 27.0552874 44.9078939 [41,] 21.5421226 27.0552874 [42,] 29.1687840 21.5421226 [43,] 29.1064280 29.1687840 [44,] 22.5267938 29.1064280 [45,] 18.2105962 22.5267938 [46,] 7.6183377 18.2105962 [47,] 0.2908184 7.6183377 [48,] 5.9995312 0.2908184 [49,] 8.4196597 5.9995312 [50,] 12.4528708 8.4196597 [51,] 8.5262807 12.4528708 [52,] 7.9584847 8.5262807 [53,] 12.2588103 7.9584847 [54,] 1.0356083 12.2588103 [55,] -4.3788413 1.0356083 [56,] -15.3214195 -4.3788413 [57,] -27.9922602 -15.3214195 [58,] -27.6101181 -27.9922602 [59,] -39.1112184 -27.6101181 [60,] -28.7455402 -39.1112184 [61,] -26.4348806 -28.7455402 [62,] -39.1679964 -26.4348806 [63,] -44.7814154 -39.1679964 [64,] -46.8760248 -44.7814154 [65,] -50.5636364 -46.8760248 [66,] -45.3141522 -50.5636364 [67,] -44.1679802 -45.3141522 [68,] -39.7748070 -44.1679802 [69,] -35.8632502 -39.7748070 [70,] -33.8392723 -35.8632502 [71,] -33.1835438 -33.8392723 [72,] -26.5101572 -33.1835438 [73,] -27.3998767 -26.5101572 [74,] -26.1500179 -27.3998767 [75,] -23.0669272 -26.1500179 [76,] -20.1516580 -23.0669272 [77,] -24.6428658 -20.1516580 [78,] -26.6717731 -24.6428658 [79,] -27.2357070 -26.6717731 [80,] -25.3564033 -27.2357070 [81,] -25.9199455 -25.3564033 [82,] -25.7243283 -25.9199455 [83,] -19.0147609 -25.7243283 [84,] -17.5160482 -19.0147609 [85,] -17.6679074 -17.5160482 [86,] -19.1125398 -17.6679074 [87,] -15.0585849 -19.1125398 [88,] -11.2042566 -15.0585849 [89,] -13.5367691 -11.2042566 [90,] -19.2612911 -13.5367691 [91,] -13.1427215 -19.2612911 [92,] -4.8856066 -13.1427215 [93,] 0.6194851 -4.8856066 [94,] 0.8496548 0.6194851 [95,] 11.4692376 0.8496548 [96,] 9.8789818 11.4692376 [97,] 10.1471533 9.8789818 [98,] 11.7145378 10.1471533 [99,] 17.1489793 11.7145378 [100,] 18.8499845 17.1489793 [101,] 19.1630713 18.8499845 [102,] 17.1268947 19.1630713 [103,] 10.9208212 17.1268947 [104,] 12.8619913 10.9208212 [105,] 16.3775542 12.8619913 [106,] 20.5955996 16.3775542 [107,] 26.5423597 20.5955996 [108,] 31.5533794 26.5423597 [109,] 26.7409891 31.5533794 [110,] 29.3773713 26.7409891 [111,] 32.9770637 29.3773713 [112,] 29.6978111 32.9770637 [113,] 30.7461781 29.6978111 [114,] 32.9955409 30.7461781 [115,] 37.2285265 32.9955409 [116,] 39.2880573 37.2285265 [117,] 33.8326640 39.2880573 [118,] 33.4200877 33.8326640 [119,] 40.6453605 33.4200877 [120,] 43.2710694 40.6453605 [121,] 35.6585578 43.2710694 [122,] 30.3112087 35.6585578 [123,] 13.3893983 30.3112087 [124,] 11.2120889 13.3893983 [125,] 3.3725956 11.2120889 [126,] 7.9345540 3.3725956 [127,] 6.9376608 7.9345540 [128,] -3.2594392 6.9376608 [129,] -4.3992623 -3.2594392 [130,] -1.7048286 -4.3992623 [131,] -8.0810432 -1.7048286 [132,] -19.6858362 -8.0810432 [133,] -29.1723232 -19.6858362 [134,] -35.5098090 -29.1723232 [135,] -35.9459309 -35.5098090 [136,] -43.8480062 -35.9459309 [137,] -43.1227950 -43.8480062 [138,] -37.6764375 -43.1227950 [139,] -32.4891880 -37.6764375 [140,] -31.6902343 -32.4891880 [141,] -22.6424564 -31.6902343 [142,] -15.9545185 -22.6424564 [143,] -9.1148145 -15.9545185 [144,] -9.7099113 -9.1148145 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -45.5283849 -46.8492118 2 -42.9786934 -45.5283849 3 -35.0750103 -42.9786934 4 -25.9101509 -35.0750103 5 -17.6228153 -25.9101509 6 -23.8465177 -17.6228153 7 -16.5492681 -23.8465177 8 -11.2926506 -16.5492681 9 -7.9614729 -11.2926506 10 -25.4516378 -7.9614729 11 -33.8273505 -25.4516378 12 -24.8754359 -33.8273505 13 -14.9651708 -24.8754359 14 -12.3340227 -14.9651708 15 -4.8584746 -12.3340227 16 -4.0507617 -4.8584746 17 -0.8299358 -4.0507617 18 3.3744954 -0.8299358 19 -1.7096058 3.3744954 20 5.1970271 -1.7096058 21 1.1326806 5.1970271 22 5.7984190 1.1326806 23 7.1452405 5.7984190 24 19.2982172 7.1452405 25 32.3519728 19.2982172 26 48.6247755 32.3519728 27 41.8367273 48.6247755 28 57.2672015 41.8367273 29 63.2360397 57.2672015 30 61.1342943 63.2360397 31 55.4798754 61.1342943 32 51.7066910 55.4798754 33 54.6056676 51.7066910 34 62.0026048 54.6056676 35 56.2397148 62.0026048 36 63.8909617 56.2397148 37 47.8502107 63.8909617 38 42.7723151 47.8502107 39 44.9078939 42.7723151 40 27.0552874 44.9078939 41 21.5421226 27.0552874 42 29.1687840 21.5421226 43 29.1064280 29.1687840 44 22.5267938 29.1064280 45 18.2105962 22.5267938 46 7.6183377 18.2105962 47 0.2908184 7.6183377 48 5.9995312 0.2908184 49 8.4196597 5.9995312 50 12.4528708 8.4196597 51 8.5262807 12.4528708 52 7.9584847 8.5262807 53 12.2588103 7.9584847 54 1.0356083 12.2588103 55 -4.3788413 1.0356083 56 -15.3214195 -4.3788413 57 -27.9922602 -15.3214195 58 -27.6101181 -27.9922602 59 -39.1112184 -27.6101181 60 -28.7455402 -39.1112184 61 -26.4348806 -28.7455402 62 -39.1679964 -26.4348806 63 -44.7814154 -39.1679964 64 -46.8760248 -44.7814154 65 -50.5636364 -46.8760248 66 -45.3141522 -50.5636364 67 -44.1679802 -45.3141522 68 -39.7748070 -44.1679802 69 -35.8632502 -39.7748070 70 -33.8392723 -35.8632502 71 -33.1835438 -33.8392723 72 -26.5101572 -33.1835438 73 -27.3998767 -26.5101572 74 -26.1500179 -27.3998767 75 -23.0669272 -26.1500179 76 -20.1516580 -23.0669272 77 -24.6428658 -20.1516580 78 -26.6717731 -24.6428658 79 -27.2357070 -26.6717731 80 -25.3564033 -27.2357070 81 -25.9199455 -25.3564033 82 -25.7243283 -25.9199455 83 -19.0147609 -25.7243283 84 -17.5160482 -19.0147609 85 -17.6679074 -17.5160482 86 -19.1125398 -17.6679074 87 -15.0585849 -19.1125398 88 -11.2042566 -15.0585849 89 -13.5367691 -11.2042566 90 -19.2612911 -13.5367691 91 -13.1427215 -19.2612911 92 -4.8856066 -13.1427215 93 0.6194851 -4.8856066 94 0.8496548 0.6194851 95 11.4692376 0.8496548 96 9.8789818 11.4692376 97 10.1471533 9.8789818 98 11.7145378 10.1471533 99 17.1489793 11.7145378 100 18.8499845 17.1489793 101 19.1630713 18.8499845 102 17.1268947 19.1630713 103 10.9208212 17.1268947 104 12.8619913 10.9208212 105 16.3775542 12.8619913 106 20.5955996 16.3775542 107 26.5423597 20.5955996 108 31.5533794 26.5423597 109 26.7409891 31.5533794 110 29.3773713 26.7409891 111 32.9770637 29.3773713 112 29.6978111 32.9770637 113 30.7461781 29.6978111 114 32.9955409 30.7461781 115 37.2285265 32.9955409 116 39.2880573 37.2285265 117 33.8326640 39.2880573 118 33.4200877 33.8326640 119 40.6453605 33.4200877 120 43.2710694 40.6453605 121 35.6585578 43.2710694 122 30.3112087 35.6585578 123 13.3893983 30.3112087 124 11.2120889 13.3893983 125 3.3725956 11.2120889 126 7.9345540 3.3725956 127 6.9376608 7.9345540 128 -3.2594392 6.9376608 129 -4.3992623 -3.2594392 130 -1.7048286 -4.3992623 131 -8.0810432 -1.7048286 132 -19.6858362 -8.0810432 133 -29.1723232 -19.6858362 134 -35.5098090 -29.1723232 135 -35.9459309 -35.5098090 136 -43.8480062 -35.9459309 137 -43.1227950 -43.8480062 138 -37.6764375 -43.1227950 139 -32.4891880 -37.6764375 140 -31.6902343 -32.4891880 141 -22.6424564 -31.6902343 142 -15.9545185 -22.6424564 143 -9.1148145 -15.9545185 144 -9.7099113 -9.1148145 > 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/7xj931260702576.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/8nuo21260702576.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/9gaol1260702576.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/104hwl1260702576.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/117cg01260702576.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/12t9x11260702576.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/13dt4h1260702576.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/14plmv1260702576.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/15uuom1260702576.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/16lszt1260702576.tab") + } > > try(system("convert tmp/1eu4d1260702576.ps tmp/1eu4d1260702576.png",intern=TRUE)) character(0) > try(system("convert tmp/2kk271260702576.ps tmp/2kk271260702576.png",intern=TRUE)) character(0) > try(system("convert tmp/39lof1260702576.ps tmp/39lof1260702576.png",intern=TRUE)) character(0) > try(system("convert tmp/4idme1260702576.ps tmp/4idme1260702576.png",intern=TRUE)) character(0) > try(system("convert tmp/5touf1260702576.ps tmp/5touf1260702576.png",intern=TRUE)) character(0) > try(system("convert tmp/63x271260702576.ps tmp/63x271260702576.png",intern=TRUE)) character(0) > try(system("convert tmp/7xj931260702576.ps tmp/7xj931260702576.png",intern=TRUE)) character(0) > try(system("convert tmp/8nuo21260702576.ps tmp/8nuo21260702576.png",intern=TRUE)) character(0) > try(system("convert tmp/9gaol1260702576.ps tmp/9gaol1260702576.png",intern=TRUE)) character(0) > try(system("convert tmp/104hwl1260702576.ps tmp/104hwl1260702576.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.660 1.675 4.498