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(1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,0,1,1,0,0,1,0,0,0,0,1,1,0,1,0,0,0,0,0,1,0,0,1,0,0,1,1,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,1,0,0,0,0,1,0,0,1,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,0,1,0,0,1,0,0,1,0,0,1,1,0,1,1,0,1,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,1,0,1,0,0,1,0,0,1,1,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,1,0,0,0,0,1,1,0,1,0,0,1,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0),dim=c(3,154),dimnames=list(c('T40','T20','Outcome'),1:154)) > y <- array(NA,dim=c(3,154),dimnames=list(c('T40','T20','Outcome'),1:154)) > 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 T40 T20 Outcome t 1 1 0 1 1 2 0 0 0 2 3 0 0 0 3 4 0 0 0 4 5 0 0 0 5 6 0 0 1 6 7 0 0 0 7 8 1 0 0 8 9 0 0 1 9 10 0 0 0 10 11 1 0 0 11 12 0 0 0 12 13 0 0 0 13 14 1 0 0 14 15 0 0 1 15 16 1 0 1 16 17 1 0 0 17 18 1 0 0 18 19 0 0 1 19 20 1 0 1 20 21 0 0 0 21 22 0 0 1 22 23 0 0 1 23 24 0 0 1 24 25 1 0 1 25 26 0 0 0 26 27 0 0 1 27 28 0 0 0 28 29 0 0 1 29 30 0 0 0 30 31 0 0 0 31 32 0 0 0 32 33 0 0 0 33 34 1 0 1 34 35 0 0 0 35 36 0 0 0 36 37 1 0 0 37 38 0 0 1 38 39 0 0 1 39 40 1 0 0 40 41 0 0 1 41 42 0 0 1 42 43 0 0 1 43 44 1 0 0 44 45 0 0 0 45 46 0 0 1 46 47 0 0 0 47 48 0 0 1 48 49 0 0 1 49 50 0 0 0 50 51 1 0 0 51 52 1 0 0 52 53 0 0 1 53 54 0 0 0 54 55 0 0 0 55 56 1 0 1 56 57 0 0 1 57 58 0 0 1 58 59 0 0 1 59 60 1 0 1 60 61 1 0 1 61 62 0 0 0 62 63 0 0 0 63 64 1 0 1 64 65 0 0 0 65 66 0 0 0 66 67 1 0 0 67 68 0 0 0 68 69 0 0 1 69 70 0 0 0 70 71 0 0 0 71 72 0 0 1 72 73 0 0 1 73 74 0 0 0 74 75 0 0 1 75 76 1 0 1 76 77 0 0 1 77 78 0 0 1 78 79 1 0 1 79 80 1 0 0 80 81 0 0 0 81 82 0 0 1 82 83 0 0 0 83 84 0 0 0 84 85 0 0 1 85 86 0 0 0 86 87 0 0 1 87 88 0 1 1 88 89 0 0 0 89 90 0 0 1 90 91 0 0 0 91 92 0 1 0 92 93 0 0 0 93 94 0 0 0 94 95 0 1 0 95 96 0 0 1 96 97 0 1 0 97 98 0 0 0 98 99 0 0 0 99 100 0 0 1 100 101 0 0 1 101 102 0 0 0 102 103 0 0 0 103 104 0 0 0 104 105 0 1 0 105 106 0 0 0 106 107 0 0 0 107 108 0 1 0 108 109 0 0 0 109 110 0 0 0 110 111 0 1 0 111 112 0 1 0 112 113 0 0 0 113 114 0 1 0 114 115 0 0 0 115 116 0 0 0 116 117 0 0 1 117 118 0 0 0 118 119 0 0 0 119 120 0 0 1 120 121 0 0 0 121 122 0 0 0 122 123 0 1 0 123 124 0 0 1 124 125 0 0 1 125 126 0 1 0 126 127 0 0 0 127 128 0 0 1 128 129 0 0 0 129 130 0 0 1 130 131 0 0 0 131 132 0 0 1 132 133 0 0 0 133 134 0 0 0 134 135 0 0 0 135 136 0 0 0 136 137 0 0 1 137 138 0 1 1 138 139 0 1 0 139 140 0 0 0 140 141 0 0 1 141 142 0 1 1 142 143 0 0 0 143 144 0 0 1 144 145 0 0 0 145 146 0 1 1 146 147 0 1 0 147 148 0 1 0 148 149 0 0 0 149 150 0 0 1 150 151 0 0 1 151 152 0 0 0 152 153 0 0 0 153 154 0 0 0 154 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) T20 Outcome t 0.350713 -0.036163 0.027423 -0.002687 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.36202 -0.22163 -0.07262 0.02198 0.86424 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.3507133 0.0608569 5.763 4.54e-08 *** T20 -0.0361628 0.0925494 -0.391 0.697 Outcome 0.0274233 0.0561358 0.489 0.626 t -0.0026869 0.0006505 -4.131 5.99e-05 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.338 on 150 degrees of freedom Multiple R-squared: 0.1243, Adjusted R-squared: 0.1068 F-statistic: 7.096 on 3 and 150 DF, p-value: 0.0001721 > 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.5097214 9.805572e-01 4.902786e-01 [2,] 0.9799586 4.008287e-02 2.004144e-02 [3,] 0.9769596 4.608086e-02 2.304043e-02 [4,] 0.9588752 8.224960e-02 4.112480e-02 [5,] 0.9914202 1.715960e-02 8.579798e-03 [6,] 0.9886113 2.277750e-02 1.138875e-02 [7,] 0.9835168 3.296634e-02 1.648317e-02 [8,] 0.9943048 1.139036e-02 5.695179e-03 [9,] 0.9940910 1.181804e-02 5.909021e-03 [10,] 0.9967468 6.506411e-03 3.253206e-03 [11,] 0.9977896 4.420763e-03 2.210381e-03 [12,] 0.9980789 3.842168e-03 1.921084e-03 [13,] 0.9990537 1.892693e-03 9.463463e-04 [14,] 0.9992684 1.463254e-03 7.316269e-04 [15,] 0.9996486 7.027600e-04 3.513800e-04 [16,] 0.9997617 4.766656e-04 2.383328e-04 [17,] 0.9997849 4.302337e-04 2.151168e-04 [18,] 0.9997711 4.577035e-04 2.288518e-04 [19,] 0.9999077 1.845028e-04 9.225139e-05 [20,] 0.9999158 1.684475e-04 8.422374e-05 [21,] 0.9999093 1.813130e-04 9.065650e-05 [22,] 0.9998912 2.176908e-04 1.088454e-04 [23,] 0.9998662 2.676240e-04 1.338120e-04 [24,] 0.9998203 3.593527e-04 1.796764e-04 [25,] 0.9997517 4.965256e-04 2.482628e-04 [26,] 0.9996540 6.919106e-04 3.459553e-04 [27,] 0.9995194 9.612155e-04 4.806077e-04 [28,] 0.9998892 2.216723e-04 1.108362e-04 [29,] 0.9998472 3.056634e-04 1.528317e-04 [30,] 0.9997904 4.192153e-04 2.096076e-04 [31,] 0.9999657 6.863427e-05 3.431714e-05 [32,] 0.9999584 8.310411e-05 4.155205e-05 [33,] 0.9999480 1.040654e-04 5.203270e-05 [34,] 0.9999915 1.692967e-05 8.464833e-06 [35,] 0.9999894 2.114760e-05 1.057380e-05 [36,] 0.9999866 2.689163e-05 1.344582e-05 [37,] 0.9999828 3.440548e-05 1.720274e-05 [38,] 0.9999975 5.035128e-06 2.517564e-06 [39,] 0.9999967 6.559818e-06 3.279909e-06 [40,] 0.9999958 8.406030e-06 4.203015e-06 [41,] 0.9999944 1.122278e-05 5.611390e-06 [42,] 0.9999928 1.431097e-05 7.155484e-06 [43,] 0.9999910 1.798077e-05 8.990387e-06 [44,] 0.9999880 2.397480e-05 1.198740e-05 [45,] 0.9999987 2.587981e-06 1.293990e-06 [46,] 0.9999999 2.149567e-07 1.074784e-07 [47,] 0.9999999 2.724782e-07 1.362391e-07 [48,] 0.9999998 3.692735e-07 1.846367e-07 [49,] 0.9999997 5.086956e-07 2.543478e-07 [50,] 1.0000000 3.499839e-08 1.749920e-08 [51,] 1.0000000 4.518766e-08 2.259383e-08 [52,] 1.0000000 5.731238e-08 2.865619e-08 [53,] 1.0000000 7.085482e-08 3.542741e-08 [54,] 1.0000000 3.404062e-09 1.702031e-09 [55,] 1.0000000 8.101088e-11 4.050544e-11 [56,] 1.0000000 1.231892e-10 6.159458e-11 [57,] 1.0000000 1.913028e-10 9.565138e-11 [58,] 1.0000000 1.386862e-12 6.934312e-13 [59,] 1.0000000 2.331489e-12 1.165744e-12 [60,] 1.0000000 3.969728e-12 1.984864e-12 [61,] 1.0000000 2.441659e-15 1.220830e-15 [62,] 1.0000000 4.748212e-15 2.374106e-15 [63,] 1.0000000 8.392889e-15 4.196444e-15 [64,] 1.0000000 1.661687e-14 8.308436e-15 [65,] 1.0000000 3.306385e-14 1.653193e-14 [66,] 1.0000000 5.852148e-14 2.926074e-14 [67,] 1.0000000 1.020823e-13 5.104117e-14 [68,] 1.0000000 2.014107e-13 1.007054e-13 [69,] 1.0000000 3.419177e-13 1.709588e-13 [70,] 1.0000000 1.932757e-17 9.663785e-18 [71,] 1.0000000 4.170605e-17 2.085302e-17 [72,] 1.0000000 8.823829e-17 4.411915e-17 [73,] 1.0000000 4.342575e-25 2.171288e-25 [74,] 1.0000000 0.000000e+00 0.000000e+00 [75,] 1.0000000 0.000000e+00 0.000000e+00 [76,] 1.0000000 0.000000e+00 0.000000e+00 [77,] 1.0000000 0.000000e+00 0.000000e+00 [78,] 1.0000000 0.000000e+00 0.000000e+00 [79,] 1.0000000 0.000000e+00 0.000000e+00 [80,] 1.0000000 0.000000e+00 0.000000e+00 [81,] 1.0000000 0.000000e+00 0.000000e+00 [82,] 1.0000000 0.000000e+00 0.000000e+00 [83,] 1.0000000 0.000000e+00 0.000000e+00 [84,] 1.0000000 0.000000e+00 0.000000e+00 [85,] 1.0000000 0.000000e+00 0.000000e+00 [86,] 1.0000000 0.000000e+00 0.000000e+00 [87,] 1.0000000 0.000000e+00 0.000000e+00 [88,] 1.0000000 0.000000e+00 0.000000e+00 [89,] 1.0000000 0.000000e+00 0.000000e+00 [90,] 1.0000000 0.000000e+00 0.000000e+00 [91,] 1.0000000 0.000000e+00 0.000000e+00 [92,] 1.0000000 0.000000e+00 0.000000e+00 [93,] 1.0000000 0.000000e+00 0.000000e+00 [94,] 1.0000000 0.000000e+00 0.000000e+00 [95,] 1.0000000 0.000000e+00 0.000000e+00 [96,] 1.0000000 0.000000e+00 0.000000e+00 [97,] 1.0000000 0.000000e+00 0.000000e+00 [98,] 1.0000000 0.000000e+00 0.000000e+00 [99,] 1.0000000 0.000000e+00 0.000000e+00 [100,] 1.0000000 0.000000e+00 0.000000e+00 [101,] 1.0000000 0.000000e+00 0.000000e+00 [102,] 1.0000000 0.000000e+00 0.000000e+00 [103,] 1.0000000 0.000000e+00 0.000000e+00 [104,] 1.0000000 0.000000e+00 0.000000e+00 [105,] 1.0000000 0.000000e+00 0.000000e+00 [106,] 1.0000000 0.000000e+00 0.000000e+00 [107,] 1.0000000 0.000000e+00 0.000000e+00 [108,] 1.0000000 0.000000e+00 0.000000e+00 [109,] 1.0000000 0.000000e+00 0.000000e+00 [110,] 1.0000000 0.000000e+00 0.000000e+00 [111,] 1.0000000 0.000000e+00 0.000000e+00 [112,] 1.0000000 0.000000e+00 0.000000e+00 [113,] 1.0000000 0.000000e+00 0.000000e+00 [114,] 1.0000000 0.000000e+00 0.000000e+00 [115,] 1.0000000 0.000000e+00 0.000000e+00 [116,] 1.0000000 0.000000e+00 0.000000e+00 [117,] 1.0000000 0.000000e+00 0.000000e+00 [118,] 1.0000000 0.000000e+00 0.000000e+00 [119,] 1.0000000 0.000000e+00 0.000000e+00 [120,] 1.0000000 0.000000e+00 0.000000e+00 [121,] 1.0000000 0.000000e+00 0.000000e+00 [122,] 1.0000000 0.000000e+00 0.000000e+00 [123,] 1.0000000 0.000000e+00 0.000000e+00 [124,] 1.0000000 0.000000e+00 0.000000e+00 [125,] 1.0000000 0.000000e+00 0.000000e+00 [126,] 1.0000000 0.000000e+00 0.000000e+00 [127,] 1.0000000 0.000000e+00 0.000000e+00 [128,] 1.0000000 0.000000e+00 0.000000e+00 [129,] 1.0000000 0.000000e+00 0.000000e+00 [130,] 1.0000000 0.000000e+00 0.000000e+00 [131,] 1.0000000 0.000000e+00 0.000000e+00 [132,] 1.0000000 0.000000e+00 0.000000e+00 [133,] 1.0000000 0.000000e+00 0.000000e+00 [134,] 1.0000000 0.000000e+00 0.000000e+00 [135,] 1.0000000 0.000000e+00 0.000000e+00 [136,] 1.0000000 0.000000e+00 0.000000e+00 [137,] 1.0000000 0.000000e+00 0.000000e+00 [138,] 1.0000000 0.000000e+00 0.000000e+00 [139,] 1.0000000 0.000000e+00 0.000000e+00 [140,] 1.0000000 0.000000e+00 0.000000e+00 [141,] 1.0000000 0.000000e+00 0.000000e+00 > postscript(file="/var/fisher/rcomp/tmp/17qi21356041101.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/fisher/rcomp/tmp/2wbgy1356041101.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/fisher/rcomp/tmp/3xw941356041101.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/fisher/rcomp/tmp/42ssn1356041101.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/fisher/rcomp/tmp/5h0dn1356041101.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 = 154 Frequency = 1 1 2 3 4 5 0.6245502964 -0.3453394936 -0.3426526151 -0.3399657365 -0.3372788579 6 7 8 9 10 -0.3620153108 -0.3319051008 0.6707817777 -0.3539546752 -0.3238444652 11 12 13 14 15 0.6788424134 -0.3184707080 -0.3157838295 0.6869030491 -0.3378334038 16 17 18 19 20 0.6648534747 0.6949636848 0.6976505633 -0.3270858896 0.6756009890 21 22 23 24 25 -0.2942888010 -0.3190252539 -0.3163383754 -0.3136514968 0.6890353818 26 27 28 29 30 -0.2808544082 -0.3055908611 -0.2754806511 -0.3002171040 -0.2701068940 31 32 33 34 35 -0.2674200154 -0.2647331369 -0.2620462583 0.7132172888 -0.2566725012 36 37 38 39 40 -0.2539856226 0.7487012559 -0.2760351970 -0.2733483184 0.7567618916 41 42 43 44 45 -0.2679745613 -0.2652876827 -0.2626008042 0.7675094058 -0.2298037156 46 47 48 49 50 -0.2545401685 -0.2244299585 -0.2491664114 -0.2464795328 -0.2163693228 51 52 53 54 55 0.7863175558 0.7890044343 -0.2357320186 -0.2056218086 -0.2029349300 56 57 58 59 60 0.7723286171 -0.2249845044 -0.2222976258 -0.2196107472 0.7830761313 61 62 63 64 65 0.7857630099 -0.1841267801 -0.1814399015 0.7938236456 -0.1760661444 66 67 68 69 70 -0.1733792659 0.8293076127 -0.1680055088 -0.1927419617 -0.1626317516 71 72 73 74 75 -0.1599448731 -0.1846813260 -0.1819944474 -0.1518842374 -0.1766206903 76 77 78 79 80 0.8260661883 -0.1712469332 -0.1685600546 0.8341268239 0.8642370339 81 82 83 84 85 -0.1330760875 -0.1578125404 -0.1277023304 -0.1250154518 -0.1497519047 86 87 88 89 90 -0.1196416947 -0.1443781476 -0.1055284316 -0.1115810590 -0.1363175119 91 92 93 94 95 -0.1062073019 -0.0673575859 -0.1008335448 -0.0981466662 -0.0592969503 96 97 98 99 100 -0.1201962406 -0.0539231931 -0.0873991520 -0.0847122734 -0.1094487263 101 102 103 104 105 -0.1067618478 -0.0766516378 -0.0739647592 -0.0712778806 -0.0324281647 106 107 108 109 110 -0.0659041235 -0.0632172450 -0.0243675290 -0.0578434879 -0.0551566093 111 112 113 114 115 -0.0163068933 -0.0136200148 -0.0470959736 -0.0082462577 -0.0417222165 116 117 118 119 120 -0.0390353379 -0.0637717908 -0.0336615808 -0.0309747023 -0.0557111552 121 122 123 124 125 -0.0256009451 -0.0229140666 0.0159356494 -0.0449636409 -0.0422767624 126 127 128 129 130 0.0239962850 -0.0094796738 -0.0342161267 -0.0041059167 -0.0288423696 131 132 133 134 135 0.0012678404 -0.0234686125 0.0066415976 0.0093284761 0.0120153547 136 137 138 139 140 0.0147022332 -0.0100342197 0.0288154963 0.0589257063 0.0254497475 141 142 143 144 145 0.0007132946 0.0395630105 0.0335103831 0.0087739302 0.0388841403 146 147 148 149 150 0.0503105248 0.0804207348 0.0831076133 0.0496316545 0.0248952016 151 152 153 154 0.0275820802 0.0576922902 0.0603791687 0.0630660473 > postscript(file="/var/fisher/rcomp/tmp/6lwb31356041101.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 = 154 Frequency = 1 lag(myerror, k = 1) myerror 0 0.6245502964 NA 1 -0.3453394936 0.6245502964 2 -0.3426526151 -0.3453394936 3 -0.3399657365 -0.3426526151 4 -0.3372788579 -0.3399657365 5 -0.3620153108 -0.3372788579 6 -0.3319051008 -0.3620153108 7 0.6707817777 -0.3319051008 8 -0.3539546752 0.6707817777 9 -0.3238444652 -0.3539546752 10 0.6788424134 -0.3238444652 11 -0.3184707080 0.6788424134 12 -0.3157838295 -0.3184707080 13 0.6869030491 -0.3157838295 14 -0.3378334038 0.6869030491 15 0.6648534747 -0.3378334038 16 0.6949636848 0.6648534747 17 0.6976505633 0.6949636848 18 -0.3270858896 0.6976505633 19 0.6756009890 -0.3270858896 20 -0.2942888010 0.6756009890 21 -0.3190252539 -0.2942888010 22 -0.3163383754 -0.3190252539 23 -0.3136514968 -0.3163383754 24 0.6890353818 -0.3136514968 25 -0.2808544082 0.6890353818 26 -0.3055908611 -0.2808544082 27 -0.2754806511 -0.3055908611 28 -0.3002171040 -0.2754806511 29 -0.2701068940 -0.3002171040 30 -0.2674200154 -0.2701068940 31 -0.2647331369 -0.2674200154 32 -0.2620462583 -0.2647331369 33 0.7132172888 -0.2620462583 34 -0.2566725012 0.7132172888 35 -0.2539856226 -0.2566725012 36 0.7487012559 -0.2539856226 37 -0.2760351970 0.7487012559 38 -0.2733483184 -0.2760351970 39 0.7567618916 -0.2733483184 40 -0.2679745613 0.7567618916 41 -0.2652876827 -0.2679745613 42 -0.2626008042 -0.2652876827 43 0.7675094058 -0.2626008042 44 -0.2298037156 0.7675094058 45 -0.2545401685 -0.2298037156 46 -0.2244299585 -0.2545401685 47 -0.2491664114 -0.2244299585 48 -0.2464795328 -0.2491664114 49 -0.2163693228 -0.2464795328 50 0.7863175558 -0.2163693228 51 0.7890044343 0.7863175558 52 -0.2357320186 0.7890044343 53 -0.2056218086 -0.2357320186 54 -0.2029349300 -0.2056218086 55 0.7723286171 -0.2029349300 56 -0.2249845044 0.7723286171 57 -0.2222976258 -0.2249845044 58 -0.2196107472 -0.2222976258 59 0.7830761313 -0.2196107472 60 0.7857630099 0.7830761313 61 -0.1841267801 0.7857630099 62 -0.1814399015 -0.1841267801 63 0.7938236456 -0.1814399015 64 -0.1760661444 0.7938236456 65 -0.1733792659 -0.1760661444 66 0.8293076127 -0.1733792659 67 -0.1680055088 0.8293076127 68 -0.1927419617 -0.1680055088 69 -0.1626317516 -0.1927419617 70 -0.1599448731 -0.1626317516 71 -0.1846813260 -0.1599448731 72 -0.1819944474 -0.1846813260 73 -0.1518842374 -0.1819944474 74 -0.1766206903 -0.1518842374 75 0.8260661883 -0.1766206903 76 -0.1712469332 0.8260661883 77 -0.1685600546 -0.1712469332 78 0.8341268239 -0.1685600546 79 0.8642370339 0.8341268239 80 -0.1330760875 0.8642370339 81 -0.1578125404 -0.1330760875 82 -0.1277023304 -0.1578125404 83 -0.1250154518 -0.1277023304 84 -0.1497519047 -0.1250154518 85 -0.1196416947 -0.1497519047 86 -0.1443781476 -0.1196416947 87 -0.1055284316 -0.1443781476 88 -0.1115810590 -0.1055284316 89 -0.1363175119 -0.1115810590 90 -0.1062073019 -0.1363175119 91 -0.0673575859 -0.1062073019 92 -0.1008335448 -0.0673575859 93 -0.0981466662 -0.1008335448 94 -0.0592969503 -0.0981466662 95 -0.1201962406 -0.0592969503 96 -0.0539231931 -0.1201962406 97 -0.0873991520 -0.0539231931 98 -0.0847122734 -0.0873991520 99 -0.1094487263 -0.0847122734 100 -0.1067618478 -0.1094487263 101 -0.0766516378 -0.1067618478 102 -0.0739647592 -0.0766516378 103 -0.0712778806 -0.0739647592 104 -0.0324281647 -0.0712778806 105 -0.0659041235 -0.0324281647 106 -0.0632172450 -0.0659041235 107 -0.0243675290 -0.0632172450 108 -0.0578434879 -0.0243675290 109 -0.0551566093 -0.0578434879 110 -0.0163068933 -0.0551566093 111 -0.0136200148 -0.0163068933 112 -0.0470959736 -0.0136200148 113 -0.0082462577 -0.0470959736 114 -0.0417222165 -0.0082462577 115 -0.0390353379 -0.0417222165 116 -0.0637717908 -0.0390353379 117 -0.0336615808 -0.0637717908 118 -0.0309747023 -0.0336615808 119 -0.0557111552 -0.0309747023 120 -0.0256009451 -0.0557111552 121 -0.0229140666 -0.0256009451 122 0.0159356494 -0.0229140666 123 -0.0449636409 0.0159356494 124 -0.0422767624 -0.0449636409 125 0.0239962850 -0.0422767624 126 -0.0094796738 0.0239962850 127 -0.0342161267 -0.0094796738 128 -0.0041059167 -0.0342161267 129 -0.0288423696 -0.0041059167 130 0.0012678404 -0.0288423696 131 -0.0234686125 0.0012678404 132 0.0066415976 -0.0234686125 133 0.0093284761 0.0066415976 134 0.0120153547 0.0093284761 135 0.0147022332 0.0120153547 136 -0.0100342197 0.0147022332 137 0.0288154963 -0.0100342197 138 0.0589257063 0.0288154963 139 0.0254497475 0.0589257063 140 0.0007132946 0.0254497475 141 0.0395630105 0.0007132946 142 0.0335103831 0.0395630105 143 0.0087739302 0.0335103831 144 0.0388841403 0.0087739302 145 0.0503105248 0.0388841403 146 0.0804207348 0.0503105248 147 0.0831076133 0.0804207348 148 0.0496316545 0.0831076133 149 0.0248952016 0.0496316545 150 0.0275820802 0.0248952016 151 0.0576922902 0.0275820802 152 0.0603791687 0.0576922902 153 0.0630660473 0.0603791687 154 NA 0.0630660473 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.3453394936 0.6245502964 [2,] -0.3426526151 -0.3453394936 [3,] -0.3399657365 -0.3426526151 [4,] -0.3372788579 -0.3399657365 [5,] -0.3620153108 -0.3372788579 [6,] -0.3319051008 -0.3620153108 [7,] 0.6707817777 -0.3319051008 [8,] -0.3539546752 0.6707817777 [9,] -0.3238444652 -0.3539546752 [10,] 0.6788424134 -0.3238444652 [11,] -0.3184707080 0.6788424134 [12,] -0.3157838295 -0.3184707080 [13,] 0.6869030491 -0.3157838295 [14,] -0.3378334038 0.6869030491 [15,] 0.6648534747 -0.3378334038 [16,] 0.6949636848 0.6648534747 [17,] 0.6976505633 0.6949636848 [18,] -0.3270858896 0.6976505633 [19,] 0.6756009890 -0.3270858896 [20,] -0.2942888010 0.6756009890 [21,] -0.3190252539 -0.2942888010 [22,] -0.3163383754 -0.3190252539 [23,] -0.3136514968 -0.3163383754 [24,] 0.6890353818 -0.3136514968 [25,] -0.2808544082 0.6890353818 [26,] -0.3055908611 -0.2808544082 [27,] -0.2754806511 -0.3055908611 [28,] -0.3002171040 -0.2754806511 [29,] -0.2701068940 -0.3002171040 [30,] -0.2674200154 -0.2701068940 [31,] -0.2647331369 -0.2674200154 [32,] -0.2620462583 -0.2647331369 [33,] 0.7132172888 -0.2620462583 [34,] -0.2566725012 0.7132172888 [35,] -0.2539856226 -0.2566725012 [36,] 0.7487012559 -0.2539856226 [37,] -0.2760351970 0.7487012559 [38,] -0.2733483184 -0.2760351970 [39,] 0.7567618916 -0.2733483184 [40,] -0.2679745613 0.7567618916 [41,] -0.2652876827 -0.2679745613 [42,] -0.2626008042 -0.2652876827 [43,] 0.7675094058 -0.2626008042 [44,] -0.2298037156 0.7675094058 [45,] -0.2545401685 -0.2298037156 [46,] -0.2244299585 -0.2545401685 [47,] -0.2491664114 -0.2244299585 [48,] -0.2464795328 -0.2491664114 [49,] -0.2163693228 -0.2464795328 [50,] 0.7863175558 -0.2163693228 [51,] 0.7890044343 0.7863175558 [52,] -0.2357320186 0.7890044343 [53,] -0.2056218086 -0.2357320186 [54,] -0.2029349300 -0.2056218086 [55,] 0.7723286171 -0.2029349300 [56,] -0.2249845044 0.7723286171 [57,] -0.2222976258 -0.2249845044 [58,] -0.2196107472 -0.2222976258 [59,] 0.7830761313 -0.2196107472 [60,] 0.7857630099 0.7830761313 [61,] -0.1841267801 0.7857630099 [62,] -0.1814399015 -0.1841267801 [63,] 0.7938236456 -0.1814399015 [64,] -0.1760661444 0.7938236456 [65,] -0.1733792659 -0.1760661444 [66,] 0.8293076127 -0.1733792659 [67,] -0.1680055088 0.8293076127 [68,] -0.1927419617 -0.1680055088 [69,] -0.1626317516 -0.1927419617 [70,] -0.1599448731 -0.1626317516 [71,] -0.1846813260 -0.1599448731 [72,] -0.1819944474 -0.1846813260 [73,] -0.1518842374 -0.1819944474 [74,] -0.1766206903 -0.1518842374 [75,] 0.8260661883 -0.1766206903 [76,] -0.1712469332 0.8260661883 [77,] -0.1685600546 -0.1712469332 [78,] 0.8341268239 -0.1685600546 [79,] 0.8642370339 0.8341268239 [80,] -0.1330760875 0.8642370339 [81,] -0.1578125404 -0.1330760875 [82,] -0.1277023304 -0.1578125404 [83,] -0.1250154518 -0.1277023304 [84,] -0.1497519047 -0.1250154518 [85,] -0.1196416947 -0.1497519047 [86,] -0.1443781476 -0.1196416947 [87,] -0.1055284316 -0.1443781476 [88,] -0.1115810590 -0.1055284316 [89,] -0.1363175119 -0.1115810590 [90,] -0.1062073019 -0.1363175119 [91,] -0.0673575859 -0.1062073019 [92,] -0.1008335448 -0.0673575859 [93,] -0.0981466662 -0.1008335448 [94,] -0.0592969503 -0.0981466662 [95,] -0.1201962406 -0.0592969503 [96,] -0.0539231931 -0.1201962406 [97,] -0.0873991520 -0.0539231931 [98,] -0.0847122734 -0.0873991520 [99,] -0.1094487263 -0.0847122734 [100,] -0.1067618478 -0.1094487263 [101,] -0.0766516378 -0.1067618478 [102,] -0.0739647592 -0.0766516378 [103,] -0.0712778806 -0.0739647592 [104,] -0.0324281647 -0.0712778806 [105,] -0.0659041235 -0.0324281647 [106,] -0.0632172450 -0.0659041235 [107,] -0.0243675290 -0.0632172450 [108,] -0.0578434879 -0.0243675290 [109,] -0.0551566093 -0.0578434879 [110,] -0.0163068933 -0.0551566093 [111,] -0.0136200148 -0.0163068933 [112,] -0.0470959736 -0.0136200148 [113,] -0.0082462577 -0.0470959736 [114,] -0.0417222165 -0.0082462577 [115,] -0.0390353379 -0.0417222165 [116,] -0.0637717908 -0.0390353379 [117,] -0.0336615808 -0.0637717908 [118,] -0.0309747023 -0.0336615808 [119,] -0.0557111552 -0.0309747023 [120,] -0.0256009451 -0.0557111552 [121,] -0.0229140666 -0.0256009451 [122,] 0.0159356494 -0.0229140666 [123,] -0.0449636409 0.0159356494 [124,] -0.0422767624 -0.0449636409 [125,] 0.0239962850 -0.0422767624 [126,] -0.0094796738 0.0239962850 [127,] -0.0342161267 -0.0094796738 [128,] -0.0041059167 -0.0342161267 [129,] -0.0288423696 -0.0041059167 [130,] 0.0012678404 -0.0288423696 [131,] -0.0234686125 0.0012678404 [132,] 0.0066415976 -0.0234686125 [133,] 0.0093284761 0.0066415976 [134,] 0.0120153547 0.0093284761 [135,] 0.0147022332 0.0120153547 [136,] -0.0100342197 0.0147022332 [137,] 0.0288154963 -0.0100342197 [138,] 0.0589257063 0.0288154963 [139,] 0.0254497475 0.0589257063 [140,] 0.0007132946 0.0254497475 [141,] 0.0395630105 0.0007132946 [142,] 0.0335103831 0.0395630105 [143,] 0.0087739302 0.0335103831 [144,] 0.0388841403 0.0087739302 [145,] 0.0503105248 0.0388841403 [146,] 0.0804207348 0.0503105248 [147,] 0.0831076133 0.0804207348 [148,] 0.0496316545 0.0831076133 [149,] 0.0248952016 0.0496316545 [150,] 0.0275820802 0.0248952016 [151,] 0.0576922902 0.0275820802 [152,] 0.0603791687 0.0576922902 [153,] 0.0630660473 0.0603791687 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.3453394936 0.6245502964 2 -0.3426526151 -0.3453394936 3 -0.3399657365 -0.3426526151 4 -0.3372788579 -0.3399657365 5 -0.3620153108 -0.3372788579 6 -0.3319051008 -0.3620153108 7 0.6707817777 -0.3319051008 8 -0.3539546752 0.6707817777 9 -0.3238444652 -0.3539546752 10 0.6788424134 -0.3238444652 11 -0.3184707080 0.6788424134 12 -0.3157838295 -0.3184707080 13 0.6869030491 -0.3157838295 14 -0.3378334038 0.6869030491 15 0.6648534747 -0.3378334038 16 0.6949636848 0.6648534747 17 0.6976505633 0.6949636848 18 -0.3270858896 0.6976505633 19 0.6756009890 -0.3270858896 20 -0.2942888010 0.6756009890 21 -0.3190252539 -0.2942888010 22 -0.3163383754 -0.3190252539 23 -0.3136514968 -0.3163383754 24 0.6890353818 -0.3136514968 25 -0.2808544082 0.6890353818 26 -0.3055908611 -0.2808544082 27 -0.2754806511 -0.3055908611 28 -0.3002171040 -0.2754806511 29 -0.2701068940 -0.3002171040 30 -0.2674200154 -0.2701068940 31 -0.2647331369 -0.2674200154 32 -0.2620462583 -0.2647331369 33 0.7132172888 -0.2620462583 34 -0.2566725012 0.7132172888 35 -0.2539856226 -0.2566725012 36 0.7487012559 -0.2539856226 37 -0.2760351970 0.7487012559 38 -0.2733483184 -0.2760351970 39 0.7567618916 -0.2733483184 40 -0.2679745613 0.7567618916 41 -0.2652876827 -0.2679745613 42 -0.2626008042 -0.2652876827 43 0.7675094058 -0.2626008042 44 -0.2298037156 0.7675094058 45 -0.2545401685 -0.2298037156 46 -0.2244299585 -0.2545401685 47 -0.2491664114 -0.2244299585 48 -0.2464795328 -0.2491664114 49 -0.2163693228 -0.2464795328 50 0.7863175558 -0.2163693228 51 0.7890044343 0.7863175558 52 -0.2357320186 0.7890044343 53 -0.2056218086 -0.2357320186 54 -0.2029349300 -0.2056218086 55 0.7723286171 -0.2029349300 56 -0.2249845044 0.7723286171 57 -0.2222976258 -0.2249845044 58 -0.2196107472 -0.2222976258 59 0.7830761313 -0.2196107472 60 0.7857630099 0.7830761313 61 -0.1841267801 0.7857630099 62 -0.1814399015 -0.1841267801 63 0.7938236456 -0.1814399015 64 -0.1760661444 0.7938236456 65 -0.1733792659 -0.1760661444 66 0.8293076127 -0.1733792659 67 -0.1680055088 0.8293076127 68 -0.1927419617 -0.1680055088 69 -0.1626317516 -0.1927419617 70 -0.1599448731 -0.1626317516 71 -0.1846813260 -0.1599448731 72 -0.1819944474 -0.1846813260 73 -0.1518842374 -0.1819944474 74 -0.1766206903 -0.1518842374 75 0.8260661883 -0.1766206903 76 -0.1712469332 0.8260661883 77 -0.1685600546 -0.1712469332 78 0.8341268239 -0.1685600546 79 0.8642370339 0.8341268239 80 -0.1330760875 0.8642370339 81 -0.1578125404 -0.1330760875 82 -0.1277023304 -0.1578125404 83 -0.1250154518 -0.1277023304 84 -0.1497519047 -0.1250154518 85 -0.1196416947 -0.1497519047 86 -0.1443781476 -0.1196416947 87 -0.1055284316 -0.1443781476 88 -0.1115810590 -0.1055284316 89 -0.1363175119 -0.1115810590 90 -0.1062073019 -0.1363175119 91 -0.0673575859 -0.1062073019 92 -0.1008335448 -0.0673575859 93 -0.0981466662 -0.1008335448 94 -0.0592969503 -0.0981466662 95 -0.1201962406 -0.0592969503 96 -0.0539231931 -0.1201962406 97 -0.0873991520 -0.0539231931 98 -0.0847122734 -0.0873991520 99 -0.1094487263 -0.0847122734 100 -0.1067618478 -0.1094487263 101 -0.0766516378 -0.1067618478 102 -0.0739647592 -0.0766516378 103 -0.0712778806 -0.0739647592 104 -0.0324281647 -0.0712778806 105 -0.0659041235 -0.0324281647 106 -0.0632172450 -0.0659041235 107 -0.0243675290 -0.0632172450 108 -0.0578434879 -0.0243675290 109 -0.0551566093 -0.0578434879 110 -0.0163068933 -0.0551566093 111 -0.0136200148 -0.0163068933 112 -0.0470959736 -0.0136200148 113 -0.0082462577 -0.0470959736 114 -0.0417222165 -0.0082462577 115 -0.0390353379 -0.0417222165 116 -0.0637717908 -0.0390353379 117 -0.0336615808 -0.0637717908 118 -0.0309747023 -0.0336615808 119 -0.0557111552 -0.0309747023 120 -0.0256009451 -0.0557111552 121 -0.0229140666 -0.0256009451 122 0.0159356494 -0.0229140666 123 -0.0449636409 0.0159356494 124 -0.0422767624 -0.0449636409 125 0.0239962850 -0.0422767624 126 -0.0094796738 0.0239962850 127 -0.0342161267 -0.0094796738 128 -0.0041059167 -0.0342161267 129 -0.0288423696 -0.0041059167 130 0.0012678404 -0.0288423696 131 -0.0234686125 0.0012678404 132 0.0066415976 -0.0234686125 133 0.0093284761 0.0066415976 134 0.0120153547 0.0093284761 135 0.0147022332 0.0120153547 136 -0.0100342197 0.0147022332 137 0.0288154963 -0.0100342197 138 0.0589257063 0.0288154963 139 0.0254497475 0.0589257063 140 0.0007132946 0.0254497475 141 0.0395630105 0.0007132946 142 0.0335103831 0.0395630105 143 0.0087739302 0.0335103831 144 0.0388841403 0.0087739302 145 0.0503105248 0.0388841403 146 0.0804207348 0.0503105248 147 0.0831076133 0.0804207348 148 0.0496316545 0.0831076133 149 0.0248952016 0.0496316545 150 0.0275820802 0.0248952016 151 0.0576922902 0.0275820802 152 0.0603791687 0.0576922902 153 0.0630660473 0.0603791687 > 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/fisher/rcomp/tmp/72fa71356041101.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/fisher/rcomp/tmp/8vduc1356041101.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/fisher/rcomp/tmp/92puj1356041101.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/fisher/rcomp/tmp/107w901356041101.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/11gd8k1356041101.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/fisher/rcomp/tmp/12cmeq1356041101.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/fisher/rcomp/tmp/134pr71356041101.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/fisher/rcomp/tmp/14i2jk1356041101.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/fisher/rcomp/tmp/15xzy41356041101.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/fisher/rcomp/tmp/166ihg1356041101.tab") + } > > try(system("convert tmp/17qi21356041101.ps tmp/17qi21356041101.png",intern=TRUE)) character(0) > try(system("convert tmp/2wbgy1356041101.ps tmp/2wbgy1356041101.png",intern=TRUE)) character(0) > try(system("convert tmp/3xw941356041101.ps tmp/3xw941356041101.png",intern=TRUE)) character(0) > try(system("convert tmp/42ssn1356041101.ps tmp/42ssn1356041101.png",intern=TRUE)) character(0) > try(system("convert tmp/5h0dn1356041101.ps tmp/5h0dn1356041101.png",intern=TRUE)) character(0) > try(system("convert tmp/6lwb31356041101.ps tmp/6lwb31356041101.png",intern=TRUE)) character(0) > try(system("convert tmp/72fa71356041101.ps tmp/72fa71356041101.png",intern=TRUE)) character(0) > try(system("convert tmp/8vduc1356041101.ps tmp/8vduc1356041101.png",intern=TRUE)) character(0) > try(system("convert tmp/92puj1356041101.ps tmp/92puj1356041101.png",intern=TRUE)) character(0) > try(system("convert tmp/107w901356041101.ps tmp/107w901356041101.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.605 1.996 10.594