R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
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(24
+ ,24
+ ,25
+ ,25
+ ,30
+ ,17
+ ,19
+ ,18
+ ,22
+ ,18
+ ,22
+ ,16
+ ,25
+ ,20
+ ,23
+ ,16
+ ,17
+ ,18
+ ,21
+ ,17
+ ,19
+ ,23
+ ,19
+ ,30
+ ,15
+ ,23
+ ,16
+ ,18
+ ,23
+ ,15
+ ,27
+ ,12
+ ,22
+ ,21
+ ,14
+ ,15
+ ,22
+ ,20
+ ,23
+ ,31
+ ,23
+ ,27
+ ,21
+ ,34
+ ,19
+ ,21
+ ,18
+ ,31
+ ,20
+ ,19
+ ,23
+ ,16
+ ,25
+ ,20
+ ,19
+ ,21
+ ,24
+ ,22
+ ,22
+ ,17
+ ,25
+ ,24
+ ,26
+ ,25
+ ,29
+ ,26
+ ,32
+ ,25
+ ,25
+ ,17
+ ,29
+ ,32
+ ,28
+ ,33
+ ,17
+ ,13
+ ,28
+ ,32
+ ,29
+ ,25
+ ,26
+ ,29
+ ,25
+ ,22
+ ,14
+ ,18
+ ,25
+ ,17
+ ,26
+ ,20
+ ,20
+ ,15
+ ,18
+ ,20
+ ,32
+ ,33
+ ,25
+ ,29
+ ,25
+ ,23
+ ,23
+ ,26
+ ,21
+ ,18
+ ,20
+ ,20
+ ,15
+ ,11
+ ,30
+ ,28
+ ,24
+ ,26
+ ,26
+ ,22
+ ,24
+ ,17
+ ,22
+ ,12
+ ,14
+ ,14
+ ,24
+ ,17
+ ,24
+ ,21
+ ,24
+ ,19
+ ,24
+ ,18
+ ,19
+ ,10
+ ,31
+ ,29
+ ,22
+ ,31
+ ,27
+ ,19
+ ,19
+ ,9
+ ,25
+ ,20
+ ,20
+ ,28
+ ,21
+ ,19
+ ,27
+ ,30
+ ,23
+ ,29
+ ,25
+ ,26
+ ,20
+ ,23
+ ,21
+ ,13
+ ,22
+ ,21
+ ,23
+ ,19
+ ,25
+ ,28
+ ,25
+ ,23
+ ,17
+ ,18
+ ,19
+ ,21
+ ,25
+ ,20
+ ,19
+ ,23
+ ,20
+ ,21
+ ,26
+ ,21
+ ,23
+ ,15
+ ,27
+ ,28
+ ,17
+ ,19
+ ,17
+ ,26
+ ,19
+ ,10
+ ,17
+ ,16
+ ,22
+ ,22
+ ,21
+ ,19
+ ,32
+ ,31
+ ,21
+ ,31
+ ,21
+ ,29
+ ,18
+ ,19
+ ,18
+ ,22
+ ,23
+ ,23
+ ,19
+ ,15
+ ,20
+ ,20
+ ,21
+ ,18
+ ,20
+ ,23
+ ,17
+ ,25
+ ,18
+ ,21
+ ,19
+ ,24
+ ,22
+ ,25
+ ,15
+ ,17
+ ,14
+ ,13
+ ,18
+ ,28
+ ,24
+ ,21
+ ,35
+ ,25
+ ,29
+ ,9
+ ,21
+ ,16
+ ,25
+ ,19
+ ,20
+ ,17
+ ,22
+ ,25
+ ,13
+ ,20
+ ,26
+ ,29
+ ,17
+ ,14
+ ,25
+ ,22
+ ,20
+ ,15
+ ,19
+ ,19
+ ,21
+ ,20
+ ,22
+ ,15
+ ,24
+ ,20
+ ,21
+ ,18
+ ,26
+ ,33
+ ,24
+ ,22
+ ,16
+ ,16
+ ,23
+ ,17
+ ,18
+ ,16
+ ,16
+ ,21
+ ,26
+ ,26
+ ,19
+ ,18
+ ,21
+ ,18
+ ,21
+ ,17
+ ,22
+ ,22
+ ,23
+ ,30
+ ,29
+ ,30
+ ,21
+ ,24
+ ,21
+ ,21
+ ,23
+ ,21
+ ,27
+ ,29
+ ,25
+ ,31
+ ,21
+ ,20
+ ,10
+ ,16
+ ,20
+ ,22
+ ,26
+ ,20
+ ,24
+ ,28
+ ,29
+ ,38
+ ,19
+ ,22
+ ,24
+ ,20
+ ,19
+ ,17
+ ,24
+ ,28
+ ,22
+ ,22
+ ,17
+ ,31)
+ ,dim=c(2
+ ,159)
+ ,dimnames=list(c('PS'
+ ,'x')
+ ,1:159))
> y <- array(NA,dim=c(2,159),dimnames=list(c('PS','x'),1:159))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Include Monthly 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.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
PS x M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 24 24 1 0 0 0 0 0 0 0 0 0 0 1
2 25 25 0 1 0 0 0 0 0 0 0 0 0 2
3 30 17 0 0 1 0 0 0 0 0 0 0 0 3
4 19 18 0 0 0 1 0 0 0 0 0 0 0 4
5 22 18 0 0 0 0 1 0 0 0 0 0 0 5
6 22 16 0 0 0 0 0 1 0 0 0 0 0 6
7 25 20 0 0 0 0 0 0 1 0 0 0 0 7
8 23 16 0 0 0 0 0 0 0 1 0 0 0 8
9 17 18 0 0 0 0 0 0 0 0 1 0 0 9
10 21 17 0 0 0 0 0 0 0 0 0 1 0 10
11 19 23 0 0 0 0 0 0 0 0 0 0 1 11
12 19 30 0 0 0 0 0 0 0 0 0 0 0 12
13 15 23 1 0 0 0 0 0 0 0 0 0 0 13
14 16 18 0 1 0 0 0 0 0 0 0 0 0 14
15 23 15 0 0 1 0 0 0 0 0 0 0 0 15
16 27 12 0 0 0 1 0 0 0 0 0 0 0 16
17 22 21 0 0 0 0 1 0 0 0 0 0 0 17
18 14 15 0 0 0 0 0 1 0 0 0 0 0 18
19 22 20 0 0 0 0 0 0 1 0 0 0 0 19
20 23 31 0 0 0 0 0 0 0 1 0 0 0 20
21 23 27 0 0 0 0 0 0 0 0 1 0 0 21
22 21 34 0 0 0 0 0 0 0 0 0 1 0 22
23 19 21 0 0 0 0 0 0 0 0 0 0 1 23
24 18 31 0 0 0 0 0 0 0 0 0 0 0 24
25 20 19 1 0 0 0 0 0 0 0 0 0 0 25
26 23 16 0 1 0 0 0 0 0 0 0 0 0 26
27 25 20 0 0 1 0 0 0 0 0 0 0 0 27
28 19 21 0 0 0 1 0 0 0 0 0 0 0 28
29 24 22 0 0 0 0 1 0 0 0 0 0 0 29
30 22 17 0 0 0 0 0 1 0 0 0 0 0 30
31 25 24 0 0 0 0 0 0 1 0 0 0 0 31
32 26 25 0 0 0 0 0 0 0 1 0 0 0 32
33 29 26 0 0 0 0 0 0 0 0 1 0 0 33
34 32 25 0 0 0 0 0 0 0 0 0 1 0 34
35 25 17 0 0 0 0 0 0 0 0 0 0 1 35
36 29 32 0 0 0 0 0 0 0 0 0 0 0 36
37 28 33 1 0 0 0 0 0 0 0 0 0 0 37
38 17 13 0 1 0 0 0 0 0 0 0 0 0 38
39 28 32 0 0 1 0 0 0 0 0 0 0 0 39
40 29 25 0 0 0 1 0 0 0 0 0 0 0 40
41 26 29 0 0 0 0 1 0 0 0 0 0 0 41
42 25 22 0 0 0 0 0 1 0 0 0 0 0 42
43 14 18 0 0 0 0 0 0 1 0 0 0 0 43
44 25 17 0 0 0 0 0 0 0 1 0 0 0 44
45 26 20 0 0 0 0 0 0 0 0 1 0 0 45
46 20 15 0 0 0 0 0 0 0 0 0 1 0 46
47 18 20 0 0 0 0 0 0 0 0 0 0 1 47
48 32 33 0 0 0 0 0 0 0 0 0 0 0 48
49 25 29 1 0 0 0 0 0 0 0 0 0 0 49
50 25 23 0 1 0 0 0 0 0 0 0 0 0 50
51 23 26 0 0 1 0 0 0 0 0 0 0 0 51
52 21 18 0 0 0 1 0 0 0 0 0 0 0 52
53 20 20 0 0 0 0 1 0 0 0 0 0 0 53
54 15 11 0 0 0 0 0 1 0 0 0 0 0 54
55 30 28 0 0 0 0 0 0 1 0 0 0 0 55
56 24 26 0 0 0 0 0 0 0 1 0 0 0 56
57 26 22 0 0 0 0 0 0 0 0 1 0 0 57
58 24 17 0 0 0 0 0 0 0 0 0 1 0 58
59 22 12 0 0 0 0 0 0 0 0 0 0 1 59
60 14 14 0 0 0 0 0 0 0 0 0 0 0 60
61 24 17 1 0 0 0 0 0 0 0 0 0 0 61
62 24 21 0 1 0 0 0 0 0 0 0 0 0 62
63 24 19 0 0 1 0 0 0 0 0 0 0 0 63
64 24 18 0 0 0 1 0 0 0 0 0 0 0 64
65 19 10 0 0 0 0 1 0 0 0 0 0 0 65
66 31 29 0 0 0 0 0 1 0 0 0 0 0 66
67 22 31 0 0 0 0 0 0 1 0 0 0 0 67
68 27 19 0 0 0 0 0 0 0 1 0 0 0 68
69 19 9 0 0 0 0 0 0 0 0 1 0 0 69
70 25 20 0 0 0 0 0 0 0 0 0 1 0 70
71 20 28 0 0 0 0 0 0 0 0 0 0 1 71
72 21 19 0 0 0 0 0 0 0 0 0 0 0 72
73 27 30 1 0 0 0 0 0 0 0 0 0 0 73
74 23 29 0 1 0 0 0 0 0 0 0 0 0 74
75 25 26 0 0 1 0 0 0 0 0 0 0 0 75
76 20 23 0 0 0 1 0 0 0 0 0 0 0 76
77 21 13 0 0 0 0 1 0 0 0 0 0 0 77
78 22 21 0 0 0 0 0 1 0 0 0 0 0 78
79 23 19 0 0 0 0 0 0 1 0 0 0 0 79
80 25 28 0 0 0 0 0 0 0 1 0 0 0 80
81 25 23 0 0 0 0 0 0 0 0 1 0 0 81
82 17 18 0 0 0 0 0 0 0 0 0 1 0 82
83 19 21 0 0 0 0 0 0 0 0 0 0 1 83
84 25 20 0 0 0 0 0 0 0 0 0 0 0 84
85 19 23 1 0 0 0 0 0 0 0 0 0 0 85
86 20 21 0 1 0 0 0 0 0 0 0 0 0 86
87 26 21 0 0 1 0 0 0 0 0 0 0 0 87
88 23 15 0 0 0 1 0 0 0 0 0 0 0 88
89 27 28 0 0 0 0 1 0 0 0 0 0 0 89
90 17 19 0 0 0 0 0 1 0 0 0 0 0 90
91 17 26 0 0 0 0 0 0 1 0 0 0 0 91
92 19 10 0 0 0 0 0 0 0 1 0 0 0 92
93 17 16 0 0 0 0 0 0 0 0 1 0 0 93
94 22 22 0 0 0 0 0 0 0 0 0 1 0 94
95 21 19 0 0 0 0 0 0 0 0 0 0 1 95
96 32 31 0 0 0 0 0 0 0 0 0 0 0 96
97 21 31 1 0 0 0 0 0 0 0 0 0 0 97
98 21 29 0 1 0 0 0 0 0 0 0 0 0 98
99 18 19 0 0 1 0 0 0 0 0 0 0 0 99
100 18 22 0 0 0 1 0 0 0 0 0 0 0 100
101 23 23 0 0 0 0 1 0 0 0 0 0 0 101
102 19 15 0 0 0 0 0 1 0 0 0 0 0 102
103 20 20 0 0 0 0 0 0 1 0 0 0 0 103
104 21 18 0 0 0 0 0 0 0 1 0 0 0 104
105 20 23 0 0 0 0 0 0 0 0 1 0 0 105
106 17 25 0 0 0 0 0 0 0 0 0 1 0 106
107 18 21 0 0 0 0 0 0 0 0 0 0 1 107
108 19 24 0 0 0 0 0 0 0 0 0 0 0 108
109 22 25 1 0 0 0 0 0 0 0 0 0 0 109
110 15 17 0 1 0 0 0 0 0 0 0 0 0 110
111 14 13 0 0 1 0 0 0 0 0 0 0 0 111
112 18 28 0 0 0 1 0 0 0 0 0 0 0 112
113 24 21 0 0 0 0 1 0 0 0 0 0 0 113
114 35 25 0 0 0 0 0 1 0 0 0 0 0 114
115 29 9 0 0 0 0 0 0 1 0 0 0 0 115
116 21 16 0 0 0 0 0 0 0 1 0 0 0 116
117 25 19 0 0 0 0 0 0 0 0 1 0 0 117
118 20 17 0 0 0 0 0 0 0 0 0 1 0 118
119 22 25 0 0 0 0 0 0 0 0 0 0 1 119
120 13 20 0 0 0 0 0 0 0 0 0 0 0 120
121 26 29 1 0 0 0 0 0 0 0 0 0 0 121
122 17 14 0 1 0 0 0 0 0 0 0 0 0 122
123 25 22 0 0 1 0 0 0 0 0 0 0 0 123
124 20 15 0 0 0 1 0 0 0 0 0 0 0 124
125 19 19 0 0 0 0 1 0 0 0 0 0 0 125
126 21 20 0 0 0 0 0 1 0 0 0 0 0 126
127 22 15 0 0 0 0 0 0 1 0 0 0 0 127
128 24 20 0 0 0 0 0 0 0 1 0 0 0 128
129 21 18 0 0 0 0 0 0 0 0 1 0 0 129
130 26 33 0 0 0 0 0 0 0 0 0 1 0 130
131 24 22 0 0 0 0 0 0 0 0 0 0 1 131
132 16 16 0 0 0 0 0 0 0 0 0 0 0 132
133 23 17 1 0 0 0 0 0 0 0 0 0 0 133
134 18 16 0 1 0 0 0 0 0 0 0 0 0 134
135 16 21 0 0 1 0 0 0 0 0 0 0 0 135
136 26 26 0 0 0 1 0 0 0 0 0 0 0 136
137 19 18 0 0 0 0 1 0 0 0 0 0 0 137
138 21 18 0 0 0 0 0 1 0 0 0 0 0 138
139 21 17 0 0 0 0 0 0 1 0 0 0 0 139
140 22 22 0 0 0 0 0 0 0 1 0 0 0 140
141 23 30 0 0 0 0 0 0 0 0 1 0 0 141
142 29 30 0 0 0 0 0 0 0 0 0 1 0 142
143 21 24 0 0 0 0 0 0 0 0 0 0 1 143
144 21 21 0 0 0 0 0 0 0 0 0 0 0 144
145 23 21 1 0 0 0 0 0 0 0 0 0 0 145
146 27 29 0 1 0 0 0 0 0 0 0 0 0 146
147 25 31 0 0 1 0 0 0 0 0 0 0 0 147
148 21 20 0 0 0 1 0 0 0 0 0 0 0 148
149 10 16 0 0 0 0 1 0 0 0 0 0 0 149
150 20 22 0 0 0 0 0 1 0 0 0 0 0 150
151 26 20 0 0 0 0 0 0 1 0 0 0 0 151
152 24 28 0 0 0 0 0 0 0 1 0 0 0 152
153 29 38 0 0 0 0 0 0 0 0 1 0 0 153
154 19 22 0 0 0 0 0 0 0 0 0 1 0 154
155 24 20 0 0 0 0 0 0 0 0 0 0 1 155
156 19 17 0 0 0 0 0 0 0 0 0 0 0 156
157 24 28 1 0 0 0 0 0 0 0 0 0 0 157
158 22 22 0 1 0 0 0 0 0 0 0 0 0 158
159 17 31 0 0 1 0 0 0 0 0 0 0 0 159
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) x M1 M2 M3 M4
14.55144 0.32838 1.08162 0.40643 1.80572 1.63550
M5 M6 M7 M8 M9 M10
1.03025 1.85899 2.36392 2.76323 2.13843 1.45968
M11 t
0.41130 -0.01127
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-9.1561 -2.3207 0.1326 2.3590 11.6652
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 14.551443 1.773089 8.207 1.13e-13 ***
x 0.328383 0.055901 5.874 2.79e-08 ***
M1 1.081621 1.486541 0.728 0.4680
M2 0.406425 1.492620 0.272 0.7858
M3 1.805724 1.486453 1.215 0.2264
M4 1.635504 1.525793 1.072 0.2855
M5 1.030250 1.527359 0.675 0.5010
M6 1.858990 1.532393 1.213 0.2271
M7 2.363917 1.522166 1.553 0.1226
M8 2.763233 1.518104 1.820 0.0708 .
M9 2.138431 1.514019 1.412 0.1600
M10 1.459682 1.512799 0.965 0.3362
M11 0.411295 1.519187 0.271 0.7870
t -0.011273 0.006674 -1.689 0.0934 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.854 on 145 degrees of freedom
Multiple R-squared: 0.2334, Adjusted R-squared: 0.1647
F-statistic: 3.396 on 13 and 145 DF, p-value: 0.0001405
> 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.9387472 0.122505643 0.061252822
[2,] 0.9120246 0.175950723 0.087975361
[3,] 0.8516691 0.296661871 0.148330936
[4,] 0.7958247 0.408350515 0.204175258
[5,] 0.8200512 0.359897688 0.179948844
[6,] 0.7713241 0.457351801 0.228675901
[7,] 0.7201799 0.559640142 0.279820071
[8,] 0.6746735 0.650653029 0.325326514
[9,] 0.6625330 0.674934031 0.337467016
[10,] 0.6739684 0.652063214 0.326031607
[11,] 0.5990616 0.801876773 0.400938387
[12,] 0.5584457 0.883108574 0.441554287
[13,] 0.5202472 0.959505675 0.479752837
[14,] 0.5290931 0.941813882 0.470906941
[15,] 0.4663761 0.932752175 0.533623912
[16,] 0.4315583 0.863116638 0.568441681
[17,] 0.5899681 0.820063861 0.410031931
[18,] 0.7986248 0.402750433 0.201375216
[19,] 0.8012316 0.397536793 0.198768396
[20,] 0.8652774 0.269445137 0.134722568
[21,] 0.8586425 0.282714901 0.141357450
[22,] 0.8715052 0.256989631 0.128494816
[23,] 0.8453044 0.309391221 0.154695611
[24,] 0.8403103 0.319379340 0.159689670
[25,] 0.8013598 0.397280463 0.198640232
[26,] 0.7659538 0.468092383 0.234046192
[27,] 0.9222512 0.155497657 0.077748829
[28,] 0.9018474 0.196305171 0.098152585
[29,] 0.8827013 0.234597355 0.117298678
[30,] 0.8672221 0.265555898 0.132777949
[31,] 0.8625195 0.274960982 0.137480491
[32,] 0.9097193 0.180561389 0.090280695
[33,] 0.8855000 0.228999989 0.114499994
[34,] 0.8631661 0.273667869 0.136833935
[35,] 0.8764463 0.247107451 0.123553726
[36,] 0.8608199 0.278360110 0.139180055
[37,] 0.8481344 0.303731114 0.151865557
[38,] 0.8609040 0.278192084 0.139096042
[39,] 0.8644755 0.271049036 0.135524518
[40,] 0.8418343 0.316331492 0.158165746
[41,] 0.8156812 0.368637669 0.184318834
[42,] 0.7893677 0.421264596 0.210632298
[43,] 0.7726393 0.454721461 0.227360730
[44,] 0.7975389 0.404922292 0.202461146
[45,] 0.7800636 0.439872822 0.219936411
[46,] 0.7503598 0.499280330 0.249640165
[47,] 0.7288338 0.542332311 0.271166155
[48,] 0.6993590 0.601282062 0.300641031
[49,] 0.6568647 0.686270576 0.343135288
[50,] 0.6850707 0.629858689 0.314929345
[51,] 0.7187214 0.562557133 0.281278566
[52,] 0.7120436 0.575912816 0.287956408
[53,] 0.6725636 0.654872819 0.327436409
[54,] 0.6543102 0.691379575 0.345689787
[55,] 0.6622692 0.675461635 0.337730818
[56,] 0.6169681 0.766063747 0.383031874
[57,] 0.5772650 0.845470017 0.422735008
[58,] 0.5439466 0.912106885 0.456053442
[59,] 0.5263620 0.947275941 0.473637971
[60,] 0.5260568 0.947886464 0.473943232
[61,] 0.4933600 0.986720017 0.506639991
[62,] 0.4463380 0.892676067 0.553661967
[63,] 0.3982541 0.796508266 0.601745867
[64,] 0.3580862 0.716172302 0.641913849
[65,] 0.3235655 0.647131048 0.676434476
[66,] 0.3397493 0.679498639 0.660250681
[67,] 0.3082132 0.616426464 0.691786768
[68,] 0.3270520 0.654104046 0.672947977
[69,] 0.3182052 0.636410496 0.681794752
[70,] 0.2818842 0.563768499 0.718115750
[71,] 0.3156466 0.631293236 0.684353382
[72,] 0.3136408 0.627281687 0.686359156
[73,] 0.3141969 0.628393893 0.685803053
[74,] 0.3374755 0.674950905 0.662524548
[75,] 0.5140962 0.971807561 0.485903781
[76,] 0.4696529 0.939305764 0.530347118
[77,] 0.4620250 0.924050068 0.537974966
[78,] 0.4162315 0.832463081 0.583768459
[79,] 0.3698720 0.739744073 0.630127964
[80,] 0.5933892 0.813221567 0.406610783
[81,] 0.5964309 0.807138141 0.403569070
[82,] 0.5635774 0.872845265 0.436422632
[83,] 0.5574368 0.885126327 0.442563163
[84,] 0.5528330 0.894333909 0.447166954
[85,] 0.5270037 0.945992539 0.472996269
[86,] 0.4881946 0.976389202 0.511805399
[87,] 0.5095549 0.980890220 0.490445110
[88,] 0.4586042 0.917208479 0.541395760
[89,] 0.4392768 0.878553624 0.560723188
[90,] 0.5226438 0.954712424 0.477356212
[91,] 0.5241163 0.951767344 0.475883672
[92,] 0.4840887 0.968177485 0.515911258
[93,] 0.4618030 0.923606100 0.538196950
[94,] 0.5139536 0.972092859 0.486046429
[95,] 0.5230097 0.953980569 0.476990284
[96,] 0.7159026 0.568194858 0.284097429
[97,] 0.7077869 0.584426131 0.292213066
[98,] 0.9370652 0.125869692 0.062934846
[99,] 0.9861217 0.027756513 0.013878257
[100,] 0.9793932 0.041213691 0.020606845
[101,] 0.9795059 0.040988294 0.020494147
[102,] 0.9700377 0.059924655 0.029962327
[103,] 0.9647397 0.070520634 0.035260317
[104,] 0.9911422 0.017715510 0.008857755
[105,] 0.9898442 0.020311640 0.010155820
[106,] 0.9883202 0.023359653 0.011679827
[107,] 0.9953443 0.009311441 0.004655721
[108,] 0.9921629 0.015674158 0.007837079
[109,] 0.9887097 0.022580654 0.011290327
[110,] 0.9818814 0.036237221 0.018118611
[111,] 0.9722019 0.055596261 0.027798130
[112,] 0.9621639 0.075672246 0.037836123
[113,] 0.9520227 0.095954688 0.047977344
[114,] 0.9501529 0.099694211 0.049847106
[115,] 0.9256689 0.148662253 0.074331126
[116,] 0.9252238 0.149552322 0.074776161
[117,] 0.9033847 0.193230515 0.096615258
[118,] 0.8691392 0.261721500 0.130860750
[119,] 0.8227894 0.354421157 0.177210578
[120,] 0.7507074 0.498585143 0.249292572
[121,] 0.7920575 0.415884906 0.207942453
[122,] 0.7204875 0.559025030 0.279512515
[123,] 0.6897998 0.620400482 0.310200241
[124,] 0.5616041 0.876791849 0.438395924
[125,] 0.4818816 0.963763183 0.518118409
[126,] 0.4751590 0.950318053 0.524840974
> postscript(file="/var/www/html/rcomp/tmp/1yctx1291115821.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/www/html/rcomp/tmp/2yctx1291115821.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/www/html/rcomp/tmp/3qlt01291115821.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/www/html/rcomp/tmp/4qlt01291115821.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/www/html/rcomp/tmp/51ual1291115821.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 = 159
Frequency = 1
1 2 3 4 5 6
0.49702319 1.85510940 8.09414683 -3.05274248 0.56378457 0.40308378
7 8 9 10 11 12
1.59589943 0.52138775 -5.49930270 -0.48089713 -3.39153372 -5.26764407
13 14 15 16 17 18
-8.03931217 -4.71092941 1.88619423 7.05283594 -0.28608182 -7.13325158
19 20 21 22 23 24
-1.26881869 -4.26907173 -2.31946563 -5.92812213 -2.59948633 -6.46074494
25 26 27 28 29 30
-1.59049926 3.08111798 2.37956232 -3.76732699 1.52081731 0.34526478
31 32 33 34 35 36
0.55293216 0.83650670 4.14419900 8.16260457 4.84932658 4.34615418
37 38 39 40 41 42
1.94742402 -1.79845186 1.57425111 5.05442386 1.35741988 1.83863287
43 44 45 46 47 48
-8.34148941 2.59885064 3.24977743 -0.41828597 -3.00053981 7.15305330
49 50 51 52 53 54
0.39623693 3.05300244 -1.32017046 -0.51161496 -1.55185342 -4.41387491
55 56 57 58 59 60
4.50996489 -1.22131230 2.72829380 3.06023040 3.76180413 -4.47239242
61 62 63 64 65 66
3.47211190 2.84504984 2.11379072 2.62366692 0.86725604 5.81051733
67 68 69 70 71 72
-4.33990150 4.21264889 0.13255153 3.21036400 -3.35703811 1.02097567
73 74 75 76 77 78
2.33841793 -0.64673034 0.95039330 -2.88296498 2.01738965 -0.42713873
79 80 81 82 83 84
0.73597347 -0.60751405 1.67047480 -3.99758860 -1.92307692 4.82787480
85 86 87 88 89 90
-3.22762088 -0.88438640 3.72758897 2.87937896 3.22693016 -4.63509133
91 92 93 94 95 96
-7.42742395 -0.56134253 -3.89556401 -0.17583775 0.86897047 8.35094634
97 98 99 100 101 102
-3.71940106 -2.37616658 -3.48036363 -4.28401846 1.00412583 -1.18627842
103 104 105 106 107 108
-2.32184552 -1.05312271 -3.05896144 -6.02570414 -2.65251316 -2.21509247
109 110 111 112 113 114
-0.61382264 -4.30029161 -5.37478521 -6.11903313 2.79617323 11.66517589
115 116 117 118 119 120
10.42564669 -0.26107532 3.38985148 -0.26336020 0.16923769 -6.76627956
121 122 123 124 125 126
2.20792821 -1.17986145 2.80505185 0.28522460 -1.41177937 -0.55762844
127 128 129 130 131 132
1.59063203 1.56067553 -0.14648389 0.61779756 3.28966784 -2.31746665
133 134 135 136 137 138
3.28380319 -0.70134509 -5.73128351 2.80829615 -0.94811473 0.23441895
139 140 141 142 143 144
0.06914839 -0.96080810 -1.95179510 4.73822771 -0.23181579 1.17590145
145 146 147 148 149 150
2.10555404 4.16496094 0.12017080 -0.08612542 -9.15606734 -1.94383020
151 152 153 154 155 156
4.21928200 -0.79582277 1.55642472 -2.49942834 4.21699712 0.62471436
157 158 159
0.94215661 1.59892213 -7.74454732
> postscript(file="/var/www/html/rcomp/tmp/61ual1291115821.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 = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 0.49702319 NA
1 1.85510940 0.49702319
2 8.09414683 1.85510940
3 -3.05274248 8.09414683
4 0.56378457 -3.05274248
5 0.40308378 0.56378457
6 1.59589943 0.40308378
7 0.52138775 1.59589943
8 -5.49930270 0.52138775
9 -0.48089713 -5.49930270
10 -3.39153372 -0.48089713
11 -5.26764407 -3.39153372
12 -8.03931217 -5.26764407
13 -4.71092941 -8.03931217
14 1.88619423 -4.71092941
15 7.05283594 1.88619423
16 -0.28608182 7.05283594
17 -7.13325158 -0.28608182
18 -1.26881869 -7.13325158
19 -4.26907173 -1.26881869
20 -2.31946563 -4.26907173
21 -5.92812213 -2.31946563
22 -2.59948633 -5.92812213
23 -6.46074494 -2.59948633
24 -1.59049926 -6.46074494
25 3.08111798 -1.59049926
26 2.37956232 3.08111798
27 -3.76732699 2.37956232
28 1.52081731 -3.76732699
29 0.34526478 1.52081731
30 0.55293216 0.34526478
31 0.83650670 0.55293216
32 4.14419900 0.83650670
33 8.16260457 4.14419900
34 4.84932658 8.16260457
35 4.34615418 4.84932658
36 1.94742402 4.34615418
37 -1.79845186 1.94742402
38 1.57425111 -1.79845186
39 5.05442386 1.57425111
40 1.35741988 5.05442386
41 1.83863287 1.35741988
42 -8.34148941 1.83863287
43 2.59885064 -8.34148941
44 3.24977743 2.59885064
45 -0.41828597 3.24977743
46 -3.00053981 -0.41828597
47 7.15305330 -3.00053981
48 0.39623693 7.15305330
49 3.05300244 0.39623693
50 -1.32017046 3.05300244
51 -0.51161496 -1.32017046
52 -1.55185342 -0.51161496
53 -4.41387491 -1.55185342
54 4.50996489 -4.41387491
55 -1.22131230 4.50996489
56 2.72829380 -1.22131230
57 3.06023040 2.72829380
58 3.76180413 3.06023040
59 -4.47239242 3.76180413
60 3.47211190 -4.47239242
61 2.84504984 3.47211190
62 2.11379072 2.84504984
63 2.62366692 2.11379072
64 0.86725604 2.62366692
65 5.81051733 0.86725604
66 -4.33990150 5.81051733
67 4.21264889 -4.33990150
68 0.13255153 4.21264889
69 3.21036400 0.13255153
70 -3.35703811 3.21036400
71 1.02097567 -3.35703811
72 2.33841793 1.02097567
73 -0.64673034 2.33841793
74 0.95039330 -0.64673034
75 -2.88296498 0.95039330
76 2.01738965 -2.88296498
77 -0.42713873 2.01738965
78 0.73597347 -0.42713873
79 -0.60751405 0.73597347
80 1.67047480 -0.60751405
81 -3.99758860 1.67047480
82 -1.92307692 -3.99758860
83 4.82787480 -1.92307692
84 -3.22762088 4.82787480
85 -0.88438640 -3.22762088
86 3.72758897 -0.88438640
87 2.87937896 3.72758897
88 3.22693016 2.87937896
89 -4.63509133 3.22693016
90 -7.42742395 -4.63509133
91 -0.56134253 -7.42742395
92 -3.89556401 -0.56134253
93 -0.17583775 -3.89556401
94 0.86897047 -0.17583775
95 8.35094634 0.86897047
96 -3.71940106 8.35094634
97 -2.37616658 -3.71940106
98 -3.48036363 -2.37616658
99 -4.28401846 -3.48036363
100 1.00412583 -4.28401846
101 -1.18627842 1.00412583
102 -2.32184552 -1.18627842
103 -1.05312271 -2.32184552
104 -3.05896144 -1.05312271
105 -6.02570414 -3.05896144
106 -2.65251316 -6.02570414
107 -2.21509247 -2.65251316
108 -0.61382264 -2.21509247
109 -4.30029161 -0.61382264
110 -5.37478521 -4.30029161
111 -6.11903313 -5.37478521
112 2.79617323 -6.11903313
113 11.66517589 2.79617323
114 10.42564669 11.66517589
115 -0.26107532 10.42564669
116 3.38985148 -0.26107532
117 -0.26336020 3.38985148
118 0.16923769 -0.26336020
119 -6.76627956 0.16923769
120 2.20792821 -6.76627956
121 -1.17986145 2.20792821
122 2.80505185 -1.17986145
123 0.28522460 2.80505185
124 -1.41177937 0.28522460
125 -0.55762844 -1.41177937
126 1.59063203 -0.55762844
127 1.56067553 1.59063203
128 -0.14648389 1.56067553
129 0.61779756 -0.14648389
130 3.28966784 0.61779756
131 -2.31746665 3.28966784
132 3.28380319 -2.31746665
133 -0.70134509 3.28380319
134 -5.73128351 -0.70134509
135 2.80829615 -5.73128351
136 -0.94811473 2.80829615
137 0.23441895 -0.94811473
138 0.06914839 0.23441895
139 -0.96080810 0.06914839
140 -1.95179510 -0.96080810
141 4.73822771 -1.95179510
142 -0.23181579 4.73822771
143 1.17590145 -0.23181579
144 2.10555404 1.17590145
145 4.16496094 2.10555404
146 0.12017080 4.16496094
147 -0.08612542 0.12017080
148 -9.15606734 -0.08612542
149 -1.94383020 -9.15606734
150 4.21928200 -1.94383020
151 -0.79582277 4.21928200
152 1.55642472 -0.79582277
153 -2.49942834 1.55642472
154 4.21699712 -2.49942834
155 0.62471436 4.21699712
156 0.94215661 0.62471436
157 1.59892213 0.94215661
158 -7.74454732 1.59892213
159 NA -7.74454732
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.85510940 0.49702319
[2,] 8.09414683 1.85510940
[3,] -3.05274248 8.09414683
[4,] 0.56378457 -3.05274248
[5,] 0.40308378 0.56378457
[6,] 1.59589943 0.40308378
[7,] 0.52138775 1.59589943
[8,] -5.49930270 0.52138775
[9,] -0.48089713 -5.49930270
[10,] -3.39153372 -0.48089713
[11,] -5.26764407 -3.39153372
[12,] -8.03931217 -5.26764407
[13,] -4.71092941 -8.03931217
[14,] 1.88619423 -4.71092941
[15,] 7.05283594 1.88619423
[16,] -0.28608182 7.05283594
[17,] -7.13325158 -0.28608182
[18,] -1.26881869 -7.13325158
[19,] -4.26907173 -1.26881869
[20,] -2.31946563 -4.26907173
[21,] -5.92812213 -2.31946563
[22,] -2.59948633 -5.92812213
[23,] -6.46074494 -2.59948633
[24,] -1.59049926 -6.46074494
[25,] 3.08111798 -1.59049926
[26,] 2.37956232 3.08111798
[27,] -3.76732699 2.37956232
[28,] 1.52081731 -3.76732699
[29,] 0.34526478 1.52081731
[30,] 0.55293216 0.34526478
[31,] 0.83650670 0.55293216
[32,] 4.14419900 0.83650670
[33,] 8.16260457 4.14419900
[34,] 4.84932658 8.16260457
[35,] 4.34615418 4.84932658
[36,] 1.94742402 4.34615418
[37,] -1.79845186 1.94742402
[38,] 1.57425111 -1.79845186
[39,] 5.05442386 1.57425111
[40,] 1.35741988 5.05442386
[41,] 1.83863287 1.35741988
[42,] -8.34148941 1.83863287
[43,] 2.59885064 -8.34148941
[44,] 3.24977743 2.59885064
[45,] -0.41828597 3.24977743
[46,] -3.00053981 -0.41828597
[47,] 7.15305330 -3.00053981
[48,] 0.39623693 7.15305330
[49,] 3.05300244 0.39623693
[50,] -1.32017046 3.05300244
[51,] -0.51161496 -1.32017046
[52,] -1.55185342 -0.51161496
[53,] -4.41387491 -1.55185342
[54,] 4.50996489 -4.41387491
[55,] -1.22131230 4.50996489
[56,] 2.72829380 -1.22131230
[57,] 3.06023040 2.72829380
[58,] 3.76180413 3.06023040
[59,] -4.47239242 3.76180413
[60,] 3.47211190 -4.47239242
[61,] 2.84504984 3.47211190
[62,] 2.11379072 2.84504984
[63,] 2.62366692 2.11379072
[64,] 0.86725604 2.62366692
[65,] 5.81051733 0.86725604
[66,] -4.33990150 5.81051733
[67,] 4.21264889 -4.33990150
[68,] 0.13255153 4.21264889
[69,] 3.21036400 0.13255153
[70,] -3.35703811 3.21036400
[71,] 1.02097567 -3.35703811
[72,] 2.33841793 1.02097567
[73,] -0.64673034 2.33841793
[74,] 0.95039330 -0.64673034
[75,] -2.88296498 0.95039330
[76,] 2.01738965 -2.88296498
[77,] -0.42713873 2.01738965
[78,] 0.73597347 -0.42713873
[79,] -0.60751405 0.73597347
[80,] 1.67047480 -0.60751405
[81,] -3.99758860 1.67047480
[82,] -1.92307692 -3.99758860
[83,] 4.82787480 -1.92307692
[84,] -3.22762088 4.82787480
[85,] -0.88438640 -3.22762088
[86,] 3.72758897 -0.88438640
[87,] 2.87937896 3.72758897
[88,] 3.22693016 2.87937896
[89,] -4.63509133 3.22693016
[90,] -7.42742395 -4.63509133
[91,] -0.56134253 -7.42742395
[92,] -3.89556401 -0.56134253
[93,] -0.17583775 -3.89556401
[94,] 0.86897047 -0.17583775
[95,] 8.35094634 0.86897047
[96,] -3.71940106 8.35094634
[97,] -2.37616658 -3.71940106
[98,] -3.48036363 -2.37616658
[99,] -4.28401846 -3.48036363
[100,] 1.00412583 -4.28401846
[101,] -1.18627842 1.00412583
[102,] -2.32184552 -1.18627842
[103,] -1.05312271 -2.32184552
[104,] -3.05896144 -1.05312271
[105,] -6.02570414 -3.05896144
[106,] -2.65251316 -6.02570414
[107,] -2.21509247 -2.65251316
[108,] -0.61382264 -2.21509247
[109,] -4.30029161 -0.61382264
[110,] -5.37478521 -4.30029161
[111,] -6.11903313 -5.37478521
[112,] 2.79617323 -6.11903313
[113,] 11.66517589 2.79617323
[114,] 10.42564669 11.66517589
[115,] -0.26107532 10.42564669
[116,] 3.38985148 -0.26107532
[117,] -0.26336020 3.38985148
[118,] 0.16923769 -0.26336020
[119,] -6.76627956 0.16923769
[120,] 2.20792821 -6.76627956
[121,] -1.17986145 2.20792821
[122,] 2.80505185 -1.17986145
[123,] 0.28522460 2.80505185
[124,] -1.41177937 0.28522460
[125,] -0.55762844 -1.41177937
[126,] 1.59063203 -0.55762844
[127,] 1.56067553 1.59063203
[128,] -0.14648389 1.56067553
[129,] 0.61779756 -0.14648389
[130,] 3.28966784 0.61779756
[131,] -2.31746665 3.28966784
[132,] 3.28380319 -2.31746665
[133,] -0.70134509 3.28380319
[134,] -5.73128351 -0.70134509
[135,] 2.80829615 -5.73128351
[136,] -0.94811473 2.80829615
[137,] 0.23441895 -0.94811473
[138,] 0.06914839 0.23441895
[139,] -0.96080810 0.06914839
[140,] -1.95179510 -0.96080810
[141,] 4.73822771 -1.95179510
[142,] -0.23181579 4.73822771
[143,] 1.17590145 -0.23181579
[144,] 2.10555404 1.17590145
[145,] 4.16496094 2.10555404
[146,] 0.12017080 4.16496094
[147,] -0.08612542 0.12017080
[148,] -9.15606734 -0.08612542
[149,] -1.94383020 -9.15606734
[150,] 4.21928200 -1.94383020
[151,] -0.79582277 4.21928200
[152,] 1.55642472 -0.79582277
[153,] -2.49942834 1.55642472
[154,] 4.21699712 -2.49942834
[155,] 0.62471436 4.21699712
[156,] 0.94215661 0.62471436
[157,] 1.59892213 0.94215661
[158,] -7.74454732 1.59892213
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.85510940 0.49702319
2 8.09414683 1.85510940
3 -3.05274248 8.09414683
4 0.56378457 -3.05274248
5 0.40308378 0.56378457
6 1.59589943 0.40308378
7 0.52138775 1.59589943
8 -5.49930270 0.52138775
9 -0.48089713 -5.49930270
10 -3.39153372 -0.48089713
11 -5.26764407 -3.39153372
12 -8.03931217 -5.26764407
13 -4.71092941 -8.03931217
14 1.88619423 -4.71092941
15 7.05283594 1.88619423
16 -0.28608182 7.05283594
17 -7.13325158 -0.28608182
18 -1.26881869 -7.13325158
19 -4.26907173 -1.26881869
20 -2.31946563 -4.26907173
21 -5.92812213 -2.31946563
22 -2.59948633 -5.92812213
23 -6.46074494 -2.59948633
24 -1.59049926 -6.46074494
25 3.08111798 -1.59049926
26 2.37956232 3.08111798
27 -3.76732699 2.37956232
28 1.52081731 -3.76732699
29 0.34526478 1.52081731
30 0.55293216 0.34526478
31 0.83650670 0.55293216
32 4.14419900 0.83650670
33 8.16260457 4.14419900
34 4.84932658 8.16260457
35 4.34615418 4.84932658
36 1.94742402 4.34615418
37 -1.79845186 1.94742402
38 1.57425111 -1.79845186
39 5.05442386 1.57425111
40 1.35741988 5.05442386
41 1.83863287 1.35741988
42 -8.34148941 1.83863287
43 2.59885064 -8.34148941
44 3.24977743 2.59885064
45 -0.41828597 3.24977743
46 -3.00053981 -0.41828597
47 7.15305330 -3.00053981
48 0.39623693 7.15305330
49 3.05300244 0.39623693
50 -1.32017046 3.05300244
51 -0.51161496 -1.32017046
52 -1.55185342 -0.51161496
53 -4.41387491 -1.55185342
54 4.50996489 -4.41387491
55 -1.22131230 4.50996489
56 2.72829380 -1.22131230
57 3.06023040 2.72829380
58 3.76180413 3.06023040
59 -4.47239242 3.76180413
60 3.47211190 -4.47239242
61 2.84504984 3.47211190
62 2.11379072 2.84504984
63 2.62366692 2.11379072
64 0.86725604 2.62366692
65 5.81051733 0.86725604
66 -4.33990150 5.81051733
67 4.21264889 -4.33990150
68 0.13255153 4.21264889
69 3.21036400 0.13255153
70 -3.35703811 3.21036400
71 1.02097567 -3.35703811
72 2.33841793 1.02097567
73 -0.64673034 2.33841793
74 0.95039330 -0.64673034
75 -2.88296498 0.95039330
76 2.01738965 -2.88296498
77 -0.42713873 2.01738965
78 0.73597347 -0.42713873
79 -0.60751405 0.73597347
80 1.67047480 -0.60751405
81 -3.99758860 1.67047480
82 -1.92307692 -3.99758860
83 4.82787480 -1.92307692
84 -3.22762088 4.82787480
85 -0.88438640 -3.22762088
86 3.72758897 -0.88438640
87 2.87937896 3.72758897
88 3.22693016 2.87937896
89 -4.63509133 3.22693016
90 -7.42742395 -4.63509133
91 -0.56134253 -7.42742395
92 -3.89556401 -0.56134253
93 -0.17583775 -3.89556401
94 0.86897047 -0.17583775
95 8.35094634 0.86897047
96 -3.71940106 8.35094634
97 -2.37616658 -3.71940106
98 -3.48036363 -2.37616658
99 -4.28401846 -3.48036363
100 1.00412583 -4.28401846
101 -1.18627842 1.00412583
102 -2.32184552 -1.18627842
103 -1.05312271 -2.32184552
104 -3.05896144 -1.05312271
105 -6.02570414 -3.05896144
106 -2.65251316 -6.02570414
107 -2.21509247 -2.65251316
108 -0.61382264 -2.21509247
109 -4.30029161 -0.61382264
110 -5.37478521 -4.30029161
111 -6.11903313 -5.37478521
112 2.79617323 -6.11903313
113 11.66517589 2.79617323
114 10.42564669 11.66517589
115 -0.26107532 10.42564669
116 3.38985148 -0.26107532
117 -0.26336020 3.38985148
118 0.16923769 -0.26336020
119 -6.76627956 0.16923769
120 2.20792821 -6.76627956
121 -1.17986145 2.20792821
122 2.80505185 -1.17986145
123 0.28522460 2.80505185
124 -1.41177937 0.28522460
125 -0.55762844 -1.41177937
126 1.59063203 -0.55762844
127 1.56067553 1.59063203
128 -0.14648389 1.56067553
129 0.61779756 -0.14648389
130 3.28966784 0.61779756
131 -2.31746665 3.28966784
132 3.28380319 -2.31746665
133 -0.70134509 3.28380319
134 -5.73128351 -0.70134509
135 2.80829615 -5.73128351
136 -0.94811473 2.80829615
137 0.23441895 -0.94811473
138 0.06914839 0.23441895
139 -0.96080810 0.06914839
140 -1.95179510 -0.96080810
141 4.73822771 -1.95179510
142 -0.23181579 4.73822771
143 1.17590145 -0.23181579
144 2.10555404 1.17590145
145 4.16496094 2.10555404
146 0.12017080 4.16496094
147 -0.08612542 0.12017080
148 -9.15606734 -0.08612542
149 -1.94383020 -9.15606734
150 4.21928200 -1.94383020
151 -0.79582277 4.21928200
152 1.55642472 -0.79582277
153 -2.49942834 1.55642472
154 4.21699712 -2.49942834
155 0.62471436 4.21699712
156 0.94215661 0.62471436
157 1.59892213 0.94215661
158 -7.74454732 1.59892213
> 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/www/html/rcomp/tmp/7u4r61291115821.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/www/html/rcomp/tmp/8u4r61291115821.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/www/html/rcomp/tmp/9u4r61291115821.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/www/html/rcomp/tmp/10nv9r1291115821.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/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/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/www/html/rcomp/tmp/11qdpf1291115821.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/www/html/rcomp/tmp/12bw6k1291115821.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/www/html/rcomp/tmp/13ixlw1291115821.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/www/html/rcomp/tmp/143gmu1291115822.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/www/html/rcomp/tmp/156y3i1291115822.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/www/html/rcomp/tmp/1638jr1291115822.tab")
+ }
> try(system("convert tmp/1yctx1291115821.ps tmp/1yctx1291115821.png",intern=TRUE))
character(0)
> try(system("convert tmp/2yctx1291115821.ps tmp/2yctx1291115821.png",intern=TRUE))
character(0)
> try(system("convert tmp/3qlt01291115821.ps tmp/3qlt01291115821.png",intern=TRUE))
character(0)
> try(system("convert tmp/4qlt01291115821.ps tmp/4qlt01291115821.png",intern=TRUE))
character(0)
> try(system("convert tmp/51ual1291115821.ps tmp/51ual1291115821.png",intern=TRUE))
character(0)
> try(system("convert tmp/61ual1291115821.ps tmp/61ual1291115821.png",intern=TRUE))
character(0)
> try(system("convert tmp/7u4r61291115821.ps tmp/7u4r61291115821.png",intern=TRUE))
character(0)
> try(system("convert tmp/8u4r61291115821.ps tmp/8u4r61291115821.png",intern=TRUE))
character(0)
> try(system("convert tmp/9u4r61291115821.ps tmp/9u4r61291115821.png",intern=TRUE))
character(0)
> try(system("convert tmp/10nv9r1291115821.ps tmp/10nv9r1291115821.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.033 1.780 9.539