R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
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
+ ,4
+ ,5
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,5
+ ,5
+ ,4
+ ,4
+ ,5
+ ,5
+ ,3
+ ,3
+ ,2
+ ,3
+ ,4
+ ,4
+ ,2
+ ,3
+ ,2
+ ,3
+ ,2
+ ,4
+ ,5
+ ,4
+ ,3
+ ,3
+ ,4
+ ,5
+ ,4
+ ,3
+ ,3
+ ,3
+ ,3
+ ,4
+ ,2
+ ,3
+ ,4
+ ,4
+ ,2
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,5
+ ,4
+ ,3
+ ,2
+ ,3
+ ,2
+ ,2
+ ,4
+ ,3
+ ,2
+ ,4
+ ,4
+ ,4
+ ,2
+ ,3
+ ,2
+ ,4
+ ,2
+ ,3
+ ,5
+ ,4
+ ,2
+ ,5
+ ,5
+ ,5
+ ,3
+ ,4
+ ,2
+ ,3
+ ,3
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,3
+ ,4
+ ,4
+ ,5
+ ,3
+ ,2
+ ,3
+ ,3
+ ,3
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,2
+ ,3
+ ,2
+ ,2
+ ,2
+ ,4
+ ,4
+ ,2
+ ,4
+ ,4
+ ,3
+ ,4
+ ,3
+ ,3
+ ,2
+ ,4
+ ,4
+ ,4
+ ,3
+ ,2
+ ,4
+ ,4
+ ,2
+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+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,5
+ ,3
+ ,3
+ ,3
+ ,4
+ ,4
+ ,4
+ ,2
+ ,3
+ ,2
+ ,2
+ ,3
+ ,4
+ ,3
+ ,3
+ ,4
+ ,4
+ ,2
+ ,4
+ ,3
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,2
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,3
+ ,5
+ ,2
+ ,2
+ ,2
+ ,2
+ ,4
+ ,3
+ ,5
+ ,2
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,3
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,2
+ ,4
+ ,4
+ ,4
+ ,3
+ ,3
+ ,3
+ ,3
+ ,3
+ ,4
+ ,3
+ ,4
+ ,2
+ ,4
+ ,3
+ ,4
+ ,5
+ ,3
+ ,5
+ ,5
+ ,5
+ ,5)
+ ,dim=c(6
+ ,151)
+ ,dimnames=list(c('y'
+ ,'x1'
+ ,'x2'
+ ,'x3'
+ ,'x4'
+ ,'x5')
+ ,1:151))
> y <- array(NA,dim=c(6,151),dimnames=list(c('y','x1','x2','x3','x4','x5'),1:151))
> 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'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
y x1 x2 x3 x4 x5
1 4 4 5 4 4 4
2 4 4 4 4 3 4
3 5 5 4 4 5 5
4 3 3 2 3 4 4
5 2 3 2 3 2 4
6 5 4 3 3 4 5
7 4 3 3 3 3 4
8 2 3 4 4 2 4
9 4 4 3 4 4 5
10 4 3 2 3 2 2
11 4 3 2 4 4 4
12 2 3 2 4 2 3
13 5 4 2 5 5 5
14 3 4 2 3 3 4
15 4 3 4 4 4 4
16 4 3 3 4 4 5
17 3 2 3 3 3 3
18 4 4 4 4 4 4
19 2 3 2 2 2 4
20 4 2 4 4 3 4
21 3 3 2 4 4 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95 4 4 3 3 4 4
96 4 4 4 5 4 4
97 3 4 4 4 2 4
98 3 3 4 2 2 5
99 4 4 4 4 4 5
100 2 4 3 3 3 4
101 4 3 4 2 2 4
102 4 4 2 4 4 5
103 4 3 3 4 3 5
104 5 4 4 3 3 4
105 5 4 3 4 4 5
106 5 3 3 4 3 4
107 4 3 2 4 4 4
108 4 3 2 4 3 4
109 3 3 2 4 3 4
110 2 3 2 4 3 2
111 2 2 4 2 2 4
112 4 4 2 4 2 5
113 2 2 3 3 1 4
114 3 3 4 3 2 4
115 4 3 3 4 3 4
116 4 3 3 3 3 4
117 4 4 4 4 3 4
118 4 4 3 3 3 3
119 3 3 2 3 2 4
120 4 4 3 4 4 4
121 3 3 2 3 2 3
122 4 3 3 4 3 4
123 4 3 4 3 3 5
124 4 4 3 4 4 5
125 2 2 3 2 3 3
126 5 4 4 3 3 5
127 5 3 2 4 3 4
128 3 3 2 3 4 4
129 3 4 3 4 4 3
130 3 4 3 3 3 3
131 4 4 3 4 4 4
132 3 3 5 1 5 5
133 2 2 4 2 2 2
134 5 4 4 4 4 4
135 4 2 4 4 4 4
136 2 3 3 3 3 4
137 4 4 4 4 3 5
138 3 3 3 4 4 4
139 2 3 2 2 3 4
140 3 3 4 4 2 4
141 3 3 4 4 4 4
142 4 4 4 4 4 4
143 4 3 2 4 4 4
144 4 3 4 4 3 5
145 2 2 2 2 4 3
146 5 2 4 4 4 4
147 4 3 3 3 4 4
148 4 4 2 4 4 4
149 3 3 3 3 3 4
150 3 4 2 4 3 4
151 5 3 5 5 5 5
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) x1 x2 x3 x4 x5
-0.37757 0.13456 0.05101 0.33632 0.27231 0.33092
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.46326 -0.42798 -0.02087 0.33499 1.65646
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.37757 0.43184 -0.874 0.383382
x1 0.13456 0.09190 1.464 0.145301
x2 0.05101 0.06133 0.832 0.406935
x3 0.33632 0.08973 3.748 0.000257 ***
x4 0.27231 0.07050 3.863 0.000169 ***
x5 0.33092 0.09618 3.441 0.000759 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.6749 on 145 degrees of freedom
Multiple R-squared: 0.4473, Adjusted R-squared: 0.4282
F-statistic: 23.47 on 5 and 145 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.62287112 0.7542578 0.3771289
[2,] 0.69925730 0.6014854 0.3007427
[3,] 0.77397513 0.4520497 0.2260249
[4,] 0.74613623 0.5077275 0.2538638
[5,] 0.75450442 0.4909912 0.2454956
[6,] 0.78069010 0.4386198 0.2193099
[7,] 0.70031803 0.5993639 0.2996820
[8,] 0.64846551 0.7030690 0.3515345
[9,] 0.57029169 0.8594166 0.4297083
[10,] 0.50716016 0.9856797 0.4928398
[11,] 0.46051859 0.9210372 0.5394814
[12,] 0.54246221 0.9150756 0.4575378
[13,] 0.59883818 0.8023236 0.4011618
[14,] 0.53604862 0.9279028 0.4639514
[15,] 0.46062714 0.9212543 0.5393729
[16,] 0.39230426 0.7846085 0.6076957
[17,] 0.34000802 0.6800160 0.6599920
[18,] 0.34695945 0.6939189 0.6530405
[19,] 0.35120414 0.7024083 0.6487959
[20,] 0.29158561 0.5831712 0.7084144
[21,] 0.23635906 0.4727181 0.7636409
[22,] 0.18801297 0.3760259 0.8119870
[23,] 0.27536625 0.5507325 0.7246337
[24,] 0.22967498 0.4593500 0.7703250
[25,] 0.20871290 0.4174258 0.7912871
[26,] 0.17749828 0.3549966 0.8225017
[27,] 0.14805413 0.2961083 0.8519459
[28,] 0.39495987 0.7899197 0.6050401
[29,] 0.33967550 0.6793510 0.6603245
[30,] 0.31693397 0.6338679 0.6830660
[31,] 0.28631455 0.5726291 0.7136855
[32,] 0.25924119 0.5184824 0.7407588
[33,] 0.22303609 0.4460722 0.7769639
[34,] 0.22771437 0.4554287 0.7722856
[35,] 0.29100522 0.5820104 0.7089948
[36,] 0.25090818 0.5018164 0.7490918
[37,] 0.25570333 0.5114067 0.7442967
[38,] 0.24617637 0.4923527 0.7538236
[39,] 0.20707221 0.4141444 0.7929278
[40,] 0.18595892 0.3719178 0.8140411
[41,] 0.15252285 0.3050457 0.8474772
[42,] 0.18555875 0.3711175 0.8144413
[43,] 0.16628414 0.3325683 0.8337159
[44,] 0.14061916 0.2812383 0.8593808
[45,] 0.11661783 0.2332357 0.8833822
[46,] 0.09441739 0.1888348 0.9055826
[47,] 0.16080798 0.3216160 0.8391920
[48,] 0.16330581 0.3266116 0.8366942
[49,] 0.13638975 0.2727795 0.8636102
[50,] 0.11062595 0.2212519 0.8893741
[51,] 0.09628850 0.1925770 0.9037115
[52,] 0.10473942 0.2094788 0.8952606
[53,] 0.09774395 0.1954879 0.9022561
[54,] 0.07930587 0.1586117 0.9206941
[55,] 0.24575663 0.4915133 0.7542434
[56,] 0.20989795 0.4197959 0.7901020
[57,] 0.17664228 0.3532846 0.8233577
[58,] 0.15214555 0.3042911 0.8478544
[59,] 0.12890729 0.2578146 0.8710927
[60,] 0.11021045 0.2204209 0.8897895
[61,] 0.08892375 0.1778475 0.9110762
[62,] 0.07257260 0.1451452 0.9274274
[63,] 0.06429218 0.1285844 0.9357078
[64,] 0.14473057 0.2894611 0.8552694
[65,] 0.23054309 0.4610862 0.7694569
[66,] 0.23011919 0.4602384 0.7698808
[67,] 0.21637410 0.4327482 0.7836259
[68,] 0.35705983 0.7141197 0.6429402
[69,] 0.33578740 0.6715748 0.6642126
[70,] 0.35219949 0.7043990 0.6478005
[71,] 0.31238785 0.6247757 0.6876122
[72,] 0.32017391 0.6403478 0.6798261
[73,] 0.30976699 0.6195340 0.6902330
[74,] 0.28979497 0.5795899 0.7102050
[75,] 0.27312896 0.5462579 0.7268710
[76,] 0.25146119 0.5029224 0.7485388
[77,] 0.25869458 0.5173892 0.7413054
[78,] 0.29163545 0.5832709 0.7083646
[79,] 0.27654541 0.5530908 0.7234546
[80,] 0.31783636 0.6356727 0.6821636
[81,] 0.43623559 0.8724712 0.5637644
[82,] 0.39172557 0.7834511 0.6082744
[83,] 0.44766999 0.8953400 0.5523300
[84,] 0.40069401 0.8013880 0.5993060
[85,] 0.37012636 0.7402527 0.6298736
[86,] 0.32703033 0.6540607 0.6729697
[87,] 0.29342346 0.5868469 0.7065765
[88,] 0.27564772 0.5512954 0.7243523
[89,] 0.28339572 0.5667914 0.7166043
[90,] 0.24436407 0.4887281 0.7556359
[91,] 0.23079235 0.4615847 0.7692076
[92,] 0.40686208 0.8137242 0.5931379
[93,] 0.50592445 0.9881511 0.4940755
[94,] 0.46716016 0.9343203 0.5328398
[95,] 0.41758473 0.8351695 0.5824153
[96,] 0.59505706 0.8098859 0.4049429
[97,] 0.57842938 0.8431412 0.4215706
[98,] 0.72438383 0.5512323 0.2756162
[99,] 0.68336704 0.6332659 0.3166330
[100,] 0.65932679 0.6813464 0.3406732
[101,] 0.63985531 0.7202894 0.3601447
[102,] 0.68143662 0.6371268 0.3185634
[103,] 0.66333867 0.6733227 0.3366613
[104,] 0.61478697 0.7704261 0.3852130
[105,] 0.62443654 0.7511269 0.3755635
[106,] 0.57742630 0.8451474 0.4225737
[107,] 0.52856078 0.9428784 0.4714392
[108,] 0.53756853 0.9248629 0.4624315
[109,] 0.47897403 0.9579481 0.5210260
[110,] 0.55370462 0.8925908 0.4462954
[111,] 0.49229876 0.9845975 0.5077012
[112,] 0.43180060 0.8636012 0.5681994
[113,] 0.40159282 0.8031856 0.5984072
[114,] 0.35454794 0.7090959 0.6454521
[115,] 0.30619778 0.6123956 0.6938022
[116,] 0.26330852 0.5266170 0.7366915
[117,] 0.22407664 0.4481533 0.7759234
[118,] 0.40650357 0.8130071 0.5934964
[119,] 0.74422370 0.5115526 0.2557763
[120,] 0.68842081 0.6231584 0.3115792
[121,] 0.72000823 0.5599835 0.2799918
[122,] 0.65174915 0.6965017 0.3482508
[123,] 0.57442678 0.8511464 0.4255732
[124,] 0.50837305 0.9832539 0.4916270
[125,] 0.44403871 0.8880774 0.5559613
[126,] 0.58808281 0.8238344 0.4119172
[127,] 0.49476125 0.9895225 0.5052388
[128,] 0.55969519 0.8806096 0.4403048
[129,] 0.46285419 0.9257084 0.5371458
[130,] 0.54067574 0.9186485 0.4593243
[131,] 0.46064221 0.9212844 0.5393578
[132,] 0.33886072 0.6777214 0.6611393
[133,] 0.49685078 0.9937016 0.5031492
[134,] 0.33562470 0.6712494 0.6643753
> postscript(file="/var/www/html/rcomp/tmp/1lmoa1291375391.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2wvnd1291375391.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3wvnd1291375391.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/4wvnd1291375391.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/564mg1291375391.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 = 151
Frequency = 1
1 2 3 4 5 6
-0.173900599 0.149414747 0.139318458 -0.549992799 -1.005381830 0.933512021
7 8 9 10 11 12
0.671302825 -1.443717187 -0.402803615 1.656463646 0.113691565 -1.010774728
13 14 15 16 17 18
0.039585125 -0.412249895 0.011671843 -0.268241034 0.136788143 -0.122890738
19 20 21 22 23 24
-0.669066194 0.418539909 -0.886308435 0.021768131 -0.020871016 -0.071880877
25 26 27 28 29 30
-0.122890738 0.334987189 0.877109262 0.280797005 -0.020871016 -0.020871016
31 32 33 34 35 36
0.892598449 0.113691565 -0.504823337 -0.122890738 -0.122890738 1.391389948
37 38 39 40 41 42
-0.020871016 0.671302825 0.200424608 -0.385099935 0.149414747 -0.674459092
43 44 45 46 47 48
-0.967446072 -0.319250895 0.421720231 0.546186524 0.113691565 0.334987189
49 50 51 52 53 54
-0.020871016 0.979128984 -0.379707036 -0.364217849 -0.122890738 -0.071880877
55 56 57 58 59 60
-1.443717187 -0.687533195 -0.122890738 0.011671843 0.283977328 -0.850585253
61 62 63 64 65 66
-0.733076345 -0.122890738 1.556282813 -0.071880877 -0.062434597 0.251434469
67 68 69 70 71 72
-0.277687314 0.325540908 0.011671843 -0.241964133 -0.394546215 1.465496388
73 74 75 76 77 78
-1.351793754 0.706823499 0.495176663 1.559836822 0.470241196 0.658302534
79 80 81 82 83 84
0.187798004 -0.652012521 0.620292964 0.421720231 -0.514269617 0.450007201
85 86 87 88 89 90
0.737801872 -0.909202506 -0.527269908 -0.941371678 1.251434469 -0.107401551
91 92 93 94 95 96
1.032553928 0.062681704 -0.379707036 0.002225562 0.264434759 -0.459206374
97 98 99 100 101 102
-0.578279769 -0.102008653 -0.453813476 -1.463259756 1.228914085 -0.351793754
103 104 105 106 107 108
0.004064451 1.485730383 0.597196385 1.334987189 0.113691565 0.385997050
109 110 111 112 113 114
-0.614002950 -0.952157475 -0.636523334 0.192817216 -0.649523625 -0.107401551
115 116 117 118 119 120
0.334987189 0.671302825 0.149414747 0.867662981 -0.005381830 -0.071880877
121 122 123 124 125 126
0.325540908 0.334987189 0.289370226 -0.402803615 -0.526896221 1.154807645
127 128 129 130 131 132
1.385997050 -0.549992799 -0.740958140 -0.132337019 -0.071880877 -0.633619333
133 134 135 136 137 138
0.025322141 0.877109262 0.146234424 -1.328697175 -0.181507991 -0.937318296
139 140 141 142 143 144
-0.941371678 -0.443717187 -0.988328157 -0.122890738 0.113691565 -0.046945410
145 146 147 148 149 150
-0.748191845 1.146234424 0.398997340 -0.020871016 -0.328697175 -0.748565531
151
0.021118123
> postscript(file="/var/www/html/rcomp/tmp/664mg1291375391.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 = 151
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.173900599 NA
1 0.149414747 -0.173900599
2 0.139318458 0.149414747
3 -0.549992799 0.139318458
4 -1.005381830 -0.549992799
5 0.933512021 -1.005381830
6 0.671302825 0.933512021
7 -1.443717187 0.671302825
8 -0.402803615 -1.443717187
9 1.656463646 -0.402803615
10 0.113691565 1.656463646
11 -1.010774728 0.113691565
12 0.039585125 -1.010774728
13 -0.412249895 0.039585125
14 0.011671843 -0.412249895
15 -0.268241034 0.011671843
16 0.136788143 -0.268241034
17 -0.122890738 0.136788143
18 -0.669066194 -0.122890738
19 0.418539909 -0.669066194
20 -0.886308435 0.418539909
21 0.021768131 -0.886308435
22 -0.020871016 0.021768131
23 -0.071880877 -0.020871016
24 -0.122890738 -0.071880877
25 0.334987189 -0.122890738
26 0.877109262 0.334987189
27 0.280797005 0.877109262
28 -0.020871016 0.280797005
29 -0.020871016 -0.020871016
30 0.892598449 -0.020871016
31 0.113691565 0.892598449
32 -0.504823337 0.113691565
33 -0.122890738 -0.504823337
34 -0.122890738 -0.122890738
35 1.391389948 -0.122890738
36 -0.020871016 1.391389948
37 0.671302825 -0.020871016
38 0.200424608 0.671302825
39 -0.385099935 0.200424608
40 0.149414747 -0.385099935
41 -0.674459092 0.149414747
42 -0.967446072 -0.674459092
43 -0.319250895 -0.967446072
44 0.421720231 -0.319250895
45 0.546186524 0.421720231
46 0.113691565 0.546186524
47 0.334987189 0.113691565
48 -0.020871016 0.334987189
49 0.979128984 -0.020871016
50 -0.379707036 0.979128984
51 -0.364217849 -0.379707036
52 -0.122890738 -0.364217849
53 -0.071880877 -0.122890738
54 -1.443717187 -0.071880877
55 -0.687533195 -1.443717187
56 -0.122890738 -0.687533195
57 0.011671843 -0.122890738
58 0.283977328 0.011671843
59 -0.850585253 0.283977328
60 -0.733076345 -0.850585253
61 -0.122890738 -0.733076345
62 1.556282813 -0.122890738
63 -0.071880877 1.556282813
64 -0.062434597 -0.071880877
65 0.251434469 -0.062434597
66 -0.277687314 0.251434469
67 0.325540908 -0.277687314
68 0.011671843 0.325540908
69 -0.241964133 0.011671843
70 -0.394546215 -0.241964133
71 1.465496388 -0.394546215
72 -1.351793754 1.465496388
73 0.706823499 -1.351793754
74 0.495176663 0.706823499
75 1.559836822 0.495176663
76 0.470241196 1.559836822
77 0.658302534 0.470241196
78 0.187798004 0.658302534
79 -0.652012521 0.187798004
80 0.620292964 -0.652012521
81 0.421720231 0.620292964
82 -0.514269617 0.421720231
83 0.450007201 -0.514269617
84 0.737801872 0.450007201
85 -0.909202506 0.737801872
86 -0.527269908 -0.909202506
87 -0.941371678 -0.527269908
88 1.251434469 -0.941371678
89 -0.107401551 1.251434469
90 1.032553928 -0.107401551
91 0.062681704 1.032553928
92 -0.379707036 0.062681704
93 0.002225562 -0.379707036
94 0.264434759 0.002225562
95 -0.459206374 0.264434759
96 -0.578279769 -0.459206374
97 -0.102008653 -0.578279769
98 -0.453813476 -0.102008653
99 -1.463259756 -0.453813476
100 1.228914085 -1.463259756
101 -0.351793754 1.228914085
102 0.004064451 -0.351793754
103 1.485730383 0.004064451
104 0.597196385 1.485730383
105 1.334987189 0.597196385
106 0.113691565 1.334987189
107 0.385997050 0.113691565
108 -0.614002950 0.385997050
109 -0.952157475 -0.614002950
110 -0.636523334 -0.952157475
111 0.192817216 -0.636523334
112 -0.649523625 0.192817216
113 -0.107401551 -0.649523625
114 0.334987189 -0.107401551
115 0.671302825 0.334987189
116 0.149414747 0.671302825
117 0.867662981 0.149414747
118 -0.005381830 0.867662981
119 -0.071880877 -0.005381830
120 0.325540908 -0.071880877
121 0.334987189 0.325540908
122 0.289370226 0.334987189
123 -0.402803615 0.289370226
124 -0.526896221 -0.402803615
125 1.154807645 -0.526896221
126 1.385997050 1.154807645
127 -0.549992799 1.385997050
128 -0.740958140 -0.549992799
129 -0.132337019 -0.740958140
130 -0.071880877 -0.132337019
131 -0.633619333 -0.071880877
132 0.025322141 -0.633619333
133 0.877109262 0.025322141
134 0.146234424 0.877109262
135 -1.328697175 0.146234424
136 -0.181507991 -1.328697175
137 -0.937318296 -0.181507991
138 -0.941371678 -0.937318296
139 -0.443717187 -0.941371678
140 -0.988328157 -0.443717187
141 -0.122890738 -0.988328157
142 0.113691565 -0.122890738
143 -0.046945410 0.113691565
144 -0.748191845 -0.046945410
145 1.146234424 -0.748191845
146 0.398997340 1.146234424
147 -0.020871016 0.398997340
148 -0.328697175 -0.020871016
149 -0.748565531 -0.328697175
150 0.021118123 -0.748565531
151 NA 0.021118123
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.149414747 -0.173900599
[2,] 0.139318458 0.149414747
[3,] -0.549992799 0.139318458
[4,] -1.005381830 -0.549992799
[5,] 0.933512021 -1.005381830
[6,] 0.671302825 0.933512021
[7,] -1.443717187 0.671302825
[8,] -0.402803615 -1.443717187
[9,] 1.656463646 -0.402803615
[10,] 0.113691565 1.656463646
[11,] -1.010774728 0.113691565
[12,] 0.039585125 -1.010774728
[13,] -0.412249895 0.039585125
[14,] 0.011671843 -0.412249895
[15,] -0.268241034 0.011671843
[16,] 0.136788143 -0.268241034
[17,] -0.122890738 0.136788143
[18,] -0.669066194 -0.122890738
[19,] 0.418539909 -0.669066194
[20,] -0.886308435 0.418539909
[21,] 0.021768131 -0.886308435
[22,] -0.020871016 0.021768131
[23,] -0.071880877 -0.020871016
[24,] -0.122890738 -0.071880877
[25,] 0.334987189 -0.122890738
[26,] 0.877109262 0.334987189
[27,] 0.280797005 0.877109262
[28,] -0.020871016 0.280797005
[29,] -0.020871016 -0.020871016
[30,] 0.892598449 -0.020871016
[31,] 0.113691565 0.892598449
[32,] -0.504823337 0.113691565
[33,] -0.122890738 -0.504823337
[34,] -0.122890738 -0.122890738
[35,] 1.391389948 -0.122890738
[36,] -0.020871016 1.391389948
[37,] 0.671302825 -0.020871016
[38,] 0.200424608 0.671302825
[39,] -0.385099935 0.200424608
[40,] 0.149414747 -0.385099935
[41,] -0.674459092 0.149414747
[42,] -0.967446072 -0.674459092
[43,] -0.319250895 -0.967446072
[44,] 0.421720231 -0.319250895
[45,] 0.546186524 0.421720231
[46,] 0.113691565 0.546186524
[47,] 0.334987189 0.113691565
[48,] -0.020871016 0.334987189
[49,] 0.979128984 -0.020871016
[50,] -0.379707036 0.979128984
[51,] -0.364217849 -0.379707036
[52,] -0.122890738 -0.364217849
[53,] -0.071880877 -0.122890738
[54,] -1.443717187 -0.071880877
[55,] -0.687533195 -1.443717187
[56,] -0.122890738 -0.687533195
[57,] 0.011671843 -0.122890738
[58,] 0.283977328 0.011671843
[59,] -0.850585253 0.283977328
[60,] -0.733076345 -0.850585253
[61,] -0.122890738 -0.733076345
[62,] 1.556282813 -0.122890738
[63,] -0.071880877 1.556282813
[64,] -0.062434597 -0.071880877
[65,] 0.251434469 -0.062434597
[66,] -0.277687314 0.251434469
[67,] 0.325540908 -0.277687314
[68,] 0.011671843 0.325540908
[69,] -0.241964133 0.011671843
[70,] -0.394546215 -0.241964133
[71,] 1.465496388 -0.394546215
[72,] -1.351793754 1.465496388
[73,] 0.706823499 -1.351793754
[74,] 0.495176663 0.706823499
[75,] 1.559836822 0.495176663
[76,] 0.470241196 1.559836822
[77,] 0.658302534 0.470241196
[78,] 0.187798004 0.658302534
[79,] -0.652012521 0.187798004
[80,] 0.620292964 -0.652012521
[81,] 0.421720231 0.620292964
[82,] -0.514269617 0.421720231
[83,] 0.450007201 -0.514269617
[84,] 0.737801872 0.450007201
[85,] -0.909202506 0.737801872
[86,] -0.527269908 -0.909202506
[87,] -0.941371678 -0.527269908
[88,] 1.251434469 -0.941371678
[89,] -0.107401551 1.251434469
[90,] 1.032553928 -0.107401551
[91,] 0.062681704 1.032553928
[92,] -0.379707036 0.062681704
[93,] 0.002225562 -0.379707036
[94,] 0.264434759 0.002225562
[95,] -0.459206374 0.264434759
[96,] -0.578279769 -0.459206374
[97,] -0.102008653 -0.578279769
[98,] -0.453813476 -0.102008653
[99,] -1.463259756 -0.453813476
[100,] 1.228914085 -1.463259756
[101,] -0.351793754 1.228914085
[102,] 0.004064451 -0.351793754
[103,] 1.485730383 0.004064451
[104,] 0.597196385 1.485730383
[105,] 1.334987189 0.597196385
[106,] 0.113691565 1.334987189
[107,] 0.385997050 0.113691565
[108,] -0.614002950 0.385997050
[109,] -0.952157475 -0.614002950
[110,] -0.636523334 -0.952157475
[111,] 0.192817216 -0.636523334
[112,] -0.649523625 0.192817216
[113,] -0.107401551 -0.649523625
[114,] 0.334987189 -0.107401551
[115,] 0.671302825 0.334987189
[116,] 0.149414747 0.671302825
[117,] 0.867662981 0.149414747
[118,] -0.005381830 0.867662981
[119,] -0.071880877 -0.005381830
[120,] 0.325540908 -0.071880877
[121,] 0.334987189 0.325540908
[122,] 0.289370226 0.334987189
[123,] -0.402803615 0.289370226
[124,] -0.526896221 -0.402803615
[125,] 1.154807645 -0.526896221
[126,] 1.385997050 1.154807645
[127,] -0.549992799 1.385997050
[128,] -0.740958140 -0.549992799
[129,] -0.132337019 -0.740958140
[130,] -0.071880877 -0.132337019
[131,] -0.633619333 -0.071880877
[132,] 0.025322141 -0.633619333
[133,] 0.877109262 0.025322141
[134,] 0.146234424 0.877109262
[135,] -1.328697175 0.146234424
[136,] -0.181507991 -1.328697175
[137,] -0.937318296 -0.181507991
[138,] -0.941371678 -0.937318296
[139,] -0.443717187 -0.941371678
[140,] -0.988328157 -0.443717187
[141,] -0.122890738 -0.988328157
[142,] 0.113691565 -0.122890738
[143,] -0.046945410 0.113691565
[144,] -0.748191845 -0.046945410
[145,] 1.146234424 -0.748191845
[146,] 0.398997340 1.146234424
[147,] -0.020871016 0.398997340
[148,] -0.328697175 -0.020871016
[149,] -0.748565531 -0.328697175
[150,] 0.021118123 -0.748565531
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.149414747 -0.173900599
2 0.139318458 0.149414747
3 -0.549992799 0.139318458
4 -1.005381830 -0.549992799
5 0.933512021 -1.005381830
6 0.671302825 0.933512021
7 -1.443717187 0.671302825
8 -0.402803615 -1.443717187
9 1.656463646 -0.402803615
10 0.113691565 1.656463646
11 -1.010774728 0.113691565
12 0.039585125 -1.010774728
13 -0.412249895 0.039585125
14 0.011671843 -0.412249895
15 -0.268241034 0.011671843
16 0.136788143 -0.268241034
17 -0.122890738 0.136788143
18 -0.669066194 -0.122890738
19 0.418539909 -0.669066194
20 -0.886308435 0.418539909
21 0.021768131 -0.886308435
22 -0.020871016 0.021768131
23 -0.071880877 -0.020871016
24 -0.122890738 -0.071880877
25 0.334987189 -0.122890738
26 0.877109262 0.334987189
27 0.280797005 0.877109262
28 -0.020871016 0.280797005
29 -0.020871016 -0.020871016
30 0.892598449 -0.020871016
31 0.113691565 0.892598449
32 -0.504823337 0.113691565
33 -0.122890738 -0.504823337
34 -0.122890738 -0.122890738
35 1.391389948 -0.122890738
36 -0.020871016 1.391389948
37 0.671302825 -0.020871016
38 0.200424608 0.671302825
39 -0.385099935 0.200424608
40 0.149414747 -0.385099935
41 -0.674459092 0.149414747
42 -0.967446072 -0.674459092
43 -0.319250895 -0.967446072
44 0.421720231 -0.319250895
45 0.546186524 0.421720231
46 0.113691565 0.546186524
47 0.334987189 0.113691565
48 -0.020871016 0.334987189
49 0.979128984 -0.020871016
50 -0.379707036 0.979128984
51 -0.364217849 -0.379707036
52 -0.122890738 -0.364217849
53 -0.071880877 -0.122890738
54 -1.443717187 -0.071880877
55 -0.687533195 -1.443717187
56 -0.122890738 -0.687533195
57 0.011671843 -0.122890738
58 0.283977328 0.011671843
59 -0.850585253 0.283977328
60 -0.733076345 -0.850585253
61 -0.122890738 -0.733076345
62 1.556282813 -0.122890738
63 -0.071880877 1.556282813
64 -0.062434597 -0.071880877
65 0.251434469 -0.062434597
66 -0.277687314 0.251434469
67 0.325540908 -0.277687314
68 0.011671843 0.325540908
69 -0.241964133 0.011671843
70 -0.394546215 -0.241964133
71 1.465496388 -0.394546215
72 -1.351793754 1.465496388
73 0.706823499 -1.351793754
74 0.495176663 0.706823499
75 1.559836822 0.495176663
76 0.470241196 1.559836822
77 0.658302534 0.470241196
78 0.187798004 0.658302534
79 -0.652012521 0.187798004
80 0.620292964 -0.652012521
81 0.421720231 0.620292964
82 -0.514269617 0.421720231
83 0.450007201 -0.514269617
84 0.737801872 0.450007201
85 -0.909202506 0.737801872
86 -0.527269908 -0.909202506
87 -0.941371678 -0.527269908
88 1.251434469 -0.941371678
89 -0.107401551 1.251434469
90 1.032553928 -0.107401551
91 0.062681704 1.032553928
92 -0.379707036 0.062681704
93 0.002225562 -0.379707036
94 0.264434759 0.002225562
95 -0.459206374 0.264434759
96 -0.578279769 -0.459206374
97 -0.102008653 -0.578279769
98 -0.453813476 -0.102008653
99 -1.463259756 -0.453813476
100 1.228914085 -1.463259756
101 -0.351793754 1.228914085
102 0.004064451 -0.351793754
103 1.485730383 0.004064451
104 0.597196385 1.485730383
105 1.334987189 0.597196385
106 0.113691565 1.334987189
107 0.385997050 0.113691565
108 -0.614002950 0.385997050
109 -0.952157475 -0.614002950
110 -0.636523334 -0.952157475
111 0.192817216 -0.636523334
112 -0.649523625 0.192817216
113 -0.107401551 -0.649523625
114 0.334987189 -0.107401551
115 0.671302825 0.334987189
116 0.149414747 0.671302825
117 0.867662981 0.149414747
118 -0.005381830 0.867662981
119 -0.071880877 -0.005381830
120 0.325540908 -0.071880877
121 0.334987189 0.325540908
122 0.289370226 0.334987189
123 -0.402803615 0.289370226
124 -0.526896221 -0.402803615
125 1.154807645 -0.526896221
126 1.385997050 1.154807645
127 -0.549992799 1.385997050
128 -0.740958140 -0.549992799
129 -0.132337019 -0.740958140
130 -0.071880877 -0.132337019
131 -0.633619333 -0.071880877
132 0.025322141 -0.633619333
133 0.877109262 0.025322141
134 0.146234424 0.877109262
135 -1.328697175 0.146234424
136 -0.181507991 -1.328697175
137 -0.937318296 -0.181507991
138 -0.941371678 -0.937318296
139 -0.443717187 -0.941371678
140 -0.988328157 -0.443717187
141 -0.122890738 -0.988328157
142 0.113691565 -0.122890738
143 -0.046945410 0.113691565
144 -0.748191845 -0.046945410
145 1.146234424 -0.748191845
146 0.398997340 1.146234424
147 -0.020871016 0.398997340
148 -0.328697175 -0.020871016
149 -0.748565531 -0.328697175
150 0.021118123 -0.748565531
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/7hw411291375391.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8hw411291375391.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9anlm1291375391.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10anlm1291375391.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/11vo2a1291375391.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/12go0g1291375391.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/13n7fr1291375391.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/14ygwv1291375391.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/151zv01291375391.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/16g9t91291375391.tab")
+ }
>
> try(system("convert tmp/1lmoa1291375391.ps tmp/1lmoa1291375391.png",intern=TRUE))
character(0)
> try(system("convert tmp/2wvnd1291375391.ps tmp/2wvnd1291375391.png",intern=TRUE))
character(0)
> try(system("convert tmp/3wvnd1291375391.ps tmp/3wvnd1291375391.png",intern=TRUE))
character(0)
> try(system("convert tmp/4wvnd1291375391.ps tmp/4wvnd1291375391.png",intern=TRUE))
character(0)
> try(system("convert tmp/564mg1291375391.ps tmp/564mg1291375391.png",intern=TRUE))
character(0)
> try(system("convert tmp/664mg1291375391.ps tmp/664mg1291375391.png",intern=TRUE))
character(0)
> try(system("convert tmp/7hw411291375391.ps tmp/7hw411291375391.png",intern=TRUE))
character(0)
> try(system("convert tmp/8hw411291375391.ps tmp/8hw411291375391.png",intern=TRUE))
character(0)
> try(system("convert tmp/9anlm1291375391.ps tmp/9anlm1291375391.png",intern=TRUE))
character(0)
> try(system("convert tmp/10anlm1291375391.ps tmp/10anlm1291375391.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.969 1.762 17.057