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(1 + ,1 + ,1 + ,9 + ,1 + ,1 + ,1 + ,0 + ,0 + ,9 + ,1 + ,0 + ,1 + ,0 + ,0 + ,9 + ,1 + ,0 + ,1 + ,0 + ,0 + ,9 + ,1 + ,0 + ,1 + ,0 + ,0 + ,9 + ,1 + ,0 + ,1 + ,1 + ,0 + ,9 + ,1 + ,1 + ,1 + ,0 + ,0 + ,9 + ,1 + ,0 + ,1 + ,0 + ,1 + ,9 + ,1 + ,0 + ,1 + ,0 + ,0 + ,9 + ,1 + ,1 + ,1 + ,1 + ,0 + ,9 + ,1 + ,0 + ,1 + ,1 + ,1 + ,9 + ,1 + ,0 + ,1 + ,0 + ,0 + ,9 + ,1 + ,0 + ,1 + ,0 + ,0 + ,9 + ,0 + ,0 + ,1 + ,1 + ,1 + ,9 + ,1 + ,0 + ,1 + ,0 + ,0 + ,9 + ,0 + ,1 + ,1 + ,0 + ,1 + ,9 + ,0 + ,1 + ,1 + ,1 + ,1 + ,9 + ,0 + ,0 + ,1 + ,1 + ,1 + ,9 + ,1 + ,0 + ,1 + ,0 + ,0 + ,9 + ,1 + ,1 + ,1 + ,0 + ,1 + ,9 + ,0 + ,1 + ,1 + ,1 + ,0 + ,9 + ,1 + ,0 + ,1 + ,1 + ,0 + ,9 + ,0 + ,1 + ,1 + ,0 + ,0 + ,9 + ,1 + ,1 + ,1 + ,1 + ,0 + ,9 + ,1 + ,1 + ,1 + ,0 + ,1 + ,9 + ,0 + ,1 + ,1 + ,0 + ,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+ ,1 + ,9 + ,0 + ,9 + ,0 + ,1 + ,0 + ,9 + ,0 + ,9 + ,0 + ,1 + ,1 + ,9 + ,1 + ,9 + ,0 + ,1 + ,0 + ,9 + ,1 + ,9 + ,0 + ,1 + ,1 + ,9 + ,1 + ,9 + ,0 + ,0 + ,0 + ,9 + ,0 + ,9 + ,0 + ,1 + ,0 + ,9 + ,0 + ,9 + ,0 + ,1 + ,0 + ,9 + ,0 + ,9 + ,0 + ,1 + ,0 + ,9 + ,1 + ,9 + ,0 + ,0 + ,1 + ,9 + ,1 + ,9 + ,1 + ,0 + ,1 + ,9 + ,0 + ,9 + ,1 + ,1 + ,0 + ,9 + ,0 + ,9 + ,0 + ,1 + ,0 + ,9 + ,0 + ,9 + ,0 + ,0 + ,1 + ,9 + ,0 + ,9 + ,1 + ,0 + ,1 + ,9 + ,1 + ,9 + ,0 + ,1 + ,0 + ,9 + ,0 + ,9 + ,0 + ,1 + ,1 + ,9 + ,0 + ,9 + ,0 + ,1 + ,0 + ,9 + ,0 + ,9 + ,1 + ,1 + ,1 + ,9 + ,0 + ,9 + ,1 + ,0 + ,0 + ,9 + ,0 + ,9 + ,1 + ,1 + ,0 + ,9 + ,1 + ,9 + ,0 + ,1 + ,0 + ,9 + ,0 + ,9 + ,0 + ,1 + ,1 + ,9 + ,0 + ,9 + ,0 + ,1 + ,1 + ,9 + ,1 + ,9 + ,0 + ,0 + ,0 + ,9 + ,1 + ,9 + ,0 + ,0 + ,0 + ,9 + ,1 + ,9 + ,0 + ,0 + ,0) + ,dim=c(6 + ,154) + ,dimnames=list(c('Weeks' + ,'UseLimit' + ,'T40' + ,'T20' + ,'Used' + ,'Outcome') + ,1:154)) > y <- array(NA,dim=c(6,154),dimnames=list(c('Weeks','UseLimit','T40','T20','Used','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' > par3 <- 'No Linear Trend' > par2 <- 'Do not include Seasonal Dummies' > par1 <- '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo 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 Outcome 1 1 1 1 9 1 1 2 1 0 0 9 1 0 3 1 0 0 9 1 0 4 1 0 0 9 1 0 5 1 0 0 9 1 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79 1 0 1 9 0 1 80 1 0 1 9 1 0 81 1 0 0 9 1 0 82 1 1 0 9 0 1 83 1 0 0 9 1 0 84 1 0 0 9 0 0 85 1 0 0 9 1 1 86 1 1 0 9 1 0 87 9 1 9 0 1 1 88 9 1 9 1 0 1 89 9 0 9 0 1 0 90 9 0 9 0 1 1 91 9 0 9 0 1 0 92 9 1 9 1 1 0 93 9 1 9 0 1 0 94 9 0 9 0 1 0 95 9 0 9 1 1 0 96 9 0 9 0 1 1 97 9 1 9 1 1 0 98 9 0 9 0 1 0 99 9 1 9 0 1 0 100 9 0 9 0 1 1 101 9 1 9 0 1 1 102 9 0 9 0 1 0 103 9 0 9 0 1 0 104 9 0 9 0 1 0 105 9 0 9 1 0 0 106 9 0 9 0 1 0 107 9 0 9 0 1 0 108 9 1 9 1 0 0 109 9 0 9 0 1 0 110 9 1 9 0 1 0 111 9 1 9 1 0 0 112 9 0 9 1 1 0 113 9 0 9 0 0 0 114 9 1 9 1 0 0 115 9 1 9 0 1 0 116 9 0 9 0 1 0 117 9 1 9 0 1 1 118 9 1 9 0 1 0 119 9 0 9 0 1 0 120 9 0 9 0 1 1 121 9 1 9 0 1 0 122 9 0 9 0 1 0 123 9 1 9 1 0 0 124 9 0 9 0 0 1 125 9 0 9 0 1 1 126 9 0 9 1 1 0 127 9 0 9 0 1 0 128 9 0 9 0 1 1 129 9 0 9 0 1 0 130 9 0 9 0 1 1 131 9 1 9 0 1 0 132 9 1 9 0 1 1 133 9 1 9 0 0 0 134 9 0 9 0 1 0 135 9 0 9 0 1 0 136 9 0 9 0 1 0 137 9 1 9 0 0 1 138 9 1 9 1 0 1 139 9 0 9 1 1 0 140 9 0 9 0 1 0 141 9 0 9 0 0 1 142 9 0 9 1 0 1 143 9 1 9 0 1 0 144 9 0 9 0 1 1 145 9 0 9 0 1 0 146 9 0 9 1 1 1 147 9 0 9 1 0 0 148 9 0 9 1 1 0 149 9 1 9 0 1 0 150 9 0 9 0 1 1 151 9 0 9 0 1 1 152 9 1 9 0 0 0 153 9 1 9 0 0 0 154 9 1 9 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) UseLimit T40 T20 Used Outcome 5.68564 -0.03373 0.38749 -0.52554 -0.04063 -0.02994 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.34327 -0.13241 0.04422 0.11480 0.42686 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 5.68564 0.36756 15.468 <2e-16 *** UseLimit -0.03373 0.03559 -0.948 0.345 T40 0.38749 0.03899 9.939 <2e-16 *** T20 -0.52554 0.03893 -13.501 <2e-16 *** Used -0.04063 0.03733 -1.089 0.278 Outcome -0.02994 0.03371 -0.888 0.376 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.2007 on 148 degrees of freedom Multiple R-squared: 0.9975, Adjusted R-squared: 0.9975 F-statistic: 1.204e+04 on 5 and 148 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,] 2.578480e-47 5.156960e-47 1.000000e+00 [2,] 7.449317e-63 1.489863e-62 1.000000e+00 [3,] 8.521586e-82 1.704317e-81 1.000000e+00 [4,] 1.292513e-91 2.585026e-91 1.000000e+00 [5,] 2.509596e-121 5.019193e-121 1.000000e+00 [6,] 5.743564e-121 1.148713e-120 1.000000e+00 [7,] 4.895640e-136 9.791281e-136 1.000000e+00 [8,] 0.000000e+00 0.000000e+00 1.000000e+00 [9,] 1.015762e-178 2.031523e-178 1.000000e+00 [10,] 1.332643e-182 2.665285e-182 1.000000e+00 [11,] 2.283054e-196 4.566108e-196 1.000000e+00 [12,] 1.180583e-221 2.361167e-221 1.000000e+00 [13,] 1.224880e-256 2.449760e-256 1.000000e+00 [14,] 6.572175e-245 1.314435e-244 1.000000e+00 [15,] 7.417348e-256 1.483470e-255 1.000000e+00 [16,] 3.615286e-274 7.230571e-274 1.000000e+00 [17,] 7.189364e-293 1.437873e-292 1.000000e+00 [18,] 0.000000e+00 0.000000e+00 1.000000e+00 [19,] 7.213358e-322 1.442672e-321 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,] 0.000000e+00 0.000000e+00 1.000000e+00 [71,] 0.000000e+00 0.000000e+00 1.000000e+00 [72,] 2.281906e-23 4.563811e-23 1.000000e+00 [73,] 5.556913e-56 1.111383e-55 1.000000e+00 [74,] 4.349730e-44 8.699461e-44 1.000000e+00 [75,] 2.073349e-24 4.146699e-24 1.000000e+00 [76,] 6.374779e-172 1.274956e-171 1.000000e+00 [77,] 9.999944e-01 1.112182e-05 5.560908e-06 [78,] 8.221221e-49 1.644244e-48 1.000000e+00 [79,] 1.000000e+00 1.777852e-18 8.889260e-19 [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 0.000000e+00 0.000000e+00 [116,] 1.000000e+00 0.000000e+00 0.000000e+00 [117,] 1.000000e+00 0.000000e+00 0.000000e+00 [118,] 1.000000e+00 4.826377e-313 2.413188e-313 [119,] 1.000000e+00 1.264339e-300 6.321695e-301 [120,] 1.000000e+00 2.703279e-291 1.351639e-291 [121,] 1.000000e+00 1.675966e-273 8.379832e-274 [122,] 1.000000e+00 1.084476e-260 5.422379e-261 [123,] 1.000000e+00 5.198790e-238 2.599395e-238 [124,] 1.000000e+00 1.364114e-226 6.820572e-227 [125,] 1.000000e+00 8.957889e-215 4.478944e-215 [126,] 1.000000e+00 5.351167e-207 2.675583e-207 [127,] 1.000000e+00 7.336799e-184 3.668399e-184 [128,] 1.000000e+00 4.165531e-169 2.082765e-169 [129,] 1.000000e+00 2.352829e-154 1.176414e-154 [130,] 1.000000e+00 0.000000e+00 0.000000e+00 [131,] 1.000000e+00 5.426539e-125 2.713270e-125 [132,] 1.000000e+00 3.536328e-111 1.768164e-111 [133,] 1.000000e+00 3.160536e-101 1.580268e-101 [134,] 1.000000e+00 1.319736e-84 6.598679e-85 [135,] 1.000000e+00 1.096266e-72 5.481332e-73 [136,] 1.000000e+00 2.468431e-59 1.234216e-59 [137,] 1.000000e+00 4.674241e-90 2.337121e-90 > postscript(file="/var/wessaorg/rcomp/tmp/19ur21355750863.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/2ucq71355750863.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/3hw8a1355750863.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/4nj2i1355750863.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/5sg8q1355750863.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 6 -0.23896019 0.08485233 0.08485233 0.08485233 0.08485233 0.14852895 7 8 9 10 11 12 0.08485233 -0.30263680 0.11479614 0.11858514 -0.26890400 0.08485233 13 14 15 16 17 18 0.04422281 -0.26890400 0.07416662 -0.31332252 -0.30953352 -0.26890400 19 20 21 22 23 24 0.11479614 -0.31332252 0.11858514 0.10789942 0.11479614 0.14852895 25 26 27 28 29 30 -0.31332252 0.04422281 0.14852895 0.04422281 0.11479614 0.08485233 31 32 33 34 35 36 0.08485233 0.11858514 0.11858514 -0.27269299 0.08485233 0.08485233 37 38 39 40 41 42 -0.30953352 0.07416662 0.11479614 -0.30263680 0.07416662 0.07416662 43 44 45 46 47 48 0.14852895 -0.26890400 0.08485233 0.11479614 0.08485233 0.11479614 49 50 51 52 53 54 0.11479614 0.08485233 -0.34326633 -0.30953352 0.11479614 0.04422281 55 56 57 58 59 60 0.08485233 -0.31332252 0.07416662 0.11479614 0.11479614 -0.27958971 61 62 63 64 65 66 -0.23896019 0.04422281 0.08485233 -0.23896019 0.08485233 0.08485233 67 68 69 70 71 72 -0.34326633 0.11858514 0.11479614 0.04422281 0.08485233 0.11479614 73 74 75 76 77 78 0.07416662 0.07795561 0.11479614 -0.27269299 0.11479614 0.07416662 79 80 81 82 83 84 -0.31332252 -0.30263680 0.08485233 0.10789942 0.08485233 0.04422281 85 86 87 88 89 90 0.11479614 0.11858514 -0.06873693 0.41617395 -0.13241355 -0.10246974 91 92 93 94 95 96 -0.13241355 0.42685966 -0.09868075 -0.13241355 0.39312685 -0.10246974 97 98 99 100 101 102 0.42685966 -0.13241355 -0.09868075 -0.10246974 -0.06873693 -0.13241355 103 104 105 106 107 108 -0.13241355 -0.13241355 0.35249733 -0.13241355 -0.13241355 0.38623014 109 110 111 112 113 114 -0.13241355 -0.09868075 0.38623014 0.39312685 -0.17304308 0.38623014 115 116 117 118 119 120 -0.09868075 -0.13241355 -0.06873693 -0.09868075 -0.13241355 -0.10246974 121 122 123 124 125 126 -0.09868075 -0.13241355 0.38623014 -0.14309926 -0.10246974 0.39312685 127 128 129 130 131 132 -0.13241355 -0.10246974 -0.13241355 -0.10246974 -0.09868075 -0.06873693 133 134 135 136 137 138 -0.13931027 -0.13241355 -0.13241355 -0.13241355 -0.10936646 0.41617395 139 140 141 142 143 144 0.39312685 -0.13241355 -0.14309926 0.38244114 -0.09868075 -0.10246974 145 146 147 148 149 150 -0.13241355 0.42307067 0.35249733 0.39312685 -0.09868075 -0.10246974 151 152 153 154 -0.10246974 -0.13931027 -0.13931027 -0.13931027 > postscript(file="/var/wessaorg/rcomp/tmp/6hijf1355750863.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.23896019 NA 1 0.08485233 -0.23896019 2 0.08485233 0.08485233 3 0.08485233 0.08485233 4 0.08485233 0.08485233 5 0.14852895 0.08485233 6 0.08485233 0.14852895 7 -0.30263680 0.08485233 8 0.11479614 -0.30263680 9 0.11858514 0.11479614 10 -0.26890400 0.11858514 11 0.08485233 -0.26890400 12 0.04422281 0.08485233 13 -0.26890400 0.04422281 14 0.07416662 -0.26890400 15 -0.31332252 0.07416662 16 -0.30953352 -0.31332252 17 -0.26890400 -0.30953352 18 0.11479614 -0.26890400 19 -0.31332252 0.11479614 20 0.11858514 -0.31332252 21 0.10789942 0.11858514 22 0.11479614 0.10789942 23 0.14852895 0.11479614 24 -0.31332252 0.14852895 25 0.04422281 -0.31332252 26 0.14852895 0.04422281 27 0.04422281 0.14852895 28 0.11479614 0.04422281 29 0.08485233 0.11479614 30 0.08485233 0.08485233 31 0.11858514 0.08485233 32 0.11858514 0.11858514 33 -0.27269299 0.11858514 34 0.08485233 -0.27269299 35 0.08485233 0.08485233 36 -0.30953352 0.08485233 37 0.07416662 -0.30953352 38 0.11479614 0.07416662 39 -0.30263680 0.11479614 40 0.07416662 -0.30263680 41 0.07416662 0.07416662 42 0.14852895 0.07416662 43 -0.26890400 0.14852895 44 0.08485233 -0.26890400 45 0.11479614 0.08485233 46 0.08485233 0.11479614 47 0.11479614 0.08485233 48 0.11479614 0.11479614 49 0.08485233 0.11479614 50 -0.34326633 0.08485233 51 -0.30953352 -0.34326633 52 0.11479614 -0.30953352 53 0.04422281 0.11479614 54 0.08485233 0.04422281 55 -0.31332252 0.08485233 56 0.07416662 -0.31332252 57 0.11479614 0.07416662 58 0.11479614 0.11479614 59 -0.27958971 0.11479614 60 -0.23896019 -0.27958971 61 0.04422281 -0.23896019 62 0.08485233 0.04422281 63 -0.23896019 0.08485233 64 0.08485233 -0.23896019 65 0.08485233 0.08485233 66 -0.34326633 0.08485233 67 0.11858514 -0.34326633 68 0.11479614 0.11858514 69 0.04422281 0.11479614 70 0.08485233 0.04422281 71 0.11479614 0.08485233 72 0.07416662 0.11479614 73 0.07795561 0.07416662 74 0.11479614 0.07795561 75 -0.27269299 0.11479614 76 0.11479614 -0.27269299 77 0.07416662 0.11479614 78 -0.31332252 0.07416662 79 -0.30263680 -0.31332252 80 0.08485233 -0.30263680 81 0.10789942 0.08485233 82 0.08485233 0.10789942 83 0.04422281 0.08485233 84 0.11479614 0.04422281 85 0.11858514 0.11479614 86 -0.06873693 0.11858514 87 0.41617395 -0.06873693 88 -0.13241355 0.41617395 89 -0.10246974 -0.13241355 90 -0.13241355 -0.10246974 91 0.42685966 -0.13241355 92 -0.09868075 0.42685966 93 -0.13241355 -0.09868075 94 0.39312685 -0.13241355 95 -0.10246974 0.39312685 96 0.42685966 -0.10246974 97 -0.13241355 0.42685966 98 -0.09868075 -0.13241355 99 -0.10246974 -0.09868075 100 -0.06873693 -0.10246974 101 -0.13241355 -0.06873693 102 -0.13241355 -0.13241355 103 -0.13241355 -0.13241355 104 0.35249733 -0.13241355 105 -0.13241355 0.35249733 106 -0.13241355 -0.13241355 107 0.38623014 -0.13241355 108 -0.13241355 0.38623014 109 -0.09868075 -0.13241355 110 0.38623014 -0.09868075 111 0.39312685 0.38623014 112 -0.17304308 0.39312685 113 0.38623014 -0.17304308 114 -0.09868075 0.38623014 115 -0.13241355 -0.09868075 116 -0.06873693 -0.13241355 117 -0.09868075 -0.06873693 118 -0.13241355 -0.09868075 119 -0.10246974 -0.13241355 120 -0.09868075 -0.10246974 121 -0.13241355 -0.09868075 122 0.38623014 -0.13241355 123 -0.14309926 0.38623014 124 -0.10246974 -0.14309926 125 0.39312685 -0.10246974 126 -0.13241355 0.39312685 127 -0.10246974 -0.13241355 128 -0.13241355 -0.10246974 129 -0.10246974 -0.13241355 130 -0.09868075 -0.10246974 131 -0.06873693 -0.09868075 132 -0.13931027 -0.06873693 133 -0.13241355 -0.13931027 134 -0.13241355 -0.13241355 135 -0.13241355 -0.13241355 136 -0.10936646 -0.13241355 137 0.41617395 -0.10936646 138 0.39312685 0.41617395 139 -0.13241355 0.39312685 140 -0.14309926 -0.13241355 141 0.38244114 -0.14309926 142 -0.09868075 0.38244114 143 -0.10246974 -0.09868075 144 -0.13241355 -0.10246974 145 0.42307067 -0.13241355 146 0.35249733 0.42307067 147 0.39312685 0.35249733 148 -0.09868075 0.39312685 149 -0.10246974 -0.09868075 150 -0.10246974 -0.10246974 151 -0.13931027 -0.10246974 152 -0.13931027 -0.13931027 153 -0.13931027 -0.13931027 154 NA -0.13931027 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.08485233 -0.23896019 [2,] 0.08485233 0.08485233 [3,] 0.08485233 0.08485233 [4,] 0.08485233 0.08485233 [5,] 0.14852895 0.08485233 [6,] 0.08485233 0.14852895 [7,] -0.30263680 0.08485233 [8,] 0.11479614 -0.30263680 [9,] 0.11858514 0.11479614 [10,] -0.26890400 0.11858514 [11,] 0.08485233 -0.26890400 [12,] 0.04422281 0.08485233 [13,] -0.26890400 0.04422281 [14,] 0.07416662 -0.26890400 [15,] -0.31332252 0.07416662 [16,] -0.30953352 -0.31332252 [17,] -0.26890400 -0.30953352 [18,] 0.11479614 -0.26890400 [19,] -0.31332252 0.11479614 [20,] 0.11858514 -0.31332252 [21,] 0.10789942 0.11858514 [22,] 0.11479614 0.10789942 [23,] 0.14852895 0.11479614 [24,] -0.31332252 0.14852895 [25,] 0.04422281 -0.31332252 [26,] 0.14852895 0.04422281 [27,] 0.04422281 0.14852895 [28,] 0.11479614 0.04422281 [29,] 0.08485233 0.11479614 [30,] 0.08485233 0.08485233 [31,] 0.11858514 0.08485233 [32,] 0.11858514 0.11858514 [33,] -0.27269299 0.11858514 [34,] 0.08485233 -0.27269299 [35,] 0.08485233 0.08485233 [36,] -0.30953352 0.08485233 [37,] 0.07416662 -0.30953352 [38,] 0.11479614 0.07416662 [39,] -0.30263680 0.11479614 [40,] 0.07416662 -0.30263680 [41,] 0.07416662 0.07416662 [42,] 0.14852895 0.07416662 [43,] -0.26890400 0.14852895 [44,] 0.08485233 -0.26890400 [45,] 0.11479614 0.08485233 [46,] 0.08485233 0.11479614 [47,] 0.11479614 0.08485233 [48,] 0.11479614 0.11479614 [49,] 0.08485233 0.11479614 [50,] -0.34326633 0.08485233 [51,] -0.30953352 -0.34326633 [52,] 0.11479614 -0.30953352 [53,] 0.04422281 0.11479614 [54,] 0.08485233 0.04422281 [55,] -0.31332252 0.08485233 [56,] 0.07416662 -0.31332252 [57,] 0.11479614 0.07416662 [58,] 0.11479614 0.11479614 [59,] -0.27958971 0.11479614 [60,] -0.23896019 -0.27958971 [61,] 0.04422281 -0.23896019 [62,] 0.08485233 0.04422281 [63,] -0.23896019 0.08485233 [64,] 0.08485233 -0.23896019 [65,] 0.08485233 0.08485233 [66,] -0.34326633 0.08485233 [67,] 0.11858514 -0.34326633 [68,] 0.11479614 0.11858514 [69,] 0.04422281 0.11479614 [70,] 0.08485233 0.04422281 [71,] 0.11479614 0.08485233 [72,] 0.07416662 0.11479614 [73,] 0.07795561 0.07416662 [74,] 0.11479614 0.07795561 [75,] -0.27269299 0.11479614 [76,] 0.11479614 -0.27269299 [77,] 0.07416662 0.11479614 [78,] -0.31332252 0.07416662 [79,] -0.30263680 -0.31332252 [80,] 0.08485233 -0.30263680 [81,] 0.10789942 0.08485233 [82,] 0.08485233 0.10789942 [83,] 0.04422281 0.08485233 [84,] 0.11479614 0.04422281 [85,] 0.11858514 0.11479614 [86,] -0.06873693 0.11858514 [87,] 0.41617395 -0.06873693 [88,] -0.13241355 0.41617395 [89,] -0.10246974 -0.13241355 [90,] -0.13241355 -0.10246974 [91,] 0.42685966 -0.13241355 [92,] -0.09868075 0.42685966 [93,] -0.13241355 -0.09868075 [94,] 0.39312685 -0.13241355 [95,] -0.10246974 0.39312685 [96,] 0.42685966 -0.10246974 [97,] -0.13241355 0.42685966 [98,] -0.09868075 -0.13241355 [99,] -0.10246974 -0.09868075 [100,] -0.06873693 -0.10246974 [101,] -0.13241355 -0.06873693 [102,] -0.13241355 -0.13241355 [103,] -0.13241355 -0.13241355 [104,] 0.35249733 -0.13241355 [105,] -0.13241355 0.35249733 [106,] -0.13241355 -0.13241355 [107,] 0.38623014 -0.13241355 [108,] -0.13241355 0.38623014 [109,] -0.09868075 -0.13241355 [110,] 0.38623014 -0.09868075 [111,] 0.39312685 0.38623014 [112,] -0.17304308 0.39312685 [113,] 0.38623014 -0.17304308 [114,] -0.09868075 0.38623014 [115,] -0.13241355 -0.09868075 [116,] -0.06873693 -0.13241355 [117,] -0.09868075 -0.06873693 [118,] -0.13241355 -0.09868075 [119,] -0.10246974 -0.13241355 [120,] -0.09868075 -0.10246974 [121,] -0.13241355 -0.09868075 [122,] 0.38623014 -0.13241355 [123,] -0.14309926 0.38623014 [124,] -0.10246974 -0.14309926 [125,] 0.39312685 -0.10246974 [126,] -0.13241355 0.39312685 [127,] -0.10246974 -0.13241355 [128,] -0.13241355 -0.10246974 [129,] -0.10246974 -0.13241355 [130,] -0.09868075 -0.10246974 [131,] -0.06873693 -0.09868075 [132,] -0.13931027 -0.06873693 [133,] -0.13241355 -0.13931027 [134,] -0.13241355 -0.13241355 [135,] -0.13241355 -0.13241355 [136,] -0.10936646 -0.13241355 [137,] 0.41617395 -0.10936646 [138,] 0.39312685 0.41617395 [139,] -0.13241355 0.39312685 [140,] -0.14309926 -0.13241355 [141,] 0.38244114 -0.14309926 [142,] -0.09868075 0.38244114 [143,] -0.10246974 -0.09868075 [144,] -0.13241355 -0.10246974 [145,] 0.42307067 -0.13241355 [146,] 0.35249733 0.42307067 [147,] 0.39312685 0.35249733 [148,] -0.09868075 0.39312685 [149,] -0.10246974 -0.09868075 [150,] -0.10246974 -0.10246974 [151,] -0.13931027 -0.10246974 [152,] -0.13931027 -0.13931027 [153,] -0.13931027 -0.13931027 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.08485233 -0.23896019 2 0.08485233 0.08485233 3 0.08485233 0.08485233 4 0.08485233 0.08485233 5 0.14852895 0.08485233 6 0.08485233 0.14852895 7 -0.30263680 0.08485233 8 0.11479614 -0.30263680 9 0.11858514 0.11479614 10 -0.26890400 0.11858514 11 0.08485233 -0.26890400 12 0.04422281 0.08485233 13 -0.26890400 0.04422281 14 0.07416662 -0.26890400 15 -0.31332252 0.07416662 16 -0.30953352 -0.31332252 17 -0.26890400 -0.30953352 18 0.11479614 -0.26890400 19 -0.31332252 0.11479614 20 0.11858514 -0.31332252 21 0.10789942 0.11858514 22 0.11479614 0.10789942 23 0.14852895 0.11479614 24 -0.31332252 0.14852895 25 0.04422281 -0.31332252 26 0.14852895 0.04422281 27 0.04422281 0.14852895 28 0.11479614 0.04422281 29 0.08485233 0.11479614 30 0.08485233 0.08485233 31 0.11858514 0.08485233 32 0.11858514 0.11858514 33 -0.27269299 0.11858514 34 0.08485233 -0.27269299 35 0.08485233 0.08485233 36 -0.30953352 0.08485233 37 0.07416662 -0.30953352 38 0.11479614 0.07416662 39 -0.30263680 0.11479614 40 0.07416662 -0.30263680 41 0.07416662 0.07416662 42 0.14852895 0.07416662 43 -0.26890400 0.14852895 44 0.08485233 -0.26890400 45 0.11479614 0.08485233 46 0.08485233 0.11479614 47 0.11479614 0.08485233 48 0.11479614 0.11479614 49 0.08485233 0.11479614 50 -0.34326633 0.08485233 51 -0.30953352 -0.34326633 52 0.11479614 -0.30953352 53 0.04422281 0.11479614 54 0.08485233 0.04422281 55 -0.31332252 0.08485233 56 0.07416662 -0.31332252 57 0.11479614 0.07416662 58 0.11479614 0.11479614 59 -0.27958971 0.11479614 60 -0.23896019 -0.27958971 61 0.04422281 -0.23896019 62 0.08485233 0.04422281 63 -0.23896019 0.08485233 64 0.08485233 -0.23896019 65 0.08485233 0.08485233 66 -0.34326633 0.08485233 67 0.11858514 -0.34326633 68 0.11479614 0.11858514 69 0.04422281 0.11479614 70 0.08485233 0.04422281 71 0.11479614 0.08485233 72 0.07416662 0.11479614 73 0.07795561 0.07416662 74 0.11479614 0.07795561 75 -0.27269299 0.11479614 76 0.11479614 -0.27269299 77 0.07416662 0.11479614 78 -0.31332252 0.07416662 79 -0.30263680 -0.31332252 80 0.08485233 -0.30263680 81 0.10789942 0.08485233 82 0.08485233 0.10789942 83 0.04422281 0.08485233 84 0.11479614 0.04422281 85 0.11858514 0.11479614 86 -0.06873693 0.11858514 87 0.41617395 -0.06873693 88 -0.13241355 0.41617395 89 -0.10246974 -0.13241355 90 -0.13241355 -0.10246974 91 0.42685966 -0.13241355 92 -0.09868075 0.42685966 93 -0.13241355 -0.09868075 94 0.39312685 -0.13241355 95 -0.10246974 0.39312685 96 0.42685966 -0.10246974 97 -0.13241355 0.42685966 98 -0.09868075 -0.13241355 99 -0.10246974 -0.09868075 100 -0.06873693 -0.10246974 101 -0.13241355 -0.06873693 102 -0.13241355 -0.13241355 103 -0.13241355 -0.13241355 104 0.35249733 -0.13241355 105 -0.13241355 0.35249733 106 -0.13241355 -0.13241355 107 0.38623014 -0.13241355 108 -0.13241355 0.38623014 109 -0.09868075 -0.13241355 110 0.38623014 -0.09868075 111 0.39312685 0.38623014 112 -0.17304308 0.39312685 113 0.38623014 -0.17304308 114 -0.09868075 0.38623014 115 -0.13241355 -0.09868075 116 -0.06873693 -0.13241355 117 -0.09868075 -0.06873693 118 -0.13241355 -0.09868075 119 -0.10246974 -0.13241355 120 -0.09868075 -0.10246974 121 -0.13241355 -0.09868075 122 0.38623014 -0.13241355 123 -0.14309926 0.38623014 124 -0.10246974 -0.14309926 125 0.39312685 -0.10246974 126 -0.13241355 0.39312685 127 -0.10246974 -0.13241355 128 -0.13241355 -0.10246974 129 -0.10246974 -0.13241355 130 -0.09868075 -0.10246974 131 -0.06873693 -0.09868075 132 -0.13931027 -0.06873693 133 -0.13241355 -0.13931027 134 -0.13241355 -0.13241355 135 -0.13241355 -0.13241355 136 -0.10936646 -0.13241355 137 0.41617395 -0.10936646 138 0.39312685 0.41617395 139 -0.13241355 0.39312685 140 -0.14309926 -0.13241355 141 0.38244114 -0.14309926 142 -0.09868075 0.38244114 143 -0.10246974 -0.09868075 144 -0.13241355 -0.10246974 145 0.42307067 -0.13241355 146 0.35249733 0.42307067 147 0.39312685 0.35249733 148 -0.09868075 0.39312685 149 -0.10246974 -0.09868075 150 -0.10246974 -0.10246974 151 -0.13931027 -0.10246974 152 -0.13931027 -0.13931027 153 -0.13931027 -0.13931027 > 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/71i771355750863.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/8r4h41355750863.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/9otou1355750863.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/10xd9a1355750863.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/11md001355750863.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/12bq791355750863.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/13av1g1355750863.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/14hks91355750863.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/15fc6t1355750863.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/16a4en1355750863.tab") + } > > try(system("convert tmp/19ur21355750863.ps tmp/19ur21355750863.png",intern=TRUE)) character(0) > try(system("convert tmp/2ucq71355750863.ps tmp/2ucq71355750863.png",intern=TRUE)) character(0) > try(system("convert tmp/3hw8a1355750863.ps tmp/3hw8a1355750863.png",intern=TRUE)) character(0) > try(system("convert tmp/4nj2i1355750863.ps tmp/4nj2i1355750863.png",intern=TRUE)) character(0) > try(system("convert tmp/5sg8q1355750863.ps tmp/5sg8q1355750863.png",intern=TRUE)) character(0) > try(system("convert tmp/6hijf1355750863.ps tmp/6hijf1355750863.png",intern=TRUE)) character(0) > try(system("convert tmp/71i771355750863.ps tmp/71i771355750863.png",intern=TRUE)) character(0) > try(system("convert tmp/8r4h41355750863.ps tmp/8r4h41355750863.png",intern=TRUE)) character(0) > try(system("convert tmp/9otou1355750863.ps tmp/9otou1355750863.png",intern=TRUE)) character(0) > try(system("convert tmp/10xd9a1355750863.ps tmp/10xd9a1355750863.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.714 1.274 9.010