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(2.6 + ,2.8 + ,2.5 + ,2.5 + ,2.6 + ,2.8 + ,2.4 + ,2.6 + ,2.6 + ,2.9 + ,2.6 + ,2.6 + ,2.0 + ,2.3 + ,2.2 + ,2.4 + ,2.2 + ,2.3 + ,2.2 + ,2.4 + ,2.6 + ,2.8 + ,2.7 + ,2.4 + ,2.9 + ,3.2 + ,3.0 + ,2.6 + ,3.1 + ,3.4 + ,3.1 + ,2.7 + ,3.3 + ,3.7 + ,3.4 + ,2.7 + ,3.3 + ,3.6 + ,3.4 + ,2.7 + ,3.2 + ,3.5 + ,3.2 + ,2.7 + ,3.7 + ,3.8 + ,3.4 + ,3.0 + ,3.4 + ,3.6 + ,3.1 + ,3.0 + ,3.4 + ,3.6 + ,3.0 + ,3.0 + ,3.4 + ,3.6 + ,3.1 + ,2.5 + ,4.0 + ,3.8 + ,3.3 + ,2.6 + ,3.4 + ,3.7 + ,3.3 + ,2.7 + ,3.1 + ,3.3 + ,2.9 + ,2.7 + ,3.3 + ,3.4 + ,2.9 + ,2.8 + ,3.5 + ,3.5 + ,2.9 + ,2.7 + ,3.5 + ,3.4 + ,2.8 + ,2.4 + ,3.7 + ,3.2 + ,2.7 + ,2.3 + ,3.4 + ,3.1 + ,2.6 + ,2.2 + ,3.0 + ,2.9 + ,2.5 + ,1.9 + ,3.1 + ,3.0 + ,2.5 + ,1.9 + ,2.9 + ,2.9 + ,2.6 + ,1.9 + ,2.4 + ,2.3 + ,2.1 + ,1.6 + ,2.4 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,3.0 + ,2.9 + ,3.2 + ,2.8 + ,3.1 + ,3.1 + ,3.1 + ,3.1 + ,2.9 + ,2.8 + ,2.7 + ,2.7 + ,2.2 + ,2.1 + ,2.2 + ,2.2 + ,2.5 + ,2.3 + ,2.2 + ,1.9 + ,2.7 + ,2.2 + ,2.1 + ,2.0 + ,3.0 + ,2.5 + ,2.3 + ,2.5 + ,3.7 + ,3.1 + ,2.5 + ,2.5 + ,3.7 + ,3.0 + ,2.3 + ,2.4 + ,4.0 + ,3.4 + ,2.6 + ,2.5 + ,3.5 + ,2.9 + ,2.3 + ,2.0 + ,1.7 + ,2.8 + ,2.0 + ,2.0 + ,3.0 + ,2.7 + ,1.8 + ,2.1 + ,2.4 + ,2.2 + ,1.4 + ,1.7 + ,2.3 + ,2.1 + ,1.5 + ,1.7 + ,2.5 + ,2.2 + ,1.4 + ,1.9 + ,2.1 + ,1.9 + ,1.2 + ,1.9 + ,0.3 + ,1.8 + ,1.2 + ,1.8) + ,dim=c(4 + ,154) + ,dimnames=list(c('HICP_Belgie' + ,'Consumptieprijsindex_Belgie' + ,'Gezondheidsindex_Belgie' + ,'HICP_Eurogebied') + ,1:154)) > y <- array(NA,dim=c(4,154),dimnames=list(c('HICP_Belgie','Consumptieprijsindex_Belgie','Gezondheidsindex_Belgie','HICP_Eurogebied'),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 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '4' > 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 HICP_Eurogebied HICP_Belgie Consumptieprijsindex_Belgie 1 2.5 2.6 2.8 2 2.6 2.6 2.8 3 2.6 2.6 2.9 4 2.4 2.0 2.3 5 2.4 2.2 2.3 6 2.4 2.6 2.8 7 2.6 2.9 3.2 8 2.7 3.1 3.4 9 2.7 3.3 3.7 10 2.7 3.3 3.6 11 2.7 3.2 3.5 12 3.0 3.7 3.8 13 3.0 3.4 3.6 14 3.0 3.4 3.6 15 2.5 3.4 3.6 16 2.6 4.0 3.8 17 2.7 3.4 3.7 18 2.7 3.1 3.3 19 2.8 3.3 3.4 20 2.7 3.5 3.5 21 2.4 3.5 3.4 22 2.3 3.7 3.2 23 2.2 3.4 3.1 24 1.9 3.0 2.9 25 1.9 3.1 3.0 26 1.9 2.9 2.9 27 1.6 2.4 2.3 28 1.7 2.4 2.6 29 1.5 2.7 2.5 30 1.7 2.5 2.3 31 1.6 2.1 1.8 32 1.6 1.9 1.7 33 0.8 0.8 0.7 34 0.9 0.8 0.6 35 0.9 0.3 0.3 36 0.5 0.0 -0.1 37 -0.1 -0.9 -1.0 38 -0.3 -1.0 -1.2 39 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.6 1.8 112 1.9 1.4 1.5 113 1.9 1.5 1.6 114 1.8 0.9 1.0 115 2.1 1.5 1.5 116 2.4 1.7 1.8 117 2.4 1.6 1.7 118 2.1 1.2 1.2 119 2.3 1.3 1.4 120 2.3 1.1 1.1 121 2.3 1.3 1.3 122 2.1 1.2 1.3 123 2.1 1.3 1.3 124 2.0 1.1 1.3 125 1.9 0.8 0.9 126 2.0 1.4 1.3 127 2.3 1.6 1.8 128 2.5 2.5 2.7 129 2.5 2.5 2.6 130 2.6 2.6 2.9 131 2.1 2.0 2.2 132 2.0 1.8 2.1 133 2.2 1.9 2.3 134 2.2 1.9 2.3 135 2.4 2.5 2.7 136 2.5 2.8 2.6 137 2.8 3.0 2.9 138 3.1 3.1 3.1 139 2.7 2.9 2.8 140 2.2 2.2 2.1 141 1.9 2.5 2.3 142 2.0 2.7 2.2 143 2.5 3.0 2.5 144 2.5 3.7 3.1 145 2.4 3.7 3.0 146 2.5 4.0 3.4 147 2.0 3.5 2.9 148 2.0 1.7 2.8 149 2.1 3.0 2.7 150 1.7 2.4 2.2 151 1.7 2.3 2.1 152 1.9 2.5 2.2 153 1.9 2.1 1.9 154 1.8 0.3 1.8 Gezondheidsindex_Belgie 1 2.5 2 2.4 3 2.6 4 2.2 5 2.2 6 2.7 7 3.0 8 3.1 9 3.4 10 3.4 11 3.2 12 3.4 13 3.1 14 3.0 15 3.1 16 3.3 17 3.3 18 2.9 19 2.9 20 2.9 21 2.8 22 2.7 23 2.6 24 2.5 25 2.5 26 2.6 27 2.1 28 2.2 29 2.0 30 1.6 31 1.1 32 0.9 33 0.1 34 -0.1 35 -0.3 36 -0.3 37 -0.6 38 -0.6 39 -0.2 40 -0.7 41 -0.1 42 0.7 43 1.5 44 1.6 45 2.8 46 3.3 47 3.5 48 3.9 49 4.8 50 5.1 51 4.9 52 5.2 53 5.1 54 4.6 55 3.7 56 3.9 57 3.1 58 2.8 59 2.6 60 2.2 61 1.8 62 1.3 63 1.2 64 1.4 65 1.3 66 1.3 67 1.9 68 1.9 69 2.1 70 2.0 71 1.9 72 1.9 73 1.9 74 1.8 75 1.7 76 1.6 77 1.7 78 1.9 79 1.7 80 1.3 81 2.0 82 2.0 83 2.3 84 2.0 85 1.7 86 2.3 87 2.4 88 2.4 89 2.3 90 2.1 91 2.1 92 2.5 93 2.0 94 1.8 95 1.7 96 1.9 97 2.1 98 1.4 99 1.6 100 1.7 101 1.6 102 1.9 103 1.6 104 1.1 105 1.3 106 1.6 107 1.6 108 1.7 109 1.6 110 1.7 111 1.6 112 1.5 113 1.6 114 1.1 115 1.5 116 1.4 117 1.3 118 0.9 119 1.2 120 0.9 121 1.1 122 1.3 123 1.3 124 1.4 125 1.2 126 1.7 127 2.0 128 3.0 129 3.1 130 3.2 131 2.7 132 2.8 133 3.0 134 2.8 135 3.1 136 3.1 137 3.2 138 3.1 139 2.7 140 2.2 141 2.2 142 2.1 143 2.3 144 2.5 145 2.3 146 2.6 147 2.3 148 2.0 149 1.8 150 1.4 151 1.5 152 1.4 153 1.2 154 1.2 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) HICP_Belgie 0.92112 0.03742 Consumptieprijsindex_Belgie Gezondheidsindex_Belgie 0.57796 -0.09230 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.92442 -0.29484 0.05612 0.24592 0.78503 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.92112 0.06539 14.087 < 2e-16 *** HICP_Belgie 0.03742 0.09678 0.387 0.700 Consumptieprijsindex_Belgie 0.57796 0.11010 5.249 5.13e-07 *** Gezondheidsindex_Belgie -0.09230 0.07070 -1.305 0.194 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.3637 on 150 degrees of freedom Multiple R-squared: 0.7723, Adjusted R-squared: 0.7678 F-statistic: 169.6 on 3 and 150 DF, p-value: < 2.2e-16 > 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,] 3.110526e-03 6.221051e-03 9.968895e-01 [2,] 5.270236e-04 1.054047e-03 9.994730e-01 [3,] 7.000125e-05 1.400025e-04 9.999300e-01 [4,] 1.429937e-05 2.859875e-05 9.999857e-01 [5,] 1.601165e-06 3.202329e-06 9.999984e-01 [6,] 4.862081e-06 9.724162e-06 9.999951e-01 [7,] 2.243125e-06 4.486249e-06 9.999978e-01 [8,] 3.607100e-07 7.214200e-07 9.999996e-01 [9,] 2.248218e-04 4.496436e-04 9.997752e-01 [10,] 2.767920e-04 5.535840e-04 9.997232e-01 [11,] 1.229839e-04 2.459678e-04 9.998770e-01 [12,] 4.196991e-05 8.393982e-05 9.999580e-01 [13,] 1.492870e-05 2.985741e-05 9.999851e-01 [14,] 5.866450e-06 1.173290e-05 9.999941e-01 [15,] 1.380655e-05 2.761310e-05 9.999862e-01 [16,] 5.342869e-06 1.068574e-05 9.999947e-01 [17,] 4.521551e-06 9.043102e-06 9.999955e-01 [18,] 9.274350e-05 1.854870e-04 9.999073e-01 [19,] 6.481785e-04 1.296357e-03 9.993518e-01 [20,] 1.778780e-03 3.557561e-03 9.982212e-01 [21,] 2.717367e-03 5.434734e-03 9.972826e-01 [22,] 1.288263e-02 2.576526e-02 9.871174e-01 [23,] 1.899837e-02 3.799674e-02 9.810016e-01 [24,] 1.443055e-02 2.886110e-02 9.855694e-01 [25,] 1.296301e-02 2.592602e-02 9.870370e-01 [26,] 9.793537e-03 1.958707e-02 9.902065e-01 [27,] 9.060685e-03 1.812137e-02 9.909393e-01 [28,] 6.937973e-03 1.387595e-02 9.930620e-01 [29,] 4.851986e-03 9.703972e-03 9.951480e-01 [30,] 3.593123e-03 7.186245e-03 9.964069e-01 [31,] 2.812610e-03 5.625220e-03 9.971874e-01 [32,] 2.376590e-03 4.753180e-03 9.976234e-01 [33,] 2.804311e-03 5.608622e-03 9.971957e-01 [34,] 2.732619e-03 5.465237e-03 9.972674e-01 [35,] 2.709779e-03 5.419559e-03 9.972902e-01 [36,] 3.289496e-03 6.578992e-03 9.967105e-01 [37,] 3.757184e-03 7.514367e-03 9.962428e-01 [38,] 4.831172e-03 9.662343e-03 9.951688e-01 [39,] 7.537250e-03 1.507450e-02 9.924628e-01 [40,] 6.519114e-02 1.303823e-01 9.348089e-01 [41,] 9.323950e-02 1.864790e-01 9.067605e-01 [42,] 1.183137e-01 2.366273e-01 8.816863e-01 [43,] 1.150822e-01 2.301645e-01 8.849178e-01 [44,] 9.306322e-02 1.861264e-01 9.069368e-01 [45,] 8.433494e-02 1.686699e-01 9.156651e-01 [46,] 6.866693e-02 1.373339e-01 9.313331e-01 [47,] 5.889993e-02 1.177999e-01 9.411001e-01 [48,] 4.976111e-02 9.952221e-02 9.502389e-01 [49,] 5.160288e-02 1.032058e-01 9.483971e-01 [50,] 1.134285e-01 2.268570e-01 8.865715e-01 [51,] 2.820776e-01 5.641552e-01 7.179224e-01 [52,] 4.411701e-01 8.823403e-01 5.588299e-01 [53,] 7.043886e-01 5.912227e-01 2.956114e-01 [54,] 9.112390e-01 1.775219e-01 8.876096e-02 [55,] 9.639516e-01 7.209672e-02 3.604836e-02 [56,] 9.737915e-01 5.241706e-02 2.620853e-02 [57,] 9.833389e-01 3.332210e-02 1.666105e-02 [58,] 9.829616e-01 3.407688e-02 1.703844e-02 [59,] 9.869661e-01 2.606774e-02 1.303387e-02 [60,] 9.895754e-01 2.084922e-02 1.042461e-02 [61,] 9.889655e-01 2.206903e-02 1.103452e-02 [62,] 9.882846e-01 2.343078e-02 1.171539e-02 [63,] 9.890223e-01 2.195547e-02 1.097774e-02 [64,] 9.899055e-01 2.018909e-02 1.009454e-02 [65,] 9.955160e-01 8.968001e-03 4.484001e-03 [66,] 9.978543e-01 4.291434e-03 2.145717e-03 [67,] 9.992907e-01 1.418521e-03 7.092606e-04 [68,] 9.997751e-01 4.497210e-04 2.248605e-04 [69,] 9.998814e-01 2.372569e-04 1.186285e-04 [70,] 9.999344e-01 1.312646e-04 6.563232e-05 [71,] 9.999563e-01 8.735834e-05 4.367917e-05 [72,] 9.999533e-01 9.339874e-05 4.669937e-05 [73,] 9.999623e-01 7.544524e-05 3.772262e-05 [74,] 9.999484e-01 1.031598e-04 5.157992e-05 [75,] 9.999167e-01 1.666545e-04 8.332726e-05 [76,] 9.998773e-01 2.453599e-04 1.226799e-04 [77,] 9.998326e-01 3.347955e-04 1.673978e-04 [78,] 9.997452e-01 5.095854e-04 2.547927e-04 [79,] 9.997880e-01 4.240339e-04 2.120169e-04 [80,] 9.997659e-01 4.682044e-04 2.341022e-04 [81,] 9.997116e-01 5.768132e-04 2.884066e-04 [82,] 9.996135e-01 7.729064e-04 3.864532e-04 [83,] 9.995523e-01 8.954808e-04 4.477404e-04 [84,] 9.994623e-01 1.075412e-03 5.377060e-04 [85,] 9.992862e-01 1.427608e-03 7.138042e-04 [86,] 9.993408e-01 1.318377e-03 6.591886e-04 [87,] 9.990886e-01 1.822801e-03 9.114005e-04 [88,] 9.990289e-01 1.942113e-03 9.710565e-04 [89,] 9.990688e-01 1.862454e-03 9.312268e-04 [90,] 9.985899e-01 2.820280e-03 1.410140e-03 [91,] 9.979332e-01 4.133669e-03 2.066835e-03 [92,] 9.970840e-01 5.832065e-03 2.916033e-03 [93,] 9.964833e-01 7.033334e-03 3.516667e-03 [94,] 9.953864e-01 9.227105e-03 4.613552e-03 [95,] 9.955809e-01 8.838242e-03 4.419121e-03 [96,] 9.958048e-01 8.390403e-03 4.195202e-03 [97,] 9.942285e-01 1.154303e-02 5.771514e-03 [98,] 9.939761e-01 1.204783e-02 6.023914e-03 [99,] 9.953627e-01 9.274621e-03 4.637311e-03 [100,] 9.945873e-01 1.082541e-02 5.412707e-03 [101,] 9.929218e-01 1.415640e-02 7.078199e-03 [102,] 9.911534e-01 1.769315e-02 8.846576e-03 [103,] 9.892284e-01 2.154326e-02 1.077163e-02 [104,] 9.871402e-01 2.571961e-02 1.285980e-02 [105,] 9.832831e-01 3.343372e-02 1.671686e-02 [106,] 9.800618e-01 3.987648e-02 1.993824e-02 [107,] 9.766243e-01 4.675146e-02 2.337573e-02 [108,] 9.753129e-01 4.937418e-02 2.468709e-02 [109,] 9.701337e-01 5.973263e-02 2.986632e-02 [110,] 9.762659e-01 4.746813e-02 2.373406e-02 [111,] 9.839328e-01 3.213449e-02 1.606724e-02 [112,] 9.830304e-01 3.393918e-02 1.696959e-02 [113,] 9.883172e-01 2.336550e-02 1.168275e-02 [114,] 9.956910e-01 8.617943e-03 4.308971e-03 [115,] 9.985308e-01 2.938331e-03 1.469166e-03 [116,] 9.986799e-01 2.640143e-03 1.320072e-03 [117,] 9.989316e-01 2.136782e-03 1.068391e-03 [118,] 9.988269e-01 2.346279e-03 1.173139e-03 [119,] 9.991370e-01 1.725986e-03 8.629928e-04 [120,] 9.991580e-01 1.683911e-03 8.419554e-04 [121,] 9.996712e-01 6.575782e-04 3.287891e-04 [122,] 9.993821e-01 1.235804e-03 6.179021e-04 [123,] 9.988869e-01 2.226203e-03 1.113101e-03 [124,] 9.979745e-01 4.050952e-03 2.025476e-03 [125,] 9.966737e-01 6.652575e-03 3.326288e-03 [126,] 9.962395e-01 7.521078e-03 3.760539e-03 [127,] 9.955832e-01 8.833665e-03 4.416832e-03 [128,] 9.944013e-01 1.119732e-02 5.598662e-03 [129,] 9.945556e-01 1.088883e-02 5.444415e-03 [130,] 9.934384e-01 1.312315e-02 6.561573e-03 [131,] 9.883456e-01 2.330882e-02 1.165441e-02 [132,] 9.925056e-01 1.498875e-02 7.494377e-03 [133,] 9.930028e-01 1.399445e-02 6.997225e-03 [134,] 9.872998e-01 2.540032e-02 1.270016e-02 [135,] 9.866470e-01 2.670606e-02 1.335303e-02 [136,] 9.846126e-01 3.077488e-02 1.538744e-02 [137,] 9.781235e-01 4.375306e-02 2.187653e-02 [138,] 9.702836e-01 5.943288e-02 2.971644e-02 [139,] 9.639001e-01 7.219986e-02 3.609993e-02 [140,] 9.730176e-01 5.396473e-02 2.698237e-02 [141,] 9.310439e-01 1.379121e-01 6.895605e-02 > postscript(file="/var/fisher/rcomp/tmp/18ezr1353062132.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/2nnvd1353062132.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/3h4mg1353062132.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/4oon31353062132.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/5fdfq1353062132.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 6 0.094046354 0.184816333 0.145480446 0.277788499 0.270304312 0.012506395 7 8 9 10 11 12 -0.002213540 -0.016059564 -0.169241477 -0.111445548 -0.068367566 0.057994219 13 14 15 16 17 18 0.157122296 0.147892276 -0.342877704 -0.362462083 -0.182213591 0.023276323 19 20 21 22 23 24 0.057996207 -0.107283910 -0.358718002 -0.359840353 -0.400048163 -0.578717950 25 26 27 28 29 30 -0.640255973 -0.565745836 -0.546409897 -0.610567662 -0.782458057 -0.496302094 31 32 33 34 35 36 -0.338504177 -0.291684102 -0.546401946 -0.407066059 -0.233427844 -0.391017848 37 38 39 40 41 42 -0.464865706 -0.545531754 -0.651021669 -0.539587474 -0.357177580 -0.617845668 43 44 45 46 47 48 -0.555643636 -0.542671521 -0.631905568 -0.924423368 -0.601803677 -0.372573708 49 50 51 52 53 54 -0.174111884 -0.234983910 0.008094072 -0.071905980 -0.019597978 0.007222149 55 56 57 58 59 60 0.139532190 0.331174092 0.449638109 0.383486069 0.511178119 0.597334082 61 62 63 64 65 66 0.491180158 0.379538307 0.208976189 0.150306351 0.298872259 0.298872259 67 68 69 70 71 72 0.046562269 0.046562269 -0.034977690 0.017330312 0.150927845 0.212465867 73 74 75 76 77 78 0.097079935 0.180365727 0.524983616 0.612011501 0.544111642 0.377957615 79 80 81 82 83 84 0.482573619 0.334009698 0.071595778 0.056003921 -0.289693804 -0.025285610 85 86 87 88 89 90 0.208562351 -0.070565778 -0.399797734 -0.392313547 -0.385951710 -0.258259660 91 92 93 94 95 96 -0.335389540 -0.486825620 -0.225285610 -0.259131583 0.235380490 -0.134515630 97 98 99 100 101 102 -0.104411751 0.084820309 0.180204305 0.070100374 0.222408376 0.161742276 103 104 105 106 107 108 0.064818372 0.207230357 0.002614353 0.149432440 0.180410230 0.270306299 109 110 111 112 113 114 0.249432440 0.331844322 0.226356395 0.197998349 0.145690346 0.368768379 115 116 117 118 119 120 0.394256255 0.504154260 0.556462262 0.523490199 0.631846309 0.785028222 121 122 123 124 125 126 0.680412218 0.502614353 0.498872259 0.415586467 0.539536423 0.432050247 127 128 129 130 131 132 0.463276477 0.201734480 0.268760429 0.200860569 0.081734531 0.056244668 133 134 135 136 137 138 0.155370758 0.136910717 0.110964500 0.257534147 0.385892194 0.557328222 139 140 141 142 143 144 0.301280113 0.185896169 -0.240921970 -0.099840250 0.234005723 -0.120504465 145 146 147 148 149 150 -0.181168578 -0.295888513 -0.515888461 -0.418424903 -0.327736237 -0.453224112 151 152 153 154 -0.382456069 -0.256966206 -0.087070086 -0.061916466 > postscript(file="/var/fisher/rcomp/tmp/63faz1353062132.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.094046354 NA 1 0.184816333 0.094046354 2 0.145480446 0.184816333 3 0.277788499 0.145480446 4 0.270304312 0.277788499 5 0.012506395 0.270304312 6 -0.002213540 0.012506395 7 -0.016059564 -0.002213540 8 -0.169241477 -0.016059564 9 -0.111445548 -0.169241477 10 -0.068367566 -0.111445548 11 0.057994219 -0.068367566 12 0.157122296 0.057994219 13 0.147892276 0.157122296 14 -0.342877704 0.147892276 15 -0.362462083 -0.342877704 16 -0.182213591 -0.362462083 17 0.023276323 -0.182213591 18 0.057996207 0.023276323 19 -0.107283910 0.057996207 20 -0.358718002 -0.107283910 21 -0.359840353 -0.358718002 22 -0.400048163 -0.359840353 23 -0.578717950 -0.400048163 24 -0.640255973 -0.578717950 25 -0.565745836 -0.640255973 26 -0.546409897 -0.565745836 27 -0.610567662 -0.546409897 28 -0.782458057 -0.610567662 29 -0.496302094 -0.782458057 30 -0.338504177 -0.496302094 31 -0.291684102 -0.338504177 32 -0.546401946 -0.291684102 33 -0.407066059 -0.546401946 34 -0.233427844 -0.407066059 35 -0.391017848 -0.233427844 36 -0.464865706 -0.391017848 37 -0.545531754 -0.464865706 38 -0.651021669 -0.545531754 39 -0.539587474 -0.651021669 40 -0.357177580 -0.539587474 41 -0.617845668 -0.357177580 42 -0.555643636 -0.617845668 43 -0.542671521 -0.555643636 44 -0.631905568 -0.542671521 45 -0.924423368 -0.631905568 46 -0.601803677 -0.924423368 47 -0.372573708 -0.601803677 48 -0.174111884 -0.372573708 49 -0.234983910 -0.174111884 50 0.008094072 -0.234983910 51 -0.071905980 0.008094072 52 -0.019597978 -0.071905980 53 0.007222149 -0.019597978 54 0.139532190 0.007222149 55 0.331174092 0.139532190 56 0.449638109 0.331174092 57 0.383486069 0.449638109 58 0.511178119 0.383486069 59 0.597334082 0.511178119 60 0.491180158 0.597334082 61 0.379538307 0.491180158 62 0.208976189 0.379538307 63 0.150306351 0.208976189 64 0.298872259 0.150306351 65 0.298872259 0.298872259 66 0.046562269 0.298872259 67 0.046562269 0.046562269 68 -0.034977690 0.046562269 69 0.017330312 -0.034977690 70 0.150927845 0.017330312 71 0.212465867 0.150927845 72 0.097079935 0.212465867 73 0.180365727 0.097079935 74 0.524983616 0.180365727 75 0.612011501 0.524983616 76 0.544111642 0.612011501 77 0.377957615 0.544111642 78 0.482573619 0.377957615 79 0.334009698 0.482573619 80 0.071595778 0.334009698 81 0.056003921 0.071595778 82 -0.289693804 0.056003921 83 -0.025285610 -0.289693804 84 0.208562351 -0.025285610 85 -0.070565778 0.208562351 86 -0.399797734 -0.070565778 87 -0.392313547 -0.399797734 88 -0.385951710 -0.392313547 89 -0.258259660 -0.385951710 90 -0.335389540 -0.258259660 91 -0.486825620 -0.335389540 92 -0.225285610 -0.486825620 93 -0.259131583 -0.225285610 94 0.235380490 -0.259131583 95 -0.134515630 0.235380490 96 -0.104411751 -0.134515630 97 0.084820309 -0.104411751 98 0.180204305 0.084820309 99 0.070100374 0.180204305 100 0.222408376 0.070100374 101 0.161742276 0.222408376 102 0.064818372 0.161742276 103 0.207230357 0.064818372 104 0.002614353 0.207230357 105 0.149432440 0.002614353 106 0.180410230 0.149432440 107 0.270306299 0.180410230 108 0.249432440 0.270306299 109 0.331844322 0.249432440 110 0.226356395 0.331844322 111 0.197998349 0.226356395 112 0.145690346 0.197998349 113 0.368768379 0.145690346 114 0.394256255 0.368768379 115 0.504154260 0.394256255 116 0.556462262 0.504154260 117 0.523490199 0.556462262 118 0.631846309 0.523490199 119 0.785028222 0.631846309 120 0.680412218 0.785028222 121 0.502614353 0.680412218 122 0.498872259 0.502614353 123 0.415586467 0.498872259 124 0.539536423 0.415586467 125 0.432050247 0.539536423 126 0.463276477 0.432050247 127 0.201734480 0.463276477 128 0.268760429 0.201734480 129 0.200860569 0.268760429 130 0.081734531 0.200860569 131 0.056244668 0.081734531 132 0.155370758 0.056244668 133 0.136910717 0.155370758 134 0.110964500 0.136910717 135 0.257534147 0.110964500 136 0.385892194 0.257534147 137 0.557328222 0.385892194 138 0.301280113 0.557328222 139 0.185896169 0.301280113 140 -0.240921970 0.185896169 141 -0.099840250 -0.240921970 142 0.234005723 -0.099840250 143 -0.120504465 0.234005723 144 -0.181168578 -0.120504465 145 -0.295888513 -0.181168578 146 -0.515888461 -0.295888513 147 -0.418424903 -0.515888461 148 -0.327736237 -0.418424903 149 -0.453224112 -0.327736237 150 -0.382456069 -0.453224112 151 -0.256966206 -0.382456069 152 -0.087070086 -0.256966206 153 -0.061916466 -0.087070086 154 NA -0.061916466 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.184816333 0.094046354 [2,] 0.145480446 0.184816333 [3,] 0.277788499 0.145480446 [4,] 0.270304312 0.277788499 [5,] 0.012506395 0.270304312 [6,] -0.002213540 0.012506395 [7,] -0.016059564 -0.002213540 [8,] -0.169241477 -0.016059564 [9,] -0.111445548 -0.169241477 [10,] -0.068367566 -0.111445548 [11,] 0.057994219 -0.068367566 [12,] 0.157122296 0.057994219 [13,] 0.147892276 0.157122296 [14,] -0.342877704 0.147892276 [15,] -0.362462083 -0.342877704 [16,] -0.182213591 -0.362462083 [17,] 0.023276323 -0.182213591 [18,] 0.057996207 0.023276323 [19,] -0.107283910 0.057996207 [20,] -0.358718002 -0.107283910 [21,] -0.359840353 -0.358718002 [22,] -0.400048163 -0.359840353 [23,] -0.578717950 -0.400048163 [24,] -0.640255973 -0.578717950 [25,] -0.565745836 -0.640255973 [26,] -0.546409897 -0.565745836 [27,] -0.610567662 -0.546409897 [28,] -0.782458057 -0.610567662 [29,] -0.496302094 -0.782458057 [30,] -0.338504177 -0.496302094 [31,] -0.291684102 -0.338504177 [32,] -0.546401946 -0.291684102 [33,] -0.407066059 -0.546401946 [34,] -0.233427844 -0.407066059 [35,] -0.391017848 -0.233427844 [36,] -0.464865706 -0.391017848 [37,] -0.545531754 -0.464865706 [38,] -0.651021669 -0.545531754 [39,] -0.539587474 -0.651021669 [40,] -0.357177580 -0.539587474 [41,] -0.617845668 -0.357177580 [42,] -0.555643636 -0.617845668 [43,] -0.542671521 -0.555643636 [44,] -0.631905568 -0.542671521 [45,] -0.924423368 -0.631905568 [46,] -0.601803677 -0.924423368 [47,] -0.372573708 -0.601803677 [48,] -0.174111884 -0.372573708 [49,] -0.234983910 -0.174111884 [50,] 0.008094072 -0.234983910 [51,] -0.071905980 0.008094072 [52,] -0.019597978 -0.071905980 [53,] 0.007222149 -0.019597978 [54,] 0.139532190 0.007222149 [55,] 0.331174092 0.139532190 [56,] 0.449638109 0.331174092 [57,] 0.383486069 0.449638109 [58,] 0.511178119 0.383486069 [59,] 0.597334082 0.511178119 [60,] 0.491180158 0.597334082 [61,] 0.379538307 0.491180158 [62,] 0.208976189 0.379538307 [63,] 0.150306351 0.208976189 [64,] 0.298872259 0.150306351 [65,] 0.298872259 0.298872259 [66,] 0.046562269 0.298872259 [67,] 0.046562269 0.046562269 [68,] -0.034977690 0.046562269 [69,] 0.017330312 -0.034977690 [70,] 0.150927845 0.017330312 [71,] 0.212465867 0.150927845 [72,] 0.097079935 0.212465867 [73,] 0.180365727 0.097079935 [74,] 0.524983616 0.180365727 [75,] 0.612011501 0.524983616 [76,] 0.544111642 0.612011501 [77,] 0.377957615 0.544111642 [78,] 0.482573619 0.377957615 [79,] 0.334009698 0.482573619 [80,] 0.071595778 0.334009698 [81,] 0.056003921 0.071595778 [82,] -0.289693804 0.056003921 [83,] -0.025285610 -0.289693804 [84,] 0.208562351 -0.025285610 [85,] -0.070565778 0.208562351 [86,] -0.399797734 -0.070565778 [87,] -0.392313547 -0.399797734 [88,] -0.385951710 -0.392313547 [89,] -0.258259660 -0.385951710 [90,] -0.335389540 -0.258259660 [91,] -0.486825620 -0.335389540 [92,] -0.225285610 -0.486825620 [93,] -0.259131583 -0.225285610 [94,] 0.235380490 -0.259131583 [95,] -0.134515630 0.235380490 [96,] -0.104411751 -0.134515630 [97,] 0.084820309 -0.104411751 [98,] 0.180204305 0.084820309 [99,] 0.070100374 0.180204305 [100,] 0.222408376 0.070100374 [101,] 0.161742276 0.222408376 [102,] 0.064818372 0.161742276 [103,] 0.207230357 0.064818372 [104,] 0.002614353 0.207230357 [105,] 0.149432440 0.002614353 [106,] 0.180410230 0.149432440 [107,] 0.270306299 0.180410230 [108,] 0.249432440 0.270306299 [109,] 0.331844322 0.249432440 [110,] 0.226356395 0.331844322 [111,] 0.197998349 0.226356395 [112,] 0.145690346 0.197998349 [113,] 0.368768379 0.145690346 [114,] 0.394256255 0.368768379 [115,] 0.504154260 0.394256255 [116,] 0.556462262 0.504154260 [117,] 0.523490199 0.556462262 [118,] 0.631846309 0.523490199 [119,] 0.785028222 0.631846309 [120,] 0.680412218 0.785028222 [121,] 0.502614353 0.680412218 [122,] 0.498872259 0.502614353 [123,] 0.415586467 0.498872259 [124,] 0.539536423 0.415586467 [125,] 0.432050247 0.539536423 [126,] 0.463276477 0.432050247 [127,] 0.201734480 0.463276477 [128,] 0.268760429 0.201734480 [129,] 0.200860569 0.268760429 [130,] 0.081734531 0.200860569 [131,] 0.056244668 0.081734531 [132,] 0.155370758 0.056244668 [133,] 0.136910717 0.155370758 [134,] 0.110964500 0.136910717 [135,] 0.257534147 0.110964500 [136,] 0.385892194 0.257534147 [137,] 0.557328222 0.385892194 [138,] 0.301280113 0.557328222 [139,] 0.185896169 0.301280113 [140,] -0.240921970 0.185896169 [141,] -0.099840250 -0.240921970 [142,] 0.234005723 -0.099840250 [143,] -0.120504465 0.234005723 [144,] -0.181168578 -0.120504465 [145,] -0.295888513 -0.181168578 [146,] -0.515888461 -0.295888513 [147,] -0.418424903 -0.515888461 [148,] -0.327736237 -0.418424903 [149,] -0.453224112 -0.327736237 [150,] -0.382456069 -0.453224112 [151,] -0.256966206 -0.382456069 [152,] -0.087070086 -0.256966206 [153,] -0.061916466 -0.087070086 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.184816333 0.094046354 2 0.145480446 0.184816333 3 0.277788499 0.145480446 4 0.270304312 0.277788499 5 0.012506395 0.270304312 6 -0.002213540 0.012506395 7 -0.016059564 -0.002213540 8 -0.169241477 -0.016059564 9 -0.111445548 -0.169241477 10 -0.068367566 -0.111445548 11 0.057994219 -0.068367566 12 0.157122296 0.057994219 13 0.147892276 0.157122296 14 -0.342877704 0.147892276 15 -0.362462083 -0.342877704 16 -0.182213591 -0.362462083 17 0.023276323 -0.182213591 18 0.057996207 0.023276323 19 -0.107283910 0.057996207 20 -0.358718002 -0.107283910 21 -0.359840353 -0.358718002 22 -0.400048163 -0.359840353 23 -0.578717950 -0.400048163 24 -0.640255973 -0.578717950 25 -0.565745836 -0.640255973 26 -0.546409897 -0.565745836 27 -0.610567662 -0.546409897 28 -0.782458057 -0.610567662 29 -0.496302094 -0.782458057 30 -0.338504177 -0.496302094 31 -0.291684102 -0.338504177 32 -0.546401946 -0.291684102 33 -0.407066059 -0.546401946 34 -0.233427844 -0.407066059 35 -0.391017848 -0.233427844 36 -0.464865706 -0.391017848 37 -0.545531754 -0.464865706 38 -0.651021669 -0.545531754 39 -0.539587474 -0.651021669 40 -0.357177580 -0.539587474 41 -0.617845668 -0.357177580 42 -0.555643636 -0.617845668 43 -0.542671521 -0.555643636 44 -0.631905568 -0.542671521 45 -0.924423368 -0.631905568 46 -0.601803677 -0.924423368 47 -0.372573708 -0.601803677 48 -0.174111884 -0.372573708 49 -0.234983910 -0.174111884 50 0.008094072 -0.234983910 51 -0.071905980 0.008094072 52 -0.019597978 -0.071905980 53 0.007222149 -0.019597978 54 0.139532190 0.007222149 55 0.331174092 0.139532190 56 0.449638109 0.331174092 57 0.383486069 0.449638109 58 0.511178119 0.383486069 59 0.597334082 0.511178119 60 0.491180158 0.597334082 61 0.379538307 0.491180158 62 0.208976189 0.379538307 63 0.150306351 0.208976189 64 0.298872259 0.150306351 65 0.298872259 0.298872259 66 0.046562269 0.298872259 67 0.046562269 0.046562269 68 -0.034977690 0.046562269 69 0.017330312 -0.034977690 70 0.150927845 0.017330312 71 0.212465867 0.150927845 72 0.097079935 0.212465867 73 0.180365727 0.097079935 74 0.524983616 0.180365727 75 0.612011501 0.524983616 76 0.544111642 0.612011501 77 0.377957615 0.544111642 78 0.482573619 0.377957615 79 0.334009698 0.482573619 80 0.071595778 0.334009698 81 0.056003921 0.071595778 82 -0.289693804 0.056003921 83 -0.025285610 -0.289693804 84 0.208562351 -0.025285610 85 -0.070565778 0.208562351 86 -0.399797734 -0.070565778 87 -0.392313547 -0.399797734 88 -0.385951710 -0.392313547 89 -0.258259660 -0.385951710 90 -0.335389540 -0.258259660 91 -0.486825620 -0.335389540 92 -0.225285610 -0.486825620 93 -0.259131583 -0.225285610 94 0.235380490 -0.259131583 95 -0.134515630 0.235380490 96 -0.104411751 -0.134515630 97 0.084820309 -0.104411751 98 0.180204305 0.084820309 99 0.070100374 0.180204305 100 0.222408376 0.070100374 101 0.161742276 0.222408376 102 0.064818372 0.161742276 103 0.207230357 0.064818372 104 0.002614353 0.207230357 105 0.149432440 0.002614353 106 0.180410230 0.149432440 107 0.270306299 0.180410230 108 0.249432440 0.270306299 109 0.331844322 0.249432440 110 0.226356395 0.331844322 111 0.197998349 0.226356395 112 0.145690346 0.197998349 113 0.368768379 0.145690346 114 0.394256255 0.368768379 115 0.504154260 0.394256255 116 0.556462262 0.504154260 117 0.523490199 0.556462262 118 0.631846309 0.523490199 119 0.785028222 0.631846309 120 0.680412218 0.785028222 121 0.502614353 0.680412218 122 0.498872259 0.502614353 123 0.415586467 0.498872259 124 0.539536423 0.415586467 125 0.432050247 0.539536423 126 0.463276477 0.432050247 127 0.201734480 0.463276477 128 0.268760429 0.201734480 129 0.200860569 0.268760429 130 0.081734531 0.200860569 131 0.056244668 0.081734531 132 0.155370758 0.056244668 133 0.136910717 0.155370758 134 0.110964500 0.136910717 135 0.257534147 0.110964500 136 0.385892194 0.257534147 137 0.557328222 0.385892194 138 0.301280113 0.557328222 139 0.185896169 0.301280113 140 -0.240921970 0.185896169 141 -0.099840250 -0.240921970 142 0.234005723 -0.099840250 143 -0.120504465 0.234005723 144 -0.181168578 -0.120504465 145 -0.295888513 -0.181168578 146 -0.515888461 -0.295888513 147 -0.418424903 -0.515888461 148 -0.327736237 -0.418424903 149 -0.453224112 -0.327736237 150 -0.382456069 -0.453224112 151 -0.256966206 -0.382456069 152 -0.087070086 -0.256966206 153 -0.061916466 -0.087070086 > 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/79b8z1353062132.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/8jv4g1353062132.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/9hass1353062132.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/10ced11353062132.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/11crb21353062132.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/12pep11353062132.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/13a3ew1353062132.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/14s8ty1353062132.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/15u6461353062132.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/16rov11353062132.tab") + } > > try(system("convert tmp/18ezr1353062132.ps tmp/18ezr1353062132.png",intern=TRUE)) character(0) > try(system("convert tmp/2nnvd1353062132.ps tmp/2nnvd1353062132.png",intern=TRUE)) character(0) > try(system("convert tmp/3h4mg1353062132.ps tmp/3h4mg1353062132.png",intern=TRUE)) character(0) > try(system("convert tmp/4oon31353062132.ps tmp/4oon31353062132.png",intern=TRUE)) character(0) > try(system("convert tmp/5fdfq1353062132.ps tmp/5fdfq1353062132.png",intern=TRUE)) character(0) > try(system("convert tmp/63faz1353062132.ps tmp/63faz1353062132.png",intern=TRUE)) character(0) > try(system("convert tmp/79b8z1353062132.ps tmp/79b8z1353062132.png",intern=TRUE)) character(0) > try(system("convert tmp/8jv4g1353062132.ps tmp/8jv4g1353062132.png",intern=TRUE)) character(0) > try(system("convert tmp/9hass1353062132.ps tmp/9hass1353062132.png",intern=TRUE)) character(0) > try(system("convert tmp/10ced11353062132.ps tmp/10ced11353062132.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.508 1.304 8.821