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(14 + ,12 + ,18 + ,11 + ,11 + ,14 + ,12 + ,12 + ,16 + ,21 + ,18 + ,12 + ,14 + ,22 + ,14 + ,11 + ,15 + ,10 + ,15 + ,13 + ,17 + ,10 + ,19 + ,8 + ,10 + ,15 + ,16 + ,14 + ,18 + ,10 + ,14 + ,14 + ,14 + ,14 + ,17 + ,11 + ,14 + ,10 + ,16 + ,13 + ,18 + ,7 + ,11 + ,14 + ,14 + ,12 + ,12 + ,14 + ,17 + ,11 + ,9 + ,9 + ,16 + ,11 + ,14 + ,15 + ,15 + ,14 + ,11 + ,13 + ,16 + ,9 + ,13 + ,15 + ,17 + ,10 + ,15 + ,11 + ,14 + ,13 + ,16 + ,8 + ,9 + ,20 + ,15 + ,12 + ,17 + ,10 + ,13 + ,10 + ,15 + ,9 + ,16 + ,14 + ,16 + ,8 + ,12 + ,14 + ,12 + ,11 + ,11 + ,13 + ,15 + ,9 + ,15 + ,11 + ,17 + ,15 + ,13 + ,11 + ,16 + ,10 + ,14 + ,14 + ,11 + ,18 + ,12 + ,14 + ,12 + ,11 + ,15 + ,12 + ,16 + ,13 + ,15 + ,9 + ,12 + ,10 + ,12 + ,15 + ,8 + ,20 + ,13 + ,12 + ,11 + ,12 + ,14 + ,14 + ,15 + ,13 + ,10 + ,11 + ,11 + ,17 + ,12 + ,12 + ,15 + ,13 + ,15 + ,14 + ,14 + ,13 + ,16 + ,15 + ,15 + ,13 + ,15 + ,10 + ,13 + ,11 + ,12 + ,19 + ,17 + ,13 + ,13 + ,17 + ,15 + ,13 + ,13 + ,9 + ,15 + ,11 + ,16 + ,10 + ,15 + ,9 + ,16 + ,12 + ,15 + ,12 + ,14 + ,13 + ,15 + ,13 + ,14 + ,12 + ,13 + ,15 + ,7 + ,22 + ,17 + ,13 + ,13 + ,15 + ,15 + ,13 + ,14 + ,15 + ,13 + ,10 + ,16 + ,11 + ,12 + ,16 + ,14 + ,11 + ,17 + ,11 + ,15 + ,10 + ,17 + ,10 + ,12 + ,16 + ,16 + ,12 + ,11 + ,11 + ,15 + ,16 + ,9 + ,19 + ,16 + ,11 + ,15 + ,16 + ,10 + ,15 + ,10 + ,24 + ,15 + ,14 + ,11 + ,15 + ,13 + ,11 + ,14 + ,15 + ,18 + ,12 + ,16 + ,10 + ,14 + ,14 + ,14 + ,13 + ,14 + ,9 + ,14 + ,15 + ,12 + ,15 + ,14 + ,14 + ,15 + ,11 + ,15 + ,8 + ,15 + ,11 + ,13 + ,11 + ,17 + ,8 + ,17 + ,10 + ,19 + ,11 + ,15 + ,13 + ,13 + ,11 + ,9 + ,20 + ,15 + ,10 + ,15 + ,15 + ,15 + ,12 + ,16 + ,14 + ,11 + ,23 + ,14 + ,14 + ,11 + ,16 + ,15 + ,11 + ,13 + ,12 + ,15 + ,10 + ,16 + ,14 + ,14 + ,12 + ,15 + ,12 + ,16 + ,11 + ,16 + ,12 + ,11 + ,13 + ,12 + ,11 + ,9 + ,19 + ,16 + ,12 + ,13 + ,17 + ,16 + ,9 + ,12 + ,12 + ,9 + ,19 + ,13 + ,18 + ,13 + ,15 + ,14 + ,14 + ,19 + ,11 + ,13 + ,9 + ,12 + ,18 + ,13 + ,16) + ,dim=c(2 + ,162) + ,dimnames=list(c('Happiness' + ,'Depression') + ,1:162)) > y <- array(NA,dim=c(2,162),dimnames=list(c('Happiness','Depression'),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 = '1' > par3 <- 'Linear Trend' > par2 <- 'Do not include Seasonal Dummies' > par1 <- '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, 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 Happiness Depression t 1 14 12 1 2 18 11 2 3 11 14 3 4 12 12 4 5 16 21 5 6 18 12 6 7 14 22 7 8 14 11 8 9 15 10 9 10 15 13 10 11 17 10 11 12 19 8 12 13 10 15 13 14 16 14 14 15 18 10 15 16 14 14 16 17 14 14 17 18 17 11 18 19 14 10 19 20 16 13 20 21 18 7 21 22 11 14 22 23 14 12 23 24 12 14 24 25 17 11 25 26 9 9 26 27 16 11 27 28 14 15 28 29 15 14 29 30 11 13 30 31 16 9 31 32 13 15 32 33 17 10 33 34 15 11 34 35 14 13 35 36 16 8 36 37 9 20 37 38 15 12 38 39 17 10 39 40 13 10 40 41 15 9 41 42 16 14 42 43 16 8 43 44 12 14 44 45 12 11 45 46 11 13 46 47 15 9 47 48 15 11 48 49 17 15 49 50 13 11 50 51 16 10 51 52 14 14 52 53 11 18 53 54 12 14 54 55 12 11 55 56 15 12 56 57 16 13 57 58 15 9 58 59 12 10 59 60 12 15 60 61 8 20 61 62 13 12 62 63 11 12 63 64 14 14 64 65 15 13 65 66 10 11 66 67 11 17 67 68 12 12 68 69 15 13 69 70 15 14 70 71 14 13 71 72 16 15 72 73 15 13 73 74 15 10 74 75 13 11 75 76 12 19 76 77 17 13 77 78 13 17 78 79 15 13 79 80 13 9 80 81 15 11 81 82 16 10 82 83 15 9 83 84 16 12 84 85 15 12 85 86 14 13 86 87 15 13 87 88 14 12 88 89 13 15 89 90 7 22 90 91 17 13 91 92 13 15 92 93 15 13 93 94 14 15 94 95 13 10 95 96 16 11 96 97 12 16 97 98 14 11 98 99 17 11 99 100 15 10 100 101 17 10 101 102 12 16 102 103 16 12 103 104 11 11 104 105 15 16 105 106 9 19 106 107 16 11 107 108 15 16 108 109 10 15 109 110 10 24 110 111 15 14 111 112 11 15 112 113 13 11 113 114 14 15 114 115 18 12 115 116 16 10 116 117 14 14 117 118 14 13 118 119 14 9 119 120 14 15 120 121 12 15 121 122 14 14 122 123 15 11 123 124 15 8 124 125 15 11 125 126 13 11 126 127 17 8 127 128 17 10 128 129 19 11 129 130 15 13 130 131 13 11 131 132 9 20 132 133 15 10 133 134 15 15 134 135 15 12 135 136 16 14 136 137 11 23 137 138 14 14 138 139 11 16 139 140 15 11 140 141 13 12 141 142 15 10 142 143 16 14 143 144 14 12 144 145 15 12 145 146 16 11 146 147 16 12 147 148 11 13 148 149 12 11 149 150 9 19 150 151 16 12 151 152 13 17 152 153 16 9 153 154 12 12 154 155 9 19 155 156 13 18 156 157 13 15 157 158 14 14 158 159 19 11 159 160 13 9 160 161 12 18 161 162 13 16 162 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Depression t 19.31588 -0.39887 -0.00154 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.6860 -1.4334 0.2758 1.1930 5.0681 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 19.315879 0.679856 28.412 < 2e-16 *** Depression -0.398871 0.049503 -8.057 1.74e-13 *** t -0.001540 0.003341 -0.461 0.645 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.972 on 159 degrees of freedom Multiple R-squared: 0.2971, Adjusted R-squared: 0.2883 F-statistic: 33.61 on 2 and 159 DF, p-value: 6.703e-13 > 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.9878179 0.024364171 0.012182086 [2,] 0.9787991 0.042401798 0.021200899 [3,] 0.9699729 0.060054265 0.030027133 [4,] 0.9451414 0.109717174 0.054858587 [5,] 0.9096927 0.180614618 0.090307309 [6,] 0.8842852 0.231429573 0.115714786 [7,] 0.8927725 0.214455049 0.107227524 [8,] 0.9858388 0.028322469 0.014161234 [9,] 0.9806428 0.038714445 0.019357222 [10,] 0.9786910 0.042617991 0.021308995 [11,] 0.9716880 0.056623908 0.028311954 [12,] 0.9612365 0.077527083 0.038763542 [13,] 0.9515806 0.096838844 0.048419422 [14,] 0.9479521 0.104095779 0.052047889 [15,] 0.9341347 0.131730625 0.065865313 [16,] 0.9190938 0.161812437 0.080906218 [17,] 0.9567940 0.086411919 0.043205959 [18,] 0.9426165 0.114767022 0.057383511 [19,] 0.9384110 0.123178093 0.061589046 [20,] 0.9401179 0.119764245 0.059882122 [21,] 0.9962389 0.007522218 0.003761109 [22,] 0.9956522 0.008695656 0.004347828 [23,] 0.9939228 0.012154398 0.006077199 [24,] 0.9926640 0.014672032 0.007336016 [25,] 0.9941598 0.011680326 0.005840163 [26,] 0.9923907 0.015218581 0.007609291 [27,] 0.9889604 0.022079267 0.011039634 [28,] 0.9901004 0.019799287 0.009899643 [29,] 0.9863208 0.027358403 0.013679202 [30,] 0.9809849 0.038030191 0.019015096 [31,] 0.9746133 0.050773464 0.025386732 [32,] 0.9747976 0.050404727 0.025202363 [33,] 0.9688931 0.062213842 0.031106921 [34,] 0.9710497 0.057900657 0.028950328 [35,] 0.9682008 0.063598313 0.031799156 [36,] 0.9579271 0.084145783 0.042072892 [37,] 0.9672562 0.065487641 0.032743820 [38,] 0.9576001 0.084799836 0.042399918 [39,] 0.9496838 0.100632373 0.050316187 [40,] 0.9523157 0.095368556 0.047684278 [41,] 0.9565551 0.086889858 0.043444929 [42,] 0.9446479 0.110704216 0.055352108 [43,] 0.9333783 0.133243353 0.066621676 [44,] 0.9738501 0.052299781 0.026149891 [45,] 0.9689571 0.062085874 0.031042937 [46,] 0.9644353 0.071129468 0.035564734 [47,] 0.9559995 0.088001053 0.044000527 [48,] 0.9451372 0.109725676 0.054862838 [49,] 0.9349835 0.130032962 0.065016481 [50,] 0.9377066 0.124586858 0.062293429 [51,] 0.9286817 0.142636638 0.071318319 [52,] 0.9387437 0.122512538 0.061256269 [53,] 0.9236908 0.152618338 0.076309169 [54,] 0.9351821 0.129635899 0.064817950 [55,] 0.9211099 0.157780103 0.078890051 [56,] 0.9339721 0.132055844 0.066027922 [57,] 0.9215461 0.156907738 0.078453869 [58,] 0.9377762 0.124447605 0.062223802 [59,] 0.9289205 0.142159091 0.071079546 [60,] 0.9256319 0.148736212 0.074368106 [61,] 0.9701151 0.059769729 0.029884864 [62,] 0.9643642 0.071271639 0.035635819 [63,] 0.9660122 0.067975506 0.033987753 [64,] 0.9648910 0.070217964 0.035108982 [65,] 0.9659482 0.068103686 0.034051843 [66,] 0.9587983 0.082403483 0.041201741 [67,] 0.9739867 0.052026576 0.026013288 [68,] 0.9710852 0.057829634 0.028914817 [69,] 0.9642572 0.071485630 0.035742815 [70,] 0.9619102 0.076179642 0.038089821 [71,] 0.9530574 0.093885215 0.046942607 [72,] 0.9710688 0.057862393 0.028931196 [73,] 0.9645724 0.070855267 0.035427633 [74,] 0.9596362 0.080727557 0.040363779 [75,] 0.9657553 0.068489409 0.034244704 [76,] 0.9578270 0.084346085 0.042173043 [77,] 0.9510706 0.097858712 0.048929356 [78,] 0.9414468 0.117106392 0.058553196 [79,] 0.9395572 0.120885587 0.060442794 [80,] 0.9276448 0.144710350 0.072355175 [81,] 0.9111984 0.177603127 0.088801563 [82,] 0.8988386 0.202322701 0.101161351 [83,] 0.8784706 0.243058882 0.121529441 [84,] 0.8539031 0.292193706 0.146096853 [85,] 0.8940549 0.211890207 0.105945104 [86,] 0.9231187 0.153762579 0.076881289 [87,] 0.9053375 0.189324948 0.094662474 [88,] 0.8916979 0.216604113 0.108302056 [89,] 0.8742071 0.251585733 0.125792866 [90,] 0.8811225 0.237754961 0.118877481 [91,] 0.8674089 0.265182254 0.132591127 [92,] 0.8445026 0.310994808 0.155497404 [93,] 0.8218328 0.356334479 0.178167240 [94,] 0.8304992 0.339001634 0.169500817 [95,] 0.8006831 0.398633732 0.199316866 [96,] 0.7958139 0.408372257 0.204186128 [97,] 0.7652394 0.469521172 0.234760586 [98,] 0.7543691 0.491261737 0.245630869 [99,] 0.8497727 0.300454527 0.150227263 [100,] 0.8589647 0.282070652 0.141035326 [101,] 0.8768217 0.246356527 0.123178263 [102,] 0.8595936 0.280812738 0.140406369 [103,] 0.8685536 0.262892762 0.131446381 [104,] 0.9105896 0.178820836 0.089410418 [105,] 0.8902699 0.219460153 0.109730077 [106,] 0.8782225 0.243555011 0.121777505 [107,] 0.8882140 0.223572088 0.111786044 [108,] 0.8938394 0.212321146 0.106160573 [109,] 0.8715610 0.256877991 0.128438995 [110,] 0.9220004 0.155999215 0.077999608 [111,] 0.9040850 0.191829957 0.095914978 [112,] 0.8808453 0.238309339 0.119154670 [113,] 0.8526128 0.294774403 0.147387201 [114,] 0.8507386 0.298522876 0.149261438 [115,] 0.8227055 0.354589089 0.177294545 [116,] 0.8029438 0.394112415 0.197056207 [117,] 0.7640635 0.471873075 0.235936538 [118,] 0.7209202 0.558159647 0.279079823 [119,] 0.7023395 0.595320986 0.297660493 [120,] 0.6548378 0.690324420 0.345162210 [121,] 0.6793121 0.641375789 0.320687895 [122,] 0.6323915 0.735216980 0.367608490 [123,] 0.6000945 0.799810924 0.399905462 [124,] 0.7540593 0.491881388 0.245940694 [125,] 0.7181609 0.563678273 0.281839136 [126,] 0.7179030 0.564194070 0.282097035 [127,] 0.7375389 0.524922248 0.262461124 [128,] 0.6914470 0.617106017 0.308553008 [129,] 0.6686251 0.662749876 0.331374938 [130,] 0.6111182 0.777763609 0.388881805 [131,] 0.6396288 0.720742499 0.360371249 [132,] 0.6259533 0.748093371 0.374046686 [133,] 0.5752790 0.849442043 0.424721022 [134,] 0.5323490 0.935302097 0.467651049 [135,] 0.4650834 0.930166766 0.534916617 [136,] 0.4223134 0.844626743 0.577686629 [137,] 0.3551894 0.710378711 0.644810644 [138,] 0.4165179 0.833035862 0.583482069 [139,] 0.3443697 0.688739400 0.655630300 [140,] 0.2958642 0.591728462 0.704135769 [141,] 0.2864953 0.572990551 0.713504725 [142,] 0.3638150 0.727630089 0.636184955 [143,] 0.3335146 0.667029180 0.666485410 [144,] 0.3389389 0.677877732 0.661061134 [145,] 0.3271067 0.654213497 0.672893252 [146,] 0.2993501 0.598700193 0.700649904 [147,] 0.2508746 0.501749284 0.749125358 [148,] 0.1978141 0.395628102 0.802185949 [149,] 0.1614444 0.322888803 0.838555598 [150,] 0.2044901 0.408980166 0.795509917 [151,] 0.1149921 0.229984263 0.885007868 > postscript(file="/var/wessaorg/rcomp/tmp/1qs0k1355689100.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/2kkqg1355689100.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/3hgnv1355689100.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/43sye1355689100.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/58d341355689100.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.527891604 3.074778118 -2.727069946 -2.523270778 5.068104481 3.479809772 7 8 9 10 11 12 3.470055585 -0.915980232 -0.313310511 0.884841426 1.689770040 2.893569207 13 14 15 16 17 18 -3.312796641 2.289873080 2.695931140 0.292953630 0.294493905 2.099422519 19 20 21 22 23 24 -1.297907760 1.900244177 1.508561129 -2.697804719 -0.494005552 -1.694724169 25 26 27 28 29 30 2.110204444 -6.685996388 1.113284995 0.710307485 1.312977206 -3.084353073 31 32 33 34 35 36 0.321704987 -0.283531415 1.723656091 0.124066920 -0.076651697 -0.069464191 37 38 39 40 41 42 -2.281477271 0.529098574 1.732897742 -2.265561983 -0.662892262 2.333000782 43 44 45 46 47 48 -0.058682266 -1.663918668 -2.858990054 -3.059708671 -0.653650611 0.145630771 49 50 51 52 53 54 3.742653261 -1.851288679 0.751381043 0.348403533 -1.054573977 -1.648515917 55 56 57 58 59 60 -2.843587303 0.556823526 1.957234354 -0.636707586 -3.236296757 -1.240403713 61 62 63 64 65 66 -3.244510669 -1.433934824 -3.432394549 0.366886834 0.969556555 -4.826644277 67 68 69 70 71 72 -1.431880680 -2.424693173 0.975717655 1.376128484 -0.021201794 2.778079588 73 74 75 76 77 78 0.981878756 -0.213192631 -1.812781802 0.379722904 2.988039856 0.585062346 79 80 81 82 83 84 0.991120406 -2.602821534 0.196459849 0.799129570 -0.598200709 1.599951228 85 86 87 88 89 90 0.601491503 0.001902332 1.003442607 -0.393887672 -0.195735736 -3.402101584 91 92 93 94 95 96 3.009603707 -0.191114910 1.012684257 0.811965640 -2.180846854 1.219563975 97 98 99 100 101 102 -0.784542981 -0.777355475 2.224184800 -0.173145479 1.828394796 -0.776841606 103 104 105 106 107 108 1.629216454 -3.768113825 2.227779219 -2.574068844 1.236507001 2.232400045 109 110 111 112 113 114 -3.164930234 0.426445025 1.439279762 -2.160309409 -1.754251349 0.842771141 115 116 117 118 119 120 3.647699755 0.851498923 0.448521413 0.051191134 -1.542750806 0.852012792 121 122 123 124 125 126 -1.146446933 0.456222788 0.261151402 -0.933919984 0.264231952 -1.734227773 127 128 129 130 131 132 1.070700841 1.869982223 4.270393052 1.069674435 -1.726526397 -2.135151138 133 134 135 136 137 138 -0.122316401 1.873576643 0.678505257 2.477786639 1.069161898 0.480867189 139 140 141 142 143 144 -1.719851428 0.287336078 -1.312253093 -0.108453925 2.488568565 -0.307632268 145 146 147 148 149 150 0.693908007 1.296577729 1.696988558 -2.902600614 -2.698801446 -2.506296741 151 152 153 154 155 156 1.703149658 0.699042702 0.509618547 -2.292229517 -2.498595365 1.104074356 157 158 159 160 161 162 -0.090997030 0.511672691 4.316601305 -2.479599528 0.111775731 0.315574899 > postscript(file="/var/wessaorg/rcomp/tmp/6a7b01355689100.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.527891604 NA 1 3.074778118 -0.527891604 2 -2.727069946 3.074778118 3 -2.523270778 -2.727069946 4 5.068104481 -2.523270778 5 3.479809772 5.068104481 6 3.470055585 3.479809772 7 -0.915980232 3.470055585 8 -0.313310511 -0.915980232 9 0.884841426 -0.313310511 10 1.689770040 0.884841426 11 2.893569207 1.689770040 12 -3.312796641 2.893569207 13 2.289873080 -3.312796641 14 2.695931140 2.289873080 15 0.292953630 2.695931140 16 0.294493905 0.292953630 17 2.099422519 0.294493905 18 -1.297907760 2.099422519 19 1.900244177 -1.297907760 20 1.508561129 1.900244177 21 -2.697804719 1.508561129 22 -0.494005552 -2.697804719 23 -1.694724169 -0.494005552 24 2.110204444 -1.694724169 25 -6.685996388 2.110204444 26 1.113284995 -6.685996388 27 0.710307485 1.113284995 28 1.312977206 0.710307485 29 -3.084353073 1.312977206 30 0.321704987 -3.084353073 31 -0.283531415 0.321704987 32 1.723656091 -0.283531415 33 0.124066920 1.723656091 34 -0.076651697 0.124066920 35 -0.069464191 -0.076651697 36 -2.281477271 -0.069464191 37 0.529098574 -2.281477271 38 1.732897742 0.529098574 39 -2.265561983 1.732897742 40 -0.662892262 -2.265561983 41 2.333000782 -0.662892262 42 -0.058682266 2.333000782 43 -1.663918668 -0.058682266 44 -2.858990054 -1.663918668 45 -3.059708671 -2.858990054 46 -0.653650611 -3.059708671 47 0.145630771 -0.653650611 48 3.742653261 0.145630771 49 -1.851288679 3.742653261 50 0.751381043 -1.851288679 51 0.348403533 0.751381043 52 -1.054573977 0.348403533 53 -1.648515917 -1.054573977 54 -2.843587303 -1.648515917 55 0.556823526 -2.843587303 56 1.957234354 0.556823526 57 -0.636707586 1.957234354 58 -3.236296757 -0.636707586 59 -1.240403713 -3.236296757 60 -3.244510669 -1.240403713 61 -1.433934824 -3.244510669 62 -3.432394549 -1.433934824 63 0.366886834 -3.432394549 64 0.969556555 0.366886834 65 -4.826644277 0.969556555 66 -1.431880680 -4.826644277 67 -2.424693173 -1.431880680 68 0.975717655 -2.424693173 69 1.376128484 0.975717655 70 -0.021201794 1.376128484 71 2.778079588 -0.021201794 72 0.981878756 2.778079588 73 -0.213192631 0.981878756 74 -1.812781802 -0.213192631 75 0.379722904 -1.812781802 76 2.988039856 0.379722904 77 0.585062346 2.988039856 78 0.991120406 0.585062346 79 -2.602821534 0.991120406 80 0.196459849 -2.602821534 81 0.799129570 0.196459849 82 -0.598200709 0.799129570 83 1.599951228 -0.598200709 84 0.601491503 1.599951228 85 0.001902332 0.601491503 86 1.003442607 0.001902332 87 -0.393887672 1.003442607 88 -0.195735736 -0.393887672 89 -3.402101584 -0.195735736 90 3.009603707 -3.402101584 91 -0.191114910 3.009603707 92 1.012684257 -0.191114910 93 0.811965640 1.012684257 94 -2.180846854 0.811965640 95 1.219563975 -2.180846854 96 -0.784542981 1.219563975 97 -0.777355475 -0.784542981 98 2.224184800 -0.777355475 99 -0.173145479 2.224184800 100 1.828394796 -0.173145479 101 -0.776841606 1.828394796 102 1.629216454 -0.776841606 103 -3.768113825 1.629216454 104 2.227779219 -3.768113825 105 -2.574068844 2.227779219 106 1.236507001 -2.574068844 107 2.232400045 1.236507001 108 -3.164930234 2.232400045 109 0.426445025 -3.164930234 110 1.439279762 0.426445025 111 -2.160309409 1.439279762 112 -1.754251349 -2.160309409 113 0.842771141 -1.754251349 114 3.647699755 0.842771141 115 0.851498923 3.647699755 116 0.448521413 0.851498923 117 0.051191134 0.448521413 118 -1.542750806 0.051191134 119 0.852012792 -1.542750806 120 -1.146446933 0.852012792 121 0.456222788 -1.146446933 122 0.261151402 0.456222788 123 -0.933919984 0.261151402 124 0.264231952 -0.933919984 125 -1.734227773 0.264231952 126 1.070700841 -1.734227773 127 1.869982223 1.070700841 128 4.270393052 1.869982223 129 1.069674435 4.270393052 130 -1.726526397 1.069674435 131 -2.135151138 -1.726526397 132 -0.122316401 -2.135151138 133 1.873576643 -0.122316401 134 0.678505257 1.873576643 135 2.477786639 0.678505257 136 1.069161898 2.477786639 137 0.480867189 1.069161898 138 -1.719851428 0.480867189 139 0.287336078 -1.719851428 140 -1.312253093 0.287336078 141 -0.108453925 -1.312253093 142 2.488568565 -0.108453925 143 -0.307632268 2.488568565 144 0.693908007 -0.307632268 145 1.296577729 0.693908007 146 1.696988558 1.296577729 147 -2.902600614 1.696988558 148 -2.698801446 -2.902600614 149 -2.506296741 -2.698801446 150 1.703149658 -2.506296741 151 0.699042702 1.703149658 152 0.509618547 0.699042702 153 -2.292229517 0.509618547 154 -2.498595365 -2.292229517 155 1.104074356 -2.498595365 156 -0.090997030 1.104074356 157 0.511672691 -0.090997030 158 4.316601305 0.511672691 159 -2.479599528 4.316601305 160 0.111775731 -2.479599528 161 0.315574899 0.111775731 162 NA 0.315574899 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 3.074778118 -0.527891604 [2,] -2.727069946 3.074778118 [3,] -2.523270778 -2.727069946 [4,] 5.068104481 -2.523270778 [5,] 3.479809772 5.068104481 [6,] 3.470055585 3.479809772 [7,] -0.915980232 3.470055585 [8,] -0.313310511 -0.915980232 [9,] 0.884841426 -0.313310511 [10,] 1.689770040 0.884841426 [11,] 2.893569207 1.689770040 [12,] -3.312796641 2.893569207 [13,] 2.289873080 -3.312796641 [14,] 2.695931140 2.289873080 [15,] 0.292953630 2.695931140 [16,] 0.294493905 0.292953630 [17,] 2.099422519 0.294493905 [18,] -1.297907760 2.099422519 [19,] 1.900244177 -1.297907760 [20,] 1.508561129 1.900244177 [21,] -2.697804719 1.508561129 [22,] -0.494005552 -2.697804719 [23,] -1.694724169 -0.494005552 [24,] 2.110204444 -1.694724169 [25,] -6.685996388 2.110204444 [26,] 1.113284995 -6.685996388 [27,] 0.710307485 1.113284995 [28,] 1.312977206 0.710307485 [29,] -3.084353073 1.312977206 [30,] 0.321704987 -3.084353073 [31,] -0.283531415 0.321704987 [32,] 1.723656091 -0.283531415 [33,] 0.124066920 1.723656091 [34,] -0.076651697 0.124066920 [35,] -0.069464191 -0.076651697 [36,] -2.281477271 -0.069464191 [37,] 0.529098574 -2.281477271 [38,] 1.732897742 0.529098574 [39,] -2.265561983 1.732897742 [40,] -0.662892262 -2.265561983 [41,] 2.333000782 -0.662892262 [42,] -0.058682266 2.333000782 [43,] -1.663918668 -0.058682266 [44,] -2.858990054 -1.663918668 [45,] -3.059708671 -2.858990054 [46,] -0.653650611 -3.059708671 [47,] 0.145630771 -0.653650611 [48,] 3.742653261 0.145630771 [49,] -1.851288679 3.742653261 [50,] 0.751381043 -1.851288679 [51,] 0.348403533 0.751381043 [52,] -1.054573977 0.348403533 [53,] -1.648515917 -1.054573977 [54,] -2.843587303 -1.648515917 [55,] 0.556823526 -2.843587303 [56,] 1.957234354 0.556823526 [57,] -0.636707586 1.957234354 [58,] -3.236296757 -0.636707586 [59,] -1.240403713 -3.236296757 [60,] -3.244510669 -1.240403713 [61,] -1.433934824 -3.244510669 [62,] -3.432394549 -1.433934824 [63,] 0.366886834 -3.432394549 [64,] 0.969556555 0.366886834 [65,] -4.826644277 0.969556555 [66,] -1.431880680 -4.826644277 [67,] -2.424693173 -1.431880680 [68,] 0.975717655 -2.424693173 [69,] 1.376128484 0.975717655 [70,] -0.021201794 1.376128484 [71,] 2.778079588 -0.021201794 [72,] 0.981878756 2.778079588 [73,] -0.213192631 0.981878756 [74,] -1.812781802 -0.213192631 [75,] 0.379722904 -1.812781802 [76,] 2.988039856 0.379722904 [77,] 0.585062346 2.988039856 [78,] 0.991120406 0.585062346 [79,] -2.602821534 0.991120406 [80,] 0.196459849 -2.602821534 [81,] 0.799129570 0.196459849 [82,] -0.598200709 0.799129570 [83,] 1.599951228 -0.598200709 [84,] 0.601491503 1.599951228 [85,] 0.001902332 0.601491503 [86,] 1.003442607 0.001902332 [87,] -0.393887672 1.003442607 [88,] -0.195735736 -0.393887672 [89,] -3.402101584 -0.195735736 [90,] 3.009603707 -3.402101584 [91,] -0.191114910 3.009603707 [92,] 1.012684257 -0.191114910 [93,] 0.811965640 1.012684257 [94,] -2.180846854 0.811965640 [95,] 1.219563975 -2.180846854 [96,] -0.784542981 1.219563975 [97,] -0.777355475 -0.784542981 [98,] 2.224184800 -0.777355475 [99,] -0.173145479 2.224184800 [100,] 1.828394796 -0.173145479 [101,] -0.776841606 1.828394796 [102,] 1.629216454 -0.776841606 [103,] -3.768113825 1.629216454 [104,] 2.227779219 -3.768113825 [105,] -2.574068844 2.227779219 [106,] 1.236507001 -2.574068844 [107,] 2.232400045 1.236507001 [108,] -3.164930234 2.232400045 [109,] 0.426445025 -3.164930234 [110,] 1.439279762 0.426445025 [111,] -2.160309409 1.439279762 [112,] -1.754251349 -2.160309409 [113,] 0.842771141 -1.754251349 [114,] 3.647699755 0.842771141 [115,] 0.851498923 3.647699755 [116,] 0.448521413 0.851498923 [117,] 0.051191134 0.448521413 [118,] -1.542750806 0.051191134 [119,] 0.852012792 -1.542750806 [120,] -1.146446933 0.852012792 [121,] 0.456222788 -1.146446933 [122,] 0.261151402 0.456222788 [123,] -0.933919984 0.261151402 [124,] 0.264231952 -0.933919984 [125,] -1.734227773 0.264231952 [126,] 1.070700841 -1.734227773 [127,] 1.869982223 1.070700841 [128,] 4.270393052 1.869982223 [129,] 1.069674435 4.270393052 [130,] -1.726526397 1.069674435 [131,] -2.135151138 -1.726526397 [132,] -0.122316401 -2.135151138 [133,] 1.873576643 -0.122316401 [134,] 0.678505257 1.873576643 [135,] 2.477786639 0.678505257 [136,] 1.069161898 2.477786639 [137,] 0.480867189 1.069161898 [138,] -1.719851428 0.480867189 [139,] 0.287336078 -1.719851428 [140,] -1.312253093 0.287336078 [141,] -0.108453925 -1.312253093 [142,] 2.488568565 -0.108453925 [143,] -0.307632268 2.488568565 [144,] 0.693908007 -0.307632268 [145,] 1.296577729 0.693908007 [146,] 1.696988558 1.296577729 [147,] -2.902600614 1.696988558 [148,] -2.698801446 -2.902600614 [149,] -2.506296741 -2.698801446 [150,] 1.703149658 -2.506296741 [151,] 0.699042702 1.703149658 [152,] 0.509618547 0.699042702 [153,] -2.292229517 0.509618547 [154,] -2.498595365 -2.292229517 [155,] 1.104074356 -2.498595365 [156,] -0.090997030 1.104074356 [157,] 0.511672691 -0.090997030 [158,] 4.316601305 0.511672691 [159,] -2.479599528 4.316601305 [160,] 0.111775731 -2.479599528 [161,] 0.315574899 0.111775731 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 3.074778118 -0.527891604 2 -2.727069946 3.074778118 3 -2.523270778 -2.727069946 4 5.068104481 -2.523270778 5 3.479809772 5.068104481 6 3.470055585 3.479809772 7 -0.915980232 3.470055585 8 -0.313310511 -0.915980232 9 0.884841426 -0.313310511 10 1.689770040 0.884841426 11 2.893569207 1.689770040 12 -3.312796641 2.893569207 13 2.289873080 -3.312796641 14 2.695931140 2.289873080 15 0.292953630 2.695931140 16 0.294493905 0.292953630 17 2.099422519 0.294493905 18 -1.297907760 2.099422519 19 1.900244177 -1.297907760 20 1.508561129 1.900244177 21 -2.697804719 1.508561129 22 -0.494005552 -2.697804719 23 -1.694724169 -0.494005552 24 2.110204444 -1.694724169 25 -6.685996388 2.110204444 26 1.113284995 -6.685996388 27 0.710307485 1.113284995 28 1.312977206 0.710307485 29 -3.084353073 1.312977206 30 0.321704987 -3.084353073 31 -0.283531415 0.321704987 32 1.723656091 -0.283531415 33 0.124066920 1.723656091 34 -0.076651697 0.124066920 35 -0.069464191 -0.076651697 36 -2.281477271 -0.069464191 37 0.529098574 -2.281477271 38 1.732897742 0.529098574 39 -2.265561983 1.732897742 40 -0.662892262 -2.265561983 41 2.333000782 -0.662892262 42 -0.058682266 2.333000782 43 -1.663918668 -0.058682266 44 -2.858990054 -1.663918668 45 -3.059708671 -2.858990054 46 -0.653650611 -3.059708671 47 0.145630771 -0.653650611 48 3.742653261 0.145630771 49 -1.851288679 3.742653261 50 0.751381043 -1.851288679 51 0.348403533 0.751381043 52 -1.054573977 0.348403533 53 -1.648515917 -1.054573977 54 -2.843587303 -1.648515917 55 0.556823526 -2.843587303 56 1.957234354 0.556823526 57 -0.636707586 1.957234354 58 -3.236296757 -0.636707586 59 -1.240403713 -3.236296757 60 -3.244510669 -1.240403713 61 -1.433934824 -3.244510669 62 -3.432394549 -1.433934824 63 0.366886834 -3.432394549 64 0.969556555 0.366886834 65 -4.826644277 0.969556555 66 -1.431880680 -4.826644277 67 -2.424693173 -1.431880680 68 0.975717655 -2.424693173 69 1.376128484 0.975717655 70 -0.021201794 1.376128484 71 2.778079588 -0.021201794 72 0.981878756 2.778079588 73 -0.213192631 0.981878756 74 -1.812781802 -0.213192631 75 0.379722904 -1.812781802 76 2.988039856 0.379722904 77 0.585062346 2.988039856 78 0.991120406 0.585062346 79 -2.602821534 0.991120406 80 0.196459849 -2.602821534 81 0.799129570 0.196459849 82 -0.598200709 0.799129570 83 1.599951228 -0.598200709 84 0.601491503 1.599951228 85 0.001902332 0.601491503 86 1.003442607 0.001902332 87 -0.393887672 1.003442607 88 -0.195735736 -0.393887672 89 -3.402101584 -0.195735736 90 3.009603707 -3.402101584 91 -0.191114910 3.009603707 92 1.012684257 -0.191114910 93 0.811965640 1.012684257 94 -2.180846854 0.811965640 95 1.219563975 -2.180846854 96 -0.784542981 1.219563975 97 -0.777355475 -0.784542981 98 2.224184800 -0.777355475 99 -0.173145479 2.224184800 100 1.828394796 -0.173145479 101 -0.776841606 1.828394796 102 1.629216454 -0.776841606 103 -3.768113825 1.629216454 104 2.227779219 -3.768113825 105 -2.574068844 2.227779219 106 1.236507001 -2.574068844 107 2.232400045 1.236507001 108 -3.164930234 2.232400045 109 0.426445025 -3.164930234 110 1.439279762 0.426445025 111 -2.160309409 1.439279762 112 -1.754251349 -2.160309409 113 0.842771141 -1.754251349 114 3.647699755 0.842771141 115 0.851498923 3.647699755 116 0.448521413 0.851498923 117 0.051191134 0.448521413 118 -1.542750806 0.051191134 119 0.852012792 -1.542750806 120 -1.146446933 0.852012792 121 0.456222788 -1.146446933 122 0.261151402 0.456222788 123 -0.933919984 0.261151402 124 0.264231952 -0.933919984 125 -1.734227773 0.264231952 126 1.070700841 -1.734227773 127 1.869982223 1.070700841 128 4.270393052 1.869982223 129 1.069674435 4.270393052 130 -1.726526397 1.069674435 131 -2.135151138 -1.726526397 132 -0.122316401 -2.135151138 133 1.873576643 -0.122316401 134 0.678505257 1.873576643 135 2.477786639 0.678505257 136 1.069161898 2.477786639 137 0.480867189 1.069161898 138 -1.719851428 0.480867189 139 0.287336078 -1.719851428 140 -1.312253093 0.287336078 141 -0.108453925 -1.312253093 142 2.488568565 -0.108453925 143 -0.307632268 2.488568565 144 0.693908007 -0.307632268 145 1.296577729 0.693908007 146 1.696988558 1.296577729 147 -2.902600614 1.696988558 148 -2.698801446 -2.902600614 149 -2.506296741 -2.698801446 150 1.703149658 -2.506296741 151 0.699042702 1.703149658 152 0.509618547 0.699042702 153 -2.292229517 0.509618547 154 -2.498595365 -2.292229517 155 1.104074356 -2.498595365 156 -0.090997030 1.104074356 157 0.511672691 -0.090997030 158 4.316601305 0.511672691 159 -2.479599528 4.316601305 160 0.111775731 -2.479599528 161 0.315574899 0.111775731 > 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/7izl91355689100.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/89n2o1355689100.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/9fh7x1355689100.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/10cxnb1355689100.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/113dnq1355689100.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/12l6p71355689100.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/130eoe1355689100.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/14skt51355689100.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/158z0b1355689100.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/16pcop1355689100.tab") + } > > try(system("convert tmp/1qs0k1355689100.ps tmp/1qs0k1355689100.png",intern=TRUE)) character(0) > try(system("convert tmp/2kkqg1355689100.ps tmp/2kkqg1355689100.png",intern=TRUE)) character(0) > try(system("convert tmp/3hgnv1355689100.ps tmp/3hgnv1355689100.png",intern=TRUE)) character(0) > try(system("convert tmp/43sye1355689100.ps tmp/43sye1355689100.png",intern=TRUE)) character(0) > try(system("convert tmp/58d341355689100.ps tmp/58d341355689100.png",intern=TRUE)) character(0) > try(system("convert tmp/6a7b01355689100.ps tmp/6a7b01355689100.png",intern=TRUE)) character(0) > try(system("convert tmp/7izl91355689100.ps tmp/7izl91355689100.png",intern=TRUE)) character(0) > try(system("convert tmp/89n2o1355689100.ps tmp/89n2o1355689100.png",intern=TRUE)) character(0) > try(system("convert tmp/9fh7x1355689100.ps tmp/9fh7x1355689100.png",intern=TRUE)) character(0) > try(system("convert tmp/10cxnb1355689100.ps tmp/10cxnb1355689100.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 9.715 1.139 10.877