R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-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(2,3,4,4,4,2,2,4,4,2,3,3,4,3,5,4,4,2,5,4,2,4,4,3,4,4,4,2,4,2,2,2,3,2,2,1,5,2,5,4,2,4,4,2,3,4,2,2,3,4,3,1,1,2,2,1,3,3,2,3,5,2,3,4,4,3,4,2,2,4,1,1,3,2,2,4,4,5,4,2,4,4,2,2,4,3,5,4,2,3,3,4,1,1,2,4,3,3,2,1,4,2,2,4,4,4,2,2,2,2,2,1,5,2,3,2,4,1,2,2,2,2,4,4,4,4,2,2,3,4,1,2,4,2,3,4,2,4,1,4,4,2,3,2,4,4,2,4,2,4,2,3,2,4,1,4,3,4,5,3,4,4,2,2,5,2,2,2,2,4,5,2,4,4,4,4,3,4,1,4,4,4,4,4,3,4,5,1,3,2,2,2,3,4,5,2,4,4,2,4,4,4,4,2,2,3,3,4,2,2,4,4,2,2,5,4,2,2,4,3,3,2,4,2,4,2,5,2,4,2,4,4,5,4,3,4,3,4,3,4,2,2,3,2,2,4,2,1,1,3,3,2,3,2,2,1,2,4,3,4,3,4,2,4,1,1,4,2,2,4,2,4,3,2,4,2,4,4,4,4,2,4,4,4,3,3,2,4,2,4,2,2,1,2,3,4,4,4,4,2,2,2,1,1),dim=c(2,152),dimnames=list(c('Talk','Driver'),1:152))
> y <- array(NA,dim=c(2,152),dimnames=list(c('Talk','Driver'),1:152))
> 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 = 'Include Monthly 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
> 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
Talk Driver M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 2 3 1 0 0 0 0 0 0 0 0 0 0 1
2 4 4 0 1 0 0 0 0 0 0 0 0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 0 0 0 0 0 0 0 1 0 0 105
106 4 4 0 0 0 0 0 0 0 0 0 1 0 106
107 2 2 0 0 0 0 0 0 0 0 0 0 1 107
108 5 4 0 0 0 0 0 0 0 0 0 0 0 108
109 2 2 1 0 0 0 0 0 0 0 0 0 0 109
110 4 3 0 1 0 0 0 0 0 0 0 0 0 110
111 3 2 0 0 1 0 0 0 0 0 0 0 0 111
112 4 2 0 0 0 1 0 0 0 0 0 0 0 112
113 4 2 0 0 0 0 1 0 0 0 0 0 0 113
114 5 2 0 0 0 0 0 1 0 0 0 0 0 114
115 4 2 0 0 0 0 0 0 1 0 0 0 0 115
116 4 4 0 0 0 0 0 0 0 1 0 0 0 116
117 5 4 0 0 0 0 0 0 0 0 1 0 0 117
118 3 4 0 0 0 0 0 0 0 0 0 1 0 118
119 3 4 0 0 0 0 0 0 0 0 0 0 1 119
120 3 4 0 0 0 0 0 0 0 0 0 0 0 120
121 2 2 1 0 0 0 0 0 0 0 0 0 0 121
122 3 2 0 1 0 0 0 0 0 0 0 0 0 122
123 2 4 0 0 1 0 0 0 0 0 0 0 0 123
124 2 1 0 0 0 1 0 0 0 0 0 0 0 124
125 1 3 0 0 0 0 1 0 0 0 0 0 0 125
126 3 2 0 0 0 0 0 1 0 0 0 0 0 126
127 3 2 0 0 0 0 0 0 1 0 0 0 0 127
128 2 1 0 0 0 0 0 0 0 1 0 0 0 128
129 2 4 0 0 0 0 0 0 0 0 1 0 0 129
130 3 4 0 0 0 0 0 0 0 0 0 1 0 130
131 3 4 0 0 0 0 0 0 0 0 0 0 1 131
132 2 4 0 0 0 0 0 0 0 0 0 0 0 132
133 1 1 1 0 0 0 0 0 0 0 0 0 0 133
134 4 2 0 1 0 0 0 0 0 0 0 0 0 134
135 2 4 0 0 1 0 0 0 0 0 0 0 0 135
136 2 4 0 0 0 1 0 0 0 0 0 0 0 136
137 3 2 0 0 0 0 1 0 0 0 0 0 0 137
138 4 2 0 0 0 0 0 1 0 0 0 0 0 138
139 4 4 0 0 0 0 0 0 1 0 0 0 0 139
140 4 4 0 0 0 0 0 0 0 1 0 0 0 140
141 2 4 0 0 0 0 0 0 0 0 1 0 0 141
142 4 4 0 0 0 0 0 0 0 0 0 1 0 142
143 3 3 0 0 0 0 0 0 0 0 0 0 1 143
144 2 4 0 0 0 0 0 0 0 0 0 0 0 144
145 2 4 1 0 0 0 0 0 0 0 0 0 0 145
146 2 2 0 1 0 0 0 0 0 0 0 0 0 146
147 1 2 0 0 1 0 0 0 0 0 0 0 0 147
148 3 4 0 0 0 1 0 0 0 0 0 0 0 148
149 4 4 0 0 0 0 1 0 0 0 0 0 0 149
150 4 2 0 0 0 0 0 1 0 0 0 0 0 150
151 2 2 0 0 0 0 0 0 1 0 0 0 0 151
152 1 1 0 0 0 0 0 0 0 1 0 0 0 152
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Driver M1 M2 M3 M4
2.454515 0.107074 0.004085 0.902963 0.455763 0.030476
M5 M6 M7 M8 M9 M10
0.684908 0.163430 1.056868 1.002519 0.519878 0.883286
M11 t
0.422283 -0.003306
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.5347 -0.7382 -0.1317 0.7780 2.5448
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.454515 0.429083 5.720 6.33e-08 ***
Driver 0.107074 0.086789 1.234 0.2194
M1 0.004085 0.445175 0.009 0.9927
M2 0.902963 0.445581 2.026 0.0446 *
M3 0.455763 0.445736 1.022 0.3083
M4 0.030476 0.444821 0.069 0.9455
M5 0.684908 0.446150 1.535 0.1270
M6 0.163430 0.446501 0.366 0.7149
M7 1.056868 0.444976 2.375 0.0189 *
M8 1.002519 0.446134 2.247 0.0262 *
M9 0.519878 0.455759 1.141 0.2560
M10 0.883286 0.454158 1.945 0.0538 .
M11 0.422283 0.453669 0.931 0.3536
t -0.003306 0.002060 -1.605 0.1108
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.111 on 138 degrees of freedom
Multiple R-squared: 0.1391, Adjusted R-squared: 0.05799
F-statistic: 1.715 on 13 and 138 DF, p-value: 0.06407
> 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.31653687 0.63307374 0.68346313
[2,] 0.19431109 0.38862219 0.80568891
[3,] 0.15343946 0.30687892 0.84656054
[4,] 0.09211330 0.18422661 0.90788670
[5,] 0.24590722 0.49181445 0.75409278
[6,] 0.19499362 0.38998724 0.80500638
[7,] 0.16769143 0.33538286 0.83230857
[8,] 0.20530633 0.41061267 0.79469367
[9,] 0.14371597 0.28743195 0.85628403
[10,] 0.10248042 0.20496085 0.89751958
[11,] 0.26148671 0.52297342 0.73851329
[12,] 0.21516882 0.43033764 0.78483118
[13,] 0.15991342 0.31982684 0.84008658
[14,] 0.11738147 0.23476294 0.88261853
[15,] 0.11482559 0.22965117 0.88517441
[16,] 0.11997727 0.23995454 0.88002273
[17,] 0.14101041 0.28202083 0.85898959
[18,] 0.10619388 0.21238775 0.89380612
[19,] 0.08103667 0.16207335 0.91896333
[20,] 0.08916844 0.17833688 0.91083156
[21,] 0.07510987 0.15021973 0.92489013
[22,] 0.07006494 0.14012988 0.92993506
[23,] 0.08799757 0.17599514 0.91200243
[24,] 0.19723591 0.39447183 0.80276409
[25,] 0.17404923 0.34809846 0.82595077
[26,] 0.13914724 0.27829448 0.86085276
[27,] 0.11208806 0.22417611 0.88791194
[28,] 0.11123177 0.22246355 0.88876823
[29,] 0.10330563 0.20661126 0.89669437
[30,] 0.09423508 0.18847017 0.90576492
[31,] 0.09371154 0.18742307 0.90628846
[32,] 0.07358638 0.14717276 0.92641362
[33,] 0.05964334 0.11928668 0.94035666
[34,] 0.05260804 0.10521608 0.94739196
[35,] 0.05905203 0.11810407 0.94094797
[36,] 0.04609497 0.09218995 0.95390503
[37,] 0.03973647 0.07947294 0.96026353
[38,] 0.03092221 0.06184442 0.96907779
[39,] 0.05007285 0.10014569 0.94992715
[40,] 0.05712273 0.11424545 0.94287727
[41,] 0.14606400 0.29212801 0.85393600
[42,] 0.11885975 0.23771951 0.88114025
[43,] 0.20904308 0.41808616 0.79095692
[44,] 0.17765290 0.35530579 0.82234710
[45,] 0.14832889 0.29665778 0.85167111
[46,] 0.13978283 0.27956566 0.86021717
[47,] 0.12896691 0.25793383 0.87103309
[48,] 0.10669282 0.21338564 0.89330718
[49,] 0.08616068 0.17232136 0.91383932
[50,] 0.09991219 0.19982438 0.90008781
[51,] 0.08294130 0.16588259 0.91705870
[52,] 0.07010840 0.14021681 0.92989160
[53,] 0.07016946 0.14033892 0.92983054
[54,] 0.16516710 0.33033421 0.83483290
[55,] 0.20295588 0.40591176 0.79704412
[56,] 0.19131914 0.38263828 0.80868086
[57,] 0.21811316 0.43622631 0.78188684
[58,] 0.25484585 0.50969171 0.74515415
[59,] 0.24956801 0.49913603 0.75043199
[60,] 0.22979003 0.45958006 0.77020997
[61,] 0.24672972 0.49345944 0.75327028
[62,] 0.39011029 0.78022057 0.60988971
[63,] 0.36801408 0.73602816 0.63198592
[64,] 0.40933768 0.81867537 0.59066232
[65,] 0.39721860 0.79443720 0.60278140
[66,] 0.44868918 0.89737835 0.55131082
[67,] 0.60535542 0.78928915 0.39464458
[68,] 0.58052898 0.83894203 0.41947102
[69,] 0.55032940 0.89934120 0.44967060
[70,] 0.61119730 0.77760540 0.38880270
[71,] 0.59655193 0.80689614 0.40344807
[72,] 0.61669307 0.76661385 0.38330693
[73,] 0.58438279 0.83123442 0.41561721
[74,] 0.88906333 0.22187334 0.11093667
[75,] 0.86363813 0.27272375 0.13636187
[76,] 0.83294320 0.33411361 0.16705680
[77,] 0.80360598 0.39278804 0.19639402
[78,] 0.87196167 0.25607666 0.12803833
[79,] 0.84179511 0.31640979 0.15820489
[80,] 0.82279181 0.35441637 0.17720819
[81,] 0.78606989 0.42786022 0.21393011
[82,] 0.81431400 0.37137200 0.18568600
[83,] 0.80845348 0.38309303 0.19154652
[84,] 0.84026738 0.31946524 0.15973262
[85,] 0.81034340 0.37931319 0.18965660
[86,] 0.82435713 0.35128575 0.17564287
[87,] 0.90697495 0.18605010 0.09302505
[88,] 0.91456742 0.17086515 0.08543258
[89,] 0.90796368 0.18407264 0.09203632
[90,] 0.88433642 0.23132716 0.11566358
[91,] 0.88242898 0.23514203 0.11757102
[92,] 0.94156287 0.11687425 0.05843713
[93,] 0.92419218 0.15161564 0.07580782
[94,] 0.90128678 0.19742644 0.09871322
[95,] 0.89617342 0.20765316 0.10382658
[96,] 0.91616380 0.16767239 0.08383620
[97,] 0.91893044 0.16213911 0.08106956
[98,] 0.93236948 0.13526104 0.06763052
[99,] 0.92310728 0.15378544 0.07689272
[100,] 0.89698020 0.20603960 0.10301980
[101,] 0.98306990 0.03386020 0.01693010
[102,] 0.97601173 0.04797654 0.02398827
[103,] 0.96394795 0.07210410 0.03605205
[104,] 0.95799875 0.08400250 0.04200125
[105,] 0.94738823 0.10522354 0.05261177
[106,] 0.92206431 0.15587137 0.07793569
[107,] 0.89269820 0.21460359 0.10730180
[108,] 0.89184953 0.21630095 0.10815047
[109,] 0.98520926 0.02958148 0.01479074
[110,] 0.98924026 0.02151947 0.01075974
[111,] 0.98038523 0.03922954 0.01961477
[112,] 0.96615683 0.06768633 0.03384317
[113,] 0.94135238 0.11729523 0.05864762
[114,] 0.94145861 0.11708278 0.05854139
[115,] 0.92696706 0.14606588 0.07303294
[116,] 0.87620213 0.24759573 0.12379787
[117,] 0.81239135 0.37521731 0.18760865
[118,] 0.92299593 0.15400813 0.07700407
[119,] 0.87204535 0.25590931 0.12795465
> postscript(file="/var/www/rcomp/tmp/1f9sp1293216184.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/rcomp/tmp/2f9sp1293216184.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/rcomp/tmp/3pirs1293216184.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/rcomp/tmp/4pirs1293216184.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/rcomp/tmp/5pirs1293216184.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 = 152
Frequency = 1
1 2 3 4 5 6
-0.77651397 0.22084007 0.88549398 -0.90006038 0.66296118 0.08067154
7 8 9 10 11 12
0.19054032 1.14112176 0.84121668 1.26696785 -1.26872334 1.26393968
13 14 15 16 17 18
1.15608788 0.47466258 0.92516938 -0.64623786 -0.29736342 -0.66550595
19 20 21 22 23 24
1.33728928 1.18079716 -1.33325503 0.52079036 -0.22904793 -0.58931136
25 26 27 28 29 30
0.19576329 -0.37858846 -2.03515521 -0.49948890 -0.36476157 -0.83997765
31 32 33 34 35 36
1.37696469 -0.77952743 0.81349393 0.56046577 -1.18937253 -1.44256240
37 38 39 40 41 42
0.44958580 -1.66013372 0.68329953 1.43311295 0.56784028 -0.69322869
43 44 45 46 47 48
0.30956654 1.26014797 -1.14683066 -0.61400594 -1.82847646 -0.72410766
49 50 51 52 53 54
0.38218765 -1.29923765 1.04419560 -0.74135876 0.60751569 -0.65355329
55 56 57 58 59 60
-1.54368450 -1.37895596 1.99991830 -0.36018342 1.21119895 -0.47028515
61 62 63 64 65 66
-0.47106339 0.41921709 0.86972389 -0.48753624 -0.35280891 -1.61387788
67 68 69 70 71 72
0.49599090 -0.66050122 -1.17455341 -2.53465513 1.14380080 0.56939026
73 74 75 76 77 78
1.35446491 -1.54110750 -1.09060070 -0.55493439 -1.31313350 -1.78834959
79 80 81 82 83 84
-0.67848080 1.48624774 0.86512200 -1.28083261 2.18347620 -0.39093434
85 86 87 88 89 90
-0.60585969 1.71271501 0.94907471 1.37766746 -0.27345810 -1.74867418
91 92 93 94 95 96
0.36119460 0.41884959 -0.09520260 1.86591635 0.22315161 -0.35125893
97 98 99 100 101 102
0.43381572 1.75239042 0.98875011 -0.58265714 0.76621731 1.50514833
103 104 105 106 107 108
-1.49205644 -0.54147500 -0.84138008 0.58437109 -0.73717299 2.47426937
109 110 111 112 113 114
-0.31236177 0.68499227 0.24257262 1.67116538 1.02003982 2.54482374
115 116 117 118 119 120
0.65469252 0.49820040 1.98414821 -0.37595351 0.08835531 0.51394477
121 122 123 124 125 126
-0.27268636 -0.16825877 -0.93189908 -0.18208566 -2.04735833 0.58449914
127 128 129 130 131 132
-0.30563207 -1.14090353 -0.97617638 -0.33627810 0.12803071 -0.44637982
133 134 135 136 137 138
-1.12593740 0.87141663 -0.89222367 -0.46363092 0.09939063 1.62417455
139 140 141 142 143 144
0.51989622 0.57755121 -0.93650098 0.70339730 0.27477967 -0.40670442
145 146 147 148 149 150
-0.40748266 -1.08890796 -1.63840116 0.57604448 0.92491893 1.66384995
151 152
-1.22628126 -2.06155272
> postscript(file="/var/www/rcomp/tmp/6ia9v1293216184.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 = 152
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.77651397 NA
1 0.22084007 -0.77651397
2 0.88549398 0.22084007
3 -0.90006038 0.88549398
4 0.66296118 -0.90006038
5 0.08067154 0.66296118
6 0.19054032 0.08067154
7 1.14112176 0.19054032
8 0.84121668 1.14112176
9 1.26696785 0.84121668
10 -1.26872334 1.26696785
11 1.26393968 -1.26872334
12 1.15608788 1.26393968
13 0.47466258 1.15608788
14 0.92516938 0.47466258
15 -0.64623786 0.92516938
16 -0.29736342 -0.64623786
17 -0.66550595 -0.29736342
18 1.33728928 -0.66550595
19 1.18079716 1.33728928
20 -1.33325503 1.18079716
21 0.52079036 -1.33325503
22 -0.22904793 0.52079036
23 -0.58931136 -0.22904793
24 0.19576329 -0.58931136
25 -0.37858846 0.19576329
26 -2.03515521 -0.37858846
27 -0.49948890 -2.03515521
28 -0.36476157 -0.49948890
29 -0.83997765 -0.36476157
30 1.37696469 -0.83997765
31 -0.77952743 1.37696469
32 0.81349393 -0.77952743
33 0.56046577 0.81349393
34 -1.18937253 0.56046577
35 -1.44256240 -1.18937253
36 0.44958580 -1.44256240
37 -1.66013372 0.44958580
38 0.68329953 -1.66013372
39 1.43311295 0.68329953
40 0.56784028 1.43311295
41 -0.69322869 0.56784028
42 0.30956654 -0.69322869
43 1.26014797 0.30956654
44 -1.14683066 1.26014797
45 -0.61400594 -1.14683066
46 -1.82847646 -0.61400594
47 -0.72410766 -1.82847646
48 0.38218765 -0.72410766
49 -1.29923765 0.38218765
50 1.04419560 -1.29923765
51 -0.74135876 1.04419560
52 0.60751569 -0.74135876
53 -0.65355329 0.60751569
54 -1.54368450 -0.65355329
55 -1.37895596 -1.54368450
56 1.99991830 -1.37895596
57 -0.36018342 1.99991830
58 1.21119895 -0.36018342
59 -0.47028515 1.21119895
60 -0.47106339 -0.47028515
61 0.41921709 -0.47106339
62 0.86972389 0.41921709
63 -0.48753624 0.86972389
64 -0.35280891 -0.48753624
65 -1.61387788 -0.35280891
66 0.49599090 -1.61387788
67 -0.66050122 0.49599090
68 -1.17455341 -0.66050122
69 -2.53465513 -1.17455341
70 1.14380080 -2.53465513
71 0.56939026 1.14380080
72 1.35446491 0.56939026
73 -1.54110750 1.35446491
74 -1.09060070 -1.54110750
75 -0.55493439 -1.09060070
76 -1.31313350 -0.55493439
77 -1.78834959 -1.31313350
78 -0.67848080 -1.78834959
79 1.48624774 -0.67848080
80 0.86512200 1.48624774
81 -1.28083261 0.86512200
82 2.18347620 -1.28083261
83 -0.39093434 2.18347620
84 -0.60585969 -0.39093434
85 1.71271501 -0.60585969
86 0.94907471 1.71271501
87 1.37766746 0.94907471
88 -0.27345810 1.37766746
89 -1.74867418 -0.27345810
90 0.36119460 -1.74867418
91 0.41884959 0.36119460
92 -0.09520260 0.41884959
93 1.86591635 -0.09520260
94 0.22315161 1.86591635
95 -0.35125893 0.22315161
96 0.43381572 -0.35125893
97 1.75239042 0.43381572
98 0.98875011 1.75239042
99 -0.58265714 0.98875011
100 0.76621731 -0.58265714
101 1.50514833 0.76621731
102 -1.49205644 1.50514833
103 -0.54147500 -1.49205644
104 -0.84138008 -0.54147500
105 0.58437109 -0.84138008
106 -0.73717299 0.58437109
107 2.47426937 -0.73717299
108 -0.31236177 2.47426937
109 0.68499227 -0.31236177
110 0.24257262 0.68499227
111 1.67116538 0.24257262
112 1.02003982 1.67116538
113 2.54482374 1.02003982
114 0.65469252 2.54482374
115 0.49820040 0.65469252
116 1.98414821 0.49820040
117 -0.37595351 1.98414821
118 0.08835531 -0.37595351
119 0.51394477 0.08835531
120 -0.27268636 0.51394477
121 -0.16825877 -0.27268636
122 -0.93189908 -0.16825877
123 -0.18208566 -0.93189908
124 -2.04735833 -0.18208566
125 0.58449914 -2.04735833
126 -0.30563207 0.58449914
127 -1.14090353 -0.30563207
128 -0.97617638 -1.14090353
129 -0.33627810 -0.97617638
130 0.12803071 -0.33627810
131 -0.44637982 0.12803071
132 -1.12593740 -0.44637982
133 0.87141663 -1.12593740
134 -0.89222367 0.87141663
135 -0.46363092 -0.89222367
136 0.09939063 -0.46363092
137 1.62417455 0.09939063
138 0.51989622 1.62417455
139 0.57755121 0.51989622
140 -0.93650098 0.57755121
141 0.70339730 -0.93650098
142 0.27477967 0.70339730
143 -0.40670442 0.27477967
144 -0.40748266 -0.40670442
145 -1.08890796 -0.40748266
146 -1.63840116 -1.08890796
147 0.57604448 -1.63840116
148 0.92491893 0.57604448
149 1.66384995 0.92491893
150 -1.22628126 1.66384995
151 -2.06155272 -1.22628126
152 NA -2.06155272
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.22084007 -0.77651397
[2,] 0.88549398 0.22084007
[3,] -0.90006038 0.88549398
[4,] 0.66296118 -0.90006038
[5,] 0.08067154 0.66296118
[6,] 0.19054032 0.08067154
[7,] 1.14112176 0.19054032
[8,] 0.84121668 1.14112176
[9,] 1.26696785 0.84121668
[10,] -1.26872334 1.26696785
[11,] 1.26393968 -1.26872334
[12,] 1.15608788 1.26393968
[13,] 0.47466258 1.15608788
[14,] 0.92516938 0.47466258
[15,] -0.64623786 0.92516938
[16,] -0.29736342 -0.64623786
[17,] -0.66550595 -0.29736342
[18,] 1.33728928 -0.66550595
[19,] 1.18079716 1.33728928
[20,] -1.33325503 1.18079716
[21,] 0.52079036 -1.33325503
[22,] -0.22904793 0.52079036
[23,] -0.58931136 -0.22904793
[24,] 0.19576329 -0.58931136
[25,] -0.37858846 0.19576329
[26,] -2.03515521 -0.37858846
[27,] -0.49948890 -2.03515521
[28,] -0.36476157 -0.49948890
[29,] -0.83997765 -0.36476157
[30,] 1.37696469 -0.83997765
[31,] -0.77952743 1.37696469
[32,] 0.81349393 -0.77952743
[33,] 0.56046577 0.81349393
[34,] -1.18937253 0.56046577
[35,] -1.44256240 -1.18937253
[36,] 0.44958580 -1.44256240
[37,] -1.66013372 0.44958580
[38,] 0.68329953 -1.66013372
[39,] 1.43311295 0.68329953
[40,] 0.56784028 1.43311295
[41,] -0.69322869 0.56784028
[42,] 0.30956654 -0.69322869
[43,] 1.26014797 0.30956654
[44,] -1.14683066 1.26014797
[45,] -0.61400594 -1.14683066
[46,] -1.82847646 -0.61400594
[47,] -0.72410766 -1.82847646
[48,] 0.38218765 -0.72410766
[49,] -1.29923765 0.38218765
[50,] 1.04419560 -1.29923765
[51,] -0.74135876 1.04419560
[52,] 0.60751569 -0.74135876
[53,] -0.65355329 0.60751569
[54,] -1.54368450 -0.65355329
[55,] -1.37895596 -1.54368450
[56,] 1.99991830 -1.37895596
[57,] -0.36018342 1.99991830
[58,] 1.21119895 -0.36018342
[59,] -0.47028515 1.21119895
[60,] -0.47106339 -0.47028515
[61,] 0.41921709 -0.47106339
[62,] 0.86972389 0.41921709
[63,] -0.48753624 0.86972389
[64,] -0.35280891 -0.48753624
[65,] -1.61387788 -0.35280891
[66,] 0.49599090 -1.61387788
[67,] -0.66050122 0.49599090
[68,] -1.17455341 -0.66050122
[69,] -2.53465513 -1.17455341
[70,] 1.14380080 -2.53465513
[71,] 0.56939026 1.14380080
[72,] 1.35446491 0.56939026
[73,] -1.54110750 1.35446491
[74,] -1.09060070 -1.54110750
[75,] -0.55493439 -1.09060070
[76,] -1.31313350 -0.55493439
[77,] -1.78834959 -1.31313350
[78,] -0.67848080 -1.78834959
[79,] 1.48624774 -0.67848080
[80,] 0.86512200 1.48624774
[81,] -1.28083261 0.86512200
[82,] 2.18347620 -1.28083261
[83,] -0.39093434 2.18347620
[84,] -0.60585969 -0.39093434
[85,] 1.71271501 -0.60585969
[86,] 0.94907471 1.71271501
[87,] 1.37766746 0.94907471
[88,] -0.27345810 1.37766746
[89,] -1.74867418 -0.27345810
[90,] 0.36119460 -1.74867418
[91,] 0.41884959 0.36119460
[92,] -0.09520260 0.41884959
[93,] 1.86591635 -0.09520260
[94,] 0.22315161 1.86591635
[95,] -0.35125893 0.22315161
[96,] 0.43381572 -0.35125893
[97,] 1.75239042 0.43381572
[98,] 0.98875011 1.75239042
[99,] -0.58265714 0.98875011
[100,] 0.76621731 -0.58265714
[101,] 1.50514833 0.76621731
[102,] -1.49205644 1.50514833
[103,] -0.54147500 -1.49205644
[104,] -0.84138008 -0.54147500
[105,] 0.58437109 -0.84138008
[106,] -0.73717299 0.58437109
[107,] 2.47426937 -0.73717299
[108,] -0.31236177 2.47426937
[109,] 0.68499227 -0.31236177
[110,] 0.24257262 0.68499227
[111,] 1.67116538 0.24257262
[112,] 1.02003982 1.67116538
[113,] 2.54482374 1.02003982
[114,] 0.65469252 2.54482374
[115,] 0.49820040 0.65469252
[116,] 1.98414821 0.49820040
[117,] -0.37595351 1.98414821
[118,] 0.08835531 -0.37595351
[119,] 0.51394477 0.08835531
[120,] -0.27268636 0.51394477
[121,] -0.16825877 -0.27268636
[122,] -0.93189908 -0.16825877
[123,] -0.18208566 -0.93189908
[124,] -2.04735833 -0.18208566
[125,] 0.58449914 -2.04735833
[126,] -0.30563207 0.58449914
[127,] -1.14090353 -0.30563207
[128,] -0.97617638 -1.14090353
[129,] -0.33627810 -0.97617638
[130,] 0.12803071 -0.33627810
[131,] -0.44637982 0.12803071
[132,] -1.12593740 -0.44637982
[133,] 0.87141663 -1.12593740
[134,] -0.89222367 0.87141663
[135,] -0.46363092 -0.89222367
[136,] 0.09939063 -0.46363092
[137,] 1.62417455 0.09939063
[138,] 0.51989622 1.62417455
[139,] 0.57755121 0.51989622
[140,] -0.93650098 0.57755121
[141,] 0.70339730 -0.93650098
[142,] 0.27477967 0.70339730
[143,] -0.40670442 0.27477967
[144,] -0.40748266 -0.40670442
[145,] -1.08890796 -0.40748266
[146,] -1.63840116 -1.08890796
[147,] 0.57604448 -1.63840116
[148,] 0.92491893 0.57604448
[149,] 1.66384995 0.92491893
[150,] -1.22628126 1.66384995
[151,] -2.06155272 -1.22628126
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.22084007 -0.77651397
2 0.88549398 0.22084007
3 -0.90006038 0.88549398
4 0.66296118 -0.90006038
5 0.08067154 0.66296118
6 0.19054032 0.08067154
7 1.14112176 0.19054032
8 0.84121668 1.14112176
9 1.26696785 0.84121668
10 -1.26872334 1.26696785
11 1.26393968 -1.26872334
12 1.15608788 1.26393968
13 0.47466258 1.15608788
14 0.92516938 0.47466258
15 -0.64623786 0.92516938
16 -0.29736342 -0.64623786
17 -0.66550595 -0.29736342
18 1.33728928 -0.66550595
19 1.18079716 1.33728928
20 -1.33325503 1.18079716
21 0.52079036 -1.33325503
22 -0.22904793 0.52079036
23 -0.58931136 -0.22904793
24 0.19576329 -0.58931136
25 -0.37858846 0.19576329
26 -2.03515521 -0.37858846
27 -0.49948890 -2.03515521
28 -0.36476157 -0.49948890
29 -0.83997765 -0.36476157
30 1.37696469 -0.83997765
31 -0.77952743 1.37696469
32 0.81349393 -0.77952743
33 0.56046577 0.81349393
34 -1.18937253 0.56046577
35 -1.44256240 -1.18937253
36 0.44958580 -1.44256240
37 -1.66013372 0.44958580
38 0.68329953 -1.66013372
39 1.43311295 0.68329953
40 0.56784028 1.43311295
41 -0.69322869 0.56784028
42 0.30956654 -0.69322869
43 1.26014797 0.30956654
44 -1.14683066 1.26014797
45 -0.61400594 -1.14683066
46 -1.82847646 -0.61400594
47 -0.72410766 -1.82847646
48 0.38218765 -0.72410766
49 -1.29923765 0.38218765
50 1.04419560 -1.29923765
51 -0.74135876 1.04419560
52 0.60751569 -0.74135876
53 -0.65355329 0.60751569
54 -1.54368450 -0.65355329
55 -1.37895596 -1.54368450
56 1.99991830 -1.37895596
57 -0.36018342 1.99991830
58 1.21119895 -0.36018342
59 -0.47028515 1.21119895
60 -0.47106339 -0.47028515
61 0.41921709 -0.47106339
62 0.86972389 0.41921709
63 -0.48753624 0.86972389
64 -0.35280891 -0.48753624
65 -1.61387788 -0.35280891
66 0.49599090 -1.61387788
67 -0.66050122 0.49599090
68 -1.17455341 -0.66050122
69 -2.53465513 -1.17455341
70 1.14380080 -2.53465513
71 0.56939026 1.14380080
72 1.35446491 0.56939026
73 -1.54110750 1.35446491
74 -1.09060070 -1.54110750
75 -0.55493439 -1.09060070
76 -1.31313350 -0.55493439
77 -1.78834959 -1.31313350
78 -0.67848080 -1.78834959
79 1.48624774 -0.67848080
80 0.86512200 1.48624774
81 -1.28083261 0.86512200
82 2.18347620 -1.28083261
83 -0.39093434 2.18347620
84 -0.60585969 -0.39093434
85 1.71271501 -0.60585969
86 0.94907471 1.71271501
87 1.37766746 0.94907471
88 -0.27345810 1.37766746
89 -1.74867418 -0.27345810
90 0.36119460 -1.74867418
91 0.41884959 0.36119460
92 -0.09520260 0.41884959
93 1.86591635 -0.09520260
94 0.22315161 1.86591635
95 -0.35125893 0.22315161
96 0.43381572 -0.35125893
97 1.75239042 0.43381572
98 0.98875011 1.75239042
99 -0.58265714 0.98875011
100 0.76621731 -0.58265714
101 1.50514833 0.76621731
102 -1.49205644 1.50514833
103 -0.54147500 -1.49205644
104 -0.84138008 -0.54147500
105 0.58437109 -0.84138008
106 -0.73717299 0.58437109
107 2.47426937 -0.73717299
108 -0.31236177 2.47426937
109 0.68499227 -0.31236177
110 0.24257262 0.68499227
111 1.67116538 0.24257262
112 1.02003982 1.67116538
113 2.54482374 1.02003982
114 0.65469252 2.54482374
115 0.49820040 0.65469252
116 1.98414821 0.49820040
117 -0.37595351 1.98414821
118 0.08835531 -0.37595351
119 0.51394477 0.08835531
120 -0.27268636 0.51394477
121 -0.16825877 -0.27268636
122 -0.93189908 -0.16825877
123 -0.18208566 -0.93189908
124 -2.04735833 -0.18208566
125 0.58449914 -2.04735833
126 -0.30563207 0.58449914
127 -1.14090353 -0.30563207
128 -0.97617638 -1.14090353
129 -0.33627810 -0.97617638
130 0.12803071 -0.33627810
131 -0.44637982 0.12803071
132 -1.12593740 -0.44637982
133 0.87141663 -1.12593740
134 -0.89222367 0.87141663
135 -0.46363092 -0.89222367
136 0.09939063 -0.46363092
137 1.62417455 0.09939063
138 0.51989622 1.62417455
139 0.57755121 0.51989622
140 -0.93650098 0.57755121
141 0.70339730 -0.93650098
142 0.27477967 0.70339730
143 -0.40670442 0.27477967
144 -0.40748266 -0.40670442
145 -1.08890796 -0.40748266
146 -1.63840116 -1.08890796
147 0.57604448 -1.63840116
148 0.92491893 0.57604448
149 1.66384995 0.92491893
150 -1.22628126 1.66384995
151 -2.06155272 -1.22628126
> 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/rcomp/tmp/7t1qy1293216184.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/rcomp/tmp/8t1qy1293216184.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/rcomp/tmp/9t1qy1293216184.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/rcomp/tmp/104sp11293216184.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/117tn71293216184.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/rcomp/tmp/12atmd1293216184.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/rcomp/tmp/13o3k31293216184.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/rcomp/tmp/14a3i91293216184.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/rcomp/tmp/153diu1293216184.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/rcomp/tmp/16hnyl1293216184.tab")
+ }
>
> try(system("convert tmp/1f9sp1293216184.ps tmp/1f9sp1293216184.png",intern=TRUE))
character(0)
> try(system("convert tmp/2f9sp1293216184.ps tmp/2f9sp1293216184.png",intern=TRUE))
character(0)
> try(system("convert tmp/3pirs1293216184.ps tmp/3pirs1293216184.png",intern=TRUE))
character(0)
> try(system("convert tmp/4pirs1293216184.ps tmp/4pirs1293216184.png",intern=TRUE))
character(0)
> try(system("convert tmp/5pirs1293216184.ps tmp/5pirs1293216184.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ia9v1293216184.ps tmp/6ia9v1293216184.png",intern=TRUE))
character(0)
> try(system("convert tmp/7t1qy1293216184.ps tmp/7t1qy1293216184.png",intern=TRUE))
character(0)
> try(system("convert tmp/8t1qy1293216184.ps tmp/8t1qy1293216184.png",intern=TRUE))
character(0)
> try(system("convert tmp/9t1qy1293216184.ps tmp/9t1qy1293216184.png",intern=TRUE))
character(0)
> try(system("convert tmp/104sp11293216184.ps tmp/104sp11293216184.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.630 0.710 5.353