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(1966
+ ,1
+ ,41
+ ,1966
+ ,2
+ ,39
+ ,1966
+ ,3
+ ,50
+ ,1966
+ ,4
+ ,40
+ ,1966
+ ,5
+ ,43
+ ,1966
+ ,6
+ ,38
+ ,1966
+ ,7
+ ,44
+ ,1966
+ ,8
+ ,35
+ ,1966
+ ,9
+ ,39
+ ,1966
+ ,10
+ ,35
+ ,1966
+ ,11
+ ,29
+ ,1966
+ ,12
+ ,49
+ ,1967
+ ,1
+ ,50
+ ,1967
+ ,2
+ ,59
+ ,1967
+ ,3
+ ,63
+ ,1967
+ ,4
+ ,32
+ ,1967
+ ,5
+ ,39
+ ,1967
+ ,6
+ ,47
+ ,1967
+ ,7
+ ,53
+ ,1967
+ ,8
+ ,60
+ ,1967
+ ,9
+ ,57
+ ,1967
+ ,10
+ ,52
+ ,1967
+ ,11
+ ,70
+ ,1967
+ ,12
+ ,90
+ ,1968
+ ,1
+ ,74
+ ,1968
+ ,2
+ ,62
+ ,1968
+ ,3
+ ,55
+ ,1968
+ ,4
+ ,84
+ ,1968
+ ,5
+ ,94
+ ,1968
+ ,6
+ ,70
+ ,1968
+ ,7
+ ,108
+ ,1968
+ ,8
+ ,139
+ ,1968
+ ,9
+ ,120
+ ,1968
+ ,10
+ ,97
+ ,1968
+ ,11
+ ,126
+ ,1968
+ ,12
+ ,149
+ ,1969
+ ,1
+ ,158
+ ,1969
+ ,2
+ ,124
+ ,1969
+ ,3
+ ,140
+ ,1969
+ ,4
+ ,109
+ ,1969
+ ,5
+ ,114
+ ,1969
+ ,6
+ ,77
+ ,1969
+ ,7
+ ,120
+ ,1969
+ ,8
+ ,133
+ ,1969
+ ,9
+ ,110
+ ,1969
+ ,10
+ ,92
+ ,1969
+ ,11
+ ,97
+ ,1969
+ ,12
+ ,78
+ ,1970
+ ,1
+ ,99
+ ,1970
+ ,2
+ ,107
+ ,1970
+ ,3
+ ,112
+ ,1970
+ ,4
+ ,90
+ ,1970
+ ,5
+ ,98
+ ,1970
+ ,6
+ ,125
+ ,1970
+ ,7
+ ,155
+ ,1970
+ ,8
+ ,190
+ ,1970
+ ,9
+ ,236
+ ,1970
+ ,10
+ ,189
+ ,1970
+ ,11
+ ,174
+ ,1970
+ ,12
+ ,178
+ ,1971
+ ,1
+ ,136
+ ,1971
+ ,2
+ ,161
+ ,1971
+ ,3
+ ,171
+ ,1971
+ ,4
+ ,149
+ ,1971
+ ,5
+ ,184
+ ,1971
+ ,6
+ ,155
+ ,1971
+ ,7
+ ,276
+ ,1971
+ ,8
+ ,224
+ ,1971
+ ,9
+ ,213
+ ,1971
+ ,10
+ ,279
+ ,1971
+ ,11
+ ,268
+ ,1971
+ ,12
+ ,287
+ ,1972
+ ,1
+ ,238
+ ,1972
+ ,2
+ ,213
+ ,1972
+ ,3
+ ,257
+ ,1972
+ ,4
+ ,293
+ ,1972
+ ,5
+ ,212
+ ,1972
+ ,6
+ ,246
+ ,1972
+ ,7
+ ,353
+ ,1972
+ ,8
+ ,339
+ ,1972
+ ,9
+ ,308
+ ,1972
+ ,10
+ ,247
+ ,1972
+ ,11
+ ,257
+ ,1972
+ ,12
+ ,322
+ ,1973
+ ,1
+ ,298
+ ,1973
+ ,2
+ ,273
+ ,1973
+ ,3
+ ,312
+ ,1973
+ ,4
+ ,249
+ ,1973
+ ,5
+ ,286
+ ,1973
+ ,6
+ ,279
+ ,1973
+ ,7
+ ,309
+ ,1973
+ ,8
+ ,401
+ ,1973
+ ,9
+ ,309
+ ,1973
+ ,10
+ ,328
+ ,1973
+ ,11
+ ,353
+ ,1973
+ ,12
+ ,354
+ ,1974
+ ,1
+ ,327
+ ,1974
+ ,2
+ ,324
+ ,1974
+ ,3
+ ,285
+ ,1974
+ ,4
+ ,243
+ ,1974
+ ,5
+ ,241
+ ,1974
+ ,6
+ ,287
+ ,1974
+ ,7
+ ,355
+ ,1974
+ ,8
+ ,460
+ ,1974
+ ,9
+ ,364
+ ,1974
+ ,10
+ ,487
+ ,1974
+ ,11
+ ,452
+ ,1974
+ ,12
+ ,391
+ ,1975
+ ,1
+ ,500
+ ,1975
+ ,2
+ ,451
+ ,1975
+ ,3
+ ,375
+ ,1975
+ ,4
+ ,372
+ ,1975
+ ,5
+ ,302
+ ,1975
+ ,6
+ ,316
+ ,1975
+ ,7
+ ,398
+ ,1975
+ ,8
+ ,394
+ ,1975
+ ,9
+ ,431
+ ,1975
+ ,10
+ ,431)
+ ,dim=c(3
+ ,118)
+ ,dimnames=list(c('Year'
+ ,'Month'
+ ,'Robberies')
+ ,1:118))
> y <- array(NA,dim=c(3,118),dimnames=list(c('Year','Month','Robberies'),1:118))
> 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'
> 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, 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
Year Month Robberies t
1 1966 1 41 1
2 1966 2 39 2
3 1966 3 50 3
4 1966 4 40 4
5 1966 5 43 5
6 1966 6 38 6
7 1966 7 44 7
8 1966 8 35 8
9 1966 9 39 9
10 1966 10 35 10
11 1966 11 29 11
12 1966 12 49 12
13 1967 1 50 13
14 1967 2 59 14
15 1967 3 63 15
16 1967 4 32 16
17 1967 5 39 17
18 1967 6 47 18
19 1967 7 53 19
20 1967 8 60 20
21 1967 9 57 21
22 1967 10 52 22
23 1967 11 70 23
24 1967 12 90 24
25 1968 1 74 25
26 1968 2 62 26
27 1968 3 55 27
28 1968 4 84 28
29 1968 5 94 29
30 1968 6 70 30
31 1968 7 108 31
32 1968 8 139 32
33 1968 9 120 33
34 1968 10 97 34
35 1968 11 126 35
36 1968 12 149 36
37 1969 1 158 37
38 1969 2 124 38
39 1969 3 140 39
40 1969 4 109 40
41 1969 5 114 41
42 1969 6 77 42
43 1969 7 120 43
44 1969 8 133 44
45 1969 9 110 45
46 1969 10 92 46
47 1969 11 97 47
48 1969 12 78 48
49 1970 1 99 49
50 1970 2 107 50
51 1970 3 112 51
52 1970 4 90 52
53 1970 5 98 53
54 1970 6 125 54
55 1970 7 155 55
56 1970 8 190 56
57 1970 9 236 57
58 1970 10 189 58
59 1970 11 174 59
60 1970 12 178 60
61 1971 1 136 61
62 1971 2 161 62
63 1971 3 171 63
64 1971 4 149 64
65 1971 5 184 65
66 1971 6 155 66
67 1971 7 276 67
68 1971 8 224 68
69 1971 9 213 69
70 1971 10 279 70
71 1971 11 268 71
72 1971 12 287 72
73 1972 1 238 73
74 1972 2 213 74
75 1972 3 257 75
76 1972 4 293 76
77 1972 5 212 77
78 1972 6 246 78
79 1972 7 353 79
80 1972 8 339 80
81 1972 9 308 81
82 1972 10 247 82
83 1972 11 257 83
84 1972 12 322 84
85 1973 1 298 85
86 1973 2 273 86
87 1973 3 312 87
88 1973 4 249 88
89 1973 5 286 89
90 1973 6 279 90
91 1973 7 309 91
92 1973 8 401 92
93 1973 9 309 93
94 1973 10 328 94
95 1973 11 353 95
96 1973 12 354 96
97 1974 1 327 97
98 1974 2 324 98
99 1974 3 285 99
100 1974 4 243 100
101 1974 5 241 101
102 1974 6 287 102
103 1974 7 355 103
104 1974 8 460 104
105 1974 9 364 105
106 1974 10 487 106
107 1974 11 452 107
108 1974 12 391 108
109 1975 1 500 109
110 1975 2 451 110
111 1975 3 375 111
112 1975 4 372 112
113 1975 5 302 113
114 1975 6 316 114
115 1975 7 398 115
116 1975 8 394 116
117 1975 9 431 117
118 1975 10 431 118
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Month Robberies t
1.966e+03 -8.333e-02 -1.448e-15 8.333e-02
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-4.808e-12 -3.710e-14 3.300e-14 1.129e-13 3.253e-13
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.966e+03 1.183e-13 1.662e+16 <2e-16 ***
Month -8.333e-02 1.280e-14 -6.510e+12 <2e-16 ***
Robberies -1.448e-15 9.923e-16 -1.459e+00 0.147
t 8.333e-02 3.695e-15 2.255e+13 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.668e-13 on 114 degrees of freedom
Multiple R-squared: 1, Adjusted R-squared: 1
F-statistic: 1.451e+27 on 3 and 114 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,] 3.413580e-03 6.827160e-03 9.965864e-01
[2,] 4.696416e-01 9.392832e-01 5.303584e-01
[3,] 7.150545e-01 5.698910e-01 2.849455e-01
[4,] 8.933802e-04 1.786760e-03 9.991066e-01
[5,] 6.109866e-07 1.221973e-06 9.999994e-01
[6,] 7.665344e-02 1.533069e-01 9.233466e-01
[7,] 5.816187e-10 1.163237e-09 1.000000e+00
[8,] 1.000000e+00 1.670569e-64 8.352847e-65
[9,] 1.000000e+00 5.791793e-35 2.895897e-35
[10,] 9.715433e-03 1.943087e-02 9.902846e-01
[11,] 5.848328e-03 1.169666e-02 9.941517e-01
[12,] 1.000000e+00 5.753104e-08 2.876552e-08
[13,] 1.341274e-10 2.682549e-10 1.000000e+00
[14,] 7.103637e-05 1.420727e-04 9.999290e-01
[15,] 7.424768e-01 5.150463e-01 2.575232e-01
[16,] 1.590290e-08 3.180579e-08 1.000000e+00
[17,] 1.000000e+00 7.449586e-35 3.724793e-35
[18,] 1.000000e+00 1.678658e-101 8.393291e-102
[19,] 1.000000e+00 1.495219e-33 7.476097e-34
[20,] 2.076040e-02 4.152080e-02 9.792396e-01
[21,] 1.000000e+00 2.186340e-93 1.093170e-93
[22,] 8.070301e-01 3.859397e-01 1.929699e-01
[23,] 1.000000e+00 4.848401e-94 2.424201e-94
[24,] 1.000000e+00 1.604209e-45 8.021044e-46
[25,] 1.000000e+00 4.331675e-15 2.165837e-15
[26,] 9.999717e-01 5.664067e-05 2.832034e-05
[27,] 1.000000e+00 1.298458e-23 6.492292e-24
[28,] 5.518995e-01 8.962010e-01 4.481005e-01
[29,] 3.828218e-03 7.656435e-03 9.961718e-01
[30,] 3.255385e-06 6.510770e-06 9.999967e-01
[31,] 1.429050e-05 2.858099e-05 9.999857e-01
[32,] 1.072361e-01 2.144723e-01 8.927639e-01
[33,] 1.388881e-36 2.777762e-36 1.000000e+00
[34,] 1.000000e+00 2.183067e-38 1.091534e-38
[35,] 1.000000e+00 1.326666e-31 6.633328e-32
[36,] 1.203706e-06 2.407411e-06 9.999988e-01
[37,] 9.999929e-01 1.413010e-05 7.065049e-06
[38,] 9.999992e-01 1.582927e-06 7.914637e-07
[39,] 9.999985e-01 2.965761e-06 1.482880e-06
[40,] 9.999210e-01 1.579053e-04 7.895264e-05
[41,] 1.000000e+00 6.972551e-62 3.486276e-62
[42,] 1.000000e+00 2.893159e-14 1.446580e-14
[43,] 5.289285e-01 9.421430e-01 4.710715e-01
[44,] 5.920778e-24 1.184156e-23 1.000000e+00
[45,] 1.000000e+00 9.417730e-17 4.708865e-17
[46,] 8.778686e-36 1.755737e-35 1.000000e+00
[47,] 9.999998e-01 4.707123e-07 2.353562e-07
[48,] 1.000000e+00 3.149710e-09 1.574855e-09
[49,] 1.867043e-07 3.734087e-07 9.999998e-01
[50,] 1.000000e+00 5.733574e-36 2.866787e-36
[51,] 1.758289e-24 3.516578e-24 1.000000e+00
[52,] 5.604179e-01 8.791642e-01 4.395821e-01
[53,] 1.000000e+00 7.672313e-10 3.836156e-10
[54,] 9.717923e-01 5.641549e-02 2.820775e-02
[55,] 9.999977e-01 4.535960e-06 2.267980e-06
[56,] 2.002871e-02 4.005743e-02 9.799713e-01
[57,] 9.999999e-01 1.102121e-07 5.510603e-08
[58,] 1.883220e-06 3.766440e-06 9.999981e-01
[59,] 1.743321e-03 3.486643e-03 9.982567e-01
[60,] 1.000000e+00 4.910169e-13 2.455085e-13
[61,] 2.826593e-54 5.653186e-54 1.000000e+00
[62,] 3.141138e-01 6.282275e-01 6.858862e-01
[63,] 4.114055e-23 8.228110e-23 1.000000e+00
[64,] 5.022258e-12 1.004452e-11 1.000000e+00
[65,] 4.409941e-75 8.819881e-75 1.000000e+00
[66,] 1.000000e+00 4.665747e-19 2.332873e-19
[67,] 3.625434e-04 7.250868e-04 9.996375e-01
[68,] 9.999179e-01 1.641038e-04 8.205191e-05
[69,] 4.382633e-06 8.765266e-06 9.999956e-01
[70,] 1.000000e+00 2.465529e-17 1.232764e-17
[71,] 1.547992e-21 3.095984e-21 1.000000e+00
[72,] 7.857721e-01 4.284557e-01 2.142279e-01
[73,] 1.000000e+00 2.094166e-17 1.047083e-17
[74,] 3.354663e-17 6.709325e-17 1.000000e+00
[75,] 1.000000e+00 1.964265e-10 9.821323e-11
[76,] 9.933824e-01 1.323526e-02 6.617628e-03
[77,] 9.875817e-01 2.483659e-02 1.241829e-02
[78,] 7.613625e-01 4.772749e-01 2.386375e-01
[79,] 9.822224e-01 3.555519e-02 1.777759e-02
[80,] 9.999513e-01 9.734795e-05 4.867397e-05
[81,] 1.000000e+00 5.132690e-15 2.566345e-15
[82,] 4.722108e-16 9.444216e-16 1.000000e+00
[83,] 4.054188e-16 8.108376e-16 1.000000e+00
[84,] 1.000000e+00 9.580711e-09 4.790355e-09
[85,] 9.848576e-01 3.028479e-02 1.514239e-02
[86,] 1.000000e+00 4.140403e-28 2.070202e-28
[87,] 2.281843e-23 4.563686e-23 1.000000e+00
[88,] 9.999996e-01 7.185658e-07 3.592829e-07
[89,] 3.081973e-22 6.163947e-22 1.000000e+00
[90,] 7.353291e-01 5.293418e-01 2.646709e-01
[91,] 8.779531e-06 1.755906e-05 9.999912e-01
[92,] 8.712952e-01 2.574095e-01 1.287048e-01
[93,] 1.000000e+00 1.554762e-10 7.773808e-11
[94,] 2.316016e-48 4.632031e-48 1.000000e+00
[95,] 7.926465e-01 4.147070e-01 2.073535e-01
[96,] 1.000000e+00 1.766184e-38 8.830919e-39
[97,] 6.912046e-07 1.382409e-06 9.999993e-01
[98,] 2.082782e-02 4.165564e-02 9.791722e-01
[99,] 9.004322e-01 1.991357e-01 9.956784e-02
[100,] 9.407608e-01 1.184784e-01 5.923920e-02
[101,] 1.000000e+00 6.300124e-21 3.150062e-21
[102,] 9.999995e-01 9.346276e-07 4.673138e-07
[103,] 1.151356e-07 2.302712e-07 9.999999e-01
[104,] 7.097900e-01 5.804201e-01 2.902100e-01
[105,] 9.999984e-01 3.267728e-06 1.633864e-06
> postscript(file="/var/fisher/rcomp/tmp/1wh1x1354887989.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/2wrtb1354887989.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/301301354887989.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/4gkxf1354887989.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/54dhp1354887989.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 = 118
Frequency = 1
1 2 3 4 5
-4.808392e-12 3.252895e-13 3.127628e-13 2.673633e-13 2.437929e-13
6 7 8 9 10
2.066651e-13 1.856031e-13 1.436316e-13 1.194522e-13 8.478450e-14
11 12 13 14 15
4.632544e-14 4.541264e-14 2.864667e-13 2.696965e-13 2.460343e-13
16 17 18 19 20
1.718846e-13 1.526072e-13 1.343355e-13 1.136171e-13 9.434376e-14
21 22 23 24 25
6.018769e-14 2.358482e-14 1.961317e-14 1.863032e-14 2.348351e-13
26 27 28 29 30
1.877901e-13 1.484334e-13 1.609000e-13 1.457520e-13 8.147277e-14
31 32 33 34 35
1.069543e-13 1.220116e-13 6.475720e-14 2.514372e-15 1.473189e-14
36 37 38 39 40
1.832357e-14 2.703745e-13 1.917255e-13 1.852567e-13 1.109462e-13
41 42 43 44 45
8.869229e-14 5.812864e-15 3.841126e-14 2.754560e-14 -3.502599e-14
46 47 48 49 50
-9.079046e-14 -1.129129e-13 -1.696735e-13 9.943930e-14 8.138657e-14
51 52 53 54 55
5.918809e-14 -2.150700e-15 -2.005728e-14 -1.063278e-14 3.194692e-15
56 57 58 59 60
2.425025e-14 6.130105e-14 -3.620529e-14 -8.739592e-14 -1.110230e-13
61 62 63 64 65
6.703325e-14 7.359475e-14 5.840508e-14 -3.009665e-15 1.826489e-14
66 67 68 69 70
-5.320298e-14 9.210966e-14 -1.244051e-14 -5.783477e-14 7.943928e-15
71 72 73 74 75
-3.742254e-14 -3.949725e-14 1.287849e-13 6.261246e-14 9.703827e-14
76 77 78 79 80
1.195823e-13 -2.654321e-14 -7.208693e-15 1.178136e-13 6.768800e-14
81 82 83 84 85
-6.561231e-15 -1.240672e-13 -1.393678e-13 -7.455016e-14 1.293922e-13
86 87 88 89 90
6.351524e-14 9.102452e-14 -2.944984e-14 -5.388073e-15 -4.530881e-14
91 92 93 94 95
-3.131342e-14 7.214940e-14 -9.051824e-14 -9.245633e-14 -8.608552e-14
96 97 98 99 100
-1.141214e-13 8.606589e-14 5.191685e-14 -3.313052e-14 -1.238954e-13
101 102 103 104 105
-1.566260e-13 -1.195780e-13 -5.064253e-14 7.167576e-14 -9.688140e-14
106 107 108 109 110
5.129716e-14 -2.827501e-14 -1.464569e-13 2.496779e-13 1.495670e-13
111 112 113 114 115
9.930512e-15 -2.417047e-14 -1.542539e-13 -1.639509e-13 -7.520711e-14
116 117 118
-1.099346e-13 -8.631858e-14 -1.152404e-13
> postscript(file="/var/fisher/rcomp/tmp/6bft71354887989.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 = 118
Frequency = 1
lag(myerror, k = 1) myerror
0 -4.808392e-12 NA
1 3.252895e-13 -4.808392e-12
2 3.127628e-13 3.252895e-13
3 2.673633e-13 3.127628e-13
4 2.437929e-13 2.673633e-13
5 2.066651e-13 2.437929e-13
6 1.856031e-13 2.066651e-13
7 1.436316e-13 1.856031e-13
8 1.194522e-13 1.436316e-13
9 8.478450e-14 1.194522e-13
10 4.632544e-14 8.478450e-14
11 4.541264e-14 4.632544e-14
12 2.864667e-13 4.541264e-14
13 2.696965e-13 2.864667e-13
14 2.460343e-13 2.696965e-13
15 1.718846e-13 2.460343e-13
16 1.526072e-13 1.718846e-13
17 1.343355e-13 1.526072e-13
18 1.136171e-13 1.343355e-13
19 9.434376e-14 1.136171e-13
20 6.018769e-14 9.434376e-14
21 2.358482e-14 6.018769e-14
22 1.961317e-14 2.358482e-14
23 1.863032e-14 1.961317e-14
24 2.348351e-13 1.863032e-14
25 1.877901e-13 2.348351e-13
26 1.484334e-13 1.877901e-13
27 1.609000e-13 1.484334e-13
28 1.457520e-13 1.609000e-13
29 8.147277e-14 1.457520e-13
30 1.069543e-13 8.147277e-14
31 1.220116e-13 1.069543e-13
32 6.475720e-14 1.220116e-13
33 2.514372e-15 6.475720e-14
34 1.473189e-14 2.514372e-15
35 1.832357e-14 1.473189e-14
36 2.703745e-13 1.832357e-14
37 1.917255e-13 2.703745e-13
38 1.852567e-13 1.917255e-13
39 1.109462e-13 1.852567e-13
40 8.869229e-14 1.109462e-13
41 5.812864e-15 8.869229e-14
42 3.841126e-14 5.812864e-15
43 2.754560e-14 3.841126e-14
44 -3.502599e-14 2.754560e-14
45 -9.079046e-14 -3.502599e-14
46 -1.129129e-13 -9.079046e-14
47 -1.696735e-13 -1.129129e-13
48 9.943930e-14 -1.696735e-13
49 8.138657e-14 9.943930e-14
50 5.918809e-14 8.138657e-14
51 -2.150700e-15 5.918809e-14
52 -2.005728e-14 -2.150700e-15
53 -1.063278e-14 -2.005728e-14
54 3.194692e-15 -1.063278e-14
55 2.425025e-14 3.194692e-15
56 6.130105e-14 2.425025e-14
57 -3.620529e-14 6.130105e-14
58 -8.739592e-14 -3.620529e-14
59 -1.110230e-13 -8.739592e-14
60 6.703325e-14 -1.110230e-13
61 7.359475e-14 6.703325e-14
62 5.840508e-14 7.359475e-14
63 -3.009665e-15 5.840508e-14
64 1.826489e-14 -3.009665e-15
65 -5.320298e-14 1.826489e-14
66 9.210966e-14 -5.320298e-14
67 -1.244051e-14 9.210966e-14
68 -5.783477e-14 -1.244051e-14
69 7.943928e-15 -5.783477e-14
70 -3.742254e-14 7.943928e-15
71 -3.949725e-14 -3.742254e-14
72 1.287849e-13 -3.949725e-14
73 6.261246e-14 1.287849e-13
74 9.703827e-14 6.261246e-14
75 1.195823e-13 9.703827e-14
76 -2.654321e-14 1.195823e-13
77 -7.208693e-15 -2.654321e-14
78 1.178136e-13 -7.208693e-15
79 6.768800e-14 1.178136e-13
80 -6.561231e-15 6.768800e-14
81 -1.240672e-13 -6.561231e-15
82 -1.393678e-13 -1.240672e-13
83 -7.455016e-14 -1.393678e-13
84 1.293922e-13 -7.455016e-14
85 6.351524e-14 1.293922e-13
86 9.102452e-14 6.351524e-14
87 -2.944984e-14 9.102452e-14
88 -5.388073e-15 -2.944984e-14
89 -4.530881e-14 -5.388073e-15
90 -3.131342e-14 -4.530881e-14
91 7.214940e-14 -3.131342e-14
92 -9.051824e-14 7.214940e-14
93 -9.245633e-14 -9.051824e-14
94 -8.608552e-14 -9.245633e-14
95 -1.141214e-13 -8.608552e-14
96 8.606589e-14 -1.141214e-13
97 5.191685e-14 8.606589e-14
98 -3.313052e-14 5.191685e-14
99 -1.238954e-13 -3.313052e-14
100 -1.566260e-13 -1.238954e-13
101 -1.195780e-13 -1.566260e-13
102 -5.064253e-14 -1.195780e-13
103 7.167576e-14 -5.064253e-14
104 -9.688140e-14 7.167576e-14
105 5.129716e-14 -9.688140e-14
106 -2.827501e-14 5.129716e-14
107 -1.464569e-13 -2.827501e-14
108 2.496779e-13 -1.464569e-13
109 1.495670e-13 2.496779e-13
110 9.930512e-15 1.495670e-13
111 -2.417047e-14 9.930512e-15
112 -1.542539e-13 -2.417047e-14
113 -1.639509e-13 -1.542539e-13
114 -7.520711e-14 -1.639509e-13
115 -1.099346e-13 -7.520711e-14
116 -8.631858e-14 -1.099346e-13
117 -1.152404e-13 -8.631858e-14
118 NA -1.152404e-13
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.252895e-13 -4.808392e-12
[2,] 3.127628e-13 3.252895e-13
[3,] 2.673633e-13 3.127628e-13
[4,] 2.437929e-13 2.673633e-13
[5,] 2.066651e-13 2.437929e-13
[6,] 1.856031e-13 2.066651e-13
[7,] 1.436316e-13 1.856031e-13
[8,] 1.194522e-13 1.436316e-13
[9,] 8.478450e-14 1.194522e-13
[10,] 4.632544e-14 8.478450e-14
[11,] 4.541264e-14 4.632544e-14
[12,] 2.864667e-13 4.541264e-14
[13,] 2.696965e-13 2.864667e-13
[14,] 2.460343e-13 2.696965e-13
[15,] 1.718846e-13 2.460343e-13
[16,] 1.526072e-13 1.718846e-13
[17,] 1.343355e-13 1.526072e-13
[18,] 1.136171e-13 1.343355e-13
[19,] 9.434376e-14 1.136171e-13
[20,] 6.018769e-14 9.434376e-14
[21,] 2.358482e-14 6.018769e-14
[22,] 1.961317e-14 2.358482e-14
[23,] 1.863032e-14 1.961317e-14
[24,] 2.348351e-13 1.863032e-14
[25,] 1.877901e-13 2.348351e-13
[26,] 1.484334e-13 1.877901e-13
[27,] 1.609000e-13 1.484334e-13
[28,] 1.457520e-13 1.609000e-13
[29,] 8.147277e-14 1.457520e-13
[30,] 1.069543e-13 8.147277e-14
[31,] 1.220116e-13 1.069543e-13
[32,] 6.475720e-14 1.220116e-13
[33,] 2.514372e-15 6.475720e-14
[34,] 1.473189e-14 2.514372e-15
[35,] 1.832357e-14 1.473189e-14
[36,] 2.703745e-13 1.832357e-14
[37,] 1.917255e-13 2.703745e-13
[38,] 1.852567e-13 1.917255e-13
[39,] 1.109462e-13 1.852567e-13
[40,] 8.869229e-14 1.109462e-13
[41,] 5.812864e-15 8.869229e-14
[42,] 3.841126e-14 5.812864e-15
[43,] 2.754560e-14 3.841126e-14
[44,] -3.502599e-14 2.754560e-14
[45,] -9.079046e-14 -3.502599e-14
[46,] -1.129129e-13 -9.079046e-14
[47,] -1.696735e-13 -1.129129e-13
[48,] 9.943930e-14 -1.696735e-13
[49,] 8.138657e-14 9.943930e-14
[50,] 5.918809e-14 8.138657e-14
[51,] -2.150700e-15 5.918809e-14
[52,] -2.005728e-14 -2.150700e-15
[53,] -1.063278e-14 -2.005728e-14
[54,] 3.194692e-15 -1.063278e-14
[55,] 2.425025e-14 3.194692e-15
[56,] 6.130105e-14 2.425025e-14
[57,] -3.620529e-14 6.130105e-14
[58,] -8.739592e-14 -3.620529e-14
[59,] -1.110230e-13 -8.739592e-14
[60,] 6.703325e-14 -1.110230e-13
[61,] 7.359475e-14 6.703325e-14
[62,] 5.840508e-14 7.359475e-14
[63,] -3.009665e-15 5.840508e-14
[64,] 1.826489e-14 -3.009665e-15
[65,] -5.320298e-14 1.826489e-14
[66,] 9.210966e-14 -5.320298e-14
[67,] -1.244051e-14 9.210966e-14
[68,] -5.783477e-14 -1.244051e-14
[69,] 7.943928e-15 -5.783477e-14
[70,] -3.742254e-14 7.943928e-15
[71,] -3.949725e-14 -3.742254e-14
[72,] 1.287849e-13 -3.949725e-14
[73,] 6.261246e-14 1.287849e-13
[74,] 9.703827e-14 6.261246e-14
[75,] 1.195823e-13 9.703827e-14
[76,] -2.654321e-14 1.195823e-13
[77,] -7.208693e-15 -2.654321e-14
[78,] 1.178136e-13 -7.208693e-15
[79,] 6.768800e-14 1.178136e-13
[80,] -6.561231e-15 6.768800e-14
[81,] -1.240672e-13 -6.561231e-15
[82,] -1.393678e-13 -1.240672e-13
[83,] -7.455016e-14 -1.393678e-13
[84,] 1.293922e-13 -7.455016e-14
[85,] 6.351524e-14 1.293922e-13
[86,] 9.102452e-14 6.351524e-14
[87,] -2.944984e-14 9.102452e-14
[88,] -5.388073e-15 -2.944984e-14
[89,] -4.530881e-14 -5.388073e-15
[90,] -3.131342e-14 -4.530881e-14
[91,] 7.214940e-14 -3.131342e-14
[92,] -9.051824e-14 7.214940e-14
[93,] -9.245633e-14 -9.051824e-14
[94,] -8.608552e-14 -9.245633e-14
[95,] -1.141214e-13 -8.608552e-14
[96,] 8.606589e-14 -1.141214e-13
[97,] 5.191685e-14 8.606589e-14
[98,] -3.313052e-14 5.191685e-14
[99,] -1.238954e-13 -3.313052e-14
[100,] -1.566260e-13 -1.238954e-13
[101,] -1.195780e-13 -1.566260e-13
[102,] -5.064253e-14 -1.195780e-13
[103,] 7.167576e-14 -5.064253e-14
[104,] -9.688140e-14 7.167576e-14
[105,] 5.129716e-14 -9.688140e-14
[106,] -2.827501e-14 5.129716e-14
[107,] -1.464569e-13 -2.827501e-14
[108,] 2.496779e-13 -1.464569e-13
[109,] 1.495670e-13 2.496779e-13
[110,] 9.930512e-15 1.495670e-13
[111,] -2.417047e-14 9.930512e-15
[112,] -1.542539e-13 -2.417047e-14
[113,] -1.639509e-13 -1.542539e-13
[114,] -7.520711e-14 -1.639509e-13
[115,] -1.099346e-13 -7.520711e-14
[116,] -8.631858e-14 -1.099346e-13
[117,] -1.152404e-13 -8.631858e-14
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.252895e-13 -4.808392e-12
2 3.127628e-13 3.252895e-13
3 2.673633e-13 3.127628e-13
4 2.437929e-13 2.673633e-13
5 2.066651e-13 2.437929e-13
6 1.856031e-13 2.066651e-13
7 1.436316e-13 1.856031e-13
8 1.194522e-13 1.436316e-13
9 8.478450e-14 1.194522e-13
10 4.632544e-14 8.478450e-14
11 4.541264e-14 4.632544e-14
12 2.864667e-13 4.541264e-14
13 2.696965e-13 2.864667e-13
14 2.460343e-13 2.696965e-13
15 1.718846e-13 2.460343e-13
16 1.526072e-13 1.718846e-13
17 1.343355e-13 1.526072e-13
18 1.136171e-13 1.343355e-13
19 9.434376e-14 1.136171e-13
20 6.018769e-14 9.434376e-14
21 2.358482e-14 6.018769e-14
22 1.961317e-14 2.358482e-14
23 1.863032e-14 1.961317e-14
24 2.348351e-13 1.863032e-14
25 1.877901e-13 2.348351e-13
26 1.484334e-13 1.877901e-13
27 1.609000e-13 1.484334e-13
28 1.457520e-13 1.609000e-13
29 8.147277e-14 1.457520e-13
30 1.069543e-13 8.147277e-14
31 1.220116e-13 1.069543e-13
32 6.475720e-14 1.220116e-13
33 2.514372e-15 6.475720e-14
34 1.473189e-14 2.514372e-15
35 1.832357e-14 1.473189e-14
36 2.703745e-13 1.832357e-14
37 1.917255e-13 2.703745e-13
38 1.852567e-13 1.917255e-13
39 1.109462e-13 1.852567e-13
40 8.869229e-14 1.109462e-13
41 5.812864e-15 8.869229e-14
42 3.841126e-14 5.812864e-15
43 2.754560e-14 3.841126e-14
44 -3.502599e-14 2.754560e-14
45 -9.079046e-14 -3.502599e-14
46 -1.129129e-13 -9.079046e-14
47 -1.696735e-13 -1.129129e-13
48 9.943930e-14 -1.696735e-13
49 8.138657e-14 9.943930e-14
50 5.918809e-14 8.138657e-14
51 -2.150700e-15 5.918809e-14
52 -2.005728e-14 -2.150700e-15
53 -1.063278e-14 -2.005728e-14
54 3.194692e-15 -1.063278e-14
55 2.425025e-14 3.194692e-15
56 6.130105e-14 2.425025e-14
57 -3.620529e-14 6.130105e-14
58 -8.739592e-14 -3.620529e-14
59 -1.110230e-13 -8.739592e-14
60 6.703325e-14 -1.110230e-13
61 7.359475e-14 6.703325e-14
62 5.840508e-14 7.359475e-14
63 -3.009665e-15 5.840508e-14
64 1.826489e-14 -3.009665e-15
65 -5.320298e-14 1.826489e-14
66 9.210966e-14 -5.320298e-14
67 -1.244051e-14 9.210966e-14
68 -5.783477e-14 -1.244051e-14
69 7.943928e-15 -5.783477e-14
70 -3.742254e-14 7.943928e-15
71 -3.949725e-14 -3.742254e-14
72 1.287849e-13 -3.949725e-14
73 6.261246e-14 1.287849e-13
74 9.703827e-14 6.261246e-14
75 1.195823e-13 9.703827e-14
76 -2.654321e-14 1.195823e-13
77 -7.208693e-15 -2.654321e-14
78 1.178136e-13 -7.208693e-15
79 6.768800e-14 1.178136e-13
80 -6.561231e-15 6.768800e-14
81 -1.240672e-13 -6.561231e-15
82 -1.393678e-13 -1.240672e-13
83 -7.455016e-14 -1.393678e-13
84 1.293922e-13 -7.455016e-14
85 6.351524e-14 1.293922e-13
86 9.102452e-14 6.351524e-14
87 -2.944984e-14 9.102452e-14
88 -5.388073e-15 -2.944984e-14
89 -4.530881e-14 -5.388073e-15
90 -3.131342e-14 -4.530881e-14
91 7.214940e-14 -3.131342e-14
92 -9.051824e-14 7.214940e-14
93 -9.245633e-14 -9.051824e-14
94 -8.608552e-14 -9.245633e-14
95 -1.141214e-13 -8.608552e-14
96 8.606589e-14 -1.141214e-13
97 5.191685e-14 8.606589e-14
98 -3.313052e-14 5.191685e-14
99 -1.238954e-13 -3.313052e-14
100 -1.566260e-13 -1.238954e-13
101 -1.195780e-13 -1.566260e-13
102 -5.064253e-14 -1.195780e-13
103 7.167576e-14 -5.064253e-14
104 -9.688140e-14 7.167576e-14
105 5.129716e-14 -9.688140e-14
106 -2.827501e-14 5.129716e-14
107 -1.464569e-13 -2.827501e-14
108 2.496779e-13 -1.464569e-13
109 1.495670e-13 2.496779e-13
110 9.930512e-15 1.495670e-13
111 -2.417047e-14 9.930512e-15
112 -1.542539e-13 -2.417047e-14
113 -1.639509e-13 -1.542539e-13
114 -7.520711e-14 -1.639509e-13
115 -1.099346e-13 -7.520711e-14
116 -8.631858e-14 -1.099346e-13
117 -1.152404e-13 -8.631858e-14
> 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/7f1pi1354887989.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/8p1r61354887989.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/9h3wb1354887989.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/10oh7n1354887989.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/11cbx71354887989.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/12kz7t1354887989.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/13t0sg1354887989.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/143g6p1354887989.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/15hpxa1354887989.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/161kzw1354887989.tab")
+ }
>
> try(system("convert tmp/1wh1x1354887989.ps tmp/1wh1x1354887989.png",intern=TRUE))
character(0)
> try(system("convert tmp/2wrtb1354887989.ps tmp/2wrtb1354887989.png",intern=TRUE))
character(0)
> try(system("convert tmp/301301354887989.ps tmp/301301354887989.png",intern=TRUE))
character(0)
> try(system("convert tmp/4gkxf1354887989.ps tmp/4gkxf1354887989.png",intern=TRUE))
character(0)
> try(system("convert tmp/54dhp1354887989.ps tmp/54dhp1354887989.png",intern=TRUE))
character(0)
> try(system("convert tmp/6bft71354887989.ps tmp/6bft71354887989.png",intern=TRUE))
character(0)
> try(system("convert tmp/7f1pi1354887989.ps tmp/7f1pi1354887989.png",intern=TRUE))
character(0)
> try(system("convert tmp/8p1r61354887989.ps tmp/8p1r61354887989.png",intern=TRUE))
character(0)
> try(system("convert tmp/9h3wb1354887989.ps tmp/9h3wb1354887989.png",intern=TRUE))
character(0)
> try(system("convert tmp/10oh7n1354887989.ps tmp/10oh7n1354887989.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
6.844 1.527 8.390