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.98 + ,1.34 + ,1.98 + ,1.97 + ,2.62 + ,5.05 + ,8.02 + ,8.47 + ,2.07 + ,1.78 + ,1.25 + ,5.87 + ,1.45 + ,3.91 + ,9.77 + ,4.06 + ,0.98 + ,1.34 + ,1.97 + ,1.98 + ,2.62 + ,5.04 + ,7.98 + ,8.46 + ,2.06 + ,1.77 + ,1.24 + ,5.89 + ,1.46 + ,3.93 + ,9.73 + ,4.12 + ,0.98 + ,1.34 + ,1.98 + ,1.98 + ,2.61 + ,5.02 + ,7.98 + ,8.43 + ,2.06 + ,1.76 + ,1.24 + ,5.88 + ,1.47 + ,3.93 + ,9.74 + ,4.06 + ,0.97 + ,1.34 + ,1.98 + ,1.98 + ,2.61 + ,5.03 + ,7.97 + ,8.41 + ,2.05 + ,1.76 + ,1.24 + ,5.89 + ,1.47 + ,3.93 + ,9.71 + ,4.07 + ,1.04 + ,1.34 + ,1.98 + ,1.98 + ,2.6 + ,5.01 + ,7.96 + ,8.33 + ,2.05 + ,1.75 + ,1.24 + ,5.85 + ,1.47 + ,4.01 + ,9.69 + ,4.05 + ,1.05 + ,1.33 + ,1.97 + ,1.98 + ,2.59 + ,5 + ,7.95 + ,8.26 + ,2.03 + ,1.74 + ,1.23 + ,5.72 + ,1.45 + ,4.07 + ,9.66 + ,4.07 + ,1.07 + ,1.33 + ,1.97 + ,1.98 + ,2.59 + ,5 + ,7.94 + ,8.25 + ,2.02 + ,1.74 + ,1.23 + ,5.69 + ,1.42 + ,4.08 + ,9.65 + ,4.08 + ,1.06 + ,1.33 + ,1.97 + ,1.97 + ,2.59 + ,5 + ,7.91 + ,8.25 + ,2.02 + ,1.73 + ,1.22 + ,5.72 + ,1.42 + ,4.05 + ,9.63 + ,4.07 + ,1.07 + ,1.33 + ,1.97 + ,1.97 + ,2.58 + ,5 + ,7.9 + ,8.25 + ,2.02 + ,1.73 + ,1.23 + ,5.76 + ,1.41 + ,3.96 + ,9.63 + ,4.03 + ,1.03 + ,1.33 + ,1.96 + ,1.97 + ,2.58 + ,4.97 + ,7.9 + ,8.25 + ,2.02 + ,1.73 + ,1.22 + ,5.8 + ,1.41 + ,3.85 + ,9.6 + ,3.97 + ,1.02 + ,1.33 + ,1.96 + ,1.97 + ,2.58 + ,4.97 + ,7.88 + ,8.25 + ,2.01 + ,1.72 + ,1.22 + ,5.87 + ,1.41 + ,3.77 + ,9.59 + ,3.89 + ,1.02 + ,1.33 + ,1.96 + ,1.97 + ,2.57 + ,4.96 + ,7.88 + ,8.25 + ,2 + ,1.72 + ,1.22 + ,5.88 + ,1.4 + ,3.75 + ,9.57 + ,3.91 + ,1.01 + ,1.32 + ,1.95 + ,1.97 + ,2.56 + ,4.93 + ,7.86 + ,8.22 + ,2 + ,1.72 + ,1.21 + ,5.79 + ,1.39 + ,3.71 + ,9.54 + ,3.89 + ,1.01 + ,1.32 + ,1.95 + ,1.96 + ,2.57 + ,4.93 + ,7.86 + ,8.21 + ,2 + ,1.71 + ,1.21 + ,5.83 + ,1.39 + ,3.73 + ,9.54 + ,3.88 + ,1 + ,1.32 + ,1.95 + ,1.96 + ,2.56 + ,4.92 + ,7.86 + ,8.21 + ,2 + ,1.71 + ,1.21 + ,5.8 + ,1.38 + ,3.74 + ,9.53 + ,3.86 + ,1 + ,1.32 + ,1.95 + ,1.96 + ,2.56 + ,4.92 + ,7.84 + ,8.2 + ,2 + ,1.71 + ,1.21 + ,5.66 + ,1.37 + ,3.73 + ,9.52 + ,3.83 + ,1 + ,1.32 + ,1.94 + ,1.96 + ,2.57 + ,4.92 + ,7.79 + ,8.2 + ,1.99 + ,1.72 + ,1.2 + ,5.32 + ,1.3 + ,3.77 + ,9.47 + ,3.77 + ,0.98 + ,1.31 + ,1.93 + ,1.96 + ,2.55 + ,4.91 + ,7.62 + ,8.15 + ,1.99 + ,1.71 + ,1.19 + ,5.3 + ,1.31 + ,3.84 + ,9.38 + ,3.64 + ,0.87 + ,1.3 + ,1.93 + ,1.95 + ,2.53 + ,4.88 + ,7.6 + ,8.1 + ,1.98 + ,1.7 + ,1.18 + ,5.3 + ,1.31 + ,3.75 + ,9.35 + ,3.66 + ,0.82 + ,1.27 + ,1.9 + ,1.92 + ,2.5 + ,4.83 + ,7.55 + ,8.03 + ,1.97 + ,1.69 + ,1.17 + ,5.28 + ,1.32 + ,3.69 + ,9.3 + ,3.62 + ,0.8 + ,1.27 + ,1.9 + ,1.93 + ,2.49 + ,4.82 + ,7.53 + ,8.08 + ,1.97 + ,1.69 + ,1.17 + ,5.3 + ,1.32 + ,3.73 + ,9.27 + ,3.61 + ,0.81 + ,1.27 + ,1.9 + ,1.92 + ,2.48 + ,4.81 + ,7.5 + ,8.04 + ,1.96 + ,1.69 + ,1.17 + ,5.28 + ,1.32 + ,3.73 + ,9.25 + ,3.61 + ,0.81 + ,1.26 + ,1.88 + ,1.9 + ,2.46 + ,4.77 + ,7.4 + ,7.98 + ,1.96 + ,1.67 + ,1.16 + ,5.28 + ,1.29 + ,3.72 + ,9.19 + ,3.59 + ,0.81 + ,1.26 + ,1.88 + ,1.9 + ,2.44 + ,4.74 + ,7.35 + ,7.95 + ,1.95 + ,1.67 + ,1.16 + ,5.25 + ,1.26 + ,3.7 + ,9.15 + ,3.56 + ,0.81 + ,1.25 + ,1.87 + ,1.89 + ,2.43 + ,4.77 + ,7.31 + ,7.88 + ,1.95 + ,1.67 + ,1.16 + ,5.27 + ,1.25 + ,3.69 + ,9.11 + ,3.56 + ,0.81 + ,1.25 + ,1.88 + ,1.89 + ,2.43 + ,4.75 + ,7.35 + ,7.92 + ,1.95 + ,1.67 + ,1.15 + ,5.29 + ,1.24 + ,3.7 + ,9.09 + ,3.55 + ,0.79 + ,1.25 + ,1.87 + ,1.89 + ,2.44 + ,4.76 + ,7.38 + ,7.88 + ,1.95 + ,1.67 + ,1.16 + ,5.26 + ,1.24 + ,3.72 + ,9.07 + ,3.53 + ,0.78 + ,1.25 + ,1.88 + ,1.89 + ,2.43 + ,4.76 + ,7.37 + ,7.95 + ,1.94 + ,1.67 + ,1.15 + ,5.27 + ,1.23 + ,3.71 + ,9.07 + ,3.55 + ,0.78 + ,1.25 + ,1.87 + ,1.89 + ,2.43 + ,4.75 + ,7.37 + ,7.93 + ,1.94 + ,1.66 + ,1.15 + ,5.21 + ,1.22 + ,3.75 + ,9.07 + ,3.55 + ,0.77 + ,1.25 + ,1.87 + ,1.89 + ,2.44 + ,4.73 + ,7.32 + ,7.95 + ,1.92 + ,1.66 + ,1.15 + ,5.23 + ,1.22 + ,3.76 + ,9.03 + ,3.56 + ,0.78 + ,1.25 + ,1.87 + ,1.89 + ,2.43 + ,4.74 + ,7.24 + ,7.85 + ,1.93 + ,1.65 + ,1.15 + ,5.27 + ,1.21 + ,3.78 + ,8.95 + ,3.53 + ,0.77 + ,1.25 + ,1.87 + ,1.89 + ,2.43 + ,4.74 + ,7.21 + ,7.85 + ,1.93 + ,1.65 + ,1.15 + ,5.26 + ,1.2 + ,3.76 + ,8.95 + ,3.53 + ,0.78 + ,1.25 + ,1.87 + ,1.89 + ,2.43 + ,4.74 + ,7.21 + ,7.85 + ,1.92 + ,1.65 + ,1.15 + ,5.27 + ,1.19 + ,3.77 + ,8.89 + ,3.51 + ,0.79 + ,1.25 + ,1.87 + ,1.89 + ,2.43 + ,4.72 + ,7.19 + ,7.83 + ,1.92 + ,1.65 + ,1.14 + ,5.27 + ,1.19 + ,3.78 + ,8.87 + ,3.53 + ,0.79 + ,1.24 + ,1.87 + ,1.89 + ,2.43 + ,4.71 + ,7.14 + ,7.81 + ,1.91 + ,1.65 + ,1.14 + ,5.3 + ,1.19 + ,3.77 + ,8.84 + ,3.53 + ,0.79 + ,1.25 + ,1.87 + ,1.89 + ,2.42 + ,4.7 + ,7.13 + ,7.85 + ,1.91 + ,1.64 + ,1.14 + ,5.29 + ,1.19 + ,3.79 + ,8.83 + ,3.54 + ,0.79 + ,1.25 + ,1.87 + ,1.89 + ,2.43 + ,4.71 + ,7.12 + ,7.83 + ,1.91 + ,1.64 + ,1.14 + ,5.31 + ,1.19 + ,3.78 + ,8.81 + ,3.56 + ,0.79 + ,1.24 + ,1.87 + ,1.89 + ,2.44 + ,4.72 + ,7.08 + ,7.8 + ,1.9 + ,1.64 + ,1.14 + ,5.32 + ,1.19 + ,3.85 + ,8.74 + ,3.58 + ,0.8 + ,1.24 + ,1.87 + ,1.89 + ,2.44 + ,4.7 + ,7.04 + ,7.81 + ,1.89 + ,1.64 + ,1.14 + ,5.26 + ,1.19 + ,3.8 + ,8.72 + ,3.56 + ,0.8 + ,1.24 + ,1.87 + ,1.89 + ,2.44 + ,4.7 + ,7.04 + ,7.79 + ,1.9 + ,1.64 + ,1.13 + ,5.28 + ,1.18 + ,3.86 + ,8.71 + ,3.55 + ,0.8 + ,1.24 + ,1.87 + ,1.89 + ,2.44 + ,4.7 + ,7.03 + ,7.75 + ,1.88 + ,1.63 + ,1.13 + ,5.27 + ,1.18 + ,3.84 + ,8.7 + ,3.52 + ,0.8 + ,1.24 + ,1.87 + ,1.89 + ,2.44 + ,4.68 + ,7.03 + ,7.77 + ,1.88 + ,1.62 + ,1.13 + ,5.28 + ,1.18 + ,3.82 + ,8.69 + ,3.52 + ,0.81 + ,1.25 + ,1.87 + ,1.89 + ,2.43 + ,4.68 + ,6.99 + ,7.72 + ,1.87 + ,1.62 + ,1.13 + ,5.25 + ,1.18 + ,3.82 + ,8.62 + ,3.49 + ,0.8 + ,1.26 + ,1.88 + ,1.89 + ,2.44 + ,4.67 + ,7 + ,7.68 + ,1.87 + ,1.61 + ,1.13 + ,5.13 + ,1.17 + ,3.8 + ,8.55 + ,3.46 + ,0.82 + ,1.26 + ,1.88 + ,1.9 + ,2.44 + ,4.67 + ,6.97 + ,7.7 + ,1.87 + ,1.62 + ,1.12 + ,5.12 + ,1.16 + ,3.79 + ,8.57 + ,3.46 + ,0.85 + ,1.26 + ,1.87 + ,1.89 + ,2.43 + ,4.67 + ,6.91 + ,7.69 + ,1.86 + ,1.62 + ,1.11 + ,5.12 + ,1.16 + ,3.78 + ,8.54 + ,3.45 + ,0.85 + ,1.26 + ,1.87 + ,1.89 + ,2.42 + ,4.62 + ,6.83 + ,7.64 + ,1.85 + ,1.61 + ,1.1 + ,5.11 + ,1.16 + ,3.8 + ,8.45 + ,3.48 + ,0.86 + ,1.26 + ,1.87 + ,1.89 + ,2.42 + ,4.62 + ,6.8 + ,7.66 + ,1.84 + ,1.61 + ,1.1 + ,5.09 + ,1.15 + ,3.78 + ,8.4 + ,3.48 + ,0.85 + ,1.26 + ,1.87 + ,1.88 + ,2.41 + ,4.61 + ,6.79 + ,7.63 + ,1.83 + ,1.61 + ,1.1 + ,5.05 + ,1.15 + ,3.75 + ,8.37 + ,3.48 + ,0.83 + ,1.26 + ,1.87 + ,1.88 + ,2.41 + ,4.61 + ,6.77 + ,7.64 + ,1.83 + ,1.6 + ,1.1 + ,5.1 + ,1.15 + ,3.77 + ,8.36 + ,3.48 + ,0.81 + ,1.26 + ,1.87 + ,1.88 + ,2.41 + ,4.61 + ,6.78 + ,7.63 + ,1.83 + ,1.59 + ,1.1 + ,5.07 + ,1.15 + ,3.75 + ,8.36 + ,3.46 + ,0.82 + ,1.26 + ,1.87 + ,1.88 + ,2.41 + ,4.61 + ,6.75 + ,7.6 + ,1.82 + ,1.6 + ,1.09 + ,5.09 + ,1.15 + ,3.74 + ,8.35 + ,3.44 + ,0.82 + ,1.25 + ,1.86 + ,1.87 + ,2.38 + ,4.6 + ,6.73 + ,7.58 + ,1.81 + ,1.59 + ,1.09 + ,5.1 + ,1.16 + ,3.71 + ,8.34 + ,3.41 + ,0.78 + ,1.25 + ,1.86 + ,1.87 + ,2.38 + ,4.62 + ,6.68 + ,7.55 + ,1.81 + ,1.58 + ,1.09 + ,5.1 + ,1.14 + ,3.71 + ,8.28 + ,3.4 + ,0.78 + ,1.25 + ,1.85 + ,1.87 + ,2.37 + ,4.61 + ,6.64 + ,7.54 + ,1.8 + ,1.57 + ,1.08 + ,5.07 + ,1.12 + ,3.69 + ,8.24 + ,3.34 + ,0.73 + ,1.24 + ,1.84 + ,1.85 + ,2.35 + ,4.59 + ,6.52 + ,7.49 + ,1.79 + ,1.56 + ,1.08 + ,5.06 + ,1.11 + ,3.65 + ,8.16 + ,3.34 + ,0.68 + ,1.24 + ,1.83 + ,1.84 + ,2.33 + ,4.58 + ,6.44 + ,7.45 + ,1.78 + ,1.56 + ,1.07 + ,5.05 + ,1.09 + ,3.56 + ,8.09 + ,3.34 + ,0.65 + ,1.23 + ,1.82 + ,1.83 + ,2.33 + ,4.54 + ,6.37 + ,7.31 + ,1.77 + ,1.54 + ,1.06 + ,4.95 + ,1.07 + ,3.44 + ,8.04 + ,3.3 + ,0.62 + ,1.2 + ,1.78 + ,1.79 + ,2.254 + ,4.46 + ,6.11 + ,7.23 + ,1.75 + ,1.52 + ,1.04 + ,4.94 + ,1.07 + ,3.39 + ,7.84 + ,3.27 + ,0.6 + ,1.18 + ,1.75 + ,1.76 + ,2.22 + ,4.43 + ,5.98 + ,7.12 + ,1.73 + ,1.5 + ,1.03 + ,4.94 + ,1.07 + ,3.38 + ,7.73 + ,3.26 + ,0.6 + ,1.17 + ,1.74 + ,1.75 + ,2.212 + ,4.4 + ,5.94 + ,7.09 + ,1.72 + ,1.49 + ,1.03 + ,4.95 + ,1.06 + ,3.38 + ,7.7 + ,3.28 + ,0.59 + ,1.18 + ,1.74 + ,1.75 + ,2.2 + ,4.39 + ,5.94 + ,7.06 + ,1.71 + ,1.49 + ,1.03 + ,4.96 + ,1.07 + ,3.37 + ,7.68 + ,3.3 + ,0.6 + ,1.17 + ,1.74 + ,1.75 + ,2.2 + ,4.39 + ,5.93 + ,7.06 + ,1.71 + ,1.49 + ,1.03 + ,4.95 + ,1.06 + ,3.35 + ,7.68 + ,3.29 + ,0.6 + ,1.17 + ,1.73 + ,1.74 + ,2.2 + ,4.39 + ,5.92 + ,7.05 + ,1.71 + ,1.49 + ,1.03 + ,4.97 + ,1.06 + ,3.31 + ,7.66 + ,3.29 + ,0.6 + ,1.17 + ,1.73 + ,1.74 + ,2.19 + ,4.4 + ,5.91 + ,7.02 + ,1.71 + ,1.47 + ,1.03 + ,4.9 + ,1.06 + ,3.25 + ,7.66 + ,3.25 + ,0.59 + ,1.17 + ,1.73 + ,1.73 + ,2.2 + ,4.38 + ,5.89 + ,6.99 + ,1.7 + ,1.47 + ,1.03 + ,4.9 + ,1.06 + ,3.22 + ,7.62 + ,3.26 + ,0.58 + ,1.16 + ,1.71 + ,1.72 + ,2.16 + ,4.33 + ,5.82 + ,6.92 + ,1.68 + ,1.47 + ,1.01 + ,4.68 + ,1.03 + ,3.25 + ,7.57 + ,3.26 + ,0.56 + ,1.14 + ,1.7 + ,1.71 + ,2.17 + ,4.32 + ,5.77 + ,6.92 + ,1.68 + ,1.46 + ,1.02 + ,4.63 + ,1.03 + ,3.21 + ,7.5 + ,3.24 + ,0.55 + ,1.14 + ,1.7 + ,1.7 + ,2.16 + ,4.32 + ,5.76 + ,6.88 + ,1.67 + ,1.46 + ,1.02 + ,4.62 + ,1.02 + ,3.2 + ,7.49 + ,3.24 + ,0.54 + ,1.13 + ,1.69 + ,1.7 + ,2.15 + ,4.28 + ,5.73 + ,6.88 + ,1.66 + ,1.45 + ,1.01 + ,4.6 + ,1.01 + ,3.17 + ,7.46 + ,3.25 + ,0.55 + ,1.13 + ,1.68 + ,1.69 + ,2.14 + ,4.26 + ,5.72 + ,6.86 + ,1.65 + ,1.44 + ,1 + ,4.64 + ,1.02 + ,3.17 + ,7.42 + ,3.21 + ,0.55 + ,1.12 + ,1.68 + ,1.68 + ,2.13 + ,4.26 + ,5.7 + ,6.87 + ,1.64 + ,1.44 + ,1 + ,4.64 + ,1.02 + ,3.18 + ,7.38 + ,3.2 + ,0.54 + ,1.12 + ,1.68 + ,1.68 + ,2.134 + ,4.26 + ,5.68 + ,6.81 + ,1.63 + ,1.43 + ,1 + ,4.65 + ,1.02 + ,3.19 + ,7.37 + ,3.21 + ,0.54 + ,1.12 + ,1.68 + ,1.68 + ,2.132 + ,4.25 + ,5.68 + ,6.81 + ,1.63 + ,1.43 + ,1 + ,4.65 + ,1.01 + ,3.17 + ,7.36 + ,3.23 + ,0.54 + ,1.12 + ,1.67 + ,1.68 + ,2.13 + ,4.27 + ,5.69 + ,6.81 + ,1.63 + ,1.43 + ,1 + ,4.63 + ,1.02 + ,3.16 + ,7.36 + ,3.2 + ,0.53 + ,1.12 + ,1.66 + ,1.67 + ,2.117 + ,4.25 + ,5.65 + ,6.77 + ,1.63 + ,1.43 + ,0.99 + ,4.65 + ,1.01 + ,3.14 + ,7.33 + ,3.2 + ,0.53 + ,1.11 + ,1.65 + ,1.66 + ,2.11 + ,4.26 + ,5.66 + ,6.75 + ,1.62 + ,1.43 + ,0.99 + ,4.67 + ,1.01 + ,3.13 + ,7.32 + ,3.19 + ,0.53 + ,1.11 + ,1.65 + ,1.66 + ,2.104 + ,4.26 + ,5.64 + ,6.69 + ,1.62 + ,1.42 + ,0.99 + ,4.64 + ,0.99 + ,3.1 + ,7.3 + ,3.16 + ,0.53 + ,1.1 + ,1.65 + ,1.65 + ,2.1 + ,4.24 + ,5.61 + ,6.69 + ,1.61 + ,1.41 + ,0.98 + ,4.64 + ,0.98 + ,3.11 + ,7.27 + ,3.11) + ,dim=c(16 + ,79) + ,dimnames=list(c('Flour_1kg' + ,'Speciality_bread_400g' + ,'Speciality_bread_800g' + ,'Brown_bread_800g' + ,'Multigrain_bread_800g' + ,'Currant_1kg' + ,'Roll_1kg' + ,'Rice_tart_1kg' + ,'Mocha_tart' + ,'Fruit_tart' + ,'Eclair' + ,'Biscuits_1kg' + ,'Penny_wafer_200g' + ,'Spekulatius_1kg' + ,'Garibaldi' + ,'biscuit_1kg') + ,1:79)) > y <- array(NA,dim=c(16,79),dimnames=list(c('Flour_1kg','Speciality_bread_400g','Speciality_bread_800g','Brown_bread_800g','Multigrain_bread_800g','Currant_1kg','Roll_1kg','Rice_tart_1kg','Mocha_tart','Fruit_tart','Eclair','Biscuits_1kg','Penny_wafer_200g','Spekulatius_1kg','Garibaldi','biscuit_1kg'),1:79)) > 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 = '1' > 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 Flour_1kg Speciality_bread_400g Speciality_bread_800g Brown_bread_800g 1 0.98 1.34 1.98 1.97 2 0.98 1.34 1.97 1.98 3 0.98 1.34 1.98 1.98 4 0.97 1.34 1.98 1.98 5 1.04 1.34 1.98 1.98 6 1.05 1.33 1.97 1.98 7 1.07 1.33 1.97 1.98 8 1.06 1.33 1.97 1.97 9 1.07 1.33 1.97 1.97 10 1.03 1.33 1.96 1.97 11 1.02 1.33 1.96 1.97 12 1.02 1.33 1.96 1.97 13 1.01 1.32 1.95 1.97 14 1.01 1.32 1.95 1.96 15 1.00 1.32 1.95 1.96 16 1.00 1.32 1.95 1.96 17 1.00 1.32 1.94 1.96 18 0.98 1.31 1.93 1.96 19 0.87 1.30 1.93 1.95 20 0.82 1.27 1.90 1.92 21 0.80 1.27 1.90 1.93 22 0.81 1.27 1.90 1.92 23 0.81 1.26 1.88 1.90 24 0.81 1.26 1.88 1.90 25 0.81 1.25 1.87 1.89 26 0.81 1.25 1.88 1.89 27 0.79 1.25 1.87 1.89 28 0.78 1.25 1.88 1.89 29 0.78 1.25 1.87 1.89 30 0.77 1.25 1.87 1.89 31 0.78 1.25 1.87 1.89 32 0.77 1.25 1.87 1.89 33 0.78 1.25 1.87 1.89 34 0.79 1.25 1.87 1.89 35 0.79 1.24 1.87 1.89 36 0.79 1.25 1.87 1.89 37 0.79 1.25 1.87 1.89 38 0.79 1.24 1.87 1.89 39 0.80 1.24 1.87 1.89 40 0.80 1.24 1.87 1.89 41 0.80 1.24 1.87 1.89 42 0.80 1.24 1.87 1.89 43 0.81 1.25 1.87 1.89 44 0.80 1.26 1.88 1.89 45 0.82 1.26 1.88 1.90 46 0.85 1.26 1.87 1.89 47 0.85 1.26 1.87 1.89 48 0.86 1.26 1.87 1.89 49 0.85 1.26 1.87 1.88 50 0.83 1.26 1.87 1.88 51 0.81 1.26 1.87 1.88 52 0.82 1.26 1.87 1.88 53 0.82 1.25 1.86 1.87 54 0.78 1.25 1.86 1.87 55 0.78 1.25 1.85 1.87 56 0.73 1.24 1.84 1.85 57 0.68 1.24 1.83 1.84 58 0.65 1.23 1.82 1.83 59 0.62 1.20 1.78 1.79 60 0.60 1.18 1.75 1.76 61 0.60 1.17 1.74 1.75 62 0.59 1.18 1.74 1.75 63 0.60 1.17 1.74 1.75 64 0.60 1.17 1.73 1.74 65 0.60 1.17 1.73 1.74 66 0.59 1.17 1.73 1.73 67 0.58 1.16 1.71 1.72 68 0.56 1.14 1.70 1.71 69 0.55 1.14 1.70 1.70 70 0.54 1.13 1.69 1.70 71 0.55 1.13 1.68 1.69 72 0.55 1.12 1.68 1.68 73 0.54 1.12 1.68 1.68 74 0.54 1.12 1.68 1.68 75 0.54 1.12 1.67 1.68 76 0.53 1.12 1.66 1.67 77 0.53 1.11 1.65 1.66 78 0.53 1.11 1.65 1.66 79 0.53 1.10 1.65 1.65 Multigrain_bread_800g Currant_1kg Roll_1kg Rice_tart_1kg Mocha_tart 1 2.620 5.05 8.02 8.47 2.07 2 2.620 5.04 7.98 8.46 2.06 3 2.610 5.02 7.98 8.43 2.06 4 2.610 5.03 7.97 8.41 2.05 5 2.600 5.01 7.96 8.33 2.05 6 2.590 5.00 7.95 8.26 2.03 7 2.590 5.00 7.94 8.25 2.02 8 2.590 5.00 7.91 8.25 2.02 9 2.580 5.00 7.90 8.25 2.02 10 2.580 4.97 7.90 8.25 2.02 11 2.580 4.97 7.88 8.25 2.01 12 2.570 4.96 7.88 8.25 2.00 13 2.560 4.93 7.86 8.22 2.00 14 2.570 4.93 7.86 8.21 2.00 15 2.560 4.92 7.86 8.21 2.00 16 2.560 4.92 7.84 8.20 2.00 17 2.570 4.92 7.79 8.20 1.99 18 2.550 4.91 7.62 8.15 1.99 19 2.530 4.88 7.60 8.10 1.98 20 2.500 4.83 7.55 8.03 1.97 21 2.490 4.82 7.53 8.08 1.97 22 2.480 4.81 7.50 8.04 1.96 23 2.460 4.77 7.40 7.98 1.96 24 2.440 4.74 7.35 7.95 1.95 25 2.430 4.77 7.31 7.88 1.95 26 2.430 4.75 7.35 7.92 1.95 27 2.440 4.76 7.38 7.88 1.95 28 2.430 4.76 7.37 7.95 1.94 29 2.430 4.75 7.37 7.93 1.94 30 2.440 4.73 7.32 7.95 1.92 31 2.430 4.74 7.24 7.85 1.93 32 2.430 4.74 7.21 7.85 1.93 33 2.430 4.74 7.21 7.85 1.92 34 2.430 4.72 7.19 7.83 1.92 35 2.430 4.71 7.14 7.81 1.91 36 2.420 4.70 7.13 7.85 1.91 37 2.430 4.71 7.12 7.83 1.91 38 2.440 4.72 7.08 7.80 1.90 39 2.440 4.70 7.04 7.81 1.89 40 2.440 4.70 7.04 7.79 1.90 41 2.440 4.70 7.03 7.75 1.88 42 2.440 4.68 7.03 7.77 1.88 43 2.430 4.68 6.99 7.72 1.87 44 2.440 4.67 7.00 7.68 1.87 45 2.440 4.67 6.97 7.70 1.87 46 2.430 4.67 6.91 7.69 1.86 47 2.420 4.62 6.83 7.64 1.85 48 2.420 4.62 6.80 7.66 1.84 49 2.410 4.61 6.79 7.63 1.83 50 2.410 4.61 6.77 7.64 1.83 51 2.410 4.61 6.78 7.63 1.83 52 2.410 4.61 6.75 7.60 1.82 53 2.380 4.60 6.73 7.58 1.81 54 2.380 4.62 6.68 7.55 1.81 55 2.370 4.61 6.64 7.54 1.80 56 2.350 4.59 6.52 7.49 1.79 57 2.330 4.58 6.44 7.45 1.78 58 2.330 4.54 6.37 7.31 1.77 59 2.254 4.46 6.11 7.23 1.75 60 2.220 4.43 5.98 7.12 1.73 61 2.212 4.40 5.94 7.09 1.72 62 2.200 4.39 5.94 7.06 1.71 63 2.200 4.39 5.93 7.06 1.71 64 2.200 4.39 5.92 7.05 1.71 65 2.190 4.40 5.91 7.02 1.71 66 2.200 4.38 5.89 6.99 1.70 67 2.160 4.33 5.82 6.92 1.68 68 2.170 4.32 5.77 6.92 1.68 69 2.160 4.32 5.76 6.88 1.67 70 2.150 4.28 5.73 6.88 1.66 71 2.140 4.26 5.72 6.86 1.65 72 2.130 4.26 5.70 6.87 1.64 73 2.134 4.26 5.68 6.81 1.63 74 2.132 4.25 5.68 6.81 1.63 75 2.130 4.27 5.69 6.81 1.63 76 2.117 4.25 5.65 6.77 1.63 77 2.110 4.26 5.66 6.75 1.62 78 2.104 4.26 5.64 6.69 1.62 79 2.100 4.24 5.61 6.69 1.61 Fruit_tart Eclair Biscuits_1kg Penny_wafer_200g Spekulatius_1kg Garibaldi 1 1.78 1.25 5.87 1.45 3.91 9.77 2 1.77 1.24 5.89 1.46 3.93 9.73 3 1.76 1.24 5.88 1.47 3.93 9.74 4 1.76 1.24 5.89 1.47 3.93 9.71 5 1.75 1.24 5.85 1.47 4.01 9.69 6 1.74 1.23 5.72 1.45 4.07 9.66 7 1.74 1.23 5.69 1.42 4.08 9.65 8 1.73 1.22 5.72 1.42 4.05 9.63 9 1.73 1.23 5.76 1.41 3.96 9.63 10 1.73 1.22 5.80 1.41 3.85 9.60 11 1.72 1.22 5.87 1.41 3.77 9.59 12 1.72 1.22 5.88 1.40 3.75 9.57 13 1.72 1.21 5.79 1.39 3.71 9.54 14 1.71 1.21 5.83 1.39 3.73 9.54 15 1.71 1.21 5.80 1.38 3.74 9.53 16 1.71 1.21 5.66 1.37 3.73 9.52 17 1.72 1.20 5.32 1.30 3.77 9.47 18 1.71 1.19 5.30 1.31 3.84 9.38 19 1.70 1.18 5.30 1.31 3.75 9.35 20 1.69 1.17 5.28 1.32 3.69 9.30 21 1.69 1.17 5.30 1.32 3.73 9.27 22 1.69 1.17 5.28 1.32 3.73 9.25 23 1.67 1.16 5.28 1.29 3.72 9.19 24 1.67 1.16 5.25 1.26 3.70 9.15 25 1.67 1.16 5.27 1.25 3.69 9.11 26 1.67 1.15 5.29 1.24 3.70 9.09 27 1.67 1.16 5.26 1.24 3.72 9.07 28 1.67 1.15 5.27 1.23 3.71 9.07 29 1.66 1.15 5.21 1.22 3.75 9.07 30 1.66 1.15 5.23 1.22 3.76 9.03 31 1.65 1.15 5.27 1.21 3.78 8.95 32 1.65 1.15 5.26 1.20 3.76 8.95 33 1.65 1.15 5.27 1.19 3.77 8.89 34 1.65 1.14 5.27 1.19 3.78 8.87 35 1.65 1.14 5.30 1.19 3.77 8.84 36 1.64 1.14 5.29 1.19 3.79 8.83 37 1.64 1.14 5.31 1.19 3.78 8.81 38 1.64 1.14 5.32 1.19 3.85 8.74 39 1.64 1.14 5.26 1.19 3.80 8.72 40 1.64 1.13 5.28 1.18 3.86 8.71 41 1.63 1.13 5.27 1.18 3.84 8.70 42 1.62 1.13 5.28 1.18 3.82 8.69 43 1.62 1.13 5.25 1.18 3.82 8.62 44 1.61 1.13 5.13 1.17 3.80 8.55 45 1.62 1.12 5.12 1.16 3.79 8.57 46 1.62 1.11 5.12 1.16 3.78 8.54 47 1.61 1.10 5.11 1.16 3.80 8.45 48 1.61 1.10 5.09 1.15 3.78 8.40 49 1.61 1.10 5.05 1.15 3.75 8.37 50 1.60 1.10 5.10 1.15 3.77 8.36 51 1.59 1.10 5.07 1.15 3.75 8.36 52 1.60 1.09 5.09 1.15 3.74 8.35 53 1.59 1.09 5.10 1.16 3.71 8.34 54 1.58 1.09 5.10 1.14 3.71 8.28 55 1.57 1.08 5.07 1.12 3.69 8.24 56 1.56 1.08 5.06 1.11 3.65 8.16 57 1.56 1.07 5.05 1.09 3.56 8.09 58 1.54 1.06 4.95 1.07 3.44 8.04 59 1.52 1.04 4.94 1.07 3.39 7.84 60 1.50 1.03 4.94 1.07 3.38 7.73 61 1.49 1.03 4.95 1.06 3.38 7.70 62 1.49 1.03 4.96 1.07 3.37 7.68 63 1.49 1.03 4.95 1.06 3.35 7.68 64 1.49 1.03 4.97 1.06 3.31 7.66 65 1.47 1.03 4.90 1.06 3.25 7.66 66 1.47 1.03 4.90 1.06 3.22 7.62 67 1.47 1.01 4.68 1.03 3.25 7.57 68 1.46 1.02 4.63 1.03 3.21 7.50 69 1.46 1.02 4.62 1.02 3.20 7.49 70 1.45 1.01 4.60 1.01 3.17 7.46 71 1.44 1.00 4.64 1.02 3.17 7.42 72 1.44 1.00 4.64 1.02 3.18 7.38 73 1.43 1.00 4.65 1.02 3.19 7.37 74 1.43 1.00 4.65 1.01 3.17 7.36 75 1.43 1.00 4.63 1.02 3.16 7.36 76 1.43 0.99 4.65 1.01 3.14 7.33 77 1.43 0.99 4.67 1.01 3.13 7.32 78 1.42 0.99 4.64 0.99 3.10 7.30 79 1.41 0.98 4.64 0.98 3.11 7.27 biscuit_1kg 1 4.06 2 4.12 3 4.06 4 4.07 5 4.05 6 4.07 7 4.08 8 4.07 9 4.03 10 3.97 11 3.89 12 3.91 13 3.89 14 3.88 15 3.86 16 3.83 17 3.77 18 3.64 19 3.66 20 3.62 21 3.61 22 3.61 23 3.59 24 3.56 25 3.56 26 3.55 27 3.53 28 3.55 29 3.55 30 3.56 31 3.53 32 3.53 33 3.51 34 3.53 35 3.53 36 3.54 37 3.56 38 3.58 39 3.56 40 3.55 41 3.52 42 3.52 43 3.49 44 3.46 45 3.46 46 3.45 47 3.48 48 3.48 49 3.48 50 3.48 51 3.46 52 3.44 53 3.41 54 3.40 55 3.34 56 3.34 57 3.34 58 3.30 59 3.27 60 3.26 61 3.28 62 3.30 63 3.29 64 3.29 65 3.25 66 3.26 67 3.26 68 3.24 69 3.24 70 3.25 71 3.21 72 3.20 73 3.21 74 3.23 75 3.20 76 3.20 77 3.19 78 3.16 79 3.11 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Speciality_bread_400g Speciality_bread_800g -0.16782 2.32198 -0.98397 Brown_bread_800g Multigrain_bread_800g Currant_1kg 0.29506 0.78795 -0.51359 Roll_1kg Rice_tart_1kg Mocha_tart 0.12373 -0.37771 -1.39522 Fruit_tart Eclair Biscuits_1kg 0.38031 0.36147 0.06012 Penny_wafer_200g Spekulatius_1kg Garibaldi -0.10538 0.15556 0.25924 biscuit_1kg 0.13647 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.072582 -0.010057 -0.000651 0.011863 0.064378 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -0.16782 0.38666 -0.434 0.665760 Speciality_bread_400g 2.32198 0.58586 3.963 0.000191 *** Speciality_bread_800g -0.98397 0.67374 -1.460 0.149132 Brown_bread_800g 0.29506 0.66390 0.444 0.658253 Multigrain_bread_800g 0.78795 0.35955 2.191 0.032123 * Currant_1kg -0.51359 0.19597 -2.621 0.010982 * Roll_1kg 0.12373 0.10592 1.168 0.247144 Rice_tart_1kg -0.37771 0.10712 -3.526 0.000793 *** Mocha_tart -1.39522 0.47920 -2.912 0.004968 ** Fruit_tart 0.38031 0.57697 0.659 0.512202 Eclair 0.36147 0.68079 0.531 0.597316 Biscuits_1kg 0.06012 0.04011 1.499 0.138891 Penny_wafer_200g -0.10538 0.17475 -0.603 0.548663 Spekulatius_1kg 0.15556 0.06085 2.557 0.012991 * Garibaldi 0.25924 0.14442 1.795 0.077455 . biscuit_1kg 0.13647 0.09020 1.513 0.135266 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.02293 on 63 degrees of freedom Multiple R-squared: 0.984, Adjusted R-squared: 0.9802 F-statistic: 258.8 on 15 and 63 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,] 0.7677744 0.464451203 0.232225601 [2,] 0.7973989 0.405202298 0.202601149 [3,] 0.7094920 0.581015967 0.290507983 [4,] 0.6991904 0.601619158 0.300809579 [5,] 0.6745782 0.650843642 0.325421821 [6,] 0.5758447 0.848310516 0.424155258 [7,] 0.5448207 0.910358683 0.455179342 [8,] 0.5834201 0.833159714 0.416579857 [9,] 0.7265885 0.546822981 0.273411491 [10,] 0.6492488 0.701502346 0.350751173 [11,] 0.7619576 0.476084729 0.238042364 [12,] 0.7688151 0.462369824 0.231184912 [13,] 0.7126182 0.574763697 0.287381849 [14,] 0.6451497 0.709700669 0.354850334 [15,] 0.6449591 0.710081789 0.355040895 [16,] 0.6071471 0.785705750 0.392852875 [17,] 0.6203094 0.759381284 0.379690642 [18,] 0.6561567 0.687686578 0.343843289 [19,] 0.6255533 0.748893352 0.374446676 [20,] 0.6671934 0.665613220 0.332806610 [21,] 0.7172204 0.565559277 0.282779639 [22,] 0.6739693 0.652061346 0.326030673 [23,] 0.6365423 0.726915363 0.363457681 [24,] 0.6048515 0.790297009 0.395148504 [25,] 0.5721318 0.855736469 0.427868234 [26,] 0.7051511 0.589697878 0.294848939 [27,] 0.9292482 0.141503562 0.070751781 [28,] 0.9495804 0.100839163 0.050419581 [29,] 0.9567801 0.086439774 0.043219887 [30,] 0.9770948 0.045810316 0.022905158 [31,] 0.9852402 0.029519636 0.014759818 [32,] 0.9842382 0.031523564 0.015761782 [33,] 0.9876941 0.024611781 0.012305891 [34,] 0.9954261 0.009147737 0.004573868 [35,] 0.9905005 0.018999069 0.009499534 [36,] 0.9904865 0.019026922 0.009513461 [37,] 0.9906418 0.018716385 0.009358193 [38,] 0.9901357 0.019728640 0.009864320 [39,] 0.9847521 0.030495766 0.015247883 [40,] 0.9695269 0.060946154 0.030473077 [41,] 0.9464816 0.107036738 0.053518369 [42,] 0.9443672 0.111265669 0.055632834 > postscript(file="/var/wessaorg/rcomp/tmp/1cnt61353439920.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/229w71353439920.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/36pea1353439920.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/4gpeh1353439920.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/51sre1353439920.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 = 79 Frequency = 1 1 2 3 4 5 3.569507e-03 -2.079742e-02 -1.362729e-02 -3.294916e-02 7.356290e-03 6 7 8 9 10 -1.078705e-02 -8.964770e-03 4.528353e-03 3.603131e-02 5.071040e-03 11 12 13 14 15 9.143401e-03 1.846352e-03 1.354215e-02 4.488043e-03 1.747578e-03 16 17 18 19 20 1.605003e-02 1.836831e-02 6.437809e-02 -2.299729e-02 -2.282313e-02 21 22 23 24 25 -1.995297e-02 -2.322026e-02 -9.537940e-04 -3.482311e-03 2.431426e-02 26 27 28 29 30 4.039360e-02 -8.018151e-03 1.421167e-02 -8.184144e-03 -4.425217e-02 31 32 33 34 35 -1.309029e-02 -1.671971e-02 -5.598730e-03 -6.435673e-03 3.857700e-03 36 37 38 39 40 2.247864e-03 -4.003992e-03 6.488393e-05 1.386660e-02 1.624661e-02 41 42 43 44 45 -1.132670e-02 -5.138834e-03 -1.432308e-02 -3.174873e-02 -7.703318e-03 46 47 48 49 50 2.729391e-02 1.069984e-02 3.423550e-02 2.073222e-02 7.262322e-03 51 52 53 54 55 -6.304777e-03 -1.238956e-02 1.902105e-02 2.762765e-03 1.166953e-02 56 57 58 59 60 -1.239828e-03 -3.241239e-02 -7.258224e-02 1.152344e-02 1.796853e-02 61 62 63 64 65 1.205674e-02 -3.766349e-02 8.169602e-04 1.592910e-03 3.112139e-02 66 67 68 69 70 -3.216510e-03 -2.098077e-02 2.203379e-02 -1.263982e-03 -2.142624e-03 71 72 73 74 75 2.021907e-04 3.673024e-02 -7.687618e-03 -9.327281e-03 -6.506370e-04 76 77 78 79 -1.548040e-02 -6.931488e-03 -4.946852e-03 2.327246e-02 > postscript(file="/var/wessaorg/rcomp/tmp/6hotk1353439920.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 = 79 Frequency = 1 lag(myerror, k = 1) myerror 0 3.569507e-03 NA 1 -2.079742e-02 3.569507e-03 2 -1.362729e-02 -2.079742e-02 3 -3.294916e-02 -1.362729e-02 4 7.356290e-03 -3.294916e-02 5 -1.078705e-02 7.356290e-03 6 -8.964770e-03 -1.078705e-02 7 4.528353e-03 -8.964770e-03 8 3.603131e-02 4.528353e-03 9 5.071040e-03 3.603131e-02 10 9.143401e-03 5.071040e-03 11 1.846352e-03 9.143401e-03 12 1.354215e-02 1.846352e-03 13 4.488043e-03 1.354215e-02 14 1.747578e-03 4.488043e-03 15 1.605003e-02 1.747578e-03 16 1.836831e-02 1.605003e-02 17 6.437809e-02 1.836831e-02 18 -2.299729e-02 6.437809e-02 19 -2.282313e-02 -2.299729e-02 20 -1.995297e-02 -2.282313e-02 21 -2.322026e-02 -1.995297e-02 22 -9.537940e-04 -2.322026e-02 23 -3.482311e-03 -9.537940e-04 24 2.431426e-02 -3.482311e-03 25 4.039360e-02 2.431426e-02 26 -8.018151e-03 4.039360e-02 27 1.421167e-02 -8.018151e-03 28 -8.184144e-03 1.421167e-02 29 -4.425217e-02 -8.184144e-03 30 -1.309029e-02 -4.425217e-02 31 -1.671971e-02 -1.309029e-02 32 -5.598730e-03 -1.671971e-02 33 -6.435673e-03 -5.598730e-03 34 3.857700e-03 -6.435673e-03 35 2.247864e-03 3.857700e-03 36 -4.003992e-03 2.247864e-03 37 6.488393e-05 -4.003992e-03 38 1.386660e-02 6.488393e-05 39 1.624661e-02 1.386660e-02 40 -1.132670e-02 1.624661e-02 41 -5.138834e-03 -1.132670e-02 42 -1.432308e-02 -5.138834e-03 43 -3.174873e-02 -1.432308e-02 44 -7.703318e-03 -3.174873e-02 45 2.729391e-02 -7.703318e-03 46 1.069984e-02 2.729391e-02 47 3.423550e-02 1.069984e-02 48 2.073222e-02 3.423550e-02 49 7.262322e-03 2.073222e-02 50 -6.304777e-03 7.262322e-03 51 -1.238956e-02 -6.304777e-03 52 1.902105e-02 -1.238956e-02 53 2.762765e-03 1.902105e-02 54 1.166953e-02 2.762765e-03 55 -1.239828e-03 1.166953e-02 56 -3.241239e-02 -1.239828e-03 57 -7.258224e-02 -3.241239e-02 58 1.152344e-02 -7.258224e-02 59 1.796853e-02 1.152344e-02 60 1.205674e-02 1.796853e-02 61 -3.766349e-02 1.205674e-02 62 8.169602e-04 -3.766349e-02 63 1.592910e-03 8.169602e-04 64 3.112139e-02 1.592910e-03 65 -3.216510e-03 3.112139e-02 66 -2.098077e-02 -3.216510e-03 67 2.203379e-02 -2.098077e-02 68 -1.263982e-03 2.203379e-02 69 -2.142624e-03 -1.263982e-03 70 2.021907e-04 -2.142624e-03 71 3.673024e-02 2.021907e-04 72 -7.687618e-03 3.673024e-02 73 -9.327281e-03 -7.687618e-03 74 -6.506370e-04 -9.327281e-03 75 -1.548040e-02 -6.506370e-04 76 -6.931488e-03 -1.548040e-02 77 -4.946852e-03 -6.931488e-03 78 2.327246e-02 -4.946852e-03 79 NA 2.327246e-02 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -2.079742e-02 3.569507e-03 [2,] -1.362729e-02 -2.079742e-02 [3,] -3.294916e-02 -1.362729e-02 [4,] 7.356290e-03 -3.294916e-02 [5,] -1.078705e-02 7.356290e-03 [6,] -8.964770e-03 -1.078705e-02 [7,] 4.528353e-03 -8.964770e-03 [8,] 3.603131e-02 4.528353e-03 [9,] 5.071040e-03 3.603131e-02 [10,] 9.143401e-03 5.071040e-03 [11,] 1.846352e-03 9.143401e-03 [12,] 1.354215e-02 1.846352e-03 [13,] 4.488043e-03 1.354215e-02 [14,] 1.747578e-03 4.488043e-03 [15,] 1.605003e-02 1.747578e-03 [16,] 1.836831e-02 1.605003e-02 [17,] 6.437809e-02 1.836831e-02 [18,] -2.299729e-02 6.437809e-02 [19,] -2.282313e-02 -2.299729e-02 [20,] -1.995297e-02 -2.282313e-02 [21,] -2.322026e-02 -1.995297e-02 [22,] -9.537940e-04 -2.322026e-02 [23,] -3.482311e-03 -9.537940e-04 [24,] 2.431426e-02 -3.482311e-03 [25,] 4.039360e-02 2.431426e-02 [26,] -8.018151e-03 4.039360e-02 [27,] 1.421167e-02 -8.018151e-03 [28,] -8.184144e-03 1.421167e-02 [29,] -4.425217e-02 -8.184144e-03 [30,] -1.309029e-02 -4.425217e-02 [31,] -1.671971e-02 -1.309029e-02 [32,] -5.598730e-03 -1.671971e-02 [33,] -6.435673e-03 -5.598730e-03 [34,] 3.857700e-03 -6.435673e-03 [35,] 2.247864e-03 3.857700e-03 [36,] -4.003992e-03 2.247864e-03 [37,] 6.488393e-05 -4.003992e-03 [38,] 1.386660e-02 6.488393e-05 [39,] 1.624661e-02 1.386660e-02 [40,] -1.132670e-02 1.624661e-02 [41,] -5.138834e-03 -1.132670e-02 [42,] -1.432308e-02 -5.138834e-03 [43,] -3.174873e-02 -1.432308e-02 [44,] -7.703318e-03 -3.174873e-02 [45,] 2.729391e-02 -7.703318e-03 [46,] 1.069984e-02 2.729391e-02 [47,] 3.423550e-02 1.069984e-02 [48,] 2.073222e-02 3.423550e-02 [49,] 7.262322e-03 2.073222e-02 [50,] -6.304777e-03 7.262322e-03 [51,] -1.238956e-02 -6.304777e-03 [52,] 1.902105e-02 -1.238956e-02 [53,] 2.762765e-03 1.902105e-02 [54,] 1.166953e-02 2.762765e-03 [55,] -1.239828e-03 1.166953e-02 [56,] -3.241239e-02 -1.239828e-03 [57,] -7.258224e-02 -3.241239e-02 [58,] 1.152344e-02 -7.258224e-02 [59,] 1.796853e-02 1.152344e-02 [60,] 1.205674e-02 1.796853e-02 [61,] -3.766349e-02 1.205674e-02 [62,] 8.169602e-04 -3.766349e-02 [63,] 1.592910e-03 8.169602e-04 [64,] 3.112139e-02 1.592910e-03 [65,] -3.216510e-03 3.112139e-02 [66,] -2.098077e-02 -3.216510e-03 [67,] 2.203379e-02 -2.098077e-02 [68,] -1.263982e-03 2.203379e-02 [69,] -2.142624e-03 -1.263982e-03 [70,] 2.021907e-04 -2.142624e-03 [71,] 3.673024e-02 2.021907e-04 [72,] -7.687618e-03 3.673024e-02 [73,] -9.327281e-03 -7.687618e-03 [74,] -6.506370e-04 -9.327281e-03 [75,] -1.548040e-02 -6.506370e-04 [76,] -6.931488e-03 -1.548040e-02 [77,] -4.946852e-03 -6.931488e-03 [78,] 2.327246e-02 -4.946852e-03 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -2.079742e-02 3.569507e-03 2 -1.362729e-02 -2.079742e-02 3 -3.294916e-02 -1.362729e-02 4 7.356290e-03 -3.294916e-02 5 -1.078705e-02 7.356290e-03 6 -8.964770e-03 -1.078705e-02 7 4.528353e-03 -8.964770e-03 8 3.603131e-02 4.528353e-03 9 5.071040e-03 3.603131e-02 10 9.143401e-03 5.071040e-03 11 1.846352e-03 9.143401e-03 12 1.354215e-02 1.846352e-03 13 4.488043e-03 1.354215e-02 14 1.747578e-03 4.488043e-03 15 1.605003e-02 1.747578e-03 16 1.836831e-02 1.605003e-02 17 6.437809e-02 1.836831e-02 18 -2.299729e-02 6.437809e-02 19 -2.282313e-02 -2.299729e-02 20 -1.995297e-02 -2.282313e-02 21 -2.322026e-02 -1.995297e-02 22 -9.537940e-04 -2.322026e-02 23 -3.482311e-03 -9.537940e-04 24 2.431426e-02 -3.482311e-03 25 4.039360e-02 2.431426e-02 26 -8.018151e-03 4.039360e-02 27 1.421167e-02 -8.018151e-03 28 -8.184144e-03 1.421167e-02 29 -4.425217e-02 -8.184144e-03 30 -1.309029e-02 -4.425217e-02 31 -1.671971e-02 -1.309029e-02 32 -5.598730e-03 -1.671971e-02 33 -6.435673e-03 -5.598730e-03 34 3.857700e-03 -6.435673e-03 35 2.247864e-03 3.857700e-03 36 -4.003992e-03 2.247864e-03 37 6.488393e-05 -4.003992e-03 38 1.386660e-02 6.488393e-05 39 1.624661e-02 1.386660e-02 40 -1.132670e-02 1.624661e-02 41 -5.138834e-03 -1.132670e-02 42 -1.432308e-02 -5.138834e-03 43 -3.174873e-02 -1.432308e-02 44 -7.703318e-03 -3.174873e-02 45 2.729391e-02 -7.703318e-03 46 1.069984e-02 2.729391e-02 47 3.423550e-02 1.069984e-02 48 2.073222e-02 3.423550e-02 49 7.262322e-03 2.073222e-02 50 -6.304777e-03 7.262322e-03 51 -1.238956e-02 -6.304777e-03 52 1.902105e-02 -1.238956e-02 53 2.762765e-03 1.902105e-02 54 1.166953e-02 2.762765e-03 55 -1.239828e-03 1.166953e-02 56 -3.241239e-02 -1.239828e-03 57 -7.258224e-02 -3.241239e-02 58 1.152344e-02 -7.258224e-02 59 1.796853e-02 1.152344e-02 60 1.205674e-02 1.796853e-02 61 -3.766349e-02 1.205674e-02 62 8.169602e-04 -3.766349e-02 63 1.592910e-03 8.169602e-04 64 3.112139e-02 1.592910e-03 65 -3.216510e-03 3.112139e-02 66 -2.098077e-02 -3.216510e-03 67 2.203379e-02 -2.098077e-02 68 -1.263982e-03 2.203379e-02 69 -2.142624e-03 -1.263982e-03 70 2.021907e-04 -2.142624e-03 71 3.673024e-02 2.021907e-04 72 -7.687618e-03 3.673024e-02 73 -9.327281e-03 -7.687618e-03 74 -6.506370e-04 -9.327281e-03 75 -1.548040e-02 -6.506370e-04 76 -6.931488e-03 -1.548040e-02 77 -4.946852e-03 -6.931488e-03 78 2.327246e-02 -4.946852e-03 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7umba1353439920.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/8ncg11353439920.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/99npr1353439920.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/wessaorg/rcomp/tmp/102rys1353439920.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/11sqd11353439920.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/12yvfh1353439920.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/13lsc71353439920.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/14dm5d1353439920.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/15k0r11353439920.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/16tky41353439920.tab") + } > > try(system("convert tmp/1cnt61353439920.ps tmp/1cnt61353439920.png",intern=TRUE)) character(0) > try(system("convert tmp/229w71353439920.ps tmp/229w71353439920.png",intern=TRUE)) character(0) > try(system("convert tmp/36pea1353439920.ps tmp/36pea1353439920.png",intern=TRUE)) character(0) > try(system("convert tmp/4gpeh1353439920.ps tmp/4gpeh1353439920.png",intern=TRUE)) character(0) > try(system("convert tmp/51sre1353439920.ps tmp/51sre1353439920.png",intern=TRUE)) character(0) > try(system("convert tmp/6hotk1353439920.ps tmp/6hotk1353439920.png",intern=TRUE)) character(0) > try(system("convert tmp/7umba1353439920.ps tmp/7umba1353439920.png",intern=TRUE)) character(0) > try(system("convert tmp/8ncg11353439920.ps tmp/8ncg11353439920.png",intern=TRUE)) character(0) > try(system("convert tmp/99npr1353439920.ps tmp/99npr1353439920.png",intern=TRUE)) character(0) > try(system("convert tmp/102rys1353439920.ps tmp/102rys1353439920.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.539 1.385 8.958