R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(13
+ ,14
+ ,13
+ ,3
+ ,25
+ ,55
+ ,147
+ ,12
+ ,8
+ ,13
+ ,5
+ ,158
+ ,7
+ ,71
+ ,10
+ ,12
+ ,16
+ ,6
+ ,0
+ ,0
+ ,0
+ ,9
+ ,7
+ ,12
+ ,6
+ ,143
+ ,10
+ ,0
+ ,10
+ ,10
+ ,11
+ ,5
+ ,67
+ ,74
+ ,43
+ ,12
+ ,7
+ ,12
+ ,3
+ ,0
+ ,0
+ ,0
+ ,13
+ ,16
+ ,18
+ ,8
+ ,148
+ ,138
+ ,8
+ ,12
+ ,11
+ ,11
+ ,4
+ ,28
+ ,0
+ ,0
+ ,12
+ ,14
+ ,14
+ ,4
+ ,114
+ ,113
+ ,34
+ ,6
+ ,6
+ ,9
+ ,4
+ ,0
+ ,0
+ ,0
+ ,5
+ ,16
+ ,14
+ ,6
+ ,123
+ ,115
+ ,103
+ ,12
+ ,11
+ ,12
+ ,6
+ ,145
+ ,9
+ ,0
+ ,11
+ ,16
+ ,11
+ ,5
+ ,113
+ ,114
+ ,73
+ ,14
+ ,12
+ ,12
+ ,4
+ ,152
+ ,59
+ ,159
+ ,14
+ ,7
+ ,13
+ ,6
+ ,0
+ ,0
+ ,0
+ ,12
+ ,13
+ ,11
+ ,4
+ ,36
+ ,114
+ ,113
+ ,12
+ ,11
+ ,12
+ ,6
+ ,0
+ ,0
+ ,0
+ ,11
+ ,15
+ ,16
+ ,6
+ ,8
+ ,102
+ ,44
+ ,11
+ ,7
+ ,9
+ ,4
+ ,108
+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86
+ ,139
+ ,17
+ ,12
+ ,14
+ ,14
+ ,6
+ ,33
+ ,145
+ ,100
+ ,12
+ ,14
+ ,16
+ ,4
+ ,152
+ ,55
+ ,70
+ ,10
+ ,10
+ ,6
+ ,4
+ ,51
+ ,41
+ ,0
+ ,12
+ ,10
+ ,13
+ ,4
+ ,48
+ ,25
+ ,123
+ ,13
+ ,4
+ ,13
+ ,6
+ ,97
+ ,47
+ ,109
+ ,12
+ ,8
+ ,14
+ ,5
+ ,77
+ ,0
+ ,0
+ ,15
+ ,15
+ ,15
+ ,6
+ ,130
+ ,143
+ ,37
+ ,11
+ ,16
+ ,14
+ ,6
+ ,8
+ ,102
+ ,44
+ ,12
+ ,12
+ ,15
+ ,8
+ ,84
+ ,148
+ ,98
+ ,11
+ ,12
+ ,13
+ ,7
+ ,51
+ ,153
+ ,11
+ ,12
+ ,15
+ ,16
+ ,7
+ ,33
+ ,32
+ ,9
+ ,11
+ ,9
+ ,12
+ ,4
+ ,6
+ ,106
+ ,0
+ ,10
+ ,12
+ ,15
+ ,6
+ ,116
+ ,63
+ ,57
+ ,11
+ ,14
+ ,12
+ ,6
+ ,88
+ ,56
+ ,63
+ ,11
+ ,11
+ ,14
+ ,2
+ ,142
+ ,39
+ ,66)
+ ,dim=c(7
+ ,156)
+ ,dimnames=list(c('findingfriends'
+ ,'knowingPeople'
+ ,'liked'
+ ,'celebrity'
+ ,'friend'
+ ,'secondbestfriend'
+ ,'thirdbestfriend')
+ ,1:156))
> y <- array(NA,dim=c(7,156),dimnames=list(c('findingfriends','knowingPeople','liked','celebrity','friend','secondbestfriend','thirdbestfriend'),1:156))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.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 = '3'
> ylab = ''
> xlab = ''
> main = ''
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
liked findingfriends knowingPeople celebrity friend secondbestfriend
1 13 13 14 3 25 55
2 13 12 8 5 158 7
3 16 10 12 6 0 0
4 12 9 7 6 143 10
5 11 10 10 5 67 74
6 12 12 7 3 0 0
7 18 13 16 8 148 138
8 11 12 11 4 28 0
9 14 12 14 4 114 113
10 9 6 6 4 0 0
11 14 5 16 6 123 115
12 12 12 11 6 145 9
13 11 11 16 5 113 114
14 12 14 12 4 152 59
15 13 14 7 6 0 0
16 11 12 13 4 36 114
17 12 12 11 6 0 0
18 16 11 15 6 8 102
19 9 11 7 4 108 0
20 11 7 9 4 112 86
21 13 9 7 2 51 17
22 15 11 14 7 43 45
23 10 11 15 5 120 123
24 11 12 7 4 13 24
25 13 12 15 6 55 5
26 16 11 17 6 103 123
27 15 11 15 7 127 136
28 14 8 14 5 14 4
29 14 9 14 6 135 76
30 14 12 8 4 38 99
31 8 10 8 4 11 98
32 13 10 14 7 43 67
33 15 12 14 7 141 92
34 13 8 8 4 62 13
35 11 12 11 4 62 24
36 15 11 16 6 135 129
37 15 12 10 6 117 117
38 9 7 8 5 82 11
39 13 11 14 6 145 20
40 16 11 16 7 87 91
41 13 12 13 6 76 111
42 11 9 5 3 124 0
43 12 15 8 3 151 58
44 12 11 10 4 131 0
45 12 11 8 6 127 146
46 14 11 13 7 76 129
47 14 11 15 5 25 48
48 8 15 6 4 0 0
49 13 11 12 5 58 111
50 16 12 16 6 115 32
51 13 12 5 6 130 112
52 11 9 15 6 17 51
53 14 12 12 5 102 53
54 13 12 8 4 21 131
55 13 13 13 5 0 0
56 13 11 14 5 14 76
57 12 9 12 4 110 106
58 16 9 16 6 133 26
59 15 11 10 2 83 44
60 15 11 15 8 56 63
61 12 12 8 3 0 0
62 14 12 16 6 44 116
63 12 9 19 6 70 119
64 15 11 14 6 36 18
65 12 9 6 5 5 134
66 13 12 13 5 118 138
67 12 12 15 6 17 41
68 12 12 7 5 79 0
69 13 12 13 6 122 57
70 5 14 4 2 119 101
71 13 11 14 5 36 114
72 13 12 13 5 36 113
73 14 11 11 5 141 122
74 17 6 14 6 0 14
75 13 10 12 6 37 10
76 13 12 15 6 110 27
77 12 13 14 5 10 39
78 13 8 13 5 14 133
79 14 12 8 4 157 42
80 11 12 6 2 59 0
81 12 12 7 4 77 58
82 12 6 13 6 129 133
83 16 11 13 6 125 151
84 12 10 11 5 87 111
85 12 12 5 3 61 139
86 12 13 12 6 146 126
87 10 11 8 4 96 139
88 15 7 11 5 133 138
89 15 11 14 8 47 52
90 12 11 9 4 74 67
91 16 11 10 6 109 97
92 15 11 13 6 30 137
93 16 12 16 7 116 56
94 13 10 16 6 149 3
95 12 11 11 5 19 78
96 11 12 8 4 96 0
97 13 7 4 6 0 0
98 10 13 7 3 21 0
99 15 8 14 5 26 118
100 13 12 11 6 156 39
101 16 11 17 7 53 63
102 15 12 15 7 72 78
103 18 14 17 6 27 26
104 13 10 5 3 66 50
105 10 10 4 2 71 104
106 16 13 10 8 66 54
107 13 10 11 3 40 104
108 15 11 15 8 57 148
109 14 10 10 3 3 30
110 15 7 9 4 12 38
111 14 10 12 5 107 132
112 13 8 15 7 80 132
113 13 12 7 6 98 84
114 15 12 13 6 155 71
115 16 12 12 7 111 125
116 14 11 14 6 81 25
117 14 12 14 6 50 66
118 16 12 8 6 49 86
119 14 12 15 6 96 61
120 12 11 12 4 2 60
121 13 12 12 4 1 144
122 12 11 16 5 22 120
123 12 11 9 4 64 139
124 14 13 15 6 56 131
125 14 12 15 6 144 159
126 14 12 6 5 0 0
127 16 12 14 8 94 18
128 13 12 15 6 25 123
129 14 8 10 5 93 18
130 4 8 6 4 0 0
131 16 12 14 8 48 123
132 13 11 12 6 30 105
133 16 12 8 4 19 0
134 15 13 11 6 0 0
135 14 12 13 6 10 68
136 13 12 9 4 78 157
137 14 11 15 6 93 94
138 12 12 13 3 0 0
139 15 12 15 6 95 87
140 14 10 14 5 50 156
141 13 11 16 4 86 139
142 14 12 14 6 33 145
143 16 12 14 4 152 55
144 6 10 10 4 51 41
145 13 12 10 4 48 25
146 13 13 4 6 97 47
147 14 12 8 5 77 0
148 15 15 15 6 130 143
149 14 11 16 6 8 102
150 15 12 12 8 84 148
151 13 11 12 7 51 153
152 16 12 15 7 33 32
153 12 11 9 4 6 106
154 15 10 12 6 116 63
155 12 11 14 6 88 56
156 14 11 11 2 142 39
thirdbestfriend
1 147
2 71
3 0
4 0
5 43
6 0
7 8
8 0
9 34
10 0
11 103
12 0
13 73
14 159
15 0
16 113
17 0
18 44
19 0
20 0
21 41
22 74
23 0
24 0
25 0
26 32
27 126
28 154
29 129
30 98
31 82
32 45
33 8
34 0
35 129
36 31
37 117
38 99
39 55
40 132
41 58
42 0
43 0
44 0
45 101
46 31
47 147
48 0
49 132
50 123
51 39
52 136
53 141
54 0
55 0
56 135
57 118
58 154
59 0
60 116
61 0
62 88
63 25
64 113
65 157
66 26
67 38
68 0
69 53
70 0
71 106
72 106
73 102
74 138
75 142
76 73
77 130
78 86
79 78
80 0
81 0
82 4
83 91
84 132
85 0
86 0
87 0
88 14
89 97
90 45
91 0
92 149
93 57
94 105
95 0
96 0
97 0
98 0
99 128
100 29
101 148
102 93
103 4
104 0
105 158
106 144
107 0
108 122
109 149
110 17
111 91
112 111
113 99
114 40
115 132
116 123
117 54
118 90
119 86
120 152
121 152
122 123
123 100
124 116
125 59
126 0
127 5
128 147
129 139
130 0
131 81
132 3
133 0
134 0
135 37
136 5
137 69
138 0
139 0
140 142
141 17
142 100
143 70
144 0
145 123
146 109
147 0
148 37
149 44
150 98
151 11
152 9
153 0
154 57
155 63
156 66
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) findingfriends knowingPeople celebrity
6.899816 0.097864 0.167368 0.571325
friend secondbestfriend thirdbestfriend
0.002437 -0.001318 0.003365
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.9722414 -0.9171556 0.0009425 1.0294973 4.2552573
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.899816 1.064182 6.484 1.24e-09 ***
findingfriends 0.097864 0.081463 1.201 0.23153
knowingPeople 0.167368 0.052260 3.203 0.00167 **
celebrity 0.571325 0.123606 4.622 8.17e-06 ***
friend 0.002437 0.003014 0.809 0.41997
secondbestfriend -0.001318 0.003026 -0.435 0.66386
thirdbestfriend 0.003365 0.002783 1.209 0.22852
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.776 on 149 degrees of freedom
Multiple R-squared: 0.3593, Adjusted R-squared: 0.3335
F-statistic: 13.92 on 6 and 149 DF, p-value: 1.545e-12
> 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.62660566 0.74678868 0.3733943
[2,] 0.48463691 0.96927382 0.5153631
[3,] 0.52034685 0.95930630 0.4796532
[4,] 0.70005711 0.59988579 0.2999429
[5,] 0.60719142 0.78561716 0.3928086
[6,] 0.57382291 0.85235418 0.4261771
[7,] 0.53947340 0.92105319 0.4605266
[8,] 0.56529374 0.86941253 0.4347063
[9,] 0.53287316 0.93425367 0.4671268
[10,] 0.50588164 0.98823672 0.4941184
[11,] 0.43874079 0.87748158 0.5612592
[12,] 0.70430643 0.59138714 0.2956936
[13,] 0.63587032 0.72825935 0.3641297
[14,] 0.76506756 0.46986489 0.2349324
[15,] 0.70814732 0.58370536 0.2918527
[16,] 0.65844199 0.68311603 0.3415580
[17,] 0.65548865 0.68902269 0.3445113
[18,] 0.59021280 0.81957439 0.4097872
[19,] 0.52586847 0.94826305 0.4741315
[20,] 0.45954442 0.91908884 0.5404556
[21,] 0.45055868 0.90111735 0.5494413
[22,] 0.67668298 0.64663404 0.3233170
[23,] 0.66103047 0.67793907 0.3389695
[24,] 0.60972010 0.78055979 0.3902799
[25,] 0.62151545 0.75696910 0.3784845
[26,] 0.59958465 0.80083069 0.4004153
[27,] 0.55343032 0.89313936 0.4465697
[28,] 0.53690382 0.92619236 0.4630962
[29,] 0.62053794 0.75892413 0.3794621
[30,] 0.57928588 0.84142823 0.4207141
[31,] 0.53451848 0.93096304 0.4654815
[32,] 0.49548535 0.99097069 0.5045147
[33,] 0.47030587 0.94061174 0.5296941
[34,] 0.42299018 0.84598035 0.5770098
[35,] 0.37397096 0.74794191 0.6260290
[36,] 0.33821336 0.67642673 0.6617866
[37,] 0.29133542 0.58267084 0.7086646
[38,] 0.24863673 0.49727346 0.7513633
[39,] 0.37504871 0.75009741 0.6249513
[40,] 0.32664004 0.65328008 0.6733600
[41,] 0.30367857 0.60735713 0.6963214
[42,] 0.27263156 0.54526311 0.7273684
[43,] 0.35733393 0.71466786 0.6426661
[44,] 0.31947279 0.63894557 0.6805272
[45,] 0.30820804 0.61641608 0.6917920
[46,] 0.26545525 0.53091051 0.7345447
[47,] 0.22775783 0.45551565 0.7722422
[48,] 0.19456608 0.38913217 0.8054339
[49,] 0.18745254 0.37490508 0.8125475
[50,] 0.35102939 0.70205877 0.6489706
[51,] 0.30948812 0.61897625 0.6905119
[52,] 0.27878250 0.55756500 0.7212175
[53,] 0.24099546 0.48199092 0.7590045
[54,] 0.28998948 0.57997896 0.7100105
[55,] 0.26404987 0.52809974 0.7359501
[56,] 0.23009648 0.46019296 0.7699035
[57,] 0.19591309 0.39182619 0.8040869
[58,] 0.20620937 0.41241873 0.7937906
[59,] 0.17492749 0.34985499 0.8250725
[60,] 0.15526035 0.31052069 0.8447397
[61,] 0.45780456 0.91560913 0.5421954
[62,] 0.41300800 0.82601599 0.5869920
[63,] 0.36918884 0.73837768 0.6308112
[64,] 0.33757992 0.67515985 0.6624201
[65,] 0.45485556 0.90971112 0.5451444
[66,] 0.41767981 0.83535961 0.5823202
[67,] 0.40644350 0.81288699 0.5935565
[68,] 0.40866297 0.81732594 0.5913370
[69,] 0.36426612 0.72853223 0.6357339
[70,] 0.36215525 0.72431050 0.6378447
[71,] 0.32676734 0.65353468 0.6732327
[72,] 0.29028718 0.58057436 0.7097128
[73,] 0.26582868 0.53165737 0.7341713
[74,] 0.28000484 0.56000968 0.7199952
[75,] 0.25541549 0.51083097 0.7445845
[76,] 0.24182185 0.48364371 0.7581781
[77,] 0.24806762 0.49613524 0.7519324
[78,] 0.25200354 0.50400708 0.7479965
[79,] 0.29287628 0.58575255 0.7071237
[80,] 0.25394364 0.50788729 0.7460564
[81,] 0.21891075 0.43782150 0.7810893
[82,] 0.27088154 0.54176308 0.7291185
[83,] 0.24608086 0.49216171 0.7539191
[84,] 0.21739365 0.43478729 0.7826064
[85,] 0.21824804 0.43649609 0.7817520
[86,] 0.18839959 0.37679918 0.8116004
[87,] 0.17883842 0.35767684 0.8211616
[88,] 0.17175545 0.34351090 0.8282445
[89,] 0.17741876 0.35483752 0.8225812
[90,] 0.20220792 0.40441583 0.7977921
[91,] 0.19303733 0.38607465 0.8069627
[92,] 0.16711084 0.33422168 0.8328892
[93,] 0.13836260 0.27672520 0.8616374
[94,] 0.19313064 0.38626129 0.8068694
[95,] 0.20788841 0.41577682 0.7921116
[96,] 0.18085929 0.36171857 0.8191407
[97,] 0.15618606 0.31237212 0.8438139
[98,] 0.15046129 0.30092257 0.8495387
[99,] 0.12321879 0.24643757 0.8767812
[100,] 0.13614531 0.27229063 0.8638547
[101,] 0.42180070 0.84360141 0.5781993
[102,] 0.39948452 0.79896903 0.6005155
[103,] 0.37767358 0.75534715 0.6223264
[104,] 0.34602171 0.69204342 0.6539783
[105,] 0.30521106 0.61042211 0.6947889
[106,] 0.27311957 0.54623914 0.7268804
[107,] 0.23271854 0.46543707 0.7672815
[108,] 0.19366174 0.38732349 0.8063383
[109,] 0.23416162 0.46832324 0.7658384
[110,] 0.21098240 0.42196480 0.7890176
[111,] 0.17591292 0.35182584 0.8240871
[112,] 0.14214354 0.28428708 0.8578565
[113,] 0.13040797 0.26081594 0.8695920
[114,] 0.10211801 0.20423602 0.8978820
[115,] 0.09205772 0.18411545 0.9079423
[116,] 0.07489508 0.14979017 0.9251049
[117,] 0.08032898 0.16065796 0.9196710
[118,] 0.06035653 0.12071305 0.9396435
[119,] 0.06705446 0.13410892 0.9329455
[120,] 0.09306506 0.18613011 0.9069349
[121,] 0.35438313 0.70876626 0.6456169
[122,] 0.30514448 0.61028897 0.6948555
[123,] 0.24641520 0.49283040 0.7535848
[124,] 0.46860488 0.93720975 0.5313951
[125,] 0.44107547 0.88215094 0.5589245
[126,] 0.37204496 0.74408992 0.6279550
[127,] 0.33055854 0.66111708 0.6694415
[128,] 0.26610513 0.53221026 0.7338949
[129,] 0.20058348 0.40116696 0.7994165
[130,] 0.14954739 0.29909477 0.8504526
[131,] 0.10793006 0.21586012 0.8920699
[132,] 0.07006605 0.14013210 0.9299339
[133,] 0.04246561 0.08493122 0.9575344
[134,] 0.03187074 0.06374147 0.9681293
[135,] 0.71899027 0.56201945 0.2810097
[136,] 0.57733255 0.84533489 0.4226674
[137,] 0.42710416 0.85420832 0.5728958
> postscript(file="/var/www/html/rcomp/tmp/1gk5m1291304497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2rbnp1291304497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3rbnp1291304497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/4rbnp1291304497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/5klms1291304497.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 = 156
Frequency = 1
1 2 3 4 5 6
0.287642481 0.115435980 2.685170102 -0.715467227 -1.619256167 1.040257717
7 8 9 10 11 12
2.373685410 -1.268782181 1.054003682 -1.776512490 0.010151227 -1.684725678
13 14 15 16 17 18
-2.881691872 -1.391450944 0.130553234 -1.853080239 -1.343190628 2.052042938
19 20 21 22 23 24
-2.696421854 -0.536114350 2.665297466 0.386702005 -3.473843905 -0.531122877
25 26 27 28 29 30
-1.140120815 1.553831935 -0.040472498 0.570355209 -0.214715158 2.009600725
31 32 33 34 35 36
-3.676335894 -1.388842131 0.334050946 1.559047090 -1.754165215 0.654481921
37 38 39 40 41 42
1.299451491 -3.298975512 -1.259570568 0.810151782 -0.912071530 0.366373267
43 44 45 46 47 48
0.287712341 -0.254582312 -1.200254599 -0.270943190 0.164127907 -3.657292661
49 50 51 52 53 54
-0.280688972 1.167906841 0.360526482 -3.150996899 0.407484828 1.423020923
55 56 57 58 59 60
-0.204466300 -0.564409145 -0.599842459 1.305393635 4.063039507 -0.501303791
61 62 63 64 65 66
0.872889520 -0.430560341 -2.486460621 0.808252290 -0.005405011 -0.299832169
67 68 69 70 71 72
-2.127952286 -0.294932368 -1.078519659 -5.238967005 -0.470350838 -0.402164952
73 74 75 76 77 78
0.799851217 3.295905977 -0.869725598 -1.490854428 -1.782322214 0.136577994
79 80 81 82 83 84
1.711764722 0.635155617 0.357702400 -1.243328704 2.008022819 -1.086135447
85 86 87 88 89 90
1.409505018 -1.798207384 -1.651362700 2.528054061 -0.262553002 -0.011443611
91 92 93 94 95 96
2.784217186 1.025910544 0.847894088 -1.696868468 -0.617515888 -0.932407976
97 98 99 100 101 102
1.317709070 -1.108788189 1.778845625 -0.769598332 0.634901457 0.030335167
103 104 105 106 107 108
3.411868689 2.475759454 -0.258314389 1.009342244 1.606081540 -0.411916805
109 110 111 112 113 114
2.264650178 3.587137061 0.863411369 -1.587119439 -0.135047331 0.903253390
115 116 117 118 119 120
1.368073847 -0.325852040 -0.061913469 2.849932803 -0.455677814 -0.707399650
121 122 123 124 125 126
0.307872294 -1.820272247 -0.077287555 -0.464768713 -0.352647102 2.064975544
127 128 129 130 131 132
0.789850407 -1.406223174 1.116220264 -6.972241417 0.784560089 -0.357533137
133 134 135 136 137 138
4.255257315 1.558944909 0.262791949 1.134168332 -0.249799683 0.036048534
139 140 141 142 143 144
0.870454223 0.527585188 -0.023149225 -0.071182731 2.763797409 -5.907709173
145 146 147 148 149 150
0.468834638 0.189214906 1.542573858 0.440835343 -0.115325259 0.007289993
151 152 153 154 155 156
-0.943706876 1.347465270 0.357129174 1.293645923 -2.100130790 2.523165287
> postscript(file="/var/www/html/rcomp/tmp/6klms1291304497.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 = 156
Frequency = 1
lag(myerror, k = 1) myerror
0 0.287642481 NA
1 0.115435980 0.287642481
2 2.685170102 0.115435980
3 -0.715467227 2.685170102
4 -1.619256167 -0.715467227
5 1.040257717 -1.619256167
6 2.373685410 1.040257717
7 -1.268782181 2.373685410
8 1.054003682 -1.268782181
9 -1.776512490 1.054003682
10 0.010151227 -1.776512490
11 -1.684725678 0.010151227
12 -2.881691872 -1.684725678
13 -1.391450944 -2.881691872
14 0.130553234 -1.391450944
15 -1.853080239 0.130553234
16 -1.343190628 -1.853080239
17 2.052042938 -1.343190628
18 -2.696421854 2.052042938
19 -0.536114350 -2.696421854
20 2.665297466 -0.536114350
21 0.386702005 2.665297466
22 -3.473843905 0.386702005
23 -0.531122877 -3.473843905
24 -1.140120815 -0.531122877
25 1.553831935 -1.140120815
26 -0.040472498 1.553831935
27 0.570355209 -0.040472498
28 -0.214715158 0.570355209
29 2.009600725 -0.214715158
30 -3.676335894 2.009600725
31 -1.388842131 -3.676335894
32 0.334050946 -1.388842131
33 1.559047090 0.334050946
34 -1.754165215 1.559047090
35 0.654481921 -1.754165215
36 1.299451491 0.654481921
37 -3.298975512 1.299451491
38 -1.259570568 -3.298975512
39 0.810151782 -1.259570568
40 -0.912071530 0.810151782
41 0.366373267 -0.912071530
42 0.287712341 0.366373267
43 -0.254582312 0.287712341
44 -1.200254599 -0.254582312
45 -0.270943190 -1.200254599
46 0.164127907 -0.270943190
47 -3.657292661 0.164127907
48 -0.280688972 -3.657292661
49 1.167906841 -0.280688972
50 0.360526482 1.167906841
51 -3.150996899 0.360526482
52 0.407484828 -3.150996899
53 1.423020923 0.407484828
54 -0.204466300 1.423020923
55 -0.564409145 -0.204466300
56 -0.599842459 -0.564409145
57 1.305393635 -0.599842459
58 4.063039507 1.305393635
59 -0.501303791 4.063039507
60 0.872889520 -0.501303791
61 -0.430560341 0.872889520
62 -2.486460621 -0.430560341
63 0.808252290 -2.486460621
64 -0.005405011 0.808252290
65 -0.299832169 -0.005405011
66 -2.127952286 -0.299832169
67 -0.294932368 -2.127952286
68 -1.078519659 -0.294932368
69 -5.238967005 -1.078519659
70 -0.470350838 -5.238967005
71 -0.402164952 -0.470350838
72 0.799851217 -0.402164952
73 3.295905977 0.799851217
74 -0.869725598 3.295905977
75 -1.490854428 -0.869725598
76 -1.782322214 -1.490854428
77 0.136577994 -1.782322214
78 1.711764722 0.136577994
79 0.635155617 1.711764722
80 0.357702400 0.635155617
81 -1.243328704 0.357702400
82 2.008022819 -1.243328704
83 -1.086135447 2.008022819
84 1.409505018 -1.086135447
85 -1.798207384 1.409505018
86 -1.651362700 -1.798207384
87 2.528054061 -1.651362700
88 -0.262553002 2.528054061
89 -0.011443611 -0.262553002
90 2.784217186 -0.011443611
91 1.025910544 2.784217186
92 0.847894088 1.025910544
93 -1.696868468 0.847894088
94 -0.617515888 -1.696868468
95 -0.932407976 -0.617515888
96 1.317709070 -0.932407976
97 -1.108788189 1.317709070
98 1.778845625 -1.108788189
99 -0.769598332 1.778845625
100 0.634901457 -0.769598332
101 0.030335167 0.634901457
102 3.411868689 0.030335167
103 2.475759454 3.411868689
104 -0.258314389 2.475759454
105 1.009342244 -0.258314389
106 1.606081540 1.009342244
107 -0.411916805 1.606081540
108 2.264650178 -0.411916805
109 3.587137061 2.264650178
110 0.863411369 3.587137061
111 -1.587119439 0.863411369
112 -0.135047331 -1.587119439
113 0.903253390 -0.135047331
114 1.368073847 0.903253390
115 -0.325852040 1.368073847
116 -0.061913469 -0.325852040
117 2.849932803 -0.061913469
118 -0.455677814 2.849932803
119 -0.707399650 -0.455677814
120 0.307872294 -0.707399650
121 -1.820272247 0.307872294
122 -0.077287555 -1.820272247
123 -0.464768713 -0.077287555
124 -0.352647102 -0.464768713
125 2.064975544 -0.352647102
126 0.789850407 2.064975544
127 -1.406223174 0.789850407
128 1.116220264 -1.406223174
129 -6.972241417 1.116220264
130 0.784560089 -6.972241417
131 -0.357533137 0.784560089
132 4.255257315 -0.357533137
133 1.558944909 4.255257315
134 0.262791949 1.558944909
135 1.134168332 0.262791949
136 -0.249799683 1.134168332
137 0.036048534 -0.249799683
138 0.870454223 0.036048534
139 0.527585188 0.870454223
140 -0.023149225 0.527585188
141 -0.071182731 -0.023149225
142 2.763797409 -0.071182731
143 -5.907709173 2.763797409
144 0.468834638 -5.907709173
145 0.189214906 0.468834638
146 1.542573858 0.189214906
147 0.440835343 1.542573858
148 -0.115325259 0.440835343
149 0.007289993 -0.115325259
150 -0.943706876 0.007289993
151 1.347465270 -0.943706876
152 0.357129174 1.347465270
153 1.293645923 0.357129174
154 -2.100130790 1.293645923
155 2.523165287 -2.100130790
156 NA 2.523165287
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.115435980 0.287642481
[2,] 2.685170102 0.115435980
[3,] -0.715467227 2.685170102
[4,] -1.619256167 -0.715467227
[5,] 1.040257717 -1.619256167
[6,] 2.373685410 1.040257717
[7,] -1.268782181 2.373685410
[8,] 1.054003682 -1.268782181
[9,] -1.776512490 1.054003682
[10,] 0.010151227 -1.776512490
[11,] -1.684725678 0.010151227
[12,] -2.881691872 -1.684725678
[13,] -1.391450944 -2.881691872
[14,] 0.130553234 -1.391450944
[15,] -1.853080239 0.130553234
[16,] -1.343190628 -1.853080239
[17,] 2.052042938 -1.343190628
[18,] -2.696421854 2.052042938
[19,] -0.536114350 -2.696421854
[20,] 2.665297466 -0.536114350
[21,] 0.386702005 2.665297466
[22,] -3.473843905 0.386702005
[23,] -0.531122877 -3.473843905
[24,] -1.140120815 -0.531122877
[25,] 1.553831935 -1.140120815
[26,] -0.040472498 1.553831935
[27,] 0.570355209 -0.040472498
[28,] -0.214715158 0.570355209
[29,] 2.009600725 -0.214715158
[30,] -3.676335894 2.009600725
[31,] -1.388842131 -3.676335894
[32,] 0.334050946 -1.388842131
[33,] 1.559047090 0.334050946
[34,] -1.754165215 1.559047090
[35,] 0.654481921 -1.754165215
[36,] 1.299451491 0.654481921
[37,] -3.298975512 1.299451491
[38,] -1.259570568 -3.298975512
[39,] 0.810151782 -1.259570568
[40,] -0.912071530 0.810151782
[41,] 0.366373267 -0.912071530
[42,] 0.287712341 0.366373267
[43,] -0.254582312 0.287712341
[44,] -1.200254599 -0.254582312
[45,] -0.270943190 -1.200254599
[46,] 0.164127907 -0.270943190
[47,] -3.657292661 0.164127907
[48,] -0.280688972 -3.657292661
[49,] 1.167906841 -0.280688972
[50,] 0.360526482 1.167906841
[51,] -3.150996899 0.360526482
[52,] 0.407484828 -3.150996899
[53,] 1.423020923 0.407484828
[54,] -0.204466300 1.423020923
[55,] -0.564409145 -0.204466300
[56,] -0.599842459 -0.564409145
[57,] 1.305393635 -0.599842459
[58,] 4.063039507 1.305393635
[59,] -0.501303791 4.063039507
[60,] 0.872889520 -0.501303791
[61,] -0.430560341 0.872889520
[62,] -2.486460621 -0.430560341
[63,] 0.808252290 -2.486460621
[64,] -0.005405011 0.808252290
[65,] -0.299832169 -0.005405011
[66,] -2.127952286 -0.299832169
[67,] -0.294932368 -2.127952286
[68,] -1.078519659 -0.294932368
[69,] -5.238967005 -1.078519659
[70,] -0.470350838 -5.238967005
[71,] -0.402164952 -0.470350838
[72,] 0.799851217 -0.402164952
[73,] 3.295905977 0.799851217
[74,] -0.869725598 3.295905977
[75,] -1.490854428 -0.869725598
[76,] -1.782322214 -1.490854428
[77,] 0.136577994 -1.782322214
[78,] 1.711764722 0.136577994
[79,] 0.635155617 1.711764722
[80,] 0.357702400 0.635155617
[81,] -1.243328704 0.357702400
[82,] 2.008022819 -1.243328704
[83,] -1.086135447 2.008022819
[84,] 1.409505018 -1.086135447
[85,] -1.798207384 1.409505018
[86,] -1.651362700 -1.798207384
[87,] 2.528054061 -1.651362700
[88,] -0.262553002 2.528054061
[89,] -0.011443611 -0.262553002
[90,] 2.784217186 -0.011443611
[91,] 1.025910544 2.784217186
[92,] 0.847894088 1.025910544
[93,] -1.696868468 0.847894088
[94,] -0.617515888 -1.696868468
[95,] -0.932407976 -0.617515888
[96,] 1.317709070 -0.932407976
[97,] -1.108788189 1.317709070
[98,] 1.778845625 -1.108788189
[99,] -0.769598332 1.778845625
[100,] 0.634901457 -0.769598332
[101,] 0.030335167 0.634901457
[102,] 3.411868689 0.030335167
[103,] 2.475759454 3.411868689
[104,] -0.258314389 2.475759454
[105,] 1.009342244 -0.258314389
[106,] 1.606081540 1.009342244
[107,] -0.411916805 1.606081540
[108,] 2.264650178 -0.411916805
[109,] 3.587137061 2.264650178
[110,] 0.863411369 3.587137061
[111,] -1.587119439 0.863411369
[112,] -0.135047331 -1.587119439
[113,] 0.903253390 -0.135047331
[114,] 1.368073847 0.903253390
[115,] -0.325852040 1.368073847
[116,] -0.061913469 -0.325852040
[117,] 2.849932803 -0.061913469
[118,] -0.455677814 2.849932803
[119,] -0.707399650 -0.455677814
[120,] 0.307872294 -0.707399650
[121,] -1.820272247 0.307872294
[122,] -0.077287555 -1.820272247
[123,] -0.464768713 -0.077287555
[124,] -0.352647102 -0.464768713
[125,] 2.064975544 -0.352647102
[126,] 0.789850407 2.064975544
[127,] -1.406223174 0.789850407
[128,] 1.116220264 -1.406223174
[129,] -6.972241417 1.116220264
[130,] 0.784560089 -6.972241417
[131,] -0.357533137 0.784560089
[132,] 4.255257315 -0.357533137
[133,] 1.558944909 4.255257315
[134,] 0.262791949 1.558944909
[135,] 1.134168332 0.262791949
[136,] -0.249799683 1.134168332
[137,] 0.036048534 -0.249799683
[138,] 0.870454223 0.036048534
[139,] 0.527585188 0.870454223
[140,] -0.023149225 0.527585188
[141,] -0.071182731 -0.023149225
[142,] 2.763797409 -0.071182731
[143,] -5.907709173 2.763797409
[144,] 0.468834638 -5.907709173
[145,] 0.189214906 0.468834638
[146,] 1.542573858 0.189214906
[147,] 0.440835343 1.542573858
[148,] -0.115325259 0.440835343
[149,] 0.007289993 -0.115325259
[150,] -0.943706876 0.007289993
[151,] 1.347465270 -0.943706876
[152,] 0.357129174 1.347465270
[153,] 1.293645923 0.357129174
[154,] -2.100130790 1.293645923
[155,] 2.523165287 -2.100130790
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.115435980 0.287642481
2 2.685170102 0.115435980
3 -0.715467227 2.685170102
4 -1.619256167 -0.715467227
5 1.040257717 -1.619256167
6 2.373685410 1.040257717
7 -1.268782181 2.373685410
8 1.054003682 -1.268782181
9 -1.776512490 1.054003682
10 0.010151227 -1.776512490
11 -1.684725678 0.010151227
12 -2.881691872 -1.684725678
13 -1.391450944 -2.881691872
14 0.130553234 -1.391450944
15 -1.853080239 0.130553234
16 -1.343190628 -1.853080239
17 2.052042938 -1.343190628
18 -2.696421854 2.052042938
19 -0.536114350 -2.696421854
20 2.665297466 -0.536114350
21 0.386702005 2.665297466
22 -3.473843905 0.386702005
23 -0.531122877 -3.473843905
24 -1.140120815 -0.531122877
25 1.553831935 -1.140120815
26 -0.040472498 1.553831935
27 0.570355209 -0.040472498
28 -0.214715158 0.570355209
29 2.009600725 -0.214715158
30 -3.676335894 2.009600725
31 -1.388842131 -3.676335894
32 0.334050946 -1.388842131
33 1.559047090 0.334050946
34 -1.754165215 1.559047090
35 0.654481921 -1.754165215
36 1.299451491 0.654481921
37 -3.298975512 1.299451491
38 -1.259570568 -3.298975512
39 0.810151782 -1.259570568
40 -0.912071530 0.810151782
41 0.366373267 -0.912071530
42 0.287712341 0.366373267
43 -0.254582312 0.287712341
44 -1.200254599 -0.254582312
45 -0.270943190 -1.200254599
46 0.164127907 -0.270943190
47 -3.657292661 0.164127907
48 -0.280688972 -3.657292661
49 1.167906841 -0.280688972
50 0.360526482 1.167906841
51 -3.150996899 0.360526482
52 0.407484828 -3.150996899
53 1.423020923 0.407484828
54 -0.204466300 1.423020923
55 -0.564409145 -0.204466300
56 -0.599842459 -0.564409145
57 1.305393635 -0.599842459
58 4.063039507 1.305393635
59 -0.501303791 4.063039507
60 0.872889520 -0.501303791
61 -0.430560341 0.872889520
62 -2.486460621 -0.430560341
63 0.808252290 -2.486460621
64 -0.005405011 0.808252290
65 -0.299832169 -0.005405011
66 -2.127952286 -0.299832169
67 -0.294932368 -2.127952286
68 -1.078519659 -0.294932368
69 -5.238967005 -1.078519659
70 -0.470350838 -5.238967005
71 -0.402164952 -0.470350838
72 0.799851217 -0.402164952
73 3.295905977 0.799851217
74 -0.869725598 3.295905977
75 -1.490854428 -0.869725598
76 -1.782322214 -1.490854428
77 0.136577994 -1.782322214
78 1.711764722 0.136577994
79 0.635155617 1.711764722
80 0.357702400 0.635155617
81 -1.243328704 0.357702400
82 2.008022819 -1.243328704
83 -1.086135447 2.008022819
84 1.409505018 -1.086135447
85 -1.798207384 1.409505018
86 -1.651362700 -1.798207384
87 2.528054061 -1.651362700
88 -0.262553002 2.528054061
89 -0.011443611 -0.262553002
90 2.784217186 -0.011443611
91 1.025910544 2.784217186
92 0.847894088 1.025910544
93 -1.696868468 0.847894088
94 -0.617515888 -1.696868468
95 -0.932407976 -0.617515888
96 1.317709070 -0.932407976
97 -1.108788189 1.317709070
98 1.778845625 -1.108788189
99 -0.769598332 1.778845625
100 0.634901457 -0.769598332
101 0.030335167 0.634901457
102 3.411868689 0.030335167
103 2.475759454 3.411868689
104 -0.258314389 2.475759454
105 1.009342244 -0.258314389
106 1.606081540 1.009342244
107 -0.411916805 1.606081540
108 2.264650178 -0.411916805
109 3.587137061 2.264650178
110 0.863411369 3.587137061
111 -1.587119439 0.863411369
112 -0.135047331 -1.587119439
113 0.903253390 -0.135047331
114 1.368073847 0.903253390
115 -0.325852040 1.368073847
116 -0.061913469 -0.325852040
117 2.849932803 -0.061913469
118 -0.455677814 2.849932803
119 -0.707399650 -0.455677814
120 0.307872294 -0.707399650
121 -1.820272247 0.307872294
122 -0.077287555 -1.820272247
123 -0.464768713 -0.077287555
124 -0.352647102 -0.464768713
125 2.064975544 -0.352647102
126 0.789850407 2.064975544
127 -1.406223174 0.789850407
128 1.116220264 -1.406223174
129 -6.972241417 1.116220264
130 0.784560089 -6.972241417
131 -0.357533137 0.784560089
132 4.255257315 -0.357533137
133 1.558944909 4.255257315
134 0.262791949 1.558944909
135 1.134168332 0.262791949
136 -0.249799683 1.134168332
137 0.036048534 -0.249799683
138 0.870454223 0.036048534
139 0.527585188 0.870454223
140 -0.023149225 0.527585188
141 -0.071182731 -0.023149225
142 2.763797409 -0.071182731
143 -5.907709173 2.763797409
144 0.468834638 -5.907709173
145 0.189214906 0.468834638
146 1.542573858 0.189214906
147 0.440835343 1.542573858
148 -0.115325259 0.440835343
149 0.007289993 -0.115325259
150 -0.943706876 0.007289993
151 1.347465270 -0.943706876
152 0.357129174 1.347465270
153 1.293645923 0.357129174
154 -2.100130790 1.293645923
155 2.523165287 -2.100130790
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/7hxaj1291304497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8hxaj1291304497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9532y1291304497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10532y1291304497.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/11rmj41291304497.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/12umz91291304497.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/13qwx01291304497.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/14twd61291304497.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/15xxcu1291304497.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/16t7al1291304497.tab")
+ }
>
> try(system("convert tmp/1gk5m1291304497.ps tmp/1gk5m1291304497.png",intern=TRUE))
character(0)
> try(system("convert tmp/2rbnp1291304497.ps tmp/2rbnp1291304497.png",intern=TRUE))
character(0)
> try(system("convert tmp/3rbnp1291304497.ps tmp/3rbnp1291304497.png",intern=TRUE))
character(0)
> try(system("convert tmp/4rbnp1291304497.ps tmp/4rbnp1291304497.png",intern=TRUE))
character(0)
> try(system("convert tmp/5klms1291304497.ps tmp/5klms1291304497.png",intern=TRUE))
character(0)
> try(system("convert tmp/6klms1291304497.ps tmp/6klms1291304497.png",intern=TRUE))
character(0)
> try(system("convert tmp/7hxaj1291304497.ps tmp/7hxaj1291304497.png",intern=TRUE))
character(0)
> try(system("convert tmp/8hxaj1291304497.ps tmp/8hxaj1291304497.png",intern=TRUE))
character(0)
> try(system("convert tmp/9532y1291304497.ps tmp/9532y1291304497.png",intern=TRUE))
character(0)
> try(system("convert tmp/10532y1291304497.ps tmp/10532y1291304497.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.212 1.810 8.982