R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(0
+ ,24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,0
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,0
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,1
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,1
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,1
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,1
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,1
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,1
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,1
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,0
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,0
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,1
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,1
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,1
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,1
+ ,12
+ ,4
+ ,15
+ ,4
+ ,27
+ ,28
+ ,0
+ ,21
+ ,9
+ ,9
+ ,9
+ ,22
+ ,20
+ ,1
+ ,15
+ ,8
+ ,11
+ ,8
+ ,14
+ ,12
+ ,1
+ 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
+ ,14
+ ,9
+ ,9
+ ,23
+ ,14
+ ,0
+ ,30
+ ,12
+ ,15
+ ,10
+ ,29
+ ,22
+ ,1
+ ,24
+ ,14
+ ,24
+ ,20
+ ,21
+ ,10
+ ,1
+ ,21
+ ,15
+ ,7
+ ,5
+ ,21
+ ,24
+ ,1
+ ,21
+ ,13
+ ,17
+ ,11
+ ,23
+ ,22
+ ,1
+ ,29
+ ,16
+ ,11
+ ,6
+ ,27
+ ,24
+ ,1
+ ,31
+ ,9
+ ,17
+ ,9
+ ,25
+ ,19
+ ,1
+ ,20
+ ,9
+ ,11
+ ,7
+ ,21
+ ,20
+ ,0
+ ,16
+ ,9
+ ,12
+ ,9
+ ,10
+ ,13
+ ,0
+ ,22
+ ,8
+ ,14
+ ,10
+ ,20
+ ,20
+ ,1
+ ,20
+ ,7
+ ,11
+ ,9
+ ,26
+ ,22
+ ,1
+ ,28
+ ,16
+ ,16
+ ,8
+ ,24
+ ,24
+ ,1
+ ,38
+ ,11
+ ,21
+ ,7
+ ,29
+ ,29
+ ,0
+ ,22
+ ,9
+ ,14
+ ,6
+ ,19
+ ,12
+ ,1
+ ,20
+ ,11
+ ,20
+ ,13
+ ,24
+ ,20
+ ,0
+ ,17
+ ,9
+ ,13
+ ,6
+ ,19
+ ,21
+ ,1
+ ,28
+ ,14
+ ,11
+ ,8
+ ,24
+ ,24
+ ,1
+ ,22
+ ,13
+ ,15
+ ,10
+ ,22
+ ,22
+ ,0
+ ,31
+ ,16
+ ,19
+ ,16
+ ,17
+ ,20)
+ ,dim=c(7
+ ,159)
+ ,dimnames=list(c('gender'
+ ,'ConcernoverMistakes'
+ ,'Doubtsaboutactions'
+ ,'ParentalExpectations'
+ ,'ParentalCriticism'
+ ,'PersonalStandards'
+ ,'Organization
')
+ ,1:159))
> y <- array(NA,dim=c(7,159),dimnames=list(c('gender','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 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '2'
> #'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
> 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
ConcernoverMistakes gender Doubtsaboutactions ParentalExpectations
1 24 0 14 11
2 25 0 11 7
3 17 0 6 17
4 18 1 12 10
5 18 1 8 12
6 16 1 10 12
7 20 1 10 11
8 16 1 11 11
9 18 1 16 12
10 17 1 11 13
11 23 0 13 14
12 30 0 12 16
13 23 1 8 11
14 18 1 12 10
15 15 1 11 11
16 12 1 4 15
17 21 0 9 9
18 15 1 8 11
19 20 1 8 17
20 31 0 14 17
21 27 0 15 11
22 34 1 16 18
23 21 1 9 14
24 31 1 14 10
25 19 1 11 11
26 16 0 8 15
27 20 1 9 15
28 21 1 9 13
29 22 1 9 16
30 17 1 9 13
31 24 1 10 9
32 25 0 16 18
33 26 0 11 18
34 25 1 8 12
35 17 1 9 17
36 32 1 16 9
37 33 1 11 9
38 13 1 16 12
39 32 1 12 18
40 25 1 12 12
41 29 1 14 18
42 22 1 9 14
43 18 1 10 15
44 17 1 9 16
45 20 0 10 10
46 15 1 12 11
47 20 1 14 14
48 33 1 14 9
49 29 0 10 12
50 23 1 14 17
51 26 0 16 5
52 18 1 9 12
53 20 0 10 12
54 6 11 6 4
55 8 28 24 20
56 13 26 12 8
57 10 22 12 8
58 8 17 14 6
59 7 12 7 4
60 15 14 13 8
61 9 17 12 9
62 10 21 13 6
63 12 19 14 7
64 13 18 8 9
65 10 10 11 5
66 11 29 9 5
67 8 31 11 8
68 9 19 13 8
69 13 9 10 6
70 11 20 11 8
71 8 28 12 7
72 9 19 9 7
73 9 30 15 9
74 15 29 18 11
75 9 26 15 6
76 10 23 12 8
77 14 13 13 6
78 12 21 14 9
79 12 19 10 8
80 11 28 13 6
81 14 23 13 10
82 6 18 11 8
83 12 21 13 8
84 8 20 16 10
85 14 23 8 5
86 11 21 16 7
87 10 21 11 5
88 14 15 9 8
89 12 28 16 14
90 10 19 12 7
91 14 26 14 8
92 5 10 8 6
93 11 16 9 5
94 10 22 15 6
95 9 19 11 10
96 10 31 21 12
97 16 31 14 9
98 13 29 18 12
99 9 19 12 7
100 10 22 13 8
101 10 23 15 10
102 7 15 12 6
103 9 20 19 10
104 8 18 15 10
105 14 23 11 10
106 14 25 11 5
107 8 21 10 7
108 9 24 13 10
109 14 25 15 11
110 14 17 12 6
111 8 13 12 7
112 8 28 16 12
113 8 21 9 11
114 7 25 18 11
115 6 9 8 11
116 8 16 13 5
117 6 19 17 8
118 11 17 9 6
119 14 25 15 9
120 11 20 8 4
121 11 29 7 4
122 11 14 12 7
123 14 22 14 11
124 8 15 6 6
125 20 19 8 7
126 11 20 17 8
127 8 15 10 4
128 11 20 11 8
129 10 18 14 9
130 14 33 11 8
131 11 22 13 11
132 9 16 12 8
133 9 17 11 5
134 8 16 9 4
135 10 21 12 8
136 13 26 20 10
137 13 18 12 6
138 12 18 13 9
139 8 17 12 9
140 13 22 12 13
141 14 30 9 9
142 12 30 15 10
143 14 24 24 20
144 15 21 7 5
145 13 21 17 11
146 16 29 11 6
147 9 31 17 9
148 9 20 11 7
149 9 16 12 9
150 8 22 14 10
151 7 20 11 9
152 16 28 16 8
153 11 38 21 7
154 9 22 14 6
155 11 20 20 13
156 9 17 13 6
157 14 28 11 8
158 13 22 15 10
159 16 31 19 16
ParentalCriticism PersonalStandards Organization\r
1 12 24 26
2 8 25 23
3 8 30 25
4 8 19 23
5 9 22 19
6 7 22 29
7 4 25 25
8 11 23 21
9 7 17 22
10 7 21 25
11 12 19 24
12 10 19 18
13 10 15 22
14 8 16 15
15 8 23 22
16 4 27 28
17 9 22 20
18 8 14 12
19 7 22 24
20 11 23 20
21 9 23 21
22 11 21 20
23 13 19 21
24 8 18 23
25 8 20 28
26 9 23 24
27 6 25 24
28 9 19 24
29 9 24 23
30 6 22 23
31 6 25 29
32 16 26 24
33 5 29 18
34 7 32 25
35 9 25 21
36 6 29 26
37 6 28 22
38 5 17 22
39 12 28 22
40 7 29 23
41 10 26 30
42 9 25 23
43 8 14 17
44 5 25 23
45 8 26 23
46 8 20 25
47 10 18 24
48 6 32 24
49 8 25 23
50 7 25 21
51 4 23 24
52 8 21 24
53 8 20 28
54 15 16 1
55 30 20 1
56 24 29 0
57 26 27 1
58 24 22 0
59 22 28 1
60 14 16 1
61 24 25 1
62 24 24 1
63 24 28 1
64 24 24 0
65 19 23 0
66 31 30 1
67 22 24 0
68 27 21 1
69 19 25 1
70 25 25 1
71 20 22 0
72 21 23 0
73 27 26 0
74 23 23 0
75 25 25 0
76 20 21 1
77 21 25 1
78 22 24 1
79 23 29 1
80 25 22 1
81 25 27 1
82 17 26 0
83 19 22 1
84 25 24 1
85 19 27 1
86 20 24 1
87 26 24 1
88 23 29 1
89 27 22 1
90 17 21 1
91 17 24 1
92 19 24 0
93 17 23 1
94 22 20 1
95 21 27 1
96 32 26 0
97 21 25 1
98 21 21 0
99 18 21 1
100 18 19 1
101 23 21 0
102 19 21 0
103 20 16 1
104 21 22 1
105 20 29 1
106 17 15 1
107 18 17 1
108 19 15 1
109 22 21 1
110 15 21 1
111 14 19 1
112 18 24 0
113 24 20 1
114 35 17 0
115 29 23 1
116 21 24 1
117 25 14 1
118 20 19 1
119 22 24 1
120 13 13 1
121 26 22 1
122 17 16 1
123 25 19 1
124 20 25 0
125 19 25 1
126 21 23 0
127 22 24 1
128 24 26 1
129 21 26 1
130 26 25 1
131 24 18 1
132 16 21 1
133 23 26 1
134 18 23 0
135 16 23 0
136 26 22 1
137 19 20 1
138 21 13 1
139 21 24 1
140 22 15 1
141 23 14 0
142 29 22 1
143 21 10 1
144 21 24 1
145 23 22 1
146 27 24 1
147 25 19 1
148 21 20 0
149 10 13 0
150 20 20 1
151 26 22 1
152 24 24 1
153 29 29 0
154 19 12 1
155 24 20 0
156 19 21 1
157 24 24 1
158 22 22 0
159 17 20 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) gender Doubtsaboutactions
3.44755 0.02289 0.34754
ParentalExpectations ParentalCriticism PersonalStandards
0.08062 -0.19629 0.26462
`Organization\r`
0.39171
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-11.3974 -2.5721 -0.2593 2.0652 12.2857
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.44755 2.49222 1.383 0.16859
gender 0.02289 0.07416 0.309 0.75799
Doubtsaboutactions 0.34754 0.11138 3.120 0.00216 **
ParentalExpectations 0.08062 0.11623 0.694 0.48895
ParentalCriticism -0.19629 0.09820 -1.999 0.04740 *
PersonalStandards 0.26462 0.08028 3.296 0.00122 **
`Organization\r` 0.39171 0.08232 4.758 4.5e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.915 on 152 degrees of freedom
Multiple R-squared: 0.6667, Adjusted R-squared: 0.6535
F-statistic: 50.66 on 6 and 152 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.1292720 2.585439e-01 8.707280e-01
[2,] 0.0814002 1.628004e-01 9.185998e-01
[3,] 0.2450984 4.901968e-01 7.549016e-01
[4,] 0.1774907 3.549815e-01 8.225093e-01
[5,] 0.2737796 5.475593e-01 7.262204e-01
[6,] 0.2058930 4.117860e-01 7.941070e-01
[7,] 0.2068281 4.136561e-01 7.931719e-01
[8,] 0.2755132 5.510263e-01 7.244868e-01
[9,] 0.3431353 6.862706e-01 6.568647e-01
[10,] 0.3533239 7.066478e-01 6.466761e-01
[11,] 0.4926888 9.853777e-01 5.073112e-01
[12,] 0.4336292 8.672585e-01 5.663708e-01
[13,] 0.8243123 3.513755e-01 1.756877e-01
[14,] 0.7782206 4.435588e-01 2.217794e-01
[15,] 0.9703977 5.920458e-02 2.960229e-02
[16,] 0.9606065 7.878703e-02 3.939352e-02
[17,] 0.9737010 5.259801e-02 2.629900e-02
[18,] 0.9676287 6.474259e-02 3.237129e-02
[19,] 0.9597262 8.054766e-02 4.027383e-02
[20,] 0.9482667 1.034666e-01 5.173328e-02
[21,] 0.9406081 1.187838e-01 5.939188e-02
[22,] 0.9688708 6.225838e-02 3.112919e-02
[23,] 0.9777252 4.454951e-02 2.227476e-02
[24,] 0.9720128 5.597448e-02 2.798724e-02
[25,] 0.9828215 3.435694e-02 1.717847e-02
[26,] 0.9845775 3.084493e-02 1.542247e-02
[27,] 0.9886188 2.276234e-02 1.138117e-02
[28,] 0.9988366 2.326854e-03 1.163427e-03
[29,] 0.9999308 1.384195e-04 6.920975e-05
[30,] 0.9999845 3.101588e-05 1.550794e-05
[31,] 0.9999752 4.959755e-05 2.479877e-05
[32,] 0.9999724 5.513018e-05 2.756509e-05
[33,] 0.9999527 9.451131e-05 4.725566e-05
[34,] 0.9999259 1.481538e-04 7.407691e-05
[35,] 0.9999468 1.063445e-04 5.317227e-05
[36,] 0.9999303 1.394145e-04 6.970726e-05
[37,] 0.9999854 2.916507e-05 1.458253e-05
[38,] 0.9999814 3.717419e-05 1.858710e-05
[39,] 0.9999930 1.404793e-05 7.023966e-06
[40,] 0.9999990 2.050115e-06 1.025057e-06
[41,] 0.9999987 2.678717e-06 1.339358e-06
[42,] 0.9999992 1.504772e-06 7.523861e-07
[43,] 0.9999987 2.600814e-06 1.300407e-06
[44,] 0.9999994 1.192483e-06 5.962417e-07
[45,] 0.9999994 1.141376e-06 5.706881e-07
[46,] 0.9999995 1.051061e-06 5.255306e-07
[47,] 0.9999997 6.394518e-07 3.197259e-07
[48,] 0.9999995 9.891200e-07 4.945600e-07
[49,] 0.9999997 5.954346e-07 2.977173e-07
[50,] 0.9999999 2.186833e-07 1.093416e-07
[51,] 1.0000000 9.863755e-08 4.931878e-08
[52,] 0.9999999 1.370849e-07 6.854246e-08
[53,] 0.9999999 2.462816e-07 1.231408e-07
[54,] 0.9999998 4.169404e-07 2.084702e-07
[55,] 0.9999999 1.939286e-07 9.696431e-08
[56,] 0.9999999 1.057468e-07 5.287341e-08
[57,] 1.0000000 6.300071e-08 3.150035e-08
[58,] 1.0000000 3.060943e-08 1.530471e-08
[59,] 1.0000000 5.804728e-08 2.902364e-08
[60,] 1.0000000 4.090840e-08 2.045420e-08
[61,] 1.0000000 7.847464e-08 3.923732e-08
[62,] 1.0000000 7.528095e-08 3.764048e-08
[63,] 0.9999999 1.437503e-07 7.187515e-08
[64,] 0.9999999 2.042720e-07 1.021360e-07
[65,] 0.9999999 1.765394e-07 8.826969e-08
[66,] 0.9999998 3.130352e-07 1.565176e-07
[67,] 0.9999998 4.515797e-07 2.257898e-07
[68,] 0.9999999 1.918108e-07 9.590540e-08
[69,] 0.9999998 3.574675e-07 1.787337e-07
[70,] 0.9999997 6.626429e-07 3.313215e-07
[71,] 0.9999996 8.774919e-07 4.387459e-07
[72,] 0.9999994 1.272204e-06 6.361021e-07
[73,] 0.9999997 5.764607e-07 2.882304e-07
[74,] 0.9999995 1.043273e-06 5.216363e-07
[75,] 0.9999995 9.081041e-07 4.540521e-07
[76,] 0.9999995 1.008670e-06 5.043348e-07
[77,] 0.9999991 1.702439e-06 8.512194e-07
[78,] 0.9999984 3.107598e-06 1.553799e-06
[79,] 0.9999987 2.600516e-06 1.300258e-06
[80,] 0.9999979 4.210392e-06 2.105196e-06
[81,] 0.9999964 7.122638e-06 3.561319e-06
[82,] 0.9999943 1.136796e-05 5.683979e-06
[83,] 0.9999944 1.122222e-05 5.611109e-06
[84,] 0.9999904 1.928151e-05 9.640753e-06
[85,] 0.9999832 3.356154e-05 1.678077e-05
[86,] 0.9999820 3.590274e-05 1.795137e-05
[87,] 0.9999737 5.261147e-05 2.630574e-05
[88,] 0.9999702 5.953100e-05 2.976550e-05
[89,] 0.9999502 9.968359e-05 4.984180e-05
[90,] 0.9999304 1.391608e-04 6.958040e-05
[91,] 0.9998997 2.006187e-04 1.003093e-04
[92,] 0.9998336 3.327124e-04 1.663562e-04
[93,] 0.9997648 4.703410e-04 2.351705e-04
[94,] 0.9996733 6.533027e-04 3.266513e-04
[95,] 0.9996622 6.756127e-04 3.378063e-04
[96,] 0.9994673 1.065445e-03 5.327226e-04
[97,] 0.9995437 9.126539e-04 4.563269e-04
[98,] 0.9995417 9.166439e-04 4.583220e-04
[99,] 0.9995571 8.858930e-04 4.429465e-04
[100,] 0.9993514 1.297251e-03 6.486257e-04
[101,] 0.9992774 1.445222e-03 7.226109e-04
[102,] 0.9990972 1.805559e-03 9.027793e-04
[103,] 0.9997371 5.258058e-04 2.629029e-04
[104,] 0.9998226 3.548063e-04 1.774032e-04
[105,] 0.9996973 6.054814e-04 3.027407e-04
[106,] 0.9995979 8.041926e-04 4.020963e-04
[107,] 0.9994123 1.175307e-03 5.876535e-04
[108,] 0.9992294 1.541126e-03 7.705628e-04
[109,] 0.9988171 2.365814e-03 1.182907e-03
[110,] 0.9981948 3.610389e-03 1.805194e-03
[111,] 0.9974126 5.174797e-03 2.587399e-03
[112,] 0.9969425 6.114908e-03 3.057454e-03
[113,] 0.9956653 8.669350e-03 4.334675e-03
[114,] 0.9948965 1.020703e-02 5.103516e-03
[115,] 0.9930924 1.381527e-02 6.907636e-03
[116,] 0.9997057 5.885871e-04 2.942935e-04
[117,] 0.9995487 9.026156e-04 4.513078e-04
[118,] 0.9991917 1.616559e-03 8.082796e-04
[119,] 0.9985261 2.947767e-03 1.473883e-03
[120,] 0.9975124 4.975170e-03 2.487585e-03
[121,] 0.9961524 7.695129e-03 3.847565e-03
[122,] 0.9937847 1.243058e-02 6.215288e-03
[123,] 0.9906621 1.867575e-02 9.337873e-03
[124,] 0.9849039 3.019222e-02 1.509611e-02
[125,] 0.9762041 4.759187e-02 2.379594e-02
[126,] 0.9654340 6.913201e-02 3.456601e-02
[127,] 0.9522681 9.546374e-02 4.773187e-02
[128,] 0.9497464 1.005073e-01 5.025363e-02
[129,] 0.9423828 1.152344e-01 5.761722e-02
[130,] 0.9408486 1.183029e-01 5.915143e-02
[131,] 0.9107714 1.784571e-01 8.922856e-02
[132,] 0.8883489 2.233022e-01 1.116511e-01
[133,] 0.8359634 3.280732e-01 1.640366e-01
[134,] 0.8106767 3.786465e-01 1.893233e-01
[135,] 0.7694628 4.610744e-01 2.305372e-01
[136,] 0.7024121 5.951759e-01 2.975879e-01
[137,] 0.7609546 4.780908e-01 2.390454e-01
[138,] 0.6905244 6.189511e-01 3.094756e-01
[139,] 0.5464823 9.070353e-01 4.535177e-01
[140,] 0.3998908 7.997815e-01 6.001092e-01
> postscript(file="/var/www/rcomp/tmp/1vyzf1292091237.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/rcomp/tmp/268yi1292091237.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/rcomp/tmp/368yi1292091237.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/rcomp/tmp/468yi1292091237.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/rcomp/tmp/568yi1292091237.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 159
Frequency = 1
1 2 3 4 5 6
0.62022320 3.11065771 -6.06441675 -2.91389697 -0.71574799 -7.72046497
7 8 9 10 11 12
-3.45576909 -4.33319253 -3.74063696 -5.31718077 1.83242515 10.97636598
13 14 15 16 17 18
5.23842267 1.01362071 -6.31377418 -11.39739554 1.80977056 1.02751824
19 20 21 22 23 24
-1.46997724 9.55504767 4.90696029 12.28570308 2.57109683 9.65564982
25 26 27 28 29 30
-3.87013372 -5.15787825 -2.64643468 0.69143561 0.51814798 -4.29960857
31 32 33 34 35 36
-0.46876002 1.40011103 3.53495239 0.89518963 -4.04368903 5.56262525
37 38 39 40 41 42
10.13176616 -9.13322105 9.23636792 1.08231875 2.54431101 0.41477049
43 44 45 46 47 48
1.05141887 -5.53164473 -2.04829849 -7.04255604 -1.66596567 7.24724045
49 50 51 52 53 54
7.05507899 -0.17396745 1.88658575 -2.95348196 -2.58032598 -1.78840727
55 56 57 58 59 60
-5.83737099 1.17869493 -1.19960793 -2.29673270 -2.96028842 4.19135741
61 62 63 64 65 66
-2.02910459 -0.96171791 -0.40259361 3.99448853 -0.25933067 1.11221923
67 68 69 70 71 72
-2.65768960 -0.69443049 2.10952251 0.52667269 -2.71926286 -0.53894731
73 74 75 76 77 78
-2.65336501 2.17436911 -2.44788451 -0.81250547 2.36792048 0.05628858
79 80 81 82 83 84
0.44602177 0.60357650 2.07242175 -5.87079792 0.42482386 -4.10764415
85 86 87 88 89 90
3.03548138 -1.87012622 0.20656743 2.88513016 0.30855587 -1.22918857
91 92 93 94 95 96
1.04098996 -4.56196211 0.51410317 -1.01377404 -2.92609918 -3.02190091
97 98 99 100 101 102
3.36644820 0.23041054 -2.03289652 -1.00048701 -1.03578745 -3.27270592
103 104 105 106 107 108
-3.01472483 -3.97023967 1.25679021 4.72999016 -1.32510547 -0.95272868
109 110 111 112 113 114
2.24980671 2.50463562 -3.15146138 -5.43436904 -0.91618195 -1.79080969
115 116 117 118 119 120
-2.10634784 -3.35550863 -3.62479841 2.05796149 1.61718019 2.71177304
121 122 123 124 125 126
3.02345640 1.20839594 3.78414790 -1.04967875 9.49505291 -1.42277414
127 128 129 130 131 132
-2.01308409 0.06575613 -2.60057537 3.42536379 1.20001924 -2.43742699
133 134 135 136 137 138
-1.81998823 -1.81727575 -1.68943242 0.09038718 2.53153594 3.18708226
139 140 141 142 143 144
-3.35335621 3.78760054 6.82219424 1.32538813 1.13381532 5.61526266
145 146 147 148 149 150
0.57796603 6.13909691 -2.30325310 -0.46304386 -1.18710111 -3.38131333
151 152 153 154 155 156
-2.56378522 3.67417179 -3.16177969 -0.13811516 -1.48575862 -2.05773506
157 158 159
3.41186612 1.52618837 1.99404918
> postscript(file="/var/www/rcomp/tmp/6ghy31292091237.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 0.62022320 NA
1 3.11065771 0.62022320
2 -6.06441675 3.11065771
3 -2.91389697 -6.06441675
4 -0.71574799 -2.91389697
5 -7.72046497 -0.71574799
6 -3.45576909 -7.72046497
7 -4.33319253 -3.45576909
8 -3.74063696 -4.33319253
9 -5.31718077 -3.74063696
10 1.83242515 -5.31718077
11 10.97636598 1.83242515
12 5.23842267 10.97636598
13 1.01362071 5.23842267
14 -6.31377418 1.01362071
15 -11.39739554 -6.31377418
16 1.80977056 -11.39739554
17 1.02751824 1.80977056
18 -1.46997724 1.02751824
19 9.55504767 -1.46997724
20 4.90696029 9.55504767
21 12.28570308 4.90696029
22 2.57109683 12.28570308
23 9.65564982 2.57109683
24 -3.87013372 9.65564982
25 -5.15787825 -3.87013372
26 -2.64643468 -5.15787825
27 0.69143561 -2.64643468
28 0.51814798 0.69143561
29 -4.29960857 0.51814798
30 -0.46876002 -4.29960857
31 1.40011103 -0.46876002
32 3.53495239 1.40011103
33 0.89518963 3.53495239
34 -4.04368903 0.89518963
35 5.56262525 -4.04368903
36 10.13176616 5.56262525
37 -9.13322105 10.13176616
38 9.23636792 -9.13322105
39 1.08231875 9.23636792
40 2.54431101 1.08231875
41 0.41477049 2.54431101
42 1.05141887 0.41477049
43 -5.53164473 1.05141887
44 -2.04829849 -5.53164473
45 -7.04255604 -2.04829849
46 -1.66596567 -7.04255604
47 7.24724045 -1.66596567
48 7.05507899 7.24724045
49 -0.17396745 7.05507899
50 1.88658575 -0.17396745
51 -2.95348196 1.88658575
52 -2.58032598 -2.95348196
53 -1.78840727 -2.58032598
54 -5.83737099 -1.78840727
55 1.17869493 -5.83737099
56 -1.19960793 1.17869493
57 -2.29673270 -1.19960793
58 -2.96028842 -2.29673270
59 4.19135741 -2.96028842
60 -2.02910459 4.19135741
61 -0.96171791 -2.02910459
62 -0.40259361 -0.96171791
63 3.99448853 -0.40259361
64 -0.25933067 3.99448853
65 1.11221923 -0.25933067
66 -2.65768960 1.11221923
67 -0.69443049 -2.65768960
68 2.10952251 -0.69443049
69 0.52667269 2.10952251
70 -2.71926286 0.52667269
71 -0.53894731 -2.71926286
72 -2.65336501 -0.53894731
73 2.17436911 -2.65336501
74 -2.44788451 2.17436911
75 -0.81250547 -2.44788451
76 2.36792048 -0.81250547
77 0.05628858 2.36792048
78 0.44602177 0.05628858
79 0.60357650 0.44602177
80 2.07242175 0.60357650
81 -5.87079792 2.07242175
82 0.42482386 -5.87079792
83 -4.10764415 0.42482386
84 3.03548138 -4.10764415
85 -1.87012622 3.03548138
86 0.20656743 -1.87012622
87 2.88513016 0.20656743
88 0.30855587 2.88513016
89 -1.22918857 0.30855587
90 1.04098996 -1.22918857
91 -4.56196211 1.04098996
92 0.51410317 -4.56196211
93 -1.01377404 0.51410317
94 -2.92609918 -1.01377404
95 -3.02190091 -2.92609918
96 3.36644820 -3.02190091
97 0.23041054 3.36644820
98 -2.03289652 0.23041054
99 -1.00048701 -2.03289652
100 -1.03578745 -1.00048701
101 -3.27270592 -1.03578745
102 -3.01472483 -3.27270592
103 -3.97023967 -3.01472483
104 1.25679021 -3.97023967
105 4.72999016 1.25679021
106 -1.32510547 4.72999016
107 -0.95272868 -1.32510547
108 2.24980671 -0.95272868
109 2.50463562 2.24980671
110 -3.15146138 2.50463562
111 -5.43436904 -3.15146138
112 -0.91618195 -5.43436904
113 -1.79080969 -0.91618195
114 -2.10634784 -1.79080969
115 -3.35550863 -2.10634784
116 -3.62479841 -3.35550863
117 2.05796149 -3.62479841
118 1.61718019 2.05796149
119 2.71177304 1.61718019
120 3.02345640 2.71177304
121 1.20839594 3.02345640
122 3.78414790 1.20839594
123 -1.04967875 3.78414790
124 9.49505291 -1.04967875
125 -1.42277414 9.49505291
126 -2.01308409 -1.42277414
127 0.06575613 -2.01308409
128 -2.60057537 0.06575613
129 3.42536379 -2.60057537
130 1.20001924 3.42536379
131 -2.43742699 1.20001924
132 -1.81998823 -2.43742699
133 -1.81727575 -1.81998823
134 -1.68943242 -1.81727575
135 0.09038718 -1.68943242
136 2.53153594 0.09038718
137 3.18708226 2.53153594
138 -3.35335621 3.18708226
139 3.78760054 -3.35335621
140 6.82219424 3.78760054
141 1.32538813 6.82219424
142 1.13381532 1.32538813
143 5.61526266 1.13381532
144 0.57796603 5.61526266
145 6.13909691 0.57796603
146 -2.30325310 6.13909691
147 -0.46304386 -2.30325310
148 -1.18710111 -0.46304386
149 -3.38131333 -1.18710111
150 -2.56378522 -3.38131333
151 3.67417179 -2.56378522
152 -3.16177969 3.67417179
153 -0.13811516 -3.16177969
154 -1.48575862 -0.13811516
155 -2.05773506 -1.48575862
156 3.41186612 -2.05773506
157 1.52618837 3.41186612
158 1.99404918 1.52618837
159 NA 1.99404918
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.11065771 0.62022320
[2,] -6.06441675 3.11065771
[3,] -2.91389697 -6.06441675
[4,] -0.71574799 -2.91389697
[5,] -7.72046497 -0.71574799
[6,] -3.45576909 -7.72046497
[7,] -4.33319253 -3.45576909
[8,] -3.74063696 -4.33319253
[9,] -5.31718077 -3.74063696
[10,] 1.83242515 -5.31718077
[11,] 10.97636598 1.83242515
[12,] 5.23842267 10.97636598
[13,] 1.01362071 5.23842267
[14,] -6.31377418 1.01362071
[15,] -11.39739554 -6.31377418
[16,] 1.80977056 -11.39739554
[17,] 1.02751824 1.80977056
[18,] -1.46997724 1.02751824
[19,] 9.55504767 -1.46997724
[20,] 4.90696029 9.55504767
[21,] 12.28570308 4.90696029
[22,] 2.57109683 12.28570308
[23,] 9.65564982 2.57109683
[24,] -3.87013372 9.65564982
[25,] -5.15787825 -3.87013372
[26,] -2.64643468 -5.15787825
[27,] 0.69143561 -2.64643468
[28,] 0.51814798 0.69143561
[29,] -4.29960857 0.51814798
[30,] -0.46876002 -4.29960857
[31,] 1.40011103 -0.46876002
[32,] 3.53495239 1.40011103
[33,] 0.89518963 3.53495239
[34,] -4.04368903 0.89518963
[35,] 5.56262525 -4.04368903
[36,] 10.13176616 5.56262525
[37,] -9.13322105 10.13176616
[38,] 9.23636792 -9.13322105
[39,] 1.08231875 9.23636792
[40,] 2.54431101 1.08231875
[41,] 0.41477049 2.54431101
[42,] 1.05141887 0.41477049
[43,] -5.53164473 1.05141887
[44,] -2.04829849 -5.53164473
[45,] -7.04255604 -2.04829849
[46,] -1.66596567 -7.04255604
[47,] 7.24724045 -1.66596567
[48,] 7.05507899 7.24724045
[49,] -0.17396745 7.05507899
[50,] 1.88658575 -0.17396745
[51,] -2.95348196 1.88658575
[52,] -2.58032598 -2.95348196
[53,] -1.78840727 -2.58032598
[54,] -5.83737099 -1.78840727
[55,] 1.17869493 -5.83737099
[56,] -1.19960793 1.17869493
[57,] -2.29673270 -1.19960793
[58,] -2.96028842 -2.29673270
[59,] 4.19135741 -2.96028842
[60,] -2.02910459 4.19135741
[61,] -0.96171791 -2.02910459
[62,] -0.40259361 -0.96171791
[63,] 3.99448853 -0.40259361
[64,] -0.25933067 3.99448853
[65,] 1.11221923 -0.25933067
[66,] -2.65768960 1.11221923
[67,] -0.69443049 -2.65768960
[68,] 2.10952251 -0.69443049
[69,] 0.52667269 2.10952251
[70,] -2.71926286 0.52667269
[71,] -0.53894731 -2.71926286
[72,] -2.65336501 -0.53894731
[73,] 2.17436911 -2.65336501
[74,] -2.44788451 2.17436911
[75,] -0.81250547 -2.44788451
[76,] 2.36792048 -0.81250547
[77,] 0.05628858 2.36792048
[78,] 0.44602177 0.05628858
[79,] 0.60357650 0.44602177
[80,] 2.07242175 0.60357650
[81,] -5.87079792 2.07242175
[82,] 0.42482386 -5.87079792
[83,] -4.10764415 0.42482386
[84,] 3.03548138 -4.10764415
[85,] -1.87012622 3.03548138
[86,] 0.20656743 -1.87012622
[87,] 2.88513016 0.20656743
[88,] 0.30855587 2.88513016
[89,] -1.22918857 0.30855587
[90,] 1.04098996 -1.22918857
[91,] -4.56196211 1.04098996
[92,] 0.51410317 -4.56196211
[93,] -1.01377404 0.51410317
[94,] -2.92609918 -1.01377404
[95,] -3.02190091 -2.92609918
[96,] 3.36644820 -3.02190091
[97,] 0.23041054 3.36644820
[98,] -2.03289652 0.23041054
[99,] -1.00048701 -2.03289652
[100,] -1.03578745 -1.00048701
[101,] -3.27270592 -1.03578745
[102,] -3.01472483 -3.27270592
[103,] -3.97023967 -3.01472483
[104,] 1.25679021 -3.97023967
[105,] 4.72999016 1.25679021
[106,] -1.32510547 4.72999016
[107,] -0.95272868 -1.32510547
[108,] 2.24980671 -0.95272868
[109,] 2.50463562 2.24980671
[110,] -3.15146138 2.50463562
[111,] -5.43436904 -3.15146138
[112,] -0.91618195 -5.43436904
[113,] -1.79080969 -0.91618195
[114,] -2.10634784 -1.79080969
[115,] -3.35550863 -2.10634784
[116,] -3.62479841 -3.35550863
[117,] 2.05796149 -3.62479841
[118,] 1.61718019 2.05796149
[119,] 2.71177304 1.61718019
[120,] 3.02345640 2.71177304
[121,] 1.20839594 3.02345640
[122,] 3.78414790 1.20839594
[123,] -1.04967875 3.78414790
[124,] 9.49505291 -1.04967875
[125,] -1.42277414 9.49505291
[126,] -2.01308409 -1.42277414
[127,] 0.06575613 -2.01308409
[128,] -2.60057537 0.06575613
[129,] 3.42536379 -2.60057537
[130,] 1.20001924 3.42536379
[131,] -2.43742699 1.20001924
[132,] -1.81998823 -2.43742699
[133,] -1.81727575 -1.81998823
[134,] -1.68943242 -1.81727575
[135,] 0.09038718 -1.68943242
[136,] 2.53153594 0.09038718
[137,] 3.18708226 2.53153594
[138,] -3.35335621 3.18708226
[139,] 3.78760054 -3.35335621
[140,] 6.82219424 3.78760054
[141,] 1.32538813 6.82219424
[142,] 1.13381532 1.32538813
[143,] 5.61526266 1.13381532
[144,] 0.57796603 5.61526266
[145,] 6.13909691 0.57796603
[146,] -2.30325310 6.13909691
[147,] -0.46304386 -2.30325310
[148,] -1.18710111 -0.46304386
[149,] -3.38131333 -1.18710111
[150,] -2.56378522 -3.38131333
[151,] 3.67417179 -2.56378522
[152,] -3.16177969 3.67417179
[153,] -0.13811516 -3.16177969
[154,] -1.48575862 -0.13811516
[155,] -2.05773506 -1.48575862
[156,] 3.41186612 -2.05773506
[157,] 1.52618837 3.41186612
[158,] 1.99404918 1.52618837
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.11065771 0.62022320
2 -6.06441675 3.11065771
3 -2.91389697 -6.06441675
4 -0.71574799 -2.91389697
5 -7.72046497 -0.71574799
6 -3.45576909 -7.72046497
7 -4.33319253 -3.45576909
8 -3.74063696 -4.33319253
9 -5.31718077 -3.74063696
10 1.83242515 -5.31718077
11 10.97636598 1.83242515
12 5.23842267 10.97636598
13 1.01362071 5.23842267
14 -6.31377418 1.01362071
15 -11.39739554 -6.31377418
16 1.80977056 -11.39739554
17 1.02751824 1.80977056
18 -1.46997724 1.02751824
19 9.55504767 -1.46997724
20 4.90696029 9.55504767
21 12.28570308 4.90696029
22 2.57109683 12.28570308
23 9.65564982 2.57109683
24 -3.87013372 9.65564982
25 -5.15787825 -3.87013372
26 -2.64643468 -5.15787825
27 0.69143561 -2.64643468
28 0.51814798 0.69143561
29 -4.29960857 0.51814798
30 -0.46876002 -4.29960857
31 1.40011103 -0.46876002
32 3.53495239 1.40011103
33 0.89518963 3.53495239
34 -4.04368903 0.89518963
35 5.56262525 -4.04368903
36 10.13176616 5.56262525
37 -9.13322105 10.13176616
38 9.23636792 -9.13322105
39 1.08231875 9.23636792
40 2.54431101 1.08231875
41 0.41477049 2.54431101
42 1.05141887 0.41477049
43 -5.53164473 1.05141887
44 -2.04829849 -5.53164473
45 -7.04255604 -2.04829849
46 -1.66596567 -7.04255604
47 7.24724045 -1.66596567
48 7.05507899 7.24724045
49 -0.17396745 7.05507899
50 1.88658575 -0.17396745
51 -2.95348196 1.88658575
52 -2.58032598 -2.95348196
53 -1.78840727 -2.58032598
54 -5.83737099 -1.78840727
55 1.17869493 -5.83737099
56 -1.19960793 1.17869493
57 -2.29673270 -1.19960793
58 -2.96028842 -2.29673270
59 4.19135741 -2.96028842
60 -2.02910459 4.19135741
61 -0.96171791 -2.02910459
62 -0.40259361 -0.96171791
63 3.99448853 -0.40259361
64 -0.25933067 3.99448853
65 1.11221923 -0.25933067
66 -2.65768960 1.11221923
67 -0.69443049 -2.65768960
68 2.10952251 -0.69443049
69 0.52667269 2.10952251
70 -2.71926286 0.52667269
71 -0.53894731 -2.71926286
72 -2.65336501 -0.53894731
73 2.17436911 -2.65336501
74 -2.44788451 2.17436911
75 -0.81250547 -2.44788451
76 2.36792048 -0.81250547
77 0.05628858 2.36792048
78 0.44602177 0.05628858
79 0.60357650 0.44602177
80 2.07242175 0.60357650
81 -5.87079792 2.07242175
82 0.42482386 -5.87079792
83 -4.10764415 0.42482386
84 3.03548138 -4.10764415
85 -1.87012622 3.03548138
86 0.20656743 -1.87012622
87 2.88513016 0.20656743
88 0.30855587 2.88513016
89 -1.22918857 0.30855587
90 1.04098996 -1.22918857
91 -4.56196211 1.04098996
92 0.51410317 -4.56196211
93 -1.01377404 0.51410317
94 -2.92609918 -1.01377404
95 -3.02190091 -2.92609918
96 3.36644820 -3.02190091
97 0.23041054 3.36644820
98 -2.03289652 0.23041054
99 -1.00048701 -2.03289652
100 -1.03578745 -1.00048701
101 -3.27270592 -1.03578745
102 -3.01472483 -3.27270592
103 -3.97023967 -3.01472483
104 1.25679021 -3.97023967
105 4.72999016 1.25679021
106 -1.32510547 4.72999016
107 -0.95272868 -1.32510547
108 2.24980671 -0.95272868
109 2.50463562 2.24980671
110 -3.15146138 2.50463562
111 -5.43436904 -3.15146138
112 -0.91618195 -5.43436904
113 -1.79080969 -0.91618195
114 -2.10634784 -1.79080969
115 -3.35550863 -2.10634784
116 -3.62479841 -3.35550863
117 2.05796149 -3.62479841
118 1.61718019 2.05796149
119 2.71177304 1.61718019
120 3.02345640 2.71177304
121 1.20839594 3.02345640
122 3.78414790 1.20839594
123 -1.04967875 3.78414790
124 9.49505291 -1.04967875
125 -1.42277414 9.49505291
126 -2.01308409 -1.42277414
127 0.06575613 -2.01308409
128 -2.60057537 0.06575613
129 3.42536379 -2.60057537
130 1.20001924 3.42536379
131 -2.43742699 1.20001924
132 -1.81998823 -2.43742699
133 -1.81727575 -1.81998823
134 -1.68943242 -1.81727575
135 0.09038718 -1.68943242
136 2.53153594 0.09038718
137 3.18708226 2.53153594
138 -3.35335621 3.18708226
139 3.78760054 -3.35335621
140 6.82219424 3.78760054
141 1.32538813 6.82219424
142 1.13381532 1.32538813
143 5.61526266 1.13381532
144 0.57796603 5.61526266
145 6.13909691 0.57796603
146 -2.30325310 6.13909691
147 -0.46304386 -2.30325310
148 -1.18710111 -0.46304386
149 -3.38131333 -1.18710111
150 -2.56378522 -3.38131333
151 3.67417179 -2.56378522
152 -3.16177969 3.67417179
153 -0.13811516 -3.16177969
154 -1.48575862 -0.13811516
155 -2.05773506 -1.48575862
156 3.41186612 -2.05773506
157 1.52618837 3.41186612
158 1.99404918 1.52618837
> 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/rcomp/tmp/7rqfo1292091237.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/rcomp/tmp/8rqfo1292091237.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/rcomp/tmp/9rqfo1292091237.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/rcomp/tmp/102her1292091237.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/11niuw1292091237.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/rcomp/tmp/12r0tl1292091237.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/rcomp/tmp/13narb1292091237.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/rcomp/tmp/14qtph1292091237.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/rcomp/tmp/15bbo51292091237.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/rcomp/tmp/16fu4b1292091237.tab")
+ }
>
> try(system("convert tmp/1vyzf1292091237.ps tmp/1vyzf1292091237.png",intern=TRUE))
character(0)
> try(system("convert tmp/268yi1292091237.ps tmp/268yi1292091237.png",intern=TRUE))
character(0)
> try(system("convert tmp/368yi1292091237.ps tmp/368yi1292091237.png",intern=TRUE))
character(0)
> try(system("convert tmp/468yi1292091237.ps tmp/468yi1292091237.png",intern=TRUE))
character(0)
> try(system("convert tmp/568yi1292091237.ps tmp/568yi1292091237.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ghy31292091237.ps tmp/6ghy31292091237.png",intern=TRUE))
character(0)
> try(system("convert tmp/7rqfo1292091237.ps tmp/7rqfo1292091237.png",intern=TRUE))
character(0)
> try(system("convert tmp/8rqfo1292091237.ps tmp/8rqfo1292091237.png",intern=TRUE))
character(0)
> try(system("convert tmp/9rqfo1292091237.ps tmp/9rqfo1292091237.png",intern=TRUE))
character(0)
> try(system("convert tmp/102her1292091237.ps tmp/102her1292091237.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.720 0.830 5.531