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 + ,7 + ,7 + ,6 + ,1 + ,5 + ,7 + ,1 + ,5 + ,5 + ,6 + ,4 + ,1 + ,4 + ,5 + ,1 + ,4 + ,6 + ,6 + ,6 + ,2 + ,5 + ,5 + ,1 + ,3 + ,4 + ,5 + ,4 + ,2 + ,4 + ,5 + ,2 + ,6 + ,5 + ,6 + ,2 + ,2 + ,4 + ,5 + ,1 + ,5 + ,6 + ,7 + ,5 + ,1 + ,6 + ,7 + ,1 + ,5 + ,7 + ,7 + ,1 + ,1 + ,5 + ,7 + ,2 + ,1 + ,6 + ,7 + ,6 + ,1 + ,3 + ,5 + ,1 + ,4 + ,6 + ,7 + ,3 + ,1 + ,4 + ,3 + ,1 + ,5 + ,6 + ,6 + ,4 + ,1 + ,4 + ,6 + ,1 + ,6 + ,5 + ,4 + ,3 + ,1 + ,2 + ,7 + ,2 + ,7 + ,5 + ,6 + ,2 + ,1 + ,5 + ,6 + ,2 + ,5 + ,4 + ,6 + ,4 + ,1 + ,3 + ,5 + ,1 + ,6 + ,6 + ,7 + ,3 + ,1 + ,5 + ,3 + ,1 + ,5 + ,6 + ,6 + ,5 + ,1 + ,6 + ,7 + ,1 + ,4 + ,5 + ,6 + ,3 + ,2 + ,4 + ,5 + ,2 + ,7 + ,3 + ,4 + ,3 + ,1 + ,3 + ,7 + ,1 + ,7 + ,7 + ,7 + ,6 + ,1 + ,6 + ,7 + ,2 + ,6 + ,3 + ,7 + ,1 + ,1 + ,7 + ,7 + ,2 + ,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7 + ,7 + ,4 + ,1 + ,6 + ,6 + ,2 + ,5 + ,6 + ,6 + ,5 + ,1 + ,5 + ,6 + ,2 + ,3 + ,5 + ,5 + ,5 + ,2 + ,4 + ,6 + ,2 + ,6 + ,5 + ,6 + ,5 + ,1 + ,5 + ,5 + ,1 + ,7 + ,5 + ,7 + ,5 + ,1 + ,4 + ,6 + ,1 + ,4 + ,7 + ,6 + ,3 + ,1 + ,7 + ,7 + ,1 + ,5 + ,6 + ,7 + ,4 + ,1 + ,5 + ,7 + ,2 + ,4 + ,6 + ,7 + ,4 + ,1 + ,3 + ,6 + ,2 + ,5 + ,5 + ,6 + ,3 + ,2 + ,5 + ,6 + ,2 + ,2 + ,2 + ,6 + ,4 + ,2 + ,2 + ,6 + ,1 + ,7 + ,4 + ,4 + ,4 + ,4 + ,4 + ,7 + ,1 + ,5 + ,6 + ,7 + ,3 + ,1 + ,3 + ,6 + ,1 + ,4 + ,5 + ,6 + ,2 + ,1 + ,4 + ,5 + ,1 + ,2 + ,5 + ,4 + ,4 + ,1 + ,5 + ,5 + ,2 + ,4 + ,5 + ,5 + ,4 + ,1 + ,4 + ,5 + ,1) + ,dim=c(8 + ,162) + ,dimnames=list(c('Q1' + ,'Q2' + ,'Q3' + ,'Q4' + ,'Q5' + ,'Q6' + ,'Q7' + ,'Gender') + ,1:162)) > y <- array(NA,dim=c(8,162),dimnames=list(c('Q1','Q2','Q3','Q4','Q5','Q6','Q7','Gender'),1:162)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > 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 Q1 Q2 Q3 Q4 Q5 Q6 Q7 Gender 1 4 7 7 6 1 5 7 1 2 5 5 6 4 1 4 5 1 3 4 6 6 6 2 5 5 1 4 3 4 5 4 2 4 5 2 5 6 5 6 2 2 4 5 1 6 5 6 7 5 1 6 7 1 7 5 7 7 1 1 5 7 2 8 1 6 7 6 1 3 5 1 9 4 6 7 3 1 4 3 1 10 5 6 6 4 1 4 6 1 11 6 5 4 3 1 2 7 2 12 7 5 6 2 1 5 6 2 13 5 4 6 4 1 3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 5 7 1 6 128 5 7 3 1 2 2 1 5 129 4 3 4 1 4 5 2 5 130 6 6 6 1 6 6 2 5 131 4 5 4 3 6 6 1 3 132 4 5 5 2 5 6 2 5 133 4 6 4 1 4 2 2 4 134 4 5 4 1 4 6 2 5 135 6 6 5 1 5 7 2 5 136 6 6 4 2 3 4 1 1 137 5 7 3 5 5 7 1 4 138 3 5 3 1 5 7 2 7 139 6 7 6 1 5 6 2 4 140 5 6 5 2 6 6 1 6 141 4 6 2 1 4 2 1 7 142 5 7 4 2 3 7 1 6 143 2 7 3 1 3 7 1 5 144 5 5 3 1 4 5 2 6 145 7 7 5 1 5 5 1 5 146 4 5 3 1 5 6 1 5 147 4 6 3 2 3 5 2 6 148 7 7 4 1 6 6 2 5 149 6 6 5 1 5 6 2 3 150 5 5 5 2 4 6 2 6 151 5 6 5 1 5 5 1 7 152 5 7 5 1 4 6 1 4 153 7 6 3 1 7 7 1 5 154 6 7 4 1 5 7 2 4 155 6 7 4 1 3 6 2 5 156 5 6 3 2 5 6 2 2 157 2 6 4 2 2 6 1 7 158 4 4 4 4 4 7 1 5 159 6 7 3 1 3 6 1 4 160 5 6 2 1 4 5 1 2 161 5 4 4 1 5 5 2 4 162 5 5 4 1 4 5 1 4 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Q2 Q3 Q4 Q5 Q6 2.51086 0.15315 0.32907 -0.14322 0.21060 -0.04964 Q7 Gender 0.02841 -0.02672 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -4.3022 -0.8466 0.1087 0.9574 2.9092 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.51086 0.83694 3.000 0.00315 ** Q2 0.15315 0.09815 1.560 0.12072 Q3 0.32907 0.10161 3.238 0.00147 ** Q4 -0.14322 0.09113 -1.572 0.11808 Q5 0.21060 0.09821 2.144 0.03357 * Q6 -0.04964 0.08665 -0.573 0.56759 Q7 0.02841 0.09148 0.311 0.75653 Gender -0.02672 0.08998 -0.297 0.76689 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.369 on 154 degrees of freedom Multiple R-squared: 0.1177, Adjusted R-squared: 0.07757 F-statistic: 2.934 on 7 and 154 DF, p-value: 0.00653 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 0.05331321 1.066264e-01 9.466868e-01 [2,] 0.15809861 3.161972e-01 8.419014e-01 [3,] 0.10383046 2.076609e-01 8.961695e-01 [4,] 0.07086601 1.417320e-01 9.291340e-01 [5,] 0.14052681 2.810536e-01 8.594732e-01 [6,] 0.09534558 1.906912e-01 9.046544e-01 [7,] 0.07548571 1.509714e-01 9.245143e-01 [8,] 0.46995027 9.399005e-01 5.300497e-01 [9,] 0.43541390 8.708278e-01 5.645861e-01 [10,] 0.48579244 9.715849e-01 5.142076e-01 [11,] 0.89453991 2.109202e-01 1.054601e-01 [12,] 0.88654398 2.269120e-01 1.134560e-01 [13,] 0.84703693 3.059261e-01 1.529631e-01 [14,] 0.86157972 2.768406e-01 1.384203e-01 [15,] 0.84344694 3.131061e-01 1.565531e-01 [16,] 0.96022112 7.955775e-02 3.977888e-02 [17,] 0.98470295 3.059409e-02 1.529705e-02 [18,] 0.98870175 2.259650e-02 1.129825e-02 [19,] 0.98366382 3.267236e-02 1.633618e-02 [20,] 0.97734007 4.531986e-02 2.265993e-02 [21,] 0.97547121 4.905757e-02 2.452879e-02 [22,] 0.96789339 6.421322e-02 3.210661e-02 [23,] 0.96339141 7.321718e-02 3.660859e-02 [24,] 0.95056379 9.887242e-02 4.943621e-02 [25,] 0.94148983 1.170203e-01 5.851017e-02 [26,] 0.92752603 1.449479e-01 7.247397e-02 [27,] 0.92855809 1.428838e-01 7.144191e-02 [28,] 0.92500088 1.499982e-01 7.499912e-02 [29,] 0.96195339 7.609322e-02 3.804661e-02 [30,] 0.95372762 9.254476e-02 4.627238e-02 [31,] 0.95650679 8.698642e-02 4.349321e-02 [32,] 0.97979852 4.040295e-02 2.020148e-02 [33,] 0.97575434 4.849133e-02 2.424566e-02 [34,] 0.97885131 4.229738e-02 2.114869e-02 [35,] 0.98217984 3.564033e-02 1.782016e-02 [36,] 0.97672124 4.655752e-02 2.327876e-02 [37,] 0.96887478 6.225045e-02 3.112522e-02 [38,] 0.95941681 8.116638e-02 4.058319e-02 [39,] 0.95164824 9.670353e-02 4.835176e-02 [40,] 0.96742955 6.514089e-02 3.257045e-02 [41,] 0.95839564 8.320872e-02 4.160436e-02 [42,] 0.96939403 6.121194e-02 3.060597e-02 [43,] 0.97586169 4.827661e-02 2.413831e-02 [44,] 0.99797324 4.053511e-03 2.026755e-03 [45,] 0.99705318 5.893648e-03 2.946824e-03 [46,] 0.99644842 7.103167e-03 3.551583e-03 [47,] 0.99505944 9.881121e-03 4.940560e-03 [48,] 0.99325575 1.348850e-02 6.744250e-03 [49,] 0.99415748 1.168504e-02 5.842518e-03 [50,] 0.99566868 8.662641e-03 4.331321e-03 [51,] 0.99437862 1.124277e-02 5.621385e-03 [52,] 0.99314660 1.370680e-02 6.853401e-03 [53,] 0.99480876 1.038249e-02 5.191243e-03 [54,] 0.99476869 1.046262e-02 5.231309e-03 [55,] 0.99361264 1.277472e-02 6.387360e-03 [56,] 0.99176278 1.647444e-02 8.237222e-03 [57,] 0.99206240 1.587520e-02 7.937602e-03 [58,] 0.99326578 1.346844e-02 6.734218e-03 [59,] 0.99092104 1.815792e-02 9.078961e-03 [60,] 0.99651301 6.973978e-03 3.486989e-03 [61,] 0.99801073 3.978533e-03 1.989267e-03 [62,] 0.99888566 2.228678e-03 1.114339e-03 [63,] 0.99855420 2.891600e-03 1.445800e-03 [64,] 0.99862550 2.748995e-03 1.374497e-03 [65,] 0.99845219 3.095624e-03 1.547812e-03 [66,] 0.99849040 3.019193e-03 1.509597e-03 [67,] 0.99816526 3.669490e-03 1.834745e-03 [68,] 0.99807286 3.854273e-03 1.927137e-03 [69,] 0.99920668 1.586650e-03 7.933248e-04 [70,] 0.99930184 1.396311e-03 6.981555e-04 [71,] 0.99998908 2.183076e-05 1.091538e-05 [72,] 0.99998220 3.560132e-05 1.780066e-05 [73,] 0.99997066 5.868265e-05 2.934132e-05 [74,] 0.99996101 7.797340e-05 3.898670e-05 [75,] 0.99998565 2.870553e-05 1.435276e-05 [76,] 0.99998467 3.066984e-05 1.533492e-05 [77,] 0.99998241 3.518173e-05 1.759086e-05 [78,] 0.99997574 4.851981e-05 2.425991e-05 [79,] 0.99996404 7.191194e-05 3.595597e-05 [80,] 0.99994663 1.067344e-04 5.336719e-05 [81,] 0.99993779 1.244118e-04 6.220588e-05 [82,] 0.99996103 7.794270e-05 3.897135e-05 [83,] 0.99995901 8.198832e-05 4.099416e-05 [84,] 0.99993598 1.280319e-04 6.401597e-05 [85,] 0.99994080 1.183975e-04 5.919874e-05 [86,] 0.99991526 1.694722e-04 8.473612e-05 [87,] 0.99992102 1.579608e-04 7.898042e-05 [88,] 0.99988414 2.317207e-04 1.158604e-04 [89,] 0.99994450 1.109989e-04 5.549943e-05 [90,] 0.99992013 1.597331e-04 7.986656e-05 [91,] 0.99988092 2.381633e-04 1.190816e-04 [92,] 0.99981954 3.609110e-04 1.804555e-04 [93,] 0.99988841 2.231756e-04 1.115878e-04 [94,] 0.99982279 3.544270e-04 1.772135e-04 [95,] 0.99970994 5.801192e-04 2.900596e-04 [96,] 0.99972122 5.575672e-04 2.787836e-04 [97,] 0.99956313 8.737366e-04 4.368683e-04 [98,] 0.99954551 9.089713e-04 4.544856e-04 [99,] 0.99933069 1.338625e-03 6.693125e-04 [100,] 0.99895993 2.080132e-03 1.040066e-03 [101,] 0.99873227 2.535469e-03 1.267734e-03 [102,] 0.99867404 2.651921e-03 1.325960e-03 [103,] 0.99812849 3.743012e-03 1.871506e-03 [104,] 0.99775476 4.490485e-03 2.245243e-03 [105,] 0.99654783 6.904333e-03 3.452166e-03 [106,] 0.99526749 9.465026e-03 4.732513e-03 [107,] 0.99333688 1.332624e-02 6.663119e-03 [108,] 0.99063188 1.873624e-02 9.368119e-03 [109,] 0.99484525 1.030949e-02 5.154746e-03 [110,] 0.99222333 1.555334e-02 7.776672e-03 [111,] 0.98853543 2.292914e-02 1.146457e-02 [112,] 0.98954785 2.090430e-02 1.045215e-02 [113,] 0.98521663 2.956675e-02 1.478337e-02 [114,] 0.98437483 3.125033e-02 1.562517e-02 [115,] 0.97978201 4.043598e-02 2.021799e-02 [116,] 0.97948396 4.103209e-02 2.051604e-02 [117,] 0.99118997 1.762006e-02 8.810030e-03 [118,] 0.98775342 2.449316e-02 1.224658e-02 [119,] 0.98310303 3.379394e-02 1.689697e-02 [120,] 0.97486237 5.027526e-02 2.513763e-02 [121,] 0.97920116 4.159768e-02 2.079884e-02 [122,] 0.97804961 4.390078e-02 2.195039e-02 [123,] 0.98733621 2.532759e-02 1.266379e-02 [124,] 0.98158497 3.683006e-02 1.841503e-02 [125,] 0.97289843 5.420313e-02 2.710157e-02 [126,] 0.96107301 7.785399e-02 3.892699e-02 [127,] 0.94415746 1.116851e-01 5.584254e-02 [128,] 0.94694645 1.061071e-01 5.305355e-02 [129,] 0.93212720 1.357456e-01 6.787280e-02 [130,] 0.92562432 1.487514e-01 7.437568e-02 [131,] 0.90637650 1.872470e-01 9.362350e-02 [132,] 0.89559978 2.088004e-01 1.044002e-01 [133,] 0.96357528 7.284945e-02 3.642472e-02 [134,] 0.94511369 1.097726e-01 5.488631e-02 [135,] 0.93592248 1.281550e-01 6.407752e-02 [136,] 0.94162525 1.167495e-01 5.837475e-02 [137,] 0.89515625 2.096875e-01 1.048438e-01 [138,] 0.84334219 3.133156e-01 1.566578e-01 [139,] 0.74275947 5.144811e-01 2.572405e-01 [140,] 0.63634239 7.273152e-01 3.636576e-01 [141,] 0.58048127 8.390375e-01 4.195187e-01 > postscript(file="/var/wessaorg/rcomp/tmp/1f5nh1355655179.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/2jdt11355655179.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/331641355655179.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/4g3ia1355655179.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/5vpoi1355655179.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 162 Frequency = 1 1 2 3 4 5 6 -1.161636946 0.194475610 -0.833200375 -1.507190482 0.697432343 -0.102072206 7 8 9 10 11 12 -0.851012773 -4.050936544 -1.374133847 0.012914958 1.580014557 1.955982674 13 14 15 16 17 18 0.297987131 0.675502612 0.226994908 -1.132625279 2.909224301 1.914722190 19 20 21 22 23 24 0.860852070 0.426527054 -1.815690591 1.951802856 0.576050558 -1.461061850 25 26 27 28 29 30 2.251090072 -3.443937977 -3.443937977 1.772005387 -0.693726421 -0.255040054 31 32 33 34 35 36 0.303354045 0.380323023 -0.635982054 0.117762163 0.746041095 -1.071693310 37 38 39 40 41 42 1.944794110 1.649638553 1.964358650 -0.756068065 1.743412584 2.248398832 43 44 45 46 47 48 -0.973680676 -1.839865656 -2.313475485 0.198175485 -0.564541630 0.114860046 49 50 51 52 53 54 -1.026056535 2.274968614 -0.576540872 1.540659885 1.680315183 -3.534649844 55 56 57 58 59 60 -0.096573319 -1.195475314 0.194475610 -0.294928367 1.055076458 1.326682747 61 62 63 64 65 66 0.231461805 0.412917720 1.615626762 -1.374587587 -1.234551543 0.638211069 67 68 69 70 71 72 1.425349956 -1.729165254 0.309282641 -2.741721048 2.014317873 1.946054394 73 74 75 76 77 78 -0.900797625 1.398627279 1.041147494 -1.848765231 -1.491285446 1.067870172 79 80 81 82 83 84 1.771502490 -2.034089045 -4.302224191 0.106498200 0.404926000 -0.027242803 85 86 87 88 89 90 -2.321872552 0.868954094 1.007441928 0.623763406 -0.820485947 -0.216469404 91 92 93 94 95 96 -1.035517596 1.611696591 1.237437757 0.383849800 -1.289449354 -0.356309918 97 98 99 100 101 102 1.469063778 0.609962942 1.890271507 0.633657066 -0.257634998 -0.220346329 103 104 105 106 107 108 1.560326483 0.049546041 -0.128063085 -1.167034578 -0.245909781 0.835331689 109 110 111 112 113 114 -0.623682546 0.536597739 -0.225874085 1.493667552 0.271920855 -1.006067173 115 116 117 118 119 120 0.314622967 -0.982190038 0.001465173 -0.010018698 1.759578262 -0.344807492 121 122 123 124 125 126 -0.292772763 -1.312220506 0.537614335 0.567764938 1.249205030 -0.857533003 127 128 129 130 131 132 1.647641607 0.356386493 -0.660799717 -0.149949160 -1.077260232 -1.313910498 133 134 135 136 137 138 -1.295875716 -0.917459220 0.439358279 1.105465406 0.518913323 -1.695914156 139 140 141 142 143 144 -0.119215954 -0.622526997 -0.529160785 0.234840189 -2.606035074 0.388694112 145 146 147 148 149 150 1.215350049 -0.770583300 -0.410630304 1.355037088 0.336276465 -0.076583957 151 152 153 154 155 156 -0.578056616 -0.551132305 1.704697449 0.588554735 0.986848682 0.110907718 157 158 159 160 161 162 -2.424321747 -0.256603007 1.317605789 0.486135207 -0.051274240 0.034594313 > postscript(file="/var/wessaorg/rcomp/tmp/64m9n1355655179.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 162 Frequency = 1 lag(myerror, k = 1) myerror 0 -1.161636946 NA 1 0.194475610 -1.161636946 2 -0.833200375 0.194475610 3 -1.507190482 -0.833200375 4 0.697432343 -1.507190482 5 -0.102072206 0.697432343 6 -0.851012773 -0.102072206 7 -4.050936544 -0.851012773 8 -1.374133847 -4.050936544 9 0.012914958 -1.374133847 10 1.580014557 0.012914958 11 1.955982674 1.580014557 12 0.297987131 1.955982674 13 0.675502612 0.297987131 14 0.226994908 0.675502612 15 -1.132625279 0.226994908 16 2.909224301 -1.132625279 17 1.914722190 2.909224301 18 0.860852070 1.914722190 19 0.426527054 0.860852070 20 -1.815690591 0.426527054 21 1.951802856 -1.815690591 22 0.576050558 1.951802856 23 -1.461061850 0.576050558 24 2.251090072 -1.461061850 25 -3.443937977 2.251090072 26 -3.443937977 -3.443937977 27 1.772005387 -3.443937977 28 -0.693726421 1.772005387 29 -0.255040054 -0.693726421 30 0.303354045 -0.255040054 31 0.380323023 0.303354045 32 -0.635982054 0.380323023 33 0.117762163 -0.635982054 34 0.746041095 0.117762163 35 -1.071693310 0.746041095 36 1.944794110 -1.071693310 37 1.649638553 1.944794110 38 1.964358650 1.649638553 39 -0.756068065 1.964358650 40 1.743412584 -0.756068065 41 2.248398832 1.743412584 42 -0.973680676 2.248398832 43 -1.839865656 -0.973680676 44 -2.313475485 -1.839865656 45 0.198175485 -2.313475485 46 -0.564541630 0.198175485 47 0.114860046 -0.564541630 48 -1.026056535 0.114860046 49 2.274968614 -1.026056535 50 -0.576540872 2.274968614 51 1.540659885 -0.576540872 52 1.680315183 1.540659885 53 -3.534649844 1.680315183 54 -0.096573319 -3.534649844 55 -1.195475314 -0.096573319 56 0.194475610 -1.195475314 57 -0.294928367 0.194475610 58 1.055076458 -0.294928367 59 1.326682747 1.055076458 60 0.231461805 1.326682747 61 0.412917720 0.231461805 62 1.615626762 0.412917720 63 -1.374587587 1.615626762 64 -1.234551543 -1.374587587 65 0.638211069 -1.234551543 66 1.425349956 0.638211069 67 -1.729165254 1.425349956 68 0.309282641 -1.729165254 69 -2.741721048 0.309282641 70 2.014317873 -2.741721048 71 1.946054394 2.014317873 72 -0.900797625 1.946054394 73 1.398627279 -0.900797625 74 1.041147494 1.398627279 75 -1.848765231 1.041147494 76 -1.491285446 -1.848765231 77 1.067870172 -1.491285446 78 1.771502490 1.067870172 79 -2.034089045 1.771502490 80 -4.302224191 -2.034089045 81 0.106498200 -4.302224191 82 0.404926000 0.106498200 83 -0.027242803 0.404926000 84 -2.321872552 -0.027242803 85 0.868954094 -2.321872552 86 1.007441928 0.868954094 87 0.623763406 1.007441928 88 -0.820485947 0.623763406 89 -0.216469404 -0.820485947 90 -1.035517596 -0.216469404 91 1.611696591 -1.035517596 92 1.237437757 1.611696591 93 0.383849800 1.237437757 94 -1.289449354 0.383849800 95 -0.356309918 -1.289449354 96 1.469063778 -0.356309918 97 0.609962942 1.469063778 98 1.890271507 0.609962942 99 0.633657066 1.890271507 100 -0.257634998 0.633657066 101 -0.220346329 -0.257634998 102 1.560326483 -0.220346329 103 0.049546041 1.560326483 104 -0.128063085 0.049546041 105 -1.167034578 -0.128063085 106 -0.245909781 -1.167034578 107 0.835331689 -0.245909781 108 -0.623682546 0.835331689 109 0.536597739 -0.623682546 110 -0.225874085 0.536597739 111 1.493667552 -0.225874085 112 0.271920855 1.493667552 113 -1.006067173 0.271920855 114 0.314622967 -1.006067173 115 -0.982190038 0.314622967 116 0.001465173 -0.982190038 117 -0.010018698 0.001465173 118 1.759578262 -0.010018698 119 -0.344807492 1.759578262 120 -0.292772763 -0.344807492 121 -1.312220506 -0.292772763 122 0.537614335 -1.312220506 123 0.567764938 0.537614335 124 1.249205030 0.567764938 125 -0.857533003 1.249205030 126 1.647641607 -0.857533003 127 0.356386493 1.647641607 128 -0.660799717 0.356386493 129 -0.149949160 -0.660799717 130 -1.077260232 -0.149949160 131 -1.313910498 -1.077260232 132 -1.295875716 -1.313910498 133 -0.917459220 -1.295875716 134 0.439358279 -0.917459220 135 1.105465406 0.439358279 136 0.518913323 1.105465406 137 -1.695914156 0.518913323 138 -0.119215954 -1.695914156 139 -0.622526997 -0.119215954 140 -0.529160785 -0.622526997 141 0.234840189 -0.529160785 142 -2.606035074 0.234840189 143 0.388694112 -2.606035074 144 1.215350049 0.388694112 145 -0.770583300 1.215350049 146 -0.410630304 -0.770583300 147 1.355037088 -0.410630304 148 0.336276465 1.355037088 149 -0.076583957 0.336276465 150 -0.578056616 -0.076583957 151 -0.551132305 -0.578056616 152 1.704697449 -0.551132305 153 0.588554735 1.704697449 154 0.986848682 0.588554735 155 0.110907718 0.986848682 156 -2.424321747 0.110907718 157 -0.256603007 -2.424321747 158 1.317605789 -0.256603007 159 0.486135207 1.317605789 160 -0.051274240 0.486135207 161 0.034594313 -0.051274240 162 NA 0.034594313 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.194475610 -1.161636946 [2,] -0.833200375 0.194475610 [3,] -1.507190482 -0.833200375 [4,] 0.697432343 -1.507190482 [5,] -0.102072206 0.697432343 [6,] -0.851012773 -0.102072206 [7,] -4.050936544 -0.851012773 [8,] -1.374133847 -4.050936544 [9,] 0.012914958 -1.374133847 [10,] 1.580014557 0.012914958 [11,] 1.955982674 1.580014557 [12,] 0.297987131 1.955982674 [13,] 0.675502612 0.297987131 [14,] 0.226994908 0.675502612 [15,] -1.132625279 0.226994908 [16,] 2.909224301 -1.132625279 [17,] 1.914722190 2.909224301 [18,] 0.860852070 1.914722190 [19,] 0.426527054 0.860852070 [20,] -1.815690591 0.426527054 [21,] 1.951802856 -1.815690591 [22,] 0.576050558 1.951802856 [23,] -1.461061850 0.576050558 [24,] 2.251090072 -1.461061850 [25,] -3.443937977 2.251090072 [26,] -3.443937977 -3.443937977 [27,] 1.772005387 -3.443937977 [28,] -0.693726421 1.772005387 [29,] -0.255040054 -0.693726421 [30,] 0.303354045 -0.255040054 [31,] 0.380323023 0.303354045 [32,] -0.635982054 0.380323023 [33,] 0.117762163 -0.635982054 [34,] 0.746041095 0.117762163 [35,] -1.071693310 0.746041095 [36,] 1.944794110 -1.071693310 [37,] 1.649638553 1.944794110 [38,] 1.964358650 1.649638553 [39,] -0.756068065 1.964358650 [40,] 1.743412584 -0.756068065 [41,] 2.248398832 1.743412584 [42,] -0.973680676 2.248398832 [43,] -1.839865656 -0.973680676 [44,] -2.313475485 -1.839865656 [45,] 0.198175485 -2.313475485 [46,] -0.564541630 0.198175485 [47,] 0.114860046 -0.564541630 [48,] -1.026056535 0.114860046 [49,] 2.274968614 -1.026056535 [50,] -0.576540872 2.274968614 [51,] 1.540659885 -0.576540872 [52,] 1.680315183 1.540659885 [53,] -3.534649844 1.680315183 [54,] -0.096573319 -3.534649844 [55,] -1.195475314 -0.096573319 [56,] 0.194475610 -1.195475314 [57,] -0.294928367 0.194475610 [58,] 1.055076458 -0.294928367 [59,] 1.326682747 1.055076458 [60,] 0.231461805 1.326682747 [61,] 0.412917720 0.231461805 [62,] 1.615626762 0.412917720 [63,] -1.374587587 1.615626762 [64,] -1.234551543 -1.374587587 [65,] 0.638211069 -1.234551543 [66,] 1.425349956 0.638211069 [67,] -1.729165254 1.425349956 [68,] 0.309282641 -1.729165254 [69,] -2.741721048 0.309282641 [70,] 2.014317873 -2.741721048 [71,] 1.946054394 2.014317873 [72,] -0.900797625 1.946054394 [73,] 1.398627279 -0.900797625 [74,] 1.041147494 1.398627279 [75,] -1.848765231 1.041147494 [76,] -1.491285446 -1.848765231 [77,] 1.067870172 -1.491285446 [78,] 1.771502490 1.067870172 [79,] -2.034089045 1.771502490 [80,] -4.302224191 -2.034089045 [81,] 0.106498200 -4.302224191 [82,] 0.404926000 0.106498200 [83,] -0.027242803 0.404926000 [84,] -2.321872552 -0.027242803 [85,] 0.868954094 -2.321872552 [86,] 1.007441928 0.868954094 [87,] 0.623763406 1.007441928 [88,] -0.820485947 0.623763406 [89,] -0.216469404 -0.820485947 [90,] -1.035517596 -0.216469404 [91,] 1.611696591 -1.035517596 [92,] 1.237437757 1.611696591 [93,] 0.383849800 1.237437757 [94,] -1.289449354 0.383849800 [95,] -0.356309918 -1.289449354 [96,] 1.469063778 -0.356309918 [97,] 0.609962942 1.469063778 [98,] 1.890271507 0.609962942 [99,] 0.633657066 1.890271507 [100,] -0.257634998 0.633657066 [101,] -0.220346329 -0.257634998 [102,] 1.560326483 -0.220346329 [103,] 0.049546041 1.560326483 [104,] -0.128063085 0.049546041 [105,] -1.167034578 -0.128063085 [106,] -0.245909781 -1.167034578 [107,] 0.835331689 -0.245909781 [108,] -0.623682546 0.835331689 [109,] 0.536597739 -0.623682546 [110,] -0.225874085 0.536597739 [111,] 1.493667552 -0.225874085 [112,] 0.271920855 1.493667552 [113,] -1.006067173 0.271920855 [114,] 0.314622967 -1.006067173 [115,] -0.982190038 0.314622967 [116,] 0.001465173 -0.982190038 [117,] -0.010018698 0.001465173 [118,] 1.759578262 -0.010018698 [119,] -0.344807492 1.759578262 [120,] -0.292772763 -0.344807492 [121,] -1.312220506 -0.292772763 [122,] 0.537614335 -1.312220506 [123,] 0.567764938 0.537614335 [124,] 1.249205030 0.567764938 [125,] -0.857533003 1.249205030 [126,] 1.647641607 -0.857533003 [127,] 0.356386493 1.647641607 [128,] -0.660799717 0.356386493 [129,] -0.149949160 -0.660799717 [130,] -1.077260232 -0.149949160 [131,] -1.313910498 -1.077260232 [132,] -1.295875716 -1.313910498 [133,] -0.917459220 -1.295875716 [134,] 0.439358279 -0.917459220 [135,] 1.105465406 0.439358279 [136,] 0.518913323 1.105465406 [137,] -1.695914156 0.518913323 [138,] -0.119215954 -1.695914156 [139,] -0.622526997 -0.119215954 [140,] -0.529160785 -0.622526997 [141,] 0.234840189 -0.529160785 [142,] -2.606035074 0.234840189 [143,] 0.388694112 -2.606035074 [144,] 1.215350049 0.388694112 [145,] -0.770583300 1.215350049 [146,] -0.410630304 -0.770583300 [147,] 1.355037088 -0.410630304 [148,] 0.336276465 1.355037088 [149,] -0.076583957 0.336276465 [150,] -0.578056616 -0.076583957 [151,] -0.551132305 -0.578056616 [152,] 1.704697449 -0.551132305 [153,] 0.588554735 1.704697449 [154,] 0.986848682 0.588554735 [155,] 0.110907718 0.986848682 [156,] -2.424321747 0.110907718 [157,] -0.256603007 -2.424321747 [158,] 1.317605789 -0.256603007 [159,] 0.486135207 1.317605789 [160,] -0.051274240 0.486135207 [161,] 0.034594313 -0.051274240 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.194475610 -1.161636946 2 -0.833200375 0.194475610 3 -1.507190482 -0.833200375 4 0.697432343 -1.507190482 5 -0.102072206 0.697432343 6 -0.851012773 -0.102072206 7 -4.050936544 -0.851012773 8 -1.374133847 -4.050936544 9 0.012914958 -1.374133847 10 1.580014557 0.012914958 11 1.955982674 1.580014557 12 0.297987131 1.955982674 13 0.675502612 0.297987131 14 0.226994908 0.675502612 15 -1.132625279 0.226994908 16 2.909224301 -1.132625279 17 1.914722190 2.909224301 18 0.860852070 1.914722190 19 0.426527054 0.860852070 20 -1.815690591 0.426527054 21 1.951802856 -1.815690591 22 0.576050558 1.951802856 23 -1.461061850 0.576050558 24 2.251090072 -1.461061850 25 -3.443937977 2.251090072 26 -3.443937977 -3.443937977 27 1.772005387 -3.443937977 28 -0.693726421 1.772005387 29 -0.255040054 -0.693726421 30 0.303354045 -0.255040054 31 0.380323023 0.303354045 32 -0.635982054 0.380323023 33 0.117762163 -0.635982054 34 0.746041095 0.117762163 35 -1.071693310 0.746041095 36 1.944794110 -1.071693310 37 1.649638553 1.944794110 38 1.964358650 1.649638553 39 -0.756068065 1.964358650 40 1.743412584 -0.756068065 41 2.248398832 1.743412584 42 -0.973680676 2.248398832 43 -1.839865656 -0.973680676 44 -2.313475485 -1.839865656 45 0.198175485 -2.313475485 46 -0.564541630 0.198175485 47 0.114860046 -0.564541630 48 -1.026056535 0.114860046 49 2.274968614 -1.026056535 50 -0.576540872 2.274968614 51 1.540659885 -0.576540872 52 1.680315183 1.540659885 53 -3.534649844 1.680315183 54 -0.096573319 -3.534649844 55 -1.195475314 -0.096573319 56 0.194475610 -1.195475314 57 -0.294928367 0.194475610 58 1.055076458 -0.294928367 59 1.326682747 1.055076458 60 0.231461805 1.326682747 61 0.412917720 0.231461805 62 1.615626762 0.412917720 63 -1.374587587 1.615626762 64 -1.234551543 -1.374587587 65 0.638211069 -1.234551543 66 1.425349956 0.638211069 67 -1.729165254 1.425349956 68 0.309282641 -1.729165254 69 -2.741721048 0.309282641 70 2.014317873 -2.741721048 71 1.946054394 2.014317873 72 -0.900797625 1.946054394 73 1.398627279 -0.900797625 74 1.041147494 1.398627279 75 -1.848765231 1.041147494 76 -1.491285446 -1.848765231 77 1.067870172 -1.491285446 78 1.771502490 1.067870172 79 -2.034089045 1.771502490 80 -4.302224191 -2.034089045 81 0.106498200 -4.302224191 82 0.404926000 0.106498200 83 -0.027242803 0.404926000 84 -2.321872552 -0.027242803 85 0.868954094 -2.321872552 86 1.007441928 0.868954094 87 0.623763406 1.007441928 88 -0.820485947 0.623763406 89 -0.216469404 -0.820485947 90 -1.035517596 -0.216469404 91 1.611696591 -1.035517596 92 1.237437757 1.611696591 93 0.383849800 1.237437757 94 -1.289449354 0.383849800 95 -0.356309918 -1.289449354 96 1.469063778 -0.356309918 97 0.609962942 1.469063778 98 1.890271507 0.609962942 99 0.633657066 1.890271507 100 -0.257634998 0.633657066 101 -0.220346329 -0.257634998 102 1.560326483 -0.220346329 103 0.049546041 1.560326483 104 -0.128063085 0.049546041 105 -1.167034578 -0.128063085 106 -0.245909781 -1.167034578 107 0.835331689 -0.245909781 108 -0.623682546 0.835331689 109 0.536597739 -0.623682546 110 -0.225874085 0.536597739 111 1.493667552 -0.225874085 112 0.271920855 1.493667552 113 -1.006067173 0.271920855 114 0.314622967 -1.006067173 115 -0.982190038 0.314622967 116 0.001465173 -0.982190038 117 -0.010018698 0.001465173 118 1.759578262 -0.010018698 119 -0.344807492 1.759578262 120 -0.292772763 -0.344807492 121 -1.312220506 -0.292772763 122 0.537614335 -1.312220506 123 0.567764938 0.537614335 124 1.249205030 0.567764938 125 -0.857533003 1.249205030 126 1.647641607 -0.857533003 127 0.356386493 1.647641607 128 -0.660799717 0.356386493 129 -0.149949160 -0.660799717 130 -1.077260232 -0.149949160 131 -1.313910498 -1.077260232 132 -1.295875716 -1.313910498 133 -0.917459220 -1.295875716 134 0.439358279 -0.917459220 135 1.105465406 0.439358279 136 0.518913323 1.105465406 137 -1.695914156 0.518913323 138 -0.119215954 -1.695914156 139 -0.622526997 -0.119215954 140 -0.529160785 -0.622526997 141 0.234840189 -0.529160785 142 -2.606035074 0.234840189 143 0.388694112 -2.606035074 144 1.215350049 0.388694112 145 -0.770583300 1.215350049 146 -0.410630304 -0.770583300 147 1.355037088 -0.410630304 148 0.336276465 1.355037088 149 -0.076583957 0.336276465 150 -0.578056616 -0.076583957 151 -0.551132305 -0.578056616 152 1.704697449 -0.551132305 153 0.588554735 1.704697449 154 0.986848682 0.588554735 155 0.110907718 0.986848682 156 -2.424321747 0.110907718 157 -0.256603007 -2.424321747 158 1.317605789 -0.256603007 159 0.486135207 1.317605789 160 -0.051274240 0.486135207 161 0.034594313 -0.051274240 > 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/79re31355655179.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/8e5ts1355655179.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/9gseu1355655179.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/1022481355655179.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/11acd41355655180.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/12mo9n1355655180.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/13i2411355655180.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/14p0yr1355655180.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/15ruaw1355655180.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/1639vw1355655180.tab") + } > > try(system("convert tmp/1f5nh1355655179.ps tmp/1f5nh1355655179.png",intern=TRUE)) character(0) > try(system("convert tmp/2jdt11355655179.ps tmp/2jdt11355655179.png",intern=TRUE)) character(0) > try(system("convert tmp/331641355655179.ps tmp/331641355655179.png",intern=TRUE)) character(0) > try(system("convert tmp/4g3ia1355655179.ps tmp/4g3ia1355655179.png",intern=TRUE)) character(0) > try(system("convert tmp/5vpoi1355655179.ps tmp/5vpoi1355655179.png",intern=TRUE)) character(0) > try(system("convert tmp/64m9n1355655179.ps tmp/64m9n1355655179.png",intern=TRUE)) character(0) > try(system("convert tmp/79re31355655179.ps tmp/79re31355655179.png",intern=TRUE)) character(0) > try(system("convert tmp/8e5ts1355655179.ps tmp/8e5ts1355655179.png",intern=TRUE)) character(0) > try(system("convert tmp/9gseu1355655179.ps tmp/9gseu1355655179.png",intern=TRUE)) character(0) > try(system("convert tmp/1022481355655179.ps tmp/1022481355655179.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.825 0.986 9.817