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