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(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
+ ,20
+ ,8
+ ,17
+ ,7
+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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 = '3'
> #'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
Doubtsaboutactions month ConcernoverMistakes ParentalExpectations
1 14 9 24 11
2 11 9 25 7
3 6 9 17 17
4 12 9 18 10
5 8 9 18 12
6 10 9 16 12
7 10 10 20 11
8 11 10 16 11
9 16 10 18 12
10 11 10 17 13
11 13 10 23 14
12 12 10 30 16
13 8 10 23 11
14 12 10 18 10
15 11 10 15 11
16 4 10 12 15
17 9 10 21 9
18 8 10 15 11
19 8 10 20 17
20 14 10 31 17
21 15 10 27 11
22 16 10 34 18
23 9 10 21 14
24 14 10 31 10
25 11 10 19 11
26 8 10 16 15
27 9 10 20 15
28 9 10 21 13
29 9 10 22 16
30 9 10 17 13
31 10 10 24 9
32 16 10 25 18
33 11 10 26 18
34 8 10 25 12
35 9 10 17 17
36 16 10 32 9
37 11 10 33 9
38 16 10 13 12
39 12 10 32 18
40 12 10 25 12
41 14 10 29 18
42 9 10 22 14
43 10 10 18 15
44 9 10 17 16
45 10 10 20 10
46 12 10 15 11
47 14 10 20 14
48 14 10 33 9
49 10 10 29 12
50 14 10 23 17
51 16 10 26 5
52 9 10 18 12
53 10 10 20 12
54 6 10 11 6
55 8 10 28 24
56 13 10 26 12
57 10 10 22 12
58 8 10 17 14
59 7 10 12 7
60 15 10 14 13
61 9 10 17 12
62 10 10 21 13
63 12 10 19 14
64 13 10 18 8
65 10 10 10 11
66 11 10 29 9
67 8 10 31 11
68 9 10 19 13
69 13 10 9 10
70 11 10 20 11
71 8 10 28 12
72 9 10 19 9
73 9 10 30 15
74 15 10 29 18
75 9 10 26 15
76 10 10 23 12
77 14 10 13 13
78 12 10 21 14
79 12 10 19 10
80 11 10 28 13
81 14 10 23 13
82 6 10 18 11
83 12 10 21 13
84 8 10 20 16
85 14 10 23 8
86 11 10 21 16
87 10 10 21 11
88 14 10 15 9
89 12 10 28 16
90 10 10 19 12
91 14 10 26 14
92 5 10 10 8
93 11 10 16 9
94 10 10 22 15
95 9 10 19 11
96 10 10 31 21
97 16 10 31 14
98 13 10 29 18
99 9 10 19 12
100 10 10 22 13
101 10 10 23 15
102 7 10 15 12
103 9 10 20 19
104 8 10 18 15
105 14 10 23 11
106 14 10 25 11
107 8 10 21 10
108 9 10 24 13
109 14 10 25 15
110 14 10 17 12
111 8 10 13 12
112 8 10 28 16
113 8 10 21 9
114 7 10 25 18
115 6 10 9 8
116 8 10 16 13
117 6 10 19 17
118 11 10 17 9
119 14 10 25 15
120 11 10 20 8
121 11 10 29 7
122 11 10 14 12
123 14 10 22 14
124 8 10 15 6
125 20 10 19 8
126 11 10 20 17
127 8 10 15 10
128 11 10 20 11
129 10 10 18 14
130 14 10 33 11
131 11 10 22 13
132 9 10 16 12
133 9 10 17 11
134 8 10 16 9
135 10 10 21 12
136 13 10 26 20
137 13 10 18 12
138 12 10 18 13
139 8 10 17 12
140 13 10 22 12
141 14 10 30 9
142 12 10 30 15
143 14 10 24 24
144 15 10 21 7
145 13 10 21 17
146 16 10 29 11
147 9 10 31 17
148 9 10 20 11
149 9 10 16 12
150 8 10 22 14
151 7 10 20 11
152 16 10 28 16
153 11 10 38 21
154 9 10 22 14
155 11 10 20 20
156 9 10 17 13
157 14 10 28 11
158 13 10 22 15
159 16 10 31 19
ParentalCriticism PersonalStandards Organization\r t
1 12 24 26 1
2 8 25 23 2
3 8 30 25 3
4 8 19 23 4
5 9 22 19 5
6 7 22 29 6
7 4 25 25 7
8 11 23 21 8
9 7 17 22 9
10 7 21 25 10
11 12 19 24 11
12 10 19 18 12
13 10 15 22 13
14 8 16 15 14
15 8 23 22 15
16 4 27 28 16
17 9 22 20 17
18 8 14 12 18
19 7 22 24 19
20 11 23 20 20
21 9 23 21 21
22 11 21 20 22
23 13 19 21 23
24 8 18 23 24
25 8 20 28 25
26 9 23 24 26
27 6 25 24 27
28 9 19 24 28
29 9 24 23 29
30 6 22 23 30
31 6 25 29 31
32 16 26 24 32
33 5 29 18 33
34 7 32 25 34
35 9 25 21 35
36 6 29 26 36
37 6 28 22 37
38 5 17 22 38
39 12 28 22 39
40 7 29 23 40
41 10 26 30 41
42 9 25 23 42
43 8 14 17 43
44 5 25 23 44
45 8 26 23 45
46 8 20 25 46
47 10 18 24 47
48 6 32 24 48
49 8 25 23 49
50 7 25 21 50
51 4 23 24 51
52 8 21 24 52
53 8 20 28 53
54 4 15 16 54
55 20 30 20 55
56 8 24 29 56
57 8 26 27 57
58 6 24 22 58
59 4 22 28 59
60 8 14 16 60
61 9 24 25 61
62 6 24 24 62
63 7 24 28 63
64 9 24 24 64
65 5 19 23 65
66 5 31 30 66
67 8 22 24 67
68 8 27 21 68
69 6 19 25 69
70 8 25 25 70
71 7 20 22 71
72 7 21 23 72
73 9 27 26 73
74 11 23 23 74
75 6 25 25 75
76 8 20 21 76
77 6 21 25 77
78 9 22 24 78
79 8 23 29 79
80 6 25 22 80
81 10 25 27 81
82 8 17 26 82
83 8 19 22 83
84 10 25 24 84
85 5 19 27 85
86 7 20 24 86
87 5 26 24 87
88 8 23 29 88
89 14 27 22 89
90 7 17 21 90
91 8 17 24 91
92 6 19 24 92
93 5 17 23 93
94 6 22 20 94
95 10 21 27 95
96 12 32 26 96
97 9 21 25 97
98 12 21 21 98
99 7 18 21 99
100 8 18 19 100
101 10 23 21 101
102 6 19 21 102
103 10 20 16 103
104 10 21 22 104
105 10 20 29 105
106 5 17 15 106
107 7 18 17 107
108 10 19 15 108
109 11 22 21 109
110 6 15 21 110
111 7 14 19 111
112 12 18 24 112
113 11 24 20 113
114 11 35 17 114
115 11 29 23 115
116 5 21 24 116
117 8 25 14 117
118 6 20 19 118
119 9 22 24 119
120 4 13 13 120
121 4 26 22 121
122 7 17 16 122
123 11 25 19 123
124 6 20 25 124
125 7 19 25 125
126 8 21 23 126
127 4 22 24 127
128 8 24 26 128
129 9 21 26 129
130 8 26 25 130
131 11 24 18 131
132 8 16 21 132
133 5 23 26 133
134 4 18 23 134
135 8 16 23 135
136 10 26 22 136
137 6 19 20 137
138 9 21 13 138
139 9 21 24 139
140 13 22 15 140
141 9 23 14 141
142 10 29 22 142
143 20 21 10 143
144 5 21 24 144
145 11 23 22 145
146 6 27 24 146
147 9 25 19 147
148 7 21 20 148
149 9 10 13 149
150 10 20 20 150
151 9 26 22 151
152 8 24 24 152
153 7 29 29 153
154 6 19 12 154
155 13 24 20 155
156 6 19 21 156
157 8 24 24 157
158 10 22 22 158
159 16 17 20 159
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) month ConcernoverMistakes
4.0984846 0.3226781 0.2468958
ParentalExpectations ParentalCriticism PersonalStandards
-0.1092443 0.1515472 -0.1897569
`Organization\r` t
0.1133295 0.0009941
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.7246 -1.7244 -0.2130 1.6843 8.4447
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.0984846 11.1416904 0.368 0.71350
month 0.3226781 1.1151524 0.289 0.77270
ConcernoverMistakes 0.2468958 0.0405380 6.090 8.93e-09 ***
ParentalExpectations -0.1092443 0.0749021 -1.458 0.14678
ParentalCriticism 0.1515472 0.0941785 1.609 0.10967
PersonalStandards -0.1897569 0.0573959 -3.306 0.00118 **
`Organization\r` 0.1133295 0.0580930 1.951 0.05293 .
t 0.0009941 0.0046932 0.212 0.83253
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.497 on 151 degrees of freedom
Multiple R-squared: 0.2405, Adjusted R-squared: 0.2053
F-statistic: 6.83 on 7 and 151 DF, p-value: 4.752e-07
> 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.08580382 0.17160763 0.9141962
[2,] 0.03113883 0.06227767 0.9688612
[3,] 0.30462570 0.60925139 0.6953743
[4,] 0.49232974 0.98465948 0.5076703
[5,] 0.65261475 0.69477051 0.3473853
[6,] 0.58138324 0.83723352 0.4186168
[7,] 0.48860591 0.97721182 0.5113941
[8,] 0.41543369 0.83086739 0.5845663
[9,] 0.38167334 0.76334669 0.6183267
[10,] 0.56914655 0.86170691 0.4308535
[11,] 0.65537920 0.68924159 0.3446208
[12,] 0.64084594 0.71830812 0.3591541
[13,] 0.60841978 0.78316044 0.3915802
[14,] 0.53484064 0.93031872 0.4651594
[15,] 0.46975214 0.93950428 0.5302479
[16,] 0.40308146 0.80616292 0.5969185
[17,] 0.34219519 0.68439038 0.6578048
[18,] 0.29974719 0.59949438 0.7002528
[19,] 0.24487082 0.48974165 0.7551292
[20,] 0.20791082 0.41582164 0.7920892
[21,] 0.17036143 0.34072286 0.8296386
[22,] 0.28306725 0.56613449 0.7169328
[23,] 0.27031664 0.54063327 0.7296834
[24,] 0.25714934 0.51429869 0.7428507
[25,] 0.21676523 0.43353046 0.7832348
[26,] 0.25198665 0.50397329 0.7480134
[27,] 0.23792955 0.47585911 0.7620704
[28,] 0.65044165 0.69911670 0.3495583
[29,] 0.60170840 0.79658320 0.3982916
[30,] 0.56110032 0.87779936 0.4388997
[31,] 0.51521617 0.96956766 0.4847838
[32,] 0.49239698 0.98479397 0.5076030
[33,] 0.45030692 0.90061384 0.5496931
[34,] 0.39760738 0.79521475 0.6023926
[35,] 0.34631922 0.69263845 0.6536808
[36,] 0.31707973 0.63415947 0.6829203
[37,] 0.29598153 0.59196305 0.7040185
[38,] 0.26811709 0.53623418 0.7318829
[39,] 0.28259204 0.56518407 0.7174080
[40,] 0.33677590 0.67355179 0.6632241
[41,] 0.37079277 0.74158554 0.6292072
[42,] 0.36110471 0.72220942 0.6388953
[43,] 0.34741281 0.69482563 0.6525872
[44,] 0.37523922 0.75047845 0.6247608
[45,] 0.39433616 0.78867232 0.6056638
[46,] 0.34904108 0.69808216 0.6509589
[47,] 0.30847498 0.61694996 0.6915250
[48,] 0.26983920 0.53967840 0.7301608
[49,] 0.25360709 0.50721419 0.7463929
[50,] 0.40250649 0.80501297 0.5974935
[51,] 0.35846444 0.71692887 0.6415356
[52,] 0.31587345 0.63174689 0.6841266
[53,] 0.29385977 0.58771954 0.7061402
[54,] 0.30298233 0.60596466 0.6970177
[55,] 0.27719467 0.55438934 0.7228053
[56,] 0.24518360 0.49036720 0.7548164
[57,] 0.42881131 0.85762262 0.5711887
[58,] 0.38274528 0.76549056 0.6172547
[59,] 0.47990336 0.95980671 0.5200966
[60,] 0.43747822 0.87495644 0.5625218
[61,] 0.55059668 0.89880664 0.4494033
[62,] 0.52211393 0.95577215 0.4778861
[63,] 0.54206998 0.91586005 0.4579300
[64,] 0.55364336 0.89271327 0.4463566
[65,] 0.53276212 0.93447576 0.4672379
[66,] 0.49779206 0.99558412 0.5022079
[67,] 0.66349795 0.67300411 0.3365021
[68,] 0.63251032 0.73497936 0.3674897
[69,] 0.59607959 0.80784083 0.4039204
[70,] 0.55005656 0.89988689 0.4499434
[71,] 0.55992594 0.88014812 0.4400741
[72,] 0.71160707 0.57678585 0.2883929
[73,] 0.67793224 0.64413552 0.3220678
[74,] 0.65343547 0.69312906 0.3465645
[75,] 0.63092699 0.73814601 0.3690730
[76,] 0.58988048 0.82023903 0.4101195
[77,] 0.54633799 0.90732402 0.4536620
[78,] 0.63273325 0.73453349 0.3672667
[79,] 0.58744814 0.82510372 0.4125519
[80,] 0.54396854 0.91206292 0.4560315
[81,] 0.51125764 0.97748472 0.4887424
[82,] 0.55448516 0.89102968 0.4455148
[83,] 0.51722296 0.96555409 0.4827770
[84,] 0.47265371 0.94530742 0.5273463
[85,] 0.45451350 0.90902699 0.5454865
[86,] 0.41243576 0.82487151 0.5875642
[87,] 0.41372041 0.82744082 0.5862796
[88,] 0.36989172 0.73978344 0.6301083
[89,] 0.33560735 0.67121471 0.6643926
[90,] 0.29657800 0.59315600 0.7034220
[91,] 0.25645365 0.51290730 0.7435464
[92,] 0.23755610 0.47511221 0.7624439
[93,] 0.20094300 0.40188600 0.7990570
[94,] 0.18159548 0.36319096 0.8184045
[95,] 0.15870755 0.31741510 0.8412924
[96,] 0.16704678 0.33409355 0.8329532
[97,] 0.16638040 0.33276079 0.8336196
[98,] 0.15884760 0.31769520 0.8411524
[99,] 0.15639908 0.31279815 0.8436009
[100,] 0.19963046 0.39926092 0.8003695
[101,] 0.17152191 0.34304383 0.8284781
[102,] 0.34576432 0.69152864 0.6542357
[103,] 0.40546546 0.81093092 0.5945345
[104,] 0.37433018 0.74866036 0.6256698
[105,] 0.36788874 0.73577748 0.6321113
[106,] 0.32724697 0.65449394 0.6727530
[107,] 0.32900867 0.65801735 0.6709913
[108,] 0.28787760 0.57575519 0.7121224
[109,] 0.26028310 0.52056619 0.7397169
[110,] 0.21701266 0.43402532 0.7829873
[111,] 0.20310068 0.40620137 0.7968993
[112,] 0.18124098 0.36248195 0.8187590
[113,] 0.18509044 0.37018089 0.8149096
[114,] 0.20020907 0.40041814 0.7997909
[115,] 0.72394749 0.55210503 0.2760525
[116,] 0.68092969 0.63814062 0.3190703
[117,] 0.62527507 0.74944986 0.3747249
[118,] 0.56234801 0.87530398 0.4376520
[119,] 0.49771660 0.99543320 0.5022834
[120,] 0.43431999 0.86863998 0.5656800
[121,] 0.37913411 0.75826823 0.6208659
[122,] 0.32686024 0.65372047 0.6731398
[123,] 0.26952094 0.53904188 0.7304791
[124,] 0.23864371 0.47728743 0.7613563
[125,] 0.23882935 0.47765870 0.7611706
[126,] 0.19788762 0.39577524 0.8021124
[127,] 0.20397183 0.40794366 0.7960282
[128,] 0.20833590 0.41667180 0.7916641
[129,] 0.23203763 0.46407526 0.7679624
[130,] 0.17717986 0.35435973 0.8228201
[131,] 0.12992500 0.25985000 0.8700750
[132,] 0.09495521 0.18991042 0.9050448
[133,] 0.09669682 0.19339364 0.9033032
[134,] 0.08692161 0.17384321 0.9130784
[135,] 0.09598637 0.19197275 0.9040136
[136,] 0.30586783 0.61173565 0.6941322
[137,] 0.20299821 0.40599641 0.7970018
[138,] 0.12298064 0.24596127 0.8770194
> postscript(file="/var/www/html/rcomp/tmp/1w4yh1291315851.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/2w4yh1291315851.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/3pegk1291315851.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/4pegk1291315851.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/5pegk1291315851.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
2.06163906 -0.48729388 -1.69855357 1.42817992 -1.48328419 0.17931265
7 8 9 10 11 12
0.23604321 1.23560623 5.20438276 0.97856774 0.58152309 -0.94618160
13 14 15 16 17 18
-4.97747214 1.43292607 1.81685526 -3.32123516 -1.99964126 -1.76064402
19 20 21 22 23 24
-2.03100311 1.28903536 2.80992355 2.27609031 -2.74817337 -0.31378239
25 26 27 28 29 30
-0.42991658 -1.38220480 -0.53662675 -2.59618799 -1.45423116 -0.47335144
31 32 33 34 35 36
-1.75029946 4.22594176 1.89431840 -2.04237578 0.29994323 3.36857974
37 38 39 40 41 42
-1.61574904 6.71312680 -0.29692603 1.60904791 1.45871771 -1.49588628
43 44 45 46 47 48
-0.65585451 0.56128165 -0.10075011 1.87677869 2.39975990 1.90568426
49 50 51 52 53 54
-2.29805690 4.10675123 3.78927771 -1.45754266 -1.59540320 -3.01244270
55 56 57 58 59 60
-3.27598766 0.56593781 -0.84130043 -0.89909901 -2.18672055 5.20966967
61 62 63 64 65 66
-0.91519992 -0.22656185 1.77061472 2.51127435 1.58391312 -0.84281330
67 68 69 70 71 72
-5.60158687 -0.13257018 4.33938201 0.56722552 -4.75693929 -1.78717683
73 74 75 76 77 78
-3.35310042 2.49840071 -2.17904826 -1.56564862 5.05109260 1.03262137
79 80 81 82 83 84
0.86309828 -0.55631044 2.50433817 -5.58229678 0.72734207 -2.09023550
85 86 87 88 89 90
1.57333494 0.16673763 0.06115775 3.73249013 -0.07038824 -1.00970651
91 92 93 94 95 96
0.98798181 -4.03553738 0.47670102 -0.21297640 -2.49951233 -1.47325221
97 98 99 100 101 102
2.24168908 0.17014011 -1.82889663 -1.38622199 -0.99659227 -2.50299179
103 104 105 106 107 108
-0.82353920 -2.25793896 1.08654757 2.36684007 -3.09581166 -2.54798593
109 110 111 112 113 114
2.16035922 3.23623624 -1.89181981 -5.72462935 -3.01865651 -1.59672109
115 116 117 118 119 120
-1.55834375 -1.46348841 -2.33051179 1.07599391 2.11352398 -0.12115276
121 122 123 124 125 126
-1.00657922 1.75960831 3.57381436 -2.44388901 8.44471826 0.63465245
127 128 129 130 131 132
-1.21395663 0.20648070 -0.69380682 0.48769059 0.38018981 -1.65207589
133 134 135 136 137 138
-0.79291786 -2.22275348 -2.11619612 2.23008903 2.83485648 2.66128535
139 140 141 142 143 144
-2.44868172 1.91937891 1.52476080 0.25959049 3.04959674 3.61873191
145 146 147 148 149 150
2.40707029 4.06554866 -3.04127914 -1.55114800 -2.05242826 -3.36359335
151 152 153 154 155 156
-3.13509928 3.98033618 -2.40971025 -1.04450201 1.08507931 -0.94122107
157 158 159
1.42914423 1.89055280 1.47306533
> postscript(file="/var/www/html/rcomp/tmp/605x51291315851.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 2.06163906 NA
1 -0.48729388 2.06163906
2 -1.69855357 -0.48729388
3 1.42817992 -1.69855357
4 -1.48328419 1.42817992
5 0.17931265 -1.48328419
6 0.23604321 0.17931265
7 1.23560623 0.23604321
8 5.20438276 1.23560623
9 0.97856774 5.20438276
10 0.58152309 0.97856774
11 -0.94618160 0.58152309
12 -4.97747214 -0.94618160
13 1.43292607 -4.97747214
14 1.81685526 1.43292607
15 -3.32123516 1.81685526
16 -1.99964126 -3.32123516
17 -1.76064402 -1.99964126
18 -2.03100311 -1.76064402
19 1.28903536 -2.03100311
20 2.80992355 1.28903536
21 2.27609031 2.80992355
22 -2.74817337 2.27609031
23 -0.31378239 -2.74817337
24 -0.42991658 -0.31378239
25 -1.38220480 -0.42991658
26 -0.53662675 -1.38220480
27 -2.59618799 -0.53662675
28 -1.45423116 -2.59618799
29 -0.47335144 -1.45423116
30 -1.75029946 -0.47335144
31 4.22594176 -1.75029946
32 1.89431840 4.22594176
33 -2.04237578 1.89431840
34 0.29994323 -2.04237578
35 3.36857974 0.29994323
36 -1.61574904 3.36857974
37 6.71312680 -1.61574904
38 -0.29692603 6.71312680
39 1.60904791 -0.29692603
40 1.45871771 1.60904791
41 -1.49588628 1.45871771
42 -0.65585451 -1.49588628
43 0.56128165 -0.65585451
44 -0.10075011 0.56128165
45 1.87677869 -0.10075011
46 2.39975990 1.87677869
47 1.90568426 2.39975990
48 -2.29805690 1.90568426
49 4.10675123 -2.29805690
50 3.78927771 4.10675123
51 -1.45754266 3.78927771
52 -1.59540320 -1.45754266
53 -3.01244270 -1.59540320
54 -3.27598766 -3.01244270
55 0.56593781 -3.27598766
56 -0.84130043 0.56593781
57 -0.89909901 -0.84130043
58 -2.18672055 -0.89909901
59 5.20966967 -2.18672055
60 -0.91519992 5.20966967
61 -0.22656185 -0.91519992
62 1.77061472 -0.22656185
63 2.51127435 1.77061472
64 1.58391312 2.51127435
65 -0.84281330 1.58391312
66 -5.60158687 -0.84281330
67 -0.13257018 -5.60158687
68 4.33938201 -0.13257018
69 0.56722552 4.33938201
70 -4.75693929 0.56722552
71 -1.78717683 -4.75693929
72 -3.35310042 -1.78717683
73 2.49840071 -3.35310042
74 -2.17904826 2.49840071
75 -1.56564862 -2.17904826
76 5.05109260 -1.56564862
77 1.03262137 5.05109260
78 0.86309828 1.03262137
79 -0.55631044 0.86309828
80 2.50433817 -0.55631044
81 -5.58229678 2.50433817
82 0.72734207 -5.58229678
83 -2.09023550 0.72734207
84 1.57333494 -2.09023550
85 0.16673763 1.57333494
86 0.06115775 0.16673763
87 3.73249013 0.06115775
88 -0.07038824 3.73249013
89 -1.00970651 -0.07038824
90 0.98798181 -1.00970651
91 -4.03553738 0.98798181
92 0.47670102 -4.03553738
93 -0.21297640 0.47670102
94 -2.49951233 -0.21297640
95 -1.47325221 -2.49951233
96 2.24168908 -1.47325221
97 0.17014011 2.24168908
98 -1.82889663 0.17014011
99 -1.38622199 -1.82889663
100 -0.99659227 -1.38622199
101 -2.50299179 -0.99659227
102 -0.82353920 -2.50299179
103 -2.25793896 -0.82353920
104 1.08654757 -2.25793896
105 2.36684007 1.08654757
106 -3.09581166 2.36684007
107 -2.54798593 -3.09581166
108 2.16035922 -2.54798593
109 3.23623624 2.16035922
110 -1.89181981 3.23623624
111 -5.72462935 -1.89181981
112 -3.01865651 -5.72462935
113 -1.59672109 -3.01865651
114 -1.55834375 -1.59672109
115 -1.46348841 -1.55834375
116 -2.33051179 -1.46348841
117 1.07599391 -2.33051179
118 2.11352398 1.07599391
119 -0.12115276 2.11352398
120 -1.00657922 -0.12115276
121 1.75960831 -1.00657922
122 3.57381436 1.75960831
123 -2.44388901 3.57381436
124 8.44471826 -2.44388901
125 0.63465245 8.44471826
126 -1.21395663 0.63465245
127 0.20648070 -1.21395663
128 -0.69380682 0.20648070
129 0.48769059 -0.69380682
130 0.38018981 0.48769059
131 -1.65207589 0.38018981
132 -0.79291786 -1.65207589
133 -2.22275348 -0.79291786
134 -2.11619612 -2.22275348
135 2.23008903 -2.11619612
136 2.83485648 2.23008903
137 2.66128535 2.83485648
138 -2.44868172 2.66128535
139 1.91937891 -2.44868172
140 1.52476080 1.91937891
141 0.25959049 1.52476080
142 3.04959674 0.25959049
143 3.61873191 3.04959674
144 2.40707029 3.61873191
145 4.06554866 2.40707029
146 -3.04127914 4.06554866
147 -1.55114800 -3.04127914
148 -2.05242826 -1.55114800
149 -3.36359335 -2.05242826
150 -3.13509928 -3.36359335
151 3.98033618 -3.13509928
152 -2.40971025 3.98033618
153 -1.04450201 -2.40971025
154 1.08507931 -1.04450201
155 -0.94122107 1.08507931
156 1.42914423 -0.94122107
157 1.89055280 1.42914423
158 1.47306533 1.89055280
159 NA 1.47306533
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.48729388 2.06163906
[2,] -1.69855357 -0.48729388
[3,] 1.42817992 -1.69855357
[4,] -1.48328419 1.42817992
[5,] 0.17931265 -1.48328419
[6,] 0.23604321 0.17931265
[7,] 1.23560623 0.23604321
[8,] 5.20438276 1.23560623
[9,] 0.97856774 5.20438276
[10,] 0.58152309 0.97856774
[11,] -0.94618160 0.58152309
[12,] -4.97747214 -0.94618160
[13,] 1.43292607 -4.97747214
[14,] 1.81685526 1.43292607
[15,] -3.32123516 1.81685526
[16,] -1.99964126 -3.32123516
[17,] -1.76064402 -1.99964126
[18,] -2.03100311 -1.76064402
[19,] 1.28903536 -2.03100311
[20,] 2.80992355 1.28903536
[21,] 2.27609031 2.80992355
[22,] -2.74817337 2.27609031
[23,] -0.31378239 -2.74817337
[24,] -0.42991658 -0.31378239
[25,] -1.38220480 -0.42991658
[26,] -0.53662675 -1.38220480
[27,] -2.59618799 -0.53662675
[28,] -1.45423116 -2.59618799
[29,] -0.47335144 -1.45423116
[30,] -1.75029946 -0.47335144
[31,] 4.22594176 -1.75029946
[32,] 1.89431840 4.22594176
[33,] -2.04237578 1.89431840
[34,] 0.29994323 -2.04237578
[35,] 3.36857974 0.29994323
[36,] -1.61574904 3.36857974
[37,] 6.71312680 -1.61574904
[38,] -0.29692603 6.71312680
[39,] 1.60904791 -0.29692603
[40,] 1.45871771 1.60904791
[41,] -1.49588628 1.45871771
[42,] -0.65585451 -1.49588628
[43,] 0.56128165 -0.65585451
[44,] -0.10075011 0.56128165
[45,] 1.87677869 -0.10075011
[46,] 2.39975990 1.87677869
[47,] 1.90568426 2.39975990
[48,] -2.29805690 1.90568426
[49,] 4.10675123 -2.29805690
[50,] 3.78927771 4.10675123
[51,] -1.45754266 3.78927771
[52,] -1.59540320 -1.45754266
[53,] -3.01244270 -1.59540320
[54,] -3.27598766 -3.01244270
[55,] 0.56593781 -3.27598766
[56,] -0.84130043 0.56593781
[57,] -0.89909901 -0.84130043
[58,] -2.18672055 -0.89909901
[59,] 5.20966967 -2.18672055
[60,] -0.91519992 5.20966967
[61,] -0.22656185 -0.91519992
[62,] 1.77061472 -0.22656185
[63,] 2.51127435 1.77061472
[64,] 1.58391312 2.51127435
[65,] -0.84281330 1.58391312
[66,] -5.60158687 -0.84281330
[67,] -0.13257018 -5.60158687
[68,] 4.33938201 -0.13257018
[69,] 0.56722552 4.33938201
[70,] -4.75693929 0.56722552
[71,] -1.78717683 -4.75693929
[72,] -3.35310042 -1.78717683
[73,] 2.49840071 -3.35310042
[74,] -2.17904826 2.49840071
[75,] -1.56564862 -2.17904826
[76,] 5.05109260 -1.56564862
[77,] 1.03262137 5.05109260
[78,] 0.86309828 1.03262137
[79,] -0.55631044 0.86309828
[80,] 2.50433817 -0.55631044
[81,] -5.58229678 2.50433817
[82,] 0.72734207 -5.58229678
[83,] -2.09023550 0.72734207
[84,] 1.57333494 -2.09023550
[85,] 0.16673763 1.57333494
[86,] 0.06115775 0.16673763
[87,] 3.73249013 0.06115775
[88,] -0.07038824 3.73249013
[89,] -1.00970651 -0.07038824
[90,] 0.98798181 -1.00970651
[91,] -4.03553738 0.98798181
[92,] 0.47670102 -4.03553738
[93,] -0.21297640 0.47670102
[94,] -2.49951233 -0.21297640
[95,] -1.47325221 -2.49951233
[96,] 2.24168908 -1.47325221
[97,] 0.17014011 2.24168908
[98,] -1.82889663 0.17014011
[99,] -1.38622199 -1.82889663
[100,] -0.99659227 -1.38622199
[101,] -2.50299179 -0.99659227
[102,] -0.82353920 -2.50299179
[103,] -2.25793896 -0.82353920
[104,] 1.08654757 -2.25793896
[105,] 2.36684007 1.08654757
[106,] -3.09581166 2.36684007
[107,] -2.54798593 -3.09581166
[108,] 2.16035922 -2.54798593
[109,] 3.23623624 2.16035922
[110,] -1.89181981 3.23623624
[111,] -5.72462935 -1.89181981
[112,] -3.01865651 -5.72462935
[113,] -1.59672109 -3.01865651
[114,] -1.55834375 -1.59672109
[115,] -1.46348841 -1.55834375
[116,] -2.33051179 -1.46348841
[117,] 1.07599391 -2.33051179
[118,] 2.11352398 1.07599391
[119,] -0.12115276 2.11352398
[120,] -1.00657922 -0.12115276
[121,] 1.75960831 -1.00657922
[122,] 3.57381436 1.75960831
[123,] -2.44388901 3.57381436
[124,] 8.44471826 -2.44388901
[125,] 0.63465245 8.44471826
[126,] -1.21395663 0.63465245
[127,] 0.20648070 -1.21395663
[128,] -0.69380682 0.20648070
[129,] 0.48769059 -0.69380682
[130,] 0.38018981 0.48769059
[131,] -1.65207589 0.38018981
[132,] -0.79291786 -1.65207589
[133,] -2.22275348 -0.79291786
[134,] -2.11619612 -2.22275348
[135,] 2.23008903 -2.11619612
[136,] 2.83485648 2.23008903
[137,] 2.66128535 2.83485648
[138,] -2.44868172 2.66128535
[139,] 1.91937891 -2.44868172
[140,] 1.52476080 1.91937891
[141,] 0.25959049 1.52476080
[142,] 3.04959674 0.25959049
[143,] 3.61873191 3.04959674
[144,] 2.40707029 3.61873191
[145,] 4.06554866 2.40707029
[146,] -3.04127914 4.06554866
[147,] -1.55114800 -3.04127914
[148,] -2.05242826 -1.55114800
[149,] -3.36359335 -2.05242826
[150,] -3.13509928 -3.36359335
[151,] 3.98033618 -3.13509928
[152,] -2.40971025 3.98033618
[153,] -1.04450201 -2.40971025
[154,] 1.08507931 -1.04450201
[155,] -0.94122107 1.08507931
[156,] 1.42914423 -0.94122107
[157,] 1.89055280 1.42914423
[158,] 1.47306533 1.89055280
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.48729388 2.06163906
2 -1.69855357 -0.48729388
3 1.42817992 -1.69855357
4 -1.48328419 1.42817992
5 0.17931265 -1.48328419
6 0.23604321 0.17931265
7 1.23560623 0.23604321
8 5.20438276 1.23560623
9 0.97856774 5.20438276
10 0.58152309 0.97856774
11 -0.94618160 0.58152309
12 -4.97747214 -0.94618160
13 1.43292607 -4.97747214
14 1.81685526 1.43292607
15 -3.32123516 1.81685526
16 -1.99964126 -3.32123516
17 -1.76064402 -1.99964126
18 -2.03100311 -1.76064402
19 1.28903536 -2.03100311
20 2.80992355 1.28903536
21 2.27609031 2.80992355
22 -2.74817337 2.27609031
23 -0.31378239 -2.74817337
24 -0.42991658 -0.31378239
25 -1.38220480 -0.42991658
26 -0.53662675 -1.38220480
27 -2.59618799 -0.53662675
28 -1.45423116 -2.59618799
29 -0.47335144 -1.45423116
30 -1.75029946 -0.47335144
31 4.22594176 -1.75029946
32 1.89431840 4.22594176
33 -2.04237578 1.89431840
34 0.29994323 -2.04237578
35 3.36857974 0.29994323
36 -1.61574904 3.36857974
37 6.71312680 -1.61574904
38 -0.29692603 6.71312680
39 1.60904791 -0.29692603
40 1.45871771 1.60904791
41 -1.49588628 1.45871771
42 -0.65585451 -1.49588628
43 0.56128165 -0.65585451
44 -0.10075011 0.56128165
45 1.87677869 -0.10075011
46 2.39975990 1.87677869
47 1.90568426 2.39975990
48 -2.29805690 1.90568426
49 4.10675123 -2.29805690
50 3.78927771 4.10675123
51 -1.45754266 3.78927771
52 -1.59540320 -1.45754266
53 -3.01244270 -1.59540320
54 -3.27598766 -3.01244270
55 0.56593781 -3.27598766
56 -0.84130043 0.56593781
57 -0.89909901 -0.84130043
58 -2.18672055 -0.89909901
59 5.20966967 -2.18672055
60 -0.91519992 5.20966967
61 -0.22656185 -0.91519992
62 1.77061472 -0.22656185
63 2.51127435 1.77061472
64 1.58391312 2.51127435
65 -0.84281330 1.58391312
66 -5.60158687 -0.84281330
67 -0.13257018 -5.60158687
68 4.33938201 -0.13257018
69 0.56722552 4.33938201
70 -4.75693929 0.56722552
71 -1.78717683 -4.75693929
72 -3.35310042 -1.78717683
73 2.49840071 -3.35310042
74 -2.17904826 2.49840071
75 -1.56564862 -2.17904826
76 5.05109260 -1.56564862
77 1.03262137 5.05109260
78 0.86309828 1.03262137
79 -0.55631044 0.86309828
80 2.50433817 -0.55631044
81 -5.58229678 2.50433817
82 0.72734207 -5.58229678
83 -2.09023550 0.72734207
84 1.57333494 -2.09023550
85 0.16673763 1.57333494
86 0.06115775 0.16673763
87 3.73249013 0.06115775
88 -0.07038824 3.73249013
89 -1.00970651 -0.07038824
90 0.98798181 -1.00970651
91 -4.03553738 0.98798181
92 0.47670102 -4.03553738
93 -0.21297640 0.47670102
94 -2.49951233 -0.21297640
95 -1.47325221 -2.49951233
96 2.24168908 -1.47325221
97 0.17014011 2.24168908
98 -1.82889663 0.17014011
99 -1.38622199 -1.82889663
100 -0.99659227 -1.38622199
101 -2.50299179 -0.99659227
102 -0.82353920 -2.50299179
103 -2.25793896 -0.82353920
104 1.08654757 -2.25793896
105 2.36684007 1.08654757
106 -3.09581166 2.36684007
107 -2.54798593 -3.09581166
108 2.16035922 -2.54798593
109 3.23623624 2.16035922
110 -1.89181981 3.23623624
111 -5.72462935 -1.89181981
112 -3.01865651 -5.72462935
113 -1.59672109 -3.01865651
114 -1.55834375 -1.59672109
115 -1.46348841 -1.55834375
116 -2.33051179 -1.46348841
117 1.07599391 -2.33051179
118 2.11352398 1.07599391
119 -0.12115276 2.11352398
120 -1.00657922 -0.12115276
121 1.75960831 -1.00657922
122 3.57381436 1.75960831
123 -2.44388901 3.57381436
124 8.44471826 -2.44388901
125 0.63465245 8.44471826
126 -1.21395663 0.63465245
127 0.20648070 -1.21395663
128 -0.69380682 0.20648070
129 0.48769059 -0.69380682
130 0.38018981 0.48769059
131 -1.65207589 0.38018981
132 -0.79291786 -1.65207589
133 -2.22275348 -0.79291786
134 -2.11619612 -2.22275348
135 2.23008903 -2.11619612
136 2.83485648 2.23008903
137 2.66128535 2.83485648
138 -2.44868172 2.66128535
139 1.91937891 -2.44868172
140 1.52476080 1.91937891
141 0.25959049 1.52476080
142 3.04959674 0.25959049
143 3.61873191 3.04959674
144 2.40707029 3.61873191
145 4.06554866 2.40707029
146 -3.04127914 4.06554866
147 -1.55114800 -3.04127914
148 -2.05242826 -1.55114800
149 -3.36359335 -2.05242826
150 -3.13509928 -3.36359335
151 3.98033618 -3.13509928
152 -2.40971025 3.98033618
153 -1.04450201 -2.40971025
154 1.08507931 -1.04450201
155 -0.94122107 1.08507931
156 1.42914423 -0.94122107
157 1.89055280 1.42914423
158 1.47306533 1.89055280
> 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/7sww71291315851.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/8sww71291315851.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/9sww71291315851.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/10lnvs1291315851.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/11oocy1291315851.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/12hxb11291315851.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/136gqd1291315851.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/14yp7g1291315851.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/1528641291315851.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/16yimc1291315851.tab")
+ }
>
> try(system("convert tmp/1w4yh1291315851.ps tmp/1w4yh1291315851.png",intern=TRUE))
character(0)
> try(system("convert tmp/2w4yh1291315851.ps tmp/2w4yh1291315851.png",intern=TRUE))
character(0)
> try(system("convert tmp/3pegk1291315851.ps tmp/3pegk1291315851.png",intern=TRUE))
character(0)
> try(system("convert tmp/4pegk1291315851.ps tmp/4pegk1291315851.png",intern=TRUE))
character(0)
> try(system("convert tmp/5pegk1291315851.ps tmp/5pegk1291315851.png",intern=TRUE))
character(0)
> try(system("convert tmp/605x51291315851.ps tmp/605x51291315851.png",intern=TRUE))
character(0)
> try(system("convert tmp/7sww71291315851.ps tmp/7sww71291315851.png",intern=TRUE))
character(0)
> try(system("convert tmp/8sww71291315851.ps tmp/8sww71291315851.png",intern=TRUE))
character(0)
> try(system("convert tmp/9sww71291315851.ps tmp/9sww71291315851.png",intern=TRUE))
character(0)
> try(system("convert tmp/10lnvs1291315851.ps tmp/10lnvs1291315851.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.153 1.767 9.515