R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(4 + ,1 + ,1 + ,0 + ,0 + ,0 + ,0 + ,1 + ,4 + ,0 + ,2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4 + ,1 + ,2 + ,0 + ,0 + ,0 + ,1 + ,1 + ,4 + ,0 + ,2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,2 + ,0 + ,0 + ,0 + ,0 + ,1 + ,4 + ,1 + ,2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4 + ,1 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,2 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,2 + ,0 + ,1 + ,0 + ,1 + ,0 + ,4 + ,1 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,2 + ,0 + ,1 + ,0 + ,1 + ,1 + ,4 + ,0 + ,1 + ,0 + ,1 + ,0 + ,1 + ,1 + ,4 + ,1 + ,1 + ,0 + ,1 + ,1 + ,1 + ,0 + ,4 + ,1 + ,1 + ,0 + ,0 + ,0 + ,0 + ,0 + ,4 + ,0 + ,2 + ,0 + ,0 + ,0 + ,0 + ,1 + ,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2 + ,0 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,2 + ,1 + ,0 + ,2 + ,0 + ,0 + ,0 + ,0 + ,2 + ,0 + ,0 + ,2 + ,0 + ,0 + ,1 + ,1 + ,2 + ,0 + ,0 + ,2 + ,0 + ,0 + ,0 + ,1 + ,2 + ,1 + ,0 + ,2 + ,1 + ,1 + ,0 + ,0 + ,2 + ,1 + ,0 + ,2 + ,1 + ,1 + ,1 + ,0 + ,2 + ,1 + ,0 + ,2 + ,1 + ,0 + ,0 + ,0) + ,dim=c(8 + ,154) + ,dimnames=list(c('Weeks' + ,'UseLimit' + ,'T40' + ,'T20' + ,'Used' + ,'CorrectAnalysis' + ,'Useful' + ,'Outcome') + ,1:154)) > y <- array(NA,dim=c(8,154),dimnames=list(c('Weeks','UseLimit','T40','T20','Used','CorrectAnalysis','Useful','Outcome'),1:154)) > 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' > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, 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 Weeks UseLimit T40 T20 Used CorrectAnalysis Useful Outcome 1 4 1 1 0 0 0 0 1 2 4 0 2 0 0 0 0 0 3 4 0 2 0 0 0 0 0 4 4 0 2 0 0 0 0 0 5 4 0 2 0 0 0 0 0 6 4 1 2 0 0 0 1 1 7 4 0 2 0 0 0 0 0 8 4 0 1 0 0 0 0 0 9 4 0 2 0 0 0 0 1 10 4 1 2 0 0 0 0 0 11 4 1 1 0 0 0 0 0 12 4 0 2 0 0 0 0 0 13 4 0 2 0 1 0 1 0 14 4 1 1 0 0 0 0 0 15 4 0 2 0 1 0 1 1 16 4 0 1 0 1 0 1 1 17 4 1 1 0 1 1 1 0 18 4 1 1 0 0 0 0 0 19 4 0 2 0 0 0 0 1 20 4 0 1 0 1 1 1 1 21 4 1 2 0 0 0 1 0 22 4 1 2 0 1 0 1 1 23 4 0 2 0 0 0 1 1 24 4 1 2 0 0 0 1 1 25 4 0 1 0 1 0 0 1 26 4 0 2 0 1 0 1 0 27 4 1 2 0 0 0 0 1 28 4 0 2 0 1 0 0 0 29 4 0 2 0 0 0 0 1 30 4 0 2 0 0 0 1 0 31 4 0 2 0 0 0 0 0 32 4 1 2 0 0 0 0 0 33 4 1 2 0 0 0 1 0 34 4 0 1 0 0 0 0 1 35 4 0 2 0 0 0 0 0 36 4 0 2 0 0 0 0 0 37 4 1 1 0 1 0 1 0 38 4 0 2 0 1 0 0 1 39 4 0 2 0 0 0 1 1 40 4 0 1 0 0 0 1 0 41 4 0 2 0 1 1 1 1 42 4 0 2 0 1 0 0 1 43 4 1 2 0 0 0 1 1 44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 101 2 1 0 2 0 0 0 1 102 2 0 0 2 0 0 0 0 103 2 0 0 2 0 0 0 0 104 2 0 0 2 0 0 0 0 105 2 0 0 1 1 0 0 0 106 2 0 0 2 0 0 0 0 107 2 0 0 2 0 0 0 0 108 2 1 0 1 1 0 0 0 109 2 0 0 2 0 0 0 0 110 2 1 0 2 0 0 0 0 111 2 1 0 1 1 0 1 0 112 2 0 0 1 0 0 0 0 113 2 0 0 2 1 0 0 0 114 2 1 0 1 1 0 0 0 115 2 1 0 2 0 0 0 0 116 2 0 0 2 0 0 0 0 117 2 1 0 2 0 0 0 1 118 2 1 0 2 0 0 0 0 119 2 0 0 2 0 0 0 0 120 2 0 0 2 0 0 0 1 121 2 1 0 2 0 0 0 0 122 2 0 0 2 0 0 0 0 123 2 1 0 1 1 0 0 0 124 2 0 0 2 1 0 1 1 125 2 0 0 2 0 0 0 1 126 2 0 0 1 0 0 0 0 127 2 0 0 2 0 0 1 0 128 2 0 0 2 0 0 0 1 129 2 0 0 2 0 0 0 0 130 2 0 0 2 0 0 0 1 131 2 1 0 2 0 0 0 0 132 2 1 0 2 0 0 0 1 133 2 1 0 2 1 0 0 0 134 2 0 0 2 0 0 0 0 135 2 0 0 2 0 0 0 0 136 2 0 0 2 0 0 0 0 137 2 1 0 2 1 0 1 1 138 2 1 0 1 1 0 1 1 139 2 0 0 1 0 0 0 0 140 2 0 0 2 0 0 0 0 141 2 0 0 2 1 1 0 1 142 2 0 0 1 1 0 0 1 143 2 1 0 2 0 0 0 0 144 2 0 0 2 0 0 1 1 145 2 0 0 2 0 0 1 0 146 2 0 0 1 0 0 0 1 147 2 0 0 1 1 0 0 0 148 2 0 0 1 0 0 0 0 149 2 1 0 2 0 0 0 0 150 2 0 0 2 0 0 1 1 151 2 0 0 2 0 0 0 1 152 2 1 0 2 1 1 0 0 153 2 1 0 2 1 1 1 0 154 2 1 0 2 1 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) UseLimit T40 T20 3.12216 0.02406 0.45780 -0.61593 Used CorrectAnalysis Useful Outcome -0.13095 0.29243 0.06352 0.04666 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.55289 -0.08443 0.02606 0.10970 0.55099 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.12216 0.08874 35.183 < 2e-16 *** UseLimit 0.02406 0.04148 0.580 0.562819 T40 0.45780 0.04644 9.857 < 2e-16 *** T20 -0.61593 0.04663 -13.208 < 2e-16 *** Used -0.13095 0.04869 -2.690 0.007989 ** CorrectAnalysis 0.29243 0.07920 3.692 0.000314 *** Useful 0.06352 0.04541 1.399 0.164014 Outcome 0.04666 0.03949 1.182 0.239253 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.2331 on 146 degrees of freedom Multiple R-squared: 0.9478, Adjusted R-squared: 0.9453 F-statistic: 378.5 on 7 and 146 DF, p-value: < 2.2e-16 > 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,] 9.035063e-48 1.807013e-47 1.000000e+00 [2,] 3.206263e-59 6.412525e-59 1.000000e+00 [3,] 2.795072e-84 5.590144e-84 1.000000e+00 [4,] 8.932841e-88 1.786568e-87 1.000000e+00 [5,] 3.476542e-102 6.953084e-102 1.000000e+00 [6,] 0.000000e+00 0.000000e+00 1.000000e+00 [7,] 1.321777e-141 2.643554e-141 1.000000e+00 [8,] 5.632960e-147 1.126592e-146 1.000000e+00 [9,] 2.651778e-160 5.303556e-160 1.000000e+00 [10,] 1.054769e-183 2.109538e-183 1.000000e+00 [11,] 1.713055e-215 3.426109e-215 1.000000e+00 [12,] 9.810491e-207 1.962098e-206 1.000000e+00 [13,] 1.003432e-217 2.006865e-217 1.000000e+00 [14,] 3.131727e-235 6.263453e-235 1.000000e+00 [15,] 9.336325e-253 1.867265e-252 1.000000e+00 [16,] 5.300311e-293 1.060062e-292 1.000000e+00 [17,] 9.031758e-281 1.806352e-280 1.000000e+00 [18,] 1.367809e-290 2.735619e-290 1.000000e+00 [19,] 4.426121e-310 8.852241e-310 1.000000e+00 [20,] 0.000000e+00 0.000000e+00 1.000000e+00 [21,] 0.000000e+00 0.000000e+00 1.000000e+00 [22,] 0.000000e+00 0.000000e+00 1.000000e+00 [23,] 0.000000e+00 0.000000e+00 1.000000e+00 [24,] 0.000000e+00 0.000000e+00 1.000000e+00 [25,] 0.000000e+00 0.000000e+00 1.000000e+00 [26,] 0.000000e+00 0.000000e+00 1.000000e+00 [27,] 0.000000e+00 0.000000e+00 1.000000e+00 [28,] 0.000000e+00 0.000000e+00 1.000000e+00 [29,] 0.000000e+00 0.000000e+00 1.000000e+00 [30,] 0.000000e+00 0.000000e+00 1.000000e+00 [31,] 0.000000e+00 0.000000e+00 1.000000e+00 [32,] 0.000000e+00 0.000000e+00 1.000000e+00 [33,] 0.000000e+00 0.000000e+00 1.000000e+00 [34,] 0.000000e+00 0.000000e+00 1.000000e+00 [35,] 0.000000e+00 0.000000e+00 1.000000e+00 [36,] 0.000000e+00 0.000000e+00 1.000000e+00 [37,] 0.000000e+00 0.000000e+00 1.000000e+00 [38,] 0.000000e+00 0.000000e+00 1.000000e+00 [39,] 0.000000e+00 0.000000e+00 1.000000e+00 [40,] 0.000000e+00 0.000000e+00 1.000000e+00 [41,] 0.000000e+00 0.000000e+00 1.000000e+00 [42,] 0.000000e+00 0.000000e+00 1.000000e+00 [43,] 0.000000e+00 0.000000e+00 1.000000e+00 [44,] 0.000000e+00 0.000000e+00 1.000000e+00 [45,] 0.000000e+00 0.000000e+00 1.000000e+00 [46,] 0.000000e+00 0.000000e+00 1.000000e+00 [47,] 0.000000e+00 0.000000e+00 1.000000e+00 [48,] 0.000000e+00 0.000000e+00 1.000000e+00 [49,] 0.000000e+00 0.000000e+00 1.000000e+00 [50,] 0.000000e+00 0.000000e+00 1.000000e+00 [51,] 0.000000e+00 0.000000e+00 1.000000e+00 [52,] 0.000000e+00 0.000000e+00 1.000000e+00 [53,] 0.000000e+00 0.000000e+00 1.000000e+00 [54,] 0.000000e+00 0.000000e+00 1.000000e+00 [55,] 0.000000e+00 0.000000e+00 1.000000e+00 [56,] 0.000000e+00 0.000000e+00 1.000000e+00 [57,] 0.000000e+00 0.000000e+00 1.000000e+00 [58,] 0.000000e+00 0.000000e+00 1.000000e+00 [59,] 0.000000e+00 0.000000e+00 1.000000e+00 [60,] 0.000000e+00 0.000000e+00 1.000000e+00 [61,] 0.000000e+00 0.000000e+00 1.000000e+00 [62,] 0.000000e+00 0.000000e+00 1.000000e+00 [63,] 0.000000e+00 0.000000e+00 1.000000e+00 [64,] 0.000000e+00 0.000000e+00 1.000000e+00 [65,] 0.000000e+00 0.000000e+00 1.000000e+00 [66,] 0.000000e+00 0.000000e+00 1.000000e+00 [67,] 0.000000e+00 0.000000e+00 1.000000e+00 [68,] 0.000000e+00 0.000000e+00 1.000000e+00 [69,] 0.000000e+00 0.000000e+00 1.000000e+00 [70,] 1.000000e+00 1.503792e-69 7.518959e-70 [71,] 9.999868e-01 2.643691e-05 1.321845e-05 [72,] 9.768569e-01 4.628614e-02 2.314307e-02 [73,] 1.000000e+00 2.068515e-62 1.034257e-62 [74,] 1.273462e-61 2.546925e-61 1.000000e+00 [75,] 1.000000e+00 4.830362e-68 2.415181e-68 [76,] 1.000000e+00 1.725567e-18 8.627835e-19 [77,] 1.603087e-23 3.206174e-23 1.000000e+00 [78,] 1.000000e+00 0.000000e+00 0.000000e+00 [79,] 1.000000e+00 0.000000e+00 0.000000e+00 [80,] 1.000000e+00 0.000000e+00 0.000000e+00 [81,] 1.000000e+00 0.000000e+00 0.000000e+00 [82,] 1.000000e+00 0.000000e+00 0.000000e+00 [83,] 1.000000e+00 0.000000e+00 0.000000e+00 [84,] 1.000000e+00 0.000000e+00 0.000000e+00 [85,] 1.000000e+00 0.000000e+00 0.000000e+00 [86,] 1.000000e+00 0.000000e+00 0.000000e+00 [87,] 1.000000e+00 0.000000e+00 0.000000e+00 [88,] 1.000000e+00 0.000000e+00 0.000000e+00 [89,] 1.000000e+00 0.000000e+00 0.000000e+00 [90,] 1.000000e+00 0.000000e+00 0.000000e+00 [91,] 1.000000e+00 0.000000e+00 0.000000e+00 [92,] 1.000000e+00 0.000000e+00 0.000000e+00 [93,] 1.000000e+00 0.000000e+00 0.000000e+00 [94,] 1.000000e+00 0.000000e+00 0.000000e+00 [95,] 1.000000e+00 0.000000e+00 0.000000e+00 [96,] 1.000000e+00 0.000000e+00 0.000000e+00 [97,] 1.000000e+00 0.000000e+00 0.000000e+00 [98,] 1.000000e+00 0.000000e+00 0.000000e+00 [99,] 1.000000e+00 0.000000e+00 0.000000e+00 [100,] 1.000000e+00 0.000000e+00 0.000000e+00 [101,] 1.000000e+00 0.000000e+00 0.000000e+00 [102,] 1.000000e+00 0.000000e+00 0.000000e+00 [103,] 1.000000e+00 0.000000e+00 0.000000e+00 [104,] 1.000000e+00 0.000000e+00 0.000000e+00 [105,] 1.000000e+00 0.000000e+00 0.000000e+00 [106,] 1.000000e+00 0.000000e+00 0.000000e+00 [107,] 1.000000e+00 0.000000e+00 0.000000e+00 [108,] 1.000000e+00 0.000000e+00 0.000000e+00 [109,] 1.000000e+00 0.000000e+00 0.000000e+00 [110,] 1.000000e+00 0.000000e+00 0.000000e+00 [111,] 1.000000e+00 0.000000e+00 0.000000e+00 [112,] 1.000000e+00 0.000000e+00 0.000000e+00 [113,] 1.000000e+00 0.000000e+00 0.000000e+00 [114,] 1.000000e+00 0.000000e+00 0.000000e+00 [115,] 1.000000e+00 2.092885e-315 1.046443e-315 [116,] 1.000000e+00 3.687667e-296 1.843834e-296 [117,] 1.000000e+00 1.509910e-285 7.549552e-286 [118,] 1.000000e+00 3.487746e-297 1.743873e-297 [119,] 1.000000e+00 7.563962e-257 3.781981e-257 [120,] 1.000000e+00 1.199428e-238 5.997139e-239 [121,] 1.000000e+00 7.710083e-222 3.855041e-222 [122,] 1.000000e+00 4.786859e-210 2.393429e-210 [123,] 1.000000e+00 6.373233e-218 3.186616e-218 [124,] 1.000000e+00 7.009818e-186 3.504909e-186 [125,] 1.000000e+00 2.371215e-162 1.185608e-162 [126,] 1.000000e+00 3.601867e-149 1.800933e-149 [127,] 1.000000e+00 1.276336e-144 6.381679e-145 [128,] 1.000000e+00 0.000000e+00 0.000000e+00 [129,] 1.000000e+00 1.100399e-103 5.501994e-104 [130,] 1.000000e+00 1.514512e-89 7.572560e-90 [131,] 1.000000e+00 4.407366e-85 2.203683e-85 [132,] 1.000000e+00 1.273573e-59 6.367866e-60 [133,] 1.000000e+00 6.259757e-48 3.129879e-48 > postscript(file="/var/wessaorg/rcomp/tmp/111pp1355473774.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/24kgi1355473774.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/3q1r41355473774.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/4cp3x1355473774.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/5svbr1355473774.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 = 154 Frequency = 1 1 2 3 4 5 0.3493153214 -0.0377648940 -0.0377648940 -0.0377648940 -0.0377648940 6 7 8 9 10 -0.1720089111 -0.0377648940 0.4200381657 -0.0844277287 -0.0618249037 11 12 13 14 15 0.3959781560 -0.0377648940 0.0296616644 0.3959781560 -0.0170011703 16 17 18 19 20 0.4408018895 0.1709768413 0.3959781560 -0.0844277287 0.1483740163 21 22 23 24 25 -0.1253460764 -0.0410611800 -0.1479489014 -0.1720089111 0.5043230622 26 27 28 29 30 0.0296616644 -0.1084877384 0.0931828371 -0.0844277287 -0.1012860667 31 32 33 34 35 -0.0377648940 -0.0618249037 -0.1253460764 0.3733753311 -0.0377648940 36 37 38 39 40 -0.0377648940 0.4634047145 0.0465200024 -0.1479489014 0.3565169930 41 42 43 44 45 -0.3094290434 0.0465200024 -0.1720089111 0.3959781560 -0.1012860667 46 47 48 49 50 -0.1479489014 -0.0377648940 -0.0844277287 -0.1479489014 -0.0377648940 51 52 53 54 55 0.5509858968 0.1709768413 -0.0844277287 -0.1992450361 -0.0377648940 56 57 58 59 60 0.5043230622 -0.0170011703 -0.0844277287 -0.0844277287 0.1243140066 61 62 63 64 65 0.3493153214 0.0296616644 -0.0377648940 0.3493153214 -0.0377648940 66 67 68 69 70 -0.0377648940 0.1950368510 -0.0618249037 -0.0844277287 0.0931828371 71 72 73 74 75 -0.0377648940 -0.0844277287 0.0465200024 0.0691228274 -0.0844277287 76 77 78 79 80 0.3098541584 -0.0844277287 -0.0170011703 0.2118951890 0.3565169930 81 82 83 84 85 -0.0377648940 0.0224599927 -0.0377648940 -0.1992450361 -0.1479489014 86 87 88 89 90 -0.0618249037 0.0389737632 -0.4460061967 0.1096966076 0.0630337729 91 92 93 94 95 0.0461754349 -0.5302910931 0.0221154252 0.1096966076 -0.5062310834 96 97 98 99 100 0.0630337729 -0.5302910931 0.1096966076 0.0856365979 0.0630337729 101 102 103 104 105 0.0389737632 0.1096966076 0.1096966076 0.1096966076 -0.3752833523 106 107 108 109 110 0.1096966076 0.1096966076 -0.3993433620 0.1096966076 0.0856365979 111 112 113 114 115 -0.4628645347 -0.5062310834 0.2406443387 -0.3993433620 0.0856365979 116 117 118 119 120 0.1096966076 0.0389737632 0.0856365979 0.1096966076 0.0630337729 121 122 123 124 125 0.0856365979 0.1096966076 -0.3993433620 0.1304603314 0.0630337729 126 127 128 129 130 -0.5062310834 0.0461754349 0.0630337729 0.1096966076 0.0630337729 131 132 133 134 135 0.0856365979 0.0389737632 0.2165843290 0.1096966076 0.1096966076 136 137 138 139 140 0.1096966076 0.1064003217 -0.5095273694 -0.5062310834 0.1096966076 141 142 143 144 145 -0.0984463691 -0.4219461870 0.0856365979 -0.0004873997 0.0461754349 146 147 148 149 150 -0.5528939181 -0.3752833523 -0.5062310834 0.0856365979 -0.0004873997 151 152 153 154 0.0630337729 -0.0758435441 -0.1393647168 0.2165843290 > postscript(file="/var/wessaorg/rcomp/tmp/6l8qd1355473774.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 = 154 Frequency = 1 lag(myerror, k = 1) myerror 0 0.3493153214 NA 1 -0.0377648940 0.3493153214 2 -0.0377648940 -0.0377648940 3 -0.0377648940 -0.0377648940 4 -0.0377648940 -0.0377648940 5 -0.1720089111 -0.0377648940 6 -0.0377648940 -0.1720089111 7 0.4200381657 -0.0377648940 8 -0.0844277287 0.4200381657 9 -0.0618249037 -0.0844277287 10 0.3959781560 -0.0618249037 11 -0.0377648940 0.3959781560 12 0.0296616644 -0.0377648940 13 0.3959781560 0.0296616644 14 -0.0170011703 0.3959781560 15 0.4408018895 -0.0170011703 16 0.1709768413 0.4408018895 17 0.3959781560 0.1709768413 18 -0.0844277287 0.3959781560 19 0.1483740163 -0.0844277287 20 -0.1253460764 0.1483740163 21 -0.0410611800 -0.1253460764 22 -0.1479489014 -0.0410611800 23 -0.1720089111 -0.1479489014 24 0.5043230622 -0.1720089111 25 0.0296616644 0.5043230622 26 -0.1084877384 0.0296616644 27 0.0931828371 -0.1084877384 28 -0.0844277287 0.0931828371 29 -0.1012860667 -0.0844277287 30 -0.0377648940 -0.1012860667 31 -0.0618249037 -0.0377648940 32 -0.1253460764 -0.0618249037 33 0.3733753311 -0.1253460764 34 -0.0377648940 0.3733753311 35 -0.0377648940 -0.0377648940 36 0.4634047145 -0.0377648940 37 0.0465200024 0.4634047145 38 -0.1479489014 0.0465200024 39 0.3565169930 -0.1479489014 40 -0.3094290434 0.3565169930 41 0.0465200024 -0.3094290434 42 -0.1720089111 0.0465200024 43 0.3959781560 -0.1720089111 44 -0.1012860667 0.3959781560 45 -0.1479489014 -0.1012860667 46 -0.0377648940 -0.1479489014 47 -0.0844277287 -0.0377648940 48 -0.1479489014 -0.0844277287 49 -0.0377648940 -0.1479489014 50 0.5509858968 -0.0377648940 51 0.1709768413 0.5509858968 52 -0.0844277287 0.1709768413 53 -0.1992450361 -0.0844277287 54 -0.0377648940 -0.1992450361 55 0.5043230622 -0.0377648940 56 -0.0170011703 0.5043230622 57 -0.0844277287 -0.0170011703 58 -0.0844277287 -0.0844277287 59 0.1243140066 -0.0844277287 60 0.3493153214 0.1243140066 61 0.0296616644 0.3493153214 62 -0.0377648940 0.0296616644 63 0.3493153214 -0.0377648940 64 -0.0377648940 0.3493153214 65 -0.0377648940 -0.0377648940 66 0.1950368510 -0.0377648940 67 -0.0618249037 0.1950368510 68 -0.0844277287 -0.0618249037 69 0.0931828371 -0.0844277287 70 -0.0377648940 0.0931828371 71 -0.0844277287 -0.0377648940 72 0.0465200024 -0.0844277287 73 0.0691228274 0.0465200024 74 -0.0844277287 0.0691228274 75 0.3098541584 -0.0844277287 76 -0.0844277287 0.3098541584 77 -0.0170011703 -0.0844277287 78 0.2118951890 -0.0170011703 79 0.3565169930 0.2118951890 80 -0.0377648940 0.3565169930 81 0.0224599927 -0.0377648940 82 -0.0377648940 0.0224599927 83 -0.1992450361 -0.0377648940 84 -0.1479489014 -0.1992450361 85 -0.0618249037 -0.1479489014 86 0.0389737632 -0.0618249037 87 -0.4460061967 0.0389737632 88 0.1096966076 -0.4460061967 89 0.0630337729 0.1096966076 90 0.0461754349 0.0630337729 91 -0.5302910931 0.0461754349 92 0.0221154252 -0.5302910931 93 0.1096966076 0.0221154252 94 -0.5062310834 0.1096966076 95 0.0630337729 -0.5062310834 96 -0.5302910931 0.0630337729 97 0.1096966076 -0.5302910931 98 0.0856365979 0.1096966076 99 0.0630337729 0.0856365979 100 0.0389737632 0.0630337729 101 0.1096966076 0.0389737632 102 0.1096966076 0.1096966076 103 0.1096966076 0.1096966076 104 -0.3752833523 0.1096966076 105 0.1096966076 -0.3752833523 106 0.1096966076 0.1096966076 107 -0.3993433620 0.1096966076 108 0.1096966076 -0.3993433620 109 0.0856365979 0.1096966076 110 -0.4628645347 0.0856365979 111 -0.5062310834 -0.4628645347 112 0.2406443387 -0.5062310834 113 -0.3993433620 0.2406443387 114 0.0856365979 -0.3993433620 115 0.1096966076 0.0856365979 116 0.0389737632 0.1096966076 117 0.0856365979 0.0389737632 118 0.1096966076 0.0856365979 119 0.0630337729 0.1096966076 120 0.0856365979 0.0630337729 121 0.1096966076 0.0856365979 122 -0.3993433620 0.1096966076 123 0.1304603314 -0.3993433620 124 0.0630337729 0.1304603314 125 -0.5062310834 0.0630337729 126 0.0461754349 -0.5062310834 127 0.0630337729 0.0461754349 128 0.1096966076 0.0630337729 129 0.0630337729 0.1096966076 130 0.0856365979 0.0630337729 131 0.0389737632 0.0856365979 132 0.2165843290 0.0389737632 133 0.1096966076 0.2165843290 134 0.1096966076 0.1096966076 135 0.1096966076 0.1096966076 136 0.1064003217 0.1096966076 137 -0.5095273694 0.1064003217 138 -0.5062310834 -0.5095273694 139 0.1096966076 -0.5062310834 140 -0.0984463691 0.1096966076 141 -0.4219461870 -0.0984463691 142 0.0856365979 -0.4219461870 143 -0.0004873997 0.0856365979 144 0.0461754349 -0.0004873997 145 -0.5528939181 0.0461754349 146 -0.3752833523 -0.5528939181 147 -0.5062310834 -0.3752833523 148 0.0856365979 -0.5062310834 149 -0.0004873997 0.0856365979 150 0.0630337729 -0.0004873997 151 -0.0758435441 0.0630337729 152 -0.1393647168 -0.0758435441 153 0.2165843290 -0.1393647168 154 NA 0.2165843290 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.0377648940 0.3493153214 [2,] -0.0377648940 -0.0377648940 [3,] -0.0377648940 -0.0377648940 [4,] -0.0377648940 -0.0377648940 [5,] -0.1720089111 -0.0377648940 [6,] -0.0377648940 -0.1720089111 [7,] 0.4200381657 -0.0377648940 [8,] -0.0844277287 0.4200381657 [9,] -0.0618249037 -0.0844277287 [10,] 0.3959781560 -0.0618249037 [11,] -0.0377648940 0.3959781560 [12,] 0.0296616644 -0.0377648940 [13,] 0.3959781560 0.0296616644 [14,] -0.0170011703 0.3959781560 [15,] 0.4408018895 -0.0170011703 [16,] 0.1709768413 0.4408018895 [17,] 0.3959781560 0.1709768413 [18,] -0.0844277287 0.3959781560 [19,] 0.1483740163 -0.0844277287 [20,] -0.1253460764 0.1483740163 [21,] -0.0410611800 -0.1253460764 [22,] -0.1479489014 -0.0410611800 [23,] -0.1720089111 -0.1479489014 [24,] 0.5043230622 -0.1720089111 [25,] 0.0296616644 0.5043230622 [26,] -0.1084877384 0.0296616644 [27,] 0.0931828371 -0.1084877384 [28,] -0.0844277287 0.0931828371 [29,] -0.1012860667 -0.0844277287 [30,] -0.0377648940 -0.1012860667 [31,] -0.0618249037 -0.0377648940 [32,] -0.1253460764 -0.0618249037 [33,] 0.3733753311 -0.1253460764 [34,] -0.0377648940 0.3733753311 [35,] -0.0377648940 -0.0377648940 [36,] 0.4634047145 -0.0377648940 [37,] 0.0465200024 0.4634047145 [38,] -0.1479489014 0.0465200024 [39,] 0.3565169930 -0.1479489014 [40,] -0.3094290434 0.3565169930 [41,] 0.0465200024 -0.3094290434 [42,] -0.1720089111 0.0465200024 [43,] 0.3959781560 -0.1720089111 [44,] -0.1012860667 0.3959781560 [45,] -0.1479489014 -0.1012860667 [46,] -0.0377648940 -0.1479489014 [47,] -0.0844277287 -0.0377648940 [48,] -0.1479489014 -0.0844277287 [49,] -0.0377648940 -0.1479489014 [50,] 0.5509858968 -0.0377648940 [51,] 0.1709768413 0.5509858968 [52,] -0.0844277287 0.1709768413 [53,] -0.1992450361 -0.0844277287 [54,] -0.0377648940 -0.1992450361 [55,] 0.5043230622 -0.0377648940 [56,] -0.0170011703 0.5043230622 [57,] -0.0844277287 -0.0170011703 [58,] -0.0844277287 -0.0844277287 [59,] 0.1243140066 -0.0844277287 [60,] 0.3493153214 0.1243140066 [61,] 0.0296616644 0.3493153214 [62,] -0.0377648940 0.0296616644 [63,] 0.3493153214 -0.0377648940 [64,] -0.0377648940 0.3493153214 [65,] -0.0377648940 -0.0377648940 [66,] 0.1950368510 -0.0377648940 [67,] -0.0618249037 0.1950368510 [68,] -0.0844277287 -0.0618249037 [69,] 0.0931828371 -0.0844277287 [70,] -0.0377648940 0.0931828371 [71,] -0.0844277287 -0.0377648940 [72,] 0.0465200024 -0.0844277287 [73,] 0.0691228274 0.0465200024 [74,] -0.0844277287 0.0691228274 [75,] 0.3098541584 -0.0844277287 [76,] -0.0844277287 0.3098541584 [77,] -0.0170011703 -0.0844277287 [78,] 0.2118951890 -0.0170011703 [79,] 0.3565169930 0.2118951890 [80,] -0.0377648940 0.3565169930 [81,] 0.0224599927 -0.0377648940 [82,] -0.0377648940 0.0224599927 [83,] -0.1992450361 -0.0377648940 [84,] -0.1479489014 -0.1992450361 [85,] -0.0618249037 -0.1479489014 [86,] 0.0389737632 -0.0618249037 [87,] -0.4460061967 0.0389737632 [88,] 0.1096966076 -0.4460061967 [89,] 0.0630337729 0.1096966076 [90,] 0.0461754349 0.0630337729 [91,] -0.5302910931 0.0461754349 [92,] 0.0221154252 -0.5302910931 [93,] 0.1096966076 0.0221154252 [94,] -0.5062310834 0.1096966076 [95,] 0.0630337729 -0.5062310834 [96,] -0.5302910931 0.0630337729 [97,] 0.1096966076 -0.5302910931 [98,] 0.0856365979 0.1096966076 [99,] 0.0630337729 0.0856365979 [100,] 0.0389737632 0.0630337729 [101,] 0.1096966076 0.0389737632 [102,] 0.1096966076 0.1096966076 [103,] 0.1096966076 0.1096966076 [104,] -0.3752833523 0.1096966076 [105,] 0.1096966076 -0.3752833523 [106,] 0.1096966076 0.1096966076 [107,] -0.3993433620 0.1096966076 [108,] 0.1096966076 -0.3993433620 [109,] 0.0856365979 0.1096966076 [110,] -0.4628645347 0.0856365979 [111,] -0.5062310834 -0.4628645347 [112,] 0.2406443387 -0.5062310834 [113,] -0.3993433620 0.2406443387 [114,] 0.0856365979 -0.3993433620 [115,] 0.1096966076 0.0856365979 [116,] 0.0389737632 0.1096966076 [117,] 0.0856365979 0.0389737632 [118,] 0.1096966076 0.0856365979 [119,] 0.0630337729 0.1096966076 [120,] 0.0856365979 0.0630337729 [121,] 0.1096966076 0.0856365979 [122,] -0.3993433620 0.1096966076 [123,] 0.1304603314 -0.3993433620 [124,] 0.0630337729 0.1304603314 [125,] -0.5062310834 0.0630337729 [126,] 0.0461754349 -0.5062310834 [127,] 0.0630337729 0.0461754349 [128,] 0.1096966076 0.0630337729 [129,] 0.0630337729 0.1096966076 [130,] 0.0856365979 0.0630337729 [131,] 0.0389737632 0.0856365979 [132,] 0.2165843290 0.0389737632 [133,] 0.1096966076 0.2165843290 [134,] 0.1096966076 0.1096966076 [135,] 0.1096966076 0.1096966076 [136,] 0.1064003217 0.1096966076 [137,] -0.5095273694 0.1064003217 [138,] -0.5062310834 -0.5095273694 [139,] 0.1096966076 -0.5062310834 [140,] -0.0984463691 0.1096966076 [141,] -0.4219461870 -0.0984463691 [142,] 0.0856365979 -0.4219461870 [143,] -0.0004873997 0.0856365979 [144,] 0.0461754349 -0.0004873997 [145,] -0.5528939181 0.0461754349 [146,] -0.3752833523 -0.5528939181 [147,] -0.5062310834 -0.3752833523 [148,] 0.0856365979 -0.5062310834 [149,] -0.0004873997 0.0856365979 [150,] 0.0630337729 -0.0004873997 [151,] -0.0758435441 0.0630337729 [152,] -0.1393647168 -0.0758435441 [153,] 0.2165843290 -0.1393647168 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.0377648940 0.3493153214 2 -0.0377648940 -0.0377648940 3 -0.0377648940 -0.0377648940 4 -0.0377648940 -0.0377648940 5 -0.1720089111 -0.0377648940 6 -0.0377648940 -0.1720089111 7 0.4200381657 -0.0377648940 8 -0.0844277287 0.4200381657 9 -0.0618249037 -0.0844277287 10 0.3959781560 -0.0618249037 11 -0.0377648940 0.3959781560 12 0.0296616644 -0.0377648940 13 0.3959781560 0.0296616644 14 -0.0170011703 0.3959781560 15 0.4408018895 -0.0170011703 16 0.1709768413 0.4408018895 17 0.3959781560 0.1709768413 18 -0.0844277287 0.3959781560 19 0.1483740163 -0.0844277287 20 -0.1253460764 0.1483740163 21 -0.0410611800 -0.1253460764 22 -0.1479489014 -0.0410611800 23 -0.1720089111 -0.1479489014 24 0.5043230622 -0.1720089111 25 0.0296616644 0.5043230622 26 -0.1084877384 0.0296616644 27 0.0931828371 -0.1084877384 28 -0.0844277287 0.0931828371 29 -0.1012860667 -0.0844277287 30 -0.0377648940 -0.1012860667 31 -0.0618249037 -0.0377648940 32 -0.1253460764 -0.0618249037 33 0.3733753311 -0.1253460764 34 -0.0377648940 0.3733753311 35 -0.0377648940 -0.0377648940 36 0.4634047145 -0.0377648940 37 0.0465200024 0.4634047145 38 -0.1479489014 0.0465200024 39 0.3565169930 -0.1479489014 40 -0.3094290434 0.3565169930 41 0.0465200024 -0.3094290434 42 -0.1720089111 0.0465200024 43 0.3959781560 -0.1720089111 44 -0.1012860667 0.3959781560 45 -0.1479489014 -0.1012860667 46 -0.0377648940 -0.1479489014 47 -0.0844277287 -0.0377648940 48 -0.1479489014 -0.0844277287 49 -0.0377648940 -0.1479489014 50 0.5509858968 -0.0377648940 51 0.1709768413 0.5509858968 52 -0.0844277287 0.1709768413 53 -0.1992450361 -0.0844277287 54 -0.0377648940 -0.1992450361 55 0.5043230622 -0.0377648940 56 -0.0170011703 0.5043230622 57 -0.0844277287 -0.0170011703 58 -0.0844277287 -0.0844277287 59 0.1243140066 -0.0844277287 60 0.3493153214 0.1243140066 61 0.0296616644 0.3493153214 62 -0.0377648940 0.0296616644 63 0.3493153214 -0.0377648940 64 -0.0377648940 0.3493153214 65 -0.0377648940 -0.0377648940 66 0.1950368510 -0.0377648940 67 -0.0618249037 0.1950368510 68 -0.0844277287 -0.0618249037 69 0.0931828371 -0.0844277287 70 -0.0377648940 0.0931828371 71 -0.0844277287 -0.0377648940 72 0.0465200024 -0.0844277287 73 0.0691228274 0.0465200024 74 -0.0844277287 0.0691228274 75 0.3098541584 -0.0844277287 76 -0.0844277287 0.3098541584 77 -0.0170011703 -0.0844277287 78 0.2118951890 -0.0170011703 79 0.3565169930 0.2118951890 80 -0.0377648940 0.3565169930 81 0.0224599927 -0.0377648940 82 -0.0377648940 0.0224599927 83 -0.1992450361 -0.0377648940 84 -0.1479489014 -0.1992450361 85 -0.0618249037 -0.1479489014 86 0.0389737632 -0.0618249037 87 -0.4460061967 0.0389737632 88 0.1096966076 -0.4460061967 89 0.0630337729 0.1096966076 90 0.0461754349 0.0630337729 91 -0.5302910931 0.0461754349 92 0.0221154252 -0.5302910931 93 0.1096966076 0.0221154252 94 -0.5062310834 0.1096966076 95 0.0630337729 -0.5062310834 96 -0.5302910931 0.0630337729 97 0.1096966076 -0.5302910931 98 0.0856365979 0.1096966076 99 0.0630337729 0.0856365979 100 0.0389737632 0.0630337729 101 0.1096966076 0.0389737632 102 0.1096966076 0.1096966076 103 0.1096966076 0.1096966076 104 -0.3752833523 0.1096966076 105 0.1096966076 -0.3752833523 106 0.1096966076 0.1096966076 107 -0.3993433620 0.1096966076 108 0.1096966076 -0.3993433620 109 0.0856365979 0.1096966076 110 -0.4628645347 0.0856365979 111 -0.5062310834 -0.4628645347 112 0.2406443387 -0.5062310834 113 -0.3993433620 0.2406443387 114 0.0856365979 -0.3993433620 115 0.1096966076 0.0856365979 116 0.0389737632 0.1096966076 117 0.0856365979 0.0389737632 118 0.1096966076 0.0856365979 119 0.0630337729 0.1096966076 120 0.0856365979 0.0630337729 121 0.1096966076 0.0856365979 122 -0.3993433620 0.1096966076 123 0.1304603314 -0.3993433620 124 0.0630337729 0.1304603314 125 -0.5062310834 0.0630337729 126 0.0461754349 -0.5062310834 127 0.0630337729 0.0461754349 128 0.1096966076 0.0630337729 129 0.0630337729 0.1096966076 130 0.0856365979 0.0630337729 131 0.0389737632 0.0856365979 132 0.2165843290 0.0389737632 133 0.1096966076 0.2165843290 134 0.1096966076 0.1096966076 135 0.1096966076 0.1096966076 136 0.1064003217 0.1096966076 137 -0.5095273694 0.1064003217 138 -0.5062310834 -0.5095273694 139 0.1096966076 -0.5062310834 140 -0.0984463691 0.1096966076 141 -0.4219461870 -0.0984463691 142 0.0856365979 -0.4219461870 143 -0.0004873997 0.0856365979 144 0.0461754349 -0.0004873997 145 -0.5528939181 0.0461754349 146 -0.3752833523 -0.5528939181 147 -0.5062310834 -0.3752833523 148 0.0856365979 -0.5062310834 149 -0.0004873997 0.0856365979 150 0.0630337729 -0.0004873997 151 -0.0758435441 0.0630337729 152 -0.1393647168 -0.0758435441 153 0.2165843290 -0.1393647168 > 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/7uwfl1355473774.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/8cit21355473774.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/9wz2n1355473774.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/10bvoe1355473774.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/1130v01355473774.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/124h6o1355473774.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/131zcn1355473774.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/1439y01355473774.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/15srrs1355473774.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/16w9s71355473774.tab") + } > > try(system("convert tmp/111pp1355473774.ps tmp/111pp1355473774.png",intern=TRUE)) character(0) > try(system("convert tmp/24kgi1355473774.ps tmp/24kgi1355473774.png",intern=TRUE)) character(0) > try(system("convert tmp/3q1r41355473774.ps tmp/3q1r41355473774.png",intern=TRUE)) character(0) > try(system("convert tmp/4cp3x1355473774.ps tmp/4cp3x1355473774.png",intern=TRUE)) character(0) > try(system("convert tmp/5svbr1355473774.ps tmp/5svbr1355473774.png",intern=TRUE)) character(0) > try(system("convert tmp/6l8qd1355473774.ps tmp/6l8qd1355473774.png",intern=TRUE)) character(0) > try(system("convert tmp/7uwfl1355473774.ps tmp/7uwfl1355473774.png",intern=TRUE)) character(0) > try(system("convert tmp/8cit21355473774.ps tmp/8cit21355473774.png",intern=TRUE)) character(0) > try(system("convert tmp/9wz2n1355473774.ps tmp/9wz2n1355473774.png",intern=TRUE)) character(0) > try(system("convert tmp/10bvoe1355473774.ps tmp/10bvoe1355473774.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.243 1.005 9.337