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 + ,41837160 + ,91.51 + ,2747.48 + ,0.016 + ,62.7 + ,0.16 + ,26.90 + ,35204750 + ,91.09 + ,2760.01 + ,0.016 + ,62.7 + ,0.17 + ,25.86 + ,42367740 + ,93.00 + ,2778.11 + ,0.016 + ,62.7 + ,0.17 + ,26.81 + ,61427940 + ,93.08 + ,2844.72 + ,0.016 + ,62.7 + ,0.16 + ,26.31 + ,26132090 + ,94.13 + ,2831.02 + ,0.016 + ,62.7 + ,0.16 + ,27.10 + ,3799718 + ,96.26 + ,2858.42 + ,0.016 + ,62.7 + ,0.17 + ,27.00 + ,28202230 + ,94.29 + ,2809.73 + ,0.016 + ,62.7 + ,0.17 + ,27.40 + ,15809640 + ,94.46 + ,2843.07 + ,0.016 + ,62.7 + ,0.16 + ,27.27 + ,17110160 + ,95.53 + ,2818.61 + ,0.016 + ,62.7 + ,0.17 + ,28.29 + ,16835510 + ,98.29 + ,2836.33 + ,0.016 + ,62.7 + ,0.17 + ,30.01 + ,43517670 + ,102.01 + ,2872.80 + ,0.016 + ,62.7 + ,0.18 + ,31.41 + ,42958450 + ,105.16 + ,2895.33 + ,0.016 + ,62.7 + ,0.17 + ,31.91 + ,30826830 + ,105.34 + ,2929.76 + ,0.016 + ,62.7 + ,0.17 + ,31.60 + ,15549740 + ,105.27 + ,2930.45 + ,0.016 + ,62.7 + ,0.16 + ,31.84 + ,21843070 + ,102.19 + ,2859.09 + ,0.016 + ,62.7 + ,0.17 + ,33.05 + ,73424890 + ,106.85 + ,2892.42 + ,0.016 + ,62.7 + ,0.17 + ,32.06 + ,24330740 + ,103.05 + ,2836.16 + ,0.016 + ,62.7 + ,0.17 + ,33.10 + ,24785970 + ,106.42 + ,2854.06 + ,0.016 + ,62.7 + ,0.16 + ,32.23 + ,28553940 + ,105.17 + ,2875.32 + ,0.016 + ,62.7 + ,0.15 + ,31.36 + ,17659080 + ,102.74 + ,2849.49 + ,0.016 + ,62.7 + ,0.15 + ,31.09 + ,19508980 + ,106.27 + ,2935.05 + ,0.016 + ,62.7 + ,0.09 + ,30.77 + ,14110230 + ,107.63 + ,2951.23 + ,0.0141 + ,65.4 + ,0.18 + ,31.20 + ,8765498 + ,108.54 + ,2976.08 + ,0.0141 + ,65.4 + ,0.17 + ,31.47 + ,10027250 + ,108.24 + ,2976.12 + ,0.0141 + ,65.4 + ,0.17 + ,31.73 + ,10943350 + ,108.86 + ,2937.33 + ,0.0141 + ,65.4 + ,0.17 + ,32.17 + ,17755740 + ,102.98 + ,2931.77 + ,0.0141 + ,65.4 + ,0.17 + ,31.47 + ,14238190 + ,99.53 + ,2902.33 + ,0.0141 + ,65.4 + ,0.17 + ,30.97 + ,12997760 + ,101.08 + ,2887.98 + ,0.0141 + ,65.4 + ,0.17 + ,30.81 + ,11299240 + ,104.64 + ,2866.19 + ,0.0141 + ,65.4 + ,0.18 + ,30.72 + ,8102653 + ,105.59 + ,2908.47 + ,0.0141 + ,65.4 + ,0.19 + ,28.24 + ,24549800 + ,103.21 + ,2896.94 + ,0.0141 + ,65.4 + ,0.18 + ,28.09 + ,30410530 + ,103.84 + ,2910.04 + ,0.0141 + ,65.4 + ,0.17 + ,29.11 + ,16807730 + ,104.61 + ,2942.60 + ,0.0141 + ,65.4 + ,0.16 + ,29.00 + ,13671200 + ,108.65 + ,2965.90 + ,0.0141 + ,65.4 + ,0.13 + ,28.76 + ,11854290 + ,106.26 + ,2925.30 + ,0.0141 + ,65.4 + ,0.13 + ,28.75 + ,12383610 + ,104.20 + ,2890.15 + ,0.0141 + ,65.4 + ,0.14 + ,28.45 + ,11512350 + ,102.99 + ,2862.99 + ,0.0141 + ,65.4 + ,0.15 + ,29.34 + ,16749990 + ,102.19 + ,2854.24 + ,0.0141 + ,65.4 + ,0.15 + ,26.84 + ,61009290 + ,100.82 + ,2893.25 + ,0.0141 + ,65.4 + ,0.14 + ,23.70 + ,123011300 + ,103.42 + ,2958.09 + ,0.0141 + ,65.4 + ,0.14 + ,23.15 + ,29253590 + ,104.18 + ,2945.84 + ,0.0141 + ,65.4 + ,0.14 + ,21.71 + ,55998620 + ,102.65 + ,2939.52 + ,0.0141 + ,65.4 + ,0.13 + ,20.88 + ,44488370 + ,95.64 + ,2920.21 + ,0.0169 + ,61.3 + ,0.14 + ,20.04 + ,56264460 + ,93.51 + ,2909.77 + ,0.0169 + ,61.3 + ,0.14 + ,21.09 + ,80626220 + ,108.51 + ,2967.90 + ,0.0169 + ,61.3 + ,0.14 + ,21.92 + ,27733830 + ,111.55 + ,2989.91 + ,0.0169 + ,61.3 + ,0.14 + ,20.72 + ,36699380 + ,106.70 + ,3015.86 + ,0.0169 + ,61.3 + ,0.13 + ,20.72 + ,29514550 + ,104.93 + ,3011.25 + ,0.0169 + ,61.3 + ,0.13 + ,21.01 + ,15605960 + ,105.23 + ,3018.64 + ,0.0169 + ,61.3 + ,0.13 + ,21.80 + ,25714310 + ,104.92 + ,3020.86 + ,0.0169 + ,61.3 + ,0.13 + ,21.60 + ,24904700 + ,104.60 + ,3022.52 + ,0.0169 + ,61.3 + ,0.13 + ,20.38 + ,38971320 + ,101.76 + ,3016.98 + ,0.0169 + ,61.3 + ,0.13 + ,21.20 + ,47682050 + ,102.23 + ,3030.93 + ,0.0169 + ,61.3 + ,0.13 + ,19.87 + ,157188200 + ,103.99 + ,3062.39 + ,0.0169 + ,61.3 + ,0.13 + ,19.05 + ,129057400 + ,101.36 + ,3076.59 + ,0.0169 + ,61.3 + ,0.13 + ,20.01 + ,100818300 + ,102.92 + ,3076.21 + ,0.0169 + ,61.3 + ,0.13 + ,19.15 + ,70483330 + ,105.25 + ,3067.26 + ,0.0169 + ,61.3 + ,0.13 + ,19.43 + ,49779450 + ,105.71 + ,3073.67 + ,0.0169 + ,61.3 + ,0.13 + ,19.44 + ,32747000 + ,105.42 + ,3053.40 + ,0.0169 + ,61.3 + ,0.13 + ,19.40 + ,29588690 + ,105.11 + ,3069.79 + ,0.0169 + ,61.3 + ,0.13 + ,19.15 + ,20663220 + ,104.67 + ,3073.19 + ,0.0169 + ,61.3 + ,0.13 + ,19.34 + ,25402980 + ,107.51 + ,3077.14 + ,0.0169 + ,61.3 + ,0.13 + ,19.10 + ,16071190 + ,109.00 + ,3081.19 + ,0.0169 + ,61.3 + ,0.13 + ,19.08 + ,30571430 + ,107.37 + ,3048.71 + ,0.0169 + ,61.3 + ,0.14 + ,18.05 + ,58612440 + ,107.30 + ,3066.96 + ,0.0169 + ,61.3 + ,0.13 + ,17.72 + ,46177000 + ,107.37 + ,3075.06 + ,0.0199 + ,70.3 + ,0.14 + ,18.58 + ,60657900 + ,113.28 + ,3069.27 + ,0.0199 + ,70.3 + ,0.16 + ,18.96 + ,46028860 + ,119.10 + ,3135.81 + ,0.0199 + ,70.3 + ,0.16 + ,18.98 + ,36325880 + ,119.04 + ,3136.42 + ,0.0199 + ,70.3 + ,0.15 + ,18.81 + ,24752340 + ,117.80 + ,3104.02 + ,0.0199 + ,70.3 + ,0.15 + ,19.43 + ,47343020 + ,117.90 + ,3104.53 + ,0.0199 + ,70.3 + ,0.15 + ,20.93 + ,121399400 + ,119.55 + ,3114.31 + ,0.0199 + ,70.3 + ,0.15 + ,20.71 + ,64896660 + ,119.47 + ,3155.83 + ,0.0199 + ,70.3 + ,0.15 + ,22.00 + ,72707430 + ,123.23 + ,3183.95 + ,0.0199 + ,70.3 + ,0.16 + ,21.52 + ,50593510 + ,121.40 + ,3178.67 + ,0.0199 + ,70.3 + ,0.16 + ,21.87 + ,36696330 + ,121.43 + ,3177.80 + ,0.0199 + ,70.3 + ,0.16 + ,23.29 + ,78525460 + ,122.51 + ,3182.62 + ,0.0199 + ,70.3 + ,0.15 + ,22.59 + ,57115160 + ,122.78 + ,3175.96 + ,0.0199 + ,70.3 + ,0.16 + ,22.86 + ,51163120 + ,122.84 + ,3179.96 + ,0.0199 + ,70.3 + ,0.15 + ,20.79 + ,78968380 + ,122.70 + ,3160.78 + ,0.0199 + ,70.3 + ,0.16 + ,20.28 + ,46169460 + ,119.89 + ,3117.73 + ,0.0199 + ,70.3 + ,0.15 + ,20.62 + ,38212360 + ,118.00 + ,3093.70 + ,0.0199 + ,70.3 + ,0.16 + ,20.32 + ,30061050 + ,119.61 + ,3136.60 + ,0.0199 + ,70.3 + ,0.14 + ,21.66 + ,65415370 + ,120.40 + ,3116.23 + ,0.0199 + ,70.3 + ,0.09 + ,21.99 + ,51198150 + ,117.94 + ,3113.53 + ,0.0216 + ,73.1 + ,0.15 + ,22.27 + ,29276680 + ,118.77 + ,3120.04 + ,0.0216 + ,73.1 + ,0.16 + ,21.83 + ,31940720 + ,121.68 + ,3135.23 + ,0.0216 + ,73.1 + ,0.16 + ,21.94 + ,46549400 + ,121.98 + ,3149.46 + ,0.0216 + ,73.1 + ,0.15 + ,20.91 + ,40483780 + ,118.83 + ,3136.19 + ,0.0216 + ,73.1 + ,0.15 + ,20.40 + ,32190200 + ,117.97 + ,3112.35 + ,0.0216 + ,73.1 + ,0.15 + ,20.22 + ,27125670 + ,113.07 + ,3065.02 + ,0.0216 + ,73.1 + ,0.16 + ,19.64 + ,39282420 + ,111.98 + ,3051.78 + ,0.0216 + ,73.1 + ,0.16 + ,19.75 + ,21803710 + ,113.77 + ,3049.41 + ,0.0216 + ,73.1 + ,0.16 + ,19.51 + ,18743920 + ,110.41 + ,3044.11 + ,0.0216 + ,73.1 + ,0.16 + ,19.52 + ,20154860 + ,110.85 + ,3064.18 + ,0.0216 + ,73.1 + ,0.16 + ,19.48 + ,21816100 + ,111.18 + ,3101.17 + ,0.0216 + ,73.1 + ,0.16 + ,19.88 + ,44020450 + ,109.42 + ,3104.12 + ,0.0216 + ,73.1 + ,0.15 + ,18.97 + ,52059860 + ,108.87 + ,3072.87 + ,0.0216 + ,73.1 + ,0.15 + ,19.00 + ,34769600 + ,106.72 + ,3005.62 + ,0.0216 + ,73.1 + ,0.16 + ,19.32 + ,32269470 + ,107.28 + ,3016.96 + ,0.0216 + ,73.1 + ,0.15 + ,19.50 + ,72281000 + ,104.13 + ,2990.46 + ,0.0216 + ,73.1 + ,0.15 + ,23.22 + ,228364700 + ,107.55 + ,2981.70 + ,0.0216 + ,73.1 + ,0.17 + ,22.56 + ,76050080 + ,105.72 + ,2986.12 + ,0.0216 + ,73.1 + ,0.16 + ,21.94 + ,9999999 + ,104.55 + ,2987.95 + ,0.0216 + ,73.1 + ,0.16 + ,21.11 + ,99311480 + ,106.93 + ,2977.23 + ,0.0216 + ,73.1 + ,0.18 + ,21.21 + ,37631000 + ,106.85 + ,3020.06 + ,0.0176 + ,73.1 + ,0.17 + ,21.18 + ,38308550 + ,106.78 + ,2982.13 + ,0.0176 + ,73.1 + ,0.16 + ,21.25 + ,31752420 + ,107.29 + ,2999.66 + ,0.0176 + ,73.1 + ,0.17 + ,21.17 + ,29030780 + ,104.14 + ,3011.93 + ,0.0176 + ,73.1 + ,0.16 + ,20.47 + ,33352920 + ,101.21 + ,2937.29 + ,0.0176 + ,73.1 + ,0.16 + ,19.99 + ,34106840 + ,96.35 + ,2895.58 + ,0.0176 + ,73.1 + ,0.16 + ,19.21 + ,42257790 + ,95.62 + ,2904.87 + ,0.0176 + ,73.1 + ,0.16 + ,20.07 + ,67220540 + ,99.00 + ,2904.26 + ,0.0176 + ,73.1 + ,0.16 + ,19.86 + ,71524510 + ,99.26 + ,2883.89 + ,0.0176 + ,73.1 + ,0.16 + ,22.36 + ,229081600 + ,98.77 + ,2846.81 + ,0.0176 + ,73.1 + ,0.16 + ,22.17 + ,78808770 + ,100.65 + ,2836.94 + ,0.0176 + ,73.1 + ,0.16 + ,23.56 + ,107091400 + ,103.13 + ,2853.13 + ,0.0176 + ,73.1 + ,0.16 + ,22.92 + ,84944370 + ,105.53 + ,2916.07 + ,0.0176 + ,73.1 + ,0.16 + ,23.10 + ,46515660 + ,106.76 + ,2916.68 + ,0.0176 + ,73.1 + ,0.16 + ,24.32 + ,89720920 + ,107.59 + ,2926.55 + ,0.0176 + ,73.1 + ,0.16 + ,23.99 + ,29520310 + ,107.62 + ,2966.85 + ,0.0176 + ,73.1 + ,0.16 + ,25.94 + ,123513900 + ,108.82 + ,2976.78 + ,0.0176 + ,73.1 + ,0.16 + ,26.15 + ,85687430 + ,107.59 + ,2967.79 + ,0.0176 + ,73.1 + ,0.16 + ,26.36 + ,49113040 + ,107.85 + ,2991.78 + ,0.0176 + ,73.1 + ,0.16 + ,27.32 + ,88572990 + ,107.11 + ,3012.03 + ,0.0176 + ,73.1 + ,0.16 + ,28.00 + ,126867400 + ,108.14 + ,3010.24 + ,0.0176 + ,73.1 + ,0.16) + ,dim=c(7 + ,126) + ,dimnames=list(c('FACEBOOK' + ,'VOLUME' + ,'LINKEDIN' + ,'NASDAQ' + ,'INF.CONS.CONF' + ,'FED' + ,'FUNDS.RATE') + ,1:126)) > y <- array(NA,dim=c(7,126),dimnames=list(c('FACEBOOK','VOLUME','LINKEDIN','NASDAQ','INF.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 = 'Do not include Seasonal Dummies' > par1 = '1' > par3 <- 'Linear Trend' > par2 <- 'Do not include Seasonal Dummies' > par1 <- '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > 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 VOLUME LINKEDIN NASDAQ INF.CONS.CONF FED FUNDS.RATE t 1 27.72 41837160 91.51 2747.48 0.0160 62.7 0.16 1 2 26.90 35204750 91.09 2760.01 0.0160 62.7 0.17 2 3 25.86 42367740 93.00 2778.11 0.0160 62.7 0.17 3 4 26.81 61427940 93.08 2844.72 0.0160 62.7 0.16 4 5 26.31 26132090 94.13 2831.02 0.0160 62.7 0.16 5 6 27.10 3799718 96.26 2858.42 0.0160 62.7 0.17 6 7 27.00 28202230 94.29 2809.73 0.0160 62.7 0.17 7 8 27.40 15809640 94.46 2843.07 0.0160 62.7 0.16 8 9 27.27 17110160 95.53 2818.61 0.0160 62.7 0.17 9 10 28.29 16835510 98.29 2836.33 0.0160 62.7 0.17 10 11 30.01 43517670 102.01 2872.80 0.0160 62.7 0.18 11 12 31.41 42958450 105.16 2895.33 0.0160 62.7 0.17 12 13 31.91 30826830 105.34 2929.76 0.0160 62.7 0.17 13 14 31.60 15549740 105.27 2930.45 0.0160 62.7 0.16 14 15 31.84 21843070 102.19 2859.09 0.0160 62.7 0.17 15 16 33.05 73424890 106.85 2892.42 0.0160 62.7 0.17 16 17 32.06 24330740 103.05 2836.16 0.0160 62.7 0.17 17 18 33.10 24785970 106.42 2854.06 0.0160 62.7 0.16 18 19 32.23 28553940 105.17 2875.32 0.0160 62.7 0.15 19 20 31.36 17659080 102.74 2849.49 0.0160 62.7 0.15 20 21 31.09 19508980 106.27 2935.05 0.0160 62.7 0.09 21 22 30.77 14110230 107.63 2951.23 0.0141 65.4 0.18 22 23 31.20 8765498 108.54 2976.08 0.0141 65.4 0.17 23 24 31.47 10027250 108.24 2976.12 0.0141 65.4 0.17 24 25 31.73 10943350 108.86 2937.33 0.0141 65.4 0.17 25 26 32.17 17755740 102.98 2931.77 0.0141 65.4 0.17 26 27 31.47 14238190 99.53 2902.33 0.0141 65.4 0.17 27 28 30.97 12997760 101.08 2887.98 0.0141 65.4 0.17 28 29 30.81 11299240 104.64 2866.19 0.0141 65.4 0.18 29 30 30.72 8102653 105.59 2908.47 0.0141 65.4 0.19 30 31 28.24 24549800 103.21 2896.94 0.0141 65.4 0.18 31 32 28.09 30410530 103.84 2910.04 0.0141 65.4 0.17 32 33 29.11 16807730 104.61 2942.60 0.0141 65.4 0.16 33 34 29.00 13671200 108.65 2965.90 0.0141 65.4 0.13 34 35 28.76 11854290 106.26 2925.30 0.0141 65.4 0.13 35 36 28.75 12383610 104.20 2890.15 0.0141 65.4 0.14 36 37 28.45 11512350 102.99 2862.99 0.0141 65.4 0.15 37 38 29.34 16749990 102.19 2854.24 0.0141 65.4 0.15 38 39 26.84 61009290 100.82 2893.25 0.0141 65.4 0.14 39 40 23.70 123011300 103.42 2958.09 0.0141 65.4 0.14 40 41 23.15 29253590 104.18 2945.84 0.0141 65.4 0.14 41 42 21.71 55998620 102.65 2939.52 0.0141 65.4 0.13 42 43 20.88 44488370 95.64 2920.21 0.0169 61.3 0.14 43 44 20.04 56264460 93.51 2909.77 0.0169 61.3 0.14 44 45 21.09 80626220 108.51 2967.90 0.0169 61.3 0.14 45 46 21.92 27733830 111.55 2989.91 0.0169 61.3 0.14 46 47 20.72 36699380 106.70 3015.86 0.0169 61.3 0.13 47 48 20.72 29514550 104.93 3011.25 0.0169 61.3 0.13 48 49 21.01 15605960 105.23 3018.64 0.0169 61.3 0.13 49 50 21.80 25714310 104.92 3020.86 0.0169 61.3 0.13 50 51 21.60 24904700 104.60 3022.52 0.0169 61.3 0.13 51 52 20.38 38971320 101.76 3016.98 0.0169 61.3 0.13 52 53 21.20 47682050 102.23 3030.93 0.0169 61.3 0.13 53 54 19.87 157188200 103.99 3062.39 0.0169 61.3 0.13 54 55 19.05 129057400 101.36 3076.59 0.0169 61.3 0.13 55 56 20.01 100818300 102.92 3076.21 0.0169 61.3 0.13 56 57 19.15 70483330 105.25 3067.26 0.0169 61.3 0.13 57 58 19.43 49779450 105.71 3073.67 0.0169 61.3 0.13 58 59 19.44 32747000 105.42 3053.40 0.0169 61.3 0.13 59 60 19.40 29588690 105.11 3069.79 0.0169 61.3 0.13 60 61 19.15 20663220 104.67 3073.19 0.0169 61.3 0.13 61 62 19.34 25402980 107.51 3077.14 0.0169 61.3 0.13 62 63 19.10 16071190 109.00 3081.19 0.0169 61.3 0.13 63 64 19.08 30571430 107.37 3048.71 0.0169 61.3 0.14 64 65 18.05 58612440 107.30 3066.96 0.0169 61.3 0.13 65 66 17.72 46177000 107.37 3075.06 0.0199 70.3 0.14 66 67 18.58 60657900 113.28 3069.27 0.0199 70.3 0.16 67 68 18.96 46028860 119.10 3135.81 0.0199 70.3 0.16 68 69 18.98 36325880 119.04 3136.42 0.0199 70.3 0.15 69 70 18.81 24752340 117.80 3104.02 0.0199 70.3 0.15 70 71 19.43 47343020 117.90 3104.53 0.0199 70.3 0.15 71 72 20.93 121399400 119.55 3114.31 0.0199 70.3 0.15 72 73 20.71 64896660 119.47 3155.83 0.0199 70.3 0.15 73 74 22.00 72707430 123.23 3183.95 0.0199 70.3 0.16 74 75 21.52 50593510 121.40 3178.67 0.0199 70.3 0.16 75 76 21.87 36696330 121.43 3177.80 0.0199 70.3 0.16 76 77 23.29 78525460 122.51 3182.62 0.0199 70.3 0.15 77 78 22.59 57115160 122.78 3175.96 0.0199 70.3 0.16 78 79 22.86 51163120 122.84 3179.96 0.0199 70.3 0.15 79 80 20.79 78968380 122.70 3160.78 0.0199 70.3 0.16 80 81 20.28 46169460 119.89 3117.73 0.0199 70.3 0.15 81 82 20.62 38212360 118.00 3093.70 0.0199 70.3 0.16 82 83 20.32 30061050 119.61 3136.60 0.0199 70.3 0.14 83 84 21.66 65415370 120.40 3116.23 0.0199 70.3 0.09 84 85 21.99 51198150 117.94 3113.53 0.0216 73.1 0.15 85 86 22.27 29276680 118.77 3120.04 0.0216 73.1 0.16 86 87 21.83 31940720 121.68 3135.23 0.0216 73.1 0.16 87 88 21.94 46549400 121.98 3149.46 0.0216 73.1 0.15 88 89 20.91 40483780 118.83 3136.19 0.0216 73.1 0.15 89 90 20.40 32190200 117.97 3112.35 0.0216 73.1 0.15 90 91 20.22 27125670 113.07 3065.02 0.0216 73.1 0.16 91 92 19.64 39282420 111.98 3051.78 0.0216 73.1 0.16 92 93 19.75 21803710 113.77 3049.41 0.0216 73.1 0.16 93 94 19.51 18743920 110.41 3044.11 0.0216 73.1 0.16 94 95 19.52 20154860 110.85 3064.18 0.0216 73.1 0.16 95 96 19.48 21816100 111.18 3101.17 0.0216 73.1 0.16 96 97 19.88 44020450 109.42 3104.12 0.0216 73.1 0.15 97 98 18.97 52059860 108.87 3072.87 0.0216 73.1 0.15 98 99 19.00 34769600 106.72 3005.62 0.0216 73.1 0.16 99 100 19.32 32269470 107.28 3016.96 0.0216 73.1 0.15 100 101 19.50 72281000 104.13 2990.46 0.0216 73.1 0.15 101 102 23.22 228364700 107.55 2981.70 0.0216 73.1 0.17 102 103 22.56 76050080 105.72 2986.12 0.0216 73.1 0.16 103 104 21.94 9999999 104.55 2987.95 0.0216 73.1 0.16 104 105 21.11 99311480 106.93 2977.23 0.0216 73.1 0.18 105 106 21.21 37631000 106.85 3020.06 0.0176 73.1 0.17 106 107 21.18 38308550 106.78 2982.13 0.0176 73.1 0.16 107 108 21.25 31752420 107.29 2999.66 0.0176 73.1 0.17 108 109 21.17 29030780 104.14 3011.93 0.0176 73.1 0.16 109 110 20.47 33352920 101.21 2937.29 0.0176 73.1 0.16 110 111 19.99 34106840 96.35 2895.58 0.0176 73.1 0.16 111 112 19.21 42257790 95.62 2904.87 0.0176 73.1 0.16 112 113 20.07 67220540 99.00 2904.26 0.0176 73.1 0.16 113 114 19.86 71524510 99.26 2883.89 0.0176 73.1 0.16 114 115 22.36 229081600 98.77 2846.81 0.0176 73.1 0.16 115 116 22.17 78808770 100.65 2836.94 0.0176 73.1 0.16 116 117 23.56 107091400 103.13 2853.13 0.0176 73.1 0.16 117 118 22.92 84944370 105.53 2916.07 0.0176 73.1 0.16 118 119 23.10 46515660 106.76 2916.68 0.0176 73.1 0.16 119 120 24.32 89720920 107.59 2926.55 0.0176 73.1 0.16 120 121 23.99 29520310 107.62 2966.85 0.0176 73.1 0.16 121 122 25.94 123513900 108.82 2976.78 0.0176 73.1 0.16 122 123 26.15 85687430 107.59 2967.79 0.0176 73.1 0.16 123 124 26.36 49113040 107.85 2991.78 0.0176 73.1 0.16 124 125 27.32 88572990 107.11 3012.03 0.0176 73.1 0.16 125 126 28.00 126867400 108.14 3010.24 0.0176 73.1 0.16 126 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) VOLUME LINKEDIN NASDAQ INF.CONS.CONF 7.547e+01 2.908e-09 3.960e-01 -3.184e-02 -7.938e+02 FED FUNDS.RATE t 1.790e-01 3.944e+01 -5.068e-02 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -4.4823 -1.3666 -0.1849 1.1519 6.1534 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 7.547e+01 1.317e+01 5.730 7.82e-08 *** VOLUME 2.908e-09 5.647e-09 0.515 0.607590 LINKEDIN 3.960e-01 6.054e-02 6.542 1.63e-09 *** NASDAQ -3.184e-02 5.002e-03 -6.366 3.85e-09 *** INF.CONS.CONF -7.938e+02 1.365e+02 -5.817 5.23e-08 *** FED 1.790e-01 1.165e-01 1.537 0.126990 FUNDS.RATE 3.944e+01 1.566e+01 2.518 0.013129 * t -5.068e-02 1.367e-02 -3.709 0.000319 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.122 on 118 degrees of freedom Multiple R-squared: 0.7883, Adjusted R-squared: 0.7757 F-statistic: 62.76 on 7 and 118 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,] 1.154577e-01 2.309153e-01 8.845423e-01 [2,] 4.264674e-02 8.529348e-02 9.573533e-01 [3,] 2.397784e-02 4.795567e-02 9.760222e-01 [4,] 8.747198e-03 1.749440e-02 9.912528e-01 [5,] 5.965125e-03 1.193025e-02 9.940349e-01 [6,] 2.557010e-03 5.114020e-03 9.974430e-01 [7,] 8.776529e-04 1.755306e-03 9.991223e-01 [8,] 5.211282e-04 1.042256e-03 9.994789e-01 [9,] 3.203277e-04 6.406555e-04 9.996797e-01 [10,] 1.445090e-04 2.890180e-04 9.998555e-01 [11,] 2.140795e-04 4.281589e-04 9.997859e-01 [12,] 7.627676e-05 1.525535e-04 9.999237e-01 [13,] 3.002692e-05 6.005384e-05 9.999700e-01 [14,] 1.355581e-05 2.711161e-05 9.999864e-01 [15,] 5.190154e-06 1.038031e-05 9.999948e-01 [16,] 4.438382e-05 8.876765e-05 9.999556e-01 [17,] 3.960042e-05 7.920083e-05 9.999604e-01 [18,] 2.625631e-05 5.251262e-05 9.999737e-01 [19,] 6.786845e-05 1.357369e-04 9.999321e-01 [20,] 1.629623e-04 3.259246e-04 9.998370e-01 [21,] 4.375369e-03 8.750738e-03 9.956246e-01 [22,] 1.687624e-02 3.375248e-02 9.831238e-01 [23,] 2.074845e-02 4.149689e-02 9.792516e-01 [24,] 4.365201e-02 8.730403e-02 9.563480e-01 [25,] 5.342156e-02 1.068431e-01 9.465784e-01 [26,] 5.822647e-02 1.164529e-01 9.417735e-01 [27,] 6.669380e-02 1.333876e-01 9.333062e-01 [28,] 1.243659e-01 2.487318e-01 8.756341e-01 [29,] 2.017816e-01 4.035632e-01 7.982184e-01 [30,] 2.956140e-01 5.912280e-01 7.043860e-01 [31,] 6.901967e-01 6.196066e-01 3.098033e-01 [32,] 8.357073e-01 3.285854e-01 1.642927e-01 [33,] 8.560499e-01 2.879001e-01 1.439501e-01 [34,] 8.769980e-01 2.460040e-01 1.230020e-01 [35,] 9.556265e-01 8.874704e-02 4.437352e-02 [36,] 9.836033e-01 3.279333e-02 1.639666e-02 [37,] 9.829253e-01 3.414939e-02 1.707470e-02 [38,] 9.833702e-01 3.325951e-02 1.662975e-02 [39,] 9.872689e-01 2.546227e-02 1.273113e-02 [40,] 9.952767e-01 9.446560e-03 4.723280e-03 [41,] 9.989670e-01 2.066064e-03 1.033032e-03 [42,] 9.997268e-01 5.463222e-04 2.731611e-04 [43,] 9.999906e-01 1.879228e-05 9.396138e-06 [44,] 9.999917e-01 1.658527e-05 8.292633e-06 [45,] 9.999873e-01 2.544924e-05 1.272462e-05 [46,] 9.999858e-01 2.843050e-05 1.421525e-05 [47,] 9.999808e-01 3.842563e-05 1.921281e-05 [48,] 9.999774e-01 4.524336e-05 2.262168e-05 [49,] 9.999799e-01 4.017370e-05 2.008685e-05 [50,] 9.999799e-01 4.010252e-05 2.005126e-05 [51,] 9.999806e-01 3.884781e-05 1.942391e-05 [52,] 9.999789e-01 4.222980e-05 2.111490e-05 [53,] 9.999776e-01 4.479332e-05 2.239666e-05 [54,] 9.999757e-01 4.851339e-05 2.425669e-05 [55,] 9.999708e-01 5.836407e-05 2.918204e-05 [56,] 9.999957e-01 8.646953e-06 4.323477e-06 [57,] 9.999966e-01 6.793780e-06 3.396890e-06 [58,] 9.999951e-01 9.718330e-06 4.859165e-06 [59,] 9.999916e-01 1.687742e-05 8.438709e-06 [60,] 9.999861e-01 2.789983e-05 1.394991e-05 [61,] 9.999777e-01 4.457433e-05 2.228717e-05 [62,] 9.999690e-01 6.209254e-05 3.104627e-05 [63,] 9.999587e-01 8.262573e-05 4.131286e-05 [64,] 9.999370e-01 1.260978e-04 6.304888e-05 [65,] 9.999131e-01 1.738086e-04 8.690429e-05 [66,] 9.999110e-01 1.779615e-04 8.898077e-05 [67,] 9.999670e-01 6.599174e-05 3.299587e-05 [68,] 9.999710e-01 5.803857e-05 2.901928e-05 [69,] 9.999867e-01 2.655031e-05 1.327516e-05 [70,] 9.999800e-01 4.001747e-05 2.000874e-05 [71,] 9.999640e-01 7.206684e-05 3.603342e-05 [72,] 9.999443e-01 1.114022e-04 5.570109e-05 [73,] 9.999131e-01 1.738220e-04 8.691098e-05 [74,] 9.998863e-01 2.274307e-04 1.137153e-04 [75,] 9.999829e-01 3.423723e-05 1.711861e-05 [76,] 9.999982e-01 3.551640e-06 1.775820e-06 [77,] 9.999978e-01 4.304008e-06 2.152004e-06 [78,] 9.999974e-01 5.244088e-06 2.622044e-06 [79,] 9.999962e-01 7.564580e-06 3.782290e-06 [80,] 9.999930e-01 1.404006e-05 7.020029e-06 [81,] 9.999946e-01 1.073494e-05 5.367470e-06 [82,] 9.999919e-01 1.618244e-05 8.091221e-06 [83,] 9.999845e-01 3.092667e-05 1.546334e-05 [84,] 9.999774e-01 4.526200e-05 2.263100e-05 [85,] 9.999573e-01 8.549041e-05 4.274521e-05 [86,] 9.999294e-01 1.412175e-04 7.060874e-05 [87,] 9.998979e-01 2.042381e-04 1.021190e-04 [88,] 9.999234e-01 1.532311e-04 7.661557e-05 [89,] 9.998869e-01 2.262321e-04 1.131160e-04 [90,] 9.999092e-01 1.815522e-04 9.077611e-05 [91,] 9.999909e-01 1.823683e-05 9.118415e-06 [92,] 9.999829e-01 3.425927e-05 1.712964e-05 [93,] 9.999627e-01 7.453646e-05 3.726823e-05 [94,] 9.999677e-01 6.458821e-05 3.229410e-05 [95,] 9.999028e-01 1.943185e-04 9.715927e-05 [96,] 9.997309e-01 5.381897e-04 2.690949e-04 [97,] 9.994125e-01 1.174997e-03 5.874984e-04 [98,] 9.984027e-01 3.194542e-03 1.597271e-03 [99,] 9.968670e-01 6.265972e-03 3.132986e-03 [100,] 9.984727e-01 3.054619e-03 1.527310e-03 [101,] 9.997005e-01 5.990558e-04 2.995279e-04 [102,] 9.990571e-01 1.885814e-03 9.429070e-04 [103,] 9.994785e-01 1.043023e-03 5.215116e-04 [104,] 9.970624e-01 5.875257e-03 2.937628e-03 [105,] 9.894190e-01 2.116194e-02 1.058097e-02 > postscript(file="/var/wessaorg/rcomp/tmp/15blg1356078939.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/2xa5b1356078939.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/39kca1356078939.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/4ptlb1356078939.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/5oq0y1356078939.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.40411622 -1.98319547 -3.17342129 0.25565981 -0.94313295 -0.40296825 7 8 9 10 11 12 -1.29349665 0.58195727 -1.09820230 -0.55554318 0.43120183 1.74778990 13 14 15 16 17 18 3.35884199 3.58803708 2.41349117 2.73994969 1.65684754 2.37591849 19 20 21 22 23 24 3.11209784 2.46433766 5.93249371 0.11437359 1.43590414 1.87300821 25 26 27 28 29 30 0.70025986 3.32285206 3.11265416 1.59611206 -1.00646604 -0.46077177 31 32 33 34 35 36 -1.96808188 -1.52240484 0.71410063 0.98900345 0.45867237 -0.20002103 37 38 39 40 41 42 -1.22685194 -0.26319097 -0.66200012 -2.89658430 -3.81435391 -4.48234397 43 44 45 46 47 48 -0.50455220 -0.81697454 -3.87678702 -3.34540998 -1.37922073 -0.75343709 49 50 51 52 53 54 -0.25579855 0.74896121 0.78159622 0.51974257 1.62317522 0.33019546 55 56 57 58 59 60 1.13646871 1.59932997 -0.32957295 0.08325024 -0.33715663 0.32740575 61 62 63 64 65 66 0.43657407 -0.33551995 -0.95884620 -1.75344254 -1.81103182 -1.44816547 67 68 69 70 71 72 -3.89339750 -3.60629707 -3.06981837 -3.69611674 -3.11448600 -2.12119176 73 74 75 76 77 78 -0.77237238 -0.44249029 -0.25086818 0.15064110 1.61984094 0.31937770 79 80 81 82 83 84 1.15537381 -1.89450210 -2.12202805 -2.11927054 -0.82764160 1.47066476 85 86 87 88 89 90 1.26283824 1.14145604 0.07559802 0.92251733 0.78582732 -0.06792471 91 92 93 94 95 96 -0.14342999 -0.69801262 -1.27090075 -0.28936623 0.23205792 1.28511574 97 98 99 100 101 102 2.85661182 1.19662939 -0.35678786 0.55487935 1.07291340 1.96751445 103 104 105 106 107 108 3.06101091 3.20540737 0.09364601 -0.96157093 -1.72857404 -1.62698193 109 110 111 112 113 114 0.38428573 -1.49399098 -1.32890313 -1.49697583 -2.01694820 -2.94040847 115 116 117 118 119 120 -1.83457069 -2.59579225 -1.70399926 -1.17518800 -1.30047590 -0.16984662 121 122 123 124 125 126 0.99731069 2.56563006 3.13717151 4.16516576 5.99902058 6.15342183 > postscript(file="/var/wessaorg/rcomp/tmp/6bw8g1356078939.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.40411622 NA 1 -1.98319547 -1.40411622 2 -3.17342129 -1.98319547 3 0.25565981 -3.17342129 4 -0.94313295 0.25565981 5 -0.40296825 -0.94313295 6 -1.29349665 -0.40296825 7 0.58195727 -1.29349665 8 -1.09820230 0.58195727 9 -0.55554318 -1.09820230 10 0.43120183 -0.55554318 11 1.74778990 0.43120183 12 3.35884199 1.74778990 13 3.58803708 3.35884199 14 2.41349117 3.58803708 15 2.73994969 2.41349117 16 1.65684754 2.73994969 17 2.37591849 1.65684754 18 3.11209784 2.37591849 19 2.46433766 3.11209784 20 5.93249371 2.46433766 21 0.11437359 5.93249371 22 1.43590414 0.11437359 23 1.87300821 1.43590414 24 0.70025986 1.87300821 25 3.32285206 0.70025986 26 3.11265416 3.32285206 27 1.59611206 3.11265416 28 -1.00646604 1.59611206 29 -0.46077177 -1.00646604 30 -1.96808188 -0.46077177 31 -1.52240484 -1.96808188 32 0.71410063 -1.52240484 33 0.98900345 0.71410063 34 0.45867237 0.98900345 35 -0.20002103 0.45867237 36 -1.22685194 -0.20002103 37 -0.26319097 -1.22685194 38 -0.66200012 -0.26319097 39 -2.89658430 -0.66200012 40 -3.81435391 -2.89658430 41 -4.48234397 -3.81435391 42 -0.50455220 -4.48234397 43 -0.81697454 -0.50455220 44 -3.87678702 -0.81697454 45 -3.34540998 -3.87678702 46 -1.37922073 -3.34540998 47 -0.75343709 -1.37922073 48 -0.25579855 -0.75343709 49 0.74896121 -0.25579855 50 0.78159622 0.74896121 51 0.51974257 0.78159622 52 1.62317522 0.51974257 53 0.33019546 1.62317522 54 1.13646871 0.33019546 55 1.59932997 1.13646871 56 -0.32957295 1.59932997 57 0.08325024 -0.32957295 58 -0.33715663 0.08325024 59 0.32740575 -0.33715663 60 0.43657407 0.32740575 61 -0.33551995 0.43657407 62 -0.95884620 -0.33551995 63 -1.75344254 -0.95884620 64 -1.81103182 -1.75344254 65 -1.44816547 -1.81103182 66 -3.89339750 -1.44816547 67 -3.60629707 -3.89339750 68 -3.06981837 -3.60629707 69 -3.69611674 -3.06981837 70 -3.11448600 -3.69611674 71 -2.12119176 -3.11448600 72 -0.77237238 -2.12119176 73 -0.44249029 -0.77237238 74 -0.25086818 -0.44249029 75 0.15064110 -0.25086818 76 1.61984094 0.15064110 77 0.31937770 1.61984094 78 1.15537381 0.31937770 79 -1.89450210 1.15537381 80 -2.12202805 -1.89450210 81 -2.11927054 -2.12202805 82 -0.82764160 -2.11927054 83 1.47066476 -0.82764160 84 1.26283824 1.47066476 85 1.14145604 1.26283824 86 0.07559802 1.14145604 87 0.92251733 0.07559802 88 0.78582732 0.92251733 89 -0.06792471 0.78582732 90 -0.14342999 -0.06792471 91 -0.69801262 -0.14342999 92 -1.27090075 -0.69801262 93 -0.28936623 -1.27090075 94 0.23205792 -0.28936623 95 1.28511574 0.23205792 96 2.85661182 1.28511574 97 1.19662939 2.85661182 98 -0.35678786 1.19662939 99 0.55487935 -0.35678786 100 1.07291340 0.55487935 101 1.96751445 1.07291340 102 3.06101091 1.96751445 103 3.20540737 3.06101091 104 0.09364601 3.20540737 105 -0.96157093 0.09364601 106 -1.72857404 -0.96157093 107 -1.62698193 -1.72857404 108 0.38428573 -1.62698193 109 -1.49399098 0.38428573 110 -1.32890313 -1.49399098 111 -1.49697583 -1.32890313 112 -2.01694820 -1.49697583 113 -2.94040847 -2.01694820 114 -1.83457069 -2.94040847 115 -2.59579225 -1.83457069 116 -1.70399926 -2.59579225 117 -1.17518800 -1.70399926 118 -1.30047590 -1.17518800 119 -0.16984662 -1.30047590 120 0.99731069 -0.16984662 121 2.56563006 0.99731069 122 3.13717151 2.56563006 123 4.16516576 3.13717151 124 5.99902058 4.16516576 125 6.15342183 5.99902058 126 NA 6.15342183 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.98319547 -1.40411622 [2,] -3.17342129 -1.98319547 [3,] 0.25565981 -3.17342129 [4,] -0.94313295 0.25565981 [5,] -0.40296825 -0.94313295 [6,] -1.29349665 -0.40296825 [7,] 0.58195727 -1.29349665 [8,] -1.09820230 0.58195727 [9,] -0.55554318 -1.09820230 [10,] 0.43120183 -0.55554318 [11,] 1.74778990 0.43120183 [12,] 3.35884199 1.74778990 [13,] 3.58803708 3.35884199 [14,] 2.41349117 3.58803708 [15,] 2.73994969 2.41349117 [16,] 1.65684754 2.73994969 [17,] 2.37591849 1.65684754 [18,] 3.11209784 2.37591849 [19,] 2.46433766 3.11209784 [20,] 5.93249371 2.46433766 [21,] 0.11437359 5.93249371 [22,] 1.43590414 0.11437359 [23,] 1.87300821 1.43590414 [24,] 0.70025986 1.87300821 [25,] 3.32285206 0.70025986 [26,] 3.11265416 3.32285206 [27,] 1.59611206 3.11265416 [28,] -1.00646604 1.59611206 [29,] -0.46077177 -1.00646604 [30,] -1.96808188 -0.46077177 [31,] -1.52240484 -1.96808188 [32,] 0.71410063 -1.52240484 [33,] 0.98900345 0.71410063 [34,] 0.45867237 0.98900345 [35,] -0.20002103 0.45867237 [36,] -1.22685194 -0.20002103 [37,] -0.26319097 -1.22685194 [38,] -0.66200012 -0.26319097 [39,] -2.89658430 -0.66200012 [40,] -3.81435391 -2.89658430 [41,] -4.48234397 -3.81435391 [42,] -0.50455220 -4.48234397 [43,] -0.81697454 -0.50455220 [44,] -3.87678702 -0.81697454 [45,] -3.34540998 -3.87678702 [46,] -1.37922073 -3.34540998 [47,] -0.75343709 -1.37922073 [48,] -0.25579855 -0.75343709 [49,] 0.74896121 -0.25579855 [50,] 0.78159622 0.74896121 [51,] 0.51974257 0.78159622 [52,] 1.62317522 0.51974257 [53,] 0.33019546 1.62317522 [54,] 1.13646871 0.33019546 [55,] 1.59932997 1.13646871 [56,] -0.32957295 1.59932997 [57,] 0.08325024 -0.32957295 [58,] -0.33715663 0.08325024 [59,] 0.32740575 -0.33715663 [60,] 0.43657407 0.32740575 [61,] -0.33551995 0.43657407 [62,] -0.95884620 -0.33551995 [63,] -1.75344254 -0.95884620 [64,] -1.81103182 -1.75344254 [65,] -1.44816547 -1.81103182 [66,] -3.89339750 -1.44816547 [67,] -3.60629707 -3.89339750 [68,] -3.06981837 -3.60629707 [69,] -3.69611674 -3.06981837 [70,] -3.11448600 -3.69611674 [71,] -2.12119176 -3.11448600 [72,] -0.77237238 -2.12119176 [73,] -0.44249029 -0.77237238 [74,] -0.25086818 -0.44249029 [75,] 0.15064110 -0.25086818 [76,] 1.61984094 0.15064110 [77,] 0.31937770 1.61984094 [78,] 1.15537381 0.31937770 [79,] -1.89450210 1.15537381 [80,] -2.12202805 -1.89450210 [81,] -2.11927054 -2.12202805 [82,] -0.82764160 -2.11927054 [83,] 1.47066476 -0.82764160 [84,] 1.26283824 1.47066476 [85,] 1.14145604 1.26283824 [86,] 0.07559802 1.14145604 [87,] 0.92251733 0.07559802 [88,] 0.78582732 0.92251733 [89,] -0.06792471 0.78582732 [90,] -0.14342999 -0.06792471 [91,] -0.69801262 -0.14342999 [92,] -1.27090075 -0.69801262 [93,] -0.28936623 -1.27090075 [94,] 0.23205792 -0.28936623 [95,] 1.28511574 0.23205792 [96,] 2.85661182 1.28511574 [97,] 1.19662939 2.85661182 [98,] -0.35678786 1.19662939 [99,] 0.55487935 -0.35678786 [100,] 1.07291340 0.55487935 [101,] 1.96751445 1.07291340 [102,] 3.06101091 1.96751445 [103,] 3.20540737 3.06101091 [104,] 0.09364601 3.20540737 [105,] -0.96157093 0.09364601 [106,] -1.72857404 -0.96157093 [107,] -1.62698193 -1.72857404 [108,] 0.38428573 -1.62698193 [109,] -1.49399098 0.38428573 [110,] -1.32890313 -1.49399098 [111,] -1.49697583 -1.32890313 [112,] -2.01694820 -1.49697583 [113,] -2.94040847 -2.01694820 [114,] -1.83457069 -2.94040847 [115,] -2.59579225 -1.83457069 [116,] -1.70399926 -2.59579225 [117,] -1.17518800 -1.70399926 [118,] -1.30047590 -1.17518800 [119,] -0.16984662 -1.30047590 [120,] 0.99731069 -0.16984662 [121,] 2.56563006 0.99731069 [122,] 3.13717151 2.56563006 [123,] 4.16516576 3.13717151 [124,] 5.99902058 4.16516576 [125,] 6.15342183 5.99902058 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.98319547 -1.40411622 2 -3.17342129 -1.98319547 3 0.25565981 -3.17342129 4 -0.94313295 0.25565981 5 -0.40296825 -0.94313295 6 -1.29349665 -0.40296825 7 0.58195727 -1.29349665 8 -1.09820230 0.58195727 9 -0.55554318 -1.09820230 10 0.43120183 -0.55554318 11 1.74778990 0.43120183 12 3.35884199 1.74778990 13 3.58803708 3.35884199 14 2.41349117 3.58803708 15 2.73994969 2.41349117 16 1.65684754 2.73994969 17 2.37591849 1.65684754 18 3.11209784 2.37591849 19 2.46433766 3.11209784 20 5.93249371 2.46433766 21 0.11437359 5.93249371 22 1.43590414 0.11437359 23 1.87300821 1.43590414 24 0.70025986 1.87300821 25 3.32285206 0.70025986 26 3.11265416 3.32285206 27 1.59611206 3.11265416 28 -1.00646604 1.59611206 29 -0.46077177 -1.00646604 30 -1.96808188 -0.46077177 31 -1.52240484 -1.96808188 32 0.71410063 -1.52240484 33 0.98900345 0.71410063 34 0.45867237 0.98900345 35 -0.20002103 0.45867237 36 -1.22685194 -0.20002103 37 -0.26319097 -1.22685194 38 -0.66200012 -0.26319097 39 -2.89658430 -0.66200012 40 -3.81435391 -2.89658430 41 -4.48234397 -3.81435391 42 -0.50455220 -4.48234397 43 -0.81697454 -0.50455220 44 -3.87678702 -0.81697454 45 -3.34540998 -3.87678702 46 -1.37922073 -3.34540998 47 -0.75343709 -1.37922073 48 -0.25579855 -0.75343709 49 0.74896121 -0.25579855 50 0.78159622 0.74896121 51 0.51974257 0.78159622 52 1.62317522 0.51974257 53 0.33019546 1.62317522 54 1.13646871 0.33019546 55 1.59932997 1.13646871 56 -0.32957295 1.59932997 57 0.08325024 -0.32957295 58 -0.33715663 0.08325024 59 0.32740575 -0.33715663 60 0.43657407 0.32740575 61 -0.33551995 0.43657407 62 -0.95884620 -0.33551995 63 -1.75344254 -0.95884620 64 -1.81103182 -1.75344254 65 -1.44816547 -1.81103182 66 -3.89339750 -1.44816547 67 -3.60629707 -3.89339750 68 -3.06981837 -3.60629707 69 -3.69611674 -3.06981837 70 -3.11448600 -3.69611674 71 -2.12119176 -3.11448600 72 -0.77237238 -2.12119176 73 -0.44249029 -0.77237238 74 -0.25086818 -0.44249029 75 0.15064110 -0.25086818 76 1.61984094 0.15064110 77 0.31937770 1.61984094 78 1.15537381 0.31937770 79 -1.89450210 1.15537381 80 -2.12202805 -1.89450210 81 -2.11927054 -2.12202805 82 -0.82764160 -2.11927054 83 1.47066476 -0.82764160 84 1.26283824 1.47066476 85 1.14145604 1.26283824 86 0.07559802 1.14145604 87 0.92251733 0.07559802 88 0.78582732 0.92251733 89 -0.06792471 0.78582732 90 -0.14342999 -0.06792471 91 -0.69801262 -0.14342999 92 -1.27090075 -0.69801262 93 -0.28936623 -1.27090075 94 0.23205792 -0.28936623 95 1.28511574 0.23205792 96 2.85661182 1.28511574 97 1.19662939 2.85661182 98 -0.35678786 1.19662939 99 0.55487935 -0.35678786 100 1.07291340 0.55487935 101 1.96751445 1.07291340 102 3.06101091 1.96751445 103 3.20540737 3.06101091 104 0.09364601 3.20540737 105 -0.96157093 0.09364601 106 -1.72857404 -0.96157093 107 -1.62698193 -1.72857404 108 0.38428573 -1.62698193 109 -1.49399098 0.38428573 110 -1.32890313 -1.49399098 111 -1.49697583 -1.32890313 112 -2.01694820 -1.49697583 113 -2.94040847 -2.01694820 114 -1.83457069 -2.94040847 115 -2.59579225 -1.83457069 116 -1.70399926 -2.59579225 117 -1.17518800 -1.70399926 118 -1.30047590 -1.17518800 119 -0.16984662 -1.30047590 120 0.99731069 -0.16984662 121 2.56563006 0.99731069 122 3.13717151 2.56563006 123 4.16516576 3.13717151 124 5.99902058 4.16516576 125 6.15342183 5.99902058 > 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/79b8v1356078939.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/832kn1356078939.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/90hnn1356078939.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/10d71x1356078939.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/117z5i1356078939.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/1230sx1356078939.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/13638v1356078939.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/14guy11356078939.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/15lot91356078939.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/1618v91356078939.tab") + } > > try(system("convert tmp/15blg1356078939.ps tmp/15blg1356078939.png",intern=TRUE)) character(0) > try(system("convert tmp/2xa5b1356078939.ps tmp/2xa5b1356078939.png",intern=TRUE)) character(0) > try(system("convert tmp/39kca1356078939.ps tmp/39kca1356078939.png",intern=TRUE)) character(0) > try(system("convert tmp/4ptlb1356078939.ps tmp/4ptlb1356078939.png",intern=TRUE)) character(0) > try(system("convert tmp/5oq0y1356078939.ps tmp/5oq0y1356078939.png",intern=TRUE)) character(0) > try(system("convert tmp/6bw8g1356078939.ps tmp/6bw8g1356078939.png",intern=TRUE)) character(0) > try(system("convert tmp/79b8v1356078939.ps tmp/79b8v1356078939.png",intern=TRUE)) character(0) > try(system("convert tmp/832kn1356078939.ps tmp/832kn1356078939.png",intern=TRUE)) character(0) > try(system("convert tmp/90hnn1356078939.ps tmp/90hnn1356078939.png",intern=TRUE)) character(0) > try(system("convert tmp/10d71x1356078939.ps tmp/10d71x1356078939.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.248 1.159 8.514