R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-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(41 + ,14 + ,39 + ,18 + ,30 + ,11 + ,31 + ,12 + ,34 + ,16 + ,35 + ,18 + ,39 + ,14 + ,34 + ,14 + ,36 + ,15 + ,37 + ,15 + ,38 + ,17 + ,36 + ,19 + ,38 + ,10 + ,39 + ,16 + ,33 + ,18 + ,32 + ,14 + ,36 + ,14 + ,38 + ,17 + ,39 + ,14 + ,32 + ,16 + ,32 + ,18 + ,31 + ,11 + ,39 + ,14 + ,37 + ,12 + ,39 + ,17 + ,41 + ,9 + ,36 + ,16 + ,33 + ,14 + ,33 + ,15 + ,34 + ,11 + ,31 + ,16 + ,27 + ,13 + ,37 + ,17 + ,34 + ,15 + ,34 + ,14 + ,32 + ,16 + ,29 + ,9 + ,36 + ,15 + ,29 + ,17 + ,35 + ,13 + ,37 + ,15 + ,34 + ,16 + ,38 + ,16 + ,35 + ,12 + ,38 + ,12 + ,37 + ,11 + ,38 + ,15 + ,33 + ,15 + ,36 + ,17 + ,38 + ,13 + ,32 + ,16 + ,32 + ,14 + ,32 + ,11 + ,34 + ,12 + ,32 + ,12 + ,37 + ,15 + ,39 + ,16 + ,29 + ,15 + ,37 + ,12 + ,35 + ,12 + ,30 + ,8 + ,38 + ,13 + ,34 + ,11 + ,31 + ,14 + ,34 + ,15 + ,35 + ,10 + ,36 + ,11 + ,30 + ,12 + ,39 + ,15 + ,35 + ,15 + ,38 + ,14 + ,31 + ,16 + ,34 + ,15 + ,38 + ,15 + ,34 + ,13 + ,39 + ,12 + ,37 + ,17 + ,34 + ,13 + ,28 + ,15 + ,37 + ,13 + ,33 + ,15 + ,37 + ,16 + ,35 + ,15 + ,37 + ,16 + ,32 + ,15 + ,33 + ,14 + ,38 + ,15 + ,33 + ,14 + ,29 + ,13 + ,33 + ,7 + ,31 + ,17 + ,36 + ,13 + ,35 + ,15 + ,32 + ,14 + ,29 + ,13 + ,39 + ,16 + ,37 + ,12 + ,35 + ,14 + ,37 + ,17 + ,32 + ,15 + ,38 + ,17 + ,37 + ,12 + ,36 + ,16 + ,32 + ,11 + ,33 + ,15 + ,40 + ,9 + ,38 + ,16 + ,41 + ,15 + ,36 + ,10 + ,43 + ,10 + ,30 + ,15 + ,31 + ,11 + ,32 + ,13 + ,32 + ,14 + ,37 + ,18 + ,37 + ,16 + ,33 + ,14 + ,34 + ,14 + ,33 + ,14 + ,38 + ,14 + ,33 + ,12 + ,31 + ,14 + ,38 + ,15 + ,37 + ,15 + ,33 + ,15 + ,31 + ,13 + ,39 + ,17 + ,44 + ,17 + ,33 + ,19 + ,35 + ,15 + ,32 + ,13 + ,28 + ,9 + ,40 + ,15 + ,27 + ,15 + ,37 + ,15 + ,32 + ,16 + ,28 + ,11 + ,34 + ,14 + ,30 + ,11 + ,35 + ,15 + ,31 + ,13 + ,32 + ,15 + ,30 + ,16 + ,30 + ,14 + ,31 + ,15 + ,40 + ,16 + ,32 + ,16 + ,36 + ,11 + ,32 + ,12 + ,35 + ,9 + ,38 + ,16 + ,42 + ,13 + ,34 + ,16 + ,35 + ,12 + ,35 + ,9 + ,33 + ,13 + ,36 + ,13 + ,32 + ,14 + ,33 + ,19 + ,34 + ,13 + ,32 + ,12 + ,34 + ,13) + ,dim=c(2 + ,162) + ,dimnames=list(c('Connected' + ,'Happiness') + ,1:162)) > y <- array(NA,dim=c(2,162),dimnames=list(c('Connected','Happiness'),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 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo > 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 Connected Happiness 1 41 14 2 39 18 3 30 11 4 31 12 5 34 16 6 35 18 7 39 14 8 34 14 9 36 15 10 37 15 11 38 17 12 36 19 13 38 10 14 39 16 15 33 18 16 32 14 17 36 14 18 38 17 19 39 14 20 32 16 21 32 18 22 31 11 23 39 14 24 37 12 25 39 17 26 41 9 27 36 16 28 33 14 29 33 15 30 34 11 31 31 16 32 27 13 33 37 17 34 34 15 35 34 14 36 32 16 37 29 9 38 36 15 39 29 17 40 35 13 41 37 15 42 34 16 43 38 16 44 35 12 45 38 12 46 37 11 47 38 15 48 33 15 49 36 17 50 38 13 51 32 16 52 32 14 53 32 11 54 34 12 55 32 12 56 37 15 57 39 16 58 29 15 59 37 12 60 35 12 61 30 8 62 38 13 63 34 11 64 31 14 65 34 15 66 35 10 67 36 11 68 30 12 69 39 15 70 35 15 71 38 14 72 31 16 73 34 15 74 38 15 75 34 13 76 39 12 77 37 17 78 34 13 79 28 15 80 37 13 81 33 15 82 37 16 83 35 15 84 37 16 85 32 15 86 33 14 87 38 15 88 33 14 89 29 13 90 33 7 91 31 17 92 36 13 93 35 15 94 32 14 95 29 13 96 39 16 97 37 12 98 35 14 99 37 17 100 32 15 101 38 17 102 37 12 103 36 16 104 32 11 105 33 15 106 40 9 107 38 16 108 41 15 109 36 10 110 43 10 111 30 15 112 31 11 113 32 13 114 32 14 115 37 18 116 37 16 117 33 14 118 34 14 119 33 14 120 38 14 121 33 12 122 31 14 123 38 15 124 37 15 125 33 15 126 31 13 127 39 17 128 44 17 129 33 19 130 35 15 131 32 13 132 28 9 133 40 15 134 27 15 135 37 15 136 32 16 137 28 11 138 34 14 139 30 11 140 35 15 141 31 13 142 32 15 143 30 16 144 30 14 145 31 15 146 40 16 147 32 16 148 36 11 149 32 12 150 35 9 151 38 16 152 42 13 153 34 16 154 35 12 155 35 9 156 33 13 157 36 13 158 32 14 159 33 19 160 34 13 161 32 12 162 34 13 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Happiness 31.731 0.206 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -7.8219 -2.6158 -0.0857 2.7221 9.2083 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 31.731 1.608 19.739 <2e-16 *** Happiness 0.206 0.113 1.824 0.0701 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.351 on 160 degrees of freedom Multiple R-squared: 0.02036, Adjusted R-squared: 0.01424 F-statistic: 3.326 on 1 and 160 DF, p-value: 0.07007 > 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.80223481 0.395530386 0.197765193 [2,] 0.77170591 0.456588179 0.228294089 [3,] 0.80085939 0.398281221 0.199140611 [4,] 0.71114599 0.577708026 0.288854013 [5,] 0.60672389 0.786552222 0.393276111 [6,] 0.51409287 0.971814264 0.485907132 [7,] 0.41679363 0.833587262 0.583206369 [8,] 0.37875805 0.757516099 0.621241950 [9,] 0.45473841 0.909476818 0.545261591 [10,] 0.42239523 0.844790458 0.577604771 [11,] 0.45605941 0.912118829 0.543940585 [12,] 0.46475043 0.929500858 0.535249571 [13,] 0.38889854 0.777797071 0.611101465 [14,] 0.33646913 0.672938259 0.663530870 [15,] 0.34601990 0.692039804 0.653980098 [16,] 0.38448031 0.768960628 0.615519686 [17,] 0.42605746 0.852114920 0.573942540 [18,] 0.44037157 0.880743135 0.559628432 [19,] 0.46093468 0.921869369 0.539065316 [20,] 0.42117638 0.842352761 0.578823619 [21,] 0.41013476 0.820269516 0.589865242 [22,] 0.55759820 0.884803606 0.442401803 [23,] 0.49629830 0.992596601 0.503701699 [24,] 0.47628654 0.952573075 0.523713462 [25,] 0.45515532 0.910310649 0.544844675 [26,] 0.40732332 0.814646634 0.592676683 [27,] 0.45992738 0.919854765 0.540072617 [28,] 0.72069694 0.558606124 0.279303062 [29,] 0.68113870 0.637722602 0.318861301 [30,] 0.63651167 0.726976663 0.363488331 [31,] 0.58873255 0.822534893 0.411267447 [32,] 0.58490469 0.830190621 0.415095310 [33,] 0.64637871 0.707242579 0.353621290 [34,] 0.59935604 0.801287928 0.400643964 [35,] 0.71819738 0.563605230 0.281802615 [36,] 0.67289556 0.654208879 0.327104440 [37,] 0.64231808 0.715363844 0.357681922 [38,] 0.59807378 0.803852440 0.401926220 [39,] 0.58361168 0.832776646 0.416388323 [40,] 0.53452825 0.930943508 0.465471754 [41,] 0.53851411 0.922971774 0.461485887 [42,] 0.51798892 0.964022161 0.482011081 [43,] 0.50635562 0.987288764 0.493644382 [44,] 0.47517906 0.950358127 0.524820936 [45,] 0.42790978 0.855819569 0.572090216 [46,] 0.42483109 0.849662174 0.575168913 [47,] 0.42012625 0.840252510 0.579873745 [48,] 0.40787250 0.815744992 0.592127504 [49,] 0.38583675 0.771673492 0.614163254 [50,] 0.34172793 0.683455860 0.658272070 [51,] 0.32186243 0.643724851 0.678137574 [52,] 0.29558921 0.591178420 0.704410790 [53,] 0.30962933 0.619258665 0.690370668 [54,] 0.40500474 0.810009487 0.594995256 [55,] 0.38673739 0.773474771 0.613262614 [56,] 0.34405177 0.688103539 0.655948231 [57,] 0.35176598 0.703531960 0.648234020 [58,] 0.35485333 0.709706667 0.645146666 [59,] 0.31266350 0.625327002 0.687336499 [60,] 0.32230896 0.644617927 0.677691036 [61,] 0.28474425 0.569488494 0.715255753 [62,] 0.25081413 0.501628258 0.749185871 [63,] 0.22652138 0.453042766 0.773478617 [64,] 0.24972571 0.499451417 0.750274292 [65,] 0.26845277 0.536905542 0.731547229 [66,] 0.23214564 0.464291285 0.767854358 [67,] 0.23131829 0.462636586 0.768681707 [68,] 0.24880207 0.497604139 0.751197930 [69,] 0.21640509 0.432810180 0.783594910 [70,] 0.21209722 0.424194433 0.787902784 [71,] 0.18136448 0.362728968 0.818635516 [72,] 0.21253091 0.425061818 0.787469091 [73,] 0.18924719 0.378494375 0.810752812 [74,] 0.16089057 0.321781138 0.839109431 [75,] 0.26379605 0.527592097 0.736203951 [76,] 0.24855635 0.497112698 0.751443651 [77,] 0.22420854 0.448417076 0.775791462 [78,] 0.20256285 0.405125697 0.797437151 [79,] 0.17234932 0.344698643 0.827650678 [80,] 0.15412684 0.308253671 0.845873164 [81,] 0.14642412 0.292848248 0.853575876 [82,] 0.12750294 0.255005878 0.872497061 [83,] 0.12502737 0.250054749 0.874972626 [84,] 0.10805569 0.216111383 0.891944309 [85,] 0.14459075 0.289181493 0.855409254 [86,] 0.12054438 0.241088758 0.879455621 [87,] 0.13364131 0.267282622 0.866358689 [88,] 0.11563344 0.231266886 0.884366557 [89,] 0.09503135 0.190062704 0.904968648 [90,] 0.08731679 0.174633574 0.912683213 [91,] 0.11799729 0.235994575 0.882002713 [92,] 0.12640503 0.252810057 0.873594971 [93,] 0.11921636 0.238432730 0.880783635 [94,] 0.09822121 0.196442428 0.901778786 [95,] 0.08460219 0.169204389 0.915397805 [96,] 0.07874950 0.157499009 0.921250496 [97,] 0.07340335 0.146806701 0.926596650 [98,] 0.06864552 0.137291037 0.931354481 [99,] 0.05583169 0.111663377 0.944168312 [100,] 0.04748687 0.094973749 0.952513125 [101,] 0.03954350 0.079087000 0.960456500 [102,] 0.07440065 0.148801306 0.925599347 [103,] 0.07083629 0.141672590 0.929163705 [104,] 0.11796881 0.235937617 0.882031191 [105,] 0.10854533 0.217090653 0.891454674 [106,] 0.37130828 0.742616566 0.628691717 [107,] 0.41306427 0.826128545 0.586935727 [108,] 0.39016515 0.780330301 0.609834850 [109,] 0.36016049 0.720320972 0.639839514 [110,] 0.33604218 0.672084355 0.663957822 [111,] 0.29892789 0.597855778 0.701072111 [112,] 0.27229964 0.544599279 0.727700360 [113,] 0.23811837 0.476236748 0.761881626 [114,] 0.20159044 0.403180881 0.798409560 [115,] 0.17263680 0.345273593 0.827363203 [116,] 0.17967153 0.359343059 0.820328471 [117,] 0.14993504 0.299870084 0.850064958 [118,] 0.14642667 0.292853333 0.853573333 [119,] 0.14670044 0.293400880 0.853299560 [120,] 0.13333366 0.266667314 0.866666343 [121,] 0.11145968 0.222919355 0.888540322 [122,] 0.10370570 0.207411407 0.896294296 [123,] 0.11093329 0.221866581 0.889066709 [124,] 0.36595271 0.731905426 0.634047287 [125,] 0.32981831 0.659636616 0.670181692 [126,] 0.28510152 0.570203035 0.714898483 [127,] 0.24982777 0.499655549 0.750172226 [128,] 0.31064230 0.621284609 0.689357696 [129,] 0.43868127 0.877362533 0.561318733 [130,] 0.63323179 0.733536418 0.366768209 [131,] 0.62853766 0.742924679 0.371462340 [132,] 0.58944404 0.821111914 0.410555957 [133,] 0.71415038 0.571699236 0.285849618 [134,] 0.65555053 0.688898940 0.344449470 [135,] 0.69281117 0.614377654 0.307188827 [136,] 0.63747051 0.725058986 0.362529493 [137,] 0.63268654 0.734626916 0.367313458 [138,] 0.59041035 0.819179293 0.409589647 [139,] 0.63281092 0.734378165 0.367189082 [140,] 0.69708363 0.605832732 0.302916366 [141,] 0.72163691 0.556726175 0.278363088 [142,] 0.83987103 0.320257941 0.160128971 [143,] 0.81913926 0.361721478 0.180860739 [144,] 0.76590350 0.468193001 0.234096500 [145,] 0.74959029 0.500819416 0.250409708 [146,] 0.66768027 0.664639454 0.332319727 [147,] 0.69403739 0.611925216 0.305962608 [148,] 0.99663836 0.006723285 0.003361643 [149,] 0.99179680 0.016406406 0.008203203 [150,] 0.98307127 0.033857454 0.016928727 [151,] 0.96255205 0.074895893 0.037447947 [152,] 0.91330727 0.173385468 0.086692734 [153,] 0.95044465 0.099110709 0.049555355 > postscript(file="/var/wessaorg/rcomp/tmp/1p7571324680951.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/27i751324680951.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/35wgw1324680951.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/4kath1324680951.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/5rczn1324680951.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 6.384173894 3.560060060 -3.997740731 -3.203769190 -1.027883023 -0.439939940 7 8 9 10 11 12 4.384173894 -0.615826106 1.178145435 2.178145435 2.766088518 0.354031602 13 14 15 16 17 18 4.208287727 3.972116977 -2.439939940 -2.615826106 1.384173894 2.766088518 19 20 21 22 23 24 4.384173894 -3.027883023 -3.439939940 -2.997740731 4.384173894 2.796230810 25 26 27 28 29 30 3.766088518 7.414316185 0.972116977 -1.615826106 -1.821854565 0.002259269 31 32 33 34 35 36 -4.027883023 -7.409797648 1.766088518 -0.821854565 -0.615826106 -3.027883023 37 38 39 40 41 42 -4.585683815 1.178145435 -6.233911482 0.590202352 2.178145435 -1.027883023 43 44 45 46 47 48 2.972116977 0.796230810 3.796230810 3.002259269 3.178145435 -1.821854565 49 50 51 52 53 54 0.766088518 3.590202352 -3.027883023 -2.615826106 -1.997740731 -0.203769190 55 56 57 58 59 60 -2.203769190 2.178145435 3.972116977 -5.821854565 2.796230810 0.796230810 61 62 63 64 65 66 -3.379655356 3.590202352 0.002259269 -3.615826106 -0.821854565 1.208287727 67 68 69 70 71 72 2.002259269 -4.203769190 4.178145435 0.178145435 3.384173894 -4.027883023 73 74 75 76 77 78 -0.821854565 3.178145435 -0.409797648 4.796230810 1.766088518 -0.409797648 79 80 81 82 83 84 -6.821854565 2.590202352 -1.821854565 1.972116977 0.178145435 1.972116977 85 86 87 88 89 90 -2.821854565 -1.615826106 3.178145435 -1.615826106 -5.409797648 -0.173626898 91 92 93 94 95 96 -4.233911482 1.590202352 0.178145435 -2.615826106 -5.409797648 3.972116977 97 98 99 100 101 102 2.796230810 0.384173894 1.766088518 -2.821854565 2.766088518 2.796230810 103 104 105 106 107 108 0.972116977 -1.997740731 -1.821854565 6.414316185 2.972116977 6.178145435 109 110 111 112 113 114 2.208287727 9.208287727 -4.821854565 -2.997740731 -2.409797648 -2.615826106 115 116 117 118 119 120 1.560060060 1.972116977 -1.615826106 -0.615826106 -1.615826106 3.384173894 121 122 123 124 125 126 -1.203769190 -3.615826106 3.178145435 2.178145435 -1.821854565 -3.409797648 127 128 129 130 131 132 3.766088518 8.766088518 -2.645968398 0.178145435 -2.409797648 -5.585683815 133 134 135 136 137 138 5.178145435 -7.821854565 2.178145435 -3.027883023 -5.997740731 -0.615826106 139 140 141 142 143 144 -3.997740731 0.178145435 -3.409797648 -2.821854565 -5.027883023 -4.615826106 145 146 147 148 149 150 -3.821854565 4.972116977 -3.027883023 2.002259269 -2.203769190 1.414316185 151 152 153 154 155 156 2.972116977 7.590202352 -1.027883023 0.796230810 1.414316185 -1.409797648 157 158 159 160 161 162 1.590202352 -2.615826106 -2.645968398 -0.409797648 -2.203769190 -0.409797648 > postscript(file="/var/wessaorg/rcomp/tmp/6yxie1324680951.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 6.384173894 NA 1 3.560060060 6.384173894 2 -3.997740731 3.560060060 3 -3.203769190 -3.997740731 4 -1.027883023 -3.203769190 5 -0.439939940 -1.027883023 6 4.384173894 -0.439939940 7 -0.615826106 4.384173894 8 1.178145435 -0.615826106 9 2.178145435 1.178145435 10 2.766088518 2.178145435 11 0.354031602 2.766088518 12 4.208287727 0.354031602 13 3.972116977 4.208287727 14 -2.439939940 3.972116977 15 -2.615826106 -2.439939940 16 1.384173894 -2.615826106 17 2.766088518 1.384173894 18 4.384173894 2.766088518 19 -3.027883023 4.384173894 20 -3.439939940 -3.027883023 21 -2.997740731 -3.439939940 22 4.384173894 -2.997740731 23 2.796230810 4.384173894 24 3.766088518 2.796230810 25 7.414316185 3.766088518 26 0.972116977 7.414316185 27 -1.615826106 0.972116977 28 -1.821854565 -1.615826106 29 0.002259269 -1.821854565 30 -4.027883023 0.002259269 31 -7.409797648 -4.027883023 32 1.766088518 -7.409797648 33 -0.821854565 1.766088518 34 -0.615826106 -0.821854565 35 -3.027883023 -0.615826106 36 -4.585683815 -3.027883023 37 1.178145435 -4.585683815 38 -6.233911482 1.178145435 39 0.590202352 -6.233911482 40 2.178145435 0.590202352 41 -1.027883023 2.178145435 42 2.972116977 -1.027883023 43 0.796230810 2.972116977 44 3.796230810 0.796230810 45 3.002259269 3.796230810 46 3.178145435 3.002259269 47 -1.821854565 3.178145435 48 0.766088518 -1.821854565 49 3.590202352 0.766088518 50 -3.027883023 3.590202352 51 -2.615826106 -3.027883023 52 -1.997740731 -2.615826106 53 -0.203769190 -1.997740731 54 -2.203769190 -0.203769190 55 2.178145435 -2.203769190 56 3.972116977 2.178145435 57 -5.821854565 3.972116977 58 2.796230810 -5.821854565 59 0.796230810 2.796230810 60 -3.379655356 0.796230810 61 3.590202352 -3.379655356 62 0.002259269 3.590202352 63 -3.615826106 0.002259269 64 -0.821854565 -3.615826106 65 1.208287727 -0.821854565 66 2.002259269 1.208287727 67 -4.203769190 2.002259269 68 4.178145435 -4.203769190 69 0.178145435 4.178145435 70 3.384173894 0.178145435 71 -4.027883023 3.384173894 72 -0.821854565 -4.027883023 73 3.178145435 -0.821854565 74 -0.409797648 3.178145435 75 4.796230810 -0.409797648 76 1.766088518 4.796230810 77 -0.409797648 1.766088518 78 -6.821854565 -0.409797648 79 2.590202352 -6.821854565 80 -1.821854565 2.590202352 81 1.972116977 -1.821854565 82 0.178145435 1.972116977 83 1.972116977 0.178145435 84 -2.821854565 1.972116977 85 -1.615826106 -2.821854565 86 3.178145435 -1.615826106 87 -1.615826106 3.178145435 88 -5.409797648 -1.615826106 89 -0.173626898 -5.409797648 90 -4.233911482 -0.173626898 91 1.590202352 -4.233911482 92 0.178145435 1.590202352 93 -2.615826106 0.178145435 94 -5.409797648 -2.615826106 95 3.972116977 -5.409797648 96 2.796230810 3.972116977 97 0.384173894 2.796230810 98 1.766088518 0.384173894 99 -2.821854565 1.766088518 100 2.766088518 -2.821854565 101 2.796230810 2.766088518 102 0.972116977 2.796230810 103 -1.997740731 0.972116977 104 -1.821854565 -1.997740731 105 6.414316185 -1.821854565 106 2.972116977 6.414316185 107 6.178145435 2.972116977 108 2.208287727 6.178145435 109 9.208287727 2.208287727 110 -4.821854565 9.208287727 111 -2.997740731 -4.821854565 112 -2.409797648 -2.997740731 113 -2.615826106 -2.409797648 114 1.560060060 -2.615826106 115 1.972116977 1.560060060 116 -1.615826106 1.972116977 117 -0.615826106 -1.615826106 118 -1.615826106 -0.615826106 119 3.384173894 -1.615826106 120 -1.203769190 3.384173894 121 -3.615826106 -1.203769190 122 3.178145435 -3.615826106 123 2.178145435 3.178145435 124 -1.821854565 2.178145435 125 -3.409797648 -1.821854565 126 3.766088518 -3.409797648 127 8.766088518 3.766088518 128 -2.645968398 8.766088518 129 0.178145435 -2.645968398 130 -2.409797648 0.178145435 131 -5.585683815 -2.409797648 132 5.178145435 -5.585683815 133 -7.821854565 5.178145435 134 2.178145435 -7.821854565 135 -3.027883023 2.178145435 136 -5.997740731 -3.027883023 137 -0.615826106 -5.997740731 138 -3.997740731 -0.615826106 139 0.178145435 -3.997740731 140 -3.409797648 0.178145435 141 -2.821854565 -3.409797648 142 -5.027883023 -2.821854565 143 -4.615826106 -5.027883023 144 -3.821854565 -4.615826106 145 4.972116977 -3.821854565 146 -3.027883023 4.972116977 147 2.002259269 -3.027883023 148 -2.203769190 2.002259269 149 1.414316185 -2.203769190 150 2.972116977 1.414316185 151 7.590202352 2.972116977 152 -1.027883023 7.590202352 153 0.796230810 -1.027883023 154 1.414316185 0.796230810 155 -1.409797648 1.414316185 156 1.590202352 -1.409797648 157 -2.615826106 1.590202352 158 -2.645968398 -2.615826106 159 -0.409797648 -2.645968398 160 -2.203769190 -0.409797648 161 -0.409797648 -2.203769190 162 NA -0.409797648 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 3.560060060 6.384173894 [2,] -3.997740731 3.560060060 [3,] -3.203769190 -3.997740731 [4,] -1.027883023 -3.203769190 [5,] -0.439939940 -1.027883023 [6,] 4.384173894 -0.439939940 [7,] -0.615826106 4.384173894 [8,] 1.178145435 -0.615826106 [9,] 2.178145435 1.178145435 [10,] 2.766088518 2.178145435 [11,] 0.354031602 2.766088518 [12,] 4.208287727 0.354031602 [13,] 3.972116977 4.208287727 [14,] -2.439939940 3.972116977 [15,] -2.615826106 -2.439939940 [16,] 1.384173894 -2.615826106 [17,] 2.766088518 1.384173894 [18,] 4.384173894 2.766088518 [19,] -3.027883023 4.384173894 [20,] -3.439939940 -3.027883023 [21,] -2.997740731 -3.439939940 [22,] 4.384173894 -2.997740731 [23,] 2.796230810 4.384173894 [24,] 3.766088518 2.796230810 [25,] 7.414316185 3.766088518 [26,] 0.972116977 7.414316185 [27,] -1.615826106 0.972116977 [28,] -1.821854565 -1.615826106 [29,] 0.002259269 -1.821854565 [30,] -4.027883023 0.002259269 [31,] -7.409797648 -4.027883023 [32,] 1.766088518 -7.409797648 [33,] -0.821854565 1.766088518 [34,] -0.615826106 -0.821854565 [35,] -3.027883023 -0.615826106 [36,] -4.585683815 -3.027883023 [37,] 1.178145435 -4.585683815 [38,] -6.233911482 1.178145435 [39,] 0.590202352 -6.233911482 [40,] 2.178145435 0.590202352 [41,] -1.027883023 2.178145435 [42,] 2.972116977 -1.027883023 [43,] 0.796230810 2.972116977 [44,] 3.796230810 0.796230810 [45,] 3.002259269 3.796230810 [46,] 3.178145435 3.002259269 [47,] -1.821854565 3.178145435 [48,] 0.766088518 -1.821854565 [49,] 3.590202352 0.766088518 [50,] -3.027883023 3.590202352 [51,] -2.615826106 -3.027883023 [52,] -1.997740731 -2.615826106 [53,] -0.203769190 -1.997740731 [54,] -2.203769190 -0.203769190 [55,] 2.178145435 -2.203769190 [56,] 3.972116977 2.178145435 [57,] -5.821854565 3.972116977 [58,] 2.796230810 -5.821854565 [59,] 0.796230810 2.796230810 [60,] -3.379655356 0.796230810 [61,] 3.590202352 -3.379655356 [62,] 0.002259269 3.590202352 [63,] -3.615826106 0.002259269 [64,] -0.821854565 -3.615826106 [65,] 1.208287727 -0.821854565 [66,] 2.002259269 1.208287727 [67,] -4.203769190 2.002259269 [68,] 4.178145435 -4.203769190 [69,] 0.178145435 4.178145435 [70,] 3.384173894 0.178145435 [71,] -4.027883023 3.384173894 [72,] -0.821854565 -4.027883023 [73,] 3.178145435 -0.821854565 [74,] -0.409797648 3.178145435 [75,] 4.796230810 -0.409797648 [76,] 1.766088518 4.796230810 [77,] -0.409797648 1.766088518 [78,] -6.821854565 -0.409797648 [79,] 2.590202352 -6.821854565 [80,] -1.821854565 2.590202352 [81,] 1.972116977 -1.821854565 [82,] 0.178145435 1.972116977 [83,] 1.972116977 0.178145435 [84,] -2.821854565 1.972116977 [85,] -1.615826106 -2.821854565 [86,] 3.178145435 -1.615826106 [87,] -1.615826106 3.178145435 [88,] -5.409797648 -1.615826106 [89,] -0.173626898 -5.409797648 [90,] -4.233911482 -0.173626898 [91,] 1.590202352 -4.233911482 [92,] 0.178145435 1.590202352 [93,] -2.615826106 0.178145435 [94,] -5.409797648 -2.615826106 [95,] 3.972116977 -5.409797648 [96,] 2.796230810 3.972116977 [97,] 0.384173894 2.796230810 [98,] 1.766088518 0.384173894 [99,] -2.821854565 1.766088518 [100,] 2.766088518 -2.821854565 [101,] 2.796230810 2.766088518 [102,] 0.972116977 2.796230810 [103,] -1.997740731 0.972116977 [104,] -1.821854565 -1.997740731 [105,] 6.414316185 -1.821854565 [106,] 2.972116977 6.414316185 [107,] 6.178145435 2.972116977 [108,] 2.208287727 6.178145435 [109,] 9.208287727 2.208287727 [110,] -4.821854565 9.208287727 [111,] -2.997740731 -4.821854565 [112,] -2.409797648 -2.997740731 [113,] -2.615826106 -2.409797648 [114,] 1.560060060 -2.615826106 [115,] 1.972116977 1.560060060 [116,] -1.615826106 1.972116977 [117,] -0.615826106 -1.615826106 [118,] -1.615826106 -0.615826106 [119,] 3.384173894 -1.615826106 [120,] -1.203769190 3.384173894 [121,] -3.615826106 -1.203769190 [122,] 3.178145435 -3.615826106 [123,] 2.178145435 3.178145435 [124,] -1.821854565 2.178145435 [125,] -3.409797648 -1.821854565 [126,] 3.766088518 -3.409797648 [127,] 8.766088518 3.766088518 [128,] -2.645968398 8.766088518 [129,] 0.178145435 -2.645968398 [130,] -2.409797648 0.178145435 [131,] -5.585683815 -2.409797648 [132,] 5.178145435 -5.585683815 [133,] -7.821854565 5.178145435 [134,] 2.178145435 -7.821854565 [135,] -3.027883023 2.178145435 [136,] -5.997740731 -3.027883023 [137,] -0.615826106 -5.997740731 [138,] -3.997740731 -0.615826106 [139,] 0.178145435 -3.997740731 [140,] -3.409797648 0.178145435 [141,] -2.821854565 -3.409797648 [142,] -5.027883023 -2.821854565 [143,] -4.615826106 -5.027883023 [144,] -3.821854565 -4.615826106 [145,] 4.972116977 -3.821854565 [146,] -3.027883023 4.972116977 [147,] 2.002259269 -3.027883023 [148,] -2.203769190 2.002259269 [149,] 1.414316185 -2.203769190 [150,] 2.972116977 1.414316185 [151,] 7.590202352 2.972116977 [152,] -1.027883023 7.590202352 [153,] 0.796230810 -1.027883023 [154,] 1.414316185 0.796230810 [155,] -1.409797648 1.414316185 [156,] 1.590202352 -1.409797648 [157,] -2.615826106 1.590202352 [158,] -2.645968398 -2.615826106 [159,] -0.409797648 -2.645968398 [160,] -2.203769190 -0.409797648 [161,] -0.409797648 -2.203769190 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 3.560060060 6.384173894 2 -3.997740731 3.560060060 3 -3.203769190 -3.997740731 4 -1.027883023 -3.203769190 5 -0.439939940 -1.027883023 6 4.384173894 -0.439939940 7 -0.615826106 4.384173894 8 1.178145435 -0.615826106 9 2.178145435 1.178145435 10 2.766088518 2.178145435 11 0.354031602 2.766088518 12 4.208287727 0.354031602 13 3.972116977 4.208287727 14 -2.439939940 3.972116977 15 -2.615826106 -2.439939940 16 1.384173894 -2.615826106 17 2.766088518 1.384173894 18 4.384173894 2.766088518 19 -3.027883023 4.384173894 20 -3.439939940 -3.027883023 21 -2.997740731 -3.439939940 22 4.384173894 -2.997740731 23 2.796230810 4.384173894 24 3.766088518 2.796230810 25 7.414316185 3.766088518 26 0.972116977 7.414316185 27 -1.615826106 0.972116977 28 -1.821854565 -1.615826106 29 0.002259269 -1.821854565 30 -4.027883023 0.002259269 31 -7.409797648 -4.027883023 32 1.766088518 -7.409797648 33 -0.821854565 1.766088518 34 -0.615826106 -0.821854565 35 -3.027883023 -0.615826106 36 -4.585683815 -3.027883023 37 1.178145435 -4.585683815 38 -6.233911482 1.178145435 39 0.590202352 -6.233911482 40 2.178145435 0.590202352 41 -1.027883023 2.178145435 42 2.972116977 -1.027883023 43 0.796230810 2.972116977 44 3.796230810 0.796230810 45 3.002259269 3.796230810 46 3.178145435 3.002259269 47 -1.821854565 3.178145435 48 0.766088518 -1.821854565 49 3.590202352 0.766088518 50 -3.027883023 3.590202352 51 -2.615826106 -3.027883023 52 -1.997740731 -2.615826106 53 -0.203769190 -1.997740731 54 -2.203769190 -0.203769190 55 2.178145435 -2.203769190 56 3.972116977 2.178145435 57 -5.821854565 3.972116977 58 2.796230810 -5.821854565 59 0.796230810 2.796230810 60 -3.379655356 0.796230810 61 3.590202352 -3.379655356 62 0.002259269 3.590202352 63 -3.615826106 0.002259269 64 -0.821854565 -3.615826106 65 1.208287727 -0.821854565 66 2.002259269 1.208287727 67 -4.203769190 2.002259269 68 4.178145435 -4.203769190 69 0.178145435 4.178145435 70 3.384173894 0.178145435 71 -4.027883023 3.384173894 72 -0.821854565 -4.027883023 73 3.178145435 -0.821854565 74 -0.409797648 3.178145435 75 4.796230810 -0.409797648 76 1.766088518 4.796230810 77 -0.409797648 1.766088518 78 -6.821854565 -0.409797648 79 2.590202352 -6.821854565 80 -1.821854565 2.590202352 81 1.972116977 -1.821854565 82 0.178145435 1.972116977 83 1.972116977 0.178145435 84 -2.821854565 1.972116977 85 -1.615826106 -2.821854565 86 3.178145435 -1.615826106 87 -1.615826106 3.178145435 88 -5.409797648 -1.615826106 89 -0.173626898 -5.409797648 90 -4.233911482 -0.173626898 91 1.590202352 -4.233911482 92 0.178145435 1.590202352 93 -2.615826106 0.178145435 94 -5.409797648 -2.615826106 95 3.972116977 -5.409797648 96 2.796230810 3.972116977 97 0.384173894 2.796230810 98 1.766088518 0.384173894 99 -2.821854565 1.766088518 100 2.766088518 -2.821854565 101 2.796230810 2.766088518 102 0.972116977 2.796230810 103 -1.997740731 0.972116977 104 -1.821854565 -1.997740731 105 6.414316185 -1.821854565 106 2.972116977 6.414316185 107 6.178145435 2.972116977 108 2.208287727 6.178145435 109 9.208287727 2.208287727 110 -4.821854565 9.208287727 111 -2.997740731 -4.821854565 112 -2.409797648 -2.997740731 113 -2.615826106 -2.409797648 114 1.560060060 -2.615826106 115 1.972116977 1.560060060 116 -1.615826106 1.972116977 117 -0.615826106 -1.615826106 118 -1.615826106 -0.615826106 119 3.384173894 -1.615826106 120 -1.203769190 3.384173894 121 -3.615826106 -1.203769190 122 3.178145435 -3.615826106 123 2.178145435 3.178145435 124 -1.821854565 2.178145435 125 -3.409797648 -1.821854565 126 3.766088518 -3.409797648 127 8.766088518 3.766088518 128 -2.645968398 8.766088518 129 0.178145435 -2.645968398 130 -2.409797648 0.178145435 131 -5.585683815 -2.409797648 132 5.178145435 -5.585683815 133 -7.821854565 5.178145435 134 2.178145435 -7.821854565 135 -3.027883023 2.178145435 136 -5.997740731 -3.027883023 137 -0.615826106 -5.997740731 138 -3.997740731 -0.615826106 139 0.178145435 -3.997740731 140 -3.409797648 0.178145435 141 -2.821854565 -3.409797648 142 -5.027883023 -2.821854565 143 -4.615826106 -5.027883023 144 -3.821854565 -4.615826106 145 4.972116977 -3.821854565 146 -3.027883023 4.972116977 147 2.002259269 -3.027883023 148 -2.203769190 2.002259269 149 1.414316185 -2.203769190 150 2.972116977 1.414316185 151 7.590202352 2.972116977 152 -1.027883023 7.590202352 153 0.796230810 -1.027883023 154 1.414316185 0.796230810 155 -1.409797648 1.414316185 156 1.590202352 -1.409797648 157 -2.615826106 1.590202352 158 -2.645968398 -2.615826106 159 -0.409797648 -2.645968398 160 -2.203769190 -0.409797648 161 -0.409797648 -2.203769190 > 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/7aoj61324680951.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/8vrek1324680951.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/9zjs61324680951.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/1010c61324680951.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/11xs3h1324680951.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/122xzt1324680951.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/139zh81324680951.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/14x0n71324680951.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/15p6dk1324680951.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/16yr5x1324680951.tab") + } > > try(system("convert tmp/1p7571324680951.ps tmp/1p7571324680951.png",intern=TRUE)) character(0) > try(system("convert tmp/27i751324680951.ps tmp/27i751324680951.png",intern=TRUE)) character(0) > try(system("convert tmp/35wgw1324680951.ps tmp/35wgw1324680951.png",intern=TRUE)) character(0) > try(system("convert tmp/4kath1324680951.ps tmp/4kath1324680951.png",intern=TRUE)) character(0) > try(system("convert tmp/5rczn1324680951.ps tmp/5rczn1324680951.png",intern=TRUE)) character(0) > try(system("convert tmp/6yxie1324680951.ps tmp/6yxie1324680951.png",intern=TRUE)) character(0) > try(system("convert tmp/7aoj61324680951.ps tmp/7aoj61324680951.png",intern=TRUE)) character(0) > try(system("convert tmp/8vrek1324680951.ps tmp/8vrek1324680951.png",intern=TRUE)) character(0) > try(system("convert tmp/9zjs61324680951.ps tmp/9zjs61324680951.png",intern=TRUE)) character(0) > try(system("convert tmp/1010c61324680951.ps tmp/1010c61324680951.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.948 0.816 5.799