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(0
+ ,255202
+ ,64
+ ,92
+ ,34
+ ,0
+ ,135248
+ ,59
+ ,58
+ ,30
+ ,0
+ ,207223
+ ,64
+ ,62
+ ,42
+ ,1
+ ,189326
+ ,95
+ ,108
+ ,34
+ ,1
+ ,141365
+ ,46
+ ,55
+ ,25
+ ,0
+ ,65295
+ ,27
+ ,8
+ ,31
+ ,0
+ ,439387
+ ,103
+ ,134
+ ,29
+ ,0
+ ,33186
+ ,19
+ ,1
+ ,18
+ ,0
+ ,183696
+ ,51
+ ,64
+ ,30
+ ,0
+ ,186657
+ ,38
+ ,77
+ ,29
+ ,1
+ ,276696
+ ,99
+ ,86
+ ,42
+ ,1
+ ,194414
+ ,98
+ ,96
+ ,50
+ ,0
+ ,141409
+ ,59
+ ,44
+ ,33
+ ,1
+ ,306730
+ ,68
+ ,108
+ ,46
+ ,1
+ ,192691
+ ,74
+ ,63
+ ,38
+ ,1
+ ,333497
+ ,164
+ ,160
+ ,52
+ ,0
+ ,261835
+ ,59
+ ,109
+ ,32
+ ,1
+ ,263451
+ ,130
+ ,86
+ ,35
+ ,1
+ ,157448
+ ,49
+ ,93
+ ,25
+ ,1
+ ,232190
+ ,73
+ ,126
+ ,42
+ ,0
+ ,245725
+ ,64
+ ,110
+ ,40
+ ,0
+ ,388603
+ ,92
+ ,86
+ ,35
+ ,0
+ ,156540
+ ,34
+ ,50
+ ,25
+ ,0
+ ,156189
+ ,47
+ ,92
+ ,46
+ ,0
+ ,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 ,0
+ ,0
+ ,0
+ ,203
+ ,4
+ ,0
+ ,0
+ ,0
+ ,7199
+ ,5
+ ,7
+ ,0
+ ,1
+ ,46660
+ ,20
+ ,12
+ ,5
+ ,1
+ ,17547
+ ,5
+ ,0
+ ,1
+ ,0
+ ,107465
+ ,38
+ ,37
+ ,38
+ ,1
+ ,969
+ ,2
+ ,0
+ ,0
+ ,1
+ ,179994
+ ,58
+ ,47
+ ,28)
+ ,dim=c(5
+ ,164)
+ ,dimnames=list(c('Geslacht'
+ ,'Time_in_RFC'
+ ,'Logins'
+ ,'Blogged_computations'
+ ,'Reviewed_compendiums')
+ ,1:164))
> y <- array(NA,dim=c(5,164),dimnames=list(c('Geslacht','Time_in_RFC','Logins','Blogged_computations','Reviewed_compendiums'),1:164))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '2'
> 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
Time_in_RFC Geslacht Logins Blogged_computations Reviewed_compendiums
1 255202 0 64 92 34
2 135248 0 59 58 30
3 207223 0 64 62 42
4 189326 1 95 108 34
5 141365 1 46 55 25
6 65295 0 27 8 31
7 439387 0 103 134 29
8 33186 0 19 1 18
9 183696 0 51 64 30
10 186657 0 38 77 29
11 276696 1 99 86 42
12 194414 1 98 96 50
13 141409 0 59 44 33
14 306730 1 68 108 46
15 192691 1 74 63 38
16 333497 1 164 160 52
17 261835 0 59 109 32
18 263451 1 130 86 35
19 157448 1 49 93 25
20 232190 1 73 126 42
21 245725 0 64 110 40
22 388603 0 92 86 35
23 156540 0 34 50 25
24 156189 0 47 92 46
25 189726 0 106 123 39
26 192167 0 106 81 35
27 249893 1 122 93 38
28 236812 1 76 113 35
29 143160 1 47 52 28
30 259667 0 54 113 37
31 243020 0 68 113 40
32 176062 0 67 44 42
33 286683 0 79 123 44
34 87485 1 33 38 33
35 329737 0 88 111 38
36 247082 1 51 77 37
37 378463 0 108 102 41
38 191653 1 75 74 32
39 114673 0 31 33 17
40 301596 0 167 107 39
41 284195 0 73 108 33
42 155568 1 60 66 35
43 177306 1 67 69 32
44 144595 1 51 62 35
45 140319 0 73 50 45
46 405267 1 135 91 38
47 78800 1 42 20 26
48 201970 1 69 101 45
49 302705 1 101 129 44
50 164733 1 50 93 40
51 194221 1 68 89 33
52 24188 0 24 8 4
53 346142 0 288 80 41
54 65029 0 17 21 18
55 101097 0 64 30 14
56 253745 1 51 86 36
57 273513 0 77 116 49
58 282220 1 160 106 32
59 280928 1 120 132 37
60 214872 1 74 75 32
61 342048 0 127 139 43
62 273924 0 108 121 25
63 195726 1 92 57 42
64 231162 1 80 67 37
65 209798 0 61 45 33
66 201345 1 60 88 28
67 180231 0 118 79 31
68 204441 1 129 75 40
69 197813 0 67 114 32
70 136421 1 60 127 25
71 216092 1 59 86 42
72 73566 1 32 22 23
73 213998 0 70 67 42
74 181728 1 50 77 38
75 148758 0 51 105 34
76 308343 0 71 121 39
77 251437 1 78 88 32
78 202388 0 102 78 37
79 173286 0 56 122 34
80 155529 0 58 66 33
81 132672 0 41 58 25
82 390163 1 102 134 45
83 145905 0 66 30 26
84 228012 0 88 103 40
85 80953 1 25 49 8
86 130805 0 47 26 27
87 135163 1 49 67 32
88 333790 1 168 59 37
89 271806 1 95 95 50
90 164235 1 99 156 41
91 234092 1 80 74 37
92 207158 0 69 137 38
93 156583 0 57 37 28
94 242395 0 68 111 36
95 261601 1 70 58 32
96 178489 1 35 78 32
97 204221 0 44 88 33
98 268066 1 69 152 35
99 327622 1 133 130 58
100 361799 1 101 145 27
101 247131 0 107 108 45
102 265849 1 58 138 37
103 162336 0 162 62 32
104 43287 1 14 13 19
105 172244 0 68 89 22
106 189021 0 121 86 35
107 227681 0 43 116 36
108 269329 0 81 157 36
109 106503 0 56 28 23
110 117891 1 77 83 40
111 287201 1 59 72 40
112 266805 0 78 134 42
113 23623 0 11 12 1
114 174954 1 69 120 36
115 61857 0 25 23 11
116 144889 1 43 83 40
117 347988 1 103 126 34
118 21054 0 16 4 0
119 224051 1 46 71 27
120 31414 1 19 18 8
121 278660 1 107 98 35
122 209481 0 58 68 44
123 156870 0 75 44 40
124 112933 1 46 29 28
125 38214 0 34 16 8
126 166011 0 35 61 36
127 316044 1 73 117 47
128 181578 1 56 46 48
129 358903 1 72 129 45
130 275578 1 91 139 48
131 368796 1 106 136 49
132 172464 1 31 66 35
133 94381 1 35 42 32
134 250563 1 290 75 36
135 382499 1 154 97 42
136 118010 1 42 49 35
137 365575 1 122 127 42
138 147989 1 72 55 34
139 231681 1 46 101 41
140 193119 0 77 80 36
141 189020 0 108 29 32
142 341958 0 106 95 33
143 222060 1 79 120 35
144 173260 0 63 41 21
145 274787 0 91 128 42
146 130908 1 52 142 49
147 204009 0 75 88 33
148 262412 0 94 170 39
149 1 0 0 0 0
150 14688 0 10 4 0
151 98 0 1 0 0
152 455 0 2 0 0
153 0 1 0 0 0
154 0 0 0 0 0
155 195765 1 75 56 33
156 334258 0 129 121 47
157 0 0 0 0 0
158 203 0 4 0 0
159 7199 0 5 7 0
160 46660 1 20 12 5
161 17547 1 5 0 1
162 107465 0 38 37 38
163 969 1 2 0 0
164 179994 1 58 47 28
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Geslacht Logins
5060.8 -1704.7 754.5
Blogged_computations Reviewed_compendiums
1081.2 1694.1
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-151949 -23607 -5060 19558 162597
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5060.8 10410.0 0.486 0.627533
Geslacht -1704.7 7803.2 -0.218 0.827351
Logins 754.5 109.4 6.896 1.19e-10 ***
Blogged_computations 1081.2 135.7 7.966 2.97e-13 ***
Reviewed_compendiums 1694.1 466.9 3.628 0.000384 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 48910 on 159 degrees of freedom
Multiple R-squared: 0.7654, Adjusted R-squared: 0.7595
F-statistic: 129.7 on 4 and 159 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,] 0.7341225 5.317549e-01 2.658775e-01
[2,] 0.6235353 7.529293e-01 3.764647e-01
[3,] 0.5679412 8.641175e-01 4.320588e-01
[4,] 0.6269797 7.460405e-01 3.730203e-01
[5,] 0.5875746 8.248508e-01 4.124254e-01
[6,] 0.4978769 9.957538e-01 5.021231e-01
[7,] 0.6009612 7.980775e-01 3.990388e-01
[8,] 0.5555109 8.889782e-01 4.444891e-01
[9,] 0.6163306 7.673387e-01 3.836694e-01
[10,] 0.5807442 8.385116e-01 4.192558e-01
[11,] 0.5538397 8.923207e-01 4.461603e-01
[12,] 0.5524621 8.950759e-01 4.475379e-01
[13,] 0.5202865 9.594270e-01 4.797135e-01
[14,] 0.4668793 9.337586e-01 5.331207e-01
[15,] 0.8314083 3.371834e-01 1.685917e-01
[16,] 0.7868940 4.262120e-01 2.131060e-01
[17,] 0.8047062 3.905876e-01 1.952938e-01
[18,] 0.9640251 7.194988e-02 3.597494e-02
[19,] 0.9670459 6.590814e-02 3.295407e-02
[20,] 0.9539439 9.211216e-02 4.605608e-02
[21,] 0.9371974 1.256051e-01 6.280256e-02
[22,] 0.9168654 1.662692e-01 8.313462e-02
[23,] 0.8945778 2.108445e-01 1.054222e-01
[24,] 0.8670942 2.658115e-01 1.329058e-01
[25,] 0.8385122 3.229756e-01 1.614878e-01
[26,] 0.8019004 3.961992e-01 1.980996e-01
[27,] 0.7672081 4.655838e-01 2.327919e-01
[28,] 0.7836739 4.326521e-01 2.163261e-01
[29,] 0.8304065 3.391871e-01 1.695935e-01
[30,] 0.9147813 1.704374e-01 8.521870e-02
[31,] 0.8915402 2.169197e-01 1.084598e-01
[32,] 0.8681040 2.637920e-01 1.318960e-01
[33,] 0.8549568 2.900863e-01 1.450432e-01
[34,] 0.8401752 3.196495e-01 1.598248e-01
[35,] 0.8097953 3.804094e-01 1.902047e-01
[36,] 0.7725210 4.549580e-01 2.274790e-01
[37,] 0.7358493 5.283013e-01 2.641507e-01
[38,] 0.7172062 5.655875e-01 2.827938e-01
[39,] 0.9231476 1.537048e-01 7.685239e-02
[40,] 0.9065990 1.868020e-01 9.340101e-02
[41,] 0.8917061 2.165878e-01 1.082939e-01
[42,] 0.8677094 2.645812e-01 1.322906e-01
[43,] 0.8546173 2.907654e-01 1.453827e-01
[44,] 0.8273604 3.452792e-01 1.726396e-01
[45,] 0.8278830 3.442340e-01 1.721170e-01
[46,] 0.8311920 3.376159e-01 1.688080e-01
[47,] 0.8017520 3.964960e-01 1.982480e-01
[48,] 0.7756417 4.487166e-01 2.243583e-01
[49,] 0.7919577 4.160847e-01 2.080423e-01
[50,] 0.7567611 4.864778e-01 2.432389e-01
[51,] 0.7239209 5.521582e-01 2.760791e-01
[52,] 0.6979595 6.040810e-01 3.020405e-01
[53,] 0.6641048 6.717903e-01 3.358952e-01
[54,] 0.6295344 7.409312e-01 3.704656e-01
[55,] 0.6056032 7.887936e-01 3.943968e-01
[56,] 0.5660434 8.679133e-01 4.339566e-01
[57,] 0.5490705 9.018589e-01 4.509295e-01
[58,] 0.5616903 8.766194e-01 4.383097e-01
[59,] 0.5162425 9.675150e-01 4.837575e-01
[60,] 0.5336773 9.326455e-01 4.663227e-01
[61,] 0.5182183 9.635634e-01 4.817817e-01
[62,] 0.5210486 9.579029e-01 4.789514e-01
[63,] 0.6598466 6.803067e-01 3.401534e-01
[64,] 0.6181248 7.637504e-01 3.818752e-01
[65,] 0.5798952 8.402096e-01 4.201048e-01
[66,] 0.5377242 9.245516e-01 4.622758e-01
[67,] 0.4935262 9.870523e-01 5.064738e-01
[68,] 0.5425987 9.148026e-01 4.574013e-01
[69,] 0.5499884 9.000232e-01 4.500116e-01
[70,] 0.5351866 9.296269e-01 4.648134e-01
[71,] 0.5037062 9.925877e-01 4.962938e-01
[72,] 0.5420076 9.159848e-01 4.579924e-01
[73,] 0.5047156 9.905688e-01 4.952844e-01
[74,] 0.4612585 9.225171e-01 5.387415e-01
[75,] 0.5639935 8.720131e-01 4.360065e-01
[76,] 0.5234576 9.530847e-01 4.765424e-01
[77,] 0.4879681 9.759363e-01 5.120319e-01
[78,] 0.4438612 8.877225e-01 5.561388e-01
[79,] 0.4048993 8.097985e-01 5.951007e-01
[80,] 0.3799789 7.599577e-01 6.200211e-01
[81,] 0.4492798 8.985595e-01 5.507202e-01
[82,] 0.4061470 8.122940e-01 5.938530e-01
[83,] 0.7702118 4.595763e-01 2.297882e-01
[84,] 0.7453826 5.092348e-01 2.546174e-01
[85,] 0.7637856 4.724288e-01 2.362144e-01
[86,] 0.7368097 5.263805e-01 2.631903e-01
[87,] 0.6986761 6.026477e-01 3.013239e-01
[88,] 0.7830679 4.338643e-01 2.169321e-01
[89,] 0.7488242 5.023516e-01 2.511758e-01
[90,] 0.7152506 5.694988e-01 2.847494e-01
[91,] 0.6800231 6.399538e-01 3.199769e-01
[92,] 0.6394694 7.210612e-01 3.605306e-01
[93,] 0.7024947 5.950106e-01 2.975053e-01
[94,] 0.6730373 6.539253e-01 3.269627e-01
[95,] 0.6300575 7.398849e-01 3.699425e-01
[96,] 0.7033255 5.933490e-01 2.966745e-01
[97,] 0.6675448 6.649105e-01 3.324552e-01
[98,] 0.6277060 7.445881e-01 3.722940e-01
[99,] 0.6423195 7.153610e-01 3.576805e-01
[100,] 0.5965662 8.068676e-01 4.034338e-01
[101,] 0.5622780 8.754440e-01 4.377220e-01
[102,] 0.5156390 9.687220e-01 4.843610e-01
[103,] 0.6736341 6.527318e-01 3.263659e-01
[104,] 0.7758350 4.483301e-01 2.241650e-01
[105,] 0.7399268 5.201464e-01 2.600732e-01
[106,] 0.6979908 6.040183e-01 3.020092e-01
[107,] 0.7570389 4.859222e-01 2.429611e-01
[108,] 0.7157912 5.684177e-01 2.842088e-01
[109,] 0.7240337 5.519326e-01 2.759663e-01
[110,] 0.7638629 4.722742e-01 2.361371e-01
[111,] 0.7220000 5.560000e-01 2.780000e-01
[112,] 0.7466116 5.067769e-01 2.533884e-01
[113,] 0.7093415 5.813169e-01 2.906585e-01
[114,] 0.6792690 6.414620e-01 3.207310e-01
[115,] 0.6317756 7.364489e-01 3.682244e-01
[116,] 0.5902087 8.195827e-01 4.097913e-01
[117,] 0.5371385 9.257230e-01 4.628615e-01
[118,] 0.4932835 9.865670e-01 5.067165e-01
[119,] 0.4384704 8.769407e-01 5.615296e-01
[120,] 0.4376893 8.753787e-01 5.623107e-01
[121,] 0.3828059 7.656118e-01 6.171941e-01
[122,] 0.5079303 9.841393e-01 4.920697e-01
[123,] 0.4596485 9.192971e-01 5.403515e-01
[124,] 0.5028123 9.943754e-01 4.971877e-01
[125,] 0.4547936 9.095872e-01 5.452064e-01
[126,] 0.4195936 8.391873e-01 5.804064e-01
[127,] 0.9981170 3.765994e-03 1.882997e-03
[128,] 0.9973654 5.269245e-03 2.634623e-03
[129,] 0.9955654 8.869130e-03 4.434565e-03
[130,] 0.9951527 9.694501e-03 4.847251e-03
[131,] 0.9951308 9.738323e-03 4.869161e-03
[132,] 0.9996357 7.286135e-04 3.643067e-04
[133,] 0.9992828 1.434457e-03 7.172285e-04
[134,] 0.9999996 7.747132e-07 3.873566e-07
[135,] 1.0000000 9.392635e-09 4.696318e-09
[136,] 1.0000000 3.908893e-08 1.954446e-08
[137,] 0.9999999 1.647332e-07 8.236662e-08
[138,] 1.0000000 2.886586e-08 1.443293e-08
[139,] 1.0000000 2.330938e-09 1.165469e-09
[140,] 1.0000000 1.560346e-08 7.801730e-09
[141,] 0.9999999 1.005423e-07 5.027116e-08
[142,] 0.9999997 5.691343e-07 2.845672e-07
[143,] 0.9999983 3.419680e-06 1.709840e-06
[144,] 0.9999899 2.020267e-05 1.010133e-05
[145,] 0.9999414 1.172567e-04 5.862834e-05
[146,] 0.9996995 6.009675e-04 3.004838e-04
[147,] 0.9986575 2.684958e-03 1.342479e-03
[148,] 0.9961546 7.690828e-03 3.845414e-03
[149,] 0.9914724 1.705518e-02 8.527589e-03
> postscript(file="/var/wessaorg/rcomp/tmp/1dnba1355163860.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/2yfix1355163860.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/322i31355163860.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/44w2s1355163860.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/584931355163860.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 164
Frequency = 1
1 2 3 4 5 6
44779.2700 -27863.7177 15684.5044 -60081.5937 1480.8124 -21304.7368
7 8 9 10 11 12
162597.0536 -17785.6172 20132.9292 20540.5695 34504.7158 -71388.0014
13 14 15 16 17 18
-11647.7295 57364.8382 1007.2914 -54689.8961 40192.0059 9728.7132
19 20 21 22 23 24
-25786.6992 -33633.5297 5675.3678 161847.3506 29411.4180 -61736.3805
25 26 27 28 29 30
-94374.9453 -39745.5823 -10444.1990 -5360.2271 682.6909 29001.0634
31 32 33 34 35 36
-3291.3747 1722.2366 14483.2395 -37762.4205 73886.1486 59308.7776
37 38 39 40 41 42
112170.7895 -2514.1729 21741.8236 -11230.1641 51376.0195 -23713.9800
43 44 45 46 47 48
-5418.9245 -23571.4599 -50117.5545 137283.6668 -21916.9849 -38886.9071
49 50 51 52 53 54
9123.3149 -44667.8207 -12577.2702 -14407.3081 -32174.4912 -6058.3306
55 56 57 58 59 60
-8406.9162 57934.7567 1920.3737 -10679.9413 -18374.2983 20378.0988
61 62 63 64 65 66
18026.1675 14194.0170 -9827.8682 32320.4035 54151.0175 10134.5700
67 68 69 70 71 72
-51796.7780 -45103.7149 -35272.2425 -91875.3306 4081.0454 -16686.0528
73 74 75 76 77 78
12526.2725 -6984.8217 -65912.1973 52812.3162 39868.9914 -26651.0549
79 80 81 82 83 84
-63537.7589 -20560.4241 -8388.0316 88726.5166 14562.7766 -22577.1746
85 86 87 88 89 90
-7799.2671 16429.2717 -31818.3032 77201.5702 9348.7598 -151948.7313
91 92 93 94 95 96
27681.7481 -62469.3437 21074.4802 5022.5285 88506.1522 10177.2108
97 98 99 100 101 102
14907.4884 -10992.8927 -14902.6911 79717.3594 -31670.5514 6838.7937
103 104 105 106 107 108
-86203.2278 -16876.3458 -17623.7628 -59615.3884 3765.0521 -27588.9574
109 110 111 112 113 114
-10049.3453 -101069.1783 93715.5715 -13145.6386 -4406.3242 -71199.4325
115 116 117 118 119 120
-5570.1166 -48417.8981 73082.0835 -403.8659 63478.8133 -19292.8863
121 122 123 124 125 126
29316.5648 12593.9198 -20117.6142 -3921.3614 -23352.7127 7599.1253
127 128 129 130 131 132
51481.0609 4915.3846 85507.9464 -28047.3979 55402.5804 15062.7590
133 134 135 136 137 138
-35006.2754 -113681.1117 86916.1610 -29309.8112 61699.3299 -26759.3699
139 140 141 142 143 144
14954.2127 -17525.7143 16905.0216 98296.3219 -29944.4073 40758.2377
145 146 147 148 149 150
-8484.8268 -148229.3935 -8694.2671 -63452.9616 -5059.7881 -2242.8165
151 152 153 154 155 156
-5717.2963 -6114.8046 -3356.1124 -5060.7881 19365.9764 21412.9777
157 158 159 160 161 162
-5060.7881 -7875.8211 -9202.9848 6768.3471 8724.2388 -30648.9387
163 164
-3896.1289 34623.2828
> postscript(file="/var/wessaorg/rcomp/tmp/61paa1355163860.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 164
Frequency = 1
lag(myerror, k = 1) myerror
0 44779.2700 NA
1 -27863.7177 44779.2700
2 15684.5044 -27863.7177
3 -60081.5937 15684.5044
4 1480.8124 -60081.5937
5 -21304.7368 1480.8124
6 162597.0536 -21304.7368
7 -17785.6172 162597.0536
8 20132.9292 -17785.6172
9 20540.5695 20132.9292
10 34504.7158 20540.5695
11 -71388.0014 34504.7158
12 -11647.7295 -71388.0014
13 57364.8382 -11647.7295
14 1007.2914 57364.8382
15 -54689.8961 1007.2914
16 40192.0059 -54689.8961
17 9728.7132 40192.0059
18 -25786.6992 9728.7132
19 -33633.5297 -25786.6992
20 5675.3678 -33633.5297
21 161847.3506 5675.3678
22 29411.4180 161847.3506
23 -61736.3805 29411.4180
24 -94374.9453 -61736.3805
25 -39745.5823 -94374.9453
26 -10444.1990 -39745.5823
27 -5360.2271 -10444.1990
28 682.6909 -5360.2271
29 29001.0634 682.6909
30 -3291.3747 29001.0634
31 1722.2366 -3291.3747
32 14483.2395 1722.2366
33 -37762.4205 14483.2395
34 73886.1486 -37762.4205
35 59308.7776 73886.1486
36 112170.7895 59308.7776
37 -2514.1729 112170.7895
38 21741.8236 -2514.1729
39 -11230.1641 21741.8236
40 51376.0195 -11230.1641
41 -23713.9800 51376.0195
42 -5418.9245 -23713.9800
43 -23571.4599 -5418.9245
44 -50117.5545 -23571.4599
45 137283.6668 -50117.5545
46 -21916.9849 137283.6668
47 -38886.9071 -21916.9849
48 9123.3149 -38886.9071
49 -44667.8207 9123.3149
50 -12577.2702 -44667.8207
51 -14407.3081 -12577.2702
52 -32174.4912 -14407.3081
53 -6058.3306 -32174.4912
54 -8406.9162 -6058.3306
55 57934.7567 -8406.9162
56 1920.3737 57934.7567
57 -10679.9413 1920.3737
58 -18374.2983 -10679.9413
59 20378.0988 -18374.2983
60 18026.1675 20378.0988
61 14194.0170 18026.1675
62 -9827.8682 14194.0170
63 32320.4035 -9827.8682
64 54151.0175 32320.4035
65 10134.5700 54151.0175
66 -51796.7780 10134.5700
67 -45103.7149 -51796.7780
68 -35272.2425 -45103.7149
69 -91875.3306 -35272.2425
70 4081.0454 -91875.3306
71 -16686.0528 4081.0454
72 12526.2725 -16686.0528
73 -6984.8217 12526.2725
74 -65912.1973 -6984.8217
75 52812.3162 -65912.1973
76 39868.9914 52812.3162
77 -26651.0549 39868.9914
78 -63537.7589 -26651.0549
79 -20560.4241 -63537.7589
80 -8388.0316 -20560.4241
81 88726.5166 -8388.0316
82 14562.7766 88726.5166
83 -22577.1746 14562.7766
84 -7799.2671 -22577.1746
85 16429.2717 -7799.2671
86 -31818.3032 16429.2717
87 77201.5702 -31818.3032
88 9348.7598 77201.5702
89 -151948.7313 9348.7598
90 27681.7481 -151948.7313
91 -62469.3437 27681.7481
92 21074.4802 -62469.3437
93 5022.5285 21074.4802
94 88506.1522 5022.5285
95 10177.2108 88506.1522
96 14907.4884 10177.2108
97 -10992.8927 14907.4884
98 -14902.6911 -10992.8927
99 79717.3594 -14902.6911
100 -31670.5514 79717.3594
101 6838.7937 -31670.5514
102 -86203.2278 6838.7937
103 -16876.3458 -86203.2278
104 -17623.7628 -16876.3458
105 -59615.3884 -17623.7628
106 3765.0521 -59615.3884
107 -27588.9574 3765.0521
108 -10049.3453 -27588.9574
109 -101069.1783 -10049.3453
110 93715.5715 -101069.1783
111 -13145.6386 93715.5715
112 -4406.3242 -13145.6386
113 -71199.4325 -4406.3242
114 -5570.1166 -71199.4325
115 -48417.8981 -5570.1166
116 73082.0835 -48417.8981
117 -403.8659 73082.0835
118 63478.8133 -403.8659
119 -19292.8863 63478.8133
120 29316.5648 -19292.8863
121 12593.9198 29316.5648
122 -20117.6142 12593.9198
123 -3921.3614 -20117.6142
124 -23352.7127 -3921.3614
125 7599.1253 -23352.7127
126 51481.0609 7599.1253
127 4915.3846 51481.0609
128 85507.9464 4915.3846
129 -28047.3979 85507.9464
130 55402.5804 -28047.3979
131 15062.7590 55402.5804
132 -35006.2754 15062.7590
133 -113681.1117 -35006.2754
134 86916.1610 -113681.1117
135 -29309.8112 86916.1610
136 61699.3299 -29309.8112
137 -26759.3699 61699.3299
138 14954.2127 -26759.3699
139 -17525.7143 14954.2127
140 16905.0216 -17525.7143
141 98296.3219 16905.0216
142 -29944.4073 98296.3219
143 40758.2377 -29944.4073
144 -8484.8268 40758.2377
145 -148229.3935 -8484.8268
146 -8694.2671 -148229.3935
147 -63452.9616 -8694.2671
148 -5059.7881 -63452.9616
149 -2242.8165 -5059.7881
150 -5717.2963 -2242.8165
151 -6114.8046 -5717.2963
152 -3356.1124 -6114.8046
153 -5060.7881 -3356.1124
154 19365.9764 -5060.7881
155 21412.9777 19365.9764
156 -5060.7881 21412.9777
157 -7875.8211 -5060.7881
158 -9202.9848 -7875.8211
159 6768.3471 -9202.9848
160 8724.2388 6768.3471
161 -30648.9387 8724.2388
162 -3896.1289 -30648.9387
163 34623.2828 -3896.1289
164 NA 34623.2828
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -27863.7177 44779.2700
[2,] 15684.5044 -27863.7177
[3,] -60081.5937 15684.5044
[4,] 1480.8124 -60081.5937
[5,] -21304.7368 1480.8124
[6,] 162597.0536 -21304.7368
[7,] -17785.6172 162597.0536
[8,] 20132.9292 -17785.6172
[9,] 20540.5695 20132.9292
[10,] 34504.7158 20540.5695
[11,] -71388.0014 34504.7158
[12,] -11647.7295 -71388.0014
[13,] 57364.8382 -11647.7295
[14,] 1007.2914 57364.8382
[15,] -54689.8961 1007.2914
[16,] 40192.0059 -54689.8961
[17,] 9728.7132 40192.0059
[18,] -25786.6992 9728.7132
[19,] -33633.5297 -25786.6992
[20,] 5675.3678 -33633.5297
[21,] 161847.3506 5675.3678
[22,] 29411.4180 161847.3506
[23,] -61736.3805 29411.4180
[24,] -94374.9453 -61736.3805
[25,] -39745.5823 -94374.9453
[26,] -10444.1990 -39745.5823
[27,] -5360.2271 -10444.1990
[28,] 682.6909 -5360.2271
[29,] 29001.0634 682.6909
[30,] -3291.3747 29001.0634
[31,] 1722.2366 -3291.3747
[32,] 14483.2395 1722.2366
[33,] -37762.4205 14483.2395
[34,] 73886.1486 -37762.4205
[35,] 59308.7776 73886.1486
[36,] 112170.7895 59308.7776
[37,] -2514.1729 112170.7895
[38,] 21741.8236 -2514.1729
[39,] -11230.1641 21741.8236
[40,] 51376.0195 -11230.1641
[41,] -23713.9800 51376.0195
[42,] -5418.9245 -23713.9800
[43,] -23571.4599 -5418.9245
[44,] -50117.5545 -23571.4599
[45,] 137283.6668 -50117.5545
[46,] -21916.9849 137283.6668
[47,] -38886.9071 -21916.9849
[48,] 9123.3149 -38886.9071
[49,] -44667.8207 9123.3149
[50,] -12577.2702 -44667.8207
[51,] -14407.3081 -12577.2702
[52,] -32174.4912 -14407.3081
[53,] -6058.3306 -32174.4912
[54,] -8406.9162 -6058.3306
[55,] 57934.7567 -8406.9162
[56,] 1920.3737 57934.7567
[57,] -10679.9413 1920.3737
[58,] -18374.2983 -10679.9413
[59,] 20378.0988 -18374.2983
[60,] 18026.1675 20378.0988
[61,] 14194.0170 18026.1675
[62,] -9827.8682 14194.0170
[63,] 32320.4035 -9827.8682
[64,] 54151.0175 32320.4035
[65,] 10134.5700 54151.0175
[66,] -51796.7780 10134.5700
[67,] -45103.7149 -51796.7780
[68,] -35272.2425 -45103.7149
[69,] -91875.3306 -35272.2425
[70,] 4081.0454 -91875.3306
[71,] -16686.0528 4081.0454
[72,] 12526.2725 -16686.0528
[73,] -6984.8217 12526.2725
[74,] -65912.1973 -6984.8217
[75,] 52812.3162 -65912.1973
[76,] 39868.9914 52812.3162
[77,] -26651.0549 39868.9914
[78,] -63537.7589 -26651.0549
[79,] -20560.4241 -63537.7589
[80,] -8388.0316 -20560.4241
[81,] 88726.5166 -8388.0316
[82,] 14562.7766 88726.5166
[83,] -22577.1746 14562.7766
[84,] -7799.2671 -22577.1746
[85,] 16429.2717 -7799.2671
[86,] -31818.3032 16429.2717
[87,] 77201.5702 -31818.3032
[88,] 9348.7598 77201.5702
[89,] -151948.7313 9348.7598
[90,] 27681.7481 -151948.7313
[91,] -62469.3437 27681.7481
[92,] 21074.4802 -62469.3437
[93,] 5022.5285 21074.4802
[94,] 88506.1522 5022.5285
[95,] 10177.2108 88506.1522
[96,] 14907.4884 10177.2108
[97,] -10992.8927 14907.4884
[98,] -14902.6911 -10992.8927
[99,] 79717.3594 -14902.6911
[100,] -31670.5514 79717.3594
[101,] 6838.7937 -31670.5514
[102,] -86203.2278 6838.7937
[103,] -16876.3458 -86203.2278
[104,] -17623.7628 -16876.3458
[105,] -59615.3884 -17623.7628
[106,] 3765.0521 -59615.3884
[107,] -27588.9574 3765.0521
[108,] -10049.3453 -27588.9574
[109,] -101069.1783 -10049.3453
[110,] 93715.5715 -101069.1783
[111,] -13145.6386 93715.5715
[112,] -4406.3242 -13145.6386
[113,] -71199.4325 -4406.3242
[114,] -5570.1166 -71199.4325
[115,] -48417.8981 -5570.1166
[116,] 73082.0835 -48417.8981
[117,] -403.8659 73082.0835
[118,] 63478.8133 -403.8659
[119,] -19292.8863 63478.8133
[120,] 29316.5648 -19292.8863
[121,] 12593.9198 29316.5648
[122,] -20117.6142 12593.9198
[123,] -3921.3614 -20117.6142
[124,] -23352.7127 -3921.3614
[125,] 7599.1253 -23352.7127
[126,] 51481.0609 7599.1253
[127,] 4915.3846 51481.0609
[128,] 85507.9464 4915.3846
[129,] -28047.3979 85507.9464
[130,] 55402.5804 -28047.3979
[131,] 15062.7590 55402.5804
[132,] -35006.2754 15062.7590
[133,] -113681.1117 -35006.2754
[134,] 86916.1610 -113681.1117
[135,] -29309.8112 86916.1610
[136,] 61699.3299 -29309.8112
[137,] -26759.3699 61699.3299
[138,] 14954.2127 -26759.3699
[139,] -17525.7143 14954.2127
[140,] 16905.0216 -17525.7143
[141,] 98296.3219 16905.0216
[142,] -29944.4073 98296.3219
[143,] 40758.2377 -29944.4073
[144,] -8484.8268 40758.2377
[145,] -148229.3935 -8484.8268
[146,] -8694.2671 -148229.3935
[147,] -63452.9616 -8694.2671
[148,] -5059.7881 -63452.9616
[149,] -2242.8165 -5059.7881
[150,] -5717.2963 -2242.8165
[151,] -6114.8046 -5717.2963
[152,] -3356.1124 -6114.8046
[153,] -5060.7881 -3356.1124
[154,] 19365.9764 -5060.7881
[155,] 21412.9777 19365.9764
[156,] -5060.7881 21412.9777
[157,] -7875.8211 -5060.7881
[158,] -9202.9848 -7875.8211
[159,] 6768.3471 -9202.9848
[160,] 8724.2388 6768.3471
[161,] -30648.9387 8724.2388
[162,] -3896.1289 -30648.9387
[163,] 34623.2828 -3896.1289
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -27863.7177 44779.2700
2 15684.5044 -27863.7177
3 -60081.5937 15684.5044
4 1480.8124 -60081.5937
5 -21304.7368 1480.8124
6 162597.0536 -21304.7368
7 -17785.6172 162597.0536
8 20132.9292 -17785.6172
9 20540.5695 20132.9292
10 34504.7158 20540.5695
11 -71388.0014 34504.7158
12 -11647.7295 -71388.0014
13 57364.8382 -11647.7295
14 1007.2914 57364.8382
15 -54689.8961 1007.2914
16 40192.0059 -54689.8961
17 9728.7132 40192.0059
18 -25786.6992 9728.7132
19 -33633.5297 -25786.6992
20 5675.3678 -33633.5297
21 161847.3506 5675.3678
22 29411.4180 161847.3506
23 -61736.3805 29411.4180
24 -94374.9453 -61736.3805
25 -39745.5823 -94374.9453
26 -10444.1990 -39745.5823
27 -5360.2271 -10444.1990
28 682.6909 -5360.2271
29 29001.0634 682.6909
30 -3291.3747 29001.0634
31 1722.2366 -3291.3747
32 14483.2395 1722.2366
33 -37762.4205 14483.2395
34 73886.1486 -37762.4205
35 59308.7776 73886.1486
36 112170.7895 59308.7776
37 -2514.1729 112170.7895
38 21741.8236 -2514.1729
39 -11230.1641 21741.8236
40 51376.0195 -11230.1641
41 -23713.9800 51376.0195
42 -5418.9245 -23713.9800
43 -23571.4599 -5418.9245
44 -50117.5545 -23571.4599
45 137283.6668 -50117.5545
46 -21916.9849 137283.6668
47 -38886.9071 -21916.9849
48 9123.3149 -38886.9071
49 -44667.8207 9123.3149
50 -12577.2702 -44667.8207
51 -14407.3081 -12577.2702
52 -32174.4912 -14407.3081
53 -6058.3306 -32174.4912
54 -8406.9162 -6058.3306
55 57934.7567 -8406.9162
56 1920.3737 57934.7567
57 -10679.9413 1920.3737
58 -18374.2983 -10679.9413
59 20378.0988 -18374.2983
60 18026.1675 20378.0988
61 14194.0170 18026.1675
62 -9827.8682 14194.0170
63 32320.4035 -9827.8682
64 54151.0175 32320.4035
65 10134.5700 54151.0175
66 -51796.7780 10134.5700
67 -45103.7149 -51796.7780
68 -35272.2425 -45103.7149
69 -91875.3306 -35272.2425
70 4081.0454 -91875.3306
71 -16686.0528 4081.0454
72 12526.2725 -16686.0528
73 -6984.8217 12526.2725
74 -65912.1973 -6984.8217
75 52812.3162 -65912.1973
76 39868.9914 52812.3162
77 -26651.0549 39868.9914
78 -63537.7589 -26651.0549
79 -20560.4241 -63537.7589
80 -8388.0316 -20560.4241
81 88726.5166 -8388.0316
82 14562.7766 88726.5166
83 -22577.1746 14562.7766
84 -7799.2671 -22577.1746
85 16429.2717 -7799.2671
86 -31818.3032 16429.2717
87 77201.5702 -31818.3032
88 9348.7598 77201.5702
89 -151948.7313 9348.7598
90 27681.7481 -151948.7313
91 -62469.3437 27681.7481
92 21074.4802 -62469.3437
93 5022.5285 21074.4802
94 88506.1522 5022.5285
95 10177.2108 88506.1522
96 14907.4884 10177.2108
97 -10992.8927 14907.4884
98 -14902.6911 -10992.8927
99 79717.3594 -14902.6911
100 -31670.5514 79717.3594
101 6838.7937 -31670.5514
102 -86203.2278 6838.7937
103 -16876.3458 -86203.2278
104 -17623.7628 -16876.3458
105 -59615.3884 -17623.7628
106 3765.0521 -59615.3884
107 -27588.9574 3765.0521
108 -10049.3453 -27588.9574
109 -101069.1783 -10049.3453
110 93715.5715 -101069.1783
111 -13145.6386 93715.5715
112 -4406.3242 -13145.6386
113 -71199.4325 -4406.3242
114 -5570.1166 -71199.4325
115 -48417.8981 -5570.1166
116 73082.0835 -48417.8981
117 -403.8659 73082.0835
118 63478.8133 -403.8659
119 -19292.8863 63478.8133
120 29316.5648 -19292.8863
121 12593.9198 29316.5648
122 -20117.6142 12593.9198
123 -3921.3614 -20117.6142
124 -23352.7127 -3921.3614
125 7599.1253 -23352.7127
126 51481.0609 7599.1253
127 4915.3846 51481.0609
128 85507.9464 4915.3846
129 -28047.3979 85507.9464
130 55402.5804 -28047.3979
131 15062.7590 55402.5804
132 -35006.2754 15062.7590
133 -113681.1117 -35006.2754
134 86916.1610 -113681.1117
135 -29309.8112 86916.1610
136 61699.3299 -29309.8112
137 -26759.3699 61699.3299
138 14954.2127 -26759.3699
139 -17525.7143 14954.2127
140 16905.0216 -17525.7143
141 98296.3219 16905.0216
142 -29944.4073 98296.3219
143 40758.2377 -29944.4073
144 -8484.8268 40758.2377
145 -148229.3935 -8484.8268
146 -8694.2671 -148229.3935
147 -63452.9616 -8694.2671
148 -5059.7881 -63452.9616
149 -2242.8165 -5059.7881
150 -5717.2963 -2242.8165
151 -6114.8046 -5717.2963
152 -3356.1124 -6114.8046
153 -5060.7881 -3356.1124
154 19365.9764 -5060.7881
155 21412.9777 19365.9764
156 -5060.7881 21412.9777
157 -7875.8211 -5060.7881
158 -9202.9848 -7875.8211
159 6768.3471 -9202.9848
160 8724.2388 6768.3471
161 -30648.9387 8724.2388
162 -3896.1289 -30648.9387
163 34623.2828 -3896.1289
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/7uu6y1355163860.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/81l821355163860.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/99uu91355163860.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/wessaorg/rcomp/tmp/10kmbl1355163860.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/119iwp1355163860.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/12ttd81355163860.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/13nbp21355163860.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/14p1wr1355163860.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/154umq1355163860.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/16lzwm1355163861.tab")
+ }
>
> try(system("convert tmp/1dnba1355163860.ps tmp/1dnba1355163860.png",intern=TRUE))
character(0)
> try(system("convert tmp/2yfix1355163860.ps tmp/2yfix1355163860.png",intern=TRUE))
character(0)
> try(system("convert tmp/322i31355163860.ps tmp/322i31355163860.png",intern=TRUE))
character(0)
> try(system("convert tmp/44w2s1355163860.ps tmp/44w2s1355163860.png",intern=TRUE))
character(0)
> try(system("convert tmp/584931355163860.ps tmp/584931355163860.png",intern=TRUE))
character(0)
> try(system("convert tmp/61paa1355163860.ps tmp/61paa1355163860.png",intern=TRUE))
character(0)
> try(system("convert tmp/7uu6y1355163860.ps tmp/7uu6y1355163860.png",intern=TRUE))
character(0)
> try(system("convert tmp/81l821355163860.ps tmp/81l821355163860.png",intern=TRUE))
character(0)
> try(system("convert tmp/99uu91355163860.ps tmp/99uu91355163860.png",intern=TRUE))
character(0)
> try(system("convert tmp/10kmbl1355163860.ps tmp/10kmbl1355163860.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.734 1.150 8.890