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(103.48
+ ,105.16
+ ,100.44
+ ,100.76
+ ,105.01
+ ,96.84
+ ,104.85
+ ,103.75
+ ,103.51
+ ,103.93
+ ,105.16
+ ,100.47
+ ,100.89
+ ,105.06
+ ,96.15
+ ,104.85
+ ,104.35
+ ,103.87
+ ,103.89
+ ,105.16
+ ,100.49
+ ,100.88
+ ,105.06
+ ,95.46
+ ,104.85
+ ,104.51
+ ,103.98
+ ,104.40
+ ,105.16
+ ,100.52
+ ,101.12
+ ,105.01
+ ,95.35
+ ,104.85
+ ,105.25
+ ,104.10
+ ,104.79
+ ,105.16
+ ,100.47
+ ,101.30
+ ,105.08
+ ,95.23
+ ,104.85
+ ,105.20
+ ,104.36
+ ,104.77
+ ,105.17
+ ,100.48
+ ,101.36
+ ,104.74
+ ,95.08
+ ,104.85
+ ,105.87
+ ,104.47
+ ,105.13
+ ,105.17
+ ,100.48
+ ,101.42
+ ,104.45
+ ,95.02
+ ,104.85
+ ,107.63
+ ,104.99
+ ,105.26
+ ,105.54
+ ,100.53
+ ,101.49
+ ,104.49
+ ,94.96
+ ,104.85
+ ,107.77
+ ,105.09
+ ,104.96
+ ,106.90
+ ,100.62
+ ,101.63
+ ,104.57
+ ,94.29
+ ,104.85
+ ,106.58
+ ,105.28
+ ,104.75
+ ,107.27
+ ,100.89
+ ,101.73
+ ,104.59
+ ,94.49
+ ,107.35
+ ,106.32
+ ,105.46
+ ,105.01
+ ,107.31
+ ,100.97
+ ,101.94
+ ,104.62
+ ,94.51
+ ,107.35
+ ,106.30
+ ,105.61
+ ,105.15
+ ,107.39
+ ,101.01
+ ,102.03
+ ,104.64
+ ,94.79
+ ,107.35
+ ,106.38
+ ,105.66
+ ,105.20
+ ,107.41
+ ,101.02
+ ,102.15
+ ,105.26
+ ,94.67
+ ,107.35
+ ,106.42
+ ,106.98
+ ,105.77
+ ,107.46
+ ,100.92
+ ,102.43
+ ,105.39
+ ,94.69
+ ,107.35
+ ,107.35
+ ,107.16
+ ,105.78
+ ,113.14
+ ,100.93
+ ,102.61
+ ,105.33
+ ,94.78
+ ,107.35
+ ,107.58
+ ,107.79
+ ,106.26
+ ,117.00
+ ,100.98
+ ,102.75
+ ,105.18
+ ,95.02
+ ,107.35
+ ,108.20
+ ,108.45
+ ,106.13
+ ,119.28
+ ,101.07
+ ,102.95
+ ,105.02
+ ,94.09
+ ,107.35
+ ,108.29
+ ,108.58
+ ,106.12
+ ,119.39
+ ,101.10
+ ,103.11
+ ,104.23
+ ,91.98
+ ,107.35
+ ,108.76
+ ,108.65
+ ,106.57
+ ,119.50
+ ,101.11
+ ,103.69
+ ,104.30
+ ,91.63
+ ,107.35
+ ,110.69
+ ,108.92
+ ,106.44
+ ,119.67
+ ,101.19
+ ,104.22
+ ,104.31
+ ,91.22
+ ,107.35
+ ,110.56
+ ,108.94
+ ,106.54
+ ,119.67
+ ,101.31
+ ,104.29
+ ,104.32
+ ,90.03
+ ,107.35
+ ,108.81
+ ,108.88
+ ,107.10
+ ,119.73
+ ,101.52
+ ,104.49
+ ,104.00
+ ,90.14
+ ,109.47
+ ,108.81
+ ,108.99
+ ,108.10
+ ,119.77
+ ,101.61
+ ,104.62
+ ,104.03
+ ,89.96
+ ,109.47
+ ,108.81
+ ,109.10
+ ,108.40
+ ,119.77
+ ,101.65
+ ,104.76
+ ,104.10
+ ,89.97
+ ,109.47
+ ,109.74
+ ,109.20
+ ,108.84
+ ,119.78
+ ,101.66
+ ,104.88
+ ,104.36
+ ,89.98
+ ,109.47
+ ,109.57
+ ,109.68
+ ,109.62
+ ,119.78
+ ,101.56
+ ,105.09
+ ,103.60
+ ,90.10
+ ,109.47
+ ,110.44
+ ,110.02
+ ,110.42
+ ,119.78
+ ,101.75
+ ,105.31
+ ,103.69
+ ,90.13
+ ,109.47
+ ,111.20
+ ,110.32
+ ,110.67
+ ,121.28
+ ,101.83
+ ,105.48
+ ,103.78
+ ,89.60
+ ,109.47
+ ,111.44
+ ,110.64
+ ,111.66
+ ,122.44
+ ,101.98
+ ,105.71
+ ,103.27
+ ,89.60
+ ,109.47
+ ,111.83
+ ,110.87
+ ,112.28
+ ,122.72
+ ,102.06
+ ,105.87
+ ,103.29
+ ,89.61
+ ,109.47
+ ,112.87
+ ,110.96
+ ,112.87
+ ,122.75
+ ,102.07
+ ,105.94
+ ,103.30
+ ,89.22
+ ,109.47
+ ,115.07
+ ,111.85
+ ,112.18
+ ,122.80
+ ,102.10
+ ,106.14
+ ,103.47
+ ,89.60
+ ,109.47
+ ,115.35
+ ,111.94
+ ,112.36
+ ,122.81
+ ,102.42
+ ,106.49
+ ,103.27
+ ,88.90
+ ,109.47
+ ,113.81
+ ,112.11
+ ,112.16
+ ,122.83
+ ,102.91
+ ,106.79
+ ,103.30
+ ,89.60
+ ,111.29
+ ,114.66
+ ,112.42
+ ,111.49
+ ,122.83
+ ,103.14
+ ,107.02
+ ,103.38
+ ,89.47
+ ,111.29
+ ,114.51
+ ,112.62
+ ,111.25
+ ,122.83
+ ,103.23
+ ,107.14
+ ,103.38
+ ,89.73
+ ,111.29
+ ,115.11
+ ,112.63
+ ,111.36
+ ,122.84
+ ,103.23
+ ,107.31
+ ,105.22
+ ,88.53
+ ,111.29
+ ,114.54
+ ,113.25
+ ,111.74
+ ,122.85
+ ,102.91
+ ,107.67
+ ,105.29
+ ,90.09
+ ,111.29
+ ,115.39
+ ,113.73
+ ,111.10
+ ,123.61
+ ,103.11
+ ,108.03
+ ,104.85
+ ,90.09
+ ,111.29
+ ,115.65
+ ,114.17
+ ,111.33
+ ,124.74
+ ,103.14
+ ,108.27
+ ,104.99
+ ,90.28
+ ,111.29
+ ,116.46
+ ,114.27
+ ,111.25
+ ,125.10
+ ,103.26
+ ,108.41
+ ,104.61
+ ,89.69
+ ,111.29
+ ,116.18
+ ,114.49
+ ,111.04
+ ,125.29
+ ,103.30
+ ,108.56
+ ,104.60
+ ,89.69
+ ,111.29
+ ,116.63
+ ,114.69
+ ,110.97
+ ,125.45
+ ,103.32
+ ,108.62
+ ,103.53
+ ,89.67
+ ,111.29
+ ,118.84
+ ,114.63
+ ,111.31
+ ,125.51
+ ,103.44
+ ,108.83
+ ,103.48
+ ,89.66
+ ,111.29
+ ,118.77
+ ,114.74
+ ,111.02
+ ,125.55
+ ,103.54
+ ,109.00
+ ,103.54
+ ,89.56
+ ,111.29
+ ,117.83
+ ,114.94
+ ,111.07
+ ,125.57
+ ,103.98
+ ,109.21
+ ,103.52
+ ,89.60
+ ,116.29
+ ,117.66
+ ,114.78
+ ,111.36
+ ,125.81
+ ,104.24
+ ,109.45
+ ,103.50
+ ,86.62
+ ,116.29
+ ,117.36
+ ,114.83
+ ,111.54
+ ,127.41
+ ,104.29
+ ,109.59
+ ,103.50
+ ,86.98
+ ,116.29
+ ,118.00
+ ,114.91
+ ,112.05
+ ,127.75
+ ,104.29
+ ,109.57
+ ,103.83
+ ,86.71
+ ,116.29
+ ,117.34
+ ,114.84
+ ,112.52
+ ,127.76
+ ,103.98
+ ,109.75
+ ,103.20
+ ,86.60
+ ,116.29
+ ,118.04
+ ,115.13
+ ,112.94
+ ,127.80
+ ,103.98
+ ,110.01
+ ,103.24
+ ,86.58
+ ,116.29
+ ,118.17
+ ,115.45
+ ,113.33
+ ,128.23
+ ,103.89
+ ,110.09
+ ,103.11
+ ,86.79
+ ,116.29
+ ,118.82
+ ,115.50
+ ,113.78
+ ,130.01
+ ,103.86
+ ,110.25
+ ,103.13
+ ,86.08
+ ,116.29
+ ,119.00
+ ,115.61
+ ,113.77
+ ,130.07
+ ,103.88
+ ,110.28
+ ,103.15
+ ,87.48
+ ,116.29
+ ,118.89
+ ,116.30
+ ,113.82
+ ,130.17
+ ,103.88
+ ,110.26
+ ,103.03
+ ,87.40
+ ,116.29
+ ,121.40
+ ,116.48
+ ,113.89
+ ,130.21
+ ,104.31
+ ,110.38
+ ,103.06
+ ,87.51
+ ,116.29
+ ,121.01
+ ,116.46
+ ,114.25
+ ,130.22
+ ,104.41
+ ,110.37
+ ,103.11
+ ,87.58
+ ,116.29
+ ,120.21
+ ,116.77
+ ,114.41
+ ,130.23
+ ,104.80
+ ,110.50
+ ,103.11
+ ,87.59
+ ,115.72
+ ,120.39
+ ,117.02
+ ,114.55
+ ,130.23
+ ,104.89
+ ,110.51
+ ,103.12
+ ,87.62
+ ,115.72
+ ,120.09
+ ,117.19
+ ,115.00
+ ,130.23
+ ,104.90
+ ,110.71
+ ,103.12
+ ,88.35
+ ,115.72
+ ,120.76
+ ,117.34
+ ,115.66
+ ,130.23
+ ,104.90
+ ,110.62
+ ,103.28
+ ,88.67
+ ,115.72
+ ,120.33
+ ,118.15
+ ,116.33
+ ,130.24
+ ,104.54
+ ,110.81
+ ,103.44
+ ,87.81
+ ,115.72
+ ,120.84
+ ,118.94
+ ,116.91
+ ,130.13
+ ,104.67
+ ,110.97
+ ,103.37
+ ,87.81
+ ,115.72
+ ,121.49
+ ,119.17
+ ,117.20
+ ,130.14
+ ,104.87
+ ,111.06
+ ,103.15
+ ,87.86
+ ,115.72
+ ,122.29
+ ,119.33
+ ,117.59
+ ,130.79
+ ,105.04
+ ,111.33
+ ,103.21
+ ,87.86
+ ,115.72
+ ,121.91
+ ,119.50
+ ,117.95
+ ,131.38
+ ,105.09
+ ,111.55
+ ,103.22
+ ,87.86
+ ,115.72
+ ,122.46
+ ,119.58
+ ,118.09
+ ,131.61
+ ,105.10
+ ,111.67
+ ,103.32
+ ,87.51
+ ,115.72
+ ,124.94
+ ,119.79
+ ,117.99
+ ,131.72
+ ,105.46
+ ,111.72
+ ,103.34
+ ,87.50
+ ,115.72
+ ,124.60
+ ,119.91
+ ,118.31
+ ,131.89
+ ,105.83
+ ,112.00
+ ,103.34
+ ,86.72
+ ,115.72
+ ,123.09
+ ,120.35
+ ,118.49
+ ,131.89
+ ,106.27
+ ,112.42
+ ,103.30
+ ,86.74
+ ,119.24
+ ,123.25
+ ,120.69
+ ,118.96
+ ,131.96
+ ,106.46
+ ,112.84
+ ,103.29
+ ,86.74
+ ,119.24
+ ,123.01
+ ,121.01
+ ,119.01
+ ,131.99
+ ,106.52
+ ,112.99
+ ,103.35
+ ,86.76
+ ,119.24
+ ,123.82
+ ,121.14
+ ,119.88
+ ,132.00
+ ,106.53
+ ,113.11
+ ,104.02
+ ,90.75
+ ,119.24
+ ,123.31
+ ,123.78
+ ,120.59
+ ,132.06
+ ,105.96
+ ,113.51
+ ,104.07
+ ,90.21
+ ,119.24
+ ,124.04
+ ,123.95
+ ,120.85
+ ,132.11
+ ,106.00
+ ,113.42
+ ,104.23
+ ,90.20
+ ,119.24
+ ,124.15
+ ,124.25
+ ,120.93
+ ,132.88
+ ,106.15
+ ,113.60
+ ,103.96
+ ,89.34
+ ,119.24
+ ,125.37
+ ,124.30
+ ,120.89
+ ,135.48
+ ,106.32
+ ,113.65
+ ,103.81
+ ,89.35
+ ,119.24
+ ,125.41
+ ,124.70
+ ,120.61
+ ,136.56
+ ,106.41
+ ,113.76
+ ,103.38
+ ,88.94
+ ,119.24
+ ,126.06
+ ,124.73
+ ,120.83
+ ,136.96
+ ,106.41
+ ,113.74
+ ,103.29
+ ,88.94
+ ,119.24
+ ,128.17
+ ,125.02
+ ,121.36
+ ,138.32
+ ,106.81
+ ,114.02
+ ,103.24
+ ,88.77
+ ,119.24
+ ,128.16
+ ,125.24
+ ,121.57
+ ,138.32
+ ,106.99
+ ,114.08
+ ,103.26
+ ,88.72
+ ,119.24
+ ,126.69
+ ,125.67
+ ,121.79
+ ,138.82
+ ,107.35
+ ,114.29
+ ,103.40
+ ,89.25
+ ,119.79
+ ,126.75
+ ,125.84)
+ ,dim=c(9
+ ,82)
+ ,dimnames=list(c('Algemeen_indexcijfer'
+ ,'Tabak'
+ ,'Kleding_en_schoeisel'
+ ,'Stoff_huish_app_&_ond_won.'
+ ,'Gezondheidsuitgaven'
+ ,'Communicatie'
+ ,'Onderwijs'
+ ,'Hotels_cafés_en_restaurants'
+ ,'Diverse_goederen_&_diensten')
+ ,1:82))
> y <- array(NA,dim=c(9,82),dimnames=list(c('Algemeen_indexcijfer','Tabak','Kleding_en_schoeisel','Stoff_huish_app_&_ond_won.','Gezondheidsuitgaven','Communicatie','Onderwijs','Hotels_cafés_en_restaurants','Diverse_goederen_&_diensten'),1:82))
> 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'
> 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
Algemeen_indexcijfer Tabak Kleding_en_schoeisel Stoff_huish_app_&_ond_won.
1 103.48 105.16 100.44 100.76
2 103.93 105.16 100.47 100.89
3 103.89 105.16 100.49 100.88
4 104.40 105.16 100.52 101.12
5 104.79 105.16 100.47 101.30
6 104.77 105.17 100.48 101.36
7 105.13 105.17 100.48 101.42
8 105.26 105.54 100.53 101.49
9 104.96 106.90 100.62 101.63
10 104.75 107.27 100.89 101.73
11 105.01 107.31 100.97 101.94
12 105.15 107.39 101.01 102.03
13 105.20 107.41 101.02 102.15
14 105.77 107.46 100.92 102.43
15 105.78 113.14 100.93 102.61
16 106.26 117.00 100.98 102.75
17 106.13 119.28 101.07 102.95
18 106.12 119.39 101.10 103.11
19 106.57 119.50 101.11 103.69
20 106.44 119.67 101.19 104.22
21 106.54 119.67 101.31 104.29
22 107.10 119.73 101.52 104.49
23 108.10 119.77 101.61 104.62
24 108.40 119.77 101.65 104.76
25 108.84 119.78 101.66 104.88
26 109.62 119.78 101.56 105.09
27 110.42 119.78 101.75 105.31
28 110.67 121.28 101.83 105.48
29 111.66 122.44 101.98 105.71
30 112.28 122.72 102.06 105.87
31 112.87 122.75 102.07 105.94
32 112.18 122.80 102.10 106.14
33 112.36 122.81 102.42 106.49
34 112.16 122.83 102.91 106.79
35 111.49 122.83 103.14 107.02
36 111.25 122.83 103.23 107.14
37 111.36 122.84 103.23 107.31
38 111.74 122.85 102.91 107.67
39 111.10 123.61 103.11 108.03
40 111.33 124.74 103.14 108.27
41 111.25 125.10 103.26 108.41
42 111.04 125.29 103.30 108.56
43 110.97 125.45 103.32 108.62
44 111.31 125.51 103.44 108.83
45 111.02 125.55 103.54 109.00
46 111.07 125.57 103.98 109.21
47 111.36 125.81 104.24 109.45
48 111.54 127.41 104.29 109.59
49 112.05 127.75 104.29 109.57
50 112.52 127.76 103.98 109.75
51 112.94 127.80 103.98 110.01
52 113.33 128.23 103.89 110.09
53 113.78 130.01 103.86 110.25
54 113.77 130.07 103.88 110.28
55 113.82 130.17 103.88 110.26
56 113.89 130.21 104.31 110.38
57 114.25 130.22 104.41 110.37
58 114.41 130.23 104.80 110.50
59 114.55 130.23 104.89 110.51
60 115.00 130.23 104.90 110.71
61 115.66 130.23 104.90 110.62
62 116.33 130.24 104.54 110.81
63 116.91 130.13 104.67 110.97
64 117.20 130.14 104.87 111.06
65 117.59 130.79 105.04 111.33
66 117.95 131.38 105.09 111.55
67 118.09 131.61 105.10 111.67
68 117.99 131.72 105.46 111.72
69 118.31 131.89 105.83 112.00
70 118.49 131.89 106.27 112.42
71 118.96 131.96 106.46 112.84
72 119.01 131.99 106.52 112.99
73 119.88 132.00 106.53 113.11
74 120.59 132.06 105.96 113.51
75 120.85 132.11 106.00 113.42
76 120.93 132.88 106.15 113.60
77 120.89 135.48 106.32 113.65
78 120.61 136.56 106.41 113.76
79 120.83 136.96 106.41 113.74
80 121.36 138.32 106.81 114.02
81 121.57 138.32 106.99 114.08
82 121.79 138.82 107.35 114.29
Gezondheidsuitgaven Communicatie Onderwijs
1 105.01 96.84 104.85
2 105.06 96.15 104.85
3 105.06 95.46 104.85
4 105.01 95.35 104.85
5 105.08 95.23 104.85
6 104.74 95.08 104.85
7 104.45 95.02 104.85
8 104.49 94.96 104.85
9 104.57 94.29 104.85
10 104.59 94.49 107.35
11 104.62 94.51 107.35
12 104.64 94.79 107.35
13 105.26 94.67 107.35
14 105.39 94.69 107.35
15 105.33 94.78 107.35
16 105.18 95.02 107.35
17 105.02 94.09 107.35
18 104.23 91.98 107.35
19 104.30 91.63 107.35
20 104.31 91.22 107.35
21 104.32 90.03 107.35
22 104.00 90.14 109.47
23 104.03 89.96 109.47
24 104.10 89.97 109.47
25 104.36 89.98 109.47
26 103.60 90.10 109.47
27 103.69 90.13 109.47
28 103.78 89.60 109.47
29 103.27 89.60 109.47
30 103.29 89.61 109.47
31 103.30 89.22 109.47
32 103.47 89.60 109.47
33 103.27 88.90 109.47
34 103.30 89.60 111.29
35 103.38 89.47 111.29
36 103.38 89.73 111.29
37 105.22 88.53 111.29
38 105.29 90.09 111.29
39 104.85 90.09 111.29
40 104.99 90.28 111.29
41 104.61 89.69 111.29
42 104.60 89.69 111.29
43 103.53 89.67 111.29
44 103.48 89.66 111.29
45 103.54 89.56 111.29
46 103.52 89.60 116.29
47 103.50 86.62 116.29
48 103.50 86.98 116.29
49 103.83 86.71 116.29
50 103.20 86.60 116.29
51 103.24 86.58 116.29
52 103.11 86.79 116.29
53 103.13 86.08 116.29
54 103.15 87.48 116.29
55 103.03 87.40 116.29
56 103.06 87.51 116.29
57 103.11 87.58 116.29
58 103.11 87.59 115.72
59 103.12 87.62 115.72
60 103.12 88.35 115.72
61 103.28 88.67 115.72
62 103.44 87.81 115.72
63 103.37 87.81 115.72
64 103.15 87.86 115.72
65 103.21 87.86 115.72
66 103.22 87.86 115.72
67 103.32 87.51 115.72
68 103.34 87.50 115.72
69 103.34 86.72 115.72
70 103.30 86.74 119.24
71 103.29 86.74 119.24
72 103.35 86.76 119.24
73 104.02 90.75 119.24
74 104.07 90.21 119.24
75 104.23 90.20 119.24
76 103.96 89.34 119.24
77 103.81 89.35 119.24
78 103.38 88.94 119.24
79 103.29 88.94 119.24
80 103.24 88.77 119.24
81 103.26 88.72 119.24
82 103.40 89.25 119.79
Hotels_caf\303\251s_en_restaurants Diverse_goederen_&_diensten
1 103.75 103.51
2 104.35 103.87
3 104.51 103.98
4 105.25 104.10
5 105.20 104.36
6 105.87 104.47
7 107.63 104.99
8 107.77 105.09
9 106.58 105.28
10 106.32 105.46
11 106.30 105.61
12 106.38 105.66
13 106.42 106.98
14 107.35 107.16
15 107.58 107.79
16 108.20 108.45
17 108.29 108.58
18 108.76 108.65
19 110.69 108.92
20 110.56 108.94
21 108.81 108.88
22 108.81 108.99
23 108.81 109.10
24 109.74 109.20
25 109.57 109.68
26 110.44 110.02
27 111.20 110.32
28 111.44 110.64
29 111.83 110.87
30 112.87 110.96
31 115.07 111.85
32 115.35 111.94
33 113.81 112.11
34 114.66 112.42
35 114.51 112.62
36 115.11 112.63
37 114.54 113.25
38 115.39 113.73
39 115.65 114.17
40 116.46 114.27
41 116.18 114.49
42 116.63 114.69
43 118.84 114.63
44 118.77 114.74
45 117.83 114.94
46 117.66 114.78
47 117.36 114.83
48 118.00 114.91
49 117.34 114.84
50 118.04 115.13
51 118.17 115.45
52 118.82 115.50
53 119.00 115.61
54 118.89 116.30
55 121.40 116.48
56 121.01 116.46
57 120.21 116.77
58 120.39 117.02
59 120.09 117.19
60 120.76 117.34
61 120.33 118.15
62 120.84 118.94
63 121.49 119.17
64 122.29 119.33
65 121.91 119.50
66 122.46 119.58
67 124.94 119.79
68 124.60 119.91
69 123.09 120.35
70 123.25 120.69
71 123.01 121.01
72 123.82 121.14
73 123.31 123.78
74 124.04 123.95
75 124.15 124.25
76 125.37 124.30
77 125.41 124.70
78 126.06 124.73
79 128.17 125.02
80 128.16 125.24
81 126.69 125.67
82 126.75 125.84
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Tabak
212.48284 -0.26148
Kleding_en_schoeisel `Stoff_huish_app_&_ond_won.`
0.08806 -0.57481
Gezondheidsuitgaven Communicatie
-1.17153 -0.44314
Onderwijs `Hotels_caf\\303\\251s_en_restaurants`
-0.19469 -0.10297
`Diverse_goederen_&_diensten`
1.58032
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.95246 -0.46602 0.05441 0.54820 2.05261
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 212.48284 34.48967 6.161 3.59e-08
Tabak -0.26148 0.05574 -4.691 1.24e-05
Kleding_en_schoeisel 0.08806 0.33564 0.262 0.793775
`Stoff_huish_app_&_ond_won.` -0.57481 0.32773 -1.754 0.083642
Gezondheidsuitgaven -1.17153 0.23946 -4.892 5.77e-06
Communicatie -0.44314 0.12197 -3.633 0.000518
Onderwijs -0.19469 0.10024 -1.942 0.055972
`Hotels_caf\\303\\251s_en_restaurants` -0.10297 0.10743 -0.958 0.340977
`Diverse_goederen_&_diensten` 1.58032 0.16141 9.790 6.23e-15
(Intercept) ***
Tabak ***
Kleding_en_schoeisel
`Stoff_huish_app_&_ond_won.` .
Gezondheidsuitgaven ***
Communicatie ***
Onderwijs .
`Hotels_caf\\303\\251s_en_restaurants`
`Diverse_goederen_&_diensten` ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.7885 on 73 degrees of freedom
Multiple R-squared: 0.9802, Adjusted R-squared: 0.9781
F-statistic: 452.8 on 8 and 73 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,] 4.416421e-05 8.832841e-05 9.999558e-01
[2,] 6.836896e-05 1.367379e-04 9.999316e-01
[3,] 2.809859e-05 5.619718e-05 9.999719e-01
[4,] 8.049779e-06 1.609956e-05 9.999920e-01
[5,] 2.215376e-05 4.430753e-05 9.999778e-01
[6,] 7.606792e-06 1.521358e-05 9.999924e-01
[7,] 1.773964e-06 3.547927e-06 9.999982e-01
[8,] 5.301802e-05 1.060360e-04 9.999470e-01
[9,] 5.124931e-05 1.024986e-04 9.999488e-01
[10,] 5.865684e-05 1.173137e-04 9.999413e-01
[11,] 1.640457e-04 3.280915e-04 9.998360e-01
[12,] 7.345726e-03 1.469145e-02 9.926543e-01
[13,] 1.965165e-02 3.930330e-02 9.803483e-01
[14,] 3.947352e-02 7.894705e-02 9.605265e-01
[15,] 4.976745e-02 9.953490e-02 9.502325e-01
[16,] 4.374965e-02 8.749930e-02 9.562503e-01
[17,] 3.788815e-02 7.577631e-02 9.621118e-01
[18,] 2.674691e-02 5.349381e-02 9.732531e-01
[19,] 4.068591e-02 8.137181e-02 9.593141e-01
[20,] 3.948671e-02 7.897343e-02 9.605133e-01
[21,] 5.413074e-02 1.082615e-01 9.458693e-01
[22,] 1.759171e-01 3.518343e-01 8.240829e-01
[23,] 4.854981e-01 9.709962e-01 5.145019e-01
[24,] 6.835849e-01 6.328302e-01 3.164151e-01
[25,] 8.811950e-01 2.376101e-01 1.188050e-01
[26,] 9.246846e-01 1.506308e-01 7.531542e-02
[27,] 9.649437e-01 7.011250e-02 3.505625e-02
[28,] 9.849938e-01 3.001242e-02 1.500621e-02
[29,] 9.914426e-01 1.711486e-02 8.557429e-03
[30,] 9.944014e-01 1.119711e-02 5.598553e-03
[31,] 9.960564e-01 7.887204e-03 3.943602e-03
[32,] 9.992727e-01 1.454587e-03 7.272933e-04
[33,] 9.995959e-01 8.082064e-04 4.041032e-04
[34,] 9.999998e-01 3.051029e-07 1.525514e-07
[35,] 9.999997e-01 5.662268e-07 2.831134e-07
[36,] 1.000000e+00 3.475792e-08 1.737896e-08
[37,] 1.000000e+00 8.280884e-09 4.140442e-09
[38,] 1.000000e+00 2.768559e-08 1.384279e-08
[39,] 1.000000e+00 4.096094e-08 2.048047e-08
[40,] 1.000000e+00 1.624292e-08 8.121462e-09
[41,] 1.000000e+00 3.362527e-08 1.681263e-08
[42,] 1.000000e+00 8.057464e-08 4.028732e-08
[43,] 9.999999e-01 2.597028e-07 1.298514e-07
[44,] 9.999996e-01 8.984710e-07 4.492355e-07
[45,] 9.999986e-01 2.753447e-06 1.376724e-06
[46,] 9.999957e-01 8.615945e-06 4.307973e-06
[47,] 9.999938e-01 1.238581e-05 6.192907e-06
[48,] 9.999957e-01 8.553646e-06 4.276823e-06
[49,] 9.999977e-01 4.674012e-06 2.337006e-06
[50,] 9.999968e-01 6.329958e-06 3.164979e-06
[51,] 9.999978e-01 4.425698e-06 2.212849e-06
[52,] 9.999958e-01 8.350523e-06 4.175261e-06
[53,] 9.999797e-01 4.060198e-05 2.030099e-05
[54,] 9.999134e-01 1.731029e-04 8.655147e-05
[55,] 9.999006e-01 1.987712e-04 9.938561e-05
[56,] 9.997887e-01 4.226045e-04 2.113022e-04
[57,] 9.993403e-01 1.319396e-03 6.596980e-04
[58,] 9.963920e-01 7.215919e-03 3.607960e-03
[59,] 9.874003e-01 2.519947e-02 1.259974e-02
> postscript(file="/var/wessaorg/rcomp/tmp/1lm2q1353456854.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/27ykm1353456854.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/3b1qg1353456854.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/4mmv41353456854.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/5z32x1353456854.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 = 82
Frequency = 1
1 2 3 4 5 6
1.020081574 0.787842587 0.277208714 0.701758772 0.812425932 0.259013386
7 8 9 10 11 12
-0.353371089 -0.214131890 -0.711938764 -0.503935187 -0.314909706 -0.029050353
13 14 15 16 17 18
-1.314462415 -0.589170446 0.006317272 0.523169456 0.300655405 -1.514003247
19 20 21 22 23 24
-1.003777415 -1.006682773 -1.478006866 -0.893086808 -0.034281822 0.366836480
25 26 27 28 29 30
0.410516182 0.035122778 0.667740456 0.790224562 1.281749415 2.052610688
31 32 33 34 35 36
1.348747788 1.038295929 0.422186957 0.654008156 -0.199435174 -0.217189693
37 38 39 40 41 42
0.578494338 1.298489237 -0.137504428 0.696868289 -0.302223814 -0.661286297
43 44 45 46 47 48
-1.596735472 -1.374954470 -1.952461077 -0.612181623 -1.598250043 -0.824800764
49 50 51 52 53 54
0.072227520 -0.497413835 -0.371822579 0.113200372 0.676757364 0.240000939
55 56 57 58 59 60
0.102613496 0.289522729 0.154903438 -0.125188283 -0.261902176 0.457609818
61 62 63 64 65 66
0.070785706 -0.505277017 -0.252069799 -0.331389685 0.131312171 0.709565979
67 68 69 70 71 72
0.863354707 0.583506960 -0.120148426 0.388997005 0.559858689 0.655758499
73 74 75 76 77 78
-0.075062339 0.556542294 0.494603290 0.215400256 0.069721987 -0.538492707
79 80 81 82
-0.571861349 -0.043130271 -0.644122841 0.039105371
> postscript(file="/var/wessaorg/rcomp/tmp/6dp181353456854.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 = 82
Frequency = 1
lag(myerror, k = 1) myerror
0 1.020081574 NA
1 0.787842587 1.020081574
2 0.277208714 0.787842587
3 0.701758772 0.277208714
4 0.812425932 0.701758772
5 0.259013386 0.812425932
6 -0.353371089 0.259013386
7 -0.214131890 -0.353371089
8 -0.711938764 -0.214131890
9 -0.503935187 -0.711938764
10 -0.314909706 -0.503935187
11 -0.029050353 -0.314909706
12 -1.314462415 -0.029050353
13 -0.589170446 -1.314462415
14 0.006317272 -0.589170446
15 0.523169456 0.006317272
16 0.300655405 0.523169456
17 -1.514003247 0.300655405
18 -1.003777415 -1.514003247
19 -1.006682773 -1.003777415
20 -1.478006866 -1.006682773
21 -0.893086808 -1.478006866
22 -0.034281822 -0.893086808
23 0.366836480 -0.034281822
24 0.410516182 0.366836480
25 0.035122778 0.410516182
26 0.667740456 0.035122778
27 0.790224562 0.667740456
28 1.281749415 0.790224562
29 2.052610688 1.281749415
30 1.348747788 2.052610688
31 1.038295929 1.348747788
32 0.422186957 1.038295929
33 0.654008156 0.422186957
34 -0.199435174 0.654008156
35 -0.217189693 -0.199435174
36 0.578494338 -0.217189693
37 1.298489237 0.578494338
38 -0.137504428 1.298489237
39 0.696868289 -0.137504428
40 -0.302223814 0.696868289
41 -0.661286297 -0.302223814
42 -1.596735472 -0.661286297
43 -1.374954470 -1.596735472
44 -1.952461077 -1.374954470
45 -0.612181623 -1.952461077
46 -1.598250043 -0.612181623
47 -0.824800764 -1.598250043
48 0.072227520 -0.824800764
49 -0.497413835 0.072227520
50 -0.371822579 -0.497413835
51 0.113200372 -0.371822579
52 0.676757364 0.113200372
53 0.240000939 0.676757364
54 0.102613496 0.240000939
55 0.289522729 0.102613496
56 0.154903438 0.289522729
57 -0.125188283 0.154903438
58 -0.261902176 -0.125188283
59 0.457609818 -0.261902176
60 0.070785706 0.457609818
61 -0.505277017 0.070785706
62 -0.252069799 -0.505277017
63 -0.331389685 -0.252069799
64 0.131312171 -0.331389685
65 0.709565979 0.131312171
66 0.863354707 0.709565979
67 0.583506960 0.863354707
68 -0.120148426 0.583506960
69 0.388997005 -0.120148426
70 0.559858689 0.388997005
71 0.655758499 0.559858689
72 -0.075062339 0.655758499
73 0.556542294 -0.075062339
74 0.494603290 0.556542294
75 0.215400256 0.494603290
76 0.069721987 0.215400256
77 -0.538492707 0.069721987
78 -0.571861349 -0.538492707
79 -0.043130271 -0.571861349
80 -0.644122841 -0.043130271
81 0.039105371 -0.644122841
82 NA 0.039105371
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.787842587 1.020081574
[2,] 0.277208714 0.787842587
[3,] 0.701758772 0.277208714
[4,] 0.812425932 0.701758772
[5,] 0.259013386 0.812425932
[6,] -0.353371089 0.259013386
[7,] -0.214131890 -0.353371089
[8,] -0.711938764 -0.214131890
[9,] -0.503935187 -0.711938764
[10,] -0.314909706 -0.503935187
[11,] -0.029050353 -0.314909706
[12,] -1.314462415 -0.029050353
[13,] -0.589170446 -1.314462415
[14,] 0.006317272 -0.589170446
[15,] 0.523169456 0.006317272
[16,] 0.300655405 0.523169456
[17,] -1.514003247 0.300655405
[18,] -1.003777415 -1.514003247
[19,] -1.006682773 -1.003777415
[20,] -1.478006866 -1.006682773
[21,] -0.893086808 -1.478006866
[22,] -0.034281822 -0.893086808
[23,] 0.366836480 -0.034281822
[24,] 0.410516182 0.366836480
[25,] 0.035122778 0.410516182
[26,] 0.667740456 0.035122778
[27,] 0.790224562 0.667740456
[28,] 1.281749415 0.790224562
[29,] 2.052610688 1.281749415
[30,] 1.348747788 2.052610688
[31,] 1.038295929 1.348747788
[32,] 0.422186957 1.038295929
[33,] 0.654008156 0.422186957
[34,] -0.199435174 0.654008156
[35,] -0.217189693 -0.199435174
[36,] 0.578494338 -0.217189693
[37,] 1.298489237 0.578494338
[38,] -0.137504428 1.298489237
[39,] 0.696868289 -0.137504428
[40,] -0.302223814 0.696868289
[41,] -0.661286297 -0.302223814
[42,] -1.596735472 -0.661286297
[43,] -1.374954470 -1.596735472
[44,] -1.952461077 -1.374954470
[45,] -0.612181623 -1.952461077
[46,] -1.598250043 -0.612181623
[47,] -0.824800764 -1.598250043
[48,] 0.072227520 -0.824800764
[49,] -0.497413835 0.072227520
[50,] -0.371822579 -0.497413835
[51,] 0.113200372 -0.371822579
[52,] 0.676757364 0.113200372
[53,] 0.240000939 0.676757364
[54,] 0.102613496 0.240000939
[55,] 0.289522729 0.102613496
[56,] 0.154903438 0.289522729
[57,] -0.125188283 0.154903438
[58,] -0.261902176 -0.125188283
[59,] 0.457609818 -0.261902176
[60,] 0.070785706 0.457609818
[61,] -0.505277017 0.070785706
[62,] -0.252069799 -0.505277017
[63,] -0.331389685 -0.252069799
[64,] 0.131312171 -0.331389685
[65,] 0.709565979 0.131312171
[66,] 0.863354707 0.709565979
[67,] 0.583506960 0.863354707
[68,] -0.120148426 0.583506960
[69,] 0.388997005 -0.120148426
[70,] 0.559858689 0.388997005
[71,] 0.655758499 0.559858689
[72,] -0.075062339 0.655758499
[73,] 0.556542294 -0.075062339
[74,] 0.494603290 0.556542294
[75,] 0.215400256 0.494603290
[76,] 0.069721987 0.215400256
[77,] -0.538492707 0.069721987
[78,] -0.571861349 -0.538492707
[79,] -0.043130271 -0.571861349
[80,] -0.644122841 -0.043130271
[81,] 0.039105371 -0.644122841
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.787842587 1.020081574
2 0.277208714 0.787842587
3 0.701758772 0.277208714
4 0.812425932 0.701758772
5 0.259013386 0.812425932
6 -0.353371089 0.259013386
7 -0.214131890 -0.353371089
8 -0.711938764 -0.214131890
9 -0.503935187 -0.711938764
10 -0.314909706 -0.503935187
11 -0.029050353 -0.314909706
12 -1.314462415 -0.029050353
13 -0.589170446 -1.314462415
14 0.006317272 -0.589170446
15 0.523169456 0.006317272
16 0.300655405 0.523169456
17 -1.514003247 0.300655405
18 -1.003777415 -1.514003247
19 -1.006682773 -1.003777415
20 -1.478006866 -1.006682773
21 -0.893086808 -1.478006866
22 -0.034281822 -0.893086808
23 0.366836480 -0.034281822
24 0.410516182 0.366836480
25 0.035122778 0.410516182
26 0.667740456 0.035122778
27 0.790224562 0.667740456
28 1.281749415 0.790224562
29 2.052610688 1.281749415
30 1.348747788 2.052610688
31 1.038295929 1.348747788
32 0.422186957 1.038295929
33 0.654008156 0.422186957
34 -0.199435174 0.654008156
35 -0.217189693 -0.199435174
36 0.578494338 -0.217189693
37 1.298489237 0.578494338
38 -0.137504428 1.298489237
39 0.696868289 -0.137504428
40 -0.302223814 0.696868289
41 -0.661286297 -0.302223814
42 -1.596735472 -0.661286297
43 -1.374954470 -1.596735472
44 -1.952461077 -1.374954470
45 -0.612181623 -1.952461077
46 -1.598250043 -0.612181623
47 -0.824800764 -1.598250043
48 0.072227520 -0.824800764
49 -0.497413835 0.072227520
50 -0.371822579 -0.497413835
51 0.113200372 -0.371822579
52 0.676757364 0.113200372
53 0.240000939 0.676757364
54 0.102613496 0.240000939
55 0.289522729 0.102613496
56 0.154903438 0.289522729
57 -0.125188283 0.154903438
58 -0.261902176 -0.125188283
59 0.457609818 -0.261902176
60 0.070785706 0.457609818
61 -0.505277017 0.070785706
62 -0.252069799 -0.505277017
63 -0.331389685 -0.252069799
64 0.131312171 -0.331389685
65 0.709565979 0.131312171
66 0.863354707 0.709565979
67 0.583506960 0.863354707
68 -0.120148426 0.583506960
69 0.388997005 -0.120148426
70 0.559858689 0.388997005
71 0.655758499 0.559858689
72 -0.075062339 0.655758499
73 0.556542294 -0.075062339
74 0.494603290 0.556542294
75 0.215400256 0.494603290
76 0.069721987 0.215400256
77 -0.538492707 0.069721987
78 -0.571861349 -0.538492707
79 -0.043130271 -0.571861349
80 -0.644122841 -0.043130271
81 0.039105371 -0.644122841
> 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/7e49x1353456854.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/880521353456854.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/9scrt1353456854.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/109ypo1353456854.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/11yo0a1353456854.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/12ebyb1353456854.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/13873h1353456854.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/14xmcn1353456854.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/15u3ds1353456854.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/165zz61353456854.tab")
+ }
>
> try(system("convert tmp/1lm2q1353456854.ps tmp/1lm2q1353456854.png",intern=TRUE))
character(0)
> try(system("convert tmp/27ykm1353456854.ps tmp/27ykm1353456854.png",intern=TRUE))
character(0)
> try(system("convert tmp/3b1qg1353456854.ps tmp/3b1qg1353456854.png",intern=TRUE))
character(0)
> try(system("convert tmp/4mmv41353456854.ps tmp/4mmv41353456854.png",intern=TRUE))
character(0)
> try(system("convert tmp/5z32x1353456854.ps tmp/5z32x1353456854.png",intern=TRUE))
character(0)
> try(system("convert tmp/6dp181353456854.ps tmp/6dp181353456854.png",intern=TRUE))
character(0)
> try(system("convert tmp/7e49x1353456854.ps tmp/7e49x1353456854.png",intern=TRUE))
character(0)
> try(system("convert tmp/880521353456854.ps tmp/880521353456854.png",intern=TRUE))
character(0)
> try(system("convert tmp/9scrt1353456854.ps tmp/9scrt1353456854.png",intern=TRUE))
character(0)
> try(system("convert tmp/109ypo1353456854.ps tmp/109ypo1353456854.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.357 1.278 8.635