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(27.72 + ,91.51 + ,2747.48 + ,0.016 + ,62.7 + ,0.16 + ,26.90 + ,91.09 + ,2760.01 + ,0.016 + ,62.7 + ,0.17 + ,25.86 + ,93.00 + ,2778.11 + ,0.016 + ,62.7 + ,0.17 + ,26.81 + ,93.08 + ,2844.72 + ,0.016 + ,62.7 + ,0.16 + ,26.31 + ,94.13 + ,2831.02 + ,0.016 + ,62.7 + ,0.16 + ,27.10 + ,96.26 + ,2858.42 + ,0.016 + ,62.7 + ,0.17 + ,27.00 + ,94.29 + ,2809.73 + ,0.016 + ,62.7 + ,0.17 + ,27.40 + ,94.46 + ,2843.07 + ,0.016 + ,62.7 + ,0.16 + ,27.27 + ,95.53 + ,2818.61 + ,0.016 + ,62.7 + ,0.17 + ,28.29 + ,98.29 + ,2836.33 + ,0.016 + ,62.7 + ,0.17 + ,30.01 + ,102.01 + ,2872.80 + ,0.016 + ,62.7 + ,0.18 + ,31.41 + ,105.16 + ,2895.33 + ,0.016 + ,62.7 + ,0.17 + ,31.91 + ,105.34 + ,2929.76 + ,0.016 + ,62.7 + ,0.17 + ,31.60 + ,105.27 + ,2930.45 + ,0.016 + ,62.7 + ,0.16 + ,31.84 + ,102.19 + ,2859.09 + ,0.016 + ,62.7 + ,0.17 + ,33.05 + ,106.85 + ,2892.42 + ,0.016 + ,62.7 + ,0.17 + ,32.06 + ,103.05 + ,2836.16 + ,0.016 + ,62.7 + ,0.17 + ,33.10 + ,106.42 + ,2854.06 + ,0.016 + ,62.7 + ,0.16 + ,32.23 + ,105.17 + ,2875.32 + ,0.016 + ,62.7 + ,0.15 + ,31.36 + ,102.74 + ,2849.49 + ,0.016 + ,62.7 + ,0.15 + ,31.09 + ,106.27 + ,2935.05 + ,0.016 + ,62.7 + ,0.09 + ,30.77 + ,107.63 + ,2951.23 + ,0.0141 + ,65.4 + ,0.18 + ,31.20 + ,108.54 + ,2976.08 + ,0.0141 + ,65.4 + ,0.17 + ,31.47 + ,108.24 + ,2976.12 + ,0.0141 + ,65.4 + ,0.17 + ,31.73 + ,108.86 + ,2937.33 + ,0.0141 + ,65.4 + ,0.17 + ,32.17 + ,102.98 + ,2931.77 + ,0.0141 + ,65.4 + ,0.17 + ,31.47 + ,99.53 + ,2902.33 + ,0.0141 + ,65.4 + ,0.17 + ,30.97 + ,101.08 + ,2887.98 + ,0.0141 + ,65.4 + ,0.17 + ,30.81 + ,104.64 + ,2866.19 + ,0.0141 + ,65.4 + ,0.18 + ,30.72 + ,105.59 + ,2908.47 + ,0.0141 + ,65.4 + ,0.19 + ,28.24 + ,103.21 + ,2896.94 + ,0.0141 + ,65.4 + ,0.18 + ,28.09 + ,103.84 + ,2910.04 + ,0.0141 + ,65.4 + ,0.17 + ,29.11 + ,104.61 + ,2942.60 + ,0.0141 + ,65.4 + ,0.16 + ,29.00 + ,108.65 + ,2965.90 + ,0.0141 + ,65.4 + ,0.13 + ,28.76 + ,106.26 + ,2925.30 + ,0.0141 + ,65.4 + ,0.13 + ,28.75 + ,104.20 + ,2890.15 + ,0.0141 + ,65.4 + ,0.14 + ,28.45 + ,102.99 + ,2862.99 + ,0.0141 + ,65.4 + ,0.15 + ,29.34 + ,102.19 + ,2854.24 + ,0.0141 + ,65.4 + ,0.15 + ,26.84 + ,100.82 + ,2893.25 + ,0.0141 + ,65.4 + ,0.14 + ,23.70 + ,103.42 + ,2958.09 + ,0.0141 + ,65.4 + ,0.14 + ,23.15 + ,104.18 + ,2945.84 + ,0.0141 + ,65.4 + ,0.14 + ,21.71 + ,102.65 + ,2939.52 + ,0.0141 + ,65.4 + ,0.13 + ,20.88 + ,95.64 + ,2920.21 + ,0.0169 + ,61.3 + ,0.14 + ,20.04 + ,93.51 + ,2909.77 + ,0.0169 + ,61.3 + ,0.14 + ,21.09 + ,108.51 + ,2967.90 + ,0.0169 + ,61.3 + ,0.14 + ,21.92 + ,111.55 + ,2989.91 + ,0.0169 + ,61.3 + ,0.14 + ,20.72 + ,106.70 + ,3015.86 + ,0.0169 + ,61.3 + ,0.13 + ,20.72 + ,104.93 + ,3011.25 + ,0.0169 + ,61.3 + ,0.13 + ,21.01 + ,105.23 + ,3018.64 + ,0.0169 + ,61.3 + ,0.13 + ,21.80 + ,104.92 + ,3020.86 + ,0.0169 + ,61.3 + ,0.13 + ,21.60 + ,104.60 + ,3022.52 + ,0.0169 + ,61.3 + ,0.13 + ,20.38 + ,101.76 + ,3016.98 + ,0.0169 + ,61.3 + ,0.13 + ,21.20 + ,102.23 + ,3030.93 + ,0.0169 + ,61.3 + ,0.13 + ,19.87 + ,103.99 + ,3062.39 + ,0.0169 + ,61.3 + ,0.13 + ,19.05 + ,101.36 + ,3076.59 + ,0.0169 + ,61.3 + ,0.13 + ,20.01 + ,102.92 + ,3076.21 + ,0.0169 + ,61.3 + ,0.13 + ,19.15 + ,105.25 + ,3067.26 + ,0.0169 + ,61.3 + ,0.13 + ,19.43 + ,105.71 + ,3073.67 + ,0.0169 + ,61.3 + ,0.13 + ,19.44 + ,105.42 + ,3053.40 + ,0.0169 + ,61.3 + ,0.13 + ,19.40 + ,105.11 + ,3069.79 + ,0.0169 + ,61.3 + ,0.13 + ,19.15 + ,104.67 + ,3073.19 + ,0.0169 + ,61.3 + ,0.13 + ,19.34 + ,107.51 + ,3077.14 + ,0.0169 + ,61.3 + ,0.13 + ,19.10 + ,109.00 + ,3081.19 + ,0.0169 + ,61.3 + ,0.13 + ,19.08 + ,107.37 + ,3048.71 + ,0.0169 + ,61.3 + ,0.14 + ,18.05 + ,107.30 + ,3066.96 + ,0.0169 + ,61.3 + ,0.13 + ,17.72 + ,107.37 + ,3075.06 + ,0.0199 + ,70.3 + ,0.14 + ,18.58 + ,113.28 + ,3069.27 + ,0.0199 + ,70.3 + ,0.16 + ,18.96 + ,119.10 + ,3135.81 + ,0.0199 + ,70.3 + ,0.16 + ,18.98 + ,119.04 + ,3136.42 + ,0.0199 + ,70.3 + ,0.15 + ,18.81 + ,117.80 + ,3104.02 + ,0.0199 + ,70.3 + ,0.15 + ,19.43 + ,117.90 + ,3104.53 + ,0.0199 + ,70.3 + ,0.15 + ,20.93 + ,119.55 + ,3114.31 + ,0.0199 + ,70.3 + ,0.15 + ,20.71 + ,119.47 + ,3155.83 + ,0.0199 + ,70.3 + ,0.15 + ,22.00 + ,123.23 + ,3183.95 + ,0.0199 + ,70.3 + ,0.16 + ,21.52 + ,121.40 + ,3178.67 + ,0.0199 + ,70.3 + ,0.16 + ,21.87 + ,121.43 + ,3177.80 + ,0.0199 + ,70.3 + ,0.16 + ,23.29 + ,122.51 + ,3182.62 + ,0.0199 + ,70.3 + ,0.15 + ,22.59 + ,122.78 + ,3175.96 + ,0.0199 + ,70.3 + ,0.16 + ,22.86 + ,122.84 + ,3179.96 + ,0.0199 + ,70.3 + ,0.15 + ,20.79 + ,122.70 + ,3160.78 + ,0.0199 + ,70.3 + ,0.16 + ,20.28 + ,119.89 + ,3117.73 + ,0.0199 + ,70.3 + ,0.15 + ,20.62 + ,118.00 + ,3093.70 + ,0.0199 + ,70.3 + ,0.16 + ,20.32 + ,119.61 + ,3136.60 + ,0.0199 + ,70.3 + ,0.14 + ,21.66 + ,120.40 + ,3116.23 + ,0.0199 + ,70.3 + ,0.09 + ,21.99 + ,117.94 + ,3113.53 + ,0.0216 + ,73.1 + ,0.15 + ,22.27 + ,118.77 + ,3120.04 + ,0.0216 + ,73.1 + ,0.16 + ,21.83 + ,121.68 + ,3135.23 + ,0.0216 + ,73.1 + ,0.16 + ,21.94 + ,121.98 + ,3149.46 + ,0.0216 + ,73.1 + ,0.15 + ,20.91 + ,118.83 + ,3136.19 + ,0.0216 + ,73.1 + ,0.15 + ,20.40 + ,117.97 + ,3112.35 + ,0.0216 + ,73.1 + ,0.15 + ,20.22 + ,113.07 + ,3065.02 + ,0.0216 + ,73.1 + ,0.16 + ,19.64 + ,111.98 + ,3051.78 + ,0.0216 + ,73.1 + ,0.16 + ,19.75 + ,113.77 + ,3049.41 + ,0.0216 + ,73.1 + ,0.16 + ,19.51 + ,110.41 + ,3044.11 + ,0.0216 + ,73.1 + ,0.16 + ,19.52 + ,110.85 + ,3064.18 + ,0.0216 + ,73.1 + ,0.16 + ,19.48 + ,111.18 + ,3101.17 + ,0.0216 + ,73.1 + ,0.16 + ,19.88 + ,109.42 + ,3104.12 + ,0.0216 + ,73.1 + ,0.15 + ,18.97 + ,108.87 + ,3072.87 + ,0.0216 + ,73.1 + ,0.15 + ,19.00 + ,106.72 + ,3005.62 + ,0.0216 + ,73.1 + ,0.16 + ,19.32 + ,107.28 + ,3016.96 + ,0.0216 + ,73.1 + ,0.15 + ,19.50 + ,104.13 + ,2990.46 + ,0.0216 + ,73.1 + ,0.15 + ,23.22 + ,107.55 + ,2981.70 + ,0.0216 + ,73.1 + ,0.17 + ,22.56 + ,105.72 + ,2986.12 + ,0.0216 + ,73.1 + ,0.16 + ,21.94 + ,104.55 + ,2987.95 + ,0.0216 + ,73.1 + ,0.16 + ,21.11 + ,106.93 + ,2977.23 + ,0.0216 + ,73.1 + ,0.18 + ,21.21 + ,106.85 + ,3020.06 + ,0.0176 + ,73.1 + ,0.17 + ,21.18 + ,106.78 + ,2982.13 + ,0.0176 + ,73.1 + ,0.16 + ,21.25 + ,107.29 + ,2999.66 + ,0.0176 + ,73.1 + ,0.17 + ,21.17 + ,104.14 + ,3011.93 + ,0.0176 + ,73.1 + ,0.16 + ,20.47 + ,101.21 + ,2937.29 + ,0.0176 + ,73.1 + ,0.16 + ,19.99 + ,96.35 + ,2895.58 + ,0.0176 + ,73.1 + ,0.16 + ,19.21 + ,95.62 + ,2904.87 + ,0.0176 + ,73.1 + ,0.16 + ,20.07 + ,99.00 + ,2904.26 + ,0.0176 + ,73.1 + ,0.16 + ,19.86 + ,99.26 + ,2883.89 + ,0.0176 + ,73.1 + ,0.16 + ,22.36 + ,98.77 + ,2846.81 + ,0.0176 + ,73.1 + ,0.16 + ,22.17 + ,100.65 + ,2836.94 + ,0.0176 + ,73.1 + ,0.16 + ,23.56 + ,103.13 + ,2853.13 + ,0.0176 + ,73.1 + ,0.16 + ,22.92 + ,105.53 + ,2916.07 + ,0.0176 + ,73.1 + ,0.16 + ,23.10 + ,106.76 + ,2916.68 + ,0.0176 + ,73.1 + ,0.16 + ,24.32 + ,107.59 + ,2926.55 + ,0.0176 + ,73.1 + ,0.16 + ,23.99 + ,107.62 + ,2966.85 + ,0.0176 + ,73.1 + ,0.16 + ,25.94 + ,108.82 + ,2976.78 + ,0.0176 + ,73.1 + ,0.16 + ,26.15 + ,107.59 + ,2967.79 + ,0.0176 + ,73.1 + ,0.16 + ,26.36 + ,107.85 + ,2991.78 + ,0.0176 + ,73.1 + ,0.16 + ,27.32 + ,107.11 + ,3012.03 + ,0.0176 + ,73.1 + ,0.16 + ,28.00 + ,108.14 + ,3010.24 + ,0.0176 + ,73.1 + ,0.16) + ,dim=c(6 + ,126) + ,dimnames=list(c('FACEBOOK' + ,'LINKEDIN' + ,'NASDAQ' + ,'INFLATION' + ,'CONS.CONF' + ,'FED.FUNDS.RATE') + ,1:126)) > y <- array(NA,dim=c(6,126),dimnames=list(c('FACEBOOK','LINKEDIN','NASDAQ','INFLATION','CONS.CONF','FED.FUNDS.RATE'),1:126)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Include Monthly 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 FACEBOOK LINKEDIN NASDAQ INFLATION CONS.CONF FED.FUNDS.RATE M1 M2 M3 M4 M5 1 27.72 91.51 2747.48 0.0160 62.7 0.16 1 0 0 0 0 2 26.90 91.09 2760.01 0.0160 62.7 0.17 0 1 0 0 0 3 25.86 93.00 2778.11 0.0160 62.7 0.17 0 0 1 0 0 4 26.81 93.08 2844.72 0.0160 62.7 0.16 0 0 0 1 0 5 26.31 94.13 2831.02 0.0160 62.7 0.16 0 0 0 0 1 6 27.10 96.26 2858.42 0.0160 62.7 0.17 0 0 0 0 0 7 27.00 94.29 2809.73 0.0160 62.7 0.17 0 0 0 0 0 8 27.40 94.46 2843.07 0.0160 62.7 0.16 0 0 0 0 0 9 27.27 95.53 2818.61 0.0160 62.7 0.17 0 0 0 0 0 10 28.29 98.29 2836.33 0.0160 62.7 0.17 0 0 0 0 0 11 30.01 102.01 2872.80 0.0160 62.7 0.18 0 0 0 0 0 12 31.41 105.16 2895.33 0.0160 62.7 0.17 0 0 0 0 0 13 31.91 105.34 2929.76 0.0160 62.7 0.17 1 0 0 0 0 14 31.60 105.27 2930.45 0.0160 62.7 0.16 0 1 0 0 0 15 31.84 102.19 2859.09 0.0160 62.7 0.17 0 0 1 0 0 16 33.05 106.85 2892.42 0.0160 62.7 0.17 0 0 0 1 0 17 32.06 103.05 2836.16 0.0160 62.7 0.17 0 0 0 0 1 18 33.10 106.42 2854.06 0.0160 62.7 0.16 0 0 0 0 0 19 32.23 105.17 2875.32 0.0160 62.7 0.15 0 0 0 0 0 20 31.36 102.74 2849.49 0.0160 62.7 0.15 0 0 0 0 0 21 31.09 106.27 2935.05 0.0160 62.7 0.09 0 0 0 0 0 22 30.77 107.63 2951.23 0.0141 65.4 0.18 0 0 0 0 0 23 31.20 108.54 2976.08 0.0141 65.4 0.17 0 0 0 0 0 24 31.47 108.24 2976.12 0.0141 65.4 0.17 0 0 0 0 0 25 31.73 108.86 2937.33 0.0141 65.4 0.17 1 0 0 0 0 26 32.17 102.98 2931.77 0.0141 65.4 0.17 0 1 0 0 0 27 31.47 99.53 2902.33 0.0141 65.4 0.17 0 0 1 0 0 28 30.97 101.08 2887.98 0.0141 65.4 0.17 0 0 0 1 0 29 30.81 104.64 2866.19 0.0141 65.4 0.18 0 0 0 0 1 30 30.72 105.59 2908.47 0.0141 65.4 0.19 0 0 0 0 0 31 28.24 103.21 2896.94 0.0141 65.4 0.18 0 0 0 0 0 32 28.09 103.84 2910.04 0.0141 65.4 0.17 0 0 0 0 0 33 29.11 104.61 2942.60 0.0141 65.4 0.16 0 0 0 0 0 34 29.00 108.65 2965.90 0.0141 65.4 0.13 0 0 0 0 0 35 28.76 106.26 2925.30 0.0141 65.4 0.13 0 0 0 0 0 36 28.75 104.20 2890.15 0.0141 65.4 0.14 0 0 0 0 0 37 28.45 102.99 2862.99 0.0141 65.4 0.15 1 0 0 0 0 38 29.34 102.19 2854.24 0.0141 65.4 0.15 0 1 0 0 0 39 26.84 100.82 2893.25 0.0141 65.4 0.14 0 0 1 0 0 40 23.70 103.42 2958.09 0.0141 65.4 0.14 0 0 0 1 0 41 23.15 104.18 2945.84 0.0141 65.4 0.14 0 0 0 0 1 42 21.71 102.65 2939.52 0.0141 65.4 0.13 0 0 0 0 0 43 20.88 95.64 2920.21 0.0169 61.3 0.14 0 0 0 0 0 44 20.04 93.51 2909.77 0.0169 61.3 0.14 0 0 0 0 0 45 21.09 108.51 2967.90 0.0169 61.3 0.14 0 0 0 0 0 46 21.92 111.55 2989.91 0.0169 61.3 0.14 0 0 0 0 0 47 20.72 106.70 3015.86 0.0169 61.3 0.13 0 0 0 0 0 48 20.72 104.93 3011.25 0.0169 61.3 0.13 0 0 0 0 0 49 21.01 105.23 3018.64 0.0169 61.3 0.13 1 0 0 0 0 50 21.80 104.92 3020.86 0.0169 61.3 0.13 0 1 0 0 0 51 21.60 104.60 3022.52 0.0169 61.3 0.13 0 0 1 0 0 52 20.38 101.76 3016.98 0.0169 61.3 0.13 0 0 0 1 0 53 21.20 102.23 3030.93 0.0169 61.3 0.13 0 0 0 0 1 54 19.87 103.99 3062.39 0.0169 61.3 0.13 0 0 0 0 0 55 19.05 101.36 3076.59 0.0169 61.3 0.13 0 0 0 0 0 56 20.01 102.92 3076.21 0.0169 61.3 0.13 0 0 0 0 0 57 19.15 105.25 3067.26 0.0169 61.3 0.13 0 0 0 0 0 58 19.43 105.71 3073.67 0.0169 61.3 0.13 0 0 0 0 0 59 19.44 105.42 3053.40 0.0169 61.3 0.13 0 0 0 0 0 60 19.40 105.11 3069.79 0.0169 61.3 0.13 0 0 0 0 0 61 19.15 104.67 3073.19 0.0169 61.3 0.13 1 0 0 0 0 62 19.34 107.51 3077.14 0.0169 61.3 0.13 0 1 0 0 0 63 19.10 109.00 3081.19 0.0169 61.3 0.13 0 0 1 0 0 64 19.08 107.37 3048.71 0.0169 61.3 0.14 0 0 0 1 0 65 18.05 107.30 3066.96 0.0169 61.3 0.13 0 0 0 0 1 66 17.72 107.37 3075.06 0.0199 70.3 0.14 0 0 0 0 0 67 18.58 113.28 3069.27 0.0199 70.3 0.16 0 0 0 0 0 68 18.96 119.10 3135.81 0.0199 70.3 0.16 0 0 0 0 0 69 18.98 119.04 3136.42 0.0199 70.3 0.15 0 0 0 0 0 70 18.81 117.80 3104.02 0.0199 70.3 0.15 0 0 0 0 0 71 19.43 117.90 3104.53 0.0199 70.3 0.15 0 0 0 0 0 72 20.93 119.55 3114.31 0.0199 70.3 0.15 0 0 0 0 0 73 20.71 119.47 3155.83 0.0199 70.3 0.15 1 0 0 0 0 74 22.00 123.23 3183.95 0.0199 70.3 0.16 0 1 0 0 0 75 21.52 121.40 3178.67 0.0199 70.3 0.16 0 0 1 0 0 76 21.87 121.43 3177.80 0.0199 70.3 0.16 0 0 0 1 0 77 23.29 122.51 3182.62 0.0199 70.3 0.15 0 0 0 0 1 78 22.59 122.78 3175.96 0.0199 70.3 0.16 0 0 0 0 0 79 22.86 122.84 3179.96 0.0199 70.3 0.15 0 0 0 0 0 80 20.79 122.70 3160.78 0.0199 70.3 0.16 0 0 0 0 0 81 20.28 119.89 3117.73 0.0199 70.3 0.15 0 0 0 0 0 82 20.62 118.00 3093.70 0.0199 70.3 0.16 0 0 0 0 0 83 20.32 119.61 3136.60 0.0199 70.3 0.14 0 0 0 0 0 84 21.66 120.40 3116.23 0.0199 70.3 0.09 0 0 0 0 0 85 21.99 117.94 3113.53 0.0216 73.1 0.15 1 0 0 0 0 86 22.27 118.77 3120.04 0.0216 73.1 0.16 0 1 0 0 0 87 21.83 121.68 3135.23 0.0216 73.1 0.16 0 0 1 0 0 88 21.94 121.98 3149.46 0.0216 73.1 0.15 0 0 0 1 0 89 20.91 118.83 3136.19 0.0216 73.1 0.15 0 0 0 0 1 90 20.40 117.97 3112.35 0.0216 73.1 0.15 0 0 0 0 0 91 20.22 113.07 3065.02 0.0216 73.1 0.16 0 0 0 0 0 92 19.64 111.98 3051.78 0.0216 73.1 0.16 0 0 0 0 0 93 19.75 113.77 3049.41 0.0216 73.1 0.16 0 0 0 0 0 94 19.51 110.41 3044.11 0.0216 73.1 0.16 0 0 0 0 0 95 19.52 110.85 3064.18 0.0216 73.1 0.16 0 0 0 0 0 96 19.48 111.18 3101.17 0.0216 73.1 0.16 0 0 0 0 0 97 19.88 109.42 3104.12 0.0216 73.1 0.15 1 0 0 0 0 98 18.97 108.87 3072.87 0.0216 73.1 0.15 0 1 0 0 0 99 19.00 106.72 3005.62 0.0216 73.1 0.16 0 0 1 0 0 100 19.32 107.28 3016.96 0.0216 73.1 0.15 0 0 0 1 0 101 19.50 104.13 2990.46 0.0216 73.1 0.15 0 0 0 0 1 102 23.22 107.55 2981.70 0.0216 73.1 0.17 0 0 0 0 0 103 22.56 105.72 2986.12 0.0216 73.1 0.16 0 0 0 0 0 104 21.94 104.55 2987.95 0.0216 73.1 0.16 0 0 0 0 0 105 21.11 106.93 2977.23 0.0216 73.1 0.18 0 0 0 0 0 106 21.21 106.85 3020.06 0.0176 73.1 0.17 0 0 0 0 0 107 21.18 106.78 2982.13 0.0176 73.1 0.16 0 0 0 0 0 108 21.25 107.29 2999.66 0.0176 73.1 0.17 0 0 0 0 0 109 21.17 104.14 3011.93 0.0176 73.1 0.16 1 0 0 0 0 110 20.47 101.21 2937.29 0.0176 73.1 0.16 0 1 0 0 0 111 19.99 96.35 2895.58 0.0176 73.1 0.16 0 0 1 0 0 112 19.21 95.62 2904.87 0.0176 73.1 0.16 0 0 0 1 0 113 20.07 99.00 2904.26 0.0176 73.1 0.16 0 0 0 0 1 114 19.86 99.26 2883.89 0.0176 73.1 0.16 0 0 0 0 0 115 22.36 98.77 2846.81 0.0176 73.1 0.16 0 0 0 0 0 116 22.17 100.65 2836.94 0.0176 73.1 0.16 0 0 0 0 0 117 23.56 103.13 2853.13 0.0176 73.1 0.16 0 0 0 0 0 118 22.92 105.53 2916.07 0.0176 73.1 0.16 0 0 0 0 0 119 23.10 106.76 2916.68 0.0176 73.1 0.16 0 0 0 0 0 120 24.32 107.59 2926.55 0.0176 73.1 0.16 0 0 0 0 0 121 23.99 107.62 2966.85 0.0176 73.1 0.16 1 0 0 0 0 122 25.94 108.82 2976.78 0.0176 73.1 0.16 0 1 0 0 0 123 26.15 107.59 2967.79 0.0176 73.1 0.16 0 0 1 0 0 124 26.36 107.85 2991.78 0.0176 73.1 0.16 0 0 0 1 0 125 27.32 107.11 3012.03 0.0176 73.1 0.16 0 0 0 0 1 126 28.00 108.14 3010.24 0.0176 73.1 0.16 0 0 0 0 0 M6 M7 M8 M9 M10 M11 t 1 0 0 0 0 0 0 1 2 0 0 0 0 0 0 2 3 0 0 0 0 0 0 3 4 0 0 0 0 0 0 4 5 0 0 0 0 0 0 5 6 1 0 0 0 0 0 6 7 0 1 0 0 0 0 7 8 0 0 1 0 0 0 8 9 0 0 0 1 0 0 9 10 0 0 0 0 1 0 10 11 0 0 0 0 0 1 11 12 0 0 0 0 0 0 12 13 0 0 0 0 0 0 13 14 0 0 0 0 0 0 14 15 0 0 0 0 0 0 15 16 0 0 0 0 0 0 16 17 0 0 0 0 0 0 17 18 1 0 0 0 0 0 18 19 0 1 0 0 0 0 19 20 0 0 1 0 0 0 20 21 0 0 0 1 0 0 21 22 0 0 0 0 1 0 22 23 0 0 0 0 0 1 23 24 0 0 0 0 0 0 24 25 0 0 0 0 0 0 25 26 0 0 0 0 0 0 26 27 0 0 0 0 0 0 27 28 0 0 0 0 0 0 28 29 0 0 0 0 0 0 29 30 1 0 0 0 0 0 30 31 0 1 0 0 0 0 31 32 0 0 1 0 0 0 32 33 0 0 0 1 0 0 33 34 0 0 0 0 1 0 34 35 0 0 0 0 0 1 35 36 0 0 0 0 0 0 36 37 0 0 0 0 0 0 37 38 0 0 0 0 0 0 38 39 0 0 0 0 0 0 39 40 0 0 0 0 0 0 40 41 0 0 0 0 0 0 41 42 1 0 0 0 0 0 42 43 0 1 0 0 0 0 43 44 0 0 1 0 0 0 44 45 0 0 0 1 0 0 45 46 0 0 0 0 1 0 46 47 0 0 0 0 0 1 47 48 0 0 0 0 0 0 48 49 0 0 0 0 0 0 49 50 0 0 0 0 0 0 50 51 0 0 0 0 0 0 51 52 0 0 0 0 0 0 52 53 0 0 0 0 0 0 53 54 1 0 0 0 0 0 54 55 0 1 0 0 0 0 55 56 0 0 1 0 0 0 56 57 0 0 0 1 0 0 57 58 0 0 0 0 1 0 58 59 0 0 0 0 0 1 59 60 0 0 0 0 0 0 60 61 0 0 0 0 0 0 61 62 0 0 0 0 0 0 62 63 0 0 0 0 0 0 63 64 0 0 0 0 0 0 64 65 0 0 0 0 0 0 65 66 1 0 0 0 0 0 66 67 0 1 0 0 0 0 67 68 0 0 1 0 0 0 68 69 0 0 0 1 0 0 69 70 0 0 0 0 1 0 70 71 0 0 0 0 0 1 71 72 0 0 0 0 0 0 72 73 0 0 0 0 0 0 73 74 0 0 0 0 0 0 74 75 0 0 0 0 0 0 75 76 0 0 0 0 0 0 76 77 0 0 0 0 0 0 77 78 1 0 0 0 0 0 78 79 0 1 0 0 0 0 79 80 0 0 1 0 0 0 80 81 0 0 0 1 0 0 81 82 0 0 0 0 1 0 82 83 0 0 0 0 0 1 83 84 0 0 0 0 0 0 84 85 0 0 0 0 0 0 85 86 0 0 0 0 0 0 86 87 0 0 0 0 0 0 87 88 0 0 0 0 0 0 88 89 0 0 0 0 0 0 89 90 1 0 0 0 0 0 90 91 0 1 0 0 0 0 91 92 0 0 1 0 0 0 92 93 0 0 0 1 0 0 93 94 0 0 0 0 1 0 94 95 0 0 0 0 0 1 95 96 0 0 0 0 0 0 96 97 0 0 0 0 0 0 97 98 0 0 0 0 0 0 98 99 0 0 0 0 0 0 99 100 0 0 0 0 0 0 100 101 0 0 0 0 0 0 101 102 1 0 0 0 0 0 102 103 0 1 0 0 0 0 103 104 0 0 1 0 0 0 104 105 0 0 0 1 0 0 105 106 0 0 0 0 1 0 106 107 0 0 0 0 0 1 107 108 0 0 0 0 0 0 108 109 0 0 0 0 0 0 109 110 0 0 0 0 0 0 110 111 0 0 0 0 0 0 111 112 0 0 0 0 0 0 112 113 0 0 0 0 0 0 113 114 1 0 0 0 0 0 114 115 0 1 0 0 0 0 115 116 0 0 1 0 0 0 116 117 0 0 0 1 0 0 117 118 0 0 0 0 1 0 118 119 0 0 0 0 0 1 119 120 0 0 0 0 0 0 120 121 0 0 0 0 0 0 121 122 0 0 0 0 0 0 122 123 0 0 0 0 0 0 123 124 0 0 0 0 0 0 124 125 0 0 0 0 0 0 125 126 1 0 0 0 0 0 126 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) LINKEDIN NASDAQ INFLATION CONS.CONF 82.28292 0.43177 -0.03455 -761.52044 0.13420 FED.FUNDS.RATE M1 M2 M3 M4 38.43978 0.41475 0.58566 0.09830 0.33041 M5 M6 M7 M8 M9 0.15897 0.06942 -0.18145 -0.46578 -0.87669 M10 M11 t -1.31408 -0.83127 -0.04513 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -4.530 -1.248 -0.115 1.163 6.478 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 8.228e+01 1.337e+01 6.157 1.29e-08 *** LINKEDIN 4.318e-01 6.315e-02 6.837 5.03e-10 *** NASDAQ -3.456e-02 5.153e-03 -6.706 9.48e-10 *** INFLATION -7.615e+02 1.412e+02 -5.392 4.14e-07 *** CONS.CONF 1.342e-01 1.170e-01 1.147 0.254089 FED.FUNDS.RATE 3.844e+01 1.606e+01 2.393 0.018433 * M1 4.148e-01 9.442e-01 0.439 0.661349 M2 5.857e-01 9.458e-01 0.619 0.537072 M3 9.829e-02 9.498e-01 0.103 0.917765 M4 3.304e-01 9.492e-01 0.348 0.728442 M5 1.590e-01 9.452e-01 0.168 0.866752 M6 6.942e-02 9.477e-01 0.073 0.941741 M7 -1.815e-01 9.827e-01 -0.185 0.853851 M8 -4.658e-01 9.794e-01 -0.476 0.635351 M9 -8.767e-01 9.682e-01 -0.905 0.367237 M10 -1.314e+00 9.640e-01 -1.363 0.175680 M11 -8.313e-01 9.590e-01 -0.867 0.387984 t -4.513e-02 1.313e-02 -3.437 0.000838 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.141 on 108 degrees of freedom Multiple R-squared: 0.8027, Adjusted R-squared: 0.7717 F-statistic: 25.85 on 17 and 108 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.073255582 1.465112e-01 9.267444e-01 [2,] 0.023075680 4.615136e-02 9.769243e-01 [3,] 0.007756577 1.551315e-02 9.922434e-01 [4,] 0.003097935 6.195871e-03 9.969021e-01 [5,] 0.005766021 1.153204e-02 9.942340e-01 [6,] 0.003414949 6.829899e-03 9.965851e-01 [7,] 0.001735974 3.471948e-03 9.982640e-01 [8,] 0.001756683 3.513367e-03 9.982433e-01 [9,] 0.001444870 2.889741e-03 9.985551e-01 [10,] 0.001760917 3.521834e-03 9.982391e-01 [11,] 0.009625343 1.925069e-02 9.903747e-01 [12,] 0.023615818 4.723164e-02 9.763842e-01 [13,] 0.020996928 4.199386e-02 9.790031e-01 [14,] 0.066089616 1.321792e-01 9.339104e-01 [15,] 0.093360496 1.867210e-01 9.066395e-01 [16,] 0.095141671 1.902833e-01 9.048583e-01 [17,] 0.096125830 1.922517e-01 9.038742e-01 [18,] 0.114279825 2.285596e-01 8.857202e-01 [19,] 0.198792596 3.975852e-01 8.012074e-01 [20,] 0.573168853 8.536623e-01 4.268311e-01 [21,] 0.719275769 5.614485e-01 2.807242e-01 [22,] 0.767871831 4.642563e-01 2.321282e-01 [23,] 0.750572295 4.988554e-01 2.494277e-01 [24,] 0.762248253 4.755035e-01 2.377517e-01 [25,] 0.979973177 4.005365e-02 2.002682e-02 [26,] 0.985093394 2.981321e-02 1.490661e-02 [27,] 0.983350983 3.329803e-02 1.664902e-02 [28,] 0.981386014 3.722797e-02 1.861399e-02 [29,] 0.978636252 4.272750e-02 2.136375e-02 [30,] 0.983572201 3.285560e-02 1.642780e-02 [31,] 0.990258523 1.948295e-02 9.741477e-03 [32,] 0.995167106 9.665788e-03 4.832894e-03 [33,] 0.999437008 1.125985e-03 5.629925e-04 [34,] 0.999325622 1.348755e-03 6.743777e-04 [35,] 0.998943744 2.112513e-03 1.056256e-03 [36,] 0.999230248 1.539504e-03 7.697519e-04 [37,] 0.999071686 1.856628e-03 9.283142e-04 [38,] 0.999116945 1.766110e-03 8.830549e-04 [39,] 0.999313118 1.373764e-03 6.868818e-04 [40,] 0.999385208 1.229583e-03 6.147917e-04 [41,] 0.999280289 1.439422e-03 7.197109e-04 [42,] 0.999293392 1.413216e-03 7.066078e-04 [43,] 0.999307870 1.384260e-03 6.921299e-04 [44,] 0.999008517 1.982967e-03 9.914834e-04 [45,] 0.999314159 1.371681e-03 6.858406e-04 [46,] 0.999734567 5.308652e-04 2.654326e-04 [47,] 0.999705299 5.894026e-04 2.947013e-04 [48,] 0.999711397 5.772057e-04 2.886028e-04 [49,] 0.999563684 8.726325e-04 4.363163e-04 [50,] 0.999307653 1.384693e-03 6.923467e-04 [51,] 0.999194688 1.610625e-03 8.053123e-04 [52,] 0.999305173 1.389654e-03 6.948272e-04 [53,] 0.999015297 1.969406e-03 9.847028e-04 [54,] 0.998441087 3.117826e-03 1.558913e-03 [55,] 0.997686565 4.626871e-03 2.313435e-03 [56,] 0.997342507 5.314986e-03 2.657493e-03 [57,] 0.998812102 2.375795e-03 1.187898e-03 [58,] 0.998606019 2.787962e-03 1.393981e-03 [59,] 0.997904289 4.191421e-03 2.095711e-03 [60,] 0.997719866 4.560268e-03 2.280134e-03 [61,] 0.996930391 6.139218e-03 3.069609e-03 [62,] 0.996554249 6.891502e-03 3.445751e-03 [63,] 0.997364887 5.270227e-03 2.635113e-03 [64,] 0.996103237 7.793525e-03 3.896763e-03 [65,] 0.999575248 8.495032e-04 4.247516e-04 [66,] 0.999919393 1.612146e-04 8.060729e-05 [67,] 0.999861056 2.778876e-04 1.389438e-04 [68,] 0.999874496 2.510079e-04 1.255040e-04 [69,] 0.999838120 3.237590e-04 1.618795e-04 [70,] 0.999685897 6.282058e-04 3.141029e-04 [71,] 0.999538101 9.237977e-04 4.618988e-04 [72,] 0.999303460 1.393079e-03 6.965397e-04 [73,] 0.998947958 2.104083e-03 1.052042e-03 [74,] 0.998365920 3.268159e-03 1.634080e-03 [75,] 0.996899738 6.200523e-03 3.100262e-03 [76,] 0.994380454 1.123909e-02 5.619546e-03 [77,] 0.990953718 1.809256e-02 9.046282e-03 [78,] 0.987533839 2.493232e-02 1.246616e-02 [79,] 0.984810048 3.037990e-02 1.518995e-02 [80,] 0.982943324 3.411335e-02 1.705668e-02 [81,] 0.978758032 4.248394e-02 2.124197e-02 [82,] 0.999993301 1.339717e-05 6.698583e-06 [83,] 0.999971094 5.781215e-05 2.890608e-05 [84,] 0.999838625 3.227508e-04 1.613754e-04 [85,] 0.998183083 3.633834e-03 1.816917e-03 > postscript(file="/var/wessaorg/rcomp/tmp/1q1nd1356076907.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/2sw3j1356076907.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/3fyrl1356076907.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/4jq5l1356076907.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/5h51q1356076907.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 = 126 Frequency = 1 1 2 3 4 5 6 -1.88542999 -2.60128759 -3.30802547 0.10654189 -1.10364458 -0.53621878 7 8 9 10 11 12 -1.17210073 1.02041394 -0.34514330 0.57801177 1.12996932 1.54667307 13 14 15 16 17 18 2.78905752 2.79174754 2.04386795 2.20655074 1.12979276 1.85234979 19 20 21 22 23 24 2.93710002 2.55320939 6.47800364 1.34361489 2.18611287 1.80088518 25 26 27 28 29 30 0.08318880 2.74409268 3.04890270 1.19681497 -1.42105841 -0.70996952 31 32 33 34 35 36 -1.88037193 -1.13586023 1.51722358 2.10372332 1.05505031 -0.45064474 37 38 39 40 41 42 -1.92072896 -1.11344255 -0.75703870 -2.96608960 -4.05095854 -4.52964954 43 44 45 46 47 48 -0.40611973 -0.35774277 -3.31956663 -2.55906686 -0.82156788 -1.00277463 49 50 51 52 53 54 -0.95656424 -0.08177860 0.44624799 0.07405493 1.38973479 0.52160551 55 56 57 58 59 60 1.62384255 2.22661236 0.50736865 1.29277816 0.28988885 0.16394981 61 62 63 64 65 66 -0.14820423 -1.17371184 -1.38460157 -2.39453950 -2.16272080 -1.41598674 67 68 69 70 71 72 -3.78060496 -3.28476491 -2.37733846 -2.64899302 -2.49222361 -2.15283754 73 74 75 76 77 78 -1.27319957 -1.14514321 -0.48495539 -0.36495522 1.35625793 0.05983804 79 80 81 82 83 84 1.12255475 -1.60469581 -1.54856652 -1.12474524 -0.30637378 1.12449580 85 86 87 88 89 90 0.66617217 0.30258315 -0.33647842 0.33311936 0.42122219 -0.40655210 91 92 93 94 95 96 -0.19475352 -0.43216999 -0.72088773 0.78924351 0.86510325 1.17466077 97 98 99 100 101 102 2.45129027 0.57315141 -0.64425333 0.02322108 0.86416392 2.17070806 103 104 105 106 107 108 3.13398162 3.41184751 0.87105769 0.30642441 -1.05729405 -1.77228921 109 110 111 112 113 114 -0.05344975 -2.19331059 -1.48369334 -1.81447180 -2.21835825 -3.10980891 115 116 117 118 119 120 -1.38352809 -2.39684948 -1.06215092 -0.08099094 -0.84866527 -0.43211851 121 122 123 124 125 126 0.24786799 1.89709961 2.86002759 3.59975314 5.79556899 6.10368419 > postscript(file="/var/wessaorg/rcomp/tmp/6d9lo1356076907.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 = 126 Frequency = 1 lag(myerror, k = 1) myerror 0 -1.88542999 NA 1 -2.60128759 -1.88542999 2 -3.30802547 -2.60128759 3 0.10654189 -3.30802547 4 -1.10364458 0.10654189 5 -0.53621878 -1.10364458 6 -1.17210073 -0.53621878 7 1.02041394 -1.17210073 8 -0.34514330 1.02041394 9 0.57801177 -0.34514330 10 1.12996932 0.57801177 11 1.54667307 1.12996932 12 2.78905752 1.54667307 13 2.79174754 2.78905752 14 2.04386795 2.79174754 15 2.20655074 2.04386795 16 1.12979276 2.20655074 17 1.85234979 1.12979276 18 2.93710002 1.85234979 19 2.55320939 2.93710002 20 6.47800364 2.55320939 21 1.34361489 6.47800364 22 2.18611287 1.34361489 23 1.80088518 2.18611287 24 0.08318880 1.80088518 25 2.74409268 0.08318880 26 3.04890270 2.74409268 27 1.19681497 3.04890270 28 -1.42105841 1.19681497 29 -0.70996952 -1.42105841 30 -1.88037193 -0.70996952 31 -1.13586023 -1.88037193 32 1.51722358 -1.13586023 33 2.10372332 1.51722358 34 1.05505031 2.10372332 35 -0.45064474 1.05505031 36 -1.92072896 -0.45064474 37 -1.11344255 -1.92072896 38 -0.75703870 -1.11344255 39 -2.96608960 -0.75703870 40 -4.05095854 -2.96608960 41 -4.52964954 -4.05095854 42 -0.40611973 -4.52964954 43 -0.35774277 -0.40611973 44 -3.31956663 -0.35774277 45 -2.55906686 -3.31956663 46 -0.82156788 -2.55906686 47 -1.00277463 -0.82156788 48 -0.95656424 -1.00277463 49 -0.08177860 -0.95656424 50 0.44624799 -0.08177860 51 0.07405493 0.44624799 52 1.38973479 0.07405493 53 0.52160551 1.38973479 54 1.62384255 0.52160551 55 2.22661236 1.62384255 56 0.50736865 2.22661236 57 1.29277816 0.50736865 58 0.28988885 1.29277816 59 0.16394981 0.28988885 60 -0.14820423 0.16394981 61 -1.17371184 -0.14820423 62 -1.38460157 -1.17371184 63 -2.39453950 -1.38460157 64 -2.16272080 -2.39453950 65 -1.41598674 -2.16272080 66 -3.78060496 -1.41598674 67 -3.28476491 -3.78060496 68 -2.37733846 -3.28476491 69 -2.64899302 -2.37733846 70 -2.49222361 -2.64899302 71 -2.15283754 -2.49222361 72 -1.27319957 -2.15283754 73 -1.14514321 -1.27319957 74 -0.48495539 -1.14514321 75 -0.36495522 -0.48495539 76 1.35625793 -0.36495522 77 0.05983804 1.35625793 78 1.12255475 0.05983804 79 -1.60469581 1.12255475 80 -1.54856652 -1.60469581 81 -1.12474524 -1.54856652 82 -0.30637378 -1.12474524 83 1.12449580 -0.30637378 84 0.66617217 1.12449580 85 0.30258315 0.66617217 86 -0.33647842 0.30258315 87 0.33311936 -0.33647842 88 0.42122219 0.33311936 89 -0.40655210 0.42122219 90 -0.19475352 -0.40655210 91 -0.43216999 -0.19475352 92 -0.72088773 -0.43216999 93 0.78924351 -0.72088773 94 0.86510325 0.78924351 95 1.17466077 0.86510325 96 2.45129027 1.17466077 97 0.57315141 2.45129027 98 -0.64425333 0.57315141 99 0.02322108 -0.64425333 100 0.86416392 0.02322108 101 2.17070806 0.86416392 102 3.13398162 2.17070806 103 3.41184751 3.13398162 104 0.87105769 3.41184751 105 0.30642441 0.87105769 106 -1.05729405 0.30642441 107 -1.77228921 -1.05729405 108 -0.05344975 -1.77228921 109 -2.19331059 -0.05344975 110 -1.48369334 -2.19331059 111 -1.81447180 -1.48369334 112 -2.21835825 -1.81447180 113 -3.10980891 -2.21835825 114 -1.38352809 -3.10980891 115 -2.39684948 -1.38352809 116 -1.06215092 -2.39684948 117 -0.08099094 -1.06215092 118 -0.84866527 -0.08099094 119 -0.43211851 -0.84866527 120 0.24786799 -0.43211851 121 1.89709961 0.24786799 122 2.86002759 1.89709961 123 3.59975314 2.86002759 124 5.79556899 3.59975314 125 6.10368419 5.79556899 126 NA 6.10368419 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -2.60128759 -1.88542999 [2,] -3.30802547 -2.60128759 [3,] 0.10654189 -3.30802547 [4,] -1.10364458 0.10654189 [5,] -0.53621878 -1.10364458 [6,] -1.17210073 -0.53621878 [7,] 1.02041394 -1.17210073 [8,] -0.34514330 1.02041394 [9,] 0.57801177 -0.34514330 [10,] 1.12996932 0.57801177 [11,] 1.54667307 1.12996932 [12,] 2.78905752 1.54667307 [13,] 2.79174754 2.78905752 [14,] 2.04386795 2.79174754 [15,] 2.20655074 2.04386795 [16,] 1.12979276 2.20655074 [17,] 1.85234979 1.12979276 [18,] 2.93710002 1.85234979 [19,] 2.55320939 2.93710002 [20,] 6.47800364 2.55320939 [21,] 1.34361489 6.47800364 [22,] 2.18611287 1.34361489 [23,] 1.80088518 2.18611287 [24,] 0.08318880 1.80088518 [25,] 2.74409268 0.08318880 [26,] 3.04890270 2.74409268 [27,] 1.19681497 3.04890270 [28,] -1.42105841 1.19681497 [29,] -0.70996952 -1.42105841 [30,] -1.88037193 -0.70996952 [31,] -1.13586023 -1.88037193 [32,] 1.51722358 -1.13586023 [33,] 2.10372332 1.51722358 [34,] 1.05505031 2.10372332 [35,] -0.45064474 1.05505031 [36,] -1.92072896 -0.45064474 [37,] -1.11344255 -1.92072896 [38,] -0.75703870 -1.11344255 [39,] -2.96608960 -0.75703870 [40,] -4.05095854 -2.96608960 [41,] -4.52964954 -4.05095854 [42,] -0.40611973 -4.52964954 [43,] -0.35774277 -0.40611973 [44,] -3.31956663 -0.35774277 [45,] -2.55906686 -3.31956663 [46,] -0.82156788 -2.55906686 [47,] -1.00277463 -0.82156788 [48,] -0.95656424 -1.00277463 [49,] -0.08177860 -0.95656424 [50,] 0.44624799 -0.08177860 [51,] 0.07405493 0.44624799 [52,] 1.38973479 0.07405493 [53,] 0.52160551 1.38973479 [54,] 1.62384255 0.52160551 [55,] 2.22661236 1.62384255 [56,] 0.50736865 2.22661236 [57,] 1.29277816 0.50736865 [58,] 0.28988885 1.29277816 [59,] 0.16394981 0.28988885 [60,] -0.14820423 0.16394981 [61,] -1.17371184 -0.14820423 [62,] -1.38460157 -1.17371184 [63,] -2.39453950 -1.38460157 [64,] -2.16272080 -2.39453950 [65,] -1.41598674 -2.16272080 [66,] -3.78060496 -1.41598674 [67,] -3.28476491 -3.78060496 [68,] -2.37733846 -3.28476491 [69,] -2.64899302 -2.37733846 [70,] -2.49222361 -2.64899302 [71,] -2.15283754 -2.49222361 [72,] -1.27319957 -2.15283754 [73,] -1.14514321 -1.27319957 [74,] -0.48495539 -1.14514321 [75,] -0.36495522 -0.48495539 [76,] 1.35625793 -0.36495522 [77,] 0.05983804 1.35625793 [78,] 1.12255475 0.05983804 [79,] -1.60469581 1.12255475 [80,] -1.54856652 -1.60469581 [81,] -1.12474524 -1.54856652 [82,] -0.30637378 -1.12474524 [83,] 1.12449580 -0.30637378 [84,] 0.66617217 1.12449580 [85,] 0.30258315 0.66617217 [86,] -0.33647842 0.30258315 [87,] 0.33311936 -0.33647842 [88,] 0.42122219 0.33311936 [89,] -0.40655210 0.42122219 [90,] -0.19475352 -0.40655210 [91,] -0.43216999 -0.19475352 [92,] -0.72088773 -0.43216999 [93,] 0.78924351 -0.72088773 [94,] 0.86510325 0.78924351 [95,] 1.17466077 0.86510325 [96,] 2.45129027 1.17466077 [97,] 0.57315141 2.45129027 [98,] -0.64425333 0.57315141 [99,] 0.02322108 -0.64425333 [100,] 0.86416392 0.02322108 [101,] 2.17070806 0.86416392 [102,] 3.13398162 2.17070806 [103,] 3.41184751 3.13398162 [104,] 0.87105769 3.41184751 [105,] 0.30642441 0.87105769 [106,] -1.05729405 0.30642441 [107,] -1.77228921 -1.05729405 [108,] -0.05344975 -1.77228921 [109,] -2.19331059 -0.05344975 [110,] -1.48369334 -2.19331059 [111,] -1.81447180 -1.48369334 [112,] -2.21835825 -1.81447180 [113,] -3.10980891 -2.21835825 [114,] -1.38352809 -3.10980891 [115,] -2.39684948 -1.38352809 [116,] -1.06215092 -2.39684948 [117,] -0.08099094 -1.06215092 [118,] -0.84866527 -0.08099094 [119,] -0.43211851 -0.84866527 [120,] 0.24786799 -0.43211851 [121,] 1.89709961 0.24786799 [122,] 2.86002759 1.89709961 [123,] 3.59975314 2.86002759 [124,] 5.79556899 3.59975314 [125,] 6.10368419 5.79556899 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -2.60128759 -1.88542999 2 -3.30802547 -2.60128759 3 0.10654189 -3.30802547 4 -1.10364458 0.10654189 5 -0.53621878 -1.10364458 6 -1.17210073 -0.53621878 7 1.02041394 -1.17210073 8 -0.34514330 1.02041394 9 0.57801177 -0.34514330 10 1.12996932 0.57801177 11 1.54667307 1.12996932 12 2.78905752 1.54667307 13 2.79174754 2.78905752 14 2.04386795 2.79174754 15 2.20655074 2.04386795 16 1.12979276 2.20655074 17 1.85234979 1.12979276 18 2.93710002 1.85234979 19 2.55320939 2.93710002 20 6.47800364 2.55320939 21 1.34361489 6.47800364 22 2.18611287 1.34361489 23 1.80088518 2.18611287 24 0.08318880 1.80088518 25 2.74409268 0.08318880 26 3.04890270 2.74409268 27 1.19681497 3.04890270 28 -1.42105841 1.19681497 29 -0.70996952 -1.42105841 30 -1.88037193 -0.70996952 31 -1.13586023 -1.88037193 32 1.51722358 -1.13586023 33 2.10372332 1.51722358 34 1.05505031 2.10372332 35 -0.45064474 1.05505031 36 -1.92072896 -0.45064474 37 -1.11344255 -1.92072896 38 -0.75703870 -1.11344255 39 -2.96608960 -0.75703870 40 -4.05095854 -2.96608960 41 -4.52964954 -4.05095854 42 -0.40611973 -4.52964954 43 -0.35774277 -0.40611973 44 -3.31956663 -0.35774277 45 -2.55906686 -3.31956663 46 -0.82156788 -2.55906686 47 -1.00277463 -0.82156788 48 -0.95656424 -1.00277463 49 -0.08177860 -0.95656424 50 0.44624799 -0.08177860 51 0.07405493 0.44624799 52 1.38973479 0.07405493 53 0.52160551 1.38973479 54 1.62384255 0.52160551 55 2.22661236 1.62384255 56 0.50736865 2.22661236 57 1.29277816 0.50736865 58 0.28988885 1.29277816 59 0.16394981 0.28988885 60 -0.14820423 0.16394981 61 -1.17371184 -0.14820423 62 -1.38460157 -1.17371184 63 -2.39453950 -1.38460157 64 -2.16272080 -2.39453950 65 -1.41598674 -2.16272080 66 -3.78060496 -1.41598674 67 -3.28476491 -3.78060496 68 -2.37733846 -3.28476491 69 -2.64899302 -2.37733846 70 -2.49222361 -2.64899302 71 -2.15283754 -2.49222361 72 -1.27319957 -2.15283754 73 -1.14514321 -1.27319957 74 -0.48495539 -1.14514321 75 -0.36495522 -0.48495539 76 1.35625793 -0.36495522 77 0.05983804 1.35625793 78 1.12255475 0.05983804 79 -1.60469581 1.12255475 80 -1.54856652 -1.60469581 81 -1.12474524 -1.54856652 82 -0.30637378 -1.12474524 83 1.12449580 -0.30637378 84 0.66617217 1.12449580 85 0.30258315 0.66617217 86 -0.33647842 0.30258315 87 0.33311936 -0.33647842 88 0.42122219 0.33311936 89 -0.40655210 0.42122219 90 -0.19475352 -0.40655210 91 -0.43216999 -0.19475352 92 -0.72088773 -0.43216999 93 0.78924351 -0.72088773 94 0.86510325 0.78924351 95 1.17466077 0.86510325 96 2.45129027 1.17466077 97 0.57315141 2.45129027 98 -0.64425333 0.57315141 99 0.02322108 -0.64425333 100 0.86416392 0.02322108 101 2.17070806 0.86416392 102 3.13398162 2.17070806 103 3.41184751 3.13398162 104 0.87105769 3.41184751 105 0.30642441 0.87105769 106 -1.05729405 0.30642441 107 -1.77228921 -1.05729405 108 -0.05344975 -1.77228921 109 -2.19331059 -0.05344975 110 -1.48369334 -2.19331059 111 -1.81447180 -1.48369334 112 -2.21835825 -1.81447180 113 -3.10980891 -2.21835825 114 -1.38352809 -3.10980891 115 -2.39684948 -1.38352809 116 -1.06215092 -2.39684948 117 -0.08099094 -1.06215092 118 -0.84866527 -0.08099094 119 -0.43211851 -0.84866527 120 0.24786799 -0.43211851 121 1.89709961 0.24786799 122 2.86002759 1.89709961 123 3.59975314 2.86002759 124 5.79556899 3.59975314 125 6.10368419 5.79556899 > 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/7ciwa1356076908.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/80ma71356076908.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/9npc61356076908.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/10xuco1356076908.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/11gm451356076908.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/12nb981356076908.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/136l031356076908.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/14i3571356076908.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/15xj9x1356076908.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/16ftkr1356076908.tab") + } > > try(system("convert tmp/1q1nd1356076907.ps tmp/1q1nd1356076907.png",intern=TRUE)) character(0) > try(system("convert tmp/2sw3j1356076907.ps tmp/2sw3j1356076907.png",intern=TRUE)) character(0) > try(system("convert tmp/3fyrl1356076907.ps tmp/3fyrl1356076907.png",intern=TRUE)) character(0) > try(system("convert tmp/4jq5l1356076907.ps tmp/4jq5l1356076907.png",intern=TRUE)) character(0) > try(system("convert tmp/5h51q1356076907.ps tmp/5h51q1356076907.png",intern=TRUE)) character(0) > try(system("convert tmp/6d9lo1356076907.ps tmp/6d9lo1356076907.png",intern=TRUE)) character(0) > try(system("convert tmp/7ciwa1356076908.ps tmp/7ciwa1356076908.png",intern=TRUE)) character(0) > try(system("convert tmp/80ma71356076908.ps tmp/80ma71356076908.png",intern=TRUE)) character(0) > try(system("convert tmp/9npc61356076908.ps tmp/9npc61356076908.png",intern=TRUE)) character(0) > try(system("convert tmp/10xuco1356076908.ps tmp/10xuco1356076908.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.257 1.189 8.644