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
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,9
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,9
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,9
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,9
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,9
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,10
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,10
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,10
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,10
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,10
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,10
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,10
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,10
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,10
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,10
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,10
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,10
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,10
+ ,8
+ ,17
+ ,7
+ ,22
+ ,24
+ ,10
+ ,14
+ ,17
+ ,11
+ ,23
+ ,20
+ ,10
+ ,15
+ ,11
+ ,9
+ ,23
+ ,21
+ ,10
+ ,16
+ ,18
+ ,11
+ ,21
+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+ ,26
+ ,22
+ ,10
+ ,13
+ ,12
+ ,6
+ ,19
+ ,20
+ ,10
+ ,12
+ ,13
+ ,9
+ ,21
+ ,13
+ ,10
+ ,8
+ ,12
+ ,9
+ ,21
+ ,24
+ ,10
+ ,13
+ ,12
+ ,13
+ ,22
+ ,15
+ ,10
+ ,14
+ ,9
+ ,9
+ ,23
+ ,14
+ ,10
+ ,12
+ ,15
+ ,10
+ ,29
+ ,22
+ ,10
+ ,14
+ ,24
+ ,20
+ ,21
+ ,10
+ ,10
+ ,15
+ ,7
+ ,5
+ ,21
+ ,24
+ ,10
+ ,13
+ ,17
+ ,11
+ ,23
+ ,22
+ ,10
+ ,16
+ ,11
+ ,6
+ ,27
+ ,24
+ ,10
+ ,9
+ ,17
+ ,9
+ ,25
+ ,19
+ ,10
+ ,9
+ ,11
+ ,7
+ ,21
+ ,20
+ ,10
+ ,9
+ ,12
+ ,9
+ ,10
+ ,13
+ ,10
+ ,8
+ ,14
+ ,10
+ ,20
+ ,20
+ ,10
+ ,7
+ ,11
+ ,9
+ ,26
+ ,22
+ ,10
+ ,16
+ ,16
+ ,8
+ ,24
+ ,24
+ ,10
+ ,11
+ ,21
+ ,7
+ ,29
+ ,29
+ ,10
+ ,9
+ ,14
+ ,6
+ ,19
+ ,12
+ ,10
+ ,11
+ ,20
+ ,13
+ ,24
+ ,20
+ ,10
+ ,9
+ ,13
+ ,6
+ ,19
+ ,21
+ ,10
+ ,14
+ ,11
+ ,8
+ ,24
+ ,24
+ ,10
+ ,13
+ ,15
+ ,10
+ ,22
+ ,22
+ ,10
+ ,16
+ ,19
+ ,16
+ ,17
+ ,20)
+ ,dim=c(6
+ ,159)
+ ,dimnames=list(c('Month'
+ ,'DoubtsActions'
+ ,'ParentalExpectations'
+ ,'ParentalCriticism'
+ ,'Standards'
+ ,'Organization
')
+ ,1:159))
> y <- array(NA,dim=c(6,159),dimnames=list(c('Month','DoubtsActions','ParentalExpectations','ParentalCriticism','Standards','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 = '4'
> #'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
ParentalCriticism Month DoubtsActions ParentalExpectations Standards
1 12 9 14 11 24
2 8 9 11 7 25
3 8 9 6 17 30
4 8 9 12 10 19
5 9 9 8 12 22
6 7 9 10 12 22
7 4 10 10 11 25
8 11 10 11 11 23
9 7 10 16 12 17
10 7 10 11 13 21
11 12 10 13 14 19
12 10 10 12 16 19
13 10 10 8 11 15
14 8 10 12 10 16
15 8 10 11 11 23
16 4 10 4 15 27
17 9 10 9 9 22
18 8 10 8 11 14
19 7 10 8 17 22
20 11 10 14 17 23
21 9 10 15 11 23
22 11 10 16 18 21
23 13 10 9 14 19
24 8 10 14 10 18
25 8 10 11 11 20
26 9 10 8 15 23
27 6 10 9 15 25
28 9 10 9 13 19
29 9 10 9 16 24
30 6 10 9 13 22
31 6 10 10 9 25
32 16 10 16 18 26
33 5 10 11 18 29
34 7 10 8 12 32
35 9 10 9 17 25
36 6 10 16 9 29
37 6 10 11 9 28
38 5 10 16 12 17
39 12 10 12 18 28
40 7 10 12 12 29
41 10 10 14 18 26
42 9 10 9 14 25
43 8 10 10 15 14
44 5 10 9 16 25
45 8 10 10 10 26
46 8 10 12 11 20
47 10 10 14 14 18
48 6 10 14 9 32
49 8 10 10 12 25
50 7 10 14 17 25
51 4 10 16 5 23
52 8 10 9 12 21
53 8 10 10 12 20
54 4 10 6 6 15
55 20 10 8 24 30
56 8 10 13 12 24
57 8 10 10 12 26
58 6 10 8 14 24
59 4 10 7 7 22
60 8 10 15 13 14
61 9 10 9 12 24
62 6 10 10 13 24
63 7 10 12 14 24
64 9 10 13 8 24
65 5 10 10 11 19
66 5 10 11 9 31
67 8 10 8 11 22
68 8 10 9 13 27
69 6 10 13 10 19
70 8 10 11 11 25
71 7 10 8 12 20
72 7 10 9 9 21
73 9 10 9 15 27
74 11 10 15 18 23
75 6 10 9 15 25
76 8 10 10 12 20
77 6 10 14 13 21
78 9 10 12 14 22
79 8 10 12 10 23
80 6 10 11 13 25
81 10 10 14 13 25
82 8 10 6 11 17
83 8 10 12 13 19
84 10 10 8 16 25
85 5 10 14 8 19
86 7 10 11 16 20
87 5 10 10 11 26
88 8 10 14 9 23
89 14 10 12 16 27
90 7 10 10 12 17
91 8 10 14 14 17
92 6 10 5 8 19
93 5 10 11 9 17
94 6 10 10 15 22
95 10 10 9 11 21
96 12 10 10 21 32
97 9 10 16 14 21
98 12 10 13 18 21
99 7 10 9 12 18
100 8 10 10 13 18
101 10 10 10 15 23
102 6 10 7 12 19
103 10 10 9 19 20
104 10 10 8 15 21
105 10 10 14 11 20
106 5 10 14 11 17
107 7 10 8 10 18
108 10 10 9 13 19
109 11 10 14 15 22
110 6 10 14 12 15
111 7 10 8 12 14
112 12 10 8 16 18
113 11 10 8 9 24
114 11 10 7 18 35
115 11 10 6 8 29
116 5 10 8 13 21
117 8 10 6 17 25
118 6 10 11 9 20
119 9 10 14 15 22
120 4 10 11 8 13
121 4 10 11 7 26
122 7 10 11 12 17
123 11 10 14 14 25
124 6 10 8 6 20
125 7 10 20 8 19
126 8 10 11 17 21
127 4 10 8 10 22
128 8 10 11 11 24
129 9 10 10 14 21
130 8 10 14 11 26
131 11 10 11 13 24
132 8 10 9 12 16
133 5 10 9 11 23
134 4 10 8 9 18
135 8 10 10 12 16
136 10 10 13 20 26
137 6 10 13 12 19
138 9 10 12 13 21
139 9 10 8 12 21
140 13 10 13 12 22
141 9 10 14 9 23
142 10 10 12 15 29
143 20 10 14 24 21
144 5 10 15 7 21
145 11 10 13 17 23
146 6 10 16 11 27
147 9 10 9 17 25
148 7 10 9 11 21
149 9 10 9 12 10
150 10 10 8 14 20
151 9 10 7 11 26
152 8 10 16 16 24
153 7 10 11 21 29
154 6 10 9 14 19
155 13 10 11 20 24
156 6 10 9 13 19
157 8 10 14 11 24
158 10 10 13 15 22
159 16 10 16 19 17
Organization\r t
1 26 1
2 23 2
3 25 3
4 23 4
5 19 5
6 29 6
7 25 7
8 21 8
9 22 9
10 25 10
11 24 11
12 18 12
13 22 13
14 15 14
15 22 15
16 28 16
17 20 17
18 12 18
19 24 19
20 20 20
21 21 21
22 20 22
23 21 23
24 23 24
25 28 25
26 24 26
27 24 27
28 24 28
29 23 29
30 23 30
31 29 31
32 24 32
33 18 33
34 25 34
35 21 35
36 26 36
37 22 37
38 22 38
39 22 39
40 23 40
41 30 41
42 23 42
43 17 43
44 23 44
45 23 45
46 25 46
47 24 47
48 24 48
49 23 49
50 21 50
51 24 51
52 24 52
53 28 53
54 16 54
55 20 55
56 29 56
57 27 57
58 22 58
59 28 59
60 16 60
61 25 61
62 24 62
63 28 63
64 24 64
65 23 65
66 30 66
67 24 67
68 21 68
69 25 69
70 25 70
71 22 71
72 23 72
73 26 73
74 23 74
75 25 75
76 21 76
77 25 77
78 24 78
79 29 79
80 22 80
81 27 81
82 26 82
83 22 83
84 24 84
85 27 85
86 24 86
87 24 87
88 29 88
89 22 89
90 21 90
91 24 91
92 24 92
93 23 93
94 20 94
95 27 95
96 26 96
97 25 97
98 21 98
99 21 99
100 19 100
101 21 101
102 21 102
103 16 103
104 22 104
105 29 105
106 15 106
107 17 107
108 15 108
109 21 109
110 21 110
111 19 111
112 24 112
113 20 113
114 17 114
115 23 115
116 24 116
117 14 117
118 19 118
119 24 119
120 13 120
121 22 121
122 16 122
123 19 123
124 25 124
125 25 125
126 23 126
127 24 127
128 26 128
129 26 129
130 25 130
131 18 131
132 21 132
133 26 133
134 23 134
135 23 135
136 22 136
137 20 137
138 13 138
139 24 139
140 15 140
141 14 141
142 22 142
143 10 143
144 24 144
145 22 145
146 24 146
147 19 147
148 20 148
149 13 149
150 20 150
151 22 151
152 24 152
153 29 153
154 12 154
155 20 155
156 21 156
157 24 157
158 22 158
159 20 159
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Month DoubtsActions
16.6011389 -1.4167051 0.1502388
ParentalExpectations Standards `Organization\r`
0.4409393 0.0298389 -0.1031117
t
0.0009491
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.0643 -1.3008 -0.0143 1.1196 6.8963
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 16.6011389 9.4432867 1.758 0.0808 .
Month -1.4167051 0.9482956 -1.494 0.1373
DoubtsActions 0.1502388 0.0613725 2.448 0.0155 *
ParentalExpectations 0.4409393 0.0531825 8.291 5.53e-14 ***
Standards 0.0298389 0.0458552 0.651 0.5162
`Organization\r` -0.1031117 0.0496269 -2.078 0.0394 *
t 0.0009491 0.0040249 0.236 0.8139
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.142 on 152 degrees of freedom
Multiple R-squared: 0.3974, Adjusted R-squared: 0.3736
F-statistic: 16.71 on 6 and 152 DF, p-value: 9.413e-15
> 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.831910067 0.33617987 0.16808993
[2,] 0.831306091 0.33738782 0.16869391
[3,] 0.832139793 0.33572041 0.16786021
[4,] 0.905982798 0.18803440 0.09401720
[5,] 0.874792260 0.25041548 0.12520774
[6,] 0.821336012 0.35732798 0.17866399
[7,] 0.786155505 0.42768899 0.21384449
[8,] 0.772307161 0.45538568 0.22769284
[9,] 0.721728047 0.55654391 0.27827195
[10,] 0.657443931 0.68511214 0.34255607
[11,] 0.586748205 0.82650359 0.41325180
[12,] 0.512653026 0.97469395 0.48734697
[13,] 0.433083757 0.86616751 0.56691624
[14,] 0.669122869 0.66175426 0.33087713
[15,] 0.636472962 0.72705408 0.36352704
[16,] 0.572192170 0.85561566 0.42780783
[17,] 0.507336097 0.98532781 0.49266390
[18,] 0.522175379 0.95564924 0.47782462
[19,] 0.464840073 0.92968015 0.53515993
[20,] 0.399620797 0.79924159 0.60037920
[21,] 0.399359730 0.79871946 0.60064027
[22,] 0.338261434 0.67652287 0.66173857
[23,] 0.588974487 0.82205103 0.41102551
[24,] 0.823616269 0.35276746 0.17638373
[25,] 0.797314738 0.40537052 0.20268526
[26,] 0.755249836 0.48950033 0.24475016
[27,] 0.740494644 0.51901071 0.25950536
[28,] 0.693065439 0.61386912 0.30693456
[29,] 0.837278304 0.32544339 0.16272170
[30,] 0.845269432 0.30946114 0.15473057
[31,] 0.812714473 0.37457105 0.18728553
[32,] 0.774490362 0.45101928 0.22550964
[33,] 0.746840266 0.50631947 0.25315973
[34,] 0.716611213 0.56677757 0.28338879
[35,] 0.780220807 0.43955839 0.21977919
[36,] 0.765623969 0.46875206 0.23437603
[37,] 0.729209070 0.54158186 0.27079093
[38,] 0.696921831 0.60615634 0.30307817
[39,] 0.656366317 0.68726737 0.34363368
[40,] 0.616003634 0.76799273 0.38399637
[41,] 0.663891806 0.67221639 0.33610819
[42,] 0.652287333 0.69542533 0.34771267
[43,] 0.618018353 0.76396329 0.38198165
[44,] 0.580188697 0.83962261 0.41981130
[45,] 0.536987532 0.92602494 0.46301247
[46,] 0.944951333 0.11009733 0.05504867
[47,] 0.931062678 0.13787464 0.06893732
[48,] 0.916304646 0.16739071 0.08369535
[49,] 0.914971451 0.17005710 0.08502855
[50,] 0.894864333 0.21027133 0.10513567
[51,] 0.879358065 0.24128387 0.12064194
[52,] 0.873185940 0.25362812 0.12681406
[53,] 0.864709694 0.27058061 0.13529031
[54,] 0.845459377 0.30908125 0.15454062
[55,] 0.867372441 0.26525512 0.13262756
[56,] 0.860855841 0.27828832 0.13914416
[57,] 0.838493280 0.32301344 0.16150672
[58,] 0.821400674 0.35719865 0.17859933
[59,] 0.790480849 0.41903830 0.20951915
[60,] 0.759480334 0.48103933 0.24051967
[61,] 0.728804903 0.54239019 0.27119510
[62,] 0.688603591 0.62279282 0.31139641
[63,] 0.655110311 0.68977938 0.34488969
[64,] 0.613855619 0.77228876 0.38614438
[65,] 0.567946047 0.86410791 0.43205395
[66,] 0.586429776 0.82714045 0.41357022
[67,] 0.541426761 0.91714648 0.45857324
[68,] 0.547706392 0.90458722 0.45229361
[69,] 0.503135728 0.99372854 0.49686427
[70,] 0.480728201 0.96145640 0.51927180
[71,] 0.488321225 0.97664245 0.51167878
[72,] 0.469641431 0.93928286 0.53035857
[73,] 0.458844661 0.91768932 0.54115534
[74,] 0.413113230 0.82622646 0.58688677
[75,] 0.378329738 0.75665948 0.62167026
[76,] 0.342796946 0.68559389 0.65720305
[77,] 0.347797508 0.69559502 0.65220249
[78,] 0.352750511 0.70550102 0.64724949
[79,] 0.332637344 0.66527469 0.66736266
[80,] 0.446613281 0.89322656 0.55338672
[81,] 0.403276759 0.80655352 0.59672324
[82,] 0.363461350 0.72692270 0.63653865
[83,] 0.330894024 0.66178805 0.66910598
[84,] 0.301330687 0.60266137 0.69866931
[85,] 0.352474205 0.70494841 0.64752580
[86,] 0.417395205 0.83479041 0.58260480
[87,] 0.375162051 0.75032410 0.62483795
[88,] 0.330370779 0.66074156 0.66962922
[89,] 0.299019522 0.59803904 0.70098048
[90,] 0.259897677 0.51979535 0.74010232
[91,] 0.222645725 0.44529145 0.77735427
[92,] 0.192950624 0.38590125 0.80704938
[93,] 0.170923262 0.34184652 0.82907674
[94,] 0.152791360 0.30558272 0.84720864
[95,] 0.133322357 0.26664471 0.86667764
[96,] 0.161763854 0.32352771 0.83823615
[97,] 0.207774928 0.41554986 0.79222507
[98,] 0.175545563 0.35109113 0.82445444
[99,] 0.156077430 0.31215486 0.84392257
[100,] 0.136387527 0.27277505 0.86361247
[101,] 0.133862533 0.26772507 0.86613747
[102,] 0.109776909 0.21955382 0.89022309
[103,] 0.144199514 0.28839903 0.85580049
[104,] 0.271050959 0.54210192 0.72894904
[105,] 0.231577524 0.46315505 0.76842248
[106,] 0.585287614 0.82942477 0.41471239
[107,] 0.574097853 0.85180429 0.42590215
[108,] 0.570648370 0.85870326 0.42935163
[109,] 0.519809934 0.96038013 0.48019007
[110,] 0.464720290 0.92944058 0.53527971
[111,] 0.551503822 0.89699236 0.44849618
[112,] 0.522527800 0.95494440 0.47747220
[113,] 0.537047088 0.92590582 0.46295291
[114,] 0.488801320 0.97760264 0.51119868
[115,] 0.497346814 0.99469363 0.50265319
[116,] 0.438777000 0.87755400 0.56122300
[117,] 0.443977397 0.88795479 0.55602260
[118,] 0.434071417 0.86814283 0.56592858
[119,] 0.397735441 0.79547088 0.60226456
[120,] 0.356646308 0.71329262 0.64335369
[121,] 0.308346182 0.61669236 0.69165382
[122,] 0.299021870 0.59804374 0.70097813
[123,] 0.247113545 0.49422709 0.75288646
[124,] 0.203676810 0.40735362 0.79632319
[125,] 0.171957287 0.34391457 0.82804271
[126,] 0.134942577 0.26988515 0.86505742
[127,] 0.127662529 0.25532506 0.87233747
[128,] 0.168974002 0.33794800 0.83102600
[129,] 0.175454423 0.35090885 0.82454558
[130,] 0.156449813 0.31289963 0.84355019
[131,] 0.188128559 0.37625712 0.81187144
[132,] 0.138596567 0.27719313 0.86140343
[133,] 0.104487833 0.20897567 0.89551217
[134,] 0.168616912 0.33723382 0.83138309
[135,] 0.118995963 0.23799193 0.88100404
[136,] 0.091408613 0.18281723 0.90859139
[137,] 0.057885264 0.11577053 0.94211474
[138,] 0.033795603 0.06759121 0.96620440
[139,] 0.016744899 0.03348980 0.98325510
[140,] 0.007372982 0.01474596 0.99262702
> postscript(file="/var/www/html/rcomp/tmp/1mqk51293492044.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/2mqk51293492044.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/3mqk51293492044.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/4xi1q1293492044.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/5xi1q1293492044.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
3.159352189 1.033702782 -2.568416477 -0.262218886 -0.046054708 -1.316364900
7 8 9 10 11 12
-2.961632912 3.534410308 -1.376527147 -0.877242186 3.336957902 -0.014300959
13 14 15 16 17 18
3.322203714 0.409618243 0.630877995 -3.582842391 2.634951479 0.316180372
19 20 21 22 23 24
-2.331775777 0.323556825 0.921116337 -0.360080571 4.617188460 0.864864735
25 26 27 28 29 30
1.329573182 0.513619970 -2.697245728 1.362717027 -0.213356073 -1.831809551
31 32 33 34 35 36
0.309912983 4.893680247 -6.064261491 -0.336593531 -0.896052390 -1.024955962
37 38 39 40 41 42
-0.657318861 -3.404052154 1.222090383 -1.059950194 -0.195714488 0.626344845
43 44 45 46 47 48
-1.256224596 -4.257432028 1.207176948 0.850067527 1.182389018 -1.031607987
49 50 51 52 53 54
0.351340681 -3.661483431 -1.302625851 0.721199245 1.012296809 -0.830206791
55 56 57 58 59 60
6.896322485 0.542489136 0.726355307 -2.311875342 -0.397662912 -1.244786970
61 62 63 64 65 66
1.726252007 -1.968986877 -1.298906288 2.783094957 -2.043872935 -0.949467289
67 68 69 70 71 72
1.268301382 -0.223294521 -0.851223263 0.828332591 -0.322980010 0.921922723
73 74 75 76 77 78
0.405639459 -0.009539767 -2.639692705 0.268685058 -2.391550823 0.334087792
79 80 81 82 83 84
1.582615232 -2.372372347 1.691520400 1.909959618 -0.346425259 0.957952893
85 86 87 88 89 90
-0.928546364 -2.345467351 -2.170514500 1.714534699 4.086350955 -0.655086228
91 92 93 94 95 96
-0.829534178 1.107623853 -1.279131234 -3.234006743 3.430660563 0.438740284
97 98 99 100 101 102
-0.151950472 1.121612964 -0.543228560 -0.341579097 0.832622061 -1.275437270
103 104 105 106 107 108
-1.208836234 1.293041653 2.906037402 -3.448958236 0.068849111 1.358781095
109 110 111 112 113 114
1.253912663 -2.215346401 -0.491247200 3.140249204 4.634395245 0.177668545
115 116 117 118 119 120
5.534054401 -2.630246101 -2.244946910 -0.804822950 -0.446243758 -2.775579669
121 122 123 124 125 126
-1.795490104 -1.351255710 1.385824072 1.581686418 -0.074167960 -1.957322711
127 128 129 130 131 132
-2.347707609 0.906233115 0.822221523 0.290829038 2.196613876 0.485127646
133 134 135 136 137 138
-1.768196106 -1.897168400 0.538264745 -1.842415643 -2.313201521 -0.386310503
139 140 141 142 143 144
1.788863019 4.078876149 1.117555576 0.417308166 5.148798976 -1.062857736
145 146 147 148 149 150
0.561376657 -2.157785296 -1.208579169 -0.341425333 0.823132367 1.513936172
151 152 153 154 155 156
2.013233733 -2.278659969 -4.366747776 -3.435153519 1.293482779 -2.068107616
157 158 159
0.221768420 0.460755341 4.188303735
> postscript(file="/var/www/html/rcomp/tmp/6xi1q1293492044.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 3.159352189 NA
1 1.033702782 3.159352189
2 -2.568416477 1.033702782
3 -0.262218886 -2.568416477
4 -0.046054708 -0.262218886
5 -1.316364900 -0.046054708
6 -2.961632912 -1.316364900
7 3.534410308 -2.961632912
8 -1.376527147 3.534410308
9 -0.877242186 -1.376527147
10 3.336957902 -0.877242186
11 -0.014300959 3.336957902
12 3.322203714 -0.014300959
13 0.409618243 3.322203714
14 0.630877995 0.409618243
15 -3.582842391 0.630877995
16 2.634951479 -3.582842391
17 0.316180372 2.634951479
18 -2.331775777 0.316180372
19 0.323556825 -2.331775777
20 0.921116337 0.323556825
21 -0.360080571 0.921116337
22 4.617188460 -0.360080571
23 0.864864735 4.617188460
24 1.329573182 0.864864735
25 0.513619970 1.329573182
26 -2.697245728 0.513619970
27 1.362717027 -2.697245728
28 -0.213356073 1.362717027
29 -1.831809551 -0.213356073
30 0.309912983 -1.831809551
31 4.893680247 0.309912983
32 -6.064261491 4.893680247
33 -0.336593531 -6.064261491
34 -0.896052390 -0.336593531
35 -1.024955962 -0.896052390
36 -0.657318861 -1.024955962
37 -3.404052154 -0.657318861
38 1.222090383 -3.404052154
39 -1.059950194 1.222090383
40 -0.195714488 -1.059950194
41 0.626344845 -0.195714488
42 -1.256224596 0.626344845
43 -4.257432028 -1.256224596
44 1.207176948 -4.257432028
45 0.850067527 1.207176948
46 1.182389018 0.850067527
47 -1.031607987 1.182389018
48 0.351340681 -1.031607987
49 -3.661483431 0.351340681
50 -1.302625851 -3.661483431
51 0.721199245 -1.302625851
52 1.012296809 0.721199245
53 -0.830206791 1.012296809
54 6.896322485 -0.830206791
55 0.542489136 6.896322485
56 0.726355307 0.542489136
57 -2.311875342 0.726355307
58 -0.397662912 -2.311875342
59 -1.244786970 -0.397662912
60 1.726252007 -1.244786970
61 -1.968986877 1.726252007
62 -1.298906288 -1.968986877
63 2.783094957 -1.298906288
64 -2.043872935 2.783094957
65 -0.949467289 -2.043872935
66 1.268301382 -0.949467289
67 -0.223294521 1.268301382
68 -0.851223263 -0.223294521
69 0.828332591 -0.851223263
70 -0.322980010 0.828332591
71 0.921922723 -0.322980010
72 0.405639459 0.921922723
73 -0.009539767 0.405639459
74 -2.639692705 -0.009539767
75 0.268685058 -2.639692705
76 -2.391550823 0.268685058
77 0.334087792 -2.391550823
78 1.582615232 0.334087792
79 -2.372372347 1.582615232
80 1.691520400 -2.372372347
81 1.909959618 1.691520400
82 -0.346425259 1.909959618
83 0.957952893 -0.346425259
84 -0.928546364 0.957952893
85 -2.345467351 -0.928546364
86 -2.170514500 -2.345467351
87 1.714534699 -2.170514500
88 4.086350955 1.714534699
89 -0.655086228 4.086350955
90 -0.829534178 -0.655086228
91 1.107623853 -0.829534178
92 -1.279131234 1.107623853
93 -3.234006743 -1.279131234
94 3.430660563 -3.234006743
95 0.438740284 3.430660563
96 -0.151950472 0.438740284
97 1.121612964 -0.151950472
98 -0.543228560 1.121612964
99 -0.341579097 -0.543228560
100 0.832622061 -0.341579097
101 -1.275437270 0.832622061
102 -1.208836234 -1.275437270
103 1.293041653 -1.208836234
104 2.906037402 1.293041653
105 -3.448958236 2.906037402
106 0.068849111 -3.448958236
107 1.358781095 0.068849111
108 1.253912663 1.358781095
109 -2.215346401 1.253912663
110 -0.491247200 -2.215346401
111 3.140249204 -0.491247200
112 4.634395245 3.140249204
113 0.177668545 4.634395245
114 5.534054401 0.177668545
115 -2.630246101 5.534054401
116 -2.244946910 -2.630246101
117 -0.804822950 -2.244946910
118 -0.446243758 -0.804822950
119 -2.775579669 -0.446243758
120 -1.795490104 -2.775579669
121 -1.351255710 -1.795490104
122 1.385824072 -1.351255710
123 1.581686418 1.385824072
124 -0.074167960 1.581686418
125 -1.957322711 -0.074167960
126 -2.347707609 -1.957322711
127 0.906233115 -2.347707609
128 0.822221523 0.906233115
129 0.290829038 0.822221523
130 2.196613876 0.290829038
131 0.485127646 2.196613876
132 -1.768196106 0.485127646
133 -1.897168400 -1.768196106
134 0.538264745 -1.897168400
135 -1.842415643 0.538264745
136 -2.313201521 -1.842415643
137 -0.386310503 -2.313201521
138 1.788863019 -0.386310503
139 4.078876149 1.788863019
140 1.117555576 4.078876149
141 0.417308166 1.117555576
142 5.148798976 0.417308166
143 -1.062857736 5.148798976
144 0.561376657 -1.062857736
145 -2.157785296 0.561376657
146 -1.208579169 -2.157785296
147 -0.341425333 -1.208579169
148 0.823132367 -0.341425333
149 1.513936172 0.823132367
150 2.013233733 1.513936172
151 -2.278659969 2.013233733
152 -4.366747776 -2.278659969
153 -3.435153519 -4.366747776
154 1.293482779 -3.435153519
155 -2.068107616 1.293482779
156 0.221768420 -2.068107616
157 0.460755341 0.221768420
158 4.188303735 0.460755341
159 NA 4.188303735
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.033702782 3.159352189
[2,] -2.568416477 1.033702782
[3,] -0.262218886 -2.568416477
[4,] -0.046054708 -0.262218886
[5,] -1.316364900 -0.046054708
[6,] -2.961632912 -1.316364900
[7,] 3.534410308 -2.961632912
[8,] -1.376527147 3.534410308
[9,] -0.877242186 -1.376527147
[10,] 3.336957902 -0.877242186
[11,] -0.014300959 3.336957902
[12,] 3.322203714 -0.014300959
[13,] 0.409618243 3.322203714
[14,] 0.630877995 0.409618243
[15,] -3.582842391 0.630877995
[16,] 2.634951479 -3.582842391
[17,] 0.316180372 2.634951479
[18,] -2.331775777 0.316180372
[19,] 0.323556825 -2.331775777
[20,] 0.921116337 0.323556825
[21,] -0.360080571 0.921116337
[22,] 4.617188460 -0.360080571
[23,] 0.864864735 4.617188460
[24,] 1.329573182 0.864864735
[25,] 0.513619970 1.329573182
[26,] -2.697245728 0.513619970
[27,] 1.362717027 -2.697245728
[28,] -0.213356073 1.362717027
[29,] -1.831809551 -0.213356073
[30,] 0.309912983 -1.831809551
[31,] 4.893680247 0.309912983
[32,] -6.064261491 4.893680247
[33,] -0.336593531 -6.064261491
[34,] -0.896052390 -0.336593531
[35,] -1.024955962 -0.896052390
[36,] -0.657318861 -1.024955962
[37,] -3.404052154 -0.657318861
[38,] 1.222090383 -3.404052154
[39,] -1.059950194 1.222090383
[40,] -0.195714488 -1.059950194
[41,] 0.626344845 -0.195714488
[42,] -1.256224596 0.626344845
[43,] -4.257432028 -1.256224596
[44,] 1.207176948 -4.257432028
[45,] 0.850067527 1.207176948
[46,] 1.182389018 0.850067527
[47,] -1.031607987 1.182389018
[48,] 0.351340681 -1.031607987
[49,] -3.661483431 0.351340681
[50,] -1.302625851 -3.661483431
[51,] 0.721199245 -1.302625851
[52,] 1.012296809 0.721199245
[53,] -0.830206791 1.012296809
[54,] 6.896322485 -0.830206791
[55,] 0.542489136 6.896322485
[56,] 0.726355307 0.542489136
[57,] -2.311875342 0.726355307
[58,] -0.397662912 -2.311875342
[59,] -1.244786970 -0.397662912
[60,] 1.726252007 -1.244786970
[61,] -1.968986877 1.726252007
[62,] -1.298906288 -1.968986877
[63,] 2.783094957 -1.298906288
[64,] -2.043872935 2.783094957
[65,] -0.949467289 -2.043872935
[66,] 1.268301382 -0.949467289
[67,] -0.223294521 1.268301382
[68,] -0.851223263 -0.223294521
[69,] 0.828332591 -0.851223263
[70,] -0.322980010 0.828332591
[71,] 0.921922723 -0.322980010
[72,] 0.405639459 0.921922723
[73,] -0.009539767 0.405639459
[74,] -2.639692705 -0.009539767
[75,] 0.268685058 -2.639692705
[76,] -2.391550823 0.268685058
[77,] 0.334087792 -2.391550823
[78,] 1.582615232 0.334087792
[79,] -2.372372347 1.582615232
[80,] 1.691520400 -2.372372347
[81,] 1.909959618 1.691520400
[82,] -0.346425259 1.909959618
[83,] 0.957952893 -0.346425259
[84,] -0.928546364 0.957952893
[85,] -2.345467351 -0.928546364
[86,] -2.170514500 -2.345467351
[87,] 1.714534699 -2.170514500
[88,] 4.086350955 1.714534699
[89,] -0.655086228 4.086350955
[90,] -0.829534178 -0.655086228
[91,] 1.107623853 -0.829534178
[92,] -1.279131234 1.107623853
[93,] -3.234006743 -1.279131234
[94,] 3.430660563 -3.234006743
[95,] 0.438740284 3.430660563
[96,] -0.151950472 0.438740284
[97,] 1.121612964 -0.151950472
[98,] -0.543228560 1.121612964
[99,] -0.341579097 -0.543228560
[100,] 0.832622061 -0.341579097
[101,] -1.275437270 0.832622061
[102,] -1.208836234 -1.275437270
[103,] 1.293041653 -1.208836234
[104,] 2.906037402 1.293041653
[105,] -3.448958236 2.906037402
[106,] 0.068849111 -3.448958236
[107,] 1.358781095 0.068849111
[108,] 1.253912663 1.358781095
[109,] -2.215346401 1.253912663
[110,] -0.491247200 -2.215346401
[111,] 3.140249204 -0.491247200
[112,] 4.634395245 3.140249204
[113,] 0.177668545 4.634395245
[114,] 5.534054401 0.177668545
[115,] -2.630246101 5.534054401
[116,] -2.244946910 -2.630246101
[117,] -0.804822950 -2.244946910
[118,] -0.446243758 -0.804822950
[119,] -2.775579669 -0.446243758
[120,] -1.795490104 -2.775579669
[121,] -1.351255710 -1.795490104
[122,] 1.385824072 -1.351255710
[123,] 1.581686418 1.385824072
[124,] -0.074167960 1.581686418
[125,] -1.957322711 -0.074167960
[126,] -2.347707609 -1.957322711
[127,] 0.906233115 -2.347707609
[128,] 0.822221523 0.906233115
[129,] 0.290829038 0.822221523
[130,] 2.196613876 0.290829038
[131,] 0.485127646 2.196613876
[132,] -1.768196106 0.485127646
[133,] -1.897168400 -1.768196106
[134,] 0.538264745 -1.897168400
[135,] -1.842415643 0.538264745
[136,] -2.313201521 -1.842415643
[137,] -0.386310503 -2.313201521
[138,] 1.788863019 -0.386310503
[139,] 4.078876149 1.788863019
[140,] 1.117555576 4.078876149
[141,] 0.417308166 1.117555576
[142,] 5.148798976 0.417308166
[143,] -1.062857736 5.148798976
[144,] 0.561376657 -1.062857736
[145,] -2.157785296 0.561376657
[146,] -1.208579169 -2.157785296
[147,] -0.341425333 -1.208579169
[148,] 0.823132367 -0.341425333
[149,] 1.513936172 0.823132367
[150,] 2.013233733 1.513936172
[151,] -2.278659969 2.013233733
[152,] -4.366747776 -2.278659969
[153,] -3.435153519 -4.366747776
[154,] 1.293482779 -3.435153519
[155,] -2.068107616 1.293482779
[156,] 0.221768420 -2.068107616
[157,] 0.460755341 0.221768420
[158,] 4.188303735 0.460755341
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.033702782 3.159352189
2 -2.568416477 1.033702782
3 -0.262218886 -2.568416477
4 -0.046054708 -0.262218886
5 -1.316364900 -0.046054708
6 -2.961632912 -1.316364900
7 3.534410308 -2.961632912
8 -1.376527147 3.534410308
9 -0.877242186 -1.376527147
10 3.336957902 -0.877242186
11 -0.014300959 3.336957902
12 3.322203714 -0.014300959
13 0.409618243 3.322203714
14 0.630877995 0.409618243
15 -3.582842391 0.630877995
16 2.634951479 -3.582842391
17 0.316180372 2.634951479
18 -2.331775777 0.316180372
19 0.323556825 -2.331775777
20 0.921116337 0.323556825
21 -0.360080571 0.921116337
22 4.617188460 -0.360080571
23 0.864864735 4.617188460
24 1.329573182 0.864864735
25 0.513619970 1.329573182
26 -2.697245728 0.513619970
27 1.362717027 -2.697245728
28 -0.213356073 1.362717027
29 -1.831809551 -0.213356073
30 0.309912983 -1.831809551
31 4.893680247 0.309912983
32 -6.064261491 4.893680247
33 -0.336593531 -6.064261491
34 -0.896052390 -0.336593531
35 -1.024955962 -0.896052390
36 -0.657318861 -1.024955962
37 -3.404052154 -0.657318861
38 1.222090383 -3.404052154
39 -1.059950194 1.222090383
40 -0.195714488 -1.059950194
41 0.626344845 -0.195714488
42 -1.256224596 0.626344845
43 -4.257432028 -1.256224596
44 1.207176948 -4.257432028
45 0.850067527 1.207176948
46 1.182389018 0.850067527
47 -1.031607987 1.182389018
48 0.351340681 -1.031607987
49 -3.661483431 0.351340681
50 -1.302625851 -3.661483431
51 0.721199245 -1.302625851
52 1.012296809 0.721199245
53 -0.830206791 1.012296809
54 6.896322485 -0.830206791
55 0.542489136 6.896322485
56 0.726355307 0.542489136
57 -2.311875342 0.726355307
58 -0.397662912 -2.311875342
59 -1.244786970 -0.397662912
60 1.726252007 -1.244786970
61 -1.968986877 1.726252007
62 -1.298906288 -1.968986877
63 2.783094957 -1.298906288
64 -2.043872935 2.783094957
65 -0.949467289 -2.043872935
66 1.268301382 -0.949467289
67 -0.223294521 1.268301382
68 -0.851223263 -0.223294521
69 0.828332591 -0.851223263
70 -0.322980010 0.828332591
71 0.921922723 -0.322980010
72 0.405639459 0.921922723
73 -0.009539767 0.405639459
74 -2.639692705 -0.009539767
75 0.268685058 -2.639692705
76 -2.391550823 0.268685058
77 0.334087792 -2.391550823
78 1.582615232 0.334087792
79 -2.372372347 1.582615232
80 1.691520400 -2.372372347
81 1.909959618 1.691520400
82 -0.346425259 1.909959618
83 0.957952893 -0.346425259
84 -0.928546364 0.957952893
85 -2.345467351 -0.928546364
86 -2.170514500 -2.345467351
87 1.714534699 -2.170514500
88 4.086350955 1.714534699
89 -0.655086228 4.086350955
90 -0.829534178 -0.655086228
91 1.107623853 -0.829534178
92 -1.279131234 1.107623853
93 -3.234006743 -1.279131234
94 3.430660563 -3.234006743
95 0.438740284 3.430660563
96 -0.151950472 0.438740284
97 1.121612964 -0.151950472
98 -0.543228560 1.121612964
99 -0.341579097 -0.543228560
100 0.832622061 -0.341579097
101 -1.275437270 0.832622061
102 -1.208836234 -1.275437270
103 1.293041653 -1.208836234
104 2.906037402 1.293041653
105 -3.448958236 2.906037402
106 0.068849111 -3.448958236
107 1.358781095 0.068849111
108 1.253912663 1.358781095
109 -2.215346401 1.253912663
110 -0.491247200 -2.215346401
111 3.140249204 -0.491247200
112 4.634395245 3.140249204
113 0.177668545 4.634395245
114 5.534054401 0.177668545
115 -2.630246101 5.534054401
116 -2.244946910 -2.630246101
117 -0.804822950 -2.244946910
118 -0.446243758 -0.804822950
119 -2.775579669 -0.446243758
120 -1.795490104 -2.775579669
121 -1.351255710 -1.795490104
122 1.385824072 -1.351255710
123 1.581686418 1.385824072
124 -0.074167960 1.581686418
125 -1.957322711 -0.074167960
126 -2.347707609 -1.957322711
127 0.906233115 -2.347707609
128 0.822221523 0.906233115
129 0.290829038 0.822221523
130 2.196613876 0.290829038
131 0.485127646 2.196613876
132 -1.768196106 0.485127646
133 -1.897168400 -1.768196106
134 0.538264745 -1.897168400
135 -1.842415643 0.538264745
136 -2.313201521 -1.842415643
137 -0.386310503 -2.313201521
138 1.788863019 -0.386310503
139 4.078876149 1.788863019
140 1.117555576 4.078876149
141 0.417308166 1.117555576
142 5.148798976 0.417308166
143 -1.062857736 5.148798976
144 0.561376657 -1.062857736
145 -2.157785296 0.561376657
146 -1.208579169 -2.157785296
147 -0.341425333 -1.208579169
148 0.823132367 -0.341425333
149 1.513936172 0.823132367
150 2.013233733 1.513936172
151 -2.278659969 2.013233733
152 -4.366747776 -2.278659969
153 -3.435153519 -4.366747776
154 1.293482779 -3.435153519
155 -2.068107616 1.293482779
156 0.221768420 -2.068107616
157 0.460755341 0.221768420
158 4.188303735 0.460755341
> 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/7791b1293492044.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/8000w1293492044.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/9000w1293492044.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/10000w1293492044.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/11esgn1293492044.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/120set1293492044.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/13wkc21293492044.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/146ubn1293492044.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/15acst1293492044.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/16648j1293492044.tab")
+ }
>
> try(system("convert tmp/1mqk51293492044.ps tmp/1mqk51293492044.png",intern=TRUE))
character(0)
> try(system("convert tmp/2mqk51293492044.ps tmp/2mqk51293492044.png",intern=TRUE))
character(0)
> try(system("convert tmp/3mqk51293492044.ps tmp/3mqk51293492044.png",intern=TRUE))
character(0)
> try(system("convert tmp/4xi1q1293492044.ps tmp/4xi1q1293492044.png",intern=TRUE))
character(0)
> try(system("convert tmp/5xi1q1293492044.ps tmp/5xi1q1293492044.png",intern=TRUE))
character(0)
> try(system("convert tmp/6xi1q1293492044.ps tmp/6xi1q1293492044.png",intern=TRUE))
character(0)
> try(system("convert tmp/7791b1293492044.ps tmp/7791b1293492044.png",intern=TRUE))
character(0)
> try(system("convert tmp/8000w1293492044.ps tmp/8000w1293492044.png",intern=TRUE))
character(0)
> try(system("convert tmp/9000w1293492044.ps tmp/9000w1293492044.png",intern=TRUE))
character(0)
> try(system("convert tmp/10000w1293492044.ps tmp/10000w1293492044.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.093 1.824 13.844