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(26
+ ,21
+ ,21
+ ,23
+ ,17
+ ,23
+ ,4
+ ,14
+ ,12
+ ,20
+ ,16
+ ,15
+ ,24
+ ,17
+ ,20
+ ,4
+ ,18
+ ,11
+ ,19
+ ,19
+ ,18
+ ,22
+ ,18
+ ,20
+ ,6
+ ,11
+ ,14
+ ,19
+ ,18
+ ,11
+ ,20
+ ,21
+ ,21
+ ,8
+ ,12
+ ,12
+ ,20
+ ,16
+ ,8
+ ,24
+ ,20
+ ,24
+ ,8
+ ,16
+ ,21
+ ,25
+ ,23
+ ,19
+ ,27
+ ,28
+ ,22
+ ,4
+ ,18
+ ,12
+ ,25
+ ,17
+ ,4
+ ,28
+ ,19
+ ,23
+ ,4
+ ,14
+ ,22
+ ,22
+ ,12
+ ,20
+ ,27
+ ,22
+ ,20
+ ,8
+ ,14
+ ,11
+ ,26
+ ,19
+ ,16
+ ,24
+ ,16
+ ,25
+ ,5
+ ,15
+ ,10
+ ,22
+ ,16
+ ,14
+ ,23
+ ,18
+ ,23
+ ,4
+ ,15
+ ,13
+ ,17
+ ,19
+ ,10
+ ,24
+ ,25
+ ,27
+ ,4
+ ,17
+ ,10
+ ,22
+ ,20
+ ,13
+ ,27
+ ,17
+ ,27
+ ,4
+ ,19
+ ,8
+ ,19
+ ,13
+ ,14
+ ,27
+ ,14
+ ,22
+ ,4
+ ,10
+ ,15
+ ,24
+ ,20
+ ,8
+ ,28
+ ,11
+ ,24
+ ,4
+ ,16
+ ,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])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> 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 I2 I3 E1 E2 E3 A Happiness Depression\r t
1 26 21 21 23 17 23 4 14 12 1
2 20 16 15 24 17 20 4 18 11 2
3 19 19 18 22 18 20 6 11 14 3
4 19 18 11 20 21 21 8 12 12 4
5 20 16 8 24 20 24 8 16 21 5
6 25 23 19 27 28 22 4 18 12 6
7 25 17 4 28 19 23 4 14 22 7
8 22 12 20 27 22 20 8 14 11 8
9 26 19 16 24 16 25 5 15 10 9
10 22 16 14 23 18 23 4 15 13 10
11 17 19 10 24 25 27 4 17 10 11
12 22 20 13 27 17 27 4 19 8 12
13 19 13 14 27 14 22 4 10 15 13
14 24 20 8 28 11 24 4 16 14 14
15 26 27 23 27 27 25 4 18 10 15
16 21 17 11 23 20 22 8 14 14 16
17 13 8 9 24 22 28 4 14 14 17
18 26 25 24 28 22 28 4 17 11 18
19 20 26 5 27 21 27 4 14 10 19
20 22 13 15 25 23 25 8 16 13 20
21 14 19 5 19 17 16 4 18 7 21
22 21 15 19 24 24 28 7 11 14 22
23 7 5 6 20 14 21 4 14 12 23
24 23 16 13 28 17 24 4 12 14 24
25 17 14 11 26 23 27 5 17 11 25
26 25 24 17 23 24 14 4 9 9 26
27 25 24 17 23 24 14 4 16 11 27
28 19 9 5 20 8 27 4 14 15 28
29 20 19 9 11 22 20 4 15 14 29
30 23 19 15 24 23 21 4 11 13 30
31 22 25 17 25 25 22 4 16 9 31
32 22 19 17 23 21 21 4 13 15 32
33 21 18 20 18 24 12 15 17 10 33
34 15 15 12 20 15 20 10 15 11 34
35 20 12 7 20 22 24 4 14 13 35
36 22 21 16 24 21 19 8 16 8 36
37 18 12 7 23 25 28 4 9 20 37
38 20 15 14 25 16 23 4 15 12 38
39 28 28 24 28 28 27 4 17 10 39
40 22 25 15 26 23 22 4 13 10 40
41 18 19 15 26 21 27 7 15 9 41
42 23 20 10 23 21 26 4 16 14 42
43 20 24 14 22 26 22 6 16 8 43
44 25 26 18 24 22 21 5 12 14 44
45 26 25 12 21 21 19 4 12 11 45
46 15 12 9 20 18 24 16 11 13 46
47 17 12 9 22 12 19 5 15 9 47
48 23 15 8 20 25 26 12 15 11 48
49 21 17 18 25 17 22 6 17 15 49
50 13 14 10 20 24 28 9 13 11 50
51 18 16 17 22 15 21 9 16 10 51
52 19 11 14 23 13 23 4 14 14 52
53 22 20 16 25 26 28 5 11 18 53
54 16 11 10 23 16 10 4 12 14 54
55 24 22 19 23 24 24 4 12 11 55
56 18 20 10 22 21 21 5 15 12 56
57 20 19 14 24 20 21 4 16 13 57
58 24 17 10 25 14 24 4 15 9 58
59 14 21 4 21 25 24 4 12 10 59
60 22 23 19 12 25 25 5 12 15 60
61 24 18 9 17 20 25 4 8 20 61
62 18 17 12 20 22 23 6 13 12 62
63 21 27 16 23 20 21 4 11 12 63
64 23 25 11 23 26 16 4 14 14 64
65 17 19 18 20 18 17 18 15 13 65
66 22 22 11 28 22 25 4 10 11 66
67 24 24 24 24 24 24 6 11 17 67
68 21 20 17 24 17 23 4 12 12 68
69 22 19 18 24 24 25 4 15 13 69
70 16 11 9 24 20 23 5 15 14 70
71 21 22 19 28 19 28 4 14 13 71
72 23 22 18 25 20 26 4 16 15 72
73 22 16 12 21 15 22 5 15 13 73
74 24 20 23 25 23 19 10 15 10 74
75 24 24 22 25 26 26 5 13 11 75
76 16 16 14 18 22 18 8 12 19 76
77 16 16 14 17 20 18 8 17 13 77
78 21 22 16 26 24 25 5 13 17 78
79 26 24 23 28 26 27 4 15 13 79
80 15 16 7 21 21 12 4 13 9 80
81 25 27 10 27 25 15 4 15 11 81
82 18 11 12 22 13 21 5 16 10 82
83 23 21 12 21 20 23 4 15 9 83
84 20 20 12 25 22 22 4 16 12 84
85 17 20 17 22 23 21 8 15 12 85
86 25 27 21 23 28 24 4 14 13 86
87 24 20 16 26 22 27 5 15 13 87
88 17 12 11 19 20 22 14 14 12 88
89 19 8 14 25 6 28 8 13 15 89
90 20 21 13 21 21 26 8 7 22 90
91 15 18 9 13 20 10 4 17 13 91
92 27 24 19 24 18 19 4 13 15 92
93 22 16 13 25 23 22 6 15 13 93
94 23 18 19 26 20 21 4 14 15 94
95 16 20 13 25 24 24 7 13 10 95
96 19 20 13 25 22 25 7 16 11 96
97 25 19 13 22 21 21 4 12 16 97
98 19 17 14 21 18 20 6 14 11 98
99 19 16 12 23 21 21 4 17 11 99
100 26 26 22 25 23 24 7 15 10 100
101 21 15 11 24 23 23 4 17 10 101
102 20 22 5 21 15 18 4 12 16 102
103 24 17 18 21 21 24 8 16 12 103
104 22 23 19 25 24 24 4 11 11 104
105 20 21 14 22 23 19 4 15 16 105
106 18 19 15 20 21 20 10 9 19 106
107 18 14 12 20 21 18 8 16 11 107
108 24 17 19 23 20 20 6 15 16 108
109 24 12 15 28 11 27 4 10 15 109
110 22 24 17 23 22 23 4 10 24 110
111 23 18 8 28 27 26 4 15 14 111
112 22 20 10 24 25 23 5 11 15 112
113 20 16 12 18 18 17 4 13 11 113
114 18 20 12 20 20 21 6 14 15 114
115 25 22 20 28 24 25 4 18 12 115
116 18 12 12 21 10 23 5 16 10 116
117 16 16 12 21 27 27 7 14 14 117
118 20 17 14 25 21 24 8 14 13 118
119 19 22 6 19 21 20 5 14 9 119
120 15 12 10 18 18 27 8 14 15 120
121 19 14 18 21 15 21 10 12 15 121
122 19 23 18 22 24 24 8 14 14 122
123 16 15 7 24 22 21 5 15 11 123
124 17 17 18 15 14 15 12 15 8 124
125 28 28 9 28 28 25 4 15 11 125
126 23 20 17 26 18 25 5 13 11 126
127 25 23 22 23 26 22 4 17 8 127
128 20 13 11 26 17 24 6 17 10 128
129 17 18 15 20 19 21 4 19 11 129
130 23 23 17 22 22 22 4 15 13 130
131 16 19 15 20 18 23 7 13 11 131
132 23 23 22 23 24 22 7 9 20 132
133 11 12 9 22 15 20 10 15 10 133
134 18 16 13 24 18 23 4 15 15 134
135 24 23 20 23 26 25 5 15 12 135
136 23 13 14 22 11 23 8 16 14 136
137 21 22 14 26 26 22 11 11 23 137
138 16 18 12 23 21 25 7 14 14 138
139 24 23 20 27 23 26 4 11 16 139
140 23 20 20 23 23 22 8 15 11 140
141 18 10 8 21 15 24 6 13 12 141
142 20 17 17 26 22 24 7 15 10 142
143 9 18 9 23 26 25 5 16 14 143
144 24 15 18 21 16 20 4 14 12 144
145 25 23 22 27 20 26 8 15 12 145
146 20 17 10 19 18 21 4 16 11 146
147 21 17 13 23 22 26 8 16 12 147
148 25 22 15 25 16 21 6 11 13 148
149 22 20 18 23 19 22 4 12 11 149
150 21 20 18 22 20 16 9 9 19 150
151 21 19 12 22 19 26 5 16 12 151
152 22 18 12 25 23 28 6 13 17 152
153 27 22 20 25 24 18 4 16 9 153
154 24 20 12 28 25 25 4 12 12 154
155 24 22 16 28 21 23 4 9 19 155
156 21 18 16 20 21 21 5 13 18 156
157 18 16 18 25 23 20 6 13 15 157
158 16 16 16 19 27 25 16 14 14 158
159 22 16 13 25 23 22 6 19 11 159
160 20 16 17 22 18 21 6 13 9 160
161 18 17 13 18 16 16 4 12 18 161
162 20 18 17 20 16 18 4 13 16 162
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) I2 I3 E1
5.361343 0.366963 0.255827 0.264182
E2 E3 A Happiness
-0.119733 0.026078 -0.207942 0.044920
`Depression\\r` t
0.116248 -0.003547
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-9.6834 -1.6012 -0.1357 1.7052 7.8323
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.361343 2.884834 1.858 0.06504 .
I2 0.366963 0.063539 5.775 4.19e-08 ***
I3 0.255827 0.050628 5.053 1.23e-06 ***
E1 0.264182 0.075272 3.510 0.00059 ***
E2 -0.119733 0.059044 -2.028 0.04432 *
E3 0.026078 0.061678 0.423 0.67303
A -0.207942 0.084223 -2.469 0.01466 *
Happiness 0.044920 0.101712 0.442 0.65937
`Depression\\r` 0.116248 0.075645 1.537 0.12643
t -0.003547 0.004310 -0.823 0.41181
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.5 on 152 degrees of freedom
Multiple R-squared: 0.5588, Adjusted R-squared: 0.5326
F-statistic: 21.39 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.94996868 0.10006264 0.05003132
[2,] 0.90238225 0.19523550 0.09761775
[3,] 0.83396197 0.33207606 0.16603803
[4,] 0.78771888 0.42456224 0.21228112
[5,] 0.71552803 0.56894393 0.28447197
[6,] 0.63632944 0.72734111 0.36367056
[7,] 0.56663836 0.86672328 0.43336164
[8,] 0.55960357 0.88079285 0.44039643
[9,] 0.49656333 0.99312667 0.50343667
[10,] 0.42112409 0.84224818 0.57887591
[11,] 0.50552875 0.98894251 0.49447125
[12,] 0.48201132 0.96402263 0.51798868
[13,] 0.41169353 0.82338706 0.58830647
[14,] 0.48889408 0.97778816 0.51110592
[15,] 0.43000678 0.86001356 0.56999322
[16,] 0.58529484 0.82941033 0.41470516
[17,] 0.59844999 0.80310002 0.40155001
[18,] 0.53845870 0.92308259 0.46154130
[19,] 0.53646447 0.92707106 0.46353553
[20,] 0.51956057 0.96087885 0.48043943
[21,] 0.49993639 0.99987279 0.50006361
[22,] 0.57210138 0.85579724 0.42789862
[23,] 0.71318385 0.57363230 0.28681615
[24,] 0.66282722 0.67434556 0.33717278
[25,] 0.61557981 0.76884039 0.38442019
[26,] 0.56214807 0.87570386 0.43785193
[27,] 0.50576202 0.98847596 0.49423798
[28,] 0.48135139 0.96270278 0.51864861
[29,] 0.48612650 0.97225300 0.51387350
[30,] 0.45477983 0.90955966 0.54522017
[31,] 0.40647065 0.81294129 0.59352935
[32,] 0.37586696 0.75173393 0.62413304
[33,] 0.43584328 0.87168656 0.56415672
[34,] 0.38396269 0.76792537 0.61603731
[35,] 0.33907514 0.67815028 0.66092486
[36,] 0.75634703 0.48730594 0.24365297
[37,] 0.75143618 0.49712764 0.24856382
[38,] 0.77907857 0.44184285 0.22092143
[39,] 0.75917976 0.48164049 0.24082024
[40,] 0.71903126 0.56193749 0.28096874
[41,] 0.69746689 0.60506622 0.30253311
[42,] 0.66366523 0.67266953 0.33633477
[43,] 0.62658601 0.74682798 0.37341399
[44,] 0.60826481 0.78347038 0.39173519
[45,] 0.57335965 0.85328070 0.42664035
[46,] 0.69663713 0.60672574 0.30336287
[47,] 0.74281507 0.51436987 0.25718493
[48,] 0.71834665 0.56330670 0.28165335
[49,] 0.82881348 0.34237305 0.17118652
[50,] 0.79762569 0.40474862 0.20237431
[51,] 0.83599907 0.32800186 0.16400093
[52,] 0.81073341 0.37853317 0.18926659
[53,] 0.82427821 0.35144358 0.17572179
[54,] 0.79436434 0.41127132 0.20563566
[55,] 0.77925503 0.44148994 0.22074497
[56,] 0.75508441 0.48983119 0.24491559
[57,] 0.71703175 0.56593650 0.28296825
[58,] 0.67879638 0.64240725 0.32120362
[59,] 0.73916337 0.52167327 0.26083663
[60,] 0.70677708 0.58644584 0.29322292
[61,] 0.72481237 0.55037527 0.27518763
[62,] 0.71135138 0.57729724 0.28864862
[63,] 0.67162445 0.65675111 0.32837555
[64,] 0.67976365 0.64047269 0.32023635
[65,] 0.64772976 0.70454048 0.35227024
[66,] 0.63788783 0.72422433 0.36211217
[67,] 0.60180138 0.79639724 0.39819862
[68,] 0.58026627 0.83946745 0.41973373
[69,] 0.56356306 0.87287389 0.43643694
[70,] 0.53826642 0.92346716 0.46173358
[71,] 0.55684206 0.88631589 0.44315794
[72,] 0.52406689 0.95186623 0.47593311
[73,] 0.57745345 0.84509310 0.42254655
[74,] 0.53060461 0.93879079 0.46939539
[75,] 0.50765463 0.98469075 0.49234537
[76,] 0.52464162 0.95071676 0.47535838
[77,] 0.48487209 0.96974418 0.51512791
[78,] 0.45868767 0.91737534 0.54131233
[79,] 0.42426221 0.84852442 0.57573779
[80,] 0.40817117 0.81634234 0.59182883
[81,] 0.40995803 0.81991605 0.59004197
[82,] 0.36967420 0.73934839 0.63032580
[83,] 0.46766266 0.93532533 0.53233734
[84,] 0.45256520 0.90513040 0.54743480
[85,] 0.55791427 0.88417146 0.44208573
[86,] 0.51326324 0.97347352 0.48673676
[87,] 0.47195221 0.94390443 0.52804779
[88,] 0.43105261 0.86210523 0.56894739
[89,] 0.42636689 0.85273378 0.57363311
[90,] 0.37940713 0.75881426 0.62059287
[91,] 0.47561545 0.95123091 0.52438455
[92,] 0.46325701 0.92651402 0.53674299
[93,] 0.42853352 0.85706703 0.57146648
[94,] 0.39490488 0.78980976 0.60509512
[95,] 0.36176290 0.72352581 0.63823710
[96,] 0.37365806 0.74731611 0.62634194
[97,] 0.36269995 0.72539990 0.63730005
[98,] 0.34454384 0.68908768 0.65545616
[99,] 0.37530202 0.75060404 0.62469798
[100,] 0.38065793 0.76131587 0.61934207
[101,] 0.40517997 0.81035995 0.59482003
[102,] 0.36623624 0.73247247 0.63376376
[103,] 0.31735902 0.63471803 0.68264098
[104,] 0.27092310 0.54184620 0.72907690
[105,] 0.24277976 0.48555951 0.75722024
[106,] 0.20560125 0.41120251 0.79439875
[107,] 0.18184579 0.36369159 0.81815421
[108,] 0.17215627 0.34431253 0.82784373
[109,] 0.14941526 0.29883052 0.85058474
[110,] 0.14174998 0.28349995 0.85825002
[111,] 0.11510872 0.23021744 0.88489128
[112,] 0.08952450 0.17904901 0.91047550
[113,] 0.19501862 0.39003724 0.80498138
[114,] 0.15697346 0.31394691 0.84302654
[115,] 0.14649431 0.29298861 0.85350569
[116,] 0.12900515 0.25801029 0.87099485
[117,] 0.12158687 0.24317374 0.87841313
[118,] 0.10167597 0.20335195 0.89832403
[119,] 0.11011218 0.22022436 0.88988782
[120,] 0.08459979 0.16919959 0.91540021
[121,] 0.17477619 0.34955238 0.82522381
[122,] 0.16244852 0.32489704 0.83755148
[123,] 0.15925155 0.31850310 0.84074845
[124,] 0.13745589 0.27491178 0.86254411
[125,] 0.13364395 0.26728791 0.86635605
[126,] 0.13139582 0.26279165 0.86860418
[127,] 0.09509923 0.19019845 0.90490077
[128,] 0.07646856 0.15293712 0.92353144
[129,] 0.05833970 0.11667940 0.94166030
[130,] 0.04243958 0.08487916 0.95756042
[131,] 0.92731058 0.14537883 0.07268942
[132,] 0.98841269 0.02317463 0.01158731
[133,] 0.97930996 0.04138007 0.02069004
[134,] 0.95548969 0.08902061 0.04451031
[135,] 0.91081326 0.17837348 0.08918674
[136,] 0.83914239 0.32171521 0.16085761
[137,] 0.71732718 0.56534565 0.28267282
> postscript(file="/var/wessaorg/rcomp/tmp/1b6wp1353168443.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/2trb81353168443.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/3vk731353168443.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/44q3m1353168443.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/5d7cg1353168443.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.730998110 -1.145059094 -2.980202527 0.646039145 0.670382427 0.633190486
7 8 9 10 11 12
4.325261610 1.882512910 3.731884921 1.347091261 -2.998406194 -0.737052394
13 14 15 16 17 18
-2.058851828 1.082104157 -0.791512435 1.794877830 -3.400208853 -1.315178029
19 20 21 22 23 24
-2.396350353 3.032620489 -3.730065367 0.488573162 -6.996644349 1.204374421
25 26 27 28 29 30
-2.045888079 2.388279499 1.844888232 2.585457370 3.203835582 1.627642581
31 32 33 34 35 36
-1.892645316 -0.174536401 3.032231825 -2.697420539 3.984734276 0.660274958
37 38 39 40 41 42
0.865032147 -0.838198287 0.519150720 -1.834199556 -3.348494686 2.135857834
43 44 45 46 47 48
-1.271221714 0.268125988 4.039368358 0.663242181 -0.451633504 7.832291847
49 50 51 52 53 54
-1.433299285 -3.011179153 -1.974267096 -0.339092129 -0.374386730 -1.520635635
55 56 57 58 59 60
1.085388412 -1.934546037 -1.604549514 3.605332157 -3.931714100 1.478766744
61 62 63 64 65 66
5.346321496 -0.430302461 -3.425591539 1.072544596 -1.721787535 -0.325588667
67 68 69 70 71 72
-1.385968408 -1.815395621 -0.165749100 -1.259136596 -4.204075048 -1.302603508
73 74 75 76 77 78
2.485419162 1.574845618 -0.523102065 -2.219506751 -1.718354531 -2.418632073
79 80 81 82 83 84
-0.113642411 -1.884546617 1.808193950 0.178417249 2.515713376 -1.298625296
85 86 87 88 89 90
-3.759164817 0.005483032 1.430751917 2.421986847 0.156610850 -0.993878743
91 92 93 94 95 96
-1.689900046 2.120617113 2.409616836 -0.056484555 -4.337036702 -1.850041871
97 98 99 100 101 102
4.272207052 -0.407798091 -0.271524088 0.966908502 2.397735779 -0.140310973
103 104 105 106 107 108
4.051313358 -1.591194127 -1.532305741 -1.619406888 1.238251757 2.433482630
109 110 111 112 113 114
2.639067135 -2.576549893 3.068616574 1.993456659 2.023845466 -1.927699466
115 116 117 118 119 120
0.309649811 -0.215105617 -1.707536828 0.044696317 0.790611368 -0.910742413
121 122 123 124 125 126
-0.177283376 -3.130704198 -1.386955570 -0.550840794 4.687378362 0.208838114
127 128 129 130 131 132
1.622125064 1.370489869 -3.203267670 0.205751380 -3.841675831 -1.011392613
133 134 135 136 137 138
-4.889971187 -2.453879313 0.916713172 3.991611387 -0.739975174 -3.561570033
139 140 141 142 143 144
-1.004354904 1.494451975 2.313604624 -0.686212559 -9.683415311 3.694404876
145 146 147 148 149 150
0.263160075 1.782345269 2.025746044 2.258924574 -0.137906999 -0.349489126
151 152 153 154 155 156
0.842992997 1.609193910 3.858130529 2.617793564 -0.241642961 0.539877769
157 158 159 160 161 162
-2.732980610 -0.133397019 2.696562471 0.398782404 -1.410872377 -1.190538627
> postscript(file="/var/wessaorg/rcomp/tmp/61vf51353168443.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.730998110 NA
1 -1.145059094 1.730998110
2 -2.980202527 -1.145059094
3 0.646039145 -2.980202527
4 0.670382427 0.646039145
5 0.633190486 0.670382427
6 4.325261610 0.633190486
7 1.882512910 4.325261610
8 3.731884921 1.882512910
9 1.347091261 3.731884921
10 -2.998406194 1.347091261
11 -0.737052394 -2.998406194
12 -2.058851828 -0.737052394
13 1.082104157 -2.058851828
14 -0.791512435 1.082104157
15 1.794877830 -0.791512435
16 -3.400208853 1.794877830
17 -1.315178029 -3.400208853
18 -2.396350353 -1.315178029
19 3.032620489 -2.396350353
20 -3.730065367 3.032620489
21 0.488573162 -3.730065367
22 -6.996644349 0.488573162
23 1.204374421 -6.996644349
24 -2.045888079 1.204374421
25 2.388279499 -2.045888079
26 1.844888232 2.388279499
27 2.585457370 1.844888232
28 3.203835582 2.585457370
29 1.627642581 3.203835582
30 -1.892645316 1.627642581
31 -0.174536401 -1.892645316
32 3.032231825 -0.174536401
33 -2.697420539 3.032231825
34 3.984734276 -2.697420539
35 0.660274958 3.984734276
36 0.865032147 0.660274958
37 -0.838198287 0.865032147
38 0.519150720 -0.838198287
39 -1.834199556 0.519150720
40 -3.348494686 -1.834199556
41 2.135857834 -3.348494686
42 -1.271221714 2.135857834
43 0.268125988 -1.271221714
44 4.039368358 0.268125988
45 0.663242181 4.039368358
46 -0.451633504 0.663242181
47 7.832291847 -0.451633504
48 -1.433299285 7.832291847
49 -3.011179153 -1.433299285
50 -1.974267096 -3.011179153
51 -0.339092129 -1.974267096
52 -0.374386730 -0.339092129
53 -1.520635635 -0.374386730
54 1.085388412 -1.520635635
55 -1.934546037 1.085388412
56 -1.604549514 -1.934546037
57 3.605332157 -1.604549514
58 -3.931714100 3.605332157
59 1.478766744 -3.931714100
60 5.346321496 1.478766744
61 -0.430302461 5.346321496
62 -3.425591539 -0.430302461
63 1.072544596 -3.425591539
64 -1.721787535 1.072544596
65 -0.325588667 -1.721787535
66 -1.385968408 -0.325588667
67 -1.815395621 -1.385968408
68 -0.165749100 -1.815395621
69 -1.259136596 -0.165749100
70 -4.204075048 -1.259136596
71 -1.302603508 -4.204075048
72 2.485419162 -1.302603508
73 1.574845618 2.485419162
74 -0.523102065 1.574845618
75 -2.219506751 -0.523102065
76 -1.718354531 -2.219506751
77 -2.418632073 -1.718354531
78 -0.113642411 -2.418632073
79 -1.884546617 -0.113642411
80 1.808193950 -1.884546617
81 0.178417249 1.808193950
82 2.515713376 0.178417249
83 -1.298625296 2.515713376
84 -3.759164817 -1.298625296
85 0.005483032 -3.759164817
86 1.430751917 0.005483032
87 2.421986847 1.430751917
88 0.156610850 2.421986847
89 -0.993878743 0.156610850
90 -1.689900046 -0.993878743
91 2.120617113 -1.689900046
92 2.409616836 2.120617113
93 -0.056484555 2.409616836
94 -4.337036702 -0.056484555
95 -1.850041871 -4.337036702
96 4.272207052 -1.850041871
97 -0.407798091 4.272207052
98 -0.271524088 -0.407798091
99 0.966908502 -0.271524088
100 2.397735779 0.966908502
101 -0.140310973 2.397735779
102 4.051313358 -0.140310973
103 -1.591194127 4.051313358
104 -1.532305741 -1.591194127
105 -1.619406888 -1.532305741
106 1.238251757 -1.619406888
107 2.433482630 1.238251757
108 2.639067135 2.433482630
109 -2.576549893 2.639067135
110 3.068616574 -2.576549893
111 1.993456659 3.068616574
112 2.023845466 1.993456659
113 -1.927699466 2.023845466
114 0.309649811 -1.927699466
115 -0.215105617 0.309649811
116 -1.707536828 -0.215105617
117 0.044696317 -1.707536828
118 0.790611368 0.044696317
119 -0.910742413 0.790611368
120 -0.177283376 -0.910742413
121 -3.130704198 -0.177283376
122 -1.386955570 -3.130704198
123 -0.550840794 -1.386955570
124 4.687378362 -0.550840794
125 0.208838114 4.687378362
126 1.622125064 0.208838114
127 1.370489869 1.622125064
128 -3.203267670 1.370489869
129 0.205751380 -3.203267670
130 -3.841675831 0.205751380
131 -1.011392613 -3.841675831
132 -4.889971187 -1.011392613
133 -2.453879313 -4.889971187
134 0.916713172 -2.453879313
135 3.991611387 0.916713172
136 -0.739975174 3.991611387
137 -3.561570033 -0.739975174
138 -1.004354904 -3.561570033
139 1.494451975 -1.004354904
140 2.313604624 1.494451975
141 -0.686212559 2.313604624
142 -9.683415311 -0.686212559
143 3.694404876 -9.683415311
144 0.263160075 3.694404876
145 1.782345269 0.263160075
146 2.025746044 1.782345269
147 2.258924574 2.025746044
148 -0.137906999 2.258924574
149 -0.349489126 -0.137906999
150 0.842992997 -0.349489126
151 1.609193910 0.842992997
152 3.858130529 1.609193910
153 2.617793564 3.858130529
154 -0.241642961 2.617793564
155 0.539877769 -0.241642961
156 -2.732980610 0.539877769
157 -0.133397019 -2.732980610
158 2.696562471 -0.133397019
159 0.398782404 2.696562471
160 -1.410872377 0.398782404
161 -1.190538627 -1.410872377
162 NA -1.190538627
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.145059094 1.730998110
[2,] -2.980202527 -1.145059094
[3,] 0.646039145 -2.980202527
[4,] 0.670382427 0.646039145
[5,] 0.633190486 0.670382427
[6,] 4.325261610 0.633190486
[7,] 1.882512910 4.325261610
[8,] 3.731884921 1.882512910
[9,] 1.347091261 3.731884921
[10,] -2.998406194 1.347091261
[11,] -0.737052394 -2.998406194
[12,] -2.058851828 -0.737052394
[13,] 1.082104157 -2.058851828
[14,] -0.791512435 1.082104157
[15,] 1.794877830 -0.791512435
[16,] -3.400208853 1.794877830
[17,] -1.315178029 -3.400208853
[18,] -2.396350353 -1.315178029
[19,] 3.032620489 -2.396350353
[20,] -3.730065367 3.032620489
[21,] 0.488573162 -3.730065367
[22,] -6.996644349 0.488573162
[23,] 1.204374421 -6.996644349
[24,] -2.045888079 1.204374421
[25,] 2.388279499 -2.045888079
[26,] 1.844888232 2.388279499
[27,] 2.585457370 1.844888232
[28,] 3.203835582 2.585457370
[29,] 1.627642581 3.203835582
[30,] -1.892645316 1.627642581
[31,] -0.174536401 -1.892645316
[32,] 3.032231825 -0.174536401
[33,] -2.697420539 3.032231825
[34,] 3.984734276 -2.697420539
[35,] 0.660274958 3.984734276
[36,] 0.865032147 0.660274958
[37,] -0.838198287 0.865032147
[38,] 0.519150720 -0.838198287
[39,] -1.834199556 0.519150720
[40,] -3.348494686 -1.834199556
[41,] 2.135857834 -3.348494686
[42,] -1.271221714 2.135857834
[43,] 0.268125988 -1.271221714
[44,] 4.039368358 0.268125988
[45,] 0.663242181 4.039368358
[46,] -0.451633504 0.663242181
[47,] 7.832291847 -0.451633504
[48,] -1.433299285 7.832291847
[49,] -3.011179153 -1.433299285
[50,] -1.974267096 -3.011179153
[51,] -0.339092129 -1.974267096
[52,] -0.374386730 -0.339092129
[53,] -1.520635635 -0.374386730
[54,] 1.085388412 -1.520635635
[55,] -1.934546037 1.085388412
[56,] -1.604549514 -1.934546037
[57,] 3.605332157 -1.604549514
[58,] -3.931714100 3.605332157
[59,] 1.478766744 -3.931714100
[60,] 5.346321496 1.478766744
[61,] -0.430302461 5.346321496
[62,] -3.425591539 -0.430302461
[63,] 1.072544596 -3.425591539
[64,] -1.721787535 1.072544596
[65,] -0.325588667 -1.721787535
[66,] -1.385968408 -0.325588667
[67,] -1.815395621 -1.385968408
[68,] -0.165749100 -1.815395621
[69,] -1.259136596 -0.165749100
[70,] -4.204075048 -1.259136596
[71,] -1.302603508 -4.204075048
[72,] 2.485419162 -1.302603508
[73,] 1.574845618 2.485419162
[74,] -0.523102065 1.574845618
[75,] -2.219506751 -0.523102065
[76,] -1.718354531 -2.219506751
[77,] -2.418632073 -1.718354531
[78,] -0.113642411 -2.418632073
[79,] -1.884546617 -0.113642411
[80,] 1.808193950 -1.884546617
[81,] 0.178417249 1.808193950
[82,] 2.515713376 0.178417249
[83,] -1.298625296 2.515713376
[84,] -3.759164817 -1.298625296
[85,] 0.005483032 -3.759164817
[86,] 1.430751917 0.005483032
[87,] 2.421986847 1.430751917
[88,] 0.156610850 2.421986847
[89,] -0.993878743 0.156610850
[90,] -1.689900046 -0.993878743
[91,] 2.120617113 -1.689900046
[92,] 2.409616836 2.120617113
[93,] -0.056484555 2.409616836
[94,] -4.337036702 -0.056484555
[95,] -1.850041871 -4.337036702
[96,] 4.272207052 -1.850041871
[97,] -0.407798091 4.272207052
[98,] -0.271524088 -0.407798091
[99,] 0.966908502 -0.271524088
[100,] 2.397735779 0.966908502
[101,] -0.140310973 2.397735779
[102,] 4.051313358 -0.140310973
[103,] -1.591194127 4.051313358
[104,] -1.532305741 -1.591194127
[105,] -1.619406888 -1.532305741
[106,] 1.238251757 -1.619406888
[107,] 2.433482630 1.238251757
[108,] 2.639067135 2.433482630
[109,] -2.576549893 2.639067135
[110,] 3.068616574 -2.576549893
[111,] 1.993456659 3.068616574
[112,] 2.023845466 1.993456659
[113,] -1.927699466 2.023845466
[114,] 0.309649811 -1.927699466
[115,] -0.215105617 0.309649811
[116,] -1.707536828 -0.215105617
[117,] 0.044696317 -1.707536828
[118,] 0.790611368 0.044696317
[119,] -0.910742413 0.790611368
[120,] -0.177283376 -0.910742413
[121,] -3.130704198 -0.177283376
[122,] -1.386955570 -3.130704198
[123,] -0.550840794 -1.386955570
[124,] 4.687378362 -0.550840794
[125,] 0.208838114 4.687378362
[126,] 1.622125064 0.208838114
[127,] 1.370489869 1.622125064
[128,] -3.203267670 1.370489869
[129,] 0.205751380 -3.203267670
[130,] -3.841675831 0.205751380
[131,] -1.011392613 -3.841675831
[132,] -4.889971187 -1.011392613
[133,] -2.453879313 -4.889971187
[134,] 0.916713172 -2.453879313
[135,] 3.991611387 0.916713172
[136,] -0.739975174 3.991611387
[137,] -3.561570033 -0.739975174
[138,] -1.004354904 -3.561570033
[139,] 1.494451975 -1.004354904
[140,] 2.313604624 1.494451975
[141,] -0.686212559 2.313604624
[142,] -9.683415311 -0.686212559
[143,] 3.694404876 -9.683415311
[144,] 0.263160075 3.694404876
[145,] 1.782345269 0.263160075
[146,] 2.025746044 1.782345269
[147,] 2.258924574 2.025746044
[148,] -0.137906999 2.258924574
[149,] -0.349489126 -0.137906999
[150,] 0.842992997 -0.349489126
[151,] 1.609193910 0.842992997
[152,] 3.858130529 1.609193910
[153,] 2.617793564 3.858130529
[154,] -0.241642961 2.617793564
[155,] 0.539877769 -0.241642961
[156,] -2.732980610 0.539877769
[157,] -0.133397019 -2.732980610
[158,] 2.696562471 -0.133397019
[159,] 0.398782404 2.696562471
[160,] -1.410872377 0.398782404
[161,] -1.190538627 -1.410872377
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.145059094 1.730998110
2 -2.980202527 -1.145059094
3 0.646039145 -2.980202527
4 0.670382427 0.646039145
5 0.633190486 0.670382427
6 4.325261610 0.633190486
7 1.882512910 4.325261610
8 3.731884921 1.882512910
9 1.347091261 3.731884921
10 -2.998406194 1.347091261
11 -0.737052394 -2.998406194
12 -2.058851828 -0.737052394
13 1.082104157 -2.058851828
14 -0.791512435 1.082104157
15 1.794877830 -0.791512435
16 -3.400208853 1.794877830
17 -1.315178029 -3.400208853
18 -2.396350353 -1.315178029
19 3.032620489 -2.396350353
20 -3.730065367 3.032620489
21 0.488573162 -3.730065367
22 -6.996644349 0.488573162
23 1.204374421 -6.996644349
24 -2.045888079 1.204374421
25 2.388279499 -2.045888079
26 1.844888232 2.388279499
27 2.585457370 1.844888232
28 3.203835582 2.585457370
29 1.627642581 3.203835582
30 -1.892645316 1.627642581
31 -0.174536401 -1.892645316
32 3.032231825 -0.174536401
33 -2.697420539 3.032231825
34 3.984734276 -2.697420539
35 0.660274958 3.984734276
36 0.865032147 0.660274958
37 -0.838198287 0.865032147
38 0.519150720 -0.838198287
39 -1.834199556 0.519150720
40 -3.348494686 -1.834199556
41 2.135857834 -3.348494686
42 -1.271221714 2.135857834
43 0.268125988 -1.271221714
44 4.039368358 0.268125988
45 0.663242181 4.039368358
46 -0.451633504 0.663242181
47 7.832291847 -0.451633504
48 -1.433299285 7.832291847
49 -3.011179153 -1.433299285
50 -1.974267096 -3.011179153
51 -0.339092129 -1.974267096
52 -0.374386730 -0.339092129
53 -1.520635635 -0.374386730
54 1.085388412 -1.520635635
55 -1.934546037 1.085388412
56 -1.604549514 -1.934546037
57 3.605332157 -1.604549514
58 -3.931714100 3.605332157
59 1.478766744 -3.931714100
60 5.346321496 1.478766744
61 -0.430302461 5.346321496
62 -3.425591539 -0.430302461
63 1.072544596 -3.425591539
64 -1.721787535 1.072544596
65 -0.325588667 -1.721787535
66 -1.385968408 -0.325588667
67 -1.815395621 -1.385968408
68 -0.165749100 -1.815395621
69 -1.259136596 -0.165749100
70 -4.204075048 -1.259136596
71 -1.302603508 -4.204075048
72 2.485419162 -1.302603508
73 1.574845618 2.485419162
74 -0.523102065 1.574845618
75 -2.219506751 -0.523102065
76 -1.718354531 -2.219506751
77 -2.418632073 -1.718354531
78 -0.113642411 -2.418632073
79 -1.884546617 -0.113642411
80 1.808193950 -1.884546617
81 0.178417249 1.808193950
82 2.515713376 0.178417249
83 -1.298625296 2.515713376
84 -3.759164817 -1.298625296
85 0.005483032 -3.759164817
86 1.430751917 0.005483032
87 2.421986847 1.430751917
88 0.156610850 2.421986847
89 -0.993878743 0.156610850
90 -1.689900046 -0.993878743
91 2.120617113 -1.689900046
92 2.409616836 2.120617113
93 -0.056484555 2.409616836
94 -4.337036702 -0.056484555
95 -1.850041871 -4.337036702
96 4.272207052 -1.850041871
97 -0.407798091 4.272207052
98 -0.271524088 -0.407798091
99 0.966908502 -0.271524088
100 2.397735779 0.966908502
101 -0.140310973 2.397735779
102 4.051313358 -0.140310973
103 -1.591194127 4.051313358
104 -1.532305741 -1.591194127
105 -1.619406888 -1.532305741
106 1.238251757 -1.619406888
107 2.433482630 1.238251757
108 2.639067135 2.433482630
109 -2.576549893 2.639067135
110 3.068616574 -2.576549893
111 1.993456659 3.068616574
112 2.023845466 1.993456659
113 -1.927699466 2.023845466
114 0.309649811 -1.927699466
115 -0.215105617 0.309649811
116 -1.707536828 -0.215105617
117 0.044696317 -1.707536828
118 0.790611368 0.044696317
119 -0.910742413 0.790611368
120 -0.177283376 -0.910742413
121 -3.130704198 -0.177283376
122 -1.386955570 -3.130704198
123 -0.550840794 -1.386955570
124 4.687378362 -0.550840794
125 0.208838114 4.687378362
126 1.622125064 0.208838114
127 1.370489869 1.622125064
128 -3.203267670 1.370489869
129 0.205751380 -3.203267670
130 -3.841675831 0.205751380
131 -1.011392613 -3.841675831
132 -4.889971187 -1.011392613
133 -2.453879313 -4.889971187
134 0.916713172 -2.453879313
135 3.991611387 0.916713172
136 -0.739975174 3.991611387
137 -3.561570033 -0.739975174
138 -1.004354904 -3.561570033
139 1.494451975 -1.004354904
140 2.313604624 1.494451975
141 -0.686212559 2.313604624
142 -9.683415311 -0.686212559
143 3.694404876 -9.683415311
144 0.263160075 3.694404876
145 1.782345269 0.263160075
146 2.025746044 1.782345269
147 2.258924574 2.025746044
148 -0.137906999 2.258924574
149 -0.349489126 -0.137906999
150 0.842992997 -0.349489126
151 1.609193910 0.842992997
152 3.858130529 1.609193910
153 2.617793564 3.858130529
154 -0.241642961 2.617793564
155 0.539877769 -0.241642961
156 -2.732980610 0.539877769
157 -0.133397019 -2.732980610
158 2.696562471 -0.133397019
159 0.398782404 2.696562471
160 -1.410872377 0.398782404
161 -1.190538627 -1.410872377
> 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/7ncr31353168443.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/8w0p91353168443.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/944zp1353168443.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/106cqt1353168443.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/11d4sw1353168443.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/12z1uc1353168443.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/13nv531353168443.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/14d0ek1353168443.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/15q0op1353168443.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/1633ml1353168443.tab")
+ }
>
> try(system("convert tmp/1b6wp1353168443.ps tmp/1b6wp1353168443.png",intern=TRUE))
character(0)
> try(system("convert tmp/2trb81353168443.ps tmp/2trb81353168443.png",intern=TRUE))
character(0)
> try(system("convert tmp/3vk731353168443.ps tmp/3vk731353168443.png",intern=TRUE))
character(0)
> try(system("convert tmp/44q3m1353168443.ps tmp/44q3m1353168443.png",intern=TRUE))
character(0)
> try(system("convert tmp/5d7cg1353168443.ps tmp/5d7cg1353168443.png",intern=TRUE))
character(0)
> try(system("convert tmp/61vf51353168443.ps tmp/61vf51353168443.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ncr31353168443.ps tmp/7ncr31353168443.png",intern=TRUE))
character(0)
> try(system("convert tmp/8w0p91353168443.ps tmp/8w0p91353168443.png",intern=TRUE))
character(0)
> try(system("convert tmp/944zp1353168443.ps tmp/944zp1353168443.png",intern=TRUE))
character(0)
> try(system("convert tmp/106cqt1353168443.ps tmp/106cqt1353168443.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
9.127 1.327 10.499