R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(9
+ ,13
+ ,13
+ ,14
+ ,13
+ ,3
+ ,9
+ ,12
+ ,12
+ ,8
+ ,13
+ ,5
+ ,9
+ ,8
+ ,10
+ ,12
+ ,16
+ ,6
+ ,9
+ ,12
+ ,9
+ ,7
+ ,12
+ ,6
+ ,9
+ ,10
+ ,10
+ ,10
+ ,11
+ ,5
+ ,9
+ ,12
+ ,12
+ ,7
+ ,12
+ ,3
+ ,9
+ ,15
+ ,13
+ ,16
+ ,18
+ ,8
+ ,9
+ ,9
+ ,12
+ ,11
+ ,11
+ ,4
+ ,9
+ ,12
+ ,15
+ ,14
+ ,14
+ ,4
+ ,9
+ ,11
+ ,6
+ ,6
+ ,9
+ ,4
+ ,9
+ ,11
+ ,5
+ ,16
+ ,14
+ ,6
+ ,9
+ ,11
+ ,12
+ ,11
+ ,12
+ ,6
+ ,9
+ ,15
+ ,11
+ ,16
+ ,11
+ ,5
+ ,9
+ ,7
+ ,14
+ ,12
+ ,12
+ ,4
+ ,9
+ ,11
+ ,14
+ ,7
+ ,13
+ ,6
+ ,9
+ ,11
+ ,12
+ ,13
+ ,11
+ ,4
+ ,9
+ ,10
+ ,12
+ ,11
+ ,12
+ ,6
+ ,9
+ ,14
+ ,11
+ ,15
+ ,16
+ ,6
+ ,9
+ ,10
+ ,11
+ ,7
+ ,9
+ ,4
+ ,9
+ ,6
+ ,7
+ ,9
+ ,11
+ ,4
+ ,9
+ ,11
+ ,9
+ ,7
+ ,13
+ ,2
+ ,9
+ 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 ,10
+ ,12
+ ,12
+ ,9
+ ,13
+ ,4
+ ,10
+ ,14
+ ,11
+ ,15
+ ,14
+ ,6
+ ,10
+ ,7
+ ,12
+ ,13
+ ,12
+ ,3
+ ,10
+ ,19
+ ,12
+ ,15
+ ,15
+ ,6
+ ,10
+ ,12
+ ,10
+ ,14
+ ,14
+ ,5
+ ,10
+ ,12
+ ,11
+ ,16
+ ,13
+ ,4
+ ,10
+ ,13
+ ,12
+ ,14
+ ,14
+ ,6
+ ,10
+ ,15
+ ,12
+ ,14
+ ,16
+ ,4
+ ,10
+ ,8
+ ,10
+ ,10
+ ,6
+ ,4
+ ,10
+ ,12
+ ,12
+ ,10
+ ,13
+ ,4
+ ,10
+ ,10
+ ,13
+ ,4
+ ,13
+ ,6
+ ,10
+ ,8
+ ,12
+ ,8
+ ,14
+ ,5
+ ,10
+ ,10
+ ,15
+ ,15
+ ,15
+ ,6
+ ,10
+ ,15
+ ,11
+ ,16
+ ,14
+ ,6
+ ,10
+ ,16
+ ,12
+ ,12
+ ,15
+ ,8
+ ,10
+ ,13
+ ,11
+ ,12
+ ,13
+ ,7
+ ,10
+ ,16
+ ,12
+ ,15
+ ,16
+ ,7
+ ,10
+ ,9
+ ,11
+ ,9
+ ,12
+ ,4
+ ,10
+ ,14
+ ,10
+ ,12
+ ,15
+ ,6
+ ,10
+ ,14
+ ,11
+ ,14
+ ,12
+ ,6
+ ,10
+ ,12
+ ,11
+ ,11
+ ,14
+ ,2)
+ ,dim=c(6
+ ,156)
+ ,dimnames=list(c('Month'
+ ,'Depressie'
+ ,'belasting'
+ ,'autonomie'
+ ,'conformistisch'
+ ,'agressief')
+ ,1:156))
> y <- array(NA,dim=c(6,156),dimnames=list(c('Month','Depressie','belasting','autonomie','conformistisch','agressief'),1:156))
> 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 = '1'
> 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
Month Depressie belasting autonomie conformistisch agressief
1 9 13 13 14 13 3
2 9 12 12 8 13 5
3 9 8 10 12 16 6
4 9 12 9 7 12 6
5 9 10 10 10 11 5
6 9 12 12 7 12 3
7 9 15 13 16 18 8
8 9 9 12 11 11 4
9 9 12 15 14 14 4
10 9 11 6 6 9 4
11 9 11 5 16 14 6
12 9 11 12 11 12 6
13 9 15 11 16 11 5
14 9 7 14 12 12 4
15 9 11 14 7 13 6
16 9 11 12 13 11 4
17 9 10 12 11 12 6
18 9 14 11 15 16 6
19 9 10 11 7 9 4
20 9 6 7 9 11 4
21 9 11 9 7 13 2
22 9 15 11 14 15 7
23 9 11 11 15 10 5
24 9 12 12 7 11 4
25 9 14 12 15 13 6
26 9 15 11 17 16 6
27 9 9 11 15 15 7
28 9 13 8 14 14 5
29 9 13 9 14 14 6
30 9 16 12 8 14 4
31 9 13 10 8 8 4
32 9 12 10 14 13 7
33 9 14 12 14 15 7
34 9 11 8 8 13 4
35 9 9 12 11 11 4
36 9 16 11 16 15 6
37 9 12 12 10 15 6
38 9 10 7 8 9 5
39 9 13 11 14 13 6
40 9 16 11 16 16 7
41 9 14 12 13 13 6
42 9 15 9 5 11 3
43 9 5 15 8 12 3
44 9 8 11 10 12 4
45 9 11 11 8 12 6
46 9 16 11 13 14 7
47 9 17 11 15 14 5
48 9 9 15 6 8 4
49 9 9 11 12 13 5
50 9 13 12 16 16 6
51 9 10 12 5 13 6
52 9 6 9 15 11 6
53 9 12 12 12 14 5
54 9 8 12 8 13 4
55 9 14 13 13 13 5
56 9 12 11 14 13 5
57 10 11 9 12 12 4
58 10 16 9 16 16 6
59 10 8 11 10 15 2
60 10 15 11 15 15 8
61 10 7 12 8 12 3
62 10 16 12 16 14 6
63 10 14 9 19 12 6
64 10 16 11 14 15 6
65 10 9 9 6 12 5
66 10 14 12 13 13 5
67 10 11 12 15 12 6
68 10 13 12 7 12 5
69 10 15 12 13 13 6
70 10 5 14 4 5 2
71 10 15 11 14 13 5
72 10 13 12 13 13 5
73 10 11 11 11 14 5
74 10 11 6 14 17 6
75 10 12 10 12 13 6
76 10 12 12 15 13 6
77 10 12 13 14 12 5
78 10 12 8 13 13 5
79 10 14 12 8 14 4
80 10 6 12 6 11 2
81 10 7 12 7 12 4
82 10 14 6 13 12 6
83 10 14 11 13 16 6
84 10 10 10 11 12 5
85 10 13 12 5 12 3
86 10 12 13 12 12 6
87 10 9 11 8 10 4
88 10 12 7 11 15 5
89 10 16 11 14 15 8
90 10 10 11 9 12 4
91 10 14 11 10 16 6
92 10 10 11 13 15 6
93 10 16 12 16 16 7
94 10 15 10 16 13 6
95 10 12 11 11 12 5
96 10 10 12 8 11 4
97 10 8 7 4 13 6
98 10 8 13 7 10 3
99 10 11 8 14 15 5
100 10 13 12 11 13 6
101 10 16 11 17 16 7
102 10 16 12 15 15 7
103 10 14 14 17 18 6
104 10 11 10 5 13 3
105 10 4 10 4 10 2
106 10 14 13 10 16 8
107 10 9 10 11 13 3
108 10 14 11 15 15 8
109 10 8 10 10 14 3
110 10 8 7 9 15 4
111 10 11 10 12 14 5
112 10 12 8 15 13 7
113 10 11 12 7 13 6
114 10 14 12 13 15 6
115 10 15 12 12 16 7
116 10 16 11 14 14 6
117 10 16 12 14 14 6
118 10 11 12 8 16 6
119 10 14 12 15 14 6
120 10 14 11 12 12 4
121 10 12 12 12 13 4
122 10 14 11 16 12 5
123 10 8 11 9 12 4
124 10 13 13 15 14 6
125 10 16 12 15 14 6
126 10 12 12 6 14 5
127 10 16 12 14 16 8
128 10 12 12 15 13 6
129 10 11 8 10 14 5
130 10 4 8 6 4 4
131 10 16 12 14 16 8
132 10 15 11 12 13 6
133 10 10 12 8 16 4
134 10 13 13 11 15 6
135 10 15 12 13 14 6
136 10 12 12 9 13 4
137 10 14 11 15 14 6
138 10 7 12 13 12 3
139 10 19 12 15 15 6
140 10 12 10 14 14 5
141 10 12 11 16 13 4
142 10 13 12 14 14 6
143 10 15 12 14 16 4
144 10 8 10 10 6 4
145 10 12 12 10 13 4
146 10 10 13 4 13 6
147 10 8 12 8 14 5
148 10 10 15 15 15 6
149 10 15 11 16 14 6
150 10 16 12 12 15 8
151 10 13 11 12 13 7
152 10 16 12 15 16 7
153 10 9 11 9 12 4
154 10 14 10 12 15 6
155 10 14 11 14 12 6
156 10 12 11 11 14 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Depressie belasting autonomie conformistisch
9.244257 0.007209 -0.002286 -0.006501 0.037068
agressief
-0.014929
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.7664 -0.5941 0.2897 0.3596 0.6956
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.244257 0.324826 28.459 <2e-16 ***
Depressie 0.007209 0.018309 0.394 0.694
belasting -0.002286 0.021800 -0.105 0.917
autonomie -0.006501 0.014826 -0.438 0.662
conformistisch 0.037068 0.022889 1.619 0.107
agressief -0.014929 0.037620 -0.397 0.692
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.4833 on 150 degrees of freedom
Multiple R-squared: 0.02393, Adjusted R-squared: -0.008606
F-statistic: 0.7355 on 5 and 150 DF, p-value: 0.5979
> 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,] 4.279084e-46 8.558168e-46 1.000000e+00
[2,] 4.184002e-61 8.368005e-61 1.000000e+00
[3,] 2.680902e-75 5.361804e-75 1.000000e+00
[4,] 1.988051e-87 3.976101e-87 1.000000e+00
[5,] 5.378042e-104 1.075608e-103 1.000000e+00
[6,] 1.527716e-114 3.055432e-114 1.000000e+00
[7,] 7.622542e-129 1.524508e-128 1.000000e+00
[8,] 0.000000e+00 0.000000e+00 1.000000e+00
[9,] 3.525460e-158 7.050919e-158 1.000000e+00
[10,] 2.672697e-174 5.345394e-174 1.000000e+00
[11,] 8.603157e-190 1.720631e-189 1.000000e+00
[12,] 2.028090e-213 4.056180e-213 1.000000e+00
[13,] 2.696199e-221 5.392397e-221 1.000000e+00
[14,] 2.598686e-233 5.197372e-233 1.000000e+00
[15,] 2.666158e-244 5.332317e-244 1.000000e+00
[16,] 5.228857e-268 1.045771e-267 1.000000e+00
[17,] 3.000051e-281 6.000102e-281 1.000000e+00
[18,] 1.951364e-299 3.902727e-299 1.000000e+00
[19,] 6.474857e-309 1.294971e-308 1.000000e+00
[20,] 9.980126e-322 1.996025e-321 1.000000e+00
[21,] 0.000000e+00 0.000000e+00 1.000000e+00
[22,] 0.000000e+00 0.000000e+00 1.000000e+00
[23,] 0.000000e+00 0.000000e+00 1.000000e+00
[24,] 0.000000e+00 0.000000e+00 1.000000e+00
[25,] 0.000000e+00 0.000000e+00 1.000000e+00
[26,] 0.000000e+00 0.000000e+00 1.000000e+00
[27,] 0.000000e+00 0.000000e+00 1.000000e+00
[28,] 0.000000e+00 0.000000e+00 1.000000e+00
[29,] 0.000000e+00 0.000000e+00 1.000000e+00
[30,] 0.000000e+00 0.000000e+00 1.000000e+00
[31,] 0.000000e+00 0.000000e+00 1.000000e+00
[32,] 0.000000e+00 0.000000e+00 1.000000e+00
[33,] 0.000000e+00 0.000000e+00 1.000000e+00
[34,] 0.000000e+00 0.000000e+00 1.000000e+00
[35,] 0.000000e+00 0.000000e+00 1.000000e+00
[36,] 0.000000e+00 0.000000e+00 1.000000e+00
[37,] 0.000000e+00 0.000000e+00 1.000000e+00
[38,] 0.000000e+00 0.000000e+00 1.000000e+00
[39,] 0.000000e+00 0.000000e+00 1.000000e+00
[40,] 0.000000e+00 0.000000e+00 1.000000e+00
[41,] 0.000000e+00 0.000000e+00 1.000000e+00
[42,] 0.000000e+00 0.000000e+00 1.000000e+00
[43,] 0.000000e+00 0.000000e+00 1.000000e+00
[44,] 0.000000e+00 0.000000e+00 1.000000e+00
[45,] 0.000000e+00 0.000000e+00 1.000000e+00
[46,] 0.000000e+00 0.000000e+00 1.000000e+00
[47,] 0.000000e+00 0.000000e+00 1.000000e+00
[48,] 1.637400e-19 3.274799e-19 1.000000e+00
[49,] 1.000000e+00 0.000000e+00 0.000000e+00
[50,] 1.000000e+00 0.000000e+00 0.000000e+00
[51,] 1.000000e+00 0.000000e+00 0.000000e+00
[52,] 1.000000e+00 0.000000e+00 0.000000e+00
[53,] 1.000000e+00 0.000000e+00 0.000000e+00
[54,] 1.000000e+00 0.000000e+00 0.000000e+00
[55,] 1.000000e+00 0.000000e+00 0.000000e+00
[56,] 1.000000e+00 0.000000e+00 0.000000e+00
[57,] 1.000000e+00 0.000000e+00 0.000000e+00
[58,] 1.000000e+00 0.000000e+00 0.000000e+00
[59,] 1.000000e+00 0.000000e+00 0.000000e+00
[60,] 1.000000e+00 0.000000e+00 0.000000e+00
[61,] 1.000000e+00 0.000000e+00 0.000000e+00
[62,] 1.000000e+00 0.000000e+00 0.000000e+00
[63,] 1.000000e+00 0.000000e+00 0.000000e+00
[64,] 1.000000e+00 0.000000e+00 0.000000e+00
[65,] 1.000000e+00 0.000000e+00 0.000000e+00
[66,] 1.000000e+00 0.000000e+00 0.000000e+00
[67,] 1.000000e+00 0.000000e+00 0.000000e+00
[68,] 1.000000e+00 0.000000e+00 0.000000e+00
[69,] 1.000000e+00 0.000000e+00 0.000000e+00
[70,] 1.000000e+00 0.000000e+00 0.000000e+00
[71,] 1.000000e+00 0.000000e+00 0.000000e+00
[72,] 1.000000e+00 0.000000e+00 0.000000e+00
[73,] 1.000000e+00 0.000000e+00 0.000000e+00
[74,] 1.000000e+00 0.000000e+00 0.000000e+00
[75,] 1.000000e+00 0.000000e+00 0.000000e+00
[76,] 1.000000e+00 0.000000e+00 0.000000e+00
[77,] 1.000000e+00 0.000000e+00 0.000000e+00
[78,] 1.000000e+00 0.000000e+00 0.000000e+00
[79,] 1.000000e+00 0.000000e+00 0.000000e+00
[80,] 1.000000e+00 0.000000e+00 0.000000e+00
[81,] 1.000000e+00 0.000000e+00 0.000000e+00
[82,] 1.000000e+00 0.000000e+00 0.000000e+00
[83,] 1.000000e+00 0.000000e+00 0.000000e+00
[84,] 1.000000e+00 0.000000e+00 0.000000e+00
[85,] 1.000000e+00 0.000000e+00 0.000000e+00
[86,] 1.000000e+00 0.000000e+00 0.000000e+00
[87,] 1.000000e+00 0.000000e+00 0.000000e+00
[88,] 1.000000e+00 0.000000e+00 0.000000e+00
[89,] 1.000000e+00 0.000000e+00 0.000000e+00
[90,] 1.000000e+00 0.000000e+00 0.000000e+00
[91,] 1.000000e+00 0.000000e+00 0.000000e+00
[92,] 1.000000e+00 0.000000e+00 0.000000e+00
[93,] 1.000000e+00 0.000000e+00 0.000000e+00
[94,] 1.000000e+00 0.000000e+00 0.000000e+00
[95,] 1.000000e+00 0.000000e+00 0.000000e+00
[96,] 1.000000e+00 0.000000e+00 0.000000e+00
[97,] 1.000000e+00 0.000000e+00 0.000000e+00
[98,] 1.000000e+00 0.000000e+00 0.000000e+00
[99,] 1.000000e+00 0.000000e+00 0.000000e+00
[100,] 1.000000e+00 0.000000e+00 0.000000e+00
[101,] 1.000000e+00 0.000000e+00 0.000000e+00
[102,] 1.000000e+00 0.000000e+00 0.000000e+00
[103,] 1.000000e+00 0.000000e+00 0.000000e+00
[104,] 1.000000e+00 0.000000e+00 0.000000e+00
[105,] 1.000000e+00 0.000000e+00 0.000000e+00
[106,] 1.000000e+00 0.000000e+00 0.000000e+00
[107,] 1.000000e+00 0.000000e+00 0.000000e+00
[108,] 1.000000e+00 0.000000e+00 0.000000e+00
[109,] 1.000000e+00 0.000000e+00 0.000000e+00
[110,] 1.000000e+00 0.000000e+00 0.000000e+00
[111,] 1.000000e+00 0.000000e+00 0.000000e+00
[112,] 1.000000e+00 0.000000e+00 0.000000e+00
[113,] 1.000000e+00 0.000000e+00 0.000000e+00
[114,] 1.000000e+00 0.000000e+00 0.000000e+00
[115,] 1.000000e+00 0.000000e+00 0.000000e+00
[116,] 1.000000e+00 0.000000e+00 0.000000e+00
[117,] 1.000000e+00 0.000000e+00 0.000000e+00
[118,] 1.000000e+00 0.000000e+00 0.000000e+00
[119,] 1.000000e+00 0.000000e+00 0.000000e+00
[120,] 1.000000e+00 0.000000e+00 0.000000e+00
[121,] 1.000000e+00 1.351418e-311 6.757092e-312
[122,] 1.000000e+00 7.584352e-294 3.792176e-294
[123,] 1.000000e+00 5.708839e-270 2.854419e-270
[124,] 1.000000e+00 1.980019e-277 9.900094e-278
[125,] 1.000000e+00 1.128685e-242 5.643423e-243
[126,] 1.000000e+00 3.413402e-231 1.706701e-231
[127,] 1.000000e+00 7.688068e-217 3.844034e-217
[128,] 1.000000e+00 4.165612e-212 2.082806e-212
[129,] 1.000000e+00 2.086401e-190 1.043201e-190
[130,] 1.000000e+00 2.626654e-182 1.313327e-182
[131,] 1.000000e+00 9.608930e-159 4.804465e-159
[132,] 1.000000e+00 0.000000e+00 0.000000e+00
[133,] 1.000000e+00 8.532804e-131 4.266402e-131
[134,] 1.000000e+00 1.084705e-116 5.423527e-117
[135,] 1.000000e+00 2.411253e-108 1.205626e-108
[136,] 1.000000e+00 3.458585e-86 1.729293e-86
[137,] 1.000000e+00 2.380111e-74 1.190056e-74
[138,] 1.000000e+00 1.950487e-66 9.752436e-67
[139,] 1.000000e+00 2.662861e-46 1.331430e-46
> postscript(file="/var/wessaorg/rcomp/tmp/1t8yf1321902723.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/2zey81321902723.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/3grpf1321902723.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/4smxd1321902723.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/5n87u1321902723.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 156
Frequency = 1
1 2 3 4 5 6 7
-0.6543316 -0.6585594 -0.7045686 -0.6199228 -0.5615756 -0.6578497 -0.7664447
8 9 10 11 12 13 14
-0.5582216 -0.6646898 -0.5447268 -0.6374850 -0.5798500 -0.5563253 -0.5697985
15 16 17 18 19 20 21
-0.6383506 -0.5596365 -0.5726413 -0.7260307 -0.5195850 -0.5610299 -0.7094971
22 23 24 25 26 27 28
-0.6877437 -0.4969234 -0.6058527 -0.6125394 -0.7202369 -0.6379902 -0.6729744
29 30 31 32 33 34 35
-0.6557594 -0.7393913 -0.4999279 -0.5942673 -0.6782486 -0.6754249 -0.5582216
36 37 38 39 40 41 42
-0.6968786 -0.7047649 -0.5073006 -0.6141183 -0.7190182 -0.6255419 -0.6622691
43 44 45 46 47 48 49
-0.5940284 -0.5968688 -0.6016401 -0.6643853 -0.6884489 -0.4726638 -0.6132147
50 51 52 53 54 55 56
-0.7100344 -0.6487171 -0.4875922 -0.6696228 -0.6446533 -0.6381842 -0.6218383
57 58 59 60 61 62 63
0.3899348 0.2614804 0.2620688 0.3336862 0.3846950 0.3424761 0.4436748
64 65 66 67 68 69 70
0.2901189 0.3802734 0.3595294 0.4461550 0.3647989 0.3672494 0.6222298
71 72 73 74 75 76 77
0.3565356 0.3667381 0.3287983 0.2405939 0.3778015 0.4018780 0.4198028
78 79 80 81 82 83 84
0.3648013 0.2750261 0.4010409 0.3931225 0.3978082 0.2609668 0.4078573
85 86 87 88 89 90 91
0.3219391 0.4217290 0.4570566 0.2753758 0.3199763 0.3822125 0.2414630
92 93 94 95 96 97 98
0.3268699 0.2832682 0.3821804 0.3957263 0.4150659 0.3477672 0.4474081
99 100 101 102 103 104 105
0.3043746 0.3686643 0.2874830 0.3138352 0.2196942 0.2947154 0.4349514
106 107 108 109 110 111 112
0.2758931 0.3481403 0.3408949 0.3117794 0.2762794 0.3330132 0.4076612
113 114 115 116 117 118 119
0.3570767 0.3003214 0.2644718 0.3271872 0.3294736 0.2523730 0.3503923
120 121 122 123 124 125 126
0.3728814 0.3525169 0.4138151 0.3966299 0.3598874 0.3359749 0.2913697
127 128 129 130 131 132 133
0.2851943 0.4018780 0.3154380 0.6956484 0.2851943 0.3584618 0.2297243
134 135 136 137 138 139 140
0.2968140 0.3301811 0.3330131 0.3481059 0.4172013 0.2772804 0.3388070
141 142 143 144 145 146 147
0.3762355 0.3510997 0.2326883 0.6232547 0.3395144 0.3470680 0.3332071
148 149 150 151 152 153 154
0.3490179 0.3473985 0.3092602 0.3878079 0.2767669 0.3894212 0.2892475
155 156
0.4157413 0.2768036
> postscript(file="/var/wessaorg/rcomp/tmp/615s01321902723.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 156
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.6543316 NA
1 -0.6585594 -0.6543316
2 -0.7045686 -0.6585594
3 -0.6199228 -0.7045686
4 -0.5615756 -0.6199228
5 -0.6578497 -0.5615756
6 -0.7664447 -0.6578497
7 -0.5582216 -0.7664447
8 -0.6646898 -0.5582216
9 -0.5447268 -0.6646898
10 -0.6374850 -0.5447268
11 -0.5798500 -0.6374850
12 -0.5563253 -0.5798500
13 -0.5697985 -0.5563253
14 -0.6383506 -0.5697985
15 -0.5596365 -0.6383506
16 -0.5726413 -0.5596365
17 -0.7260307 -0.5726413
18 -0.5195850 -0.7260307
19 -0.5610299 -0.5195850
20 -0.7094971 -0.5610299
21 -0.6877437 -0.7094971
22 -0.4969234 -0.6877437
23 -0.6058527 -0.4969234
24 -0.6125394 -0.6058527
25 -0.7202369 -0.6125394
26 -0.6379902 -0.7202369
27 -0.6729744 -0.6379902
28 -0.6557594 -0.6729744
29 -0.7393913 -0.6557594
30 -0.4999279 -0.7393913
31 -0.5942673 -0.4999279
32 -0.6782486 -0.5942673
33 -0.6754249 -0.6782486
34 -0.5582216 -0.6754249
35 -0.6968786 -0.5582216
36 -0.7047649 -0.6968786
37 -0.5073006 -0.7047649
38 -0.6141183 -0.5073006
39 -0.7190182 -0.6141183
40 -0.6255419 -0.7190182
41 -0.6622691 -0.6255419
42 -0.5940284 -0.6622691
43 -0.5968688 -0.5940284
44 -0.6016401 -0.5968688
45 -0.6643853 -0.6016401
46 -0.6884489 -0.6643853
47 -0.4726638 -0.6884489
48 -0.6132147 -0.4726638
49 -0.7100344 -0.6132147
50 -0.6487171 -0.7100344
51 -0.4875922 -0.6487171
52 -0.6696228 -0.4875922
53 -0.6446533 -0.6696228
54 -0.6381842 -0.6446533
55 -0.6218383 -0.6381842
56 0.3899348 -0.6218383
57 0.2614804 0.3899348
58 0.2620688 0.2614804
59 0.3336862 0.2620688
60 0.3846950 0.3336862
61 0.3424761 0.3846950
62 0.4436748 0.3424761
63 0.2901189 0.4436748
64 0.3802734 0.2901189
65 0.3595294 0.3802734
66 0.4461550 0.3595294
67 0.3647989 0.4461550
68 0.3672494 0.3647989
69 0.6222298 0.3672494
70 0.3565356 0.6222298
71 0.3667381 0.3565356
72 0.3287983 0.3667381
73 0.2405939 0.3287983
74 0.3778015 0.2405939
75 0.4018780 0.3778015
76 0.4198028 0.4018780
77 0.3648013 0.4198028
78 0.2750261 0.3648013
79 0.4010409 0.2750261
80 0.3931225 0.4010409
81 0.3978082 0.3931225
82 0.2609668 0.3978082
83 0.4078573 0.2609668
84 0.3219391 0.4078573
85 0.4217290 0.3219391
86 0.4570566 0.4217290
87 0.2753758 0.4570566
88 0.3199763 0.2753758
89 0.3822125 0.3199763
90 0.2414630 0.3822125
91 0.3268699 0.2414630
92 0.2832682 0.3268699
93 0.3821804 0.2832682
94 0.3957263 0.3821804
95 0.4150659 0.3957263
96 0.3477672 0.4150659
97 0.4474081 0.3477672
98 0.3043746 0.4474081
99 0.3686643 0.3043746
100 0.2874830 0.3686643
101 0.3138352 0.2874830
102 0.2196942 0.3138352
103 0.2947154 0.2196942
104 0.4349514 0.2947154
105 0.2758931 0.4349514
106 0.3481403 0.2758931
107 0.3408949 0.3481403
108 0.3117794 0.3408949
109 0.2762794 0.3117794
110 0.3330132 0.2762794
111 0.4076612 0.3330132
112 0.3570767 0.4076612
113 0.3003214 0.3570767
114 0.2644718 0.3003214
115 0.3271872 0.2644718
116 0.3294736 0.3271872
117 0.2523730 0.3294736
118 0.3503923 0.2523730
119 0.3728814 0.3503923
120 0.3525169 0.3728814
121 0.4138151 0.3525169
122 0.3966299 0.4138151
123 0.3598874 0.3966299
124 0.3359749 0.3598874
125 0.2913697 0.3359749
126 0.2851943 0.2913697
127 0.4018780 0.2851943
128 0.3154380 0.4018780
129 0.6956484 0.3154380
130 0.2851943 0.6956484
131 0.3584618 0.2851943
132 0.2297243 0.3584618
133 0.2968140 0.2297243
134 0.3301811 0.2968140
135 0.3330131 0.3301811
136 0.3481059 0.3330131
137 0.4172013 0.3481059
138 0.2772804 0.4172013
139 0.3388070 0.2772804
140 0.3762355 0.3388070
141 0.3510997 0.3762355
142 0.2326883 0.3510997
143 0.6232547 0.2326883
144 0.3395144 0.6232547
145 0.3470680 0.3395144
146 0.3332071 0.3470680
147 0.3490179 0.3332071
148 0.3473985 0.3490179
149 0.3092602 0.3473985
150 0.3878079 0.3092602
151 0.2767669 0.3878079
152 0.3894212 0.2767669
153 0.2892475 0.3894212
154 0.4157413 0.2892475
155 0.2768036 0.4157413
156 NA 0.2768036
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.6585594 -0.6543316
[2,] -0.7045686 -0.6585594
[3,] -0.6199228 -0.7045686
[4,] -0.5615756 -0.6199228
[5,] -0.6578497 -0.5615756
[6,] -0.7664447 -0.6578497
[7,] -0.5582216 -0.7664447
[8,] -0.6646898 -0.5582216
[9,] -0.5447268 -0.6646898
[10,] -0.6374850 -0.5447268
[11,] -0.5798500 -0.6374850
[12,] -0.5563253 -0.5798500
[13,] -0.5697985 -0.5563253
[14,] -0.6383506 -0.5697985
[15,] -0.5596365 -0.6383506
[16,] -0.5726413 -0.5596365
[17,] -0.7260307 -0.5726413
[18,] -0.5195850 -0.7260307
[19,] -0.5610299 -0.5195850
[20,] -0.7094971 -0.5610299
[21,] -0.6877437 -0.7094971
[22,] -0.4969234 -0.6877437
[23,] -0.6058527 -0.4969234
[24,] -0.6125394 -0.6058527
[25,] -0.7202369 -0.6125394
[26,] -0.6379902 -0.7202369
[27,] -0.6729744 -0.6379902
[28,] -0.6557594 -0.6729744
[29,] -0.7393913 -0.6557594
[30,] -0.4999279 -0.7393913
[31,] -0.5942673 -0.4999279
[32,] -0.6782486 -0.5942673
[33,] -0.6754249 -0.6782486
[34,] -0.5582216 -0.6754249
[35,] -0.6968786 -0.5582216
[36,] -0.7047649 -0.6968786
[37,] -0.5073006 -0.7047649
[38,] -0.6141183 -0.5073006
[39,] -0.7190182 -0.6141183
[40,] -0.6255419 -0.7190182
[41,] -0.6622691 -0.6255419
[42,] -0.5940284 -0.6622691
[43,] -0.5968688 -0.5940284
[44,] -0.6016401 -0.5968688
[45,] -0.6643853 -0.6016401
[46,] -0.6884489 -0.6643853
[47,] -0.4726638 -0.6884489
[48,] -0.6132147 -0.4726638
[49,] -0.7100344 -0.6132147
[50,] -0.6487171 -0.7100344
[51,] -0.4875922 -0.6487171
[52,] -0.6696228 -0.4875922
[53,] -0.6446533 -0.6696228
[54,] -0.6381842 -0.6446533
[55,] -0.6218383 -0.6381842
[56,] 0.3899348 -0.6218383
[57,] 0.2614804 0.3899348
[58,] 0.2620688 0.2614804
[59,] 0.3336862 0.2620688
[60,] 0.3846950 0.3336862
[61,] 0.3424761 0.3846950
[62,] 0.4436748 0.3424761
[63,] 0.2901189 0.4436748
[64,] 0.3802734 0.2901189
[65,] 0.3595294 0.3802734
[66,] 0.4461550 0.3595294
[67,] 0.3647989 0.4461550
[68,] 0.3672494 0.3647989
[69,] 0.6222298 0.3672494
[70,] 0.3565356 0.6222298
[71,] 0.3667381 0.3565356
[72,] 0.3287983 0.3667381
[73,] 0.2405939 0.3287983
[74,] 0.3778015 0.2405939
[75,] 0.4018780 0.3778015
[76,] 0.4198028 0.4018780
[77,] 0.3648013 0.4198028
[78,] 0.2750261 0.3648013
[79,] 0.4010409 0.2750261
[80,] 0.3931225 0.4010409
[81,] 0.3978082 0.3931225
[82,] 0.2609668 0.3978082
[83,] 0.4078573 0.2609668
[84,] 0.3219391 0.4078573
[85,] 0.4217290 0.3219391
[86,] 0.4570566 0.4217290
[87,] 0.2753758 0.4570566
[88,] 0.3199763 0.2753758
[89,] 0.3822125 0.3199763
[90,] 0.2414630 0.3822125
[91,] 0.3268699 0.2414630
[92,] 0.2832682 0.3268699
[93,] 0.3821804 0.2832682
[94,] 0.3957263 0.3821804
[95,] 0.4150659 0.3957263
[96,] 0.3477672 0.4150659
[97,] 0.4474081 0.3477672
[98,] 0.3043746 0.4474081
[99,] 0.3686643 0.3043746
[100,] 0.2874830 0.3686643
[101,] 0.3138352 0.2874830
[102,] 0.2196942 0.3138352
[103,] 0.2947154 0.2196942
[104,] 0.4349514 0.2947154
[105,] 0.2758931 0.4349514
[106,] 0.3481403 0.2758931
[107,] 0.3408949 0.3481403
[108,] 0.3117794 0.3408949
[109,] 0.2762794 0.3117794
[110,] 0.3330132 0.2762794
[111,] 0.4076612 0.3330132
[112,] 0.3570767 0.4076612
[113,] 0.3003214 0.3570767
[114,] 0.2644718 0.3003214
[115,] 0.3271872 0.2644718
[116,] 0.3294736 0.3271872
[117,] 0.2523730 0.3294736
[118,] 0.3503923 0.2523730
[119,] 0.3728814 0.3503923
[120,] 0.3525169 0.3728814
[121,] 0.4138151 0.3525169
[122,] 0.3966299 0.4138151
[123,] 0.3598874 0.3966299
[124,] 0.3359749 0.3598874
[125,] 0.2913697 0.3359749
[126,] 0.2851943 0.2913697
[127,] 0.4018780 0.2851943
[128,] 0.3154380 0.4018780
[129,] 0.6956484 0.3154380
[130,] 0.2851943 0.6956484
[131,] 0.3584618 0.2851943
[132,] 0.2297243 0.3584618
[133,] 0.2968140 0.2297243
[134,] 0.3301811 0.2968140
[135,] 0.3330131 0.3301811
[136,] 0.3481059 0.3330131
[137,] 0.4172013 0.3481059
[138,] 0.2772804 0.4172013
[139,] 0.3388070 0.2772804
[140,] 0.3762355 0.3388070
[141,] 0.3510997 0.3762355
[142,] 0.2326883 0.3510997
[143,] 0.6232547 0.2326883
[144,] 0.3395144 0.6232547
[145,] 0.3470680 0.3395144
[146,] 0.3332071 0.3470680
[147,] 0.3490179 0.3332071
[148,] 0.3473985 0.3490179
[149,] 0.3092602 0.3473985
[150,] 0.3878079 0.3092602
[151,] 0.2767669 0.3878079
[152,] 0.3894212 0.2767669
[153,] 0.2892475 0.3894212
[154,] 0.4157413 0.2892475
[155,] 0.2768036 0.4157413
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.6585594 -0.6543316
2 -0.7045686 -0.6585594
3 -0.6199228 -0.7045686
4 -0.5615756 -0.6199228
5 -0.6578497 -0.5615756
6 -0.7664447 -0.6578497
7 -0.5582216 -0.7664447
8 -0.6646898 -0.5582216
9 -0.5447268 -0.6646898
10 -0.6374850 -0.5447268
11 -0.5798500 -0.6374850
12 -0.5563253 -0.5798500
13 -0.5697985 -0.5563253
14 -0.6383506 -0.5697985
15 -0.5596365 -0.6383506
16 -0.5726413 -0.5596365
17 -0.7260307 -0.5726413
18 -0.5195850 -0.7260307
19 -0.5610299 -0.5195850
20 -0.7094971 -0.5610299
21 -0.6877437 -0.7094971
22 -0.4969234 -0.6877437
23 -0.6058527 -0.4969234
24 -0.6125394 -0.6058527
25 -0.7202369 -0.6125394
26 -0.6379902 -0.7202369
27 -0.6729744 -0.6379902
28 -0.6557594 -0.6729744
29 -0.7393913 -0.6557594
30 -0.4999279 -0.7393913
31 -0.5942673 -0.4999279
32 -0.6782486 -0.5942673
33 -0.6754249 -0.6782486
34 -0.5582216 -0.6754249
35 -0.6968786 -0.5582216
36 -0.7047649 -0.6968786
37 -0.5073006 -0.7047649
38 -0.6141183 -0.5073006
39 -0.7190182 -0.6141183
40 -0.6255419 -0.7190182
41 -0.6622691 -0.6255419
42 -0.5940284 -0.6622691
43 -0.5968688 -0.5940284
44 -0.6016401 -0.5968688
45 -0.6643853 -0.6016401
46 -0.6884489 -0.6643853
47 -0.4726638 -0.6884489
48 -0.6132147 -0.4726638
49 -0.7100344 -0.6132147
50 -0.6487171 -0.7100344
51 -0.4875922 -0.6487171
52 -0.6696228 -0.4875922
53 -0.6446533 -0.6696228
54 -0.6381842 -0.6446533
55 -0.6218383 -0.6381842
56 0.3899348 -0.6218383
57 0.2614804 0.3899348
58 0.2620688 0.2614804
59 0.3336862 0.2620688
60 0.3846950 0.3336862
61 0.3424761 0.3846950
62 0.4436748 0.3424761
63 0.2901189 0.4436748
64 0.3802734 0.2901189
65 0.3595294 0.3802734
66 0.4461550 0.3595294
67 0.3647989 0.4461550
68 0.3672494 0.3647989
69 0.6222298 0.3672494
70 0.3565356 0.6222298
71 0.3667381 0.3565356
72 0.3287983 0.3667381
73 0.2405939 0.3287983
74 0.3778015 0.2405939
75 0.4018780 0.3778015
76 0.4198028 0.4018780
77 0.3648013 0.4198028
78 0.2750261 0.3648013
79 0.4010409 0.2750261
80 0.3931225 0.4010409
81 0.3978082 0.3931225
82 0.2609668 0.3978082
83 0.4078573 0.2609668
84 0.3219391 0.4078573
85 0.4217290 0.3219391
86 0.4570566 0.4217290
87 0.2753758 0.4570566
88 0.3199763 0.2753758
89 0.3822125 0.3199763
90 0.2414630 0.3822125
91 0.3268699 0.2414630
92 0.2832682 0.3268699
93 0.3821804 0.2832682
94 0.3957263 0.3821804
95 0.4150659 0.3957263
96 0.3477672 0.4150659
97 0.4474081 0.3477672
98 0.3043746 0.4474081
99 0.3686643 0.3043746
100 0.2874830 0.3686643
101 0.3138352 0.2874830
102 0.2196942 0.3138352
103 0.2947154 0.2196942
104 0.4349514 0.2947154
105 0.2758931 0.4349514
106 0.3481403 0.2758931
107 0.3408949 0.3481403
108 0.3117794 0.3408949
109 0.2762794 0.3117794
110 0.3330132 0.2762794
111 0.4076612 0.3330132
112 0.3570767 0.4076612
113 0.3003214 0.3570767
114 0.2644718 0.3003214
115 0.3271872 0.2644718
116 0.3294736 0.3271872
117 0.2523730 0.3294736
118 0.3503923 0.2523730
119 0.3728814 0.3503923
120 0.3525169 0.3728814
121 0.4138151 0.3525169
122 0.3966299 0.4138151
123 0.3598874 0.3966299
124 0.3359749 0.3598874
125 0.2913697 0.3359749
126 0.2851943 0.2913697
127 0.4018780 0.2851943
128 0.3154380 0.4018780
129 0.6956484 0.3154380
130 0.2851943 0.6956484
131 0.3584618 0.2851943
132 0.2297243 0.3584618
133 0.2968140 0.2297243
134 0.3301811 0.2968140
135 0.3330131 0.3301811
136 0.3481059 0.3330131
137 0.4172013 0.3481059
138 0.2772804 0.4172013
139 0.3388070 0.2772804
140 0.3762355 0.3388070
141 0.3510997 0.3762355
142 0.2326883 0.3510997
143 0.6232547 0.2326883
144 0.3395144 0.6232547
145 0.3470680 0.3395144
146 0.3332071 0.3470680
147 0.3490179 0.3332071
148 0.3473985 0.3490179
149 0.3092602 0.3473985
150 0.3878079 0.3092602
151 0.2767669 0.3878079
152 0.3894212 0.2767669
153 0.2892475 0.3894212
154 0.4157413 0.2892475
155 0.2768036 0.4157413
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/75zsn1321902723.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/8zo4s1321902723.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/9w28w1321902723.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/wessaorg/rcomp/tmp/10h75y1321902723.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/11yver1321902723.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/12hb451321902723.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/13jbzl1321902723.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/14hrln1321902723.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/15rdaq1321902723.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/162fjz1321902723.tab")
+ }
>
> try(system("convert tmp/1t8yf1321902723.ps tmp/1t8yf1321902723.png",intern=TRUE))
character(0)
> try(system("convert tmp/2zey81321902723.ps tmp/2zey81321902723.png",intern=TRUE))
character(0)
> try(system("convert tmp/3grpf1321902723.ps tmp/3grpf1321902723.png",intern=TRUE))
character(0)
> try(system("convert tmp/4smxd1321902723.ps tmp/4smxd1321902723.png",intern=TRUE))
character(0)
> try(system("convert tmp/5n87u1321902723.ps tmp/5n87u1321902723.png",intern=TRUE))
character(0)
> try(system("convert tmp/615s01321902723.ps tmp/615s01321902723.png",intern=TRUE))
character(0)
> try(system("convert tmp/75zsn1321902723.ps tmp/75zsn1321902723.png",intern=TRUE))
character(0)
> try(system("convert tmp/8zo4s1321902723.ps tmp/8zo4s1321902723.png",intern=TRUE))
character(0)
> try(system("convert tmp/9w28w1321902723.ps tmp/9w28w1321902723.png",intern=TRUE))
character(0)
> try(system("convert tmp/10h75y1321902723.ps tmp/10h75y1321902723.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.018 0.716 6.021