R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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.
Natural language support but running in an English locale
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 = 'No 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
1 24 24 1 0 0 0 0 0 0 0 0 0 0
2 25 25 0 1 0 0 0 0 0 0 0 0 0
3 30 17 0 0 1 0 0 0 0 0 0 0 0
4 19 18 0 0 0 1 0 0 0 0 0 0 0
5 22 18 0 0 0 0 1 0 0 0 0 0 0
6 22 16 0 0 0 0 0 1 0 0 0 0 0
7 25 20 0 0 0 0 0 0 1 0 0 0 0
8 23 16 0 0 0 0 0 0 0 1 0 0 0
9 17 18 0 0 0 0 0 0 0 0 1 0 0
10 21 17 0 0 0 0 0 0 0 0 0 1 0
11 19 23 0 0 0 0 0 0 0 0 0 0 1
12 19 30 0 0 0 0 0 0 0 0 0 0 0
13 15 23 1 0 0 0 0 0 0 0 0 0 0
14 16 18 0 1 0 0 0 0 0 0 0 0 0
15 23 15 0 0 1 0 0 0 0 0 0 0 0
16 27 12 0 0 0 1 0 0 0 0 0 0 0
17 22 21 0 0 0 0 1 0 0 0 0 0 0
18 14 15 0 0 0 0 0 1 0 0 0 0 0
19 22 20 0 0 0 0 0 0 1 0 0 0 0
20 23 31 0 0 0 0 0 0 0 1 0 0 0
21 23 27 0 0 0 0 0 0 0 0 1 0 0
22 21 34 0 0 0 0 0 0 0 0 0 1 0
23 19 21 0 0 0 0 0 0 0 0 0 0 1
24 18 31 0 0 0 0 0 0 0 0 0 0 0
25 20 19 1 0 0 0 0 0 0 0 0 0 0
26 23 16 0 1 0 0 0 0 0 0 0 0 0
27 25 20 0 0 1 0 0 0 0 0 0 0 0
28 19 21 0 0 0 1 0 0 0 0 0 0 0
29 24 22 0 0 0 0 1 0 0 0 0 0 0
30 22 17 0 0 0 0 0 1 0 0 0 0 0
31 25 24 0 0 0 0 0 0 1 0 0 0 0
32 26 25 0 0 0 0 0 0 0 1 0 0 0
33 29 26 0 0 0 0 0 0 0 0 1 0 0
34 32 25 0 0 0 0 0 0 0 0 0 1 0
35 25 17 0 0 0 0 0 0 0 0 0 0 1
36 29 32 0 0 0 0 0 0 0 0 0 0 0
37 28 33 1 0 0 0 0 0 0 0 0 0 0
38 17 13 0 1 0 0 0 0 0 0 0 0 0
39 28 32 0 0 1 0 0 0 0 0 0 0 0
40 29 25 0 0 0 1 0 0 0 0 0 0 0
41 26 29 0 0 0 0 1 0 0 0 0 0 0
42 25 22 0 0 0 0 0 1 0 0 0 0 0
43 14 18 0 0 0 0 0 0 1 0 0 0 0
44 25 17 0 0 0 0 0 0 0 1 0 0 0
45 26 20 0 0 0 0 0 0 0 0 1 0 0
46 20 15 0 0 0 0 0 0 0 0 0 1 0
47 18 20 0 0 0 0 0 0 0 0 0 0 1
48 32 33 0 0 0 0 0 0 0 0 0 0 0
49 25 29 1 0 0 0 0 0 0 0 0 0 0
50 25 23 0 1 0 0 0 0 0 0 0 0 0
51 23 26 0 0 1 0 0 0 0 0 0 0 0
52 21 18 0 0 0 1 0 0 0 0 0 0 0
53 20 20 0 0 0 0 1 0 0 0 0 0 0
54 15 11 0 0 0 0 0 1 0 0 0 0 0
55 30 28 0 0 0 0 0 0 1 0 0 0 0
56 24 26 0 0 0 0 0 0 0 1 0 0 0
57 26 22 0 0 0 0 0 0 0 0 1 0 0
58 24 17 0 0 0 0 0 0 0 0 0 1 0
59 22 12 0 0 0 0 0 0 0 0 0 0 1
60 14 14 0 0 0 0 0 0 0 0 0 0 0
61 24 17 1 0 0 0 0 0 0 0 0 0 0
62 24 21 0 1 0 0 0 0 0 0 0 0 0
63 24 19 0 0 1 0 0 0 0 0 0 0 0
64 24 18 0 0 0 1 0 0 0 0 0 0 0
65 19 10 0 0 0 0 1 0 0 0 0 0 0
66 31 29 0 0 0 0 0 1 0 0 0 0 0
67 22 31 0 0 0 0 0 0 1 0 0 0 0
68 27 19 0 0 0 0 0 0 0 1 0 0 0
69 19 9 0 0 0 0 0 0 0 0 1 0 0
70 25 20 0 0 0 0 0 0 0 0 0 1 0
71 20 28 0 0 0 0 0 0 0 0 0 0 1
72 21 19 0 0 0 0 0 0 0 0 0 0 0
73 27 30 1 0 0 0 0 0 0 0 0 0 0
74 23 29 0 1 0 0 0 0 0 0 0 0 0
75 25 26 0 0 1 0 0 0 0 0 0 0 0
76 20 23 0 0 0 1 0 0 0 0 0 0 0
77 21 13 0 0 0 0 1 0 0 0 0 0 0
78 22 21 0 0 0 0 0 1 0 0 0 0 0
79 23 19 0 0 0 0 0 0 1 0 0 0 0
80 25 28 0 0 0 0 0 0 0 1 0 0 0
81 25 23 0 0 0 0 0 0 0 0 1 0 0
82 17 18 0 0 0 0 0 0 0 0 0 1 0
83 19 21 0 0 0 0 0 0 0 0 0 0 1
84 25 20 0 0 0 0 0 0 0 0 0 0 0
85 19 23 1 0 0 0 0 0 0 0 0 0 0
86 20 21 0 1 0 0 0 0 0 0 0 0 0
87 26 21 0 0 1 0 0 0 0 0 0 0 0
88 23 15 0 0 0 1 0 0 0 0 0 0 0
89 27 28 0 0 0 0 1 0 0 0 0 0 0
90 17 19 0 0 0 0 0 1 0 0 0 0 0
91 17 26 0 0 0 0 0 0 1 0 0 0 0
92 19 10 0 0 0 0 0 0 0 1 0 0 0
93 17 16 0 0 0 0 0 0 0 0 1 0 0
94 22 22 0 0 0 0 0 0 0 0 0 1 0
95 21 19 0 0 0 0 0 0 0 0 0 0 1
96 32 31 0 0 0 0 0 0 0 0 0 0 0
97 21 31 1 0 0 0 0 0 0 0 0 0 0
98 21 29 0 1 0 0 0 0 0 0 0 0 0
99 18 19 0 0 1 0 0 0 0 0 0 0 0
100 18 22 0 0 0 1 0 0 0 0 0 0 0
101 23 23 0 0 0 0 1 0 0 0 0 0 0
102 19 15 0 0 0 0 0 1 0 0 0 0 0
103 20 20 0 0 0 0 0 0 1 0 0 0 0
104 21 18 0 0 0 0 0 0 0 1 0 0 0
105 20 23 0 0 0 0 0 0 0 0 1 0 0
106 17 25 0 0 0 0 0 0 0 0 0 1 0
107 18 21 0 0 0 0 0 0 0 0 0 0 1
108 19 24 0 0 0 0 0 0 0 0 0 0 0
109 22 25 1 0 0 0 0 0 0 0 0 0 0
110 15 17 0 1 0 0 0 0 0 0 0 0 0
111 14 13 0 0 1 0 0 0 0 0 0 0 0
112 18 28 0 0 0 1 0 0 0 0 0 0 0
113 24 21 0 0 0 0 1 0 0 0 0 0 0
114 35 25 0 0 0 0 0 1 0 0 0 0 0
115 29 9 0 0 0 0 0 0 1 0 0 0 0
116 21 16 0 0 0 0 0 0 0 1 0 0 0
117 25 19 0 0 0 0 0 0 0 0 1 0 0
118 20 17 0 0 0 0 0 0 0 0 0 1 0
119 22 25 0 0 0 0 0 0 0 0 0 0 1
120 13 20 0 0 0 0 0 0 0 0 0 0 0
121 26 29 1 0 0 0 0 0 0 0 0 0 0
122 17 14 0 1 0 0 0 0 0 0 0 0 0
123 25 22 0 0 1 0 0 0 0 0 0 0 0
124 20 15 0 0 0 1 0 0 0 0 0 0 0
125 19 19 0 0 0 0 1 0 0 0 0 0 0
126 21 20 0 0 0 0 0 1 0 0 0 0 0
127 22 15 0 0 0 0 0 0 1 0 0 0 0
128 24 20 0 0 0 0 0 0 0 1 0 0 0
129 21 18 0 0 0 0 0 0 0 0 1 0 0
130 26 33 0 0 0 0 0 0 0 0 0 1 0
131 24 22 0 0 0 0 0 0 0 0 0 0 1
132 16 16 0 0 0 0 0 0 0 0 0 0 0
133 23 17 1 0 0 0 0 0 0 0 0 0 0
134 18 16 0 1 0 0 0 0 0 0 0 0 0
135 16 21 0 0 1 0 0 0 0 0 0 0 0
136 26 26 0 0 0 1 0 0 0 0 0 0 0
137 19 18 0 0 0 0 1 0 0 0 0 0 0
138 21 18 0 0 0 0 0 1 0 0 0 0 0
139 21 17 0 0 0 0 0 0 1 0 0 0 0
140 22 22 0 0 0 0 0 0 0 1 0 0 0
141 23 30 0 0 0 0 0 0 0 0 1 0 0
142 29 30 0 0 0 0 0 0 0 0 0 1 0
143 21 24 0 0 0 0 0 0 0 0 0 0 1
144 21 21 0 0 0 0 0 0 0 0 0 0 0
145 23 21 1 0 0 0 0 0 0 0 0 0 0
146 27 29 0 1 0 0 0 0 0 0 0 0 0
147 25 31 0 0 1 0 0 0 0 0 0 0 0
148 21 20 0 0 0 1 0 0 0 0 0 0 0
149 10 16 0 0 0 0 1 0 0 0 0 0 0
150 20 22 0 0 0 0 0 1 0 0 0 0 0
151 26 20 0 0 0 0 0 0 1 0 0 0 0
152 24 28 0 0 0 0 0 0 0 1 0 0 0
153 29 38 0 0 0 0 0 0 0 0 1 0 0
154 19 22 0 0 0 0 0 0 0 0 0 1 0
155 24 20 0 0 0 0 0 0 0 0 0 0 1
156 19 17 0 0 0 0 0 0 0 0 0 0 0
157 24 28 1 0 0 0 0 0 0 0 0 0 0
158 22 22 0 1 0 0 0 0 0 0 0 0 0
159 17 31 0 0 1 0 0 0 0 0 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) x M1 M2 M3 M4
13.7057 0.3241 1.1433 0.4397 1.8338 1.7102
M5 M6 M7 M8 M9 M10
1.0927 1.9076 2.4068 2.7978 2.1660 1.4780
M11
0.4111
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-9.9842 -2.5579 -0.2156 2.4416 11.2840
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 13.7057 1.7117 8.007 3.38e-13 ***
x 0.3241 0.0562 5.767 4.63e-08 ***
M1 1.1433 1.4955 0.764 0.446
M2 0.4397 1.5019 0.293 0.770
M3 1.8338 1.4958 1.226 0.222
M4 1.7102 1.5348 1.114 0.267
M5 1.0927 1.5366 0.711 0.478
M6 1.9076 1.5418 1.237 0.218
M7 2.4068 1.5316 1.571 0.118
M8 2.7978 1.5276 1.832 0.069 .
M9 2.1660 1.5235 1.422 0.157
M10 1.4780 1.5223 0.971 0.333
M11 0.4111 1.5288 0.269 0.788
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 3.879 on 146 degrees of freedom
Multiple R-squared: 0.2183, Adjusted R-squared: 0.1541
F-statistic: 3.398 on 12 and 146 DF, p-value: 0.0002108
> 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.9662302 0.06753957 0.03376978
[2,] 0.9309679 0.13806418 0.06903209
[3,] 0.9431266 0.11374681 0.05687340
[4,] 0.9111614 0.17767711 0.08883856
[5,] 0.8817771 0.23644578 0.11822289
[6,] 0.8514395 0.29712098 0.14856049
[7,] 0.8167827 0.36643457 0.18321729
[8,] 0.7502265 0.49954692 0.24977346
[9,] 0.6980117 0.60397665 0.30198832
[10,] 0.6222193 0.75556148 0.37778074
[11,] 0.5809501 0.83809980 0.41904990
[12,] 0.5216750 0.95665001 0.47832501
[13,] 0.5102321 0.97953570 0.48976785
[14,] 0.4465335 0.89306694 0.55346653
[15,] 0.4199886 0.83997717 0.58001142
[16,] 0.3536693 0.70733855 0.64633072
[17,] 0.3114944 0.62298876 0.68850562
[18,] 0.4636755 0.92735109 0.53632446
[19,] 0.7374530 0.52509390 0.26254695
[20,] 0.7769510 0.44609795 0.22304897
[21,] 0.8809078 0.23818437 0.11909218
[22,] 0.8971919 0.20561611 0.10280805
[23,] 0.8762067 0.24758665 0.12379332
[24,] 0.8490558 0.30188831 0.15094416
[25,] 0.8670487 0.26590268 0.13295134
[26,] 0.8362919 0.32741628 0.16370814
[27,] 0.8216263 0.35674737 0.17837369
[28,] 0.9060649 0.18787018 0.09393509
[29,] 0.8927982 0.21440353 0.10720176
[30,] 0.8865272 0.22694551 0.11347276
[31,] 0.8604724 0.27905530 0.13952765
[32,] 0.8409252 0.31814967 0.15907484
[33,] 0.9161890 0.16762199 0.08381100
[34,] 0.8962353 0.20752940 0.10376470
[35,] 0.8863301 0.22733982 0.11366991
[36,] 0.8817001 0.23659973 0.11829987
[37,] 0.8579958 0.28400842 0.14200421
[38,] 0.8342560 0.33148793 0.16574396
[39,] 0.8317254 0.33654918 0.16827459
[40,] 0.8504523 0.29909532 0.14954766
[41,] 0.8209267 0.35814651 0.17907326
[42,] 0.8022798 0.39544038 0.19772019
[43,] 0.7854051 0.42918984 0.21459492
[44,] 0.7851666 0.42966680 0.21483340
[45,] 0.7878607 0.42427853 0.21213926
[46,] 0.7863859 0.42722815 0.21361407
[47,] 0.7675390 0.46492208 0.23246104
[48,] 0.7478330 0.50433409 0.25216704
[49,] 0.7260062 0.54798768 0.27399384
[50,] 0.6862023 0.62759550 0.31379775
[51,] 0.7394373 0.52112547 0.26056273
[52,] 0.7486132 0.50277357 0.25138678
[53,] 0.7572733 0.48545349 0.24272674
[54,] 0.7186612 0.56267766 0.28133883
[55,] 0.7085114 0.58297722 0.29148861
[56,] 0.6996297 0.60074067 0.30037033
[57,] 0.6604739 0.67905218 0.33952609
[58,] 0.6300928 0.73981439 0.36990719
[59,] 0.5880834 0.82383325 0.41191662
[60,] 0.5629602 0.87407958 0.43703979
[61,] 0.5486476 0.90270484 0.45135242
[62,] 0.5180731 0.96385387 0.48192693
[63,] 0.4695336 0.93906727 0.53046637
[64,] 0.4237762 0.84755249 0.57622376
[65,] 0.3791722 0.75834448 0.62082776
[66,] 0.3444087 0.68881747 0.65559126
[67,] 0.3513412 0.70268231 0.64865885
[68,] 0.3174367 0.63487343 0.68256329
[69,] 0.3420590 0.68411792 0.65794104
[70,] 0.3287511 0.65750224 0.67124888
[71,] 0.2897941 0.57958820 0.71020590
[72,] 0.3200668 0.64013361 0.67993319
[73,] 0.3138847 0.62776945 0.68611528
[74,] 0.3057703 0.61154050 0.69422975
[75,] 0.3347272 0.66945439 0.66527280
[76,] 0.5232040 0.95359209 0.47679604
[77,] 0.4783565 0.95671302 0.52164349
[78,] 0.4722727 0.94454549 0.52772726
[79,] 0.4266679 0.85333578 0.57333211
[80,] 0.3798684 0.75973675 0.62013163
[81,] 0.5842048 0.83159040 0.41579520
[82,] 0.6011748 0.79765035 0.39882518
[83,] 0.5739370 0.85212607 0.42606303
[84,] 0.5706452 0.85870963 0.42935481
[85,] 0.5747406 0.85051879 0.42525940
[86,] 0.5446403 0.91071945 0.45535973
[87,] 0.5103500 0.97929999 0.48964999
[88,] 0.5379683 0.92406344 0.46203172
[89,] 0.4891456 0.97829130 0.51085435
[90,] 0.4723967 0.94479332 0.52760334
[91,] 0.5529915 0.89401706 0.44700853
[92,] 0.5427069 0.91458620 0.45729310
[93,] 0.5042852 0.99142961 0.49571480
[94,] 0.4629815 0.92596308 0.53701846
[95,] 0.4841555 0.96831100 0.51584450
[96,] 0.4944258 0.98885158 0.50557421
[97,] 0.5908492 0.81830158 0.40915079
[98,] 0.6382781 0.72344370 0.36172185
[99,] 0.9400632 0.11987362 0.05993681
[100,] 0.9880055 0.02398900 0.01199450
[101,] 0.9822643 0.03547135 0.01773567
[102,] 0.9834625 0.03307501 0.01653750
[103,] 0.9756078 0.04878446 0.02439223
[104,] 0.9680151 0.06396971 0.03198485
[105,] 0.9856670 0.02866603 0.01433301
[106,] 0.9786333 0.04273330 0.02136665
[107,] 0.9706368 0.05872646 0.02936323
[108,] 0.9927980 0.01440398 0.00720199
[109,] 0.9882346 0.02353086 0.01176543
[110,] 0.9871973 0.02560538 0.01280269
[111,] 0.9797138 0.04057239 0.02028619
[112,] 0.9683748 0.06325036 0.03162518
[113,] 0.9630257 0.07394857 0.03697429
[114,] 0.9561146 0.08777083 0.04388541
[115,] 0.9390189 0.12196229 0.06098115
[116,] 0.9151603 0.16967938 0.08483969
[117,] 0.8901346 0.21973086 0.10986543
[118,] 0.8858256 0.22834871 0.11417435
[119,] 0.8360847 0.32783052 0.16391526
[120,] 0.7942233 0.41155348 0.20577674
[121,] 0.7222506 0.55549877 0.27774939
[122,] 0.8233748 0.35325037 0.17662519
[123,] 0.7830333 0.43393346 0.21696673
[124,] 0.7256575 0.54868505 0.27434252
[125,] 0.6267524 0.74649520 0.37324760
[126,] 0.5016477 0.99670467 0.49835233
[127,] 0.5509074 0.89818519 0.44909259
[128,] 0.4936130 0.98722599 0.50638700
> postscript(file="/var/www/html/freestat/rcomp/tmp/103ri1291114715.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/freestat/rcomp/tmp/203ri1291114715.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/freestat/rcomp/tmp/303ri1291114715.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/freestat/rcomp/tmp/4buql1291114715.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/freestat/rcomp/tmp/5buql1291114715.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
1.37238646 2.75184398 8.95058123 -2.24992851 1.36758492 1.20096591
7 8 9 10 11 12
2.40528919 1.31072137 -4.70569482 0.30646375 -2.57129392 -4.42899206
13 14 15 16 17 18
-7.30350504 -3.97939654 2.59879823 7.69472248 0.39525943 -6.47492559
19 20 21 22 23 24
-0.59471081 -3.55090609 -1.62267129 -5.20338070 -1.92307692 -5.75310056
25 26 27 28 29 30
-1.00707105 3.66882045 2.97825574 -3.22225400 2.07115093 0.87685742
31 32 33 34 35 36
1.10885520 1.39374490 4.70143720 8.71359578 5.37335707 4.92279095
37 38 39 40 41 42
2.45540999 -1.35885406 2.08895378 5.48131201 1.80239145 2.25631493
43 44 45 46 47 48
-7.94649381 2.98661287 3.64608819 -0.04531925 -2.59896843 7.59868245
49 50 51 52 53 54
0.75184398 3.40006097 -0.96639524 -0.24992851 -1.28063208 -4.17849160
55 56 57 58 59 60
4.81242121 -0.93036360 2.99787119 3.30646375 3.99389955 -4.24325610
61 62 63 64 65 66
3.64114594 3.04827796 2.30236424 2.75007149 0.96045290 5.98755545
67 68 69 70 71 72
-4.15990428 4.33839588 0.21128165 3.33413826 -3.19183640 1.13620141
73 74 75 76 77 78
2.42773548 -0.54459001 1.03360476 -2.87047099 1.98812740 -0.41957657
79 80 81 82 83 84
0.72939769 -0.57858060 1.67376269 -4.01764474 -1.92307692 4.81209291
85 86 87 88 89 90
-3.30350504 -0.95172204 3.65414725 2.72239699 3.12649995 -4.77135958
91 92 93 94 95 96
-7.53936179 -0.74462765 -4.05747783 -0.31407873 0.72514007 8.24689944
97 98 99 100 101 102
-3.89637302 -2.54459001 -3.69763576 -4.54636249 0.74704243 -1.47492559
103 104 105 106 107 108
-2.59471081 -1.33749562 -3.32623731 -6.28640422 -2.92307692 -2.48434108
109 110 111 112 113 114
-0.95172204 -4.65528805 -5.75298478 -6.49101348 2.39525943 11.28398944
115 116 117 118 119 120
9.97048266 -0.68927863 2.97019668 -0.69353625 -0.21951091 -7.18790709
121 122 123 124 125 126
1.75184398 -1.68296256 2.33003875 -0.27760301 -1.95652358 -1.09546807
127 128 129 130 131 132
1.02583168 1.01428738 -0.70569482 0.12072780 2.75281458 -2.89147310
133 134 135 136 137 138
2.64114594 -1.33117955 -6.34585275 2.15720352 -1.63241508 -0.44725108
139 140 141 142 143 144
-0.62238532 -1.63392961 -2.59499679 4.09305329 -0.89540241 0.48798442
145 146 147 148 149 150
1.34471195 3.45540999 -0.58693773 -0.89814550 -9.98419809 -2.74368507
151 152 153 154 155 156
3.40528919 -1.57858060 0.81213524 -3.31407873 3.40103157 -0.21558160
157 158 159
0.07595247 0.72416947 -8.58693773
> postscript(file="/var/www/html/freestat/rcomp/tmp/6ml7o1291114715.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 1.37238646 NA
1 2.75184398 1.37238646
2 8.95058123 2.75184398
3 -2.24992851 8.95058123
4 1.36758492 -2.24992851
5 1.20096591 1.36758492
6 2.40528919 1.20096591
7 1.31072137 2.40528919
8 -4.70569482 1.31072137
9 0.30646375 -4.70569482
10 -2.57129392 0.30646375
11 -4.42899206 -2.57129392
12 -7.30350504 -4.42899206
13 -3.97939654 -7.30350504
14 2.59879823 -3.97939654
15 7.69472248 2.59879823
16 0.39525943 7.69472248
17 -6.47492559 0.39525943
18 -0.59471081 -6.47492559
19 -3.55090609 -0.59471081
20 -1.62267129 -3.55090609
21 -5.20338070 -1.62267129
22 -1.92307692 -5.20338070
23 -5.75310056 -1.92307692
24 -1.00707105 -5.75310056
25 3.66882045 -1.00707105
26 2.97825574 3.66882045
27 -3.22225400 2.97825574
28 2.07115093 -3.22225400
29 0.87685742 2.07115093
30 1.10885520 0.87685742
31 1.39374490 1.10885520
32 4.70143720 1.39374490
33 8.71359578 4.70143720
34 5.37335707 8.71359578
35 4.92279095 5.37335707
36 2.45540999 4.92279095
37 -1.35885406 2.45540999
38 2.08895378 -1.35885406
39 5.48131201 2.08895378
40 1.80239145 5.48131201
41 2.25631493 1.80239145
42 -7.94649381 2.25631493
43 2.98661287 -7.94649381
44 3.64608819 2.98661287
45 -0.04531925 3.64608819
46 -2.59896843 -0.04531925
47 7.59868245 -2.59896843
48 0.75184398 7.59868245
49 3.40006097 0.75184398
50 -0.96639524 3.40006097
51 -0.24992851 -0.96639524
52 -1.28063208 -0.24992851
53 -4.17849160 -1.28063208
54 4.81242121 -4.17849160
55 -0.93036360 4.81242121
56 2.99787119 -0.93036360
57 3.30646375 2.99787119
58 3.99389955 3.30646375
59 -4.24325610 3.99389955
60 3.64114594 -4.24325610
61 3.04827796 3.64114594
62 2.30236424 3.04827796
63 2.75007149 2.30236424
64 0.96045290 2.75007149
65 5.98755545 0.96045290
66 -4.15990428 5.98755545
67 4.33839588 -4.15990428
68 0.21128165 4.33839588
69 3.33413826 0.21128165
70 -3.19183640 3.33413826
71 1.13620141 -3.19183640
72 2.42773548 1.13620141
73 -0.54459001 2.42773548
74 1.03360476 -0.54459001
75 -2.87047099 1.03360476
76 1.98812740 -2.87047099
77 -0.41957657 1.98812740
78 0.72939769 -0.41957657
79 -0.57858060 0.72939769
80 1.67376269 -0.57858060
81 -4.01764474 1.67376269
82 -1.92307692 -4.01764474
83 4.81209291 -1.92307692
84 -3.30350504 4.81209291
85 -0.95172204 -3.30350504
86 3.65414725 -0.95172204
87 2.72239699 3.65414725
88 3.12649995 2.72239699
89 -4.77135958 3.12649995
90 -7.53936179 -4.77135958
91 -0.74462765 -7.53936179
92 -4.05747783 -0.74462765
93 -0.31407873 -4.05747783
94 0.72514007 -0.31407873
95 8.24689944 0.72514007
96 -3.89637302 8.24689944
97 -2.54459001 -3.89637302
98 -3.69763576 -2.54459001
99 -4.54636249 -3.69763576
100 0.74704243 -4.54636249
101 -1.47492559 0.74704243
102 -2.59471081 -1.47492559
103 -1.33749562 -2.59471081
104 -3.32623731 -1.33749562
105 -6.28640422 -3.32623731
106 -2.92307692 -6.28640422
107 -2.48434108 -2.92307692
108 -0.95172204 -2.48434108
109 -4.65528805 -0.95172204
110 -5.75298478 -4.65528805
111 -6.49101348 -5.75298478
112 2.39525943 -6.49101348
113 11.28398944 2.39525943
114 9.97048266 11.28398944
115 -0.68927863 9.97048266
116 2.97019668 -0.68927863
117 -0.69353625 2.97019668
118 -0.21951091 -0.69353625
119 -7.18790709 -0.21951091
120 1.75184398 -7.18790709
121 -1.68296256 1.75184398
122 2.33003875 -1.68296256
123 -0.27760301 2.33003875
124 -1.95652358 -0.27760301
125 -1.09546807 -1.95652358
126 1.02583168 -1.09546807
127 1.01428738 1.02583168
128 -0.70569482 1.01428738
129 0.12072780 -0.70569482
130 2.75281458 0.12072780
131 -2.89147310 2.75281458
132 2.64114594 -2.89147310
133 -1.33117955 2.64114594
134 -6.34585275 -1.33117955
135 2.15720352 -6.34585275
136 -1.63241508 2.15720352
137 -0.44725108 -1.63241508
138 -0.62238532 -0.44725108
139 -1.63392961 -0.62238532
140 -2.59499679 -1.63392961
141 4.09305329 -2.59499679
142 -0.89540241 4.09305329
143 0.48798442 -0.89540241
144 1.34471195 0.48798442
145 3.45540999 1.34471195
146 -0.58693773 3.45540999
147 -0.89814550 -0.58693773
148 -9.98419809 -0.89814550
149 -2.74368507 -9.98419809
150 3.40528919 -2.74368507
151 -1.57858060 3.40528919
152 0.81213524 -1.57858060
153 -3.31407873 0.81213524
154 3.40103157 -3.31407873
155 -0.21558160 3.40103157
156 0.07595247 -0.21558160
157 0.72416947 0.07595247
158 -8.58693773 0.72416947
159 NA -8.58693773
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2.75184398 1.37238646
[2,] 8.95058123 2.75184398
[3,] -2.24992851 8.95058123
[4,] 1.36758492 -2.24992851
[5,] 1.20096591 1.36758492
[6,] 2.40528919 1.20096591
[7,] 1.31072137 2.40528919
[8,] -4.70569482 1.31072137
[9,] 0.30646375 -4.70569482
[10,] -2.57129392 0.30646375
[11,] -4.42899206 -2.57129392
[12,] -7.30350504 -4.42899206
[13,] -3.97939654 -7.30350504
[14,] 2.59879823 -3.97939654
[15,] 7.69472248 2.59879823
[16,] 0.39525943 7.69472248
[17,] -6.47492559 0.39525943
[18,] -0.59471081 -6.47492559
[19,] -3.55090609 -0.59471081
[20,] -1.62267129 -3.55090609
[21,] -5.20338070 -1.62267129
[22,] -1.92307692 -5.20338070
[23,] -5.75310056 -1.92307692
[24,] -1.00707105 -5.75310056
[25,] 3.66882045 -1.00707105
[26,] 2.97825574 3.66882045
[27,] -3.22225400 2.97825574
[28,] 2.07115093 -3.22225400
[29,] 0.87685742 2.07115093
[30,] 1.10885520 0.87685742
[31,] 1.39374490 1.10885520
[32,] 4.70143720 1.39374490
[33,] 8.71359578 4.70143720
[34,] 5.37335707 8.71359578
[35,] 4.92279095 5.37335707
[36,] 2.45540999 4.92279095
[37,] -1.35885406 2.45540999
[38,] 2.08895378 -1.35885406
[39,] 5.48131201 2.08895378
[40,] 1.80239145 5.48131201
[41,] 2.25631493 1.80239145
[42,] -7.94649381 2.25631493
[43,] 2.98661287 -7.94649381
[44,] 3.64608819 2.98661287
[45,] -0.04531925 3.64608819
[46,] -2.59896843 -0.04531925
[47,] 7.59868245 -2.59896843
[48,] 0.75184398 7.59868245
[49,] 3.40006097 0.75184398
[50,] -0.96639524 3.40006097
[51,] -0.24992851 -0.96639524
[52,] -1.28063208 -0.24992851
[53,] -4.17849160 -1.28063208
[54,] 4.81242121 -4.17849160
[55,] -0.93036360 4.81242121
[56,] 2.99787119 -0.93036360
[57,] 3.30646375 2.99787119
[58,] 3.99389955 3.30646375
[59,] -4.24325610 3.99389955
[60,] 3.64114594 -4.24325610
[61,] 3.04827796 3.64114594
[62,] 2.30236424 3.04827796
[63,] 2.75007149 2.30236424
[64,] 0.96045290 2.75007149
[65,] 5.98755545 0.96045290
[66,] -4.15990428 5.98755545
[67,] 4.33839588 -4.15990428
[68,] 0.21128165 4.33839588
[69,] 3.33413826 0.21128165
[70,] -3.19183640 3.33413826
[71,] 1.13620141 -3.19183640
[72,] 2.42773548 1.13620141
[73,] -0.54459001 2.42773548
[74,] 1.03360476 -0.54459001
[75,] -2.87047099 1.03360476
[76,] 1.98812740 -2.87047099
[77,] -0.41957657 1.98812740
[78,] 0.72939769 -0.41957657
[79,] -0.57858060 0.72939769
[80,] 1.67376269 -0.57858060
[81,] -4.01764474 1.67376269
[82,] -1.92307692 -4.01764474
[83,] 4.81209291 -1.92307692
[84,] -3.30350504 4.81209291
[85,] -0.95172204 -3.30350504
[86,] 3.65414725 -0.95172204
[87,] 2.72239699 3.65414725
[88,] 3.12649995 2.72239699
[89,] -4.77135958 3.12649995
[90,] -7.53936179 -4.77135958
[91,] -0.74462765 -7.53936179
[92,] -4.05747783 -0.74462765
[93,] -0.31407873 -4.05747783
[94,] 0.72514007 -0.31407873
[95,] 8.24689944 0.72514007
[96,] -3.89637302 8.24689944
[97,] -2.54459001 -3.89637302
[98,] -3.69763576 -2.54459001
[99,] -4.54636249 -3.69763576
[100,] 0.74704243 -4.54636249
[101,] -1.47492559 0.74704243
[102,] -2.59471081 -1.47492559
[103,] -1.33749562 -2.59471081
[104,] -3.32623731 -1.33749562
[105,] -6.28640422 -3.32623731
[106,] -2.92307692 -6.28640422
[107,] -2.48434108 -2.92307692
[108,] -0.95172204 -2.48434108
[109,] -4.65528805 -0.95172204
[110,] -5.75298478 -4.65528805
[111,] -6.49101348 -5.75298478
[112,] 2.39525943 -6.49101348
[113,] 11.28398944 2.39525943
[114,] 9.97048266 11.28398944
[115,] -0.68927863 9.97048266
[116,] 2.97019668 -0.68927863
[117,] -0.69353625 2.97019668
[118,] -0.21951091 -0.69353625
[119,] -7.18790709 -0.21951091
[120,] 1.75184398 -7.18790709
[121,] -1.68296256 1.75184398
[122,] 2.33003875 -1.68296256
[123,] -0.27760301 2.33003875
[124,] -1.95652358 -0.27760301
[125,] -1.09546807 -1.95652358
[126,] 1.02583168 -1.09546807
[127,] 1.01428738 1.02583168
[128,] -0.70569482 1.01428738
[129,] 0.12072780 -0.70569482
[130,] 2.75281458 0.12072780
[131,] -2.89147310 2.75281458
[132,] 2.64114594 -2.89147310
[133,] -1.33117955 2.64114594
[134,] -6.34585275 -1.33117955
[135,] 2.15720352 -6.34585275
[136,] -1.63241508 2.15720352
[137,] -0.44725108 -1.63241508
[138,] -0.62238532 -0.44725108
[139,] -1.63392961 -0.62238532
[140,] -2.59499679 -1.63392961
[141,] 4.09305329 -2.59499679
[142,] -0.89540241 4.09305329
[143,] 0.48798442 -0.89540241
[144,] 1.34471195 0.48798442
[145,] 3.45540999 1.34471195
[146,] -0.58693773 3.45540999
[147,] -0.89814550 -0.58693773
[148,] -9.98419809 -0.89814550
[149,] -2.74368507 -9.98419809
[150,] 3.40528919 -2.74368507
[151,] -1.57858060 3.40528919
[152,] 0.81213524 -1.57858060
[153,] -3.31407873 0.81213524
[154,] 3.40103157 -3.31407873
[155,] -0.21558160 3.40103157
[156,] 0.07595247 -0.21558160
[157,] 0.72416947 0.07595247
[158,] -8.58693773 0.72416947
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2.75184398 1.37238646
2 8.95058123 2.75184398
3 -2.24992851 8.95058123
4 1.36758492 -2.24992851
5 1.20096591 1.36758492
6 2.40528919 1.20096591
7 1.31072137 2.40528919
8 -4.70569482 1.31072137
9 0.30646375 -4.70569482
10 -2.57129392 0.30646375
11 -4.42899206 -2.57129392
12 -7.30350504 -4.42899206
13 -3.97939654 -7.30350504
14 2.59879823 -3.97939654
15 7.69472248 2.59879823
16 0.39525943 7.69472248
17 -6.47492559 0.39525943
18 -0.59471081 -6.47492559
19 -3.55090609 -0.59471081
20 -1.62267129 -3.55090609
21 -5.20338070 -1.62267129
22 -1.92307692 -5.20338070
23 -5.75310056 -1.92307692
24 -1.00707105 -5.75310056
25 3.66882045 -1.00707105
26 2.97825574 3.66882045
27 -3.22225400 2.97825574
28 2.07115093 -3.22225400
29 0.87685742 2.07115093
30 1.10885520 0.87685742
31 1.39374490 1.10885520
32 4.70143720 1.39374490
33 8.71359578 4.70143720
34 5.37335707 8.71359578
35 4.92279095 5.37335707
36 2.45540999 4.92279095
37 -1.35885406 2.45540999
38 2.08895378 -1.35885406
39 5.48131201 2.08895378
40 1.80239145 5.48131201
41 2.25631493 1.80239145
42 -7.94649381 2.25631493
43 2.98661287 -7.94649381
44 3.64608819 2.98661287
45 -0.04531925 3.64608819
46 -2.59896843 -0.04531925
47 7.59868245 -2.59896843
48 0.75184398 7.59868245
49 3.40006097 0.75184398
50 -0.96639524 3.40006097
51 -0.24992851 -0.96639524
52 -1.28063208 -0.24992851
53 -4.17849160 -1.28063208
54 4.81242121 -4.17849160
55 -0.93036360 4.81242121
56 2.99787119 -0.93036360
57 3.30646375 2.99787119
58 3.99389955 3.30646375
59 -4.24325610 3.99389955
60 3.64114594 -4.24325610
61 3.04827796 3.64114594
62 2.30236424 3.04827796
63 2.75007149 2.30236424
64 0.96045290 2.75007149
65 5.98755545 0.96045290
66 -4.15990428 5.98755545
67 4.33839588 -4.15990428
68 0.21128165 4.33839588
69 3.33413826 0.21128165
70 -3.19183640 3.33413826
71 1.13620141 -3.19183640
72 2.42773548 1.13620141
73 -0.54459001 2.42773548
74 1.03360476 -0.54459001
75 -2.87047099 1.03360476
76 1.98812740 -2.87047099
77 -0.41957657 1.98812740
78 0.72939769 -0.41957657
79 -0.57858060 0.72939769
80 1.67376269 -0.57858060
81 -4.01764474 1.67376269
82 -1.92307692 -4.01764474
83 4.81209291 -1.92307692
84 -3.30350504 4.81209291
85 -0.95172204 -3.30350504
86 3.65414725 -0.95172204
87 2.72239699 3.65414725
88 3.12649995 2.72239699
89 -4.77135958 3.12649995
90 -7.53936179 -4.77135958
91 -0.74462765 -7.53936179
92 -4.05747783 -0.74462765
93 -0.31407873 -4.05747783
94 0.72514007 -0.31407873
95 8.24689944 0.72514007
96 -3.89637302 8.24689944
97 -2.54459001 -3.89637302
98 -3.69763576 -2.54459001
99 -4.54636249 -3.69763576
100 0.74704243 -4.54636249
101 -1.47492559 0.74704243
102 -2.59471081 -1.47492559
103 -1.33749562 -2.59471081
104 -3.32623731 -1.33749562
105 -6.28640422 -3.32623731
106 -2.92307692 -6.28640422
107 -2.48434108 -2.92307692
108 -0.95172204 -2.48434108
109 -4.65528805 -0.95172204
110 -5.75298478 -4.65528805
111 -6.49101348 -5.75298478
112 2.39525943 -6.49101348
113 11.28398944 2.39525943
114 9.97048266 11.28398944
115 -0.68927863 9.97048266
116 2.97019668 -0.68927863
117 -0.69353625 2.97019668
118 -0.21951091 -0.69353625
119 -7.18790709 -0.21951091
120 1.75184398 -7.18790709
121 -1.68296256 1.75184398
122 2.33003875 -1.68296256
123 -0.27760301 2.33003875
124 -1.95652358 -0.27760301
125 -1.09546807 -1.95652358
126 1.02583168 -1.09546807
127 1.01428738 1.02583168
128 -0.70569482 1.01428738
129 0.12072780 -0.70569482
130 2.75281458 0.12072780
131 -2.89147310 2.75281458
132 2.64114594 -2.89147310
133 -1.33117955 2.64114594
134 -6.34585275 -1.33117955
135 2.15720352 -6.34585275
136 -1.63241508 2.15720352
137 -0.44725108 -1.63241508
138 -0.62238532 -0.44725108
139 -1.63392961 -0.62238532
140 -2.59499679 -1.63392961
141 4.09305329 -2.59499679
142 -0.89540241 4.09305329
143 0.48798442 -0.89540241
144 1.34471195 0.48798442
145 3.45540999 1.34471195
146 -0.58693773 3.45540999
147 -0.89814550 -0.58693773
148 -9.98419809 -0.89814550
149 -2.74368507 -9.98419809
150 3.40528919 -2.74368507
151 -1.57858060 3.40528919
152 0.81213524 -1.57858060
153 -3.31407873 0.81213524
154 3.40103157 -3.31407873
155 -0.21558160 3.40103157
156 0.07595247 -0.21558160
157 0.72416947 0.07595247
158 -8.58693773 0.72416947
> 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/freestat/rcomp/tmp/7ml7o1291114715.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/freestat/rcomp/tmp/8eu6r1291114715.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/freestat/rcomp/tmp/9eu6r1291114715.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/freestat/rcomp/tmp/10eu6r1291114715.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11b44z1291114715.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/freestat/rcomp/tmp/123e3k1291114715.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/freestat/rcomp/tmp/13sw0e1291114715.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/freestat/rcomp/tmp/143oiz1291114715.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/freestat/rcomp/tmp/156pgn1291114715.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/freestat/rcomp/tmp/162yee1291114715.tab")
+ }
> try(system("convert tmp/103ri1291114715.ps tmp/103ri1291114715.png",intern=TRUE))
character(0)
> try(system("convert tmp/203ri1291114715.ps tmp/203ri1291114715.png",intern=TRUE))
character(0)
> try(system("convert tmp/303ri1291114715.ps tmp/303ri1291114715.png",intern=TRUE))
character(0)
> try(system("convert tmp/4buql1291114715.ps tmp/4buql1291114715.png",intern=TRUE))
character(0)
> try(system("convert tmp/5buql1291114715.ps tmp/5buql1291114715.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ml7o1291114715.ps tmp/6ml7o1291114715.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ml7o1291114715.ps tmp/7ml7o1291114715.png",intern=TRUE))
character(0)
> try(system("convert tmp/8eu6r1291114715.ps tmp/8eu6r1291114715.png",intern=TRUE))
character(0)
> try(system("convert tmp/9eu6r1291114715.ps tmp/9eu6r1291114715.png",intern=TRUE))
character(0)
> try(system("convert tmp/10eu6r1291114715.ps tmp/10eu6r1291114715.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.585 2.676 5.927