R version 2.11.1 (2010-05-31)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(5.5
+ ,6
+ ,5.33
+ ,12
+ ,3.5
+ ,4
+ ,5.56
+ ,11
+ ,8.5
+ ,4
+ ,3.78
+ ,14
+ ,5
+ ,4
+ ,4.00
+ ,12
+ ,6
+ ,4.5
+ ,4.00
+ ,21
+ ,6
+ ,3.5
+ ,3.56
+ ,12
+ ,5.5
+ ,2
+ ,4.44
+ ,22
+ ,5.5
+ ,5.5
+ ,3.56
+ ,11
+ ,6
+ ,3.5
+ ,4.00
+ ,10
+ ,6.5
+ ,3.5
+ ,3.78
+ ,13
+ ,7
+ ,6
+ ,5.11
+ ,10
+ ,8
+ ,5
+ ,6.67
+ ,8
+ ,5.5
+ ,5
+ ,5.11
+ ,15
+ ,5
+ ,4
+ ,4.00
+ ,14
+ ,5.5
+ ,4
+ ,3.33
+ ,10
+ ,7.5
+ ,2
+ ,2.67
+ ,14
+ ,4.5
+ ,4.5
+ ,4.67
+ ,14
+ ,5.5
+ ,4
+ ,3.33
+ ,11
+ ,8.5
+ ,3.5
+ ,4.44
+ ,10
+ ,8.5
+ ,5.5
+ ,6.89
+ ,13
+ ,5.5
+ ,4.5
+ ,6.00
+ ,7
+ ,9
+ ,5.5
+ ,7.56
+ ,14
+ ,7
+ ,6.5
+ ,4.67
+ ,12
+ ,5
+ ,4
+ ,6.89
+ ,14
+ ,5.5
+ ,4
+ ,4.22
+ ,11
+ ,7.5
+ ,4.5
+ ,3.56
+ ,9
+ ,7.5
+ ,3
+ ,4.44
+ ,11
+ ,6.5
+ ,4.5
+ ,4.67
+ ,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78
+ ,16
+ ,6
+ ,6.5
+ ,4.89
+ ,11
+ ,4.5
+ ,4.5
+ ,6.67
+ ,12
+ ,7.5
+ ,5
+ ,6.67
+ ,10
+ ,12
+ ,10
+ ,5.33
+ ,14
+ ,3.5
+ ,2.5
+ ,4.67
+ ,12
+ ,8.5
+ ,5.5
+ ,4.67
+ ,12
+ ,5.5
+ ,3
+ ,6.44
+ ,11
+ ,8.5
+ ,4.5
+ ,6.89
+ ,12
+ ,5.5
+ ,3.5
+ ,4.44
+ ,13
+ ,6
+ ,4.5
+ ,3.56
+ ,11
+ ,7
+ ,5
+ ,4.89
+ ,19
+ ,5.5
+ ,4.5
+ ,4.44
+ ,12
+ ,8
+ ,4
+ ,6.22
+ ,17
+ ,10.5
+ ,3.5
+ ,8.44
+ ,9
+ ,7
+ ,3
+ ,4.89
+ ,12
+ ,10
+ ,6.5
+ ,4.44
+ ,19
+ ,6.5
+ ,3
+ ,3.78
+ ,18
+ ,5.5
+ ,4
+ ,6.22
+ ,15
+ ,7.5
+ ,5
+ ,4.89
+ ,14
+ ,9.5
+ ,8
+ ,6.89
+ ,11)
+ ,dim=c(4
+ ,159)
+ ,dimnames=list(c('Expect'
+ ,'Criticism'
+ ,'Concerns'
+ ,'Depression')
+ ,1:159))
> y <- array(NA,dim=c(4,159),dimnames=list(c('Expect','Criticism','Concerns','Depression'),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 = '4'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
> 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
Depression Expect Criticism Concerns
1 12 5.5 6.0 5.33
2 11 3.5 4.0 5.56
3 14 8.5 4.0 3.78
4 12 5.0 4.0 4.00
5 21 6.0 4.5 4.00
6 12 6.0 3.5 3.56
7 22 5.5 2.0 4.44
8 11 5.5 5.5 3.56
9 10 6.0 3.5 4.00
10 13 6.5 3.5 3.78
11 10 7.0 6.0 5.11
12 8 8.0 5.0 6.67
13 15 5.5 5.0 5.11
14 14 5.0 4.0 4.00
15 10 5.5 4.0 3.33
16 14 7.5 2.0 2.67
17 14 4.5 4.5 4.67
18 11 5.5 4.0 3.33
19 10 8.5 3.5 4.44
20 13 8.5 5.5 6.89
21 7 5.5 4.5 6.00
22 14 9.0 5.5 7.56
23 12 7.0 6.5 4.67
24 14 5.0 4.0 6.89
25 11 5.5 4.0 4.22
26 9 7.5 4.5 3.56
27 11 7.5 3.0 4.44
28 15 6.5 4.5 4.67
29 14 8.0 4.5 4.89
30 13 6.5 3.0 3.78
31 9 4.5 3.0 5.33
32 15 9.0 8.0 5.56
33 10 9.0 2.5 5.78
34 11 6.0 3.5 5.56
35 13 8.5 4.5 3.78
36 8 4.5 3.0 7.11
37 20 4.5 3.0 7.33
38 12 6.0 2.5 2.89
39 10 9.0 6.0 7.11
40 10 6.0 3.5 5.56
41 9 9.0 5.0 6.44
42 14 7.0 4.5 4.89
43 8 7.5 4.0 4.00
44 14 8.0 2.5 3.78
45 11 5.0 4.0 4.44
46 13 5.5 4.0 3.33
47 9 7.0 5.0 4.44
48 11 4.5 3.0 7.33
49 15 6.0 4.0 6.44
50 11 8.5 3.5 5.11
51 10 2.5 2.0 5.78
52 14 6.0 4.0 4.00
53 18 6.0 4.0 4.44
54 14 3.0 2.0 2.44
55 11 12.0 10.0 6.22
56 12 6.0 4.0 5.78
57 13 6.0 4.0 4.89
58 9 7.0 3.0 3.78
59 10 3.5 2.0 2.67
60 15 6.5 4.0 3.11
61 20 6.0 4.5 3.78
62 12 6.5 3.0 4.67
63 12 7.0 3.5 4.22
64 14 4.0 4.5 4.00
65 13 5.5 2.5 2.22
66 11 4.5 2.5 6.44
67 17 5.5 4.0 6.89
68 12 6.5 4.0 4.22
69 13 5.0 3.0 2.00
70 14 5.5 4.0 4.44
71 13 6.0 3.5 6.22
72 15 4.5 3.5 4.22
73 13 7.5 4.5 6.67
74 10 9.0 5.5 6.44
75 11 7.5 3.0 5.78
76 19 6.0 4.0 5.11
77 13 6.5 3.0 2.89
78 17 7.0 4.5 4.67
79 13 5.0 4.0 4.22
80 9 6.5 3.0 6.22
81 11 6.5 5.0 5.11
82 10 5.5 4.0 4.00
83 9 6.5 4.0 4.67
84 12 8.0 5.0 4.44
85 12 4.0 2.5 5.11
86 13 8.0 3.5 4.67
87 13 5.5 2.5 4.67
88 12 4.5 4.0 3.33
89 15 8.0 7.0 6.22
90 22 6.0 3.5 4.22
91 13 7.0 4.0 5.78
92 15 4.0 3.0 2.22
93 13 4.5 2.5 3.56
94 15 7.5 3.0 4.89
95 10 5.5 5.0 4.22
96 11 10.5 6.0 6.89
97 16 7.0 4.5 6.89
98 11 9.0 6.0 6.44
99 11 6.0 3.5 4.22
100 10 6.5 4.0 4.89
101 10 7.5 5.0 5.11
102 16 6.0 3.0 3.33
103 12 9.5 5.0 4.44
104 11 7.5 5.0 4.00
105 16 5.5 5.0 5.11
106 19 5.5 2.5 5.56
107 11 5.0 3.5 4.67
108 16 6.5 5.0 5.33
109 15 7.5 5.5 5.56
110 24 6.0 3.0 3.78
111 14 6.0 3.5 2.89
112 15 8.0 6.0 6.22
113 11 4.5 5.5 4.67
114 15 9.0 5.5 5.56
115 12 4.0 5.5 2.00
116 10 6.5 2.5 3.56
117 14 8.5 4.0 4.22
118 13 4.5 3.0 3.78
119 9 7.5 4.5 5.56
120 15 4.0 2.0 4.44
121 15 3.5 2.0 6.44
122 14 6.0 3.5 3.11
123 11 7.0 5.5 4.89
124 8 3.0 3.0 3.33
125 11 4.0 3.5 4.22
126 11 8.5 4.0 4.44
127 8 5.0 2.0 3.33
128 10 5.5 4.0 4.44
129 11 7.0 4.5 4.00
130 13 5.5 4.0 7.33
131 11 6.5 5.5 4.89
132 20 6.0 4.0 3.56
133 10 5.5 2.5 3.78
134 15 4.5 2.0 3.56
135 12 6.0 4.0 4.67
136 14 10.0 5.0 5.78
137 23 6.0 3.0 4.00
138 14 6.5 4.5 4.00
139 16 6.0 4.5 3.78
140 11 6.0 6.5 4.89
141 12 4.5 4.5 6.67
142 10 7.5 5.0 6.67
143 14 12.0 10.0 5.33
144 12 3.5 2.5 4.67
145 12 8.5 5.5 4.67
146 11 5.5 3.0 6.44
147 12 8.5 4.5 6.89
148 13 5.5 3.5 4.44
149 11 6.0 4.5 3.56
150 19 7.0 5.0 4.89
151 12 5.5 4.5 4.44
152 17 8.0 4.0 6.22
153 9 10.5 3.5 8.44
154 12 7.0 3.0 4.89
155 19 10.0 6.5 4.44
156 18 6.5 3.0 3.78
157 15 5.5 4.0 6.22
158 14 7.5 5.0 4.89
159 11 9.5 8.0 6.89
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Expect Criticism Concerns
14.167094 -0.003743 -0.035607 -0.230057
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.6059 -2.0370 -0.6725 1.4628 10.8318
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 14.167094 1.194134 11.864 <2e-16 ***
Expect -0.003743 0.184582 -0.020 0.984
Criticism -0.035607 0.233426 -0.153 0.879
Concerns -0.230057 0.211821 -1.086 0.279
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.16 on 155 degrees of freedom
Multiple R-squared: 0.009937, Adjusted R-squared: -0.009225
F-statistic: 0.5186 on 3 and 155 DF, p-value: 0.6701
> 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.97915332 0.04169336 0.02084668
[2,] 0.95507387 0.08985226 0.04492613
[3,] 0.97260452 0.05479097 0.02739548
[4,] 0.95577303 0.08845393 0.04422697
[5,] 0.93430015 0.13139970 0.06569985
[6,] 0.93167386 0.13665227 0.06832614
[7,] 0.92438200 0.15123600 0.07561800
[8,] 0.88723460 0.22553081 0.11276540
[9,] 0.90075378 0.19849244 0.09924622
[10,] 0.87353624 0.25292752 0.12646376
[11,] 0.82986521 0.34026959 0.17013479
[12,] 0.80375664 0.39248671 0.19624336
[13,] 0.78369186 0.43261628 0.21630814
[14,] 0.75486977 0.49026045 0.24513023
[15,] 0.84623759 0.30752481 0.15376241
[16,] 0.83837210 0.32325581 0.16162790
[17,] 0.80225496 0.39549007 0.19774504
[18,] 0.75632763 0.48734475 0.24367237
[19,] 0.72181335 0.55637330 0.27818665
[20,] 0.72165037 0.55669926 0.27834963
[21,] 0.69449222 0.61101556 0.30550778
[22,] 0.67473222 0.65053555 0.32526778
[23,] 0.63416271 0.73167457 0.36583729
[24,] 0.57580847 0.84838306 0.42419153
[25,] 0.62874100 0.74251800 0.37125900
[26,] 0.64017068 0.71965863 0.35982932
[27,] 0.62222833 0.75554335 0.37777167
[28,] 0.57646081 0.84707837 0.42353919
[29,] 0.51979974 0.96040052 0.48020026
[30,] 0.53517744 0.92964512 0.46482256
[31,] 0.78940026 0.42119948 0.21059974
[32,] 0.75220400 0.49559199 0.24779600
[33,] 0.72491717 0.55016566 0.27508283
[34,] 0.70771496 0.58457008 0.29228504
[35,] 0.70079583 0.59840833 0.29920417
[36,] 0.66502970 0.66994060 0.33497030
[37,] 0.71229983 0.57540035 0.28770017
[38,] 0.67599835 0.64800331 0.32400165
[39,] 0.64264512 0.71470976 0.35735488
[40,] 0.59426448 0.81147104 0.40573552
[41,] 0.60284391 0.79431217 0.39715609
[42,] 0.56219372 0.87561256 0.43780628
[43,] 0.54889660 0.90220681 0.45110340
[44,] 0.50994968 0.98010064 0.49005032
[45,] 0.49920319 0.99840638 0.50079681
[46,] 0.45912915 0.91825830 0.54087085
[47,] 0.54935898 0.90128205 0.45064102
[48,] 0.50164747 0.99670505 0.49835253
[49,] 0.45921917 0.91843833 0.54078083
[50,] 0.41247369 0.82494739 0.58752631
[51,] 0.36691237 0.73382474 0.63308763
[52,] 0.39071130 0.78142259 0.60928870
[53,] 0.39481274 0.78962548 0.60518726
[54,] 0.37016220 0.74032441 0.62983780
[55,] 0.55819325 0.88361349 0.44180675
[56,] 0.51471428 0.97057143 0.48528572
[57,] 0.47206726 0.94413453 0.52793274
[58,] 0.42929669 0.85859337 0.57070331
[59,] 0.38548072 0.77096145 0.61451928
[60,] 0.34994536 0.69989073 0.65005464
[61,] 0.40672238 0.81344475 0.59327762
[62,] 0.36635750 0.73271500 0.63364250
[63,] 0.32572596 0.65145192 0.67427404
[64,] 0.28977270 0.57954540 0.71022730
[65,] 0.25256244 0.50512488 0.74743756
[66,] 0.23030153 0.46060307 0.76969847
[67,] 0.19866879 0.39733757 0.80133121
[68,] 0.18357724 0.36715448 0.81642276
[69,] 0.16256244 0.32512488 0.83743756
[70,] 0.25986027 0.51972055 0.74013973
[71,] 0.22629870 0.45259741 0.77370130
[72,] 0.25241336 0.50482672 0.74758664
[73,] 0.21690093 0.43380186 0.78309907
[74,] 0.22583772 0.45167543 0.77416228
[75,] 0.20232065 0.40464130 0.79767935
[76,] 0.20122641 0.40245283 0.79877359
[77,] 0.21998494 0.43996988 0.78001506
[78,] 0.19151211 0.38302422 0.80848789
[79,] 0.16396537 0.32793074 0.83603463
[80,] 0.13978255 0.27956511 0.86021745
[81,] 0.11646919 0.23293839 0.88353081
[82,] 0.09871787 0.19743574 0.90128213
[83,] 0.09341518 0.18683036 0.90658482
[84,] 0.29673544 0.59347089 0.70326456
[85,] 0.25870115 0.51740230 0.74129885
[86,] 0.22825809 0.45651618 0.77174191
[87,] 0.19519005 0.39038009 0.80480995
[88,] 0.17666102 0.35332205 0.82333898
[89,] 0.17248729 0.34497458 0.82751271
[90,] 0.15132298 0.30264596 0.84867702
[91,] 0.15871003 0.31742005 0.84128997
[92,] 0.13782561 0.27565121 0.86217439
[93,] 0.12503463 0.25006926 0.87496537
[94,] 0.12274202 0.24548403 0.87725798
[95,] 0.11956438 0.23912876 0.88043562
[96,] 0.11008934 0.22017868 0.88991066
[97,] 0.09544098 0.19088195 0.90455902
[98,] 0.08732742 0.17465484 0.91267258
[99,] 0.08813598 0.17627195 0.91186402
[100,] 0.14903093 0.29806186 0.85096907
[101,] 0.13182250 0.26364500 0.86817750
[102,] 0.13221413 0.26442826 0.86778587
[103,] 0.11923404 0.23846808 0.88076596
[104,] 0.51394564 0.97210872 0.48605436
[105,] 0.46428469 0.92856938 0.53571531
[106,] 0.44378153 0.88756306 0.55621847
[107,] 0.40451381 0.80902762 0.59548619
[108,] 0.37487340 0.74974680 0.62512660
[109,] 0.33603082 0.67206164 0.66396918
[110,] 0.35355082 0.70710163 0.64644918
[111,] 0.30852965 0.61705929 0.69147035
[112,] 0.26368590 0.52737180 0.73631410
[113,] 0.28423263 0.56846526 0.71576737
[114,] 0.25720067 0.51440134 0.74279933
[115,] 0.26646977 0.53293954 0.73353023
[116,] 0.22423787 0.44847573 0.77576213
[117,] 0.19914826 0.39829652 0.80085174
[118,] 0.25921464 0.51842927 0.74078536
[119,] 0.23183029 0.46366059 0.76816971
[120,] 0.22966953 0.45933905 0.77033047
[121,] 0.39491415 0.78982829 0.60508585
[122,] 0.41471975 0.82943950 0.58528025
[123,] 0.44183685 0.88367370 0.55816315
[124,] 0.42419713 0.84839426 0.57580287
[125,] 0.39656743 0.79313485 0.60343257
[126,] 0.49336278 0.98672556 0.50663722
[127,] 0.61700296 0.76599408 0.38299704
[128,] 0.56056989 0.87886022 0.43943011
[129,] 0.52662799 0.94674402 0.47337201
[130,] 0.46246106 0.92492212 0.53753894
[131,] 0.82086171 0.35827658 0.17913829
[132,] 0.77132764 0.45734472 0.22867236
[133,] 0.72380925 0.55238149 0.27619075
[134,] 0.68502665 0.62994671 0.31497335
[135,] 0.62635664 0.74728671 0.37364336
[136,] 0.57423519 0.85152963 0.42576481
[137,] 0.50409742 0.99180516 0.49590258
[138,] 0.42160701 0.84321402 0.57839299
[139,] 0.41834679 0.83669358 0.58165321
[140,] 0.32998145 0.65996291 0.67001855
[141,] 0.24687332 0.49374664 0.75312668
[142,] 0.18226347 0.36452695 0.81773653
[143,] 0.32483266 0.64966531 0.67516734
[144,] 0.37192088 0.74384175 0.62807912
[145,] 0.40033501 0.80067002 0.59966499
[146,] 0.47580854 0.95161708 0.52419146
> postscript(file="/var/www/rcomp/tmp/1g63q1290521368.ps",horizontal=F,pagecentre=F,paper="special",width=8.3194444444444,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/2g63q1290521368.ps",horizontal=F,pagecentre=F,paper="special",width=8.3194444444444,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/39xkb1290521368.ps",horizontal=F,pagecentre=F,paper="special",width=8.3194444444444,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/49xkb1290521368.ps",horizontal=F,pagecentre=F,paper="special",width=8.3194444444444,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/59xkb1290521368.ps",horizontal=F,pagecentre=F,paper="special",width=8.3194444444444,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
-0.7066598054 -1.7324480430 0.8767684820 -1.0857212011 7.9358258502
6 7 8 9 10
-1.2010062355 8.9461611309 -2.1316636447 -3.0997813127 -0.1485220392
11 12 13 14 15
-2.7516570621 -4.4246323922 2.2071205703 0.9142787989 -3.2379874169
16 17 18 19 20
0.5464478128 1.0843485961 -2.2379874169 -2.9891977152 0.6456553856
21 22 23 24 25
-5.6059325990 1.8016650713 -0.8350784035 1.5791424968 -2.0332370047
26 27 28 29 30
-4.1597838679 -2.0107447665 2.0918355358 1.1480632021 -0.1663256206
31 32 33 34 35
-3.8172247639 2.4305696927 -2.7146572417 -1.7408929498 -0.1054279366
36 37 38 39 40
-4.4077239396 7.6428885219 -1.3907513491 -2.2840568366 -2.7408929498
41 42 43 44 45
-3.4738019502 1.1443197322 -5.0763625265 0.8214860027 -1.9844962782
46 47 48 49 50
-0.2379874169 -3.9414021757 -1.3571114781 2.4793604774 -1.8350597644
51 52 53 54 55
-2.7567933772 0.9180222688 5.0192471916 0.4766891706 -1.3351481877
56 57 58 59 60
-0.6724769069 0.1227726809 -4.1644538857 -3.4685260667 1.7151435915
61 62 63 64 65
6.8852133888 -0.9615752085 -1.0454253814 0.9283389105 -0.5467610348
66 67 68 69 70
-1.5796654717 4.5810142317 -1.0294935349 -0.5814416497 1.0173754567
71 72 73 74 75
0.4109444345 1.9452159440 0.5556922914 -2.4559983688 -1.7024688650
76 77 78 79 80
6.1733851423 -0.3710760328 4.0937072708 -0.0351087397 -3.6049874120
81 82 83 84 85
-1.7891359599 -3.0838494662 -3.9259680456 -0.9376587058 -0.8875125417
86 87 88 89 90
0.0618435778 0.0168777402 -1.2417308868 2.5430564443 8.9508311487
91 92 93 94 95
0.3312665629 1.4654273418 -0.2422286032 2.0927807228 -2.9976298419
96 97 98 99 100
-1.3290540932 3.6044330180 -1.4381947873 -2.0491688513 -2.8753555842
101 102 103 104 105
-2.7853924900 2.7282771552 -0.9320435010 -2.0407553636 3.2071205703
106 107 108 109 110
6.2216281524 -1.9493868318 3.2614765016 2.3359365807 10.8318026445
111 112 113 114 115
0.6448558137 2.5074492814 -1.8800442410 2.3415517855 -1.4961672124
116 117 118 119 120
-3.2347416635 0.9779934048 -0.1738125603 -3.6996705821 1.9405459262
121 122 123 124 125
2.3987874770 0.6954682752 -1.8200731049 -5.2829532544 -2.0566557910
126 127 128 129 130
-1.9713941337 -5.3110734776 -2.9826245433 -2.0604306800 0.6822391546
131 132 133 134 135
-1.8219448399 6.8167973459 -3.1878726719 1.7399678154 -0.9278397805
136 137 138 139 140
1.3781041354 9.8824151059 0.9376975851 2.8852133888 -1.7882094119
141 142 143 144 145
-0.4555381181 -2.4265041271 1.4601014001 -0.9906091995 -0.8650703616
146 147 148 149 150
-1.5581184204 -0.3899517773 -0.0004281247 -2.1653990727 6.1621233136
151 152 153 154 155
-0.9648209619 4.4362349557 -3.0614842040 -0.9090910121 6.1232389782
156 157 158 159
4.8336743794 2.4268762810 1.1639950486 -1.2615832374
> postscript(file="/var/www/rcomp/tmp/61o1e1290521368.ps",horizontal=F,pagecentre=F,paper="special",width=8.3194444444444,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.7066598054 NA
1 -1.7324480430 -0.7066598054
2 0.8767684820 -1.7324480430
3 -1.0857212011 0.8767684820
4 7.9358258502 -1.0857212011
5 -1.2010062355 7.9358258502
6 8.9461611309 -1.2010062355
7 -2.1316636447 8.9461611309
8 -3.0997813127 -2.1316636447
9 -0.1485220392 -3.0997813127
10 -2.7516570621 -0.1485220392
11 -4.4246323922 -2.7516570621
12 2.2071205703 -4.4246323922
13 0.9142787989 2.2071205703
14 -3.2379874169 0.9142787989
15 0.5464478128 -3.2379874169
16 1.0843485961 0.5464478128
17 -2.2379874169 1.0843485961
18 -2.9891977152 -2.2379874169
19 0.6456553856 -2.9891977152
20 -5.6059325990 0.6456553856
21 1.8016650713 -5.6059325990
22 -0.8350784035 1.8016650713
23 1.5791424968 -0.8350784035
24 -2.0332370047 1.5791424968
25 -4.1597838679 -2.0332370047
26 -2.0107447665 -4.1597838679
27 2.0918355358 -2.0107447665
28 1.1480632021 2.0918355358
29 -0.1663256206 1.1480632021
30 -3.8172247639 -0.1663256206
31 2.4305696927 -3.8172247639
32 -2.7146572417 2.4305696927
33 -1.7408929498 -2.7146572417
34 -0.1054279366 -1.7408929498
35 -4.4077239396 -0.1054279366
36 7.6428885219 -4.4077239396
37 -1.3907513491 7.6428885219
38 -2.2840568366 -1.3907513491
39 -2.7408929498 -2.2840568366
40 -3.4738019502 -2.7408929498
41 1.1443197322 -3.4738019502
42 -5.0763625265 1.1443197322
43 0.8214860027 -5.0763625265
44 -1.9844962782 0.8214860027
45 -0.2379874169 -1.9844962782
46 -3.9414021757 -0.2379874169
47 -1.3571114781 -3.9414021757
48 2.4793604774 -1.3571114781
49 -1.8350597644 2.4793604774
50 -2.7567933772 -1.8350597644
51 0.9180222688 -2.7567933772
52 5.0192471916 0.9180222688
53 0.4766891706 5.0192471916
54 -1.3351481877 0.4766891706
55 -0.6724769069 -1.3351481877
56 0.1227726809 -0.6724769069
57 -4.1644538857 0.1227726809
58 -3.4685260667 -4.1644538857
59 1.7151435915 -3.4685260667
60 6.8852133888 1.7151435915
61 -0.9615752085 6.8852133888
62 -1.0454253814 -0.9615752085
63 0.9283389105 -1.0454253814
64 -0.5467610348 0.9283389105
65 -1.5796654717 -0.5467610348
66 4.5810142317 -1.5796654717
67 -1.0294935349 4.5810142317
68 -0.5814416497 -1.0294935349
69 1.0173754567 -0.5814416497
70 0.4109444345 1.0173754567
71 1.9452159440 0.4109444345
72 0.5556922914 1.9452159440
73 -2.4559983688 0.5556922914
74 -1.7024688650 -2.4559983688
75 6.1733851423 -1.7024688650
76 -0.3710760328 6.1733851423
77 4.0937072708 -0.3710760328
78 -0.0351087397 4.0937072708
79 -3.6049874120 -0.0351087397
80 -1.7891359599 -3.6049874120
81 -3.0838494662 -1.7891359599
82 -3.9259680456 -3.0838494662
83 -0.9376587058 -3.9259680456
84 -0.8875125417 -0.9376587058
85 0.0618435778 -0.8875125417
86 0.0168777402 0.0618435778
87 -1.2417308868 0.0168777402
88 2.5430564443 -1.2417308868
89 8.9508311487 2.5430564443
90 0.3312665629 8.9508311487
91 1.4654273418 0.3312665629
92 -0.2422286032 1.4654273418
93 2.0927807228 -0.2422286032
94 -2.9976298419 2.0927807228
95 -1.3290540932 -2.9976298419
96 3.6044330180 -1.3290540932
97 -1.4381947873 3.6044330180
98 -2.0491688513 -1.4381947873
99 -2.8753555842 -2.0491688513
100 -2.7853924900 -2.8753555842
101 2.7282771552 -2.7853924900
102 -0.9320435010 2.7282771552
103 -2.0407553636 -0.9320435010
104 3.2071205703 -2.0407553636
105 6.2216281524 3.2071205703
106 -1.9493868318 6.2216281524
107 3.2614765016 -1.9493868318
108 2.3359365807 3.2614765016
109 10.8318026445 2.3359365807
110 0.6448558137 10.8318026445
111 2.5074492814 0.6448558137
112 -1.8800442410 2.5074492814
113 2.3415517855 -1.8800442410
114 -1.4961672124 2.3415517855
115 -3.2347416635 -1.4961672124
116 0.9779934048 -3.2347416635
117 -0.1738125603 0.9779934048
118 -3.6996705821 -0.1738125603
119 1.9405459262 -3.6996705821
120 2.3987874770 1.9405459262
121 0.6954682752 2.3987874770
122 -1.8200731049 0.6954682752
123 -5.2829532544 -1.8200731049
124 -2.0566557910 -5.2829532544
125 -1.9713941337 -2.0566557910
126 -5.3110734776 -1.9713941337
127 -2.9826245433 -5.3110734776
128 -2.0604306800 -2.9826245433
129 0.6822391546 -2.0604306800
130 -1.8219448399 0.6822391546
131 6.8167973459 -1.8219448399
132 -3.1878726719 6.8167973459
133 1.7399678154 -3.1878726719
134 -0.9278397805 1.7399678154
135 1.3781041354 -0.9278397805
136 9.8824151059 1.3781041354
137 0.9376975851 9.8824151059
138 2.8852133888 0.9376975851
139 -1.7882094119 2.8852133888
140 -0.4555381181 -1.7882094119
141 -2.4265041271 -0.4555381181
142 1.4601014001 -2.4265041271
143 -0.9906091995 1.4601014001
144 -0.8650703616 -0.9906091995
145 -1.5581184204 -0.8650703616
146 -0.3899517773 -1.5581184204
147 -0.0004281247 -0.3899517773
148 -2.1653990727 -0.0004281247
149 6.1621233136 -2.1653990727
150 -0.9648209619 6.1621233136
151 4.4362349557 -0.9648209619
152 -3.0614842040 4.4362349557
153 -0.9090910121 -3.0614842040
154 6.1232389782 -0.9090910121
155 4.8336743794 6.1232389782
156 2.4268762810 4.8336743794
157 1.1639950486 2.4268762810
158 -1.2615832374 1.1639950486
159 NA -1.2615832374
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.7324480430 -0.7066598054
[2,] 0.8767684820 -1.7324480430
[3,] -1.0857212011 0.8767684820
[4,] 7.9358258502 -1.0857212011
[5,] -1.2010062355 7.9358258502
[6,] 8.9461611309 -1.2010062355
[7,] -2.1316636447 8.9461611309
[8,] -3.0997813127 -2.1316636447
[9,] -0.1485220392 -3.0997813127
[10,] -2.7516570621 -0.1485220392
[11,] -4.4246323922 -2.7516570621
[12,] 2.2071205703 -4.4246323922
[13,] 0.9142787989 2.2071205703
[14,] -3.2379874169 0.9142787989
[15,] 0.5464478128 -3.2379874169
[16,] 1.0843485961 0.5464478128
[17,] -2.2379874169 1.0843485961
[18,] -2.9891977152 -2.2379874169
[19,] 0.6456553856 -2.9891977152
[20,] -5.6059325990 0.6456553856
[21,] 1.8016650713 -5.6059325990
[22,] -0.8350784035 1.8016650713
[23,] 1.5791424968 -0.8350784035
[24,] -2.0332370047 1.5791424968
[25,] -4.1597838679 -2.0332370047
[26,] -2.0107447665 -4.1597838679
[27,] 2.0918355358 -2.0107447665
[28,] 1.1480632021 2.0918355358
[29,] -0.1663256206 1.1480632021
[30,] -3.8172247639 -0.1663256206
[31,] 2.4305696927 -3.8172247639
[32,] -2.7146572417 2.4305696927
[33,] -1.7408929498 -2.7146572417
[34,] -0.1054279366 -1.7408929498
[35,] -4.4077239396 -0.1054279366
[36,] 7.6428885219 -4.4077239396
[37,] -1.3907513491 7.6428885219
[38,] -2.2840568366 -1.3907513491
[39,] -2.7408929498 -2.2840568366
[40,] -3.4738019502 -2.7408929498
[41,] 1.1443197322 -3.4738019502
[42,] -5.0763625265 1.1443197322
[43,] 0.8214860027 -5.0763625265
[44,] -1.9844962782 0.8214860027
[45,] -0.2379874169 -1.9844962782
[46,] -3.9414021757 -0.2379874169
[47,] -1.3571114781 -3.9414021757
[48,] 2.4793604774 -1.3571114781
[49,] -1.8350597644 2.4793604774
[50,] -2.7567933772 -1.8350597644
[51,] 0.9180222688 -2.7567933772
[52,] 5.0192471916 0.9180222688
[53,] 0.4766891706 5.0192471916
[54,] -1.3351481877 0.4766891706
[55,] -0.6724769069 -1.3351481877
[56,] 0.1227726809 -0.6724769069
[57,] -4.1644538857 0.1227726809
[58,] -3.4685260667 -4.1644538857
[59,] 1.7151435915 -3.4685260667
[60,] 6.8852133888 1.7151435915
[61,] -0.9615752085 6.8852133888
[62,] -1.0454253814 -0.9615752085
[63,] 0.9283389105 -1.0454253814
[64,] -0.5467610348 0.9283389105
[65,] -1.5796654717 -0.5467610348
[66,] 4.5810142317 -1.5796654717
[67,] -1.0294935349 4.5810142317
[68,] -0.5814416497 -1.0294935349
[69,] 1.0173754567 -0.5814416497
[70,] 0.4109444345 1.0173754567
[71,] 1.9452159440 0.4109444345
[72,] 0.5556922914 1.9452159440
[73,] -2.4559983688 0.5556922914
[74,] -1.7024688650 -2.4559983688
[75,] 6.1733851423 -1.7024688650
[76,] -0.3710760328 6.1733851423
[77,] 4.0937072708 -0.3710760328
[78,] -0.0351087397 4.0937072708
[79,] -3.6049874120 -0.0351087397
[80,] -1.7891359599 -3.6049874120
[81,] -3.0838494662 -1.7891359599
[82,] -3.9259680456 -3.0838494662
[83,] -0.9376587058 -3.9259680456
[84,] -0.8875125417 -0.9376587058
[85,] 0.0618435778 -0.8875125417
[86,] 0.0168777402 0.0618435778
[87,] -1.2417308868 0.0168777402
[88,] 2.5430564443 -1.2417308868
[89,] 8.9508311487 2.5430564443
[90,] 0.3312665629 8.9508311487
[91,] 1.4654273418 0.3312665629
[92,] -0.2422286032 1.4654273418
[93,] 2.0927807228 -0.2422286032
[94,] -2.9976298419 2.0927807228
[95,] -1.3290540932 -2.9976298419
[96,] 3.6044330180 -1.3290540932
[97,] -1.4381947873 3.6044330180
[98,] -2.0491688513 -1.4381947873
[99,] -2.8753555842 -2.0491688513
[100,] -2.7853924900 -2.8753555842
[101,] 2.7282771552 -2.7853924900
[102,] -0.9320435010 2.7282771552
[103,] -2.0407553636 -0.9320435010
[104,] 3.2071205703 -2.0407553636
[105,] 6.2216281524 3.2071205703
[106,] -1.9493868318 6.2216281524
[107,] 3.2614765016 -1.9493868318
[108,] 2.3359365807 3.2614765016
[109,] 10.8318026445 2.3359365807
[110,] 0.6448558137 10.8318026445
[111,] 2.5074492814 0.6448558137
[112,] -1.8800442410 2.5074492814
[113,] 2.3415517855 -1.8800442410
[114,] -1.4961672124 2.3415517855
[115,] -3.2347416635 -1.4961672124
[116,] 0.9779934048 -3.2347416635
[117,] -0.1738125603 0.9779934048
[118,] -3.6996705821 -0.1738125603
[119,] 1.9405459262 -3.6996705821
[120,] 2.3987874770 1.9405459262
[121,] 0.6954682752 2.3987874770
[122,] -1.8200731049 0.6954682752
[123,] -5.2829532544 -1.8200731049
[124,] -2.0566557910 -5.2829532544
[125,] -1.9713941337 -2.0566557910
[126,] -5.3110734776 -1.9713941337
[127,] -2.9826245433 -5.3110734776
[128,] -2.0604306800 -2.9826245433
[129,] 0.6822391546 -2.0604306800
[130,] -1.8219448399 0.6822391546
[131,] 6.8167973459 -1.8219448399
[132,] -3.1878726719 6.8167973459
[133,] 1.7399678154 -3.1878726719
[134,] -0.9278397805 1.7399678154
[135,] 1.3781041354 -0.9278397805
[136,] 9.8824151059 1.3781041354
[137,] 0.9376975851 9.8824151059
[138,] 2.8852133888 0.9376975851
[139,] -1.7882094119 2.8852133888
[140,] -0.4555381181 -1.7882094119
[141,] -2.4265041271 -0.4555381181
[142,] 1.4601014001 -2.4265041271
[143,] -0.9906091995 1.4601014001
[144,] -0.8650703616 -0.9906091995
[145,] -1.5581184204 -0.8650703616
[146,] -0.3899517773 -1.5581184204
[147,] -0.0004281247 -0.3899517773
[148,] -2.1653990727 -0.0004281247
[149,] 6.1621233136 -2.1653990727
[150,] -0.9648209619 6.1621233136
[151,] 4.4362349557 -0.9648209619
[152,] -3.0614842040 4.4362349557
[153,] -0.9090910121 -3.0614842040
[154,] 6.1232389782 -0.9090910121
[155,] 4.8336743794 6.1232389782
[156,] 2.4268762810 4.8336743794
[157,] 1.1639950486 2.4268762810
[158,] -1.2615832374 1.1639950486
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.7324480430 -0.7066598054
2 0.8767684820 -1.7324480430
3 -1.0857212011 0.8767684820
4 7.9358258502 -1.0857212011
5 -1.2010062355 7.9358258502
6 8.9461611309 -1.2010062355
7 -2.1316636447 8.9461611309
8 -3.0997813127 -2.1316636447
9 -0.1485220392 -3.0997813127
10 -2.7516570621 -0.1485220392
11 -4.4246323922 -2.7516570621
12 2.2071205703 -4.4246323922
13 0.9142787989 2.2071205703
14 -3.2379874169 0.9142787989
15 0.5464478128 -3.2379874169
16 1.0843485961 0.5464478128
17 -2.2379874169 1.0843485961
18 -2.9891977152 -2.2379874169
19 0.6456553856 -2.9891977152
20 -5.6059325990 0.6456553856
21 1.8016650713 -5.6059325990
22 -0.8350784035 1.8016650713
23 1.5791424968 -0.8350784035
24 -2.0332370047 1.5791424968
25 -4.1597838679 -2.0332370047
26 -2.0107447665 -4.1597838679
27 2.0918355358 -2.0107447665
28 1.1480632021 2.0918355358
29 -0.1663256206 1.1480632021
30 -3.8172247639 -0.1663256206
31 2.4305696927 -3.8172247639
32 -2.7146572417 2.4305696927
33 -1.7408929498 -2.7146572417
34 -0.1054279366 -1.7408929498
35 -4.4077239396 -0.1054279366
36 7.6428885219 -4.4077239396
37 -1.3907513491 7.6428885219
38 -2.2840568366 -1.3907513491
39 -2.7408929498 -2.2840568366
40 -3.4738019502 -2.7408929498
41 1.1443197322 -3.4738019502
42 -5.0763625265 1.1443197322
43 0.8214860027 -5.0763625265
44 -1.9844962782 0.8214860027
45 -0.2379874169 -1.9844962782
46 -3.9414021757 -0.2379874169
47 -1.3571114781 -3.9414021757
48 2.4793604774 -1.3571114781
49 -1.8350597644 2.4793604774
50 -2.7567933772 -1.8350597644
51 0.9180222688 -2.7567933772
52 5.0192471916 0.9180222688
53 0.4766891706 5.0192471916
54 -1.3351481877 0.4766891706
55 -0.6724769069 -1.3351481877
56 0.1227726809 -0.6724769069
57 -4.1644538857 0.1227726809
58 -3.4685260667 -4.1644538857
59 1.7151435915 -3.4685260667
60 6.8852133888 1.7151435915
61 -0.9615752085 6.8852133888
62 -1.0454253814 -0.9615752085
63 0.9283389105 -1.0454253814
64 -0.5467610348 0.9283389105
65 -1.5796654717 -0.5467610348
66 4.5810142317 -1.5796654717
67 -1.0294935349 4.5810142317
68 -0.5814416497 -1.0294935349
69 1.0173754567 -0.5814416497
70 0.4109444345 1.0173754567
71 1.9452159440 0.4109444345
72 0.5556922914 1.9452159440
73 -2.4559983688 0.5556922914
74 -1.7024688650 -2.4559983688
75 6.1733851423 -1.7024688650
76 -0.3710760328 6.1733851423
77 4.0937072708 -0.3710760328
78 -0.0351087397 4.0937072708
79 -3.6049874120 -0.0351087397
80 -1.7891359599 -3.6049874120
81 -3.0838494662 -1.7891359599
82 -3.9259680456 -3.0838494662
83 -0.9376587058 -3.9259680456
84 -0.8875125417 -0.9376587058
85 0.0618435778 -0.8875125417
86 0.0168777402 0.0618435778
87 -1.2417308868 0.0168777402
88 2.5430564443 -1.2417308868
89 8.9508311487 2.5430564443
90 0.3312665629 8.9508311487
91 1.4654273418 0.3312665629
92 -0.2422286032 1.4654273418
93 2.0927807228 -0.2422286032
94 -2.9976298419 2.0927807228
95 -1.3290540932 -2.9976298419
96 3.6044330180 -1.3290540932
97 -1.4381947873 3.6044330180
98 -2.0491688513 -1.4381947873
99 -2.8753555842 -2.0491688513
100 -2.7853924900 -2.8753555842
101 2.7282771552 -2.7853924900
102 -0.9320435010 2.7282771552
103 -2.0407553636 -0.9320435010
104 3.2071205703 -2.0407553636
105 6.2216281524 3.2071205703
106 -1.9493868318 6.2216281524
107 3.2614765016 -1.9493868318
108 2.3359365807 3.2614765016
109 10.8318026445 2.3359365807
110 0.6448558137 10.8318026445
111 2.5074492814 0.6448558137
112 -1.8800442410 2.5074492814
113 2.3415517855 -1.8800442410
114 -1.4961672124 2.3415517855
115 -3.2347416635 -1.4961672124
116 0.9779934048 -3.2347416635
117 -0.1738125603 0.9779934048
118 -3.6996705821 -0.1738125603
119 1.9405459262 -3.6996705821
120 2.3987874770 1.9405459262
121 0.6954682752 2.3987874770
122 -1.8200731049 0.6954682752
123 -5.2829532544 -1.8200731049
124 -2.0566557910 -5.2829532544
125 -1.9713941337 -2.0566557910
126 -5.3110734776 -1.9713941337
127 -2.9826245433 -5.3110734776
128 -2.0604306800 -2.9826245433
129 0.6822391546 -2.0604306800
130 -1.8219448399 0.6822391546
131 6.8167973459 -1.8219448399
132 -3.1878726719 6.8167973459
133 1.7399678154 -3.1878726719
134 -0.9278397805 1.7399678154
135 1.3781041354 -0.9278397805
136 9.8824151059 1.3781041354
137 0.9376975851 9.8824151059
138 2.8852133888 0.9376975851
139 -1.7882094119 2.8852133888
140 -0.4555381181 -1.7882094119
141 -2.4265041271 -0.4555381181
142 1.4601014001 -2.4265041271
143 -0.9906091995 1.4601014001
144 -0.8650703616 -0.9906091995
145 -1.5581184204 -0.8650703616
146 -0.3899517773 -1.5581184204
147 -0.0004281247 -0.3899517773
148 -2.1653990727 -0.0004281247
149 6.1621233136 -2.1653990727
150 -0.9648209619 6.1621233136
151 4.4362349557 -0.9648209619
152 -3.0614842040 4.4362349557
153 -0.9090910121 -3.0614842040
154 6.1232389782 -0.9090910121
155 4.8336743794 6.1232389782
156 2.4268762810 4.8336743794
157 1.1639950486 2.4268762810
158 -1.2615832374 1.1639950486
> 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/7cg1h1290521368.ps",horizontal=F,pagecentre=F,paper="special",width=8.3194444444444,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/8cg1h1290521368.ps",horizontal=F,pagecentre=F,paper="special",width=8.3194444444444,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/9n7i11290521368.ps",horizontal=F,pagecentre=F,paper="special",width=8.3194444444444,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/10n7i11290521368.ps",horizontal=F,pagecentre=F,paper="special",width=8.3194444444444,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/118py71290521368.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/124ii81290521369.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/13tjx21290521369.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/14laen1290521369.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/157sua1290521369.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/1632aj1290521369.tab")
+ }
>
> try(system("convert tmp/1g63q1290521368.ps tmp/1g63q1290521368.png",intern=TRUE))
character(0)
> try(system("convert tmp/2g63q1290521368.ps tmp/2g63q1290521368.png",intern=TRUE))
character(0)
> try(system("convert tmp/39xkb1290521368.ps tmp/39xkb1290521368.png",intern=TRUE))
character(0)
> try(system("convert tmp/49xkb1290521368.ps tmp/49xkb1290521368.png",intern=TRUE))
character(0)
> try(system("convert tmp/59xkb1290521368.ps tmp/59xkb1290521368.png",intern=TRUE))
character(0)
> try(system("convert tmp/61o1e1290521368.ps tmp/61o1e1290521368.png",intern=TRUE))
character(0)
> try(system("convert tmp/7cg1h1290521368.ps tmp/7cg1h1290521368.png",intern=TRUE))
character(0)
> try(system("convert tmp/8cg1h1290521368.ps tmp/8cg1h1290521368.png",intern=TRUE))
character(0)
> try(system("convert tmp/9n7i11290521368.ps tmp/9n7i11290521368.png",intern=TRUE))
character(0)
> try(system("convert tmp/10n7i11290521368.ps tmp/10n7i11290521368.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.390 2.660 8.329