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(9
+ ,26
+ ,21
+ ,21
+ ,23
+ ,17
+ ,23
+ ,4
+ ,14
+ ,12
+ ,9
+ ,20
+ ,16
+ ,15
+ ,24
+ ,17
+ ,20
+ ,4
+ ,18
+ ,11
+ ,9
+ ,19
+ ,19
+ ,18
+ ,22
+ ,18
+ ,20
+ ,6
+ ,11
+ ,14
+ ,9
+ ,19
+ ,18
+ ,11
+ ,20
+ ,21
+ ,21
+ ,8
+ ,12
+ ,12
+ ,9
+ ,20
+ ,16
+ ,8
+ ,24
+ ,20
+ ,24
+ ,8
+ ,16
+ ,21
+ ,9
+ ,25
+ ,23
+ ,19
+ ,27
+ ,28
+ ,22
+ ,4
+ ,18
+ ,12
+ ,9
+ ,25
+ ,17
+ ,4
+ ,28
+ ,19
+ ,23
+ ,4
+ ,14
+ ,22
+ ,9
+ ,22
+ ,12
+ ,20
+ ,27
+ ,22
+ ,20
+ ,8
+ ,14
+ ,11
+ ,9
+ ,26
+ ,19
+ ,16
+ ,24
+ ,16
+ ,25
+ ,5
+ ,15
+ ,10
+ ,9
+ ,22
+ ,16
+ ,14
+ ,23
+ ,18
+ ,23
+ ,4
+ ,15
+ ,13
+ ,9
+ ,17
+ ,19
+ ,10
+ ,24
+ ,25
+ ,27
+ ,4
+ ,17
+ ,10
+ ,9
+ ,22
+ ,20
+ ,13
+ ,27
+ ,17
+ ,27
+ ,4
+ ,19
+ ,8
+ ,9
+ ,19
+ ,13
+ ,14
+ ,27
+ ,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numeric(x[i,j])
+ }
+ }
> par20 = ''
> par19 = ''
> par18 = ''
> par17 = ''
> par16 = ''
> par15 = ''
> par14 = ''
> par13 = ''
> par12 = ''
> par11 = ''
> par10 = ''
> par9 = ''
> par8 = ''
> par7 = ''
> par6 = ''
> par5 = ''
> par4 = ''
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '2'
> 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
I1 Month I2 I3 E1 E2 E3 A Happiness Depression\r
1 26 9 21 21 23 17 23 4 14 12
2 20 9 16 15 24 17 20 4 18 11
3 19 9 19 18 22 18 20 6 11 14
4 19 9 18 11 20 21 21 8 12 12
5 20 9 16 8 24 20 24 8 16 21
6 25 9 23 19 27 28 22 4 18 12
7 25 9 17 4 28 19 23 4 14 22
8 22 9 12 20 27 22 20 8 14 11
9 26 9 19 16 24 16 25 5 15 10
10 22 9 16 14 23 18 23 4 15 13
11 17 9 19 10 24 25 27 4 17 10
12 22 9 20 13 27 17 27 4 19 8
13 19 9 13 14 27 14 22 4 10 15
14 24 9 20 8 28 11 24 4 16 14
15 26 9 27 23 27 27 25 4 18 10
16 21 9 17 11 23 20 22 8 14 14
17 13 9 8 9 24 22 28 4 14 14
18 26 9 25 24 28 22 28 4 17 11
19 20 9 26 5 27 21 27 4 14 10
20 22 9 13 15 25 23 25 8 16 13
21 14 9 19 5 19 17 16 4 18 7
22 21 9 15 19 24 24 28 7 11 14
23 7 9 5 6 20 14 21 4 14 12
24 23 9 16 13 28 17 24 4 12 14
25 17 9 14 11 26 23 27 5 17 11
26 25 9 24 17 23 24 14 4 9 9
27 25 9 24 17 23 24 14 4 16 11
28 19 9 9 5 20 8 27 4 14 15
29 20 9 19 9 11 22 20 4 15 14
30 23 9 19 15 24 23 21 4 11 13
31 22 9 25 17 25 25 22 4 16 9
32 22 9 19 17 23 21 21 4 13 15
33 21 9 18 20 18 24 12 15 17 10
34 15 9 15 12 20 15 20 10 15 11
35 20 9 12 7 20 22 24 4 14 13
36 22 9 21 16 24 21 19 8 16 8
37 18 9 12 7 23 25 28 4 9 20
38 20 9 15 14 25 16 23 4 15 12
39 28 9 28 24 28 28 27 4 17 10
40 22 9 25 15 26 23 22 4 13 10
41 18 9 19 15 26 21 27 7 15 9
42 23 9 20 10 23 21 26 4 16 14
43 20 9 24 14 22 26 22 6 16 8
44 25 9 26 18 24 22 21 5 12 14
45 26 9 25 12 21 21 19 4 12 11
46 15 9 12 9 20 18 24 16 11 13
47 17 9 12 9 22 12 19 5 15 9
48 23 9 15 8 20 25 26 12 15 11
49 21 9 17 18 25 17 22 6 17 15
50 13 9 14 10 20 24 28 9 13 11
51 18 9 16 17 22 15 21 9 16 10
52 19 9 11 14 23 13 23 4 14 14
53 22 9 20 16 25 26 28 5 11 18
54 16 9 11 10 23 16 10 4 12 14
55 24 9 22 19 23 24 24 4 12 11
56 18 9 20 10 22 21 21 5 15 12
57 20 9 19 14 24 20 21 4 16 13
58 24 9 17 10 25 14 24 4 15 9
59 14 9 21 4 21 25 24 4 12 10
60 22 9 23 19 12 25 25 5 12 15
61 24 9 18 9 17 20 25 4 8 20
62 18 9 17 12 20 22 23 6 13 12
63 21 9 27 16 23 20 21 4 11 12
64 23 9 25 11 23 26 16 4 14 14
65 17 9 19 18 20 18 17 18 15 13
66 22 10 22 11 28 22 25 4 10 11
67 24 10 24 24 24 24 24 6 11 17
68 21 10 20 17 24 17 23 4 12 12
69 22 10 19 18 24 24 25 4 15 13
70 16 10 11 9 24 20 23 5 15 14
71 21 10 22 19 28 19 28 4 14 13
72 23 10 22 18 25 20 26 4 16 15
73 22 10 16 12 21 15 22 5 15 13
74 24 10 20 23 25 23 19 10 15 10
75 24 10 24 22 25 26 26 5 13 11
76 16 10 16 14 18 22 18 8 12 19
77 16 10 16 14 17 20 18 8 17 13
78 21 10 22 16 26 24 25 5 13 17
79 26 10 24 23 28 26 27 4 15 13
80 15 10 16 7 21 21 12 4 13 9
81 25 10 27 10 27 25 15 4 15 11
82 18 10 11 12 22 13 21 5 16 10
83 23 10 21 12 21 20 23 4 15 9
84 20 10 20 12 25 22 22 4 16 12
85 17 10 20 17 22 23 21 8 15 12
86 25 10 27 21 23 28 24 4 14 13
87 24 10 20 16 26 22 27 5 15 13
88 17 10 12 11 19 20 22 14 14 12
89 19 10 8 14 25 6 28 8 13 15
90 20 10 21 13 21 21 26 8 7 22
91 15 10 18 9 13 20 10 4 17 13
92 27 10 24 19 24 18 19 4 13 15
93 22 10 16 13 25 23 22 6 15 13
94 23 10 18 19 26 20 21 4 14 15
95 16 10 20 13 25 24 24 7 13 10
96 19 10 20 13 25 22 25 7 16 11
97 25 10 19 13 22 21 21 4 12 16
98 19 10 17 14 21 18 20 6 14 11
99 19 10 16 12 23 21 21 4 17 11
100 26 10 26 22 25 23 24 7 15 10
101 21 10 15 11 24 23 23 4 17 10
102 20 10 22 5 21 15 18 4 12 16
103 24 10 17 18 21 21 24 8 16 12
104 22 10 23 19 25 24 24 4 11 11
105 20 10 21 14 22 23 19 4 15 16
106 18 10 19 15 20 21 20 10 9 19
107 18 10 14 12 20 21 18 8 16 11
108 24 10 17 19 23 20 20 6 15 16
109 24 10 12 15 28 11 27 4 10 15
110 22 10 24 17 23 22 23 4 10 24
111 23 10 18 8 28 27 26 4 15 14
112 22 10 20 10 24 25 23 5 11 15
113 20 10 16 12 18 18 17 4 13 11
114 18 10 20 12 20 20 21 6 14 15
115 25 10 22 20 28 24 25 4 18 12
116 18 10 12 12 21 10 23 5 16 10
117 16 10 16 12 21 27 27 7 14 14
118 20 10 17 14 25 21 24 8 14 13
119 19 10 22 6 19 21 20 5 14 9
120 15 10 12 10 18 18 27 8 14 15
121 19 10 14 18 21 15 21 10 12 15
122 19 10 23 18 22 24 24 8 14 14
123 16 10 15 7 24 22 21 5 15 11
124 17 10 17 18 15 14 15 12 15 8
125 28 10 28 9 28 28 25 4 15 11
126 23 10 20 17 26 18 25 5 13 11
127 25 10 23 22 23 26 22 4 17 8
128 20 10 13 11 26 17 24 6 17 10
129 17 10 18 15 20 19 21 4 19 11
130 23 10 23 17 22 22 22 4 15 13
131 16 10 19 15 20 18 23 7 13 11
132 23 10 23 22 23 24 22 7 9 20
133 11 10 12 9 22 15 20 10 15 10
134 18 10 16 13 24 18 23 4 15 15
135 24 10 23 20 23 26 25 5 15 12
136 23 10 13 14 22 11 23 8 16 14
137 21 10 22 14 26 26 22 11 11 23
138 16 10 18 12 23 21 25 7 14 14
139 24 10 23 20 27 23 26 4 11 16
140 23 10 20 20 23 23 22 8 15 11
141 18 10 10 8 21 15 24 6 13 12
142 20 10 17 17 26 22 24 7 15 10
143 9 10 18 9 23 26 25 5 16 14
144 24 10 15 18 21 16 20 4 14 12
145 25 10 23 22 27 20 26 8 15 12
146 20 10 17 10 19 18 21 4 16 11
147 21 10 17 13 23 22 26 8 16 12
148 25 10 22 15 25 16 21 6 11 13
149 22 10 20 18 23 19 22 4 12 11
150 21 10 20 18 22 20 16 9 9 19
151 21 10 19 12 22 19 26 5 16 12
152 22 10 18 12 25 23 28 6 13 17
153 27 10 22 20 25 24 18 4 16 9
154 24 9 20 12 28 25 25 4 12 12
155 24 10 22 16 28 21 23 4 9 19
156 21 10 18 16 20 21 21 5 13 18
157 18 10 16 18 25 23 20 6 13 15
158 16 10 16 16 19 27 25 16 14 14
159 22 10 16 13 25 23 22 6 19 11
160 20 10 16 17 22 18 21 6 13 9
161 18 10 17 13 18 16 16 4 12 18
162 20 11 18 17 20 16 18 4 13 16
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Month I2 I3
9.93803 -0.52982 0.36663 0.26216
E1 E2 E3 A
0.26469 -0.12194 0.02341 -0.21130
Happiness `Depression\\r`
0.05384 0.12583
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-9.6678 -1.5391 0.0342 1.6773 7.7235
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.93803 4.65376 2.135 0.03432 *
Month -0.52982 0.40171 -1.319 0.18918
I2 0.36663 0.06332 5.790 3.90e-08 ***
I3 0.26216 0.05082 5.158 7.66e-07 ***
E1 0.26469 0.07487 3.535 0.00054 ***
E2 -0.12194 0.05885 -2.072 0.03996 *
E3 0.02341 0.06152 0.381 0.70407
A -0.21130 0.08377 -2.522 0.01269 *
Happiness 0.05384 0.10145 0.531 0.59636
`Depression\\r` 0.12583 0.07596 1.657 0.09967 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.491 on 152 degrees of freedom
Multiple R-squared: 0.5618, Adjusted R-squared: 0.5359
F-statistic: 21.65 on 9 and 152 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.95232244 0.09535513 0.04767756
[2,] 0.91050914 0.17898171 0.08949086
[3,] 0.86180142 0.27639716 0.13819858
[4,] 0.79434701 0.41130598 0.20565299
[5,] 0.72940770 0.54118460 0.27059230
[6,] 0.65857452 0.68285097 0.34142548
[7,] 0.58889154 0.82221691 0.41110846
[8,] 0.56463305 0.87073391 0.43536695
[9,] 0.53393967 0.93212065 0.46606033
[10,] 0.44707155 0.89414311 0.55292845
[11,] 0.58387036 0.83225929 0.41612964
[12,] 0.52685560 0.94628879 0.47314440
[13,] 0.46209809 0.92419618 0.53790191
[14,] 0.50233058 0.99533884 0.49766942
[15,] 0.43884928 0.87769857 0.56115072
[16,] 0.63631868 0.72736264 0.36368132
[17,] 0.67886263 0.64227473 0.32113737
[18,] 0.63633444 0.72733112 0.36366556
[19,] 0.60082436 0.79835129 0.39917564
[20,] 0.55760611 0.88478779 0.44239389
[21,] 0.51982109 0.96035781 0.48017891
[22,] 0.57956821 0.84086358 0.42043179
[23,] 0.72789339 0.54421323 0.27210661
[24,] 0.68227300 0.63545400 0.31772700
[25,] 0.63058932 0.73882137 0.36941068
[26,] 0.57531025 0.84937950 0.42468975
[27,] 0.51663965 0.96672070 0.48336035
[28,] 0.48880157 0.97760315 0.51119843
[29,] 0.49620434 0.99240867 0.50379566
[30,] 0.46355440 0.92710880 0.53644560
[31,] 0.41632616 0.83265232 0.58367384
[32,] 0.38413698 0.76827396 0.61586302
[33,] 0.44080200 0.88160400 0.55919800
[34,] 0.38784441 0.77568883 0.61215559
[35,] 0.34657194 0.69314388 0.65342806
[36,] 0.75920990 0.48158020 0.24079010
[37,] 0.74670453 0.50659094 0.25329547
[38,] 0.77745511 0.44508978 0.22254489
[39,] 0.76297605 0.47404789 0.23702395
[40,] 0.72493163 0.55013673 0.27506837
[41,] 0.70778799 0.58442403 0.29221201
[42,] 0.68695488 0.62609024 0.31304512
[43,] 0.64531667 0.70936667 0.35468333
[44,] 0.64342244 0.71315512 0.35657756
[45,] 0.63171962 0.73656076 0.36828038
[46,] 0.71569872 0.56860255 0.28430128
[47,] 0.77908181 0.44183639 0.22091819
[48,] 0.74885212 0.50229575 0.25114788
[49,] 0.82709335 0.34581331 0.17290665
[50,] 0.79592785 0.40814430 0.20407215
[51,] 0.85076406 0.29847188 0.14923594
[52,] 0.82123943 0.35752114 0.17876057
[53,] 0.85170852 0.29658295 0.14829148
[54,] 0.82269211 0.35461578 0.17730789
[55,] 0.80832473 0.38335053 0.19167527
[56,] 0.78621064 0.42757872 0.21378936
[57,] 0.75247231 0.49505539 0.24752769
[58,] 0.71708393 0.56583215 0.28291607
[59,] 0.77159524 0.45680951 0.22840476
[60,] 0.74083253 0.51833495 0.25916747
[61,] 0.76480129 0.47039743 0.23519871
[62,] 0.75240705 0.49518591 0.24759295
[63,] 0.71514112 0.56971777 0.28485888
[64,] 0.71721052 0.56557896 0.28278948
[65,] 0.68484651 0.63030697 0.31515349
[66,] 0.67395019 0.65209961 0.32604981
[67,] 0.63619683 0.72760634 0.36380317
[68,] 0.61037981 0.77924039 0.38962019
[69,] 0.59637207 0.80725587 0.40362793
[70,] 0.56794392 0.86411216 0.43205608
[71,] 0.59090723 0.81818555 0.40909277
[72,] 0.55620107 0.88759786 0.44379893
[73,] 0.60093443 0.79813113 0.39906557
[74,] 0.55504506 0.88990988 0.44495494
[75,] 0.53130897 0.93738206 0.46869103
[76,] 0.55851535 0.88296929 0.44148465
[77,] 0.51591227 0.96817545 0.48408773
[78,] 0.49039283 0.98078567 0.50960717
[79,] 0.45692050 0.91384101 0.54307950
[80,] 0.43797082 0.87594165 0.56202918
[81,] 0.43844601 0.87689201 0.56155399
[82,] 0.39624644 0.79249289 0.60375356
[83,] 0.47990010 0.95980020 0.52009990
[84,] 0.45687061 0.91374121 0.54312939
[85,] 0.57128617 0.85742765 0.42871383
[86,] 0.52494317 0.95011367 0.47505683
[87,] 0.48023115 0.96046229 0.51976885
[88,] 0.43803077 0.87606154 0.56196923
[89,] 0.43565616 0.87131233 0.56434384
[90,] 0.38871117 0.77742233 0.61128883
[91,] 0.48681995 0.97363991 0.51318005
[92,] 0.46956166 0.93912332 0.53043834
[93,] 0.43551902 0.87103803 0.56448098
[94,] 0.40197314 0.80394629 0.59802686
[95,] 0.37023932 0.74047864 0.62976068
[96,] 0.37607278 0.75214557 0.62392722
[97,] 0.36215537 0.72431074 0.63784463
[98,] 0.34871027 0.69742054 0.65128973
[99,] 0.37644835 0.75289670 0.62355165
[100,] 0.37285559 0.74571117 0.62714441
[101,] 0.36782686 0.73565371 0.63217314
[102,] 0.33638406 0.67276811 0.66361594
[103,] 0.29281013 0.58562025 0.70718987
[104,] 0.25260538 0.50521077 0.74739462
[105,] 0.22080136 0.44160272 0.77919864
[106,] 0.18244045 0.36488090 0.81755955
[107,] 0.15696094 0.31392188 0.84303906
[108,] 0.13427766 0.26855532 0.86572234
[109,] 0.10647109 0.21294219 0.89352891
[110,] 0.11377375 0.22754750 0.88622625
[111,] 0.09042724 0.18085449 0.90957276
[112,] 0.07201068 0.14402136 0.92798932
[113,] 0.17794859 0.35589719 0.82205141
[114,] 0.14496371 0.28992741 0.85503629
[115,] 0.11992939 0.23985878 0.88007061
[116,] 0.09566669 0.19133337 0.90433331
[117,] 0.13802560 0.27605120 0.86197440
[118,] 0.10620271 0.21240543 0.89379729
[119,] 0.15340081 0.30680162 0.84659919
[120,] 0.12706718 0.25413436 0.87293282
[121,] 0.27571457 0.55142914 0.72428543
[122,] 0.29333719 0.58667437 0.70666281
[123,] 0.26058801 0.52117602 0.73941199
[124,] 0.24337769 0.48675537 0.75662231
[125,] 0.20956001 0.41912002 0.79043999
[126,] 0.23517644 0.47035287 0.76482356
[127,] 0.17952731 0.35905461 0.82047269
[128,] 0.13495401 0.26990802 0.86504599
[129,] 0.10264126 0.20528252 0.89735874
[130,] 0.08135104 0.16270208 0.91864896
[131,] 0.86751646 0.26496707 0.13248354
[132,] 0.98929094 0.02141813 0.01070906
[133,] 0.97963342 0.04073315 0.02036658
[134,] 0.95484832 0.09030337 0.04515168
[135,] 0.91073974 0.17852053 0.08926026
[136,] 0.83855137 0.32289726 0.16144863
[137,] 0.71488643 0.57022715 0.28511357
> postscript(file="/var/wessaorg/rcomp/tmp/1ijf51353336744.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/23jfr1353336744.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/3upix1353336744.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/4w2it1353336744.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/5v4111353336744.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 = 162
Frequency = 1
1 2 3 4 5 6
1.65398568 -1.22394814 -3.03695772 0.65695269 0.57793661 0.53563447
7 8 9 10 11 12
4.23930799 1.80796150 3.67367179 1.26449154 -3.02174098 -0.80046898
13 14 15 16 17 18
-2.14117564 0.99078721 -0.92002249 1.72481576 -3.45766221 -1.46552051
19 20 21 22 23 24
-2.39767518 2.92705145 -3.78187459 0.39367183 -7.07253265 1.09353637
25 26 27 28 29 30
-2.13854622 2.31367468 1.68512062 2.47353688 3.08386350 1.50964486
31 32 33 34 35 36
-2.02458220 -0.35318876 2.86494192 -2.82665734 3.87836895 0.52225968
37 38 39 40 41 42
0.74491015 -1.01631974 0.31546308 -1.97313817 -3.48226629 1.96251805
43 44 45 46 47 48
-1.40705164 0.06646082 3.89116353 0.56337045 -0.61692332 7.72349178
49 50 51 52 53 54
-1.71542353 -3.12914689 -2.19617397 -0.58404125 -0.59971246 -1.75758961
55 56 57 58 59 60
0.87534591 -2.13895214 -1.86323488 3.40923101 -4.04854017 1.22686827
61 62 63 64 65 66
5.12335903 -0.63988679 -3.66084412 0.81869601 -1.99135073 0.01934637
67 68 69 70 71 72
-1.18207647 -1.55794501 0.06593014 -0.99710483 -3.98096892 -1.11531172
73 74 75 76 77 78
2.71690014 1.78759305 -0.28943019 -2.02565205 -1.51910393 -2.22335169
79 80 81 82 83 84
0.06029253 -1.60689767 2.04374614 0.38851541 2.76204708 -1.09412753
85 86 87 88 89 90
-3.56645280 0.17613385 1.61482235 2.66597995 0.31885860 -0.80819682
91 92 93 94 95 96
-1.54071456 2.23548600 2.58278146 0.04909079 -4.11215791 -1.66680165
97 98 99 100 101 102
4.41796959 -0.24461418 -0.12477213 1.09904056 2.56220409 0.01861201
103 104 105 106 107 108
4.16802169 -1.43700221 -1.44827664 -1.50172028 1.37181852 2.47613117
109 110 111 112 113 114
2.74556297 -2.55228578 3.21192507 2.14032241 2.14188835 -1.83832842
115 116 117 118 119 120
0.34725279 -0.12605781 -1.58626629 0.13973215 0.95504453 -0.81334312
121 122 123 124 125 126
-0.13301022 -3.07459204 -1.27113724 -0.48438411 4.80630177 0.27106525
127 128 129 130 131 132
1.65103068 1.43361967 -3.20198276 0.21730547 -3.78042504 -1.03811714
133 134 135 136 137 138
-4.81404026 -2.45987206 0.92079453 3.97083251 -0.76442681 -3.53372885
139 140 141 142 143 144
-1.02642859 1.48480268 2.36328541 -0.67715159 -9.66784188 3.64772802
145 146 147 148 149 150
0.21654883 1.77970843 2.02453305 2.24390236 -0.16229369 -0.42379910
151 152 153 154 155 156
0.81842029 1.57560765 3.79036197 2.09293114 -0.31930917 0.43332024
157 158 159 160 161 162
-2.82514062 -0.15702760 2.61905804 0.35293902 -1.53429802 -0.79812412
> postscript(file="/var/wessaorg/rcomp/tmp/6tsea1353336744.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 = 162
Frequency = 1
lag(myerror, k = 1) myerror
0 1.65398568 NA
1 -1.22394814 1.65398568
2 -3.03695772 -1.22394814
3 0.65695269 -3.03695772
4 0.57793661 0.65695269
5 0.53563447 0.57793661
6 4.23930799 0.53563447
7 1.80796150 4.23930799
8 3.67367179 1.80796150
9 1.26449154 3.67367179
10 -3.02174098 1.26449154
11 -0.80046898 -3.02174098
12 -2.14117564 -0.80046898
13 0.99078721 -2.14117564
14 -0.92002249 0.99078721
15 1.72481576 -0.92002249
16 -3.45766221 1.72481576
17 -1.46552051 -3.45766221
18 -2.39767518 -1.46552051
19 2.92705145 -2.39767518
20 -3.78187459 2.92705145
21 0.39367183 -3.78187459
22 -7.07253265 0.39367183
23 1.09353637 -7.07253265
24 -2.13854622 1.09353637
25 2.31367468 -2.13854622
26 1.68512062 2.31367468
27 2.47353688 1.68512062
28 3.08386350 2.47353688
29 1.50964486 3.08386350
30 -2.02458220 1.50964486
31 -0.35318876 -2.02458220
32 2.86494192 -0.35318876
33 -2.82665734 2.86494192
34 3.87836895 -2.82665734
35 0.52225968 3.87836895
36 0.74491015 0.52225968
37 -1.01631974 0.74491015
38 0.31546308 -1.01631974
39 -1.97313817 0.31546308
40 -3.48226629 -1.97313817
41 1.96251805 -3.48226629
42 -1.40705164 1.96251805
43 0.06646082 -1.40705164
44 3.89116353 0.06646082
45 0.56337045 3.89116353
46 -0.61692332 0.56337045
47 7.72349178 -0.61692332
48 -1.71542353 7.72349178
49 -3.12914689 -1.71542353
50 -2.19617397 -3.12914689
51 -0.58404125 -2.19617397
52 -0.59971246 -0.58404125
53 -1.75758961 -0.59971246
54 0.87534591 -1.75758961
55 -2.13895214 0.87534591
56 -1.86323488 -2.13895214
57 3.40923101 -1.86323488
58 -4.04854017 3.40923101
59 1.22686827 -4.04854017
60 5.12335903 1.22686827
61 -0.63988679 5.12335903
62 -3.66084412 -0.63988679
63 0.81869601 -3.66084412
64 -1.99135073 0.81869601
65 0.01934637 -1.99135073
66 -1.18207647 0.01934637
67 -1.55794501 -1.18207647
68 0.06593014 -1.55794501
69 -0.99710483 0.06593014
70 -3.98096892 -0.99710483
71 -1.11531172 -3.98096892
72 2.71690014 -1.11531172
73 1.78759305 2.71690014
74 -0.28943019 1.78759305
75 -2.02565205 -0.28943019
76 -1.51910393 -2.02565205
77 -2.22335169 -1.51910393
78 0.06029253 -2.22335169
79 -1.60689767 0.06029253
80 2.04374614 -1.60689767
81 0.38851541 2.04374614
82 2.76204708 0.38851541
83 -1.09412753 2.76204708
84 -3.56645280 -1.09412753
85 0.17613385 -3.56645280
86 1.61482235 0.17613385
87 2.66597995 1.61482235
88 0.31885860 2.66597995
89 -0.80819682 0.31885860
90 -1.54071456 -0.80819682
91 2.23548600 -1.54071456
92 2.58278146 2.23548600
93 0.04909079 2.58278146
94 -4.11215791 0.04909079
95 -1.66680165 -4.11215791
96 4.41796959 -1.66680165
97 -0.24461418 4.41796959
98 -0.12477213 -0.24461418
99 1.09904056 -0.12477213
100 2.56220409 1.09904056
101 0.01861201 2.56220409
102 4.16802169 0.01861201
103 -1.43700221 4.16802169
104 -1.44827664 -1.43700221
105 -1.50172028 -1.44827664
106 1.37181852 -1.50172028
107 2.47613117 1.37181852
108 2.74556297 2.47613117
109 -2.55228578 2.74556297
110 3.21192507 -2.55228578
111 2.14032241 3.21192507
112 2.14188835 2.14032241
113 -1.83832842 2.14188835
114 0.34725279 -1.83832842
115 -0.12605781 0.34725279
116 -1.58626629 -0.12605781
117 0.13973215 -1.58626629
118 0.95504453 0.13973215
119 -0.81334312 0.95504453
120 -0.13301022 -0.81334312
121 -3.07459204 -0.13301022
122 -1.27113724 -3.07459204
123 -0.48438411 -1.27113724
124 4.80630177 -0.48438411
125 0.27106525 4.80630177
126 1.65103068 0.27106525
127 1.43361967 1.65103068
128 -3.20198276 1.43361967
129 0.21730547 -3.20198276
130 -3.78042504 0.21730547
131 -1.03811714 -3.78042504
132 -4.81404026 -1.03811714
133 -2.45987206 -4.81404026
134 0.92079453 -2.45987206
135 3.97083251 0.92079453
136 -0.76442681 3.97083251
137 -3.53372885 -0.76442681
138 -1.02642859 -3.53372885
139 1.48480268 -1.02642859
140 2.36328541 1.48480268
141 -0.67715159 2.36328541
142 -9.66784188 -0.67715159
143 3.64772802 -9.66784188
144 0.21654883 3.64772802
145 1.77970843 0.21654883
146 2.02453305 1.77970843
147 2.24390236 2.02453305
148 -0.16229369 2.24390236
149 -0.42379910 -0.16229369
150 0.81842029 -0.42379910
151 1.57560765 0.81842029
152 3.79036197 1.57560765
153 2.09293114 3.79036197
154 -0.31930917 2.09293114
155 0.43332024 -0.31930917
156 -2.82514062 0.43332024
157 -0.15702760 -2.82514062
158 2.61905804 -0.15702760
159 0.35293902 2.61905804
160 -1.53429802 0.35293902
161 -0.79812412 -1.53429802
162 NA -0.79812412
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.22394814 1.65398568
[2,] -3.03695772 -1.22394814
[3,] 0.65695269 -3.03695772
[4,] 0.57793661 0.65695269
[5,] 0.53563447 0.57793661
[6,] 4.23930799 0.53563447
[7,] 1.80796150 4.23930799
[8,] 3.67367179 1.80796150
[9,] 1.26449154 3.67367179
[10,] -3.02174098 1.26449154
[11,] -0.80046898 -3.02174098
[12,] -2.14117564 -0.80046898
[13,] 0.99078721 -2.14117564
[14,] -0.92002249 0.99078721
[15,] 1.72481576 -0.92002249
[16,] -3.45766221 1.72481576
[17,] -1.46552051 -3.45766221
[18,] -2.39767518 -1.46552051
[19,] 2.92705145 -2.39767518
[20,] -3.78187459 2.92705145
[21,] 0.39367183 -3.78187459
[22,] -7.07253265 0.39367183
[23,] 1.09353637 -7.07253265
[24,] -2.13854622 1.09353637
[25,] 2.31367468 -2.13854622
[26,] 1.68512062 2.31367468
[27,] 2.47353688 1.68512062
[28,] 3.08386350 2.47353688
[29,] 1.50964486 3.08386350
[30,] -2.02458220 1.50964486
[31,] -0.35318876 -2.02458220
[32,] 2.86494192 -0.35318876
[33,] -2.82665734 2.86494192
[34,] 3.87836895 -2.82665734
[35,] 0.52225968 3.87836895
[36,] 0.74491015 0.52225968
[37,] -1.01631974 0.74491015
[38,] 0.31546308 -1.01631974
[39,] -1.97313817 0.31546308
[40,] -3.48226629 -1.97313817
[41,] 1.96251805 -3.48226629
[42,] -1.40705164 1.96251805
[43,] 0.06646082 -1.40705164
[44,] 3.89116353 0.06646082
[45,] 0.56337045 3.89116353
[46,] -0.61692332 0.56337045
[47,] 7.72349178 -0.61692332
[48,] -1.71542353 7.72349178
[49,] -3.12914689 -1.71542353
[50,] -2.19617397 -3.12914689
[51,] -0.58404125 -2.19617397
[52,] -0.59971246 -0.58404125
[53,] -1.75758961 -0.59971246
[54,] 0.87534591 -1.75758961
[55,] -2.13895214 0.87534591
[56,] -1.86323488 -2.13895214
[57,] 3.40923101 -1.86323488
[58,] -4.04854017 3.40923101
[59,] 1.22686827 -4.04854017
[60,] 5.12335903 1.22686827
[61,] -0.63988679 5.12335903
[62,] -3.66084412 -0.63988679
[63,] 0.81869601 -3.66084412
[64,] -1.99135073 0.81869601
[65,] 0.01934637 -1.99135073
[66,] -1.18207647 0.01934637
[67,] -1.55794501 -1.18207647
[68,] 0.06593014 -1.55794501
[69,] -0.99710483 0.06593014
[70,] -3.98096892 -0.99710483
[71,] -1.11531172 -3.98096892
[72,] 2.71690014 -1.11531172
[73,] 1.78759305 2.71690014
[74,] -0.28943019 1.78759305
[75,] -2.02565205 -0.28943019
[76,] -1.51910393 -2.02565205
[77,] -2.22335169 -1.51910393
[78,] 0.06029253 -2.22335169
[79,] -1.60689767 0.06029253
[80,] 2.04374614 -1.60689767
[81,] 0.38851541 2.04374614
[82,] 2.76204708 0.38851541
[83,] -1.09412753 2.76204708
[84,] -3.56645280 -1.09412753
[85,] 0.17613385 -3.56645280
[86,] 1.61482235 0.17613385
[87,] 2.66597995 1.61482235
[88,] 0.31885860 2.66597995
[89,] -0.80819682 0.31885860
[90,] -1.54071456 -0.80819682
[91,] 2.23548600 -1.54071456
[92,] 2.58278146 2.23548600
[93,] 0.04909079 2.58278146
[94,] -4.11215791 0.04909079
[95,] -1.66680165 -4.11215791
[96,] 4.41796959 -1.66680165
[97,] -0.24461418 4.41796959
[98,] -0.12477213 -0.24461418
[99,] 1.09904056 -0.12477213
[100,] 2.56220409 1.09904056
[101,] 0.01861201 2.56220409
[102,] 4.16802169 0.01861201
[103,] -1.43700221 4.16802169
[104,] -1.44827664 -1.43700221
[105,] -1.50172028 -1.44827664
[106,] 1.37181852 -1.50172028
[107,] 2.47613117 1.37181852
[108,] 2.74556297 2.47613117
[109,] -2.55228578 2.74556297
[110,] 3.21192507 -2.55228578
[111,] 2.14032241 3.21192507
[112,] 2.14188835 2.14032241
[113,] -1.83832842 2.14188835
[114,] 0.34725279 -1.83832842
[115,] -0.12605781 0.34725279
[116,] -1.58626629 -0.12605781
[117,] 0.13973215 -1.58626629
[118,] 0.95504453 0.13973215
[119,] -0.81334312 0.95504453
[120,] -0.13301022 -0.81334312
[121,] -3.07459204 -0.13301022
[122,] -1.27113724 -3.07459204
[123,] -0.48438411 -1.27113724
[124,] 4.80630177 -0.48438411
[125,] 0.27106525 4.80630177
[126,] 1.65103068 0.27106525
[127,] 1.43361967 1.65103068
[128,] -3.20198276 1.43361967
[129,] 0.21730547 -3.20198276
[130,] -3.78042504 0.21730547
[131,] -1.03811714 -3.78042504
[132,] -4.81404026 -1.03811714
[133,] -2.45987206 -4.81404026
[134,] 0.92079453 -2.45987206
[135,] 3.97083251 0.92079453
[136,] -0.76442681 3.97083251
[137,] -3.53372885 -0.76442681
[138,] -1.02642859 -3.53372885
[139,] 1.48480268 -1.02642859
[140,] 2.36328541 1.48480268
[141,] -0.67715159 2.36328541
[142,] -9.66784188 -0.67715159
[143,] 3.64772802 -9.66784188
[144,] 0.21654883 3.64772802
[145,] 1.77970843 0.21654883
[146,] 2.02453305 1.77970843
[147,] 2.24390236 2.02453305
[148,] -0.16229369 2.24390236
[149,] -0.42379910 -0.16229369
[150,] 0.81842029 -0.42379910
[151,] 1.57560765 0.81842029
[152,] 3.79036197 1.57560765
[153,] 2.09293114 3.79036197
[154,] -0.31930917 2.09293114
[155,] 0.43332024 -0.31930917
[156,] -2.82514062 0.43332024
[157,] -0.15702760 -2.82514062
[158,] 2.61905804 -0.15702760
[159,] 0.35293902 2.61905804
[160,] -1.53429802 0.35293902
[161,] -0.79812412 -1.53429802
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.22394814 1.65398568
2 -3.03695772 -1.22394814
3 0.65695269 -3.03695772
4 0.57793661 0.65695269
5 0.53563447 0.57793661
6 4.23930799 0.53563447
7 1.80796150 4.23930799
8 3.67367179 1.80796150
9 1.26449154 3.67367179
10 -3.02174098 1.26449154
11 -0.80046898 -3.02174098
12 -2.14117564 -0.80046898
13 0.99078721 -2.14117564
14 -0.92002249 0.99078721
15 1.72481576 -0.92002249
16 -3.45766221 1.72481576
17 -1.46552051 -3.45766221
18 -2.39767518 -1.46552051
19 2.92705145 -2.39767518
20 -3.78187459 2.92705145
21 0.39367183 -3.78187459
22 -7.07253265 0.39367183
23 1.09353637 -7.07253265
24 -2.13854622 1.09353637
25 2.31367468 -2.13854622
26 1.68512062 2.31367468
27 2.47353688 1.68512062
28 3.08386350 2.47353688
29 1.50964486 3.08386350
30 -2.02458220 1.50964486
31 -0.35318876 -2.02458220
32 2.86494192 -0.35318876
33 -2.82665734 2.86494192
34 3.87836895 -2.82665734
35 0.52225968 3.87836895
36 0.74491015 0.52225968
37 -1.01631974 0.74491015
38 0.31546308 -1.01631974
39 -1.97313817 0.31546308
40 -3.48226629 -1.97313817
41 1.96251805 -3.48226629
42 -1.40705164 1.96251805
43 0.06646082 -1.40705164
44 3.89116353 0.06646082
45 0.56337045 3.89116353
46 -0.61692332 0.56337045
47 7.72349178 -0.61692332
48 -1.71542353 7.72349178
49 -3.12914689 -1.71542353
50 -2.19617397 -3.12914689
51 -0.58404125 -2.19617397
52 -0.59971246 -0.58404125
53 -1.75758961 -0.59971246
54 0.87534591 -1.75758961
55 -2.13895214 0.87534591
56 -1.86323488 -2.13895214
57 3.40923101 -1.86323488
58 -4.04854017 3.40923101
59 1.22686827 -4.04854017
60 5.12335903 1.22686827
61 -0.63988679 5.12335903
62 -3.66084412 -0.63988679
63 0.81869601 -3.66084412
64 -1.99135073 0.81869601
65 0.01934637 -1.99135073
66 -1.18207647 0.01934637
67 -1.55794501 -1.18207647
68 0.06593014 -1.55794501
69 -0.99710483 0.06593014
70 -3.98096892 -0.99710483
71 -1.11531172 -3.98096892
72 2.71690014 -1.11531172
73 1.78759305 2.71690014
74 -0.28943019 1.78759305
75 -2.02565205 -0.28943019
76 -1.51910393 -2.02565205
77 -2.22335169 -1.51910393
78 0.06029253 -2.22335169
79 -1.60689767 0.06029253
80 2.04374614 -1.60689767
81 0.38851541 2.04374614
82 2.76204708 0.38851541
83 -1.09412753 2.76204708
84 -3.56645280 -1.09412753
85 0.17613385 -3.56645280
86 1.61482235 0.17613385
87 2.66597995 1.61482235
88 0.31885860 2.66597995
89 -0.80819682 0.31885860
90 -1.54071456 -0.80819682
91 2.23548600 -1.54071456
92 2.58278146 2.23548600
93 0.04909079 2.58278146
94 -4.11215791 0.04909079
95 -1.66680165 -4.11215791
96 4.41796959 -1.66680165
97 -0.24461418 4.41796959
98 -0.12477213 -0.24461418
99 1.09904056 -0.12477213
100 2.56220409 1.09904056
101 0.01861201 2.56220409
102 4.16802169 0.01861201
103 -1.43700221 4.16802169
104 -1.44827664 -1.43700221
105 -1.50172028 -1.44827664
106 1.37181852 -1.50172028
107 2.47613117 1.37181852
108 2.74556297 2.47613117
109 -2.55228578 2.74556297
110 3.21192507 -2.55228578
111 2.14032241 3.21192507
112 2.14188835 2.14032241
113 -1.83832842 2.14188835
114 0.34725279 -1.83832842
115 -0.12605781 0.34725279
116 -1.58626629 -0.12605781
117 0.13973215 -1.58626629
118 0.95504453 0.13973215
119 -0.81334312 0.95504453
120 -0.13301022 -0.81334312
121 -3.07459204 -0.13301022
122 -1.27113724 -3.07459204
123 -0.48438411 -1.27113724
124 4.80630177 -0.48438411
125 0.27106525 4.80630177
126 1.65103068 0.27106525
127 1.43361967 1.65103068
128 -3.20198276 1.43361967
129 0.21730547 -3.20198276
130 -3.78042504 0.21730547
131 -1.03811714 -3.78042504
132 -4.81404026 -1.03811714
133 -2.45987206 -4.81404026
134 0.92079453 -2.45987206
135 3.97083251 0.92079453
136 -0.76442681 3.97083251
137 -3.53372885 -0.76442681
138 -1.02642859 -3.53372885
139 1.48480268 -1.02642859
140 2.36328541 1.48480268
141 -0.67715159 2.36328541
142 -9.66784188 -0.67715159
143 3.64772802 -9.66784188
144 0.21654883 3.64772802
145 1.77970843 0.21654883
146 2.02453305 1.77970843
147 2.24390236 2.02453305
148 -0.16229369 2.24390236
149 -0.42379910 -0.16229369
150 0.81842029 -0.42379910
151 1.57560765 0.81842029
152 3.79036197 1.57560765
153 2.09293114 3.79036197
154 -0.31930917 2.09293114
155 0.43332024 -0.31930917
156 -2.82514062 0.43332024
157 -0.15702760 -2.82514062
158 2.61905804 -0.15702760
159 0.35293902 2.61905804
160 -1.53429802 0.35293902
161 -0.79812412 -1.53429802
> 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/7obz61353336744.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/806hc1353336744.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/9vlhz1353336744.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/10xyta1353336744.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/11adrs1353336744.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/12zno01353336744.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/139qk11353336744.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/14ok691353336744.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/15dwp11353336744.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/162zt21353336745.tab")
+ }
>
> try(system("convert tmp/1ijf51353336744.ps tmp/1ijf51353336744.png",intern=TRUE))
character(0)
> try(system("convert tmp/23jfr1353336744.ps tmp/23jfr1353336744.png",intern=TRUE))
character(0)
> try(system("convert tmp/3upix1353336744.ps tmp/3upix1353336744.png",intern=TRUE))
character(0)
> try(system("convert tmp/4w2it1353336744.ps tmp/4w2it1353336744.png",intern=TRUE))
character(0)
> try(system("convert tmp/5v4111353336744.ps tmp/5v4111353336744.png",intern=TRUE))
character(0)
> try(system("convert tmp/6tsea1353336744.ps tmp/6tsea1353336744.png",intern=TRUE))
character(0)
> try(system("convert tmp/7obz61353336744.ps tmp/7obz61353336744.png",intern=TRUE))
character(0)
> try(system("convert tmp/806hc1353336744.ps tmp/806hc1353336744.png",intern=TRUE))
character(0)
> try(system("convert tmp/9vlhz1353336744.ps tmp/9vlhz1353336744.png",intern=TRUE))
character(0)
> try(system("convert tmp/10xyta1353336744.ps tmp/10xyta1353336744.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.434 1.188 9.768