R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(46
+ ,26
+ ,95556
+ ,47.38555556
+ ,48
+ ,20
+ ,54565
+ ,24.06138889
+ ,37
+ ,24
+ ,63016
+ ,31.4825
+ ,75
+ ,25
+ ,79774
+ ,42.36388889
+ ,31
+ ,15
+ ,31258
+ ,23.94611111
+ ,18
+ ,16
+ ,52491
+ ,10.34916667
+ ,79
+ ,20
+ ,91256
+ ,85.01527778
+ ,16
+ ,18
+ ,22807
+ ,9.097222222
+ ,38
+ ,19
+ ,77411
+ ,32.36166667
+ ,24
+ ,20
+ ,48821
+ ,36.26083333
+ ,65
+ ,30
+ ,52295
+ ,44.96555556
+ ,74
+ ,37
+ ,63262
+ ,35.63166667
+ ,43
+ ,23
+ ,50466
+ ,28.43055556
+ ,42
+ ,36
+ ,62932
+ ,53.61777778
+ ,55
+ ,29
+ ,38439
+ ,39.32611111
+ ,121
+ ,35
+ ,70817
+ ,70.43305556
+ ,42
+ ,24
+ ,105965
+ ,50.30833333
+ ,102
+ ,22
+ ,73795
+ ,55.12
+ ,36
+ ,19
+ ,82043
+ ,31.62583333
+ ,50
+ ,30
+ ,74349
+ ,44.42777778
+ ,48
+ ,27
+ ,82204
+ ,46.33944444
+ ,56
+ ,26
+ ,55709
+ ,79.63194444
+ ,19
+ ,15
+ ,37137
+ ,25.46027778
+ ,32
+ ,30
+ ,70780
+ ,30.07722222
+ ,77
+ ,28
+ ,55027
+ ,40.65055556
+ ,90
+ ,24
+ ,56699
+ ,40.31722222
+ ,81
+ ,21
+ ,65911
+ ,44.92777778
+ ,55
+ ,27
+ ,56316
+ ,44.69583333
+ ,34
+ ,21
+ ,26982
+ ,29.69111111
+ ,38
+ ,30
+ ,54628
+ ,52.26388889
+ ,53
+ ,30
+ ,96750
+ ,52.61138889
+ ,48
+ ,33
+ ,53009
+ ,35.96777778
+ ,63
+ ,30
+ ,64664
+ ,56.675
+ ,25
+ ,20
+ ,36990
+ ,17.42527778
+ ,56
+ ,27
+ ,85224
+ ,67.67361111
+ ,37
+ ,25
+ ,37048
+ ,46.45972222
+ ,83
+ ,30
+ ,59635
+ ,73.48
+ ,50
+ ,20
+ ,42051
+ ,33.89555556
+ ,26
+ ,8
+ ,26998
+ ,22.49
+ ,108
+ ,24
+ ,63717
+ ,58.27638889
+ ,55
+ ,25
+ ,55071
+ ,62.27916667
+ ,41
+ ,25
+ ,40001
+ ,32.21416667
+ ,49
+ ,21
+ ,54506
+ ,38.38638889
+ ,31
+ ,21
+ ,35838
+ ,22.52944444
+ ,49
+ ,21
+ ,50838
+ ,25.86805556
+ ,96
+ ,26
+ ,86997
+ ,84.93222222
+ ,42
+ ,26
+ ,33032
+ ,21.88888889
+ ,55
+ ,30
+ ,61704
+ ,44.12083333
+ ,70
+ ,34
+ ,117986
+ ,61.59583333
+ ,39
+ ,30
+ ,56733
+ ,36.41888889
+ ,53
+ ,18
+ ,55064
+ ,35.75944444
+ ,24
+ ,4
+ ,5950
+ ,6.718888889
+ ,209
+ ,31
+ ,84607
+ ,71.57277778
+ ,17
+ ,18
+ ,32551
+ ,18.06361111
+ ,58
+ ,14
+ ,31701
+ ,27.24055556
+ ,27
+ ,20
+ ,71170
+ ,48.21861111
+ ,58
+ ,36
+ ,101773
+ ,50.01166667
+ ,114
+ ,24
+ ,101653
+ ,54.79611111
+ ,75
+ ,26
+ ,81493
+ ,58.90555556
+ ,51
+ ,22
+ ,55901
+ ,39.32833333
+ ,86
+ ,31
+ ,109104
+ ,68.08527778
+ ,77
+ ,21
+ ,114425
+ ,57.46638889
+ ,62
+ ,31
+ ,36311
+ ,40.47111111
+ ,60
+ ,26
+ ,70027
+ ,47.39861111
+ ,39
+ ,24
+ ,73713
+ ,39.46222222
+ ,35
+ ,15
+ ,40671
+ ,31.89444444
+ ,86
+ ,19
+ ,89041
+ ,31.51694444
+ ,102
+ ,28
+ ,57231
+ ,40.35694444
+ ,49
+ ,24
+ ,68608
+ ,41.94416667
+ ,35
+ ,18
+ ,59155
+ ,25.50333333
+ ,33
+ ,25
+ ,55827
+ ,33.00194444
+ ,28
+ ,20
+ ,22618
+ ,19.2975
+ ,44
+ ,25
+ ,58425
+ ,35.175
+ ,37
+ ,24
+ ,65724
+ ,40.53
+ ,33
+ ,23
+ ,56979
+ ,27.33138889
+ ,45
+ ,25
+ ,72369
+ ,53.035
+ ,57
+ ,20
+ ,79194
+ ,55.22138889
+ ,58
+ ,23
+ ,202316
+ ,29.49805556
+ ,36
+ ,22
+ ,44970
+ ,24.81055556
+ ,42
+ ,25
+ ,49319
+ ,33.43388889
+ ,30
+ ,18
+ ,36252
+ ,27.44194444
+ ,67
+ ,30
+ ,75741
+ ,76.37583333
+ ,53
+ ,22
+ ,38417
+ ,36.88833333
+ ,59
+ ,25
+ ,64102
+ ,37.56972222
+ ,25
+ ,8
+ ,56622
+ ,22.48694444
+ ,39
+ ,21
+ ,15430
+ ,30.34361111
+ ,36
+ ,22
+ ,72571
+ ,26.84277778
+ ,114
+ ,24
+ ,67271
+ ,62.83083333
+ ,54
+ ,30
+ ,43460
+ ,47.57944444
+ ,70
+ ,27
+ ,99501
+ ,32.72638889
+ ,51
+ ,24
+ ,28340
+ ,37.10027778
+ ,49
+ ,25
+ ,76013
+ ,42.27583333
+ ,42
+ ,21
+ ,37361
+ ,31.11222222
+ ,51
+ ,24
+ ,48204
+ ,47.11472222
+ ,51
+ ,24
+ ,76168
+ ,52.07861111
+ ,27
+ ,20
+ ,85168
+ ,36.25916667
+ ,29
+ ,20
+ ,125410
+ ,39.53861111
+ ,54
+ ,24
+ ,123328
+ ,52.71222222
+ ,92
+ ,40
+ ,83038
+ ,56.00083333
+ ,72
+ ,22
+ ,120087
+ ,68.565
+ ,63
+ ,31
+ ,91939
+ ,43.31861111
+ ,41
+ ,26
+ ,103646
+ ,50.71694444
+ ,111
+ ,20
+ ,29467
+ ,29.54194444
+ ,14
+ ,19
+ ,43750
+ ,12.02416667
+ ,45
+ ,15
+ ,34497
+ ,35.41472222
+ ,91
+ ,21
+ ,66477
+ ,35.53611111
+ ,29
+ ,22
+ ,71181
+ ,41.39055556
+ ,64
+ ,24
+ ,74482
+ ,52.12583333
+ ,32
+ ,19
+ ,174949
+ ,20.58666667
+ ,65
+ ,24
+ ,46765
+ ,26.11277778
+ ,42
+ ,23
+ ,90257
+ ,49.0625
+ ,55
+ ,27
+ ,51370
+ ,39.42583333
+ ,10
+ ,1
+ ,1168
+ ,6.371666667
+ ,53
+ ,24
+ ,51360
+ ,34.97972222
+ ,25
+ ,11
+ ,25162
+ ,17.1825
+ ,33
+ ,27
+ ,21067
+ ,25.35833333
+ ,66
+ ,22
+ ,58233
+ ,70.86111111
+ ,16
+ ,0
+ ,855
+ ,5.848333333
+ ,35
+ ,17
+ ,85903
+ ,46.97027778
+ ,19
+ ,8
+ ,14116
+ ,8.726111111
+ ,76
+ ,24
+ ,57637
+ ,52.41694444
+ ,35
+ ,31
+ ,94137
+ ,38.20666667
+ ,46
+ ,24
+ ,62147
+ ,21.435
+ ,29
+ ,20
+ ,62832
+ ,20.71305556
+ ,34
+ ,8
+ ,8773
+ ,10.615
+ ,25
+ ,22
+ ,63785
+ ,25.26694444
+ ,48
+ ,33
+ ,65196
+ ,53.95111111
+ ,38
+ ,33
+ ,73087
+ ,37.5725
+ ,50
+ ,31
+ ,72631
+ ,67.85333333
+ ,65
+ ,33
+ ,86281
+ ,56.04111111
+ ,72
+ ,35
+ ,162365
+ ,71.22277778
+ ,23
+ ,21
+ ,56530
+ ,38.65111111
+ ,29
+ ,20
+ ,35606
+ ,21.24166667
+ ,194
+ ,24
+ ,70111
+ ,52.63944444
+ ,114
+ ,29
+ ,92046
+ ,77.87055556
+ ,15
+ ,20
+ ,63989
+ ,14.16638889
+ ,86
+ ,27
+ ,104911
+ ,70.35388889
+ ,50
+ ,24
+ ,43448
+ ,28.6775
+ ,33
+ ,26
+ ,60029
+ ,46.68305556
+ ,50
+ ,26
+ ,38650
+ ,35.76888889
+ ,72
+ ,12
+ ,47261
+ ,21.04055556
+ ,81
+ ,21
+ ,73586
+ ,69.23111111
+ ,54
+ ,24
+ ,83042
+ ,42.32388889
+ ,63
+ ,21
+ ,37238
+ ,48.12777778
+ ,69
+ ,30
+ ,63958
+ ,54.77694444
+ ,39
+ ,32
+ ,78956
+ ,18.75194444
+ ,49
+ ,24
+ ,99518
+ ,38.72472222
+ ,67
+ ,29
+ ,111436
+ ,51.49055556
+ ,0
+ ,0
+ ,0
+ ,0
+ ,10
+ ,0
+ ,6023
+ ,4.08)
+ ,dim=c(4
+ ,150)
+ ,dimnames=list(c('A'
+ ,'B'
+ ,'C'
+ ,'D')
+ ,1:150))
> y <- array(NA,dim=c(4,150),dimnames=list(c('A','B','C','D'),1:150))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '4'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '4'
> #'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, 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
D A B C
1 47.385556 46 26 95556
2 24.061389 48 20 54565
3 31.482500 37 24 63016
4 42.363889 75 25 79774
5 23.946111 31 15 31258
6 10.349167 18 16 52491
7 85.015278 79 20 91256
8 9.097222 16 18 22807
9 32.361667 38 19 77411
10 36.260833 24 20 48821
11 44.965556 65 30 52295
12 35.631667 74 37 63262
13 28.430556 43 23 50466
14 53.617778 42 36 62932
15 39.326111 55 29 38439
16 70.433056 121 35 70817
17 50.308333 42 24 105965
18 55.120000 102 22 73795
19 31.625833 36 19 82043
20 44.427778 50 30 74349
21 46.339444 48 27 82204
22 79.631944 56 26 55709
23 25.460278 19 15 37137
24 30.077222 32 30 70780
25 40.650556 77 28 55027
26 40.317222 90 24 56699
27 44.927778 81 21 65911
28 44.695833 55 27 56316
29 29.691111 34 21 26982
30 52.263889 38 30 54628
31 52.611389 53 30 96750
32 35.967778 48 33 53009
33 56.675000 63 30 64664
34 17.425278 25 20 36990
35 67.673611 56 27 85224
36 46.459722 37 25 37048
37 73.480000 83 30 59635
38 33.895556 50 20 42051
39 22.490000 26 8 26998
40 58.276389 108 24 63717
41 62.279167 55 25 55071
42 32.214167 41 25 40001
43 38.386389 49 21 54506
44 22.529444 31 21 35838
45 25.868056 49 21 50838
46 84.932222 96 26 86997
47 21.888889 42 26 33032
48 44.120833 55 30 61704
49 61.595833 70 34 117986
50 36.418889 39 30 56733
51 35.759444 53 18 55064
52 6.718889 24 4 5950
53 71.572778 209 31 84607
54 18.063611 17 18 32551
55 27.240556 58 14 31701
56 48.218611 27 20 71170
57 50.011667 58 36 101773
58 54.796111 114 24 101653
59 58.905556 75 26 81493
60 39.328333 51 22 55901
61 68.085278 86 31 109104
62 57.466389 77 21 114425
63 40.471111 62 31 36311
64 47.398611 60 26 70027
65 39.462222 39 24 73713
66 31.894444 35 15 40671
67 31.516944 86 19 89041
68 40.356944 102 28 57231
69 41.944167 49 24 68608
70 25.503333 35 18 59155
71 33.001944 33 25 55827
72 19.297500 28 20 22618
73 35.175000 44 25 58425
74 40.530000 37 24 65724
75 27.331389 33 23 56979
76 53.035000 45 25 72369
77 55.221389 57 20 79194
78 29.498056 58 23 202316
79 24.810556 36 22 44970
80 33.433889 42 25 49319
81 27.441944 30 18 36252
82 76.375833 67 30 75741
83 36.888333 53 22 38417
84 37.569722 59 25 64102
85 22.486944 25 8 56622
86 30.343611 39 21 15430
87 26.842778 36 22 72571
88 62.830833 114 24 67271
89 47.579444 54 30 43460
90 32.726389 70 27 99501
91 37.100278 51 24 28340
92 42.275833 49 25 76013
93 31.112222 42 21 37361
94 47.114722 51 24 48204
95 52.078611 51 24 76168
96 36.259167 27 20 85168
97 39.538611 29 20 125410
98 52.712222 54 24 123328
99 56.000833 92 40 83038
100 68.565000 72 22 120087
101 43.318611 63 31 91939
102 50.716944 41 26 103646
103 29.541944 111 20 29467
104 12.024167 14 19 43750
105 35.414722 45 15 34497
106 35.536111 91 21 66477
107 41.390556 29 22 71181
108 52.125833 64 24 74482
109 20.586667 32 19 174949
110 26.112778 65 24 46765
111 49.062500 42 23 90257
112 39.425833 55 27 51370
113 6.371667 10 1 1168
114 34.979722 53 24 51360
115 17.182500 25 11 25162
116 25.358333 33 27 21067
117 70.861111 66 22 58233
118 5.848333 16 0 855
119 46.970278 35 17 85903
120 8.726111 19 8 14116
121 52.416944 76 24 57637
122 38.206667 35 31 94137
123 21.435000 46 24 62147
124 20.713056 29 20 62832
125 10.615000 34 8 8773
126 25.266944 25 22 63785
127 53.951111 48 33 65196
128 37.572500 38 33 73087
129 67.853333 50 31 72631
130 56.041111 65 33 86281
131 71.222778 72 35 162365
132 38.651111 23 21 56530
133 21.241667 29 20 35606
134 52.639444 194 24 70111
135 77.870556 114 29 92046
136 14.166389 15 20 63989
137 70.353889 86 27 104911
138 28.677500 50 24 43448
139 46.683056 33 26 60029
140 35.768889 50 26 38650
141 21.040556 72 12 47261
142 69.231111 81 21 73586
143 42.323889 54 24 83042
144 48.127778 63 21 37238
145 54.776944 69 30 63958
146 18.751944 39 32 78956
147 38.724722 49 24 99518
148 51.490556 67 29 111436
149 0.000000 0 0 0
150 4.080000 10 0 6023
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) A B C
-0.4340164 0.2442380 0.8211177 0.0001339
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-30.201 -6.879 0.053 6.298 37.583
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -4.340e-01 3.289e+00 -0.132 0.895198
A 2.442e-01 3.597e-02 6.791 2.62e-10 ***
B 8.211e-01 1.601e-01 5.129 9.12e-07 ***
C 1.339e-04 3.493e-05 3.833 0.000188 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 11.52 on 146 degrees of freedom
Multiple R-squared: 0.5826, Adjusted R-squared: 0.574
F-statistic: 67.92 on 3 and 146 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.76532023 0.469359547 0.234679774
[2,] 0.74518219 0.509635621 0.254817810
[3,] 0.67717051 0.645658990 0.322829495
[4,] 0.79576744 0.408465114 0.204232557
[5,] 0.73281470 0.534370608 0.267185304
[6,] 0.68710128 0.625797441 0.312898720
[7,] 0.59549618 0.809007649 0.404503825
[8,] 0.80357531 0.392849379 0.196424690
[9,] 0.75833292 0.483334164 0.241667082
[10,] 0.68811731 0.623765380 0.311882690
[11,] 0.61401834 0.771963316 0.385981658
[12,] 0.56005852 0.879882965 0.439941483
[13,] 0.50979594 0.980408117 0.490204058
[14,] 0.43262114 0.865242286 0.567378857
[15,] 0.35966894 0.719337880 0.640331060
[16,] 0.92235275 0.155294494 0.077647247
[17,] 0.90291233 0.194175334 0.097087667
[18,] 0.88642984 0.227140323 0.113570162
[19,] 0.86965704 0.260685911 0.130342956
[20,] 0.86456043 0.270879138 0.135439569
[21,] 0.83188387 0.336232258 0.168116129
[22,] 0.79467853 0.410642942 0.205321471
[23,] 0.76002515 0.479949696 0.239974848
[24,] 0.78328321 0.433433582 0.216716791
[25,] 0.73707465 0.525850704 0.262925352
[26,] 0.70289249 0.594215011 0.297107505
[27,] 0.68034979 0.639300415 0.319650207
[28,] 0.64699154 0.706016919 0.353008460
[29,] 0.71794870 0.564102594 0.282051297
[30,] 0.75142968 0.497140632 0.248570316
[31,] 0.82411373 0.351772547 0.175886274
[32,] 0.78606973 0.427860536 0.213930268
[33,] 0.75756900 0.484861999 0.242431000
[34,] 0.71751047 0.564979053 0.282489527
[35,] 0.80397338 0.392053243 0.196026622
[36,] 0.76645600 0.467088006 0.233544003
[37,] 0.72470827 0.550583465 0.275291733
[38,] 0.68930665 0.621386707 0.310693354
[39,] 0.68042322 0.639153567 0.319576784
[40,] 0.81303549 0.373929027 0.186964513
[41,] 0.81212411 0.375751788 0.187875894
[42,] 0.77676439 0.446471226 0.223235613
[43,] 0.74991244 0.500175114 0.250087557
[44,] 0.71243289 0.575134224 0.287567112
[45,] 0.66982194 0.660356128 0.330178064
[46,] 0.62445206 0.751095881 0.375547940
[47,] 0.74331157 0.513376867 0.256688433
[48,] 0.70722565 0.585548696 0.292774348
[49,] 0.66407614 0.671847720 0.335923860
[50,] 0.68182429 0.636351416 0.318175708
[51,] 0.67053526 0.658929480 0.329464740
[52,] 0.66297373 0.674052533 0.337026266
[53,] 0.63657902 0.726841965 0.363420983
[54,] 0.59067311 0.818653774 0.409326887
[55,] 0.55621752 0.887564961 0.443782480
[56,] 0.52525633 0.949487335 0.474743667
[57,] 0.48171468 0.963429354 0.518285323
[58,] 0.43538792 0.870775840 0.564612080
[59,] 0.39012191 0.780243813 0.609878094
[60,] 0.35572893 0.711457860 0.644271070
[61,] 0.43735717 0.874714337 0.562642832
[62,] 0.45705142 0.914102838 0.542948581
[63,] 0.41067660 0.821353199 0.589323401
[64,] 0.37894412 0.757888248 0.621055876
[65,] 0.33712644 0.674252885 0.662873557
[66,] 0.30508362 0.610167235 0.694916382
[67,] 0.26869165 0.537383293 0.731308353
[68,] 0.23291321 0.465826425 0.767086788
[69,] 0.21163606 0.423272122 0.788363939
[70,] 0.21112379 0.422247572 0.788876214
[71,] 0.22574859 0.451497181 0.774251410
[72,] 0.55392240 0.892155195 0.446077597
[73,] 0.52652581 0.946948371 0.473474186
[74,] 0.48307267 0.966145332 0.516927334
[75,] 0.43587739 0.871754790 0.564122605
[76,] 0.61828040 0.763439203 0.381719601
[77,] 0.57252723 0.854945543 0.427472772
[78,] 0.53487036 0.930259287 0.465129644
[79,] 0.48930234 0.978604689 0.510697656
[80,] 0.44311496 0.886229920 0.556885040
[81,] 0.42465014 0.849300280 0.575349860
[82,] 0.39567751 0.791355013 0.604322493
[83,] 0.35747609 0.714952179 0.642523911
[84,] 0.43512572 0.870251446 0.564874277
[85,] 0.38934047 0.778680940 0.610659530
[86,] 0.34334212 0.686684248 0.656657876
[87,] 0.29968015 0.599360306 0.700319847
[88,] 0.28430958 0.568619159 0.715690421
[89,] 0.27561561 0.551231220 0.724384390
[90,] 0.23733856 0.474677126 0.762661437
[91,] 0.20091128 0.401822564 0.799088718
[92,] 0.17084438 0.341688762 0.829155619
[93,] 0.15807722 0.316154444 0.841922778
[94,] 0.19908358 0.398167151 0.800916424
[95,] 0.18366536 0.367330711 0.816334644
[96,] 0.16125284 0.322505680 0.838747160
[97,] 0.19912835 0.398256703 0.800871649
[98,] 0.20083566 0.401671316 0.799164342
[99,] 0.18170192 0.363403845 0.818298077
[100,] 0.18272802 0.365456049 0.817271975
[101,] 0.16347180 0.326943610 0.836528195
[102,] 0.14494854 0.289897082 0.855051459
[103,] 0.30403471 0.608069421 0.695965289
[104,] 0.32419643 0.648392866 0.675803567
[105,] 0.29257387 0.585147739 0.707426131
[106,] 0.24802309 0.496046176 0.751976912
[107,] 0.20995217 0.419904338 0.790047831
[108,] 0.17496420 0.349928409 0.825035795
[109,] 0.14120521 0.282410413 0.858794794
[110,] 0.11726007 0.234520131 0.882739934
[111,] 0.32279191 0.645583830 0.677208085
[112,] 0.27674296 0.553485915 0.723257042
[113,] 0.28683125 0.573662495 0.713168753
[114,] 0.23969307 0.479386134 0.760306933
[115,] 0.21448195 0.428963892 0.785518054
[116,] 0.19029948 0.380598953 0.809700523
[117,] 0.23129972 0.462599449 0.768700276
[118,] 0.22104043 0.442080863 0.778959569
[119,] 0.17909468 0.358189355 0.820905322
[120,] 0.15431816 0.308636330 0.845681835
[121,] 0.12776552 0.255531045 0.872234478
[122,] 0.11184930 0.223698607 0.888150697
[123,] 0.18319065 0.366381295 0.816809352
[124,] 0.14149616 0.282992313 0.858503844
[125,] 0.10482158 0.209643167 0.895178417
[126,] 0.08909057 0.178181131 0.910909434
[127,] 0.06496065 0.129921300 0.935039350
[128,] 0.44770574 0.895411478 0.552294261
[129,] 0.37418732 0.748374633 0.625812683
[130,] 0.30626773 0.612535458 0.693732271
[131,] 0.27542475 0.550849491 0.724575254
[132,] 0.23669949 0.473398970 0.763300515
[133,] 0.31645575 0.632911505 0.683544248
[134,] 0.22300459 0.446009173 0.776995413
[135,] 0.99696942 0.006061159 0.003030579
[136,] 0.98843020 0.023139594 0.011569797
[137,] 0.95748511 0.085029777 0.042514888
> postscript(file="/var/wessaorg/rcomp/tmp/1ypkm1355861650.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/26ku81355861651.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/3vojb1355861651.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/4f27w1355861651.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/5zopi1355861651.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 = 150
Frequency = 1
1 2 3 4 5 6
2.44467676 -10.95430666 -5.26227819 -6.72623470 0.30786672 -13.77729804
7 8 9 10 11 12
37.51683869 -12.20957555 -2.44863998 7.87572704 -2.10950601 -20.85737584
13 14 15 16 17 18
-7.27862114 5.80964157 -2.63072325 3.09576944 6.59331902 2.69913779
19 20 21 22 23 24
-3.31602533 -1.93580748 1.87623745 37.58250593 3.96594096 -11.41234178
25 26 27 28 29 30
-8.07882525 -8.52659150 -0.48763639 1.98826363 0.96582141 11.47096345
31 32 33 34 35 36
2.51654760 -9.51416527 8.43273087 -9.62039830 20.85225053 12.36983816
37 38 39 40 41 42
21.02614051 0.06647690 6.39100227 4.09687937 21.38048492 -3.24795057
43 44 45 46 47 48
2.31323526 -6.64857340 -9.71410872 28.92513040 -13.70573103 -1.77131366
49 50 51 52 53 54
1.22187745 -4.90004460 1.09799939 -2.78972930 -15.81887572 -4.79173222
55 56 57 58 59 60
-2.23029573 16.10920938 -6.90343689 -5.92684482 8.76421324 1.75885482
61 62 63 64 65 66
7.45578951 6.53396346 -4.55277574 2.45564882 0.79709427 6.01924736
67 68 69 70 71 72
-16.57354852 -14.77340804 1.52000142 -5.30943899 -2.62469784 -6.55708992
73 74 75 76 77 78
-3.48602196 3.42273567 -6.80722189 12.26323094 14.71077483 -30.20095380
79 80 81 82 83 84
-7.63215667 -3.51975061 0.91610061 25.67387261 1.17074354 -5.51477866
85 86 87 88 89 90
2.66678984 1.94345342 -9.29453558 6.71016629 4.37363184 -19.42538720
91 92 93 94 95 96
1.57781074 0.03933554 -0.95627848 8.93330962 10.15400711 2.27602752
97 98 99 100 101 102
-0.31969792 3.74218410 -9.99501211 17.27474562 -9.39573927 5.91434833
103 104 105 106 107 108
-17.50118864 -12.41865062 7.92358151 -12.39744630 7.14897007 7.25181923
109 110 111 112 113 114
-25.81440581 -15.29534571 8.27123712 -2.61967713 3.38583996 -4.11262066
115 116 117 118 119 120
-0.88985038 -7.25765726 29.31590706 2.26009377 13.39820247 -3.93886826
121 122 123 124 125 126
6.86690423 -7.96323883 -17.39159792 -10.76871824 -4.99834853 -7.00767896
127 128 129 130 131 132
6.83784659 -8.15465424 20.89859760 1.95341519 3.59876583 8.65721760
133 134 135 136 137 138
-6.59570257 -23.40041704 14.32798034 -14.05092620 13.57013585 -8.62304830
139 140 141 142 143 144
9.67282635 -2.53164643 -12.29021508 22.78834056 -1.25356560 10.94674378
145 146 147 148 149 150
5.16375078 -27.18393983 -5.83697865 -3.16833129 0.43401643 1.26541276
> postscript(file="/var/wessaorg/rcomp/tmp/6why41355861651.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 = 150
Frequency = 1
lag(myerror, k = 1) myerror
0 2.44467676 NA
1 -10.95430666 2.44467676
2 -5.26227819 -10.95430666
3 -6.72623470 -5.26227819
4 0.30786672 -6.72623470
5 -13.77729804 0.30786672
6 37.51683869 -13.77729804
7 -12.20957555 37.51683869
8 -2.44863998 -12.20957555
9 7.87572704 -2.44863998
10 -2.10950601 7.87572704
11 -20.85737584 -2.10950601
12 -7.27862114 -20.85737584
13 5.80964157 -7.27862114
14 -2.63072325 5.80964157
15 3.09576944 -2.63072325
16 6.59331902 3.09576944
17 2.69913779 6.59331902
18 -3.31602533 2.69913779
19 -1.93580748 -3.31602533
20 1.87623745 -1.93580748
21 37.58250593 1.87623745
22 3.96594096 37.58250593
23 -11.41234178 3.96594096
24 -8.07882525 -11.41234178
25 -8.52659150 -8.07882525
26 -0.48763639 -8.52659150
27 1.98826363 -0.48763639
28 0.96582141 1.98826363
29 11.47096345 0.96582141
30 2.51654760 11.47096345
31 -9.51416527 2.51654760
32 8.43273087 -9.51416527
33 -9.62039830 8.43273087
34 20.85225053 -9.62039830
35 12.36983816 20.85225053
36 21.02614051 12.36983816
37 0.06647690 21.02614051
38 6.39100227 0.06647690
39 4.09687937 6.39100227
40 21.38048492 4.09687937
41 -3.24795057 21.38048492
42 2.31323526 -3.24795057
43 -6.64857340 2.31323526
44 -9.71410872 -6.64857340
45 28.92513040 -9.71410872
46 -13.70573103 28.92513040
47 -1.77131366 -13.70573103
48 1.22187745 -1.77131366
49 -4.90004460 1.22187745
50 1.09799939 -4.90004460
51 -2.78972930 1.09799939
52 -15.81887572 -2.78972930
53 -4.79173222 -15.81887572
54 -2.23029573 -4.79173222
55 16.10920938 -2.23029573
56 -6.90343689 16.10920938
57 -5.92684482 -6.90343689
58 8.76421324 -5.92684482
59 1.75885482 8.76421324
60 7.45578951 1.75885482
61 6.53396346 7.45578951
62 -4.55277574 6.53396346
63 2.45564882 -4.55277574
64 0.79709427 2.45564882
65 6.01924736 0.79709427
66 -16.57354852 6.01924736
67 -14.77340804 -16.57354852
68 1.52000142 -14.77340804
69 -5.30943899 1.52000142
70 -2.62469784 -5.30943899
71 -6.55708992 -2.62469784
72 -3.48602196 -6.55708992
73 3.42273567 -3.48602196
74 -6.80722189 3.42273567
75 12.26323094 -6.80722189
76 14.71077483 12.26323094
77 -30.20095380 14.71077483
78 -7.63215667 -30.20095380
79 -3.51975061 -7.63215667
80 0.91610061 -3.51975061
81 25.67387261 0.91610061
82 1.17074354 25.67387261
83 -5.51477866 1.17074354
84 2.66678984 -5.51477866
85 1.94345342 2.66678984
86 -9.29453558 1.94345342
87 6.71016629 -9.29453558
88 4.37363184 6.71016629
89 -19.42538720 4.37363184
90 1.57781074 -19.42538720
91 0.03933554 1.57781074
92 -0.95627848 0.03933554
93 8.93330962 -0.95627848
94 10.15400711 8.93330962
95 2.27602752 10.15400711
96 -0.31969792 2.27602752
97 3.74218410 -0.31969792
98 -9.99501211 3.74218410
99 17.27474562 -9.99501211
100 -9.39573927 17.27474562
101 5.91434833 -9.39573927
102 -17.50118864 5.91434833
103 -12.41865062 -17.50118864
104 7.92358151 -12.41865062
105 -12.39744630 7.92358151
106 7.14897007 -12.39744630
107 7.25181923 7.14897007
108 -25.81440581 7.25181923
109 -15.29534571 -25.81440581
110 8.27123712 -15.29534571
111 -2.61967713 8.27123712
112 3.38583996 -2.61967713
113 -4.11262066 3.38583996
114 -0.88985038 -4.11262066
115 -7.25765726 -0.88985038
116 29.31590706 -7.25765726
117 2.26009377 29.31590706
118 13.39820247 2.26009377
119 -3.93886826 13.39820247
120 6.86690423 -3.93886826
121 -7.96323883 6.86690423
122 -17.39159792 -7.96323883
123 -10.76871824 -17.39159792
124 -4.99834853 -10.76871824
125 -7.00767896 -4.99834853
126 6.83784659 -7.00767896
127 -8.15465424 6.83784659
128 20.89859760 -8.15465424
129 1.95341519 20.89859760
130 3.59876583 1.95341519
131 8.65721760 3.59876583
132 -6.59570257 8.65721760
133 -23.40041704 -6.59570257
134 14.32798034 -23.40041704
135 -14.05092620 14.32798034
136 13.57013585 -14.05092620
137 -8.62304830 13.57013585
138 9.67282635 -8.62304830
139 -2.53164643 9.67282635
140 -12.29021508 -2.53164643
141 22.78834056 -12.29021508
142 -1.25356560 22.78834056
143 10.94674378 -1.25356560
144 5.16375078 10.94674378
145 -27.18393983 5.16375078
146 -5.83697865 -27.18393983
147 -3.16833129 -5.83697865
148 0.43401643 -3.16833129
149 1.26541276 0.43401643
150 NA 1.26541276
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -10.95430666 2.44467676
[2,] -5.26227819 -10.95430666
[3,] -6.72623470 -5.26227819
[4,] 0.30786672 -6.72623470
[5,] -13.77729804 0.30786672
[6,] 37.51683869 -13.77729804
[7,] -12.20957555 37.51683869
[8,] -2.44863998 -12.20957555
[9,] 7.87572704 -2.44863998
[10,] -2.10950601 7.87572704
[11,] -20.85737584 -2.10950601
[12,] -7.27862114 -20.85737584
[13,] 5.80964157 -7.27862114
[14,] -2.63072325 5.80964157
[15,] 3.09576944 -2.63072325
[16,] 6.59331902 3.09576944
[17,] 2.69913779 6.59331902
[18,] -3.31602533 2.69913779
[19,] -1.93580748 -3.31602533
[20,] 1.87623745 -1.93580748
[21,] 37.58250593 1.87623745
[22,] 3.96594096 37.58250593
[23,] -11.41234178 3.96594096
[24,] -8.07882525 -11.41234178
[25,] -8.52659150 -8.07882525
[26,] -0.48763639 -8.52659150
[27,] 1.98826363 -0.48763639
[28,] 0.96582141 1.98826363
[29,] 11.47096345 0.96582141
[30,] 2.51654760 11.47096345
[31,] -9.51416527 2.51654760
[32,] 8.43273087 -9.51416527
[33,] -9.62039830 8.43273087
[34,] 20.85225053 -9.62039830
[35,] 12.36983816 20.85225053
[36,] 21.02614051 12.36983816
[37,] 0.06647690 21.02614051
[38,] 6.39100227 0.06647690
[39,] 4.09687937 6.39100227
[40,] 21.38048492 4.09687937
[41,] -3.24795057 21.38048492
[42,] 2.31323526 -3.24795057
[43,] -6.64857340 2.31323526
[44,] -9.71410872 -6.64857340
[45,] 28.92513040 -9.71410872
[46,] -13.70573103 28.92513040
[47,] -1.77131366 -13.70573103
[48,] 1.22187745 -1.77131366
[49,] -4.90004460 1.22187745
[50,] 1.09799939 -4.90004460
[51,] -2.78972930 1.09799939
[52,] -15.81887572 -2.78972930
[53,] -4.79173222 -15.81887572
[54,] -2.23029573 -4.79173222
[55,] 16.10920938 -2.23029573
[56,] -6.90343689 16.10920938
[57,] -5.92684482 -6.90343689
[58,] 8.76421324 -5.92684482
[59,] 1.75885482 8.76421324
[60,] 7.45578951 1.75885482
[61,] 6.53396346 7.45578951
[62,] -4.55277574 6.53396346
[63,] 2.45564882 -4.55277574
[64,] 0.79709427 2.45564882
[65,] 6.01924736 0.79709427
[66,] -16.57354852 6.01924736
[67,] -14.77340804 -16.57354852
[68,] 1.52000142 -14.77340804
[69,] -5.30943899 1.52000142
[70,] -2.62469784 -5.30943899
[71,] -6.55708992 -2.62469784
[72,] -3.48602196 -6.55708992
[73,] 3.42273567 -3.48602196
[74,] -6.80722189 3.42273567
[75,] 12.26323094 -6.80722189
[76,] 14.71077483 12.26323094
[77,] -30.20095380 14.71077483
[78,] -7.63215667 -30.20095380
[79,] -3.51975061 -7.63215667
[80,] 0.91610061 -3.51975061
[81,] 25.67387261 0.91610061
[82,] 1.17074354 25.67387261
[83,] -5.51477866 1.17074354
[84,] 2.66678984 -5.51477866
[85,] 1.94345342 2.66678984
[86,] -9.29453558 1.94345342
[87,] 6.71016629 -9.29453558
[88,] 4.37363184 6.71016629
[89,] -19.42538720 4.37363184
[90,] 1.57781074 -19.42538720
[91,] 0.03933554 1.57781074
[92,] -0.95627848 0.03933554
[93,] 8.93330962 -0.95627848
[94,] 10.15400711 8.93330962
[95,] 2.27602752 10.15400711
[96,] -0.31969792 2.27602752
[97,] 3.74218410 -0.31969792
[98,] -9.99501211 3.74218410
[99,] 17.27474562 -9.99501211
[100,] -9.39573927 17.27474562
[101,] 5.91434833 -9.39573927
[102,] -17.50118864 5.91434833
[103,] -12.41865062 -17.50118864
[104,] 7.92358151 -12.41865062
[105,] -12.39744630 7.92358151
[106,] 7.14897007 -12.39744630
[107,] 7.25181923 7.14897007
[108,] -25.81440581 7.25181923
[109,] -15.29534571 -25.81440581
[110,] 8.27123712 -15.29534571
[111,] -2.61967713 8.27123712
[112,] 3.38583996 -2.61967713
[113,] -4.11262066 3.38583996
[114,] -0.88985038 -4.11262066
[115,] -7.25765726 -0.88985038
[116,] 29.31590706 -7.25765726
[117,] 2.26009377 29.31590706
[118,] 13.39820247 2.26009377
[119,] -3.93886826 13.39820247
[120,] 6.86690423 -3.93886826
[121,] -7.96323883 6.86690423
[122,] -17.39159792 -7.96323883
[123,] -10.76871824 -17.39159792
[124,] -4.99834853 -10.76871824
[125,] -7.00767896 -4.99834853
[126,] 6.83784659 -7.00767896
[127,] -8.15465424 6.83784659
[128,] 20.89859760 -8.15465424
[129,] 1.95341519 20.89859760
[130,] 3.59876583 1.95341519
[131,] 8.65721760 3.59876583
[132,] -6.59570257 8.65721760
[133,] -23.40041704 -6.59570257
[134,] 14.32798034 -23.40041704
[135,] -14.05092620 14.32798034
[136,] 13.57013585 -14.05092620
[137,] -8.62304830 13.57013585
[138,] 9.67282635 -8.62304830
[139,] -2.53164643 9.67282635
[140,] -12.29021508 -2.53164643
[141,] 22.78834056 -12.29021508
[142,] -1.25356560 22.78834056
[143,] 10.94674378 -1.25356560
[144,] 5.16375078 10.94674378
[145,] -27.18393983 5.16375078
[146,] -5.83697865 -27.18393983
[147,] -3.16833129 -5.83697865
[148,] 0.43401643 -3.16833129
[149,] 1.26541276 0.43401643
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -10.95430666 2.44467676
2 -5.26227819 -10.95430666
3 -6.72623470 -5.26227819
4 0.30786672 -6.72623470
5 -13.77729804 0.30786672
6 37.51683869 -13.77729804
7 -12.20957555 37.51683869
8 -2.44863998 -12.20957555
9 7.87572704 -2.44863998
10 -2.10950601 7.87572704
11 -20.85737584 -2.10950601
12 -7.27862114 -20.85737584
13 5.80964157 -7.27862114
14 -2.63072325 5.80964157
15 3.09576944 -2.63072325
16 6.59331902 3.09576944
17 2.69913779 6.59331902
18 -3.31602533 2.69913779
19 -1.93580748 -3.31602533
20 1.87623745 -1.93580748
21 37.58250593 1.87623745
22 3.96594096 37.58250593
23 -11.41234178 3.96594096
24 -8.07882525 -11.41234178
25 -8.52659150 -8.07882525
26 -0.48763639 -8.52659150
27 1.98826363 -0.48763639
28 0.96582141 1.98826363
29 11.47096345 0.96582141
30 2.51654760 11.47096345
31 -9.51416527 2.51654760
32 8.43273087 -9.51416527
33 -9.62039830 8.43273087
34 20.85225053 -9.62039830
35 12.36983816 20.85225053
36 21.02614051 12.36983816
37 0.06647690 21.02614051
38 6.39100227 0.06647690
39 4.09687937 6.39100227
40 21.38048492 4.09687937
41 -3.24795057 21.38048492
42 2.31323526 -3.24795057
43 -6.64857340 2.31323526
44 -9.71410872 -6.64857340
45 28.92513040 -9.71410872
46 -13.70573103 28.92513040
47 -1.77131366 -13.70573103
48 1.22187745 -1.77131366
49 -4.90004460 1.22187745
50 1.09799939 -4.90004460
51 -2.78972930 1.09799939
52 -15.81887572 -2.78972930
53 -4.79173222 -15.81887572
54 -2.23029573 -4.79173222
55 16.10920938 -2.23029573
56 -6.90343689 16.10920938
57 -5.92684482 -6.90343689
58 8.76421324 -5.92684482
59 1.75885482 8.76421324
60 7.45578951 1.75885482
61 6.53396346 7.45578951
62 -4.55277574 6.53396346
63 2.45564882 -4.55277574
64 0.79709427 2.45564882
65 6.01924736 0.79709427
66 -16.57354852 6.01924736
67 -14.77340804 -16.57354852
68 1.52000142 -14.77340804
69 -5.30943899 1.52000142
70 -2.62469784 -5.30943899
71 -6.55708992 -2.62469784
72 -3.48602196 -6.55708992
73 3.42273567 -3.48602196
74 -6.80722189 3.42273567
75 12.26323094 -6.80722189
76 14.71077483 12.26323094
77 -30.20095380 14.71077483
78 -7.63215667 -30.20095380
79 -3.51975061 -7.63215667
80 0.91610061 -3.51975061
81 25.67387261 0.91610061
82 1.17074354 25.67387261
83 -5.51477866 1.17074354
84 2.66678984 -5.51477866
85 1.94345342 2.66678984
86 -9.29453558 1.94345342
87 6.71016629 -9.29453558
88 4.37363184 6.71016629
89 -19.42538720 4.37363184
90 1.57781074 -19.42538720
91 0.03933554 1.57781074
92 -0.95627848 0.03933554
93 8.93330962 -0.95627848
94 10.15400711 8.93330962
95 2.27602752 10.15400711
96 -0.31969792 2.27602752
97 3.74218410 -0.31969792
98 -9.99501211 3.74218410
99 17.27474562 -9.99501211
100 -9.39573927 17.27474562
101 5.91434833 -9.39573927
102 -17.50118864 5.91434833
103 -12.41865062 -17.50118864
104 7.92358151 -12.41865062
105 -12.39744630 7.92358151
106 7.14897007 -12.39744630
107 7.25181923 7.14897007
108 -25.81440581 7.25181923
109 -15.29534571 -25.81440581
110 8.27123712 -15.29534571
111 -2.61967713 8.27123712
112 3.38583996 -2.61967713
113 -4.11262066 3.38583996
114 -0.88985038 -4.11262066
115 -7.25765726 -0.88985038
116 29.31590706 -7.25765726
117 2.26009377 29.31590706
118 13.39820247 2.26009377
119 -3.93886826 13.39820247
120 6.86690423 -3.93886826
121 -7.96323883 6.86690423
122 -17.39159792 -7.96323883
123 -10.76871824 -17.39159792
124 -4.99834853 -10.76871824
125 -7.00767896 -4.99834853
126 6.83784659 -7.00767896
127 -8.15465424 6.83784659
128 20.89859760 -8.15465424
129 1.95341519 20.89859760
130 3.59876583 1.95341519
131 8.65721760 3.59876583
132 -6.59570257 8.65721760
133 -23.40041704 -6.59570257
134 14.32798034 -23.40041704
135 -14.05092620 14.32798034
136 13.57013585 -14.05092620
137 -8.62304830 13.57013585
138 9.67282635 -8.62304830
139 -2.53164643 9.67282635
140 -12.29021508 -2.53164643
141 22.78834056 -12.29021508
142 -1.25356560 22.78834056
143 10.94674378 -1.25356560
144 5.16375078 10.94674378
145 -27.18393983 5.16375078
146 -5.83697865 -27.18393983
147 -3.16833129 -5.83697865
148 0.43401643 -3.16833129
149 1.26541276 0.43401643
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/7v7ow1355861651.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/8jd6w1355861651.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/927lz1355861651.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/wessaorg/rcomp/tmp/10t78a1355861651.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/11fcoc1355861651.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/12e20n1355861651.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/132loh1355861651.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/14tfd71355861651.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/15tqt81355861651.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/16s4b11355861651.tab")
+ }
>
> try(system("convert tmp/1ypkm1355861650.ps tmp/1ypkm1355861650.png",intern=TRUE))
character(0)
> try(system("convert tmp/26ku81355861651.ps tmp/26ku81355861651.png",intern=TRUE))
character(0)
> try(system("convert tmp/3vojb1355861651.ps tmp/3vojb1355861651.png",intern=TRUE))
character(0)
> try(system("convert tmp/4f27w1355861651.ps tmp/4f27w1355861651.png",intern=TRUE))
character(0)
> try(system("convert tmp/5zopi1355861651.ps tmp/5zopi1355861651.png",intern=TRUE))
character(0)
> try(system("convert tmp/6why41355861651.ps tmp/6why41355861651.png",intern=TRUE))
character(0)
> try(system("convert tmp/7v7ow1355861651.ps tmp/7v7ow1355861651.png",intern=TRUE))
character(0)
> try(system("convert tmp/8jd6w1355861651.ps tmp/8jd6w1355861651.png",intern=TRUE))
character(0)
> try(system("convert tmp/927lz1355861651.ps tmp/927lz1355861651.png",intern=TRUE))
character(0)
> try(system("convert tmp/10t78a1355861651.ps tmp/10t78a1355861651.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.885 1.305 9.254