R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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.
Natural language support but running in an English locale
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,0,4,0,5,0,6,0,6,0,6,0,7,0,8,0,7,0,8,0,7,0,8,0,8,0,9,0,9,0,8,0,9,0,9,0,10,0,11,0,12,0,13,0,13,0,13,0,14,0,14,0,15,0,15,0,16,0,16,0,17,0,18,0,19,0,20,0,22,0,20,0,22,0,25,0,24,0,25,0,28,0,26,0,27,0,26,0,25,0,27,0,28,0,30,0,31,0,32,0,34,0,34,0,33,0,32,0,34,0,36,0,37,0,40,0,38,0,38,0,36,0,40,0,40,0,42,0,44,0,45,0,47,0,49,0,47,0,49,0,52,0,50,0,50,0,57,0,58,0,58,0,58,0,61,0,61,0,64,0,68,0,40,0,34,0,46,0,36,0,34,0,45,0,55,0,50,0,56,0,72,0,76,0,78,0,77,0,90,0,88,0,97,0,93,0,84,0,67,0,72,0,75,0,71,0,75,0,90,0,78,0,73,0,62,0,65,0,61,0,58,0,33,0,39,0,56,0,79,0,82,0,79,0,73,0,87,0,85,0,83,0,82,0,83,0,92,0,95,0,97,0,87,0,84,0,84,0,89,0,103,0,106,0,109,0,106,0,105,0,115,0,120,0,124,0,121,0,131,0,139,0,133,0,119,0,123,0,120,0,128,0,134,0,126,0,115,0,106,0,99,0,100,0,99,0,99,0,100,0,100,0,108,0,109,0,115,0,114,0,108,0,113,0,118,0,122,0,118,0,121,0,118,0,121,0,121,0,112,0,119,0,116,0,110,1,111,1,106,1,108,1),dim=c(2,176),dimnames=list(c('CO2-uitstoot','Kyoto-protocol'),1:176))
> y <- array(NA,dim=c(2,176),dimnames=list(c('CO2-uitstoot','Kyoto-protocol'),1:176))
> 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 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
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
CO2-uitstoot Kyoto-protocol t
1 5 0 1
2 4 0 2
3 5 0 3
4 6 0 4
5 6 0 5
6 6 0 6
7 7 0 7
8 8 0 8
9 7 0 9
10 8 0 10
11 7 0 11
12 8 0 12
13 8 0 13
14 9 0 14
15 9 0 15
16 8 0 16
17 9 0 17
18 9 0 18
19 10 0 19
20 11 0 20
21 12 0 21
22 13 0 22
23 13 0 23
24 13 0 24
25 14 0 25
26 14 0 26
27 15 0 27
28 15 0 28
29 16 0 29
30 16 0 30
31 17 0 31
32 18 0 32
33 19 0 33
34 20 0 34
35 22 0 35
36 20 0 36
37 22 0 37
38 25 0 38
39 24 0 39
40 25 0 40
41 28 0 41
42 26 0 42
43 27 0 43
44 26 0 44
45 25 0 45
46 27 0 46
47 28 0 47
48 30 0 48
49 31 0 49
50 32 0 50
51 34 0 51
52 34 0 52
53 33 0 53
54 32 0 54
55 34 0 55
56 36 0 56
57 37 0 57
58 40 0 58
59 38 0 59
60 38 0 60
61 36 0 61
62 40 0 62
63 40 0 63
64 42 0 64
65 44 0 65
66 45 0 66
67 47 0 67
68 49 0 68
69 47 0 69
70 49 0 70
71 52 0 71
72 50 0 72
73 50 0 73
74 57 0 74
75 58 0 75
76 58 0 76
77 58 0 77
78 61 0 78
79 61 0 79
80 64 0 80
81 68 0 81
82 40 0 82
83 34 0 83
84 46 0 84
85 36 0 85
86 34 0 86
87 45 0 87
88 55 0 88
89 50 0 89
90 56 0 90
91 72 0 91
92 76 0 92
93 78 0 93
94 77 0 94
95 90 0 95
96 88 0 96
97 97 0 97
98 93 0 98
99 84 0 99
100 67 0 100
101 72 0 101
102 75 0 102
103 71 0 103
104 75 0 104
105 90 0 105
106 78 0 106
107 73 0 107
108 62 0 108
109 65 0 109
110 61 0 110
111 58 0 111
112 33 0 112
113 39 0 113
114 56 0 114
115 79 0 115
116 82 0 116
117 79 0 117
118 73 0 118
119 87 0 119
120 85 0 120
121 83 0 121
122 82 0 122
123 83 0 123
124 92 0 124
125 95 0 125
126 97 0 126
127 87 0 127
128 84 0 128
129 84 0 129
130 89 0 130
131 103 0 131
132 106 0 132
133 109 0 133
134 106 0 134
135 105 0 135
136 115 0 136
137 120 0 137
138 124 0 138
139 121 0 139
140 131 0 140
141 139 0 141
142 133 0 142
143 119 0 143
144 123 0 144
145 120 0 145
146 128 0 146
147 134 0 147
148 126 0 148
149 115 0 149
150 106 0 150
151 99 0 151
152 100 0 152
153 99 0 153
154 99 0 154
155 100 0 155
156 100 0 156
157 108 0 157
158 109 0 158
159 115 0 159
160 114 0 160
161 108 0 161
162 113 0 162
163 118 0 163
164 122 0 164
165 118 0 165
166 121 0 166
167 118 0 167
168 121 0 168
169 121 0 169
170 112 0 170
171 119 0 171
172 116 0 172
173 110 1 173
174 111 1 174
175 106 1 175
176 108 1 176
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `Kyoto-protocol` t
-4.142 -19.025 0.756
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-47.527 -3.759 -1.051 4.816 36.550
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -4.14152 1.75078 -2.366 0.01911 *
`Kyoto-protocol` -19.02547 5.98421 -3.179 0.00175 **
t 0.75597 0.01755 43.066 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 11.43 on 173 degrees of freedom
Multiple R-squared: 0.9174, Adjusted R-squared: 0.9165
F-statistic: 961.1 on 2 and 173 DF, p-value: < 2.2e-16
> 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,] 2.492579e-04 4.985158e-04 9.997507e-01
[2,] 1.363824e-05 2.727648e-05 9.999864e-01
[3,] 1.157596e-06 2.315191e-06 9.999988e-01
[4,] 1.205042e-07 2.410084e-07 9.999999e-01
[5,] 5.866432e-09 1.173286e-08 1.000000e+00
[6,] 1.562765e-09 3.125529e-09 1.000000e+00
[7,] 9.004824e-11 1.800965e-10 1.000000e+00
[8,] 5.995614e-12 1.199123e-11 1.000000e+00
[9,] 3.313699e-13 6.627399e-13 1.000000e+00
[10,] 1.618411e-14 3.236821e-14 1.000000e+00
[11,] 5.542841e-15 1.108568e-14 1.000000e+00
[12,] 3.253778e-16 6.507556e-16 1.000000e+00
[13,] 2.253441e-17 4.506882e-17 1.000000e+00
[14,] 1.236290e-18 2.472580e-18 1.000000e+00
[15,] 1.661220e-19 3.322441e-19 1.000000e+00
[16,] 7.398866e-20 1.479773e-19 1.000000e+00
[17,] 7.496925e-20 1.499385e-19 1.000000e+00
[18,] 1.397102e-20 2.794205e-20 1.000000e+00
[19,] 1.266900e-21 2.533800e-21 1.000000e+00
[20,] 2.290094e-22 4.580188e-22 1.000000e+00
[21,] 2.061567e-23 4.123134e-23 1.000000e+00
[22,] 3.576609e-24 7.153218e-24 1.000000e+00
[23,] 3.170524e-25 6.341048e-25 1.000000e+00
[24,] 5.259374e-26 1.051875e-25 1.000000e+00
[25,] 4.570844e-27 9.141688e-27 1.000000e+00
[26,] 7.246819e-28 1.449364e-27 1.000000e+00
[27,] 2.408910e-28 4.817820e-28 1.000000e+00
[28,] 1.583377e-28 3.166755e-28 1.000000e+00
[29,] 1.734445e-28 3.468891e-28 1.000000e+00
[30,] 2.468138e-27 4.936276e-27 1.000000e+00
[31,] 2.764850e-28 5.529699e-28 1.000000e+00
[32,] 1.347164e-28 2.694328e-28 1.000000e+00
[33,] 3.710551e-27 7.421102e-27 1.000000e+00
[34,] 1.902322e-27 3.804644e-27 1.000000e+00
[35,] 1.216258e-27 2.432517e-27 1.000000e+00
[36,] 1.631037e-26 3.262073e-26 1.000000e+00
[37,] 4.186596e-27 8.373192e-27 1.000000e+00
[38,] 1.303396e-27 2.606793e-27 1.000000e+00
[39,] 1.755929e-28 3.511858e-28 1.000000e+00
[40,] 2.571206e-29 5.142413e-29 1.000000e+00
[41,] 3.359320e-30 6.718639e-30 1.000000e+00
[42,] 4.844661e-31 9.689322e-31 1.000000e+00
[43,] 1.527821e-31 3.055642e-31 1.000000e+00
[44,] 5.907183e-32 1.181437e-31 1.000000e+00
[45,] 2.755470e-32 5.510939e-32 1.000000e+00
[46,] 4.384611e-32 8.769221e-32 1.000000e+00
[47,] 2.473231e-32 4.946462e-32 1.000000e+00
[48,] 4.280827e-33 8.561654e-33 1.000000e+00
[49,] 5.692124e-34 1.138425e-33 1.000000e+00
[50,] 8.927054e-35 1.785411e-34 1.000000e+00
[51,] 2.812273e-35 5.624545e-35 1.000000e+00
[52,] 1.047865e-35 2.095731e-35 1.000000e+00
[53,] 3.641656e-35 7.283312e-35 1.000000e+00
[54,] 8.306670e-36 1.661334e-35 1.000000e+00
[55,] 1.389401e-36 2.778802e-36 1.000000e+00
[56,] 2.440411e-37 4.880823e-37 1.000000e+00
[57,] 5.711811e-38 1.142362e-37 1.000000e+00
[58,] 9.641000e-39 1.928200e-38 1.000000e+00
[59,] 3.175911e-39 6.351823e-39 1.000000e+00
[60,] 2.799061e-39 5.598122e-39 1.000000e+00
[61,] 2.651568e-39 5.303135e-39 1.000000e+00
[62,] 7.361594e-39 1.472319e-38 1.000000e+00
[63,] 5.569470e-38 1.113894e-37 1.000000e+00
[64,] 2.272064e-38 4.544128e-38 1.000000e+00
[65,] 2.088096e-38 4.176192e-38 1.000000e+00
[66,] 1.276730e-37 2.553461e-37 1.000000e+00
[67,] 5.552462e-38 1.110492e-37 1.000000e+00
[68,] 1.569480e-38 3.138960e-38 1.000000e+00
[69,] 8.941611e-37 1.788322e-36 1.000000e+00
[70,] 2.119540e-35 4.239079e-35 1.000000e+00
[71,] 1.105742e-34 2.211485e-34 1.000000e+00
[72,] 2.110077e-34 4.220155e-34 1.000000e+00
[73,] 1.604242e-33 3.208484e-33 1.000000e+00
[74,] 4.256374e-33 8.512748e-33 1.000000e+00
[75,] 4.031212e-32 8.062425e-32 1.000000e+00
[76,] 2.888731e-30 5.777461e-30 1.000000e+00
[77,] 6.966293e-27 1.393259e-26 1.000000e+00
[78,] 4.504637e-22 9.009274e-22 1.000000e+00
[79,] 1.283338e-21 2.566676e-21 1.000000e+00
[80,] 7.412149e-19 1.482430e-18 1.000000e+00
[81,] 3.982141e-16 7.964282e-16 1.000000e+00
[82,] 9.592959e-16 1.918592e-15 1.000000e+00
[83,] 4.388496e-16 8.776992e-16 1.000000e+00
[84,] 4.201164e-16 8.402329e-16 1.000000e+00
[85,] 2.032694e-16 4.065389e-16 1.000000e+00
[86,] 6.155537e-16 1.231107e-15 1.000000e+00
[87,] 3.866879e-15 7.733759e-15 1.000000e+00
[88,] 2.464569e-14 4.929138e-14 1.000000e+00
[89,] 6.880135e-14 1.376027e-13 1.000000e+00
[90,] 8.010062e-12 1.602012e-11 1.000000e+00
[91,] 1.333314e-10 2.666627e-10 1.000000e+00
[92,] 1.637019e-08 3.274037e-08 1.000000e+00
[93,] 2.121187e-07 4.242374e-07 9.999998e-01
[94,] 3.403687e-07 6.807374e-07 9.999997e-01
[95,] 2.060275e-07 4.120550e-07 9.999998e-01
[96,] 1.175970e-07 2.351939e-07 9.999999e-01
[97,] 6.999992e-08 1.399998e-07 9.999999e-01
[98,] 3.942032e-08 7.884063e-08 1.000000e+00
[99,] 2.216921e-08 4.433842e-08 1.000000e+00
[100,] 4.881398e-08 9.762796e-08 1.000000e+00
[101,] 2.944713e-08 5.889427e-08 1.000000e+00
[102,] 1.698989e-08 3.397977e-08 1.000000e+00
[103,] 2.575060e-08 5.150119e-08 1.000000e+00
[104,] 2.768387e-08 5.536774e-08 1.000000e+00
[105,] 5.510606e-08 1.102121e-07 9.999999e-01
[106,] 1.948885e-07 3.897769e-07 9.999998e-01
[107,] 3.260761e-04 6.521522e-04 9.996739e-01
[108,] 1.902836e-02 3.805672e-02 9.809716e-01
[109,] 5.941287e-02 1.188257e-01 9.405871e-01
[110,] 5.286024e-02 1.057205e-01 9.471398e-01
[111,] 4.582098e-02 9.164197e-02 9.541790e-01
[112,] 4.319830e-02 8.639659e-02 9.568017e-01
[113,] 5.607382e-02 1.121476e-01 9.439262e-01
[114,] 4.987103e-02 9.974205e-02 9.501290e-01
[115,] 4.641814e-02 9.283629e-02 9.535819e-01
[116,] 4.763948e-02 9.527896e-02 9.523605e-01
[117,] 5.463185e-02 1.092637e-01 9.453682e-01
[118,] 6.560704e-02 1.312141e-01 9.343930e-01
[119,] 6.384978e-02 1.276996e-01 9.361502e-01
[120,] 6.093469e-02 1.218694e-01 9.390653e-01
[121,] 5.767943e-02 1.153589e-01 9.423206e-01
[122,] 7.575625e-02 1.515125e-01 9.242438e-01
[123,] 1.338703e-01 2.677406e-01 8.661297e-01
[124,] 2.646871e-01 5.293741e-01 7.353129e-01
[125,] 4.225433e-01 8.450866e-01 5.774567e-01
[126,] 4.604734e-01 9.209468e-01 5.395266e-01
[127,] 4.884365e-01 9.768731e-01 5.115635e-01
[128,] 5.063258e-01 9.873485e-01 4.936742e-01
[129,] 5.438415e-01 9.123170e-01 4.561585e-01
[130,] 6.035482e-01 7.929036e-01 3.964518e-01
[131,] 6.114757e-01 7.770486e-01 3.885243e-01
[132,] 6.170127e-01 7.659746e-01 3.829873e-01
[133,] 6.327298e-01 7.345404e-01 3.672702e-01
[134,] 6.228493e-01 7.543014e-01 3.771507e-01
[135,] 6.930577e-01 6.138846e-01 3.069423e-01
[136,] 8.696147e-01 2.607705e-01 1.303853e-01
[137,] 9.345378e-01 1.309244e-01 6.546222e-02
[138,] 9.236577e-01 1.526846e-01 7.634230e-02
[139,] 9.283655e-01 1.432690e-01 7.163450e-02
[140,] 9.242928e-01 1.514143e-01 7.570716e-02
[141,] 9.647533e-01 7.049338e-02 3.524669e-02
[142,] 9.988431e-01 2.313810e-03 1.156905e-03
[143,] 9.999903e-01 1.931720e-05 9.658601e-06
[144,] 9.999995e-01 1.085747e-06 5.428734e-07
[145,] 9.999995e-01 1.094501e-06 5.472503e-07
[146,] 9.999987e-01 2.679363e-06 1.339681e-06
[147,] 9.999968e-01 6.457935e-06 3.228968e-06
[148,] 9.999941e-01 1.180140e-05 5.900700e-06
[149,] 9.999926e-01 1.470962e-05 7.354808e-06
[150,] 9.999937e-01 1.262901e-05 6.314506e-06
[151,] 9.999986e-01 2.709616e-06 1.354808e-06
[152,] 9.999974e-01 5.160640e-06 2.580320e-06
[153,] 9.999959e-01 8.263758e-06 4.131879e-06
[154,] 9.999864e-01 2.716690e-05 1.358345e-05
[155,] 9.999583e-01 8.343158e-05 4.171579e-05
[156,] 9.999922e-01 1.566970e-05 7.834852e-06
[157,] 9.999971e-01 5.725227e-06 2.862614e-06
[158,] 9.999932e-01 1.362174e-05 6.810869e-06
[159,] 9.999702e-01 5.964575e-05 2.982288e-05
[160,] 9.999186e-01 1.628563e-04 8.142817e-05
[161,] 9.996377e-01 7.245230e-04 3.622615e-04
[162,] 9.988849e-01 2.230157e-03 1.115078e-03
[163,] 9.956947e-01 8.610655e-03 4.305328e-03
[164,] 9.902675e-01 1.946501e-02 9.732507e-03
[165,] 9.944275e-01 1.114505e-02 5.572527e-03
> postscript(file="/var/www/html/freestat/rcomp/tmp/1l2dq1292434829.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/www/html/freestat/rcomp/tmp/2l2dq1292434829.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/www/html/freestat/rcomp/tmp/3vtub1292434829.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/www/html/freestat/rcomp/tmp/4vtub1292434829.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/www/html/freestat/rcomp/tmp/5vtub1292434829.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 = 176
Frequency = 1
1 2 3 4 5 6
8.38554647 6.62957517 6.87360387 7.11763256 6.36166126 5.60568995
7 8 9 10 11 12
5.84971865 6.09374735 4.33777604 4.58180474 2.82583344 3.06986213
13 14 15 16 17 18
2.31389083 2.55791952 1.80194822 0.04597692 0.29000561 -0.46596569
19 20 21 22 23 24
-0.22193699 0.02209170 0.26612040 0.51014909 -0.24582221 -1.00179351
25 26 27 28 29 30
-0.75776482 -1.51373612 -1.26970742 -2.02567873 -1.78165003 -2.53762134
31 32 33 34 35 36
-2.29359264 -2.04956394 -1.80553525 -1.56150655 -0.31747786 -3.07344916
37 38 39 40 41 42
-1.82942046 0.41460823 -1.34136307 -1.09733437 1.14669432 -1.60927698
43 44 45 46 47 48
-1.36524829 -3.12121959 -4.87719089 -3.63316220 -3.38913350 -2.14510480
49 50 51 52 53 54
-1.90107611 -1.65704741 -0.41301872 -1.16899002 -2.92496132 -4.68093263
55 56 57 58 59 60
-3.43690393 -2.19287523 -1.94884654 0.29518216 -2.46078915 -3.21676045
61 62 63 64 65 66
-5.97273175 -2.72870306 -3.48467436 -2.24064566 -0.99661697 -0.75258827
67 68 69 70 71 72
0.49144042 1.73546912 -1.02050218 0.22352651 2.46755521 -0.28841610
73 74 75 76 77 78
-1.04438740 5.19964130 5.44366999 4.68769869 3.93172739 6.17575608
79 80 81 82 83 84
5.41978478 7.66381347 10.90784217 -17.84812913 -24.60410044 -13.36007174
85 86 87 88 89 90
-24.11604304 -26.87201435 -16.62798565 -7.38395696 -13.13992826 -7.89589956
91 92 93 94 95 96
7.34812913 10.59215783 11.83618653 10.08021522 22.32424392 19.56827261
97 98 99 100 101 102
27.81230131 23.05633001 13.30035870 -4.45561260 -0.21158390 2.03244479
103 104 105 106 107 108
-2.72352651 0.52050218 14.76453088 2.00855958 -3.74741173 -15.50338303
109 110 111 112 113 114
-13.25935434 -18.01532564 -21.77129694 -47.52726825 -42.28323955 -26.03921085
115 116 117 118 119 120
-3.79518216 -1.55115346 -5.30712477 -12.06309607 1.18093263 -1.57503868
121 122 123 124 125 126
-4.33100998 -6.08698128 -5.84295259 2.40107611 4.64510480 5.88913350
127 128 129 130 131 132
-4.86683780 -8.62280911 -9.37878041 -5.13475171 8.10927698 10.35330568
133 134 135 136 137 138
12.59733437 8.84136307 7.08539177 16.32942046 20.57344916 23.81747786
139 140 141 142 143 144
20.06150655 29.30553525 36.54956394 29.79359264 15.03762134 18.28165003
145 146 147 148 149 150
14.52567873 21.76970742 27.01373612 18.25776482 6.50179351 -3.25417779
151 152 153 154 155 156
-11.01014909 -10.76612040 -12.52209170 -13.27806301 -13.03403431 -13.79000561
157 158 159 160 161 162
-6.54597692 -6.30194822 -1.05791952 -2.81389083 -9.56986213 -5.32583344
163 164 165 166 167 168
-1.08180474 2.16222396 -2.59374735 -0.34971865 -4.10568995 -1.86166126
169 170 171 172 173 174
-2.61763256 -12.37360387 -6.12957517 -9.88554647 2.38395696 2.62798565
175 176
-3.12798565 -1.88395696
> postscript(file="/var/www/html/freestat/rcomp/tmp/6okbw1292434829.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 = 176
Frequency = 1
lag(myerror, k = 1) myerror
0 8.38554647 NA
1 6.62957517 8.38554647
2 6.87360387 6.62957517
3 7.11763256 6.87360387
4 6.36166126 7.11763256
5 5.60568995 6.36166126
6 5.84971865 5.60568995
7 6.09374735 5.84971865
8 4.33777604 6.09374735
9 4.58180474 4.33777604
10 2.82583344 4.58180474
11 3.06986213 2.82583344
12 2.31389083 3.06986213
13 2.55791952 2.31389083
14 1.80194822 2.55791952
15 0.04597692 1.80194822
16 0.29000561 0.04597692
17 -0.46596569 0.29000561
18 -0.22193699 -0.46596569
19 0.02209170 -0.22193699
20 0.26612040 0.02209170
21 0.51014909 0.26612040
22 -0.24582221 0.51014909
23 -1.00179351 -0.24582221
24 -0.75776482 -1.00179351
25 -1.51373612 -0.75776482
26 -1.26970742 -1.51373612
27 -2.02567873 -1.26970742
28 -1.78165003 -2.02567873
29 -2.53762134 -1.78165003
30 -2.29359264 -2.53762134
31 -2.04956394 -2.29359264
32 -1.80553525 -2.04956394
33 -1.56150655 -1.80553525
34 -0.31747786 -1.56150655
35 -3.07344916 -0.31747786
36 -1.82942046 -3.07344916
37 0.41460823 -1.82942046
38 -1.34136307 0.41460823
39 -1.09733437 -1.34136307
40 1.14669432 -1.09733437
41 -1.60927698 1.14669432
42 -1.36524829 -1.60927698
43 -3.12121959 -1.36524829
44 -4.87719089 -3.12121959
45 -3.63316220 -4.87719089
46 -3.38913350 -3.63316220
47 -2.14510480 -3.38913350
48 -1.90107611 -2.14510480
49 -1.65704741 -1.90107611
50 -0.41301872 -1.65704741
51 -1.16899002 -0.41301872
52 -2.92496132 -1.16899002
53 -4.68093263 -2.92496132
54 -3.43690393 -4.68093263
55 -2.19287523 -3.43690393
56 -1.94884654 -2.19287523
57 0.29518216 -1.94884654
58 -2.46078915 0.29518216
59 -3.21676045 -2.46078915
60 -5.97273175 -3.21676045
61 -2.72870306 -5.97273175
62 -3.48467436 -2.72870306
63 -2.24064566 -3.48467436
64 -0.99661697 -2.24064566
65 -0.75258827 -0.99661697
66 0.49144042 -0.75258827
67 1.73546912 0.49144042
68 -1.02050218 1.73546912
69 0.22352651 -1.02050218
70 2.46755521 0.22352651
71 -0.28841610 2.46755521
72 -1.04438740 -0.28841610
73 5.19964130 -1.04438740
74 5.44366999 5.19964130
75 4.68769869 5.44366999
76 3.93172739 4.68769869
77 6.17575608 3.93172739
78 5.41978478 6.17575608
79 7.66381347 5.41978478
80 10.90784217 7.66381347
81 -17.84812913 10.90784217
82 -24.60410044 -17.84812913
83 -13.36007174 -24.60410044
84 -24.11604304 -13.36007174
85 -26.87201435 -24.11604304
86 -16.62798565 -26.87201435
87 -7.38395696 -16.62798565
88 -13.13992826 -7.38395696
89 -7.89589956 -13.13992826
90 7.34812913 -7.89589956
91 10.59215783 7.34812913
92 11.83618653 10.59215783
93 10.08021522 11.83618653
94 22.32424392 10.08021522
95 19.56827261 22.32424392
96 27.81230131 19.56827261
97 23.05633001 27.81230131
98 13.30035870 23.05633001
99 -4.45561260 13.30035870
100 -0.21158390 -4.45561260
101 2.03244479 -0.21158390
102 -2.72352651 2.03244479
103 0.52050218 -2.72352651
104 14.76453088 0.52050218
105 2.00855958 14.76453088
106 -3.74741173 2.00855958
107 -15.50338303 -3.74741173
108 -13.25935434 -15.50338303
109 -18.01532564 -13.25935434
110 -21.77129694 -18.01532564
111 -47.52726825 -21.77129694
112 -42.28323955 -47.52726825
113 -26.03921085 -42.28323955
114 -3.79518216 -26.03921085
115 -1.55115346 -3.79518216
116 -5.30712477 -1.55115346
117 -12.06309607 -5.30712477
118 1.18093263 -12.06309607
119 -1.57503868 1.18093263
120 -4.33100998 -1.57503868
121 -6.08698128 -4.33100998
122 -5.84295259 -6.08698128
123 2.40107611 -5.84295259
124 4.64510480 2.40107611
125 5.88913350 4.64510480
126 -4.86683780 5.88913350
127 -8.62280911 -4.86683780
128 -9.37878041 -8.62280911
129 -5.13475171 -9.37878041
130 8.10927698 -5.13475171
131 10.35330568 8.10927698
132 12.59733437 10.35330568
133 8.84136307 12.59733437
134 7.08539177 8.84136307
135 16.32942046 7.08539177
136 20.57344916 16.32942046
137 23.81747786 20.57344916
138 20.06150655 23.81747786
139 29.30553525 20.06150655
140 36.54956394 29.30553525
141 29.79359264 36.54956394
142 15.03762134 29.79359264
143 18.28165003 15.03762134
144 14.52567873 18.28165003
145 21.76970742 14.52567873
146 27.01373612 21.76970742
147 18.25776482 27.01373612
148 6.50179351 18.25776482
149 -3.25417779 6.50179351
150 -11.01014909 -3.25417779
151 -10.76612040 -11.01014909
152 -12.52209170 -10.76612040
153 -13.27806301 -12.52209170
154 -13.03403431 -13.27806301
155 -13.79000561 -13.03403431
156 -6.54597692 -13.79000561
157 -6.30194822 -6.54597692
158 -1.05791952 -6.30194822
159 -2.81389083 -1.05791952
160 -9.56986213 -2.81389083
161 -5.32583344 -9.56986213
162 -1.08180474 -5.32583344
163 2.16222396 -1.08180474
164 -2.59374735 2.16222396
165 -0.34971865 -2.59374735
166 -4.10568995 -0.34971865
167 -1.86166126 -4.10568995
168 -2.61763256 -1.86166126
169 -12.37360387 -2.61763256
170 -6.12957517 -12.37360387
171 -9.88554647 -6.12957517
172 2.38395696 -9.88554647
173 2.62798565 2.38395696
174 -3.12798565 2.62798565
175 -1.88395696 -3.12798565
176 NA -1.88395696
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 6.62957517 8.38554647
[2,] 6.87360387 6.62957517
[3,] 7.11763256 6.87360387
[4,] 6.36166126 7.11763256
[5,] 5.60568995 6.36166126
[6,] 5.84971865 5.60568995
[7,] 6.09374735 5.84971865
[8,] 4.33777604 6.09374735
[9,] 4.58180474 4.33777604
[10,] 2.82583344 4.58180474
[11,] 3.06986213 2.82583344
[12,] 2.31389083 3.06986213
[13,] 2.55791952 2.31389083
[14,] 1.80194822 2.55791952
[15,] 0.04597692 1.80194822
[16,] 0.29000561 0.04597692
[17,] -0.46596569 0.29000561
[18,] -0.22193699 -0.46596569
[19,] 0.02209170 -0.22193699
[20,] 0.26612040 0.02209170
[21,] 0.51014909 0.26612040
[22,] -0.24582221 0.51014909
[23,] -1.00179351 -0.24582221
[24,] -0.75776482 -1.00179351
[25,] -1.51373612 -0.75776482
[26,] -1.26970742 -1.51373612
[27,] -2.02567873 -1.26970742
[28,] -1.78165003 -2.02567873
[29,] -2.53762134 -1.78165003
[30,] -2.29359264 -2.53762134
[31,] -2.04956394 -2.29359264
[32,] -1.80553525 -2.04956394
[33,] -1.56150655 -1.80553525
[34,] -0.31747786 -1.56150655
[35,] -3.07344916 -0.31747786
[36,] -1.82942046 -3.07344916
[37,] 0.41460823 -1.82942046
[38,] -1.34136307 0.41460823
[39,] -1.09733437 -1.34136307
[40,] 1.14669432 -1.09733437
[41,] -1.60927698 1.14669432
[42,] -1.36524829 -1.60927698
[43,] -3.12121959 -1.36524829
[44,] -4.87719089 -3.12121959
[45,] -3.63316220 -4.87719089
[46,] -3.38913350 -3.63316220
[47,] -2.14510480 -3.38913350
[48,] -1.90107611 -2.14510480
[49,] -1.65704741 -1.90107611
[50,] -0.41301872 -1.65704741
[51,] -1.16899002 -0.41301872
[52,] -2.92496132 -1.16899002
[53,] -4.68093263 -2.92496132
[54,] -3.43690393 -4.68093263
[55,] -2.19287523 -3.43690393
[56,] -1.94884654 -2.19287523
[57,] 0.29518216 -1.94884654
[58,] -2.46078915 0.29518216
[59,] -3.21676045 -2.46078915
[60,] -5.97273175 -3.21676045
[61,] -2.72870306 -5.97273175
[62,] -3.48467436 -2.72870306
[63,] -2.24064566 -3.48467436
[64,] -0.99661697 -2.24064566
[65,] -0.75258827 -0.99661697
[66,] 0.49144042 -0.75258827
[67,] 1.73546912 0.49144042
[68,] -1.02050218 1.73546912
[69,] 0.22352651 -1.02050218
[70,] 2.46755521 0.22352651
[71,] -0.28841610 2.46755521
[72,] -1.04438740 -0.28841610
[73,] 5.19964130 -1.04438740
[74,] 5.44366999 5.19964130
[75,] 4.68769869 5.44366999
[76,] 3.93172739 4.68769869
[77,] 6.17575608 3.93172739
[78,] 5.41978478 6.17575608
[79,] 7.66381347 5.41978478
[80,] 10.90784217 7.66381347
[81,] -17.84812913 10.90784217
[82,] -24.60410044 -17.84812913
[83,] -13.36007174 -24.60410044
[84,] -24.11604304 -13.36007174
[85,] -26.87201435 -24.11604304
[86,] -16.62798565 -26.87201435
[87,] -7.38395696 -16.62798565
[88,] -13.13992826 -7.38395696
[89,] -7.89589956 -13.13992826
[90,] 7.34812913 -7.89589956
[91,] 10.59215783 7.34812913
[92,] 11.83618653 10.59215783
[93,] 10.08021522 11.83618653
[94,] 22.32424392 10.08021522
[95,] 19.56827261 22.32424392
[96,] 27.81230131 19.56827261
[97,] 23.05633001 27.81230131
[98,] 13.30035870 23.05633001
[99,] -4.45561260 13.30035870
[100,] -0.21158390 -4.45561260
[101,] 2.03244479 -0.21158390
[102,] -2.72352651 2.03244479
[103,] 0.52050218 -2.72352651
[104,] 14.76453088 0.52050218
[105,] 2.00855958 14.76453088
[106,] -3.74741173 2.00855958
[107,] -15.50338303 -3.74741173
[108,] -13.25935434 -15.50338303
[109,] -18.01532564 -13.25935434
[110,] -21.77129694 -18.01532564
[111,] -47.52726825 -21.77129694
[112,] -42.28323955 -47.52726825
[113,] -26.03921085 -42.28323955
[114,] -3.79518216 -26.03921085
[115,] -1.55115346 -3.79518216
[116,] -5.30712477 -1.55115346
[117,] -12.06309607 -5.30712477
[118,] 1.18093263 -12.06309607
[119,] -1.57503868 1.18093263
[120,] -4.33100998 -1.57503868
[121,] -6.08698128 -4.33100998
[122,] -5.84295259 -6.08698128
[123,] 2.40107611 -5.84295259
[124,] 4.64510480 2.40107611
[125,] 5.88913350 4.64510480
[126,] -4.86683780 5.88913350
[127,] -8.62280911 -4.86683780
[128,] -9.37878041 -8.62280911
[129,] -5.13475171 -9.37878041
[130,] 8.10927698 -5.13475171
[131,] 10.35330568 8.10927698
[132,] 12.59733437 10.35330568
[133,] 8.84136307 12.59733437
[134,] 7.08539177 8.84136307
[135,] 16.32942046 7.08539177
[136,] 20.57344916 16.32942046
[137,] 23.81747786 20.57344916
[138,] 20.06150655 23.81747786
[139,] 29.30553525 20.06150655
[140,] 36.54956394 29.30553525
[141,] 29.79359264 36.54956394
[142,] 15.03762134 29.79359264
[143,] 18.28165003 15.03762134
[144,] 14.52567873 18.28165003
[145,] 21.76970742 14.52567873
[146,] 27.01373612 21.76970742
[147,] 18.25776482 27.01373612
[148,] 6.50179351 18.25776482
[149,] -3.25417779 6.50179351
[150,] -11.01014909 -3.25417779
[151,] -10.76612040 -11.01014909
[152,] -12.52209170 -10.76612040
[153,] -13.27806301 -12.52209170
[154,] -13.03403431 -13.27806301
[155,] -13.79000561 -13.03403431
[156,] -6.54597692 -13.79000561
[157,] -6.30194822 -6.54597692
[158,] -1.05791952 -6.30194822
[159,] -2.81389083 -1.05791952
[160,] -9.56986213 -2.81389083
[161,] -5.32583344 -9.56986213
[162,] -1.08180474 -5.32583344
[163,] 2.16222396 -1.08180474
[164,] -2.59374735 2.16222396
[165,] -0.34971865 -2.59374735
[166,] -4.10568995 -0.34971865
[167,] -1.86166126 -4.10568995
[168,] -2.61763256 -1.86166126
[169,] -12.37360387 -2.61763256
[170,] -6.12957517 -12.37360387
[171,] -9.88554647 -6.12957517
[172,] 2.38395696 -9.88554647
[173,] 2.62798565 2.38395696
[174,] -3.12798565 2.62798565
[175,] -1.88395696 -3.12798565
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 6.62957517 8.38554647
2 6.87360387 6.62957517
3 7.11763256 6.87360387
4 6.36166126 7.11763256
5 5.60568995 6.36166126
6 5.84971865 5.60568995
7 6.09374735 5.84971865
8 4.33777604 6.09374735
9 4.58180474 4.33777604
10 2.82583344 4.58180474
11 3.06986213 2.82583344
12 2.31389083 3.06986213
13 2.55791952 2.31389083
14 1.80194822 2.55791952
15 0.04597692 1.80194822
16 0.29000561 0.04597692
17 -0.46596569 0.29000561
18 -0.22193699 -0.46596569
19 0.02209170 -0.22193699
20 0.26612040 0.02209170
21 0.51014909 0.26612040
22 -0.24582221 0.51014909
23 -1.00179351 -0.24582221
24 -0.75776482 -1.00179351
25 -1.51373612 -0.75776482
26 -1.26970742 -1.51373612
27 -2.02567873 -1.26970742
28 -1.78165003 -2.02567873
29 -2.53762134 -1.78165003
30 -2.29359264 -2.53762134
31 -2.04956394 -2.29359264
32 -1.80553525 -2.04956394
33 -1.56150655 -1.80553525
34 -0.31747786 -1.56150655
35 -3.07344916 -0.31747786
36 -1.82942046 -3.07344916
37 0.41460823 -1.82942046
38 -1.34136307 0.41460823
39 -1.09733437 -1.34136307
40 1.14669432 -1.09733437
41 -1.60927698 1.14669432
42 -1.36524829 -1.60927698
43 -3.12121959 -1.36524829
44 -4.87719089 -3.12121959
45 -3.63316220 -4.87719089
46 -3.38913350 -3.63316220
47 -2.14510480 -3.38913350
48 -1.90107611 -2.14510480
49 -1.65704741 -1.90107611
50 -0.41301872 -1.65704741
51 -1.16899002 -0.41301872
52 -2.92496132 -1.16899002
53 -4.68093263 -2.92496132
54 -3.43690393 -4.68093263
55 -2.19287523 -3.43690393
56 -1.94884654 -2.19287523
57 0.29518216 -1.94884654
58 -2.46078915 0.29518216
59 -3.21676045 -2.46078915
60 -5.97273175 -3.21676045
61 -2.72870306 -5.97273175
62 -3.48467436 -2.72870306
63 -2.24064566 -3.48467436
64 -0.99661697 -2.24064566
65 -0.75258827 -0.99661697
66 0.49144042 -0.75258827
67 1.73546912 0.49144042
68 -1.02050218 1.73546912
69 0.22352651 -1.02050218
70 2.46755521 0.22352651
71 -0.28841610 2.46755521
72 -1.04438740 -0.28841610
73 5.19964130 -1.04438740
74 5.44366999 5.19964130
75 4.68769869 5.44366999
76 3.93172739 4.68769869
77 6.17575608 3.93172739
78 5.41978478 6.17575608
79 7.66381347 5.41978478
80 10.90784217 7.66381347
81 -17.84812913 10.90784217
82 -24.60410044 -17.84812913
83 -13.36007174 -24.60410044
84 -24.11604304 -13.36007174
85 -26.87201435 -24.11604304
86 -16.62798565 -26.87201435
87 -7.38395696 -16.62798565
88 -13.13992826 -7.38395696
89 -7.89589956 -13.13992826
90 7.34812913 -7.89589956
91 10.59215783 7.34812913
92 11.83618653 10.59215783
93 10.08021522 11.83618653
94 22.32424392 10.08021522
95 19.56827261 22.32424392
96 27.81230131 19.56827261
97 23.05633001 27.81230131
98 13.30035870 23.05633001
99 -4.45561260 13.30035870
100 -0.21158390 -4.45561260
101 2.03244479 -0.21158390
102 -2.72352651 2.03244479
103 0.52050218 -2.72352651
104 14.76453088 0.52050218
105 2.00855958 14.76453088
106 -3.74741173 2.00855958
107 -15.50338303 -3.74741173
108 -13.25935434 -15.50338303
109 -18.01532564 -13.25935434
110 -21.77129694 -18.01532564
111 -47.52726825 -21.77129694
112 -42.28323955 -47.52726825
113 -26.03921085 -42.28323955
114 -3.79518216 -26.03921085
115 -1.55115346 -3.79518216
116 -5.30712477 -1.55115346
117 -12.06309607 -5.30712477
118 1.18093263 -12.06309607
119 -1.57503868 1.18093263
120 -4.33100998 -1.57503868
121 -6.08698128 -4.33100998
122 -5.84295259 -6.08698128
123 2.40107611 -5.84295259
124 4.64510480 2.40107611
125 5.88913350 4.64510480
126 -4.86683780 5.88913350
127 -8.62280911 -4.86683780
128 -9.37878041 -8.62280911
129 -5.13475171 -9.37878041
130 8.10927698 -5.13475171
131 10.35330568 8.10927698
132 12.59733437 10.35330568
133 8.84136307 12.59733437
134 7.08539177 8.84136307
135 16.32942046 7.08539177
136 20.57344916 16.32942046
137 23.81747786 20.57344916
138 20.06150655 23.81747786
139 29.30553525 20.06150655
140 36.54956394 29.30553525
141 29.79359264 36.54956394
142 15.03762134 29.79359264
143 18.28165003 15.03762134
144 14.52567873 18.28165003
145 21.76970742 14.52567873
146 27.01373612 21.76970742
147 18.25776482 27.01373612
148 6.50179351 18.25776482
149 -3.25417779 6.50179351
150 -11.01014909 -3.25417779
151 -10.76612040 -11.01014909
152 -12.52209170 -10.76612040
153 -13.27806301 -12.52209170
154 -13.03403431 -13.27806301
155 -13.79000561 -13.03403431
156 -6.54597692 -13.79000561
157 -6.30194822 -6.54597692
158 -1.05791952 -6.30194822
159 -2.81389083 -1.05791952
160 -9.56986213 -2.81389083
161 -5.32583344 -9.56986213
162 -1.08180474 -5.32583344
163 2.16222396 -1.08180474
164 -2.59374735 2.16222396
165 -0.34971865 -2.59374735
166 -4.10568995 -0.34971865
167 -1.86166126 -4.10568995
168 -2.61763256 -1.86166126
169 -12.37360387 -2.61763256
170 -6.12957517 -12.37360387
171 -9.88554647 -6.12957517
172 2.38395696 -9.88554647
173 2.62798565 2.38395696
174 -3.12798565 2.62798565
175 -1.88395696 -3.12798565
> 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/html/freestat/rcomp/tmp/7hbbz1292434829.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/www/html/freestat/rcomp/tmp/8hbbz1292434829.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/www/html/freestat/rcomp/tmp/9hbbz1292434829.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/www/html/freestat/rcomp/tmp/10slak1292434829.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/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/html/freestat/rcomp/tmp/11vl9q1292434829.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/html/freestat/rcomp/tmp/12hm7w1292434829.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/html/freestat/rcomp/tmp/13dw541292434829.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/html/freestat/rcomp/tmp/14gela1292434829.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/html/freestat/rcomp/tmp/15jf2y1292434829.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/html/freestat/rcomp/tmp/16nxi41292434829.tab")
+ }
>
> try(system("convert tmp/1l2dq1292434829.ps tmp/1l2dq1292434829.png",intern=TRUE))
character(0)
> try(system("convert tmp/2l2dq1292434829.ps tmp/2l2dq1292434829.png",intern=TRUE))
character(0)
> try(system("convert tmp/3vtub1292434829.ps tmp/3vtub1292434829.png",intern=TRUE))
character(0)
> try(system("convert tmp/4vtub1292434829.ps tmp/4vtub1292434829.png",intern=TRUE))
character(0)
> try(system("convert tmp/5vtub1292434829.ps tmp/5vtub1292434829.png",intern=TRUE))
character(0)
> try(system("convert tmp/6okbw1292434829.ps tmp/6okbw1292434829.png",intern=TRUE))
character(0)
> try(system("convert tmp/7hbbz1292434829.ps tmp/7hbbz1292434829.png",intern=TRUE))
character(0)
> try(system("convert tmp/8hbbz1292434829.ps tmp/8hbbz1292434829.png",intern=TRUE))
character(0)
> try(system("convert tmp/9hbbz1292434829.ps tmp/9hbbz1292434829.png",intern=TRUE))
character(0)
> try(system("convert tmp/10slak1292434829.ps tmp/10slak1292434829.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.550 2.625 5.911