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(15 + ,10 + ,12 + ,16 + ,6 + ,2 + ,0 + ,0 + ,9 + ,12 + ,9 + ,7 + ,12 + ,6 + ,1 + ,1 + ,2 + ,9 + ,9 + ,12 + ,11 + ,11 + ,4 + ,1 + ,2 + ,1 + ,9 + ,10 + ,12 + ,11 + ,12 + ,6 + ,0 + ,0 + ,0 + ,9 + ,13 + ,9 + ,14 + ,14 + ,6 + ,0 + ,0 + ,0 + ,9 + ,16 + ,11 + ,16 + ,16 + ,7 + ,1 + ,0 + ,0 + ,9 + ,14 + ,12 + ,13 + ,13 + ,6 + ,0 + ,0 + ,0 + ,9 + ,16 + ,11 + ,13 + ,14 + ,7 + ,1 + ,1 + ,0 + ,9 + ,10 + ,12 + ,5 + ,13 + ,6 + ,0 + ,0 + ,0 + ,9 + ,8 + ,12 + ,8 + ,13 + ,4 + ,2 + ,0 + ,1 + ,10 + ,12 + ,11 + ,14 + ,13 + ,5 + ,1 + ,0 + ,0 + ,10 + ,15 + ,11 + ,15 + ,15 + ,8 + ,0 + ,0 + ,0 + ,10 + ,14 + ,12 + ,8 + ,14 + ,4 + ,0 + ,1 + ,0 + ,10 + ,14 + ,6 + ,13 + ,12 + ,6 + ,1 + ,1 + ,2 + ,10 + ,12 + ,13 + ,12 + ,12 + ,6 + ,1 + ,2 + ,1 + ,10 + ,12 + ,11 + ,11 + ,12 + ,5 + ,0 + ,0 + ,0 + ,10 + ,10 + ,12 + ,8 + ,11 + ,4 + ,0 + ,0 + ,0 + ,10 + ,4 + ,10 + ,4 + ,10 + ,2 + ,0 +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+ ,14 + ,16 + ,8 + ,1 + ,1 + ,1 + ,10 + ,9 + ,11 + ,9 + ,12 + ,4 + ,0 + ,0 + ,0 + ,10) + ,dim=c(9 + ,156) + ,dimnames=list(c('Popularity' + ,'FindingFriends' + ,'KnowingPeople' + ,'Liked' + ,'Celebrity' + ,'B' + ,'2B' + ,'3B' + ,'Month') + ,1:156)) > y <- array(NA,dim=c(9,156),dimnames=list(c('Popularity','FindingFriends','KnowingPeople','Liked','Celebrity','B','2B','3B','Month'),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 = '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 Popularity FindingFriends KnowingPeople Liked Celebrity B 2B 3B Month t 1 15 10 12 16 6 2 0 0 9 1 2 12 9 7 12 6 1 1 2 9 2 3 9 12 11 11 4 1 2 1 9 3 4 10 12 11 12 6 0 0 0 9 4 5 13 9 14 14 6 0 0 0 9 5 6 16 11 16 16 7 1 0 0 9 6 7 14 12 13 13 6 0 0 0 9 7 8 16 11 13 14 7 1 1 0 9 8 9 10 12 5 13 6 0 0 0 9 9 10 8 12 8 13 4 2 0 1 10 10 11 12 11 14 13 5 1 0 0 10 11 12 15 11 15 15 8 0 0 0 10 12 13 14 12 8 14 4 0 1 0 10 13 14 14 6 13 12 6 1 1 2 10 14 15 12 13 12 12 6 1 2 1 10 15 16 12 11 11 12 5 0 0 0 10 16 17 10 12 8 11 4 0 0 0 10 17 18 4 10 4 10 2 0 0 0 10 18 19 14 11 15 15 8 0 1 0 10 19 20 15 12 12 16 7 0 0 0 10 20 21 16 12 14 14 6 0 0 0 10 21 22 12 12 9 13 4 0 1 0 10 22 23 12 11 16 13 4 0 0 0 10 23 24 12 12 10 13 4 0 0 1 10 24 25 12 12 8 13 5 1 0 1 9 25 26 12 12 14 14 4 0 0 0 9 26 27 11 6 6 9 4 3 2 1 9 27 28 11 5 16 14 6 1 0 0 9 28 29 11 12 11 12 6 1 1 0 9 29 30 11 14 7 13 6 1 1 0 9 30 31 11 12 13 11 4 3 1 1 9 31 32 11 9 7 13 2 0 0 0 9 32 33 15 11 14 15 7 0 0 0 9 33 34 15 11 17 16 6 0 0 0 9 34 35 9 11 15 15 7 0 0 0 9 35 36 16 12 8 14 4 0 0 0 9 36 37 13 10 8 8 4 0 2 1 9 37 38 9 12 11 11 4 1 0 0 9 38 39 16 11 16 15 6 0 0 0 9 39 40 12 12 10 15 6 0 0 0 9 40 41 15 9 5 11 3 0 0 2 9 41 42 5 15 8 12 3 0 0 0 9 42 43 11 11 8 12 6 2 2 0 9 43 44 17 11 15 14 5 2 2 0 9 44 45 9 15 6 8 4 0 1 1 9 45 46 13 12 16 16 6 0 0 0 9 46 47 16 9 16 16 6 0 0 0 10 47 48 16 12 16 14 6 0 0 0 10 48 49 14 9 19 12 6 2 0 2 10 49 50 16 11 14 15 6 1 0 0 10 50 51 11 12 15 12 6 0 0 0 10 51 52 11 11 11 14 5 0 0 0 10 52 53 11 6 14 17 6 0 0 0 10 53 54 12 10 12 13 6 0 0 0 10 54 55 12 12 15 13 6 1 1 1 10 55 56 12 13 14 12 5 0 0 0 10 56 57 14 11 13 16 6 0 0 0 10 57 58 10 10 11 12 5 2 0 0 10 58 59 9 11 8 10 4 0 2 0 10 59 60 12 7 11 15 5 0 0 1 10 60 61 10 11 9 12 4 0 0 0 10 61 62 14 11 10 16 6 0 0 0 10 62 63 8 7 4 13 6 0 0 0 10 63 64 16 12 15 15 7 1 0 0 10 64 65 14 14 17 18 6 1 0 0 10 65 66 14 11 12 12 4 0 0 0 10 66 67 12 12 12 13 4 0 0 0 10 67 68 14 11 15 14 6 1 0 0 10 68 69 7 12 13 12 3 1 1 1 10 69 70 19 12 15 15 6 0 0 0 10 70 71 15 12 14 16 4 0 0 0 10 71 72 8 12 8 14 5 0 0 0 10 72 73 10 15 15 15 6 0 0 0 10 73 74 13 11 12 13 7 0 0 0 10 74 75 13 13 14 13 3 0 0 0 9 75 76 10 10 10 11 5 0 0 0 9 76 77 12 12 7 12 3 0 0 0 9 77 78 15 13 16 18 8 0 1 1 9 78 79 7 14 12 12 4 1 0 0 9 79 80 14 11 15 16 6 0 0 0 9 80 81 10 11 7 9 4 0 0 0 9 81 82 6 7 9 11 4 0 3 0 9 82 83 11 11 15 10 5 2 0 0 9 83 84 12 12 7 11 4 0 0 0 9 84 85 14 12 15 13 6 0 0 2 9 85 86 12 10 14 13 7 0 0 0 9 86 87 14 12 14 15 7 0 0 0 9 87 88 11 8 8 13 4 2 2 0 9 88 89 10 7 8 9 5 1 0 1 9 89 90 13 11 14 13 6 0 0 1 9 90 91 8 11 10 12 4 0 0 0 9 91 92 9 11 12 13 5 0 0 0 9 92 93 6 9 15 11 6 0 0 0 10 93 94 12 12 12 14 5 1 0 2 10 94 95 14 13 13 13 5 0 0 0 10 95 96 11 9 12 12 4 0 0 0 10 96 97 8 11 10 15 2 1 0 1 10 97 98 7 12 8 12 3 0 0 0 10 98 99 9 9 6 12 5 0 2 1 10 99 100 14 12 13 13 5 2 1 0 10 100 101 13 12 7 12 5 0 0 0 10 101 102 15 12 13 13 6 0 0 0 10 102 103 5 14 4 5 2 0 0 0 10 103 104 15 11 14 13 5 3 1 0 10 104 105 13 12 13 13 5 0 1 0 10 105 106 12 8 13 13 5 0 0 0 10 106 107 6 12 6 11 2 1 0 0 10 107 108 7 12 7 12 4 0 0 0 10 108 109 13 12 5 12 3 0 0 0 10 109 110 16 11 14 15 8 1 1 0 10 110 111 10 11 13 15 6 0 0 0 10 111 112 16 12 16 16 7 0 0 0 10 112 113 15 10 16 13 6 0 0 0 10 113 114 8 13 7 10 3 0 0 0 10 114 115 11 8 14 15 5 0 0 0 10 115 116 13 12 11 13 6 0 3 1 10 116 117 16 11 17 16 7 1 0 0 10 117 118 11 10 5 13 3 0 0 0 10 118 119 14 13 10 16 8 0 0 0 10 119 120 9 10 11 13 3 2 1 0 10 120 121 8 10 10 14 3 0 0 0 10 121 122 8 7 9 15 4 1 0 1 10 122 123 11 10 12 14 5 2 0 0 10 123 124 12 8 15 13 7 0 0 0 10 124 125 11 12 7 13 6 4 0 0 10 125 126 14 12 13 15 6 0 1 2 10 126 127 11 12 8 16 6 2 1 0 10 127 128 14 11 16 12 5 0 0 0 10 128 129 13 13 15 14 6 2 1 2 10 129 130 12 12 6 14 5 0 0 0 10 130 131 4 8 6 4 4 0 0 0 10 131 132 15 11 12 13 6 2 1 1 10 132 133 10 12 8 16 4 0 0 0 10 133 134 13 13 11 15 6 1 2 1 10 134 135 15 12 13 14 6 1 1 2 10 135 136 12 10 14 14 5 1 2 1 10 136 137 13 12 14 14 6 0 0 0 10 137 138 8 10 10 6 4 0 0 0 10 138 139 10 13 4 13 6 2 0 0 10 139 140 15 11 16 14 6 0 0 0 10 140 141 16 12 12 15 8 0 0 0 10 141 142 16 12 15 16 7 0 0 0 10 142 143 14 10 12 15 6 0 0 0 10 143 144 14 11 14 12 6 1 1 1 10 144 145 12 11 11 14 2 1 1 1 10 145 146 15 11 16 11 5 0 1 2 9 146 147 13 8 14 14 5 1 1 1 9 147 148 16 11 14 14 6 0 0 0 10 148 149 14 12 15 14 6 0 0 0 10 149 150 8 11 9 12 4 0 0 0 10 150 151 16 12 15 14 6 0 1 0 10 151 152 16 12 14 16 8 1 1 1 10 152 153 12 12 15 13 6 0 0 0 10 153 154 11 8 10 14 5 0 3 1 10 154 155 16 12 14 16 8 1 1 1 10 155 156 9 11 9 12 4 0 0 0 10 156 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) FindingFriends KnowingPeople Liked Celebrity 1.044996 0.119499 0.241564 0.378019 0.607492 B `2B` `3B` Month t -0.048983 0.174147 0.508544 -0.136999 -0.001881 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.0022 -1.2083 -0.1294 1.2691 5.9840 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1.044996 3.928053 0.266 0.790588 FindingFriends 0.119499 0.096875 1.234 0.219357 KnowingPeople 0.241564 0.061926 3.901 0.000146 *** Liked 0.378019 0.098076 3.854 0.000173 *** Celebrity 0.607492 0.157196 3.865 0.000167 *** B -0.048983 0.224347 -0.218 0.827473 `2B` 0.174147 0.270802 0.643 0.521181 `3B` 0.508544 0.318646 1.596 0.112661 Month -0.136999 0.402640 -0.340 0.734156 t -0.001881 0.004160 -0.452 0.651825 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.108 on 146 degrees of freedom Multiple R-squared: 0.5148, Adjusted R-squared: 0.4849 F-statistic: 17.21 on 9 and 146 DF, p-value: < 2.2e-16 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 0.56523502 0.8695299642 0.4347649821 [2,] 0.39584431 0.7916886176 0.6041556912 [3,] 0.26950997 0.5390199363 0.7304900319 [4,] 0.18663697 0.3732739349 0.8133630326 [5,] 0.12023914 0.2404782788 0.8797608606 [6,] 0.21701702 0.4340340483 0.7829829758 [7,] 0.36424329 0.7284865854 0.6357567073 [8,] 0.27500502 0.5500100374 0.7249949813 [9,] 0.28308810 0.5661762084 0.7169118958 [10,] 0.21088701 0.4217740211 0.7891129894 [11,] 0.17669448 0.3533889574 0.8233055213 [12,] 0.12565498 0.2513099658 0.8743450171 [13,] 0.08664178 0.1732835658 0.9133582171 [14,] 0.07658124 0.1531624731 0.9234187634 [15,] 0.06710154 0.1342030777 0.9328984611 [16,] 0.17241569 0.3448313737 0.8275843131 [17,] 0.14449392 0.2889878444 0.8555060778 [18,] 0.11483698 0.2296739696 0.8851630152 [19,] 0.08478095 0.1695619071 0.9152190464 [20,] 0.07287113 0.1457422520 0.9271288740 [21,] 0.05180764 0.1036152764 0.9481923618 [22,] 0.03792182 0.0758436460 0.9620781770 [23,] 0.22515741 0.4503148271 0.7748425864 [24,] 0.44613092 0.8922618326 0.5538690837 [25,] 0.57786169 0.8442766245 0.4221383122 [26,] 0.52475988 0.9504802400 0.4752401200 [27,] 0.49588021 0.9917604218 0.5041197891 [28,] 0.46781126 0.9356225264 0.5321887368 [29,] 0.69902307 0.6019538576 0.3009769288 [30,] 0.85881549 0.2823690255 0.1411845128 [31,] 0.82715501 0.3456899712 0.1728449856 [32,] 0.86357999 0.2728400121 0.1364200060 [33,] 0.83718634 0.3256273283 0.1628136642 [34,] 0.83622840 0.3275431921 0.1637715961 [35,] 0.81430041 0.3713991704 0.1856995852 [36,] 0.82440990 0.3511801965 0.1755900982 [37,] 0.78935215 0.4212957030 0.2106478515 [38,] 0.79580307 0.4083938678 0.2041969339 [39,] 0.77224823 0.4555035334 0.2277517667 [40,] 0.75928906 0.4814218871 0.2407109436 [41,] 0.86594446 0.2681110733 0.1340555367 [42,] 0.83617098 0.3276580490 0.1638290245 [43,] 0.82719876 0.3456024764 0.1728012382 [44,] 0.79610782 0.4077843639 0.2038921820 [45,] 0.75948583 0.4810283441 0.2405141721 [46,] 0.71911743 0.5617651424 0.2808825712 [47,] 0.68538039 0.6292392238 0.3146196119 [48,] 0.66438645 0.6712270925 0.3356135462 [49,] 0.61852153 0.7629569426 0.3814784713 [50,] 0.58533496 0.8293300848 0.4146650424 [51,] 0.55854941 0.8829011776 0.4414505888 [52,] 0.55957112 0.8808577528 0.4404288764 [53,] 0.54755314 0.9048937205 0.4524468603 [54,] 0.63298177 0.7340364529 0.3670182265 [55,] 0.59598295 0.8080340909 0.4040170454 [56,] 0.56140676 0.8771864823 0.4385932411 [57,] 0.69713942 0.6057211601 0.3028605801 [58,] 0.88130880 0.2373824074 0.1186912037 [59,] 0.89281824 0.2143635108 0.1071817554 [60,] 0.90767337 0.1846532693 0.0923266346 [61,] 0.94842617 0.1031476662 0.0515738331 [62,] 0.93615660 0.1276868090 0.0638434045 [63,] 0.92902415 0.1419516932 0.0709758466 [64,] 0.91149969 0.1770006157 0.0885003079 [65,] 0.93284476 0.1343104858 0.0671552429 [66,] 0.93491259 0.1301748101 0.0650874051 [67,] 0.97112368 0.0577526374 0.0288763187 [68,] 0.96214295 0.0757141079 0.0378570539 [69,] 0.95943136 0.0811372853 0.0405686426 [70,] 0.97748062 0.0450387682 0.0225193841 [71,] 0.97121752 0.0575649580 0.0287824790 [72,] 0.97714227 0.0457154614 0.0228577307 [73,] 0.96979499 0.0604100238 0.0302050119 [74,] 0.96318478 0.0736304489 0.0368152244 [75,] 0.95307445 0.0938511002 0.0469255501 [76,] 0.94597000 0.1080599918 0.0540299959 [77,] 0.95046826 0.0990634802 0.0495317401 [78,] 0.93736290 0.1252741901 0.0626370950 [79,] 0.93486049 0.1302790176 0.0651395088 [80,] 0.95405605 0.0918879026 0.0459439513 [81,] 0.99606361 0.0078727705 0.0039363852 [82,] 0.99440253 0.0111949416 0.0055974708 [83,] 0.99358057 0.0128388670 0.0064194335 [84,] 0.99140582 0.0171883596 0.0085941798 [85,] 0.99143056 0.0171388726 0.0085694363 [86,] 0.99248705 0.0150258944 0.0075129472 [87,] 0.98946973 0.0210605415 0.0105302707 [88,] 0.98830581 0.0233883860 0.0116941930 [89,] 0.99232552 0.0153489596 0.0076744798 [90,] 0.99272701 0.0145459895 0.0072729948 [91,] 0.98989697 0.0202060569 0.0101030284 [92,] 0.99282516 0.0143496703 0.0071748351 [93,] 0.98994941 0.0201011835 0.0100505917 [94,] 0.98726662 0.0254667645 0.0127333823 [95,] 0.98528167 0.0294366677 0.0147183339 [96,] 0.98971774 0.0205645206 0.0102822603 [97,] 0.99898399 0.0020320123 0.0010160062 [98,] 0.99867157 0.0026568644 0.0013284322 [99,] 0.99957756 0.0008448893 0.0004224446 [100,] 0.99930483 0.0013903417 0.0006951709 [101,] 0.99929346 0.0014130834 0.0007065417 [102,] 0.99884336 0.0023132762 0.0011566381 [103,] 0.99826630 0.0034674011 0.0017337005 [104,] 0.99713469 0.0057306131 0.0028653066 [105,] 0.99557116 0.0088576887 0.0044288443 [106,] 0.99928575 0.0014284923 0.0007142462 [107,] 0.99875690 0.0024862032 0.0012431016 [108,] 0.99790663 0.0041867319 0.0020933660 [109,] 0.99737516 0.0052496836 0.0026248418 [110,] 0.99662832 0.0067433539 0.0033716770 [111,] 0.99472490 0.0105501983 0.0052750992 [112,] 0.99462270 0.0107545906 0.0053772953 [113,] 0.99111186 0.0177762827 0.0088881413 [114,] 0.98706737 0.0258652532 0.0129326266 [115,] 0.98365094 0.0326981156 0.0163490578 [116,] 0.97589200 0.0482160095 0.0241080047 [117,] 0.98769067 0.0246186569 0.0123093285 [118,] 0.98978922 0.0204215615 0.0102107808 [119,] 0.98489977 0.0302004683 0.0151002341 [120,] 0.98199611 0.0360077861 0.0180038931 [121,] 0.97488405 0.0502318909 0.0251159454 [122,] 0.96221397 0.0755720586 0.0377860293 [123,] 0.93787863 0.1242427430 0.0621213715 [124,] 0.95383948 0.0923210454 0.0461605227 [125,] 0.97214418 0.0557116402 0.0278558201 [126,] 0.94758417 0.1048316516 0.0524158258 [127,] 0.90425799 0.1914840149 0.0957420075 [128,] 0.85385804 0.2922839108 0.1461419554 [129,] 0.77312045 0.4537591045 0.2268795523 [130,] 0.70995135 0.5800973007 0.2900486503 [131,] 0.55442965 0.8911407001 0.4455703501 > postscript(file="/var/www/html/rcomp/tmp/1w5g91293204076.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/rcomp/tmp/2w5g91293204076.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/rcomp/tmp/37wfc1293204076.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/rcomp/tmp/47wfc1293204076.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/rcomp/tmp/57wfc1293204076.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 1.50083206 0.10188999 -2.29358477 -2.07685053 -0.19720170 0.76800609 7 8 9 10 11 12 1.06764512 2.07835009 -0.99608036 -2.77748695 -0.25342245 -0.12060130 13 14 15 16 17 18 3.08656747 1.17057261 -1.08808087 0.80971002 0.40229445 -2.79756754 19 20 21 22 23 24 -1.28158275 0.72911169 2.61139354 1.23994976 -0.15547143 0.66775117 25 26 27 28 29 30 0.45725197 -0.30121789 2.53037466 -2.11009053 -1.15499381 -0.80387372 31 32 33 34 35 36 -0.45193602 2.35251593 0.63095324 0.13761486 -5.60684916 5.16697525 37 38 39 40 41 42 3.81912833 -1.37091641 1.76660194 -0.90163183 5.98403018 -4.81670812 43 44 45 46 47 48 -0.40963494 3.75275158 -0.10604537 -1.71775002 1.77962781 2.17904839 49 50 51 52 53 54 -0.34834958 2.45640163 -1.81770753 -0.87861667 -2.74547987 -0.22639291 55 56 57 58 59 60 -1.82191108 -0.07874661 0.28413019 -0.89382927 -0.36948662 -0.27213525 61 62 63 64 65 66 -0.01503158 1.01822676 -1.91845472 1.51417846 -1.73263169 3.26968039 67 68 69 70 71 72 0.77404330 0.62671160 -4.11195684 5.08397256 2.16438238 -3.23580652 73 74 75 76 77 78 -4.26888258 0.08423314 1.65695520 -0.47535601 2.84918356 -2.43077400 79 80 81 82 83 84 -4.15238269 -0.29273767 1.50277054 -3.77895959 -0.31352544 2.63287645 85 86 87 88 89 90 -0.28586377 -1.39382487 -0.38697990 0.87046604 0.68719759 -0.40685253 91 92 93 94 95 96 -2.33716935 -2.80392720 -6.00219528 -1.12878860 1.85815208 0.56510446 97 98 99 100 101 102 -2.56751831 -2.21588333 -1.44419865 1.91087377 2.81633975 2.38332549 103 104 105 106 107 108 -0.22559837 2.84531513 0.82231241 0.47633763 -1.68133414 -2.56300249 109 110 111 112 113 114 4.52949836 1.18012184 -3.23628501 0.93589381 1.91832104 -0.30768739 115 116 117 118 119 120 -1.50433621 -0.13820027 0.87221602 2.40740580 -0.32854663 -1.11439891 121 122 123 124 125 126 -2.17279086 -3.01591952 -0.76917531 -1.18791879 0.07190099 -0.51880613 127 128 129 130 131 132 -1.57207059 1.81254511 -1.63980667 1.35641119 -1.77603215 2.21608900 133 134 135 136 137 138 -1.26962008 -0.75675132 0.92512307 -1.13367372 -0.17042744 0.27584153 139 140 141 142 143 144 -0.39453961 1.47158615 1.72722189 1.23388352 1.18496564 1.08456694 145 146 147 148 149 150 1.48506984 1.89618521 0.16316228 2.96976118 0.61057870 -1.84763561 151 152 153 154 155 156 2.44019298 0.25305612 -1.00387918 -1.11769373 0.25869868 -0.83635049 > postscript(file="/var/www/html/rcomp/tmp/60owy1293204076.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 1.50083206 NA 1 0.10188999 1.50083206 2 -2.29358477 0.10188999 3 -2.07685053 -2.29358477 4 -0.19720170 -2.07685053 5 0.76800609 -0.19720170 6 1.06764512 0.76800609 7 2.07835009 1.06764512 8 -0.99608036 2.07835009 9 -2.77748695 -0.99608036 10 -0.25342245 -2.77748695 11 -0.12060130 -0.25342245 12 3.08656747 -0.12060130 13 1.17057261 3.08656747 14 -1.08808087 1.17057261 15 0.80971002 -1.08808087 16 0.40229445 0.80971002 17 -2.79756754 0.40229445 18 -1.28158275 -2.79756754 19 0.72911169 -1.28158275 20 2.61139354 0.72911169 21 1.23994976 2.61139354 22 -0.15547143 1.23994976 23 0.66775117 -0.15547143 24 0.45725197 0.66775117 25 -0.30121789 0.45725197 26 2.53037466 -0.30121789 27 -2.11009053 2.53037466 28 -1.15499381 -2.11009053 29 -0.80387372 -1.15499381 30 -0.45193602 -0.80387372 31 2.35251593 -0.45193602 32 0.63095324 2.35251593 33 0.13761486 0.63095324 34 -5.60684916 0.13761486 35 5.16697525 -5.60684916 36 3.81912833 5.16697525 37 -1.37091641 3.81912833 38 1.76660194 -1.37091641 39 -0.90163183 1.76660194 40 5.98403018 -0.90163183 41 -4.81670812 5.98403018 42 -0.40963494 -4.81670812 43 3.75275158 -0.40963494 44 -0.10604537 3.75275158 45 -1.71775002 -0.10604537 46 1.77962781 -1.71775002 47 2.17904839 1.77962781 48 -0.34834958 2.17904839 49 2.45640163 -0.34834958 50 -1.81770753 2.45640163 51 -0.87861667 -1.81770753 52 -2.74547987 -0.87861667 53 -0.22639291 -2.74547987 54 -1.82191108 -0.22639291 55 -0.07874661 -1.82191108 56 0.28413019 -0.07874661 57 -0.89382927 0.28413019 58 -0.36948662 -0.89382927 59 -0.27213525 -0.36948662 60 -0.01503158 -0.27213525 61 1.01822676 -0.01503158 62 -1.91845472 1.01822676 63 1.51417846 -1.91845472 64 -1.73263169 1.51417846 65 3.26968039 -1.73263169 66 0.77404330 3.26968039 67 0.62671160 0.77404330 68 -4.11195684 0.62671160 69 5.08397256 -4.11195684 70 2.16438238 5.08397256 71 -3.23580652 2.16438238 72 -4.26888258 -3.23580652 73 0.08423314 -4.26888258 74 1.65695520 0.08423314 75 -0.47535601 1.65695520 76 2.84918356 -0.47535601 77 -2.43077400 2.84918356 78 -4.15238269 -2.43077400 79 -0.29273767 -4.15238269 80 1.50277054 -0.29273767 81 -3.77895959 1.50277054 82 -0.31352544 -3.77895959 83 2.63287645 -0.31352544 84 -0.28586377 2.63287645 85 -1.39382487 -0.28586377 86 -0.38697990 -1.39382487 87 0.87046604 -0.38697990 88 0.68719759 0.87046604 89 -0.40685253 0.68719759 90 -2.33716935 -0.40685253 91 -2.80392720 -2.33716935 92 -6.00219528 -2.80392720 93 -1.12878860 -6.00219528 94 1.85815208 -1.12878860 95 0.56510446 1.85815208 96 -2.56751831 0.56510446 97 -2.21588333 -2.56751831 98 -1.44419865 -2.21588333 99 1.91087377 -1.44419865 100 2.81633975 1.91087377 101 2.38332549 2.81633975 102 -0.22559837 2.38332549 103 2.84531513 -0.22559837 104 0.82231241 2.84531513 105 0.47633763 0.82231241 106 -1.68133414 0.47633763 107 -2.56300249 -1.68133414 108 4.52949836 -2.56300249 109 1.18012184 4.52949836 110 -3.23628501 1.18012184 111 0.93589381 -3.23628501 112 1.91832104 0.93589381 113 -0.30768739 1.91832104 114 -1.50433621 -0.30768739 115 -0.13820027 -1.50433621 116 0.87221602 -0.13820027 117 2.40740580 0.87221602 118 -0.32854663 2.40740580 119 -1.11439891 -0.32854663 120 -2.17279086 -1.11439891 121 -3.01591952 -2.17279086 122 -0.76917531 -3.01591952 123 -1.18791879 -0.76917531 124 0.07190099 -1.18791879 125 -0.51880613 0.07190099 126 -1.57207059 -0.51880613 127 1.81254511 -1.57207059 128 -1.63980667 1.81254511 129 1.35641119 -1.63980667 130 -1.77603215 1.35641119 131 2.21608900 -1.77603215 132 -1.26962008 2.21608900 133 -0.75675132 -1.26962008 134 0.92512307 -0.75675132 135 -1.13367372 0.92512307 136 -0.17042744 -1.13367372 137 0.27584153 -0.17042744 138 -0.39453961 0.27584153 139 1.47158615 -0.39453961 140 1.72722189 1.47158615 141 1.23388352 1.72722189 142 1.18496564 1.23388352 143 1.08456694 1.18496564 144 1.48506984 1.08456694 145 1.89618521 1.48506984 146 0.16316228 1.89618521 147 2.96976118 0.16316228 148 0.61057870 2.96976118 149 -1.84763561 0.61057870 150 2.44019298 -1.84763561 151 0.25305612 2.44019298 152 -1.00387918 0.25305612 153 -1.11769373 -1.00387918 154 0.25869868 -1.11769373 155 -0.83635049 0.25869868 156 NA -0.83635049 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.10188999 1.50083206 [2,] -2.29358477 0.10188999 [3,] -2.07685053 -2.29358477 [4,] -0.19720170 -2.07685053 [5,] 0.76800609 -0.19720170 [6,] 1.06764512 0.76800609 [7,] 2.07835009 1.06764512 [8,] -0.99608036 2.07835009 [9,] -2.77748695 -0.99608036 [10,] -0.25342245 -2.77748695 [11,] -0.12060130 -0.25342245 [12,] 3.08656747 -0.12060130 [13,] 1.17057261 3.08656747 [14,] -1.08808087 1.17057261 [15,] 0.80971002 -1.08808087 [16,] 0.40229445 0.80971002 [17,] -2.79756754 0.40229445 [18,] -1.28158275 -2.79756754 [19,] 0.72911169 -1.28158275 [20,] 2.61139354 0.72911169 [21,] 1.23994976 2.61139354 [22,] -0.15547143 1.23994976 [23,] 0.66775117 -0.15547143 [24,] 0.45725197 0.66775117 [25,] -0.30121789 0.45725197 [26,] 2.53037466 -0.30121789 [27,] -2.11009053 2.53037466 [28,] -1.15499381 -2.11009053 [29,] -0.80387372 -1.15499381 [30,] -0.45193602 -0.80387372 [31,] 2.35251593 -0.45193602 [32,] 0.63095324 2.35251593 [33,] 0.13761486 0.63095324 [34,] -5.60684916 0.13761486 [35,] 5.16697525 -5.60684916 [36,] 3.81912833 5.16697525 [37,] -1.37091641 3.81912833 [38,] 1.76660194 -1.37091641 [39,] -0.90163183 1.76660194 [40,] 5.98403018 -0.90163183 [41,] -4.81670812 5.98403018 [42,] -0.40963494 -4.81670812 [43,] 3.75275158 -0.40963494 [44,] -0.10604537 3.75275158 [45,] -1.71775002 -0.10604537 [46,] 1.77962781 -1.71775002 [47,] 2.17904839 1.77962781 [48,] -0.34834958 2.17904839 [49,] 2.45640163 -0.34834958 [50,] -1.81770753 2.45640163 [51,] -0.87861667 -1.81770753 [52,] -2.74547987 -0.87861667 [53,] -0.22639291 -2.74547987 [54,] -1.82191108 -0.22639291 [55,] -0.07874661 -1.82191108 [56,] 0.28413019 -0.07874661 [57,] -0.89382927 0.28413019 [58,] -0.36948662 -0.89382927 [59,] -0.27213525 -0.36948662 [60,] -0.01503158 -0.27213525 [61,] 1.01822676 -0.01503158 [62,] -1.91845472 1.01822676 [63,] 1.51417846 -1.91845472 [64,] -1.73263169 1.51417846 [65,] 3.26968039 -1.73263169 [66,] 0.77404330 3.26968039 [67,] 0.62671160 0.77404330 [68,] -4.11195684 0.62671160 [69,] 5.08397256 -4.11195684 [70,] 2.16438238 5.08397256 [71,] -3.23580652 2.16438238 [72,] -4.26888258 -3.23580652 [73,] 0.08423314 -4.26888258 [74,] 1.65695520 0.08423314 [75,] -0.47535601 1.65695520 [76,] 2.84918356 -0.47535601 [77,] -2.43077400 2.84918356 [78,] -4.15238269 -2.43077400 [79,] -0.29273767 -4.15238269 [80,] 1.50277054 -0.29273767 [81,] -3.77895959 1.50277054 [82,] -0.31352544 -3.77895959 [83,] 2.63287645 -0.31352544 [84,] -0.28586377 2.63287645 [85,] -1.39382487 -0.28586377 [86,] -0.38697990 -1.39382487 [87,] 0.87046604 -0.38697990 [88,] 0.68719759 0.87046604 [89,] -0.40685253 0.68719759 [90,] -2.33716935 -0.40685253 [91,] -2.80392720 -2.33716935 [92,] -6.00219528 -2.80392720 [93,] -1.12878860 -6.00219528 [94,] 1.85815208 -1.12878860 [95,] 0.56510446 1.85815208 [96,] -2.56751831 0.56510446 [97,] -2.21588333 -2.56751831 [98,] -1.44419865 -2.21588333 [99,] 1.91087377 -1.44419865 [100,] 2.81633975 1.91087377 [101,] 2.38332549 2.81633975 [102,] -0.22559837 2.38332549 [103,] 2.84531513 -0.22559837 [104,] 0.82231241 2.84531513 [105,] 0.47633763 0.82231241 [106,] -1.68133414 0.47633763 [107,] -2.56300249 -1.68133414 [108,] 4.52949836 -2.56300249 [109,] 1.18012184 4.52949836 [110,] -3.23628501 1.18012184 [111,] 0.93589381 -3.23628501 [112,] 1.91832104 0.93589381 [113,] -0.30768739 1.91832104 [114,] -1.50433621 -0.30768739 [115,] -0.13820027 -1.50433621 [116,] 0.87221602 -0.13820027 [117,] 2.40740580 0.87221602 [118,] -0.32854663 2.40740580 [119,] -1.11439891 -0.32854663 [120,] -2.17279086 -1.11439891 [121,] -3.01591952 -2.17279086 [122,] -0.76917531 -3.01591952 [123,] -1.18791879 -0.76917531 [124,] 0.07190099 -1.18791879 [125,] -0.51880613 0.07190099 [126,] -1.57207059 -0.51880613 [127,] 1.81254511 -1.57207059 [128,] -1.63980667 1.81254511 [129,] 1.35641119 -1.63980667 [130,] -1.77603215 1.35641119 [131,] 2.21608900 -1.77603215 [132,] -1.26962008 2.21608900 [133,] -0.75675132 -1.26962008 [134,] 0.92512307 -0.75675132 [135,] -1.13367372 0.92512307 [136,] -0.17042744 -1.13367372 [137,] 0.27584153 -0.17042744 [138,] -0.39453961 0.27584153 [139,] 1.47158615 -0.39453961 [140,] 1.72722189 1.47158615 [141,] 1.23388352 1.72722189 [142,] 1.18496564 1.23388352 [143,] 1.08456694 1.18496564 [144,] 1.48506984 1.08456694 [145,] 1.89618521 1.48506984 [146,] 0.16316228 1.89618521 [147,] 2.96976118 0.16316228 [148,] 0.61057870 2.96976118 [149,] -1.84763561 0.61057870 [150,] 2.44019298 -1.84763561 [151,] 0.25305612 2.44019298 [152,] -1.00387918 0.25305612 [153,] -1.11769373 -1.00387918 [154,] 0.25869868 -1.11769373 [155,] -0.83635049 0.25869868 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.10188999 1.50083206 2 -2.29358477 0.10188999 3 -2.07685053 -2.29358477 4 -0.19720170 -2.07685053 5 0.76800609 -0.19720170 6 1.06764512 0.76800609 7 2.07835009 1.06764512 8 -0.99608036 2.07835009 9 -2.77748695 -0.99608036 10 -0.25342245 -2.77748695 11 -0.12060130 -0.25342245 12 3.08656747 -0.12060130 13 1.17057261 3.08656747 14 -1.08808087 1.17057261 15 0.80971002 -1.08808087 16 0.40229445 0.80971002 17 -2.79756754 0.40229445 18 -1.28158275 -2.79756754 19 0.72911169 -1.28158275 20 2.61139354 0.72911169 21 1.23994976 2.61139354 22 -0.15547143 1.23994976 23 0.66775117 -0.15547143 24 0.45725197 0.66775117 25 -0.30121789 0.45725197 26 2.53037466 -0.30121789 27 -2.11009053 2.53037466 28 -1.15499381 -2.11009053 29 -0.80387372 -1.15499381 30 -0.45193602 -0.80387372 31 2.35251593 -0.45193602 32 0.63095324 2.35251593 33 0.13761486 0.63095324 34 -5.60684916 0.13761486 35 5.16697525 -5.60684916 36 3.81912833 5.16697525 37 -1.37091641 3.81912833 38 1.76660194 -1.37091641 39 -0.90163183 1.76660194 40 5.98403018 -0.90163183 41 -4.81670812 5.98403018 42 -0.40963494 -4.81670812 43 3.75275158 -0.40963494 44 -0.10604537 3.75275158 45 -1.71775002 -0.10604537 46 1.77962781 -1.71775002 47 2.17904839 1.77962781 48 -0.34834958 2.17904839 49 2.45640163 -0.34834958 50 -1.81770753 2.45640163 51 -0.87861667 -1.81770753 52 -2.74547987 -0.87861667 53 -0.22639291 -2.74547987 54 -1.82191108 -0.22639291 55 -0.07874661 -1.82191108 56 0.28413019 -0.07874661 57 -0.89382927 0.28413019 58 -0.36948662 -0.89382927 59 -0.27213525 -0.36948662 60 -0.01503158 -0.27213525 61 1.01822676 -0.01503158 62 -1.91845472 1.01822676 63 1.51417846 -1.91845472 64 -1.73263169 1.51417846 65 3.26968039 -1.73263169 66 0.77404330 3.26968039 67 0.62671160 0.77404330 68 -4.11195684 0.62671160 69 5.08397256 -4.11195684 70 2.16438238 5.08397256 71 -3.23580652 2.16438238 72 -4.26888258 -3.23580652 73 0.08423314 -4.26888258 74 1.65695520 0.08423314 75 -0.47535601 1.65695520 76 2.84918356 -0.47535601 77 -2.43077400 2.84918356 78 -4.15238269 -2.43077400 79 -0.29273767 -4.15238269 80 1.50277054 -0.29273767 81 -3.77895959 1.50277054 82 -0.31352544 -3.77895959 83 2.63287645 -0.31352544 84 -0.28586377 2.63287645 85 -1.39382487 -0.28586377 86 -0.38697990 -1.39382487 87 0.87046604 -0.38697990 88 0.68719759 0.87046604 89 -0.40685253 0.68719759 90 -2.33716935 -0.40685253 91 -2.80392720 -2.33716935 92 -6.00219528 -2.80392720 93 -1.12878860 -6.00219528 94 1.85815208 -1.12878860 95 0.56510446 1.85815208 96 -2.56751831 0.56510446 97 -2.21588333 -2.56751831 98 -1.44419865 -2.21588333 99 1.91087377 -1.44419865 100 2.81633975 1.91087377 101 2.38332549 2.81633975 102 -0.22559837 2.38332549 103 2.84531513 -0.22559837 104 0.82231241 2.84531513 105 0.47633763 0.82231241 106 -1.68133414 0.47633763 107 -2.56300249 -1.68133414 108 4.52949836 -2.56300249 109 1.18012184 4.52949836 110 -3.23628501 1.18012184 111 0.93589381 -3.23628501 112 1.91832104 0.93589381 113 -0.30768739 1.91832104 114 -1.50433621 -0.30768739 115 -0.13820027 -1.50433621 116 0.87221602 -0.13820027 117 2.40740580 0.87221602 118 -0.32854663 2.40740580 119 -1.11439891 -0.32854663 120 -2.17279086 -1.11439891 121 -3.01591952 -2.17279086 122 -0.76917531 -3.01591952 123 -1.18791879 -0.76917531 124 0.07190099 -1.18791879 125 -0.51880613 0.07190099 126 -1.57207059 -0.51880613 127 1.81254511 -1.57207059 128 -1.63980667 1.81254511 129 1.35641119 -1.63980667 130 -1.77603215 1.35641119 131 2.21608900 -1.77603215 132 -1.26962008 2.21608900 133 -0.75675132 -1.26962008 134 0.92512307 -0.75675132 135 -1.13367372 0.92512307 136 -0.17042744 -1.13367372 137 0.27584153 -0.17042744 138 -0.39453961 0.27584153 139 1.47158615 -0.39453961 140 1.72722189 1.47158615 141 1.23388352 1.72722189 142 1.18496564 1.23388352 143 1.08456694 1.18496564 144 1.48506984 1.08456694 145 1.89618521 1.48506984 146 0.16316228 1.89618521 147 2.96976118 0.16316228 148 0.61057870 2.96976118 149 -1.84763561 0.61057870 150 2.44019298 -1.84763561 151 0.25305612 2.44019298 152 -1.00387918 0.25305612 153 -1.11769373 -1.00387918 154 0.25869868 -1.11769373 155 -0.83635049 0.25869868 > 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/7sfe01293204076.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/rcomp/tmp/8sfe01293204076.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/rcomp/tmp/9sfe01293204076.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/rcomp/tmp/10l6vl1293204076.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/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/11o7t91293204076.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/12hgbu1293204076.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/13oh861293204076.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/14g8791293204076.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/15uj8a1293204077.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/168a601293204077.tab") + } > > try(system("convert tmp/1w5g91293204076.ps tmp/1w5g91293204076.png",intern=TRUE)) character(0) > try(system("convert tmp/2w5g91293204076.ps tmp/2w5g91293204076.png",intern=TRUE)) character(0) > try(system("convert tmp/37wfc1293204076.ps tmp/37wfc1293204076.png",intern=TRUE)) character(0) > try(system("convert tmp/47wfc1293204076.ps tmp/47wfc1293204076.png",intern=TRUE)) character(0) > try(system("convert tmp/57wfc1293204076.ps tmp/57wfc1293204076.png",intern=TRUE)) character(0) > try(system("convert tmp/60owy1293204076.ps tmp/60owy1293204076.png",intern=TRUE)) character(0) > try(system("convert tmp/7sfe01293204076.ps tmp/7sfe01293204076.png",intern=TRUE)) character(0) > try(system("convert tmp/8sfe01293204076.ps tmp/8sfe01293204076.png",intern=TRUE)) character(0) > try(system("convert tmp/9sfe01293204076.ps tmp/9sfe01293204076.png",intern=TRUE)) character(0) > try(system("convert tmp/10l6vl1293204076.ps tmp/10l6vl1293204076.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.355 1.853 10.794