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(15.18
+ ,10.92
+ ,8.25
+ ,14.92
+ ,18.36
+ ,7.01
+ ,5.77
+ ,7.55
+ ,13.11
+ ,3.72
+ ,10.59
+ ,8.81
+ ,15.07
+ ,10.98
+ ,8.29
+ ,15.08
+ ,18.37
+ ,7.05
+ ,5.81
+ ,7.64
+ ,13.18
+ ,3.71
+ ,10.48
+ ,8.78
+ ,15.15
+ ,11.15
+ ,8.34
+ ,15.15
+ ,18.41
+ ,7.02
+ ,5.78
+ ,7.61
+ ,12.91
+ ,3.7
+ ,10.51
+ ,8.49
+ ,15.24
+ ,11.19
+ ,8.53
+ ,14.98
+ ,18.72
+ ,7.07
+ ,5.75
+ ,7.61
+ ,12.29
+ ,3.66
+ ,10.36
+ ,8.56
+ ,15.12
+ ,11.33
+ ,8.58
+ ,14.87
+ ,18.86
+ ,7.05
+ ,5.64
+ ,7.55
+ ,13.12
+ ,3.65
+ ,10.45
+ ,8.69
+ ,15.31
+ ,11.38
+ ,8.63
+ ,15.24
+ ,18.99
+ ,7.02
+ ,5.66
+ ,7.57
+ ,13.04
+ ,3.71
+ ,10.45
+ ,8.49
+ ,15.45
+ ,11.4
+ ,8.58
+ ,15.41
+ ,19.01
+ ,7.11
+ ,5.71
+ ,7.67
+ ,13.24
+ ,3.7
+ ,10.58
+ ,8.45
+ ,15.46
+ ,11.45
+ ,8.66
+ ,15.52
+ ,19.2
+ ,7.19
+ ,5.78
+ ,7.63
+ ,13.11
+ ,3.69
+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9.52
+ ,16.77
+ ,13.18
+ ,9.89
+ ,16.6
+ ,21.34
+ ,7.75
+ ,6.09
+ ,8.58
+ ,14.9
+ ,4.19
+ ,12.86
+ ,9.25
+ ,16.76
+ ,13.1
+ ,10.01
+ ,16.6
+ ,21.18
+ ,7.64
+ ,6.03
+ ,8.62
+ ,15.07
+ ,4.22
+ ,12.82
+ ,9.6
+ ,16.58
+ ,13.23
+ ,10.02
+ ,16.54
+ ,21.26
+ ,7.63
+ ,6.13
+ ,8.57
+ ,15.2
+ ,4.14
+ ,12.96
+ ,9.27
+ ,16.69
+ ,13.33
+ ,10.07
+ ,16.62
+ ,21.2
+ ,7.68
+ ,6.17
+ ,8.45
+ ,14.35
+ ,4.17
+ ,13.09
+ ,9.15
+ ,16.85
+ ,13.38
+ ,10.14
+ ,16.72
+ ,21.31
+ ,7.68
+ ,6.21
+ ,8.59
+ ,14.95
+ ,4.15
+ ,12.95
+ ,9.42
+ ,16.84
+ ,13.26
+ ,10.08
+ ,16.76
+ ,21.32
+ ,7.67
+ ,6.25
+ ,8.66
+ ,14.94
+ ,4.16
+ ,12.97
+ ,9.37
+ ,16.88
+ ,13.17
+ ,10.08
+ ,16.68
+ ,21.47
+ ,7.74
+ ,6.3
+ ,8.6
+ ,14.99
+ ,4.18
+ ,12.89
+ ,9.51)
+ ,dim=c(12
+ ,79)
+ ,dimnames=list(c('Rosbief'
+ ,'Biefstuk'
+ ,'Karbonade'
+ ,'Dunne_lende'
+ ,'Kalfsgebraad'
+ ,'Varkensrib_filet'
+ ,'Varkensrib_spiering'
+ ,'Varkensgebraad_van_de_hesp'
+ ,'Lamsbout'
+ ,'Braadkip'
+ ,'Kalkoenborstfilet'
+ ,'Konijn')
+ ,1:79))
> y <- array(NA,dim=c(12,79),dimnames=list(c('Rosbief','Biefstuk','Karbonade','Dunne_lende','Kalfsgebraad','Varkensrib_filet','Varkensrib_spiering','Varkensgebraad_van_de_hesp','Lamsbout','Braadkip','Kalkoenborstfilet','Konijn'),1:79))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> 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
Rosbief Biefstuk Karbonade Dunne_lende Kalfsgebraad Varkensrib_filet
1 15.18 10.92 8.25 14.92 18.36 7.01
2 15.07 10.98 8.29 15.08 18.37 7.05
3 15.15 11.15 8.34 15.15 18.41 7.02
4 15.24 11.19 8.53 14.98 18.72 7.07
5 15.12 11.33 8.58 14.87 18.86 7.05
6 15.31 11.38 8.63 15.24 18.99 7.02
7 15.45 11.40 8.58 15.41 19.01 7.11
8 15.46 11.45 8.66 15.52 19.20 7.19
9 15.65 11.56 8.65 15.64 19.29 7.25
10 15.67 11.61 8.78 15.75 19.29 7.29
11 15.68 11.82 8.81 15.73 19.35 7.36
12 15.80 11.77 8.78 15.71 19.39 7.32
13 15.88 11.85 8.66 15.74 19.46 7.30
14 15.74 11.82 8.81 15.86 19.52 7.30
15 15.81 11.92 8.93 15.79 19.43 7.37
16 15.79 11.86 8.91 15.83 19.47 7.33
17 15.86 11.87 8.81 15.93 19.55 7.39
18 15.90 11.94 9.02 15.93 19.59 7.36
19 15.84 11.86 8.95 15.99 19.65 7.39
20 15.82 11.92 9.01 15.99 19.59 7.39
21 15.85 11.83 8.89 15.97 19.78 7.31
22 15.73 11.91 8.90 15.98 19.97 7.36
23 15.87 11.93 8.88 15.85 20.22 7.32
24 15.88 11.99 8.82 16.00 20.20 7.32
25 15.84 11.96 8.75 15.86 20.32 7.38
26 15.88 12.12 9.01 16.03 20.34 7.35
27 15.87 11.85 8.85 16.03 20.56 7.35
28 15.88 12.01 8.97 16.06 20.64 7.35
29 15.92 12.10 9.10 16.17 20.63 7.40
30 15.96 12.21 9.09 16.07 20.74 7.38
31 16.02 12.31 9.18 16.04 20.80 7.46
32 15.91 12.31 9.15 16.22 20.90 7.44
33 15.97 12.39 9.17 16.02 20.98 7.37
34 15.96 12.35 9.08 16.11 20.99 7.47
35 15.94 12.41 9.16 16.27 20.94 7.46
36 16.08 12.51 9.21 16.17 20.94 7.42
37 16.00 12.27 9.19 16.21 21.04 7.50
38 16.18 12.51 9.41 16.20 20.90 7.34
39 16.07 12.44 9.32 16.15 21.19 7.51
40 16.14 12.47 9.24 16.28 21.11 7.44
41 16.25 12.51 9.43 16.27 20.98 7.45
42 16.18 12.58 9.44 16.31 21.09 7.47
43 16.11 12.50 9.35 16.28 21.05 7.44
44 16.05 12.52 9.46 16.23 21.03 7.43
45 16.14 12.59 9.45 16.31 20.87 7.46
46 16.08 12.51 9.45 16.24 20.92 7.36
47 15.97 12.67 9.44 16.23 21.05 7.46
48 16.08 12.64 9.52 16.08 20.84 7.27
49 16.15 12.54 9.32 16.24 20.99 7.45
50 16.19 12.60 9.41 16.22 20.95 7.42
51 16.12 12.67 9.35 16.34 21.01 7.37
52 16.14 12.62 9.41 16.31 21.03 7.38
53 16.15 12.72 9.54 16.28 20.69 7.36
54 16.12 12.85 9.51 16.21 20.98 7.43
55 16.19 12.85 9.62 16.39 21.03 7.41
56 16.37 12.82 9.67 16.39 20.98 7.48
57 16.31 12.79 9.58 16.45 21.01 7.54
58 16.24 12.94 9.69 16.48 20.99 7.47
59 16.23 12.71 9.69 16.36 20.99 7.47
60 16.27 12.56 9.56 16.29 20.91 7.47
61 16.42 12.64 9.43 16.37 21.01 7.50
62 16.53 12.70 9.63 16.46 20.89 7.45
63 16.40 12.74 9.68 16.30 21.03 7.40
64 16.41 12.85 9.65 16.45 20.86 7.32
65 16.42 12.84 9.82 16.41 20.83 7.37
66 16.62 12.83 9.77 16.58 20.95 7.40
67 16.51 12.88 9.84 16.47 21.09 7.40
68 16.46 13.07 9.91 16.65 21.31 7.54
69 16.48 12.99 9.86 16.62 21.43 7.59
70 16.47 13.20 9.98 16.69 21.39 7.55
71 16.66 13.23 9.99 16.78 21.48 7.66
72 16.67 13.18 9.91 16.64 21.43 7.64
73 16.77 13.18 9.89 16.60 21.34 7.75
74 16.76 13.10 10.01 16.60 21.18 7.64
75 16.58 13.23 10.02 16.54 21.26 7.63
76 16.69 13.33 10.07 16.62 21.20 7.68
77 16.85 13.38 10.14 16.72 21.31 7.68
78 16.84 13.26 10.08 16.76 21.32 7.67
79 16.88 13.17 10.08 16.68 21.47 7.74
Varkensrib_spiering Varkensgebraad_van_de_hesp Lamsbout Braadkip
1 5.77 7.55 13.11 3.72
2 5.81 7.64 13.18 3.71
3 5.78 7.61 12.91 3.70
4 5.75 7.61 12.29 3.66
5 5.64 7.55 13.12 3.65
6 5.66 7.57 13.04 3.71
7 5.71 7.67 13.24 3.70
8 5.78 7.63 13.11 3.69
9 5.84 7.66 12.55 3.73
10 5.87 7.81 13.20 3.78
11 5.91 7.82 12.92 3.74
12 5.92 7.86 13.08 3.80
13 5.85 7.80 13.18 3.72
14 5.86 7.89 13.32 3.79
15 5.85 7.82 13.08 3.78
16 5.86 7.85 12.77 3.71
17 5.89 7.88 12.90 3.79
18 5.86 7.78 13.23 3.81
19 5.86 7.94 13.45 3.83
20 5.90 7.92 13.44 3.84
21 5.89 7.88 13.60 3.88
22 5.86 7.91 13.70 3.96
23 5.90 7.88 13.89 3.91
24 5.87 7.96 13.65 3.99
25 5.88 7.91 13.79 3.96
26 5.85 7.96 13.76 4.00
27 5.84 7.90 13.84 3.97
28 5.82 7.99 13.74 4.02
29 5.84 7.96 13.47 3.98
30 5.84 7.93 13.88 4.02
31 5.87 8.04 13.85 4.03
32 5.93 8.05 13.94 4.03
33 5.92 8.03 14.01 4.04
34 5.94 8.16 13.65 4.06
35 5.93 8.16 13.95 4.09
36 5.90 8.15 14.11 4.08
37 5.96 8.07 14.15 4.15
38 5.93 8.16 14.22 4.15
39 5.99 8.14 13.73 4.07
40 5.97 8.06 13.40 4.06
41 5.95 8.26 13.97 4.09
42 5.99 7.98 13.96 4.02
43 5.99 8.19 13.62 4.05
44 5.97 8.19 13.83 4.10
45 5.97 8.10 13.89 4.12
46 5.96 8.02 13.63 4.15
47 5.96 7.91 13.41 4.12
48 5.84 8.12 13.91 4.16
49 5.90 8.16 14.03 4.06
50 5.93 8.17 14.11 4.09
51 5.92 8.17 14.21 4.05
52 5.94 8.19 13.56 3.99
53 5.92 8.20 13.86 4.00
54 5.92 8.15 13.76 4.06
55 5.93 8.26 13.96 4.03
56 5.96 8.29 13.99 4.04
57 5.95 8.17 13.97 4.05
58 5.98 8.33 13.92 4.12
59 5.94 8.23 14.13 4.05
60 5.99 8.14 14.19 4.15
61 5.98 8.19 14.03 4.08
62 5.96 8.19 14.34 4.10
63 6.03 8.42 14.25 4.07
64 6.05 8.34 14.35 4.08
65 6.04 8.35 14.45 4.11
66 6.07 8.47 14.48 4.09
67 6.03 8.50 14.58 4.12
68 6.06 8.54 14.77 4.12
69 5.94 8.49 14.88 4.11
70 5.92 8.45 14.94 4.20
71 5.99 8.51 15.00 4.16
72 6.02 8.51 15.13 4.16
73 6.09 8.58 14.90 4.19
74 6.03 8.62 15.07 4.22
75 6.13 8.57 15.20 4.14
76 6.17 8.45 14.35 4.17
77 6.21 8.59 14.95 4.15
78 6.25 8.66 14.94 4.16
79 6.30 8.60 14.99 4.18
Kalkoenborstfilet Konijn
1 10.59 8.81
2 10.48 8.78
3 10.51 8.49
4 10.36 8.56
5 10.45 8.69
6 10.45 8.49
7 10.58 8.45
8 10.58 8.33
9 10.55 8.36
10 10.59 8.54
11 10.70 8.74
12 10.57 8.81
13 10.63 8.80
14 10.67 8.73
15 10.65 8.23
16 10.66 8.48
17 10.61 8.19
18 10.73 8.24
19 10.74 8.03
20 10.74 8.24
21 10.80 8.21
22 11.02 8.56
23 11.32 8.72
24 11.31 8.70
25 11.62 8.69
26 11.70 8.65
27 11.87 8.52
28 11.91 8.61
29 11.99 8.55
30 11.91 8.65
31 11.93 8.68
32 12.04 8.46
33 12.09 8.51
34 12.02 8.62
35 12.02 8.85
36 12.05 8.88
37 12.08 8.87
38 12.10 8.82
39 12.04 9.12
40 12.04 8.90
41 11.96 8.89
42 12.03 8.82
43 12.21 8.72
44 12.21 8.58
45 12.26 8.68
46 12.24 8.72
47 12.07 9.02
48 12.27 8.93
49 12.12 8.94
50 12.02 9.03
51 12.05 9.16
52 12.14 9.01
53 12.15 8.95
54 12.15 8.84
55 12.29 8.71
56 12.21 8.79
57 12.25 8.65
58 12.37 8.95
59 12.47 9.02
60 12.57 8.94
61 12.57 9.16
62 12.46 9.21
63 12.48 9.13
64 12.54 9.31
65 12.69 9.20
66 12.65 9.27
67 12.70 9.26
68 12.67 9.41
69 12.66 9.38
70 12.65 9.44
71 12.82 9.48
72 12.91 9.52
73 12.86 9.25
74 12.82 9.60
75 12.96 9.27
76 13.09 9.15
77 12.95 9.42
78 12.97 9.37
79 12.89 9.51
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Biefstuk
1.65421 0.04420
Karbonade Dunne_lende
0.18682 0.43130
Kalfsgebraad Varkensrib_filet
-0.04850 0.28164
Varkensrib_spiering Varkensgebraad_van_de_hesp
0.44206 0.11567
Lamsbout Braadkip
0.04497 -0.28480
Kalkoenborstfilet Konijn
0.03409 0.07244
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.198282 -0.048959 0.007072 0.054621 0.180062
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.65421 0.90454 1.829 0.0719 .
Biefstuk 0.04420 0.12428 0.356 0.7232
Karbonade 0.18682 0.12448 1.501 0.1381
Dunne_lende 0.43130 0.09876 4.367 4.47e-05 ***
Kalfsgebraad -0.04850 0.06154 -0.788 0.4334
Varkensrib_filet 0.28164 0.16601 1.697 0.0944 .
Varkensrib_spiering 0.44206 0.19654 2.249 0.0278 *
Varkensgebraad_van_de_hesp 0.11567 0.15236 0.759 0.4504
Lamsbout 0.04497 0.04365 1.030 0.3066
Braadkip -0.28480 0.23823 -1.195 0.2361
Kalkoenborstfilet 0.03409 0.06056 0.563 0.5754
Konijn 0.07244 0.05358 1.352 0.1809
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.08251 on 67 degrees of freedom
Multiple R-squared: 0.9658, Adjusted R-squared: 0.9601
F-statistic: 171.8 on 11 and 67 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.8075394 0.3849212 0.1924606
[2,] 0.7830180 0.4339641 0.2169820
[3,] 0.7687200 0.4625601 0.2312800
[4,] 0.7186957 0.5626087 0.2813043
[5,] 0.6219791 0.7560418 0.3780209
[6,] 0.5273745 0.9452509 0.4726255
[7,] 0.4451008 0.8902015 0.5548992
[8,] 0.7302103 0.5395794 0.2697897
[9,] 0.6711334 0.6577332 0.3288666
[10,] 0.5864266 0.8271467 0.4135734
[11,] 0.4974446 0.9948892 0.5025554
[12,] 0.4369324 0.8738648 0.5630676
[13,] 0.3705429 0.7410858 0.6294571
[14,] 0.2974740 0.5949479 0.7025260
[15,] 0.2425327 0.4850653 0.7574673
[16,] 0.1821883 0.3643765 0.8178117
[17,] 0.1389524 0.2779048 0.8610476
[18,] 0.2871783 0.5743566 0.7128217
[19,] 0.2372662 0.4745323 0.7627338
[20,] 0.2034038 0.4068077 0.7965962
[21,] 0.3821162 0.7642324 0.6178838
[22,] 0.3576511 0.7153022 0.6423489
[23,] 0.4582821 0.9165641 0.5417179
[24,] 0.6244160 0.7511679 0.3755840
[25,] 0.5986870 0.8026261 0.4013130
[26,] 0.5535546 0.8928908 0.4464454
[27,] 0.6073594 0.7852811 0.3926406
[28,] 0.5940140 0.8119721 0.4059860
[29,] 0.5318859 0.9362281 0.4681141
[30,] 0.5026909 0.9946182 0.4973091
[31,] 0.4913772 0.9827544 0.5086228
[32,] 0.4152867 0.8305733 0.5847133
[33,] 0.5393957 0.9212085 0.4606043
[34,] 0.5534510 0.8930979 0.4465490
[35,] 0.4839120 0.9678241 0.5160880
[36,] 0.4123659 0.8247318 0.5876341
[37,] 0.4379681 0.8759362 0.5620319
[38,] 0.3705446 0.7410892 0.6294554
[39,] 0.4035877 0.8071754 0.5964123
[40,] 0.3308178 0.6616355 0.6691822
[41,] 0.2717466 0.5434933 0.7282534
[42,] 0.3404455 0.6808910 0.6595545
[43,] 0.3783937 0.7567873 0.6216063
[44,] 0.3622778 0.7245556 0.6377222
[45,] 0.3473390 0.6946779 0.6526610
[46,] 0.4085753 0.8171507 0.5914247
[47,] 0.4645594 0.9291188 0.5354406
[48,] 0.4437747 0.8875495 0.5562253
[49,] 0.4038964 0.8077928 0.5961036
[50,] 0.2606455 0.5212910 0.7393545
> postscript(file="/var/fisher/rcomp/tmp/1rcdu1353474192.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/2zs3d1353474192.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/3covf1353474192.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/41tj61353474192.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/5e6lp1353474192.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 79
Frequency = 1
1 2 3 4 5 6
0.029796011 -0.198281789 -0.108926820 0.047874892 -0.024879432 0.032764308
7 8 9 10 11 12
0.036478074 -0.046061791 0.082086116 -0.043124403 -0.092068404 0.057784333
13 14 15 16 17 18
0.162038708 -0.050987478 0.055650823 0.005653959 0.060666810 0.076701367
19 20 21 22 23 24
-0.005934025 -0.069989914 0.040151612 -0.099208913 0.064288138 0.056555483
25 26 27 28 29 30
0.056941945 -0.002215663 0.043121703 0.023856082 -0.029420700 0.053591638
31 32 33 34 35 36
0.061031750 -0.130053345 0.033635654 -0.031854147 -0.155255990 0.026557459
37 38 39 40 41 42
-0.073461503 0.100057931 -0.046929706 0.042480544 0.082477923 -0.012129055
43 44 45 46 47 48
-0.041681472 -0.075924788 -0.033403905 0.002605649 -0.132008083 0.089756973
49 50 51 52 53 54
0.028477622 0.051563906 -0.066992879 -0.036115135 -0.051693306 -0.021955184
55 56 57 58 59 60
-0.072118670 0.059425255 0.007071819 -0.119712174 -0.076401344 0.037302451
61 62 63 64 65 66
0.139908989 0.180062256 0.071900428 0.015913167 0.006476090 0.102415110
67 68 69 70 71 72
0.048639420 -0.165504388 -0.074399925 -0.104569259 -0.043862925 0.021808401
73 74 75 76 77 78
0.108561743 0.101702476 -0.101255414 -0.009285297 0.016292236 -0.010686268
79
0.036226240
> postscript(file="/var/fisher/rcomp/tmp/6jrap1353474192.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 79
Frequency = 1
lag(myerror, k = 1) myerror
0 0.029796011 NA
1 -0.198281789 0.029796011
2 -0.108926820 -0.198281789
3 0.047874892 -0.108926820
4 -0.024879432 0.047874892
5 0.032764308 -0.024879432
6 0.036478074 0.032764308
7 -0.046061791 0.036478074
8 0.082086116 -0.046061791
9 -0.043124403 0.082086116
10 -0.092068404 -0.043124403
11 0.057784333 -0.092068404
12 0.162038708 0.057784333
13 -0.050987478 0.162038708
14 0.055650823 -0.050987478
15 0.005653959 0.055650823
16 0.060666810 0.005653959
17 0.076701367 0.060666810
18 -0.005934025 0.076701367
19 -0.069989914 -0.005934025
20 0.040151612 -0.069989914
21 -0.099208913 0.040151612
22 0.064288138 -0.099208913
23 0.056555483 0.064288138
24 0.056941945 0.056555483
25 -0.002215663 0.056941945
26 0.043121703 -0.002215663
27 0.023856082 0.043121703
28 -0.029420700 0.023856082
29 0.053591638 -0.029420700
30 0.061031750 0.053591638
31 -0.130053345 0.061031750
32 0.033635654 -0.130053345
33 -0.031854147 0.033635654
34 -0.155255990 -0.031854147
35 0.026557459 -0.155255990
36 -0.073461503 0.026557459
37 0.100057931 -0.073461503
38 -0.046929706 0.100057931
39 0.042480544 -0.046929706
40 0.082477923 0.042480544
41 -0.012129055 0.082477923
42 -0.041681472 -0.012129055
43 -0.075924788 -0.041681472
44 -0.033403905 -0.075924788
45 0.002605649 -0.033403905
46 -0.132008083 0.002605649
47 0.089756973 -0.132008083
48 0.028477622 0.089756973
49 0.051563906 0.028477622
50 -0.066992879 0.051563906
51 -0.036115135 -0.066992879
52 -0.051693306 -0.036115135
53 -0.021955184 -0.051693306
54 -0.072118670 -0.021955184
55 0.059425255 -0.072118670
56 0.007071819 0.059425255
57 -0.119712174 0.007071819
58 -0.076401344 -0.119712174
59 0.037302451 -0.076401344
60 0.139908989 0.037302451
61 0.180062256 0.139908989
62 0.071900428 0.180062256
63 0.015913167 0.071900428
64 0.006476090 0.015913167
65 0.102415110 0.006476090
66 0.048639420 0.102415110
67 -0.165504388 0.048639420
68 -0.074399925 -0.165504388
69 -0.104569259 -0.074399925
70 -0.043862925 -0.104569259
71 0.021808401 -0.043862925
72 0.108561743 0.021808401
73 0.101702476 0.108561743
74 -0.101255414 0.101702476
75 -0.009285297 -0.101255414
76 0.016292236 -0.009285297
77 -0.010686268 0.016292236
78 0.036226240 -0.010686268
79 NA 0.036226240
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.198281789 0.029796011
[2,] -0.108926820 -0.198281789
[3,] 0.047874892 -0.108926820
[4,] -0.024879432 0.047874892
[5,] 0.032764308 -0.024879432
[6,] 0.036478074 0.032764308
[7,] -0.046061791 0.036478074
[8,] 0.082086116 -0.046061791
[9,] -0.043124403 0.082086116
[10,] -0.092068404 -0.043124403
[11,] 0.057784333 -0.092068404
[12,] 0.162038708 0.057784333
[13,] -0.050987478 0.162038708
[14,] 0.055650823 -0.050987478
[15,] 0.005653959 0.055650823
[16,] 0.060666810 0.005653959
[17,] 0.076701367 0.060666810
[18,] -0.005934025 0.076701367
[19,] -0.069989914 -0.005934025
[20,] 0.040151612 -0.069989914
[21,] -0.099208913 0.040151612
[22,] 0.064288138 -0.099208913
[23,] 0.056555483 0.064288138
[24,] 0.056941945 0.056555483
[25,] -0.002215663 0.056941945
[26,] 0.043121703 -0.002215663
[27,] 0.023856082 0.043121703
[28,] -0.029420700 0.023856082
[29,] 0.053591638 -0.029420700
[30,] 0.061031750 0.053591638
[31,] -0.130053345 0.061031750
[32,] 0.033635654 -0.130053345
[33,] -0.031854147 0.033635654
[34,] -0.155255990 -0.031854147
[35,] 0.026557459 -0.155255990
[36,] -0.073461503 0.026557459
[37,] 0.100057931 -0.073461503
[38,] -0.046929706 0.100057931
[39,] 0.042480544 -0.046929706
[40,] 0.082477923 0.042480544
[41,] -0.012129055 0.082477923
[42,] -0.041681472 -0.012129055
[43,] -0.075924788 -0.041681472
[44,] -0.033403905 -0.075924788
[45,] 0.002605649 -0.033403905
[46,] -0.132008083 0.002605649
[47,] 0.089756973 -0.132008083
[48,] 0.028477622 0.089756973
[49,] 0.051563906 0.028477622
[50,] -0.066992879 0.051563906
[51,] -0.036115135 -0.066992879
[52,] -0.051693306 -0.036115135
[53,] -0.021955184 -0.051693306
[54,] -0.072118670 -0.021955184
[55,] 0.059425255 -0.072118670
[56,] 0.007071819 0.059425255
[57,] -0.119712174 0.007071819
[58,] -0.076401344 -0.119712174
[59,] 0.037302451 -0.076401344
[60,] 0.139908989 0.037302451
[61,] 0.180062256 0.139908989
[62,] 0.071900428 0.180062256
[63,] 0.015913167 0.071900428
[64,] 0.006476090 0.015913167
[65,] 0.102415110 0.006476090
[66,] 0.048639420 0.102415110
[67,] -0.165504388 0.048639420
[68,] -0.074399925 -0.165504388
[69,] -0.104569259 -0.074399925
[70,] -0.043862925 -0.104569259
[71,] 0.021808401 -0.043862925
[72,] 0.108561743 0.021808401
[73,] 0.101702476 0.108561743
[74,] -0.101255414 0.101702476
[75,] -0.009285297 -0.101255414
[76,] 0.016292236 -0.009285297
[77,] -0.010686268 0.016292236
[78,] 0.036226240 -0.010686268
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.198281789 0.029796011
2 -0.108926820 -0.198281789
3 0.047874892 -0.108926820
4 -0.024879432 0.047874892
5 0.032764308 -0.024879432
6 0.036478074 0.032764308
7 -0.046061791 0.036478074
8 0.082086116 -0.046061791
9 -0.043124403 0.082086116
10 -0.092068404 -0.043124403
11 0.057784333 -0.092068404
12 0.162038708 0.057784333
13 -0.050987478 0.162038708
14 0.055650823 -0.050987478
15 0.005653959 0.055650823
16 0.060666810 0.005653959
17 0.076701367 0.060666810
18 -0.005934025 0.076701367
19 -0.069989914 -0.005934025
20 0.040151612 -0.069989914
21 -0.099208913 0.040151612
22 0.064288138 -0.099208913
23 0.056555483 0.064288138
24 0.056941945 0.056555483
25 -0.002215663 0.056941945
26 0.043121703 -0.002215663
27 0.023856082 0.043121703
28 -0.029420700 0.023856082
29 0.053591638 -0.029420700
30 0.061031750 0.053591638
31 -0.130053345 0.061031750
32 0.033635654 -0.130053345
33 -0.031854147 0.033635654
34 -0.155255990 -0.031854147
35 0.026557459 -0.155255990
36 -0.073461503 0.026557459
37 0.100057931 -0.073461503
38 -0.046929706 0.100057931
39 0.042480544 -0.046929706
40 0.082477923 0.042480544
41 -0.012129055 0.082477923
42 -0.041681472 -0.012129055
43 -0.075924788 -0.041681472
44 -0.033403905 -0.075924788
45 0.002605649 -0.033403905
46 -0.132008083 0.002605649
47 0.089756973 -0.132008083
48 0.028477622 0.089756973
49 0.051563906 0.028477622
50 -0.066992879 0.051563906
51 -0.036115135 -0.066992879
52 -0.051693306 -0.036115135
53 -0.021955184 -0.051693306
54 -0.072118670 -0.021955184
55 0.059425255 -0.072118670
56 0.007071819 0.059425255
57 -0.119712174 0.007071819
58 -0.076401344 -0.119712174
59 0.037302451 -0.076401344
60 0.139908989 0.037302451
61 0.180062256 0.139908989
62 0.071900428 0.180062256
63 0.015913167 0.071900428
64 0.006476090 0.015913167
65 0.102415110 0.006476090
66 0.048639420 0.102415110
67 -0.165504388 0.048639420
68 -0.074399925 -0.165504388
69 -0.104569259 -0.074399925
70 -0.043862925 -0.104569259
71 0.021808401 -0.043862925
72 0.108561743 0.021808401
73 0.101702476 0.108561743
74 -0.101255414 0.101702476
75 -0.009285297 -0.101255414
76 0.016292236 -0.009285297
77 -0.010686268 0.016292236
78 0.036226240 -0.010686268
> 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/78mhu1353474192.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/8vksd1353474192.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/90lnd1353474192.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/10safe1353474192.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/11caxk1353474192.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/12b9a81353474192.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/13yrkc1353474192.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/14qdg21353474192.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/15xd9x1353474192.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/16khen1353474192.tab")
+ }
>
> try(system("convert tmp/1rcdu1353474192.ps tmp/1rcdu1353474192.png",intern=TRUE))
character(0)
> try(system("convert tmp/2zs3d1353474192.ps tmp/2zs3d1353474192.png",intern=TRUE))
character(0)
> try(system("convert tmp/3covf1353474192.ps tmp/3covf1353474192.png",intern=TRUE))
character(0)
> try(system("convert tmp/41tj61353474192.ps tmp/41tj61353474192.png",intern=TRUE))
character(0)
> try(system("convert tmp/5e6lp1353474192.ps tmp/5e6lp1353474192.png",intern=TRUE))
character(0)
> try(system("convert tmp/6jrap1353474192.ps tmp/6jrap1353474192.png",intern=TRUE))
character(0)
> try(system("convert tmp/78mhu1353474192.ps tmp/78mhu1353474192.png",intern=TRUE))
character(0)
> try(system("convert tmp/8vksd1353474192.ps tmp/8vksd1353474192.png",intern=TRUE))
character(0)
> try(system("convert tmp/90lnd1353474192.ps tmp/90lnd1353474192.png",intern=TRUE))
character(0)
> try(system("convert tmp/10safe1353474192.ps tmp/10safe1353474192.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
6.743 1.434 8.182