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(1775
+ ,0
+ ,2197
+ ,0
+ ,2920
+ ,0
+ ,4240
+ ,0
+ ,5415
+ ,0
+ ,6136
+ ,0
+ ,6719
+ ,0
+ ,6234
+ ,0
+ ,7152
+ ,0
+ ,3646
+ ,0
+ ,2165
+ ,0
+ ,2803
+ ,0
+ ,1615
+ ,0
+ ,2350
+ ,0
+ ,3350
+ ,0
+ ,3536
+ ,0
+ ,5834
+ ,0
+ ,6767
+ ,0
+ ,5993
+ ,0
+ ,7276
+ ,0
+ ,5641
+ ,0
+ ,3477
+ ,0
+ ,2247
+ ,0
+ ,2466
+ ,0
+ ,1567
+ ,0
+ ,2237
+ ,0
+ ,2598
+ ,0
+ ,3729
+ ,0
+ ,5715
+ ,0
+ ,5776
+ ,0
+ ,5852
+ ,0
+ ,6878
+ ,0
+ ,5488
+ ,0
+ ,3583
+ ,0
+ ,2054
+ ,0
+ ,2282
+ ,0
+ ,1552
+ ,0
+ ,2261
+ ,0
+ ,2446
+ ,0
+ ,3519
+ ,0
+ ,5161
+ ,0
+ ,5085
+ ,0
+ ,5711
+ ,0
+ ,6057
+ ,0
+ ,5224
+ ,0
+ ,3363
+ ,0
+ ,1899
+ ,0
+ ,2115
+ ,0
+ ,1491
+ ,0
+ ,2061
+ ,0
+ ,2419
+ ,0
+ ,3430
+ ,0
+ ,4778
+ ,0
+ ,4862
+ ,0
+ ,6176
+ ,0
+ ,5664
+ ,0
+ ,5529
+ ,0
+ ,3418
+ ,0
+ ,1941
+ ,0
+ ,2402
+ ,0
+ ,1579
+ ,0
+ ,2146
+ ,0
+ ,2462
+ ,0
+ ,3695
+ ,0
+ ,4831
+ ,0
+ ,5134
+ ,0
+ ,6250
+ ,0
+ ,5760
+ ,0
+ ,6249
+ ,0
+ ,2917
+ ,0
+ ,1741
+ ,0
+ ,2359
+ ,0
+ ,1511
+ ,0
+ ,2059
+ ,0
+ ,2635
+ ,0
+ ,2867
+ ,0
+ ,4403
+ ,0
+ ,5720
+ ,0
+ ,4502
+ ,0
+ ,5749
+ ,0
+ ,5627
+ ,0
+ ,2846
+ ,0
+ ,1762
+ ,0
+ ,2429
+ ,0
+ ,1169
+ ,0
+ ,2154
+ ,0
+ ,2249
+ ,0
+ ,2687
+ ,0
+ ,4359
+ ,0
+ ,5382
+ ,0
+ ,4459
+ ,0
+ ,6398
+ ,0
+ ,4596
+ ,0
+ ,3024
+ ,0
+ ,1887
+ ,0
+ ,2070
+ ,0
+ ,1351
+ ,0
+ ,2218
+ ,0
+ ,2461
+ ,0
+ ,3028
+ ,0
+ ,4784
+ ,0
+ ,4975
+ ,0
+ ,4607
+ ,1
+ ,6249
+ ,1
+ ,4809
+ ,1
+ ,3157
+ ,1
+ ,1910
+ ,1
+ ,2228
+ ,1
+ ,1594
+ ,1
+ ,2467
+ ,1
+ ,2222
+ ,1
+ ,3607
+ ,1
+ ,4685
+ ,1
+ ,4962
+ ,1
+ ,5770
+ ,1
+ ,5480
+ ,1
+ ,5000
+ ,1
+ ,3228
+ ,1
+ ,1993
+ ,1
+ ,2288
+ ,1
+ ,1588
+ ,1
+ ,2105
+ ,1
+ ,2191
+ ,1
+ ,3591
+ ,1
+ ,4668
+ ,1
+ ,4885
+ ,1
+ ,5822
+ ,1
+ ,5599
+ ,1
+ ,5340
+ ,1
+ ,3082
+ ,1
+ ,2010
+ ,1
+ ,2301
+ ,1
+ ,1507
+ ,1
+ ,1992
+ ,1
+ ,2487
+ ,1
+ ,3490
+ ,1
+ ,4647
+ ,1
+ ,5594
+ ,1
+ ,5611
+ ,1
+ ,5788
+ ,1
+ ,6204
+ ,1
+ ,3013
+ ,1
+ ,1931
+ ,1
+ ,2549
+ ,1
+ ,1504
+ ,1
+ ,2090
+ ,1
+ ,2702
+ ,1
+ ,2939
+ ,1
+ ,4500
+ ,1
+ ,6208
+ ,1
+ ,6415
+ ,1
+ ,5657
+ ,1
+ ,5964
+ ,1
+ ,3163
+ ,1
+ ,1997
+ ,1
+ ,2422
+ ,1
+ ,1376
+ ,1
+ ,2202
+ ,1
+ ,2683
+ ,1
+ ,3303
+ ,1
+ ,5202
+ ,1
+ ,5231
+ ,1
+ ,4880
+ ,1
+ ,7998
+ ,1
+ ,4977
+ ,1
+ ,3531
+ ,1
+ ,2025
+ ,1
+ ,2205
+ ,1
+ ,1442
+ ,1
+ ,2238
+ ,1
+ ,2179
+ ,1
+ ,3218
+ ,1
+ ,5139
+ ,1
+ ,4990
+ ,1
+ ,4914
+ ,1
+ ,6084
+ ,1
+ ,5672
+ ,1
+ ,3548
+ ,1
+ ,1793
+ ,1
+ ,2086
+ ,1)
+ ,dim=c(2
+ ,180)
+ ,dimnames=list(c('Huwelijken'
+ ,'Dummy')
+ ,1:180))
> y <- array(NA,dim=c(2,180),dimnames=list(c('Huwelijken','Dummy'),1:180))
> 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
Huwelijken Dummy M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 1775 0 1 0 0 0 0 0 0 0 0 0 0
2 2197 0 0 1 0 0 0 0 0 0 0 0 0
3 2920 0 0 0 1 0 0 0 0 0 0 0 0
4 4240 0 0 0 0 1 0 0 0 0 0 0 0
5 5415 0 0 0 0 0 1 0 0 0 0 0 0
6 6136 0 0 0 0 0 0 1 0 0 0 0 0
7 6719 0 0 0 0 0 0 0 1 0 0 0 0
8 6234 0 0 0 0 0 0 0 0 1 0 0 0
9 7152 0 0 0 0 0 0 0 0 0 1 0 0
10 3646 0 0 0 0 0 0 0 0 0 0 1 0
11 2165 0 0 0 0 0 0 0 0 0 0 0 1
12 2803 0 0 0 0 0 0 0 0 0 0 0 0
13 1615 0 1 0 0 0 0 0 0 0 0 0 0
14 2350 0 0 1 0 0 0 0 0 0 0 0 0
15 3350 0 0 0 1 0 0 0 0 0 0 0 0
16 3536 0 0 0 0 1 0 0 0 0 0 0 0
17 5834 0 0 0 0 0 1 0 0 0 0 0 0
18 6767 0 0 0 0 0 0 1 0 0 0 0 0
19 5993 0 0 0 0 0 0 0 1 0 0 0 0
20 7276 0 0 0 0 0 0 0 0 1 0 0 0
21 5641 0 0 0 0 0 0 0 0 0 1 0 0
22 3477 0 0 0 0 0 0 0 0 0 0 1 0
23 2247 0 0 0 0 0 0 0 0 0 0 0 1
24 2466 0 0 0 0 0 0 0 0 0 0 0 0
25 1567 0 1 0 0 0 0 0 0 0 0 0 0
26 2237 0 0 1 0 0 0 0 0 0 0 0 0
27 2598 0 0 0 1 0 0 0 0 0 0 0 0
28 3729 0 0 0 0 1 0 0 0 0 0 0 0
29 5715 0 0 0 0 0 1 0 0 0 0 0 0
30 5776 0 0 0 0 0 0 1 0 0 0 0 0
31 5852 0 0 0 0 0 0 0 1 0 0 0 0
32 6878 0 0 0 0 0 0 0 0 1 0 0 0
33 5488 0 0 0 0 0 0 0 0 0 1 0 0
34 3583 0 0 0 0 0 0 0 0 0 0 1 0
35 2054 0 0 0 0 0 0 0 0 0 0 0 1
36 2282 0 0 0 0 0 0 0 0 0 0 0 0
37 1552 0 1 0 0 0 0 0 0 0 0 0 0
38 2261 0 0 1 0 0 0 0 0 0 0 0 0
39 2446 0 0 0 1 0 0 0 0 0 0 0 0
40 3519 0 0 0 0 1 0 0 0 0 0 0 0
41 5161 0 0 0 0 0 1 0 0 0 0 0 0
42 5085 0 0 0 0 0 0 1 0 0 0 0 0
43 5711 0 0 0 0 0 0 0 1 0 0 0 0
44 6057 0 0 0 0 0 0 0 0 1 0 0 0
45 5224 0 0 0 0 0 0 0 0 0 1 0 0
46 3363 0 0 0 0 0 0 0 0 0 0 1 0
47 1899 0 0 0 0 0 0 0 0 0 0 0 1
48 2115 0 0 0 0 0 0 0 0 0 0 0 0
49 1491 0 1 0 0 0 0 0 0 0 0 0 0
50 2061 0 0 1 0 0 0 0 0 0 0 0 0
51 2419 0 0 0 1 0 0 0 0 0 0 0 0
52 3430 0 0 0 0 1 0 0 0 0 0 0 0
53 4778 0 0 0 0 0 1 0 0 0 0 0 0
54 4862 0 0 0 0 0 0 1 0 0 0 0 0
55 6176 0 0 0 0 0 0 0 1 0 0 0 0
56 5664 0 0 0 0 0 0 0 0 1 0 0 0
57 5529 0 0 0 0 0 0 0 0 0 1 0 0
58 3418 0 0 0 0 0 0 0 0 0 0 1 0
59 1941 0 0 0 0 0 0 0 0 0 0 0 1
60 2402 0 0 0 0 0 0 0 0 0 0 0 0
61 1579 0 1 0 0 0 0 0 0 0 0 0 0
62 2146 0 0 1 0 0 0 0 0 0 0 0 0
63 2462 0 0 0 1 0 0 0 0 0 0 0 0
64 3695 0 0 0 0 1 0 0 0 0 0 0 0
65 4831 0 0 0 0 0 1 0 0 0 0 0 0
66 5134 0 0 0 0 0 0 1 0 0 0 0 0
67 6250 0 0 0 0 0 0 0 1 0 0 0 0
68 5760 0 0 0 0 0 0 0 0 1 0 0 0
69 6249 0 0 0 0 0 0 0 0 0 1 0 0
70 2917 0 0 0 0 0 0 0 0 0 0 1 0
71 1741 0 0 0 0 0 0 0 0 0 0 0 1
72 2359 0 0 0 0 0 0 0 0 0 0 0 0
73 1511 0 1 0 0 0 0 0 0 0 0 0 0
74 2059 0 0 1 0 0 0 0 0 0 0 0 0
75 2635 0 0 0 1 0 0 0 0 0 0 0 0
76 2867 0 0 0 0 1 0 0 0 0 0 0 0
77 4403 0 0 0 0 0 1 0 0 0 0 0 0
78 5720 0 0 0 0 0 0 1 0 0 0 0 0
79 4502 0 0 0 0 0 0 0 1 0 0 0 0
80 5749 0 0 0 0 0 0 0 0 1 0 0 0
81 5627 0 0 0 0 0 0 0 0 0 1 0 0
82 2846 0 0 0 0 0 0 0 0 0 0 1 0
83 1762 0 0 0 0 0 0 0 0 0 0 0 1
84 2429 0 0 0 0 0 0 0 0 0 0 0 0
85 1169 0 1 0 0 0 0 0 0 0 0 0 0
86 2154 0 0 1 0 0 0 0 0 0 0 0 0
87 2249 0 0 0 1 0 0 0 0 0 0 0 0
88 2687 0 0 0 0 1 0 0 0 0 0 0 0
89 4359 0 0 0 0 0 1 0 0 0 0 0 0
90 5382 0 0 0 0 0 0 1 0 0 0 0 0
91 4459 0 0 0 0 0 0 0 1 0 0 0 0
92 6398 0 0 0 0 0 0 0 0 1 0 0 0
93 4596 0 0 0 0 0 0 0 0 0 1 0 0
94 3024 0 0 0 0 0 0 0 0 0 0 1 0
95 1887 0 0 0 0 0 0 0 0 0 0 0 1
96 2070 0 0 0 0 0 0 0 0 0 0 0 0
97 1351 0 1 0 0 0 0 0 0 0 0 0 0
98 2218 0 0 1 0 0 0 0 0 0 0 0 0
99 2461 0 0 0 1 0 0 0 0 0 0 0 0
100 3028 0 0 0 0 1 0 0 0 0 0 0 0
101 4784 0 0 0 0 0 1 0 0 0 0 0 0
102 4975 0 0 0 0 0 0 1 0 0 0 0 0
103 4607 1 0 0 0 0 0 0 1 0 0 0 0
104 6249 1 0 0 0 0 0 0 0 1 0 0 0
105 4809 1 0 0 0 0 0 0 0 0 1 0 0
106 3157 1 0 0 0 0 0 0 0 0 0 1 0
107 1910 1 0 0 0 0 0 0 0 0 0 0 1
108 2228 1 0 0 0 0 0 0 0 0 0 0 0
109 1594 1 1 0 0 0 0 0 0 0 0 0 0
110 2467 1 0 1 0 0 0 0 0 0 0 0 0
111 2222 1 0 0 1 0 0 0 0 0 0 0 0
112 3607 1 0 0 0 1 0 0 0 0 0 0 0
113 4685 1 0 0 0 0 1 0 0 0 0 0 0
114 4962 1 0 0 0 0 0 1 0 0 0 0 0
115 5770 1 0 0 0 0 0 0 1 0 0 0 0
116 5480 1 0 0 0 0 0 0 0 1 0 0 0
117 5000 1 0 0 0 0 0 0 0 0 1 0 0
118 3228 1 0 0 0 0 0 0 0 0 0 1 0
119 1993 1 0 0 0 0 0 0 0 0 0 0 1
120 2288 1 0 0 0 0 0 0 0 0 0 0 0
121 1588 1 1 0 0 0 0 0 0 0 0 0 0
122 2105 1 0 1 0 0 0 0 0 0 0 0 0
123 2191 1 0 0 1 0 0 0 0 0 0 0 0
124 3591 1 0 0 0 1 0 0 0 0 0 0 0
125 4668 1 0 0 0 0 1 0 0 0 0 0 0
126 4885 1 0 0 0 0 0 1 0 0 0 0 0
127 5822 1 0 0 0 0 0 0 1 0 0 0 0
128 5599 1 0 0 0 0 0 0 0 1 0 0 0
129 5340 1 0 0 0 0 0 0 0 0 1 0 0
130 3082 1 0 0 0 0 0 0 0 0 0 1 0
131 2010 1 0 0 0 0 0 0 0 0 0 0 1
132 2301 1 0 0 0 0 0 0 0 0 0 0 0
133 1507 1 1 0 0 0 0 0 0 0 0 0 0
134 1992 1 0 1 0 0 0 0 0 0 0 0 0
135 2487 1 0 0 1 0 0 0 0 0 0 0 0
136 3490 1 0 0 0 1 0 0 0 0 0 0 0
137 4647 1 0 0 0 0 1 0 0 0 0 0 0
138 5594 1 0 0 0 0 0 1 0 0 0 0 0
139 5611 1 0 0 0 0 0 0 1 0 0 0 0
140 5788 1 0 0 0 0 0 0 0 1 0 0 0
141 6204 1 0 0 0 0 0 0 0 0 1 0 0
142 3013 1 0 0 0 0 0 0 0 0 0 1 0
143 1931 1 0 0 0 0 0 0 0 0 0 0 1
144 2549 1 0 0 0 0 0 0 0 0 0 0 0
145 1504 1 1 0 0 0 0 0 0 0 0 0 0
146 2090 1 0 1 0 0 0 0 0 0 0 0 0
147 2702 1 0 0 1 0 0 0 0 0 0 0 0
148 2939 1 0 0 0 1 0 0 0 0 0 0 0
149 4500 1 0 0 0 0 1 0 0 0 0 0 0
150 6208 1 0 0 0 0 0 1 0 0 0 0 0
151 6415 1 0 0 0 0 0 0 1 0 0 0 0
152 5657 1 0 0 0 0 0 0 0 1 0 0 0
153 5964 1 0 0 0 0 0 0 0 0 1 0 0
154 3163 1 0 0 0 0 0 0 0 0 0 1 0
155 1997 1 0 0 0 0 0 0 0 0 0 0 1
156 2422 1 0 0 0 0 0 0 0 0 0 0 0
157 1376 1 1 0 0 0 0 0 0 0 0 0 0
158 2202 1 0 1 0 0 0 0 0 0 0 0 0
159 2683 1 0 0 1 0 0 0 0 0 0 0 0
160 3303 1 0 0 0 1 0 0 0 0 0 0 0
161 5202 1 0 0 0 0 1 0 0 0 0 0 0
162 5231 1 0 0 0 0 0 1 0 0 0 0 0
163 4880 1 0 0 0 0 0 0 1 0 0 0 0
164 7998 1 0 0 0 0 0 0 0 1 0 0 0
165 4977 1 0 0 0 0 0 0 0 0 1 0 0
166 3531 1 0 0 0 0 0 0 0 0 0 1 0
167 2025 1 0 0 0 0 0 0 0 0 0 0 1
168 2205 1 0 0 0 0 0 0 0 0 0 0 0
169 1442 1 1 0 0 0 0 0 0 0 0 0 0
170 2238 1 0 1 0 0 0 0 0 0 0 0 0
171 2179 1 0 0 1 0 0 0 0 0 0 0 0
172 3218 1 0 0 0 1 0 0 0 0 0 0 0
173 5139 1 0 0 0 0 1 0 0 0 0 0 0
174 4990 1 0 0 0 0 0 1 0 0 0 0 0
175 4914 1 0 0 0 0 0 0 1 0 0 0 0
176 6084 1 0 0 0 0 0 0 0 1 0 0 0
177 5672 1 0 0 0 0 0 0 0 0 1 0 0
178 3548 1 0 0 0 0 0 0 0 0 0 1 0
179 1793 1 0 0 0 0 0 0 0 0 0 0 1
180 2086 1 0 0 0 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) Dummy M1 M2 M3 M4
2392.6 -126.4 -834.0 -157.0 191.5 1049.8
M5 M6 M7 M8 M9 M10
2599.3 3105.0 3245.1 3857.7 3231.1 932.7
M11
-376.7
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1178.699 -209.442 -5.465 174.057 1873.989
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2392.6 118.8 20.149 < 2e-16 ***
Dummy -126.3 66.9 -1.889 0.0606 .
M1 -834.0 162.1 -5.145 7.42e-07 ***
M2 -157.0 162.1 -0.968 0.3343
M3 191.5 162.1 1.182 0.2391
M4 1049.8 162.1 6.477 1.00e-09 ***
M5 2599.3 162.1 16.036 < 2e-16 ***
M6 3105.0 162.1 19.156 < 2e-16 ***
M7 3245.1 162.0 20.028 < 2e-16 ***
M8 3857.7 162.0 23.809 < 2e-16 ***
M9 3231.1 162.0 19.942 < 2e-16 ***
M10 932.7 162.0 5.757 4.02e-08 ***
M11 -376.7 162.0 -2.325 0.0213 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 443.7 on 167 degrees of freedom
Multiple R-squared: 0.9349, Adjusted R-squared: 0.9302
F-statistic: 199.9 on 12 and 167 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.44456533 0.88913066 0.55543467
[2,] 0.38377644 0.76755289 0.61622356
[3,] 0.46768111 0.93536222 0.53231889
[4,] 0.55367205 0.89265589 0.44632795
[5,] 0.78822128 0.42355744 0.21177872
[6,] 0.96655509 0.06688982 0.03344491
[7,] 0.94754800 0.10490399 0.05245200
[8,] 0.92125376 0.15749247 0.07874624
[9,] 0.89549670 0.20900661 0.10450330
[10,] 0.85519355 0.28961290 0.14480645
[11,] 0.80427752 0.39144496 0.19572248
[12,] 0.80160361 0.39679278 0.19839639
[13,] 0.75662926 0.48674147 0.24337074
[14,] 0.73456500 0.53087000 0.26543500
[15,] 0.77847400 0.44305201 0.22152600
[16,] 0.77901922 0.44196156 0.22098078
[17,] 0.76131358 0.47737283 0.23868642
[18,] 0.84356243 0.31287514 0.15643757
[19,] 0.80868488 0.38263024 0.19131512
[20,] 0.76696343 0.46607314 0.23303657
[21,] 0.73770406 0.52459188 0.26229594
[22,] 0.68696474 0.62607052 0.31303526
[23,] 0.63109564 0.73780872 0.36890436
[24,] 0.63217063 0.73565873 0.36782937
[25,] 0.60236681 0.79526637 0.39763319
[26,] 0.61356726 0.77286549 0.38643274
[27,] 0.79767014 0.40465971 0.20232986
[28,] 0.79508706 0.40982588 0.20491294
[29,] 0.82625765 0.34748471 0.17374235
[30,] 0.87246716 0.25506568 0.12753284
[31,] 0.84850838 0.30298324 0.15149162
[32,] 0.82179530 0.35640940 0.17820470
[33,] 0.80460678 0.39078645 0.19539322
[34,] 0.76845736 0.46308528 0.23154264
[35,] 0.73202795 0.53594409 0.26797205
[36,] 0.71277540 0.57444920 0.28722460
[37,] 0.68732492 0.62535017 0.31267508
[38,] 0.72663796 0.54672407 0.27336204
[39,] 0.83259233 0.33481535 0.16740767
[40,] 0.84496097 0.31007806 0.15503903
[41,] 0.89290458 0.21419083 0.10709542
[42,] 0.87806089 0.24387822 0.12193911
[43,] 0.85773760 0.28452480 0.14226240
[44,] 0.83083789 0.33832422 0.16916211
[45,] 0.80023050 0.39953900 0.19976950
[46,] 0.76722657 0.46554687 0.23277343
[47,] 0.72919463 0.54161073 0.27080537
[48,] 0.69913430 0.60173140 0.30086570
[49,] 0.68380717 0.63238566 0.31619283
[50,] 0.68397861 0.63204278 0.31602139
[51,] 0.68619513 0.62760974 0.31380487
[52,] 0.75419987 0.49160026 0.24580013
[53,] 0.76794252 0.46411497 0.23205748
[54,] 0.83074272 0.33851456 0.16925728
[55,] 0.83018567 0.33962865 0.16981433
[56,] 0.80823279 0.38353443 0.19176721
[57,] 0.77932674 0.44134651 0.22067326
[58,] 0.74846982 0.50306036 0.25153018
[59,] 0.71259522 0.57480956 0.28740478
[60,] 0.68810520 0.62378960 0.31189480
[61,] 0.72884787 0.54230427 0.27115213
[62,] 0.77301933 0.45396135 0.22698067
[63,] 0.77030268 0.45939465 0.22969732
[64,] 0.92816667 0.14366666 0.07183333
[65,] 0.92538680 0.14922639 0.07461320
[66,] 0.92158709 0.15682581 0.07841291
[67,] 0.91727433 0.16545135 0.08272567
[68,] 0.90101717 0.19796565 0.09898283
[69,] 0.88727236 0.22545528 0.11272764
[70,] 0.87370915 0.25258170 0.12629085
[71,] 0.85056765 0.29886471 0.14943235
[72,] 0.83488388 0.33023224 0.16511612
[73,] 0.86447627 0.27104746 0.13552373
[74,] 0.87615743 0.24768515 0.12384257
[75,] 0.86093757 0.27812487 0.13906243
[76,] 0.94398243 0.11203514 0.05601757
[77,] 0.93888810 0.12222379 0.06111190
[78,] 0.96922547 0.06154905 0.03077453
[79,] 0.96189492 0.07621017 0.03810508
[80,] 0.95159314 0.09681372 0.04840686
[81,] 0.94167779 0.11664442 0.05832221
[82,] 0.92780639 0.14438722 0.07219361
[83,] 0.91202206 0.17595587 0.08797794
[84,] 0.89636170 0.20727659 0.10363830
[85,] 0.88199298 0.23601405 0.11800702
[86,] 0.86393435 0.27213131 0.13606565
[87,] 0.85435530 0.29128941 0.14564470
[88,] 0.89131071 0.21737858 0.10868929
[89,] 0.89082492 0.21835015 0.10917508
[90,] 0.90280803 0.19438394 0.09719197
[91,] 0.88879331 0.22241338 0.11120669
[92,] 0.87146419 0.25707163 0.12853581
[93,] 0.84823152 0.30353696 0.15176848
[94,] 0.82775697 0.34448606 0.17224303
[95,] 0.82036902 0.35926197 0.17963098
[96,] 0.79305878 0.41388244 0.20694122
[97,] 0.77536615 0.44926770 0.22463385
[98,] 0.74068496 0.51863008 0.25931504
[99,] 0.72626903 0.54746194 0.27373097
[100,] 0.70025173 0.59949655 0.29974827
[101,] 0.73984147 0.52031706 0.26015853
[102,] 0.75178920 0.49642160 0.24821080
[103,] 0.71338538 0.57322924 0.28661462
[104,] 0.67399190 0.65201620 0.32600810
[105,] 0.62937903 0.74124195 0.37062097
[106,] 0.58826984 0.82346031 0.41173016
[107,] 0.53928192 0.92143616 0.46071808
[108,] 0.50485712 0.99028576 0.49514288
[109,] 0.47928917 0.95857833 0.52071083
[110,] 0.43516454 0.87032908 0.56483546
[111,] 0.44645468 0.89290936 0.55354532
[112,] 0.42387362 0.84774725 0.57612638
[113,] 0.46952286 0.93904572 0.53047714
[114,] 0.43686490 0.87372980 0.56313510
[115,] 0.39284699 0.78569397 0.60715301
[116,] 0.34612764 0.69225528 0.65387236
[117,] 0.29876726 0.59753452 0.70123274
[118,] 0.25510916 0.51021832 0.74489084
[119,] 0.21670096 0.43340193 0.78329904
[120,] 0.17913067 0.35826135 0.82086933
[121,] 0.15595206 0.31190411 0.84404794
[122,] 0.13199099 0.26398198 0.86800901
[123,] 0.10796007 0.21592015 0.89203993
[124,] 0.08650459 0.17300918 0.91349541
[125,] 0.10076813 0.20153626 0.89923187
[126,] 0.12183130 0.24366261 0.87816870
[127,] 0.10513406 0.21026813 0.89486594
[128,] 0.08038038 0.16076076 0.91961962
[129,] 0.06635462 0.13270924 0.93364538
[130,] 0.04909790 0.09819580 0.95090210
[131,] 0.03556865 0.07113729 0.96443135
[132,] 0.02693559 0.05387118 0.97306441
[133,] 0.02085035 0.04170070 0.97914965
[134,] 0.02086338 0.04172676 0.97913662
[135,] 0.04695554 0.09391108 0.95304446
[136,] 0.21428215 0.42856431 0.78571785
[137,] 0.52844797 0.94310407 0.47155203
[138,] 0.56200384 0.87599233 0.43799616
[139,] 0.51742466 0.96515068 0.48257534
[140,] 0.43494649 0.86989297 0.56505351
[141,] 0.37044366 0.74088732 0.62955634
[142,] 0.28914461 0.57828921 0.71085539
[143,] 0.21493114 0.42986227 0.78506886
[144,] 0.18288344 0.36576687 0.81711656
[145,] 0.12345065 0.24690130 0.87654935
[146,] 0.07848710 0.15697419 0.92151290
[147,] 0.04727449 0.09454898 0.95272551
[148,] 0.02587263 0.05174526 0.97412737
[149,] 0.72437268 0.55125465 0.27562732
> postscript(file="/var/www/html/rcomp/tmp/1honc1293454152.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/2sx4x1293454152.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/3sx4x1293454152.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/4sx4x1293454152.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/5sx4x1293454152.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 = 180
Frequency = 1
1 2 3 4 5 6
216.391515 -38.675152 335.858182 797.524848 423.058182 638.324848
7 8 9 10 11 12
1081.301212 -16.365455 1528.234545 320.634545 149.034545 410.367879
13 14 15 16 17 18
56.391515 114.324848 765.858182 93.524848 842.058182 1269.324848
19 20 21 22 23 24
355.301212 1025.634545 17.234545 151.634545 231.034545 73.367879
25 26 27 28 29 30
8.391515 1.324848 13.858182 286.524848 723.058182 278.324848
31 32 33 34 35 36
214.301212 627.634545 -135.765455 257.634545 38.034545 -110.632121
37 38 39 40 41 42
-6.608485 25.324848 -138.141818 76.524848 169.058182 -412.675152
43 44 45 46 47 48
73.301212 -193.365455 -399.765455 37.634545 -116.965455 -277.632121
49 50 51 52 53 54
-67.608485 -174.675152 -165.141818 -12.475152 -213.941818 -635.675152
55 56 57 58 59 60
538.301212 -586.365455 -94.765455 92.634545 -74.965455 9.367879
61 62 63 64 65 66
20.391515 -89.675152 -122.141818 252.524848 -160.941818 -363.675152
67 68 69 70 71 72
612.301212 -490.365455 625.234545 -408.365455 -274.965455 -33.632121
73 74 75 76 77 78
-47.608485 -176.675152 50.858182 -575.475152 -588.941818 222.324848
79 80 81 82 83 84
-1135.698788 -501.365455 3.234545 -479.365455 -253.965455 36.367879
85 86 87 88 89 90
-389.608485 -81.675152 -335.141818 -755.475152 -632.941818 -115.675152
91 92 93 94 95 96
-1178.698788 147.634545 -1027.765455 -301.365455 -128.965455 -322.632121
97 98 99 100 101 102
-207.608485 -17.675152 -123.141818 -414.475152 -207.941818 -522.675152
103 104 105 106 107 108
-904.344242 124.989091 -688.410909 -42.010909 20.389091 -38.277576
109 110 111 112 113 114
161.746061 357.679394 -235.787273 290.879394 -180.587273 -409.320606
115 116 117 118 119 120
258.655758 -644.010909 -497.410909 28.989091 103.389091 21.722424
121 122 123 124 125 126
155.746061 -4.320606 -266.787273 274.879394 -197.587273 -486.320606
127 128 129 130 131 132
310.655758 -525.010909 -157.410909 -117.010909 120.389091 34.722424
133 134 135 136 137 138
74.746061 -117.320606 29.212727 173.879394 -218.587273 222.679394
139 140 141 142 143 144
99.655758 -336.010909 706.589091 -186.010909 41.389091 282.722424
145 146 147 148 149 150
71.746061 -19.320606 244.212727 -377.120606 -365.587273 836.679394
151 152 153 154 155 156
903.655758 -467.010909 466.589091 -36.010909 107.389091 155.722424
157 158 159 160 161 162
-56.253939 92.679394 225.212727 -13.120606 336.412727 -140.320606
163 164 165 166 167 168
-631.344242 1873.989091 -520.410909 331.989091 135.389091 -61.277576
169 170 171 172 173 174
9.746061 128.679394 -278.787273 -98.120606 273.412727 -381.320606
175 176 177 178 179 180
-597.344242 -40.010909 174.589091 348.989091 -96.610909 -180.277576
> postscript(file="/var/www/html/rcomp/tmp/6kpli1293454152.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 = 180
Frequency = 1
lag(myerror, k = 1) myerror
0 216.391515 NA
1 -38.675152 216.391515
2 335.858182 -38.675152
3 797.524848 335.858182
4 423.058182 797.524848
5 638.324848 423.058182
6 1081.301212 638.324848
7 -16.365455 1081.301212
8 1528.234545 -16.365455
9 320.634545 1528.234545
10 149.034545 320.634545
11 410.367879 149.034545
12 56.391515 410.367879
13 114.324848 56.391515
14 765.858182 114.324848
15 93.524848 765.858182
16 842.058182 93.524848
17 1269.324848 842.058182
18 355.301212 1269.324848
19 1025.634545 355.301212
20 17.234545 1025.634545
21 151.634545 17.234545
22 231.034545 151.634545
23 73.367879 231.034545
24 8.391515 73.367879
25 1.324848 8.391515
26 13.858182 1.324848
27 286.524848 13.858182
28 723.058182 286.524848
29 278.324848 723.058182
30 214.301212 278.324848
31 627.634545 214.301212
32 -135.765455 627.634545
33 257.634545 -135.765455
34 38.034545 257.634545
35 -110.632121 38.034545
36 -6.608485 -110.632121
37 25.324848 -6.608485
38 -138.141818 25.324848
39 76.524848 -138.141818
40 169.058182 76.524848
41 -412.675152 169.058182
42 73.301212 -412.675152
43 -193.365455 73.301212
44 -399.765455 -193.365455
45 37.634545 -399.765455
46 -116.965455 37.634545
47 -277.632121 -116.965455
48 -67.608485 -277.632121
49 -174.675152 -67.608485
50 -165.141818 -174.675152
51 -12.475152 -165.141818
52 -213.941818 -12.475152
53 -635.675152 -213.941818
54 538.301212 -635.675152
55 -586.365455 538.301212
56 -94.765455 -586.365455
57 92.634545 -94.765455
58 -74.965455 92.634545
59 9.367879 -74.965455
60 20.391515 9.367879
61 -89.675152 20.391515
62 -122.141818 -89.675152
63 252.524848 -122.141818
64 -160.941818 252.524848
65 -363.675152 -160.941818
66 612.301212 -363.675152
67 -490.365455 612.301212
68 625.234545 -490.365455
69 -408.365455 625.234545
70 -274.965455 -408.365455
71 -33.632121 -274.965455
72 -47.608485 -33.632121
73 -176.675152 -47.608485
74 50.858182 -176.675152
75 -575.475152 50.858182
76 -588.941818 -575.475152
77 222.324848 -588.941818
78 -1135.698788 222.324848
79 -501.365455 -1135.698788
80 3.234545 -501.365455
81 -479.365455 3.234545
82 -253.965455 -479.365455
83 36.367879 -253.965455
84 -389.608485 36.367879
85 -81.675152 -389.608485
86 -335.141818 -81.675152
87 -755.475152 -335.141818
88 -632.941818 -755.475152
89 -115.675152 -632.941818
90 -1178.698788 -115.675152
91 147.634545 -1178.698788
92 -1027.765455 147.634545
93 -301.365455 -1027.765455
94 -128.965455 -301.365455
95 -322.632121 -128.965455
96 -207.608485 -322.632121
97 -17.675152 -207.608485
98 -123.141818 -17.675152
99 -414.475152 -123.141818
100 -207.941818 -414.475152
101 -522.675152 -207.941818
102 -904.344242 -522.675152
103 124.989091 -904.344242
104 -688.410909 124.989091
105 -42.010909 -688.410909
106 20.389091 -42.010909
107 -38.277576 20.389091
108 161.746061 -38.277576
109 357.679394 161.746061
110 -235.787273 357.679394
111 290.879394 -235.787273
112 -180.587273 290.879394
113 -409.320606 -180.587273
114 258.655758 -409.320606
115 -644.010909 258.655758
116 -497.410909 -644.010909
117 28.989091 -497.410909
118 103.389091 28.989091
119 21.722424 103.389091
120 155.746061 21.722424
121 -4.320606 155.746061
122 -266.787273 -4.320606
123 274.879394 -266.787273
124 -197.587273 274.879394
125 -486.320606 -197.587273
126 310.655758 -486.320606
127 -525.010909 310.655758
128 -157.410909 -525.010909
129 -117.010909 -157.410909
130 120.389091 -117.010909
131 34.722424 120.389091
132 74.746061 34.722424
133 -117.320606 74.746061
134 29.212727 -117.320606
135 173.879394 29.212727
136 -218.587273 173.879394
137 222.679394 -218.587273
138 99.655758 222.679394
139 -336.010909 99.655758
140 706.589091 -336.010909
141 -186.010909 706.589091
142 41.389091 -186.010909
143 282.722424 41.389091
144 71.746061 282.722424
145 -19.320606 71.746061
146 244.212727 -19.320606
147 -377.120606 244.212727
148 -365.587273 -377.120606
149 836.679394 -365.587273
150 903.655758 836.679394
151 -467.010909 903.655758
152 466.589091 -467.010909
153 -36.010909 466.589091
154 107.389091 -36.010909
155 155.722424 107.389091
156 -56.253939 155.722424
157 92.679394 -56.253939
158 225.212727 92.679394
159 -13.120606 225.212727
160 336.412727 -13.120606
161 -140.320606 336.412727
162 -631.344242 -140.320606
163 1873.989091 -631.344242
164 -520.410909 1873.989091
165 331.989091 -520.410909
166 135.389091 331.989091
167 -61.277576 135.389091
168 9.746061 -61.277576
169 128.679394 9.746061
170 -278.787273 128.679394
171 -98.120606 -278.787273
172 273.412727 -98.120606
173 -381.320606 273.412727
174 -597.344242 -381.320606
175 -40.010909 -597.344242
176 174.589091 -40.010909
177 348.989091 174.589091
178 -96.610909 348.989091
179 -180.277576 -96.610909
180 NA -180.277576
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -38.675152 216.391515
[2,] 335.858182 -38.675152
[3,] 797.524848 335.858182
[4,] 423.058182 797.524848
[5,] 638.324848 423.058182
[6,] 1081.301212 638.324848
[7,] -16.365455 1081.301212
[8,] 1528.234545 -16.365455
[9,] 320.634545 1528.234545
[10,] 149.034545 320.634545
[11,] 410.367879 149.034545
[12,] 56.391515 410.367879
[13,] 114.324848 56.391515
[14,] 765.858182 114.324848
[15,] 93.524848 765.858182
[16,] 842.058182 93.524848
[17,] 1269.324848 842.058182
[18,] 355.301212 1269.324848
[19,] 1025.634545 355.301212
[20,] 17.234545 1025.634545
[21,] 151.634545 17.234545
[22,] 231.034545 151.634545
[23,] 73.367879 231.034545
[24,] 8.391515 73.367879
[25,] 1.324848 8.391515
[26,] 13.858182 1.324848
[27,] 286.524848 13.858182
[28,] 723.058182 286.524848
[29,] 278.324848 723.058182
[30,] 214.301212 278.324848
[31,] 627.634545 214.301212
[32,] -135.765455 627.634545
[33,] 257.634545 -135.765455
[34,] 38.034545 257.634545
[35,] -110.632121 38.034545
[36,] -6.608485 -110.632121
[37,] 25.324848 -6.608485
[38,] -138.141818 25.324848
[39,] 76.524848 -138.141818
[40,] 169.058182 76.524848
[41,] -412.675152 169.058182
[42,] 73.301212 -412.675152
[43,] -193.365455 73.301212
[44,] -399.765455 -193.365455
[45,] 37.634545 -399.765455
[46,] -116.965455 37.634545
[47,] -277.632121 -116.965455
[48,] -67.608485 -277.632121
[49,] -174.675152 -67.608485
[50,] -165.141818 -174.675152
[51,] -12.475152 -165.141818
[52,] -213.941818 -12.475152
[53,] -635.675152 -213.941818
[54,] 538.301212 -635.675152
[55,] -586.365455 538.301212
[56,] -94.765455 -586.365455
[57,] 92.634545 -94.765455
[58,] -74.965455 92.634545
[59,] 9.367879 -74.965455
[60,] 20.391515 9.367879
[61,] -89.675152 20.391515
[62,] -122.141818 -89.675152
[63,] 252.524848 -122.141818
[64,] -160.941818 252.524848
[65,] -363.675152 -160.941818
[66,] 612.301212 -363.675152
[67,] -490.365455 612.301212
[68,] 625.234545 -490.365455
[69,] -408.365455 625.234545
[70,] -274.965455 -408.365455
[71,] -33.632121 -274.965455
[72,] -47.608485 -33.632121
[73,] -176.675152 -47.608485
[74,] 50.858182 -176.675152
[75,] -575.475152 50.858182
[76,] -588.941818 -575.475152
[77,] 222.324848 -588.941818
[78,] -1135.698788 222.324848
[79,] -501.365455 -1135.698788
[80,] 3.234545 -501.365455
[81,] -479.365455 3.234545
[82,] -253.965455 -479.365455
[83,] 36.367879 -253.965455
[84,] -389.608485 36.367879
[85,] -81.675152 -389.608485
[86,] -335.141818 -81.675152
[87,] -755.475152 -335.141818
[88,] -632.941818 -755.475152
[89,] -115.675152 -632.941818
[90,] -1178.698788 -115.675152
[91,] 147.634545 -1178.698788
[92,] -1027.765455 147.634545
[93,] -301.365455 -1027.765455
[94,] -128.965455 -301.365455
[95,] -322.632121 -128.965455
[96,] -207.608485 -322.632121
[97,] -17.675152 -207.608485
[98,] -123.141818 -17.675152
[99,] -414.475152 -123.141818
[100,] -207.941818 -414.475152
[101,] -522.675152 -207.941818
[102,] -904.344242 -522.675152
[103,] 124.989091 -904.344242
[104,] -688.410909 124.989091
[105,] -42.010909 -688.410909
[106,] 20.389091 -42.010909
[107,] -38.277576 20.389091
[108,] 161.746061 -38.277576
[109,] 357.679394 161.746061
[110,] -235.787273 357.679394
[111,] 290.879394 -235.787273
[112,] -180.587273 290.879394
[113,] -409.320606 -180.587273
[114,] 258.655758 -409.320606
[115,] -644.010909 258.655758
[116,] -497.410909 -644.010909
[117,] 28.989091 -497.410909
[118,] 103.389091 28.989091
[119,] 21.722424 103.389091
[120,] 155.746061 21.722424
[121,] -4.320606 155.746061
[122,] -266.787273 -4.320606
[123,] 274.879394 -266.787273
[124,] -197.587273 274.879394
[125,] -486.320606 -197.587273
[126,] 310.655758 -486.320606
[127,] -525.010909 310.655758
[128,] -157.410909 -525.010909
[129,] -117.010909 -157.410909
[130,] 120.389091 -117.010909
[131,] 34.722424 120.389091
[132,] 74.746061 34.722424
[133,] -117.320606 74.746061
[134,] 29.212727 -117.320606
[135,] 173.879394 29.212727
[136,] -218.587273 173.879394
[137,] 222.679394 -218.587273
[138,] 99.655758 222.679394
[139,] -336.010909 99.655758
[140,] 706.589091 -336.010909
[141,] -186.010909 706.589091
[142,] 41.389091 -186.010909
[143,] 282.722424 41.389091
[144,] 71.746061 282.722424
[145,] -19.320606 71.746061
[146,] 244.212727 -19.320606
[147,] -377.120606 244.212727
[148,] -365.587273 -377.120606
[149,] 836.679394 -365.587273
[150,] 903.655758 836.679394
[151,] -467.010909 903.655758
[152,] 466.589091 -467.010909
[153,] -36.010909 466.589091
[154,] 107.389091 -36.010909
[155,] 155.722424 107.389091
[156,] -56.253939 155.722424
[157,] 92.679394 -56.253939
[158,] 225.212727 92.679394
[159,] -13.120606 225.212727
[160,] 336.412727 -13.120606
[161,] -140.320606 336.412727
[162,] -631.344242 -140.320606
[163,] 1873.989091 -631.344242
[164,] -520.410909 1873.989091
[165,] 331.989091 -520.410909
[166,] 135.389091 331.989091
[167,] -61.277576 135.389091
[168,] 9.746061 -61.277576
[169,] 128.679394 9.746061
[170,] -278.787273 128.679394
[171,] -98.120606 -278.787273
[172,] 273.412727 -98.120606
[173,] -381.320606 273.412727
[174,] -597.344242 -381.320606
[175,] -40.010909 -597.344242
[176,] 174.589091 -40.010909
[177,] 348.989091 174.589091
[178,] -96.610909 348.989091
[179,] -180.277576 -96.610909
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -38.675152 216.391515
2 335.858182 -38.675152
3 797.524848 335.858182
4 423.058182 797.524848
5 638.324848 423.058182
6 1081.301212 638.324848
7 -16.365455 1081.301212
8 1528.234545 -16.365455
9 320.634545 1528.234545
10 149.034545 320.634545
11 410.367879 149.034545
12 56.391515 410.367879
13 114.324848 56.391515
14 765.858182 114.324848
15 93.524848 765.858182
16 842.058182 93.524848
17 1269.324848 842.058182
18 355.301212 1269.324848
19 1025.634545 355.301212
20 17.234545 1025.634545
21 151.634545 17.234545
22 231.034545 151.634545
23 73.367879 231.034545
24 8.391515 73.367879
25 1.324848 8.391515
26 13.858182 1.324848
27 286.524848 13.858182
28 723.058182 286.524848
29 278.324848 723.058182
30 214.301212 278.324848
31 627.634545 214.301212
32 -135.765455 627.634545
33 257.634545 -135.765455
34 38.034545 257.634545
35 -110.632121 38.034545
36 -6.608485 -110.632121
37 25.324848 -6.608485
38 -138.141818 25.324848
39 76.524848 -138.141818
40 169.058182 76.524848
41 -412.675152 169.058182
42 73.301212 -412.675152
43 -193.365455 73.301212
44 -399.765455 -193.365455
45 37.634545 -399.765455
46 -116.965455 37.634545
47 -277.632121 -116.965455
48 -67.608485 -277.632121
49 -174.675152 -67.608485
50 -165.141818 -174.675152
51 -12.475152 -165.141818
52 -213.941818 -12.475152
53 -635.675152 -213.941818
54 538.301212 -635.675152
55 -586.365455 538.301212
56 -94.765455 -586.365455
57 92.634545 -94.765455
58 -74.965455 92.634545
59 9.367879 -74.965455
60 20.391515 9.367879
61 -89.675152 20.391515
62 -122.141818 -89.675152
63 252.524848 -122.141818
64 -160.941818 252.524848
65 -363.675152 -160.941818
66 612.301212 -363.675152
67 -490.365455 612.301212
68 625.234545 -490.365455
69 -408.365455 625.234545
70 -274.965455 -408.365455
71 -33.632121 -274.965455
72 -47.608485 -33.632121
73 -176.675152 -47.608485
74 50.858182 -176.675152
75 -575.475152 50.858182
76 -588.941818 -575.475152
77 222.324848 -588.941818
78 -1135.698788 222.324848
79 -501.365455 -1135.698788
80 3.234545 -501.365455
81 -479.365455 3.234545
82 -253.965455 -479.365455
83 36.367879 -253.965455
84 -389.608485 36.367879
85 -81.675152 -389.608485
86 -335.141818 -81.675152
87 -755.475152 -335.141818
88 -632.941818 -755.475152
89 -115.675152 -632.941818
90 -1178.698788 -115.675152
91 147.634545 -1178.698788
92 -1027.765455 147.634545
93 -301.365455 -1027.765455
94 -128.965455 -301.365455
95 -322.632121 -128.965455
96 -207.608485 -322.632121
97 -17.675152 -207.608485
98 -123.141818 -17.675152
99 -414.475152 -123.141818
100 -207.941818 -414.475152
101 -522.675152 -207.941818
102 -904.344242 -522.675152
103 124.989091 -904.344242
104 -688.410909 124.989091
105 -42.010909 -688.410909
106 20.389091 -42.010909
107 -38.277576 20.389091
108 161.746061 -38.277576
109 357.679394 161.746061
110 -235.787273 357.679394
111 290.879394 -235.787273
112 -180.587273 290.879394
113 -409.320606 -180.587273
114 258.655758 -409.320606
115 -644.010909 258.655758
116 -497.410909 -644.010909
117 28.989091 -497.410909
118 103.389091 28.989091
119 21.722424 103.389091
120 155.746061 21.722424
121 -4.320606 155.746061
122 -266.787273 -4.320606
123 274.879394 -266.787273
124 -197.587273 274.879394
125 -486.320606 -197.587273
126 310.655758 -486.320606
127 -525.010909 310.655758
128 -157.410909 -525.010909
129 -117.010909 -157.410909
130 120.389091 -117.010909
131 34.722424 120.389091
132 74.746061 34.722424
133 -117.320606 74.746061
134 29.212727 -117.320606
135 173.879394 29.212727
136 -218.587273 173.879394
137 222.679394 -218.587273
138 99.655758 222.679394
139 -336.010909 99.655758
140 706.589091 -336.010909
141 -186.010909 706.589091
142 41.389091 -186.010909
143 282.722424 41.389091
144 71.746061 282.722424
145 -19.320606 71.746061
146 244.212727 -19.320606
147 -377.120606 244.212727
148 -365.587273 -377.120606
149 836.679394 -365.587273
150 903.655758 836.679394
151 -467.010909 903.655758
152 466.589091 -467.010909
153 -36.010909 466.589091
154 107.389091 -36.010909
155 155.722424 107.389091
156 -56.253939 155.722424
157 92.679394 -56.253939
158 225.212727 92.679394
159 -13.120606 225.212727
160 336.412727 -13.120606
161 -140.320606 336.412727
162 -631.344242 -140.320606
163 1873.989091 -631.344242
164 -520.410909 1873.989091
165 331.989091 -520.410909
166 135.389091 331.989091
167 -61.277576 135.389091
168 9.746061 -61.277576
169 128.679394 9.746061
170 -278.787273 128.679394
171 -98.120606 -278.787273
172 273.412727 -98.120606
173 -381.320606 273.412727
174 -597.344242 -381.320606
175 -40.010909 -597.344242
176 174.589091 -40.010909
177 348.989091 174.589091
178 -96.610909 348.989091
179 -180.277576 -96.610909
> 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/7dy2l1293454152.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/8dy2l1293454152.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/9dy2l1293454152.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/106pk61293454152.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/11970u1293454152.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/12c8zi1293454152.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/1380e91293454152.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/14u0dw1293454152.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/155suz1293454152.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/16jks81293454152.tab")
+ }
>
> try(system("convert tmp/1honc1293454152.ps tmp/1honc1293454152.png",intern=TRUE))
character(0)
> try(system("convert tmp/2sx4x1293454152.ps tmp/2sx4x1293454152.png",intern=TRUE))
character(0)
> try(system("convert tmp/3sx4x1293454152.ps tmp/3sx4x1293454152.png",intern=TRUE))
character(0)
> try(system("convert tmp/4sx4x1293454152.ps tmp/4sx4x1293454152.png",intern=TRUE))
character(0)
> try(system("convert tmp/5sx4x1293454152.ps tmp/5sx4x1293454152.png",intern=TRUE))
character(0)
> try(system("convert tmp/6kpli1293454152.ps tmp/6kpli1293454152.png",intern=TRUE))
character(0)
> try(system("convert tmp/7dy2l1293454152.ps tmp/7dy2l1293454152.png",intern=TRUE))
character(0)
> try(system("convert tmp/8dy2l1293454152.ps tmp/8dy2l1293454152.png",intern=TRUE))
character(0)
> try(system("convert tmp/9dy2l1293454152.ps tmp/9dy2l1293454152.png",intern=TRUE))
character(0)
> try(system("convert tmp/106pk61293454152.ps tmp/106pk61293454152.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.524 1.787 9.877