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(1
+ ,7
+ ,7
+ ,7
+ ,7
+ ,7
+ ,1
+ ,5
+ ,5
+ ,5
+ ,5
+ ,5
+ ,1
+ ,6
+ ,5
+ ,6
+ ,4
+ ,5
+ ,1
+ ,5
+ ,5
+ ,6
+ ,5
+ ,6
+ ,1
+ ,6
+ ,7
+ ,5
+ ,6
+ ,7
+ ,1
+ ,6
+ ,5
+ ,6
+ ,5
+ ,7
+ ,1
+ ,6
+ ,3
+ ,7
+ ,7
+ ,7
+ ,1
+ ,6
+ ,6
+ ,6
+ ,5
+ ,6
+ ,1
+ ,4
+ ,5
+ ,6
+ ,4
+ ,5
+ ,1
+ ,6
+ ,3
+ ,6
+ ,6
+ ,6
+ ,1
+ ,6
+ ,7
+ ,7
+ ,7
+ ,7
+ ,1
+ ,3
+ ,7
+ ,7
+ ,4
+ ,7
+ ,1
+ ,5
+ ,6
+ ,7
+ ,6
+ ,6
+ ,1
+ ,5
+ ,7
+ ,7
+ ,5
+ ,7
+ ,1
+ ,2
+ ,4
+ ,5
+ ,2
+ ,6
+ ,1
+ ,3
+ ,7
+ ,7
+ ,5
+ ,7
+ ,1
+ ,6
+ ,7
+ ,6
+ ,6
+ ,5
+ ,1
+ ,6
+ ,7
+ ,6
+ ,6
+ ,5
+ ,1
+ ,5
+ ,3
+ ,6
+ ,5
+ ,7
+ ,1
+ ,7
+ ,5
+ ,6
+ ,5
+ ,6
+ ,1
+ ,5
+ ,5
+ ,5
+ ,6
+ ,6
+ ,1
+ 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
+ ,5
+ ,4
+ ,5)
+ ,dim=c(6
+ ,164)
+ ,dimnames=list(c('Gender'
+ ,'Q1'
+ ,'Q2'
+ ,'Q3'
+ ,'Q4'
+ ,'Q5')
+ ,1:164))
> y <- array(NA,dim=c(6,164),dimnames=list(c('Gender','Q1','Q2','Q3','Q4','Q5'),1:164))
> 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'
> #'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
Gender Q1 Q2 Q3 Q4 Q5
1 1 7 7 7 7 7
2 1 5 5 5 5 5
3 1 6 5 6 4 5
4 1 5 5 6 5 6
5 1 6 7 5 6 7
6 1 6 5 6 5 7
7 1 6 3 7 7 7
8 1 6 6 6 5 6
9 1 4 5 6 4 5
10 1 6 3 6 6 6
11 1 6 7 7 7 7
12 1 3 7 7 4 7
13 1 5 6 7 6 6
14 1 5 7 7 5 7
15 1 2 4 5 2 6
16 1 3 7 7 5 7
17 1 6 7 6 6 5
18 1 6 7 6 6 5
19 1 5 3 6 5 7
20 1 7 5 6 5 6
21 1 5 5 5 6 6
22 1 5 5 3 5 1
23 1 5 7 7 5 7
24 1 5 7 6 5 6
25 1 5 6 7 5 7
26 1 6 6 7 7 6
27 1 5 7 6 5 6
28 1 5 6 6 3 6
29 1 6 5 6 5 6
30 1 4 5 6 4 5
31 1 4 3 5 6 5
32 1 6 7 7 5 7
33 1 3 6 4 4 3
34 1 6 5 5 5 6
35 1 5 5 6 5 5
36 1 6 7 7 6 6
37 1 7 6 7 5 7
38 1 4 6 6 5 6
39 1 5 7 6 5 5
40 1 4 5 4 4 5
41 1 5 6 7 5 6
42 1 3 5 7 5 7
43 1 5 5 7 5 7
44 1 6 6 5 6 5
45 1 6 7 7 6 7
46 1 4 6 5 4 5
47 1 4 5 5 4 5
48 1 6 6 6 5 5
49 1 6 6 6 6 6
50 1 5 7 6 6 6
51 1 6 7 7 6 7
52 1 4 5 5 4 7
53 1 4 3 7 6 7
54 1 5 6 6 5 7
55 1 3 6 5 4 2
56 1 6 6 7 6 6
57 1 6 6 7 6 6
58 1 4 6 6 4 6
59 1 5 7 7 5 7
60 1 5 6 5 5 5
61 1 4 6 6 6 7
62 1 6 5 6 6 6
63 1 5 6 6 6 6
64 1 4 6 5 5 5
65 1 6 6 7 5 6
66 1 5 4 7 7 7
67 1 6 6 6 6 6
68 1 5 7 7 7 7
69 1 6 7 7 6 7
70 1 5 5 4 5 5
71 1 4 5 5 4 6
72 1 6 7 7 6 7
73 1 5 7 7 3 7
74 1 5 5 6 5 7
75 1 3 5 7 5 7
76 1 5 3 0 5 7
77 1 4 6 6 5 6
78 1 5 5 6 5 5
79 1 5 4 3 3 5
80 1 7 7 7 7 7
81 1 7 7 7 6 6
82 1 5 2 6 4 6
83 1 4 6 6 4 6
84 1 6 4 6 6 6
85 1 5 7 7 5 7
86 1 5 6 7 6 6
87 1 4 2 6 5 7
88 1 5 7 7 5 5
89 1 2 7 7 2 5
90 1 7 5 7 6 7
91 1 4 6 6 5 5
92 1 5 5 7 5 7
93 1 5 6 7 6 7
94 1 7 7 5 7 5
95 1 2 6 6 6 6
96 1 4 7 7 4 7
97 1 6 6 7 6 6
98 1 5 5 6 6 5
99 1 5 5 6 5 5
100 1 4 4 5 5 7
101 1 4 4 6 5 7
102 2 4 5 6 5 6
103 2 7 7 7 7 6
104 2 5 7 7 4 7
105 2 5 6 7 6 7
106 2 5 5 6 6 6
107 2 7 7 7 6 7
108 2 3 7 7 6 7
109 2 3 5 5 4 4
110 2 6 7 6 6 7
111 2 5 7 6 5 6
112 2 6 7 6 6 6
113 2 4 4 3 4 5
114 2 4 5 5 6 7
115 2 6 6 6 5 5
116 2 5 5 7 5 5
117 2 7 7 7 7 7
118 2 6 7 6 7 5
119 2 7 6 5 6 6
120 2 5 4 6 4 5
121 2 5 7 7 6 7
122 2 2 6 7 4 7
123 2 6 6 7 6 6
124 2 1 7 7 6 6
125 2 5 7 7 6 7
126 2 6 7 6 5 4
127 2 6 7 6 5 6
128 2 6 6 6 6 6
129 2 5 5 7 6 7
130 2 6 6 7 6 7
131 2 5 6 6 6 6
132 2 6 7 7 5 6
133 2 7 7 7 6 7
134 2 4 6 2 3 3
135 2 5 7 6 7 4
136 2 3 6 5 5 6
137 2 7 7 6 6 6
138 2 7 5 6 7 5
139 2 6 6 6 6 5
140 2 6 6 5 4 6
141 2 6 7 6 7 6
142 2 5 5 6 5 4
143 2 5 6 5 5 5
144 2 4 5 5 5 5
145 2 4 3 7 4 7
146 2 6 7 5 5 5
147 2 5 6 6 6 7
148 2 4 5 5 4 6
149 2 6 6 6 6 6
150 2 4 6 7 6 6
151 2 4 2 6 2 5
152 2 4 6 7 5 6
153 2 6 7 6 5 7
154 2 3 7 7 4 7
155 2 6 6 7 6 6
156 2 5 5 6 6 6
157 2 4 5 7 6 7
158 2 7 6 6 7 5
159 2 6 6 5 5 6
160 2 5 6 4 5 5
161 2 6 7 7 7 7
162 2 6 6 6 6 6
163 2 5 6 5 5 6
164 2 5 5 5 4 5
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Q1 Q2 Q3 Q4 Q5
1.140597 -0.008315 0.057451 -0.028932 0.057821 -0.029518
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.5970 -0.3990 -0.2899 0.5606 0.9833
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.140597 0.310324 3.675 0.000325 ***
Q1 -0.008315 0.038158 -0.218 0.827788
Q2 0.057451 0.035315 1.627 0.105769
Q3 -0.028932 0.045134 -0.641 0.522434
Q4 0.057821 0.045974 1.258 0.210356
Q5 -0.029518 0.044053 -0.670 0.503799
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.4864 on 158 degrees of freedom
Multiple R-squared: 0.03643, Adjusted R-squared: 0.005935
F-statistic: 1.195 on 5 and 158 DF, p-value: 0.3142
> 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.131239e-49 8.262479e-49 1.000000e+00
[2,] 3.756791e-65 7.513582e-65 1.000000e+00
[3,] 9.677197e-84 1.935439e-83 1.000000e+00
[4,] 6.606457e-94 1.321291e-93 1.000000e+00
[5,] 7.616599e-124 1.523320e-123 1.000000e+00
[6,] 6.274820e-124 1.254964e-123 1.000000e+00
[7,] 5.331332e-139 1.066266e-138 1.000000e+00
[8,] 0.000000e+00 0.000000e+00 1.000000e+00
[9,] 1.253443e-182 2.506885e-182 1.000000e+00
[10,] 5.618919e-187 1.123784e-186 1.000000e+00
[11,] 3.162187e-201 6.324375e-201 1.000000e+00
[12,] 6.059840e-227 1.211968e-226 1.000000e+00
[13,] 2.725696e-262 5.451391e-262 1.000000e+00
[14,] 8.679094e-251 1.735819e-250 1.000000e+00
[15,] 3.978173e-262 7.956347e-262 1.000000e+00
[16,] 6.433173e-281 1.286635e-280 1.000000e+00
[17,] 3.924336e-300 7.848671e-300 1.000000e+00
[18,] 0.000000e+00 0.000000e+00 1.000000e+00
[19,] 0.000000e+00 0.000000e+00 1.000000e+00
[20,] 0.000000e+00 0.000000e+00 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,] 0.000000e+00 0.000000e+00 1.000000e+00
[49,] 0.000000e+00 0.000000e+00 1.000000e+00
[50,] 0.000000e+00 0.000000e+00 1.000000e+00
[51,] 0.000000e+00 0.000000e+00 1.000000e+00
[52,] 0.000000e+00 0.000000e+00 1.000000e+00
[53,] 0.000000e+00 0.000000e+00 1.000000e+00
[54,] 0.000000e+00 0.000000e+00 1.000000e+00
[55,] 0.000000e+00 0.000000e+00 1.000000e+00
[56,] 0.000000e+00 0.000000e+00 1.000000e+00
[57,] 0.000000e+00 0.000000e+00 1.000000e+00
[58,] 0.000000e+00 0.000000e+00 1.000000e+00
[59,] 0.000000e+00 0.000000e+00 1.000000e+00
[60,] 0.000000e+00 0.000000e+00 1.000000e+00
[61,] 0.000000e+00 0.000000e+00 1.000000e+00
[62,] 0.000000e+00 0.000000e+00 1.000000e+00
[63,] 0.000000e+00 0.000000e+00 1.000000e+00
[64,] 0.000000e+00 0.000000e+00 1.000000e+00
[65,] 0.000000e+00 0.000000e+00 1.000000e+00
[66,] 0.000000e+00 0.000000e+00 1.000000e+00
[67,] 0.000000e+00 0.000000e+00 1.000000e+00
[68,] 0.000000e+00 0.000000e+00 1.000000e+00
[69,] 0.000000e+00 0.000000e+00 1.000000e+00
[70,] 0.000000e+00 0.000000e+00 1.000000e+00
[71,] 0.000000e+00 0.000000e+00 1.000000e+00
[72,] 0.000000e+00 0.000000e+00 1.000000e+00
[73,] 0.000000e+00 0.000000e+00 1.000000e+00
[74,] 0.000000e+00 0.000000e+00 1.000000e+00
[75,] 0.000000e+00 0.000000e+00 1.000000e+00
[76,] 0.000000e+00 0.000000e+00 1.000000e+00
[77,] 0.000000e+00 0.000000e+00 1.000000e+00
[78,] 0.000000e+00 0.000000e+00 1.000000e+00
[79,] 0.000000e+00 0.000000e+00 1.000000e+00
[80,] 0.000000e+00 0.000000e+00 1.000000e+00
[81,] 0.000000e+00 0.000000e+00 1.000000e+00
[82,] 0.000000e+00 0.000000e+00 1.000000e+00
[83,] 0.000000e+00 0.000000e+00 1.000000e+00
[84,] 0.000000e+00 0.000000e+00 1.000000e+00
[85,] 0.000000e+00 0.000000e+00 1.000000e+00
[86,] 0.000000e+00 0.000000e+00 1.000000e+00
[87,] 0.000000e+00 0.000000e+00 1.000000e+00
[88,] 0.000000e+00 0.000000e+00 1.000000e+00
[89,] 0.000000e+00 0.000000e+00 1.000000e+00
[90,] 0.000000e+00 0.000000e+00 1.000000e+00
[91,] 0.000000e+00 0.000000e+00 1.000000e+00
[92,] 0.000000e+00 0.000000e+00 1.000000e+00
[93,] 3.831783e-04 7.663565e-04 9.996168e-01
[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 0.000000e+00 0.000000e+00
[122,] 1.000000e+00 0.000000e+00 0.000000e+00
[123,] 1.000000e+00 0.000000e+00 0.000000e+00
[124,] 1.000000e+00 0.000000e+00 0.000000e+00
[125,] 1.000000e+00 0.000000e+00 0.000000e+00
[126,] 1.000000e+00 0.000000e+00 0.000000e+00
[127,] 1.000000e+00 0.000000e+00 0.000000e+00
[128,] 1.000000e+00 0.000000e+00 0.000000e+00
[129,] 1.000000e+00 9.881313e-323 4.940656e-323
[130,] 1.000000e+00 0.000000e+00 0.000000e+00
[131,] 1.000000e+00 2.084739e-293 1.042370e-293
[132,] 1.000000e+00 5.152239e-274 2.576119e-274
[133,] 1.000000e+00 9.871586e-257 4.935793e-257
[134,] 1.000000e+00 1.299986e-244 6.499929e-245
[135,] 1.000000e+00 4.505448e-257 2.252724e-257
[136,] 1.000000e+00 9.912302e-223 4.956151e-223
[137,] 1.000000e+00 6.003265e-197 3.001632e-197
[138,] 1.000000e+00 1.119140e-182 5.595698e-183
[139,] 1.000000e+00 1.213088e-178 6.065438e-179
[140,] 1.000000e+00 0.000000e+00 0.000000e+00
[141,] 1.000000e+00 6.697801e-136 3.348901e-136
[142,] 1.000000e+00 1.649192e-123 8.245961e-124
[143,] 1.000000e+00 4.454764e-121 2.227382e-121
[144,] 1.000000e+00 6.956942e-92 3.478471e-92
[145,] 1.000000e+00 1.615765e-83 8.078825e-84
[146,] 1.000000e+00 1.168017e-62 5.840084e-63
[147,] 1.000000e+00 5.761069e-47 2.880535e-47
> postscript(file="/var/wessaorg/rcomp/tmp/19zd71322066424.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/2me8s1322066424.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/30po71322066424.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/4rm3m1322066424.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/5xvzy1322066424.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 = 164
Frequency = 1
1 2 3 4 5 6
-0.48015370 -0.38313757 -0.28806913 -0.32468737 -0.48851153 -0.28685487
7 8 9 10 11 12
-0.25866263 -0.37382416 -0.30469841 -0.25929136 -0.48846833 -0.33994783
13 14 15 16 17 18
-0.41102794 -0.38114003 -0.14764778 -0.39776931 -0.51861492 -0.51861492
19 20 21 22 23 24
-0.18026666 -0.30805810 -0.41144118 -0.55907369 -0.38114003 -0.43959023
25 26 27 28 29 30
-0.32368860 -0.46053477 -0.43959023 -0.26649586 -0.31637274 -0.30469841
31 32 33 34 35 36
-0.33437083 -0.37282539 -0.48736486 -0.34530507 -0.35420524 -0.46016473
37 38 39 40 41 42
-0.30705933 -0.39045344 -0.46910809 -0.36256307 -0.35320647 -0.28286645
43 44 45 46 47 48
-0.26623718 -0.49009583 -0.43064686 -0.39108216 -0.33363074 -0.40334203
49 50 51 52 53 54
-0.43164563 -0.49741170 -0.43064686 -0.27459501 -0.21747044 -0.35262094
55 56 57 58 59 60
-0.48795039 -0.40271330 -0.40271330 -0.33263197 -0.38114003 -0.44058900
61 62 63 64 65 66
-0.41875704 -0.37419421 -0.43996027 -0.44890363 -0.34489183 -0.32442869
67 68 69 70 71 72
-0.43164563 -0.49678297 -0.43064686 -0.41206990 -0.30411287 -0.43064686
73 74 75 76 77 78
-0.26549709 -0.29516951 -0.28286645 -0.35386065 -0.39045344 -0.35420524
79 80 81 82 83 84
-0.26790787 -0.48015370 -0.45185009 -0.09451163 -0.33263197 -0.31674278
85 86 87 88 89 90
-0.38114003 -0.41102794 -0.13112987 -0.44017576 -0.29165526 -0.30742937
91 92 93 94 95 96
-0.41997130 -0.26623718 -0.38151008 -0.59705409 -0.46490418 -0.33163320
97 98 99 100 101 102
-0.40271330 -0.41202671 -0.35420524 -0.27496505 -0.24603272 0.66699799
103 104 105 106 107 108
0.49032844 0.67668144 0.61848992 0.61749115 0.57766777 0.54440922
109 110 111 112 113 114
0.62853676 0.54042080 0.56040977 0.51090294 0.66595602 0.60976205
115 116 117 118 119 120
0.59665797 0.67472709 0.51984630 0.42356361 0.54773667 0.76106766
121 122 123 124 125 126
0.56103850 0.70918895 0.59728670 0.49826209 0.56103850 0.50968868
127 128 129 130 131 132
0.56872441 0.56835437 0.67594135 0.62680456 0.56003973 0.59765674
133 134 135 136 137 138
0.57766777 0.52090658 0.38573110 0.57229959 0.51921758 0.54678109
139 140 141 142 143 144
0.53883650 0.65506498 0.45308147 0.61627690 0.55941100 0.60854779
145 146 147 148 149 150
0.89817251 0.51027421 0.58955759 0.69588713 0.56835437 0.58065742
151 152 153 154 155 156
0.98329881 0.63847889 0.59824227 0.66005217 0.59728670 0.61749115
157 158 159 160 161 162
0.66762671 0.48932967 0.59724350 0.53047867 0.51153167 0.56835437
163 164
0.58892887 0.67468390
> postscript(file="/var/wessaorg/rcomp/tmp/6h4og1322066424.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 = 164
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.48015370 NA
1 -0.38313757 -0.48015370
2 -0.28806913 -0.38313757
3 -0.32468737 -0.28806913
4 -0.48851153 -0.32468737
5 -0.28685487 -0.48851153
6 -0.25866263 -0.28685487
7 -0.37382416 -0.25866263
8 -0.30469841 -0.37382416
9 -0.25929136 -0.30469841
10 -0.48846833 -0.25929136
11 -0.33994783 -0.48846833
12 -0.41102794 -0.33994783
13 -0.38114003 -0.41102794
14 -0.14764778 -0.38114003
15 -0.39776931 -0.14764778
16 -0.51861492 -0.39776931
17 -0.51861492 -0.51861492
18 -0.18026666 -0.51861492
19 -0.30805810 -0.18026666
20 -0.41144118 -0.30805810
21 -0.55907369 -0.41144118
22 -0.38114003 -0.55907369
23 -0.43959023 -0.38114003
24 -0.32368860 -0.43959023
25 -0.46053477 -0.32368860
26 -0.43959023 -0.46053477
27 -0.26649586 -0.43959023
28 -0.31637274 -0.26649586
29 -0.30469841 -0.31637274
30 -0.33437083 -0.30469841
31 -0.37282539 -0.33437083
32 -0.48736486 -0.37282539
33 -0.34530507 -0.48736486
34 -0.35420524 -0.34530507
35 -0.46016473 -0.35420524
36 -0.30705933 -0.46016473
37 -0.39045344 -0.30705933
38 -0.46910809 -0.39045344
39 -0.36256307 -0.46910809
40 -0.35320647 -0.36256307
41 -0.28286645 -0.35320647
42 -0.26623718 -0.28286645
43 -0.49009583 -0.26623718
44 -0.43064686 -0.49009583
45 -0.39108216 -0.43064686
46 -0.33363074 -0.39108216
47 -0.40334203 -0.33363074
48 -0.43164563 -0.40334203
49 -0.49741170 -0.43164563
50 -0.43064686 -0.49741170
51 -0.27459501 -0.43064686
52 -0.21747044 -0.27459501
53 -0.35262094 -0.21747044
54 -0.48795039 -0.35262094
55 -0.40271330 -0.48795039
56 -0.40271330 -0.40271330
57 -0.33263197 -0.40271330
58 -0.38114003 -0.33263197
59 -0.44058900 -0.38114003
60 -0.41875704 -0.44058900
61 -0.37419421 -0.41875704
62 -0.43996027 -0.37419421
63 -0.44890363 -0.43996027
64 -0.34489183 -0.44890363
65 -0.32442869 -0.34489183
66 -0.43164563 -0.32442869
67 -0.49678297 -0.43164563
68 -0.43064686 -0.49678297
69 -0.41206990 -0.43064686
70 -0.30411287 -0.41206990
71 -0.43064686 -0.30411287
72 -0.26549709 -0.43064686
73 -0.29516951 -0.26549709
74 -0.28286645 -0.29516951
75 -0.35386065 -0.28286645
76 -0.39045344 -0.35386065
77 -0.35420524 -0.39045344
78 -0.26790787 -0.35420524
79 -0.48015370 -0.26790787
80 -0.45185009 -0.48015370
81 -0.09451163 -0.45185009
82 -0.33263197 -0.09451163
83 -0.31674278 -0.33263197
84 -0.38114003 -0.31674278
85 -0.41102794 -0.38114003
86 -0.13112987 -0.41102794
87 -0.44017576 -0.13112987
88 -0.29165526 -0.44017576
89 -0.30742937 -0.29165526
90 -0.41997130 -0.30742937
91 -0.26623718 -0.41997130
92 -0.38151008 -0.26623718
93 -0.59705409 -0.38151008
94 -0.46490418 -0.59705409
95 -0.33163320 -0.46490418
96 -0.40271330 -0.33163320
97 -0.41202671 -0.40271330
98 -0.35420524 -0.41202671
99 -0.27496505 -0.35420524
100 -0.24603272 -0.27496505
101 0.66699799 -0.24603272
102 0.49032844 0.66699799
103 0.67668144 0.49032844
104 0.61848992 0.67668144
105 0.61749115 0.61848992
106 0.57766777 0.61749115
107 0.54440922 0.57766777
108 0.62853676 0.54440922
109 0.54042080 0.62853676
110 0.56040977 0.54042080
111 0.51090294 0.56040977
112 0.66595602 0.51090294
113 0.60976205 0.66595602
114 0.59665797 0.60976205
115 0.67472709 0.59665797
116 0.51984630 0.67472709
117 0.42356361 0.51984630
118 0.54773667 0.42356361
119 0.76106766 0.54773667
120 0.56103850 0.76106766
121 0.70918895 0.56103850
122 0.59728670 0.70918895
123 0.49826209 0.59728670
124 0.56103850 0.49826209
125 0.50968868 0.56103850
126 0.56872441 0.50968868
127 0.56835437 0.56872441
128 0.67594135 0.56835437
129 0.62680456 0.67594135
130 0.56003973 0.62680456
131 0.59765674 0.56003973
132 0.57766777 0.59765674
133 0.52090658 0.57766777
134 0.38573110 0.52090658
135 0.57229959 0.38573110
136 0.51921758 0.57229959
137 0.54678109 0.51921758
138 0.53883650 0.54678109
139 0.65506498 0.53883650
140 0.45308147 0.65506498
141 0.61627690 0.45308147
142 0.55941100 0.61627690
143 0.60854779 0.55941100
144 0.89817251 0.60854779
145 0.51027421 0.89817251
146 0.58955759 0.51027421
147 0.69588713 0.58955759
148 0.56835437 0.69588713
149 0.58065742 0.56835437
150 0.98329881 0.58065742
151 0.63847889 0.98329881
152 0.59824227 0.63847889
153 0.66005217 0.59824227
154 0.59728670 0.66005217
155 0.61749115 0.59728670
156 0.66762671 0.61749115
157 0.48932967 0.66762671
158 0.59724350 0.48932967
159 0.53047867 0.59724350
160 0.51153167 0.53047867
161 0.56835437 0.51153167
162 0.58892887 0.56835437
163 0.67468390 0.58892887
164 NA 0.67468390
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.38313757 -0.48015370
[2,] -0.28806913 -0.38313757
[3,] -0.32468737 -0.28806913
[4,] -0.48851153 -0.32468737
[5,] -0.28685487 -0.48851153
[6,] -0.25866263 -0.28685487
[7,] -0.37382416 -0.25866263
[8,] -0.30469841 -0.37382416
[9,] -0.25929136 -0.30469841
[10,] -0.48846833 -0.25929136
[11,] -0.33994783 -0.48846833
[12,] -0.41102794 -0.33994783
[13,] -0.38114003 -0.41102794
[14,] -0.14764778 -0.38114003
[15,] -0.39776931 -0.14764778
[16,] -0.51861492 -0.39776931
[17,] -0.51861492 -0.51861492
[18,] -0.18026666 -0.51861492
[19,] -0.30805810 -0.18026666
[20,] -0.41144118 -0.30805810
[21,] -0.55907369 -0.41144118
[22,] -0.38114003 -0.55907369
[23,] -0.43959023 -0.38114003
[24,] -0.32368860 -0.43959023
[25,] -0.46053477 -0.32368860
[26,] -0.43959023 -0.46053477
[27,] -0.26649586 -0.43959023
[28,] -0.31637274 -0.26649586
[29,] -0.30469841 -0.31637274
[30,] -0.33437083 -0.30469841
[31,] -0.37282539 -0.33437083
[32,] -0.48736486 -0.37282539
[33,] -0.34530507 -0.48736486
[34,] -0.35420524 -0.34530507
[35,] -0.46016473 -0.35420524
[36,] -0.30705933 -0.46016473
[37,] -0.39045344 -0.30705933
[38,] -0.46910809 -0.39045344
[39,] -0.36256307 -0.46910809
[40,] -0.35320647 -0.36256307
[41,] -0.28286645 -0.35320647
[42,] -0.26623718 -0.28286645
[43,] -0.49009583 -0.26623718
[44,] -0.43064686 -0.49009583
[45,] -0.39108216 -0.43064686
[46,] -0.33363074 -0.39108216
[47,] -0.40334203 -0.33363074
[48,] -0.43164563 -0.40334203
[49,] -0.49741170 -0.43164563
[50,] -0.43064686 -0.49741170
[51,] -0.27459501 -0.43064686
[52,] -0.21747044 -0.27459501
[53,] -0.35262094 -0.21747044
[54,] -0.48795039 -0.35262094
[55,] -0.40271330 -0.48795039
[56,] -0.40271330 -0.40271330
[57,] -0.33263197 -0.40271330
[58,] -0.38114003 -0.33263197
[59,] -0.44058900 -0.38114003
[60,] -0.41875704 -0.44058900
[61,] -0.37419421 -0.41875704
[62,] -0.43996027 -0.37419421
[63,] -0.44890363 -0.43996027
[64,] -0.34489183 -0.44890363
[65,] -0.32442869 -0.34489183
[66,] -0.43164563 -0.32442869
[67,] -0.49678297 -0.43164563
[68,] -0.43064686 -0.49678297
[69,] -0.41206990 -0.43064686
[70,] -0.30411287 -0.41206990
[71,] -0.43064686 -0.30411287
[72,] -0.26549709 -0.43064686
[73,] -0.29516951 -0.26549709
[74,] -0.28286645 -0.29516951
[75,] -0.35386065 -0.28286645
[76,] -0.39045344 -0.35386065
[77,] -0.35420524 -0.39045344
[78,] -0.26790787 -0.35420524
[79,] -0.48015370 -0.26790787
[80,] -0.45185009 -0.48015370
[81,] -0.09451163 -0.45185009
[82,] -0.33263197 -0.09451163
[83,] -0.31674278 -0.33263197
[84,] -0.38114003 -0.31674278
[85,] -0.41102794 -0.38114003
[86,] -0.13112987 -0.41102794
[87,] -0.44017576 -0.13112987
[88,] -0.29165526 -0.44017576
[89,] -0.30742937 -0.29165526
[90,] -0.41997130 -0.30742937
[91,] -0.26623718 -0.41997130
[92,] -0.38151008 -0.26623718
[93,] -0.59705409 -0.38151008
[94,] -0.46490418 -0.59705409
[95,] -0.33163320 -0.46490418
[96,] -0.40271330 -0.33163320
[97,] -0.41202671 -0.40271330
[98,] -0.35420524 -0.41202671
[99,] -0.27496505 -0.35420524
[100,] -0.24603272 -0.27496505
[101,] 0.66699799 -0.24603272
[102,] 0.49032844 0.66699799
[103,] 0.67668144 0.49032844
[104,] 0.61848992 0.67668144
[105,] 0.61749115 0.61848992
[106,] 0.57766777 0.61749115
[107,] 0.54440922 0.57766777
[108,] 0.62853676 0.54440922
[109,] 0.54042080 0.62853676
[110,] 0.56040977 0.54042080
[111,] 0.51090294 0.56040977
[112,] 0.66595602 0.51090294
[113,] 0.60976205 0.66595602
[114,] 0.59665797 0.60976205
[115,] 0.67472709 0.59665797
[116,] 0.51984630 0.67472709
[117,] 0.42356361 0.51984630
[118,] 0.54773667 0.42356361
[119,] 0.76106766 0.54773667
[120,] 0.56103850 0.76106766
[121,] 0.70918895 0.56103850
[122,] 0.59728670 0.70918895
[123,] 0.49826209 0.59728670
[124,] 0.56103850 0.49826209
[125,] 0.50968868 0.56103850
[126,] 0.56872441 0.50968868
[127,] 0.56835437 0.56872441
[128,] 0.67594135 0.56835437
[129,] 0.62680456 0.67594135
[130,] 0.56003973 0.62680456
[131,] 0.59765674 0.56003973
[132,] 0.57766777 0.59765674
[133,] 0.52090658 0.57766777
[134,] 0.38573110 0.52090658
[135,] 0.57229959 0.38573110
[136,] 0.51921758 0.57229959
[137,] 0.54678109 0.51921758
[138,] 0.53883650 0.54678109
[139,] 0.65506498 0.53883650
[140,] 0.45308147 0.65506498
[141,] 0.61627690 0.45308147
[142,] 0.55941100 0.61627690
[143,] 0.60854779 0.55941100
[144,] 0.89817251 0.60854779
[145,] 0.51027421 0.89817251
[146,] 0.58955759 0.51027421
[147,] 0.69588713 0.58955759
[148,] 0.56835437 0.69588713
[149,] 0.58065742 0.56835437
[150,] 0.98329881 0.58065742
[151,] 0.63847889 0.98329881
[152,] 0.59824227 0.63847889
[153,] 0.66005217 0.59824227
[154,] 0.59728670 0.66005217
[155,] 0.61749115 0.59728670
[156,] 0.66762671 0.61749115
[157,] 0.48932967 0.66762671
[158,] 0.59724350 0.48932967
[159,] 0.53047867 0.59724350
[160,] 0.51153167 0.53047867
[161,] 0.56835437 0.51153167
[162,] 0.58892887 0.56835437
[163,] 0.67468390 0.58892887
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.38313757 -0.48015370
2 -0.28806913 -0.38313757
3 -0.32468737 -0.28806913
4 -0.48851153 -0.32468737
5 -0.28685487 -0.48851153
6 -0.25866263 -0.28685487
7 -0.37382416 -0.25866263
8 -0.30469841 -0.37382416
9 -0.25929136 -0.30469841
10 -0.48846833 -0.25929136
11 -0.33994783 -0.48846833
12 -0.41102794 -0.33994783
13 -0.38114003 -0.41102794
14 -0.14764778 -0.38114003
15 -0.39776931 -0.14764778
16 -0.51861492 -0.39776931
17 -0.51861492 -0.51861492
18 -0.18026666 -0.51861492
19 -0.30805810 -0.18026666
20 -0.41144118 -0.30805810
21 -0.55907369 -0.41144118
22 -0.38114003 -0.55907369
23 -0.43959023 -0.38114003
24 -0.32368860 -0.43959023
25 -0.46053477 -0.32368860
26 -0.43959023 -0.46053477
27 -0.26649586 -0.43959023
28 -0.31637274 -0.26649586
29 -0.30469841 -0.31637274
30 -0.33437083 -0.30469841
31 -0.37282539 -0.33437083
32 -0.48736486 -0.37282539
33 -0.34530507 -0.48736486
34 -0.35420524 -0.34530507
35 -0.46016473 -0.35420524
36 -0.30705933 -0.46016473
37 -0.39045344 -0.30705933
38 -0.46910809 -0.39045344
39 -0.36256307 -0.46910809
40 -0.35320647 -0.36256307
41 -0.28286645 -0.35320647
42 -0.26623718 -0.28286645
43 -0.49009583 -0.26623718
44 -0.43064686 -0.49009583
45 -0.39108216 -0.43064686
46 -0.33363074 -0.39108216
47 -0.40334203 -0.33363074
48 -0.43164563 -0.40334203
49 -0.49741170 -0.43164563
50 -0.43064686 -0.49741170
51 -0.27459501 -0.43064686
52 -0.21747044 -0.27459501
53 -0.35262094 -0.21747044
54 -0.48795039 -0.35262094
55 -0.40271330 -0.48795039
56 -0.40271330 -0.40271330
57 -0.33263197 -0.40271330
58 -0.38114003 -0.33263197
59 -0.44058900 -0.38114003
60 -0.41875704 -0.44058900
61 -0.37419421 -0.41875704
62 -0.43996027 -0.37419421
63 -0.44890363 -0.43996027
64 -0.34489183 -0.44890363
65 -0.32442869 -0.34489183
66 -0.43164563 -0.32442869
67 -0.49678297 -0.43164563
68 -0.43064686 -0.49678297
69 -0.41206990 -0.43064686
70 -0.30411287 -0.41206990
71 -0.43064686 -0.30411287
72 -0.26549709 -0.43064686
73 -0.29516951 -0.26549709
74 -0.28286645 -0.29516951
75 -0.35386065 -0.28286645
76 -0.39045344 -0.35386065
77 -0.35420524 -0.39045344
78 -0.26790787 -0.35420524
79 -0.48015370 -0.26790787
80 -0.45185009 -0.48015370
81 -0.09451163 -0.45185009
82 -0.33263197 -0.09451163
83 -0.31674278 -0.33263197
84 -0.38114003 -0.31674278
85 -0.41102794 -0.38114003
86 -0.13112987 -0.41102794
87 -0.44017576 -0.13112987
88 -0.29165526 -0.44017576
89 -0.30742937 -0.29165526
90 -0.41997130 -0.30742937
91 -0.26623718 -0.41997130
92 -0.38151008 -0.26623718
93 -0.59705409 -0.38151008
94 -0.46490418 -0.59705409
95 -0.33163320 -0.46490418
96 -0.40271330 -0.33163320
97 -0.41202671 -0.40271330
98 -0.35420524 -0.41202671
99 -0.27496505 -0.35420524
100 -0.24603272 -0.27496505
101 0.66699799 -0.24603272
102 0.49032844 0.66699799
103 0.67668144 0.49032844
104 0.61848992 0.67668144
105 0.61749115 0.61848992
106 0.57766777 0.61749115
107 0.54440922 0.57766777
108 0.62853676 0.54440922
109 0.54042080 0.62853676
110 0.56040977 0.54042080
111 0.51090294 0.56040977
112 0.66595602 0.51090294
113 0.60976205 0.66595602
114 0.59665797 0.60976205
115 0.67472709 0.59665797
116 0.51984630 0.67472709
117 0.42356361 0.51984630
118 0.54773667 0.42356361
119 0.76106766 0.54773667
120 0.56103850 0.76106766
121 0.70918895 0.56103850
122 0.59728670 0.70918895
123 0.49826209 0.59728670
124 0.56103850 0.49826209
125 0.50968868 0.56103850
126 0.56872441 0.50968868
127 0.56835437 0.56872441
128 0.67594135 0.56835437
129 0.62680456 0.67594135
130 0.56003973 0.62680456
131 0.59765674 0.56003973
132 0.57766777 0.59765674
133 0.52090658 0.57766777
134 0.38573110 0.52090658
135 0.57229959 0.38573110
136 0.51921758 0.57229959
137 0.54678109 0.51921758
138 0.53883650 0.54678109
139 0.65506498 0.53883650
140 0.45308147 0.65506498
141 0.61627690 0.45308147
142 0.55941100 0.61627690
143 0.60854779 0.55941100
144 0.89817251 0.60854779
145 0.51027421 0.89817251
146 0.58955759 0.51027421
147 0.69588713 0.58955759
148 0.56835437 0.69588713
149 0.58065742 0.56835437
150 0.98329881 0.58065742
151 0.63847889 0.98329881
152 0.59824227 0.63847889
153 0.66005217 0.59824227
154 0.59728670 0.66005217
155 0.61749115 0.59728670
156 0.66762671 0.61749115
157 0.48932967 0.66762671
158 0.59724350 0.48932967
159 0.53047867 0.59724350
160 0.51153167 0.53047867
161 0.56835437 0.51153167
162 0.58892887 0.56835437
163 0.67468390 0.58892887
> 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/7ks341322066424.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/8lopv1322066424.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/9o32b1322066424.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/10ha4h1322066424.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/110sps1322066424.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/12esec1322066424.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/13nda41322066424.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/14izl31322066424.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/15ro8d1322066424.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/16dx821322066424.tab")
+ }
>
> try(system("convert tmp/19zd71322066424.ps tmp/19zd71322066424.png",intern=TRUE))
character(0)
> try(system("convert tmp/2me8s1322066424.ps tmp/2me8s1322066424.png",intern=TRUE))
character(0)
> try(system("convert tmp/30po71322066424.ps tmp/30po71322066424.png",intern=TRUE))
character(0)
> try(system("convert tmp/4rm3m1322066424.ps tmp/4rm3m1322066424.png",intern=TRUE))
character(0)
> try(system("convert tmp/5xvzy1322066424.ps tmp/5xvzy1322066424.png",intern=TRUE))
character(0)
> try(system("convert tmp/6h4og1322066424.ps tmp/6h4og1322066424.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ks341322066424.ps tmp/7ks341322066424.png",intern=TRUE))
character(0)
> try(system("convert tmp/8lopv1322066424.ps tmp/8lopv1322066424.png",intern=TRUE))
character(0)
> try(system("convert tmp/9o32b1322066424.ps tmp/9o32b1322066424.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ha4h1322066424.ps tmp/10ha4h1322066424.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.127 0.521 5.659