R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-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
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,1
+ ,3
+ ,1
+ ,1
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,1
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,1
+ ,1
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,1
+ ,1
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,1
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,0
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,1
+ ,3
+ ,0
+ ,0)
+ ,dim=c(3
+ ,154)
+ ,dimnames=list(c('T40'
+ ,'T20'
+ ,'CorrectAnalysis')
+ ,1:154))
> y <- array(NA,dim=c(3,154),dimnames=list(c('T40','T20','CorrectAnalysis'),1:154))
> 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 = '3'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '3'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date, as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
CorrectAnalysis T40 T20
1 0 1 3
2 0 0 3
3 0 0 3
4 0 0 3
5 0 0 3
6 0 0 3
7 0 0 3
8 0 1 3
9 0 0 3
10 0 0 3
11 0 1 3
12 0 0 3
13 0 0 3
14 0 1 3
15 0 0 3
16 0 1 3
17 1 1 3
18 0 1 3
19 0 0 3
20 1 1 3
21 0 0 3
22 0 0 3
23 0 0 3
24 0 0 3
25 0 1 3
26 0 0 3
27 0 0 3
28 0 0 3
29 0 0 3
30 0 0 3
31 0 0 3
32 0 0 3
33 0 0 3
34 0 1 3
35 0 0 3
36 0 0 3
37 0 1 3
38 0 0 3
39 0 0 3
40 0 1 3
41 1 0 3
42 0 0 3
43 0 0 3
44 0 1 3
45 0 0 3
46 0 0 3
47 0 0 3
48 0 0 3
49 0 0 3
50 0 0 3
51 0 1 3
52 1 1 3
53 0 0 3
54 1 0 3
55 0 0 3
56 0 1 3
57 0 0 3
58 0 0 3
59 0 0 3
60 1 1 3
61 0 1 3
62 0 0 3
63 0 0 3
64 0 1 3
65 0 0 3
66 0 0 3
67 1 1 3
68 0 0 3
69 0 0 3
70 0 0 3
71 0 0 3
72 0 0 3
73 0 0 3
74 0 0 3
75 0 0 3
76 0 1 3
77 0 0 3
78 0 0 3
79 1 1 3
80 0 1 3
81 0 0 3
82 0 0 3
83 0 0 3
84 1 0 3
85 0 0 3
86 0 0 3
87 0 3 0
88 0 3 1
89 0 3 0
90 0 3 0
91 0 3 0
92 0 3 1
93 0 3 0
94 0 3 0
95 0 3 1
96 0 3 0
97 0 3 1
98 0 3 0
99 0 3 0
100 0 3 0
101 0 3 0
102 0 3 0
103 0 3 0
104 0 3 0
105 0 3 1
106 0 3 0
107 0 3 0
108 0 3 1
109 0 3 0
110 0 3 0
111 0 3 1
112 0 3 1
113 0 3 0
114 0 3 1
115 0 3 0
116 0 3 0
117 0 3 0
118 0 3 0
119 0 3 0
120 0 3 0
121 0 3 0
122 0 3 0
123 0 3 1
124 0 3 0
125 0 3 0
126 0 3 1
127 0 3 0
128 0 3 0
129 0 3 0
130 0 3 0
131 0 3 0
132 0 3 0
133 0 3 0
134 0 3 0
135 0 3 0
136 0 3 0
137 0 3 0
138 0 3 1
139 0 3 1
140 0 3 0
141 1 3 0
142 0 3 1
143 0 3 0
144 0 3 0
145 0 3 0
146 0 3 1
147 0 3 1
148 0 3 1
149 0 3 0
150 0 3 0
151 0 3 0
152 1 3 0
153 1 3 0
154 0 3 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) T40 T20
-0.24205 0.09039 0.10457
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.16206 -0.07167 -0.07167 -0.02912 0.97088
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.24205 0.16112 -1.502 0.1351
T40 0.09039 0.04957 1.823 0.0702 .
T20 0.10457 0.04961 2.108 0.0367 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.2665 on 151 degrees of freedom
Multiple R-squared: 0.03069, Adjusted R-squared: 0.01786
F-statistic: 2.391 on 2 and 151 DF, p-value: 0.09502
> 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.0000000000 0.0000000000 1.0000000000
[2,] 0.0000000000 0.0000000000 1.0000000000
[3,] 0.0000000000 0.0000000000 1.0000000000
[4,] 0.0000000000 0.0000000000 1.0000000000
[5,] 0.0000000000 0.0000000000 1.0000000000
[6,] 0.0000000000 0.0000000000 1.0000000000
[7,] 0.0000000000 0.0000000000 1.0000000000
[8,] 0.0000000000 0.0000000000 1.0000000000
[9,] 0.0000000000 0.0000000000 1.0000000000
[10,] 0.0000000000 0.0000000000 1.0000000000
[11,] 0.0000000000 0.0000000000 1.0000000000
[12,] 0.3448685787 0.6897371573 0.6551314213
[13,] 0.2978228866 0.5956457732 0.7021771134
[14,] 0.2328112780 0.4656225560 0.7671887220
[15,] 0.7804406625 0.4391186749 0.2195593375
[16,] 0.7250139340 0.5499721320 0.2749860660
[17,] 0.6645608730 0.6708782540 0.3354391270
[18,] 0.6006008763 0.7987982473 0.3993991237
[19,] 0.5348640761 0.9302718477 0.4651359239
[20,] 0.5147586679 0.9704826643 0.4852413321
[21,] 0.4503149871 0.9006299742 0.5496850129
[22,] 0.3879984721 0.7759969441 0.6120015279
[23,] 0.3291979437 0.6583958874 0.6708020563
[24,] 0.2750093235 0.5500186470 0.7249906765
[25,] 0.2261948221 0.4523896443 0.7738051779
[26,] 0.1831774491 0.3663548982 0.8168225509
[27,] 0.1460656498 0.2921312997 0.8539343502
[28,] 0.1147000665 0.2294001330 0.8852999335
[29,] 0.1050010548 0.2100021095 0.8949989452
[30,] 0.0809945275 0.1619890550 0.9190054725
[31,] 0.0615678986 0.1231357971 0.9384321014
[32,] 0.0542812935 0.1085625869 0.9457187065
[33,] 0.0405071515 0.0810143030 0.9594928485
[34,] 0.0298120428 0.0596240856 0.9701879572
[35,] 0.0253631529 0.0507263059 0.9746368471
[36,] 0.4408638385 0.8817276769 0.5591361615
[37,] 0.3910313922 0.7820627844 0.6089686078
[38,] 0.3432917750 0.6865835499 0.6567082250
[39,] 0.3137654042 0.6275308085 0.6862345958
[40,] 0.2709379779 0.5418759557 0.7290620221
[41,] 0.2315464431 0.4630928862 0.7684535569
[42,] 0.1958487342 0.3916974684 0.8041512658
[43,] 0.1639642150 0.3279284299 0.8360357850
[44,] 0.1358860586 0.2717721172 0.8641139414
[45,] 0.1114991815 0.2229983631 0.8885008185
[46,] 0.0973475998 0.1946951997 0.9026524002
[47,] 0.4292879520 0.8585759040 0.5707120480
[48,] 0.3846619444 0.7693238888 0.6153380556
[49,] 0.8546684738 0.2906630524 0.1453315262
[50,] 0.8272928029 0.3454143942 0.1727071971
[51,] 0.8088920654 0.3822158692 0.1911079346
[52,] 0.7770143945 0.4459712110 0.2229856055
[53,] 0.7425666861 0.5148666277 0.2574333139
[54,] 0.7058450354 0.5883099293 0.2941549646
[55,] 0.9355261034 0.1289477933 0.0644738966
[56,] 0.9270988210 0.1458023580 0.0729011790
[57,] 0.9107467643 0.1785064714 0.0892532357
[58,] 0.8919782819 0.2160434361 0.1080217181
[59,] 0.8792864940 0.2414270120 0.1207135060
[60,] 0.8565652927 0.2868694146 0.1434347073
[61,] 0.8314357790 0.3371284421 0.1685642210
[62,] 0.9764690357 0.0470619286 0.0235309643
[63,] 0.9698462248 0.0603075504 0.0301537752
[64,] 0.9618465545 0.0763068910 0.0381534455
[65,] 0.9523379511 0.0953240977 0.0476620489
[66,] 0.9412262605 0.1175474789 0.0587737395
[67,] 0.9284774283 0.1430451435 0.0715225717
[68,] 0.9141465423 0.1717069153 0.0858534577
[69,] 0.8984171568 0.2031656865 0.1015828432
[70,] 0.8816576577 0.2366846847 0.1183423423
[71,] 0.8699851513 0.2600296974 0.1300148487
[72,] 0.8524974045 0.2950051910 0.1475025955
[73,] 0.8362975219 0.3274049562 0.1637024781
[74,] 0.9808976815 0.0382046370 0.0191023185
[75,] 0.9776380887 0.0447238227 0.0223619113
[76,] 0.9731020761 0.0537958478 0.0268979239
[77,] 0.9692100332 0.0615799337 0.0307899668
[78,] 0.9678669143 0.0642661714 0.0321330857
[79,] 0.9991981452 0.0016037097 0.0008018548
[80,] 0.9988023373 0.0023953255 0.0011976627
[81,] 0.9982330558 0.0035338885 0.0017669442
[82,] 0.9974551725 0.0050896549 0.0025448275
[83,] 0.9965284686 0.0069430629 0.0034715314
[84,] 0.9951569992 0.0096860017 0.0048430008
[85,] 0.9932837607 0.0134324786 0.0067162393
[86,] 0.9907795865 0.0184408270 0.0092204135
[87,] 0.9878686794 0.0242626412 0.0121313206
[88,] 0.9837334429 0.0325331143 0.0162665571
[89,] 0.9784185212 0.0431629576 0.0215814788
[90,] 0.9722710529 0.0554578942 0.0277289471
[91,] 0.9640312442 0.0719375115 0.0359687558
[92,] 0.9544625920 0.0910748161 0.0455374080
[93,] 0.9422232823 0.1155534355 0.0577767177
[94,] 0.9274739263 0.1450521474 0.0725260737
[95,] 0.9099423514 0.1801152972 0.0900576486
[96,] 0.8893882808 0.2212234383 0.1106117192
[97,] 0.8656206186 0.2687587628 0.1343793814
[98,] 0.8385148132 0.3229703736 0.1614851868
[99,] 0.8080290251 0.3839419498 0.1919709749
[100,] 0.7755605046 0.4488789907 0.2244394954
[101,] 0.7385955614 0.5228088772 0.2614044386
[102,] 0.6986805908 0.6026388185 0.3013194092
[103,] 0.6569140504 0.6861718993 0.3430859496
[104,] 0.6121768474 0.7756463052 0.3878231526
[105,] 0.5658485625 0.8683028751 0.4341514375
[106,] 0.5183585853 0.9632828295 0.4816414147
[107,] 0.4698355069 0.9396710138 0.5301644931
[108,] 0.4221915977 0.8443831955 0.5778084023
[109,] 0.3742832611 0.7485665222 0.6257167389
[110,] 0.3292276713 0.6584553427 0.6707723287
[111,] 0.2864773651 0.5729547302 0.7135226349
[112,] 0.2465293241 0.4930586483 0.7534706759
[113,] 0.2097682000 0.4195364000 0.7902318000
[114,] 0.1764564654 0.3529129308 0.8235435346
[115,] 0.1467324486 0.2934648973 0.8532675514
[116,] 0.1206158486 0.2412316971 0.8793841514
[117,] 0.0980196920 0.1960393839 0.9019803080
[118,] 0.0767782121 0.1535564242 0.9232217879
[119,] 0.0607006772 0.1214013544 0.9392993228
[120,] 0.0474449106 0.0948898212 0.9525550894
[121,] 0.0352005213 0.0704010425 0.9647994787
[122,] 0.0267204134 0.0534408268 0.9732795866
[123,] 0.0200666204 0.0401332408 0.9799333796
[124,] 0.0149245368 0.0298490736 0.9850754632
[125,] 0.0110091229 0.0220182459 0.9889908771
[126,] 0.0080702419 0.0161404838 0.9919297581
[127,] 0.0058947401 0.0117894802 0.9941052599
[128,] 0.0043059295 0.0086118590 0.9956940705
[129,] 0.0031612117 0.0063224235 0.9968387883
[130,] 0.0023485912 0.0046971824 0.9976514088
[131,] 0.0017828003 0.0035656006 0.9982171997
[132,] 0.0014017947 0.0028035895 0.9985982053
[133,] 0.0007897797 0.0015795594 0.9992102203
[134,] 0.0004259537 0.0008519074 0.9995740463
[135,] 0.0003345926 0.0006691852 0.9996654074
[136,] 0.0095668496 0.0191336991 0.9904331504
[137,] 0.0054024889 0.0108049779 0.9945975111
[138,] 0.0037909091 0.0075818183 0.9962090909
[139,] 0.0027920569 0.0055841137 0.9972079431
[140,] 0.0022718923 0.0045437846 0.9977281077
[141,] 0.0009989709 0.0019979417 0.9990010291
[142,] 0.0003879657 0.0007759314 0.9996120343
[143,] 0.0001278203 0.0002556406 0.9998721797
> postscript(file="/var/fisher/rcomp/tmp/1tkyt1356092924.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/fisher/rcomp/tmp/2teuj1356092924.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/fisher/rcomp/tmp/3jlig1356092924.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/fisher/rcomp/tmp/49bd51356092924.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/fisher/rcomp/tmp/508gh1356092924.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 = 154
Frequency = 1
1 2 3 4 5 6
-0.16205685 -0.07166870 -0.07166870 -0.07166870 -0.07166870 -0.07166870
7 8 9 10 11 12
-0.07166870 -0.16205685 -0.07166870 -0.07166870 -0.16205685 -0.07166870
13 14 15 16 17 18
-0.07166870 -0.16205685 -0.07166870 -0.16205685 0.83794315 -0.16205685
19 20 21 22 23 24
-0.07166870 0.83794315 -0.07166870 -0.07166870 -0.07166870 -0.07166870
25 26 27 28 29 30
-0.16205685 -0.07166870 -0.07166870 -0.07166870 -0.07166870 -0.07166870
31 32 33 34 35 36
-0.07166870 -0.07166870 -0.07166870 -0.16205685 -0.07166870 -0.07166870
37 38 39 40 41 42
-0.16205685 -0.07166870 -0.07166870 -0.16205685 0.92833130 -0.07166870
43 44 45 46 47 48
-0.07166870 -0.16205685 -0.07166870 -0.07166870 -0.07166870 -0.07166870
49 50 51 52 53 54
-0.07166870 -0.07166870 -0.16205685 0.83794315 -0.07166870 0.92833130
55 56 57 58 59 60
-0.07166870 -0.16205685 -0.07166870 -0.07166870 -0.07166870 0.83794315
61 62 63 64 65 66
-0.16205685 -0.07166870 -0.07166870 -0.16205685 -0.07166870 -0.07166870
67 68 69 70 71 72
0.83794315 -0.07166870 -0.07166870 -0.07166870 -0.07166870 -0.07166870
73 74 75 76 77 78
-0.07166870 -0.07166870 -0.07166870 -0.16205685 -0.07166870 -0.07166870
79 80 81 82 83 84
0.83794315 -0.16205685 -0.07166870 -0.07166870 -0.07166870 0.92833130
85 86 87 88 89 90
-0.07166870 -0.07166870 -0.02911513 -0.13368780 -0.02911513 -0.02911513
91 92 93 94 95 96
-0.02911513 -0.13368780 -0.02911513 -0.02911513 -0.13368780 -0.02911513
97 98 99 100 101 102
-0.13368780 -0.02911513 -0.02911513 -0.02911513 -0.02911513 -0.02911513
103 104 105 106 107 108
-0.02911513 -0.02911513 -0.13368780 -0.02911513 -0.02911513 -0.13368780
109 110 111 112 113 114
-0.02911513 -0.02911513 -0.13368780 -0.13368780 -0.02911513 -0.13368780
115 116 117 118 119 120
-0.02911513 -0.02911513 -0.02911513 -0.02911513 -0.02911513 -0.02911513
121 122 123 124 125 126
-0.02911513 -0.02911513 -0.13368780 -0.02911513 -0.02911513 -0.13368780
127 128 129 130 131 132
-0.02911513 -0.02911513 -0.02911513 -0.02911513 -0.02911513 -0.02911513
133 134 135 136 137 138
-0.02911513 -0.02911513 -0.02911513 -0.02911513 -0.02911513 -0.13368780
139 140 141 142 143 144
-0.13368780 -0.02911513 0.97088487 -0.13368780 -0.02911513 -0.02911513
145 146 147 148 149 150
-0.02911513 -0.13368780 -0.13368780 -0.13368780 -0.02911513 -0.02911513
151 152 153 154
-0.02911513 0.97088487 0.97088487 -0.02911513
> postscript(file="/var/fisher/rcomp/tmp/6nddk1356092924.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 = 154
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.16205685 NA
1 -0.07166870 -0.16205685
2 -0.07166870 -0.07166870
3 -0.07166870 -0.07166870
4 -0.07166870 -0.07166870
5 -0.07166870 -0.07166870
6 -0.07166870 -0.07166870
7 -0.16205685 -0.07166870
8 -0.07166870 -0.16205685
9 -0.07166870 -0.07166870
10 -0.16205685 -0.07166870
11 -0.07166870 -0.16205685
12 -0.07166870 -0.07166870
13 -0.16205685 -0.07166870
14 -0.07166870 -0.16205685
15 -0.16205685 -0.07166870
16 0.83794315 -0.16205685
17 -0.16205685 0.83794315
18 -0.07166870 -0.16205685
19 0.83794315 -0.07166870
20 -0.07166870 0.83794315
21 -0.07166870 -0.07166870
22 -0.07166870 -0.07166870
23 -0.07166870 -0.07166870
24 -0.16205685 -0.07166870
25 -0.07166870 -0.16205685
26 -0.07166870 -0.07166870
27 -0.07166870 -0.07166870
28 -0.07166870 -0.07166870
29 -0.07166870 -0.07166870
30 -0.07166870 -0.07166870
31 -0.07166870 -0.07166870
32 -0.07166870 -0.07166870
33 -0.16205685 -0.07166870
34 -0.07166870 -0.16205685
35 -0.07166870 -0.07166870
36 -0.16205685 -0.07166870
37 -0.07166870 -0.16205685
38 -0.07166870 -0.07166870
39 -0.16205685 -0.07166870
40 0.92833130 -0.16205685
41 -0.07166870 0.92833130
42 -0.07166870 -0.07166870
43 -0.16205685 -0.07166870
44 -0.07166870 -0.16205685
45 -0.07166870 -0.07166870
46 -0.07166870 -0.07166870
47 -0.07166870 -0.07166870
48 -0.07166870 -0.07166870
49 -0.07166870 -0.07166870
50 -0.16205685 -0.07166870
51 0.83794315 -0.16205685
52 -0.07166870 0.83794315
53 0.92833130 -0.07166870
54 -0.07166870 0.92833130
55 -0.16205685 -0.07166870
56 -0.07166870 -0.16205685
57 -0.07166870 -0.07166870
58 -0.07166870 -0.07166870
59 0.83794315 -0.07166870
60 -0.16205685 0.83794315
61 -0.07166870 -0.16205685
62 -0.07166870 -0.07166870
63 -0.16205685 -0.07166870
64 -0.07166870 -0.16205685
65 -0.07166870 -0.07166870
66 0.83794315 -0.07166870
67 -0.07166870 0.83794315
68 -0.07166870 -0.07166870
69 -0.07166870 -0.07166870
70 -0.07166870 -0.07166870
71 -0.07166870 -0.07166870
72 -0.07166870 -0.07166870
73 -0.07166870 -0.07166870
74 -0.07166870 -0.07166870
75 -0.16205685 -0.07166870
76 -0.07166870 -0.16205685
77 -0.07166870 -0.07166870
78 0.83794315 -0.07166870
79 -0.16205685 0.83794315
80 -0.07166870 -0.16205685
81 -0.07166870 -0.07166870
82 -0.07166870 -0.07166870
83 0.92833130 -0.07166870
84 -0.07166870 0.92833130
85 -0.07166870 -0.07166870
86 -0.02911513 -0.07166870
87 -0.13368780 -0.02911513
88 -0.02911513 -0.13368780
89 -0.02911513 -0.02911513
90 -0.02911513 -0.02911513
91 -0.13368780 -0.02911513
92 -0.02911513 -0.13368780
93 -0.02911513 -0.02911513
94 -0.13368780 -0.02911513
95 -0.02911513 -0.13368780
96 -0.13368780 -0.02911513
97 -0.02911513 -0.13368780
98 -0.02911513 -0.02911513
99 -0.02911513 -0.02911513
100 -0.02911513 -0.02911513
101 -0.02911513 -0.02911513
102 -0.02911513 -0.02911513
103 -0.02911513 -0.02911513
104 -0.13368780 -0.02911513
105 -0.02911513 -0.13368780
106 -0.02911513 -0.02911513
107 -0.13368780 -0.02911513
108 -0.02911513 -0.13368780
109 -0.02911513 -0.02911513
110 -0.13368780 -0.02911513
111 -0.13368780 -0.13368780
112 -0.02911513 -0.13368780
113 -0.13368780 -0.02911513
114 -0.02911513 -0.13368780
115 -0.02911513 -0.02911513
116 -0.02911513 -0.02911513
117 -0.02911513 -0.02911513
118 -0.02911513 -0.02911513
119 -0.02911513 -0.02911513
120 -0.02911513 -0.02911513
121 -0.02911513 -0.02911513
122 -0.13368780 -0.02911513
123 -0.02911513 -0.13368780
124 -0.02911513 -0.02911513
125 -0.13368780 -0.02911513
126 -0.02911513 -0.13368780
127 -0.02911513 -0.02911513
128 -0.02911513 -0.02911513
129 -0.02911513 -0.02911513
130 -0.02911513 -0.02911513
131 -0.02911513 -0.02911513
132 -0.02911513 -0.02911513
133 -0.02911513 -0.02911513
134 -0.02911513 -0.02911513
135 -0.02911513 -0.02911513
136 -0.02911513 -0.02911513
137 -0.13368780 -0.02911513
138 -0.13368780 -0.13368780
139 -0.02911513 -0.13368780
140 0.97088487 -0.02911513
141 -0.13368780 0.97088487
142 -0.02911513 -0.13368780
143 -0.02911513 -0.02911513
144 -0.02911513 -0.02911513
145 -0.13368780 -0.02911513
146 -0.13368780 -0.13368780
147 -0.13368780 -0.13368780
148 -0.02911513 -0.13368780
149 -0.02911513 -0.02911513
150 -0.02911513 -0.02911513
151 0.97088487 -0.02911513
152 0.97088487 0.97088487
153 -0.02911513 0.97088487
154 NA -0.02911513
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.07166870 -0.16205685
[2,] -0.07166870 -0.07166870
[3,] -0.07166870 -0.07166870
[4,] -0.07166870 -0.07166870
[5,] -0.07166870 -0.07166870
[6,] -0.07166870 -0.07166870
[7,] -0.16205685 -0.07166870
[8,] -0.07166870 -0.16205685
[9,] -0.07166870 -0.07166870
[10,] -0.16205685 -0.07166870
[11,] -0.07166870 -0.16205685
[12,] -0.07166870 -0.07166870
[13,] -0.16205685 -0.07166870
[14,] -0.07166870 -0.16205685
[15,] -0.16205685 -0.07166870
[16,] 0.83794315 -0.16205685
[17,] -0.16205685 0.83794315
[18,] -0.07166870 -0.16205685
[19,] 0.83794315 -0.07166870
[20,] -0.07166870 0.83794315
[21,] -0.07166870 -0.07166870
[22,] -0.07166870 -0.07166870
[23,] -0.07166870 -0.07166870
[24,] -0.16205685 -0.07166870
[25,] -0.07166870 -0.16205685
[26,] -0.07166870 -0.07166870
[27,] -0.07166870 -0.07166870
[28,] -0.07166870 -0.07166870
[29,] -0.07166870 -0.07166870
[30,] -0.07166870 -0.07166870
[31,] -0.07166870 -0.07166870
[32,] -0.07166870 -0.07166870
[33,] -0.16205685 -0.07166870
[34,] -0.07166870 -0.16205685
[35,] -0.07166870 -0.07166870
[36,] -0.16205685 -0.07166870
[37,] -0.07166870 -0.16205685
[38,] -0.07166870 -0.07166870
[39,] -0.16205685 -0.07166870
[40,] 0.92833130 -0.16205685
[41,] -0.07166870 0.92833130
[42,] -0.07166870 -0.07166870
[43,] -0.16205685 -0.07166870
[44,] -0.07166870 -0.16205685
[45,] -0.07166870 -0.07166870
[46,] -0.07166870 -0.07166870
[47,] -0.07166870 -0.07166870
[48,] -0.07166870 -0.07166870
[49,] -0.07166870 -0.07166870
[50,] -0.16205685 -0.07166870
[51,] 0.83794315 -0.16205685
[52,] -0.07166870 0.83794315
[53,] 0.92833130 -0.07166870
[54,] -0.07166870 0.92833130
[55,] -0.16205685 -0.07166870
[56,] -0.07166870 -0.16205685
[57,] -0.07166870 -0.07166870
[58,] -0.07166870 -0.07166870
[59,] 0.83794315 -0.07166870
[60,] -0.16205685 0.83794315
[61,] -0.07166870 -0.16205685
[62,] -0.07166870 -0.07166870
[63,] -0.16205685 -0.07166870
[64,] -0.07166870 -0.16205685
[65,] -0.07166870 -0.07166870
[66,] 0.83794315 -0.07166870
[67,] -0.07166870 0.83794315
[68,] -0.07166870 -0.07166870
[69,] -0.07166870 -0.07166870
[70,] -0.07166870 -0.07166870
[71,] -0.07166870 -0.07166870
[72,] -0.07166870 -0.07166870
[73,] -0.07166870 -0.07166870
[74,] -0.07166870 -0.07166870
[75,] -0.16205685 -0.07166870
[76,] -0.07166870 -0.16205685
[77,] -0.07166870 -0.07166870
[78,] 0.83794315 -0.07166870
[79,] -0.16205685 0.83794315
[80,] -0.07166870 -0.16205685
[81,] -0.07166870 -0.07166870
[82,] -0.07166870 -0.07166870
[83,] 0.92833130 -0.07166870
[84,] -0.07166870 0.92833130
[85,] -0.07166870 -0.07166870
[86,] -0.02911513 -0.07166870
[87,] -0.13368780 -0.02911513
[88,] -0.02911513 -0.13368780
[89,] -0.02911513 -0.02911513
[90,] -0.02911513 -0.02911513
[91,] -0.13368780 -0.02911513
[92,] -0.02911513 -0.13368780
[93,] -0.02911513 -0.02911513
[94,] -0.13368780 -0.02911513
[95,] -0.02911513 -0.13368780
[96,] -0.13368780 -0.02911513
[97,] -0.02911513 -0.13368780
[98,] -0.02911513 -0.02911513
[99,] -0.02911513 -0.02911513
[100,] -0.02911513 -0.02911513
[101,] -0.02911513 -0.02911513
[102,] -0.02911513 -0.02911513
[103,] -0.02911513 -0.02911513
[104,] -0.13368780 -0.02911513
[105,] -0.02911513 -0.13368780
[106,] -0.02911513 -0.02911513
[107,] -0.13368780 -0.02911513
[108,] -0.02911513 -0.13368780
[109,] -0.02911513 -0.02911513
[110,] -0.13368780 -0.02911513
[111,] -0.13368780 -0.13368780
[112,] -0.02911513 -0.13368780
[113,] -0.13368780 -0.02911513
[114,] -0.02911513 -0.13368780
[115,] -0.02911513 -0.02911513
[116,] -0.02911513 -0.02911513
[117,] -0.02911513 -0.02911513
[118,] -0.02911513 -0.02911513
[119,] -0.02911513 -0.02911513
[120,] -0.02911513 -0.02911513
[121,] -0.02911513 -0.02911513
[122,] -0.13368780 -0.02911513
[123,] -0.02911513 -0.13368780
[124,] -0.02911513 -0.02911513
[125,] -0.13368780 -0.02911513
[126,] -0.02911513 -0.13368780
[127,] -0.02911513 -0.02911513
[128,] -0.02911513 -0.02911513
[129,] -0.02911513 -0.02911513
[130,] -0.02911513 -0.02911513
[131,] -0.02911513 -0.02911513
[132,] -0.02911513 -0.02911513
[133,] -0.02911513 -0.02911513
[134,] -0.02911513 -0.02911513
[135,] -0.02911513 -0.02911513
[136,] -0.02911513 -0.02911513
[137,] -0.13368780 -0.02911513
[138,] -0.13368780 -0.13368780
[139,] -0.02911513 -0.13368780
[140,] 0.97088487 -0.02911513
[141,] -0.13368780 0.97088487
[142,] -0.02911513 -0.13368780
[143,] -0.02911513 -0.02911513
[144,] -0.02911513 -0.02911513
[145,] -0.13368780 -0.02911513
[146,] -0.13368780 -0.13368780
[147,] -0.13368780 -0.13368780
[148,] -0.02911513 -0.13368780
[149,] -0.02911513 -0.02911513
[150,] -0.02911513 -0.02911513
[151,] 0.97088487 -0.02911513
[152,] 0.97088487 0.97088487
[153,] -0.02911513 0.97088487
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.07166870 -0.16205685
2 -0.07166870 -0.07166870
3 -0.07166870 -0.07166870
4 -0.07166870 -0.07166870
5 -0.07166870 -0.07166870
6 -0.07166870 -0.07166870
7 -0.16205685 -0.07166870
8 -0.07166870 -0.16205685
9 -0.07166870 -0.07166870
10 -0.16205685 -0.07166870
11 -0.07166870 -0.16205685
12 -0.07166870 -0.07166870
13 -0.16205685 -0.07166870
14 -0.07166870 -0.16205685
15 -0.16205685 -0.07166870
16 0.83794315 -0.16205685
17 -0.16205685 0.83794315
18 -0.07166870 -0.16205685
19 0.83794315 -0.07166870
20 -0.07166870 0.83794315
21 -0.07166870 -0.07166870
22 -0.07166870 -0.07166870
23 -0.07166870 -0.07166870
24 -0.16205685 -0.07166870
25 -0.07166870 -0.16205685
26 -0.07166870 -0.07166870
27 -0.07166870 -0.07166870
28 -0.07166870 -0.07166870
29 -0.07166870 -0.07166870
30 -0.07166870 -0.07166870
31 -0.07166870 -0.07166870
32 -0.07166870 -0.07166870
33 -0.16205685 -0.07166870
34 -0.07166870 -0.16205685
35 -0.07166870 -0.07166870
36 -0.16205685 -0.07166870
37 -0.07166870 -0.16205685
38 -0.07166870 -0.07166870
39 -0.16205685 -0.07166870
40 0.92833130 -0.16205685
41 -0.07166870 0.92833130
42 -0.07166870 -0.07166870
43 -0.16205685 -0.07166870
44 -0.07166870 -0.16205685
45 -0.07166870 -0.07166870
46 -0.07166870 -0.07166870
47 -0.07166870 -0.07166870
48 -0.07166870 -0.07166870
49 -0.07166870 -0.07166870
50 -0.16205685 -0.07166870
51 0.83794315 -0.16205685
52 -0.07166870 0.83794315
53 0.92833130 -0.07166870
54 -0.07166870 0.92833130
55 -0.16205685 -0.07166870
56 -0.07166870 -0.16205685
57 -0.07166870 -0.07166870
58 -0.07166870 -0.07166870
59 0.83794315 -0.07166870
60 -0.16205685 0.83794315
61 -0.07166870 -0.16205685
62 -0.07166870 -0.07166870
63 -0.16205685 -0.07166870
64 -0.07166870 -0.16205685
65 -0.07166870 -0.07166870
66 0.83794315 -0.07166870
67 -0.07166870 0.83794315
68 -0.07166870 -0.07166870
69 -0.07166870 -0.07166870
70 -0.07166870 -0.07166870
71 -0.07166870 -0.07166870
72 -0.07166870 -0.07166870
73 -0.07166870 -0.07166870
74 -0.07166870 -0.07166870
75 -0.16205685 -0.07166870
76 -0.07166870 -0.16205685
77 -0.07166870 -0.07166870
78 0.83794315 -0.07166870
79 -0.16205685 0.83794315
80 -0.07166870 -0.16205685
81 -0.07166870 -0.07166870
82 -0.07166870 -0.07166870
83 0.92833130 -0.07166870
84 -0.07166870 0.92833130
85 -0.07166870 -0.07166870
86 -0.02911513 -0.07166870
87 -0.13368780 -0.02911513
88 -0.02911513 -0.13368780
89 -0.02911513 -0.02911513
90 -0.02911513 -0.02911513
91 -0.13368780 -0.02911513
92 -0.02911513 -0.13368780
93 -0.02911513 -0.02911513
94 -0.13368780 -0.02911513
95 -0.02911513 -0.13368780
96 -0.13368780 -0.02911513
97 -0.02911513 -0.13368780
98 -0.02911513 -0.02911513
99 -0.02911513 -0.02911513
100 -0.02911513 -0.02911513
101 -0.02911513 -0.02911513
102 -0.02911513 -0.02911513
103 -0.02911513 -0.02911513
104 -0.13368780 -0.02911513
105 -0.02911513 -0.13368780
106 -0.02911513 -0.02911513
107 -0.13368780 -0.02911513
108 -0.02911513 -0.13368780
109 -0.02911513 -0.02911513
110 -0.13368780 -0.02911513
111 -0.13368780 -0.13368780
112 -0.02911513 -0.13368780
113 -0.13368780 -0.02911513
114 -0.02911513 -0.13368780
115 -0.02911513 -0.02911513
116 -0.02911513 -0.02911513
117 -0.02911513 -0.02911513
118 -0.02911513 -0.02911513
119 -0.02911513 -0.02911513
120 -0.02911513 -0.02911513
121 -0.02911513 -0.02911513
122 -0.13368780 -0.02911513
123 -0.02911513 -0.13368780
124 -0.02911513 -0.02911513
125 -0.13368780 -0.02911513
126 -0.02911513 -0.13368780
127 -0.02911513 -0.02911513
128 -0.02911513 -0.02911513
129 -0.02911513 -0.02911513
130 -0.02911513 -0.02911513
131 -0.02911513 -0.02911513
132 -0.02911513 -0.02911513
133 -0.02911513 -0.02911513
134 -0.02911513 -0.02911513
135 -0.02911513 -0.02911513
136 -0.02911513 -0.02911513
137 -0.13368780 -0.02911513
138 -0.13368780 -0.13368780
139 -0.02911513 -0.13368780
140 0.97088487 -0.02911513
141 -0.13368780 0.97088487
142 -0.02911513 -0.13368780
143 -0.02911513 -0.02911513
144 -0.02911513 -0.02911513
145 -0.13368780 -0.02911513
146 -0.13368780 -0.13368780
147 -0.13368780 -0.13368780
148 -0.02911513 -0.13368780
149 -0.02911513 -0.02911513
150 -0.02911513 -0.02911513
151 0.97088487 -0.02911513
152 0.97088487 0.97088487
153 -0.02911513 0.97088487
> 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/fisher/rcomp/tmp/7v03x1356092924.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/fisher/rcomp/tmp/81chs1356092924.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/fisher/rcomp/tmp/9iqv81356092924.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/fisher/rcomp/tmp/10lcn41356092924.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/fisher/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/fisher/rcomp/tmp/119wxs1356092924.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/fisher/rcomp/tmp/12gq0x1356092924.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/fisher/rcomp/tmp/13oqu91356092924.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/fisher/rcomp/tmp/1450f61356092924.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/fisher/rcomp/tmp/15omng1356092924.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/fisher/rcomp/tmp/16st8f1356092924.tab")
+ }
>
> try(system("convert tmp/1tkyt1356092924.ps tmp/1tkyt1356092924.png",intern=TRUE))
character(0)
> try(system("convert tmp/2teuj1356092924.ps tmp/2teuj1356092924.png",intern=TRUE))
character(0)
> try(system("convert tmp/3jlig1356092924.ps tmp/3jlig1356092924.png",intern=TRUE))
character(0)
> try(system("convert tmp/49bd51356092924.ps tmp/49bd51356092924.png",intern=TRUE))
character(0)
> try(system("convert tmp/508gh1356092924.ps tmp/508gh1356092924.png",intern=TRUE))
character(0)
> try(system("convert tmp/6nddk1356092924.ps tmp/6nddk1356092924.png",intern=TRUE))
character(0)
> try(system("convert tmp/7v03x1356092924.ps tmp/7v03x1356092924.png",intern=TRUE))
character(0)
> try(system("convert tmp/81chs1356092924.ps tmp/81chs1356092924.png",intern=TRUE))
character(0)
> try(system("convert tmp/9iqv81356092924.ps tmp/9iqv81356092924.png",intern=TRUE))
character(0)
> try(system("convert tmp/10lcn41356092924.ps tmp/10lcn41356092924.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.456 1.752 9.253