R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) 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(13 + ,14 + ,16 + ,18 + ,19 + ,11 + ,15 + ,12 + ,14 + ,16 + ,13 + ,18 + ,19 + ,14 + ,15 + ,14 + ,14 + ,15 + ,15 + ,15 + ,16 + ,17 + ,16 + ,19 + ,16 + ,10 + ,16 + ,16 + ,17 + ,18 + ,15 + ,14 + ,15 + ,14 + ,20 + ,17 + ,18 + ,14 + ,16 + ,16 + ,16 + ,18 + ,16 + ,11 + ,19 + ,14 + ,16 + ,12 + ,17 + ,17 + ,17 + ,9 + ,16 + ,16 + ,15 + ,14 + ,16 + ,15 + ,14 + ,11 + ,15 + ,16 + ,12 + ,13 + ,14 + ,17 + ,16 + ,15 + ,14 + ,14 + ,7 + ,16 + ,10 + ,9 + ,14 + ,15 + ,16 + ,17 + ,16 + ,13 + ,16 + ,15 + ,14 + ,16 + ,20 + ,16 + ,14 + ,12 + ,14 + ,12 + ,11 + ,11 + ,14 + ,15 + ,15 + ,15 + ,16 + ,17 + ,14 + ,13 + ,16 + ,16 + ,14 + ,14 + ,12 + ,11 + ,16 + ,12 + ,9 + ,12 + ,14 + ,15 + ,16 + ,16 + ,16 + ,15 + ,15 + ,12 + ,16 + ,12 + ,12 + ,8 + ,16 + ,13 + ,16 + ,11 + ,14 + ,14 + ,16 + ,15 + ,17 + ,10 + ,18 + ,11 + ,18 + ,12 + ,12 + ,15 + ,16 + ,15 + ,10 + ,14 + ,14 + ,16 + ,18 + ,15 + ,18 + ,15 + ,16 + ,13 + ,17 + ,12 + ,16 + ,17 + ,16 + ,13 + ,13 + ,15 + ,16 + ,13 + ,16 + ,15 + ,20 + ,16 + ,16 + ,15 + ,15 + ,16 + ,15 + ,15 + ,16 + ,14 + ,14 + ,15 + ,16 + ,14 + ,16 + ,13 + ,15 + ,7 + ,12 + ,17 + ,17 + ,13 + ,16 + ,15 + ,15 + ,14 + ,13 + ,13 + ,16 + ,16 + ,16 + ,12 + ,16 + ,14 + ,16 + ,17 + ,14 + ,15 + ,16 + ,17 + ,16 + ,12 + ,20 + ,16 + ,15 + ,11 + ,16 + ,15 + ,13 + ,9 + ,17 + ,16 + ,16 + ,15 + ,16 + ,10 + ,12 + ,10 + ,16 + ,15 + ,16 + ,11 + ,17 + ,13 + ,13 + ,14 + ,12 + ,18 + ,18 + ,16 + ,14 + ,14 + ,14 + ,14 + ,13 + ,14 + ,16 + ,14 + ,13 + ,12 + ,16 + ,14 + ,13 + ,15 + ,16 + ,15 + ,15 + ,15 + ,16 + ,13 + ,15 + ,17 + ,17 + ,17 + ,15 + ,19 + ,12 + ,15 + ,16 + ,13 + ,10 + ,9 + ,16 + ,15 + ,12 + ,15 + ,14 + ,15 + ,15 + ,16 + ,13 + ,11 + ,15 + ,14 + ,11 + ,11 + ,12 + ,15 + ,8 + ,13 + ,16 + ,15 + ,15 + ,16 + ,17 + ,14 + ,16 + ,15 + ,10 + ,16 + ,18 + ,16 + ,13 + ,11 + ,16 + ,12 + ,13 + ,9 + ,10 + ,16 + ,15 + ,13 + ,16 + ,16 + ,16 + ,12 + ,14 + ,9 + ,10 + ,13 + ,17 + ,13 + ,13 + ,14 + ,15 + ,19 + ,16 + ,13 + ,12 + ,12 + ,13 + ,13) + ,dim=c(2 + ,162) + ,dimnames=list(c('Learning' + ,'Hapiness') + ,1:162)) > y <- array(NA,dim=c(2,162),dimnames=list(c('Learning','Hapiness'),1:162)) > 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 = '2' > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, 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 Hapiness Learning t 1 14 13 1 2 18 16 2 3 11 19 3 4 12 15 4 5 16 14 5 6 18 13 6 7 14 19 7 8 14 15 8 9 15 14 9 10 15 15 10 11 17 16 11 12 19 16 12 13 10 16 13 14 16 16 14 15 18 17 15 16 14 15 16 17 14 15 17 18 17 20 18 19 14 18 19 20 16 16 20 21 18 16 21 22 11 16 22 23 14 19 23 24 12 16 24 25 17 17 25 26 9 17 26 27 16 16 27 28 14 15 28 29 15 16 29 30 11 14 30 31 16 15 31 32 13 12 32 33 17 14 33 34 15 16 34 35 14 14 35 36 16 7 36 37 9 10 37 38 15 14 38 39 17 16 39 40 13 16 40 41 15 16 41 42 16 14 42 43 16 20 43 44 12 14 44 45 12 14 45 46 11 11 46 47 15 14 47 48 15 15 48 49 17 16 49 50 13 14 50 51 16 16 51 52 14 14 52 53 11 12 53 54 12 16 54 55 12 9 55 56 15 14 56 57 16 16 57 58 15 16 58 59 12 15 59 60 12 16 60 61 8 12 61 62 13 16 62 63 11 16 63 64 14 14 64 65 15 16 65 66 10 17 66 67 11 18 67 68 12 18 68 69 15 12 69 70 15 16 70 71 14 10 71 72 16 14 72 73 15 18 73 74 15 18 74 75 13 16 75 76 12 17 76 77 17 16 77 78 13 16 78 79 15 13 79 80 13 16 80 81 15 16 81 82 16 20 82 83 15 16 83 84 16 15 84 85 15 15 85 86 14 16 86 87 15 14 87 88 14 16 88 89 13 16 89 90 7 15 90 91 17 12 91 92 13 17 92 93 15 16 93 94 14 15 94 95 13 13 95 96 16 16 96 97 12 16 97 98 14 16 98 99 17 16 99 100 15 14 100 101 17 16 101 102 12 16 102 103 16 20 103 104 11 15 104 105 15 16 105 106 9 13 106 107 16 17 107 108 15 16 108 109 10 16 109 110 10 12 110 111 15 16 111 112 11 16 112 113 13 17 113 114 14 13 114 115 18 12 115 116 16 18 116 117 14 14 117 118 14 14 118 119 14 13 119 120 14 16 120 121 12 13 121 122 14 16 122 123 15 13 123 124 15 16 124 125 15 15 125 126 13 16 126 127 17 15 127 128 17 17 128 129 19 15 129 130 15 12 130 131 13 16 131 132 9 10 132 133 15 16 133 134 15 12 134 135 15 14 135 136 16 15 136 137 11 13 137 138 14 15 138 139 11 11 139 140 15 12 140 141 13 8 141 142 15 16 142 143 16 15 143 144 14 17 144 145 15 16 145 146 16 10 146 147 16 18 147 148 11 13 148 149 12 16 149 150 9 13 150 151 16 10 151 152 13 15 152 153 16 16 153 154 12 16 154 155 9 14 155 156 13 10 156 157 13 17 157 158 14 13 158 159 19 15 159 160 13 16 160 161 12 12 161 162 13 13 162 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Learning t 11.68324 0.17586 -0.00338 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -7.0170 -1.2901 0.3996 1.5655 5.2162 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 11.683235 1.340991 8.712 3.68e-15 *** Learning 0.175864 0.082150 2.141 0.0338 * t -0.003380 0.003951 -0.855 0.3936 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.307 on 159 degrees of freedom Multiple R-squared: 0.03787, Adjusted R-squared: 0.02577 F-statistic: 3.13 on 2 and 159 DF, p-value: 0.04645 > 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.88680056 0.2263989 0.11319944 [2,] 0.80141754 0.3971649 0.19858246 [3,] 0.74448874 0.5110225 0.25551126 [4,] 0.64525417 0.7094917 0.35474583 [5,] 0.53184531 0.9363094 0.46815469 [6,] 0.50196512 0.9960698 0.49803488 [7,] 0.57209485 0.8558103 0.42790515 [8,] 0.89023430 0.2195314 0.10976570 [9,] 0.85093458 0.2981308 0.14906542 [10,] 0.86144525 0.2771095 0.13855475 [11,] 0.85126128 0.2974774 0.14873872 [12,] 0.82739737 0.3452053 0.17260263 [13,] 0.81868060 0.3626388 0.18131940 [14,] 0.78319497 0.4336101 0.21680503 [15,] 0.73151472 0.5369706 0.26848528 [16,] 0.72757157 0.5448569 0.27242843 [17,] 0.85652180 0.2869564 0.14347820 [18,] 0.82051278 0.3589744 0.17948722 [19,] 0.83756153 0.3248769 0.16243847 [20,] 0.83306460 0.3338708 0.16693540 [21,] 0.94360937 0.1127813 0.05639063 [22,] 0.93385539 0.1322892 0.06614461 [23,] 0.91311848 0.1737630 0.08688152 [24,] 0.88938532 0.2212294 0.11061468 [25,] 0.90657614 0.1868477 0.09342386 [26,] 0.89851741 0.2029652 0.10148259 [27,] 0.87547974 0.2490405 0.12452026 [28,] 0.89017820 0.2196436 0.10982180 [29,] 0.86522867 0.2695427 0.13477133 [30,] 0.83359766 0.3328047 0.16640234 [31,] 0.82977276 0.3404545 0.17022724 [32,] 0.91571178 0.1685764 0.08428822 [33,] 0.89961540 0.2007692 0.10038460 [34,] 0.91111277 0.1777745 0.08888723 [35,] 0.89316542 0.2136692 0.10683458 [36,] 0.87160465 0.2567907 0.12839535 [37,] 0.86572106 0.2685579 0.13427894 [38,] 0.84606285 0.3078743 0.15393715 [39,] 0.83684394 0.3263121 0.16315606 [40,] 0.82393731 0.3521254 0.17606269 [41,] 0.82142003 0.3571599 0.17857997 [42,] 0.79909547 0.4018091 0.20090453 [43,] 0.77223304 0.4555339 0.22776696 [44,] 0.79370862 0.4125828 0.20629138 [45,] 0.76134368 0.4773126 0.23865632 [46,] 0.74940664 0.5011867 0.25059336 [47,] 0.71067838 0.5786432 0.28932162 [48,] 0.71117772 0.5776446 0.28882228 [49,] 0.69834775 0.6033045 0.30165225 [50,] 0.65857891 0.6828422 0.34142109 [51,] 0.63208678 0.7358264 0.36791322 [52,] 0.62293073 0.7541385 0.37706927 [53,] 0.58672789 0.8265442 0.41327211 [54,] 0.56697582 0.8660484 0.43302418 [55,] 0.55019893 0.8996021 0.44980107 [56,] 0.71142399 0.5771520 0.28857601 [57,] 0.67439614 0.6512077 0.32560386 [58,] 0.68793009 0.6241398 0.31206991 [59,] 0.65121216 0.6975757 0.34878784 [60,] 0.62312981 0.7537404 0.37687019 [61,] 0.69624142 0.6075172 0.30375858 [62,] 0.72168645 0.5566271 0.27831355 [63,] 0.71314820 0.5737036 0.28685180 [64,] 0.70882896 0.5823421 0.29117104 [65,] 0.68785477 0.6242905 0.31214523 [66,] 0.66117249 0.6776550 0.33882751 [67,] 0.67695601 0.6460880 0.32304399 [68,] 0.64612828 0.7077434 0.35387172 [69,] 0.61288682 0.7742264 0.38711318 [70,] 0.57513534 0.8497293 0.42486466 [71,] 0.56428489 0.8714302 0.43571511 [72,] 0.60890028 0.7821994 0.39109972 [73,] 0.57199048 0.8560190 0.42800952 [74,] 0.55283817 0.8943237 0.44716183 [75,] 0.51520719 0.9695856 0.48479281 [76,] 0.48326412 0.9665282 0.51673588 [77,] 0.45764702 0.9152940 0.54235298 [78,] 0.42424171 0.8484834 0.57575829 [79,] 0.42378376 0.8475675 0.57621624 [80,] 0.39357284 0.7871457 0.60642716 [81,] 0.35083420 0.7016684 0.64916580 [82,] 0.32630098 0.6526020 0.67369902 [83,] 0.28648667 0.5729733 0.71351333 [84,] 0.25441274 0.5088255 0.74558726 [85,] 0.57578684 0.8484263 0.42421316 [86,] 0.65097854 0.6980429 0.34902146 [87,] 0.62093449 0.7581310 0.37906551 [88,] 0.58599462 0.8280108 0.41400538 [89,] 0.54161864 0.9167627 0.45838136 [90,] 0.49706769 0.9941354 0.50293231 [91,] 0.48576599 0.9715320 0.51423401 [92,] 0.47569490 0.9513898 0.52430510 [93,] 0.43104046 0.8620809 0.56895954 [94,] 0.45994584 0.9198917 0.54005416 [95,] 0.43080566 0.8616113 0.56919434 [96,] 0.46303114 0.9260623 0.53696886 [97,] 0.44939288 0.8987858 0.55060712 [98,] 0.41527551 0.8305510 0.58472449 [99,] 0.43589814 0.8717963 0.56410186 [100,] 0.39736262 0.7947252 0.60263738 [101,] 0.52612629 0.9477474 0.47387371 [102,] 0.50274547 0.9945091 0.49725453 [103,] 0.46181964 0.9236393 0.53818036 [104,] 0.57524564 0.8495087 0.42475436 [105,] 0.64700387 0.7059923 0.35299613 [106,] 0.60599261 0.7880148 0.39400739 [107,] 0.67908882 0.6418224 0.32091118 [108,] 0.67549976 0.6490005 0.32450024 [109,] 0.63581096 0.7283781 0.36418904 [110,] 0.74002351 0.5199530 0.25997649 [111,] 0.70683678 0.5863264 0.29316322 [112,] 0.66403525 0.6719295 0.33596475 [113,] 0.61885012 0.7622998 0.38114988 [114,] 0.57051946 0.8589611 0.42948054 [115,] 0.52848032 0.9430394 0.47151968 [116,] 0.52667461 0.9466508 0.47332539 [117,] 0.48927593 0.9785519 0.51072407 [118,] 0.44434316 0.8886863 0.55565684 [119,] 0.39644793 0.7928959 0.60355207 [120,] 0.34932881 0.6986576 0.65067119 [121,] 0.34394097 0.6878819 0.65605903 [122,] 0.33952058 0.6790412 0.66047942 [123,] 0.32257576 0.6451515 0.67742424 [124,] 0.48016456 0.9603291 0.51983544 [125,] 0.44786447 0.8957289 0.55213553 [126,] 0.40723023 0.8144605 0.59276977 [127,] 0.54816300 0.9036740 0.45183700 [128,] 0.48988838 0.9797768 0.51011162 [129,] 0.44445107 0.8889021 0.55554893 [130,] 0.39402957 0.7880591 0.60597043 [131,] 0.37728833 0.7545767 0.62271167 [132,] 0.39483619 0.7896724 0.60516381 [133,] 0.33346408 0.6669282 0.66653592 [134,] 0.35622265 0.7124453 0.64377735 [135,] 0.30521481 0.6104296 0.69478519 [136,] 0.25225245 0.5045049 0.74774755 [137,] 0.20258403 0.4051681 0.79741597 [138,] 0.18456553 0.3691311 0.81543447 [139,] 0.13962597 0.2792519 0.86037403 [140,] 0.11113032 0.2222606 0.88886968 [141,] 0.14346472 0.2869294 0.85653528 [142,] 0.17022965 0.3404593 0.82977035 [143,] 0.13353575 0.2670715 0.86646425 [144,] 0.09582826 0.1916565 0.90417174 [145,] 0.17384970 0.3476994 0.82615030 [146,] 0.20786341 0.4157268 0.79213659 [147,] 0.14225554 0.2845111 0.85774446 [148,] 0.18116865 0.3623373 0.81883135 [149,] 0.11539735 0.2307947 0.88460265 [150,] 0.23265024 0.4653005 0.76734976 [151,] 0.13761617 0.2752323 0.86238383 > postscript(file="/var/wessaorg/rcomp/tmp/10my21356015859.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/wessaorg/rcomp/tmp/2m1sf1356015859.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/wessaorg/rcomp/tmp/3m6w21356015859.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/wessaorg/rcomp/tmp/4s5491356015859.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/wessaorg/rcomp/tmp/5pqdm1356015859.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 = 162 Frequency = 1 1 2 3 4 5 6 0.03391477 3.50970329 -4.01450820 -2.30767285 1.87157100 4.05081485 7 8 9 10 11 12 -1.00098814 -0.29415279 0.88509106 0.71260724 2.54012342 4.54350344 13 14 15 16 17 18 -4.45311655 1.55026347 3.37777965 -0.26711267 -0.26373265 1.86032820 19 20 21 22 23 24 -0.78456412 1.57054356 3.57392357 -3.42269641 -0.94690789 -2.41593638 25 26 27 28 29 30 2.41157980 -5.58504018 1.59420367 -0.22655249 0.60096370 -3.04392862 31 32 33 34 35 36 1.78358756 -0.68544093 2.96621142 0.61786377 -0.02702855 3.20739830 37 38 39 40 41 42 -4.31681318 0.98311150 2.63476385 -1.36185614 0.64152388 1.99663156 43 44 45 46 47 48 0.94482858 -1.99660841 -1.99322839 -2.46225688 1.01353164 0.84104782 49 50 51 52 53 54 2.66856400 -0.97632832 1.67532403 0.03043171 -2.61446061 -2.31453592 55 56 57 58 59 60 -1.08010908 1.04395177 1.69560412 0.69898414 -2.12177201 -2.29425583 61 62 63 64 65 66 -5.58742048 -1.28749580 -3.28411579 0.07099190 0.72264424 -4.44983957 67 68 69 70 71 72 -3.62232339 -2.61894338 1.43961964 0.73954432 0.79810733 2.09803202 73 74 75 76 77 78 0.39795670 0.40133672 -1.24355560 -2.41603942 2.76320443 -1.23341556 79 80 81 82 83 84 1.29755596 -1.22665553 0.77672449 1.07664917 0.78348452 1.96272837 85 86 87 88 89 90 0.96610838 -0.20637544 1.14873225 -0.19961540 -1.19623539 -7.01699154 91 92 93 94 95 96 3.51397997 -1.36195918 0.81728467 -0.00347148 -0.64836380 1.82742472 97 98 99 100 101 102 -2.16919527 -0.16581525 2.83756476 1.19267244 2.84432479 -2.15229519 103 104 105 106 107 108 1.14762949 -2.96967133 0.85784485 -4.61118363 1.68874105 0.86798490 109 110 111 112 113 114 -4.12863508 -3.42179974 0.87812495 -3.11849504 -1.29097886 0.41585649 115 116 117 118 119 120 4.59510034 1.54329736 0.25013270 0.25351272 0.43275657 -0.09145492 121 122 123 124 125 126 -1.56048340 -0.08469489 1.44627663 0.92206514 1.10130899 -1.07117483 127 128 129 130 131 132 3.10806902 2.75972137 5.11482905 1.64580057 -1.05427475 -3.99571174 133 134 135 136 137 138 0.95248528 1.65932063 1.31097298 2.13848916 -2.50640316 0.14524919 139 140 141 142 143 144 -2.14791546 1.67960072 0.38643607 0.98290542 2.16214927 -0.18619838 145 146 147 148 149 150 0.99304546 3.05160848 1.64807783 -2.46922299 -1.99343448 -4.46246296 151 152 153 154 155 156 3.06850855 -0.80743060 2.02008559 -1.97653440 -4.62142672 0.08540863 157 158 159 160 161 162 -1.14225819 0.56457716 5.21622951 -0.95625431 -1.24941896 -0.42190278 > postscript(file="/var/wessaorg/rcomp/tmp/6hxhh1356015859.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 = 162 Frequency = 1 lag(myerror, k = 1) myerror 0 0.03391477 NA 1 3.50970329 0.03391477 2 -4.01450820 3.50970329 3 -2.30767285 -4.01450820 4 1.87157100 -2.30767285 5 4.05081485 1.87157100 6 -1.00098814 4.05081485 7 -0.29415279 -1.00098814 8 0.88509106 -0.29415279 9 0.71260724 0.88509106 10 2.54012342 0.71260724 11 4.54350344 2.54012342 12 -4.45311655 4.54350344 13 1.55026347 -4.45311655 14 3.37777965 1.55026347 15 -0.26711267 3.37777965 16 -0.26373265 -0.26711267 17 1.86032820 -0.26373265 18 -0.78456412 1.86032820 19 1.57054356 -0.78456412 20 3.57392357 1.57054356 21 -3.42269641 3.57392357 22 -0.94690789 -3.42269641 23 -2.41593638 -0.94690789 24 2.41157980 -2.41593638 25 -5.58504018 2.41157980 26 1.59420367 -5.58504018 27 -0.22655249 1.59420367 28 0.60096370 -0.22655249 29 -3.04392862 0.60096370 30 1.78358756 -3.04392862 31 -0.68544093 1.78358756 32 2.96621142 -0.68544093 33 0.61786377 2.96621142 34 -0.02702855 0.61786377 35 3.20739830 -0.02702855 36 -4.31681318 3.20739830 37 0.98311150 -4.31681318 38 2.63476385 0.98311150 39 -1.36185614 2.63476385 40 0.64152388 -1.36185614 41 1.99663156 0.64152388 42 0.94482858 1.99663156 43 -1.99660841 0.94482858 44 -1.99322839 -1.99660841 45 -2.46225688 -1.99322839 46 1.01353164 -2.46225688 47 0.84104782 1.01353164 48 2.66856400 0.84104782 49 -0.97632832 2.66856400 50 1.67532403 -0.97632832 51 0.03043171 1.67532403 52 -2.61446061 0.03043171 53 -2.31453592 -2.61446061 54 -1.08010908 -2.31453592 55 1.04395177 -1.08010908 56 1.69560412 1.04395177 57 0.69898414 1.69560412 58 -2.12177201 0.69898414 59 -2.29425583 -2.12177201 60 -5.58742048 -2.29425583 61 -1.28749580 -5.58742048 62 -3.28411579 -1.28749580 63 0.07099190 -3.28411579 64 0.72264424 0.07099190 65 -4.44983957 0.72264424 66 -3.62232339 -4.44983957 67 -2.61894338 -3.62232339 68 1.43961964 -2.61894338 69 0.73954432 1.43961964 70 0.79810733 0.73954432 71 2.09803202 0.79810733 72 0.39795670 2.09803202 73 0.40133672 0.39795670 74 -1.24355560 0.40133672 75 -2.41603942 -1.24355560 76 2.76320443 -2.41603942 77 -1.23341556 2.76320443 78 1.29755596 -1.23341556 79 -1.22665553 1.29755596 80 0.77672449 -1.22665553 81 1.07664917 0.77672449 82 0.78348452 1.07664917 83 1.96272837 0.78348452 84 0.96610838 1.96272837 85 -0.20637544 0.96610838 86 1.14873225 -0.20637544 87 -0.19961540 1.14873225 88 -1.19623539 -0.19961540 89 -7.01699154 -1.19623539 90 3.51397997 -7.01699154 91 -1.36195918 3.51397997 92 0.81728467 -1.36195918 93 -0.00347148 0.81728467 94 -0.64836380 -0.00347148 95 1.82742472 -0.64836380 96 -2.16919527 1.82742472 97 -0.16581525 -2.16919527 98 2.83756476 -0.16581525 99 1.19267244 2.83756476 100 2.84432479 1.19267244 101 -2.15229519 2.84432479 102 1.14762949 -2.15229519 103 -2.96967133 1.14762949 104 0.85784485 -2.96967133 105 -4.61118363 0.85784485 106 1.68874105 -4.61118363 107 0.86798490 1.68874105 108 -4.12863508 0.86798490 109 -3.42179974 -4.12863508 110 0.87812495 -3.42179974 111 -3.11849504 0.87812495 112 -1.29097886 -3.11849504 113 0.41585649 -1.29097886 114 4.59510034 0.41585649 115 1.54329736 4.59510034 116 0.25013270 1.54329736 117 0.25351272 0.25013270 118 0.43275657 0.25351272 119 -0.09145492 0.43275657 120 -1.56048340 -0.09145492 121 -0.08469489 -1.56048340 122 1.44627663 -0.08469489 123 0.92206514 1.44627663 124 1.10130899 0.92206514 125 -1.07117483 1.10130899 126 3.10806902 -1.07117483 127 2.75972137 3.10806902 128 5.11482905 2.75972137 129 1.64580057 5.11482905 130 -1.05427475 1.64580057 131 -3.99571174 -1.05427475 132 0.95248528 -3.99571174 133 1.65932063 0.95248528 134 1.31097298 1.65932063 135 2.13848916 1.31097298 136 -2.50640316 2.13848916 137 0.14524919 -2.50640316 138 -2.14791546 0.14524919 139 1.67960072 -2.14791546 140 0.38643607 1.67960072 141 0.98290542 0.38643607 142 2.16214927 0.98290542 143 -0.18619838 2.16214927 144 0.99304546 -0.18619838 145 3.05160848 0.99304546 146 1.64807783 3.05160848 147 -2.46922299 1.64807783 148 -1.99343448 -2.46922299 149 -4.46246296 -1.99343448 150 3.06850855 -4.46246296 151 -0.80743060 3.06850855 152 2.02008559 -0.80743060 153 -1.97653440 2.02008559 154 -4.62142672 -1.97653440 155 0.08540863 -4.62142672 156 -1.14225819 0.08540863 157 0.56457716 -1.14225819 158 5.21622951 0.56457716 159 -0.95625431 5.21622951 160 -1.24941896 -0.95625431 161 -0.42190278 -1.24941896 162 NA -0.42190278 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 3.50970329 0.03391477 [2,] -4.01450820 3.50970329 [3,] -2.30767285 -4.01450820 [4,] 1.87157100 -2.30767285 [5,] 4.05081485 1.87157100 [6,] -1.00098814 4.05081485 [7,] -0.29415279 -1.00098814 [8,] 0.88509106 -0.29415279 [9,] 0.71260724 0.88509106 [10,] 2.54012342 0.71260724 [11,] 4.54350344 2.54012342 [12,] -4.45311655 4.54350344 [13,] 1.55026347 -4.45311655 [14,] 3.37777965 1.55026347 [15,] -0.26711267 3.37777965 [16,] -0.26373265 -0.26711267 [17,] 1.86032820 -0.26373265 [18,] -0.78456412 1.86032820 [19,] 1.57054356 -0.78456412 [20,] 3.57392357 1.57054356 [21,] -3.42269641 3.57392357 [22,] -0.94690789 -3.42269641 [23,] -2.41593638 -0.94690789 [24,] 2.41157980 -2.41593638 [25,] -5.58504018 2.41157980 [26,] 1.59420367 -5.58504018 [27,] -0.22655249 1.59420367 [28,] 0.60096370 -0.22655249 [29,] -3.04392862 0.60096370 [30,] 1.78358756 -3.04392862 [31,] -0.68544093 1.78358756 [32,] 2.96621142 -0.68544093 [33,] 0.61786377 2.96621142 [34,] -0.02702855 0.61786377 [35,] 3.20739830 -0.02702855 [36,] -4.31681318 3.20739830 [37,] 0.98311150 -4.31681318 [38,] 2.63476385 0.98311150 [39,] -1.36185614 2.63476385 [40,] 0.64152388 -1.36185614 [41,] 1.99663156 0.64152388 [42,] 0.94482858 1.99663156 [43,] -1.99660841 0.94482858 [44,] -1.99322839 -1.99660841 [45,] -2.46225688 -1.99322839 [46,] 1.01353164 -2.46225688 [47,] 0.84104782 1.01353164 [48,] 2.66856400 0.84104782 [49,] -0.97632832 2.66856400 [50,] 1.67532403 -0.97632832 [51,] 0.03043171 1.67532403 [52,] -2.61446061 0.03043171 [53,] -2.31453592 -2.61446061 [54,] -1.08010908 -2.31453592 [55,] 1.04395177 -1.08010908 [56,] 1.69560412 1.04395177 [57,] 0.69898414 1.69560412 [58,] -2.12177201 0.69898414 [59,] -2.29425583 -2.12177201 [60,] -5.58742048 -2.29425583 [61,] -1.28749580 -5.58742048 [62,] -3.28411579 -1.28749580 [63,] 0.07099190 -3.28411579 [64,] 0.72264424 0.07099190 [65,] -4.44983957 0.72264424 [66,] -3.62232339 -4.44983957 [67,] -2.61894338 -3.62232339 [68,] 1.43961964 -2.61894338 [69,] 0.73954432 1.43961964 [70,] 0.79810733 0.73954432 [71,] 2.09803202 0.79810733 [72,] 0.39795670 2.09803202 [73,] 0.40133672 0.39795670 [74,] -1.24355560 0.40133672 [75,] -2.41603942 -1.24355560 [76,] 2.76320443 -2.41603942 [77,] -1.23341556 2.76320443 [78,] 1.29755596 -1.23341556 [79,] -1.22665553 1.29755596 [80,] 0.77672449 -1.22665553 [81,] 1.07664917 0.77672449 [82,] 0.78348452 1.07664917 [83,] 1.96272837 0.78348452 [84,] 0.96610838 1.96272837 [85,] -0.20637544 0.96610838 [86,] 1.14873225 -0.20637544 [87,] -0.19961540 1.14873225 [88,] -1.19623539 -0.19961540 [89,] -7.01699154 -1.19623539 [90,] 3.51397997 -7.01699154 [91,] -1.36195918 3.51397997 [92,] 0.81728467 -1.36195918 [93,] -0.00347148 0.81728467 [94,] -0.64836380 -0.00347148 [95,] 1.82742472 -0.64836380 [96,] -2.16919527 1.82742472 [97,] -0.16581525 -2.16919527 [98,] 2.83756476 -0.16581525 [99,] 1.19267244 2.83756476 [100,] 2.84432479 1.19267244 [101,] -2.15229519 2.84432479 [102,] 1.14762949 -2.15229519 [103,] -2.96967133 1.14762949 [104,] 0.85784485 -2.96967133 [105,] -4.61118363 0.85784485 [106,] 1.68874105 -4.61118363 [107,] 0.86798490 1.68874105 [108,] -4.12863508 0.86798490 [109,] -3.42179974 -4.12863508 [110,] 0.87812495 -3.42179974 [111,] -3.11849504 0.87812495 [112,] -1.29097886 -3.11849504 [113,] 0.41585649 -1.29097886 [114,] 4.59510034 0.41585649 [115,] 1.54329736 4.59510034 [116,] 0.25013270 1.54329736 [117,] 0.25351272 0.25013270 [118,] 0.43275657 0.25351272 [119,] -0.09145492 0.43275657 [120,] -1.56048340 -0.09145492 [121,] -0.08469489 -1.56048340 [122,] 1.44627663 -0.08469489 [123,] 0.92206514 1.44627663 [124,] 1.10130899 0.92206514 [125,] -1.07117483 1.10130899 [126,] 3.10806902 -1.07117483 [127,] 2.75972137 3.10806902 [128,] 5.11482905 2.75972137 [129,] 1.64580057 5.11482905 [130,] -1.05427475 1.64580057 [131,] -3.99571174 -1.05427475 [132,] 0.95248528 -3.99571174 [133,] 1.65932063 0.95248528 [134,] 1.31097298 1.65932063 [135,] 2.13848916 1.31097298 [136,] -2.50640316 2.13848916 [137,] 0.14524919 -2.50640316 [138,] -2.14791546 0.14524919 [139,] 1.67960072 -2.14791546 [140,] 0.38643607 1.67960072 [141,] 0.98290542 0.38643607 [142,] 2.16214927 0.98290542 [143,] -0.18619838 2.16214927 [144,] 0.99304546 -0.18619838 [145,] 3.05160848 0.99304546 [146,] 1.64807783 3.05160848 [147,] -2.46922299 1.64807783 [148,] -1.99343448 -2.46922299 [149,] -4.46246296 -1.99343448 [150,] 3.06850855 -4.46246296 [151,] -0.80743060 3.06850855 [152,] 2.02008559 -0.80743060 [153,] -1.97653440 2.02008559 [154,] -4.62142672 -1.97653440 [155,] 0.08540863 -4.62142672 [156,] -1.14225819 0.08540863 [157,] 0.56457716 -1.14225819 [158,] 5.21622951 0.56457716 [159,] -0.95625431 5.21622951 [160,] -1.24941896 -0.95625431 [161,] -0.42190278 -1.24941896 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 3.50970329 0.03391477 2 -4.01450820 3.50970329 3 -2.30767285 -4.01450820 4 1.87157100 -2.30767285 5 4.05081485 1.87157100 6 -1.00098814 4.05081485 7 -0.29415279 -1.00098814 8 0.88509106 -0.29415279 9 0.71260724 0.88509106 10 2.54012342 0.71260724 11 4.54350344 2.54012342 12 -4.45311655 4.54350344 13 1.55026347 -4.45311655 14 3.37777965 1.55026347 15 -0.26711267 3.37777965 16 -0.26373265 -0.26711267 17 1.86032820 -0.26373265 18 -0.78456412 1.86032820 19 1.57054356 -0.78456412 20 3.57392357 1.57054356 21 -3.42269641 3.57392357 22 -0.94690789 -3.42269641 23 -2.41593638 -0.94690789 24 2.41157980 -2.41593638 25 -5.58504018 2.41157980 26 1.59420367 -5.58504018 27 -0.22655249 1.59420367 28 0.60096370 -0.22655249 29 -3.04392862 0.60096370 30 1.78358756 -3.04392862 31 -0.68544093 1.78358756 32 2.96621142 -0.68544093 33 0.61786377 2.96621142 34 -0.02702855 0.61786377 35 3.20739830 -0.02702855 36 -4.31681318 3.20739830 37 0.98311150 -4.31681318 38 2.63476385 0.98311150 39 -1.36185614 2.63476385 40 0.64152388 -1.36185614 41 1.99663156 0.64152388 42 0.94482858 1.99663156 43 -1.99660841 0.94482858 44 -1.99322839 -1.99660841 45 -2.46225688 -1.99322839 46 1.01353164 -2.46225688 47 0.84104782 1.01353164 48 2.66856400 0.84104782 49 -0.97632832 2.66856400 50 1.67532403 -0.97632832 51 0.03043171 1.67532403 52 -2.61446061 0.03043171 53 -2.31453592 -2.61446061 54 -1.08010908 -2.31453592 55 1.04395177 -1.08010908 56 1.69560412 1.04395177 57 0.69898414 1.69560412 58 -2.12177201 0.69898414 59 -2.29425583 -2.12177201 60 -5.58742048 -2.29425583 61 -1.28749580 -5.58742048 62 -3.28411579 -1.28749580 63 0.07099190 -3.28411579 64 0.72264424 0.07099190 65 -4.44983957 0.72264424 66 -3.62232339 -4.44983957 67 -2.61894338 -3.62232339 68 1.43961964 -2.61894338 69 0.73954432 1.43961964 70 0.79810733 0.73954432 71 2.09803202 0.79810733 72 0.39795670 2.09803202 73 0.40133672 0.39795670 74 -1.24355560 0.40133672 75 -2.41603942 -1.24355560 76 2.76320443 -2.41603942 77 -1.23341556 2.76320443 78 1.29755596 -1.23341556 79 -1.22665553 1.29755596 80 0.77672449 -1.22665553 81 1.07664917 0.77672449 82 0.78348452 1.07664917 83 1.96272837 0.78348452 84 0.96610838 1.96272837 85 -0.20637544 0.96610838 86 1.14873225 -0.20637544 87 -0.19961540 1.14873225 88 -1.19623539 -0.19961540 89 -7.01699154 -1.19623539 90 3.51397997 -7.01699154 91 -1.36195918 3.51397997 92 0.81728467 -1.36195918 93 -0.00347148 0.81728467 94 -0.64836380 -0.00347148 95 1.82742472 -0.64836380 96 -2.16919527 1.82742472 97 -0.16581525 -2.16919527 98 2.83756476 -0.16581525 99 1.19267244 2.83756476 100 2.84432479 1.19267244 101 -2.15229519 2.84432479 102 1.14762949 -2.15229519 103 -2.96967133 1.14762949 104 0.85784485 -2.96967133 105 -4.61118363 0.85784485 106 1.68874105 -4.61118363 107 0.86798490 1.68874105 108 -4.12863508 0.86798490 109 -3.42179974 -4.12863508 110 0.87812495 -3.42179974 111 -3.11849504 0.87812495 112 -1.29097886 -3.11849504 113 0.41585649 -1.29097886 114 4.59510034 0.41585649 115 1.54329736 4.59510034 116 0.25013270 1.54329736 117 0.25351272 0.25013270 118 0.43275657 0.25351272 119 -0.09145492 0.43275657 120 -1.56048340 -0.09145492 121 -0.08469489 -1.56048340 122 1.44627663 -0.08469489 123 0.92206514 1.44627663 124 1.10130899 0.92206514 125 -1.07117483 1.10130899 126 3.10806902 -1.07117483 127 2.75972137 3.10806902 128 5.11482905 2.75972137 129 1.64580057 5.11482905 130 -1.05427475 1.64580057 131 -3.99571174 -1.05427475 132 0.95248528 -3.99571174 133 1.65932063 0.95248528 134 1.31097298 1.65932063 135 2.13848916 1.31097298 136 -2.50640316 2.13848916 137 0.14524919 -2.50640316 138 -2.14791546 0.14524919 139 1.67960072 -2.14791546 140 0.38643607 1.67960072 141 0.98290542 0.38643607 142 2.16214927 0.98290542 143 -0.18619838 2.16214927 144 0.99304546 -0.18619838 145 3.05160848 0.99304546 146 1.64807783 3.05160848 147 -2.46922299 1.64807783 148 -1.99343448 -2.46922299 149 -4.46246296 -1.99343448 150 3.06850855 -4.46246296 151 -0.80743060 3.06850855 152 2.02008559 -0.80743060 153 -1.97653440 2.02008559 154 -4.62142672 -1.97653440 155 0.08540863 -4.62142672 156 -1.14225819 0.08540863 157 0.56457716 -1.14225819 158 5.21622951 0.56457716 159 -0.95625431 5.21622951 160 -1.24941896 -0.95625431 161 -0.42190278 -1.24941896 > 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/wessaorg/rcomp/tmp/7vzro1356015859.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/wessaorg/rcomp/tmp/8bxdh1356015859.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/wessaorg/rcomp/tmp/98azm1356015859.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/wessaorg/rcomp/tmp/10w8331356015859.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11b9af1356015859.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/wessaorg/rcomp/tmp/12kf1f1356015859.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/wessaorg/rcomp/tmp/138jy01356015859.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/wessaorg/rcomp/tmp/149wzm1356015859.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/wessaorg/rcomp/tmp/15xi021356015859.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/wessaorg/rcomp/tmp/16fzly1356015859.tab") + } > > try(system("convert tmp/10my21356015859.ps tmp/10my21356015859.png",intern=TRUE)) character(0) > try(system("convert tmp/2m1sf1356015859.ps tmp/2m1sf1356015859.png",intern=TRUE)) character(0) > try(system("convert tmp/3m6w21356015859.ps tmp/3m6w21356015859.png",intern=TRUE)) character(0) > try(system("convert tmp/4s5491356015859.ps tmp/4s5491356015859.png",intern=TRUE)) character(0) > try(system("convert tmp/5pqdm1356015859.ps tmp/5pqdm1356015859.png",intern=TRUE)) character(0) > try(system("convert tmp/6hxhh1356015859.ps tmp/6hxhh1356015859.png",intern=TRUE)) character(0) > try(system("convert tmp/7vzro1356015859.ps tmp/7vzro1356015859.png",intern=TRUE)) character(0) > try(system("convert tmp/8bxdh1356015859.ps tmp/8bxdh1356015859.png",intern=TRUE)) character(0) > try(system("convert tmp/98azm1356015859.ps tmp/98azm1356015859.png",intern=TRUE)) character(0) > try(system("convert tmp/10w8331356015859.ps tmp/10w8331356015859.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.274 1.159 9.422