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(3397,562,3971,561,4625,555,4486,544,4132,537,4685,543,3172,594,4280,611,4207,613,4158,611,3933,594,3151,595,3616,591,4221,589,4436,584,4807,573,4849,567,5024,569,3521,621,4650,629,5393,628,5147,612,4845,595,3995,597,4493,593,4680,590,5463,580,4761,574,5307,573,5069,573,3501,620,4952,626,5152,620,5317,588,5189,566,4030,557,4420,561,4571,549,4551,532,4819,526,5133,511,4532,499,3339,555,4380,565,4632,542,4719,527,4212,510,3615,514,3420,517,4571,508,4407,493,4386,490,4386,469,4744,478,3185,528,3890,534,4520,518,3990,506,3809,502,3236,516,3551,528,3264,533,3579,536,3537,537,3038,524,2888,536,2198,587),dim=c(2,67),dimnames=list(c('wng','totWL'),1:67))
> y <- array(NA,dim=c(2,67),dimnames=list(c('wng','totWL'),1:67))
> 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
wng totWL
1 3397 562
2 3971 561
3 4625 555
4 4486 544
5 4132 537
6 4685 543
7 3172 594
8 4280 611
9 4207 613
10 4158 611
11 3933 594
12 3151 595
13 3616 591
14 4221 589
15 4436 584
16 4807 573
17 4849 567
18 5024 569
19 3521 621
20 4650 629
21 5393 628
22 5147 612
23 4845 595
24 3995 597
25 4493 593
26 4680 590
27 5463 580
28 4761 574
29 5307 573
30 5069 573
31 3501 620
32 4952 626
33 5152 620
34 5317 588
35 5189 566
36 4030 557
37 4420 561
38 4571 549
39 4551 532
40 4819 526
41 5133 511
42 4532 499
43 3339 555
44 4380 565
45 4632 542
46 4719 527
47 4212 510
48 3615 514
49 3420 517
50 4571 508
51 4407 493
52 4386 490
53 4386 469
54 4744 478
55 3185 528
56 3890 534
57 4520 518
58 3990 506
59 3809 502
60 3236 516
61 3551 528
62 3264 533
63 3579 536
64 3537 537
65 3038 524
66 2888 536
67 2198 587
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) totWL
2850.766 2.493
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2115.9 -562.3 164.2 496.0 1166.6
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2850.766 1194.301 2.387 0.0199 *
totWL 2.493 2.136 1.167 0.2475
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 705.3 on 65 degrees of freedom
Multiple R-squared: 0.02052, Adjusted R-squared: 0.005452
F-statistic: 1.362 on 1 and 65 DF, p-value: 0.2475
> 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.28820445 0.57640889 0.71179555
[2,] 0.18537332 0.37074665 0.81462668
[3,] 0.10251654 0.20503308 0.89748346
[4,] 0.24804679 0.49609358 0.75195321
[5,] 0.19469470 0.38938940 0.80530530
[6,] 0.13045782 0.26091563 0.86954218
[7,] 0.08001200 0.16002400 0.91998800
[8,] 0.12799383 0.25598766 0.87200617
[9,] 0.09703543 0.19407086 0.90296457
[10,] 0.06743450 0.13486900 0.93256550
[11,] 0.05299788 0.10599575 0.94700212
[12,] 0.06111706 0.12223412 0.93888294
[13,] 0.06426814 0.12853628 0.93573186
[14,] 0.08213718 0.16427436 0.91786282
[15,] 0.07047421 0.14094841 0.92952579
[16,] 0.08532783 0.17065567 0.91467217
[17,] 0.20116976 0.40233952 0.79883024
[18,] 0.23429967 0.46859934 0.76570033
[19,] 0.21024682 0.42049363 0.78975318
[20,] 0.16937140 0.33874280 0.83062860
[21,] 0.12797497 0.25594994 0.87202503
[22,] 0.10121173 0.20242346 0.89878827
[23,] 0.17005468 0.34010937 0.82994532
[24,] 0.14290891 0.28581782 0.85709109
[25,] 0.18703772 0.37407544 0.81296228
[26,] 0.19469106 0.38938213 0.80530894
[27,] 0.20720923 0.41441846 0.79279077
[28,] 0.20449663 0.40899326 0.79550337
[29,] 0.25581024 0.51162047 0.74418976
[30,] 0.40700772 0.81401544 0.59299228
[31,] 0.56857437 0.86285126 0.43142563
[32,] 0.52805111 0.94389778 0.47194889
[33,] 0.53152088 0.93695824 0.46847912
[34,] 0.55644138 0.88711723 0.44355862
[35,] 0.54771263 0.90457474 0.45228737
[36,] 0.59161897 0.81676206 0.40838103
[37,] 0.68963510 0.62072980 0.31036490
[38,] 0.64061094 0.71877813 0.35938906
[39,] 0.65698368 0.68603265 0.34301632
[40,] 0.79918070 0.40163860 0.20081930
[41,] 0.92776453 0.14447093 0.07223547
[42,] 0.98382569 0.03234862 0.01617431
[43,] 0.97874420 0.04251160 0.02125580
[44,] 0.97354521 0.05290958 0.02645479
[45,] 0.97212411 0.05575178 0.02787589
[46,] 0.97936509 0.04126983 0.02063491
[47,] 0.96735108 0.06529784 0.03264892
[48,] 0.94753434 0.10493133 0.05246566
[49,] 0.92774507 0.14450987 0.07225493
[50,] 0.89594238 0.20811524 0.10405762
[51,] 0.88680097 0.22639807 0.11319903
[52,] 0.89120990 0.21758021 0.10879010
[53,] 0.98010066 0.03979869 0.01989934
[54,] 0.96805911 0.06388178 0.03194089
[55,] 0.93518074 0.12963852 0.06481926
[56,] 0.91491826 0.17016347 0.08508174
[57,] 0.85086254 0.29827492 0.14913746
[58,] 0.72654625 0.54690750 0.27345375
> postscript(file="/var/www/html/rcomp/tmp/1lha71261151419.ps",horizontal=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/218dy1261151419.ps",horizontal=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/3ck0p1261151419.ps",horizontal=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/4qyrf1261151419.ps",horizontal=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/5t6by1261151419.ps",horizontal=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 = 67
Frequency = 1
1 2 3 4 5 6
-854.56488 -278.07236 390.88279 279.30056 -57.25176 480.79309
7 8 9 10 11 12
-1159.32568 -93.69860 -171.68365 -215.69860 -398.32568 -1182.81820
13 14 15 16 17 18
-707.84810 -97.86305 129.59957 528.01734 584.97249 754.98744
19 20 21 22 23 24
-877.62385 231.43595 976.92848 770.80887 511.18180 -343.80325
25 26 27 28 29 30
164.16685 358.64442 1166.56967 479.52482 1028.01734 790.01734
31 32 33 34 35 36
-895.13132 540.91353 755.86868 1000.62947 927.46502 -209.10226
37 38 39 40 41 42
170.92764 351.83794 374.21086 657.16601 1008.55388 437.46418
43 44 45 46 47 48
-895.11721 120.95754 430.28561 554.67349 90.04641 -516.92369
49 50 51 52 53 54
-719.40126 454.03146 327.41933 313.89691 366.23993 701.80721
55 56 57 58 59 60
-981.81904 -291.77419 378.10621 -121.98349 -293.01339 -900.90874
61 62 63 64 65 66
-615.81904 -915.28166 -607.75924 -652.25176 -1118.84894 -1298.75924
67
-2115.87800
> postscript(file="/var/www/html/rcomp/tmp/6lkp51261151419.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 67
Frequency = 1
lag(myerror, k = 1) myerror
0 -854.56488 NA
1 -278.07236 -854.56488
2 390.88279 -278.07236
3 279.30056 390.88279
4 -57.25176 279.30056
5 480.79309 -57.25176
6 -1159.32568 480.79309
7 -93.69860 -1159.32568
8 -171.68365 -93.69860
9 -215.69860 -171.68365
10 -398.32568 -215.69860
11 -1182.81820 -398.32568
12 -707.84810 -1182.81820
13 -97.86305 -707.84810
14 129.59957 -97.86305
15 528.01734 129.59957
16 584.97249 528.01734
17 754.98744 584.97249
18 -877.62385 754.98744
19 231.43595 -877.62385
20 976.92848 231.43595
21 770.80887 976.92848
22 511.18180 770.80887
23 -343.80325 511.18180
24 164.16685 -343.80325
25 358.64442 164.16685
26 1166.56967 358.64442
27 479.52482 1166.56967
28 1028.01734 479.52482
29 790.01734 1028.01734
30 -895.13132 790.01734
31 540.91353 -895.13132
32 755.86868 540.91353
33 1000.62947 755.86868
34 927.46502 1000.62947
35 -209.10226 927.46502
36 170.92764 -209.10226
37 351.83794 170.92764
38 374.21086 351.83794
39 657.16601 374.21086
40 1008.55388 657.16601
41 437.46418 1008.55388
42 -895.11721 437.46418
43 120.95754 -895.11721
44 430.28561 120.95754
45 554.67349 430.28561
46 90.04641 554.67349
47 -516.92369 90.04641
48 -719.40126 -516.92369
49 454.03146 -719.40126
50 327.41933 454.03146
51 313.89691 327.41933
52 366.23993 313.89691
53 701.80721 366.23993
54 -981.81904 701.80721
55 -291.77419 -981.81904
56 378.10621 -291.77419
57 -121.98349 378.10621
58 -293.01339 -121.98349
59 -900.90874 -293.01339
60 -615.81904 -900.90874
61 -915.28166 -615.81904
62 -607.75924 -915.28166
63 -652.25176 -607.75924
64 -1118.84894 -652.25176
65 -1298.75924 -1118.84894
66 -2115.87800 -1298.75924
67 NA -2115.87800
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -278.07236 -854.56488
[2,] 390.88279 -278.07236
[3,] 279.30056 390.88279
[4,] -57.25176 279.30056
[5,] 480.79309 -57.25176
[6,] -1159.32568 480.79309
[7,] -93.69860 -1159.32568
[8,] -171.68365 -93.69860
[9,] -215.69860 -171.68365
[10,] -398.32568 -215.69860
[11,] -1182.81820 -398.32568
[12,] -707.84810 -1182.81820
[13,] -97.86305 -707.84810
[14,] 129.59957 -97.86305
[15,] 528.01734 129.59957
[16,] 584.97249 528.01734
[17,] 754.98744 584.97249
[18,] -877.62385 754.98744
[19,] 231.43595 -877.62385
[20,] 976.92848 231.43595
[21,] 770.80887 976.92848
[22,] 511.18180 770.80887
[23,] -343.80325 511.18180
[24,] 164.16685 -343.80325
[25,] 358.64442 164.16685
[26,] 1166.56967 358.64442
[27,] 479.52482 1166.56967
[28,] 1028.01734 479.52482
[29,] 790.01734 1028.01734
[30,] -895.13132 790.01734
[31,] 540.91353 -895.13132
[32,] 755.86868 540.91353
[33,] 1000.62947 755.86868
[34,] 927.46502 1000.62947
[35,] -209.10226 927.46502
[36,] 170.92764 -209.10226
[37,] 351.83794 170.92764
[38,] 374.21086 351.83794
[39,] 657.16601 374.21086
[40,] 1008.55388 657.16601
[41,] 437.46418 1008.55388
[42,] -895.11721 437.46418
[43,] 120.95754 -895.11721
[44,] 430.28561 120.95754
[45,] 554.67349 430.28561
[46,] 90.04641 554.67349
[47,] -516.92369 90.04641
[48,] -719.40126 -516.92369
[49,] 454.03146 -719.40126
[50,] 327.41933 454.03146
[51,] 313.89691 327.41933
[52,] 366.23993 313.89691
[53,] 701.80721 366.23993
[54,] -981.81904 701.80721
[55,] -291.77419 -981.81904
[56,] 378.10621 -291.77419
[57,] -121.98349 378.10621
[58,] -293.01339 -121.98349
[59,] -900.90874 -293.01339
[60,] -615.81904 -900.90874
[61,] -915.28166 -615.81904
[62,] -607.75924 -915.28166
[63,] -652.25176 -607.75924
[64,] -1118.84894 -652.25176
[65,] -1298.75924 -1118.84894
[66,] -2115.87800 -1298.75924
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -278.07236 -854.56488
2 390.88279 -278.07236
3 279.30056 390.88279
4 -57.25176 279.30056
5 480.79309 -57.25176
6 -1159.32568 480.79309
7 -93.69860 -1159.32568
8 -171.68365 -93.69860
9 -215.69860 -171.68365
10 -398.32568 -215.69860
11 -1182.81820 -398.32568
12 -707.84810 -1182.81820
13 -97.86305 -707.84810
14 129.59957 -97.86305
15 528.01734 129.59957
16 584.97249 528.01734
17 754.98744 584.97249
18 -877.62385 754.98744
19 231.43595 -877.62385
20 976.92848 231.43595
21 770.80887 976.92848
22 511.18180 770.80887
23 -343.80325 511.18180
24 164.16685 -343.80325
25 358.64442 164.16685
26 1166.56967 358.64442
27 479.52482 1166.56967
28 1028.01734 479.52482
29 790.01734 1028.01734
30 -895.13132 790.01734
31 540.91353 -895.13132
32 755.86868 540.91353
33 1000.62947 755.86868
34 927.46502 1000.62947
35 -209.10226 927.46502
36 170.92764 -209.10226
37 351.83794 170.92764
38 374.21086 351.83794
39 657.16601 374.21086
40 1008.55388 657.16601
41 437.46418 1008.55388
42 -895.11721 437.46418
43 120.95754 -895.11721
44 430.28561 120.95754
45 554.67349 430.28561
46 90.04641 554.67349
47 -516.92369 90.04641
48 -719.40126 -516.92369
49 454.03146 -719.40126
50 327.41933 454.03146
51 313.89691 327.41933
52 366.23993 313.89691
53 701.80721 366.23993
54 -981.81904 701.80721
55 -291.77419 -981.81904
56 378.10621 -291.77419
57 -121.98349 378.10621
58 -293.01339 -121.98349
59 -900.90874 -293.01339
60 -615.81904 -900.90874
61 -915.28166 -615.81904
62 -607.75924 -915.28166
63 -652.25176 -607.75924
64 -1118.84894 -652.25176
65 -1298.75924 -1118.84894
66 -2115.87800 -1298.75924
> 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/7lzci1261151419.ps",horizontal=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/8fzbz1261151419.ps",horizontal=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/9zdlf1261151419.ps",horizontal=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/10bfbc1261151419.ps",horizontal=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/11bt921261151419.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/129ekl1261151419.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/13q8n41261151419.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/14ry221261151419.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/15b7ie1261151419.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/16vfdt1261151419.tab")
+ }
> try(system("convert tmp/1lha71261151419.ps tmp/1lha71261151419.png",intern=TRUE))
character(0)
> try(system("convert tmp/218dy1261151419.ps tmp/218dy1261151419.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ck0p1261151419.ps tmp/3ck0p1261151419.png",intern=TRUE))
character(0)
> try(system("convert tmp/4qyrf1261151419.ps tmp/4qyrf1261151419.png",intern=TRUE))
character(0)
> try(system("convert tmp/5t6by1261151419.ps tmp/5t6by1261151419.png",intern=TRUE))
character(0)
> try(system("convert tmp/6lkp51261151419.ps tmp/6lkp51261151419.png",intern=TRUE))
character(0)
> try(system("convert tmp/7lzci1261151419.ps tmp/7lzci1261151419.png",intern=TRUE))
character(0)
> try(system("convert tmp/8fzbz1261151419.ps tmp/8fzbz1261151419.png",intern=TRUE))
character(0)
> try(system("convert tmp/9zdlf1261151419.ps tmp/9zdlf1261151419.png",intern=TRUE))
character(0)
> try(system("convert tmp/10bfbc1261151419.ps tmp/10bfbc1261151419.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.538 1.576 4.622