R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-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
+ ,24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,9
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,9
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,9
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,9
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,9
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,10
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,10
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,10
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,10
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,10
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,10
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,10
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,10
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,10
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,10
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,10
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,10
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,10
+ 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
+ ,30
+ ,14
+ ,9
+ ,9
+ ,23
+ ,14
+ ,10
+ ,30
+ ,12
+ ,15
+ ,10
+ ,29
+ ,22
+ ,10
+ ,24
+ ,14
+ ,24
+ ,20
+ ,21
+ ,10
+ ,10
+ ,21
+ ,15
+ ,7
+ ,5
+ ,21
+ ,24
+ ,10
+ ,21
+ ,13
+ ,17
+ ,11
+ ,23
+ ,22
+ ,10
+ ,29
+ ,16
+ ,11
+ ,6
+ ,27
+ ,24
+ ,10
+ ,31
+ ,9
+ ,17
+ ,9
+ ,25
+ ,19
+ ,10
+ ,20
+ ,9
+ ,11
+ ,7
+ ,21
+ ,20
+ ,10
+ ,16
+ ,9
+ ,12
+ ,9
+ ,10
+ ,13
+ ,10
+ ,22
+ ,8
+ ,14
+ ,10
+ ,20
+ ,20
+ ,10
+ ,20
+ ,7
+ ,11
+ ,9
+ ,26
+ ,22
+ ,10
+ ,28
+ ,16
+ ,16
+ ,8
+ ,24
+ ,24
+ ,10
+ ,38
+ ,11
+ ,21
+ ,7
+ ,29
+ ,29
+ ,10
+ ,22
+ ,9
+ ,14
+ ,6
+ ,19
+ ,12
+ ,10
+ ,20
+ ,11
+ ,20
+ ,13
+ ,24
+ ,20
+ ,10
+ ,17
+ ,9
+ ,13
+ ,6
+ ,19
+ ,21
+ ,10
+ ,28
+ ,14
+ ,11
+ ,8
+ ,24
+ ,24
+ ,10
+ ,22
+ ,13
+ ,15
+ ,10
+ ,22
+ ,22
+ ,10
+ ,31
+ ,16
+ ,19
+ ,16
+ ,17
+ ,20)
+ ,dim=c(7
+ ,159)
+ ,dimnames=list(c('month'
+ ,'ConcernoverMistakes'
+ ,'Doubtsaboutactions'
+ ,'ParentalExpectations'
+ ,'ParentalCriticism'
+ ,'PersonalStandards'
+ ,'Organization
')
+ ,1:159))
> y <- array(NA,dim=c(7,159),dimnames=list(c('month','ConcernoverMistakes','Doubtsaboutactions','ParentalExpectations','ParentalCriticism','PersonalStandards','Organization
'),1:159))
> for (i in 1:dim(x)[1])
+ {
+ 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 = '6'
> library(lattice)
> library(lmtest)
Loading required package: zoo
> 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
PersonalStandards month ConcernoverMistakes Doubtsaboutactions
1 24 9 24 14
2 25 9 25 11
3 30 9 17 6
4 19 9 18 12
5 22 9 18 8
6 22 9 16 10
7 25 10 20 10
8 23 10 16 11
9 17 10 18 16
10 21 10 17 11
11 19 10 23 13
12 19 10 30 12
13 15 10 23 8
14 16 10 18 12
15 23 10 15 11
16 27 10 12 4
17 22 10 21 9
18 14 10 15 8
19 22 10 20 8
20 23 10 31 14
21 23 10 27 15
22 21 10 34 16
23 19 10 21 9
24 18 10 31 14
25 20 10 19 11
26 23 10 16 8
27 25 10 20 9
28 19 10 21 9
29 24 10 22 9
30 22 10 17 9
31 25 10 24 10
32 26 10 25 16
33 29 10 26 11
34 32 10 25 8
35 25 10 17 9
36 29 10 32 16
37 28 10 33 11
38 17 10 13 16
39 28 10 32 12
40 29 10 25 12
41 26 10 29 14
42 25 10 22 9
43 14 10 18 10
44 25 10 17 9
45 26 10 20 10
46 20 10 15 12
47 18 10 20 14
48 32 10 33 14
49 25 10 29 10
50 25 10 23 14
51 23 10 26 16
52 21 10 18 9
53 20 10 20 10
54 15 10 11 6
55 30 10 28 8
56 24 10 26 13
57 26 10 22 10
58 24 10 17 8
59 22 10 12 7
60 14 10 14 15
61 24 10 17 9
62 24 10 21 10
63 24 10 19 12
64 24 10 18 13
65 19 10 10 10
66 31 10 29 11
67 22 10 31 8
68 27 10 19 9
69 19 10 9 13
70 25 10 20 11
71 20 10 28 8
72 21 10 19 9
73 27 10 30 9
74 23 10 29 15
75 25 10 26 9
76 20 10 23 10
77 21 10 13 14
78 22 10 21 12
79 23 10 19 12
80 25 10 28 11
81 25 10 23 14
82 17 10 18 6
83 19 10 21 12
84 25 10 20 8
85 19 10 23 14
86 20 10 21 11
87 26 10 21 10
88 23 10 15 14
89 27 10 28 12
90 17 10 19 10
91 17 10 26 14
92 19 10 10 5
93 17 10 16 11
94 22 10 22 10
95 21 10 19 9
96 32 10 31 10
97 21 10 31 16
98 21 10 29 13
99 18 10 19 9
100 18 10 22 10
101 23 10 23 10
102 19 10 15 7
103 20 10 20 9
104 21 10 18 8
105 20 10 23 14
106 17 10 25 14
107 18 10 21 8
108 19 10 24 9
109 22 10 25 14
110 15 10 17 14
111 14 10 13 8
112 18 10 28 8
113 24 10 21 8
114 35 10 25 7
115 29 10 9 6
116 21 10 16 8
117 25 10 19 6
118 20 10 17 11
119 22 10 25 14
120 13 10 20 11
121 26 10 29 11
122 17 10 14 11
123 25 10 22 14
124 20 10 15 8
125 19 10 19 20
126 21 10 20 11
127 22 10 15 8
128 24 10 20 11
129 21 10 18 10
130 26 10 33 14
131 24 10 22 11
132 16 10 16 9
133 23 10 17 9
134 18 10 16 8
135 16 10 21 10
136 26 10 26 13
137 19 10 18 13
138 21 10 18 12
139 21 10 17 8
140 22 10 22 13
141 23 10 30 14
142 29 10 30 12
143 21 10 24 14
144 21 10 21 15
145 23 10 21 13
146 27 10 29 16
147 25 10 31 9
148 21 10 20 9
149 10 10 16 9
150 20 10 22 8
151 26 10 20 7
152 24 10 28 16
153 29 10 38 11
154 19 10 22 9
155 24 10 20 11
156 19 10 17 9
157 24 10 28 14
158 22 10 22 13
159 17 10 31 16
ParentalExpectations ParentalCriticism Organization\r t
1 11 12 26 1
2 7 8 23 2
3 17 8 25 3
4 10 8 23 4
5 12 9 19 5
6 12 7 29 6
7 11 4 25 7
8 11 11 21 8
9 12 7 22 9
10 13 7 25 10
11 14 12 24 11
12 16 10 18 12
13 11 10 22 13
14 10 8 15 14
15 11 8 22 15
16 15 4 28 16
17 9 9 20 17
18 11 8 12 18
19 17 7 24 19
20 17 11 20 20
21 11 9 21 21
22 18 11 20 22
23 14 13 21 23
24 10 8 23 24
25 11 8 28 25
26 15 9 24 26
27 15 6 24 27
28 13 9 24 28
29 16 9 23 29
30 13 6 23 30
31 9 6 29 31
32 18 16 24 32
33 18 5 18 33
34 12 7 25 34
35 17 9 21 35
36 9 6 26 36
37 9 6 22 37
38 12 5 22 38
39 18 12 22 39
40 12 7 23 40
41 18 10 30 41
42 14 9 23 42
43 15 8 17 43
44 16 5 23 44
45 10 8 23 45
46 11 8 25 46
47 14 10 24 47
48 9 6 24 48
49 12 8 23 49
50 17 7 21 50
51 5 4 24 51
52 12 8 24 52
53 12 8 28 53
54 6 4 16 54
55 24 20 20 55
56 12 8 29 56
57 12 8 27 57
58 14 6 22 58
59 7 4 28 59
60 13 8 16 60
61 12 9 25 61
62 13 6 24 62
63 14 7 28 63
64 8 9 24 64
65 11 5 23 65
66 9 5 30 66
67 11 8 24 67
68 13 8 21 68
69 10 6 25 69
70 11 8 25 70
71 12 7 22 71
72 9 7 23 72
73 15 9 26 73
74 18 11 23 74
75 15 6 25 75
76 12 8 21 76
77 13 6 25 77
78 14 9 24 78
79 10 8 29 79
80 13 6 22 80
81 13 10 27 81
82 11 8 26 82
83 13 8 22 83
84 16 10 24 84
85 8 5 27 85
86 16 7 24 86
87 11 5 24 87
88 9 8 29 88
89 16 14 22 89
90 12 7 21 90
91 14 8 24 91
92 8 6 24 92
93 9 5 23 93
94 15 6 20 94
95 11 10 27 95
96 21 12 26 96
97 14 9 25 97
98 18 12 21 98
99 12 7 21 99
100 13 8 19 100
101 15 10 21 101
102 12 6 21 102
103 19 10 16 103
104 15 10 22 104
105 11 10 29 105
106 11 5 15 106
107 10 7 17 107
108 13 10 15 108
109 15 11 21 109
110 12 6 21 110
111 12 7 19 111
112 16 12 24 112
113 9 11 20 113
114 18 11 17 114
115 8 11 23 115
116 13 5 24 116
117 17 8 14 117
118 9 6 19 118
119 15 9 24 119
120 8 4 13 120
121 7 4 22 121
122 12 7 16 122
123 14 11 19 123
124 6 6 25 124
125 8 7 25 125
126 17 8 23 126
127 10 4 24 127
128 11 8 26 128
129 14 9 26 129
130 11 8 25 130
131 13 11 18 131
132 12 8 21 132
133 11 5 26 133
134 9 4 23 134
135 12 8 23 135
136 20 10 22 136
137 12 6 20 137
138 13 9 13 138
139 12 9 24 139
140 12 13 15 140
141 9 9 14 141
142 15 10 22 142
143 24 20 10 143
144 7 5 24 144
145 17 11 22 145
146 11 6 24 146
147 17 9 19 147
148 11 7 20 148
149 12 9 13 149
150 14 10 20 150
151 11 9 22 151
152 16 8 24 152
153 21 7 29 153
154 14 6 12 154
155 20 13 20 155
156 13 6 21 156
157 11 8 24 157
158 15 10 22 158
159 19 16 20 159
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) month ConcernoverMistakes
21.06385 -1.33227 0.33136
Doubtsaboutactions ParentalExpectations ParentalCriticism
-0.35572 0.19798 0.00684
`Organization\r` t
0.38751 -0.00225
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.471 -2.280 0.054 2.113 11.495
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 21.063848 15.165043 1.389 0.16689
month -1.332265 1.523395 -0.875 0.38321
ConcernoverMistakes 0.331360 0.055769 5.942 1.87e-08 ***
Doubtsaboutactions -0.355719 0.107595 -3.306 0.00118 **
ParentalExpectations 0.197976 0.102008 1.941 0.05415 .
ParentalCriticism 0.006840 0.130045 0.053 0.95812
`Organization\r` 0.387509 0.074104 5.229 5.58e-07 ***
t -0.002250 0.006424 -0.350 0.72663
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.418 on 151 degrees of freedom
Multiple R-squared: 0.372, Adjusted R-squared: 0.3429
F-statistic: 12.78 on 7 and 151 DF, p-value: 7.807e-13
> 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.04722829 0.09445658 0.9527717
[2,] 0.01423476 0.02846951 0.9857652
[3,] 0.06428843 0.12857686 0.9357116
[4,] 0.12358941 0.24717882 0.8764106
[5,] 0.57525727 0.84948547 0.4247427
[6,] 0.51901093 0.96197814 0.4809891
[7,] 0.56529780 0.86940440 0.4347022
[8,] 0.52373975 0.95252049 0.4762602
[9,] 0.44522856 0.89045711 0.5547714
[10,] 0.55346191 0.89307618 0.4465381
[11,] 0.56782303 0.86435395 0.4321770
[12,] 0.50023550 0.99952901 0.4997645
[13,] 0.44070710 0.88141421 0.5592929
[14,] 0.45382875 0.90765749 0.5461713
[15,] 0.40041782 0.80083564 0.5995822
[16,] 0.34812419 0.69624838 0.6518758
[17,] 0.31405639 0.62811279 0.6859436
[18,] 0.29695303 0.59390606 0.7030470
[19,] 0.25897508 0.51795016 0.7410249
[20,] 0.20790971 0.41581942 0.7920903
[21,] 0.17769627 0.35539254 0.8223037
[22,] 0.21828636 0.43657272 0.7817136
[23,] 0.30357286 0.60714573 0.6964271
[24,] 0.51997646 0.96004708 0.4800235
[25,] 0.47032738 0.94065477 0.5296726
[26,] 0.47719788 0.95439576 0.5228021
[27,] 0.43909282 0.87818563 0.5609072
[28,] 0.46889131 0.93778262 0.5311087
[29,] 0.41606423 0.83212847 0.5839358
[30,] 0.44222069 0.88444138 0.5577793
[31,] 0.43259398 0.86518796 0.5674060
[32,] 0.38231756 0.76463512 0.6176824
[33,] 0.59356990 0.81286019 0.4064301
[34,] 0.55513965 0.88972069 0.4448603
[35,] 0.54179946 0.91640108 0.4582005
[36,] 0.50348534 0.99302932 0.4965147
[37,] 0.52754504 0.94490993 0.4724550
[38,] 0.60402464 0.79195072 0.3959754
[39,] 0.57389669 0.85220662 0.4261033
[40,] 0.54453020 0.91093960 0.4554698
[41,] 0.50677284 0.98645433 0.4932272
[42,] 0.48223470 0.96446939 0.5177653
[43,] 0.54203836 0.91592328 0.4579616
[44,] 0.51964994 0.96070011 0.4803501
[45,] 0.54157172 0.91685656 0.4584283
[46,] 0.51722826 0.96554347 0.4827717
[47,] 0.47304389 0.94608777 0.5269561
[48,] 0.43702692 0.87405385 0.5629731
[49,] 0.39112138 0.78224275 0.6088786
[50,] 0.35882813 0.71765627 0.6411719
[51,] 0.32140907 0.64281815 0.6785909
[52,] 0.28704770 0.57409539 0.7129523
[53,] 0.25112255 0.50224511 0.7488774
[54,] 0.26668581 0.53337162 0.7333142
[55,] 0.23099134 0.46198268 0.7690087
[56,] 0.23938806 0.47877612 0.7606119
[57,] 0.32578775 0.65157549 0.6742123
[58,] 0.38351152 0.76702305 0.6164885
[59,] 0.34608885 0.69217771 0.6539111
[60,] 0.32808648 0.65617296 0.6719135
[61,] 0.42191110 0.84382219 0.5780889
[62,] 0.38058703 0.76117405 0.6194130
[63,] 0.34682142 0.69364283 0.6531786
[64,] 0.31972327 0.63944653 0.6802767
[65,] 0.29554869 0.59109738 0.7044513
[66,] 0.27423752 0.54847504 0.7257625
[67,] 0.25548590 0.51097180 0.7445141
[68,] 0.22208299 0.44416598 0.7779170
[69,] 0.19144979 0.38289958 0.8085502
[70,] 0.16917498 0.33834996 0.8308250
[71,] 0.15137391 0.30274783 0.8486261
[72,] 0.23700088 0.47400176 0.7629991
[73,] 0.21654606 0.43309213 0.7834539
[74,] 0.19052451 0.38104902 0.8094755
[75,] 0.18827071 0.37654143 0.8117293
[76,] 0.18051768 0.36103536 0.8194823
[77,] 0.19693846 0.39387692 0.8030615
[78,] 0.19202688 0.38405376 0.8079731
[79,] 0.18697002 0.37394003 0.8130300
[80,] 0.18440952 0.36881904 0.8155905
[81,] 0.24392011 0.48784022 0.7560799
[82,] 0.20840963 0.41681926 0.7915904
[83,] 0.18624986 0.37249972 0.8137501
[84,] 0.15900432 0.31800864 0.8409957
[85,] 0.13934645 0.27869290 0.8606535
[86,] 0.15419162 0.30838324 0.8458084
[87,] 0.14569833 0.29139666 0.8543017
[88,] 0.13278819 0.26557638 0.8672118
[89,] 0.11996994 0.23993988 0.8800301
[90,] 0.10970754 0.21941507 0.8902925
[91,] 0.08985472 0.17970943 0.9101453
[92,] 0.07245056 0.14490113 0.9275494
[93,] 0.05714926 0.11429853 0.9428507
[94,] 0.04502665 0.09005331 0.9549733
[95,] 0.04595455 0.09190911 0.9540454
[96,] 0.03685710 0.07371419 0.9631429
[97,] 0.03236092 0.06472185 0.9676391
[98,] 0.02962589 0.05925178 0.9703741
[99,] 0.02333456 0.04666912 0.9766654
[100,] 0.02422052 0.04844105 0.9757795
[101,] 0.03404210 0.06808419 0.9659579
[102,] 0.23497677 0.46995354 0.7650232
[103,] 0.24749282 0.49498564 0.7525072
[104,] 0.60599895 0.78800211 0.3940011
[105,] 0.86515582 0.26968835 0.1348442
[106,] 0.83369144 0.33261711 0.1663086
[107,] 0.86311335 0.27377330 0.1368867
[108,] 0.83448600 0.33102801 0.1655140
[109,] 0.81285800 0.37428399 0.1871420
[110,] 0.86906689 0.26186621 0.1309331
[111,] 0.84169527 0.31660945 0.1583047
[112,] 0.80696606 0.38606788 0.1930339
[113,] 0.81512207 0.36975585 0.1848779
[114,] 0.77145621 0.45708758 0.2285438
[115,] 0.73679956 0.52640089 0.2632004
[116,] 0.69769675 0.60460651 0.3023033
[117,] 0.64888249 0.70223502 0.3511175
[118,] 0.59628141 0.80743719 0.4037186
[119,] 0.54096573 0.91806854 0.4590343
[120,] 0.48973884 0.97947768 0.5102612
[121,] 0.46124723 0.92249446 0.5387528
[122,] 0.48464598 0.96929195 0.5153540
[123,] 0.41966192 0.83932383 0.5803381
[124,] 0.39030367 0.78060735 0.6096963
[125,] 0.69107638 0.61784723 0.3089236
[126,] 0.62199472 0.75601056 0.3780053
[127,] 0.60792093 0.78415814 0.3920791
[128,] 0.55206301 0.89587398 0.4479370
[129,] 0.57561374 0.84877253 0.4243863
[130,] 0.49888962 0.99777923 0.5011104
[131,] 0.43665291 0.87330582 0.5633471
[132,] 0.39375218 0.78750437 0.6062478
[133,] 0.41210814 0.82421629 0.5878919
[134,] 0.35243024 0.70486049 0.6475698
[135,] 0.25295386 0.50590772 0.7470461
[136,] 0.21607313 0.43214626 0.7839269
[137,] 0.17485699 0.34971397 0.8251430
[138,] 0.09686044 0.19372089 0.9031396
> postscript(file="/var/wessaorg/rcomp/tmp/1uci31322182367.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/2ila41322182367.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/3coio1322182367.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/43k0n1322182367.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/59dk81322182367.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 = 159
Frequency = 1
1 2 3 4 5 6
-0.37884110 1.20668254 4.32643934 -2.70750467 0.01911251 -2.46588862
7 8 9 10 11 12
2.31171728 3.49728437 -1.94271597 -0.74820449 -3.86734451 -4.59755426
13 14 15 16 17 18
-8.25881375 -1.25266672 3.47740599 2.89410379 0.94643659 -2.70791131
19 20 21 22 23 24
-2.19358777 -1.17930959 1.31812874 -3.65542817 -3.44481238 -5.92648319
25 26 27 28 29 30
-3.15058821 0.52987661 1.58292437 -4.37075314 0.09371709 0.36721687
31 32 33 34 35 36
-0.12748509 2.76507991 6.05766673 6.78573408 3.34106086 4.52972491
37 38 39 40 41 42
2.97205491 -0.20698213 1.84080947 5.99712920 -1.53556330 1.51892063
43 44 45 46 47 48
-5.66375134 2.81162946 4.34285528 -0.25964905 -3.42286148 7.28894537
49 50 51 52 53 54
-0.02633935 3.17892601 2.13224051 -1.11785403 -3.97264133 -1.54570066
55 56 57 58 59 60
3.31181715 -1.27440433 1.76114744 2.26403303 0.64182460 -1.73800154
61 62 63 64 65 66
1.83940818 1.08198874 0.70354568 4.11708850 0.52400346 4.26951665
67 68 69 70 71 72
-4.54952942 5.55133789 1.34763987 2.78183250 -4.96256651 -0.41593508
73 74 75 76 77 78
-0.42271206 -1.39986817 -0.68474205 -2.20240722 1.80199002 -0.38906739
79 80 81 82 83 84
0.13710298 0.93370546 1.69500993 -6.69455058 -2.39798289 1.13012456
85 86 87 88 89 90
-3.27190930 -3.10905841 3.54103326 2.39220944 2.66102769 -3.83862491
91 92 93 94 95 96
-6.29833948 -0.99426019 -2.64948424 -0.02328510 -2.33069103 3.44502204
97 98 99 100 101 102
-3.62455098 -3.28912624 -3.17409325 -3.24000299 0.24623667 -1.54650023
103 104 105 106 107 108
-0.96526124 -1.18915890 -3.63005352 -1.83119870 -2.22854393 -1.70408583
109 110 111 112 113 114
0.01755351 -3.70118604 -4.73963161 -8.47143503 2.79304625 11.49487730
115 116 117 118 119 120
10.09788083 -0.84430337 4.51509299 1.61860377 -1.10879277 -3.83426701
121 122 123 124 125 126
2.89613576 0.18344350 5.01612980 -0.50345793 1.03918853 -1.50500163
127 128 129 130 131 132
1.11257636 1.52482871 -1.76668823 0.67631156 3.55245825 -4.11259932
133 134 135 136 137 138
0.83924141 -2.61754812 -6.18194933 2.02067646 0.05999593 4.20059391
139 140 141 142 143 144
-0.95329499 3.63097072 3.34685477 4.34289763 1.84467098 1.23978887
145 146 147 148 149 150
1.28481738 4.15038123 -0.27095518 0.19028603 -6.98111578 -2.43810177
151 152 153 154 155 156
3.69690023 0.49168133 -2.51885322 0.05404922 2.09464989 -1.57425386
157 158 159
0.78137442 0.38550053 -6.58526068
> postscript(file="/var/wessaorg/rcomp/tmp/6sqva1322182367.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 = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.37884110 NA
1 1.20668254 -0.37884110
2 4.32643934 1.20668254
3 -2.70750467 4.32643934
4 0.01911251 -2.70750467
5 -2.46588862 0.01911251
6 2.31171728 -2.46588862
7 3.49728437 2.31171728
8 -1.94271597 3.49728437
9 -0.74820449 -1.94271597
10 -3.86734451 -0.74820449
11 -4.59755426 -3.86734451
12 -8.25881375 -4.59755426
13 -1.25266672 -8.25881375
14 3.47740599 -1.25266672
15 2.89410379 3.47740599
16 0.94643659 2.89410379
17 -2.70791131 0.94643659
18 -2.19358777 -2.70791131
19 -1.17930959 -2.19358777
20 1.31812874 -1.17930959
21 -3.65542817 1.31812874
22 -3.44481238 -3.65542817
23 -5.92648319 -3.44481238
24 -3.15058821 -5.92648319
25 0.52987661 -3.15058821
26 1.58292437 0.52987661
27 -4.37075314 1.58292437
28 0.09371709 -4.37075314
29 0.36721687 0.09371709
30 -0.12748509 0.36721687
31 2.76507991 -0.12748509
32 6.05766673 2.76507991
33 6.78573408 6.05766673
34 3.34106086 6.78573408
35 4.52972491 3.34106086
36 2.97205491 4.52972491
37 -0.20698213 2.97205491
38 1.84080947 -0.20698213
39 5.99712920 1.84080947
40 -1.53556330 5.99712920
41 1.51892063 -1.53556330
42 -5.66375134 1.51892063
43 2.81162946 -5.66375134
44 4.34285528 2.81162946
45 -0.25964905 4.34285528
46 -3.42286148 -0.25964905
47 7.28894537 -3.42286148
48 -0.02633935 7.28894537
49 3.17892601 -0.02633935
50 2.13224051 3.17892601
51 -1.11785403 2.13224051
52 -3.97264133 -1.11785403
53 -1.54570066 -3.97264133
54 3.31181715 -1.54570066
55 -1.27440433 3.31181715
56 1.76114744 -1.27440433
57 2.26403303 1.76114744
58 0.64182460 2.26403303
59 -1.73800154 0.64182460
60 1.83940818 -1.73800154
61 1.08198874 1.83940818
62 0.70354568 1.08198874
63 4.11708850 0.70354568
64 0.52400346 4.11708850
65 4.26951665 0.52400346
66 -4.54952942 4.26951665
67 5.55133789 -4.54952942
68 1.34763987 5.55133789
69 2.78183250 1.34763987
70 -4.96256651 2.78183250
71 -0.41593508 -4.96256651
72 -0.42271206 -0.41593508
73 -1.39986817 -0.42271206
74 -0.68474205 -1.39986817
75 -2.20240722 -0.68474205
76 1.80199002 -2.20240722
77 -0.38906739 1.80199002
78 0.13710298 -0.38906739
79 0.93370546 0.13710298
80 1.69500993 0.93370546
81 -6.69455058 1.69500993
82 -2.39798289 -6.69455058
83 1.13012456 -2.39798289
84 -3.27190930 1.13012456
85 -3.10905841 -3.27190930
86 3.54103326 -3.10905841
87 2.39220944 3.54103326
88 2.66102769 2.39220944
89 -3.83862491 2.66102769
90 -6.29833948 -3.83862491
91 -0.99426019 -6.29833948
92 -2.64948424 -0.99426019
93 -0.02328510 -2.64948424
94 -2.33069103 -0.02328510
95 3.44502204 -2.33069103
96 -3.62455098 3.44502204
97 -3.28912624 -3.62455098
98 -3.17409325 -3.28912624
99 -3.24000299 -3.17409325
100 0.24623667 -3.24000299
101 -1.54650023 0.24623667
102 -0.96526124 -1.54650023
103 -1.18915890 -0.96526124
104 -3.63005352 -1.18915890
105 -1.83119870 -3.63005352
106 -2.22854393 -1.83119870
107 -1.70408583 -2.22854393
108 0.01755351 -1.70408583
109 -3.70118604 0.01755351
110 -4.73963161 -3.70118604
111 -8.47143503 -4.73963161
112 2.79304625 -8.47143503
113 11.49487730 2.79304625
114 10.09788083 11.49487730
115 -0.84430337 10.09788083
116 4.51509299 -0.84430337
117 1.61860377 4.51509299
118 -1.10879277 1.61860377
119 -3.83426701 -1.10879277
120 2.89613576 -3.83426701
121 0.18344350 2.89613576
122 5.01612980 0.18344350
123 -0.50345793 5.01612980
124 1.03918853 -0.50345793
125 -1.50500163 1.03918853
126 1.11257636 -1.50500163
127 1.52482871 1.11257636
128 -1.76668823 1.52482871
129 0.67631156 -1.76668823
130 3.55245825 0.67631156
131 -4.11259932 3.55245825
132 0.83924141 -4.11259932
133 -2.61754812 0.83924141
134 -6.18194933 -2.61754812
135 2.02067646 -6.18194933
136 0.05999593 2.02067646
137 4.20059391 0.05999593
138 -0.95329499 4.20059391
139 3.63097072 -0.95329499
140 3.34685477 3.63097072
141 4.34289763 3.34685477
142 1.84467098 4.34289763
143 1.23978887 1.84467098
144 1.28481738 1.23978887
145 4.15038123 1.28481738
146 -0.27095518 4.15038123
147 0.19028603 -0.27095518
148 -6.98111578 0.19028603
149 -2.43810177 -6.98111578
150 3.69690023 -2.43810177
151 0.49168133 3.69690023
152 -2.51885322 0.49168133
153 0.05404922 -2.51885322
154 2.09464989 0.05404922
155 -1.57425386 2.09464989
156 0.78137442 -1.57425386
157 0.38550053 0.78137442
158 -6.58526068 0.38550053
159 NA -6.58526068
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.20668254 -0.37884110
[2,] 4.32643934 1.20668254
[3,] -2.70750467 4.32643934
[4,] 0.01911251 -2.70750467
[5,] -2.46588862 0.01911251
[6,] 2.31171728 -2.46588862
[7,] 3.49728437 2.31171728
[8,] -1.94271597 3.49728437
[9,] -0.74820449 -1.94271597
[10,] -3.86734451 -0.74820449
[11,] -4.59755426 -3.86734451
[12,] -8.25881375 -4.59755426
[13,] -1.25266672 -8.25881375
[14,] 3.47740599 -1.25266672
[15,] 2.89410379 3.47740599
[16,] 0.94643659 2.89410379
[17,] -2.70791131 0.94643659
[18,] -2.19358777 -2.70791131
[19,] -1.17930959 -2.19358777
[20,] 1.31812874 -1.17930959
[21,] -3.65542817 1.31812874
[22,] -3.44481238 -3.65542817
[23,] -5.92648319 -3.44481238
[24,] -3.15058821 -5.92648319
[25,] 0.52987661 -3.15058821
[26,] 1.58292437 0.52987661
[27,] -4.37075314 1.58292437
[28,] 0.09371709 -4.37075314
[29,] 0.36721687 0.09371709
[30,] -0.12748509 0.36721687
[31,] 2.76507991 -0.12748509
[32,] 6.05766673 2.76507991
[33,] 6.78573408 6.05766673
[34,] 3.34106086 6.78573408
[35,] 4.52972491 3.34106086
[36,] 2.97205491 4.52972491
[37,] -0.20698213 2.97205491
[38,] 1.84080947 -0.20698213
[39,] 5.99712920 1.84080947
[40,] -1.53556330 5.99712920
[41,] 1.51892063 -1.53556330
[42,] -5.66375134 1.51892063
[43,] 2.81162946 -5.66375134
[44,] 4.34285528 2.81162946
[45,] -0.25964905 4.34285528
[46,] -3.42286148 -0.25964905
[47,] 7.28894537 -3.42286148
[48,] -0.02633935 7.28894537
[49,] 3.17892601 -0.02633935
[50,] 2.13224051 3.17892601
[51,] -1.11785403 2.13224051
[52,] -3.97264133 -1.11785403
[53,] -1.54570066 -3.97264133
[54,] 3.31181715 -1.54570066
[55,] -1.27440433 3.31181715
[56,] 1.76114744 -1.27440433
[57,] 2.26403303 1.76114744
[58,] 0.64182460 2.26403303
[59,] -1.73800154 0.64182460
[60,] 1.83940818 -1.73800154
[61,] 1.08198874 1.83940818
[62,] 0.70354568 1.08198874
[63,] 4.11708850 0.70354568
[64,] 0.52400346 4.11708850
[65,] 4.26951665 0.52400346
[66,] -4.54952942 4.26951665
[67,] 5.55133789 -4.54952942
[68,] 1.34763987 5.55133789
[69,] 2.78183250 1.34763987
[70,] -4.96256651 2.78183250
[71,] -0.41593508 -4.96256651
[72,] -0.42271206 -0.41593508
[73,] -1.39986817 -0.42271206
[74,] -0.68474205 -1.39986817
[75,] -2.20240722 -0.68474205
[76,] 1.80199002 -2.20240722
[77,] -0.38906739 1.80199002
[78,] 0.13710298 -0.38906739
[79,] 0.93370546 0.13710298
[80,] 1.69500993 0.93370546
[81,] -6.69455058 1.69500993
[82,] -2.39798289 -6.69455058
[83,] 1.13012456 -2.39798289
[84,] -3.27190930 1.13012456
[85,] -3.10905841 -3.27190930
[86,] 3.54103326 -3.10905841
[87,] 2.39220944 3.54103326
[88,] 2.66102769 2.39220944
[89,] -3.83862491 2.66102769
[90,] -6.29833948 -3.83862491
[91,] -0.99426019 -6.29833948
[92,] -2.64948424 -0.99426019
[93,] -0.02328510 -2.64948424
[94,] -2.33069103 -0.02328510
[95,] 3.44502204 -2.33069103
[96,] -3.62455098 3.44502204
[97,] -3.28912624 -3.62455098
[98,] -3.17409325 -3.28912624
[99,] -3.24000299 -3.17409325
[100,] 0.24623667 -3.24000299
[101,] -1.54650023 0.24623667
[102,] -0.96526124 -1.54650023
[103,] -1.18915890 -0.96526124
[104,] -3.63005352 -1.18915890
[105,] -1.83119870 -3.63005352
[106,] -2.22854393 -1.83119870
[107,] -1.70408583 -2.22854393
[108,] 0.01755351 -1.70408583
[109,] -3.70118604 0.01755351
[110,] -4.73963161 -3.70118604
[111,] -8.47143503 -4.73963161
[112,] 2.79304625 -8.47143503
[113,] 11.49487730 2.79304625
[114,] 10.09788083 11.49487730
[115,] -0.84430337 10.09788083
[116,] 4.51509299 -0.84430337
[117,] 1.61860377 4.51509299
[118,] -1.10879277 1.61860377
[119,] -3.83426701 -1.10879277
[120,] 2.89613576 -3.83426701
[121,] 0.18344350 2.89613576
[122,] 5.01612980 0.18344350
[123,] -0.50345793 5.01612980
[124,] 1.03918853 -0.50345793
[125,] -1.50500163 1.03918853
[126,] 1.11257636 -1.50500163
[127,] 1.52482871 1.11257636
[128,] -1.76668823 1.52482871
[129,] 0.67631156 -1.76668823
[130,] 3.55245825 0.67631156
[131,] -4.11259932 3.55245825
[132,] 0.83924141 -4.11259932
[133,] -2.61754812 0.83924141
[134,] -6.18194933 -2.61754812
[135,] 2.02067646 -6.18194933
[136,] 0.05999593 2.02067646
[137,] 4.20059391 0.05999593
[138,] -0.95329499 4.20059391
[139,] 3.63097072 -0.95329499
[140,] 3.34685477 3.63097072
[141,] 4.34289763 3.34685477
[142,] 1.84467098 4.34289763
[143,] 1.23978887 1.84467098
[144,] 1.28481738 1.23978887
[145,] 4.15038123 1.28481738
[146,] -0.27095518 4.15038123
[147,] 0.19028603 -0.27095518
[148,] -6.98111578 0.19028603
[149,] -2.43810177 -6.98111578
[150,] 3.69690023 -2.43810177
[151,] 0.49168133 3.69690023
[152,] -2.51885322 0.49168133
[153,] 0.05404922 -2.51885322
[154,] 2.09464989 0.05404922
[155,] -1.57425386 2.09464989
[156,] 0.78137442 -1.57425386
[157,] 0.38550053 0.78137442
[158,] -6.58526068 0.38550053
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.20668254 -0.37884110
2 4.32643934 1.20668254
3 -2.70750467 4.32643934
4 0.01911251 -2.70750467
5 -2.46588862 0.01911251
6 2.31171728 -2.46588862
7 3.49728437 2.31171728
8 -1.94271597 3.49728437
9 -0.74820449 -1.94271597
10 -3.86734451 -0.74820449
11 -4.59755426 -3.86734451
12 -8.25881375 -4.59755426
13 -1.25266672 -8.25881375
14 3.47740599 -1.25266672
15 2.89410379 3.47740599
16 0.94643659 2.89410379
17 -2.70791131 0.94643659
18 -2.19358777 -2.70791131
19 -1.17930959 -2.19358777
20 1.31812874 -1.17930959
21 -3.65542817 1.31812874
22 -3.44481238 -3.65542817
23 -5.92648319 -3.44481238
24 -3.15058821 -5.92648319
25 0.52987661 -3.15058821
26 1.58292437 0.52987661
27 -4.37075314 1.58292437
28 0.09371709 -4.37075314
29 0.36721687 0.09371709
30 -0.12748509 0.36721687
31 2.76507991 -0.12748509
32 6.05766673 2.76507991
33 6.78573408 6.05766673
34 3.34106086 6.78573408
35 4.52972491 3.34106086
36 2.97205491 4.52972491
37 -0.20698213 2.97205491
38 1.84080947 -0.20698213
39 5.99712920 1.84080947
40 -1.53556330 5.99712920
41 1.51892063 -1.53556330
42 -5.66375134 1.51892063
43 2.81162946 -5.66375134
44 4.34285528 2.81162946
45 -0.25964905 4.34285528
46 -3.42286148 -0.25964905
47 7.28894537 -3.42286148
48 -0.02633935 7.28894537
49 3.17892601 -0.02633935
50 2.13224051 3.17892601
51 -1.11785403 2.13224051
52 -3.97264133 -1.11785403
53 -1.54570066 -3.97264133
54 3.31181715 -1.54570066
55 -1.27440433 3.31181715
56 1.76114744 -1.27440433
57 2.26403303 1.76114744
58 0.64182460 2.26403303
59 -1.73800154 0.64182460
60 1.83940818 -1.73800154
61 1.08198874 1.83940818
62 0.70354568 1.08198874
63 4.11708850 0.70354568
64 0.52400346 4.11708850
65 4.26951665 0.52400346
66 -4.54952942 4.26951665
67 5.55133789 -4.54952942
68 1.34763987 5.55133789
69 2.78183250 1.34763987
70 -4.96256651 2.78183250
71 -0.41593508 -4.96256651
72 -0.42271206 -0.41593508
73 -1.39986817 -0.42271206
74 -0.68474205 -1.39986817
75 -2.20240722 -0.68474205
76 1.80199002 -2.20240722
77 -0.38906739 1.80199002
78 0.13710298 -0.38906739
79 0.93370546 0.13710298
80 1.69500993 0.93370546
81 -6.69455058 1.69500993
82 -2.39798289 -6.69455058
83 1.13012456 -2.39798289
84 -3.27190930 1.13012456
85 -3.10905841 -3.27190930
86 3.54103326 -3.10905841
87 2.39220944 3.54103326
88 2.66102769 2.39220944
89 -3.83862491 2.66102769
90 -6.29833948 -3.83862491
91 -0.99426019 -6.29833948
92 -2.64948424 -0.99426019
93 -0.02328510 -2.64948424
94 -2.33069103 -0.02328510
95 3.44502204 -2.33069103
96 -3.62455098 3.44502204
97 -3.28912624 -3.62455098
98 -3.17409325 -3.28912624
99 -3.24000299 -3.17409325
100 0.24623667 -3.24000299
101 -1.54650023 0.24623667
102 -0.96526124 -1.54650023
103 -1.18915890 -0.96526124
104 -3.63005352 -1.18915890
105 -1.83119870 -3.63005352
106 -2.22854393 -1.83119870
107 -1.70408583 -2.22854393
108 0.01755351 -1.70408583
109 -3.70118604 0.01755351
110 -4.73963161 -3.70118604
111 -8.47143503 -4.73963161
112 2.79304625 -8.47143503
113 11.49487730 2.79304625
114 10.09788083 11.49487730
115 -0.84430337 10.09788083
116 4.51509299 -0.84430337
117 1.61860377 4.51509299
118 -1.10879277 1.61860377
119 -3.83426701 -1.10879277
120 2.89613576 -3.83426701
121 0.18344350 2.89613576
122 5.01612980 0.18344350
123 -0.50345793 5.01612980
124 1.03918853 -0.50345793
125 -1.50500163 1.03918853
126 1.11257636 -1.50500163
127 1.52482871 1.11257636
128 -1.76668823 1.52482871
129 0.67631156 -1.76668823
130 3.55245825 0.67631156
131 -4.11259932 3.55245825
132 0.83924141 -4.11259932
133 -2.61754812 0.83924141
134 -6.18194933 -2.61754812
135 2.02067646 -6.18194933
136 0.05999593 2.02067646
137 4.20059391 0.05999593
138 -0.95329499 4.20059391
139 3.63097072 -0.95329499
140 3.34685477 3.63097072
141 4.34289763 3.34685477
142 1.84467098 4.34289763
143 1.23978887 1.84467098
144 1.28481738 1.23978887
145 4.15038123 1.28481738
146 -0.27095518 4.15038123
147 0.19028603 -0.27095518
148 -6.98111578 0.19028603
149 -2.43810177 -6.98111578
150 3.69690023 -2.43810177
151 0.49168133 3.69690023
152 -2.51885322 0.49168133
153 0.05404922 -2.51885322
154 2.09464989 0.05404922
155 -1.57425386 2.09464989
156 0.78137442 -1.57425386
157 0.38550053 0.78137442
158 -6.58526068 0.38550053
> 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/7dyzh1322182367.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/8546z1322182367.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/9gp2z1322182367.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/10bd4o1322182367.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/111md41322182367.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/127dsg1322182367.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/13qcpi1322182367.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/143kth1322182367.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/15jtzo1322182367.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/16y6ne1322182367.tab")
+ }
>
> try(system("convert tmp/1uci31322182367.ps tmp/1uci31322182367.png",intern=TRUE))
character(0)
> try(system("convert tmp/2ila41322182367.ps tmp/2ila41322182367.png",intern=TRUE))
character(0)
> try(system("convert tmp/3coio1322182367.ps tmp/3coio1322182367.png",intern=TRUE))
character(0)
> try(system("convert tmp/43k0n1322182367.ps tmp/43k0n1322182367.png",intern=TRUE))
character(0)
> try(system("convert tmp/59dk81322182367.ps tmp/59dk81322182367.png",intern=TRUE))
character(0)
> try(system("convert tmp/6sqva1322182367.ps tmp/6sqva1322182367.png",intern=TRUE))
character(0)
> try(system("convert tmp/7dyzh1322182367.ps tmp/7dyzh1322182367.png",intern=TRUE))
character(0)
> try(system("convert tmp/8546z1322182367.ps tmp/8546z1322182367.png",intern=TRUE))
character(0)
> try(system("convert tmp/9gp2z1322182367.ps tmp/9gp2z1322182367.png",intern=TRUE))
character(0)
> try(system("convert tmp/10bd4o1322182367.ps tmp/10bd4o1322182367.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.959 0.578 5.551