R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(3 + ,3 + ,3 + ,4 + ,3 + ,3 + ,3 + ,4 + ,4 + ,4 + ,3 + ,3 + ,3 + ,3 + ,3 + ,4 + ,3 + ,2 + ,2 + ,3 + ,3 + ,3 + ,2 + ,4 + ,3 + ,4 + ,4 + ,4 + ,2 + ,2 + ,2 + ,4 + ,3 + ,3 + ,3 + ,4 + ,3 + ,4 + ,2 + ,2 + ,3 + ,3 + ,4 + ,2 + ,3 + ,3 + ,3 + ,4 + ,3 + ,4 + ,3 + ,4 + ,2 + ,2 + ,2 + ,4 + ,3 + ,2 + ,3 + ,4 + ,3 + ,3 + ,2 + ,3 + ,2 + ,2 + ,3 + ,4 + ,3 + ,4 + ,3 + ,4 + ,2 + ,2 + ,2 + ,3 + ,1 + ,1 + ,3 + ,2 + ,2 + ,3 + ,2 + ,2 + ,3 + ,4 + ,3 + ,4 + ,3 + ,2 + ,3 + ,3 + ,3 + ,3 + ,2 + ,4 + ,3 + ,3 + ,3 + ,4 + ,3 + ,4 + ,3 + ,3 + ,2 + ,3 + ,4 + ,3 + ,3 + ,3 + ,3 + ,2 + ,3 + ,4 + ,3 + ,3 + ,4 + ,4 + ,2 + ,4 + ,3 + ,4 + ,2 + ,3 + ,3 + ,3 + ,4 + ,3 + ,3 + ,4 + ,4 + ,4 + ,2 + ,2 + ,3 + ,4 + ,3 + ,4 + ,4 + ,3 + ,3 + ,3 + ,3 + ,4 + ,3 + ,2 + ,2 + ,2 + ,3 + ,4 + ,3 + ,3 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,3 + ,4 + ,3 + ,4 + ,3 + ,3 + ,1 + ,2 + ,2 + ,5 + ,2 + ,2 + ,2 + ,3 + ,3 + ,3 + ,3 + ,3 + ,4 + ,4 + ,4 + ,4 + ,4 + ,5 + ,4 + ,4 + ,2 + ,2 + ,2 + ,5 + ,1 + ,3 + ,3 + ,3 + ,3 + ,3 + ,3 + ,4 + ,3 + ,2 + ,3 + ,4 + ,1 + ,2 + ,2 + ,2 + ,3 + ,3 + ,4 + ,4 + ,2 + ,2 + ,3 + ,4 + ,3 + ,4 + ,4 + ,4 + ,3 + ,3 + ,3 + ,3 + ,2 + ,3 + ,3 + ,3 + ,4 + ,4 + ,4 + ,3 + ,1 + ,1 + ,1 + ,2 + ,3 + ,4 + ,4 + ,4 + ,2 + ,2 + ,2 + ,4 + ,4 + ,4 + ,3 + ,4 + ,3 + ,4 + ,3 + ,3 + ,4 + ,4 + ,3 + ,4 + ,3 + ,2 + ,3 + ,3 + ,3 + ,4 + ,4 + ,4 + ,3 + ,2 + ,2 + ,4 + ,3 + ,4 + ,2 + ,4 + ,3 + ,4 + ,4 + ,4 + ,1 + ,1 + ,1 + ,4 + ,3 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,4 + ,3 + ,3 + ,3 + ,4 + ,2 + ,3 + ,2 + ,2 + ,3 + ,3 + ,3 + ,3 + ,3 + ,3 + ,3 + ,4 + ,3 + ,3 + ,3 + ,4 + ,2 + ,3 + ,3 + ,3 + ,3 + ,4 + ,4 + ,4 + ,2 + ,1 + ,2 + ,4 + ,2 + ,3 + ,3 + ,4 + ,3 + ,4 + ,3 + ,3 + ,3 + ,3 + ,3 + ,3 + ,2 + ,3 + ,2 + ,3 + ,2 + ,4 + ,2 + ,3 + ,3 + ,3 + ,3 + ,4 + ,2 + ,2 + ,2 + ,4 + ,3 + ,3 + ,3 + ,2 + ,4 + ,4 + ,3 + ,4 + ,2 + ,3 + ,3 + ,3 + ,3 + ,4 + ,3 + ,4 + ,2 + ,3 + ,4 + ,3 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,3 + ,3 + ,3 + ,3 + ,3 + ,3 + ,2 + ,2 + ,4 + ,3 + ,1 + ,3 + ,3 + ,2 + ,2 + ,2 + ,4 + ,3 + ,2 + ,3 + ,2 + ,4 + ,3 + ,3 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,3 + ,3 + ,3 + ,4 + ,3 + ,3 + ,2 + ,4 + ,1 + ,1 + ,1 + ,3 + ,4 + ,3 + ,3 + ,4 + ,1 + ,3 + ,3 + ,3 + ,3 + ,4 + ,4 + ,4 + ,2 + ,2 + ,2 + ,3 + ,3 + ,3 + ,3 + ,3 + ,3 + ,3 + ,4 + ,2 + ,2 + ,3 + ,3 + ,4 + ,3 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,1 + ,4 + ,4 + ,3 + ,4 + ,3 + ,2 + ,3 + ,4 + ,3 + ,3 + ,3 + ,4 + ,3 + ,4 + ,3 + ,3 + ,3 + ,3 + ,3 + ,4 + ,3 + ,4 + ,3 + ,4 + ,1 + ,2 + ,3 + ,3 + ,2 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,3 + ,3 + ,2 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,3 + ,3 + ,4 + ,2 + ,3 + ,3 + ,3 + ,1 + ,1 + ,1 + ,3 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,3 + ,4 + ,3 + ,2 + ,2 + ,4 + ,3 + ,3 + ,2 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,3 + ,3 + ,4 + ,3 + ,4 + ,4 + ,4 + ,1 + ,2 + ,2 + ,4 + ,4 + ,5 + ,4 + ,4 + ,2 + ,3 + ,4 + ,3 + ,2 + ,4 + ,3 + ,3 + ,3 + ,3 + ,3 + ,4 + ,3 + ,4 + ,3 + ,4 + ,2 + ,2 + ,2 + ,2 + ,3 + ,3 + ,3 + ,4 + ,3 + ,3 + ,3 + ,4 + ,2 + ,2 + ,3 + ,4 + ,3 + ,4 + ,4 + ,4 + ,4 + ,4 + ,3 + ,4 + ,4 + ,3 + ,3 + ,4 + ,4 + ,4 + ,4 + ,4 + ,2 + ,2 + ,2 + ,4 + ,3 + ,4 + ,3 + ,4 + ,3 + ,4 + ,4 + ,4 + ,3 + ,3 + ,2 + ,4) + ,dim=c(4 + ,153) + ,dimnames=list(c('Popular' + ,'Friends(s)' + ,'Friends(f)' + ,'Future') + ,1:153)) > y <- array(NA,dim=c(4,153),dimnames=list(c('Popular','Friends(s)','Friends(f)','Future'),1:153)) > 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 = '4' > #'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 Future Popular Friends(s) Friends(f) 1 4 3 3 3 2 4 3 3 3 3 3 4 4 3 4 4 3 3 3 5 3 3 2 2 6 4 3 3 2 7 4 3 4 4 8 4 2 2 2 9 4 3 3 3 10 2 3 4 2 11 2 3 3 4 12 4 3 3 3 13 4 3 4 3 14 4 2 2 2 15 4 3 2 3 16 3 3 3 2 17 4 2 2 3 18 4 3 4 3 19 3 2 2 2 20 2 1 1 3 21 2 2 3 2 22 4 3 4 3 23 3 3 2 3 24 4 3 3 2 25 4 3 3 3 26 3 3 4 3 27 3 2 3 4 28 2 3 3 3 29 3 3 4 3 30 4 4 4 2 31 3 3 4 2 32 3 3 3 4 33 4 3 4 4 34 4 2 2 3 35 3 3 4 4 36 4 3 3 3 37 2 3 2 2 38 3 3 4 3 39 4 4 4 4 40 4 3 4 3 41 3 3 4 3 42 5 1 2 2 43 3 2 2 2 44 3 3 3 3 45 4 4 4 4 46 4 4 5 4 47 5 2 2 2 48 3 1 3 3 49 4 3 3 3 50 4 3 2 3 51 2 1 2 2 52 4 3 3 4 53 4 2 2 3 54 4 3 4 4 55 3 3 3 3 56 3 2 3 3 57 3 4 4 4 58 2 1 1 1 59 4 3 4 4 60 4 2 2 2 61 4 4 4 3 62 3 3 4 3 63 4 4 4 3 64 3 3 2 3 65 4 3 4 4 66 4 3 2 2 67 4 3 4 2 68 4 3 4 4 69 4 1 1 1 70 4 3 4 4 71 4 3 4 4 72 4 3 3 3 73 2 2 3 2 74 3 3 3 3 75 4 3 3 3 76 4 3 3 3 77 3 2 3 3 78 4 3 4 4 79 4 2 1 2 80 4 2 3 3 81 3 3 4 3 82 3 3 3 3 83 3 2 3 2 84 3 2 4 2 85 4 3 3 3 86 4 2 2 2 87 2 3 3 3 88 4 4 4 3 89 3 2 3 3 90 4 3 4 3 91 3 2 3 4 92 4 4 4 4 93 3 3 4 4 94 3 3 3 3 95 4 3 2 2 96 3 3 1 3 97 4 2 2 2 98 2 3 2 3 99 4 4 3 3 100 4 4 4 4 101 4 4 4 3 102 4 3 3 3 103 4 3 3 2 104 3 1 1 1 105 4 4 3 3 106 3 1 3 3 107 4 3 4 4 108 3 2 2 2 109 3 3 3 3 110 2 3 3 4 111 4 2 3 3 112 4 3 4 4 113 4 3 4 4 114 1 4 4 3 115 4 4 4 3 116 4 3 2 3 117 4 3 3 3 118 3 3 4 3 119 4 3 3 3 120 4 3 4 3 121 3 1 2 3 122 4 2 4 4 123 4 4 4 3 124 4 3 3 2 125 4 4 4 4 126 4 3 3 3 127 3 2 3 3 128 3 1 1 1 129 4 4 4 4 130 4 3 4 3 131 4 3 2 2 132 4 3 3 2 133 4 4 4 4 134 4 3 3 3 135 4 3 4 4 136 4 1 2 2 137 4 4 5 4 138 3 2 3 4 139 3 2 4 3 140 4 3 3 3 141 4 3 4 3 142 2 2 2 2 143 4 3 3 3 144 4 3 3 3 145 4 2 2 3 146 4 3 4 4 147 4 4 4 3 148 4 4 3 3 149 4 4 4 4 150 4 2 2 2 151 4 3 4 3 152 4 3 4 4 153 4 3 3 2 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Popular `Friends(s)` `Friends(f)` 2.880869 0.192485 0.003701 0.039144 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2.7830 -0.4335 0.2561 0.4131 1.8410 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.880869 0.249779 11.534 <2e-16 *** Popular 0.192485 0.092765 2.075 0.0397 * `Friends(s)` 0.003701 0.091270 0.041 0.9677 `Friends(f)` 0.039144 0.094358 0.415 0.6789 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.6831 on 149 degrees of freedom Multiple R-squared: 0.05898, Adjusted R-squared: 0.04004 F-statistic: 3.113 on 3 and 149 DF, p-value: 0.02814 > 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.11038892 2.207778e-01 8.896111e-01 [2,] 0.09801448 1.960290e-01 9.019855e-01 [3,] 0.05134182 1.026836e-01 9.486582e-01 [4,] 0.24611182 4.922236e-01 7.538882e-01 [5,] 0.93100903 1.379819e-01 6.899097e-02 [6,] 0.90683647 1.863271e-01 9.316353e-02 [7,] 0.88691250 2.261750e-01 1.130875e-01 [8,] 0.84083305 3.183339e-01 1.591670e-01 [9,] 0.79275445 4.144911e-01 2.072456e-01 [10,] 0.74973646 5.005271e-01 2.502635e-01 [11,] 0.68922789 6.215442e-01 3.107721e-01 [12,] 0.65317969 6.936406e-01 3.468203e-01 [13,] 0.67232366 6.553527e-01 3.276763e-01 [14,] 0.87845622 2.430876e-01 1.215438e-01 [15,] 0.92249419 1.550116e-01 7.750581e-02 [16,] 0.91043887 1.791223e-01 8.956113e-02 [17,] 0.90299844 1.940031e-01 9.700156e-02 [18,] 0.88753700 2.249260e-01 1.124630e-01 [19,] 0.86519033 2.696193e-01 1.348097e-01 [20,] 0.84717601 3.056480e-01 1.528240e-01 [21,] 0.81244121 3.751176e-01 1.875588e-01 [22,] 0.92228107 1.554379e-01 7.771893e-02 [23,] 0.90759714 1.848057e-01 9.240286e-02 [24,] 0.88317860 2.336428e-01 1.168214e-01 [25,] 0.86302753 2.739449e-01 1.369725e-01 [26,] 0.84644841 3.071032e-01 1.535516e-01 [27,] 0.83449144 3.310171e-01 1.655086e-01 [28,] 0.83697157 3.260569e-01 1.630284e-01 [29,] 0.81713611 3.657278e-01 1.828639e-01 [30,] 0.79601827 4.079635e-01 2.039817e-01 [31,] 0.90637548 1.872490e-01 9.362452e-02 [32,] 0.89374980 2.125004e-01 1.062502e-01 [33,] 0.86979598 2.604080e-01 1.302040e-01 [34,] 0.85626317 2.874737e-01 1.437368e-01 [35,] 0.84099365 3.180127e-01 1.590063e-01 [36,] 0.95977050 8.045900e-02 4.022950e-02 [37,] 0.95081581 9.836838e-02 4.918419e-02 [38,] 0.94397942 1.120412e-01 5.602058e-02 [39,] 0.93342622 1.331476e-01 6.657378e-02 [40,] 0.91898900 1.620220e-01 8.101100e-02 [41,] 0.97413432 5.173136e-02 2.586568e-02 [42,] 0.96777810 6.444380e-02 3.222190e-02 [43,] 0.96233819 7.532361e-02 3.766181e-02 [44,] 0.95611081 8.777838e-02 4.388919e-02 [45,] 0.97350795 5.298410e-02 2.649205e-02 [46,] 0.96805362 6.389276e-02 3.194638e-02 [47,] 0.96586262 6.827476e-02 3.413738e-02 [48,] 0.95921750 8.156499e-02 4.078250e-02 [49,] 0.95534197 8.931606e-02 4.465803e-02 [50,] 0.94663033 1.067393e-01 5.336967e-02 [51,] 0.94976334 1.004733e-01 5.023666e-02 [52,] 0.96636492 6.727016e-02 3.363508e-02 [53,] 0.95965588 8.068824e-02 4.034412e-02 [54,] 0.95893452 8.213096e-02 4.106548e-02 [55,] 0.94913789 1.017242e-01 5.086211e-02 [56,] 0.94539721 1.092056e-01 5.460279e-02 [57,] 0.93304060 1.339188e-01 6.695940e-02 [58,] 0.92791621 1.441676e-01 7.208379e-02 [59,] 0.91576275 1.684745e-01 8.423725e-02 [60,] 0.90559696 1.888061e-01 9.440304e-02 [61,] 0.89435448 2.112910e-01 1.056455e-01 [62,] 0.87834301 2.433140e-01 1.216570e-01 [63,] 0.89230474 2.153905e-01 1.076953e-01 [64,] 0.87610643 2.477871e-01 1.238936e-01 [65,] 0.85813194 2.837361e-01 1.418681e-01 [66,] 0.84054325 3.189135e-01 1.594567e-01 [67,] 0.91119909 1.776018e-01 8.880091e-02 [68,] 0.90605778 1.878844e-01 9.394222e-02 [69,] 0.89270933 2.145813e-01 1.072907e-01 [70,] 0.87800032 2.439994e-01 1.219997e-01 [71,] 0.86137202 2.772560e-01 1.386280e-01 [72,] 0.84225480 3.154904e-01 1.577452e-01 [73,] 0.84046212 3.190758e-01 1.595379e-01 [74,] 0.83412719 3.317456e-01 1.658728e-01 [75,] 0.82996756 3.400649e-01 1.700324e-01 [76,] 0.82204932 3.559014e-01 1.779507e-01 [77,] 0.80320533 3.935893e-01 1.967947e-01 [78,] 0.79565304 4.086939e-01 2.043470e-01 [79,] 0.77336516 4.532697e-01 2.266348e-01 [80,] 0.76756442 4.648712e-01 2.324356e-01 [81,] 0.89884710 2.023058e-01 1.011529e-01 [82,] 0.87803802 2.439240e-01 1.219620e-01 [83,] 0.86298585 2.740283e-01 1.370142e-01 [84,] 0.84220592 3.155882e-01 1.577941e-01 [85,] 0.82139190 3.572162e-01 1.786081e-01 [86,] 0.79042635 4.191473e-01 2.095737e-01 [87,] 0.78831404 4.233719e-01 2.116860e-01 [88,] 0.78196356 4.360729e-01 2.180364e-01 [89,] 0.76076977 4.784605e-01 2.392302e-01 [90,] 0.73918758 5.216248e-01 2.608124e-01 [91,] 0.73195562 5.360888e-01 2.680444e-01 [92,] 0.87699158 2.460168e-01 1.230084e-01 [93,] 0.85172367 2.965527e-01 1.482763e-01 [94,] 0.82219151 3.556170e-01 1.778085e-01 [95,] 0.78955784 4.208843e-01 2.104422e-01 [96,] 0.76237165 4.752567e-01 2.376283e-01 [97,] 0.73483552 5.303290e-01 2.651645e-01 [98,] 0.69450316 6.109937e-01 3.054968e-01 [99,] 0.65121309 6.975738e-01 3.487869e-01 [100,] 0.61378806 7.724239e-01 3.862119e-01 [101,] 0.57396490 8.520702e-01 4.260351e-01 [102,] 0.54433738 9.113252e-01 4.556626e-01 [103,] 0.53995571 9.200886e-01 4.600443e-01 [104,] 0.81078032 3.784394e-01 1.892197e-01 [105,] 0.79290535 4.141893e-01 2.070946e-01 [106,] 0.75824518 4.835096e-01 2.417548e-01 [107,] 0.72042843 5.591431e-01 2.795716e-01 [108,] 0.99992342 1.531656e-04 7.658278e-05 [109,] 0.99986512 2.697558e-04 1.348779e-04 [110,] 0.99977077 4.584589e-04 2.292295e-04 [111,] 0.99962410 7.518001e-04 3.759001e-04 [112,] 0.99982321 3.535897e-04 1.767948e-04 [113,] 0.99970328 5.934342e-04 2.967171e-04 [114,] 0.99949641 1.007174e-03 5.035869e-04 [115,] 0.99918560 1.628806e-03 8.144028e-04 [116,] 0.99909863 1.802738e-03 9.013692e-04 [117,] 0.99849664 3.006720e-03 1.503360e-03 [118,] 0.99753302 4.933969e-03 2.466985e-03 [119,] 0.99592563 8.148737e-03 4.074368e-03 [120,] 0.99360066 1.279869e-02 6.399343e-03 [121,] 0.99293432 1.413137e-02 7.065684e-03 [122,] 0.99002099 1.995802e-02 9.979008e-03 [123,] 0.98401624 3.196753e-02 1.598376e-02 [124,] 0.97580887 4.838227e-02 2.419113e-02 [125,] 0.96341359 7.317281e-02 3.658641e-02 [126,] 0.94647177 1.070565e-01 5.352823e-02 [127,] 0.92157794 1.568441e-01 7.842206e-02 [128,] 0.88993863 2.201227e-01 1.100614e-01 [129,] 0.84988288 3.002342e-01 1.501171e-01 [130,] 0.89689649 2.062070e-01 1.031035e-01 [131,] 0.85567523 2.886495e-01 1.443248e-01 [132,] 0.84464220 3.107156e-01 1.553578e-01 [133,] 0.82741451 3.451710e-01 1.725855e-01 [134,] 0.75960329 4.807934e-01 2.403967e-01 [135,] 0.67138592 6.572282e-01 3.286141e-01 [136,] 1.00000000 2.556449e-103 1.278225e-103 [137,] 1.00000000 0.000000e+00 0.000000e+00 [138,] 1.00000000 0.000000e+00 0.000000e+00 [139,] 1.00000000 1.586687e-59 7.933437e-60 [140,] 1.00000000 0.000000e+00 0.000000e+00 > postscript(file="/var/www/html/rcomp/tmp/1r7xx1290508224.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2r7xx1290508224.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3r7xx1290508224.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/41gwi1290508224.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/51gwi1290508224.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 153 Frequency = 1 1 2 3 4 5 6 7 0.4131409 0.4131409 -0.7830454 0.4131409 -0.5440142 0.4522845 0.3702959 8 9 10 11 12 13 14 0.6484708 0.4131409 -1.5514169 -1.6260027 0.4131409 0.4094395 0.6484708 15 16 17 18 19 20 21 0.4168423 -0.5477155 0.6093272 0.4094395 -0.3515292 -1.1944865 -1.3552306 22 23 24 25 26 27 28 0.4094395 -0.5831577 0.4522845 0.4131409 -0.5905605 -0.4335177 -1.5868591 29 30 31 32 33 34 35 -0.5905605 0.2560982 -0.5514169 -0.6260027 0.3702959 0.6093272 -0.6297041 36 37 38 39 40 41 42 0.4131409 -1.5440142 -0.5905605 0.1778110 0.4094395 -0.5905605 1.8409557 43 44 45 46 47 48 49 -0.3515292 -0.5868591 0.1778110 0.1741096 1.6484708 -0.2018893 0.4131409 50 51 52 53 54 55 56 0.4168423 -1.1590443 0.3739973 0.6093272 0.3702959 -0.5868591 -0.3943742 57 58 59 60 61 62 63 -0.8221890 -1.1161994 0.3702959 0.6484708 0.2169546 -0.5905605 0.2169546 64 65 66 67 68 69 70 -0.5831577 0.3702959 0.4559858 0.4485831 0.3702959 0.8838006 0.3702959 71 72 73 74 75 76 77 0.3702959 0.4131409 -1.3552306 -0.5868591 0.4131409 0.4131409 -0.3943742 78 79 80 81 82 83 84 0.3702959 0.6521722 0.6056258 -0.5905605 -0.5868591 -0.3552306 -0.3589320 85 86 87 88 89 90 91 0.4131409 0.6484708 -1.5868591 0.2169546 -0.3943742 0.4094395 -0.4335177 92 93 94 95 96 97 98 0.1778110 -0.6297041 -0.5868591 0.4559858 -0.5794563 0.6484708 -1.5831577 99 100 101 102 103 104 105 0.2206560 0.1778110 0.2169546 0.4131409 0.4522845 -0.1161994 0.2206560 106 107 108 109 110 111 112 -0.2018893 0.3702959 -0.3515292 -0.5868591 -1.6260027 0.6056258 0.3702959 113 114 115 116 117 118 119 0.3702959 -2.7830454 0.2169546 0.4168423 0.4131409 -0.5905605 0.4131409 120 121 122 123 124 125 126 0.4094395 -0.1981879 0.5627809 0.2169546 0.4522845 0.1778110 0.4131409 127 128 129 130 131 132 133 -0.3943742 -0.1161994 0.1778110 0.4094395 0.4559858 0.4522845 0.1778110 134 135 136 137 138 139 140 0.4131409 0.3702959 0.8409557 0.1741096 -0.4335177 -0.3980756 0.4131409 141 142 143 144 145 146 147 0.4094395 -1.3515292 0.4131409 0.4131409 0.6093272 0.3702959 0.2169546 148 149 150 151 152 153 0.2206560 0.1778110 0.6484708 0.4094395 0.3702959 0.4522845 > postscript(file="/var/www/html/rcomp/tmp/61gwi1290508224.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 153 Frequency = 1 lag(myerror, k = 1) myerror 0 0.4131409 NA 1 0.4131409 0.4131409 2 -0.7830454 0.4131409 3 0.4131409 -0.7830454 4 -0.5440142 0.4131409 5 0.4522845 -0.5440142 6 0.3702959 0.4522845 7 0.6484708 0.3702959 8 0.4131409 0.6484708 9 -1.5514169 0.4131409 10 -1.6260027 -1.5514169 11 0.4131409 -1.6260027 12 0.4094395 0.4131409 13 0.6484708 0.4094395 14 0.4168423 0.6484708 15 -0.5477155 0.4168423 16 0.6093272 -0.5477155 17 0.4094395 0.6093272 18 -0.3515292 0.4094395 19 -1.1944865 -0.3515292 20 -1.3552306 -1.1944865 21 0.4094395 -1.3552306 22 -0.5831577 0.4094395 23 0.4522845 -0.5831577 24 0.4131409 0.4522845 25 -0.5905605 0.4131409 26 -0.4335177 -0.5905605 27 -1.5868591 -0.4335177 28 -0.5905605 -1.5868591 29 0.2560982 -0.5905605 30 -0.5514169 0.2560982 31 -0.6260027 -0.5514169 32 0.3702959 -0.6260027 33 0.6093272 0.3702959 34 -0.6297041 0.6093272 35 0.4131409 -0.6297041 36 -1.5440142 0.4131409 37 -0.5905605 -1.5440142 38 0.1778110 -0.5905605 39 0.4094395 0.1778110 40 -0.5905605 0.4094395 41 1.8409557 -0.5905605 42 -0.3515292 1.8409557 43 -0.5868591 -0.3515292 44 0.1778110 -0.5868591 45 0.1741096 0.1778110 46 1.6484708 0.1741096 47 -0.2018893 1.6484708 48 0.4131409 -0.2018893 49 0.4168423 0.4131409 50 -1.1590443 0.4168423 51 0.3739973 -1.1590443 52 0.6093272 0.3739973 53 0.3702959 0.6093272 54 -0.5868591 0.3702959 55 -0.3943742 -0.5868591 56 -0.8221890 -0.3943742 57 -1.1161994 -0.8221890 58 0.3702959 -1.1161994 59 0.6484708 0.3702959 60 0.2169546 0.6484708 61 -0.5905605 0.2169546 62 0.2169546 -0.5905605 63 -0.5831577 0.2169546 64 0.3702959 -0.5831577 65 0.4559858 0.3702959 66 0.4485831 0.4559858 67 0.3702959 0.4485831 68 0.8838006 0.3702959 69 0.3702959 0.8838006 70 0.3702959 0.3702959 71 0.4131409 0.3702959 72 -1.3552306 0.4131409 73 -0.5868591 -1.3552306 74 0.4131409 -0.5868591 75 0.4131409 0.4131409 76 -0.3943742 0.4131409 77 0.3702959 -0.3943742 78 0.6521722 0.3702959 79 0.6056258 0.6521722 80 -0.5905605 0.6056258 81 -0.5868591 -0.5905605 82 -0.3552306 -0.5868591 83 -0.3589320 -0.3552306 84 0.4131409 -0.3589320 85 0.6484708 0.4131409 86 -1.5868591 0.6484708 87 0.2169546 -1.5868591 88 -0.3943742 0.2169546 89 0.4094395 -0.3943742 90 -0.4335177 0.4094395 91 0.1778110 -0.4335177 92 -0.6297041 0.1778110 93 -0.5868591 -0.6297041 94 0.4559858 -0.5868591 95 -0.5794563 0.4559858 96 0.6484708 -0.5794563 97 -1.5831577 0.6484708 98 0.2206560 -1.5831577 99 0.1778110 0.2206560 100 0.2169546 0.1778110 101 0.4131409 0.2169546 102 0.4522845 0.4131409 103 -0.1161994 0.4522845 104 0.2206560 -0.1161994 105 -0.2018893 0.2206560 106 0.3702959 -0.2018893 107 -0.3515292 0.3702959 108 -0.5868591 -0.3515292 109 -1.6260027 -0.5868591 110 0.6056258 -1.6260027 111 0.3702959 0.6056258 112 0.3702959 0.3702959 113 -2.7830454 0.3702959 114 0.2169546 -2.7830454 115 0.4168423 0.2169546 116 0.4131409 0.4168423 117 -0.5905605 0.4131409 118 0.4131409 -0.5905605 119 0.4094395 0.4131409 120 -0.1981879 0.4094395 121 0.5627809 -0.1981879 122 0.2169546 0.5627809 123 0.4522845 0.2169546 124 0.1778110 0.4522845 125 0.4131409 0.1778110 126 -0.3943742 0.4131409 127 -0.1161994 -0.3943742 128 0.1778110 -0.1161994 129 0.4094395 0.1778110 130 0.4559858 0.4094395 131 0.4522845 0.4559858 132 0.1778110 0.4522845 133 0.4131409 0.1778110 134 0.3702959 0.4131409 135 0.8409557 0.3702959 136 0.1741096 0.8409557 137 -0.4335177 0.1741096 138 -0.3980756 -0.4335177 139 0.4131409 -0.3980756 140 0.4094395 0.4131409 141 -1.3515292 0.4094395 142 0.4131409 -1.3515292 143 0.4131409 0.4131409 144 0.6093272 0.4131409 145 0.3702959 0.6093272 146 0.2169546 0.3702959 147 0.2206560 0.2169546 148 0.1778110 0.2206560 149 0.6484708 0.1778110 150 0.4094395 0.6484708 151 0.3702959 0.4094395 152 0.4522845 0.3702959 153 NA 0.4522845 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.4131409 0.4131409 [2,] -0.7830454 0.4131409 [3,] 0.4131409 -0.7830454 [4,] -0.5440142 0.4131409 [5,] 0.4522845 -0.5440142 [6,] 0.3702959 0.4522845 [7,] 0.6484708 0.3702959 [8,] 0.4131409 0.6484708 [9,] -1.5514169 0.4131409 [10,] -1.6260027 -1.5514169 [11,] 0.4131409 -1.6260027 [12,] 0.4094395 0.4131409 [13,] 0.6484708 0.4094395 [14,] 0.4168423 0.6484708 [15,] -0.5477155 0.4168423 [16,] 0.6093272 -0.5477155 [17,] 0.4094395 0.6093272 [18,] -0.3515292 0.4094395 [19,] -1.1944865 -0.3515292 [20,] -1.3552306 -1.1944865 [21,] 0.4094395 -1.3552306 [22,] -0.5831577 0.4094395 [23,] 0.4522845 -0.5831577 [24,] 0.4131409 0.4522845 [25,] -0.5905605 0.4131409 [26,] -0.4335177 -0.5905605 [27,] -1.5868591 -0.4335177 [28,] -0.5905605 -1.5868591 [29,] 0.2560982 -0.5905605 [30,] -0.5514169 0.2560982 [31,] -0.6260027 -0.5514169 [32,] 0.3702959 -0.6260027 [33,] 0.6093272 0.3702959 [34,] -0.6297041 0.6093272 [35,] 0.4131409 -0.6297041 [36,] -1.5440142 0.4131409 [37,] -0.5905605 -1.5440142 [38,] 0.1778110 -0.5905605 [39,] 0.4094395 0.1778110 [40,] -0.5905605 0.4094395 [41,] 1.8409557 -0.5905605 [42,] -0.3515292 1.8409557 [43,] -0.5868591 -0.3515292 [44,] 0.1778110 -0.5868591 [45,] 0.1741096 0.1778110 [46,] 1.6484708 0.1741096 [47,] -0.2018893 1.6484708 [48,] 0.4131409 -0.2018893 [49,] 0.4168423 0.4131409 [50,] -1.1590443 0.4168423 [51,] 0.3739973 -1.1590443 [52,] 0.6093272 0.3739973 [53,] 0.3702959 0.6093272 [54,] -0.5868591 0.3702959 [55,] -0.3943742 -0.5868591 [56,] -0.8221890 -0.3943742 [57,] -1.1161994 -0.8221890 [58,] 0.3702959 -1.1161994 [59,] 0.6484708 0.3702959 [60,] 0.2169546 0.6484708 [61,] -0.5905605 0.2169546 [62,] 0.2169546 -0.5905605 [63,] -0.5831577 0.2169546 [64,] 0.3702959 -0.5831577 [65,] 0.4559858 0.3702959 [66,] 0.4485831 0.4559858 [67,] 0.3702959 0.4485831 [68,] 0.8838006 0.3702959 [69,] 0.3702959 0.8838006 [70,] 0.3702959 0.3702959 [71,] 0.4131409 0.3702959 [72,] -1.3552306 0.4131409 [73,] -0.5868591 -1.3552306 [74,] 0.4131409 -0.5868591 [75,] 0.4131409 0.4131409 [76,] -0.3943742 0.4131409 [77,] 0.3702959 -0.3943742 [78,] 0.6521722 0.3702959 [79,] 0.6056258 0.6521722 [80,] -0.5905605 0.6056258 [81,] -0.5868591 -0.5905605 [82,] -0.3552306 -0.5868591 [83,] -0.3589320 -0.3552306 [84,] 0.4131409 -0.3589320 [85,] 0.6484708 0.4131409 [86,] -1.5868591 0.6484708 [87,] 0.2169546 -1.5868591 [88,] -0.3943742 0.2169546 [89,] 0.4094395 -0.3943742 [90,] -0.4335177 0.4094395 [91,] 0.1778110 -0.4335177 [92,] -0.6297041 0.1778110 [93,] -0.5868591 -0.6297041 [94,] 0.4559858 -0.5868591 [95,] -0.5794563 0.4559858 [96,] 0.6484708 -0.5794563 [97,] -1.5831577 0.6484708 [98,] 0.2206560 -1.5831577 [99,] 0.1778110 0.2206560 [100,] 0.2169546 0.1778110 [101,] 0.4131409 0.2169546 [102,] 0.4522845 0.4131409 [103,] -0.1161994 0.4522845 [104,] 0.2206560 -0.1161994 [105,] -0.2018893 0.2206560 [106,] 0.3702959 -0.2018893 [107,] -0.3515292 0.3702959 [108,] -0.5868591 -0.3515292 [109,] -1.6260027 -0.5868591 [110,] 0.6056258 -1.6260027 [111,] 0.3702959 0.6056258 [112,] 0.3702959 0.3702959 [113,] -2.7830454 0.3702959 [114,] 0.2169546 -2.7830454 [115,] 0.4168423 0.2169546 [116,] 0.4131409 0.4168423 [117,] -0.5905605 0.4131409 [118,] 0.4131409 -0.5905605 [119,] 0.4094395 0.4131409 [120,] -0.1981879 0.4094395 [121,] 0.5627809 -0.1981879 [122,] 0.2169546 0.5627809 [123,] 0.4522845 0.2169546 [124,] 0.1778110 0.4522845 [125,] 0.4131409 0.1778110 [126,] -0.3943742 0.4131409 [127,] -0.1161994 -0.3943742 [128,] 0.1778110 -0.1161994 [129,] 0.4094395 0.1778110 [130,] 0.4559858 0.4094395 [131,] 0.4522845 0.4559858 [132,] 0.1778110 0.4522845 [133,] 0.4131409 0.1778110 [134,] 0.3702959 0.4131409 [135,] 0.8409557 0.3702959 [136,] 0.1741096 0.8409557 [137,] -0.4335177 0.1741096 [138,] -0.3980756 -0.4335177 [139,] 0.4131409 -0.3980756 [140,] 0.4094395 0.4131409 [141,] -1.3515292 0.4094395 [142,] 0.4131409 -1.3515292 [143,] 0.4131409 0.4131409 [144,] 0.6093272 0.4131409 [145,] 0.3702959 0.6093272 [146,] 0.2169546 0.3702959 [147,] 0.2206560 0.2169546 [148,] 0.1778110 0.2206560 [149,] 0.6484708 0.1778110 [150,] 0.4094395 0.6484708 [151,] 0.3702959 0.4094395 [152,] 0.4522845 0.3702959 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.4131409 0.4131409 2 -0.7830454 0.4131409 3 0.4131409 -0.7830454 4 -0.5440142 0.4131409 5 0.4522845 -0.5440142 6 0.3702959 0.4522845 7 0.6484708 0.3702959 8 0.4131409 0.6484708 9 -1.5514169 0.4131409 10 -1.6260027 -1.5514169 11 0.4131409 -1.6260027 12 0.4094395 0.4131409 13 0.6484708 0.4094395 14 0.4168423 0.6484708 15 -0.5477155 0.4168423 16 0.6093272 -0.5477155 17 0.4094395 0.6093272 18 -0.3515292 0.4094395 19 -1.1944865 -0.3515292 20 -1.3552306 -1.1944865 21 0.4094395 -1.3552306 22 -0.5831577 0.4094395 23 0.4522845 -0.5831577 24 0.4131409 0.4522845 25 -0.5905605 0.4131409 26 -0.4335177 -0.5905605 27 -1.5868591 -0.4335177 28 -0.5905605 -1.5868591 29 0.2560982 -0.5905605 30 -0.5514169 0.2560982 31 -0.6260027 -0.5514169 32 0.3702959 -0.6260027 33 0.6093272 0.3702959 34 -0.6297041 0.6093272 35 0.4131409 -0.6297041 36 -1.5440142 0.4131409 37 -0.5905605 -1.5440142 38 0.1778110 -0.5905605 39 0.4094395 0.1778110 40 -0.5905605 0.4094395 41 1.8409557 -0.5905605 42 -0.3515292 1.8409557 43 -0.5868591 -0.3515292 44 0.1778110 -0.5868591 45 0.1741096 0.1778110 46 1.6484708 0.1741096 47 -0.2018893 1.6484708 48 0.4131409 -0.2018893 49 0.4168423 0.4131409 50 -1.1590443 0.4168423 51 0.3739973 -1.1590443 52 0.6093272 0.3739973 53 0.3702959 0.6093272 54 -0.5868591 0.3702959 55 -0.3943742 -0.5868591 56 -0.8221890 -0.3943742 57 -1.1161994 -0.8221890 58 0.3702959 -1.1161994 59 0.6484708 0.3702959 60 0.2169546 0.6484708 61 -0.5905605 0.2169546 62 0.2169546 -0.5905605 63 -0.5831577 0.2169546 64 0.3702959 -0.5831577 65 0.4559858 0.3702959 66 0.4485831 0.4559858 67 0.3702959 0.4485831 68 0.8838006 0.3702959 69 0.3702959 0.8838006 70 0.3702959 0.3702959 71 0.4131409 0.3702959 72 -1.3552306 0.4131409 73 -0.5868591 -1.3552306 74 0.4131409 -0.5868591 75 0.4131409 0.4131409 76 -0.3943742 0.4131409 77 0.3702959 -0.3943742 78 0.6521722 0.3702959 79 0.6056258 0.6521722 80 -0.5905605 0.6056258 81 -0.5868591 -0.5905605 82 -0.3552306 -0.5868591 83 -0.3589320 -0.3552306 84 0.4131409 -0.3589320 85 0.6484708 0.4131409 86 -1.5868591 0.6484708 87 0.2169546 -1.5868591 88 -0.3943742 0.2169546 89 0.4094395 -0.3943742 90 -0.4335177 0.4094395 91 0.1778110 -0.4335177 92 -0.6297041 0.1778110 93 -0.5868591 -0.6297041 94 0.4559858 -0.5868591 95 -0.5794563 0.4559858 96 0.6484708 -0.5794563 97 -1.5831577 0.6484708 98 0.2206560 -1.5831577 99 0.1778110 0.2206560 100 0.2169546 0.1778110 101 0.4131409 0.2169546 102 0.4522845 0.4131409 103 -0.1161994 0.4522845 104 0.2206560 -0.1161994 105 -0.2018893 0.2206560 106 0.3702959 -0.2018893 107 -0.3515292 0.3702959 108 -0.5868591 -0.3515292 109 -1.6260027 -0.5868591 110 0.6056258 -1.6260027 111 0.3702959 0.6056258 112 0.3702959 0.3702959 113 -2.7830454 0.3702959 114 0.2169546 -2.7830454 115 0.4168423 0.2169546 116 0.4131409 0.4168423 117 -0.5905605 0.4131409 118 0.4131409 -0.5905605 119 0.4094395 0.4131409 120 -0.1981879 0.4094395 121 0.5627809 -0.1981879 122 0.2169546 0.5627809 123 0.4522845 0.2169546 124 0.1778110 0.4522845 125 0.4131409 0.1778110 126 -0.3943742 0.4131409 127 -0.1161994 -0.3943742 128 0.1778110 -0.1161994 129 0.4094395 0.1778110 130 0.4559858 0.4094395 131 0.4522845 0.4559858 132 0.1778110 0.4522845 133 0.4131409 0.1778110 134 0.3702959 0.4131409 135 0.8409557 0.3702959 136 0.1741096 0.8409557 137 -0.4335177 0.1741096 138 -0.3980756 -0.4335177 139 0.4131409 -0.3980756 140 0.4094395 0.4131409 141 -1.3515292 0.4094395 142 0.4131409 -1.3515292 143 0.4131409 0.4131409 144 0.6093272 0.4131409 145 0.3702959 0.6093272 146 0.2169546 0.3702959 147 0.2206560 0.2169546 148 0.1778110 0.2206560 149 0.6484708 0.1778110 150 0.4094395 0.6484708 151 0.3702959 0.4094395 152 0.4522845 0.3702959 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/7c8dl1290508224.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/8c8dl1290508224.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/9x9x11290508225.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/10x9x11290508225.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/11jaeo1290508225.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/124suc1290508225.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/13bt961290508225.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/144k891290508225.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/15737x1290508225.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/163cn61290508225.tab") + } > > try(system("convert tmp/1r7xx1290508224.ps tmp/1r7xx1290508224.png",intern=TRUE)) character(0) > try(system("convert tmp/2r7xx1290508224.ps tmp/2r7xx1290508224.png",intern=TRUE)) character(0) > try(system("convert tmp/3r7xx1290508224.ps tmp/3r7xx1290508224.png",intern=TRUE)) character(0) > try(system("convert tmp/41gwi1290508224.ps tmp/41gwi1290508224.png",intern=TRUE)) character(0) > try(system("convert tmp/51gwi1290508224.ps tmp/51gwi1290508224.png",intern=TRUE)) character(0) > try(system("convert tmp/61gwi1290508224.ps tmp/61gwi1290508224.png",intern=TRUE)) character(0) > try(system("convert tmp/7c8dl1290508224.ps tmp/7c8dl1290508224.png",intern=TRUE)) character(0) > try(system("convert tmp/8c8dl1290508224.ps tmp/8c8dl1290508224.png",intern=TRUE)) character(0) > try(system("convert tmp/9x9x11290508225.ps tmp/9x9x11290508225.png",intern=TRUE)) character(0) > try(system("convert tmp/10x9x11290508225.ps tmp/10x9x11290508225.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.839 1.738 8.583