R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale 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(2 + ,9 + ,2 + ,1 + ,4 + ,3 + ,3 + ,3 + ,3 + ,3 + ,9 + ,2 + ,3 + ,4 + ,3 + ,3 + ,4 + ,3 + ,3 + ,9 + ,4 + ,2 + ,3 + ,4 + ,4 + ,4 + ,3 + ,3 + ,9 + ,3 + ,3 + ,2 + ,3 + ,3 + ,3 + ,3 + ,3 + ,9 + ,3 + ,2 + ,3 + ,3 + ,2 + ,2 + ,2 + ,3 + ,9 + ,1 + ,2 + ,4 + ,3 + ,3 + ,2 + ,2 + ,2 + ,9 + ,4 + ,4 + ,5 + ,4 + ,4 + ,5 + ,4 + ,3 + ,9 + ,2 + ,2 + ,4 + ,2 + ,2 + ,3 + ,2 + ,3 + ,9 + ,2 + ,2 + ,4 + ,4 + ,3 + ,2 + ,3 + ,4 + ,9 + ,2 + ,2 + ,2 + ,2 + ,2 + ,2 + ,2 + ,3 + ,9 + ,4 + ,2 + ,2 + ,3 + ,2 + ,4 + ,4 + ,3 + ,9 + ,3 + ,3 + ,4 + ,3 + ,2 + ,3 + ,3 + ,2 + ,9 + ,3 + ,2 + ,4 + ,4 + ,4 + ,3 + ,3 + ,3 + ,9 + ,2 + ,2 + ,5 + ,3 + ,4 + ,2 + ,3 + ,9 + ,3 + ,3 + ,5 + ,3 + ,3 + ,4 + ,3 + ,3 + ,9 + ,2 + ,2 + ,4 + ,3 + ,2 + ,2 + ,2 + ,3 + ,9 + ,3 + ,3 + ,3 + ,3 + ,3 + ,3 + ,3 + ,3 + ,9 + ,3 + ,3 + ,4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3 + ,4 + ,4 + ,4 + ,1 + ,10 + ,1 + ,3 + ,3 + ,3 + ,4 + ,2) + ,dim=c(9 + ,156) + ,dimnames=list(c('Y' + ,'month' + ,'X1t' + ,'X2t' + ,'X3t' + ,'X4t' + ,'X5t' + ,'X6t' + ,'X7t') + ,1:156)) > y <- array(NA,dim=c(9,156),dimnames=list(c('Y','month','X1t','X2t','X3t','X4t','X5t','X6t','X7t'),1:156)) > 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' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Y month X1t X2t X3t X4t X5t X6t X7t 1 2 9 2 1 4 3 3 3 3 2 3 9 2 3 4 3 3 4 3 3 3 9 4 2 3 4 4 4 3 4 3 9 3 3 2 3 3 3 3 5 3 9 3 2 3 3 2 2 2 6 3 9 1 2 4 3 3 2 2 7 2 9 4 4 5 4 4 5 4 8 3 9 2 2 4 2 2 3 2 9 3 9 2 2 4 4 3 2 3 10 4 9 2 2 2 2 2 2 2 11 3 9 4 2 2 3 2 4 4 12 3 9 3 3 4 3 2 3 3 13 2 9 3 2 4 4 4 3 3 14 3 9 2 2 5 3 4 2 3 15 9 3 3 5 3 3 4 3 3 16 9 2 2 4 3 2 2 2 3 17 9 3 3 3 3 3 3 3 3 18 9 3 3 4 4 4 4 3 2 19 9 2 2 4 2 2 2 2 4 20 9 2 2 2 3 2 2 3 3 21 9 1 1 4 3 3 3 2 2 22 9 4 3 4 4 4 4 3 3 23 9 3 2 4 3 3 2 3 3 24 9 2 2 4 3 3 2 2 2 25 9 3 3 4 3 4 3 3 2 26 9 3 3 4 4 4 4 3 4 27 9 4 3 4 4 2 4 4 2 28 9 3 2 3 4 3 3 3 3 29 9 3 3 3 4 3 3 3 2 30 9 2 2 4 4 4 4 2 4 31 9 2 2 3 2 4 2 2 3 32 9 4 3 4 3 3 3 4 2 33 9 4 3 4 4 3 4 4 3 34 9 2 2 4 3 2 3 3 3 35 9 2 2 4 3 2 2 3 1 36 9 3 3 4 4 4 4 4 3 37 9 3 3 4 3 3 4 3 3 38 9 3 2 3 2 2 2 2 3 39 9 3 3 4 3 3 3 3 2 40 9 4 3 4 4 4 4 4 3 41 9 3 3 4 3 4 4 3 9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 4 4 4 4 2 10 3 3 94 4 3 4 3 4 3 10 2 3 95 4 3 3 3 3 3 10 2 2 96 4 2 2 4 2 3 10 3 3 97 2 3 1 5 3 4 10 2 1 98 4 3 2 3 2 2 10 3 2 99 4 4 2 4 3 3 10 3 3 100 4 3 3 4 3 2 10 4 3 101 4 4 4 4 4 2 10 4 3 102 4 3 4 4 3 3 10 3 3 103 5 3 5 5 3 3 10 1 2 104 4 3 2 4 2 5 10 1 1 105 4 3 1 3 1 2 10 4 4 106 4 4 3 4 3 4 10 2 1 107 3 3 3 4 3 3 10 4 4 108 4 4 4 4 4 4 10 2 1 109 4 3 2 4 2 4 10 2 2 110 4 3 2 4 3 10 3 2 4 111 3 2 4 3 3 10 4 3 3 112 3 3 3 4 3 10 3 3 4 113 3 3 4 3 3 10 3 3 4 114 3 4 4 4 2 10 4 3 4 115 4 4 4 4 2 10 2 4 5 116 3 4 4 3 2 10 3 3 4 117 3 4 4 3 2 10 3 3 4 118 4 2 4 3 1 10 3 3 4 119 3 3 4 3 2 10 2 2 4 120 3 3 3 3 3 10 2 2 4 121 3 3 4 3 3 10 2 3 4 122 3 4 3 3 4 10 2 2 4 123 3 3 3 3 3 10 4 2 4 124 3 4 4 4 2 10 3 3 4 125 4 4 4 3 3 10 2 3 4 126 3 3 4 2 2 10 4 4 4 127 4 4 4 4 3 10 3 3 4 128 3 3 3 3 3 10 2 3 3 129 4 3 3 3 5 10 1 3 1 130 1 1 1 1 2 10 4 4 4 131 4 4 4 4 2 10 3 3 4 132 3 4 3 3 3 10 2 2 4 133 4 2 4 2 1 10 2 4 4 134 4 2 4 2 3 10 3 3 4 135 4 4 3 4 3 10 2 2 4 136 3 3 4 3 3 10 3 3 4 137 3 4 4 4 4 10 2 1 4 138 3 2 2 2 1 10 3 3 4 139 4 5 4 4 2 10 3 2 3 140 3 3 3 4 4 10 2 2 4 141 3 4 3 3 2 10 3 3 4 142 3 3 4 3 2 10 2 2 4 143 4 4 4 3 4 10 2 2 4 144 2 2 2 2 3 10 2 2 4 145 3 3 3 3 3 10 3 3 4 146 3 1 3 3 4 10 2 3 4 147 3 2 3 3 1 10 3 3 5 148 3 5 5 4 2 10 3 3 4 149 3 4 4 4 2 10 4 4 4 150 4 4 4 3 3 10 4 3 4 151 3 3 3 3 2 10 4 3 4 152 4 4 4 4 3 10 2 2 3 153 3 2 3 2 3 10 3 3 3 154 4 4 4 3 3 10 3 4 3 155 4 4 4 1 10 1 3 3 3 156 4 2 2 9 2 1 4 3 3 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) month X1t X2t X3t X4t 10.12806 -0.47094 -0.09304 0.69345 0.19420 -0.38008 X5t X6t X7t -0.44658 -0.10972 -0.57576 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -7.40669 -0.67964 -0.04216 0.72314 6.02514 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 10.12806 1.01914 9.938 < 2e-16 *** month -0.47094 0.07340 -6.416 1.81e-09 *** X1t -0.09304 0.15768 -0.590 0.556 X2t 0.69345 0.14050 4.936 2.14e-06 *** X3t 0.19420 0.11860 1.637 0.104 X4t -0.38008 0.04746 -8.009 3.25e-13 *** X5t -0.44658 0.05289 -8.444 2.71e-14 *** X6t -0.10972 0.12953 -0.847 0.398 X7t -0.57576 0.05745 -10.022 < 2e-16 *** --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 1.513 on 147 degrees of freedom Multiple R-squared: 0.6059, Adjusted R-squared: 0.5844 F-statistic: 28.24 on 8 and 147 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,] 0.0371083522 7.421670e-02 9.628916e-01 [2,] 0.0109387865 2.187757e-02 9.890612e-01 [3,] 0.0148915450 2.978309e-02 9.851085e-01 [4,] 0.0047530385 9.506077e-03 9.952470e-01 [5,] 0.0027575745 5.515149e-03 9.972424e-01 [6,] 0.0028625104 5.725021e-03 9.971375e-01 [7,] 0.0011678697 2.335739e-03 9.988321e-01 [8,] 0.0004717998 9.435997e-04 9.995282e-01 [9,] 0.0001591638 3.183275e-04 9.998408e-01 [10,] 0.0006998011 1.399602e-03 9.993002e-01 [11,] 0.0036965689 7.393138e-03 9.963034e-01 [12,] 0.0029143690 5.828738e-03 9.970856e-01 [13,] 0.0019302183 3.860437e-03 9.980698e-01 [14,] 0.0010086252 2.017250e-03 9.989914e-01 [15,] 0.0008993388 1.798678e-03 9.991007e-01 [16,] 0.0006767910 1.353582e-03 9.993232e-01 [17,] 0.0005642029 1.128406e-03 9.994358e-01 [18,] 0.0003072810 6.145620e-04 9.996927e-01 [19,] 0.0002229973 4.459945e-04 9.997770e-01 [20,] 0.0001441033 2.882065e-04 9.998559e-01 [21,] 0.0001357103 2.714206e-04 9.998643e-01 [22,] 0.0001727735 3.455469e-04 9.998272e-01 [23,] 0.0001875596 3.751193e-04 9.998124e-01 [24,] 0.0002891141 5.782282e-04 9.997109e-01 [25,] 0.0003611364 7.222728e-04 9.996389e-01 [26,] 0.0004815540 9.631079e-04 9.995184e-01 [27,] 0.0009403805 1.880761e-03 9.990596e-01 [28,] 0.0028672527 5.734505e-03 9.971327e-01 [29,] 0.0302459000 6.049180e-02 9.697541e-01 [30,] 0.3901926746 7.803853e-01 6.098073e-01 [31,] 0.9997272097 5.455807e-04 2.727903e-04 [32,] 0.9999809072 3.818558e-05 1.909279e-05 [33,] 0.9999955489 8.902239e-06 4.451120e-06 [34,] 0.9999940595 1.188093e-05 5.940465e-06 [35,] 0.9999924086 1.518284e-05 7.591421e-06 [36,] 0.9999952912 9.417520e-06 4.708760e-06 [37,] 0.9999918187 1.636264e-05 8.181319e-06 [38,] 0.9999922354 1.552930e-05 7.764649e-06 [39,] 0.9999873946 2.521077e-05 1.260539e-05 [40,] 0.9999828899 3.422017e-05 1.711009e-05 [41,] 0.9999930418 1.391639e-05 6.958193e-06 [42,] 0.9999907380 1.852409e-05 9.262047e-06 [43,] 0.9999885423 2.291549e-05 1.145775e-05 [44,] 0.9999885711 2.285788e-05 1.142894e-05 [45,] 0.9999848855 3.022901e-05 1.511451e-05 [46,] 0.9999821360 3.572807e-05 1.786403e-05 [47,] 0.9999710671 5.786584e-05 2.893292e-05 [48,] 0.9999902180 1.956395e-05 9.781973e-06 [49,] 0.9999986215 2.757016e-06 1.378508e-06 [50,] 0.9999986065 2.787087e-06 1.393543e-06 [51,] 0.9999978662 4.267638e-06 2.133819e-06 [52,] 0.9999986096 2.780766e-06 1.390383e-06 [53,] 0.9999984774 3.045193e-06 1.522596e-06 [54,] 0.9999979943 4.011316e-06 2.005658e-06 [55,] 0.9999964199 7.160274e-06 3.580137e-06 [56,] 0.9999967287 6.542546e-06 3.271273e-06 [57,] 0.9999951760 9.648003e-06 4.824001e-06 [58,] 0.9999922055 1.558895e-05 7.794475e-06 [59,] 0.9999974287 5.142680e-06 2.571340e-06 [60,] 0.9999957688 8.462475e-06 4.231237e-06 [61,] 0.9999929054 1.418912e-05 7.094562e-06 [62,] 0.9999896022 2.079569e-05 1.039784e-05 [63,] 0.9999949108 1.017846e-05 5.089231e-06 [64,] 0.9999929878 1.402443e-05 7.012217e-06 [65,] 0.9999970910 5.818074e-06 2.909037e-06 [66,] 0.9999954023 9.195381e-06 4.597690e-06 [67,] 0.9999958889 8.222214e-06 4.111107e-06 [68,] 0.9999970684 5.863205e-06 2.931602e-06 [69,] 0.9999989799 2.040276e-06 1.020138e-06 [70,] 0.9999999093 1.813466e-07 9.067328e-08 [71,] 0.9999999993 1.303456e-09 6.517278e-10 [72,] 0.9999999996 8.746093e-10 4.373047e-10 [73,] 0.9999999998 4.231535e-10 2.115767e-10 [74,] 0.9999999996 8.086659e-10 4.043329e-10 [75,] 0.9999999998 4.943255e-10 2.471628e-10 [76,] 1.0000000000 7.156464e-11 3.578232e-11 [77,] 1.0000000000 4.483865e-12 2.241933e-12 [78,] 1.0000000000 8.178270e-12 4.089135e-12 [79,] 1.0000000000 1.822102e-11 9.110511e-12 [80,] 1.0000000000 1.047753e-11 5.238766e-12 [81,] 1.0000000000 2.610004e-11 1.305002e-11 [82,] 1.0000000000 6.239162e-11 3.119581e-11 [83,] 0.9999999999 1.563383e-10 7.816916e-11 [84,] 0.9999999998 3.741913e-10 1.870957e-10 [85,] 0.9999999997 5.149402e-10 2.574701e-10 [86,] 1.0000000000 1.179201e-12 5.896007e-13 [87,] 1.0000000000 3.156758e-12 1.578379e-12 [88,] 1.0000000000 7.256907e-12 3.628454e-12 [89,] 1.0000000000 1.936027e-11 9.680137e-12 [90,] 1.0000000000 5.175260e-11 2.587630e-11 [91,] 0.9999999999 1.391243e-10 6.956213e-11 [92,] 0.9999999999 2.119497e-10 1.059749e-10 [93,] 0.9999999998 3.686803e-10 1.843401e-10 [94,] 0.9999999999 1.381403e-10 6.907014e-11 [95,] 0.9999999998 3.358595e-10 1.679297e-10 [96,] 0.9999999996 8.443807e-10 4.221904e-10 [97,] 0.9999999991 1.728190e-09 8.640951e-10 [98,] 0.9999999993 1.358091e-09 6.790453e-10 [99,] 0.9999999999 1.188068e-10 5.940341e-11 [100,] 0.9999999999 2.540996e-10 1.270498e-10 [101,] 0.9999999997 6.128279e-10 3.064140e-10 [102,] 0.9999999993 1.372922e-09 6.864611e-10 [103,] 0.9999999985 3.081250e-09 1.540625e-09 [104,] 0.9999999971 5.736212e-09 2.868106e-09 [105,] 0.9999999941 1.177735e-08 5.888674e-09 [106,] 0.9999999885 2.307390e-08 1.153695e-08 [107,] 0.9999999817 3.663795e-08 1.831897e-08 [108,] 0.9999999675 6.495456e-08 3.247728e-08 [109,] 0.9999999169 1.661631e-07 8.308154e-08 [110,] 0.9999998707 2.586179e-07 1.293090e-07 [111,] 0.9999996607 6.785704e-07 3.392852e-07 [112,] 0.9999992083 1.583477e-06 7.917384e-07 [113,] 0.9999988424 2.315290e-06 1.157645e-06 [114,] 0.9999973671 5.265759e-06 2.632880e-06 [115,] 0.9999947719 1.045628e-05 5.228141e-06 [116,] 0.9999896370 2.072592e-05 1.036296e-05 [117,] 0.9999804189 3.916217e-05 1.958108e-05 [118,] 0.9999620401 7.591973e-05 3.795987e-05 [119,] 0.9999749066 5.018682e-05 2.509341e-05 [120,] 0.9999519302 9.613962e-05 4.806981e-05 [121,] 0.9998758783 2.482434e-04 1.241217e-04 [122,] 0.9997968690 4.062619e-04 2.031310e-04 [123,] 0.9998669846 2.660307e-04 1.330154e-04 [124,] 0.9998517598 2.964803e-04 1.482402e-04 [125,] 0.9996162518 7.674964e-04 3.837482e-04 [126,] 0.9992316883 1.536623e-03 7.683117e-04 [127,] 0.9986865830 2.626834e-03 1.313417e-03 [128,] 0.9964167789 7.166442e-03 3.583221e-03 [129,] 0.9925665723 1.486686e-02 7.433428e-03 [130,] 0.9809034969 3.819301e-02 1.909650e-02 [131,] 0.9537312598 9.253748e-02 4.626874e-02 [132,] 0.9229089799 1.541820e-01 7.709102e-02 [133,] 0.8768981144 2.462038e-01 1.231019e-01 > postscript(file="/var/www/html/freestat/rcomp/tmp/1df1o1291332373.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/www/html/freestat/rcomp/tmp/2df1o1291332373.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/www/html/freestat/rcomp/tmp/3df1o1291332373.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/www/html/freestat/rcomp/tmp/456i91291332373.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/www/html/freestat/rcomp/tmp/556i91291332373.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 = 156 Frequency = 1 1 2 3 4 5 6 -0.63735520 -0.91453191 0.98585117 -0.54282244 -1.17563969 -1.10932748 7 8 9 10 11 12 -1.10396127 -1.73323005 -0.06044986 -0.45455629 0.48256730 -1.37780282 13 14 15 16 17 18 -0.41110753 -0.18814604 1.49704088 0.24355000 2.43735912 1.80061005 19 20 21 22 23 24 1.01351102 1.74017486 -0.06952205 2.84730875 1.20429047 0.04786770 25 26 27 28 29 30 1.54822643 2.95213426 1.62111110 2.15012449 1.66739809 2.27843789 31 32 33 34 35 36 1.89135893 1.74880728 2.57695301 0.79985662 -0.79825014 2.48609623 37 38 39 40 41 42 2.19049127 1.60213590 1.16814662 2.95703282 6.02514371 -1.47190738 43 44 45 46 47 48 -0.73880045 -1.73835276 0.06944230 0.43417661 -0.92703590 -1.22222240 49 50 51 52 53 54 -0.74467681 -0.32840313 1.24473236 0.55849275 -0.04735080 -0.71600811 55 56 57 58 59 60 -0.09385111 -0.32954637 -1.68724554 0.51643097 -3.19815190 2.60946668 61 62 63 64 65 66 -1.54905240 0.05316005 0.69283427 0.48918776 -0.14390831 0.34217660 67 68 69 70 71 72 0.11414701 -0.46651365 1.30291707 -2.96930846 0.62922070 1.02617940 73 74 75 76 77 78 -0.80641721 0.71804715 0.56072956 1.08979297 0.18282868 -0.02012163 79 80 81 82 83 84 -0.66727099 -1.63615386 -4.61905578 -0.81664287 0.70431457 -0.81016203 85 86 87 88 89 90 0.15722117 0.87795076 -1.21771156 -1.35367050 0.12855247 0.56343694 91 92 93 94 95 96 -0.18596135 -0.12363152 -0.14031989 0.35254965 -0.12204924 -0.49978683 97 98 99 100 101 102 -3.89070374 -0.29124176 0.24788743 -0.40036919 -0.03059581 -0.03697775 103 104 105 106 107 108 -0.43260269 -0.63966298 1.07116973 -0.54024534 -0.44452727 -0.64140855 109 110 111 112 113 114 -0.33425661 -0.22253029 -0.83340055 -1.01977051 -0.23328441 0.18498325 115 116 117 118 119 120 0.97730434 0.43185110 0.43185110 0.68417684 -0.59539211 -0.88262674 121 122 123 124 125 126 -0.67986695 -0.60588907 0.01053836 -0.26159929 0.79106963 1.21067153 127 128 129 130 131 132 0.54420179 -1.34866477 -2.33516936 -1.31685838 0.73840071 -0.41169015 133 134 135 136 137 138 1.04076877 0.98922940 -0.10514054 -0.23328441 -1.31602783 0.19155582 139 140 141 142 143 144 0.52385111 -1.77027605 0.33881539 -0.59539211 0.48714664 -1.75314864 145 146 147 148 149 150 -0.32632011 -1.90897476 0.16690324 0.30237300 0.29470733 1.68423473 151 152 153 154 155 156 0.31446135 -0.58786694 -0.67956841 0.77161415 -2.73131986 -7.40669369 > postscript(file="/var/www/html/freestat/rcomp/tmp/6yyzc1291332373.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 = 156 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.63735520 NA 1 -0.91453191 -0.63735520 2 0.98585117 -0.91453191 3 -0.54282244 0.98585117 4 -1.17563969 -0.54282244 5 -1.10932748 -1.17563969 6 -1.10396127 -1.10932748 7 -1.73323005 -1.10396127 8 -0.06044986 -1.73323005 9 -0.45455629 -0.06044986 10 0.48256730 -0.45455629 11 -1.37780282 0.48256730 12 -0.41110753 -1.37780282 13 -0.18814604 -0.41110753 14 1.49704088 -0.18814604 15 0.24355000 1.49704088 16 2.43735912 0.24355000 17 1.80061005 2.43735912 18 1.01351102 1.80061005 19 1.74017486 1.01351102 20 -0.06952205 1.74017486 21 2.84730875 -0.06952205 22 1.20429047 2.84730875 23 0.04786770 1.20429047 24 1.54822643 0.04786770 25 2.95213426 1.54822643 26 1.62111110 2.95213426 27 2.15012449 1.62111110 28 1.66739809 2.15012449 29 2.27843789 1.66739809 30 1.89135893 2.27843789 31 1.74880728 1.89135893 32 2.57695301 1.74880728 33 0.79985662 2.57695301 34 -0.79825014 0.79985662 35 2.48609623 -0.79825014 36 2.19049127 2.48609623 37 1.60213590 2.19049127 38 1.16814662 1.60213590 39 2.95703282 1.16814662 40 6.02514371 2.95703282 41 -1.47190738 6.02514371 42 -0.73880045 -1.47190738 43 -1.73835276 -0.73880045 44 0.06944230 -1.73835276 45 0.43417661 0.06944230 46 -0.92703590 0.43417661 47 -1.22222240 -0.92703590 48 -0.74467681 -1.22222240 49 -0.32840313 -0.74467681 50 1.24473236 -0.32840313 51 0.55849275 1.24473236 52 -0.04735080 0.55849275 53 -0.71600811 -0.04735080 54 -0.09385111 -0.71600811 55 -0.32954637 -0.09385111 56 -1.68724554 -0.32954637 57 0.51643097 -1.68724554 58 -3.19815190 0.51643097 59 2.60946668 -3.19815190 60 -1.54905240 2.60946668 61 0.05316005 -1.54905240 62 0.69283427 0.05316005 63 0.48918776 0.69283427 64 -0.14390831 0.48918776 65 0.34217660 -0.14390831 66 0.11414701 0.34217660 67 -0.46651365 0.11414701 68 1.30291707 -0.46651365 69 -2.96930846 1.30291707 70 0.62922070 -2.96930846 71 1.02617940 0.62922070 72 -0.80641721 1.02617940 73 0.71804715 -0.80641721 74 0.56072956 0.71804715 75 1.08979297 0.56072956 76 0.18282868 1.08979297 77 -0.02012163 0.18282868 78 -0.66727099 -0.02012163 79 -1.63615386 -0.66727099 80 -4.61905578 -1.63615386 81 -0.81664287 -4.61905578 82 0.70431457 -0.81664287 83 -0.81016203 0.70431457 84 0.15722117 -0.81016203 85 0.87795076 0.15722117 86 -1.21771156 0.87795076 87 -1.35367050 -1.21771156 88 0.12855247 -1.35367050 89 0.56343694 0.12855247 90 -0.18596135 0.56343694 91 -0.12363152 -0.18596135 92 -0.14031989 -0.12363152 93 0.35254965 -0.14031989 94 -0.12204924 0.35254965 95 -0.49978683 -0.12204924 96 -3.89070374 -0.49978683 97 -0.29124176 -3.89070374 98 0.24788743 -0.29124176 99 -0.40036919 0.24788743 100 -0.03059581 -0.40036919 101 -0.03697775 -0.03059581 102 -0.43260269 -0.03697775 103 -0.63966298 -0.43260269 104 1.07116973 -0.63966298 105 -0.54024534 1.07116973 106 -0.44452727 -0.54024534 107 -0.64140855 -0.44452727 108 -0.33425661 -0.64140855 109 -0.22253029 -0.33425661 110 -0.83340055 -0.22253029 111 -1.01977051 -0.83340055 112 -0.23328441 -1.01977051 113 0.18498325 -0.23328441 114 0.97730434 0.18498325 115 0.43185110 0.97730434 116 0.43185110 0.43185110 117 0.68417684 0.43185110 118 -0.59539211 0.68417684 119 -0.88262674 -0.59539211 120 -0.67986695 -0.88262674 121 -0.60588907 -0.67986695 122 0.01053836 -0.60588907 123 -0.26159929 0.01053836 124 0.79106963 -0.26159929 125 1.21067153 0.79106963 126 0.54420179 1.21067153 127 -1.34866477 0.54420179 128 -2.33516936 -1.34866477 129 -1.31685838 -2.33516936 130 0.73840071 -1.31685838 131 -0.41169015 0.73840071 132 1.04076877 -0.41169015 133 0.98922940 1.04076877 134 -0.10514054 0.98922940 135 -0.23328441 -0.10514054 136 -1.31602783 -0.23328441 137 0.19155582 -1.31602783 138 0.52385111 0.19155582 139 -1.77027605 0.52385111 140 0.33881539 -1.77027605 141 -0.59539211 0.33881539 142 0.48714664 -0.59539211 143 -1.75314864 0.48714664 144 -0.32632011 -1.75314864 145 -1.90897476 -0.32632011 146 0.16690324 -1.90897476 147 0.30237300 0.16690324 148 0.29470733 0.30237300 149 1.68423473 0.29470733 150 0.31446135 1.68423473 151 -0.58786694 0.31446135 152 -0.67956841 -0.58786694 153 0.77161415 -0.67956841 154 -2.73131986 0.77161415 155 -7.40669369 -2.73131986 156 NA -7.40669369 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.91453191 -0.63735520 [2,] 0.98585117 -0.91453191 [3,] -0.54282244 0.98585117 [4,] -1.17563969 -0.54282244 [5,] -1.10932748 -1.17563969 [6,] -1.10396127 -1.10932748 [7,] -1.73323005 -1.10396127 [8,] -0.06044986 -1.73323005 [9,] -0.45455629 -0.06044986 [10,] 0.48256730 -0.45455629 [11,] -1.37780282 0.48256730 [12,] -0.41110753 -1.37780282 [13,] -0.18814604 -0.41110753 [14,] 1.49704088 -0.18814604 [15,] 0.24355000 1.49704088 [16,] 2.43735912 0.24355000 [17,] 1.80061005 2.43735912 [18,] 1.01351102 1.80061005 [19,] 1.74017486 1.01351102 [20,] -0.06952205 1.74017486 [21,] 2.84730875 -0.06952205 [22,] 1.20429047 2.84730875 [23,] 0.04786770 1.20429047 [24,] 1.54822643 0.04786770 [25,] 2.95213426 1.54822643 [26,] 1.62111110 2.95213426 [27,] 2.15012449 1.62111110 [28,] 1.66739809 2.15012449 [29,] 2.27843789 1.66739809 [30,] 1.89135893 2.27843789 [31,] 1.74880728 1.89135893 [32,] 2.57695301 1.74880728 [33,] 0.79985662 2.57695301 [34,] -0.79825014 0.79985662 [35,] 2.48609623 -0.79825014 [36,] 2.19049127 2.48609623 [37,] 1.60213590 2.19049127 [38,] 1.16814662 1.60213590 [39,] 2.95703282 1.16814662 [40,] 6.02514371 2.95703282 [41,] -1.47190738 6.02514371 [42,] -0.73880045 -1.47190738 [43,] -1.73835276 -0.73880045 [44,] 0.06944230 -1.73835276 [45,] 0.43417661 0.06944230 [46,] -0.92703590 0.43417661 [47,] -1.22222240 -0.92703590 [48,] -0.74467681 -1.22222240 [49,] -0.32840313 -0.74467681 [50,] 1.24473236 -0.32840313 [51,] 0.55849275 1.24473236 [52,] -0.04735080 0.55849275 [53,] -0.71600811 -0.04735080 [54,] -0.09385111 -0.71600811 [55,] -0.32954637 -0.09385111 [56,] -1.68724554 -0.32954637 [57,] 0.51643097 -1.68724554 [58,] -3.19815190 0.51643097 [59,] 2.60946668 -3.19815190 [60,] -1.54905240 2.60946668 [61,] 0.05316005 -1.54905240 [62,] 0.69283427 0.05316005 [63,] 0.48918776 0.69283427 [64,] -0.14390831 0.48918776 [65,] 0.34217660 -0.14390831 [66,] 0.11414701 0.34217660 [67,] -0.46651365 0.11414701 [68,] 1.30291707 -0.46651365 [69,] -2.96930846 1.30291707 [70,] 0.62922070 -2.96930846 [71,] 1.02617940 0.62922070 [72,] -0.80641721 1.02617940 [73,] 0.71804715 -0.80641721 [74,] 0.56072956 0.71804715 [75,] 1.08979297 0.56072956 [76,] 0.18282868 1.08979297 [77,] -0.02012163 0.18282868 [78,] -0.66727099 -0.02012163 [79,] -1.63615386 -0.66727099 [80,] -4.61905578 -1.63615386 [81,] -0.81664287 -4.61905578 [82,] 0.70431457 -0.81664287 [83,] -0.81016203 0.70431457 [84,] 0.15722117 -0.81016203 [85,] 0.87795076 0.15722117 [86,] -1.21771156 0.87795076 [87,] -1.35367050 -1.21771156 [88,] 0.12855247 -1.35367050 [89,] 0.56343694 0.12855247 [90,] -0.18596135 0.56343694 [91,] -0.12363152 -0.18596135 [92,] -0.14031989 -0.12363152 [93,] 0.35254965 -0.14031989 [94,] -0.12204924 0.35254965 [95,] -0.49978683 -0.12204924 [96,] -3.89070374 -0.49978683 [97,] -0.29124176 -3.89070374 [98,] 0.24788743 -0.29124176 [99,] -0.40036919 0.24788743 [100,] -0.03059581 -0.40036919 [101,] -0.03697775 -0.03059581 [102,] -0.43260269 -0.03697775 [103,] -0.63966298 -0.43260269 [104,] 1.07116973 -0.63966298 [105,] -0.54024534 1.07116973 [106,] -0.44452727 -0.54024534 [107,] -0.64140855 -0.44452727 [108,] -0.33425661 -0.64140855 [109,] -0.22253029 -0.33425661 [110,] -0.83340055 -0.22253029 [111,] -1.01977051 -0.83340055 [112,] -0.23328441 -1.01977051 [113,] 0.18498325 -0.23328441 [114,] 0.97730434 0.18498325 [115,] 0.43185110 0.97730434 [116,] 0.43185110 0.43185110 [117,] 0.68417684 0.43185110 [118,] -0.59539211 0.68417684 [119,] -0.88262674 -0.59539211 [120,] -0.67986695 -0.88262674 [121,] -0.60588907 -0.67986695 [122,] 0.01053836 -0.60588907 [123,] -0.26159929 0.01053836 [124,] 0.79106963 -0.26159929 [125,] 1.21067153 0.79106963 [126,] 0.54420179 1.21067153 [127,] -1.34866477 0.54420179 [128,] -2.33516936 -1.34866477 [129,] -1.31685838 -2.33516936 [130,] 0.73840071 -1.31685838 [131,] -0.41169015 0.73840071 [132,] 1.04076877 -0.41169015 [133,] 0.98922940 1.04076877 [134,] -0.10514054 0.98922940 [135,] -0.23328441 -0.10514054 [136,] -1.31602783 -0.23328441 [137,] 0.19155582 -1.31602783 [138,] 0.52385111 0.19155582 [139,] -1.77027605 0.52385111 [140,] 0.33881539 -1.77027605 [141,] -0.59539211 0.33881539 [142,] 0.48714664 -0.59539211 [143,] -1.75314864 0.48714664 [144,] -0.32632011 -1.75314864 [145,] -1.90897476 -0.32632011 [146,] 0.16690324 -1.90897476 [147,] 0.30237300 0.16690324 [148,] 0.29470733 0.30237300 [149,] 1.68423473 0.29470733 [150,] 0.31446135 1.68423473 [151,] -0.58786694 0.31446135 [152,] -0.67956841 -0.58786694 [153,] 0.77161415 -0.67956841 [154,] -2.73131986 0.77161415 [155,] -7.40669369 -2.73131986 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.91453191 -0.63735520 2 0.98585117 -0.91453191 3 -0.54282244 0.98585117 4 -1.17563969 -0.54282244 5 -1.10932748 -1.17563969 6 -1.10396127 -1.10932748 7 -1.73323005 -1.10396127 8 -0.06044986 -1.73323005 9 -0.45455629 -0.06044986 10 0.48256730 -0.45455629 11 -1.37780282 0.48256730 12 -0.41110753 -1.37780282 13 -0.18814604 -0.41110753 14 1.49704088 -0.18814604 15 0.24355000 1.49704088 16 2.43735912 0.24355000 17 1.80061005 2.43735912 18 1.01351102 1.80061005 19 1.74017486 1.01351102 20 -0.06952205 1.74017486 21 2.84730875 -0.06952205 22 1.20429047 2.84730875 23 0.04786770 1.20429047 24 1.54822643 0.04786770 25 2.95213426 1.54822643 26 1.62111110 2.95213426 27 2.15012449 1.62111110 28 1.66739809 2.15012449 29 2.27843789 1.66739809 30 1.89135893 2.27843789 31 1.74880728 1.89135893 32 2.57695301 1.74880728 33 0.79985662 2.57695301 34 -0.79825014 0.79985662 35 2.48609623 -0.79825014 36 2.19049127 2.48609623 37 1.60213590 2.19049127 38 1.16814662 1.60213590 39 2.95703282 1.16814662 40 6.02514371 2.95703282 41 -1.47190738 6.02514371 42 -0.73880045 -1.47190738 43 -1.73835276 -0.73880045 44 0.06944230 -1.73835276 45 0.43417661 0.06944230 46 -0.92703590 0.43417661 47 -1.22222240 -0.92703590 48 -0.74467681 -1.22222240 49 -0.32840313 -0.74467681 50 1.24473236 -0.32840313 51 0.55849275 1.24473236 52 -0.04735080 0.55849275 53 -0.71600811 -0.04735080 54 -0.09385111 -0.71600811 55 -0.32954637 -0.09385111 56 -1.68724554 -0.32954637 57 0.51643097 -1.68724554 58 -3.19815190 0.51643097 59 2.60946668 -3.19815190 60 -1.54905240 2.60946668 61 0.05316005 -1.54905240 62 0.69283427 0.05316005 63 0.48918776 0.69283427 64 -0.14390831 0.48918776 65 0.34217660 -0.14390831 66 0.11414701 0.34217660 67 -0.46651365 0.11414701 68 1.30291707 -0.46651365 69 -2.96930846 1.30291707 70 0.62922070 -2.96930846 71 1.02617940 0.62922070 72 -0.80641721 1.02617940 73 0.71804715 -0.80641721 74 0.56072956 0.71804715 75 1.08979297 0.56072956 76 0.18282868 1.08979297 77 -0.02012163 0.18282868 78 -0.66727099 -0.02012163 79 -1.63615386 -0.66727099 80 -4.61905578 -1.63615386 81 -0.81664287 -4.61905578 82 0.70431457 -0.81664287 83 -0.81016203 0.70431457 84 0.15722117 -0.81016203 85 0.87795076 0.15722117 86 -1.21771156 0.87795076 87 -1.35367050 -1.21771156 88 0.12855247 -1.35367050 89 0.56343694 0.12855247 90 -0.18596135 0.56343694 91 -0.12363152 -0.18596135 92 -0.14031989 -0.12363152 93 0.35254965 -0.14031989 94 -0.12204924 0.35254965 95 -0.49978683 -0.12204924 96 -3.89070374 -0.49978683 97 -0.29124176 -3.89070374 98 0.24788743 -0.29124176 99 -0.40036919 0.24788743 100 -0.03059581 -0.40036919 101 -0.03697775 -0.03059581 102 -0.43260269 -0.03697775 103 -0.63966298 -0.43260269 104 1.07116973 -0.63966298 105 -0.54024534 1.07116973 106 -0.44452727 -0.54024534 107 -0.64140855 -0.44452727 108 -0.33425661 -0.64140855 109 -0.22253029 -0.33425661 110 -0.83340055 -0.22253029 111 -1.01977051 -0.83340055 112 -0.23328441 -1.01977051 113 0.18498325 -0.23328441 114 0.97730434 0.18498325 115 0.43185110 0.97730434 116 0.43185110 0.43185110 117 0.68417684 0.43185110 118 -0.59539211 0.68417684 119 -0.88262674 -0.59539211 120 -0.67986695 -0.88262674 121 -0.60588907 -0.67986695 122 0.01053836 -0.60588907 123 -0.26159929 0.01053836 124 0.79106963 -0.26159929 125 1.21067153 0.79106963 126 0.54420179 1.21067153 127 -1.34866477 0.54420179 128 -2.33516936 -1.34866477 129 -1.31685838 -2.33516936 130 0.73840071 -1.31685838 131 -0.41169015 0.73840071 132 1.04076877 -0.41169015 133 0.98922940 1.04076877 134 -0.10514054 0.98922940 135 -0.23328441 -0.10514054 136 -1.31602783 -0.23328441 137 0.19155582 -1.31602783 138 0.52385111 0.19155582 139 -1.77027605 0.52385111 140 0.33881539 -1.77027605 141 -0.59539211 0.33881539 142 0.48714664 -0.59539211 143 -1.75314864 0.48714664 144 -0.32632011 -1.75314864 145 -1.90897476 -0.32632011 146 0.16690324 -1.90897476 147 0.30237300 0.16690324 148 0.29470733 0.30237300 149 1.68423473 0.29470733 150 0.31446135 1.68423473 151 -0.58786694 0.31446135 152 -0.67956841 -0.58786694 153 0.77161415 -0.67956841 154 -2.73131986 0.77161415 155 -7.40669369 -2.73131986 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/7yyzc1291332373.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/www/html/freestat/rcomp/tmp/8rpgw1291332373.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/www/html/freestat/rcomp/tmp/9rpgw1291332373.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/www/html/freestat/rcomp/tmp/10jgfz1291332373.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/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/11nze51291332373.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/12qzvb1291332373.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/134rs21291332373.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/148s981291332373.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/html/freestat/rcomp/tmp/15tspe1291332373.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/html/freestat/rcomp/tmp/16fto21291332373.tab") + } > > try(system("convert tmp/1df1o1291332373.ps tmp/1df1o1291332373.png",intern=TRUE)) character(0) > try(system("convert tmp/2df1o1291332373.ps tmp/2df1o1291332373.png",intern=TRUE)) character(0) > try(system("convert tmp/3df1o1291332373.ps tmp/3df1o1291332373.png",intern=TRUE)) character(0) > try(system("convert tmp/456i91291332373.ps tmp/456i91291332373.png",intern=TRUE)) character(0) > try(system("convert tmp/556i91291332373.ps tmp/556i91291332373.png",intern=TRUE)) character(0) > try(system("convert tmp/6yyzc1291332373.ps tmp/6yyzc1291332373.png",intern=TRUE)) character(0) > try(system("convert tmp/7yyzc1291332373.ps tmp/7yyzc1291332373.png",intern=TRUE)) character(0) > try(system("convert tmp/8rpgw1291332373.ps tmp/8rpgw1291332373.png",intern=TRUE)) character(0) > try(system("convert tmp/9rpgw1291332373.ps tmp/9rpgw1291332373.png",intern=TRUE)) character(0) > try(system("convert tmp/10jgfz1291332373.ps tmp/10jgfz1291332373.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.292 2.736 7.434