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(594,0,595,0,591,0,589,0,584,0,573,0,567,0,569,0,621,0,629,0,628,0,612,0,595,0,597,0,593,0,590,0,580,0,574,0,573,0,573,0,620,0,626,0,620,0,588,0,566,0,557,0,561,0,549,0,532,0,526,0,511,0,499,0,555,0,565,0,542,0,527,0,510,0,514,0,517,0,508,0,493,0,490,0,469,0,478,0,528,0,534,0,518,1,506,1,502,1,516,1,528,1,533,1,536,1,537,1,524,1,536,1,587,1,597,1,581,1,564,1,558,1),dim=c(2,61),dimnames=list(c('WklBe','X'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('WklBe','X'),1:61))
> 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 = 'Include Monthly Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
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
WklBe X M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 594 0 1 0 0 0 0 0 0 0 0 0 0
2 595 0 0 1 0 0 0 0 0 0 0 0 0
3 591 0 0 0 1 0 0 0 0 0 0 0 0
4 589 0 0 0 0 1 0 0 0 0 0 0 0
5 584 0 0 0 0 0 1 0 0 0 0 0 0
6 573 0 0 0 0 0 0 1 0 0 0 0 0
7 567 0 0 0 0 0 0 0 1 0 0 0 0
8 569 0 0 0 0 0 0 0 0 1 0 0 0
9 621 0 0 0 0 0 0 0 0 0 1 0 0
10 629 0 0 0 0 0 0 0 0 0 0 1 0
11 628 0 0 0 0 0 0 0 0 0 0 0 1
12 612 0 0 0 0 0 0 0 0 0 0 0 0
13 595 0 1 0 0 0 0 0 0 0 0 0 0
14 597 0 0 1 0 0 0 0 0 0 0 0 0
15 593 0 0 0 1 0 0 0 0 0 0 0 0
16 590 0 0 0 0 1 0 0 0 0 0 0 0
17 580 0 0 0 0 0 1 0 0 0 0 0 0
18 574 0 0 0 0 0 0 1 0 0 0 0 0
19 573 0 0 0 0 0 0 0 1 0 0 0 0
20 573 0 0 0 0 0 0 0 0 1 0 0 0
21 620 0 0 0 0 0 0 0 0 0 1 0 0
22 626 0 0 0 0 0 0 0 0 0 0 1 0
23 620 0 0 0 0 0 0 0 0 0 0 0 1
24 588 0 0 0 0 0 0 0 0 0 0 0 0
25 566 0 1 0 0 0 0 0 0 0 0 0 0
26 557 0 0 1 0 0 0 0 0 0 0 0 0
27 561 0 0 0 1 0 0 0 0 0 0 0 0
28 549 0 0 0 0 1 0 0 0 0 0 0 0
29 532 0 0 0 0 0 1 0 0 0 0 0 0
30 526 0 0 0 0 0 0 1 0 0 0 0 0
31 511 0 0 0 0 0 0 0 1 0 0 0 0
32 499 0 0 0 0 0 0 0 0 1 0 0 0
33 555 0 0 0 0 0 0 0 0 0 1 0 0
34 565 0 0 0 0 0 0 0 0 0 0 1 0
35 542 0 0 0 0 0 0 0 0 0 0 0 1
36 527 0 0 0 0 0 0 0 0 0 0 0 0
37 510 0 1 0 0 0 0 0 0 0 0 0 0
38 514 0 0 1 0 0 0 0 0 0 0 0 0
39 517 0 0 0 1 0 0 0 0 0 0 0 0
40 508 0 0 0 0 1 0 0 0 0 0 0 0
41 493 0 0 0 0 0 1 0 0 0 0 0 0
42 490 0 0 0 0 0 0 1 0 0 0 0 0
43 469 0 0 0 0 0 0 0 1 0 0 0 0
44 478 0 0 0 0 0 0 0 0 1 0 0 0
45 528 0 0 0 0 0 0 0 0 0 1 0 0
46 534 0 0 0 0 0 0 0 0 0 0 1 0
47 518 1 0 0 0 0 0 0 0 0 0 0 1
48 506 1 0 0 0 0 0 0 0 0 0 0 0
49 502 1 1 0 0 0 0 0 0 0 0 0 0
50 516 1 0 1 0 0 0 0 0 0 0 0 0
51 528 1 0 0 1 0 0 0 0 0 0 0 0
52 533 1 0 0 0 1 0 0 0 0 0 0 0
53 536 1 0 0 0 0 1 0 0 0 0 0 0
54 537 1 0 0 0 0 0 1 0 0 0 0 0
55 524 1 0 0 0 0 0 0 1 0 0 0 0
56 536 1 0 0 0 0 0 0 0 1 0 0 0
57 587 1 0 0 0 0 0 0 0 0 1 0 0
58 597 1 0 0 0 0 0 0 0 0 0 1 0
59 581 1 0 0 0 0 0 0 0 0 0 0 1
60 564 1 0 0 0 0 0 0 0 0 0 0 0
61 558 1 1 0 0 0 0 0 0 0 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X M1 M2 M3 M4
568.346 -22.366 -6.724 -8.073 -5.873 -10.073
M5 M6 M7 M8 M9 M10
-18.873 -23.873 -35.073 -32.873 18.327 26.327
M11
18.400
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-64.27 -36.47 14.89 31.73 43.65
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 568.346 18.211 31.209 <2e-16 ***
X -22.366 11.888 -1.881 0.066 .
M1 -6.724 23.816 -0.282 0.779
M2 -8.073 24.974 -0.323 0.748
M3 -5.873 24.974 -0.235 0.815
M4 -10.073 24.974 -0.403 0.688
M5 -18.873 24.974 -0.756 0.454
M6 -23.873 24.974 -0.956 0.344
M7 -35.073 24.974 -1.404 0.167
M8 -32.873 24.974 -1.316 0.194
M9 18.327 24.974 0.734 0.467
M10 26.327 24.974 1.054 0.297
M11 18.400 24.861 0.740 0.463
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 39.31 on 48 degrees of freedom
Multiple R-squared: 0.2592, Adjusted R-squared: 0.07401
F-statistic: 1.4 on 12 and 48 DF, p-value: 0.1991
> 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,] 5.971895e-05 1.194379e-04 0.9999403
[2,] 1.260988e-05 2.521976e-05 0.9999874
[3,] 6.583801e-07 1.316760e-06 0.9999993
[4,] 4.439239e-07 8.878477e-07 0.9999996
[5,] 8.226598e-08 1.645320e-07 0.9999999
[6,] 8.281787e-09 1.656357e-08 1.0000000
[7,] 1.356941e-09 2.713882e-09 1.0000000
[8,] 3.629177e-09 7.258354e-09 1.0000000
[9,] 3.359780e-06 6.719559e-06 0.9999966
[10,] 2.024717e-04 4.049434e-04 0.9997975
[11,] 6.016884e-03 1.203377e-02 0.9939831
[12,] 1.961840e-02 3.923680e-02 0.9803816
[13,] 6.978967e-02 1.395793e-01 0.9302103
[14,] 1.925040e-01 3.850080e-01 0.8074960
[15,] 3.047501e-01 6.095002e-01 0.6952499
[16,] 4.902049e-01 9.804097e-01 0.5097951
[17,] 6.537249e-01 6.925502e-01 0.3462751
[18,] 7.210458e-01 5.579084e-01 0.2789542
[19,] 7.510941e-01 4.978117e-01 0.2489059
[20,] 8.282926e-01 3.434149e-01 0.1717074
[21,] 8.593197e-01 2.813607e-01 0.1406803
[22,] 8.702246e-01 2.595508e-01 0.1297754
[23,] 8.918294e-01 2.163413e-01 0.1081706
[24,] 8.953847e-01 2.092305e-01 0.1046153
[25,] 8.807494e-01 2.385013e-01 0.1192506
[26,] 8.423668e-01 3.152664e-01 0.1576332
[27,] 7.806043e-01 4.387915e-01 0.2193957
[28,] 7.035560e-01 5.928881e-01 0.2964440
[29,] 5.848075e-01 8.303849e-01 0.4151925
[30,] 4.382036e-01 8.764072e-01 0.5617964
> postscript(file="/var/www/html/rcomp/tmp/1yxt01260893208.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/2nyjz1260893208.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/3ynkl1260893208.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/40tfg1260893208.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/5q7hk1260893208.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 = 61
Frequency = 1
1 2 3 4 5 6 7
32.378049 34.726829 28.526829 30.726829 34.526829 28.526829 33.726829
8 9 10 11 12 13 14
33.526829 34.326829 34.326829 41.253659 43.653659 33.378049 36.726829
15 16 17 18 19 20 21
30.526829 31.726829 30.526829 29.526829 39.726829 37.526829 33.326829
22 23 24 25 26 27 28
31.326829 33.253659 19.653659 4.378049 -3.273171 -1.473171 -9.273171
29 30 31 32 33 34 35
-17.473171 -18.473171 -22.273171 -36.473171 -31.673171 -29.673171 -44.746341
36 37 38 39 40 41 42
-41.346341 -51.621951 -46.273171 -45.473171 -50.273171 -56.473171 -54.473171
43 44 45 46 47 48 49
-64.273171 -57.473171 -58.673171 -60.673171 -46.380488 -39.980488 -37.256098
50 51 52 53 54 55 56
-21.907317 -12.107317 -2.907317 8.892683 14.892683 13.092683 22.892683
57 58 59 60 61
22.692683 24.692683 16.619512 18.019512 18.743902
> postscript(file="/var/www/html/rcomp/tmp/6jyce1260893208.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 = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 32.378049 NA
1 34.726829 32.378049
2 28.526829 34.726829
3 30.726829 28.526829
4 34.526829 30.726829
5 28.526829 34.526829
6 33.726829 28.526829
7 33.526829 33.726829
8 34.326829 33.526829
9 34.326829 34.326829
10 41.253659 34.326829
11 43.653659 41.253659
12 33.378049 43.653659
13 36.726829 33.378049
14 30.526829 36.726829
15 31.726829 30.526829
16 30.526829 31.726829
17 29.526829 30.526829
18 39.726829 29.526829
19 37.526829 39.726829
20 33.326829 37.526829
21 31.326829 33.326829
22 33.253659 31.326829
23 19.653659 33.253659
24 4.378049 19.653659
25 -3.273171 4.378049
26 -1.473171 -3.273171
27 -9.273171 -1.473171
28 -17.473171 -9.273171
29 -18.473171 -17.473171
30 -22.273171 -18.473171
31 -36.473171 -22.273171
32 -31.673171 -36.473171
33 -29.673171 -31.673171
34 -44.746341 -29.673171
35 -41.346341 -44.746341
36 -51.621951 -41.346341
37 -46.273171 -51.621951
38 -45.473171 -46.273171
39 -50.273171 -45.473171
40 -56.473171 -50.273171
41 -54.473171 -56.473171
42 -64.273171 -54.473171
43 -57.473171 -64.273171
44 -58.673171 -57.473171
45 -60.673171 -58.673171
46 -46.380488 -60.673171
47 -39.980488 -46.380488
48 -37.256098 -39.980488
49 -21.907317 -37.256098
50 -12.107317 -21.907317
51 -2.907317 -12.107317
52 8.892683 -2.907317
53 14.892683 8.892683
54 13.092683 14.892683
55 22.892683 13.092683
56 22.692683 22.892683
57 24.692683 22.692683
58 16.619512 24.692683
59 18.019512 16.619512
60 18.743902 18.019512
61 NA 18.743902
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 34.726829 32.378049
[2,] 28.526829 34.726829
[3,] 30.726829 28.526829
[4,] 34.526829 30.726829
[5,] 28.526829 34.526829
[6,] 33.726829 28.526829
[7,] 33.526829 33.726829
[8,] 34.326829 33.526829
[9,] 34.326829 34.326829
[10,] 41.253659 34.326829
[11,] 43.653659 41.253659
[12,] 33.378049 43.653659
[13,] 36.726829 33.378049
[14,] 30.526829 36.726829
[15,] 31.726829 30.526829
[16,] 30.526829 31.726829
[17,] 29.526829 30.526829
[18,] 39.726829 29.526829
[19,] 37.526829 39.726829
[20,] 33.326829 37.526829
[21,] 31.326829 33.326829
[22,] 33.253659 31.326829
[23,] 19.653659 33.253659
[24,] 4.378049 19.653659
[25,] -3.273171 4.378049
[26,] -1.473171 -3.273171
[27,] -9.273171 -1.473171
[28,] -17.473171 -9.273171
[29,] -18.473171 -17.473171
[30,] -22.273171 -18.473171
[31,] -36.473171 -22.273171
[32,] -31.673171 -36.473171
[33,] -29.673171 -31.673171
[34,] -44.746341 -29.673171
[35,] -41.346341 -44.746341
[36,] -51.621951 -41.346341
[37,] -46.273171 -51.621951
[38,] -45.473171 -46.273171
[39,] -50.273171 -45.473171
[40,] -56.473171 -50.273171
[41,] -54.473171 -56.473171
[42,] -64.273171 -54.473171
[43,] -57.473171 -64.273171
[44,] -58.673171 -57.473171
[45,] -60.673171 -58.673171
[46,] -46.380488 -60.673171
[47,] -39.980488 -46.380488
[48,] -37.256098 -39.980488
[49,] -21.907317 -37.256098
[50,] -12.107317 -21.907317
[51,] -2.907317 -12.107317
[52,] 8.892683 -2.907317
[53,] 14.892683 8.892683
[54,] 13.092683 14.892683
[55,] 22.892683 13.092683
[56,] 22.692683 22.892683
[57,] 24.692683 22.692683
[58,] 16.619512 24.692683
[59,] 18.019512 16.619512
[60,] 18.743902 18.019512
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 34.726829 32.378049
2 28.526829 34.726829
3 30.726829 28.526829
4 34.526829 30.726829
5 28.526829 34.526829
6 33.726829 28.526829
7 33.526829 33.726829
8 34.326829 33.526829
9 34.326829 34.326829
10 41.253659 34.326829
11 43.653659 41.253659
12 33.378049 43.653659
13 36.726829 33.378049
14 30.526829 36.726829
15 31.726829 30.526829
16 30.526829 31.726829
17 29.526829 30.526829
18 39.726829 29.526829
19 37.526829 39.726829
20 33.326829 37.526829
21 31.326829 33.326829
22 33.253659 31.326829
23 19.653659 33.253659
24 4.378049 19.653659
25 -3.273171 4.378049
26 -1.473171 -3.273171
27 -9.273171 -1.473171
28 -17.473171 -9.273171
29 -18.473171 -17.473171
30 -22.273171 -18.473171
31 -36.473171 -22.273171
32 -31.673171 -36.473171
33 -29.673171 -31.673171
34 -44.746341 -29.673171
35 -41.346341 -44.746341
36 -51.621951 -41.346341
37 -46.273171 -51.621951
38 -45.473171 -46.273171
39 -50.273171 -45.473171
40 -56.473171 -50.273171
41 -54.473171 -56.473171
42 -64.273171 -54.473171
43 -57.473171 -64.273171
44 -58.673171 -57.473171
45 -60.673171 -58.673171
46 -46.380488 -60.673171
47 -39.980488 -46.380488
48 -37.256098 -39.980488
49 -21.907317 -37.256098
50 -12.107317 -21.907317
51 -2.907317 -12.107317
52 8.892683 -2.907317
53 14.892683 8.892683
54 13.092683 14.892683
55 22.892683 13.092683
56 22.692683 22.892683
57 24.692683 22.692683
58 16.619512 24.692683
59 18.019512 16.619512
60 18.743902 18.019512
> 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/7j8mo1260893208.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/860tx1260893208.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/9h80c1260893208.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/10pywa1260893208.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/11trrg1260893208.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/12gzo41260893208.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/13cmfm1260893208.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/14g4yr1260893208.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/158lrt1260893208.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/16cm9q1260893208.tab")
+ }
>
> try(system("convert tmp/1yxt01260893208.ps tmp/1yxt01260893208.png",intern=TRUE))
character(0)
> try(system("convert tmp/2nyjz1260893208.ps tmp/2nyjz1260893208.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ynkl1260893208.ps tmp/3ynkl1260893208.png",intern=TRUE))
character(0)
> try(system("convert tmp/40tfg1260893208.ps tmp/40tfg1260893208.png",intern=TRUE))
character(0)
> try(system("convert tmp/5q7hk1260893208.ps tmp/5q7hk1260893208.png",intern=TRUE))
character(0)
> try(system("convert tmp/6jyce1260893208.ps tmp/6jyce1260893208.png",intern=TRUE))
character(0)
> try(system("convert tmp/7j8mo1260893208.ps tmp/7j8mo1260893208.png",intern=TRUE))
character(0)
> try(system("convert tmp/860tx1260893208.ps tmp/860tx1260893208.png",intern=TRUE))
character(0)
> try(system("convert tmp/9h80c1260893208.ps tmp/9h80c1260893208.png",intern=TRUE))
character(0)
> try(system("convert tmp/10pywa1260893208.ps tmp/10pywa1260893208.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.394 1.559 4.134