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 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> par3 <- 'No 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
1 27.72 41837160 91.51 2747.48 0.0160 62.7 0.16
2 26.90 35204750 91.09 2760.01 0.0160 62.7 0.17
3 25.86 42367740 93.00 2778.11 0.0160 62.7 0.17
4 26.81 61427940 93.08 2844.72 0.0160 62.7 0.16
5 26.31 26132090 94.13 2831.02 0.0160 62.7 0.16
6 27.10 3799718 96.26 2858.42 0.0160 62.7 0.17
7 27.00 28202230 94.29 2809.73 0.0160 62.7 0.17
8 27.40 15809640 94.46 2843.07 0.0160 62.7 0.16
9 27.27 17110160 95.53 2818.61 0.0160 62.7 0.17
10 28.29 16835510 98.29 2836.33 0.0160 62.7 0.17
11 30.01 43517670 102.01 2872.80 0.0160 62.7 0.18
12 31.41 42958450 105.16 2895.33 0.0160 62.7 0.17
13 31.91 30826830 105.34 2929.76 0.0160 62.7 0.17
14 31.60 15549740 105.27 2930.45 0.0160 62.7 0.16
15 31.84 21843070 102.19 2859.09 0.0160 62.7 0.17
16 33.05 73424890 106.85 2892.42 0.0160 62.7 0.17
17 32.06 24330740 103.05 2836.16 0.0160 62.7 0.17
18 33.10 24785970 106.42 2854.06 0.0160 62.7 0.16
19 32.23 28553940 105.17 2875.32 0.0160 62.7 0.15
20 31.36 17659080 102.74 2849.49 0.0160 62.7 0.15
21 31.09 19508980 106.27 2935.05 0.0160 62.7 0.09
22 30.77 14110230 107.63 2951.23 0.0141 65.4 0.18
23 31.20 8765498 108.54 2976.08 0.0141 65.4 0.17
24 31.47 10027250 108.24 2976.12 0.0141 65.4 0.17
25 31.73 10943350 108.86 2937.33 0.0141 65.4 0.17
26 32.17 17755740 102.98 2931.77 0.0141 65.4 0.17
27 31.47 14238190 99.53 2902.33 0.0141 65.4 0.17
28 30.97 12997760 101.08 2887.98 0.0141 65.4 0.17
29 30.81 11299240 104.64 2866.19 0.0141 65.4 0.18
30 30.72 8102653 105.59 2908.47 0.0141 65.4 0.19
31 28.24 24549800 103.21 2896.94 0.0141 65.4 0.18
32 28.09 30410530 103.84 2910.04 0.0141 65.4 0.17
33 29.11 16807730 104.61 2942.60 0.0141 65.4 0.16
34 29.00 13671200 108.65 2965.90 0.0141 65.4 0.13
35 28.76 11854290 106.26 2925.30 0.0141 65.4 0.13
36 28.75 12383610 104.20 2890.15 0.0141 65.4 0.14
37 28.45 11512350 102.99 2862.99 0.0141 65.4 0.15
38 29.34 16749990 102.19 2854.24 0.0141 65.4 0.15
39 26.84 61009290 100.82 2893.25 0.0141 65.4 0.14
40 23.70 123011300 103.42 2958.09 0.0141 65.4 0.14
41 23.15 29253590 104.18 2945.84 0.0141 65.4 0.14
42 21.71 55998620 102.65 2939.52 0.0141 65.4 0.13
43 20.88 44488370 95.64 2920.21 0.0169 61.3 0.14
44 20.04 56264460 93.51 2909.77 0.0169 61.3 0.14
45 21.09 80626220 108.51 2967.90 0.0169 61.3 0.14
46 21.92 27733830 111.55 2989.91 0.0169 61.3 0.14
47 20.72 36699380 106.70 3015.86 0.0169 61.3 0.13
48 20.72 29514550 104.93 3011.25 0.0169 61.3 0.13
49 21.01 15605960 105.23 3018.64 0.0169 61.3 0.13
50 21.80 25714310 104.92 3020.86 0.0169 61.3 0.13
51 21.60 24904700 104.60 3022.52 0.0169 61.3 0.13
52 20.38 38971320 101.76 3016.98 0.0169 61.3 0.13
53 21.20 47682050 102.23 3030.93 0.0169 61.3 0.13
54 19.87 157188200 103.99 3062.39 0.0169 61.3 0.13
55 19.05 129057400 101.36 3076.59 0.0169 61.3 0.13
56 20.01 100818300 102.92 3076.21 0.0169 61.3 0.13
57 19.15 70483330 105.25 3067.26 0.0169 61.3 0.13
58 19.43 49779450 105.71 3073.67 0.0169 61.3 0.13
59 19.44 32747000 105.42 3053.40 0.0169 61.3 0.13
60 19.40 29588690 105.11 3069.79 0.0169 61.3 0.13
61 19.15 20663220 104.67 3073.19 0.0169 61.3 0.13
62 19.34 25402980 107.51 3077.14 0.0169 61.3 0.13
63 19.10 16071190 109.00 3081.19 0.0169 61.3 0.13
64 19.08 30571430 107.37 3048.71 0.0169 61.3 0.14
65 18.05 58612440 107.30 3066.96 0.0169 61.3 0.13
66 17.72 46177000 107.37 3075.06 0.0199 70.3 0.14
67 18.58 60657900 113.28 3069.27 0.0199 70.3 0.16
68 18.96 46028860 119.10 3135.81 0.0199 70.3 0.16
69 18.98 36325880 119.04 3136.42 0.0199 70.3 0.15
70 18.81 24752340 117.80 3104.02 0.0199 70.3 0.15
71 19.43 47343020 117.90 3104.53 0.0199 70.3 0.15
72 20.93 121399400 119.55 3114.31 0.0199 70.3 0.15
73 20.71 64896660 119.47 3155.83 0.0199 70.3 0.15
74 22.00 72707430 123.23 3183.95 0.0199 70.3 0.16
75 21.52 50593510 121.40 3178.67 0.0199 70.3 0.16
76 21.87 36696330 121.43 3177.80 0.0199 70.3 0.16
77 23.29 78525460 122.51 3182.62 0.0199 70.3 0.15
78 22.59 57115160 122.78 3175.96 0.0199 70.3 0.16
79 22.86 51163120 122.84 3179.96 0.0199 70.3 0.15
80 20.79 78968380 122.70 3160.78 0.0199 70.3 0.16
81 20.28 46169460 119.89 3117.73 0.0199 70.3 0.15
82 20.62 38212360 118.00 3093.70 0.0199 70.3 0.16
83 20.32 30061050 119.61 3136.60 0.0199 70.3 0.14
84 21.66 65415370 120.40 3116.23 0.0199 70.3 0.09
85 21.99 51198150 117.94 3113.53 0.0216 73.1 0.15
86 22.27 29276680 118.77 3120.04 0.0216 73.1 0.16
87 21.83 31940720 121.68 3135.23 0.0216 73.1 0.16
88 21.94 46549400 121.98 3149.46 0.0216 73.1 0.15
89 20.91 40483780 118.83 3136.19 0.0216 73.1 0.15
90 20.40 32190200 117.97 3112.35 0.0216 73.1 0.15
91 20.22 27125670 113.07 3065.02 0.0216 73.1 0.16
92 19.64 39282420 111.98 3051.78 0.0216 73.1 0.16
93 19.75 21803710 113.77 3049.41 0.0216 73.1 0.16
94 19.51 18743920 110.41 3044.11 0.0216 73.1 0.16
95 19.52 20154860 110.85 3064.18 0.0216 73.1 0.16
96 19.48 21816100 111.18 3101.17 0.0216 73.1 0.16
97 19.88 44020450 109.42 3104.12 0.0216 73.1 0.15
98 18.97 52059860 108.87 3072.87 0.0216 73.1 0.15
99 19.00 34769600 106.72 3005.62 0.0216 73.1 0.16
100 19.32 32269470 107.28 3016.96 0.0216 73.1 0.15
101 19.50 72281000 104.13 2990.46 0.0216 73.1 0.15
102 23.22 228364700 107.55 2981.70 0.0216 73.1 0.17
103 22.56 76050080 105.72 2986.12 0.0216 73.1 0.16
104 21.94 9999999 104.55 2987.95 0.0216 73.1 0.16
105 21.11 99311480 106.93 2977.23 0.0216 73.1 0.18
106 21.21 37631000 106.85 3020.06 0.0176 73.1 0.17
107 21.18 38308550 106.78 2982.13 0.0176 73.1 0.16
108 21.25 31752420 107.29 2999.66 0.0176 73.1 0.17
109 21.17 29030780 104.14 3011.93 0.0176 73.1 0.16
110 20.47 33352920 101.21 2937.29 0.0176 73.1 0.16
111 19.99 34106840 96.35 2895.58 0.0176 73.1 0.16
112 19.21 42257790 95.62 2904.87 0.0176 73.1 0.16
113 20.07 67220540 99.00 2904.26 0.0176 73.1 0.16
114 19.86 71524510 99.26 2883.89 0.0176 73.1 0.16
115 22.36 229081600 98.77 2846.81 0.0176 73.1 0.16
116 22.17 78808770 100.65 2836.94 0.0176 73.1 0.16
117 23.56 107091400 103.13 2853.13 0.0176 73.1 0.16
118 22.92 84944370 105.53 2916.07 0.0176 73.1 0.16
119 23.10 46515660 106.76 2916.68 0.0176 73.1 0.16
120 24.32 89720920 107.59 2926.55 0.0176 73.1 0.16
121 23.99 29520310 107.62 2966.85 0.0176 73.1 0.16
122 25.94 123513900 108.82 2976.78 0.0176 73.1 0.16
123 26.15 85687430 107.59 2967.79 0.0176 73.1 0.16
124 26.36 49113040 107.85 2991.78 0.0176 73.1 0.16
125 27.32 88572990 107.11 3012.03 0.0176 73.1 0.16
126 28.00 126867400 108.14 3010.24 0.0176 73.1 0.16
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) VOLUME LINKEDIN NASDAQ INF.CONS.CONF
1.066e+02 -3.827e-09 4.997e-01 -4.017e-02 -7.355e+02
FED FUNDS.RATE
-1.845e-01 6.084e+01
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-4.966 -1.423 -0.032 1.616 7.245
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.066e+02 1.069e+01 9.971 < 2e-16 ***
VOLUME -3.827e-09 5.627e-09 -0.680 0.497675
LINKEDIN 4.997e-01 5.650e-02 8.844 1.01e-14 ***
NASDAQ -4.017e-02 4.704e-03 -8.539 5.23e-14 ***
INF.CONS.CONF -7.355e+02 1.426e+02 -5.156 1.02e-06 ***
FED -1.845e-01 6.622e-02 -2.786 0.006212 **
FUNDS.RATE 6.084e+01 1.532e+01 3.971 0.000123 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.232 on 119 degrees of freedom
Multiple R-squared: 0.7636, Adjusted R-squared: 0.7517
F-statistic: 64.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,] 6.762306e-02 1.352461e-01 0.9323769390
[2,] 3.357577e-02 6.715155e-02 0.9664242250
[3,] 1.062513e-02 2.125026e-02 0.9893748705
[4,] 5.891576e-03 1.178315e-02 0.9941084241
[5,] 1.944585e-03 3.889169e-03 0.9980554154
[6,] 1.840704e-03 3.681408e-03 0.9981592958
[7,] 6.617410e-04 1.323482e-03 0.9993382590
[8,] 2.200347e-04 4.400695e-04 0.9997799653
[9,] 1.227545e-04 2.455090e-04 0.9998772455
[10,] 6.283151e-05 1.256630e-04 0.9999371685
[11,] 2.504633e-05 5.009266e-05 0.9999749537
[12,] 5.782535e-05 1.156507e-04 0.9999421746
[13,] 1.962370e-05 3.924740e-05 0.9999803763
[14,] 7.605535e-06 1.521107e-05 0.9999923945
[15,] 3.709536e-06 7.419073e-06 0.9999962905
[16,] 1.415346e-06 2.830692e-06 0.9999985847
[17,] 2.464267e-04 4.928533e-04 0.9997535733
[18,] 3.338667e-03 6.677334e-03 0.9966613332
[19,] 3.272552e-03 6.545103e-03 0.9967274484
[20,] 2.867469e-03 5.734937e-03 0.9971325313
[21,] 2.321788e-03 4.643576e-03 0.9976782120
[22,] 5.962267e-03 1.192453e-02 0.9940377330
[23,] 1.326367e-02 2.652734e-02 0.9867363300
[24,] 1.587393e-02 3.174786e-02 0.9841260698
[25,] 3.597067e-02 7.194133e-02 0.9640293337
[26,] 4.481766e-02 8.963531e-02 0.9551823435
[27,] 4.827097e-02 9.654193e-02 0.9517290326
[28,] 5.267735e-02 1.053547e-01 0.9473226482
[29,] 8.344581e-02 1.668916e-01 0.9165541853
[30,] 9.734148e-02 1.946830e-01 0.9026585150
[31,] 1.431244e-01 2.862487e-01 0.8568756474
[32,] 4.861472e-01 9.722943e-01 0.5138528279
[33,] 6.798018e-01 6.403964e-01 0.3201982197
[34,] 6.440717e-01 7.118566e-01 0.3559283121
[35,] 5.986298e-01 8.027403e-01 0.4013701503
[36,] 7.032930e-01 5.934140e-01 0.2967069905
[37,] 8.071177e-01 3.857645e-01 0.1928822562
[38,] 7.834760e-01 4.330480e-01 0.2165240201
[39,] 7.517971e-01 4.964058e-01 0.2482028846
[40,] 7.304531e-01 5.390938e-01 0.2695468804
[41,] 7.359234e-01 5.281531e-01 0.2640765669
[42,] 7.474814e-01 5.050372e-01 0.2525186102
[43,] 7.334892e-01 5.330216e-01 0.2665107862
[44,] 7.676071e-01 4.647858e-01 0.2323928983
[45,] 7.788242e-01 4.423517e-01 0.2211758329
[46,] 7.531691e-01 4.936618e-01 0.2468309019
[47,] 7.152794e-01 5.694412e-01 0.2847206171
[48,] 6.913326e-01 6.173347e-01 0.3086673592
[49,] 6.728297e-01 6.543406e-01 0.3271703120
[50,] 6.661724e-01 6.676552e-01 0.3338276183
[51,] 6.551027e-01 6.897945e-01 0.3448972519
[52,] 6.521849e-01 6.956302e-01 0.3478150836
[53,] 6.726071e-01 6.547857e-01 0.3273928636
[54,] 7.275897e-01 5.448205e-01 0.2724102558
[55,] 8.144698e-01 3.710604e-01 0.1855301813
[56,] 9.496532e-01 1.006936e-01 0.0503467952
[57,] 9.995243e-01 9.514420e-04 0.0004757210
[58,] 9.994247e-01 1.150566e-03 0.0005752830
[59,] 9.993124e-01 1.375189e-03 0.0006875944
[60,] 9.990944e-01 1.811165e-03 0.0009055826
[61,] 9.987709e-01 2.458194e-03 0.0012290968
[62,] 9.982488e-01 3.502465e-03 0.0017512324
[63,] 9.979970e-01 4.006031e-03 0.0020030153
[64,] 9.974922e-01 5.015616e-03 0.0025078079
[65,] 9.967177e-01 6.564565e-03 0.0032822826
[66,] 9.955145e-01 8.970935e-03 0.0044854676
[67,] 9.940699e-01 1.186023e-02 0.0059301144
[68,] 9.941805e-01 1.163909e-02 0.0058195449
[69,] 9.922067e-01 1.558655e-02 0.0077932775
[70,] 9.915568e-01 1.688634e-02 0.0084431721
[71,] 9.895398e-01 2.092048e-02 0.0104602411
[72,] 9.860659e-01 2.786827e-02 0.0139341352
[73,] 9.810359e-01 3.792820e-02 0.0189640983
[74,] 9.737436e-01 5.251273e-02 0.0262563672
[75,] 9.690321e-01 6.193580e-02 0.0309678977
[76,] 9.636725e-01 7.265508e-02 0.0363275397
[77,] 9.545095e-01 9.098100e-02 0.0454904977
[78,] 9.412343e-01 1.175315e-01 0.0587657251
[79,] 9.314870e-01 1.370260e-01 0.0685130234
[80,] 9.257716e-01 1.484568e-01 0.0742283785
[81,] 9.289240e-01 1.421519e-01 0.0710759593
[82,] 9.091677e-01 1.816647e-01 0.0908323481
[83,] 8.960853e-01 2.078293e-01 0.1039146535
[84,] 8.962109e-01 2.075783e-01 0.1037891409
[85,] 8.725836e-01 2.548329e-01 0.1274164342
[86,] 8.521613e-01 2.956775e-01 0.1478387407
[87,] 8.434287e-01 3.131425e-01 0.1565712637
[88,] 8.410656e-01 3.178689e-01 0.1589344386
[89,] 8.855911e-01 2.288178e-01 0.1144088902
[90,] 8.733496e-01 2.533009e-01 0.1266504477
[91,] 9.113232e-01 1.773537e-01 0.0886768375
[92,] 9.716827e-01 5.663469e-02 0.0283173425
[93,] 9.738600e-01 5.227997e-02 0.0261399834
[94,] 9.705374e-01 5.892529e-02 0.0294626461
[95,] 9.607840e-01 7.843193e-02 0.0392159664
[96,] 9.388604e-01 1.222793e-01 0.0611396358
[97,] 9.101525e-01 1.796950e-01 0.0898475007
[98,] 9.660393e-01 6.792135e-02 0.0339606757
[99,] 9.456441e-01 1.087119e-01 0.0543559455
[100,] 9.728378e-01 5.432434e-02 0.0271621691
[101,] 9.685286e-01 6.294287e-02 0.0314714339
[102,] 9.501804e-01 9.963920e-02 0.0498195987
[103,] 9.106321e-01 1.787357e-01 0.0893678572
[104,] 8.719658e-01 2.560683e-01 0.1280341629
[105,] 9.136186e-01 1.727628e-01 0.0863813844
[106,] 9.454703e-01 1.090593e-01 0.0545296706
[107,] 8.696069e-01 2.607862e-01 0.1303930849
> postscript(file="/var/fisher/rcomp/tmp/1wjpl1356078680.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/fisher/rcomp/tmp/2juuh1356078680.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/fisher/rcomp/tmp/3zque1356078680.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/fisher/rcomp/tmp/4a5ca1356078680.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/fisher/rcomp/tmp/5lq211356078680.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
-0.455771583 -1.196398259 -2.436440221 1.830316003 0.120267184 0.252544812
7 8 9 10 11 12
-0.725264383 1.489843299 -0.760692803 -0.409217687 0.410418866 1.747499519
13 14 15 16 17 18
3.494001296 3.796610278 2.125237735 2.542718566 1.004024453 1.689087595
19 20 21 22 23 24
2.920442599 2.185574208 7.245526607 0.500375334 2.061671974 2.488020711
25 26 27 28 29 30
0.883705004 4.064753354 3.892829063 2.037163227 -1.391887558 -0.879055775
31 32 33 34 35 36
-1.961512084 -1.269347847 1.229973381 1.850150260 1.166801060 0.168039710
37 38 39 40 41 42
-1.229916655 -0.271546440 0.257681340 -1.339952988 -3.120605900 -3.339140904
43 44 45 46 47 48
-0.791305123 -0.941174653 -4.958780273 -4.966306940 -2.057730169 -1.385904667
49 50 51 52 53 54
-1.002232109 0.070533332 0.094015623 0.124515440 1.303294133 0.776525757
55 56 57 58 59 60
1.733436546 1.790543554 -0.709362026 -0.481013292 -1.205433658 -0.444306846
61 62 63 64 65 66
-0.372035187 -1.424417165 -2.282032773 -3.344955710 -2.891251165 0.279802974
67 68 69 70 71 72
-3.207386286 -3.119105331 -2.473372084 -3.369376764 -2.692399106 -1.340659437
73 74 75 76 77 78
-0.069290742 -0.107249785 0.030507535 0.277382058 2.119777270 0.327022333
79 80 81 82 83 84
1.313306433 -1.959064443 -2.311134185 -2.630692098 -0.826567500 2.477754264
85 86 87 88 89 90
1.990668019 1.425092927 0.151241704 1.347178826 1.335057884 0.265530221
91 92 93 94 95 96
0.005323546 -0.515249064 -1.461818957 -0.247380856 0.354259705 1.641418892
97 98 99 100 101 102
3.732767878 1.873220789 -0.398068014 0.696384733 1.539237694 2.579010967
103 104 105 106 107 108
3.036421618 2.821781174 -0.503037697 -1.212296258 -2.119795934 -2.234035282
109 110 111 112 113 114
0.350845474 -1.866381899 -1.590192082 -1.601073597 -2.359049076 -3.500662350
115 116 117 118 119 120
-1.642084507 -3.743127422 -2.833884927 -2.229966209 -2.787191769 -1.420156199
121 122 123 124 125 126
-0.376910278 1.732031878 2.050812346 2.954461086 5.248618838 5.488592095
> postscript(file="/var/fisher/rcomp/tmp/6exj31356078680.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 -0.455771583 NA
1 -1.196398259 -0.455771583
2 -2.436440221 -1.196398259
3 1.830316003 -2.436440221
4 0.120267184 1.830316003
5 0.252544812 0.120267184
6 -0.725264383 0.252544812
7 1.489843299 -0.725264383
8 -0.760692803 1.489843299
9 -0.409217687 -0.760692803
10 0.410418866 -0.409217687
11 1.747499519 0.410418866
12 3.494001296 1.747499519
13 3.796610278 3.494001296
14 2.125237735 3.796610278
15 2.542718566 2.125237735
16 1.004024453 2.542718566
17 1.689087595 1.004024453
18 2.920442599 1.689087595
19 2.185574208 2.920442599
20 7.245526607 2.185574208
21 0.500375334 7.245526607
22 2.061671974 0.500375334
23 2.488020711 2.061671974
24 0.883705004 2.488020711
25 4.064753354 0.883705004
26 3.892829063 4.064753354
27 2.037163227 3.892829063
28 -1.391887558 2.037163227
29 -0.879055775 -1.391887558
30 -1.961512084 -0.879055775
31 -1.269347847 -1.961512084
32 1.229973381 -1.269347847
33 1.850150260 1.229973381
34 1.166801060 1.850150260
35 0.168039710 1.166801060
36 -1.229916655 0.168039710
37 -0.271546440 -1.229916655
38 0.257681340 -0.271546440
39 -1.339952988 0.257681340
40 -3.120605900 -1.339952988
41 -3.339140904 -3.120605900
42 -0.791305123 -3.339140904
43 -0.941174653 -0.791305123
44 -4.958780273 -0.941174653
45 -4.966306940 -4.958780273
46 -2.057730169 -4.966306940
47 -1.385904667 -2.057730169
48 -1.002232109 -1.385904667
49 0.070533332 -1.002232109
50 0.094015623 0.070533332
51 0.124515440 0.094015623
52 1.303294133 0.124515440
53 0.776525757 1.303294133
54 1.733436546 0.776525757
55 1.790543554 1.733436546
56 -0.709362026 1.790543554
57 -0.481013292 -0.709362026
58 -1.205433658 -0.481013292
59 -0.444306846 -1.205433658
60 -0.372035187 -0.444306846
61 -1.424417165 -0.372035187
62 -2.282032773 -1.424417165
63 -3.344955710 -2.282032773
64 -2.891251165 -3.344955710
65 0.279802974 -2.891251165
66 -3.207386286 0.279802974
67 -3.119105331 -3.207386286
68 -2.473372084 -3.119105331
69 -3.369376764 -2.473372084
70 -2.692399106 -3.369376764
71 -1.340659437 -2.692399106
72 -0.069290742 -1.340659437
73 -0.107249785 -0.069290742
74 0.030507535 -0.107249785
75 0.277382058 0.030507535
76 2.119777270 0.277382058
77 0.327022333 2.119777270
78 1.313306433 0.327022333
79 -1.959064443 1.313306433
80 -2.311134185 -1.959064443
81 -2.630692098 -2.311134185
82 -0.826567500 -2.630692098
83 2.477754264 -0.826567500
84 1.990668019 2.477754264
85 1.425092927 1.990668019
86 0.151241704 1.425092927
87 1.347178826 0.151241704
88 1.335057884 1.347178826
89 0.265530221 1.335057884
90 0.005323546 0.265530221
91 -0.515249064 0.005323546
92 -1.461818957 -0.515249064
93 -0.247380856 -1.461818957
94 0.354259705 -0.247380856
95 1.641418892 0.354259705
96 3.732767878 1.641418892
97 1.873220789 3.732767878
98 -0.398068014 1.873220789
99 0.696384733 -0.398068014
100 1.539237694 0.696384733
101 2.579010967 1.539237694
102 3.036421618 2.579010967
103 2.821781174 3.036421618
104 -0.503037697 2.821781174
105 -1.212296258 -0.503037697
106 -2.119795934 -1.212296258
107 -2.234035282 -2.119795934
108 0.350845474 -2.234035282
109 -1.866381899 0.350845474
110 -1.590192082 -1.866381899
111 -1.601073597 -1.590192082
112 -2.359049076 -1.601073597
113 -3.500662350 -2.359049076
114 -1.642084507 -3.500662350
115 -3.743127422 -1.642084507
116 -2.833884927 -3.743127422
117 -2.229966209 -2.833884927
118 -2.787191769 -2.229966209
119 -1.420156199 -2.787191769
120 -0.376910278 -1.420156199
121 1.732031878 -0.376910278
122 2.050812346 1.732031878
123 2.954461086 2.050812346
124 5.248618838 2.954461086
125 5.488592095 5.248618838
126 NA 5.488592095
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.196398259 -0.455771583
[2,] -2.436440221 -1.196398259
[3,] 1.830316003 -2.436440221
[4,] 0.120267184 1.830316003
[5,] 0.252544812 0.120267184
[6,] -0.725264383 0.252544812
[7,] 1.489843299 -0.725264383
[8,] -0.760692803 1.489843299
[9,] -0.409217687 -0.760692803
[10,] 0.410418866 -0.409217687
[11,] 1.747499519 0.410418866
[12,] 3.494001296 1.747499519
[13,] 3.796610278 3.494001296
[14,] 2.125237735 3.796610278
[15,] 2.542718566 2.125237735
[16,] 1.004024453 2.542718566
[17,] 1.689087595 1.004024453
[18,] 2.920442599 1.689087595
[19,] 2.185574208 2.920442599
[20,] 7.245526607 2.185574208
[21,] 0.500375334 7.245526607
[22,] 2.061671974 0.500375334
[23,] 2.488020711 2.061671974
[24,] 0.883705004 2.488020711
[25,] 4.064753354 0.883705004
[26,] 3.892829063 4.064753354
[27,] 2.037163227 3.892829063
[28,] -1.391887558 2.037163227
[29,] -0.879055775 -1.391887558
[30,] -1.961512084 -0.879055775
[31,] -1.269347847 -1.961512084
[32,] 1.229973381 -1.269347847
[33,] 1.850150260 1.229973381
[34,] 1.166801060 1.850150260
[35,] 0.168039710 1.166801060
[36,] -1.229916655 0.168039710
[37,] -0.271546440 -1.229916655
[38,] 0.257681340 -0.271546440
[39,] -1.339952988 0.257681340
[40,] -3.120605900 -1.339952988
[41,] -3.339140904 -3.120605900
[42,] -0.791305123 -3.339140904
[43,] -0.941174653 -0.791305123
[44,] -4.958780273 -0.941174653
[45,] -4.966306940 -4.958780273
[46,] -2.057730169 -4.966306940
[47,] -1.385904667 -2.057730169
[48,] -1.002232109 -1.385904667
[49,] 0.070533332 -1.002232109
[50,] 0.094015623 0.070533332
[51,] 0.124515440 0.094015623
[52,] 1.303294133 0.124515440
[53,] 0.776525757 1.303294133
[54,] 1.733436546 0.776525757
[55,] 1.790543554 1.733436546
[56,] -0.709362026 1.790543554
[57,] -0.481013292 -0.709362026
[58,] -1.205433658 -0.481013292
[59,] -0.444306846 -1.205433658
[60,] -0.372035187 -0.444306846
[61,] -1.424417165 -0.372035187
[62,] -2.282032773 -1.424417165
[63,] -3.344955710 -2.282032773
[64,] -2.891251165 -3.344955710
[65,] 0.279802974 -2.891251165
[66,] -3.207386286 0.279802974
[67,] -3.119105331 -3.207386286
[68,] -2.473372084 -3.119105331
[69,] -3.369376764 -2.473372084
[70,] -2.692399106 -3.369376764
[71,] -1.340659437 -2.692399106
[72,] -0.069290742 -1.340659437
[73,] -0.107249785 -0.069290742
[74,] 0.030507535 -0.107249785
[75,] 0.277382058 0.030507535
[76,] 2.119777270 0.277382058
[77,] 0.327022333 2.119777270
[78,] 1.313306433 0.327022333
[79,] -1.959064443 1.313306433
[80,] -2.311134185 -1.959064443
[81,] -2.630692098 -2.311134185
[82,] -0.826567500 -2.630692098
[83,] 2.477754264 -0.826567500
[84,] 1.990668019 2.477754264
[85,] 1.425092927 1.990668019
[86,] 0.151241704 1.425092927
[87,] 1.347178826 0.151241704
[88,] 1.335057884 1.347178826
[89,] 0.265530221 1.335057884
[90,] 0.005323546 0.265530221
[91,] -0.515249064 0.005323546
[92,] -1.461818957 -0.515249064
[93,] -0.247380856 -1.461818957
[94,] 0.354259705 -0.247380856
[95,] 1.641418892 0.354259705
[96,] 3.732767878 1.641418892
[97,] 1.873220789 3.732767878
[98,] -0.398068014 1.873220789
[99,] 0.696384733 -0.398068014
[100,] 1.539237694 0.696384733
[101,] 2.579010967 1.539237694
[102,] 3.036421618 2.579010967
[103,] 2.821781174 3.036421618
[104,] -0.503037697 2.821781174
[105,] -1.212296258 -0.503037697
[106,] -2.119795934 -1.212296258
[107,] -2.234035282 -2.119795934
[108,] 0.350845474 -2.234035282
[109,] -1.866381899 0.350845474
[110,] -1.590192082 -1.866381899
[111,] -1.601073597 -1.590192082
[112,] -2.359049076 -1.601073597
[113,] -3.500662350 -2.359049076
[114,] -1.642084507 -3.500662350
[115,] -3.743127422 -1.642084507
[116,] -2.833884927 -3.743127422
[117,] -2.229966209 -2.833884927
[118,] -2.787191769 -2.229966209
[119,] -1.420156199 -2.787191769
[120,] -0.376910278 -1.420156199
[121,] 1.732031878 -0.376910278
[122,] 2.050812346 1.732031878
[123,] 2.954461086 2.050812346
[124,] 5.248618838 2.954461086
[125,] 5.488592095 5.248618838
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.196398259 -0.455771583
2 -2.436440221 -1.196398259
3 1.830316003 -2.436440221
4 0.120267184 1.830316003
5 0.252544812 0.120267184
6 -0.725264383 0.252544812
7 1.489843299 -0.725264383
8 -0.760692803 1.489843299
9 -0.409217687 -0.760692803
10 0.410418866 -0.409217687
11 1.747499519 0.410418866
12 3.494001296 1.747499519
13 3.796610278 3.494001296
14 2.125237735 3.796610278
15 2.542718566 2.125237735
16 1.004024453 2.542718566
17 1.689087595 1.004024453
18 2.920442599 1.689087595
19 2.185574208 2.920442599
20 7.245526607 2.185574208
21 0.500375334 7.245526607
22 2.061671974 0.500375334
23 2.488020711 2.061671974
24 0.883705004 2.488020711
25 4.064753354 0.883705004
26 3.892829063 4.064753354
27 2.037163227 3.892829063
28 -1.391887558 2.037163227
29 -0.879055775 -1.391887558
30 -1.961512084 -0.879055775
31 -1.269347847 -1.961512084
32 1.229973381 -1.269347847
33 1.850150260 1.229973381
34 1.166801060 1.850150260
35 0.168039710 1.166801060
36 -1.229916655 0.168039710
37 -0.271546440 -1.229916655
38 0.257681340 -0.271546440
39 -1.339952988 0.257681340
40 -3.120605900 -1.339952988
41 -3.339140904 -3.120605900
42 -0.791305123 -3.339140904
43 -0.941174653 -0.791305123
44 -4.958780273 -0.941174653
45 -4.966306940 -4.958780273
46 -2.057730169 -4.966306940
47 -1.385904667 -2.057730169
48 -1.002232109 -1.385904667
49 0.070533332 -1.002232109
50 0.094015623 0.070533332
51 0.124515440 0.094015623
52 1.303294133 0.124515440
53 0.776525757 1.303294133
54 1.733436546 0.776525757
55 1.790543554 1.733436546
56 -0.709362026 1.790543554
57 -0.481013292 -0.709362026
58 -1.205433658 -0.481013292
59 -0.444306846 -1.205433658
60 -0.372035187 -0.444306846
61 -1.424417165 -0.372035187
62 -2.282032773 -1.424417165
63 -3.344955710 -2.282032773
64 -2.891251165 -3.344955710
65 0.279802974 -2.891251165
66 -3.207386286 0.279802974
67 -3.119105331 -3.207386286
68 -2.473372084 -3.119105331
69 -3.369376764 -2.473372084
70 -2.692399106 -3.369376764
71 -1.340659437 -2.692399106
72 -0.069290742 -1.340659437
73 -0.107249785 -0.069290742
74 0.030507535 -0.107249785
75 0.277382058 0.030507535
76 2.119777270 0.277382058
77 0.327022333 2.119777270
78 1.313306433 0.327022333
79 -1.959064443 1.313306433
80 -2.311134185 -1.959064443
81 -2.630692098 -2.311134185
82 -0.826567500 -2.630692098
83 2.477754264 -0.826567500
84 1.990668019 2.477754264
85 1.425092927 1.990668019
86 0.151241704 1.425092927
87 1.347178826 0.151241704
88 1.335057884 1.347178826
89 0.265530221 1.335057884
90 0.005323546 0.265530221
91 -0.515249064 0.005323546
92 -1.461818957 -0.515249064
93 -0.247380856 -1.461818957
94 0.354259705 -0.247380856
95 1.641418892 0.354259705
96 3.732767878 1.641418892
97 1.873220789 3.732767878
98 -0.398068014 1.873220789
99 0.696384733 -0.398068014
100 1.539237694 0.696384733
101 2.579010967 1.539237694
102 3.036421618 2.579010967
103 2.821781174 3.036421618
104 -0.503037697 2.821781174
105 -1.212296258 -0.503037697
106 -2.119795934 -1.212296258
107 -2.234035282 -2.119795934
108 0.350845474 -2.234035282
109 -1.866381899 0.350845474
110 -1.590192082 -1.866381899
111 -1.601073597 -1.590192082
112 -2.359049076 -1.601073597
113 -3.500662350 -2.359049076
114 -1.642084507 -3.500662350
115 -3.743127422 -1.642084507
116 -2.833884927 -3.743127422
117 -2.229966209 -2.833884927
118 -2.787191769 -2.229966209
119 -1.420156199 -2.787191769
120 -0.376910278 -1.420156199
121 1.732031878 -0.376910278
122 2.050812346 1.732031878
123 2.954461086 2.050812346
124 5.248618838 2.954461086
125 5.488592095 5.248618838
> 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/fisher/rcomp/tmp/7sy051356078680.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/fisher/rcomp/tmp/8qn6n1356078680.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/fisher/rcomp/tmp/92sc61356078680.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/fisher/rcomp/tmp/1061j31356078680.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/fisher/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/fisher/rcomp/tmp/11rzxh1356078680.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/fisher/rcomp/tmp/12xoki1356078680.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/fisher/rcomp/tmp/13igyu1356078680.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/fisher/rcomp/tmp/14ycqv1356078680.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/fisher/rcomp/tmp/156xly1356078680.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/fisher/rcomp/tmp/16xm7l1356078680.tab")
+ }
>
> try(system("convert tmp/1wjpl1356078680.ps tmp/1wjpl1356078680.png",intern=TRUE))
character(0)
> try(system("convert tmp/2juuh1356078680.ps tmp/2juuh1356078680.png",intern=TRUE))
character(0)
> try(system("convert tmp/3zque1356078680.ps tmp/3zque1356078680.png",intern=TRUE))
character(0)
> try(system("convert tmp/4a5ca1356078680.ps tmp/4a5ca1356078680.png",intern=TRUE))
character(0)
> try(system("convert tmp/5lq211356078680.ps tmp/5lq211356078680.png",intern=TRUE))
character(0)
> try(system("convert tmp/6exj31356078680.ps tmp/6exj31356078680.png",intern=TRUE))
character(0)
> try(system("convert tmp/7sy051356078680.ps tmp/7sy051356078680.png",intern=TRUE))
character(0)
> try(system("convert tmp/8qn6n1356078680.ps tmp/8qn6n1356078680.png",intern=TRUE))
character(0)
> try(system("convert tmp/92sc61356078680.ps tmp/92sc61356078680.png",intern=TRUE))
character(0)
> try(system("convert tmp/1061j31356078680.ps tmp/1061j31356078680.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.360 1.764 9.137