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(4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,1
+ ,1
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,1
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,1
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,1
+ ,1
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,1
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,1
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,1
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,1
+ ,1
+ ,4
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,1
+ ,4
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,1
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,2
+ ,0
+ ,1
+ ,2
+ ,0
+ ,1
+ ,2
+ ,0
+ ,0)
+ ,dim=c(3
+ ,154)
+ ,dimnames=list(c('Weeks'
+ ,'Treatment'
+ ,'Difference')
+ ,1:154))
> y <- array(NA,dim=c(3,154),dimnames=list(c('Weeks','Treatment','Difference'),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 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '3'
> par3 <- '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
Difference Weeks Treatment t
1 0 4 1 1
2 0 4 0 2
3 0 4 0 3
4 0 4 0 4
5 0 4 0 5
6 0 4 0 6
7 0 4 0 7
8 0 4 1 8
9 0 4 0 9
10 0 4 0 10
11 0 4 1 11
12 0 4 0 12
13 0 4 0 13
14 0 4 1 14
15 0 4 0 15
16 0 4 1 16
17 1 4 1 17
18 0 4 1 18
19 0 4 0 19
20 1 4 1 20
21 0 4 0 21
22 0 4 0 22
23 0 4 0 23
24 0 4 0 24
25 0 4 1 25
26 0 4 0 26
27 0 4 0 27
28 0 4 0 28
29 0 4 0 29
30 0 4 0 30
31 0 4 0 31
32 0 4 0 32
33 0 4 0 33
34 0 4 1 34
35 0 4 0 35
36 0 4 0 36
37 0 4 1 37
38 0 4 0 38
39 0 4 0 39
40 0 4 1 40
41 1 4 0 41
42 0 4 0 42
43 0 4 0 43
44 0 4 1 44
45 0 4 0 45
46 0 4 0 46
47 0 4 0 47
48 0 4 0 48
49 0 4 0 49
50 0 4 0 50
51 0 4 1 51
52 1 4 1 52
53 0 4 0 53
54 1 4 0 54
55 0 4 0 55
56 0 4 1 56
57 0 4 0 57
58 0 4 0 58
59 0 4 0 59
60 1 4 1 60
61 0 4 1 61
62 0 4 0 62
63 0 4 0 63
64 0 4 1 64
65 0 4 0 65
66 0 4 0 66
67 1 4 1 67
68 0 4 0 68
69 0 4 0 69
70 0 4 0 70
71 0 4 0 71
72 0 4 0 72
73 0 4 0 73
74 0 4 0 74
75 0 4 0 75
76 0 4 1 76
77 0 4 0 77
78 0 4 0 78
79 1 4 1 79
80 0 4 1 80
81 0 4 0 81
82 0 4 0 82
83 0 4 0 83
84 1 4 0 84
85 0 4 0 85
86 0 4 0 86
87 0 2 0 87
88 0 2 1 88
89 0 2 0 89
90 0 2 0 90
91 0 2 0 91
92 0 2 1 92
93 0 2 0 93
94 0 2 0 94
95 0 2 1 95
96 0 2 0 96
97 0 2 1 97
98 0 2 0 98
99 0 2 0 99
100 0 2 0 100
101 0 2 0 101
102 0 2 0 102
103 0 2 0 103
104 0 2 0 104
105 0 2 1 105
106 0 2 0 106
107 0 2 0 107
108 0 2 1 108
109 0 2 0 109
110 0 2 0 110
111 0 2 1 111
112 0 2 1 112
113 0 2 0 113
114 0 2 1 114
115 0 2 0 115
116 0 2 0 116
117 0 2 0 117
118 0 2 0 118
119 0 2 0 119
120 0 2 0 120
121 0 2 0 121
122 0 2 0 122
123 0 2 1 123
124 0 2 0 124
125 0 2 0 125
126 0 2 1 126
127 0 2 0 127
128 0 2 0 128
129 0 2 0 129
130 0 2 0 130
131 0 2 0 131
132 0 2 0 132
133 0 2 0 133
134 0 2 0 134
135 0 2 0 135
136 0 2 0 136
137 0 2 0 137
138 0 2 1 138
139 0 2 1 139
140 0 2 0 140
141 1 2 0 141
142 0 2 1 142
143 0 2 0 143
144 0 2 0 144
145 0 2 0 145
146 0 2 1 146
147 0 2 1 147
148 0 2 1 148
149 0 2 0 149
150 0 2 0 150
151 0 2 0 151
152 1 2 0 152
153 1 2 0 153
154 0 2 0 154
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Weeks Treatment t
-0.479003 0.114897 0.102581 0.002221
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.26088 -0.11861 -0.05643 -0.00366 0.93599
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.479003 0.197456 -2.426 0.01646 *
Weeks 0.114897 0.041637 2.759 0.00651 **
Treatment 0.102581 0.048157 2.130 0.03479 *
t 0.002221 0.000931 2.386 0.01828 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.2616 on 150 degrees of freedom
Multiple R-squared: 0.07246, Adjusted R-squared: 0.05391
F-statistic: 3.906 on 3 and 150 DF, p-value: 0.01011
> 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.3440363214 0.6880726427 0.6559636786
[12,] 0.3321223323 0.6642446647 0.6678776677
[13,] 0.2734414325 0.5468828650 0.7265585675
[14,] 0.7453440909 0.5093118183 0.2546559091
[15,] 0.7123846645 0.5752306710 0.2876153355
[16,] 0.6690703124 0.6618593753 0.3309296876
[17,] 0.6187585437 0.7624829125 0.3812414563
[18,] 0.5637321741 0.8725356517 0.4362678259
[19,] 0.5820866281 0.8358267438 0.4179133719
[20,] 0.5211905186 0.9576189627 0.4788094814
[21,] 0.4596940937 0.9193881875 0.5403059063
[22,] 0.3992731993 0.7985463985 0.6007268007
[23,] 0.3414203864 0.6828407729 0.6585796136
[24,] 0.2873718086 0.5747436172 0.7126281914
[25,] 0.2380564954 0.4761129909 0.7619435046
[26,] 0.1940750667 0.3881501334 0.8059249333
[27,] 0.1557079623 0.3114159246 0.8442920377
[28,] 0.1506213630 0.3012427261 0.8493786370
[29,] 0.1185112020 0.2370224039 0.8814887980
[30,] 0.0918009316 0.1836018633 0.9081990684
[31,] 0.0825401049 0.1650802098 0.9174598951
[32,] 0.0626543531 0.1253087062 0.9373456469
[33,] 0.0468562745 0.0937125489 0.9531437255
[34,] 0.0397276356 0.0794552711 0.9602723644
[35,] 0.5157080718 0.9685838564 0.4842919282
[36,] 0.4667744358 0.9335488716 0.5332255642
[37,] 0.4181712064 0.8363424128 0.5818287936
[38,] 0.3938546479 0.7877092959 0.6061453521
[39,] 0.3468231862 0.6936463723 0.6531768138
[40,] 0.3021432053 0.6042864106 0.6978567947
[41,] 0.2603889730 0.5207779461 0.7396110270
[42,] 0.2219914705 0.4439829411 0.7780085295
[43,] 0.1872318694 0.3744637388 0.8127681306
[44,] 0.1562451792 0.3124903584 0.8437548208
[45,] 0.1395346430 0.2790692861 0.8604653570
[46,] 0.4957145831 0.9914291662 0.5042854169
[47,] 0.4508440055 0.9016880109 0.5491559945
[48,] 0.8774437470 0.2451125059 0.1225562530
[49,] 0.8564384035 0.2871231929 0.1435615965
[50,] 0.8505522649 0.2988954702 0.1494477351
[51,] 0.8256173442 0.3487653116 0.1743826558
[52,] 0.7979973195 0.4040053609 0.2020026805
[53,] 0.7677973472 0.4644053056 0.2322026528
[54,] 0.9492352090 0.1015295819 0.0507647910
[55,] 0.9476336573 0.1047326853 0.0523663427
[56,] 0.9361575124 0.1276849752 0.0638424876
[57,] 0.9227485747 0.1545028507 0.0772514253
[58,] 0.9181086894 0.1637826212 0.0818913106
[59,] 0.9018099349 0.1963801302 0.0981900651
[60,] 0.8833694816 0.2332610367 0.1166305184
[61,] 0.9851068457 0.0297863085 0.0148931543
[62,] 0.9809792201 0.0380415598 0.0190207799
[63,] 0.9759254342 0.0481491316 0.0240745658
[64,] 0.9698275889 0.0603448222 0.0301724111
[65,] 0.9625869005 0.0748261989 0.0374130995
[66,] 0.9541409096 0.0917181808 0.0458590904
[67,] 0.9444867423 0.1110265154 0.0555132577
[68,] 0.9337125522 0.1325748956 0.0662874478
[69,] 0.9220407987 0.1559184026 0.0779592013
[70,] 0.9190589004 0.1618821991 0.0809410996
[71,] 0.9075146834 0.1849706332 0.0924853166
[72,] 0.8969358517 0.2061282966 0.1030641483
[73,] 0.9884742692 0.0230514616 0.0115257308
[74,] 0.9874329173 0.0251341655 0.0125670827
[75,] 0.9847483503 0.0305032993 0.0152516497
[76,] 0.9824871708 0.0350256584 0.0175128292
[77,] 0.9819169822 0.0361660356 0.0180830178
[78,] 0.9996645961 0.0006708077 0.0003354039
[79,] 0.9994980381 0.0010039238 0.0005019619
[80,] 0.9992550888 0.0014898224 0.0007449112
[81,] 0.9988881338 0.0022237324 0.0011118662
[82,] 0.9984995474 0.0030009052 0.0015004526
[83,] 0.9978359989 0.0043280022 0.0021640011
[84,] 0.9968937671 0.0062124657 0.0031062329
[85,] 0.9955822147 0.0088355706 0.0044177853
[86,] 0.9942620614 0.0114758772 0.0057379386
[87,] 0.9920272907 0.0159454186 0.0079727093
[88,] 0.9890339466 0.0219321067 0.0109660534
[89,] 0.9861315802 0.0277368395 0.0138684198
[90,] 0.9813370488 0.0373259024 0.0186629512
[91,] 0.9768640439 0.0462719121 0.0231359561
[92,] 0.9695170430 0.0609659140 0.0304829570
[93,] 0.9602594965 0.0794810070 0.0397405035
[94,] 0.9487507396 0.1024985207 0.0512492604
[95,] 0.9346373028 0.1307253943 0.0653626972
[96,] 0.9175676111 0.1648647778 0.0824323889
[97,] 0.8972104205 0.2055791590 0.1027895795
[98,] 0.8732764384 0.2534471232 0.1267235616
[99,] 0.8533746359 0.2932507282 0.1466253641
[100,] 0.8228619369 0.3542761261 0.1771380631
[101,] 0.7883818968 0.4232362064 0.2116181032
[102,] 0.7612908525 0.4774182950 0.2387091475
[103,] 0.7203591824 0.5592816351 0.2796408176
[104,] 0.6759538264 0.6480923471 0.3240461736
[105,] 0.6434562600 0.7130874801 0.3565437400
[106,] 0.6130009992 0.7739980016 0.3869990008
[107,] 0.5630098727 0.8739802546 0.4369901273
[108,] 0.5360919446 0.9278161108 0.4639080554
[109,] 0.4846607511 0.9693215022 0.5153392489
[110,] 0.4329319252 0.8658638505 0.5670680748
[111,] 0.3817648142 0.7635296284 0.6182351858
[112,] 0.3320194019 0.6640388039 0.6679805981
[113,] 0.2845136676 0.5690273352 0.7154863324
[114,] 0.2399818659 0.4799637317 0.7600181341
[115,] 0.1990371883 0.3980743766 0.8009628117
[116,] 0.1621420810 0.3242841619 0.8378579190
[117,] 0.1442135725 0.2884271450 0.8557864275
[118,] 0.1141965630 0.2283931260 0.8858034370
[119,] 0.0885333571 0.1770667143 0.9114666429
[120,] 0.0791198834 0.1582397668 0.9208801166
[121,] 0.0595247122 0.1190494244 0.9404752878
[122,] 0.0436685399 0.0873370798 0.9563314601
[123,] 0.0311846074 0.0623692148 0.9688153926
[124,] 0.0216404561 0.0432809123 0.9783595439
[125,] 0.0145704193 0.0291408385 0.9854295807
[126,] 0.0095072661 0.0190145322 0.9904927339
[127,] 0.0060100680 0.0120201359 0.9939899320
[128,] 0.0036858676 0.0073717353 0.9963141324
[129,] 0.0022036733 0.0044073466 0.9977963267
[130,] 0.0013006361 0.0026012722 0.9986993639
[131,] 0.0007823025 0.0015646050 0.9992176975
[132,] 0.0004362406 0.0008724812 0.9995637594
[133,] 0.0002341005 0.0004682011 0.9997658995
[134,] 0.0001427624 0.0002855248 0.9998572376
[135,] 0.0229572638 0.0459145276 0.9770427362
[136,] 0.0169774062 0.0339548123 0.9830225938
[137,] 0.0099224482 0.0198448965 0.9900775518
[138,] 0.0054392170 0.0108784340 0.9945607830
[139,] 0.0030673422 0.0061346844 0.9969326578
[140,] 0.0014371087 0.0028742174 0.9985628913
[141,] 0.0005365976 0.0010731952 0.9994634024
> postscript(file="/var/fisher/rcomp/tmp/1q4xw1356097571.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/2gg7p1356097571.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/34mdf1356097571.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/4cqg81356097571.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/5qff51356097571.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
-0.0853874026 0.0149724718 0.0127510476 0.0105296235 0.0083081994
6 7 8 9 10
0.0060867753 0.0038653511 -0.1009373715 -0.0005774971 -0.0027989212
11 12 13 14 15
-0.1076016439 -0.0072417695 -0.0094631936 -0.1142659162 -0.0139060419
16 17 18 19 20
-0.1187087645 0.8790698114 -0.1231516127 -0.0227917384 0.8724055390
21 22 23 24 25
-0.0272345866 -0.0294560108 -0.0316774349 -0.0338988590 -0.1387015816
26 27 28 29 30
-0.0383417073 -0.0405631314 -0.0427845555 -0.0450059796 -0.0472274038
31 32 33 34 35
-0.0494488279 -0.0516702520 -0.0538916761 -0.1586943988 -0.0583345244
36 37 38 39 40
-0.0605559485 -0.1653586711 -0.0649987968 -0.0672202209 -0.1720229435
41 42 43 44 45
0.9283369308 -0.0738844933 -0.0761059174 -0.1809086400 -0.0805487657
46 47 48 49 50
-0.0827701898 -0.0849916139 -0.0872130380 -0.0894344622 -0.0916558863
51 52 53 54 55
-0.1964586089 0.8013199670 -0.0983201587 0.8994584172 -0.1027630069
56 57 58 59 60
-0.2075657295 -0.1072058552 -0.1094272793 -0.1116487034 0.7835485740
61 62 63 64 65
-0.2186728502 -0.1183129758 -0.1205343999 -0.2253371226 -0.1249772482
66 67 68 69 70
-0.1271986723 0.7679986051 -0.1316415206 -0.1338629447 -0.1360843688
71 72 73 74 75
-0.1383057929 -0.1405272171 -0.1427486412 -0.1449700653 -0.1471914895
76 77 78 79 80
-0.2519942121 -0.1516343377 -0.1538557618 0.7413415156 -0.2608799086
81 82 83 84 85
-0.1605200342 -0.1627414583 -0.1649628825 0.8328156934 -0.1694057307
86 87 88 89 90
-0.1716271548 0.0559453858 -0.0488573368 0.0515025375 0.0492811134
91 92 93 94 95
0.0470596893 -0.0577430333 0.0426168410 0.0403954169 -0.0644073057
96 97 98 99 100
0.0359525687 -0.0688501540 0.0315097204 0.0292882963 0.0270668722
101 102 103 104 105
0.0248454480 0.0226240239 0.0204025998 0.0181811756 -0.0866215470
106 107 108 109 110
0.0137383274 0.0115169033 -0.0932858193 0.0070740550 0.0048526309
111 112 113 114 115
-0.0999500917 -0.1021715159 -0.0018116415 -0.1066143641 -0.0062544897
116 117 118 119 120
-0.0084759139 -0.0106973380 -0.0129187621 -0.0151401862 -0.0173616104
121 122 123 124 125
-0.0195830345 -0.0218044586 -0.1266071812 -0.0262473069 -0.0284687310
126 127 128 129 130
-0.1332714536 -0.0329115793 -0.0351330034 -0.0373544275 -0.0395758516
131 132 133 134 135
-0.0417972758 -0.0440186999 -0.0462401240 -0.0484615481 -0.0506829723
136 137 138 139 140
-0.0529043964 -0.0551258205 -0.1599285431 -0.1621499673 -0.0617900929
141 142 143 144 145
0.9359884830 -0.1688142396 -0.0684543653 -0.0706757894 -0.0728972135
146 147 148 149 150
-0.1776999361 -0.1799213603 -0.1821427844 -0.0817829100 -0.0840043342
151 152 153 154
-0.0862257583 0.9115528176 0.9093313935 -0.0928900307
> postscript(file="/var/fisher/rcomp/tmp/6w7781356097571.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.0853874026 NA
1 0.0149724718 -0.0853874026
2 0.0127510476 0.0149724718
3 0.0105296235 0.0127510476
4 0.0083081994 0.0105296235
5 0.0060867753 0.0083081994
6 0.0038653511 0.0060867753
7 -0.1009373715 0.0038653511
8 -0.0005774971 -0.1009373715
9 -0.0027989212 -0.0005774971
10 -0.1076016439 -0.0027989212
11 -0.0072417695 -0.1076016439
12 -0.0094631936 -0.0072417695
13 -0.1142659162 -0.0094631936
14 -0.0139060419 -0.1142659162
15 -0.1187087645 -0.0139060419
16 0.8790698114 -0.1187087645
17 -0.1231516127 0.8790698114
18 -0.0227917384 -0.1231516127
19 0.8724055390 -0.0227917384
20 -0.0272345866 0.8724055390
21 -0.0294560108 -0.0272345866
22 -0.0316774349 -0.0294560108
23 -0.0338988590 -0.0316774349
24 -0.1387015816 -0.0338988590
25 -0.0383417073 -0.1387015816
26 -0.0405631314 -0.0383417073
27 -0.0427845555 -0.0405631314
28 -0.0450059796 -0.0427845555
29 -0.0472274038 -0.0450059796
30 -0.0494488279 -0.0472274038
31 -0.0516702520 -0.0494488279
32 -0.0538916761 -0.0516702520
33 -0.1586943988 -0.0538916761
34 -0.0583345244 -0.1586943988
35 -0.0605559485 -0.0583345244
36 -0.1653586711 -0.0605559485
37 -0.0649987968 -0.1653586711
38 -0.0672202209 -0.0649987968
39 -0.1720229435 -0.0672202209
40 0.9283369308 -0.1720229435
41 -0.0738844933 0.9283369308
42 -0.0761059174 -0.0738844933
43 -0.1809086400 -0.0761059174
44 -0.0805487657 -0.1809086400
45 -0.0827701898 -0.0805487657
46 -0.0849916139 -0.0827701898
47 -0.0872130380 -0.0849916139
48 -0.0894344622 -0.0872130380
49 -0.0916558863 -0.0894344622
50 -0.1964586089 -0.0916558863
51 0.8013199670 -0.1964586089
52 -0.0983201587 0.8013199670
53 0.8994584172 -0.0983201587
54 -0.1027630069 0.8994584172
55 -0.2075657295 -0.1027630069
56 -0.1072058552 -0.2075657295
57 -0.1094272793 -0.1072058552
58 -0.1116487034 -0.1094272793
59 0.7835485740 -0.1116487034
60 -0.2186728502 0.7835485740
61 -0.1183129758 -0.2186728502
62 -0.1205343999 -0.1183129758
63 -0.2253371226 -0.1205343999
64 -0.1249772482 -0.2253371226
65 -0.1271986723 -0.1249772482
66 0.7679986051 -0.1271986723
67 -0.1316415206 0.7679986051
68 -0.1338629447 -0.1316415206
69 -0.1360843688 -0.1338629447
70 -0.1383057929 -0.1360843688
71 -0.1405272171 -0.1383057929
72 -0.1427486412 -0.1405272171
73 -0.1449700653 -0.1427486412
74 -0.1471914895 -0.1449700653
75 -0.2519942121 -0.1471914895
76 -0.1516343377 -0.2519942121
77 -0.1538557618 -0.1516343377
78 0.7413415156 -0.1538557618
79 -0.2608799086 0.7413415156
80 -0.1605200342 -0.2608799086
81 -0.1627414583 -0.1605200342
82 -0.1649628825 -0.1627414583
83 0.8328156934 -0.1649628825
84 -0.1694057307 0.8328156934
85 -0.1716271548 -0.1694057307
86 0.0559453858 -0.1716271548
87 -0.0488573368 0.0559453858
88 0.0515025375 -0.0488573368
89 0.0492811134 0.0515025375
90 0.0470596893 0.0492811134
91 -0.0577430333 0.0470596893
92 0.0426168410 -0.0577430333
93 0.0403954169 0.0426168410
94 -0.0644073057 0.0403954169
95 0.0359525687 -0.0644073057
96 -0.0688501540 0.0359525687
97 0.0315097204 -0.0688501540
98 0.0292882963 0.0315097204
99 0.0270668722 0.0292882963
100 0.0248454480 0.0270668722
101 0.0226240239 0.0248454480
102 0.0204025998 0.0226240239
103 0.0181811756 0.0204025998
104 -0.0866215470 0.0181811756
105 0.0137383274 -0.0866215470
106 0.0115169033 0.0137383274
107 -0.0932858193 0.0115169033
108 0.0070740550 -0.0932858193
109 0.0048526309 0.0070740550
110 -0.0999500917 0.0048526309
111 -0.1021715159 -0.0999500917
112 -0.0018116415 -0.1021715159
113 -0.1066143641 -0.0018116415
114 -0.0062544897 -0.1066143641
115 -0.0084759139 -0.0062544897
116 -0.0106973380 -0.0084759139
117 -0.0129187621 -0.0106973380
118 -0.0151401862 -0.0129187621
119 -0.0173616104 -0.0151401862
120 -0.0195830345 -0.0173616104
121 -0.0218044586 -0.0195830345
122 -0.1266071812 -0.0218044586
123 -0.0262473069 -0.1266071812
124 -0.0284687310 -0.0262473069
125 -0.1332714536 -0.0284687310
126 -0.0329115793 -0.1332714536
127 -0.0351330034 -0.0329115793
128 -0.0373544275 -0.0351330034
129 -0.0395758516 -0.0373544275
130 -0.0417972758 -0.0395758516
131 -0.0440186999 -0.0417972758
132 -0.0462401240 -0.0440186999
133 -0.0484615481 -0.0462401240
134 -0.0506829723 -0.0484615481
135 -0.0529043964 -0.0506829723
136 -0.0551258205 -0.0529043964
137 -0.1599285431 -0.0551258205
138 -0.1621499673 -0.1599285431
139 -0.0617900929 -0.1621499673
140 0.9359884830 -0.0617900929
141 -0.1688142396 0.9359884830
142 -0.0684543653 -0.1688142396
143 -0.0706757894 -0.0684543653
144 -0.0728972135 -0.0706757894
145 -0.1776999361 -0.0728972135
146 -0.1799213603 -0.1776999361
147 -0.1821427844 -0.1799213603
148 -0.0817829100 -0.1821427844
149 -0.0840043342 -0.0817829100
150 -0.0862257583 -0.0840043342
151 0.9115528176 -0.0862257583
152 0.9093313935 0.9115528176
153 -0.0928900307 0.9093313935
154 NA -0.0928900307
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.0149724718 -0.0853874026
[2,] 0.0127510476 0.0149724718
[3,] 0.0105296235 0.0127510476
[4,] 0.0083081994 0.0105296235
[5,] 0.0060867753 0.0083081994
[6,] 0.0038653511 0.0060867753
[7,] -0.1009373715 0.0038653511
[8,] -0.0005774971 -0.1009373715
[9,] -0.0027989212 -0.0005774971
[10,] -0.1076016439 -0.0027989212
[11,] -0.0072417695 -0.1076016439
[12,] -0.0094631936 -0.0072417695
[13,] -0.1142659162 -0.0094631936
[14,] -0.0139060419 -0.1142659162
[15,] -0.1187087645 -0.0139060419
[16,] 0.8790698114 -0.1187087645
[17,] -0.1231516127 0.8790698114
[18,] -0.0227917384 -0.1231516127
[19,] 0.8724055390 -0.0227917384
[20,] -0.0272345866 0.8724055390
[21,] -0.0294560108 -0.0272345866
[22,] -0.0316774349 -0.0294560108
[23,] -0.0338988590 -0.0316774349
[24,] -0.1387015816 -0.0338988590
[25,] -0.0383417073 -0.1387015816
[26,] -0.0405631314 -0.0383417073
[27,] -0.0427845555 -0.0405631314
[28,] -0.0450059796 -0.0427845555
[29,] -0.0472274038 -0.0450059796
[30,] -0.0494488279 -0.0472274038
[31,] -0.0516702520 -0.0494488279
[32,] -0.0538916761 -0.0516702520
[33,] -0.1586943988 -0.0538916761
[34,] -0.0583345244 -0.1586943988
[35,] -0.0605559485 -0.0583345244
[36,] -0.1653586711 -0.0605559485
[37,] -0.0649987968 -0.1653586711
[38,] -0.0672202209 -0.0649987968
[39,] -0.1720229435 -0.0672202209
[40,] 0.9283369308 -0.1720229435
[41,] -0.0738844933 0.9283369308
[42,] -0.0761059174 -0.0738844933
[43,] -0.1809086400 -0.0761059174
[44,] -0.0805487657 -0.1809086400
[45,] -0.0827701898 -0.0805487657
[46,] -0.0849916139 -0.0827701898
[47,] -0.0872130380 -0.0849916139
[48,] -0.0894344622 -0.0872130380
[49,] -0.0916558863 -0.0894344622
[50,] -0.1964586089 -0.0916558863
[51,] 0.8013199670 -0.1964586089
[52,] -0.0983201587 0.8013199670
[53,] 0.8994584172 -0.0983201587
[54,] -0.1027630069 0.8994584172
[55,] -0.2075657295 -0.1027630069
[56,] -0.1072058552 -0.2075657295
[57,] -0.1094272793 -0.1072058552
[58,] -0.1116487034 -0.1094272793
[59,] 0.7835485740 -0.1116487034
[60,] -0.2186728502 0.7835485740
[61,] -0.1183129758 -0.2186728502
[62,] -0.1205343999 -0.1183129758
[63,] -0.2253371226 -0.1205343999
[64,] -0.1249772482 -0.2253371226
[65,] -0.1271986723 -0.1249772482
[66,] 0.7679986051 -0.1271986723
[67,] -0.1316415206 0.7679986051
[68,] -0.1338629447 -0.1316415206
[69,] -0.1360843688 -0.1338629447
[70,] -0.1383057929 -0.1360843688
[71,] -0.1405272171 -0.1383057929
[72,] -0.1427486412 -0.1405272171
[73,] -0.1449700653 -0.1427486412
[74,] -0.1471914895 -0.1449700653
[75,] -0.2519942121 -0.1471914895
[76,] -0.1516343377 -0.2519942121
[77,] -0.1538557618 -0.1516343377
[78,] 0.7413415156 -0.1538557618
[79,] -0.2608799086 0.7413415156
[80,] -0.1605200342 -0.2608799086
[81,] -0.1627414583 -0.1605200342
[82,] -0.1649628825 -0.1627414583
[83,] 0.8328156934 -0.1649628825
[84,] -0.1694057307 0.8328156934
[85,] -0.1716271548 -0.1694057307
[86,] 0.0559453858 -0.1716271548
[87,] -0.0488573368 0.0559453858
[88,] 0.0515025375 -0.0488573368
[89,] 0.0492811134 0.0515025375
[90,] 0.0470596893 0.0492811134
[91,] -0.0577430333 0.0470596893
[92,] 0.0426168410 -0.0577430333
[93,] 0.0403954169 0.0426168410
[94,] -0.0644073057 0.0403954169
[95,] 0.0359525687 -0.0644073057
[96,] -0.0688501540 0.0359525687
[97,] 0.0315097204 -0.0688501540
[98,] 0.0292882963 0.0315097204
[99,] 0.0270668722 0.0292882963
[100,] 0.0248454480 0.0270668722
[101,] 0.0226240239 0.0248454480
[102,] 0.0204025998 0.0226240239
[103,] 0.0181811756 0.0204025998
[104,] -0.0866215470 0.0181811756
[105,] 0.0137383274 -0.0866215470
[106,] 0.0115169033 0.0137383274
[107,] -0.0932858193 0.0115169033
[108,] 0.0070740550 -0.0932858193
[109,] 0.0048526309 0.0070740550
[110,] -0.0999500917 0.0048526309
[111,] -0.1021715159 -0.0999500917
[112,] -0.0018116415 -0.1021715159
[113,] -0.1066143641 -0.0018116415
[114,] -0.0062544897 -0.1066143641
[115,] -0.0084759139 -0.0062544897
[116,] -0.0106973380 -0.0084759139
[117,] -0.0129187621 -0.0106973380
[118,] -0.0151401862 -0.0129187621
[119,] -0.0173616104 -0.0151401862
[120,] -0.0195830345 -0.0173616104
[121,] -0.0218044586 -0.0195830345
[122,] -0.1266071812 -0.0218044586
[123,] -0.0262473069 -0.1266071812
[124,] -0.0284687310 -0.0262473069
[125,] -0.1332714536 -0.0284687310
[126,] -0.0329115793 -0.1332714536
[127,] -0.0351330034 -0.0329115793
[128,] -0.0373544275 -0.0351330034
[129,] -0.0395758516 -0.0373544275
[130,] -0.0417972758 -0.0395758516
[131,] -0.0440186999 -0.0417972758
[132,] -0.0462401240 -0.0440186999
[133,] -0.0484615481 -0.0462401240
[134,] -0.0506829723 -0.0484615481
[135,] -0.0529043964 -0.0506829723
[136,] -0.0551258205 -0.0529043964
[137,] -0.1599285431 -0.0551258205
[138,] -0.1621499673 -0.1599285431
[139,] -0.0617900929 -0.1621499673
[140,] 0.9359884830 -0.0617900929
[141,] -0.1688142396 0.9359884830
[142,] -0.0684543653 -0.1688142396
[143,] -0.0706757894 -0.0684543653
[144,] -0.0728972135 -0.0706757894
[145,] -0.1776999361 -0.0728972135
[146,] -0.1799213603 -0.1776999361
[147,] -0.1821427844 -0.1799213603
[148,] -0.0817829100 -0.1821427844
[149,] -0.0840043342 -0.0817829100
[150,] -0.0862257583 -0.0840043342
[151,] 0.9115528176 -0.0862257583
[152,] 0.9093313935 0.9115528176
[153,] -0.0928900307 0.9093313935
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.0149724718 -0.0853874026
2 0.0127510476 0.0149724718
3 0.0105296235 0.0127510476
4 0.0083081994 0.0105296235
5 0.0060867753 0.0083081994
6 0.0038653511 0.0060867753
7 -0.1009373715 0.0038653511
8 -0.0005774971 -0.1009373715
9 -0.0027989212 -0.0005774971
10 -0.1076016439 -0.0027989212
11 -0.0072417695 -0.1076016439
12 -0.0094631936 -0.0072417695
13 -0.1142659162 -0.0094631936
14 -0.0139060419 -0.1142659162
15 -0.1187087645 -0.0139060419
16 0.8790698114 -0.1187087645
17 -0.1231516127 0.8790698114
18 -0.0227917384 -0.1231516127
19 0.8724055390 -0.0227917384
20 -0.0272345866 0.8724055390
21 -0.0294560108 -0.0272345866
22 -0.0316774349 -0.0294560108
23 -0.0338988590 -0.0316774349
24 -0.1387015816 -0.0338988590
25 -0.0383417073 -0.1387015816
26 -0.0405631314 -0.0383417073
27 -0.0427845555 -0.0405631314
28 -0.0450059796 -0.0427845555
29 -0.0472274038 -0.0450059796
30 -0.0494488279 -0.0472274038
31 -0.0516702520 -0.0494488279
32 -0.0538916761 -0.0516702520
33 -0.1586943988 -0.0538916761
34 -0.0583345244 -0.1586943988
35 -0.0605559485 -0.0583345244
36 -0.1653586711 -0.0605559485
37 -0.0649987968 -0.1653586711
38 -0.0672202209 -0.0649987968
39 -0.1720229435 -0.0672202209
40 0.9283369308 -0.1720229435
41 -0.0738844933 0.9283369308
42 -0.0761059174 -0.0738844933
43 -0.1809086400 -0.0761059174
44 -0.0805487657 -0.1809086400
45 -0.0827701898 -0.0805487657
46 -0.0849916139 -0.0827701898
47 -0.0872130380 -0.0849916139
48 -0.0894344622 -0.0872130380
49 -0.0916558863 -0.0894344622
50 -0.1964586089 -0.0916558863
51 0.8013199670 -0.1964586089
52 -0.0983201587 0.8013199670
53 0.8994584172 -0.0983201587
54 -0.1027630069 0.8994584172
55 -0.2075657295 -0.1027630069
56 -0.1072058552 -0.2075657295
57 -0.1094272793 -0.1072058552
58 -0.1116487034 -0.1094272793
59 0.7835485740 -0.1116487034
60 -0.2186728502 0.7835485740
61 -0.1183129758 -0.2186728502
62 -0.1205343999 -0.1183129758
63 -0.2253371226 -0.1205343999
64 -0.1249772482 -0.2253371226
65 -0.1271986723 -0.1249772482
66 0.7679986051 -0.1271986723
67 -0.1316415206 0.7679986051
68 -0.1338629447 -0.1316415206
69 -0.1360843688 -0.1338629447
70 -0.1383057929 -0.1360843688
71 -0.1405272171 -0.1383057929
72 -0.1427486412 -0.1405272171
73 -0.1449700653 -0.1427486412
74 -0.1471914895 -0.1449700653
75 -0.2519942121 -0.1471914895
76 -0.1516343377 -0.2519942121
77 -0.1538557618 -0.1516343377
78 0.7413415156 -0.1538557618
79 -0.2608799086 0.7413415156
80 -0.1605200342 -0.2608799086
81 -0.1627414583 -0.1605200342
82 -0.1649628825 -0.1627414583
83 0.8328156934 -0.1649628825
84 -0.1694057307 0.8328156934
85 -0.1716271548 -0.1694057307
86 0.0559453858 -0.1716271548
87 -0.0488573368 0.0559453858
88 0.0515025375 -0.0488573368
89 0.0492811134 0.0515025375
90 0.0470596893 0.0492811134
91 -0.0577430333 0.0470596893
92 0.0426168410 -0.0577430333
93 0.0403954169 0.0426168410
94 -0.0644073057 0.0403954169
95 0.0359525687 -0.0644073057
96 -0.0688501540 0.0359525687
97 0.0315097204 -0.0688501540
98 0.0292882963 0.0315097204
99 0.0270668722 0.0292882963
100 0.0248454480 0.0270668722
101 0.0226240239 0.0248454480
102 0.0204025998 0.0226240239
103 0.0181811756 0.0204025998
104 -0.0866215470 0.0181811756
105 0.0137383274 -0.0866215470
106 0.0115169033 0.0137383274
107 -0.0932858193 0.0115169033
108 0.0070740550 -0.0932858193
109 0.0048526309 0.0070740550
110 -0.0999500917 0.0048526309
111 -0.1021715159 -0.0999500917
112 -0.0018116415 -0.1021715159
113 -0.1066143641 -0.0018116415
114 -0.0062544897 -0.1066143641
115 -0.0084759139 -0.0062544897
116 -0.0106973380 -0.0084759139
117 -0.0129187621 -0.0106973380
118 -0.0151401862 -0.0129187621
119 -0.0173616104 -0.0151401862
120 -0.0195830345 -0.0173616104
121 -0.0218044586 -0.0195830345
122 -0.1266071812 -0.0218044586
123 -0.0262473069 -0.1266071812
124 -0.0284687310 -0.0262473069
125 -0.1332714536 -0.0284687310
126 -0.0329115793 -0.1332714536
127 -0.0351330034 -0.0329115793
128 -0.0373544275 -0.0351330034
129 -0.0395758516 -0.0373544275
130 -0.0417972758 -0.0395758516
131 -0.0440186999 -0.0417972758
132 -0.0462401240 -0.0440186999
133 -0.0484615481 -0.0462401240
134 -0.0506829723 -0.0484615481
135 -0.0529043964 -0.0506829723
136 -0.0551258205 -0.0529043964
137 -0.1599285431 -0.0551258205
138 -0.1621499673 -0.1599285431
139 -0.0617900929 -0.1621499673
140 0.9359884830 -0.0617900929
141 -0.1688142396 0.9359884830
142 -0.0684543653 -0.1688142396
143 -0.0706757894 -0.0684543653
144 -0.0728972135 -0.0706757894
145 -0.1776999361 -0.0728972135
146 -0.1799213603 -0.1776999361
147 -0.1821427844 -0.1799213603
148 -0.0817829100 -0.1821427844
149 -0.0840043342 -0.0817829100
150 -0.0862257583 -0.0840043342
151 0.9115528176 -0.0862257583
152 0.9093313935 0.9115528176
153 -0.0928900307 0.9093313935
> 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/726a01356097571.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/8ruz41356097571.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/9fyaj1356097571.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/10k6co1356097571.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/11ygo71356097571.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/12y5di1356097571.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/136sda1356097571.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/14lw5f1356097571.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/15kh821356097571.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/16svmq1356097571.tab")
+ }
>
> try(system("convert tmp/1q4xw1356097571.ps tmp/1q4xw1356097571.png",intern=TRUE))
character(0)
> try(system("convert tmp/2gg7p1356097571.ps tmp/2gg7p1356097571.png",intern=TRUE))
character(0)
> try(system("convert tmp/34mdf1356097571.ps tmp/34mdf1356097571.png",intern=TRUE))
character(0)
> try(system("convert tmp/4cqg81356097571.ps tmp/4cqg81356097571.png",intern=TRUE))
character(0)
> try(system("convert tmp/5qff51356097571.ps tmp/5qff51356097571.png",intern=TRUE))
character(0)
> try(system("convert tmp/6w7781356097571.ps tmp/6w7781356097571.png",intern=TRUE))
character(0)
> try(system("convert tmp/726a01356097571.ps tmp/726a01356097571.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ruz41356097571.ps tmp/8ruz41356097571.png",intern=TRUE))
character(0)
> try(system("convert tmp/9fyaj1356097571.ps tmp/9fyaj1356097571.png",intern=TRUE))
character(0)
> try(system("convert tmp/10k6co1356097571.ps tmp/10k6co1356097571.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.557 2.018 10.594