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(9.11 + ,15.13 + ,9.24 + ,19.31 + ,9.84 + ,7.66 + ,6.11 + ,8.11 + ,2.58 + ,1.55 + ,1.55 + ,1.64 + ,2.07 + ,2.39 + ,1.32 + ,3.16 + ,0.89 + ,0.66 + ,9.06 + ,15.25 + ,9.29 + ,19.47 + ,9.87 + ,7.53 + ,6.13 + ,8.13 + ,2.59 + ,1.56 + ,1.56 + ,1.65 + ,2.08 + ,2.4 + ,1.33 + ,3.2 + ,0.89 + ,0.67 + ,9.11 + ,15.33 + ,9.39 + ,19.7 + ,9.9 + ,7.54 + ,6.15 + ,8.16 + ,2.6 + ,1.56 + ,1.56 + ,1.65 + ,2.08 + ,2.42 + ,1.33 + ,3.2 + ,0.89 + ,0.67 + ,9.13 + ,15.36 + ,9.42 + ,19.76 + ,9.9 + ,7.56 + ,6.15 + ,8.17 + ,2.6 + ,1.57 + ,1.56 + ,1.65 + ,2.08 + ,2.42 + ,1.33 + ,3.21 + ,0.89 + ,0.67 + ,9.13 + ,15.4 + ,9.42 + ,19.9 + ,9.87 + ,7.57 + ,6.16 + ,8.22 + ,2.61 + ,1.57 + ,1.57 + ,1.66 + ,2.09 + ,2.44 + ,1.33 + ,3.22 + ,0.89 + ,0.67 + ,9.19 + ,15.4 + ,9.43 + ,19.97 + ,9.87 + ,7.56 + ,6.18 + ,8.23 + ,2.62 + ,1.58 + ,1.57 + ,1.66 + ,2.09 + ,2.44 + ,1.33 + ,3.22 + ,0.89 + ,0.67 + ,9.2 + ,15.41 + ,9.5 + ,20.1 + ,9.88 + ,7.57 + ,6.21 + ,8.28 + ,2.64 + ,1.58 + ,1.57 + ,1.67 + ,2.09 + ,2.44 + ,1.34 + ,3.23 + ,0.89 + ,0.67 + ,9.23 + ,15.47 + ,9.53 + ,20.26 + ,9.76 + ,7.61 + ,6.22 + ,8.28 + ,2.65 + ,1.58 + ,1.57 + ,1.67 + ,2.1 + ,2.45 + ,1.34 + ,3.24 + ,0.9 + ,0.67 + ,9.24 + ,15.54 + ,9.58 + ,20.44 + ,9.76 + ,7.61 + ,6.23 + ,8.29 + ,2.66 + ,1.58 + ,1.58 + ,1.68 + ,2.1 + ,2.46 + ,1.34 + ,3.25 + ,0.9 + ,0.67 + ,9.28 + ,15.55 + ,9.58 + ,20.43 + ,9.76 + ,7.6 + ,6.26 + ,8.31 + ,2.67 + ,1.59 + ,1.59 + ,1.68 + ,2.1 + ,2.47 + ,1.34 + ,3.25 + ,0.9 + ,0.67 + ,9.32 + ,15.59 + ,9.6 + ,20.57 + ,9.77 + ,7.61 + ,6.28 + ,8.33 + ,2.68 + ,1.59 + ,1.59 + ,1.68 + ,2.11 + ,2.48 + ,1.35 + ,3.26 + ,0.9 + ,0.67 + ,9.32 + ,15.65 + ,9.61 + ,20.6 + ,9.77 + ,7.61 + ,6.28 + ,8.36 + ,2.69 + ,1.6 + ,1.59 + ,1.68 + ,2.11 + ,2.48 + ,1.35 + ,3.26 + ,0.9 + ,0.67 + ,9.32 + ,15.75 + ,9.65 + ,20.69 + ,9.77 + ,7.62 + ,6.29 + ,8.36 + ,2.69 + ,1.6 + ,1.6 + ,1.69 + ,2.11 + ,2.49 + ,1.34 + ,3.29 + ,0.9 + ,0.67 + ,9.36 + ,15.86 + ,9.71 + ,20.93 + ,9.83 + ,7.7 + ,6.32 + ,8.39 + ,2.71 + ,1.61 + ,1.6 + ,1.69 + ,2.13 + ,2.5 + ,1.35 + ,3.31 + ,0.91 + ,0.69 + ,9.37 + ,15.89 + ,9.78 + ,20.98 + ,9.85 + ,7.73 + ,6.36 + ,8.46 + ,2.72 + ,1.62 + ,1.61 + ,1.7 + ,2.18 + ,2.51 + ,1.35 + ,3.33 + ,0.91 + ,0.7 + ,9.38 + ,15.94 + ,9.79 + ,21.11 + ,9.85 + ,7.75 + ,6.37 + ,8.48 + ,2.73 + ,1.62 + ,1.62 + ,1.7 + ,2.2 + ,2.52 + ,1.36 + ,3.33 + ,0.91 + ,0.7 + ,9.41 + ,15.93 + ,9.84 + ,21.14 + ,9.89 + ,7.76 + ,6.38 + ,8.52 + ,2.73 + ,1.63 + ,1.62 + ,1.71 + ,2.21 + ,2.52 + ,1.36 + ,3.33 + ,0.91 + ,0.7 + ,9.44 + ,15.95 + ,9.87 + ,21.16 + ,9.9 + ,7.76 + ,6.38 + ,8.53 + ,2.74 + ,1.63 + ,1.62 + ,1.71 + ,2.21 + ,2.52 + ,1.37 + ,3.33 + ,0.91 + ,0.7 + ,9.44 + ,15.99 + ,9.9 + ,21.32 + ,9.92 + ,7.77 + ,6.4 + ,8.57 + ,2.74 + ,1.63 + ,1.62 + ,1.71 + ,2.22 + ,2.54 + ,1.37 + ,3.33 + ,0.91 + ,0.7 + ,9.44 + ,15.99 + ,9.95 + ,21.32 + ,9.91 + ,7.79 + ,6.41 + ,8.58 + ,2.74 + ,1.63 + ,1.63 + ,1.71 + ,2.22 + ,2.54 + ,1.37 + ,3.33 + ,0.91 + ,0.7 + ,9.47 + ,16.06 + ,9.96 + ,21.48 + ,9.92 + ,7.79 + ,6.42 + ,8.58 + ,2.74 + ,1.63 + ,1.63 + ,1.72 + ,2.23 + ,2.54 + ,1.38 + ,3.35 + ,0.91 + ,0.71 + ,9.48 + ,16.08 + ,9.98 + ,21.58 + ,9.92 + ,7.79 + ,6.43 + ,8.63 + ,2.74 + ,1.63 + ,1.63 + ,1.72 + ,2.23 + ,2.56 + ,1.38 + ,3.37 + ,0.91 + ,0.71 + ,9.56 + ,16.07 + ,10.01 + ,21.74 + ,9.96 + ,7.83 + ,6.44 + ,8.66 + ,2.75 + ,1.64 + ,1.63 + ,1.72 + ,2.23 + ,2.57 + ,1.38 + ,3.4 + ,0.91 + ,0.71 + ,9.58 + ,16.11 + ,10 + ,21.75 + ,9.97 + ,7.83 + ,6.47 + ,8.69 + ,2.75 + ,1.64 + ,1.64 + ,1.73 + ,2.23 + ,2.58 + ,1.38 + ,3.42 + ,0.91 + ,0.71 + ,9.56 + ,16.15 + ,10.03 + ,21.81 + ,9.98 + ,7.88 + ,6.47 + ,8.72 + ,2.75 + ,1.64 + ,1.64 + ,1.73 + ,2.24 + ,2.58 + ,1.39 + ,3.46 + ,0.91 + ,0.71 + ,9.58 + ,16.18 + ,10.05 + ,21.89 + ,10.06 + ,7.95 + ,6.48 + ,8.74 + ,2.75 + ,1.65 + ,1.64 + ,1.73 + ,2.25 + ,2.58 + ,1.39 + ,3.46 + ,0.91 + ,0.71 + ,9.7 + ,16.3 + ,10.06 + ,22.21 + ,10.07 + ,8.01 + ,6.51 + ,8.8 + ,2.77 + ,1.65 + ,1.65 + ,1.74 + ,2.26 + ,2.58 + ,1.4 + ,3.47 + ,0.92 + ,0.71 + ,9.74 + ,16.42 + ,10.09 + ,22.37 + ,10.12 + ,8.05 + ,6.54 + ,8.86 + ,2.78 + ,1.66 + ,1.66 + ,1.75 + ,2.27 + ,2.59 + ,1.4 + ,3.48 + ,0.92 + ,0.71 + ,9.76 + ,16.49 + ,10.24 + ,22.47 + ,10.1 + ,8.1 + ,6.56 + ,8.91 + ,2.79 + ,1.67 + ,1.67 + ,1.75 + ,2.28 + ,2.6 + ,1.41 + ,3.49 + ,0.92 + ,0.72 + ,9.78 + ,16.5 + ,10.23 + ,22.51 + ,10.1 + ,8.1 + ,6.57 + ,8.94 + ,2.8 + ,1.67 + ,1.67 + ,1.76 + ,2.29 + ,2.61 + ,1.42 + ,3.49 + ,0.92 + ,0.72 + ,9.84 + ,16.58 + ,10.27 + ,22.55 + ,10.1 + ,8.16 + ,6.6 + ,8.97 + ,2.82 + ,1.68 + ,1.68 + ,1.76 + ,2.3 + ,2.61 + ,1.43 + ,3.5 + ,0.93 + ,0.72 + ,9.88 + ,16.64 + ,10.28 + ,22.61 + ,10.19 + ,8.18 + ,6.62 + ,8.99 + ,2.83 + ,1.68 + ,1.68 + ,1.77 + ,2.3 + ,2.62 + ,1.44 + ,3.5 + ,0.93 + ,0.72 + ,9.96 + ,16.66 + ,10.29 + ,22.58 + ,10.21 + ,8.2 + ,6.65 + ,8.99 + ,2.84 + ,1.69 + ,1.69 + ,1.77 + ,2.3 + ,2.63 + ,1.44 + ,3.5 + ,0.94 + ,0.73 + ,9.97 + ,16.81 + ,10.44 + ,22.85 + ,10.2 + ,7.99 + ,6.71 + ,9.06 + ,2.87 + ,1.7 + ,1.7 + ,1.78 + ,2.32 + ,2.65 + ,1.45 + ,3.51 + ,0.95 + ,0.73 + ,9.96 + ,16.91 + ,10.51 + ,22.93 + ,10.39 + ,8.01 + ,6.76 + ,9.12 + ,2.89 + ,1.71 + ,1.71 + ,1.79 + ,2.32 + ,2.67 + ,1.46 + ,3.48 + ,0.95 + ,0.73 + ,9.96 + ,16.92 + ,10.52 + ,22.98 + ,10.39 + ,8.02 + ,6.78 + ,9.14 + ,2.9 + ,1.72 + ,1.71 + ,1.8 + ,2.32 + ,2.68 + ,1.46 + ,3.48 + ,0.95 + ,0.73 + ,9.96 + ,16.95 + ,10.57 + ,23.01 + ,10.39 + ,8.03 + ,6.8 + ,9.15 + ,2.9 + ,1.72 + ,1.72 + ,1.8 + ,2.33 + ,2.67 + ,1.46 + ,3.48 + ,0.95 + ,0.73 + ,10.02 + ,17.11 + ,10.62 + ,23.11 + ,10.45 + ,8.04 + ,6.83 + ,9.19 + ,2.91 + ,1.73 + ,1.72 + ,1.81 + ,2.34 + ,2.68 + ,1.46 + ,3.49 + ,0.96 + ,0.73 + ,10.08 + ,17.16 + ,10.71 + ,23.18 + ,10.49 + ,8.07 + ,6.86 + ,9.21 + ,2.92 + ,1.73 + ,1.73 + ,1.81 + ,2.34 + ,2.68 + ,1.46 + ,3.51 + ,0.96 + ,0.73 + ,10.09 + ,17.16 + ,10.73 + ,23.18 + ,10.48 + ,8.08 + ,6.86 + ,9.22 + ,2.92 + ,1.73 + ,1.73 + ,1.81 + ,2.34 + ,2.68 + ,1.46 + ,3.51 + ,0.96 + ,0.73 + ,10.12 + ,17.27 + ,10.74 + ,23.21 + ,10.49 + ,8.08 + ,6.87 + ,9.23 + ,2.92 + ,1.73 + ,1.73 + ,1.81 + ,2.35 + ,2.68 + ,1.46 + ,3.52 + ,0.97 + ,0.73 + ,10.14 + ,17.34 + ,10.75 + ,23.22 + ,10.49 + ,8.1 + ,6.88 + ,9.24 + ,2.92 + ,1.74 + ,1.74 + ,1.82 + ,2.35 + ,2.69 + ,1.47 + ,3.52 + ,0.97 + ,0.73 + ,10.17 + ,17.39 + ,10.79 + ,23.12 + ,10.5 + ,8.11 + ,6.9 + ,9.27 + ,2.94 + ,1.75 + ,1.75 + ,1.82 + ,2.36 + ,2.69 + ,1.47 + ,3.54 + ,0.97 + ,0.73 + ,10.22 + ,17.43 + ,10.81 + ,23.15 + ,10.51 + ,8.15 + ,6.92 + ,9.29 + ,2.95 + ,1.75 + ,1.75 + ,1.82 + ,2.37 + ,2.69 + ,1.47 + ,3.55 + ,0.97 + ,0.73 + ,10.25 + ,17.45 + ,10.87 + ,23.16 + ,10.51 + ,8.16 + ,6.93 + ,9.31 + ,2.95 + ,1.75 + ,1.75 + ,1.83 + ,2.37 + ,2.7 + ,1.48 + ,3.55 + ,0.98 + ,0.74 + ,10.25 + ,17.5 + ,10.92 + ,23.21 + ,10.53 + ,8.17 + ,6.94 + ,9.34 + ,2.97 + ,1.76 + ,1.76 + ,1.83 + ,2.37 + ,2.71 + ,1.48 + ,3.55 + ,0.98 + ,0.75 + ,10.26 + ,17.56 + ,10.95 + ,23.21 + ,10.54 + ,8.18 + ,6.96 + ,9.35 + ,2.99 + ,1.76 + ,1.76 + ,1.83 + ,2.38 + ,2.72 + ,1.48 + ,3.55 + ,0.98 + ,0.75 + ,10.34 + ,17.65 + ,10.94 + ,23.22 + ,10.54 + ,8.15 + ,6.98 + ,9.38 + ,3 + ,1.76 + ,1.77 + ,1.84 + ,2.38 + ,2.71 + ,1.48 + ,3.55 + ,0.99 + ,0.75 + ,10.33 + ,17.62 + ,10.97 + ,23.25 + ,10.55 + ,8.15 + ,6.99 + ,9.4 + ,3 + ,1.77 + ,1.77 + ,1.84 + ,2.38 + ,2.72 + ,1.48 + ,3.56 + ,0.99 + ,0.75 + ,10.3 + ,17.7 + ,10.99 + ,23.39 + ,10.58 + ,8.17 + ,7.01 + ,9.44 + ,3.01 + ,1.78 + ,1.78 + ,1.85 + ,2.39 + ,2.73 + ,1.49 + ,3.56 + ,0.99 + ,0.76 + ,10.33 + ,17.72 + ,11.04 + ,23.41 + ,10.59 + ,8.16 + ,7.06 + ,9.47 + ,3.03 + ,1.78 + ,1.79 + ,1.85 + ,2.4 + ,2.74 + ,1.5 + ,3.57 + ,1 + ,0.76 + ,10.33 + ,17.71 + ,11.09 + ,23.45 + ,10.56 + ,8.15 + ,7.07 + ,9.48 + ,3.03 + ,1.79 + ,1.79 + ,1.86 + ,2.41 + ,2.74 + ,1.5 + ,3.57 + ,1.01 + ,0.76 + ,10.37 + ,17.74 + ,11.12 + ,23.46 + ,10.57 + ,8.16 + ,7.08 + ,9.5 + ,3.04 + ,1.79 + ,1.79 + ,1.86 + ,2.42 + ,2.75 + ,1.5 + ,3.57 + ,1.02 + ,0.77 + ,10.44 + ,17.75 + ,11.11 + ,23.44 + ,10.59 + ,8.15 + ,7.08 + ,9.52 + ,3.04 + ,1.79 + ,1.79 + ,1.86 + ,2.43 + ,2.75 + ,1.5 + ,3.57 + ,1.02 + ,0.77 + ,10.45 + ,17.78 + ,11.14 + ,23.54 + ,10.63 + ,8.18 + ,7.1 + ,9.54 + ,3.05 + ,1.79 + ,1.79 + ,1.86 + ,2.43 + ,2.76 + ,1.5 + ,3.57 + ,1.02 + ,0.78 + ,10.45 + ,17.8 + ,11.2 + ,23.62 + ,10.63 + ,8.19 + ,7.11 + ,9.53 + ,3.05 + ,1.79 + ,1.8 + ,1.86 + ,2.43 + ,2.75 + ,1.5 + ,3.58 + ,1.02 + ,0.78 + ,10.44 + ,17.86 + ,11.25 + ,23.86 + ,10.66 + ,8.18 + ,7.22 + ,9.74 + ,3.09 + ,1.83 + ,1.82 + ,1.89 + ,2.43 + ,2.78 + ,1.51 + ,3.64 + ,1.02 + ,0.78 + ,10.43 + ,17.88 + ,11.3 + ,24.07 + ,10.69 + ,8.2 + ,7.24 + ,9.75 + ,3.09 + ,1.83 + ,1.83 + ,1.89 + ,2.44 + ,2.79 + ,1.52 + ,3.64 + ,1.03 + ,0.78 + ,10.4 + ,17.89 + ,11.31 + ,24.13 + ,10.72 + ,8.21 + ,7.25 + ,9.75 + ,3.09 + ,1.83 + ,1.83 + ,1.89 + ,2.44 + ,2.8 + ,1.52 + ,3.64 + ,1.03 + ,0.79 + ,10.43 + ,17.94 + ,11.31 + ,24.12 + ,10.72 + ,8.22 + ,7.26 + ,9.78 + ,3.1 + ,1.83 + ,1.83 + ,1.89 + ,2.45 + ,2.81 + ,1.53 + ,3.64 + ,1.03 + ,0.79 + ,10.47 + ,17.98 + ,11.33 + ,24.17 + ,10.73 + ,8.23 + ,7.27 + ,9.8 + ,3.1 + ,1.84 + ,1.83 + ,1.9 + ,2.45 + ,2.81 + ,1.53 + ,3.65 + ,1.03 + ,0.79 + ,10.52 + ,18.1 + ,11.41 + ,24.23 + ,10.75 + ,8.25 + ,7.3 + ,9.84 + ,3.11 + ,1.84 + ,1.84 + ,1.91 + ,2.48 + ,2.82 + ,1.54 + ,3.67 + ,1.03 + ,0.8 + ,10.55 + ,18.14 + ,11.46 + ,24.28 + ,10.78 + ,8.28 + ,7.32 + ,9.88 + ,3.12 + ,1.84 + ,1.84 + ,1.91 + ,2.49 + ,2.82 + ,1.55 + ,3.68 + ,1.03 + ,0.8 + ,10.5 + ,18.19 + ,11.48 + ,24.12 + ,10.79 + ,8.28 + ,7.34 + ,9.91 + ,3.12 + ,1.85 + ,1.85 + ,1.92 + ,2.49 + ,2.83 + ,1.55 + ,3.68 + ,1.03 + ,0.8 + ,10.44 + ,18.23 + ,11.58 + ,24.14 + ,10.83 + ,8.29 + ,7.35 + ,9.92 + ,3.12 + ,1.85 + ,1.85 + ,1.92 + ,2.5 + ,2.83 + ,1.55 + ,3.68 + ,1.03 + ,0.8 + ,10.47 + ,18.24 + ,11.63 + ,24.17 + ,10.83 + ,8.3 + ,7.36 + ,9.92 + ,3.13 + ,1.85 + ,1.85 + ,1.92 + ,2.51 + ,2.84 + ,1.55 + ,3.68 + ,1.03 + ,0.81 + ,10.5 + ,18.27 + ,11.69 + ,24.2 + ,10.85 + ,8.34 + ,7.39 + ,9.97 + ,3.15 + ,1.86 + ,1.86 + ,1.93 + ,2.52 + ,2.84 + ,1.56 + ,3.68 + ,1.03 + ,0.8 + ,10.54 + ,18.3 + ,11.74 + ,24.36 + ,10.88 + ,8.38 + ,7.41 + ,9.99 + ,3.16 + ,1.86 + ,1.86 + ,1.93 + ,2.53 + ,2.84 + ,1.56 + ,3.69 + ,1.03 + ,0.81 + ,10.55 + ,18.34 + ,11.68 + ,24.34 + ,10.97 + ,8.39 + ,7.43 + ,10.02 + ,3.16 + ,1.86 + ,1.86 + ,1.94 + ,2.54 + ,2.86 + ,1.56 + ,3.69 + ,1.03 + ,0.82 + ,10.53 + ,18.36 + ,11.69 + ,24.38 + ,10.98 + ,8.44 + ,7.46 + ,10.05 + ,3.18 + ,1.87 + ,1.87 + ,1.94 + ,2.54 + ,2.87 + ,1.57 + ,3.71 + ,1.03 + ,0.82 + ,10.54 + ,18.36 + ,11.71 + ,24.46 + ,11 + ,8.46 + ,7.47 + ,10.07 + ,3.19 + ,1.87 + ,1.87 + ,1.94 + ,2.56 + ,2.88 + ,1.58 + ,3.71 + ,1.04 + ,0.82 + ,10.54 + ,18.4 + ,11.75 + ,24.6 + ,11.04 + ,8.46 + ,7.5 + ,10.11 + ,3.19 + ,1.88 + ,1.88 + ,1.95 + ,2.56 + ,2.88 + ,1.58 + ,3.71 + ,1.04 + ,0.82 + ,10.54 + ,18.43 + ,11.76 + ,24.63 + ,11.08 + ,8.49 + ,7.51 + ,10.11 + ,3.2 + ,1.88 + ,1.88 + ,1.95 + ,2.56 + ,2.89 + ,1.58 + ,3.71 + ,1.04 + ,0.82 + ,10.59 + ,18.47 + ,11.79 + ,24.75 + ,11.16 + ,8.5 + ,7.52 + ,10.13 + ,3.21 + ,1.88 + ,1.88 + ,1.95 + ,2.57 + ,2.89 + ,1.58 + ,3.72 + ,1.04 + ,0.82 + ,10.72 + ,18.56 + ,11.89 + ,24.64 + ,11.19 + ,8.51 + ,7.58 + ,10.23 + ,3.26 + ,1.89 + ,1.9 + ,1.97 + ,2.58 + ,2.9 + ,1.58 + ,3.73 + ,1.05 + ,0.83 + ,10.76 + ,18.58 + ,11.94 + ,24.69 + ,11.2 + ,8.51 + ,7.59 + ,10.24 + ,3.27 + ,1.89 + ,1.9 + ,1.98 + ,2.58 + ,2.9 + ,1.59 + ,3.74 + ,1.05 + ,0.83 + ,10.78 + ,18.61 + ,11.97 + ,24.7 + ,11.22 + ,8.52 + ,7.63 + ,10.32 + ,3.28 + ,1.9 + ,1.91 + ,1.99 + ,2.59 + ,2.9 + ,1.6 + ,3.74 + ,1.05 + ,0.83 + ,10.78 + ,18.61 + ,11.99 + ,24.74 + ,11.26 + ,8.53 + ,7.64 + ,10.33 + ,3.29 + ,1.91 + ,1.91 + ,1.99 + ,2.59 + ,2.92 + ,1.6 + ,3.75 + ,1.05 + ,0.83 + ,10.78 + ,18.69 + ,12.02 + ,24.87 + ,11.29 + ,8.53 + ,7.64 + ,10.34 + ,3.29 + ,1.91 + ,1.91 + ,1.99 + ,2.6 + ,2.93 + ,1.62 + ,3.76 + ,1.05 + ,0.84) + ,dim=c(18 + ,79) + ,dimnames=list(c('Restaurant' + ,'Pepersteak' + ,'Salade' + ,'Tong' + ,'Chinees' + ,'Pizza' + ,'Bier' + ,'SpecBier' + ,'Aperitief' + ,'Water' + ,'Limonade' + ,'Expresso' + ,'Frieten' + ,'Broodje' + ,'vleessnack' + ,'Hamburger' + ,'Frisdrank' + ,'Candybar') + ,1:79)) > y <- array(NA,dim=c(18,79),dimnames=list(c('Restaurant','Pepersteak','Salade','Tong','Chinees','Pizza','Bier','SpecBier','Aperitief','Water','Limonade','Expresso','Frieten','Broodje','vleessnack','Hamburger','Frisdrank','Candybar'),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 Restaurant Pepersteak Salade Tong Chinees Pizza Bier SpecBier Aperitief 1 9.11 15.13 9.24 19.31 9.84 7.66 6.11 8.11 2.58 2 9.06 15.25 9.29 19.47 9.87 7.53 6.13 8.13 2.59 3 9.11 15.33 9.39 19.70 9.90 7.54 6.15 8.16 2.60 4 9.13 15.36 9.42 19.76 9.90 7.56 6.15 8.17 2.60 5 9.13 15.40 9.42 19.90 9.87 7.57 6.16 8.22 2.61 6 9.19 15.40 9.43 19.97 9.87 7.56 6.18 8.23 2.62 7 9.20 15.41 9.50 20.10 9.88 7.57 6.21 8.28 2.64 8 9.23 15.47 9.53 20.26 9.76 7.61 6.22 8.28 2.65 9 9.24 15.54 9.58 20.44 9.76 7.61 6.23 8.29 2.66 10 9.28 15.55 9.58 20.43 9.76 7.60 6.26 8.31 2.67 11 9.32 15.59 9.60 20.57 9.77 7.61 6.28 8.33 2.68 12 9.32 15.65 9.61 20.60 9.77 7.61 6.28 8.36 2.69 13 9.32 15.75 9.65 20.69 9.77 7.62 6.29 8.36 2.69 14 9.36 15.86 9.71 20.93 9.83 7.70 6.32 8.39 2.71 15 9.37 15.89 9.78 20.98 9.85 7.73 6.36 8.46 2.72 16 9.38 15.94 9.79 21.11 9.85 7.75 6.37 8.48 2.73 17 9.41 15.93 9.84 21.14 9.89 7.76 6.38 8.52 2.73 18 9.44 15.95 9.87 21.16 9.90 7.76 6.38 8.53 2.74 19 9.44 15.99 9.90 21.32 9.92 7.77 6.40 8.57 2.74 20 9.44 15.99 9.95 21.32 9.91 7.79 6.41 8.58 2.74 21 9.47 16.06 9.96 21.48 9.92 7.79 6.42 8.58 2.74 22 9.48 16.08 9.98 21.58 9.92 7.79 6.43 8.63 2.74 23 9.56 16.07 10.01 21.74 9.96 7.83 6.44 8.66 2.75 24 9.58 16.11 10.00 21.75 9.97 7.83 6.47 8.69 2.75 25 9.56 16.15 10.03 21.81 9.98 7.88 6.47 8.72 2.75 26 9.58 16.18 10.05 21.89 10.06 7.95 6.48 8.74 2.75 27 9.70 16.30 10.06 22.21 10.07 8.01 6.51 8.80 2.77 28 9.74 16.42 10.09 22.37 10.12 8.05 6.54 8.86 2.78 29 9.76 16.49 10.24 22.47 10.10 8.10 6.56 8.91 2.79 30 9.78 16.50 10.23 22.51 10.10 8.10 6.57 8.94 2.80 31 9.84 16.58 10.27 22.55 10.10 8.16 6.60 8.97 2.82 32 9.88 16.64 10.28 22.61 10.19 8.18 6.62 8.99 2.83 33 9.96 16.66 10.29 22.58 10.21 8.20 6.65 8.99 2.84 34 9.97 16.81 10.44 22.85 10.20 7.99 6.71 9.06 2.87 35 9.96 16.91 10.51 22.93 10.39 8.01 6.76 9.12 2.89 36 9.96 16.92 10.52 22.98 10.39 8.02 6.78 9.14 2.90 37 9.96 16.95 10.57 23.01 10.39 8.03 6.80 9.15 2.90 38 10.02 17.11 10.62 23.11 10.45 8.04 6.83 9.19 2.91 39 10.08 17.16 10.71 23.18 10.49 8.07 6.86 9.21 2.92 40 10.09 17.16 10.73 23.18 10.48 8.08 6.86 9.22 2.92 41 10.12 17.27 10.74 23.21 10.49 8.08 6.87 9.23 2.92 42 10.14 17.34 10.75 23.22 10.49 8.10 6.88 9.24 2.92 43 10.17 17.39 10.79 23.12 10.50 8.11 6.90 9.27 2.94 44 10.22 17.43 10.81 23.15 10.51 8.15 6.92 9.29 2.95 45 10.25 17.45 10.87 23.16 10.51 8.16 6.93 9.31 2.95 46 10.25 17.50 10.92 23.21 10.53 8.17 6.94 9.34 2.97 47 10.26 17.56 10.95 23.21 10.54 8.18 6.96 9.35 2.99 48 10.34 17.65 10.94 23.22 10.54 8.15 6.98 9.38 3.00 49 10.33 17.62 10.97 23.25 10.55 8.15 6.99 9.40 3.00 50 10.30 17.70 10.99 23.39 10.58 8.17 7.01 9.44 3.01 51 10.33 17.72 11.04 23.41 10.59 8.16 7.06 9.47 3.03 52 10.33 17.71 11.09 23.45 10.56 8.15 7.07 9.48 3.03 53 10.37 17.74 11.12 23.46 10.57 8.16 7.08 9.50 3.04 54 10.44 17.75 11.11 23.44 10.59 8.15 7.08 9.52 3.04 55 10.45 17.78 11.14 23.54 10.63 8.18 7.10 9.54 3.05 56 10.45 17.80 11.20 23.62 10.63 8.19 7.11 9.53 3.05 57 10.44 17.86 11.25 23.86 10.66 8.18 7.22 9.74 3.09 58 10.43 17.88 11.30 24.07 10.69 8.20 7.24 9.75 3.09 59 10.40 17.89 11.31 24.13 10.72 8.21 7.25 9.75 3.09 60 10.43 17.94 11.31 24.12 10.72 8.22 7.26 9.78 3.10 61 10.47 17.98 11.33 24.17 10.73 8.23 7.27 9.80 3.10 62 10.52 18.10 11.41 24.23 10.75 8.25 7.30 9.84 3.11 63 10.55 18.14 11.46 24.28 10.78 8.28 7.32 9.88 3.12 64 10.50 18.19 11.48 24.12 10.79 8.28 7.34 9.91 3.12 65 10.44 18.23 11.58 24.14 10.83 8.29 7.35 9.92 3.12 66 10.47 18.24 11.63 24.17 10.83 8.30 7.36 9.92 3.13 67 10.50 18.27 11.69 24.20 10.85 8.34 7.39 9.97 3.15 68 10.54 18.30 11.74 24.36 10.88 8.38 7.41 9.99 3.16 69 10.55 18.34 11.68 24.34 10.97 8.39 7.43 10.02 3.16 70 10.53 18.36 11.69 24.38 10.98 8.44 7.46 10.05 3.18 71 10.54 18.36 11.71 24.46 11.00 8.46 7.47 10.07 3.19 72 10.54 18.40 11.75 24.60 11.04 8.46 7.50 10.11 3.19 73 10.54 18.43 11.76 24.63 11.08 8.49 7.51 10.11 3.20 74 10.59 18.47 11.79 24.75 11.16 8.50 7.52 10.13 3.21 75 10.72 18.56 11.89 24.64 11.19 8.51 7.58 10.23 3.26 76 10.76 18.58 11.94 24.69 11.20 8.51 7.59 10.24 3.27 77 10.78 18.61 11.97 24.70 11.22 8.52 7.63 10.32 3.28 78 10.78 18.61 11.99 24.74 11.26 8.53 7.64 10.33 3.29 79 10.78 18.69 12.02 24.87 11.29 8.53 7.64 10.34 3.29 Water Limonade Expresso Frieten Broodje vleessnack Hamburger Frisdrank 1 1.55 1.55 1.64 2.07 2.39 1.32 3.16 0.89 2 1.56 1.56 1.65 2.08 2.40 1.33 3.20 0.89 3 1.56 1.56 1.65 2.08 2.42 1.33 3.20 0.89 4 1.57 1.56 1.65 2.08 2.42 1.33 3.21 0.89 5 1.57 1.57 1.66 2.09 2.44 1.33 3.22 0.89 6 1.58 1.57 1.66 2.09 2.44 1.33 3.22 0.89 7 1.58 1.57 1.67 2.09 2.44 1.34 3.23 0.89 8 1.58 1.57 1.67 2.10 2.45 1.34 3.24 0.90 9 1.58 1.58 1.68 2.10 2.46 1.34 3.25 0.90 10 1.59 1.59 1.68 2.10 2.47 1.34 3.25 0.90 11 1.59 1.59 1.68 2.11 2.48 1.35 3.26 0.90 12 1.60 1.59 1.68 2.11 2.48 1.35 3.26 0.90 13 1.60 1.60 1.69 2.11 2.49 1.34 3.29 0.90 14 1.61 1.60 1.69 2.13 2.50 1.35 3.31 0.91 15 1.62 1.61 1.70 2.18 2.51 1.35 3.33 0.91 16 1.62 1.62 1.70 2.20 2.52 1.36 3.33 0.91 17 1.63 1.62 1.71 2.21 2.52 1.36 3.33 0.91 18 1.63 1.62 1.71 2.21 2.52 1.37 3.33 0.91 19 1.63 1.62 1.71 2.22 2.54 1.37 3.33 0.91 20 1.63 1.63 1.71 2.22 2.54 1.37 3.33 0.91 21 1.63 1.63 1.72 2.23 2.54 1.38 3.35 0.91 22 1.63 1.63 1.72 2.23 2.56 1.38 3.37 0.91 23 1.64 1.63 1.72 2.23 2.57 1.38 3.40 0.91 24 1.64 1.64 1.73 2.23 2.58 1.38 3.42 0.91 25 1.64 1.64 1.73 2.24 2.58 1.39 3.46 0.91 26 1.65 1.64 1.73 2.25 2.58 1.39 3.46 0.91 27 1.65 1.65 1.74 2.26 2.58 1.40 3.47 0.92 28 1.66 1.66 1.75 2.27 2.59 1.40 3.48 0.92 29 1.67 1.67 1.75 2.28 2.60 1.41 3.49 0.92 30 1.67 1.67 1.76 2.29 2.61 1.42 3.49 0.92 31 1.68 1.68 1.76 2.30 2.61 1.43 3.50 0.93 32 1.68 1.68 1.77 2.30 2.62 1.44 3.50 0.93 33 1.69 1.69 1.77 2.30 2.63 1.44 3.50 0.94 34 1.70 1.70 1.78 2.32 2.65 1.45 3.51 0.95 35 1.71 1.71 1.79 2.32 2.67 1.46 3.48 0.95 36 1.72 1.71 1.80 2.32 2.68 1.46 3.48 0.95 37 1.72 1.72 1.80 2.33 2.67 1.46 3.48 0.95 38 1.73 1.72 1.81 2.34 2.68 1.46 3.49 0.96 39 1.73 1.73 1.81 2.34 2.68 1.46 3.51 0.96 40 1.73 1.73 1.81 2.34 2.68 1.46 3.51 0.96 41 1.73 1.73 1.81 2.35 2.68 1.46 3.52 0.97 42 1.74 1.74 1.82 2.35 2.69 1.47 3.52 0.97 43 1.75 1.75 1.82 2.36 2.69 1.47 3.54 0.97 44 1.75 1.75 1.82 2.37 2.69 1.47 3.55 0.97 45 1.75 1.75 1.83 2.37 2.70 1.48 3.55 0.98 46 1.76 1.76 1.83 2.37 2.71 1.48 3.55 0.98 47 1.76 1.76 1.83 2.38 2.72 1.48 3.55 0.98 48 1.76 1.77 1.84 2.38 2.71 1.48 3.55 0.99 49 1.77 1.77 1.84 2.38 2.72 1.48 3.56 0.99 50 1.78 1.78 1.85 2.39 2.73 1.49 3.56 0.99 51 1.78 1.79 1.85 2.40 2.74 1.50 3.57 1.00 52 1.79 1.79 1.86 2.41 2.74 1.50 3.57 1.01 53 1.79 1.79 1.86 2.42 2.75 1.50 3.57 1.02 54 1.79 1.79 1.86 2.43 2.75 1.50 3.57 1.02 55 1.79 1.79 1.86 2.43 2.76 1.50 3.57 1.02 56 1.79 1.80 1.86 2.43 2.75 1.50 3.58 1.02 57 1.83 1.82 1.89 2.43 2.78 1.51 3.64 1.02 58 1.83 1.83 1.89 2.44 2.79 1.52 3.64 1.03 59 1.83 1.83 1.89 2.44 2.80 1.52 3.64 1.03 60 1.83 1.83 1.89 2.45 2.81 1.53 3.64 1.03 61 1.84 1.83 1.90 2.45 2.81 1.53 3.65 1.03 62 1.84 1.84 1.91 2.48 2.82 1.54 3.67 1.03 63 1.84 1.84 1.91 2.49 2.82 1.55 3.68 1.03 64 1.85 1.85 1.92 2.49 2.83 1.55 3.68 1.03 65 1.85 1.85 1.92 2.50 2.83 1.55 3.68 1.03 66 1.85 1.85 1.92 2.51 2.84 1.55 3.68 1.03 67 1.86 1.86 1.93 2.52 2.84 1.56 3.68 1.03 68 1.86 1.86 1.93 2.53 2.84 1.56 3.69 1.03 69 1.86 1.86 1.94 2.54 2.86 1.56 3.69 1.03 70 1.87 1.87 1.94 2.54 2.87 1.57 3.71 1.03 71 1.87 1.87 1.94 2.56 2.88 1.58 3.71 1.04 72 1.88 1.88 1.95 2.56 2.88 1.58 3.71 1.04 73 1.88 1.88 1.95 2.56 2.89 1.58 3.71 1.04 74 1.88 1.88 1.95 2.57 2.89 1.58 3.72 1.04 75 1.89 1.90 1.97 2.58 2.90 1.58 3.73 1.05 76 1.89 1.90 1.98 2.58 2.90 1.59 3.74 1.05 77 1.90 1.91 1.99 2.59 2.90 1.60 3.74 1.05 78 1.91 1.91 1.99 2.59 2.92 1.60 3.75 1.05 79 1.91 1.91 1.99 2.60 2.93 1.62 3.76 1.05 Candybar 1 0.66 2 0.67 3 0.67 4 0.67 5 0.67 6 0.67 7 0.67 8 0.67 9 0.67 10 0.67 11 0.67 12 0.67 13 0.67 14 0.69 15 0.70 16 0.70 17 0.70 18 0.70 19 0.70 20 0.70 21 0.71 22 0.71 23 0.71 24 0.71 25 0.71 26 0.71 27 0.71 28 0.71 29 0.72 30 0.72 31 0.72 32 0.72 33 0.73 34 0.73 35 0.73 36 0.73 37 0.73 38 0.73 39 0.73 40 0.73 41 0.73 42 0.73 43 0.73 44 0.73 45 0.74 46 0.75 47 0.75 48 0.75 49 0.75 50 0.76 51 0.76 52 0.76 53 0.77 54 0.77 55 0.78 56 0.78 57 0.78 58 0.78 59 0.79 60 0.79 61 0.79 62 0.80 63 0.80 64 0.80 65 0.80 66 0.81 67 0.80 68 0.81 69 0.82 70 0.82 71 0.82 72 0.82 73 0.82 74 0.82 75 0.83 76 0.83 77 0.83 78 0.83 79 0.84 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Pepersteak Salade Tong Chinees Pizza 0.612279 0.348061 0.028637 0.064630 0.207910 0.061020 Bier SpecBier Aperitief Water Limonade Expresso -1.785940 0.647469 1.983065 -2.102036 0.034559 0.001853 Frieten Broodje vleessnack Hamburger Frisdrank Candybar -0.231369 -0.493662 0.074073 0.586575 4.565107 -2.210762 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.060241 -0.020247 -0.002122 0.017727 0.079936 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.612279 0.996757 0.614 0.541320 Pepersteak 0.348061 0.088766 3.921 0.000226 *** Salade 0.028637 0.133889 0.214 0.831351 Tong 0.064630 0.034669 1.864 0.067107 . Chinees 0.207910 0.084196 2.469 0.016351 * Pizza 0.061020 0.108240 0.564 0.574994 Bier -1.785940 0.410215 -4.354 5.20e-05 *** SpecBier 0.647469 0.291350 2.222 0.029981 * Aperitief 1.983065 0.384192 5.162 2.83e-06 *** Water -2.102036 1.040022 -2.021 0.047659 * Limonade 0.034559 1.293181 0.027 0.978767 Expresso 0.001853 1.255684 0.001 0.998827 Frieten -0.231369 0.406491 -0.569 0.571319 Broodje -0.493662 0.673275 -0.733 0.466229 vleessnack 0.074073 0.711228 0.104 0.917393 Hamburger 0.586575 0.333187 1.760 0.083336 . Frisdrank 4.565107 0.801880 5.693 3.81e-07 *** Candybar -2.210762 0.891291 -2.480 0.015898 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.03344 on 61 degrees of freedom Multiple R-squared: 0.9968, Adjusted R-squared: 0.9959 F-statistic: 1125 on 17 and 61 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.09932691 0.19865382 0.90067309 [2,] 0.08676025 0.17352051 0.91323975 [3,] 0.04358887 0.08717774 0.95641113 [4,] 0.02559489 0.05118978 0.97440511 [5,] 0.03253237 0.06506475 0.96746763 [6,] 0.03390023 0.06780046 0.96609977 [7,] 0.24996574 0.49993148 0.75003426 [8,] 0.23360421 0.46720842 0.76639579 [9,] 0.17394733 0.34789466 0.82605267 [10,] 0.11482640 0.22965280 0.88517360 [11,] 0.07836349 0.15672697 0.92163651 [12,] 0.08701732 0.17403465 0.91298268 [13,] 0.05639772 0.11279545 0.94360228 [14,] 0.04727229 0.09454457 0.95272771 [15,] 0.25188218 0.50376436 0.74811782 [16,] 0.35715392 0.71430783 0.64284608 [17,] 0.30004798 0.60009595 0.69995202 [18,] 0.38050643 0.76101287 0.61949357 [19,] 0.48410425 0.96820849 0.51589575 [20,] 0.44413614 0.88827228 0.55586386 [21,] 0.65714602 0.68570795 0.34285398 [22,] 0.60147069 0.79705861 0.39852931 [23,] 0.55344496 0.89311009 0.44655504 [24,] 0.55188822 0.89622356 0.44811178 [25,] 0.49945755 0.99891510 0.50054245 [26,] 0.44224514 0.88449028 0.55775486 [27,] 0.35993986 0.71987971 0.64006014 [28,] 0.33433590 0.66867180 0.66566410 [29,] 0.56688679 0.86622642 0.43311321 [30,] 0.68075971 0.63848057 0.31924029 [31,] 0.72746560 0.54506880 0.27253440 [32,] 0.72965752 0.54068495 0.27034248 [33,] 0.81901861 0.36196279 0.18098139 [34,] 0.77160631 0.45678738 0.22839369 [35,] 0.68317083 0.63365834 0.31682917 [36,] 0.96430408 0.07139183 0.03569592 [37,] 0.96187848 0.07624305 0.03812152 [38,] 0.91185377 0.17629246 0.08814623 > postscript(file="/var/wessaorg/rcomp/tmp/1lk9l1353075040.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/26d7w1353075040.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/3ca651353075040.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/4z1sw1353075040.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/58p6f1353075040.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 0.0556454108 -0.0174501663 -0.0135339212 -0.0012531572 -0.0469844024 6 7 8 9 10 0.0392491127 0.0075911053 -0.0182219250 -0.0553907218 0.0287947256 11 12 13 14 15 0.0461445820 0.0048012602 -0.0320018879 -0.0537051794 -0.0115503240 16 17 18 19 20 -0.0353050517 0.0011543904 -0.0070837195 -0.0149675627 -0.0045015755 21 22 23 24 25 0.0182177457 -0.0021515562 0.0463363357 0.0769699798 -0.0081335773 26 27 28 29 30 0.0030213274 -0.0206936545 -0.0295570519 -0.0166317652 -0.0173154982 31 32 33 34 35 -0.0273285430 -0.0251925701 0.0799356415 0.0161148643 -0.0184159893 36 37 38 39 40 0.0028525296 0.0147053278 -0.0173800505 0.0166895423 0.0211110183 41 42 43 44 45 -0.0292985343 0.0004209455 0.0035365563 0.0319692777 0.0375772647 46 47 48 49 50 0.0172354885 -0.0003634732 -0.0047060903 0.0158598986 -0.0198008627 51 52 53 54 55 -0.0160966469 -0.0207364380 -0.0265867532 0.0273279258 0.0393999616 56 57 58 59 60 0.0381260278 0.0280437326 -0.0216223813 -0.0212110395 -0.0234637408 61 62 63 64 65 0.0161663556 0.0418493962 0.0308922967 0.0130658568 -0.0602410677 66 67 68 69 70 -0.0103159461 -0.0193488601 0.0112528406 0.0415898757 0.0142589757 71 72 73 74 75 -0.0386112105 -0.0227081105 -0.0425568447 -0.0508097174 -0.0133475891 76 77 78 79 -0.0021222271 0.0232007568 0.0276981398 -0.0001090879 > postscript(file="/var/wessaorg/rcomp/tmp/6t4bv1353075040.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 0.0556454108 NA 1 -0.0174501663 0.0556454108 2 -0.0135339212 -0.0174501663 3 -0.0012531572 -0.0135339212 4 -0.0469844024 -0.0012531572 5 0.0392491127 -0.0469844024 6 0.0075911053 0.0392491127 7 -0.0182219250 0.0075911053 8 -0.0553907218 -0.0182219250 9 0.0287947256 -0.0553907218 10 0.0461445820 0.0287947256 11 0.0048012602 0.0461445820 12 -0.0320018879 0.0048012602 13 -0.0537051794 -0.0320018879 14 -0.0115503240 -0.0537051794 15 -0.0353050517 -0.0115503240 16 0.0011543904 -0.0353050517 17 -0.0070837195 0.0011543904 18 -0.0149675627 -0.0070837195 19 -0.0045015755 -0.0149675627 20 0.0182177457 -0.0045015755 21 -0.0021515562 0.0182177457 22 0.0463363357 -0.0021515562 23 0.0769699798 0.0463363357 24 -0.0081335773 0.0769699798 25 0.0030213274 -0.0081335773 26 -0.0206936545 0.0030213274 27 -0.0295570519 -0.0206936545 28 -0.0166317652 -0.0295570519 29 -0.0173154982 -0.0166317652 30 -0.0273285430 -0.0173154982 31 -0.0251925701 -0.0273285430 32 0.0799356415 -0.0251925701 33 0.0161148643 0.0799356415 34 -0.0184159893 0.0161148643 35 0.0028525296 -0.0184159893 36 0.0147053278 0.0028525296 37 -0.0173800505 0.0147053278 38 0.0166895423 -0.0173800505 39 0.0211110183 0.0166895423 40 -0.0292985343 0.0211110183 41 0.0004209455 -0.0292985343 42 0.0035365563 0.0004209455 43 0.0319692777 0.0035365563 44 0.0375772647 0.0319692777 45 0.0172354885 0.0375772647 46 -0.0003634732 0.0172354885 47 -0.0047060903 -0.0003634732 48 0.0158598986 -0.0047060903 49 -0.0198008627 0.0158598986 50 -0.0160966469 -0.0198008627 51 -0.0207364380 -0.0160966469 52 -0.0265867532 -0.0207364380 53 0.0273279258 -0.0265867532 54 0.0393999616 0.0273279258 55 0.0381260278 0.0393999616 56 0.0280437326 0.0381260278 57 -0.0216223813 0.0280437326 58 -0.0212110395 -0.0216223813 59 -0.0234637408 -0.0212110395 60 0.0161663556 -0.0234637408 61 0.0418493962 0.0161663556 62 0.0308922967 0.0418493962 63 0.0130658568 0.0308922967 64 -0.0602410677 0.0130658568 65 -0.0103159461 -0.0602410677 66 -0.0193488601 -0.0103159461 67 0.0112528406 -0.0193488601 68 0.0415898757 0.0112528406 69 0.0142589757 0.0415898757 70 -0.0386112105 0.0142589757 71 -0.0227081105 -0.0386112105 72 -0.0425568447 -0.0227081105 73 -0.0508097174 -0.0425568447 74 -0.0133475891 -0.0508097174 75 -0.0021222271 -0.0133475891 76 0.0232007568 -0.0021222271 77 0.0276981398 0.0232007568 78 -0.0001090879 0.0276981398 79 NA -0.0001090879 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.0174501663 0.0556454108 [2,] -0.0135339212 -0.0174501663 [3,] -0.0012531572 -0.0135339212 [4,] -0.0469844024 -0.0012531572 [5,] 0.0392491127 -0.0469844024 [6,] 0.0075911053 0.0392491127 [7,] -0.0182219250 0.0075911053 [8,] -0.0553907218 -0.0182219250 [9,] 0.0287947256 -0.0553907218 [10,] 0.0461445820 0.0287947256 [11,] 0.0048012602 0.0461445820 [12,] -0.0320018879 0.0048012602 [13,] -0.0537051794 -0.0320018879 [14,] -0.0115503240 -0.0537051794 [15,] -0.0353050517 -0.0115503240 [16,] 0.0011543904 -0.0353050517 [17,] -0.0070837195 0.0011543904 [18,] -0.0149675627 -0.0070837195 [19,] -0.0045015755 -0.0149675627 [20,] 0.0182177457 -0.0045015755 [21,] -0.0021515562 0.0182177457 [22,] 0.0463363357 -0.0021515562 [23,] 0.0769699798 0.0463363357 [24,] -0.0081335773 0.0769699798 [25,] 0.0030213274 -0.0081335773 [26,] -0.0206936545 0.0030213274 [27,] -0.0295570519 -0.0206936545 [28,] -0.0166317652 -0.0295570519 [29,] -0.0173154982 -0.0166317652 [30,] -0.0273285430 -0.0173154982 [31,] -0.0251925701 -0.0273285430 [32,] 0.0799356415 -0.0251925701 [33,] 0.0161148643 0.0799356415 [34,] -0.0184159893 0.0161148643 [35,] 0.0028525296 -0.0184159893 [36,] 0.0147053278 0.0028525296 [37,] -0.0173800505 0.0147053278 [38,] 0.0166895423 -0.0173800505 [39,] 0.0211110183 0.0166895423 [40,] -0.0292985343 0.0211110183 [41,] 0.0004209455 -0.0292985343 [42,] 0.0035365563 0.0004209455 [43,] 0.0319692777 0.0035365563 [44,] 0.0375772647 0.0319692777 [45,] 0.0172354885 0.0375772647 [46,] -0.0003634732 0.0172354885 [47,] -0.0047060903 -0.0003634732 [48,] 0.0158598986 -0.0047060903 [49,] -0.0198008627 0.0158598986 [50,] -0.0160966469 -0.0198008627 [51,] -0.0207364380 -0.0160966469 [52,] -0.0265867532 -0.0207364380 [53,] 0.0273279258 -0.0265867532 [54,] 0.0393999616 0.0273279258 [55,] 0.0381260278 0.0393999616 [56,] 0.0280437326 0.0381260278 [57,] -0.0216223813 0.0280437326 [58,] -0.0212110395 -0.0216223813 [59,] -0.0234637408 -0.0212110395 [60,] 0.0161663556 -0.0234637408 [61,] 0.0418493962 0.0161663556 [62,] 0.0308922967 0.0418493962 [63,] 0.0130658568 0.0308922967 [64,] -0.0602410677 0.0130658568 [65,] -0.0103159461 -0.0602410677 [66,] -0.0193488601 -0.0103159461 [67,] 0.0112528406 -0.0193488601 [68,] 0.0415898757 0.0112528406 [69,] 0.0142589757 0.0415898757 [70,] -0.0386112105 0.0142589757 [71,] -0.0227081105 -0.0386112105 [72,] -0.0425568447 -0.0227081105 [73,] -0.0508097174 -0.0425568447 [74,] -0.0133475891 -0.0508097174 [75,] -0.0021222271 -0.0133475891 [76,] 0.0232007568 -0.0021222271 [77,] 0.0276981398 0.0232007568 [78,] -0.0001090879 0.0276981398 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.0174501663 0.0556454108 2 -0.0135339212 -0.0174501663 3 -0.0012531572 -0.0135339212 4 -0.0469844024 -0.0012531572 5 0.0392491127 -0.0469844024 6 0.0075911053 0.0392491127 7 -0.0182219250 0.0075911053 8 -0.0553907218 -0.0182219250 9 0.0287947256 -0.0553907218 10 0.0461445820 0.0287947256 11 0.0048012602 0.0461445820 12 -0.0320018879 0.0048012602 13 -0.0537051794 -0.0320018879 14 -0.0115503240 -0.0537051794 15 -0.0353050517 -0.0115503240 16 0.0011543904 -0.0353050517 17 -0.0070837195 0.0011543904 18 -0.0149675627 -0.0070837195 19 -0.0045015755 -0.0149675627 20 0.0182177457 -0.0045015755 21 -0.0021515562 0.0182177457 22 0.0463363357 -0.0021515562 23 0.0769699798 0.0463363357 24 -0.0081335773 0.0769699798 25 0.0030213274 -0.0081335773 26 -0.0206936545 0.0030213274 27 -0.0295570519 -0.0206936545 28 -0.0166317652 -0.0295570519 29 -0.0173154982 -0.0166317652 30 -0.0273285430 -0.0173154982 31 -0.0251925701 -0.0273285430 32 0.0799356415 -0.0251925701 33 0.0161148643 0.0799356415 34 -0.0184159893 0.0161148643 35 0.0028525296 -0.0184159893 36 0.0147053278 0.0028525296 37 -0.0173800505 0.0147053278 38 0.0166895423 -0.0173800505 39 0.0211110183 0.0166895423 40 -0.0292985343 0.0211110183 41 0.0004209455 -0.0292985343 42 0.0035365563 0.0004209455 43 0.0319692777 0.0035365563 44 0.0375772647 0.0319692777 45 0.0172354885 0.0375772647 46 -0.0003634732 0.0172354885 47 -0.0047060903 -0.0003634732 48 0.0158598986 -0.0047060903 49 -0.0198008627 0.0158598986 50 -0.0160966469 -0.0198008627 51 -0.0207364380 -0.0160966469 52 -0.0265867532 -0.0207364380 53 0.0273279258 -0.0265867532 54 0.0393999616 0.0273279258 55 0.0381260278 0.0393999616 56 0.0280437326 0.0381260278 57 -0.0216223813 0.0280437326 58 -0.0212110395 -0.0216223813 59 -0.0234637408 -0.0212110395 60 0.0161663556 -0.0234637408 61 0.0418493962 0.0161663556 62 0.0308922967 0.0418493962 63 0.0130658568 0.0308922967 64 -0.0602410677 0.0130658568 65 -0.0103159461 -0.0602410677 66 -0.0193488601 -0.0103159461 67 0.0112528406 -0.0193488601 68 0.0415898757 0.0112528406 69 0.0142589757 0.0415898757 70 -0.0386112105 0.0142589757 71 -0.0227081105 -0.0386112105 72 -0.0425568447 -0.0227081105 73 -0.0508097174 -0.0425568447 74 -0.0133475891 -0.0508097174 75 -0.0021222271 -0.0133475891 76 0.0232007568 -0.0021222271 77 0.0276981398 0.0232007568 78 -0.0001090879 0.0276981398 > 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/79e101353075040.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/8xerq1353075040.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/9td5k1353075040.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/10b2ga1353075040.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/117h651353075040.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/12dnxp1353075040.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/13zenq1353075041.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/14y8i01353075041.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/15atb31353075041.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/16s8z61353075041.tab") + } > > try(system("convert tmp/1lk9l1353075040.ps tmp/1lk9l1353075040.png",intern=TRUE)) character(0) > try(system("convert tmp/26d7w1353075040.ps tmp/26d7w1353075040.png",intern=TRUE)) character(0) > try(system("convert tmp/3ca651353075040.ps tmp/3ca651353075040.png",intern=TRUE)) character(0) > try(system("convert tmp/4z1sw1353075040.ps tmp/4z1sw1353075040.png",intern=TRUE)) character(0) > try(system("convert tmp/58p6f1353075040.ps tmp/58p6f1353075040.png",intern=TRUE)) character(0) > try(system("convert tmp/6t4bv1353075040.ps tmp/6t4bv1353075040.png",intern=TRUE)) character(0) > try(system("convert tmp/79e101353075040.ps tmp/79e101353075040.png",intern=TRUE)) character(0) > try(system("convert tmp/8xerq1353075040.ps tmp/8xerq1353075040.png",intern=TRUE)) character(0) > try(system("convert tmp/9td5k1353075040.ps tmp/9td5k1353075040.png",intern=TRUE)) character(0) > try(system("convert tmp/10b2ga1353075040.ps tmp/10b2ga1353075040.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 10.132 1.519 11.693