R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(5 + ,6 + ,5 + ,7 + ,11 + ,2 + ,6 + ,2 + ,3 + ,11 + ,6 + ,6 + ,6 + ,5 + ,15 + ,6 + ,4 + ,4 + ,5 + ,9 + ,6 + ,2 + ,6 + ,3 + ,11 + ,5 + ,7 + ,3 + ,4 + ,17 + ,5 + ,6 + ,5 + ,4 + ,16 + ,6 + ,5 + ,3 + ,5 + ,9 + ,6 + ,6 + ,5 + ,5 + ,14 + ,5 + ,7 + ,4 + ,5 + ,12 + ,5 + ,7 + ,1 + ,6 + ,6 + ,5 + ,4 + ,6 + ,5 + ,4 + ,6 + ,1 + ,6 + ,2 + ,13 + ,5 + ,6 + ,6 + ,5 + ,12 + ,5 + ,4 + ,4 + ,4 + ,10 + ,6 + ,5 + ,6 + ,6 + ,14 + ,6 + ,5 + ,5 + ,5 + ,12 + ,4 + ,6 + ,3 + ,6 + ,9 + ,5 + ,4 + ,5 + ,5 + ,16 + ,5 + ,6 + ,4 + ,2 + ,13 + ,5 + ,3 + ,5 + ,3 + ,12 + ,6 + ,3 + ,6 + ,5 + ,11 + ,5 + ,5 + ,3 + ,6 + ,12 + ,7 + ,5 + ,4 + ,5 + ,12 + ,6 + ,5 + ,5 + ,4 + ,11 + ,6 + ,5 + ,4 + ,5 + ,16 + ,6 + ,5 + ,5 + ,5 + ,9 + ,6 + ,2 + ,6 + ,5 + ,8 + ,4 + ,6 + ,7 + ,5 + ,11 + ,5 + ,7 + ,2 + ,6 + ,9 + ,6 + ,2 + ,4 + ,6 + ,16 + ,4 + ,3 + ,6 + ,6 +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3 + ,15 + ,5 + ,2 + ,4 + ,5 + ,9) + ,dim=c(5 + ,156) + ,dimnames=list(c('handgebruik' + ,'ontmoeting' + ,'extravert' + ,'blozen' + ,'populariteit') + ,1:156)) > y <- array(NA,dim=c(5,156),dimnames=list(c('handgebruik','ontmoeting','extravert','blozen','populariteit'),1:156)) > 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 = '5' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x populariteit handgebruik ontmoeting extravert blozen 1 11 5 6 5 7 2 11 2 6 2 3 3 15 6 6 6 5 4 9 6 4 4 5 5 11 6 2 6 3 6 17 5 7 3 4 7 16 5 6 5 4 8 9 6 5 3 5 9 14 6 6 5 5 10 12 5 7 4 5 11 6 5 7 1 6 12 4 5 4 6 5 13 13 6 1 6 2 14 12 5 6 6 5 15 10 5 4 4 4 16 14 6 5 6 6 17 12 6 5 5 5 18 9 4 6 3 6 19 16 5 4 5 5 20 13 5 6 4 2 21 12 5 3 5 3 22 11 6 3 6 5 23 12 5 5 3 6 24 12 7 5 4 5 25 11 6 5 5 4 26 16 6 5 4 5 27 9 6 5 5 5 28 8 6 2 6 5 29 11 4 6 7 5 30 9 5 7 2 6 31 16 6 2 4 6 32 14 4 3 6 6 33 10 5 6 5 6 34 14 5 5 5 4 35 13 5 7 5 4 36 12 7 5 6 3 37 16 7 6 6 5 38 16 6 5 1 6 39 15 7 3 4 4 40 5 6 7 2 6 41 12 5 5 3 3 42 11 6 5 4 2 43 15 4 6 5 5 44 15 6 2 4 5 45 10 5 3 3 6 46 12 6 6 4 4 47 5 6 7 6 3 48 16 5 5 4 3 49 16 6 4 5 4 50 12 5 6 4 5 51 6 5 7 5 4 52 7 5 2 6 3 53 14 6 2 6 4 54 8 6 2 4 4 55 12 5 5 4 4 56 10 7 2 6 3 57 11 6 5 4 6 58 17 5 6 2 5 59 13 5 2 6 5 60 15 6 4 5 6 61 10 5 6 6 6 62 9 5 4 6 4 63 16 6 3 5 5 64 11 6 3 5 4 65 8 3 3 5 6 66 14 5 6 5 5 67 11 5 6 3 5 68 12 6 5 4 5 69 14 5 3 1 5 70 15 5 3 5 2 71 14 4 2 2 5 72 11 5 3 6 5 73 11 5 3 5 5 74 15 2 5 2 2 75 7 6 3 6 6 76 12 6 5 5 4 77 10 6 2 6 4 78 13 6 5 3 6 79 15 5 6 4 6 80 13 5 6 4 4 81 15 6 5 4 2 82 8 5 2 4 4 83 14 5 6 5 5 84 11 6 7 2 7 85 12 3 5 3 7 86 16 6 5 5 5 87 8 3 2 6 5 88 12 5 5 5 5 89 16 5 6 6 4 90 11 6 5 3 6 91 13 5 5 4 5 92 6 6 4 4 4 93 4 6 5 3 6 94 11 6 4 4 4 95 7 5 3 4 4 96 12 3 5 2 5 97 12 4 2 6 2 98 16 7 2 3 5 99 15 6 4 5 5 100 13 6 3 5 5 101 12 5 5 5 6 102 9 4 5 5 5 103 16 6 2 4 4 104 11 6 5 2 5 105 14 6 2 5 5 106 10 5 6 3 5 107 10 6 2 6 5 108 11 6 1 6 4 109 16 2 6 1 1 110 8 6 2 7 5 111 16 5 3 5 3 112 12 5 5 6 5 113 11 3 4 6 5 114 16 4 4 6 6 115 9 6 6 3 5 116 13 5 2 6 4 117 14 6 7 7 6 118 10 4 2 6 2 119 12 6 5 5 2 120 11 4 3 5 4 121 10 3 3 5 6 122 12 6 5 5 5 123 13 5 5 4 4 124 14 7 4 4 5 125 12 6 3 6 5 126 14 6 2 6 5 127 13 5 6 4 4 128 8 5 2 7 2 129 13 2 6 3 6 130 10 5 6 4 5 131 9 3 2 2 4 132 8 6 5 4 5 133 15 5 6 4 5 134 15 5 5 3 5 135 12 5 3 2 5 136 8 2 7 5 6 137 15 5 5 5 2 138 9 5 4 4 4 139 14 6 5 6 7 140 16 6 3 5 3 141 14 5 2 1 2 142 14 5 5 5 5 143 14 5 5 5 3 144 14 6 2 5 5 145 14 6 3 5 6 146 13 6 2 5 3 147 12 6 6 4 5 148 13 6 6 7 5 149 19 7 2 5 3 150 8 6 3 6 3 151 10 6 4 3 5 152 7 6 6 5 6 153 12 7 2 6 5 154 16 1 7 1 6 155 15 6 2 6 3 156 9 5 2 4 5 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) handgebruik ontmoeting extravert blozen 12.93870 0.19552 0.04942 -0.16377 -0.31690 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -7.96619 -1.96362 0.04445 2.30607 6.36339 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 12.93870 1.75382 7.377 1e-11 *** handgebruik 0.19552 0.22548 0.867 0.387 ontmoeting 0.04942 0.15623 0.316 0.752 extravert -0.16377 0.17918 -0.914 0.362 blozen -0.31690 0.20064 -1.579 0.116 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.969 on 151 degrees of freedom Multiple R-squared: 0.02324, Adjusted R-squared: -0.002637 F-statistic: 0.8981 on 4 and 151 DF, p-value: 0.4668 > 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.09376212 0.18752423 0.90623788 [2,] 0.03977357 0.07954714 0.96022643 [3,] 0.07517033 0.15034066 0.92482967 [4,] 0.06340800 0.12681600 0.93659200 [5,] 0.43482201 0.86964402 0.56517799 [6,] 0.37831781 0.75663562 0.62168219 [7,] 0.30531519 0.61063038 0.69468481 [8,] 0.22642740 0.45285480 0.77357260 [9,] 0.30802008 0.61604015 0.69197992 [10,] 0.23121114 0.46242228 0.76878886 [11,] 0.20967687 0.41935374 0.79032313 [12,] 0.55551431 0.88897139 0.44448569 [13,] 0.56758117 0.86483765 0.43241883 [14,] 0.49327470 0.98654939 0.50672530 [15,] 0.41983570 0.83967141 0.58016430 [16,] 0.44455080 0.88910159 0.55544920 [17,] 0.37446076 0.74892153 0.62553924 [18,] 0.34355826 0.68711652 0.65644174 [19,] 0.43612112 0.87224224 0.56387888 [20,] 0.44888085 0.89776169 0.55111915 [21,] 0.41579203 0.83158405 0.58420797 [22,] 0.37790032 0.75580063 0.62209968 [23,] 0.34329214 0.68658428 0.65670786 [24,] 0.62359564 0.75280871 0.37640436 [25,] 0.65094257 0.69811485 0.34905743 [26,] 0.60918462 0.78163076 0.39081538 [27,] 0.57224207 0.85551586 0.42775793 [28,] 0.51512313 0.96975375 0.48487687 [29,] 0.47121325 0.94242650 0.52878675 [30,] 0.47969587 0.95939175 0.52030413 [31,] 0.57042781 0.85914439 0.42957219 [32,] 0.54666905 0.90666190 0.45333095 [33,] 0.75494645 0.49010710 0.24505355 [34,] 0.71157034 0.57685932 0.28842966 [35,] 0.68710435 0.62579130 0.31289565 [36,] 0.69947550 0.60104901 0.30052450 [37,] 0.70321576 0.59356849 0.29678424 [38,] 0.66593439 0.66813122 0.33406561 [39,] 0.61809069 0.76381863 0.38190931 [40,] 0.83527493 0.32945013 0.16472507 [41,] 0.84906291 0.30187419 0.15093709 [42,] 0.86047600 0.27904800 0.13952400 [43,] 0.83106951 0.33786098 0.16893049 [44,] 0.90603400 0.18793200 0.09396600 [45,] 0.94277410 0.11445179 0.05722590 [46,] 0.93302016 0.13395967 0.06697984 [47,] 0.94763023 0.10473953 0.05236977 [48,] 0.93370492 0.13259015 0.06629508 [49,] 0.92910162 0.14179677 0.07089838 [50,] 0.91271168 0.17457664 0.08728832 [51,] 0.93974828 0.12050344 0.06025172 [52,] 0.92811507 0.14376985 0.07188493 [53,] 0.93049778 0.13900444 0.06950222 [54,] 0.91765116 0.16469767 0.08234884 [55,] 0.91591838 0.16816324 0.08408162 [56,] 0.92967287 0.14065426 0.07032713 [57,] 0.91519690 0.16960620 0.08480310 [58,] 0.91297393 0.17405213 0.08702607 [59,] 0.90370997 0.19258006 0.09629003 [60,] 0.88554584 0.22890832 0.11445416 [61,] 0.86118954 0.27762091 0.13881046 [62,] 0.84420278 0.31159443 0.15579722 [63,] 0.83615372 0.32769257 0.16384628 [64,] 0.82372039 0.35255923 0.17627961 [65,] 0.79270781 0.41458438 0.20729219 [66,] 0.75936195 0.48127610 0.24063805 [67,] 0.74887595 0.50224810 0.25112405 [68,] 0.78858089 0.42283822 0.21141911 [69,] 0.75423915 0.49152169 0.24576085 [70,] 0.73265317 0.53469366 0.26734683 [71,] 0.69720292 0.60559415 0.30279708 [72,] 0.70519147 0.58961706 0.29480853 [73,] 0.66559745 0.66880509 0.33440255 [74,] 0.63756165 0.72487671 0.36243835 [75,] 0.67268160 0.65463680 0.32731840 [76,] 0.65074940 0.69850120 0.34925060 [77,] 0.61059445 0.77881111 0.38940555 [78,] 0.57009975 0.85980051 0.42990025 [79,] 0.60429514 0.79140973 0.39570486 [80,] 0.60481212 0.79037575 0.39518788 [81,] 0.55876795 0.88246410 0.44123205 [82,] 0.59333833 0.81332335 0.40666167 [83,] 0.55075385 0.89849231 0.44924615 [84,] 0.50956552 0.98086896 0.49043448 [85,] 0.66990701 0.66018599 0.33009299 [86,] 0.88657097 0.22685806 0.11342903 [87,] 0.86926430 0.26147139 0.13073570 [88,] 0.91916087 0.16167826 0.08083913 [89,] 0.89932408 0.20135184 0.10067592 [90,] 0.87589995 0.24820009 0.12410005 [91,] 0.88352327 0.23295345 0.11647673 [92,] 0.88329578 0.23340845 0.11670422 [93,] 0.86025857 0.27948287 0.13974143 [94,] 0.83115942 0.33768117 0.16884058 [95,] 0.82606032 0.34787936 0.17393968 [96,] 0.84194854 0.31610292 0.15805146 [97,] 0.82036863 0.35926274 0.17963137 [98,] 0.80436511 0.39126977 0.19563489 [99,] 0.79488916 0.41022169 0.20511084 [100,] 0.76824910 0.46350180 0.23175090 [101,] 0.73038448 0.53923103 0.26961552 [102,] 0.72244081 0.55511838 0.27755919 [103,] 0.75246892 0.49506216 0.24753108 [104,] 0.77543875 0.44912251 0.22456125 [105,] 0.73360068 0.53279864 0.26639932 [106,] 0.68822619 0.62354762 0.31177381 [107,] 0.75672840 0.48654320 0.24327160 [108,] 0.79188577 0.41622845 0.20811423 [109,] 0.76071447 0.47857106 0.23928553 [110,] 0.74143590 0.51712820 0.25856410 [111,] 0.70796935 0.58406130 0.29203065 [112,] 0.66584614 0.66830772 0.33415386 [113,] 0.61388297 0.77223407 0.38611703 [114,] 0.55968579 0.88062843 0.44031421 [115,] 0.50233743 0.99532514 0.49766257 [116,] 0.44443207 0.88886413 0.55556793 [117,] 0.39404390 0.78808780 0.60595610 [118,] 0.33710685 0.67421370 0.66289315 [119,] 0.31450684 0.62901369 0.68549316 [120,] 0.26208856 0.52417712 0.73791144 [121,] 0.32323166 0.64646332 0.67676834 [122,] 0.28578894 0.57157788 0.71421106 [123,] 0.25941055 0.51882110 0.74058945 [124,] 0.27807258 0.55614516 0.72192742 [125,] 0.34349160 0.68698320 0.65650840 [126,] 0.32315249 0.64630498 0.67684751 [127,] 0.30391506 0.60783011 0.69608494 [128,] 0.24572304 0.49144609 0.75427696 [129,] 0.29476727 0.58953453 0.70523273 [130,] 0.24042212 0.48084424 0.75957788 [131,] 0.28965394 0.57930787 0.71034606 [132,] 0.28140987 0.56281974 0.71859013 [133,] 0.25522155 0.51044309 0.74477845 [134,] 0.19491476 0.38982952 0.80508524 [135,] 0.15238053 0.30476106 0.84761947 [136,] 0.10381346 0.20762691 0.89618654 [137,] 0.07462245 0.14924490 0.92537755 [138,] 0.08350102 0.16700204 0.91649898 [139,] 0.05085437 0.10170874 0.94914563 [140,] 0.02585647 0.05171295 0.97414353 [141,] 0.02570907 0.05141815 0.97429093 > postscript(file="/var/www/html/rcomp/tmp/1zzhy1291386862.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2zzhy1291386862.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3zzhy1291386862.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4a8yj1291386862.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5a8yj1291386862.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 156 Frequency = 1 1 2 3 4 5 6 -0.17564507 -1.34800973 3.15880591 -3.06989747 -1.27731833 4.49668946 7 8 9 10 11 12 3.87365141 -3.28308821 1.99503469 -0.02263815 -6.19705063 -7.54683715 13 14 15 16 17 18 0.45520002 0.35432380 -2.19128075 2.52512660 0.04445422 -2.62457078 19 20 21 22 23 24 4.28939164 0.07607786 -0.29499118 -0.69293552 0.22933085 -0.31483489 25 26 27 28 29 30 -1.27244695 3.88068300 -2.95554578 -3.64351599 -0.28638709 -3.03327941 31 32 33 34 35 36 4.34584275 3.01500144 -1.49254624 1.92307094 0.82423189 -0.62109480 37 38 39 40 41 42 3.96328802 3.70627053 2.46710299 -7.22879730 -0.72137266 -2.07002051 43 44 45 46 47 48 3.38607048 3.02894158 -1.67183010 -0.48563769 -7.52441596 3.44239855 49 50 51 52 53 54 3.77697257 0.02678137 -6.17576811 -5.08180044 2.03958284 -4.28795959 55 56 57 58 59 60 -0.24070028 -2.47283623 -0.80241582 4.69923894 1.55200190 3.41077492 61 62 63 64 65 66 -1.32877503 -2.86373832 4.14329327 -1.17360790 -2.95325189 2.19055259 67 68 69 70 71 72 -1.13698984 -0.11931700 1.68372630 2.38810765 2.09243493 -0.49741762 73 74 75 76 77 78 -0.66118884 2.38450863 -4.37603435 -0.27244695 -1.96041716 1.03381296 79 80 81 82 83 84 3.34368254 0.70988020 1.92997949 -4.09244170 2.19055259 -0.91189613 85 86 87 88 89 90 0.93726781 4.04445422 -3.05696232 0.23997211 4.03742263 -0.96618704 91 92 93 94 95 96 1.07620090 -6.38679864 -7.96618704 -1.38679864 -5.14186123 0.13969425 97 98 99 100 101 102 -0.20318372 3.66965247 3.09387374 1.14329327 0.55687328 -2.56451000 103 104 105 106 107 108 3.71204041 -1.44685942 2.19271279 -2.13698984 -1.64351599 -0.91099764 109 110 111 112 113 114 2.85441672 -3.47974478 3.70500882 0.40374333 -0.15580137 4.96558191 115 116 117 118 119 120 -3.33250774 1.23510073 2.59005877 -2.20318372 -0.90624929 -0.78257212 121 122 123 124 125 126 -0.95325189 0.04445422 0.75929972 1.73458464 0.30706448 2.35648401 127 128 129 130 131 132 0.70988020 -4.23493040 1.76646500 -1.97321863 -3.02894835 -4.11931700 133 134 135 136 137 138 3.02678137 2.91242968 -0.15250248 -2.95541209 2.28926860 -3.19128075 139 140 141 142 143 144 2.84202778 3.50949093 0.78244231 2.23997211 1.60616977 2.19271279 145 146 147 148 149 150 2.46019444 0.55891045 -0.16873652 1.32257712 6.36339256 -4.32673786 151 152 153 154 155 156 -2.23366869 -4.68806413 0.16096612 4.58502094 2.72268167 -2.77554053 > postscript(file="/var/www/html/rcomp/tmp/6a8yj1291386862.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 156 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.17564507 NA 1 -1.34800973 -0.17564507 2 3.15880591 -1.34800973 3 -3.06989747 3.15880591 4 -1.27731833 -3.06989747 5 4.49668946 -1.27731833 6 3.87365141 4.49668946 7 -3.28308821 3.87365141 8 1.99503469 -3.28308821 9 -0.02263815 1.99503469 10 -6.19705063 -0.02263815 11 -7.54683715 -6.19705063 12 0.45520002 -7.54683715 13 0.35432380 0.45520002 14 -2.19128075 0.35432380 15 2.52512660 -2.19128075 16 0.04445422 2.52512660 17 -2.62457078 0.04445422 18 4.28939164 -2.62457078 19 0.07607786 4.28939164 20 -0.29499118 0.07607786 21 -0.69293552 -0.29499118 22 0.22933085 -0.69293552 23 -0.31483489 0.22933085 24 -1.27244695 -0.31483489 25 3.88068300 -1.27244695 26 -2.95554578 3.88068300 27 -3.64351599 -2.95554578 28 -0.28638709 -3.64351599 29 -3.03327941 -0.28638709 30 4.34584275 -3.03327941 31 3.01500144 4.34584275 32 -1.49254624 3.01500144 33 1.92307094 -1.49254624 34 0.82423189 1.92307094 35 -0.62109480 0.82423189 36 3.96328802 -0.62109480 37 3.70627053 3.96328802 38 2.46710299 3.70627053 39 -7.22879730 2.46710299 40 -0.72137266 -7.22879730 41 -2.07002051 -0.72137266 42 3.38607048 -2.07002051 43 3.02894158 3.38607048 44 -1.67183010 3.02894158 45 -0.48563769 -1.67183010 46 -7.52441596 -0.48563769 47 3.44239855 -7.52441596 48 3.77697257 3.44239855 49 0.02678137 3.77697257 50 -6.17576811 0.02678137 51 -5.08180044 -6.17576811 52 2.03958284 -5.08180044 53 -4.28795959 2.03958284 54 -0.24070028 -4.28795959 55 -2.47283623 -0.24070028 56 -0.80241582 -2.47283623 57 4.69923894 -0.80241582 58 1.55200190 4.69923894 59 3.41077492 1.55200190 60 -1.32877503 3.41077492 61 -2.86373832 -1.32877503 62 4.14329327 -2.86373832 63 -1.17360790 4.14329327 64 -2.95325189 -1.17360790 65 2.19055259 -2.95325189 66 -1.13698984 2.19055259 67 -0.11931700 -1.13698984 68 1.68372630 -0.11931700 69 2.38810765 1.68372630 70 2.09243493 2.38810765 71 -0.49741762 2.09243493 72 -0.66118884 -0.49741762 73 2.38450863 -0.66118884 74 -4.37603435 2.38450863 75 -0.27244695 -4.37603435 76 -1.96041716 -0.27244695 77 1.03381296 -1.96041716 78 3.34368254 1.03381296 79 0.70988020 3.34368254 80 1.92997949 0.70988020 81 -4.09244170 1.92997949 82 2.19055259 -4.09244170 83 -0.91189613 2.19055259 84 0.93726781 -0.91189613 85 4.04445422 0.93726781 86 -3.05696232 4.04445422 87 0.23997211 -3.05696232 88 4.03742263 0.23997211 89 -0.96618704 4.03742263 90 1.07620090 -0.96618704 91 -6.38679864 1.07620090 92 -7.96618704 -6.38679864 93 -1.38679864 -7.96618704 94 -5.14186123 -1.38679864 95 0.13969425 -5.14186123 96 -0.20318372 0.13969425 97 3.66965247 -0.20318372 98 3.09387374 3.66965247 99 1.14329327 3.09387374 100 0.55687328 1.14329327 101 -2.56451000 0.55687328 102 3.71204041 -2.56451000 103 -1.44685942 3.71204041 104 2.19271279 -1.44685942 105 -2.13698984 2.19271279 106 -1.64351599 -2.13698984 107 -0.91099764 -1.64351599 108 2.85441672 -0.91099764 109 -3.47974478 2.85441672 110 3.70500882 -3.47974478 111 0.40374333 3.70500882 112 -0.15580137 0.40374333 113 4.96558191 -0.15580137 114 -3.33250774 4.96558191 115 1.23510073 -3.33250774 116 2.59005877 1.23510073 117 -2.20318372 2.59005877 118 -0.90624929 -2.20318372 119 -0.78257212 -0.90624929 120 -0.95325189 -0.78257212 121 0.04445422 -0.95325189 122 0.75929972 0.04445422 123 1.73458464 0.75929972 124 0.30706448 1.73458464 125 2.35648401 0.30706448 126 0.70988020 2.35648401 127 -4.23493040 0.70988020 128 1.76646500 -4.23493040 129 -1.97321863 1.76646500 130 -3.02894835 -1.97321863 131 -4.11931700 -3.02894835 132 3.02678137 -4.11931700 133 2.91242968 3.02678137 134 -0.15250248 2.91242968 135 -2.95541209 -0.15250248 136 2.28926860 -2.95541209 137 -3.19128075 2.28926860 138 2.84202778 -3.19128075 139 3.50949093 2.84202778 140 0.78244231 3.50949093 141 2.23997211 0.78244231 142 1.60616977 2.23997211 143 2.19271279 1.60616977 144 2.46019444 2.19271279 145 0.55891045 2.46019444 146 -0.16873652 0.55891045 147 1.32257712 -0.16873652 148 6.36339256 1.32257712 149 -4.32673786 6.36339256 150 -2.23366869 -4.32673786 151 -4.68806413 -2.23366869 152 0.16096612 -4.68806413 153 4.58502094 0.16096612 154 2.72268167 4.58502094 155 -2.77554053 2.72268167 156 NA -2.77554053 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.34800973 -0.17564507 [2,] 3.15880591 -1.34800973 [3,] -3.06989747 3.15880591 [4,] -1.27731833 -3.06989747 [5,] 4.49668946 -1.27731833 [6,] 3.87365141 4.49668946 [7,] -3.28308821 3.87365141 [8,] 1.99503469 -3.28308821 [9,] -0.02263815 1.99503469 [10,] -6.19705063 -0.02263815 [11,] -7.54683715 -6.19705063 [12,] 0.45520002 -7.54683715 [13,] 0.35432380 0.45520002 [14,] -2.19128075 0.35432380 [15,] 2.52512660 -2.19128075 [16,] 0.04445422 2.52512660 [17,] -2.62457078 0.04445422 [18,] 4.28939164 -2.62457078 [19,] 0.07607786 4.28939164 [20,] -0.29499118 0.07607786 [21,] -0.69293552 -0.29499118 [22,] 0.22933085 -0.69293552 [23,] -0.31483489 0.22933085 [24,] -1.27244695 -0.31483489 [25,] 3.88068300 -1.27244695 [26,] -2.95554578 3.88068300 [27,] -3.64351599 -2.95554578 [28,] -0.28638709 -3.64351599 [29,] -3.03327941 -0.28638709 [30,] 4.34584275 -3.03327941 [31,] 3.01500144 4.34584275 [32,] -1.49254624 3.01500144 [33,] 1.92307094 -1.49254624 [34,] 0.82423189 1.92307094 [35,] -0.62109480 0.82423189 [36,] 3.96328802 -0.62109480 [37,] 3.70627053 3.96328802 [38,] 2.46710299 3.70627053 [39,] -7.22879730 2.46710299 [40,] -0.72137266 -7.22879730 [41,] -2.07002051 -0.72137266 [42,] 3.38607048 -2.07002051 [43,] 3.02894158 3.38607048 [44,] -1.67183010 3.02894158 [45,] -0.48563769 -1.67183010 [46,] -7.52441596 -0.48563769 [47,] 3.44239855 -7.52441596 [48,] 3.77697257 3.44239855 [49,] 0.02678137 3.77697257 [50,] -6.17576811 0.02678137 [51,] -5.08180044 -6.17576811 [52,] 2.03958284 -5.08180044 [53,] -4.28795959 2.03958284 [54,] -0.24070028 -4.28795959 [55,] -2.47283623 -0.24070028 [56,] -0.80241582 -2.47283623 [57,] 4.69923894 -0.80241582 [58,] 1.55200190 4.69923894 [59,] 3.41077492 1.55200190 [60,] -1.32877503 3.41077492 [61,] -2.86373832 -1.32877503 [62,] 4.14329327 -2.86373832 [63,] -1.17360790 4.14329327 [64,] -2.95325189 -1.17360790 [65,] 2.19055259 -2.95325189 [66,] -1.13698984 2.19055259 [67,] -0.11931700 -1.13698984 [68,] 1.68372630 -0.11931700 [69,] 2.38810765 1.68372630 [70,] 2.09243493 2.38810765 [71,] -0.49741762 2.09243493 [72,] -0.66118884 -0.49741762 [73,] 2.38450863 -0.66118884 [74,] -4.37603435 2.38450863 [75,] -0.27244695 -4.37603435 [76,] -1.96041716 -0.27244695 [77,] 1.03381296 -1.96041716 [78,] 3.34368254 1.03381296 [79,] 0.70988020 3.34368254 [80,] 1.92997949 0.70988020 [81,] -4.09244170 1.92997949 [82,] 2.19055259 -4.09244170 [83,] -0.91189613 2.19055259 [84,] 0.93726781 -0.91189613 [85,] 4.04445422 0.93726781 [86,] -3.05696232 4.04445422 [87,] 0.23997211 -3.05696232 [88,] 4.03742263 0.23997211 [89,] -0.96618704 4.03742263 [90,] 1.07620090 -0.96618704 [91,] -6.38679864 1.07620090 [92,] -7.96618704 -6.38679864 [93,] -1.38679864 -7.96618704 [94,] -5.14186123 -1.38679864 [95,] 0.13969425 -5.14186123 [96,] -0.20318372 0.13969425 [97,] 3.66965247 -0.20318372 [98,] 3.09387374 3.66965247 [99,] 1.14329327 3.09387374 [100,] 0.55687328 1.14329327 [101,] -2.56451000 0.55687328 [102,] 3.71204041 -2.56451000 [103,] -1.44685942 3.71204041 [104,] 2.19271279 -1.44685942 [105,] -2.13698984 2.19271279 [106,] -1.64351599 -2.13698984 [107,] -0.91099764 -1.64351599 [108,] 2.85441672 -0.91099764 [109,] -3.47974478 2.85441672 [110,] 3.70500882 -3.47974478 [111,] 0.40374333 3.70500882 [112,] -0.15580137 0.40374333 [113,] 4.96558191 -0.15580137 [114,] -3.33250774 4.96558191 [115,] 1.23510073 -3.33250774 [116,] 2.59005877 1.23510073 [117,] -2.20318372 2.59005877 [118,] -0.90624929 -2.20318372 [119,] -0.78257212 -0.90624929 [120,] -0.95325189 -0.78257212 [121,] 0.04445422 -0.95325189 [122,] 0.75929972 0.04445422 [123,] 1.73458464 0.75929972 [124,] 0.30706448 1.73458464 [125,] 2.35648401 0.30706448 [126,] 0.70988020 2.35648401 [127,] -4.23493040 0.70988020 [128,] 1.76646500 -4.23493040 [129,] -1.97321863 1.76646500 [130,] -3.02894835 -1.97321863 [131,] -4.11931700 -3.02894835 [132,] 3.02678137 -4.11931700 [133,] 2.91242968 3.02678137 [134,] -0.15250248 2.91242968 [135,] -2.95541209 -0.15250248 [136,] 2.28926860 -2.95541209 [137,] -3.19128075 2.28926860 [138,] 2.84202778 -3.19128075 [139,] 3.50949093 2.84202778 [140,] 0.78244231 3.50949093 [141,] 2.23997211 0.78244231 [142,] 1.60616977 2.23997211 [143,] 2.19271279 1.60616977 [144,] 2.46019444 2.19271279 [145,] 0.55891045 2.46019444 [146,] -0.16873652 0.55891045 [147,] 1.32257712 -0.16873652 [148,] 6.36339256 1.32257712 [149,] -4.32673786 6.36339256 [150,] -2.23366869 -4.32673786 [151,] -4.68806413 -2.23366869 [152,] 0.16096612 -4.68806413 [153,] 4.58502094 0.16096612 [154,] 2.72268167 4.58502094 [155,] -2.77554053 2.72268167 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.34800973 -0.17564507 2 3.15880591 -1.34800973 3 -3.06989747 3.15880591 4 -1.27731833 -3.06989747 5 4.49668946 -1.27731833 6 3.87365141 4.49668946 7 -3.28308821 3.87365141 8 1.99503469 -3.28308821 9 -0.02263815 1.99503469 10 -6.19705063 -0.02263815 11 -7.54683715 -6.19705063 12 0.45520002 -7.54683715 13 0.35432380 0.45520002 14 -2.19128075 0.35432380 15 2.52512660 -2.19128075 16 0.04445422 2.52512660 17 -2.62457078 0.04445422 18 4.28939164 -2.62457078 19 0.07607786 4.28939164 20 -0.29499118 0.07607786 21 -0.69293552 -0.29499118 22 0.22933085 -0.69293552 23 -0.31483489 0.22933085 24 -1.27244695 -0.31483489 25 3.88068300 -1.27244695 26 -2.95554578 3.88068300 27 -3.64351599 -2.95554578 28 -0.28638709 -3.64351599 29 -3.03327941 -0.28638709 30 4.34584275 -3.03327941 31 3.01500144 4.34584275 32 -1.49254624 3.01500144 33 1.92307094 -1.49254624 34 0.82423189 1.92307094 35 -0.62109480 0.82423189 36 3.96328802 -0.62109480 37 3.70627053 3.96328802 38 2.46710299 3.70627053 39 -7.22879730 2.46710299 40 -0.72137266 -7.22879730 41 -2.07002051 -0.72137266 42 3.38607048 -2.07002051 43 3.02894158 3.38607048 44 -1.67183010 3.02894158 45 -0.48563769 -1.67183010 46 -7.52441596 -0.48563769 47 3.44239855 -7.52441596 48 3.77697257 3.44239855 49 0.02678137 3.77697257 50 -6.17576811 0.02678137 51 -5.08180044 -6.17576811 52 2.03958284 -5.08180044 53 -4.28795959 2.03958284 54 -0.24070028 -4.28795959 55 -2.47283623 -0.24070028 56 -0.80241582 -2.47283623 57 4.69923894 -0.80241582 58 1.55200190 4.69923894 59 3.41077492 1.55200190 60 -1.32877503 3.41077492 61 -2.86373832 -1.32877503 62 4.14329327 -2.86373832 63 -1.17360790 4.14329327 64 -2.95325189 -1.17360790 65 2.19055259 -2.95325189 66 -1.13698984 2.19055259 67 -0.11931700 -1.13698984 68 1.68372630 -0.11931700 69 2.38810765 1.68372630 70 2.09243493 2.38810765 71 -0.49741762 2.09243493 72 -0.66118884 -0.49741762 73 2.38450863 -0.66118884 74 -4.37603435 2.38450863 75 -0.27244695 -4.37603435 76 -1.96041716 -0.27244695 77 1.03381296 -1.96041716 78 3.34368254 1.03381296 79 0.70988020 3.34368254 80 1.92997949 0.70988020 81 -4.09244170 1.92997949 82 2.19055259 -4.09244170 83 -0.91189613 2.19055259 84 0.93726781 -0.91189613 85 4.04445422 0.93726781 86 -3.05696232 4.04445422 87 0.23997211 -3.05696232 88 4.03742263 0.23997211 89 -0.96618704 4.03742263 90 1.07620090 -0.96618704 91 -6.38679864 1.07620090 92 -7.96618704 -6.38679864 93 -1.38679864 -7.96618704 94 -5.14186123 -1.38679864 95 0.13969425 -5.14186123 96 -0.20318372 0.13969425 97 3.66965247 -0.20318372 98 3.09387374 3.66965247 99 1.14329327 3.09387374 100 0.55687328 1.14329327 101 -2.56451000 0.55687328 102 3.71204041 -2.56451000 103 -1.44685942 3.71204041 104 2.19271279 -1.44685942 105 -2.13698984 2.19271279 106 -1.64351599 -2.13698984 107 -0.91099764 -1.64351599 108 2.85441672 -0.91099764 109 -3.47974478 2.85441672 110 3.70500882 -3.47974478 111 0.40374333 3.70500882 112 -0.15580137 0.40374333 113 4.96558191 -0.15580137 114 -3.33250774 4.96558191 115 1.23510073 -3.33250774 116 2.59005877 1.23510073 117 -2.20318372 2.59005877 118 -0.90624929 -2.20318372 119 -0.78257212 -0.90624929 120 -0.95325189 -0.78257212 121 0.04445422 -0.95325189 122 0.75929972 0.04445422 123 1.73458464 0.75929972 124 0.30706448 1.73458464 125 2.35648401 0.30706448 126 0.70988020 2.35648401 127 -4.23493040 0.70988020 128 1.76646500 -4.23493040 129 -1.97321863 1.76646500 130 -3.02894835 -1.97321863 131 -4.11931700 -3.02894835 132 3.02678137 -4.11931700 133 2.91242968 3.02678137 134 -0.15250248 2.91242968 135 -2.95541209 -0.15250248 136 2.28926860 -2.95541209 137 -3.19128075 2.28926860 138 2.84202778 -3.19128075 139 3.50949093 2.84202778 140 0.78244231 3.50949093 141 2.23997211 0.78244231 142 1.60616977 2.23997211 143 2.19271279 1.60616977 144 2.46019444 2.19271279 145 0.55891045 2.46019444 146 -0.16873652 0.55891045 147 1.32257712 -0.16873652 148 6.36339256 1.32257712 149 -4.32673786 6.36339256 150 -2.23366869 -4.32673786 151 -4.68806413 -2.23366869 152 0.16096612 -4.68806413 153 4.58502094 0.16096612 154 2.72268167 4.58502094 155 -2.77554053 2.72268167 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/73hg41291386862.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/83hg41291386862.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/96jzk1291386863.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/106jzk1291386863.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/11r1yq1291386863.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/12v2fv1291386863.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/13jlu71291386863.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/14cubs1291386863.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/15yurg1291386863.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/16umpp1291386863.tab") + } > > try(system("convert tmp/1zzhy1291386862.ps tmp/1zzhy1291386862.png",intern=TRUE)) character(0) > try(system("convert tmp/2zzhy1291386862.ps tmp/2zzhy1291386862.png",intern=TRUE)) character(0) > try(system("convert tmp/3zzhy1291386862.ps tmp/3zzhy1291386862.png",intern=TRUE)) character(0) > try(system("convert tmp/4a8yj1291386862.ps tmp/4a8yj1291386862.png",intern=TRUE)) character(0) > try(system("convert tmp/5a8yj1291386862.ps tmp/5a8yj1291386862.png",intern=TRUE)) character(0) > try(system("convert tmp/6a8yj1291386862.ps tmp/6a8yj1291386862.png",intern=TRUE)) character(0) > try(system("convert tmp/73hg41291386862.ps tmp/73hg41291386862.png",intern=TRUE)) character(0) > try(system("convert tmp/83hg41291386862.ps tmp/83hg41291386862.png",intern=TRUE)) character(0) > try(system("convert tmp/96jzk1291386863.ps tmp/96jzk1291386863.png",intern=TRUE)) character(0) > try(system("convert tmp/106jzk1291386863.ps tmp/106jzk1291386863.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.946 1.784 9.328