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(206010
+ ,0
+ ,198112
+ ,0
+ ,194519
+ ,0
+ ,185705
+ ,0
+ ,180173
+ ,0
+ ,176142
+ ,0
+ ,203401
+ ,0
+ ,221902
+ ,0
+ ,197378
+ ,0
+ ,185001
+ ,0
+ ,176356
+ ,0
+ ,180449
+ ,0
+ ,180144
+ ,0
+ ,173666
+ ,0
+ ,165688
+ ,0
+ ,161570
+ ,0
+ ,156145
+ ,0
+ ,153730
+ ,0
+ ,182698
+ ,0
+ ,200765
+ ,0
+ ,176512
+ ,0
+ ,166618
+ ,0
+ ,158644
+ ,0
+ ,159585
+ ,0
+ ,163095
+ ,0
+ ,159044
+ ,0
+ ,155511
+ ,0
+ ,153745
+ ,0
+ ,150569
+ ,0
+ ,150605
+ ,0
+ ,179612
+ ,0
+ ,194690
+ ,0
+ ,189917
+ ,0
+ ,184128
+ ,0
+ ,175335
+ ,0
+ ,179566
+ ,0
+ ,181140
+ ,0
+ ,177876
+ ,0
+ ,175041
+ ,0
+ ,169292
+ ,0
+ ,166070
+ ,0
+ ,166972
+ ,0
+ ,206348
+ ,0
+ ,215706
+ ,0
+ ,202108
+ ,0
+ ,195411
+ ,0
+ ,193111
+ ,0
+ ,195198
+ ,0
+ ,198770
+ ,0
+ ,194163
+ ,0
+ ,190420
+ ,0
+ ,189733
+ ,0
+ ,186029
+ ,0
+ ,191531
+ ,0
+ ,232571
+ ,0
+ ,243477
+ ,0
+ ,227247
+ ,0
+ ,217859
+ ,0
+ ,208679
+ ,0
+ ,213188
+ ,0
+ ,216234
+ ,0
+ ,213586
+ ,0
+ ,209465
+ ,0
+ ,204045
+ ,0
+ ,200237
+ ,0
+ ,203666
+ ,0
+ ,241476
+ ,0
+ ,260307
+ ,0
+ ,243324
+ ,0
+ ,244460
+ ,0
+ ,233575
+ ,0
+ ,237217
+ ,0
+ ,235243
+ ,0
+ ,230354
+ ,0
+ ,227184
+ ,0
+ ,221678
+ ,0
+ ,217142
+ ,0
+ ,219452
+ ,0
+ ,256446
+ ,0
+ ,265845
+ ,0
+ ,248624
+ ,0
+ ,241114
+ ,0
+ ,229245
+ ,0
+ ,231805
+ ,0
+ ,219277
+ ,0
+ ,219313
+ ,0
+ ,212610
+ ,0
+ ,214771
+ ,0
+ ,211142
+ ,0
+ ,211457
+ ,0
+ ,240048
+ ,0
+ ,240636
+ ,0
+ ,230580
+ ,0
+ ,208795
+ ,0
+ ,197922
+ ,0
+ ,194596
+ ,0
+ ,194581
+ ,0
+ ,185686
+ ,0
+ ,178106
+ ,0
+ ,172608
+ ,0
+ ,167302
+ ,0
+ ,168053
+ ,0
+ ,202300
+ ,0
+ ,202388
+ ,0
+ ,182516
+ ,0
+ ,173476
+ ,0
+ ,166444
+ ,0
+ ,171297
+ ,0
+ ,169701
+ ,0
+ ,164182
+ ,0
+ ,161914
+ ,0
+ ,159612
+ ,0
+ ,151001
+ ,0
+ ,158114
+ ,0
+ ,186530
+ ,1
+ ,187069
+ ,1
+ ,174330
+ ,1
+ ,169362
+ ,1
+ ,166827
+ ,1
+ ,178037
+ ,1
+ ,186413
+ ,1
+ ,189226
+ ,1
+ ,191563
+ ,1
+ ,188906
+ ,1
+ ,186005
+ ,1
+ ,195309
+ ,1
+ ,223532
+ ,1
+ ,226899
+ ,1
+ ,214126
+ ,1
+ ,206903
+ ,1
+ ,204442
+ ,1
+ ,220375
+ ,1
+ ,214320
+ ,1
+ ,212588
+ ,1
+ ,205816
+ ,1
+ ,202196
+ ,1
+ ,195722
+ ,1
+ ,198563
+ ,1
+ ,229139
+ ,1
+ ,229527
+ ,1
+ ,211868
+ ,1
+ ,203555
+ ,1
+ ,195770
+ ,1)
+ ,dim=c(2
+ ,143)
+ ,dimnames=list(c('Werkloosheid'
+ ,'Dummy_crisis')
+ ,1:143))
> y <- array(NA,dim=c(2,143),dimnames=list(c('Werkloosheid','Dummy_crisis'),1:143))
> 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
Werkloosheid Dummy_crisis M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 206010 0 1 0 0 0 0 0 0 0 0 0 0
2 198112 0 0 1 0 0 0 0 0 0 0 0 0
3 194519 0 0 0 1 0 0 0 0 0 0 0 0
4 185705 0 0 0 0 1 0 0 0 0 0 0 0
5 180173 0 0 0 0 0 1 0 0 0 0 0 0
6 176142 0 0 0 0 0 0 1 0 0 0 0 0
7 203401 0 0 0 0 0 0 0 1 0 0 0 0
8 221902 0 0 0 0 0 0 0 0 1 0 0 0
9 197378 0 0 0 0 0 0 0 0 0 1 0 0
10 185001 0 0 0 0 0 0 0 0 0 0 1 0
11 176356 0 0 0 0 0 0 0 0 0 0 0 1
12 180449 0 0 0 0 0 0 0 0 0 0 0 0
13 180144 0 1 0 0 0 0 0 0 0 0 0 0
14 173666 0 0 1 0 0 0 0 0 0 0 0 0
15 165688 0 0 0 1 0 0 0 0 0 0 0 0
16 161570 0 0 0 0 1 0 0 0 0 0 0 0
17 156145 0 0 0 0 0 1 0 0 0 0 0 0
18 153730 0 0 0 0 0 0 1 0 0 0 0 0
19 182698 0 0 0 0 0 0 0 1 0 0 0 0
20 200765 0 0 0 0 0 0 0 0 1 0 0 0
21 176512 0 0 0 0 0 0 0 0 0 1 0 0
22 166618 0 0 0 0 0 0 0 0 0 0 1 0
23 158644 0 0 0 0 0 0 0 0 0 0 0 1
24 159585 0 0 0 0 0 0 0 0 0 0 0 0
25 163095 0 1 0 0 0 0 0 0 0 0 0 0
26 159044 0 0 1 0 0 0 0 0 0 0 0 0
27 155511 0 0 0 1 0 0 0 0 0 0 0 0
28 153745 0 0 0 0 1 0 0 0 0 0 0 0
29 150569 0 0 0 0 0 1 0 0 0 0 0 0
30 150605 0 0 0 0 0 0 1 0 0 0 0 0
31 179612 0 0 0 0 0 0 0 1 0 0 0 0
32 194690 0 0 0 0 0 0 0 0 1 0 0 0
33 189917 0 0 0 0 0 0 0 0 0 1 0 0
34 184128 0 0 0 0 0 0 0 0 0 0 1 0
35 175335 0 0 0 0 0 0 0 0 0 0 0 1
36 179566 0 0 0 0 0 0 0 0 0 0 0 0
37 181140 0 1 0 0 0 0 0 0 0 0 0 0
38 177876 0 0 1 0 0 0 0 0 0 0 0 0
39 175041 0 0 0 1 0 0 0 0 0 0 0 0
40 169292 0 0 0 0 1 0 0 0 0 0 0 0
41 166070 0 0 0 0 0 1 0 0 0 0 0 0
42 166972 0 0 0 0 0 0 1 0 0 0 0 0
43 206348 0 0 0 0 0 0 0 1 0 0 0 0
44 215706 0 0 0 0 0 0 0 0 1 0 0 0
45 202108 0 0 0 0 0 0 0 0 0 1 0 0
46 195411 0 0 0 0 0 0 0 0 0 0 1 0
47 193111 0 0 0 0 0 0 0 0 0 0 0 1
48 195198 0 0 0 0 0 0 0 0 0 0 0 0
49 198770 0 1 0 0 0 0 0 0 0 0 0 0
50 194163 0 0 1 0 0 0 0 0 0 0 0 0
51 190420 0 0 0 1 0 0 0 0 0 0 0 0
52 189733 0 0 0 0 1 0 0 0 0 0 0 0
53 186029 0 0 0 0 0 1 0 0 0 0 0 0
54 191531 0 0 0 0 0 0 1 0 0 0 0 0
55 232571 0 0 0 0 0 0 0 1 0 0 0 0
56 243477 0 0 0 0 0 0 0 0 1 0 0 0
57 227247 0 0 0 0 0 0 0 0 0 1 0 0
58 217859 0 0 0 0 0 0 0 0 0 0 1 0
59 208679 0 0 0 0 0 0 0 0 0 0 0 1
60 213188 0 0 0 0 0 0 0 0 0 0 0 0
61 216234 0 1 0 0 0 0 0 0 0 0 0 0
62 213586 0 0 1 0 0 0 0 0 0 0 0 0
63 209465 0 0 0 1 0 0 0 0 0 0 0 0
64 204045 0 0 0 0 1 0 0 0 0 0 0 0
65 200237 0 0 0 0 0 1 0 0 0 0 0 0
66 203666 0 0 0 0 0 0 1 0 0 0 0 0
67 241476 0 0 0 0 0 0 0 1 0 0 0 0
68 260307 0 0 0 0 0 0 0 0 1 0 0 0
69 243324 0 0 0 0 0 0 0 0 0 1 0 0
70 244460 0 0 0 0 0 0 0 0 0 0 1 0
71 233575 0 0 0 0 0 0 0 0 0 0 0 1
72 237217 0 0 0 0 0 0 0 0 0 0 0 0
73 235243 0 1 0 0 0 0 0 0 0 0 0 0
74 230354 0 0 1 0 0 0 0 0 0 0 0 0
75 227184 0 0 0 1 0 0 0 0 0 0 0 0
76 221678 0 0 0 0 1 0 0 0 0 0 0 0
77 217142 0 0 0 0 0 1 0 0 0 0 0 0
78 219452 0 0 0 0 0 0 1 0 0 0 0 0
79 256446 0 0 0 0 0 0 0 1 0 0 0 0
80 265845 0 0 0 0 0 0 0 0 1 0 0 0
81 248624 0 0 0 0 0 0 0 0 0 1 0 0
82 241114 0 0 0 0 0 0 0 0 0 0 1 0
83 229245 0 0 0 0 0 0 0 0 0 0 0 1
84 231805 0 0 0 0 0 0 0 0 0 0 0 0
85 219277 0 1 0 0 0 0 0 0 0 0 0 0
86 219313 0 0 1 0 0 0 0 0 0 0 0 0
87 212610 0 0 0 1 0 0 0 0 0 0 0 0
88 214771 0 0 0 0 1 0 0 0 0 0 0 0
89 211142 0 0 0 0 0 1 0 0 0 0 0 0
90 211457 0 0 0 0 0 0 1 0 0 0 0 0
91 240048 0 0 0 0 0 0 0 1 0 0 0 0
92 240636 0 0 0 0 0 0 0 0 1 0 0 0
93 230580 0 0 0 0 0 0 0 0 0 1 0 0
94 208795 0 0 0 0 0 0 0 0 0 0 1 0
95 197922 0 0 0 0 0 0 0 0 0 0 0 1
96 194596 0 0 0 0 0 0 0 0 0 0 0 0
97 194581 0 1 0 0 0 0 0 0 0 0 0 0
98 185686 0 0 1 0 0 0 0 0 0 0 0 0
99 178106 0 0 0 1 0 0 0 0 0 0 0 0
100 172608 0 0 0 0 1 0 0 0 0 0 0 0
101 167302 0 0 0 0 0 1 0 0 0 0 0 0
102 168053 0 0 0 0 0 0 1 0 0 0 0 0
103 202300 0 0 0 0 0 0 0 1 0 0 0 0
104 202388 0 0 0 0 0 0 0 0 1 0 0 0
105 182516 0 0 0 0 0 0 0 0 0 1 0 0
106 173476 0 0 0 0 0 0 0 0 0 0 1 0
107 166444 0 0 0 0 0 0 0 0 0 0 0 1
108 171297 0 0 0 0 0 0 0 0 0 0 0 0
109 169701 0 1 0 0 0 0 0 0 0 0 0 0
110 164182 0 0 1 0 0 0 0 0 0 0 0 0
111 161914 0 0 0 1 0 0 0 0 0 0 0 0
112 159612 0 0 0 0 1 0 0 0 0 0 0 0
113 151001 0 0 0 0 0 1 0 0 0 0 0 0
114 158114 0 0 0 0 0 0 1 0 0 0 0 0
115 186530 1 0 0 0 0 0 0 1 0 0 0 0
116 187069 1 0 0 0 0 0 0 0 1 0 0 0
117 174330 1 0 0 0 0 0 0 0 0 1 0 0
118 169362 1 0 0 0 0 0 0 0 0 0 1 0
119 166827 1 0 0 0 0 0 0 0 0 0 0 1
120 178037 1 0 0 0 0 0 0 0 0 0 0 0
121 186413 1 1 0 0 0 0 0 0 0 0 0 0
122 189226 1 0 1 0 0 0 0 0 0 0 0 0
123 191563 1 0 0 1 0 0 0 0 0 0 0 0
124 188906 1 0 0 0 1 0 0 0 0 0 0 0
125 186005 1 0 0 0 0 1 0 0 0 0 0 0
126 195309 1 0 0 0 0 0 1 0 0 0 0 0
127 223532 1 0 0 0 0 0 0 1 0 0 0 0
128 226899 1 0 0 0 0 0 0 0 1 0 0 0
129 214126 1 0 0 0 0 0 0 0 0 1 0 0
130 206903 1 0 0 0 0 0 0 0 0 0 1 0
131 204442 1 0 0 0 0 0 0 0 0 0 0 1
132 220375 1 0 0 0 0 0 0 0 0 0 0 0
133 214320 1 1 0 0 0 0 0 0 0 0 0 0
134 212588 1 0 1 0 0 0 0 0 0 0 0 0
135 205816 1 0 0 1 0 0 0 0 0 0 0 0
136 202196 1 0 0 0 1 0 0 0 0 0 0 0
137 195722 1 0 0 0 0 1 0 0 0 0 0 0
138 198563 1 0 0 0 0 0 1 0 0 0 0 0
139 229139 1 0 0 0 0 0 0 1 0 0 0 0
140 229527 1 0 0 0 0 0 0 0 1 0 0 0
141 211868 1 0 0 0 0 0 0 0 0 1 0 0
142 203555 1 0 0 0 0 0 0 0 0 0 1 0
143 195770 1 0 0 0 0 0 0 0 0 0 0 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy_crisis M1 M2 M3
196266.1 1193.2 612.4 -3315.3 -7478.5
M4 M5 M6 M7 M8
-11143.2 -15836.8 -13665.4 18777.4 27536.6
M9 M10 M11
11646.5 3159.1 -4368.5
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-37927 -18640 1212 18439 45035
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 196266.1 7316.4 26.826 < 2e-16 ***
Dummy_crisis 1193.2 5032.5 0.237 0.81295
M1 612.4 10049.8 0.061 0.95150
M2 -3315.3 10049.8 -0.330 0.74202
M3 -7478.5 10049.8 -0.744 0.45813
M4 -11143.2 10049.8 -1.109 0.26957
M5 -15836.8 10049.8 -1.576 0.11749
M6 -13665.4 10049.8 -1.360 0.17626
M7 18777.4 10055.4 1.867 0.06410 .
M8 27536.6 10055.4 2.738 0.00704 **
M9 11646.5 10055.4 1.158 0.24889
M10 3159.1 10055.4 0.314 0.75389
M11 -4368.5 10055.4 -0.434 0.66468
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 24080 on 130 degrees of freedom
Multiple R-squared: 0.2337, Adjusted R-squared: 0.163
F-statistic: 3.304 on 12 and 130 DF, p-value: 0.0003366
> 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.4491018314 0.8982036627 0.5508981686
[2,] 0.3670594815 0.7341189630 0.6329405185
[3,] 0.2974045254 0.5948090508 0.7025954746
[4,] 0.2379112265 0.4758224531 0.7620887735
[5,] 0.1899872823 0.3799745647 0.8100127177
[6,] 0.1547806956 0.3095613912 0.8452193044
[7,] 0.1219544972 0.2439089943 0.8780455028
[8,] 0.0958274037 0.1916548074 0.9041725963
[9,] 0.0824817060 0.1649634121 0.9175182940
[10,] 0.1038535911 0.2077071822 0.8961464089
[11,] 0.1147015223 0.2294030447 0.8852984777
[12,] 0.1185413819 0.2370827638 0.8814586181
[13,] 0.1099656084 0.2199312167 0.8900343916
[14,] 0.0978008676 0.1956017352 0.9021991324
[15,] 0.0845902332 0.1691804664 0.9154097668
[16,] 0.0756993229 0.1513986458 0.9243006771
[17,] 0.0684198585 0.1368397170 0.9315801415
[18,] 0.0501209343 0.1002418685 0.9498790657
[19,] 0.0373130019 0.0746260037 0.9626869981
[20,] 0.0276651154 0.0553302309 0.9723348846
[21,] 0.0209217276 0.0418434552 0.9790782724
[22,] 0.0145278225 0.0290556450 0.9854721775
[23,] 0.0099574539 0.0199149078 0.9900425461
[24,] 0.0067595230 0.0135190459 0.9932404770
[25,] 0.0046212067 0.0092424134 0.9953787933
[26,] 0.0031259989 0.0062519978 0.9968740011
[27,] 0.0022401710 0.0044803421 0.9977598290
[28,] 0.0020858951 0.0041717902 0.9979141049
[29,] 0.0014813098 0.0029626197 0.9985186902
[30,] 0.0011653266 0.0023306532 0.9988346734
[31,] 0.0009959819 0.0019919638 0.9990040181
[32,] 0.0010818151 0.0021636301 0.9989181849
[33,] 0.0011205431 0.0022410861 0.9988794569
[34,] 0.0009077481 0.0018154962 0.9990922519
[35,] 0.0007603552 0.0015207105 0.9992396448
[36,] 0.0006518320 0.0013036640 0.9993481680
[37,] 0.0006643483 0.0013286965 0.9993356517
[38,] 0.0006849307 0.0013698615 0.9993150693
[39,] 0.0009763533 0.0019527066 0.9990236467
[40,] 0.0022927316 0.0045854633 0.9977072684
[41,] 0.0037047329 0.0074094658 0.9962952671
[42,] 0.0056777140 0.0113554280 0.9943222860
[43,] 0.0079065625 0.0158131250 0.9920934375
[44,] 0.0096698626 0.0193397252 0.9903301374
[45,] 0.0121064685 0.0242129371 0.9878935315
[46,] 0.0134337229 0.0268674459 0.9865662771
[47,] 0.0157992408 0.0315984816 0.9842007592
[48,] 0.0182691826 0.0365383653 0.9817308174
[49,] 0.0199363721 0.0398727442 0.9800636279
[50,] 0.0217254417 0.0434508833 0.9782745583
[51,] 0.0252866972 0.0505733944 0.9747133028
[52,] 0.0328124028 0.0656248056 0.9671875972
[53,] 0.0510993044 0.1021986088 0.9489006956
[54,] 0.0731598414 0.1463196828 0.9268401586
[55,] 0.1338752464 0.2677504927 0.8661247536
[56,] 0.1986866003 0.3973732006 0.8013133997
[57,] 0.2728270441 0.5456540882 0.7271729559
[58,] 0.3330350871 0.6660701743 0.6669649129
[59,] 0.3907224934 0.7814449868 0.6092775066
[60,] 0.4554361006 0.9108722012 0.5445638994
[61,] 0.5086252557 0.9827494887 0.4913747443
[62,] 0.5613598629 0.8772802742 0.4386401371
[63,] 0.6122439952 0.7755120097 0.3877560048
[64,] 0.6854848253 0.6290303493 0.3145151747
[65,] 0.7669652512 0.4660694975 0.2330347488
[66,] 0.8321650115 0.3356699771 0.1678349885
[67,] 0.8941039990 0.2117920019 0.1058960010
[68,] 0.9294809993 0.1410380014 0.0705190007
[69,] 0.9524959561 0.0950080878 0.0475040439
[70,] 0.9550972747 0.0898054506 0.0449027253
[71,] 0.9622272974 0.0755454051 0.0377727026
[72,] 0.9662880739 0.0674238521 0.0337119261
[73,] 0.9758658366 0.0482683267 0.0241341634
[74,] 0.9850394028 0.0299211943 0.0149605972
[75,] 0.9899361681 0.0201276639 0.0100638319
[76,] 0.9939418325 0.0121163349 0.0060581675
[77,] 0.9965839425 0.0068321149 0.0034160575
[78,] 0.9990103158 0.0019793684 0.0009896842
[79,] 0.9994355914 0.0011288171 0.0005644086
[80,] 0.9996086325 0.0007827350 0.0003913675
[81,] 0.9995337950 0.0009324100 0.0004662050
[82,] 0.9994568833 0.0010862335 0.0005431167
[83,] 0.9992193678 0.0015612644 0.0007806322
[84,] 0.9987760548 0.0024478905 0.0012239452
[85,] 0.9980542547 0.0038914905 0.0019457453
[86,] 0.9969959873 0.0060080254 0.0030040127
[87,] 0.9952270689 0.0095458622 0.0047729311
[88,] 0.9939786892 0.0120426215 0.0060213108
[89,] 0.9929308177 0.0141383646 0.0070691823
[90,] 0.9911103695 0.0177792611 0.0088896305
[91,] 0.9886521294 0.0226957412 0.0113478706
[92,] 0.9850551869 0.0298896261 0.0149448131
[93,] 0.9789371223 0.0421257553 0.0210628777
[94,] 0.9705086584 0.0589826832 0.0294913416
[95,] 0.9583985172 0.0832029656 0.0416014828
[96,] 0.9415128064 0.1169743871 0.0584871936
[97,] 0.9188498170 0.1623003660 0.0811501830
[98,] 0.8905184583 0.2189630834 0.1094815417
[99,] 0.8520546603 0.2958906794 0.1479453397
[100,] 0.8904753420 0.2190493159 0.1095246580
[101,] 0.9322516994 0.1354966013 0.0677483006
[102,] 0.9610227409 0.0779545182 0.0389772591
[103,] 0.9791263314 0.0417473372 0.0208736686
[104,] 0.9900194668 0.0199610663 0.0099805332
[105,] 0.9985892993 0.0028214013 0.0014107007
[106,] 0.9995246431 0.0009507139 0.0004753569
[107,] 0.9998584149 0.0002831702 0.0001415851
[108,] 0.9998496547 0.0003006906 0.0001503453
[109,] 0.9998616615 0.0002766771 0.0001383385
[110,] 0.9997722100 0.0004555799 0.0002277900
[111,] 0.9986608999 0.0026782002 0.0013391001
[112,] 0.9941566228 0.0116867544 0.0058433772
> postscript(file="/var/www/html/rcomp/tmp/17crb1293090861.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/27crb1293090861.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/3i3qe1293090861.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/4i3qe1293090861.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/5i3qe1293090861.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 = 143
Frequency = 1
1 2 3 4 5 6
9131.5333 5161.1999 5731.4499 582.1166 -256.2167 -6458.6334
7 8 9 10 11 12
-11642.4501 -1900.6168 -10534.5334 -14424.2001 -15541.5334 -15817.0546
13 14 15 16 17 18
-16734.4667 -19284.8001 -23099.5501 -23552.8834 -24284.2167 -28870.6334
19 20 21 22 23 24
-32345.4501 -23037.6168 -31400.5334 -32807.2001 -33253.5334 -36681.0546
25 26 27 28 29 30
-33783.4667 -33906.8001 -33276.5501 -31377.8834 -29860.2167 -31995.6334
31 32 33 34 35 36
-35431.4501 -29112.6168 -17995.5334 -15297.2001 -16562.5334 -16700.0546
37 38 39 40 41 42
-15738.4667 -15074.8001 -13746.5501 -15830.8834 -14359.2167 -15628.6334
43 44 45 46 47 48
-8695.4501 -8096.6168 -5804.5334 -4014.2001 1213.4666 -1068.0546
49 50 51 52 53 54
1891.5333 1212.1999 1632.4499 4610.1166 5599.7833 8930.3666
55 56 57 58 59 60
17527.5499 19674.3832 19334.4666 18433.7999 16781.4666 16921.9454
61 62 63 64 65 66
19355.5333 20635.1999 20677.4499 18922.1166 19807.7833 21065.3666
67 68 69 70 71 72
26432.5499 36504.3832 35411.4666 45034.7999 41677.4666 40950.9454
73 74 75 76 77 78
38364.5333 37403.1999 38396.4499 36555.1166 36712.7833 36851.3666
79 80 81 82 83 84
41402.5499 42042.3832 40711.4666 41688.7999 37347.4666 35538.9454
85 86 87 88 89 90
22398.5333 26362.1999 23822.4499 29648.1166 30712.7833 28856.3666
91 92 93 94 95 96
25004.5499 16833.3832 22667.4666 9369.7999 6024.4666 -1670.0546
97 98 99 100 101 102
-2297.4667 -7264.8001 -10681.5501 -12514.8834 -13127.2167 -14547.6334
103 104 105 106 107 108
-12743.4501 -21414.6168 -25396.5334 -25949.2001 -25453.5334 -24969.0546
109 110 111 112 113 114
-27177.4667 -28768.8001 -26873.5501 -25510.8834 -29428.2167 -24486.6334
115 116 117 118 119 120
-29706.6497 -37926.8164 -34775.7330 -31256.3997 -26263.7330 -19422.2542
121 122 123 124 125 126
-11658.6663 -4917.9997 1582.2503 2589.9170 4382.5837 11515.1670
127 128 129 130 131 132
7295.3503 1903.1836 5020.2670 6284.6003 11351.2670 22915.7458
133 134 135 136 137 138
16248.3337 18444.0003 15835.2503 15879.9170 14099.5837 14769.1670
139 140 141 142 143
12902.3503 4531.1836 2762.2670 2936.6003 2679.2670
> postscript(file="/var/www/html/rcomp/tmp/6i3qe1293090861.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 = 143
Frequency = 1
lag(myerror, k = 1) myerror
0 9131.5333 NA
1 5161.1999 9131.5333
2 5731.4499 5161.1999
3 582.1166 5731.4499
4 -256.2167 582.1166
5 -6458.6334 -256.2167
6 -11642.4501 -6458.6334
7 -1900.6168 -11642.4501
8 -10534.5334 -1900.6168
9 -14424.2001 -10534.5334
10 -15541.5334 -14424.2001
11 -15817.0546 -15541.5334
12 -16734.4667 -15817.0546
13 -19284.8001 -16734.4667
14 -23099.5501 -19284.8001
15 -23552.8834 -23099.5501
16 -24284.2167 -23552.8834
17 -28870.6334 -24284.2167
18 -32345.4501 -28870.6334
19 -23037.6168 -32345.4501
20 -31400.5334 -23037.6168
21 -32807.2001 -31400.5334
22 -33253.5334 -32807.2001
23 -36681.0546 -33253.5334
24 -33783.4667 -36681.0546
25 -33906.8001 -33783.4667
26 -33276.5501 -33906.8001
27 -31377.8834 -33276.5501
28 -29860.2167 -31377.8834
29 -31995.6334 -29860.2167
30 -35431.4501 -31995.6334
31 -29112.6168 -35431.4501
32 -17995.5334 -29112.6168
33 -15297.2001 -17995.5334
34 -16562.5334 -15297.2001
35 -16700.0546 -16562.5334
36 -15738.4667 -16700.0546
37 -15074.8001 -15738.4667
38 -13746.5501 -15074.8001
39 -15830.8834 -13746.5501
40 -14359.2167 -15830.8834
41 -15628.6334 -14359.2167
42 -8695.4501 -15628.6334
43 -8096.6168 -8695.4501
44 -5804.5334 -8096.6168
45 -4014.2001 -5804.5334
46 1213.4666 -4014.2001
47 -1068.0546 1213.4666
48 1891.5333 -1068.0546
49 1212.1999 1891.5333
50 1632.4499 1212.1999
51 4610.1166 1632.4499
52 5599.7833 4610.1166
53 8930.3666 5599.7833
54 17527.5499 8930.3666
55 19674.3832 17527.5499
56 19334.4666 19674.3832
57 18433.7999 19334.4666
58 16781.4666 18433.7999
59 16921.9454 16781.4666
60 19355.5333 16921.9454
61 20635.1999 19355.5333
62 20677.4499 20635.1999
63 18922.1166 20677.4499
64 19807.7833 18922.1166
65 21065.3666 19807.7833
66 26432.5499 21065.3666
67 36504.3832 26432.5499
68 35411.4666 36504.3832
69 45034.7999 35411.4666
70 41677.4666 45034.7999
71 40950.9454 41677.4666
72 38364.5333 40950.9454
73 37403.1999 38364.5333
74 38396.4499 37403.1999
75 36555.1166 38396.4499
76 36712.7833 36555.1166
77 36851.3666 36712.7833
78 41402.5499 36851.3666
79 42042.3832 41402.5499
80 40711.4666 42042.3832
81 41688.7999 40711.4666
82 37347.4666 41688.7999
83 35538.9454 37347.4666
84 22398.5333 35538.9454
85 26362.1999 22398.5333
86 23822.4499 26362.1999
87 29648.1166 23822.4499
88 30712.7833 29648.1166
89 28856.3666 30712.7833
90 25004.5499 28856.3666
91 16833.3832 25004.5499
92 22667.4666 16833.3832
93 9369.7999 22667.4666
94 6024.4666 9369.7999
95 -1670.0546 6024.4666
96 -2297.4667 -1670.0546
97 -7264.8001 -2297.4667
98 -10681.5501 -7264.8001
99 -12514.8834 -10681.5501
100 -13127.2167 -12514.8834
101 -14547.6334 -13127.2167
102 -12743.4501 -14547.6334
103 -21414.6168 -12743.4501
104 -25396.5334 -21414.6168
105 -25949.2001 -25396.5334
106 -25453.5334 -25949.2001
107 -24969.0546 -25453.5334
108 -27177.4667 -24969.0546
109 -28768.8001 -27177.4667
110 -26873.5501 -28768.8001
111 -25510.8834 -26873.5501
112 -29428.2167 -25510.8834
113 -24486.6334 -29428.2167
114 -29706.6497 -24486.6334
115 -37926.8164 -29706.6497
116 -34775.7330 -37926.8164
117 -31256.3997 -34775.7330
118 -26263.7330 -31256.3997
119 -19422.2542 -26263.7330
120 -11658.6663 -19422.2542
121 -4917.9997 -11658.6663
122 1582.2503 -4917.9997
123 2589.9170 1582.2503
124 4382.5837 2589.9170
125 11515.1670 4382.5837
126 7295.3503 11515.1670
127 1903.1836 7295.3503
128 5020.2670 1903.1836
129 6284.6003 5020.2670
130 11351.2670 6284.6003
131 22915.7458 11351.2670
132 16248.3337 22915.7458
133 18444.0003 16248.3337
134 15835.2503 18444.0003
135 15879.9170 15835.2503
136 14099.5837 15879.9170
137 14769.1670 14099.5837
138 12902.3503 14769.1670
139 4531.1836 12902.3503
140 2762.2670 4531.1836
141 2936.6003 2762.2670
142 2679.2670 2936.6003
143 NA 2679.2670
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 5161.1999 9131.5333
[2,] 5731.4499 5161.1999
[3,] 582.1166 5731.4499
[4,] -256.2167 582.1166
[5,] -6458.6334 -256.2167
[6,] -11642.4501 -6458.6334
[7,] -1900.6168 -11642.4501
[8,] -10534.5334 -1900.6168
[9,] -14424.2001 -10534.5334
[10,] -15541.5334 -14424.2001
[11,] -15817.0546 -15541.5334
[12,] -16734.4667 -15817.0546
[13,] -19284.8001 -16734.4667
[14,] -23099.5501 -19284.8001
[15,] -23552.8834 -23099.5501
[16,] -24284.2167 -23552.8834
[17,] -28870.6334 -24284.2167
[18,] -32345.4501 -28870.6334
[19,] -23037.6168 -32345.4501
[20,] -31400.5334 -23037.6168
[21,] -32807.2001 -31400.5334
[22,] -33253.5334 -32807.2001
[23,] -36681.0546 -33253.5334
[24,] -33783.4667 -36681.0546
[25,] -33906.8001 -33783.4667
[26,] -33276.5501 -33906.8001
[27,] -31377.8834 -33276.5501
[28,] -29860.2167 -31377.8834
[29,] -31995.6334 -29860.2167
[30,] -35431.4501 -31995.6334
[31,] -29112.6168 -35431.4501
[32,] -17995.5334 -29112.6168
[33,] -15297.2001 -17995.5334
[34,] -16562.5334 -15297.2001
[35,] -16700.0546 -16562.5334
[36,] -15738.4667 -16700.0546
[37,] -15074.8001 -15738.4667
[38,] -13746.5501 -15074.8001
[39,] -15830.8834 -13746.5501
[40,] -14359.2167 -15830.8834
[41,] -15628.6334 -14359.2167
[42,] -8695.4501 -15628.6334
[43,] -8096.6168 -8695.4501
[44,] -5804.5334 -8096.6168
[45,] -4014.2001 -5804.5334
[46,] 1213.4666 -4014.2001
[47,] -1068.0546 1213.4666
[48,] 1891.5333 -1068.0546
[49,] 1212.1999 1891.5333
[50,] 1632.4499 1212.1999
[51,] 4610.1166 1632.4499
[52,] 5599.7833 4610.1166
[53,] 8930.3666 5599.7833
[54,] 17527.5499 8930.3666
[55,] 19674.3832 17527.5499
[56,] 19334.4666 19674.3832
[57,] 18433.7999 19334.4666
[58,] 16781.4666 18433.7999
[59,] 16921.9454 16781.4666
[60,] 19355.5333 16921.9454
[61,] 20635.1999 19355.5333
[62,] 20677.4499 20635.1999
[63,] 18922.1166 20677.4499
[64,] 19807.7833 18922.1166
[65,] 21065.3666 19807.7833
[66,] 26432.5499 21065.3666
[67,] 36504.3832 26432.5499
[68,] 35411.4666 36504.3832
[69,] 45034.7999 35411.4666
[70,] 41677.4666 45034.7999
[71,] 40950.9454 41677.4666
[72,] 38364.5333 40950.9454
[73,] 37403.1999 38364.5333
[74,] 38396.4499 37403.1999
[75,] 36555.1166 38396.4499
[76,] 36712.7833 36555.1166
[77,] 36851.3666 36712.7833
[78,] 41402.5499 36851.3666
[79,] 42042.3832 41402.5499
[80,] 40711.4666 42042.3832
[81,] 41688.7999 40711.4666
[82,] 37347.4666 41688.7999
[83,] 35538.9454 37347.4666
[84,] 22398.5333 35538.9454
[85,] 26362.1999 22398.5333
[86,] 23822.4499 26362.1999
[87,] 29648.1166 23822.4499
[88,] 30712.7833 29648.1166
[89,] 28856.3666 30712.7833
[90,] 25004.5499 28856.3666
[91,] 16833.3832 25004.5499
[92,] 22667.4666 16833.3832
[93,] 9369.7999 22667.4666
[94,] 6024.4666 9369.7999
[95,] -1670.0546 6024.4666
[96,] -2297.4667 -1670.0546
[97,] -7264.8001 -2297.4667
[98,] -10681.5501 -7264.8001
[99,] -12514.8834 -10681.5501
[100,] -13127.2167 -12514.8834
[101,] -14547.6334 -13127.2167
[102,] -12743.4501 -14547.6334
[103,] -21414.6168 -12743.4501
[104,] -25396.5334 -21414.6168
[105,] -25949.2001 -25396.5334
[106,] -25453.5334 -25949.2001
[107,] -24969.0546 -25453.5334
[108,] -27177.4667 -24969.0546
[109,] -28768.8001 -27177.4667
[110,] -26873.5501 -28768.8001
[111,] -25510.8834 -26873.5501
[112,] -29428.2167 -25510.8834
[113,] -24486.6334 -29428.2167
[114,] -29706.6497 -24486.6334
[115,] -37926.8164 -29706.6497
[116,] -34775.7330 -37926.8164
[117,] -31256.3997 -34775.7330
[118,] -26263.7330 -31256.3997
[119,] -19422.2542 -26263.7330
[120,] -11658.6663 -19422.2542
[121,] -4917.9997 -11658.6663
[122,] 1582.2503 -4917.9997
[123,] 2589.9170 1582.2503
[124,] 4382.5837 2589.9170
[125,] 11515.1670 4382.5837
[126,] 7295.3503 11515.1670
[127,] 1903.1836 7295.3503
[128,] 5020.2670 1903.1836
[129,] 6284.6003 5020.2670
[130,] 11351.2670 6284.6003
[131,] 22915.7458 11351.2670
[132,] 16248.3337 22915.7458
[133,] 18444.0003 16248.3337
[134,] 15835.2503 18444.0003
[135,] 15879.9170 15835.2503
[136,] 14099.5837 15879.9170
[137,] 14769.1670 14099.5837
[138,] 12902.3503 14769.1670
[139,] 4531.1836 12902.3503
[140,] 2762.2670 4531.1836
[141,] 2936.6003 2762.2670
[142,] 2679.2670 2936.6003
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 5161.1999 9131.5333
2 5731.4499 5161.1999
3 582.1166 5731.4499
4 -256.2167 582.1166
5 -6458.6334 -256.2167
6 -11642.4501 -6458.6334
7 -1900.6168 -11642.4501
8 -10534.5334 -1900.6168
9 -14424.2001 -10534.5334
10 -15541.5334 -14424.2001
11 -15817.0546 -15541.5334
12 -16734.4667 -15817.0546
13 -19284.8001 -16734.4667
14 -23099.5501 -19284.8001
15 -23552.8834 -23099.5501
16 -24284.2167 -23552.8834
17 -28870.6334 -24284.2167
18 -32345.4501 -28870.6334
19 -23037.6168 -32345.4501
20 -31400.5334 -23037.6168
21 -32807.2001 -31400.5334
22 -33253.5334 -32807.2001
23 -36681.0546 -33253.5334
24 -33783.4667 -36681.0546
25 -33906.8001 -33783.4667
26 -33276.5501 -33906.8001
27 -31377.8834 -33276.5501
28 -29860.2167 -31377.8834
29 -31995.6334 -29860.2167
30 -35431.4501 -31995.6334
31 -29112.6168 -35431.4501
32 -17995.5334 -29112.6168
33 -15297.2001 -17995.5334
34 -16562.5334 -15297.2001
35 -16700.0546 -16562.5334
36 -15738.4667 -16700.0546
37 -15074.8001 -15738.4667
38 -13746.5501 -15074.8001
39 -15830.8834 -13746.5501
40 -14359.2167 -15830.8834
41 -15628.6334 -14359.2167
42 -8695.4501 -15628.6334
43 -8096.6168 -8695.4501
44 -5804.5334 -8096.6168
45 -4014.2001 -5804.5334
46 1213.4666 -4014.2001
47 -1068.0546 1213.4666
48 1891.5333 -1068.0546
49 1212.1999 1891.5333
50 1632.4499 1212.1999
51 4610.1166 1632.4499
52 5599.7833 4610.1166
53 8930.3666 5599.7833
54 17527.5499 8930.3666
55 19674.3832 17527.5499
56 19334.4666 19674.3832
57 18433.7999 19334.4666
58 16781.4666 18433.7999
59 16921.9454 16781.4666
60 19355.5333 16921.9454
61 20635.1999 19355.5333
62 20677.4499 20635.1999
63 18922.1166 20677.4499
64 19807.7833 18922.1166
65 21065.3666 19807.7833
66 26432.5499 21065.3666
67 36504.3832 26432.5499
68 35411.4666 36504.3832
69 45034.7999 35411.4666
70 41677.4666 45034.7999
71 40950.9454 41677.4666
72 38364.5333 40950.9454
73 37403.1999 38364.5333
74 38396.4499 37403.1999
75 36555.1166 38396.4499
76 36712.7833 36555.1166
77 36851.3666 36712.7833
78 41402.5499 36851.3666
79 42042.3832 41402.5499
80 40711.4666 42042.3832
81 41688.7999 40711.4666
82 37347.4666 41688.7999
83 35538.9454 37347.4666
84 22398.5333 35538.9454
85 26362.1999 22398.5333
86 23822.4499 26362.1999
87 29648.1166 23822.4499
88 30712.7833 29648.1166
89 28856.3666 30712.7833
90 25004.5499 28856.3666
91 16833.3832 25004.5499
92 22667.4666 16833.3832
93 9369.7999 22667.4666
94 6024.4666 9369.7999
95 -1670.0546 6024.4666
96 -2297.4667 -1670.0546
97 -7264.8001 -2297.4667
98 -10681.5501 -7264.8001
99 -12514.8834 -10681.5501
100 -13127.2167 -12514.8834
101 -14547.6334 -13127.2167
102 -12743.4501 -14547.6334
103 -21414.6168 -12743.4501
104 -25396.5334 -21414.6168
105 -25949.2001 -25396.5334
106 -25453.5334 -25949.2001
107 -24969.0546 -25453.5334
108 -27177.4667 -24969.0546
109 -28768.8001 -27177.4667
110 -26873.5501 -28768.8001
111 -25510.8834 -26873.5501
112 -29428.2167 -25510.8834
113 -24486.6334 -29428.2167
114 -29706.6497 -24486.6334
115 -37926.8164 -29706.6497
116 -34775.7330 -37926.8164
117 -31256.3997 -34775.7330
118 -26263.7330 -31256.3997
119 -19422.2542 -26263.7330
120 -11658.6663 -19422.2542
121 -4917.9997 -11658.6663
122 1582.2503 -4917.9997
123 2589.9170 1582.2503
124 4382.5837 2589.9170
125 11515.1670 4382.5837
126 7295.3503 11515.1670
127 1903.1836 7295.3503
128 5020.2670 1903.1836
129 6284.6003 5020.2670
130 11351.2670 6284.6003
131 22915.7458 11351.2670
132 16248.3337 22915.7458
133 18444.0003 16248.3337
134 15835.2503 18444.0003
135 15879.9170 15835.2503
136 14099.5837 15879.9170
137 14769.1670 14099.5837
138 12902.3503 14769.1670
139 4531.1836 12902.3503
140 2762.2670 4531.1836
141 2936.6003 2762.2670
142 2679.2670 2936.6003
> 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/7ad8z1293090861.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/8l4721293090861.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/9l4721293090861.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/10wvo51293090861.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/11zwnt1293090861.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/12a5me1293090861.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/13ho1q1293090861.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/14sxjb1293090861.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/15vyhy1293090861.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/169px71293090861.tab")
+ }
>
> try(system("convert tmp/17crb1293090861.ps tmp/17crb1293090861.png",intern=TRUE))
character(0)
> try(system("convert tmp/27crb1293090861.ps tmp/27crb1293090861.png",intern=TRUE))
character(0)
> try(system("convert tmp/3i3qe1293090861.ps tmp/3i3qe1293090861.png",intern=TRUE))
character(0)
> try(system("convert tmp/4i3qe1293090861.ps tmp/4i3qe1293090861.png",intern=TRUE))
character(0)
> try(system("convert tmp/5i3qe1293090861.ps tmp/5i3qe1293090861.png",intern=TRUE))
character(0)
> try(system("convert tmp/6i3qe1293090861.ps tmp/6i3qe1293090861.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ad8z1293090861.ps tmp/7ad8z1293090861.png",intern=TRUE))
character(0)
> try(system("convert tmp/8l4721293090861.ps tmp/8l4721293090861.png",intern=TRUE))
character(0)
> try(system("convert tmp/9l4721293090861.ps tmp/9l4721293090861.png",intern=TRUE))
character(0)
> try(system("convert tmp/10wvo51293090861.ps tmp/10wvo51293090861.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.736 1.714 8.901