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 + ,1 + ,1 + ,3 + ,12 + ,9 + ,7 + ,12 + ,6 + ,1 + ,0 + ,0 + ,9 + ,12 + ,11 + ,11 + ,4 + ,1 + ,0 + ,3 + ,10 + ,12 + ,11 + ,12 + ,6 + ,1 + ,3 + ,0 + ,13 + ,9 + ,14 + ,14 + ,6 + ,1 + ,1 + ,3 + ,16 + ,11 + ,16 + ,16 + ,7 + ,1 + ,1 + ,0 + ,14 + ,12 + ,13 + ,13 + ,6 + ,1 + ,2 + ,0 + ,16 + ,11 + ,13 + ,14 + ,7 + ,2 + ,0 + ,1 + ,10 + ,12 + ,5 + ,13 + ,6 + ,1 + ,1 + ,1 + ,8 + ,12 + ,8 + ,13 + ,4 + ,0 + ,0 + ,0 + ,12 + ,11 + ,14 + ,13 + ,5 + ,2 + ,1 + ,0 + ,15 + ,11 + ,15 + ,15 + ,8 + ,1 + ,0 + ,2 + ,14 + ,12 + ,8 + ,14 + ,4 + ,1 + ,0 + ,0 + ,14 + ,6 + ,13 + ,12 + ,6 + ,1 + ,0 + ,0 + ,12 + ,13 + ,12 + ,12 + ,6 + ,1 + ,0 + ,1 + ,12 + ,11 + ,11 + ,12 + ,5 + ,0 + ,2 + ,1 + ,10 + ,12 + ,8 + ,11 + ,4 + ,0 + ,3 + ,1 + ,4 + ,10 + ,4 + ,10 + ,2 + ,0 + ,2 + ,0 + ,14 + ,11 + ,15 + ,15 + ,8 + ,0 + ,2 + ,1 + ,15 + ,12 + ,12 + ,16 + ,7 + ,0 + ,0 +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,0 + ,14 + ,12 + ,15 + ,14 + ,6 + ,0 + ,0 + ,1 + ,8 + ,11 + ,9 + ,12 + ,4 + ,0 + ,0 + ,0 + ,16 + ,12 + ,15 + ,14 + ,6 + ,0 + ,0 + ,0 + ,16 + ,12 + ,14 + ,16 + ,8 + ,1 + ,0 + ,1 + ,12 + ,12 + ,15 + ,13 + ,6 + ,0 + ,1 + ,0 + ,11 + ,8 + ,10 + ,14 + ,5 + ,0 + ,0 + ,0 + ,16 + ,12 + ,14 + ,16 + ,8 + ,0 + ,0 + ,0 + ,9 + ,11 + ,9 + ,12 + ,4 + ,0 + ,0 + ,0) + ,dim=c(8 + ,156) + ,dimnames=list(c('Popularity' + ,'FindingFriends' + ,'KnowingPeople' + ,'Liked' + ,'Celebrity' + ,'B' + ,'2B' + ,'3B') + ,1:156)) > y <- array(NA,dim=c(8,156),dimnames=list(c('Popularity','FindingFriends','KnowingPeople','Liked','Celebrity','B','2B','3B'),1:156)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > ylab = '' > xlab = '' > main = '' > #'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 1 15 10 12 16 6 1 1 3 2 12 9 7 12 6 1 0 0 3 9 12 11 11 4 1 0 3 4 10 12 11 12 6 1 3 0 5 13 9 14 14 6 1 1 3 6 16 11 16 16 7 1 1 0 7 14 12 13 13 6 1 2 0 8 16 11 13 14 7 2 0 1 9 10 12 5 13 6 1 1 1 10 8 12 8 13 4 0 0 0 11 12 11 14 13 5 2 1 0 12 15 11 15 15 8 1 0 2 13 14 12 8 14 4 1 0 0 14 14 6 13 12 6 1 0 0 15 12 13 12 12 6 1 0 1 16 12 11 11 12 5 0 2 1 17 10 12 8 11 4 0 3 1 18 4 10 4 10 2 0 2 0 19 14 11 15 15 8 0 2 1 20 15 12 12 16 7 0 0 0 21 16 12 14 14 6 1 0 0 22 12 12 9 13 4 2 0 0 23 12 11 16 13 4 0 0 0 24 12 12 10 13 4 0 1 0 25 12 12 8 13 5 0 2 0 26 12 12 14 14 4 1 0 0 27 11 6 6 9 4 1 1 0 28 11 5 16 14 6 3 0 0 29 11 12 11 12 6 0 1 3 30 11 14 7 13 6 0 1 2 31 11 12 13 11 4 1 0 0 32 11 9 7 13 2 2 0 1 33 15 11 14 15 7 1 0 0 34 15 11 17 16 6 1 0 1 35 9 11 15 15 7 0 2 2 36 16 12 8 14 4 0 2 1 37 13 10 8 8 4 0 0 1 38 9 12 11 11 4 2 2 0 39 16 11 16 15 6 1 2 0 40 12 12 10 15 6 1 0 0 41 15 9 5 11 3 2 1 0 42 5 15 8 12 3 0 3 0 43 11 11 8 12 6 1 2 0 44 17 11 15 14 5 2 0 0 45 9 15 6 8 4 0 2 1 46 13 12 16 16 6 2 0 0 47 16 9 16 16 6 0 1 1 48 16 12 16 14 6 0 1 0 49 14 9 19 12 6 1 1 0 50 16 11 14 15 6 0 1 1 51 11 12 15 12 6 1 0 0 52 11 11 11 14 5 0 1 2 53 11 6 14 17 6 1 2 1 54 12 10 12 13 6 1 0 0 55 12 12 15 13 6 1 1 1 56 12 13 14 12 5 1 1 0 57 14 11 13 16 6 1 1 1 58 10 10 11 12 5 1 0 2 59 9 11 8 10 4 0 1 0 60 12 7 11 15 5 0 1 0 61 10 11 9 12 4 1 0 0 62 14 11 10 16 6 2 2 0 63 8 7 4 13 6 1 0 0 64 16 12 15 15 7 0 2 1 65 14 14 17 18 6 0 1 3 66 14 11 12 12 4 0 0 1 67 12 12 12 13 4 0 1 0 68 14 11 15 14 6 0 1 0 69 7 12 13 12 3 0 1 0 70 19 12 15 15 6 2 1 0 71 15 12 14 16 4 0 0 2 72 8 12 8 14 5 0 0 0 73 10 15 15 15 6 1 0 0 74 13 11 12 13 7 1 1 0 75 13 13 14 13 3 1 0 3 76 10 10 10 11 5 1 0 1 77 12 12 7 12 3 1 0 0 78 15 13 16 18 8 0 0 1 79 7 14 12 12 4 0 0 1 80 14 11 15 16 6 0 0 1 81 10 11 7 9 4 1 1 1 82 6 7 9 11 4 2 0 0 83 11 11 15 10 5 1 1 0 84 12 12 7 11 4 2 2 0 85 14 12 15 13 6 3 1 0 86 12 10 14 13 7 1 2 0 87 14 12 14 15 7 0 1 2 88 11 8 8 13 4 2 1 1 89 10 7 8 9 5 1 0 0 90 13 11 14 13 6 0 1 2 91 8 11 10 12 4 0 0 1 92 9 11 12 13 5 2 0 4 93 6 9 15 11 6 1 1 0 94 12 12 12 14 5 1 0 0 95 14 13 13 13 5 0 0 0 96 11 9 12 12 4 2 2 0 97 8 11 10 15 2 0 0 1 98 7 12 8 12 3 1 0 0 99 9 9 6 12 5 0 2 0 100 14 12 13 13 5 3 1 0 101 13 12 7 12 5 0 0 0 102 15 12 13 13 6 0 1 2 103 5 14 4 5 2 1 1 2 104 15 11 14 13 5 0 2 2 105 13 12 13 13 5 0 1 0 106 12 8 13 13 5 0 0 1 107 6 12 6 11 2 1 0 0 108 7 12 7 12 4 1 0 0 109 13 12 5 12 3 3 0 0 110 16 11 14 15 8 2 0 0 111 10 11 13 15 6 0 1 0 112 16 12 16 16 7 1 0 0 113 15 10 16 13 6 1 0 0 114 8 13 7 10 3 1 0 1 115 11 8 14 15 5 1 0 0 116 13 12 11 13 6 1 1 2 117 16 11 17 16 7 0 2 1 118 11 10 5 13 3 0 1 3 119 14 13 10 16 8 0 1 1 120 9 10 11 13 3 0 0 2 121 8 10 10 14 3 0 1 0 122 8 7 9 15 4 2 0 0 123 11 10 12 14 5 1 3 0 124 12 8 15 13 7 0 2 0 125 11 12 7 13 6 2 1 0 126 14 12 13 15 6 1 0 0 127 11 12 8 16 6 1 0 0 128 14 11 16 12 5 1 1 0 129 13 13 15 14 6 0 0 1 130 12 12 6 14 5 1 1 0 131 4 8 6 4 4 1 0 0 132 15 11 12 13 6 0 0 0 133 10 12 8 16 4 0 0 1 134 13 13 11 15 6 0 0 0 135 15 12 13 14 6 0 0 2 136 12 10 14 14 5 0 0 0 137 13 12 14 14 6 1 0 0 138 8 10 10 6 4 0 0 0 139 10 13 4 13 6 0 0 1 140 15 11 16 14 6 1 0 0 141 16 12 12 15 8 0 1 0 142 16 12 15 16 7 1 0 0 143 14 10 12 15 6 0 0 0 144 14 11 14 12 6 1 0 0 145 12 11 11 14 2 0 0 0 146 15 11 16 11 5 0 0 0 147 13 8 14 14 5 0 0 1 148 16 11 14 14 6 1 0 0 149 14 12 15 14 6 0 0 1 150 8 11 9 12 4 0 0 0 151 16 12 15 14 6 0 0 0 152 16 12 14 16 8 1 0 1 153 12 12 15 13 6 0 1 0 154 11 8 10 14 5 0 0 0 155 16 12 14 16 8 0 0 0 156 9 11 9 12 4 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) FindingFriends KnowingPeople Liked Celebrity -0.23026 0.12442 0.24245 0.35248 0.63332 B `2B` `3B` 0.32079 -0.11246 -0.02646 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.41179 -1.12493 -0.05509 1.27452 6.59187 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -0.23026 1.49695 -0.154 0.877960 FindingFriends 0.12442 0.09824 1.267 0.207313 KnowingPeople 0.24245 0.06161 3.935 0.000128 *** Liked 0.35248 0.09736 3.620 0.000403 *** Celebrity 0.63332 0.15756 4.020 9.25e-05 *** B 0.32079 0.22771 1.409 0.161003 `2B` -0.11246 0.21191 -0.531 0.596422 `3B` -0.02646 0.19725 -0.134 0.893463 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.109 on 148 degrees of freedom Multiple R-squared: 0.5076, Adjusted R-squared: 0.4843 F-statistic: 21.79 on 7 and 148 DF, p-value: < 2.2e-16 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 0.27842126 0.5568425213 0.7215787393 [2,] 0.24316503 0.4863300520 0.7568349740 [3,] 0.34040270 0.6808053986 0.6595973007 [4,] 0.24231903 0.4846380604 0.7576809698 [5,] 0.17202341 0.3440468252 0.8279765874 [6,] 0.22539947 0.4507989306 0.7746005347 [7,] 0.20020203 0.4004040554 0.7997979723 [8,] 0.23835304 0.4767060854 0.7616469573 [9,] 0.18874656 0.3774931203 0.8112534399 [10,] 0.13242326 0.2648465231 0.8675767385 [11,] 0.12819686 0.2563937228 0.8718031386 [12,] 0.08759866 0.1751973108 0.9124013446 [13,] 0.05885796 0.1177159112 0.9411420444 [14,] 0.04898931 0.0979786271 0.9510106864 [15,] 0.04065573 0.0813114670 0.9593442665 [16,] 0.03128717 0.0625743419 0.9687128291 [17,] 0.03772714 0.0754542716 0.9622728642 [18,] 0.15041427 0.3008285475 0.8495857263 [19,] 0.11589755 0.2317950982 0.8841024509 [20,] 0.08799280 0.1759856036 0.9120071982 [21,] 0.06328089 0.1265617775 0.9367191113 [22,] 0.05667238 0.1133447580 0.9433276210 [23,] 0.04003389 0.0800677885 0.9599661058 [24,] 0.02768266 0.0553653211 0.9723173394 [25,] 0.12237112 0.2447422430 0.8776288785 [26,] 0.37375689 0.7475137897 0.6262431052 [27,] 0.56048717 0.8790256562 0.4395128281 [28,] 0.52042869 0.9591426220 0.4795713110 [29,] 0.53490441 0.9301911821 0.4650955910 [30,] 0.51703002 0.9659399655 0.4829699828 [31,] 0.81364430 0.3727114037 0.1863557019 [32,] 0.89822317 0.2035536529 0.1017768265 [33,] 0.87325532 0.2534893700 0.1267446850 [34,] 0.91291854 0.1741629228 0.0870814614 [35,] 0.89627916 0.2074416863 0.1037208432 [36,] 0.89428683 0.2114263309 0.1057131655 [37,] 0.88770734 0.2245853218 0.1122926609 [38,] 0.89262677 0.2147464597 0.1073732299 [39,] 0.86720046 0.2655990806 0.1327995403 [40,] 0.87212026 0.2557594726 0.1278797363 [41,] 0.87467023 0.2506595341 0.1253297670 [42,] 0.85489650 0.2902069935 0.1451034967 [43,] 0.88461301 0.2307739751 0.1153869876 [44,] 0.86774510 0.2645098001 0.1322549000 [45,] 0.84975667 0.3004866700 0.1502433350 [46,] 0.81983779 0.3603244149 0.1801622074 [47,] 0.78549466 0.4290106701 0.2145053350 [48,] 0.77107270 0.4578545955 0.2289272978 [49,] 0.74006009 0.5198798227 0.2599399113 [50,] 0.70963491 0.5807301888 0.2903650944 [51,] 0.68057651 0.6388469706 0.3194234853 [52,] 0.64061385 0.7187723089 0.3593861545 [53,] 0.69496552 0.6100689531 0.3050344766 [54,] 0.68558346 0.6288330706 0.3144165353 [55,] 0.67136753 0.6572649490 0.3286324745 [56,] 0.70862712 0.5827457688 0.2913728844 [57,] 0.67019731 0.6596053786 0.3298026893 [58,] 0.62757265 0.7448547048 0.3724273524 [59,] 0.72111057 0.5577788512 0.2788894256 [60,] 0.84432816 0.3113436780 0.1556718390 [61,] 0.84166579 0.3166684243 0.1583342121 [62,] 0.88614356 0.2277128864 0.1138564432 [63,] 0.95604011 0.0879197704 0.0439598852 [64,] 0.94382460 0.1123507900 0.0561753950 [65,] 0.93445179 0.1310964261 0.0655482131 [66,] 0.92094313 0.1581137432 0.0790568716 [67,] 0.92974565 0.1405087069 0.0702543534 [68,] 0.92626601 0.1474679840 0.0737339920 [69,] 0.97070015 0.0585996935 0.0292998467 [70,] 0.96185337 0.0762932504 0.0381466252 [71,] 0.95595009 0.0880998278 0.0440499139 [72,] 0.97452069 0.0509586115 0.0254793058 [73,] 0.96765156 0.0646968803 0.0323484402 [74,] 0.97022060 0.0595587949 0.0297793974 [75,] 0.96105075 0.0778984956 0.0389492478 [76,] 0.95549300 0.0890139929 0.0445069965 [77,] 0.94472454 0.1105509137 0.0552754569 [78,] 0.94011387 0.1197722677 0.0598861338 [79,] 0.93868220 0.1226355955 0.0613177977 [80,] 0.92277702 0.1544459506 0.0772229753 [81,] 0.92685832 0.1462833681 0.0731416840 [82,] 0.96327863 0.0734427396 0.0367213698 [83,] 0.99864611 0.0027077862 0.0013538931 [84,] 0.99805935 0.0038812915 0.0019406458 [85,] 0.99770554 0.0045889139 0.0022944570 [86,] 0.99664325 0.0067134941 0.0033567471 [87,] 0.99676234 0.0064753265 0.0032376632 [88,] 0.99737742 0.0052451684 0.0026225842 [89,] 0.99658727 0.0068254659 0.0034127330 [90,] 0.99512357 0.0097528572 0.0048764286 [91,] 0.99780620 0.0043876053 0.0021938026 [92,] 0.99744826 0.0051034761 0.0025517381 [93,] 0.99687548 0.0062490434 0.0031245217 [94,] 0.99717935 0.0056412982 0.0028206491 [95,] 0.99614044 0.0077191215 0.0038595608 [96,] 0.99436496 0.0112700717 0.0056350358 [97,] 0.99413925 0.0117214973 0.0058607487 [98,] 0.99647439 0.0070512114 0.0035256057 [99,] 0.99927779 0.0014444176 0.0007222088 [100,] 0.99885542 0.0022891535 0.0011445767 [101,] 0.99965567 0.0006886573 0.0003443286 [102,] 0.99942389 0.0011522149 0.0005761075 [103,] 0.99921438 0.0015712352 0.0007856176 [104,] 0.99880952 0.0023809685 0.0011904843 [105,] 0.99855804 0.0028839288 0.0014419644 [106,] 0.99764613 0.0047077401 0.0023538701 [107,] 0.99630134 0.0073973233 0.0036986616 [108,] 0.99928918 0.0014216436 0.0007108218 [109,] 0.99878429 0.0024314266 0.0012157133 [110,] 0.99802136 0.0039572701 0.0019786351 [111,] 0.99781866 0.0043626843 0.0021813422 [112,] 0.99814330 0.0037134042 0.0018567021 [113,] 0.99689207 0.0062158662 0.0031079331 [114,] 0.99709515 0.0058096926 0.0029048463 [115,] 0.99509923 0.0098015307 0.0049007654 [116,] 0.99186931 0.0162613887 0.0081306943 [117,] 0.99110395 0.0177921075 0.0088960537 [118,] 0.98578932 0.0284213615 0.0142106808 [119,] 0.98547052 0.0290589549 0.0145294775 [120,] 0.99132720 0.0173456045 0.0086728023 [121,] 0.98693603 0.0261279321 0.0130639661 [122,] 0.98951106 0.0209778774 0.0104889387 [123,] 0.98447549 0.0310490278 0.0155245139 [124,] 0.97448738 0.0510252378 0.0255126189 [125,] 0.96516448 0.0696710302 0.0348355151 [126,] 0.96100292 0.0779941565 0.0389970782 [127,] 0.95768971 0.0846205726 0.0423102863 [128,] 0.92864508 0.1427098499 0.0713549249 [129,] 0.92593959 0.1481208274 0.0740604137 [130,] 0.90269559 0.1946088236 0.0973044118 [131,] 0.99476428 0.0104714421 0.0052357210 [132,] 0.99962754 0.0007449143 0.0003724571 [133,] 0.99860231 0.0027953834 0.0013976917 [134,] 0.99707568 0.0058486312 0.0029243156 [135,] 0.98551420 0.0289716031 0.0144858016 > postscript(file="/var/www/html/rcomp/tmp/1tc3p1293205930.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/24m2a1293205930.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/34m2a1293205930.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/44m2a1293205930.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/5fdkv1293205930.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.508116028 1.062851244 -1.581693625 -1.942823715 -0.147395860 0.701196370 7 8 9 10 11 12 1.107340636 1.726716092 -1.039077541 -2.317912868 -0.810609567 -0.396732928 13 14 15 16 17 18 3.008820441 1.981431708 -0.620611004 1.049707778 0.750890753 -2.550274171 19 20 21 22 23 24 -0.877488887 0.754890468 2.287492392 0.798067571 -0.133070861 1.309652259 25 26 27 28 29 30 1.273685645 -0.445864374 3.115109227 -2.968022323 -0.767571394 -0.425567817 31 32 33 34 35 36 -0.145974969 1.949333157 0.426111888 0.006072588 -5.217705135 5.580988752 37 38 39 40 41 42 4.719796013 -1.756945946 1.799458698 -1.095198377 6.591865699 -4.367995688 43 44 45 46 47 48 -0.203519613 3.482002253 0.807502285 -2.223149883 1.930609687 2.235843564 49 50 51 52 53 54 0.265941680 2.519141752 -2.249993787 -0.741251443 -2.772036723 -0.626288506 55 56 57 58 59 60 -1.463552232 -0.386186395 0.088322529 -1.345114504 -0.023589107 0.351030679 61 62 63 64 65 66 -0.404243978 0.580876821 -2.313443475 1.631410971 -1.585983600 3.215661795 67 68 69 70 71 72 0.824757321 0.602712793 -3.431887886 4.484238296 2.222884651 -3.303715130 73 74 75 76 77 78 -4.680701001 -0.271571817 1.494902534 -0.776648525 2.589550818 -1.651141941 79 80 81 82 83 84 -4.157603482 -0.188246428 1.277015097 -3.874862341 -0.674829054 2.212843931 85 86 87 88 89 90 -0.131586459 -1.519584931 -0.212139490 0.677124278 0.760010847 0.250565177 91 92 93 94 95 96 -2.299443266 -3.332326154 -6.411787798 -0.594291053 1.712106410 0.021391217 97 98 99 100 101 102 -2.090241968 -2.652896651 -0.515673493 0.986630097 2.643693630 2.368590887 103 104 105 106 107 108 -0.665879823 2.996346860 0.948988235 0.360677342 -2.182199450 -3.043770799 109 110 111 112 113 114 3.432873664 0.472004225 -3.264872914 0.464314545 1.403921617 -0.803447515 115 116 117 118 119 120 -1.933979599 0.532699779 0.918457147 2.483441146 -0.379035770 -1.110165869 121 122 123 124 125 126 -2.160663250 -3.284784923 -1.008067339 -1.192402836 -0.871220660 0.177459215 127 128 129 130 131 132 -1.962784084 1.377762186 -0.732128656 0.972853827 -2.483791129 2.570075781 133 134 135 136 137 138 -1.348892669 -0.141281560 1.903650177 -0.509556426 -0.712507608 -0.086599769 139 140 141 142 143 144 -0.712725850 0.927019213 1.586509561 0.706762014 0.989536249 1.116875442 145 146 147 148 149 150 1.993329073 2.938568812 0.765749227 2.411914151 0.392293103 -2.083457932 151 152 153 154 155 156 2.365830969 0.342350001 -1.169228321 -0.290923031 0.636673912 -1.083457932 > postscript(file="/var/www/html/rcomp/tmp/6fdkv1293205930.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.508116028 NA 1 1.062851244 1.508116028 2 -1.581693625 1.062851244 3 -1.942823715 -1.581693625 4 -0.147395860 -1.942823715 5 0.701196370 -0.147395860 6 1.107340636 0.701196370 7 1.726716092 1.107340636 8 -1.039077541 1.726716092 9 -2.317912868 -1.039077541 10 -0.810609567 -2.317912868 11 -0.396732928 -0.810609567 12 3.008820441 -0.396732928 13 1.981431708 3.008820441 14 -0.620611004 1.981431708 15 1.049707778 -0.620611004 16 0.750890753 1.049707778 17 -2.550274171 0.750890753 18 -0.877488887 -2.550274171 19 0.754890468 -0.877488887 20 2.287492392 0.754890468 21 0.798067571 2.287492392 22 -0.133070861 0.798067571 23 1.309652259 -0.133070861 24 1.273685645 1.309652259 25 -0.445864374 1.273685645 26 3.115109227 -0.445864374 27 -2.968022323 3.115109227 28 -0.767571394 -2.968022323 29 -0.425567817 -0.767571394 30 -0.145974969 -0.425567817 31 1.949333157 -0.145974969 32 0.426111888 1.949333157 33 0.006072588 0.426111888 34 -5.217705135 0.006072588 35 5.580988752 -5.217705135 36 4.719796013 5.580988752 37 -1.756945946 4.719796013 38 1.799458698 -1.756945946 39 -1.095198377 1.799458698 40 6.591865699 -1.095198377 41 -4.367995688 6.591865699 42 -0.203519613 -4.367995688 43 3.482002253 -0.203519613 44 0.807502285 3.482002253 45 -2.223149883 0.807502285 46 1.930609687 -2.223149883 47 2.235843564 1.930609687 48 0.265941680 2.235843564 49 2.519141752 0.265941680 50 -2.249993787 2.519141752 51 -0.741251443 -2.249993787 52 -2.772036723 -0.741251443 53 -0.626288506 -2.772036723 54 -1.463552232 -0.626288506 55 -0.386186395 -1.463552232 56 0.088322529 -0.386186395 57 -1.345114504 0.088322529 58 -0.023589107 -1.345114504 59 0.351030679 -0.023589107 60 -0.404243978 0.351030679 61 0.580876821 -0.404243978 62 -2.313443475 0.580876821 63 1.631410971 -2.313443475 64 -1.585983600 1.631410971 65 3.215661795 -1.585983600 66 0.824757321 3.215661795 67 0.602712793 0.824757321 68 -3.431887886 0.602712793 69 4.484238296 -3.431887886 70 2.222884651 4.484238296 71 -3.303715130 2.222884651 72 -4.680701001 -3.303715130 73 -0.271571817 -4.680701001 74 1.494902534 -0.271571817 75 -0.776648525 1.494902534 76 2.589550818 -0.776648525 77 -1.651141941 2.589550818 78 -4.157603482 -1.651141941 79 -0.188246428 -4.157603482 80 1.277015097 -0.188246428 81 -3.874862341 1.277015097 82 -0.674829054 -3.874862341 83 2.212843931 -0.674829054 84 -0.131586459 2.212843931 85 -1.519584931 -0.131586459 86 -0.212139490 -1.519584931 87 0.677124278 -0.212139490 88 0.760010847 0.677124278 89 0.250565177 0.760010847 90 -2.299443266 0.250565177 91 -3.332326154 -2.299443266 92 -6.411787798 -3.332326154 93 -0.594291053 -6.411787798 94 1.712106410 -0.594291053 95 0.021391217 1.712106410 96 -2.090241968 0.021391217 97 -2.652896651 -2.090241968 98 -0.515673493 -2.652896651 99 0.986630097 -0.515673493 100 2.643693630 0.986630097 101 2.368590887 2.643693630 102 -0.665879823 2.368590887 103 2.996346860 -0.665879823 104 0.948988235 2.996346860 105 0.360677342 0.948988235 106 -2.182199450 0.360677342 107 -3.043770799 -2.182199450 108 3.432873664 -3.043770799 109 0.472004225 3.432873664 110 -3.264872914 0.472004225 111 0.464314545 -3.264872914 112 1.403921617 0.464314545 113 -0.803447515 1.403921617 114 -1.933979599 -0.803447515 115 0.532699779 -1.933979599 116 0.918457147 0.532699779 117 2.483441146 0.918457147 118 -0.379035770 2.483441146 119 -1.110165869 -0.379035770 120 -2.160663250 -1.110165869 121 -3.284784923 -2.160663250 122 -1.008067339 -3.284784923 123 -1.192402836 -1.008067339 124 -0.871220660 -1.192402836 125 0.177459215 -0.871220660 126 -1.962784084 0.177459215 127 1.377762186 -1.962784084 128 -0.732128656 1.377762186 129 0.972853827 -0.732128656 130 -2.483791129 0.972853827 131 2.570075781 -2.483791129 132 -1.348892669 2.570075781 133 -0.141281560 -1.348892669 134 1.903650177 -0.141281560 135 -0.509556426 1.903650177 136 -0.712507608 -0.509556426 137 -0.086599769 -0.712507608 138 -0.712725850 -0.086599769 139 0.927019213 -0.712725850 140 1.586509561 0.927019213 141 0.706762014 1.586509561 142 0.989536249 0.706762014 143 1.116875442 0.989536249 144 1.993329073 1.116875442 145 2.938568812 1.993329073 146 0.765749227 2.938568812 147 2.411914151 0.765749227 148 0.392293103 2.411914151 149 -2.083457932 0.392293103 150 2.365830969 -2.083457932 151 0.342350001 2.365830969 152 -1.169228321 0.342350001 153 -0.290923031 -1.169228321 154 0.636673912 -0.290923031 155 -1.083457932 0.636673912 156 NA -1.083457932 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.062851244 1.508116028 [2,] -1.581693625 1.062851244 [3,] -1.942823715 -1.581693625 [4,] -0.147395860 -1.942823715 [5,] 0.701196370 -0.147395860 [6,] 1.107340636 0.701196370 [7,] 1.726716092 1.107340636 [8,] -1.039077541 1.726716092 [9,] -2.317912868 -1.039077541 [10,] -0.810609567 -2.317912868 [11,] -0.396732928 -0.810609567 [12,] 3.008820441 -0.396732928 [13,] 1.981431708 3.008820441 [14,] -0.620611004 1.981431708 [15,] 1.049707778 -0.620611004 [16,] 0.750890753 1.049707778 [17,] -2.550274171 0.750890753 [18,] -0.877488887 -2.550274171 [19,] 0.754890468 -0.877488887 [20,] 2.287492392 0.754890468 [21,] 0.798067571 2.287492392 [22,] -0.133070861 0.798067571 [23,] 1.309652259 -0.133070861 [24,] 1.273685645 1.309652259 [25,] -0.445864374 1.273685645 [26,] 3.115109227 -0.445864374 [27,] -2.968022323 3.115109227 [28,] -0.767571394 -2.968022323 [29,] -0.425567817 -0.767571394 [30,] -0.145974969 -0.425567817 [31,] 1.949333157 -0.145974969 [32,] 0.426111888 1.949333157 [33,] 0.006072588 0.426111888 [34,] -5.217705135 0.006072588 [35,] 5.580988752 -5.217705135 [36,] 4.719796013 5.580988752 [37,] -1.756945946 4.719796013 [38,] 1.799458698 -1.756945946 [39,] -1.095198377 1.799458698 [40,] 6.591865699 -1.095198377 [41,] -4.367995688 6.591865699 [42,] -0.203519613 -4.367995688 [43,] 3.482002253 -0.203519613 [44,] 0.807502285 3.482002253 [45,] -2.223149883 0.807502285 [46,] 1.930609687 -2.223149883 [47,] 2.235843564 1.930609687 [48,] 0.265941680 2.235843564 [49,] 2.519141752 0.265941680 [50,] -2.249993787 2.519141752 [51,] -0.741251443 -2.249993787 [52,] -2.772036723 -0.741251443 [53,] -0.626288506 -2.772036723 [54,] -1.463552232 -0.626288506 [55,] -0.386186395 -1.463552232 [56,] 0.088322529 -0.386186395 [57,] -1.345114504 0.088322529 [58,] -0.023589107 -1.345114504 [59,] 0.351030679 -0.023589107 [60,] -0.404243978 0.351030679 [61,] 0.580876821 -0.404243978 [62,] -2.313443475 0.580876821 [63,] 1.631410971 -2.313443475 [64,] -1.585983600 1.631410971 [65,] 3.215661795 -1.585983600 [66,] 0.824757321 3.215661795 [67,] 0.602712793 0.824757321 [68,] -3.431887886 0.602712793 [69,] 4.484238296 -3.431887886 [70,] 2.222884651 4.484238296 [71,] -3.303715130 2.222884651 [72,] -4.680701001 -3.303715130 [73,] -0.271571817 -4.680701001 [74,] 1.494902534 -0.271571817 [75,] -0.776648525 1.494902534 [76,] 2.589550818 -0.776648525 [77,] -1.651141941 2.589550818 [78,] -4.157603482 -1.651141941 [79,] -0.188246428 -4.157603482 [80,] 1.277015097 -0.188246428 [81,] -3.874862341 1.277015097 [82,] -0.674829054 -3.874862341 [83,] 2.212843931 -0.674829054 [84,] -0.131586459 2.212843931 [85,] -1.519584931 -0.131586459 [86,] -0.212139490 -1.519584931 [87,] 0.677124278 -0.212139490 [88,] 0.760010847 0.677124278 [89,] 0.250565177 0.760010847 [90,] -2.299443266 0.250565177 [91,] -3.332326154 -2.299443266 [92,] -6.411787798 -3.332326154 [93,] -0.594291053 -6.411787798 [94,] 1.712106410 -0.594291053 [95,] 0.021391217 1.712106410 [96,] -2.090241968 0.021391217 [97,] -2.652896651 -2.090241968 [98,] -0.515673493 -2.652896651 [99,] 0.986630097 -0.515673493 [100,] 2.643693630 0.986630097 [101,] 2.368590887 2.643693630 [102,] -0.665879823 2.368590887 [103,] 2.996346860 -0.665879823 [104,] 0.948988235 2.996346860 [105,] 0.360677342 0.948988235 [106,] -2.182199450 0.360677342 [107,] -3.043770799 -2.182199450 [108,] 3.432873664 -3.043770799 [109,] 0.472004225 3.432873664 [110,] -3.264872914 0.472004225 [111,] 0.464314545 -3.264872914 [112,] 1.403921617 0.464314545 [113,] -0.803447515 1.403921617 [114,] -1.933979599 -0.803447515 [115,] 0.532699779 -1.933979599 [116,] 0.918457147 0.532699779 [117,] 2.483441146 0.918457147 [118,] -0.379035770 2.483441146 [119,] -1.110165869 -0.379035770 [120,] -2.160663250 -1.110165869 [121,] -3.284784923 -2.160663250 [122,] -1.008067339 -3.284784923 [123,] -1.192402836 -1.008067339 [124,] -0.871220660 -1.192402836 [125,] 0.177459215 -0.871220660 [126,] -1.962784084 0.177459215 [127,] 1.377762186 -1.962784084 [128,] -0.732128656 1.377762186 [129,] 0.972853827 -0.732128656 [130,] -2.483791129 0.972853827 [131,] 2.570075781 -2.483791129 [132,] -1.348892669 2.570075781 [133,] -0.141281560 -1.348892669 [134,] 1.903650177 -0.141281560 [135,] -0.509556426 1.903650177 [136,] -0.712507608 -0.509556426 [137,] -0.086599769 -0.712507608 [138,] -0.712725850 -0.086599769 [139,] 0.927019213 -0.712725850 [140,] 1.586509561 0.927019213 [141,] 0.706762014 1.586509561 [142,] 0.989536249 0.706762014 [143,] 1.116875442 0.989536249 [144,] 1.993329073 1.116875442 [145,] 2.938568812 1.993329073 [146,] 0.765749227 2.938568812 [147,] 2.411914151 0.765749227 [148,] 0.392293103 2.411914151 [149,] -2.083457932 0.392293103 [150,] 2.365830969 -2.083457932 [151,] 0.342350001 2.365830969 [152,] -1.169228321 0.342350001 [153,] -0.290923031 -1.169228321 [154,] 0.636673912 -0.290923031 [155,] -1.083457932 0.636673912 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.062851244 1.508116028 2 -1.581693625 1.062851244 3 -1.942823715 -1.581693625 4 -0.147395860 -1.942823715 5 0.701196370 -0.147395860 6 1.107340636 0.701196370 7 1.726716092 1.107340636 8 -1.039077541 1.726716092 9 -2.317912868 -1.039077541 10 -0.810609567 -2.317912868 11 -0.396732928 -0.810609567 12 3.008820441 -0.396732928 13 1.981431708 3.008820441 14 -0.620611004 1.981431708 15 1.049707778 -0.620611004 16 0.750890753 1.049707778 17 -2.550274171 0.750890753 18 -0.877488887 -2.550274171 19 0.754890468 -0.877488887 20 2.287492392 0.754890468 21 0.798067571 2.287492392 22 -0.133070861 0.798067571 23 1.309652259 -0.133070861 24 1.273685645 1.309652259 25 -0.445864374 1.273685645 26 3.115109227 -0.445864374 27 -2.968022323 3.115109227 28 -0.767571394 -2.968022323 29 -0.425567817 -0.767571394 30 -0.145974969 -0.425567817 31 1.949333157 -0.145974969 32 0.426111888 1.949333157 33 0.006072588 0.426111888 34 -5.217705135 0.006072588 35 5.580988752 -5.217705135 36 4.719796013 5.580988752 37 -1.756945946 4.719796013 38 1.799458698 -1.756945946 39 -1.095198377 1.799458698 40 6.591865699 -1.095198377 41 -4.367995688 6.591865699 42 -0.203519613 -4.367995688 43 3.482002253 -0.203519613 44 0.807502285 3.482002253 45 -2.223149883 0.807502285 46 1.930609687 -2.223149883 47 2.235843564 1.930609687 48 0.265941680 2.235843564 49 2.519141752 0.265941680 50 -2.249993787 2.519141752 51 -0.741251443 -2.249993787 52 -2.772036723 -0.741251443 53 -0.626288506 -2.772036723 54 -1.463552232 -0.626288506 55 -0.386186395 -1.463552232 56 0.088322529 -0.386186395 57 -1.345114504 0.088322529 58 -0.023589107 -1.345114504 59 0.351030679 -0.023589107 60 -0.404243978 0.351030679 61 0.580876821 -0.404243978 62 -2.313443475 0.580876821 63 1.631410971 -2.313443475 64 -1.585983600 1.631410971 65 3.215661795 -1.585983600 66 0.824757321 3.215661795 67 0.602712793 0.824757321 68 -3.431887886 0.602712793 69 4.484238296 -3.431887886 70 2.222884651 4.484238296 71 -3.303715130 2.222884651 72 -4.680701001 -3.303715130 73 -0.271571817 -4.680701001 74 1.494902534 -0.271571817 75 -0.776648525 1.494902534 76 2.589550818 -0.776648525 77 -1.651141941 2.589550818 78 -4.157603482 -1.651141941 79 -0.188246428 -4.157603482 80 1.277015097 -0.188246428 81 -3.874862341 1.277015097 82 -0.674829054 -3.874862341 83 2.212843931 -0.674829054 84 -0.131586459 2.212843931 85 -1.519584931 -0.131586459 86 -0.212139490 -1.519584931 87 0.677124278 -0.212139490 88 0.760010847 0.677124278 89 0.250565177 0.760010847 90 -2.299443266 0.250565177 91 -3.332326154 -2.299443266 92 -6.411787798 -3.332326154 93 -0.594291053 -6.411787798 94 1.712106410 -0.594291053 95 0.021391217 1.712106410 96 -2.090241968 0.021391217 97 -2.652896651 -2.090241968 98 -0.515673493 -2.652896651 99 0.986630097 -0.515673493 100 2.643693630 0.986630097 101 2.368590887 2.643693630 102 -0.665879823 2.368590887 103 2.996346860 -0.665879823 104 0.948988235 2.996346860 105 0.360677342 0.948988235 106 -2.182199450 0.360677342 107 -3.043770799 -2.182199450 108 3.432873664 -3.043770799 109 0.472004225 3.432873664 110 -3.264872914 0.472004225 111 0.464314545 -3.264872914 112 1.403921617 0.464314545 113 -0.803447515 1.403921617 114 -1.933979599 -0.803447515 115 0.532699779 -1.933979599 116 0.918457147 0.532699779 117 2.483441146 0.918457147 118 -0.379035770 2.483441146 119 -1.110165869 -0.379035770 120 -2.160663250 -1.110165869 121 -3.284784923 -2.160663250 122 -1.008067339 -3.284784923 123 -1.192402836 -1.008067339 124 -0.871220660 -1.192402836 125 0.177459215 -0.871220660 126 -1.962784084 0.177459215 127 1.377762186 -1.962784084 128 -0.732128656 1.377762186 129 0.972853827 -0.732128656 130 -2.483791129 0.972853827 131 2.570075781 -2.483791129 132 -1.348892669 2.570075781 133 -0.141281560 -1.348892669 134 1.903650177 -0.141281560 135 -0.509556426 1.903650177 136 -0.712507608 -0.509556426 137 -0.086599769 -0.712507608 138 -0.712725850 -0.086599769 139 0.927019213 -0.712725850 140 1.586509561 0.927019213 141 0.706762014 1.586509561 142 0.989536249 0.706762014 143 1.116875442 0.989536249 144 1.993329073 1.116875442 145 2.938568812 1.993329073 146 0.765749227 2.938568812 147 2.411914151 0.765749227 148 0.392293103 2.411914151 149 -2.083457932 0.392293103 150 2.365830969 -2.083457932 151 0.342350001 2.365830969 152 -1.169228321 0.342350001 153 -0.290923031 -1.169228321 154 0.636673912 -0.290923031 155 -1.083457932 0.636673912 > 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/7pm1y1293205930.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/8pm1y1293205930.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/90dij1293205930.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/100dij1293205930.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/113ezp1293205930.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/127wfc1293205930.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/13wfu61293205930.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/14o7t91293205930.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/15a7ax1293205930.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/16dqql1293205930.tab") + } > > try(system("convert tmp/1tc3p1293205930.ps tmp/1tc3p1293205930.png",intern=TRUE)) character(0) > try(system("convert tmp/24m2a1293205930.ps tmp/24m2a1293205930.png",intern=TRUE)) character(0) > try(system("convert tmp/34m2a1293205930.ps tmp/34m2a1293205930.png",intern=TRUE)) character(0) > try(system("convert tmp/44m2a1293205930.ps tmp/44m2a1293205930.png",intern=TRUE)) character(0) > try(system("convert tmp/5fdkv1293205930.ps tmp/5fdkv1293205930.png",intern=TRUE)) character(0) > try(system("convert tmp/6fdkv1293205930.ps tmp/6fdkv1293205930.png",intern=TRUE)) character(0) > try(system("convert tmp/7pm1y1293205930.ps tmp/7pm1y1293205930.png",intern=TRUE)) character(0) > try(system("convert tmp/8pm1y1293205930.ps tmp/8pm1y1293205930.png",intern=TRUE)) character(0) > try(system("convert tmp/90dij1293205930.ps tmp/90dij1293205930.png",intern=TRUE)) character(0) > try(system("convert tmp/100dij1293205930.ps tmp/100dij1293205930.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.208 1.807 9.509