R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(4
+ ,7
+ ,7
+ ,6
+ ,1
+ ,5
+ ,7
+ ,5
+ ,5
+ ,6
+ ,4
+ ,1
+ ,4
+ ,5
+ ,4
+ ,6
+ ,6
+ ,6
+ ,2
+ ,5
+ ,5
+ ,3
+ ,4
+ ,5
+ ,4
+ ,2
+ ,4
+ ,5
+ ,6
+ ,5
+ ,6
+ ,2
+ ,2
+ ,4
+ ,5
+ ,5
+ ,6
+ ,7
+ ,5
+ ,1
+ ,6
+ ,7
+ ,5
+ ,7
+ ,7
+ ,1
+ ,1
+ ,5
+ ,7
+ ,1
+ ,6
+ ,7
+ ,6
+ ,1
+ ,3
+ ,5
+ ,4
+ ,6
+ ,7
+ ,3
+ ,1
+ ,4
+ ,3
+ ,5
+ ,6
+ ,6
+ ,4
+ ,1
+ ,4
+ ,6
+ ,6
+ ,5
+ ,4
+ ,3
+ ,1
+ ,2
+ ,7
+ ,7
+ ,5
+ ,6
+ ,2
+ ,1
+ ,5
+ ,6
+ ,5
+ ,4
+ ,6
+ ,4
+ ,1
+ ,3
+ ,5
+ ,6
+ ,6
+ ,7
+ ,3
+ ,1
+ ,5
+ ,3
+ ,5
+ ,6
+ ,6
+ ,5
+ ,1
+ ,6
+ ,7
+ ,4
+ ,5
+ ,6
+ ,3
+ ,2
+ ,4
+ ,5
+ ,7
+ ,3
+ ,4
+ ,3
+ ,1
+ ,3
+ ,7
+ ,7
+ ,7
+ ,7
+ ,6
+ ,1
+ ,6
+ ,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7')
+ ,1:162))
> y <- array(NA,dim=c(7,162),dimnames=list(c('Q1','Q2','Q3','Q4','Q5','Q6','Q7'),1:162))
> 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 = '1'
> par3 <- 'No 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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 2 4 7
118 6 5 7 3 2 5 5
119 4 6 4 2 1 5 7
120 6 3 3 1 2 3 5
121 3 5 7 5 2 3 3
122 6 4 5 5 2 5 6
123 4 5 6 3 2 3 5
124 3 5 4 4 4 4 4
125 4 7 7 4 1 7 7
126 6 5 7 5 2 6 6
127 4 7 5 5 1 5 7
128 6 5 7 3 1 2 2
129 5 4 3 4 1 4 5
130 5 6 6 6 1 6 6
131 5 4 5 4 3 6 6
132 3 4 5 5 2 5 6
133 5 4 6 4 1 4 2
134 4 4 5 4 1 4 6
135 5 6 6 5 1 5 7
136 5 6 6 4 2 3 4
137 1 5 7 3 5 5 7
138 4 3 5 3 1 5 7
139 7 6 7 6 1 5 6
140 4 5 6 5 2 6 6
141 6 4 6 2 1 4 2
142 7 5 7 4 2 3 7
143 6 2 7 3 1 3 7
144 5 5 5 3 1 4 5
145 6 7 7 5 1 5 5
146 5 4 5 3 1 5 6
147 5 4 6 3 2 3 5
148 6 7 7 4 1 6 6
149 5 6 6 5 1 5 6
150 3 5 5 5 2 4 6
151 6 5 6 5 1 5 5
152 7 5 7 5 1 4 6
153 4 7 6 3 1 7 7
154 5 6 7 4 1 5 7
155 4 6 7 4 1 3 6
156 5 5 6 3 2 5 6
157 2 2 6 4 2 2 6
158 7 4 4 4 4 4 7
159 5 6 7 3 1 3 6
160 4 5 6 2 1 4 5
161 2 5 4 4 1 5 5
162 4 5 5 4 1 4 5
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Q2 Q3 Q4 Q5 Q6
2.94044 -0.04287 0.39836 -0.01665 0.01450 -0.07914
Q7
0.02904
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-4.3447 -0.8898 0.1439 0.9265 2.7595
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.94044 0.98798 2.976 0.00339 **
Q2 -0.04287 0.11885 -0.361 0.71878
Q3 0.39836 0.11883 3.352 0.00101 **
Q4 -0.01665 0.10033 -0.166 0.86840
Q5 0.01450 0.15718 0.092 0.92662
Q6 -0.07914 0.10202 -0.776 0.43908
Q7 0.02904 0.11252 0.258 0.79668
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.515 on 155 degrees of freedom
Multiple R-squared: 0.07587, Adjusted R-squared: 0.0401
F-statistic: 2.121 on 6 and 155 DF, p-value: 0.05389
> 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.5702241 0.85955170 0.42977585
[2,] 0.4373412 0.87468239 0.56265880
[3,] 0.3224549 0.64490983 0.67754509
[4,] 0.2842904 0.56858085 0.71570958
[5,] 0.2127285 0.42545706 0.78727147
[6,] 0.1680921 0.33618427 0.83190787
[7,] 0.1089831 0.21796613 0.89101694
[8,] 0.0735871 0.14717420 0.92641290
[9,] 0.2167231 0.43344630 0.78327685
[10,] 0.1926182 0.38523637 0.80738181
[11,] 0.2581291 0.51625827 0.74187086
[12,] 0.6872638 0.62547237 0.31273619
[13,] 0.6657255 0.66854904 0.33427452
[14,] 0.5939359 0.81212811 0.40606406
[15,] 0.6456837 0.70863259 0.35431629
[16,] 0.6076212 0.78475765 0.39237882
[17,] 0.7795562 0.44088767 0.22044384
[18,] 0.8539561 0.29208773 0.14604387
[19,] 0.8750584 0.24988310 0.12494155
[20,] 0.8414645 0.31707092 0.15853546
[21,] 0.8061125 0.38777491 0.19388746
[22,] 0.7907981 0.41840376 0.20920188
[23,] 0.7548310 0.49033801 0.24516901
[24,] 0.7316669 0.53666626 0.26833313
[25,] 0.6809187 0.63816258 0.31908129
[26,] 0.6442959 0.71140829 0.35570414
[27,] 0.5931751 0.81364990 0.40682495
[28,] 0.5871727 0.82565451 0.41282726
[29,] 0.5586604 0.88267924 0.44133962
[30,] 0.6809195 0.63816102 0.31908051
[31,] 0.6470366 0.70592683 0.35296342
[32,] 0.6409840 0.71803199 0.35901599
[33,] 0.7455178 0.50896448 0.25448224
[34,] 0.7153444 0.56931115 0.28465558
[35,] 0.7146854 0.57062911 0.28531455
[36,] 0.6930717 0.61385660 0.30692830
[37,] 0.6566153 0.68676938 0.34338469
[38,] 0.6088370 0.78232604 0.39116302
[39,] 0.5677236 0.86455282 0.43227641
[40,] 0.5261212 0.94775757 0.47387879
[41,] 0.5222719 0.95545624 0.47772812
[42,] 0.4840641 0.96812813 0.51593594
[43,] 0.4916619 0.98332378 0.50833811
[44,] 0.5338815 0.93223705 0.46611853
[45,] 0.8300752 0.33984969 0.16992484
[46,] 0.7974483 0.40510342 0.20255171
[47,] 0.7728373 0.45432545 0.22716272
[48,] 0.7347750 0.53044993 0.26522497
[49,] 0.6971852 0.60562963 0.30281482
[50,] 0.6691898 0.66162045 0.33081023
[51,] 0.7084945 0.58301090 0.29150545
[52,] 0.6833222 0.63335558 0.31667779
[53,] 0.6506079 0.69878420 0.34939210
[54,] 0.6732730 0.65345407 0.32672704
[55,] 0.6447339 0.71053214 0.35526607
[56,] 0.6191710 0.76165795 0.38082898
[57,] 0.5873928 0.82521445 0.41260723
[58,] 0.5916051 0.81678985 0.40839492
[59,] 0.6075188 0.78496243 0.39248121
[60,] 0.5614491 0.87710179 0.43855090
[61,] 0.7164493 0.56710130 0.28355065
[62,] 0.7486740 0.50265195 0.25132598
[63,] 0.7896316 0.42073671 0.21036836
[64,] 0.7661504 0.46769918 0.23384959
[65,] 0.7599429 0.48011410 0.24005705
[66,] 0.7329293 0.53414149 0.26707075
[67,] 0.7388507 0.52229851 0.26114926
[68,] 0.7197591 0.56048173 0.28024086
[69,] 0.6905104 0.61897911 0.30948955
[70,] 0.7118820 0.57623607 0.28811803
[71,] 0.7330930 0.53381397 0.26690699
[72,] 0.9111481 0.17770389 0.08885194
[73,] 0.8921350 0.21573009 0.10786504
[74,] 0.8735724 0.25285516 0.12642758
[75,] 0.8491119 0.30177628 0.15088814
[76,] 0.8210982 0.35780354 0.17890177
[77,] 0.8343488 0.33130247 0.16565124
[78,] 0.8248854 0.35022920 0.17511460
[79,] 0.7951005 0.40979898 0.20489949
[80,] 0.7995541 0.40089189 0.20044594
[81,] 0.7863247 0.42735069 0.21367535
[82,] 0.8484902 0.30301962 0.15150981
[83,] 0.8425709 0.31485814 0.15742907
[84,] 0.8168830 0.36623393 0.18311697
[85,] 0.9546639 0.09067214 0.04533607
[86,] 0.9459232 0.10815365 0.05407682
[87,] 0.9413428 0.11731436 0.05865718
[88,] 0.9262761 0.14744790 0.07372395
[89,] 0.9104047 0.17919069 0.08959534
[90,] 0.9077784 0.18444317 0.09222158
[91,] 0.8882484 0.22350313 0.11175156
[92,] 0.8651451 0.26970971 0.13485485
[93,] 0.8627082 0.27458355 0.13729177
[94,] 0.8752188 0.24956230 0.12478115
[95,] 0.8629050 0.27419003 0.13709502
[96,] 0.8384858 0.32302835 0.16151418
[97,] 0.8080207 0.38395860 0.19197930
[98,] 0.7763635 0.44727293 0.22363647
[99,] 0.8325886 0.33482286 0.16741143
[100,] 0.8415160 0.31696791 0.15848395
[101,] 0.8088662 0.38226755 0.19113378
[102,] 0.7730355 0.45392906 0.22696453
[103,] 0.8517569 0.29648616 0.14824308
[104,] 0.8617031 0.27659386 0.13829693
[105,] 0.8334134 0.33317325 0.16658662
[106,] 0.7986152 0.40276956 0.20138478
[107,] 0.7594299 0.48114019 0.24057009
[108,] 0.7584275 0.48314495 0.24157247
[109,] 0.7386085 0.52278307 0.26139153
[110,] 0.6944397 0.61112070 0.30556035
[111,] 0.7515832 0.49683365 0.24841683
[112,] 0.8189280 0.36214394 0.18107197
[113,] 0.8171987 0.36560257 0.18280129
[114,] 0.7855092 0.42898156 0.21449078
[115,] 0.7524024 0.49519522 0.24759761
[116,] 0.7264784 0.54704314 0.27352157
[117,] 0.6907579 0.61848430 0.30924215
[118,] 0.6471255 0.70574902 0.35287451
[119,] 0.5963490 0.80730199 0.40365099
[120,] 0.5690081 0.86198381 0.43099190
[121,] 0.5103753 0.97924944 0.48962472
[122,] 0.4871552 0.97431038 0.51284481
[123,] 0.4741652 0.94833048 0.52583476
[124,] 0.4129160 0.82583203 0.58708399
[125,] 0.3598870 0.71977394 0.64011303
[126,] 0.3001526 0.60030518 0.69984741
[127,] 0.2439257 0.48785132 0.75607434
[128,] 0.7193226 0.56135490 0.28067745
[129,] 0.6583398 0.68332034 0.34166017
[130,] 0.6532909 0.69341813 0.34670907
[131,] 0.7213197 0.55736060 0.27868030
[132,] 0.6628977 0.67420456 0.33710228
[133,] 0.6510896 0.69782089 0.34891044
[134,] 0.6676825 0.66463496 0.33231748
[135,] 0.6799761 0.64004779 0.32002390
[136,] 0.6000624 0.79987523 0.39993762
[137,] 0.7916063 0.41678738 0.20839369
[138,] 0.7101087 0.57978267 0.28989134
[139,] 0.6807909 0.63841814 0.31920907
[140,] 0.5639802 0.87203966 0.43601983
[141,] 0.7414991 0.51700178 0.25850089
[142,] 0.6260236 0.74795290 0.37397645
[143,] 0.7310712 0.53785753 0.26892876
> postscript(file="/var/fisher/rcomp/tmp/14rdp1353352249.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/2amcd1353352249.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/3z6yx1353352249.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/4wxl41353352249.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/53o0y1353352249.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 = 162
Frequency = 1
1 2 3 4 5 6
-1.15097018 0.10727277 -0.75190621 -1.55174415 1.05947064 -0.13135110
7 8 9 10 11 12
-0.23422712 -4.29405092 -1.20678016 0.12110589 1.67096442 2.12407358
13 14 15 16 17 18
-0.01474482 0.87236387 0.26700489 -0.92387797 2.66436133 1.92817385
19 20 21 22 23 24
0.75256669 0.85549075 -1.67507248 1.66748727 0.13531366 -1.32294194
25 26 27 28 29 30
1.86764934 -3.33463912 -3.33463912 2.03625547 -0.42746684 0.17636851
31 32 33 34 35 36
0.34614892 0.48897738 -0.12286191 0.36700153 0.82780842 -0.73510540
37 38 39 40 41 42
1.95339646 1.53397733 2.00731788 -1.07842925 1.74236897 2.58195452
43 44 45 46 47 48
-0.80701941 -1.67050247 -1.51596728 0.92228747 -0.48198218 0.78360239
49 50 51 52 53 54
-0.84770163 1.77897626 -0.91679737 1.42504067 2.14005873 -3.72160561
55 56 57 58 59 60
-0.18145469 -0.80401241 0.10727277 -0.22714652 0.70359948 1.42135135
61 62 63 64 65 66
0.92738866 0.78642066 1.68497996 -0.96958590 -0.89995482 0.83534612
67 68 69 70 71 72
1.31269672 -1.81358320 0.09488371 -3.15341380 1.94634886 2.18359853
73 74 75 76 77 78
-0.85927503 1.31269672 0.88530028 -1.61408737 -1.18669093 0.88530028
79 80 81 82 83 84
1.91152246 -1.93545137 -4.14503480 0.05861325 0.66109855 -0.28667147
85 86 87 88 89 90
0.13627391 1.80402986 1.09206544 0.22766632 1.61598137 1.14287700
91 92 93 94 95 96
-2.36824957 -1.25033605 -0.37304552 -4.32309136 0.70164745 -1.27002008
97 98 99 100 101 102
0.02531047 0.44543758 0.86702241 0.30049883 0.40041198 -1.08695391
103 104 105 106 107 108
1.51735159 1.14072497 -0.44426765 0.57750346 0.41495307 -2.46388673
109 110 111 112 113 114
1.75460861 0.27939395 -0.34916411 -3.00372997 -1.57351527 0.52739988
115 116 117 118 119 120
-0.21049513 0.04333607 1.44969991 0.75691007 -0.06538131 2.07299608
121 122 123 124 125 126
-2.30999433 1.51501082 -1.00302200 -1.11047285 -1.02598490 0.84031643
127 128 129 130 131 132
-0.37090958 0.62109866 1.25946719 0.31269672 0.56300411 -1.48498918
133 134 135 136 137 138
0.15152054 -0.56628524 0.18786086 0.08554340 -4.34466887 -0.57570661
139 140 141 142 143 144
1.83519670 -0.76132758 1.11821776 1.55719251 0.42641978 0.48897738
145 146 147 148 149 150
0.89045932 0.49620740 -0.04589556 0.92391152 0.21690130 -1.52125964
151 152 153 154 155 156
1.20306819 1.69652772 -0.64428029 -0.22714652 -1.35639414 0.12622562
157 158 159 160 161 162
-3.22317577 2.75953226 -0.37304552 -0.92603001 -2.01687121 -0.49437124
> postscript(file="/var/fisher/rcomp/tmp/6x22p1353352249.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 = 162
Frequency = 1
lag(myerror, k = 1) myerror
0 -1.15097018 NA
1 0.10727277 -1.15097018
2 -0.75190621 0.10727277
3 -1.55174415 -0.75190621
4 1.05947064 -1.55174415
5 -0.13135110 1.05947064
6 -0.23422712 -0.13135110
7 -4.29405092 -0.23422712
8 -1.20678016 -4.29405092
9 0.12110589 -1.20678016
10 1.67096442 0.12110589
11 2.12407358 1.67096442
12 -0.01474482 2.12407358
13 0.87236387 -0.01474482
14 0.26700489 0.87236387
15 -0.92387797 0.26700489
16 2.66436133 -0.92387797
17 1.92817385 2.66436133
18 0.75256669 1.92817385
19 0.85549075 0.75256669
20 -1.67507248 0.85549075
21 1.66748727 -1.67507248
22 0.13531366 1.66748727
23 -1.32294194 0.13531366
24 1.86764934 -1.32294194
25 -3.33463912 1.86764934
26 -3.33463912 -3.33463912
27 2.03625547 -3.33463912
28 -0.42746684 2.03625547
29 0.17636851 -0.42746684
30 0.34614892 0.17636851
31 0.48897738 0.34614892
32 -0.12286191 0.48897738
33 0.36700153 -0.12286191
34 0.82780842 0.36700153
35 -0.73510540 0.82780842
36 1.95339646 -0.73510540
37 1.53397733 1.95339646
38 2.00731788 1.53397733
39 -1.07842925 2.00731788
40 1.74236897 -1.07842925
41 2.58195452 1.74236897
42 -0.80701941 2.58195452
43 -1.67050247 -0.80701941
44 -1.51596728 -1.67050247
45 0.92228747 -1.51596728
46 -0.48198218 0.92228747
47 0.78360239 -0.48198218
48 -0.84770163 0.78360239
49 1.77897626 -0.84770163
50 -0.91679737 1.77897626
51 1.42504067 -0.91679737
52 2.14005873 1.42504067
53 -3.72160561 2.14005873
54 -0.18145469 -3.72160561
55 -0.80401241 -0.18145469
56 0.10727277 -0.80401241
57 -0.22714652 0.10727277
58 0.70359948 -0.22714652
59 1.42135135 0.70359948
60 0.92738866 1.42135135
61 0.78642066 0.92738866
62 1.68497996 0.78642066
63 -0.96958590 1.68497996
64 -0.89995482 -0.96958590
65 0.83534612 -0.89995482
66 1.31269672 0.83534612
67 -1.81358320 1.31269672
68 0.09488371 -1.81358320
69 -3.15341380 0.09488371
70 1.94634886 -3.15341380
71 2.18359853 1.94634886
72 -0.85927503 2.18359853
73 1.31269672 -0.85927503
74 0.88530028 1.31269672
75 -1.61408737 0.88530028
76 -1.18669093 -1.61408737
77 0.88530028 -1.18669093
78 1.91152246 0.88530028
79 -1.93545137 1.91152246
80 -4.14503480 -1.93545137
81 0.05861325 -4.14503480
82 0.66109855 0.05861325
83 -0.28667147 0.66109855
84 0.13627391 -0.28667147
85 1.80402986 0.13627391
86 1.09206544 1.80402986
87 0.22766632 1.09206544
88 1.61598137 0.22766632
89 1.14287700 1.61598137
90 -2.36824957 1.14287700
91 -1.25033605 -2.36824957
92 -0.37304552 -1.25033605
93 -4.32309136 -0.37304552
94 0.70164745 -4.32309136
95 -1.27002008 0.70164745
96 0.02531047 -1.27002008
97 0.44543758 0.02531047
98 0.86702241 0.44543758
99 0.30049883 0.86702241
100 0.40041198 0.30049883
101 -1.08695391 0.40041198
102 1.51735159 -1.08695391
103 1.14072497 1.51735159
104 -0.44426765 1.14072497
105 0.57750346 -0.44426765
106 0.41495307 0.57750346
107 -2.46388673 0.41495307
108 1.75460861 -2.46388673
109 0.27939395 1.75460861
110 -0.34916411 0.27939395
111 -3.00372997 -0.34916411
112 -1.57351527 -3.00372997
113 0.52739988 -1.57351527
114 -0.21049513 0.52739988
115 0.04333607 -0.21049513
116 1.44969991 0.04333607
117 0.75691007 1.44969991
118 -0.06538131 0.75691007
119 2.07299608 -0.06538131
120 -2.30999433 2.07299608
121 1.51501082 -2.30999433
122 -1.00302200 1.51501082
123 -1.11047285 -1.00302200
124 -1.02598490 -1.11047285
125 0.84031643 -1.02598490
126 -0.37090958 0.84031643
127 0.62109866 -0.37090958
128 1.25946719 0.62109866
129 0.31269672 1.25946719
130 0.56300411 0.31269672
131 -1.48498918 0.56300411
132 0.15152054 -1.48498918
133 -0.56628524 0.15152054
134 0.18786086 -0.56628524
135 0.08554340 0.18786086
136 -4.34466887 0.08554340
137 -0.57570661 -4.34466887
138 1.83519670 -0.57570661
139 -0.76132758 1.83519670
140 1.11821776 -0.76132758
141 1.55719251 1.11821776
142 0.42641978 1.55719251
143 0.48897738 0.42641978
144 0.89045932 0.48897738
145 0.49620740 0.89045932
146 -0.04589556 0.49620740
147 0.92391152 -0.04589556
148 0.21690130 0.92391152
149 -1.52125964 0.21690130
150 1.20306819 -1.52125964
151 1.69652772 1.20306819
152 -0.64428029 1.69652772
153 -0.22714652 -0.64428029
154 -1.35639414 -0.22714652
155 0.12622562 -1.35639414
156 -3.22317577 0.12622562
157 2.75953226 -3.22317577
158 -0.37304552 2.75953226
159 -0.92603001 -0.37304552
160 -2.01687121 -0.92603001
161 -0.49437124 -2.01687121
162 NA -0.49437124
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.10727277 -1.15097018
[2,] -0.75190621 0.10727277
[3,] -1.55174415 -0.75190621
[4,] 1.05947064 -1.55174415
[5,] -0.13135110 1.05947064
[6,] -0.23422712 -0.13135110
[7,] -4.29405092 -0.23422712
[8,] -1.20678016 -4.29405092
[9,] 0.12110589 -1.20678016
[10,] 1.67096442 0.12110589
[11,] 2.12407358 1.67096442
[12,] -0.01474482 2.12407358
[13,] 0.87236387 -0.01474482
[14,] 0.26700489 0.87236387
[15,] -0.92387797 0.26700489
[16,] 2.66436133 -0.92387797
[17,] 1.92817385 2.66436133
[18,] 0.75256669 1.92817385
[19,] 0.85549075 0.75256669
[20,] -1.67507248 0.85549075
[21,] 1.66748727 -1.67507248
[22,] 0.13531366 1.66748727
[23,] -1.32294194 0.13531366
[24,] 1.86764934 -1.32294194
[25,] -3.33463912 1.86764934
[26,] -3.33463912 -3.33463912
[27,] 2.03625547 -3.33463912
[28,] -0.42746684 2.03625547
[29,] 0.17636851 -0.42746684
[30,] 0.34614892 0.17636851
[31,] 0.48897738 0.34614892
[32,] -0.12286191 0.48897738
[33,] 0.36700153 -0.12286191
[34,] 0.82780842 0.36700153
[35,] -0.73510540 0.82780842
[36,] 1.95339646 -0.73510540
[37,] 1.53397733 1.95339646
[38,] 2.00731788 1.53397733
[39,] -1.07842925 2.00731788
[40,] 1.74236897 -1.07842925
[41,] 2.58195452 1.74236897
[42,] -0.80701941 2.58195452
[43,] -1.67050247 -0.80701941
[44,] -1.51596728 -1.67050247
[45,] 0.92228747 -1.51596728
[46,] -0.48198218 0.92228747
[47,] 0.78360239 -0.48198218
[48,] -0.84770163 0.78360239
[49,] 1.77897626 -0.84770163
[50,] -0.91679737 1.77897626
[51,] 1.42504067 -0.91679737
[52,] 2.14005873 1.42504067
[53,] -3.72160561 2.14005873
[54,] -0.18145469 -3.72160561
[55,] -0.80401241 -0.18145469
[56,] 0.10727277 -0.80401241
[57,] -0.22714652 0.10727277
[58,] 0.70359948 -0.22714652
[59,] 1.42135135 0.70359948
[60,] 0.92738866 1.42135135
[61,] 0.78642066 0.92738866
[62,] 1.68497996 0.78642066
[63,] -0.96958590 1.68497996
[64,] -0.89995482 -0.96958590
[65,] 0.83534612 -0.89995482
[66,] 1.31269672 0.83534612
[67,] -1.81358320 1.31269672
[68,] 0.09488371 -1.81358320
[69,] -3.15341380 0.09488371
[70,] 1.94634886 -3.15341380
[71,] 2.18359853 1.94634886
[72,] -0.85927503 2.18359853
[73,] 1.31269672 -0.85927503
[74,] 0.88530028 1.31269672
[75,] -1.61408737 0.88530028
[76,] -1.18669093 -1.61408737
[77,] 0.88530028 -1.18669093
[78,] 1.91152246 0.88530028
[79,] -1.93545137 1.91152246
[80,] -4.14503480 -1.93545137
[81,] 0.05861325 -4.14503480
[82,] 0.66109855 0.05861325
[83,] -0.28667147 0.66109855
[84,] 0.13627391 -0.28667147
[85,] 1.80402986 0.13627391
[86,] 1.09206544 1.80402986
[87,] 0.22766632 1.09206544
[88,] 1.61598137 0.22766632
[89,] 1.14287700 1.61598137
[90,] -2.36824957 1.14287700
[91,] -1.25033605 -2.36824957
[92,] -0.37304552 -1.25033605
[93,] -4.32309136 -0.37304552
[94,] 0.70164745 -4.32309136
[95,] -1.27002008 0.70164745
[96,] 0.02531047 -1.27002008
[97,] 0.44543758 0.02531047
[98,] 0.86702241 0.44543758
[99,] 0.30049883 0.86702241
[100,] 0.40041198 0.30049883
[101,] -1.08695391 0.40041198
[102,] 1.51735159 -1.08695391
[103,] 1.14072497 1.51735159
[104,] -0.44426765 1.14072497
[105,] 0.57750346 -0.44426765
[106,] 0.41495307 0.57750346
[107,] -2.46388673 0.41495307
[108,] 1.75460861 -2.46388673
[109,] 0.27939395 1.75460861
[110,] -0.34916411 0.27939395
[111,] -3.00372997 -0.34916411
[112,] -1.57351527 -3.00372997
[113,] 0.52739988 -1.57351527
[114,] -0.21049513 0.52739988
[115,] 0.04333607 -0.21049513
[116,] 1.44969991 0.04333607
[117,] 0.75691007 1.44969991
[118,] -0.06538131 0.75691007
[119,] 2.07299608 -0.06538131
[120,] -2.30999433 2.07299608
[121,] 1.51501082 -2.30999433
[122,] -1.00302200 1.51501082
[123,] -1.11047285 -1.00302200
[124,] -1.02598490 -1.11047285
[125,] 0.84031643 -1.02598490
[126,] -0.37090958 0.84031643
[127,] 0.62109866 -0.37090958
[128,] 1.25946719 0.62109866
[129,] 0.31269672 1.25946719
[130,] 0.56300411 0.31269672
[131,] -1.48498918 0.56300411
[132,] 0.15152054 -1.48498918
[133,] -0.56628524 0.15152054
[134,] 0.18786086 -0.56628524
[135,] 0.08554340 0.18786086
[136,] -4.34466887 0.08554340
[137,] -0.57570661 -4.34466887
[138,] 1.83519670 -0.57570661
[139,] -0.76132758 1.83519670
[140,] 1.11821776 -0.76132758
[141,] 1.55719251 1.11821776
[142,] 0.42641978 1.55719251
[143,] 0.48897738 0.42641978
[144,] 0.89045932 0.48897738
[145,] 0.49620740 0.89045932
[146,] -0.04589556 0.49620740
[147,] 0.92391152 -0.04589556
[148,] 0.21690130 0.92391152
[149,] -1.52125964 0.21690130
[150,] 1.20306819 -1.52125964
[151,] 1.69652772 1.20306819
[152,] -0.64428029 1.69652772
[153,] -0.22714652 -0.64428029
[154,] -1.35639414 -0.22714652
[155,] 0.12622562 -1.35639414
[156,] -3.22317577 0.12622562
[157,] 2.75953226 -3.22317577
[158,] -0.37304552 2.75953226
[159,] -0.92603001 -0.37304552
[160,] -2.01687121 -0.92603001
[161,] -0.49437124 -2.01687121
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.10727277 -1.15097018
2 -0.75190621 0.10727277
3 -1.55174415 -0.75190621
4 1.05947064 -1.55174415
5 -0.13135110 1.05947064
6 -0.23422712 -0.13135110
7 -4.29405092 -0.23422712
8 -1.20678016 -4.29405092
9 0.12110589 -1.20678016
10 1.67096442 0.12110589
11 2.12407358 1.67096442
12 -0.01474482 2.12407358
13 0.87236387 -0.01474482
14 0.26700489 0.87236387
15 -0.92387797 0.26700489
16 2.66436133 -0.92387797
17 1.92817385 2.66436133
18 0.75256669 1.92817385
19 0.85549075 0.75256669
20 -1.67507248 0.85549075
21 1.66748727 -1.67507248
22 0.13531366 1.66748727
23 -1.32294194 0.13531366
24 1.86764934 -1.32294194
25 -3.33463912 1.86764934
26 -3.33463912 -3.33463912
27 2.03625547 -3.33463912
28 -0.42746684 2.03625547
29 0.17636851 -0.42746684
30 0.34614892 0.17636851
31 0.48897738 0.34614892
32 -0.12286191 0.48897738
33 0.36700153 -0.12286191
34 0.82780842 0.36700153
35 -0.73510540 0.82780842
36 1.95339646 -0.73510540
37 1.53397733 1.95339646
38 2.00731788 1.53397733
39 -1.07842925 2.00731788
40 1.74236897 -1.07842925
41 2.58195452 1.74236897
42 -0.80701941 2.58195452
43 -1.67050247 -0.80701941
44 -1.51596728 -1.67050247
45 0.92228747 -1.51596728
46 -0.48198218 0.92228747
47 0.78360239 -0.48198218
48 -0.84770163 0.78360239
49 1.77897626 -0.84770163
50 -0.91679737 1.77897626
51 1.42504067 -0.91679737
52 2.14005873 1.42504067
53 -3.72160561 2.14005873
54 -0.18145469 -3.72160561
55 -0.80401241 -0.18145469
56 0.10727277 -0.80401241
57 -0.22714652 0.10727277
58 0.70359948 -0.22714652
59 1.42135135 0.70359948
60 0.92738866 1.42135135
61 0.78642066 0.92738866
62 1.68497996 0.78642066
63 -0.96958590 1.68497996
64 -0.89995482 -0.96958590
65 0.83534612 -0.89995482
66 1.31269672 0.83534612
67 -1.81358320 1.31269672
68 0.09488371 -1.81358320
69 -3.15341380 0.09488371
70 1.94634886 -3.15341380
71 2.18359853 1.94634886
72 -0.85927503 2.18359853
73 1.31269672 -0.85927503
74 0.88530028 1.31269672
75 -1.61408737 0.88530028
76 -1.18669093 -1.61408737
77 0.88530028 -1.18669093
78 1.91152246 0.88530028
79 -1.93545137 1.91152246
80 -4.14503480 -1.93545137
81 0.05861325 -4.14503480
82 0.66109855 0.05861325
83 -0.28667147 0.66109855
84 0.13627391 -0.28667147
85 1.80402986 0.13627391
86 1.09206544 1.80402986
87 0.22766632 1.09206544
88 1.61598137 0.22766632
89 1.14287700 1.61598137
90 -2.36824957 1.14287700
91 -1.25033605 -2.36824957
92 -0.37304552 -1.25033605
93 -4.32309136 -0.37304552
94 0.70164745 -4.32309136
95 -1.27002008 0.70164745
96 0.02531047 -1.27002008
97 0.44543758 0.02531047
98 0.86702241 0.44543758
99 0.30049883 0.86702241
100 0.40041198 0.30049883
101 -1.08695391 0.40041198
102 1.51735159 -1.08695391
103 1.14072497 1.51735159
104 -0.44426765 1.14072497
105 0.57750346 -0.44426765
106 0.41495307 0.57750346
107 -2.46388673 0.41495307
108 1.75460861 -2.46388673
109 0.27939395 1.75460861
110 -0.34916411 0.27939395
111 -3.00372997 -0.34916411
112 -1.57351527 -3.00372997
113 0.52739988 -1.57351527
114 -0.21049513 0.52739988
115 0.04333607 -0.21049513
116 1.44969991 0.04333607
117 0.75691007 1.44969991
118 -0.06538131 0.75691007
119 2.07299608 -0.06538131
120 -2.30999433 2.07299608
121 1.51501082 -2.30999433
122 -1.00302200 1.51501082
123 -1.11047285 -1.00302200
124 -1.02598490 -1.11047285
125 0.84031643 -1.02598490
126 -0.37090958 0.84031643
127 0.62109866 -0.37090958
128 1.25946719 0.62109866
129 0.31269672 1.25946719
130 0.56300411 0.31269672
131 -1.48498918 0.56300411
132 0.15152054 -1.48498918
133 -0.56628524 0.15152054
134 0.18786086 -0.56628524
135 0.08554340 0.18786086
136 -4.34466887 0.08554340
137 -0.57570661 -4.34466887
138 1.83519670 -0.57570661
139 -0.76132758 1.83519670
140 1.11821776 -0.76132758
141 1.55719251 1.11821776
142 0.42641978 1.55719251
143 0.48897738 0.42641978
144 0.89045932 0.48897738
145 0.49620740 0.89045932
146 -0.04589556 0.49620740
147 0.92391152 -0.04589556
148 0.21690130 0.92391152
149 -1.52125964 0.21690130
150 1.20306819 -1.52125964
151 1.69652772 1.20306819
152 -0.64428029 1.69652772
153 -0.22714652 -0.64428029
154 -1.35639414 -0.22714652
155 0.12622562 -1.35639414
156 -3.22317577 0.12622562
157 2.75953226 -3.22317577
158 -0.37304552 2.75953226
159 -0.92603001 -0.37304552
160 -2.01687121 -0.92603001
161 -0.49437124 -2.01687121
> 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/7xv4t1353352249.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/8f7xt1353352249.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/9sjk01353352249.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/100h4i1353352249.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/11mjmn1353352249.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/12xj9a1353352250.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/13pftb1353352250.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/142g221353352250.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/15yobd1353352250.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/16knhk1353352250.tab")
+ }
>
> try(system("convert tmp/14rdp1353352249.ps tmp/14rdp1353352249.png",intern=TRUE))
character(0)
> try(system("convert tmp/2amcd1353352249.ps tmp/2amcd1353352249.png",intern=TRUE))
character(0)
> try(system("convert tmp/3z6yx1353352249.ps tmp/3z6yx1353352249.png",intern=TRUE))
character(0)
> try(system("convert tmp/4wxl41353352249.ps tmp/4wxl41353352249.png",intern=TRUE))
character(0)
> try(system("convert tmp/53o0y1353352249.ps tmp/53o0y1353352249.png",intern=TRUE))
character(0)
> try(system("convert tmp/6x22p1353352249.ps tmp/6x22p1353352249.png",intern=TRUE))
character(0)
> try(system("convert tmp/7xv4t1353352249.ps tmp/7xv4t1353352249.png",intern=TRUE))
character(0)
> try(system("convert tmp/8f7xt1353352249.ps tmp/8f7xt1353352249.png",intern=TRUE))
character(0)
> try(system("convert tmp/9sjk01353352249.ps tmp/9sjk01353352249.png",intern=TRUE))
character(0)
> try(system("convert tmp/100h4i1353352249.ps tmp/100h4i1353352249.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.955 1.324 9.282