R version 2.8.0 (2008-10-20) Copyright (C) 2008 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. Natural language support but running in an English locale R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(15 + ,10 + ,12 + ,16 + ,6 + ,2 + ,0 + ,0 + ,12 + ,9 + ,7 + ,12 + ,6 + ,1 + ,1 + ,2 + ,9 + ,12 + ,11 + ,11 + ,4 + ,1 + ,2 + ,1 + ,10 + ,12 + ,11 + ,12 + ,6 + ,0 + ,0 + ,0 + ,13 + ,9 + ,14 + ,14 + ,6 + ,0 + ,0 + ,0 + ,16 + ,11 + ,16 + ,16 + ,7 + ,1 + ,0 + ,0 + ,14 + ,12 + ,13 + ,13 + ,6 + ,0 + ,0 + ,0 + ,16 + ,11 + ,13 + ,14 + ,7 + ,1 + ,1 + ,0 + ,10 + ,12 + ,5 + ,13 + ,6 + ,0 + ,0 + ,0 + ,8 + ,12 + ,8 + ,13 + ,4 + ,2 + ,0 + ,1 + ,12 + ,11 + ,14 + ,13 + ,5 + ,1 + ,0 + ,0 + ,15 + ,11 + ,15 + ,15 + ,8 + ,0 + ,0 + ,0 + ,14 + ,12 + ,8 + ,14 + ,4 + ,0 + ,1 + ,0 + ,14 + ,6 + ,13 + ,12 + ,6 + ,1 + ,1 + ,2 + ,12 + ,13 + ,12 + ,12 + ,6 + ,1 + ,2 + ,1 + ,12 + ,11 + ,11 + ,12 + ,5 + ,0 + ,0 + ,0 + ,10 + ,12 + ,8 + ,11 + ,4 + ,0 + ,0 + ,0 + ,4 + ,10 + ,4 + ,10 + ,2 + ,0 + ,0 + ,0 + ,14 + ,11 + ,15 + ,15 + ,8 + ,0 + ,1 + ,0 + ,15 + ,12 + ,12 + ,16 + ,7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 + ,0 + ,0 + ,0 + ,14 + ,12 + ,15 + ,14 + ,6 + ,0 + ,0 + ,0 + ,8 + ,11 + ,9 + ,12 + ,4 + ,0 + ,0 + ,0 + ,16 + ,12 + ,15 + ,14 + ,6 + ,0 + ,1 + ,0 + ,16 + ,12 + ,14 + ,16 + ,8 + ,1 + ,1 + ,1 + ,12 + ,12 + ,15 + ,13 + ,6 + ,0 + ,0 + ,0 + ,11 + ,8 + ,10 + ,14 + ,5 + ,0 + ,3 + ,1 + ,16 + ,12 + ,14 + ,16 + ,8 + ,1 + ,1 + ,1 + ,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 2 0 0 2 12 9 7 12 6 1 1 2 3 9 12 11 11 4 1 2 1 4 10 12 11 12 6 0 0 0 5 13 9 14 14 6 0 0 0 6 16 11 16 16 7 1 0 0 7 14 12 13 13 6 0 0 0 8 16 11 13 14 7 1 1 0 9 10 12 5 13 6 0 0 0 10 8 12 8 13 4 2 0 1 11 12 11 14 13 5 1 0 0 12 15 11 15 15 8 0 0 0 13 14 12 8 14 4 0 1 0 14 14 6 13 12 6 1 1 2 15 12 13 12 12 6 1 2 1 16 12 11 11 12 5 0 0 0 17 10 12 8 11 4 0 0 0 18 4 10 4 10 2 0 0 0 19 14 11 15 15 8 0 1 0 20 15 12 12 16 7 0 0 0 21 16 12 14 14 6 0 0 0 22 12 12 9 13 4 0 1 0 23 12 11 16 13 4 0 0 0 24 12 12 10 13 4 0 0 1 25 12 12 8 13 5 1 0 1 26 12 12 14 14 4 0 0 0 27 11 6 6 9 4 3 2 1 28 11 5 16 14 6 1 0 0 29 11 12 11 12 6 1 1 0 30 11 14 7 13 6 1 1 0 31 11 12 13 11 4 3 1 1 32 11 9 7 13 2 0 0 0 33 15 11 14 15 7 0 0 0 34 15 11 17 16 6 0 0 0 35 9 11 15 15 7 0 0 0 36 16 12 8 14 4 0 0 0 37 13 10 8 8 4 0 2 1 38 9 12 11 11 4 1 0 0 39 16 11 16 15 6 0 0 0 40 12 12 10 15 6 0 0 0 41 15 9 5 11 3 0 0 2 42 5 15 8 12 3 0 0 0 43 11 11 8 12 6 2 2 0 44 17 11 15 14 5 2 2 0 45 9 15 6 8 4 0 1 1 46 13 12 16 16 6 0 0 0 47 16 9 16 16 6 0 0 0 48 16 12 16 14 6 0 0 0 49 14 9 19 12 6 2 0 2 50 16 11 14 15 6 1 0 0 51 11 12 15 12 6 0 0 0 52 11 11 11 14 5 0 0 0 53 11 6 14 17 6 0 0 0 54 12 10 12 13 6 0 0 0 55 12 12 15 13 6 1 1 1 56 12 13 14 12 5 0 0 0 57 14 11 13 16 6 0 0 0 58 10 10 11 12 5 2 0 0 59 9 11 8 10 4 0 2 0 60 12 7 11 15 5 0 0 1 61 10 11 9 12 4 0 0 0 62 14 11 10 16 6 0 0 0 63 8 7 4 13 6 0 0 0 64 16 12 15 15 7 1 0 0 65 14 14 17 18 6 1 0 0 66 14 11 12 12 4 0 0 0 67 12 12 12 13 4 0 0 0 68 14 11 15 14 6 1 0 0 69 7 12 13 12 3 1 1 1 70 19 12 15 15 6 0 0 0 71 15 12 14 16 4 0 0 0 72 8 12 8 14 5 0 0 0 73 10 15 15 15 6 0 0 0 74 13 11 12 13 7 0 0 0 75 13 13 14 13 3 0 0 0 76 10 10 10 11 5 0 0 0 77 12 12 7 12 3 0 0 0 78 15 13 16 18 8 0 1 1 79 7 14 12 12 4 1 0 0 80 14 11 15 16 6 0 0 0 81 10 11 7 9 4 0 0 0 82 6 7 9 11 4 0 3 0 83 11 11 15 10 5 2 0 0 84 12 12 7 11 4 0 0 0 85 14 12 15 13 6 0 0 2 86 12 10 14 13 7 0 0 0 87 14 12 14 15 7 0 0 0 88 11 8 8 13 4 2 2 0 89 10 7 8 9 5 1 0 1 90 13 11 14 13 6 0 0 1 91 8 11 10 12 4 0 0 0 92 9 11 12 13 5 0 0 0 93 6 9 15 11 6 0 0 0 94 12 12 12 14 5 1 0 2 95 14 13 13 13 5 0 0 0 96 11 9 12 12 4 0 0 0 97 8 11 10 15 2 1 0 1 98 7 12 8 12 3 0 0 0 99 9 9 6 12 5 0 2 1 100 14 12 13 13 5 2 1 0 101 13 12 7 12 5 0 0 0 102 15 12 13 13 6 0 0 0 103 5 14 4 5 2 0 0 0 104 15 11 14 13 5 3 1 0 105 13 12 13 13 5 0 1 0 106 12 8 13 13 5 0 0 0 107 6 12 6 11 2 1 0 0 108 7 12 7 12 4 0 0 0 109 13 12 5 12 3 0 0 0 110 16 11 14 15 8 1 1 0 111 10 11 13 15 6 0 0 0 112 16 12 16 16 7 0 0 0 113 15 10 16 13 6 0 0 0 114 8 13 7 10 3 0 0 0 115 11 8 14 15 5 0 0 0 116 13 12 11 13 6 0 3 1 117 16 11 17 16 7 1 0 0 118 11 10 5 13 3 0 0 0 119 14 13 10 16 8 0 0 0 120 9 10 11 13 3 2 1 0 121 8 10 10 14 3 0 0 0 122 8 7 9 15 4 1 0 1 123 11 10 12 14 5 2 0 0 124 12 8 15 13 7 0 0 0 125 11 12 7 13 6 4 0 0 126 14 12 13 15 6 0 1 2 127 11 12 8 16 6 2 1 0 128 14 11 16 12 5 0 0 0 129 13 13 15 14 6 2 1 2 130 12 12 6 14 5 0 0 0 131 4 8 6 4 4 0 0 0 132 15 11 12 13 6 2 1 1 133 10 12 8 16 4 0 0 0 134 13 13 11 15 6 1 2 1 135 15 12 13 14 6 1 1 2 136 12 10 14 14 5 1 2 1 137 13 12 14 14 6 0 0 0 138 8 10 10 6 4 0 0 0 139 10 13 4 13 6 2 0 0 140 15 11 16 14 6 0 0 0 141 16 12 12 15 8 0 0 0 142 16 12 15 16 7 0 0 0 143 14 10 12 15 6 0 0 0 144 14 11 14 12 6 1 1 1 145 12 11 11 14 2 1 1 1 146 15 11 16 11 5 0 1 2 147 13 8 14 14 5 1 1 1 148 16 11 14 14 6 0 0 0 149 14 12 15 14 6 0 0 0 150 8 11 9 12 4 0 0 0 151 16 12 15 14 6 0 1 0 152 16 12 14 16 8 1 1 1 153 12 12 15 13 6 0 0 0 154 11 8 10 14 5 0 3 1 155 16 12 14 16 8 1 1 1 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.34096 0.11785 0.24088 0.37207 0.61092 B `2B` `3B` -0.04365 0.17183 0.50219 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.09123 -1.27976 -0.08508 1.29622 6.14596 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -0.34096 1.46415 -0.233 0.816184 FindingFriends 0.11785 0.09637 1.223 0.223335 KnowingPeople 0.24088 0.06160 3.910 0.000140 *** Liked 0.37207 0.09686 3.841 0.000181 *** Celebrity 0.61092 0.15633 3.908 0.000141 *** B -0.04365 0.22313 -0.196 0.845159 `2B` 0.17183 0.26854 0.640 0.523248 `3B` 0.50219 0.31640 1.587 0.114600 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 2.097 on 148 degrees of freedom Multiple R-squared: 0.5129, Adjusted R-squared: 0.4899 F-statistic: 22.27 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.28405131 0.5681026142 0.7159486929 [2,] 0.24572743 0.4914548611 0.7542725695 [3,] 0.29353173 0.5870634609 0.7064682695 [4,] 0.20030187 0.4006037476 0.7996981262 [5,] 0.12247104 0.2449420738 0.8775289631 [6,] 0.10024194 0.2004838739 0.8997580631 [7,] 0.07879206 0.1575841230 0.9212079385 [8,] 0.12240480 0.2448096024 0.8775951988 [9,] 0.21772666 0.4354533202 0.7822733399 [10,] 0.15770574 0.3154114812 0.8422942594 [11,] 0.18072914 0.3614582878 0.8192708561 [12,] 0.13218322 0.2643664363 0.8678167819 [13,] 0.10039876 0.2007975253 0.8996012373 [14,] 0.06930459 0.1386091831 0.9306954085 [15,] 0.05245507 0.1049101496 0.9475449252 [16,] 0.03998449 0.0799689703 0.9600155149 [17,] 0.05982729 0.1196545794 0.9401727103 [18,] 0.11787353 0.2357470660 0.8821264670 [19,] 0.09246158 0.1849231561 0.9075384219 [20,] 0.07104353 0.1420870592 0.9289564704 [21,] 0.05116021 0.1023204199 0.9488397900 [22,] 0.04454485 0.0890896977 0.9554551512 [23,] 0.03142902 0.0628580412 0.9685709794 [24,] 0.02216364 0.0443272895 0.9778363552 [25,] 0.18267389 0.3653477839 0.8173261081 [26,] 0.37052036 0.7410407296 0.6294796352 [27,] 0.51737782 0.9652443513 0.4826221757 [28,] 0.46312899 0.9262579855 0.5368710073 [29,] 0.44821666 0.8964333278 0.5517833361 [30,] 0.41082175 0.8216434933 0.5891782534 [31,] 0.67543708 0.6491258478 0.3245629239 [32,] 0.83048370 0.3390326022 0.1695163011 [33,] 0.79462739 0.4107452285 0.2053726142 [34,] 0.83868794 0.3226241123 0.1613120562 [35,] 0.81475541 0.3704891751 0.1852445875 [36,] 0.80776641 0.3844671833 0.1922335916 [37,] 0.78254813 0.4349037490 0.2174518745 [38,] 0.80099088 0.3980182382 0.1990091191 [39,] 0.76309585 0.4738082995 0.2369041497 [40,] 0.78097321 0.4380535891 0.2190267945 [41,] 0.75708285 0.4858342973 0.2429171487 [42,] 0.73212818 0.5357436389 0.2678718194 [43,] 0.84031241 0.3193751883 0.1596875941 [44,] 0.80763907 0.3847218600 0.1923609300 [45,] 0.80437985 0.3912403002 0.1956201501 [46,] 0.77127525 0.4574494918 0.2287247459 [47,] 0.73226895 0.5354620982 0.2677310491 [48,] 0.69219270 0.6156145979 0.3078072989 [49,] 0.66119496 0.6776100716 0.3388050358 [50,] 0.64331134 0.7133773142 0.3566886571 [51,] 0.59641816 0.8071636857 0.4035818429 [52,] 0.55601333 0.8879733337 0.4439866669 [53,] 0.54296789 0.9140642219 0.4570321110 [54,] 0.52928514 0.9414297247 0.4707148623 [55,] 0.53201740 0.9359652064 0.4679826032 [56,] 0.59681332 0.8063733699 0.4031866850 [57,] 0.55328945 0.8934210974 0.4467105487 [58,] 0.51164577 0.9767084515 0.4883542257 [59,] 0.68391140 0.6321771998 0.3160885999 [60,] 0.84808273 0.3038345373 0.1519172686 [61,] 0.84459873 0.3108025478 0.1554012739 [62,] 0.88082926 0.2383414781 0.1191707391 [63,] 0.94545968 0.1090806351 0.0545403176 [64,] 0.93120991 0.1375801792 0.0687900896 [65,] 0.92354053 0.1529189346 0.0764594673 [66,] 0.90501195 0.1899760974 0.0949880487 [67,] 0.92413494 0.1517301230 0.0758650615 [68,] 0.93176781 0.1364643750 0.0682321875 [69,] 0.97124566 0.0575086830 0.0287543415 [70,] 0.96252747 0.0749450657 0.0374725329 [71,] 0.95939744 0.0812051222 0.0406025611 [72,] 0.97970514 0.0405897108 0.0202948554 [73,] 0.97366612 0.0526677540 0.0263338770 [74,] 0.97911814 0.0417637209 0.0208818604 [75,] 0.97228802 0.0554239552 0.0277119776 [76,] 0.96707085 0.0658582925 0.0329291462 [77,] 0.95781481 0.0843703793 0.0421851896 [78,] 0.95110407 0.0977918678 0.0488959339 [79,] 0.95168556 0.0966288809 0.0483144404 [80,] 0.93812715 0.1237456921 0.0618728460 [81,] 0.94100263 0.1179947354 0.0589973677 [82,] 0.95273532 0.0945293634 0.0472646817 [83,] 0.99689501 0.0062099873 0.0031049937 [84,] 0.99588101 0.0082379855 0.0041189927 [85,] 0.99494139 0.0101172190 0.0050586095 [86,] 0.99307954 0.0138409163 0.0069204581 [87,] 0.99398754 0.0120249293 0.0060124647 [88,] 0.99484427 0.0103114648 0.0051557324 [89,] 0.99312713 0.0137457347 0.0068728674 [90,] 0.99169441 0.0166111702 0.0083055851 [91,] 0.99447398 0.0110520370 0.0055260185 [92,] 0.99440656 0.0111868832 0.0055934416 [93,] 0.99221801 0.0155639709 0.0077819855 [94,] 0.99401935 0.0119613018 0.0059806509 [95,] 0.99144142 0.0171171697 0.0085585848 [96,] 0.98849767 0.0230046560 0.0115023280 [97,] 0.98740006 0.0251998760 0.0125999380 [98,] 0.99163489 0.0167302128 0.0083651064 [99,] 0.99907421 0.0018515749 0.0009257874 [100,] 0.99867367 0.0026526682 0.0013263341 [101,] 0.99967487 0.0006502628 0.0003251314 [102,] 0.99945649 0.0010870271 0.0005435136 [103,] 0.99934363 0.0013127402 0.0006563701 [104,] 0.99897546 0.0020490769 0.0010245384 [105,] 0.99862705 0.0027459021 0.0013729510 [106,] 0.99775706 0.0044858777 0.0022429389 [107,] 0.99642791 0.0071441723 0.0035720861 [108,] 0.99923340 0.0015332018 0.0007666009 [109,] 0.99878932 0.0024213662 0.0012106831 [110,] 0.99809216 0.0038156831 0.0019078415 [111,] 0.99799260 0.0040148082 0.0020074041 [112,] 0.99797816 0.0040436780 0.0020218390 [113,] 0.99708216 0.0058356757 0.0029178379 [114,] 0.99771141 0.0045771877 0.0022885938 [115,] 0.99613409 0.0077318161 0.0038659081 [116,] 0.99442637 0.0111472548 0.0055736274 [117,] 0.99219413 0.0156117443 0.0078058722 [118,] 0.98849186 0.0230162805 0.0115081403 [119,] 0.99468801 0.0106239834 0.0053119917 [120,] 0.99655263 0.0068947329 0.0034473665 [121,] 0.99461720 0.0107655965 0.0053827982 [122,] 0.99395792 0.0120841540 0.0060420770 [123,] 0.99080626 0.0183874713 0.0091937357 [124,] 0.98402299 0.0319540203 0.0159770101 [125,] 0.97216222 0.0556755564 0.0278377782 [126,] 0.96854283 0.0629143393 0.0314571697 [127,] 0.95735279 0.0852944248 0.0426472124 [128,] 0.93483513 0.1303297375 0.0651648688 [129,] 0.92147888 0.1570422453 0.0785211226 [130,] 0.87192986 0.2561402754 0.1280701377 [131,] 0.87711486 0.2457702900 0.1228851450 [132,] 0.80285413 0.3942917459 0.1971458730 [133,] 0.73551679 0.5289664196 0.2644832098 [134,] 0.71361285 0.5727743027 0.2863871514 [135,] 0.58090993 0.8381801453 0.4190900727 > postscript(file="/var/www/html/freestat/rcomp/tmp/18lkx1293205809.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/20cj01293205809.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/30cj01293205809.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/40cj01293205809.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/5t3jl1293205809.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.74051170 0.33119764 -2.06161883 -1.85332033 0.03343624 1.00456323 7 8 9 10 11 12 1.29284170 2.29952450 -0.78009940 -2.69580001 -0.17562164 -0.03705014 13 14 15 16 17 18 3.17517867 1.23945361 -1.01425517 0.87544506 0.46323068 -2.74363585 19 20 21 22 23 24 -1.20888244 0.80658900 2.67988610 1.30636955 -0.09012465 0.73512801 25 26 27 28 29 30 0.64963102 -0.09828321 2.68134699 -1.93327468 -0.98149900 -0.62574288 31 32 33 34 35 36 -0.28424400 2.53534739 0.81474756 0.33094258 -5.42613480 5.34701097 37 38 39 40 41 42 3.96929443 -1.21576277 1.94389818 -0.72865769 6.14596031 -4.65147735 43 44 45 46 47 48 -0.26918053 3.91141180 0.03364123 -1.54602510 1.80752503 2.19812138 49 50 51 52 53 54 -0.34390478 2.46931654 -1.81684978 -0.86870142 -2.72923334 -0.23057584 55 56 57 58 59 60 -1.81929316 -0.08290212 0.29447203 -0.91939764 -0.39051062 -0.27156595 61 62 63 64 65 66 -0.03187487 1.01711912 -1.94996681 1.49966879 -1.72310040 3.24547804 67 68 69 70 71 72 0.75555476 0.60050742 -4.13270916 5.06693050 2.15757031 -3.26390438 73 74 75 76 77 78 -4.28661963 0.04065877 1.76685533 -0.39374929 2.94295515 -2.30387608 79 80 81 82 83 84 -4.06441846 -0.18729269 1.56610957 -3.70389833 -0.25663065 2.70411305 85 86 87 88 89 90 -0.19330596 -1.32325591 -0.30310248 0.93412706 0.72717420 -0.33238208 91 92 93 94 95 96 -2.27275723 -2.73751054 -6.09122640 -1.18816314 1.78590700 0.48117813 97 98 99 100 101 102 -2.62568411 -2.29792721 -1.53029910 1.81923201 2.72112446 2.29284170 103 104 105 106 107 108 -0.35466983 2.73985333 0.73192476 0.37515723 -1.78952027 -2.66796019 109 110 111 112 113 114 4.42471988 1.07565355 -3.33345473 0.84305955 1.80589471 -0.43074841 115 116 117 118 119 120 -1.60987161 -0.24308192 0.76368087 2.28834673 -0.44041166 -1.24147248 121 122 123 124 125 126 -2.28813832 -3.13523225 -0.90442648 -1.32843818 -0.08724961 -0.62752001 127 128 129 130 131 132 -1.70349124 1.67103325 -1.76775428 1.21786034 -1.97909173 2.06485761 133 134 135 136 137 138 -1.39713551 -0.88959253 0.78820686 -1.27570089 -0.32011390 0.07753225 139 140 141 142 143 144 -0.56975982 1.31597142 1.56774690 1.08394192 1.02527768 0.91151249 145 146 147 148 149 150 1.33367448 1.86689125 0.13183149 2.79773615 0.43900374 -2.03187487 151 152 153 154 155 156 2.26717145 0.08353880 -1.18892302 -1.29195728 0.08353880 -1.03187487 > postscript(file="/var/www/html/freestat/rcomp/tmp/6t3jl1293205809.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.74051170 NA 1 0.33119764 1.74051170 2 -2.06161883 0.33119764 3 -1.85332033 -2.06161883 4 0.03343624 -1.85332033 5 1.00456323 0.03343624 6 1.29284170 1.00456323 7 2.29952450 1.29284170 8 -0.78009940 2.29952450 9 -2.69580001 -0.78009940 10 -0.17562164 -2.69580001 11 -0.03705014 -0.17562164 12 3.17517867 -0.03705014 13 1.23945361 3.17517867 14 -1.01425517 1.23945361 15 0.87544506 -1.01425517 16 0.46323068 0.87544506 17 -2.74363585 0.46323068 18 -1.20888244 -2.74363585 19 0.80658900 -1.20888244 20 2.67988610 0.80658900 21 1.30636955 2.67988610 22 -0.09012465 1.30636955 23 0.73512801 -0.09012465 24 0.64963102 0.73512801 25 -0.09828321 0.64963102 26 2.68134699 -0.09828321 27 -1.93327468 2.68134699 28 -0.98149900 -1.93327468 29 -0.62574288 -0.98149900 30 -0.28424400 -0.62574288 31 2.53534739 -0.28424400 32 0.81474756 2.53534739 33 0.33094258 0.81474756 34 -5.42613480 0.33094258 35 5.34701097 -5.42613480 36 3.96929443 5.34701097 37 -1.21576277 3.96929443 38 1.94389818 -1.21576277 39 -0.72865769 1.94389818 40 6.14596031 -0.72865769 41 -4.65147735 6.14596031 42 -0.26918053 -4.65147735 43 3.91141180 -0.26918053 44 0.03364123 3.91141180 45 -1.54602510 0.03364123 46 1.80752503 -1.54602510 47 2.19812138 1.80752503 48 -0.34390478 2.19812138 49 2.46931654 -0.34390478 50 -1.81684978 2.46931654 51 -0.86870142 -1.81684978 52 -2.72923334 -0.86870142 53 -0.23057584 -2.72923334 54 -1.81929316 -0.23057584 55 -0.08290212 -1.81929316 56 0.29447203 -0.08290212 57 -0.91939764 0.29447203 58 -0.39051062 -0.91939764 59 -0.27156595 -0.39051062 60 -0.03187487 -0.27156595 61 1.01711912 -0.03187487 62 -1.94996681 1.01711912 63 1.49966879 -1.94996681 64 -1.72310040 1.49966879 65 3.24547804 -1.72310040 66 0.75555476 3.24547804 67 0.60050742 0.75555476 68 -4.13270916 0.60050742 69 5.06693050 -4.13270916 70 2.15757031 5.06693050 71 -3.26390438 2.15757031 72 -4.28661963 -3.26390438 73 0.04065877 -4.28661963 74 1.76685533 0.04065877 75 -0.39374929 1.76685533 76 2.94295515 -0.39374929 77 -2.30387608 2.94295515 78 -4.06441846 -2.30387608 79 -0.18729269 -4.06441846 80 1.56610957 -0.18729269 81 -3.70389833 1.56610957 82 -0.25663065 -3.70389833 83 2.70411305 -0.25663065 84 -0.19330596 2.70411305 85 -1.32325591 -0.19330596 86 -0.30310248 -1.32325591 87 0.93412706 -0.30310248 88 0.72717420 0.93412706 89 -0.33238208 0.72717420 90 -2.27275723 -0.33238208 91 -2.73751054 -2.27275723 92 -6.09122640 -2.73751054 93 -1.18816314 -6.09122640 94 1.78590700 -1.18816314 95 0.48117813 1.78590700 96 -2.62568411 0.48117813 97 -2.29792721 -2.62568411 98 -1.53029910 -2.29792721 99 1.81923201 -1.53029910 100 2.72112446 1.81923201 101 2.29284170 2.72112446 102 -0.35466983 2.29284170 103 2.73985333 -0.35466983 104 0.73192476 2.73985333 105 0.37515723 0.73192476 106 -1.78952027 0.37515723 107 -2.66796019 -1.78952027 108 4.42471988 -2.66796019 109 1.07565355 4.42471988 110 -3.33345473 1.07565355 111 0.84305955 -3.33345473 112 1.80589471 0.84305955 113 -0.43074841 1.80589471 114 -1.60987161 -0.43074841 115 -0.24308192 -1.60987161 116 0.76368087 -0.24308192 117 2.28834673 0.76368087 118 -0.44041166 2.28834673 119 -1.24147248 -0.44041166 120 -2.28813832 -1.24147248 121 -3.13523225 -2.28813832 122 -0.90442648 -3.13523225 123 -1.32843818 -0.90442648 124 -0.08724961 -1.32843818 125 -0.62752001 -0.08724961 126 -1.70349124 -0.62752001 127 1.67103325 -1.70349124 128 -1.76775428 1.67103325 129 1.21786034 -1.76775428 130 -1.97909173 1.21786034 131 2.06485761 -1.97909173 132 -1.39713551 2.06485761 133 -0.88959253 -1.39713551 134 0.78820686 -0.88959253 135 -1.27570089 0.78820686 136 -0.32011390 -1.27570089 137 0.07753225 -0.32011390 138 -0.56975982 0.07753225 139 1.31597142 -0.56975982 140 1.56774690 1.31597142 141 1.08394192 1.56774690 142 1.02527768 1.08394192 143 0.91151249 1.02527768 144 1.33367448 0.91151249 145 1.86689125 1.33367448 146 0.13183149 1.86689125 147 2.79773615 0.13183149 148 0.43900374 2.79773615 149 -2.03187487 0.43900374 150 2.26717145 -2.03187487 151 0.08353880 2.26717145 152 -1.18892302 0.08353880 153 -1.29195728 -1.18892302 154 0.08353880 -1.29195728 155 -1.03187487 0.08353880 156 NA -1.03187487 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.33119764 1.74051170 [2,] -2.06161883 0.33119764 [3,] -1.85332033 -2.06161883 [4,] 0.03343624 -1.85332033 [5,] 1.00456323 0.03343624 [6,] 1.29284170 1.00456323 [7,] 2.29952450 1.29284170 [8,] -0.78009940 2.29952450 [9,] -2.69580001 -0.78009940 [10,] -0.17562164 -2.69580001 [11,] -0.03705014 -0.17562164 [12,] 3.17517867 -0.03705014 [13,] 1.23945361 3.17517867 [14,] -1.01425517 1.23945361 [15,] 0.87544506 -1.01425517 [16,] 0.46323068 0.87544506 [17,] -2.74363585 0.46323068 [18,] -1.20888244 -2.74363585 [19,] 0.80658900 -1.20888244 [20,] 2.67988610 0.80658900 [21,] 1.30636955 2.67988610 [22,] -0.09012465 1.30636955 [23,] 0.73512801 -0.09012465 [24,] 0.64963102 0.73512801 [25,] -0.09828321 0.64963102 [26,] 2.68134699 -0.09828321 [27,] -1.93327468 2.68134699 [28,] -0.98149900 -1.93327468 [29,] -0.62574288 -0.98149900 [30,] -0.28424400 -0.62574288 [31,] 2.53534739 -0.28424400 [32,] 0.81474756 2.53534739 [33,] 0.33094258 0.81474756 [34,] -5.42613480 0.33094258 [35,] 5.34701097 -5.42613480 [36,] 3.96929443 5.34701097 [37,] -1.21576277 3.96929443 [38,] 1.94389818 -1.21576277 [39,] -0.72865769 1.94389818 [40,] 6.14596031 -0.72865769 [41,] -4.65147735 6.14596031 [42,] -0.26918053 -4.65147735 [43,] 3.91141180 -0.26918053 [44,] 0.03364123 3.91141180 [45,] -1.54602510 0.03364123 [46,] 1.80752503 -1.54602510 [47,] 2.19812138 1.80752503 [48,] -0.34390478 2.19812138 [49,] 2.46931654 -0.34390478 [50,] -1.81684978 2.46931654 [51,] -0.86870142 -1.81684978 [52,] -2.72923334 -0.86870142 [53,] -0.23057584 -2.72923334 [54,] -1.81929316 -0.23057584 [55,] -0.08290212 -1.81929316 [56,] 0.29447203 -0.08290212 [57,] -0.91939764 0.29447203 [58,] -0.39051062 -0.91939764 [59,] -0.27156595 -0.39051062 [60,] -0.03187487 -0.27156595 [61,] 1.01711912 -0.03187487 [62,] -1.94996681 1.01711912 [63,] 1.49966879 -1.94996681 [64,] -1.72310040 1.49966879 [65,] 3.24547804 -1.72310040 [66,] 0.75555476 3.24547804 [67,] 0.60050742 0.75555476 [68,] -4.13270916 0.60050742 [69,] 5.06693050 -4.13270916 [70,] 2.15757031 5.06693050 [71,] -3.26390438 2.15757031 [72,] -4.28661963 -3.26390438 [73,] 0.04065877 -4.28661963 [74,] 1.76685533 0.04065877 [75,] -0.39374929 1.76685533 [76,] 2.94295515 -0.39374929 [77,] -2.30387608 2.94295515 [78,] -4.06441846 -2.30387608 [79,] -0.18729269 -4.06441846 [80,] 1.56610957 -0.18729269 [81,] -3.70389833 1.56610957 [82,] -0.25663065 -3.70389833 [83,] 2.70411305 -0.25663065 [84,] -0.19330596 2.70411305 [85,] -1.32325591 -0.19330596 [86,] -0.30310248 -1.32325591 [87,] 0.93412706 -0.30310248 [88,] 0.72717420 0.93412706 [89,] -0.33238208 0.72717420 [90,] -2.27275723 -0.33238208 [91,] -2.73751054 -2.27275723 [92,] -6.09122640 -2.73751054 [93,] -1.18816314 -6.09122640 [94,] 1.78590700 -1.18816314 [95,] 0.48117813 1.78590700 [96,] -2.62568411 0.48117813 [97,] -2.29792721 -2.62568411 [98,] -1.53029910 -2.29792721 [99,] 1.81923201 -1.53029910 [100,] 2.72112446 1.81923201 [101,] 2.29284170 2.72112446 [102,] -0.35466983 2.29284170 [103,] 2.73985333 -0.35466983 [104,] 0.73192476 2.73985333 [105,] 0.37515723 0.73192476 [106,] -1.78952027 0.37515723 [107,] -2.66796019 -1.78952027 [108,] 4.42471988 -2.66796019 [109,] 1.07565355 4.42471988 [110,] -3.33345473 1.07565355 [111,] 0.84305955 -3.33345473 [112,] 1.80589471 0.84305955 [113,] -0.43074841 1.80589471 [114,] -1.60987161 -0.43074841 [115,] -0.24308192 -1.60987161 [116,] 0.76368087 -0.24308192 [117,] 2.28834673 0.76368087 [118,] -0.44041166 2.28834673 [119,] -1.24147248 -0.44041166 [120,] -2.28813832 -1.24147248 [121,] -3.13523225 -2.28813832 [122,] -0.90442648 -3.13523225 [123,] -1.32843818 -0.90442648 [124,] -0.08724961 -1.32843818 [125,] -0.62752001 -0.08724961 [126,] -1.70349124 -0.62752001 [127,] 1.67103325 -1.70349124 [128,] -1.76775428 1.67103325 [129,] 1.21786034 -1.76775428 [130,] -1.97909173 1.21786034 [131,] 2.06485761 -1.97909173 [132,] -1.39713551 2.06485761 [133,] -0.88959253 -1.39713551 [134,] 0.78820686 -0.88959253 [135,] -1.27570089 0.78820686 [136,] -0.32011390 -1.27570089 [137,] 0.07753225 -0.32011390 [138,] -0.56975982 0.07753225 [139,] 1.31597142 -0.56975982 [140,] 1.56774690 1.31597142 [141,] 1.08394192 1.56774690 [142,] 1.02527768 1.08394192 [143,] 0.91151249 1.02527768 [144,] 1.33367448 0.91151249 [145,] 1.86689125 1.33367448 [146,] 0.13183149 1.86689125 [147,] 2.79773615 0.13183149 [148,] 0.43900374 2.79773615 [149,] -2.03187487 0.43900374 [150,] 2.26717145 -2.03187487 [151,] 0.08353880 2.26717145 [152,] -1.18892302 0.08353880 [153,] -1.29195728 -1.18892302 [154,] 0.08353880 -1.29195728 [155,] -1.03187487 0.08353880 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.33119764 1.74051170 2 -2.06161883 0.33119764 3 -1.85332033 -2.06161883 4 0.03343624 -1.85332033 5 1.00456323 0.03343624 6 1.29284170 1.00456323 7 2.29952450 1.29284170 8 -0.78009940 2.29952450 9 -2.69580001 -0.78009940 10 -0.17562164 -2.69580001 11 -0.03705014 -0.17562164 12 3.17517867 -0.03705014 13 1.23945361 3.17517867 14 -1.01425517 1.23945361 15 0.87544506 -1.01425517 16 0.46323068 0.87544506 17 -2.74363585 0.46323068 18 -1.20888244 -2.74363585 19 0.80658900 -1.20888244 20 2.67988610 0.80658900 21 1.30636955 2.67988610 22 -0.09012465 1.30636955 23 0.73512801 -0.09012465 24 0.64963102 0.73512801 25 -0.09828321 0.64963102 26 2.68134699 -0.09828321 27 -1.93327468 2.68134699 28 -0.98149900 -1.93327468 29 -0.62574288 -0.98149900 30 -0.28424400 -0.62574288 31 2.53534739 -0.28424400 32 0.81474756 2.53534739 33 0.33094258 0.81474756 34 -5.42613480 0.33094258 35 5.34701097 -5.42613480 36 3.96929443 5.34701097 37 -1.21576277 3.96929443 38 1.94389818 -1.21576277 39 -0.72865769 1.94389818 40 6.14596031 -0.72865769 41 -4.65147735 6.14596031 42 -0.26918053 -4.65147735 43 3.91141180 -0.26918053 44 0.03364123 3.91141180 45 -1.54602510 0.03364123 46 1.80752503 -1.54602510 47 2.19812138 1.80752503 48 -0.34390478 2.19812138 49 2.46931654 -0.34390478 50 -1.81684978 2.46931654 51 -0.86870142 -1.81684978 52 -2.72923334 -0.86870142 53 -0.23057584 -2.72923334 54 -1.81929316 -0.23057584 55 -0.08290212 -1.81929316 56 0.29447203 -0.08290212 57 -0.91939764 0.29447203 58 -0.39051062 -0.91939764 59 -0.27156595 -0.39051062 60 -0.03187487 -0.27156595 61 1.01711912 -0.03187487 62 -1.94996681 1.01711912 63 1.49966879 -1.94996681 64 -1.72310040 1.49966879 65 3.24547804 -1.72310040 66 0.75555476 3.24547804 67 0.60050742 0.75555476 68 -4.13270916 0.60050742 69 5.06693050 -4.13270916 70 2.15757031 5.06693050 71 -3.26390438 2.15757031 72 -4.28661963 -3.26390438 73 0.04065877 -4.28661963 74 1.76685533 0.04065877 75 -0.39374929 1.76685533 76 2.94295515 -0.39374929 77 -2.30387608 2.94295515 78 -4.06441846 -2.30387608 79 -0.18729269 -4.06441846 80 1.56610957 -0.18729269 81 -3.70389833 1.56610957 82 -0.25663065 -3.70389833 83 2.70411305 -0.25663065 84 -0.19330596 2.70411305 85 -1.32325591 -0.19330596 86 -0.30310248 -1.32325591 87 0.93412706 -0.30310248 88 0.72717420 0.93412706 89 -0.33238208 0.72717420 90 -2.27275723 -0.33238208 91 -2.73751054 -2.27275723 92 -6.09122640 -2.73751054 93 -1.18816314 -6.09122640 94 1.78590700 -1.18816314 95 0.48117813 1.78590700 96 -2.62568411 0.48117813 97 -2.29792721 -2.62568411 98 -1.53029910 -2.29792721 99 1.81923201 -1.53029910 100 2.72112446 1.81923201 101 2.29284170 2.72112446 102 -0.35466983 2.29284170 103 2.73985333 -0.35466983 104 0.73192476 2.73985333 105 0.37515723 0.73192476 106 -1.78952027 0.37515723 107 -2.66796019 -1.78952027 108 4.42471988 -2.66796019 109 1.07565355 4.42471988 110 -3.33345473 1.07565355 111 0.84305955 -3.33345473 112 1.80589471 0.84305955 113 -0.43074841 1.80589471 114 -1.60987161 -0.43074841 115 -0.24308192 -1.60987161 116 0.76368087 -0.24308192 117 2.28834673 0.76368087 118 -0.44041166 2.28834673 119 -1.24147248 -0.44041166 120 -2.28813832 -1.24147248 121 -3.13523225 -2.28813832 122 -0.90442648 -3.13523225 123 -1.32843818 -0.90442648 124 -0.08724961 -1.32843818 125 -0.62752001 -0.08724961 126 -1.70349124 -0.62752001 127 1.67103325 -1.70349124 128 -1.76775428 1.67103325 129 1.21786034 -1.76775428 130 -1.97909173 1.21786034 131 2.06485761 -1.97909173 132 -1.39713551 2.06485761 133 -0.88959253 -1.39713551 134 0.78820686 -0.88959253 135 -1.27570089 0.78820686 136 -0.32011390 -1.27570089 137 0.07753225 -0.32011390 138 -0.56975982 0.07753225 139 1.31597142 -0.56975982 140 1.56774690 1.31597142 141 1.08394192 1.56774690 142 1.02527768 1.08394192 143 0.91151249 1.02527768 144 1.33367448 0.91151249 145 1.86689125 1.33367448 146 0.13183149 1.86689125 147 2.79773615 0.13183149 148 0.43900374 2.79773615 149 -2.03187487 0.43900374 150 2.26717145 -2.03187487 151 0.08353880 2.26717145 152 -1.18892302 0.08353880 153 -1.29195728 -1.18892302 154 0.08353880 -1.29195728 155 -1.03187487 0.08353880 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/74vio1293205809.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/84vio1293205809.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/freestat/rcomp/tmp/94vio1293205809.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/freestat/rcomp/tmp/10fmh91293205809.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/11i4yx1293205809.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/1235wk1293205809.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/130xct1293205809.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/freestat/rcomp/tmp/143fsh1293205809.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/html/freestat/rcomp/tmp/156yr51293205809.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/html/freestat/rcomp/tmp/16ay8t1293205809.tab") + } > > try(system("convert tmp/18lkx1293205809.ps tmp/18lkx1293205809.png",intern=TRUE)) character(0) > try(system("convert tmp/20cj01293205809.ps tmp/20cj01293205809.png",intern=TRUE)) character(0) > try(system("convert tmp/30cj01293205809.ps tmp/30cj01293205809.png",intern=TRUE)) character(0) > try(system("convert tmp/40cj01293205809.ps tmp/40cj01293205809.png",intern=TRUE)) character(0) > try(system("convert tmp/5t3jl1293205809.ps tmp/5t3jl1293205809.png",intern=TRUE)) character(0) > try(system("convert tmp/6t3jl1293205809.ps tmp/6t3jl1293205809.png",intern=TRUE)) character(0) > try(system("convert tmp/74vio1293205809.ps tmp/74vio1293205809.png",intern=TRUE)) character(0) > try(system("convert tmp/84vio1293205809.ps tmp/84vio1293205809.png",intern=TRUE)) character(0) > try(system("convert tmp/94vio1293205809.ps tmp/94vio1293205809.png",intern=TRUE)) character(0) > try(system("convert tmp/10fmh91293205809.ps tmp/10fmh91293205809.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.892 2.690 6.245