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 + ,26.90 + ,35204750 + ,91.09 + ,2760.01 + ,0.016 + ,62.7 + ,25.86 + ,42367740 + ,93.00 + ,2778.11 + ,0.016 + ,62.7 + ,26.81 + ,61427940 + ,93.08 + ,2844.72 + ,0.016 + ,62.7 + ,26.31 + ,26132090 + ,94.13 + ,2831.02 + ,0.016 + ,62.7 + ,27.10 + ,3799718 + ,96.26 + ,2858.42 + ,0.016 + ,62.7 + ,27.00 + ,28202230 + ,94.29 + ,2809.73 + ,0.016 + ,62.7 + ,27.40 + ,15809640 + ,94.46 + ,2843.07 + ,0.016 + ,62.7 + ,27.27 + ,17110160 + ,95.53 + ,2818.61 + ,0.016 + ,62.7 + ,28.29 + ,16835510 + ,98.29 + ,2836.33 + ,0.016 + ,62.7 + ,30.01 + ,43517670 + ,102.01 + ,2872.80 + ,0.016 + ,62.7 + ,31.41 + ,42958450 + ,105.16 + ,2895.33 + ,0.016 + ,62.7 + ,31.91 + ,30826830 + ,105.34 + ,2929.76 + ,0.016 + ,62.7 + ,31.60 + ,15549740 + ,105.27 + ,2930.45 + ,0.016 + ,62.7 + ,31.84 + ,21843070 + ,102.19 + ,2859.09 + ,0.016 + ,62.7 + ,33.05 + ,73424890 + ,106.85 + ,2892.42 + ,0.016 + ,62.7 + ,32.06 + ,24330740 + ,103.05 + ,2836.16 + ,0.016 + ,62.7 + ,33.10 + ,24785970 + ,106.42 + ,2854.06 + ,0.016 + ,62.7 + ,32.23 + ,28553940 + ,105.17 + ,2875.32 + ,0.016 + ,62.7 + ,31.36 + ,17659080 + ,102.74 + ,2849.49 + ,0.016 + ,62.7 + ,31.09 + ,19508980 + ,106.27 + ,2935.05 + ,0.016 + ,62.7 + ,30.77 + ,14110230 + ,107.63 + ,2951.23 + ,0.0141 + ,65.4 + ,31.20 + ,8765498 + ,108.54 + ,2976.08 + ,0.0141 + ,65.4 + ,31.47 + ,10027250 + ,108.24 + ,2976.12 + ,0.0141 + ,65.4 + ,31.73 + ,10943350 + ,108.86 + ,2937.33 + ,0.0141 + ,65.4 + ,32.17 + ,17755740 + ,102.98 + ,2931.77 + ,0.0141 + ,65.4 + ,31.47 + ,14238190 + ,99.53 + ,2902.33 + ,0.0141 + ,65.4 + ,30.97 + ,12997760 + ,101.08 + ,2887.98 + ,0.0141 + ,65.4 + ,30.81 + ,11299240 + ,104.64 + ,2866.19 + ,0.0141 + ,65.4 + ,30.72 + ,8102653 + ,105.59 + ,2908.47 + ,0.0141 + ,65.4 + ,28.24 + ,24549800 + ,103.21 + ,2896.94 + ,0.0141 + ,65.4 + ,28.09 + ,30410530 + ,103.84 + ,2910.04 + ,0.0141 + ,65.4 + ,29.11 + ,16807730 + ,104.61 + ,2942.60 + ,0.0141 + ,65.4 + ,29.00 + ,13671200 + ,108.65 + ,2965.90 + ,0.0141 + ,65.4 + ,28.76 + ,11854290 + ,106.26 + ,2925.30 + ,0.0141 + ,65.4 + ,28.75 + ,12383610 + ,104.20 + ,2890.15 + ,0.0141 + ,65.4 + ,28.45 + ,11512350 + ,102.99 + ,2862.99 + ,0.0141 + ,65.4 + ,29.34 + ,16749990 + ,102.19 + ,2854.24 + ,0.0141 + ,65.4 + ,26.84 + ,61009290 + ,100.82 + ,2893.25 + ,0.0141 + ,65.4 + ,23.70 + ,123011300 + ,103.42 + ,2958.09 + ,0.0141 + ,65.4 + ,23.15 + ,29253590 + ,104.18 + ,2945.84 + ,0.0141 + ,65.4 + ,21.71 + ,55998620 + ,102.65 + ,2939.52 + ,0.0141 + ,65.4 + ,20.88 + ,44488370 + ,95.64 + ,2920.21 + ,0.0169 + ,61.3 + ,20.04 + ,56264460 + ,93.51 + ,2909.77 + ,0.0169 + ,61.3 + ,21.09 + ,80626220 + ,108.51 + ,2967.90 + ,0.0169 + ,61.3 + ,21.92 + ,27733830 + ,111.55 + ,2989.91 + ,0.0169 + ,61.3 + ,20.72 + ,36699380 + ,106.70 + ,3015.86 + ,0.0169 + ,61.3 + ,20.72 + ,29514550 + ,104.93 + ,3011.25 + ,0.0169 + ,61.3 + ,21.01 + ,15605960 + ,105.23 + ,3018.64 + ,0.0169 + ,61.3 + ,21.80 + ,25714310 + ,104.92 + ,3020.86 + ,0.0169 + ,61.3 + ,21.60 + ,24904700 + ,104.60 + ,3022.52 + ,0.0169 + ,61.3 + ,20.38 + ,38971320 + ,101.76 + ,3016.98 + ,0.0169 + ,61.3 + ,21.20 + ,47682050 + ,102.23 + ,3030.93 + ,0.0169 + ,61.3 + ,19.87 + ,157188200 + ,103.99 + ,3062.39 + ,0.0169 + ,61.3 + ,19.05 + ,129057400 + ,101.36 + ,3076.59 + ,0.0169 + ,61.3 + ,20.01 + ,100818300 + ,102.92 + ,3076.21 + ,0.0169 + ,61.3 + ,19.15 + ,70483330 + ,105.25 + ,3067.26 + ,0.0169 + ,61.3 + ,19.43 + ,49779450 + ,105.71 + ,3073.67 + ,0.0169 + ,61.3 + ,19.44 + ,32747000 + ,105.42 + ,3053.40 + ,0.0169 + ,61.3 + ,19.40 + ,29588690 + ,105.11 + ,3069.79 + ,0.0169 + ,61.3 + ,19.15 + ,20663220 + ,104.67 + ,3073.19 + ,0.0169 + ,61.3 + ,19.34 + ,25402980 + ,107.51 + ,3077.14 + ,0.0169 + ,61.3 + ,19.10 + ,16071190 + ,109.00 + ,3081.19 + ,0.0169 + ,61.3 + ,19.08 + ,30571430 + ,107.37 + ,3048.71 + ,0.0169 + ,61.3 + ,18.05 + ,58612440 + ,107.30 + ,3066.96 + ,0.0169 + ,61.3 + ,17.72 + ,46177000 + ,107.37 + ,3075.06 + ,0.0199 + ,70.3 + ,18.58 + ,60657900 + ,113.28 + ,3069.27 + ,0.0199 + ,70.3 + ,18.96 + ,46028860 + ,119.10 + ,3135.81 + ,0.0199 + ,70.3 + ,18.98 + ,36325880 + ,119.04 + ,3136.42 + ,0.0199 + ,70.3 + ,18.81 + ,24752340 + ,117.80 + ,3104.02 + ,0.0199 + ,70.3 + ,19.43 + ,47343020 + ,117.90 + ,3104.53 + ,0.0199 + ,70.3 + ,20.93 + ,121399400 + ,119.55 + ,3114.31 + ,0.0199 + ,70.3 + ,20.71 + ,64896660 + ,119.47 + ,3155.83 + ,0.0199 + ,70.3 + ,22.00 + ,72707430 + ,123.23 + ,3183.95 + ,0.0199 + ,70.3 + ,21.52 + ,50593510 + ,121.40 + ,3178.67 + ,0.0199 + ,70.3 + ,21.87 + ,36696330 + ,121.43 + ,3177.80 + ,0.0199 + ,70.3 + ,23.29 + ,78525460 + ,122.51 + ,3182.62 + ,0.0199 + ,70.3 + ,22.59 + ,57115160 + ,122.78 + ,3175.96 + ,0.0199 + ,70.3 + ,22.86 + ,51163120 + ,122.84 + ,3179.96 + ,0.0199 + ,70.3 + ,20.79 + ,78968380 + ,122.70 + ,3160.78 + ,0.0199 + ,70.3 + ,20.28 + ,46169460 + ,119.89 + ,3117.73 + ,0.0199 + ,70.3 + ,20.62 + ,38212360 + ,118.00 + ,3093.70 + ,0.0199 + ,70.3 + ,20.32 + ,30061050 + ,119.61 + ,3136.60 + ,0.0199 + ,70.3 + ,21.66 + ,65415370 + ,120.40 + ,3116.23 + ,0.0199 + ,70.3 + ,21.99 + ,51198150 + ,117.94 + ,3113.53 + ,0.0216 + ,73.1 + ,22.27 + ,29276680 + ,118.77 + ,3120.04 + ,0.0216 + ,73.1 + ,21.83 + ,31940720 + ,121.68 + ,3135.23 + ,0.0216 + ,73.1 + ,21.94 + ,46549400 + ,121.98 + ,3149.46 + ,0.0216 + ,73.1 + ,20.91 + ,40483780 + ,118.83 + ,3136.19 + ,0.0216 + ,73.1 + ,20.40 + ,32190200 + ,117.97 + ,3112.35 + ,0.0216 + ,73.1 + ,20.22 + ,27125670 + ,113.07 + ,3065.02 + ,0.0216 + ,73.1 + ,19.64 + ,39282420 + ,111.98 + ,3051.78 + ,0.0216 + ,73.1 + ,19.75 + ,21803710 + ,113.77 + ,3049.41 + ,0.0216 + ,73.1 + ,19.51 + ,18743920 + ,110.41 + ,3044.11 + ,0.0216 + ,73.1 + ,19.52 + ,20154860 + ,110.85 + ,3064.18 + ,0.0216 + ,73.1 + ,19.48 + ,21816100 + ,111.18 + ,3101.17 + ,0.0216 + ,73.1 + ,19.88 + ,44020450 + ,109.42 + ,3104.12 + ,0.0216 + ,73.1 + ,18.97 + ,52059860 + ,108.87 + ,3072.87 + ,0.0216 + ,73.1 + ,19.00 + ,34769600 + ,106.72 + ,3005.62 + ,0.0216 + ,73.1 + ,19.32 + ,32269470 + ,107.28 + ,3016.96 + ,0.0216 + ,73.1 + ,19.50 + ,72281000 + ,104.13 + ,2990.46 + ,0.0216 + ,73.1 + ,23.22 + ,228364700 + ,107.55 + ,2981.70 + ,0.0216 + ,73.1 + ,22.56 + ,76050080 + ,105.72 + ,2986.12 + ,0.0216 + ,73.1 + ,21.94 + ,9999999 + ,104.55 + ,2987.95 + ,0.0216 + ,73.1 + ,21.11 + ,99311480 + ,106.93 + ,2977.23 + ,0.0216 + ,73.1 + ,21.21 + ,37631000 + ,106.85 + ,3020.06 + ,0.0176 + ,73.1 + ,21.18 + ,38308550 + ,106.78 + ,2982.13 + ,0.0176 + ,73.1 + ,21.25 + ,31752420 + ,107.29 + ,2999.66 + ,0.0176 + ,73.1 + ,21.17 + ,29030780 + ,104.14 + ,3011.93 + ,0.0176 + ,73.1 + ,20.47 + ,33352920 + ,101.21 + ,2937.29 + ,0.0176 + ,73.1 + ,19.99 + ,34106840 + ,96.35 + ,2895.58 + ,0.0176 + ,73.1 + ,19.21 + ,42257790 + ,95.62 + ,2904.87 + ,0.0176 + ,73.1 + ,20.07 + ,67220540 + ,99.00 + ,2904.26 + ,0.0176 + ,73.1 + ,19.86 + ,71524510 + ,99.26 + ,2883.89 + ,0.0176 + ,73.1 + ,22.36 + ,229081600 + ,98.77 + ,2846.81 + ,0.0176 + ,73.1 + ,22.17 + ,78808770 + ,100.65 + ,2836.94 + ,0.0176 + ,73.1 + ,23.56 + ,107091400 + ,103.13 + ,2853.13 + ,0.0176 + ,73.1 + ,22.92 + ,84944370 + ,105.53 + ,2916.07 + ,0.0176 + ,73.1 + ,23.10 + ,46515660 + ,106.76 + ,2916.68 + ,0.0176 + ,73.1 + ,24.32 + ,89720920 + ,107.59 + ,2926.55 + ,0.0176 + ,73.1 + ,23.99 + ,29520310 + ,107.62 + ,2966.85 + ,0.0176 + ,73.1 + ,25.94 + ,123513900 + ,108.82 + ,2976.78 + ,0.0176 + ,73.1 + ,26.15 + ,85687430 + ,107.59 + ,2967.79 + ,0.0176 + ,73.1 + ,26.36 + ,49113040 + ,107.85 + ,2991.78 + ,0.0176 + ,73.1 + ,27.32 + ,88572990 + ,107.11 + ,3012.03 + ,0.0176 + ,73.1 + ,28.00 + ,126867400 + ,108.14 + ,3010.24 + ,0.0176 + ,73.1) + ,dim=c(6 + ,126) + ,dimnames=list(c('FACEBOOK' + ,'VOLUME' + ,'LINKEDIN' + ,'NASDAQ' + ,'INF' + ,'CONS.CONF') + ,1:126)) > y <- array(NA,dim=c(6,126),dimnames=list(c('FACEBOOK','VOLUME','LINKEDIN','NASDAQ','INF','CONS.CONF'),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 t 1 27.72 41837160 91.51 2747.48 0.0160 62.7 1 2 26.90 35204750 91.09 2760.01 0.0160 62.7 2 3 25.86 42367740 93.00 2778.11 0.0160 62.7 3 4 26.81 61427940 93.08 2844.72 0.0160 62.7 4 5 26.31 26132090 94.13 2831.02 0.0160 62.7 5 6 27.10 3799718 96.26 2858.42 0.0160 62.7 6 7 27.00 28202230 94.29 2809.73 0.0160 62.7 7 8 27.40 15809640 94.46 2843.07 0.0160 62.7 8 9 27.27 17110160 95.53 2818.61 0.0160 62.7 9 10 28.29 16835510 98.29 2836.33 0.0160 62.7 10 11 30.01 43517670 102.01 2872.80 0.0160 62.7 11 12 31.41 42958450 105.16 2895.33 0.0160 62.7 12 13 31.91 30826830 105.34 2929.76 0.0160 62.7 13 14 31.60 15549740 105.27 2930.45 0.0160 62.7 14 15 31.84 21843070 102.19 2859.09 0.0160 62.7 15 16 33.05 73424890 106.85 2892.42 0.0160 62.7 16 17 32.06 24330740 103.05 2836.16 0.0160 62.7 17 18 33.10 24785970 106.42 2854.06 0.0160 62.7 18 19 32.23 28553940 105.17 2875.32 0.0160 62.7 19 20 31.36 17659080 102.74 2849.49 0.0160 62.7 20 21 31.09 19508980 106.27 2935.05 0.0160 62.7 21 22 30.77 14110230 107.63 2951.23 0.0141 65.4 22 23 31.20 8765498 108.54 2976.08 0.0141 65.4 23 24 31.47 10027250 108.24 2976.12 0.0141 65.4 24 25 31.73 10943350 108.86 2937.33 0.0141 65.4 25 26 32.17 17755740 102.98 2931.77 0.0141 65.4 26 27 31.47 14238190 99.53 2902.33 0.0141 65.4 27 28 30.97 12997760 101.08 2887.98 0.0141 65.4 28 29 30.81 11299240 104.64 2866.19 0.0141 65.4 29 30 30.72 8102653 105.59 2908.47 0.0141 65.4 30 31 28.24 24549800 103.21 2896.94 0.0141 65.4 31 32 28.09 30410530 103.84 2910.04 0.0141 65.4 32 33 29.11 16807730 104.61 2942.60 0.0141 65.4 33 34 29.00 13671200 108.65 2965.90 0.0141 65.4 34 35 28.76 11854290 106.26 2925.30 0.0141 65.4 35 36 28.75 12383610 104.20 2890.15 0.0141 65.4 36 37 28.45 11512350 102.99 2862.99 0.0141 65.4 37 38 29.34 16749990 102.19 2854.24 0.0141 65.4 38 39 26.84 61009290 100.82 2893.25 0.0141 65.4 39 40 23.70 123011300 103.42 2958.09 0.0141 65.4 40 41 23.15 29253590 104.18 2945.84 0.0141 65.4 41 42 21.71 55998620 102.65 2939.52 0.0141 65.4 42 43 20.88 44488370 95.64 2920.21 0.0169 61.3 43 44 20.04 56264460 93.51 2909.77 0.0169 61.3 44 45 21.09 80626220 108.51 2967.90 0.0169 61.3 45 46 21.92 27733830 111.55 2989.91 0.0169 61.3 46 47 20.72 36699380 106.70 3015.86 0.0169 61.3 47 48 20.72 29514550 104.93 3011.25 0.0169 61.3 48 49 21.01 15605960 105.23 3018.64 0.0169 61.3 49 50 21.80 25714310 104.92 3020.86 0.0169 61.3 50 51 21.60 24904700 104.60 3022.52 0.0169 61.3 51 52 20.38 38971320 101.76 3016.98 0.0169 61.3 52 53 21.20 47682050 102.23 3030.93 0.0169 61.3 53 54 19.87 157188200 103.99 3062.39 0.0169 61.3 54 55 19.05 129057400 101.36 3076.59 0.0169 61.3 55 56 20.01 100818300 102.92 3076.21 0.0169 61.3 56 57 19.15 70483330 105.25 3067.26 0.0169 61.3 57 58 19.43 49779450 105.71 3073.67 0.0169 61.3 58 59 19.44 32747000 105.42 3053.40 0.0169 61.3 59 60 19.40 29588690 105.11 3069.79 0.0169 61.3 60 61 19.15 20663220 104.67 3073.19 0.0169 61.3 61 62 19.34 25402980 107.51 3077.14 0.0169 61.3 62 63 19.10 16071190 109.00 3081.19 0.0169 61.3 63 64 19.08 30571430 107.37 3048.71 0.0169 61.3 64 65 18.05 58612440 107.30 3066.96 0.0169 61.3 65 66 17.72 46177000 107.37 3075.06 0.0199 70.3 66 67 18.58 60657900 113.28 3069.27 0.0199 70.3 67 68 18.96 46028860 119.10 3135.81 0.0199 70.3 68 69 18.98 36325880 119.04 3136.42 0.0199 70.3 69 70 18.81 24752340 117.80 3104.02 0.0199 70.3 70 71 19.43 47343020 117.90 3104.53 0.0199 70.3 71 72 20.93 121399400 119.55 3114.31 0.0199 70.3 72 73 20.71 64896660 119.47 3155.83 0.0199 70.3 73 74 22.00 72707430 123.23 3183.95 0.0199 70.3 74 75 21.52 50593510 121.40 3178.67 0.0199 70.3 75 76 21.87 36696330 121.43 3177.80 0.0199 70.3 76 77 23.29 78525460 122.51 3182.62 0.0199 70.3 77 78 22.59 57115160 122.78 3175.96 0.0199 70.3 78 79 22.86 51163120 122.84 3179.96 0.0199 70.3 79 80 20.79 78968380 122.70 3160.78 0.0199 70.3 80 81 20.28 46169460 119.89 3117.73 0.0199 70.3 81 82 20.62 38212360 118.00 3093.70 0.0199 70.3 82 83 20.32 30061050 119.61 3136.60 0.0199 70.3 83 84 21.66 65415370 120.40 3116.23 0.0199 70.3 84 85 21.99 51198150 117.94 3113.53 0.0216 73.1 85 86 22.27 29276680 118.77 3120.04 0.0216 73.1 86 87 21.83 31940720 121.68 3135.23 0.0216 73.1 87 88 21.94 46549400 121.98 3149.46 0.0216 73.1 88 89 20.91 40483780 118.83 3136.19 0.0216 73.1 89 90 20.40 32190200 117.97 3112.35 0.0216 73.1 90 91 20.22 27125670 113.07 3065.02 0.0216 73.1 91 92 19.64 39282420 111.98 3051.78 0.0216 73.1 92 93 19.75 21803710 113.77 3049.41 0.0216 73.1 93 94 19.51 18743920 110.41 3044.11 0.0216 73.1 94 95 19.52 20154860 110.85 3064.18 0.0216 73.1 95 96 19.48 21816100 111.18 3101.17 0.0216 73.1 96 97 19.88 44020450 109.42 3104.12 0.0216 73.1 97 98 18.97 52059860 108.87 3072.87 0.0216 73.1 98 99 19.00 34769600 106.72 3005.62 0.0216 73.1 99 100 19.32 32269470 107.28 3016.96 0.0216 73.1 100 101 19.50 72281000 104.13 2990.46 0.0216 73.1 101 102 23.22 228364700 107.55 2981.70 0.0216 73.1 102 103 22.56 76050080 105.72 2986.12 0.0216 73.1 103 104 21.94 9999999 104.55 2987.95 0.0216 73.1 104 105 21.11 99311480 106.93 2977.23 0.0216 73.1 105 106 21.21 37631000 106.85 3020.06 0.0176 73.1 106 107 21.18 38308550 106.78 2982.13 0.0176 73.1 107 108 21.25 31752420 107.29 2999.66 0.0176 73.1 108 109 21.17 29030780 104.14 3011.93 0.0176 73.1 109 110 20.47 33352920 101.21 2937.29 0.0176 73.1 110 111 19.99 34106840 96.35 2895.58 0.0176 73.1 111 112 19.21 42257790 95.62 2904.87 0.0176 73.1 112 113 20.07 67220540 99.00 2904.26 0.0176 73.1 113 114 19.86 71524510 99.26 2883.89 0.0176 73.1 114 115 22.36 229081600 98.77 2846.81 0.0176 73.1 115 116 22.17 78808770 100.65 2836.94 0.0176 73.1 116 117 23.56 107091400 103.13 2853.13 0.0176 73.1 117 118 22.92 84944370 105.53 2916.07 0.0176 73.1 118 119 23.10 46515660 106.76 2916.68 0.0176 73.1 119 120 24.32 89720920 107.59 2926.55 0.0176 73.1 120 121 23.99 29520310 107.62 2966.85 0.0176 73.1 121 122 25.94 123513900 108.82 2976.78 0.0176 73.1 122 123 26.15 85687430 107.59 2967.79 0.0176 73.1 123 124 26.36 49113040 107.85 2991.78 0.0176 73.1 124 125 27.32 88572990 107.11 3012.03 0.0176 73.1 125 126 28.00 126867400 108.14 3010.24 0.0176 73.1 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.970e+01 3.050e-09 4.000e-01 -3.422e-02 -8.036e+02 3.193e-01 t -6.337e-02 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5.5114 -1.2799 -0.1206 1.1860 6.4633 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 7.970e+01 1.335e+01 5.969 2.53e-08 *** VOLUME 3.050e-09 5.772e-09 0.528 0.59819 LINKEDIN 4.000e-01 6.186e-02 6.466 2.32e-09 *** NASDAQ -3.422e-02 5.021e-03 -6.817 4.09e-10 *** INF -8.036e+02 1.394e+02 -5.763 6.62e-08 *** CONS.CONF 3.193e-01 1.046e-01 3.054 0.00279 ** t -6.337e-02 1.299e-02 -4.879 3.34e-06 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.169 on 119 degrees of freedom Multiple R-squared: 0.7769, Adjusted R-squared: 0.7656 F-statistic: 69.06 on 6 and 119 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.012077e-01 2.024155e-01 8.987923e-01 [2,] 4.874872e-02 9.749744e-02 9.512513e-01 [3,] 1.950160e-02 3.900320e-02 9.804984e-01 [4,] 1.281798e-02 2.563596e-02 9.871820e-01 [5,] 6.038812e-03 1.207762e-02 9.939612e-01 [6,] 5.436260e-03 1.087252e-02 9.945637e-01 [7,] 2.300922e-03 4.601844e-03 9.976991e-01 [8,] 8.915315e-04 1.783063e-03 9.991085e-01 [9,] 3.525021e-04 7.050042e-04 9.996475e-01 [10,] 1.498060e-04 2.996119e-04 9.998502e-01 [11,] 6.237810e-05 1.247562e-04 9.999376e-01 [12,] 5.442921e-05 1.088584e-04 9.999456e-01 [13,] 1.887681e-05 3.775362e-05 9.999811e-01 [14,] 7.268663e-06 1.453733e-05 9.999927e-01 [15,] 3.418720e-06 6.837440e-06 9.999966e-01 [16,] 1.355330e-06 2.710660e-06 9.999986e-01 [17,] 2.777014e-05 5.554028e-05 9.999722e-01 [18,] 3.856782e-05 7.713565e-05 9.999614e-01 [19,] 2.649157e-05 5.298313e-05 9.999735e-01 [20,] 5.783881e-05 1.156776e-04 9.999422e-01 [21,] 1.048562e-04 2.097124e-04 9.998951e-01 [22,] 2.844154e-03 5.688308e-03 9.971558e-01 [23,] 1.228616e-02 2.457233e-02 9.877138e-01 [24,] 1.576336e-02 3.152671e-02 9.842366e-01 [25,] 4.236051e-02 8.472103e-02 9.576395e-01 [26,] 6.428983e-02 1.285797e-01 9.357102e-01 [27,] 7.559806e-02 1.511961e-01 9.244019e-01 [28,] 8.908304e-02 1.781661e-01 9.109170e-01 [29,] 1.644302e-01 3.288605e-01 8.355698e-01 [30,] 2.584055e-01 5.168110e-01 7.415945e-01 [31,] 3.519236e-01 7.038472e-01 6.480764e-01 [32,] 7.090537e-01 5.818926e-01 2.909463e-01 [33,] 8.443151e-01 3.113699e-01 1.556849e-01 [34,] 8.663531e-01 2.672939e-01 1.336469e-01 [35,] 8.887776e-01 2.224448e-01 1.112224e-01 [36,] 9.689158e-01 6.216845e-02 3.108423e-02 [37,] 9.900686e-01 1.986286e-02 9.931432e-03 [38,] 9.896556e-01 2.068887e-02 1.034443e-02 [39,] 9.899204e-01 2.015918e-02 1.007959e-02 [40,] 9.923983e-01 1.520331e-02 7.601654e-03 [41,] 9.974752e-01 5.049590e-03 2.524795e-03 [42,] 9.995240e-01 9.520926e-04 4.760463e-04 [43,] 9.998941e-01 2.118480e-04 1.059240e-04 [44,] 9.999975e-01 5.015465e-06 2.507732e-06 [45,] 9.999981e-01 3.731019e-06 1.865510e-06 [46,] 9.999975e-01 4.975723e-06 2.487862e-06 [47,] 9.999975e-01 5.057272e-06 2.528636e-06 [48,] 9.999959e-01 8.194589e-06 4.097294e-06 [49,] 9.999942e-01 1.152327e-05 5.761636e-06 [50,] 9.999940e-01 1.194744e-05 5.973720e-06 [51,] 9.999934e-01 1.329980e-05 6.649900e-06 [52,] 9.999929e-01 1.419782e-05 7.098908e-06 [53,] 9.999911e-01 1.770607e-05 8.853034e-06 [54,] 9.999890e-01 2.203090e-05 1.101545e-05 [55,] 9.999871e-01 2.588998e-05 1.294499e-05 [56,] 9.999825e-01 3.505075e-05 1.752537e-05 [57,] 9.999954e-01 9.206891e-06 4.603446e-06 [58,] 9.999965e-01 6.922391e-06 3.461196e-06 [59,] 9.999950e-01 9.997805e-06 4.998902e-06 [60,] 9.999914e-01 1.714419e-05 8.572094e-06 [61,] 9.999860e-01 2.807837e-05 1.403919e-05 [62,] 9.999776e-01 4.476513e-05 2.238257e-05 [63,] 9.999688e-01 6.233923e-05 3.116961e-05 [64,] 9.999584e-01 8.316835e-05 4.158417e-05 [65,] 9.999409e-01 1.181551e-04 5.907756e-05 [66,] 9.999260e-01 1.480010e-04 7.400048e-05 [67,] 9.999346e-01 1.308599e-04 6.542997e-05 [68,] 9.999773e-01 4.547236e-05 2.273618e-05 [69,] 9.999827e-01 3.455113e-05 1.727556e-05 [70,] 9.999926e-01 1.487647e-05 7.438235e-06 [71,] 9.999884e-01 2.329525e-05 1.164762e-05 [72,] 9.999783e-01 4.338707e-05 2.169353e-05 [73,] 9.999694e-01 6.116527e-05 3.058264e-05 [74,] 9.999476e-01 1.047373e-04 5.236866e-05 [75,] 9.999198e-01 1.603568e-04 8.017842e-05 [76,] 9.999861e-01 2.788935e-05 1.394467e-05 [77,] 9.999988e-01 2.363208e-06 1.181604e-06 [78,] 9.999987e-01 2.614970e-06 1.307485e-06 [79,] 9.999983e-01 3.465549e-06 1.732774e-06 [80,] 9.999973e-01 5.490918e-06 2.745459e-06 [81,] 9.999945e-01 1.093684e-05 5.468419e-06 [82,] 9.999957e-01 8.508459e-06 4.254229e-06 [83,] 9.999936e-01 1.287753e-05 6.438767e-06 [84,] 9.999874e-01 2.511285e-05 1.255643e-05 [85,] 9.999818e-01 3.639486e-05 1.819743e-05 [86,] 9.999666e-01 6.686249e-05 3.343125e-05 [87,] 9.999455e-01 1.089476e-04 5.447380e-05 [88,] 9.999280e-01 1.439859e-04 7.199295e-05 [89,] 9.999644e-01 7.129806e-05 3.564903e-05 [90,] 9.999489e-01 1.022507e-04 5.112536e-05 [91,] 9.999573e-01 8.534597e-05 4.267299e-05 [92,] 9.999708e-01 5.839018e-05 2.919509e-05 [93,] 9.999553e-01 8.941040e-05 4.470520e-05 [94,] 9.999565e-01 8.708615e-05 4.354308e-05 [95,] 9.999905e-01 1.890493e-05 9.452465e-06 [96,] 9.999708e-01 5.835368e-05 2.917684e-05 [97,] 9.999163e-01 1.674020e-04 8.370098e-05 [98,] 9.997995e-01 4.010385e-04 2.005193e-04 [99,] 9.994583e-01 1.083489e-03 5.417443e-04 [100,] 9.989212e-01 2.157625e-03 1.078812e-03 [101,] 9.995583e-01 8.833033e-04 4.416517e-04 [102,] 9.999393e-01 1.214795e-04 6.073977e-05 [103,] 9.998053e-01 3.894414e-04 1.947207e-04 [104,] 9.999232e-01 1.535650e-04 7.678249e-05 [105,] 9.995307e-01 9.386196e-04 4.693098e-04 [106,] 9.983579e-01 3.284225e-03 1.642112e-03 [107,] 9.925095e-01 1.498098e-02 7.490492e-03 > postscript(file="/var/wessaorg/rcomp/tmp/1x3xh1356079314.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/2gru31356079314.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/38f1i1356079314.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/4ikzf1356079314.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/5m8vg1356079314.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.78362226 -1.92318399 -3.06622880 0.13669950 -1.08116358 -0.07395307 7 8 9 10 11 12 -1.06338900 0.51082521 -0.82492483 -0.23830045 1.22379524 2.19990235 13 14 15 16 17 18 3.90662520 3.75820767 2.83215425 3.22481952 2.04251661 2.40906613 19 20 21 22 23 24 2.81857325 2.13318630 3.43711708 0.81776437 1.81390266 2.26479413 25 26 27 28 29 30 1.00978448 3.65416878 3.40074292 1.85674740 -0.40451143 0.64560891 31 32 33 34 35 36 -1.26376793 -1.17194480 0.75925691 -0.09643451 -0.70101012 -1.02822308 37 38 39 40 41 42 -1.70772160 -0.74978484 -1.43829950 -3.52497094 -4.44887810 -5.51136871 43 44 45 46 47 48 -0.54049625 -0.85832381 -3.83001027 -3.23806670 -1.57384751 -0.93831440 49 50 51 52 53 54 -0.40960673 0.61290982 0.66356374 0.41046043 1.55668349 0.32870488 55 56 57 58 59 60 1.19590709 1.66838330 -0.27406375 0.16782909 -0.28457888 0.43336777 61 62 63 64 65 66 0.56633006 -0.19561517 -0.80119577 -1.26165074 -1.66121697 -2.10389988 67 68 69 70 71 72 -3.78695126 -3.34974066 -3.19189899 -3.87608896 -3.28417732 -2.27201178 73 74 75 76 77 78 -0.80328752 -0.01540467 0.18673697 0.60071843 1.68944086 0.78217550 79 80 81 82 83 84 1.24659539 -1.44527822 -2.14119369 -1.77994528 -1.16750198 -0.88514339 85 86 87 88 89 90 0.91517406 1.21619795 0.18726797 0.68308593 0.54084014 -0.35239750 91 92 93 94 95 96 -0.11336181 -0.68419467 -1.25465121 -0.25929237 0.32065232 1.47291570 97 98 99 100 101 102 2.67354109 0.95287402 -0.34259291 0.21249901 0.68691256 2.32632011 103 104 105 106 107 108 3.07759122 3.25307853 0.89509609 -0.46978284 -1.70862155 -1.15930650 109 110 111 112 113 114 0.51234437 -1.51995529 -1.42232582 -1.55386440 -2.07956792 -3.04048880 115 116 117 118 119 120 -2.03075945 -2.78884059 -1.85968393 -1.17469974 -1.28525500 -0.12789219 121 122 123 124 125 126 1.15635603 2.74284746 3.31593489 4.41790923 6.30997091 6.46325127 > postscript(file="/var/wessaorg/rcomp/tmp/6qam91356079314.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.78362226 NA 1 -1.92318399 -1.78362226 2 -3.06622880 -1.92318399 3 0.13669950 -3.06622880 4 -1.08116358 0.13669950 5 -0.07395307 -1.08116358 6 -1.06338900 -0.07395307 7 0.51082521 -1.06338900 8 -0.82492483 0.51082521 9 -0.23830045 -0.82492483 10 1.22379524 -0.23830045 11 2.19990235 1.22379524 12 3.90662520 2.19990235 13 3.75820767 3.90662520 14 2.83215425 3.75820767 15 3.22481952 2.83215425 16 2.04251661 3.22481952 17 2.40906613 2.04251661 18 2.81857325 2.40906613 19 2.13318630 2.81857325 20 3.43711708 2.13318630 21 0.81776437 3.43711708 22 1.81390266 0.81776437 23 2.26479413 1.81390266 24 1.00978448 2.26479413 25 3.65416878 1.00978448 26 3.40074292 3.65416878 27 1.85674740 3.40074292 28 -0.40451143 1.85674740 29 0.64560891 -0.40451143 30 -1.26376793 0.64560891 31 -1.17194480 -1.26376793 32 0.75925691 -1.17194480 33 -0.09643451 0.75925691 34 -0.70101012 -0.09643451 35 -1.02822308 -0.70101012 36 -1.70772160 -1.02822308 37 -0.74978484 -1.70772160 38 -1.43829950 -0.74978484 39 -3.52497094 -1.43829950 40 -4.44887810 -3.52497094 41 -5.51136871 -4.44887810 42 -0.54049625 -5.51136871 43 -0.85832381 -0.54049625 44 -3.83001027 -0.85832381 45 -3.23806670 -3.83001027 46 -1.57384751 -3.23806670 47 -0.93831440 -1.57384751 48 -0.40960673 -0.93831440 49 0.61290982 -0.40960673 50 0.66356374 0.61290982 51 0.41046043 0.66356374 52 1.55668349 0.41046043 53 0.32870488 1.55668349 54 1.19590709 0.32870488 55 1.66838330 1.19590709 56 -0.27406375 1.66838330 57 0.16782909 -0.27406375 58 -0.28457888 0.16782909 59 0.43336777 -0.28457888 60 0.56633006 0.43336777 61 -0.19561517 0.56633006 62 -0.80119577 -0.19561517 63 -1.26165074 -0.80119577 64 -1.66121697 -1.26165074 65 -2.10389988 -1.66121697 66 -3.78695126 -2.10389988 67 -3.34974066 -3.78695126 68 -3.19189899 -3.34974066 69 -3.87608896 -3.19189899 70 -3.28417732 -3.87608896 71 -2.27201178 -3.28417732 72 -0.80328752 -2.27201178 73 -0.01540467 -0.80328752 74 0.18673697 -0.01540467 75 0.60071843 0.18673697 76 1.68944086 0.60071843 77 0.78217550 1.68944086 78 1.24659539 0.78217550 79 -1.44527822 1.24659539 80 -2.14119369 -1.44527822 81 -1.77994528 -2.14119369 82 -1.16750198 -1.77994528 83 -0.88514339 -1.16750198 84 0.91517406 -0.88514339 85 1.21619795 0.91517406 86 0.18726797 1.21619795 87 0.68308593 0.18726797 88 0.54084014 0.68308593 89 -0.35239750 0.54084014 90 -0.11336181 -0.35239750 91 -0.68419467 -0.11336181 92 -1.25465121 -0.68419467 93 -0.25929237 -1.25465121 94 0.32065232 -0.25929237 95 1.47291570 0.32065232 96 2.67354109 1.47291570 97 0.95287402 2.67354109 98 -0.34259291 0.95287402 99 0.21249901 -0.34259291 100 0.68691256 0.21249901 101 2.32632011 0.68691256 102 3.07759122 2.32632011 103 3.25307853 3.07759122 104 0.89509609 3.25307853 105 -0.46978284 0.89509609 106 -1.70862155 -0.46978284 107 -1.15930650 -1.70862155 108 0.51234437 -1.15930650 109 -1.51995529 0.51234437 110 -1.42232582 -1.51995529 111 -1.55386440 -1.42232582 112 -2.07956792 -1.55386440 113 -3.04048880 -2.07956792 114 -2.03075945 -3.04048880 115 -2.78884059 -2.03075945 116 -1.85968393 -2.78884059 117 -1.17469974 -1.85968393 118 -1.28525500 -1.17469974 119 -0.12789219 -1.28525500 120 1.15635603 -0.12789219 121 2.74284746 1.15635603 122 3.31593489 2.74284746 123 4.41790923 3.31593489 124 6.30997091 4.41790923 125 6.46325127 6.30997091 126 NA 6.46325127 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.92318399 -1.78362226 [2,] -3.06622880 -1.92318399 [3,] 0.13669950 -3.06622880 [4,] -1.08116358 0.13669950 [5,] -0.07395307 -1.08116358 [6,] -1.06338900 -0.07395307 [7,] 0.51082521 -1.06338900 [8,] -0.82492483 0.51082521 [9,] -0.23830045 -0.82492483 [10,] 1.22379524 -0.23830045 [11,] 2.19990235 1.22379524 [12,] 3.90662520 2.19990235 [13,] 3.75820767 3.90662520 [14,] 2.83215425 3.75820767 [15,] 3.22481952 2.83215425 [16,] 2.04251661 3.22481952 [17,] 2.40906613 2.04251661 [18,] 2.81857325 2.40906613 [19,] 2.13318630 2.81857325 [20,] 3.43711708 2.13318630 [21,] 0.81776437 3.43711708 [22,] 1.81390266 0.81776437 [23,] 2.26479413 1.81390266 [24,] 1.00978448 2.26479413 [25,] 3.65416878 1.00978448 [26,] 3.40074292 3.65416878 [27,] 1.85674740 3.40074292 [28,] -0.40451143 1.85674740 [29,] 0.64560891 -0.40451143 [30,] -1.26376793 0.64560891 [31,] -1.17194480 -1.26376793 [32,] 0.75925691 -1.17194480 [33,] -0.09643451 0.75925691 [34,] -0.70101012 -0.09643451 [35,] -1.02822308 -0.70101012 [36,] -1.70772160 -1.02822308 [37,] -0.74978484 -1.70772160 [38,] -1.43829950 -0.74978484 [39,] -3.52497094 -1.43829950 [40,] -4.44887810 -3.52497094 [41,] -5.51136871 -4.44887810 [42,] -0.54049625 -5.51136871 [43,] -0.85832381 -0.54049625 [44,] -3.83001027 -0.85832381 [45,] -3.23806670 -3.83001027 [46,] -1.57384751 -3.23806670 [47,] -0.93831440 -1.57384751 [48,] -0.40960673 -0.93831440 [49,] 0.61290982 -0.40960673 [50,] 0.66356374 0.61290982 [51,] 0.41046043 0.66356374 [52,] 1.55668349 0.41046043 [53,] 0.32870488 1.55668349 [54,] 1.19590709 0.32870488 [55,] 1.66838330 1.19590709 [56,] -0.27406375 1.66838330 [57,] 0.16782909 -0.27406375 [58,] -0.28457888 0.16782909 [59,] 0.43336777 -0.28457888 [60,] 0.56633006 0.43336777 [61,] -0.19561517 0.56633006 [62,] -0.80119577 -0.19561517 [63,] -1.26165074 -0.80119577 [64,] -1.66121697 -1.26165074 [65,] -2.10389988 -1.66121697 [66,] -3.78695126 -2.10389988 [67,] -3.34974066 -3.78695126 [68,] -3.19189899 -3.34974066 [69,] -3.87608896 -3.19189899 [70,] -3.28417732 -3.87608896 [71,] -2.27201178 -3.28417732 [72,] -0.80328752 -2.27201178 [73,] -0.01540467 -0.80328752 [74,] 0.18673697 -0.01540467 [75,] 0.60071843 0.18673697 [76,] 1.68944086 0.60071843 [77,] 0.78217550 1.68944086 [78,] 1.24659539 0.78217550 [79,] -1.44527822 1.24659539 [80,] -2.14119369 -1.44527822 [81,] -1.77994528 -2.14119369 [82,] -1.16750198 -1.77994528 [83,] -0.88514339 -1.16750198 [84,] 0.91517406 -0.88514339 [85,] 1.21619795 0.91517406 [86,] 0.18726797 1.21619795 [87,] 0.68308593 0.18726797 [88,] 0.54084014 0.68308593 [89,] -0.35239750 0.54084014 [90,] -0.11336181 -0.35239750 [91,] -0.68419467 -0.11336181 [92,] -1.25465121 -0.68419467 [93,] -0.25929237 -1.25465121 [94,] 0.32065232 -0.25929237 [95,] 1.47291570 0.32065232 [96,] 2.67354109 1.47291570 [97,] 0.95287402 2.67354109 [98,] -0.34259291 0.95287402 [99,] 0.21249901 -0.34259291 [100,] 0.68691256 0.21249901 [101,] 2.32632011 0.68691256 [102,] 3.07759122 2.32632011 [103,] 3.25307853 3.07759122 [104,] 0.89509609 3.25307853 [105,] -0.46978284 0.89509609 [106,] -1.70862155 -0.46978284 [107,] -1.15930650 -1.70862155 [108,] 0.51234437 -1.15930650 [109,] -1.51995529 0.51234437 [110,] -1.42232582 -1.51995529 [111,] -1.55386440 -1.42232582 [112,] -2.07956792 -1.55386440 [113,] -3.04048880 -2.07956792 [114,] -2.03075945 -3.04048880 [115,] -2.78884059 -2.03075945 [116,] -1.85968393 -2.78884059 [117,] -1.17469974 -1.85968393 [118,] -1.28525500 -1.17469974 [119,] -0.12789219 -1.28525500 [120,] 1.15635603 -0.12789219 [121,] 2.74284746 1.15635603 [122,] 3.31593489 2.74284746 [123,] 4.41790923 3.31593489 [124,] 6.30997091 4.41790923 [125,] 6.46325127 6.30997091 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.92318399 -1.78362226 2 -3.06622880 -1.92318399 3 0.13669950 -3.06622880 4 -1.08116358 0.13669950 5 -0.07395307 -1.08116358 6 -1.06338900 -0.07395307 7 0.51082521 -1.06338900 8 -0.82492483 0.51082521 9 -0.23830045 -0.82492483 10 1.22379524 -0.23830045 11 2.19990235 1.22379524 12 3.90662520 2.19990235 13 3.75820767 3.90662520 14 2.83215425 3.75820767 15 3.22481952 2.83215425 16 2.04251661 3.22481952 17 2.40906613 2.04251661 18 2.81857325 2.40906613 19 2.13318630 2.81857325 20 3.43711708 2.13318630 21 0.81776437 3.43711708 22 1.81390266 0.81776437 23 2.26479413 1.81390266 24 1.00978448 2.26479413 25 3.65416878 1.00978448 26 3.40074292 3.65416878 27 1.85674740 3.40074292 28 -0.40451143 1.85674740 29 0.64560891 -0.40451143 30 -1.26376793 0.64560891 31 -1.17194480 -1.26376793 32 0.75925691 -1.17194480 33 -0.09643451 0.75925691 34 -0.70101012 -0.09643451 35 -1.02822308 -0.70101012 36 -1.70772160 -1.02822308 37 -0.74978484 -1.70772160 38 -1.43829950 -0.74978484 39 -3.52497094 -1.43829950 40 -4.44887810 -3.52497094 41 -5.51136871 -4.44887810 42 -0.54049625 -5.51136871 43 -0.85832381 -0.54049625 44 -3.83001027 -0.85832381 45 -3.23806670 -3.83001027 46 -1.57384751 -3.23806670 47 -0.93831440 -1.57384751 48 -0.40960673 -0.93831440 49 0.61290982 -0.40960673 50 0.66356374 0.61290982 51 0.41046043 0.66356374 52 1.55668349 0.41046043 53 0.32870488 1.55668349 54 1.19590709 0.32870488 55 1.66838330 1.19590709 56 -0.27406375 1.66838330 57 0.16782909 -0.27406375 58 -0.28457888 0.16782909 59 0.43336777 -0.28457888 60 0.56633006 0.43336777 61 -0.19561517 0.56633006 62 -0.80119577 -0.19561517 63 -1.26165074 -0.80119577 64 -1.66121697 -1.26165074 65 -2.10389988 -1.66121697 66 -3.78695126 -2.10389988 67 -3.34974066 -3.78695126 68 -3.19189899 -3.34974066 69 -3.87608896 -3.19189899 70 -3.28417732 -3.87608896 71 -2.27201178 -3.28417732 72 -0.80328752 -2.27201178 73 -0.01540467 -0.80328752 74 0.18673697 -0.01540467 75 0.60071843 0.18673697 76 1.68944086 0.60071843 77 0.78217550 1.68944086 78 1.24659539 0.78217550 79 -1.44527822 1.24659539 80 -2.14119369 -1.44527822 81 -1.77994528 -2.14119369 82 -1.16750198 -1.77994528 83 -0.88514339 -1.16750198 84 0.91517406 -0.88514339 85 1.21619795 0.91517406 86 0.18726797 1.21619795 87 0.68308593 0.18726797 88 0.54084014 0.68308593 89 -0.35239750 0.54084014 90 -0.11336181 -0.35239750 91 -0.68419467 -0.11336181 92 -1.25465121 -0.68419467 93 -0.25929237 -1.25465121 94 0.32065232 -0.25929237 95 1.47291570 0.32065232 96 2.67354109 1.47291570 97 0.95287402 2.67354109 98 -0.34259291 0.95287402 99 0.21249901 -0.34259291 100 0.68691256 0.21249901 101 2.32632011 0.68691256 102 3.07759122 2.32632011 103 3.25307853 3.07759122 104 0.89509609 3.25307853 105 -0.46978284 0.89509609 106 -1.70862155 -0.46978284 107 -1.15930650 -1.70862155 108 0.51234437 -1.15930650 109 -1.51995529 0.51234437 110 -1.42232582 -1.51995529 111 -1.55386440 -1.42232582 112 -2.07956792 -1.55386440 113 -3.04048880 -2.07956792 114 -2.03075945 -3.04048880 115 -2.78884059 -2.03075945 116 -1.85968393 -2.78884059 117 -1.17469974 -1.85968393 118 -1.28525500 -1.17469974 119 -0.12789219 -1.28525500 120 1.15635603 -0.12789219 121 2.74284746 1.15635603 122 3.31593489 2.74284746 123 4.41790923 3.31593489 124 6.30997091 4.41790923 125 6.46325127 6.30997091 > 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/7a4a51356079314.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/84x581356079314.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/9mk8z1356079314.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/10q5k11356079314.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/11jf9k1356079315.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/123lh21356079315.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/13v7vr1356079315.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/146pjc1356079315.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/158lph1356079315.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/16kd9i1356079315.tab") + } > > try(system("convert tmp/1x3xh1356079314.ps tmp/1x3xh1356079314.png",intern=TRUE)) character(0) > try(system("convert tmp/2gru31356079314.ps tmp/2gru31356079314.png",intern=TRUE)) character(0) > try(system("convert tmp/38f1i1356079314.ps tmp/38f1i1356079314.png",intern=TRUE)) character(0) > try(system("convert tmp/4ikzf1356079314.ps tmp/4ikzf1356079314.png",intern=TRUE)) character(0) > try(system("convert tmp/5m8vg1356079314.ps tmp/5m8vg1356079314.png",intern=TRUE)) character(0) > try(system("convert tmp/6qam91356079314.ps tmp/6qam91356079314.png",intern=TRUE)) character(0) > try(system("convert tmp/7a4a51356079314.ps tmp/7a4a51356079314.png",intern=TRUE)) character(0) > try(system("convert tmp/84x581356079314.ps tmp/84x581356079314.png",intern=TRUE)) character(0) > try(system("convert tmp/9mk8z1356079314.ps tmp/9mk8z1356079314.png",intern=TRUE)) character(0) > try(system("convert tmp/10q5k11356079314.ps tmp/10q5k11356079314.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.830 1.186 8.093