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(627,0,696,0,825,0,677,0,656,0,785,0,412,0,352,0,839,0,729,0,696,0,641,0,695,0,638,0,762,0,635,0,721,0,854,0,418,0,367,0,824,0,687,0,601,0,676,0,740,0,691,0,683,0,594,0,729,0,731,0,386,0,331,0,707,0,715,0,657,0,653,0,642,0,643,0,718,0,654,0,632,0,731,0,392,0,344,0,792,0,852,0,649,0,629,0,685,1,617,1,715,1,715,1,629,1,916,1,531,1,357,1,917,1,828,1,708,1,858,1),dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> 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
Y X M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 627 0 1 0 0 0 0 0 0 0 0 0 0
2 696 0 0 1 0 0 0 0 0 0 0 0 0
3 825 0 0 0 1 0 0 0 0 0 0 0 0
4 677 0 0 0 0 1 0 0 0 0 0 0 0
5 656 0 0 0 0 0 1 0 0 0 0 0 0
6 785 0 0 0 0 0 0 1 0 0 0 0 0
7 412 0 0 0 0 0 0 0 1 0 0 0 0
8 352 0 0 0 0 0 0 0 0 1 0 0 0
9 839 0 0 0 0 0 0 0 0 0 1 0 0
10 729 0 0 0 0 0 0 0 0 0 0 1 0
11 696 0 0 0 0 0 0 0 0 0 0 0 1
12 641 0 0 0 0 0 0 0 0 0 0 0 0
13 695 0 1 0 0 0 0 0 0 0 0 0 0
14 638 0 0 1 0 0 0 0 0 0 0 0 0
15 762 0 0 0 1 0 0 0 0 0 0 0 0
16 635 0 0 0 0 1 0 0 0 0 0 0 0
17 721 0 0 0 0 0 1 0 0 0 0 0 0
18 854 0 0 0 0 0 0 1 0 0 0 0 0
19 418 0 0 0 0 0 0 0 1 0 0 0 0
20 367 0 0 0 0 0 0 0 0 1 0 0 0
21 824 0 0 0 0 0 0 0 0 0 1 0 0
22 687 0 0 0 0 0 0 0 0 0 0 1 0
23 601 0 0 0 0 0 0 0 0 0 0 0 1
24 676 0 0 0 0 0 0 0 0 0 0 0 0
25 740 0 1 0 0 0 0 0 0 0 0 0 0
26 691 0 0 1 0 0 0 0 0 0 0 0 0
27 683 0 0 0 1 0 0 0 0 0 0 0 0
28 594 0 0 0 0 1 0 0 0 0 0 0 0
29 729 0 0 0 0 0 1 0 0 0 0 0 0
30 731 0 0 0 0 0 0 1 0 0 0 0 0
31 386 0 0 0 0 0 0 0 1 0 0 0 0
32 331 0 0 0 0 0 0 0 0 1 0 0 0
33 707 0 0 0 0 0 0 0 0 0 1 0 0
34 715 0 0 0 0 0 0 0 0 0 0 1 0
35 657 0 0 0 0 0 0 0 0 0 0 0 1
36 653 0 0 0 0 0 0 0 0 0 0 0 0
37 642 0 1 0 0 0 0 0 0 0 0 0 0
38 643 0 0 1 0 0 0 0 0 0 0 0 0
39 718 0 0 0 1 0 0 0 0 0 0 0 0
40 654 0 0 0 0 1 0 0 0 0 0 0 0
41 632 0 0 0 0 0 1 0 0 0 0 0 0
42 731 0 0 0 0 0 0 1 0 0 0 0 0
43 392 0 0 0 0 0 0 0 1 0 0 0 0
44 344 0 0 0 0 0 0 0 0 1 0 0 0
45 792 0 0 0 0 0 0 0 0 0 1 0 0
46 852 0 0 0 0 0 0 0 0 0 0 1 0
47 649 0 0 0 0 0 0 0 0 0 0 0 1
48 629 0 0 0 0 0 0 0 0 0 0 0 0
49 685 1 1 0 0 0 0 0 0 0 0 0 0
50 617 1 0 1 0 0 0 0 0 0 0 0 0
51 715 1 0 0 1 0 0 0 0 0 0 0 0
52 715 1 0 0 0 1 0 0 0 0 0 0 0
53 629 1 0 0 0 0 1 0 0 0 0 0 0
54 916 1 0 0 0 0 0 1 0 0 0 0 0
55 531 1 0 0 0 0 0 0 1 0 0 0 0
56 357 1 0 0 0 0 0 0 0 1 0 0 0
57 917 1 0 0 0 0 0 0 0 0 1 0 0
58 828 1 0 0 0 0 0 0 0 0 0 1 0
59 708 1 0 0 0 0 0 0 0 0 0 0 1
60 858 1 0 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
679.75 58.25 -13.60 -34.40 49.20 -36.40
M5 M6 M7 M8 M9 M10
-18.00 112.00 -263.60 -341.20 124.40 70.80
M11
-29.20
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-97.15 -36.35 -3.95 33.20 120.00
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 679.75 24.53 27.713 < 2e-16 ***
X 58.25 17.52 3.325 0.001722 **
M1 -13.60 34.33 -0.396 0.693803
M2 -34.40 34.33 -1.002 0.321488
M3 49.20 34.33 1.433 0.158462
M4 -36.40 34.33 -1.060 0.294460
M5 -18.00 34.33 -0.524 0.602543
M6 112.00 34.33 3.262 0.002062 **
M7 -263.60 34.33 -7.678 7.74e-10 ***
M8 -341.20 34.33 -9.938 3.91e-13 ***
M9 124.40 34.33 3.623 0.000712 ***
M10 70.80 34.33 2.062 0.044741 *
M11 -29.20 34.33 -0.851 0.399354
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 54.28 on 47 degrees of freedom
Multiple R-squared: 0.888, Adjusted R-squared: 0.8595
F-statistic: 31.07 on 12 and 47 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.41438458 0.82876917 0.5856154
[2,] 0.36948813 0.73897626 0.6305119
[3,] 0.35213351 0.70426702 0.6478665
[4,] 0.22802041 0.45604083 0.7719796
[5,] 0.14538188 0.29076377 0.8546181
[6,] 0.08794356 0.17588712 0.9120564
[7,] 0.07060387 0.14120773 0.9293961
[8,] 0.10413508 0.20827016 0.8958649
[9,] 0.06881437 0.13762873 0.9311856
[10,] 0.11060399 0.22120798 0.8893960
[11,] 0.09586976 0.19173951 0.9041302
[12,] 0.16309654 0.32619309 0.8369035
[13,] 0.15083746 0.30167493 0.8491625
[14,] 0.20302091 0.40604182 0.7969791
[15,] 0.23241206 0.46482412 0.7675879
[16,] 0.17878873 0.35757746 0.8212113
[17,] 0.12879459 0.25758918 0.8712054
[18,] 0.27355283 0.54710565 0.7264472
[19,] 0.27057490 0.54114980 0.7294251
[20,] 0.19525188 0.39050375 0.8047481
[21,] 0.15581143 0.31162286 0.8441886
[22,] 0.11503475 0.23006950 0.8849652
[23,] 0.11920239 0.23840478 0.8807976
[24,] 0.11472856 0.22945713 0.8852714
[25,] 0.07267045 0.14534090 0.9273295
[26,] 0.09472803 0.18945606 0.9052720
[27,] 0.10136978 0.20273956 0.8986302
[28,] 0.06636677 0.13273354 0.9336332
[29,] 0.04995498 0.09990996 0.9500450
> postscript(file="/var/www/html/rcomp/tmp/1zbi21259319500.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/2r72v1259319500.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/36idi1259319500.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/4sqqv1259319500.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/5urfn1259319500.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 = 60
Frequency = 1
1 2 3 4 5 6 7 8 9 10 11
-39.15 50.65 96.05 33.65 -5.75 -6.75 -4.15 13.45 34.85 -21.55 45.45
12 13 14 15 16 17 18 19 20 21 22
-38.75 28.85 -7.35 33.05 -8.35 59.25 62.25 1.85 28.45 19.85 -63.55
23 24 25 26 27 28 29 30 31 32 33
-49.55 -3.75 73.85 45.65 -45.95 -49.35 67.25 -60.75 -30.15 -7.55 -97.15
34 35 36 37 38 39 40 41 42 43 44
-35.55 6.45 -26.75 -24.15 -2.35 -10.95 10.65 -29.75 -60.75 -24.15 5.45
45 46 47 48 49 50 51 52 53 54 55
-12.15 101.45 -1.55 -50.75 -39.40 -86.60 -72.20 13.40 -91.00 66.00 56.60
56 57 58 59 60
-39.80 54.60 19.20 -0.80 120.00
> postscript(file="/var/www/html/rcomp/tmp/6psrs1259319500.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 -39.15 NA
1 50.65 -39.15
2 96.05 50.65
3 33.65 96.05
4 -5.75 33.65
5 -6.75 -5.75
6 -4.15 -6.75
7 13.45 -4.15
8 34.85 13.45
9 -21.55 34.85
10 45.45 -21.55
11 -38.75 45.45
12 28.85 -38.75
13 -7.35 28.85
14 33.05 -7.35
15 -8.35 33.05
16 59.25 -8.35
17 62.25 59.25
18 1.85 62.25
19 28.45 1.85
20 19.85 28.45
21 -63.55 19.85
22 -49.55 -63.55
23 -3.75 -49.55
24 73.85 -3.75
25 45.65 73.85
26 -45.95 45.65
27 -49.35 -45.95
28 67.25 -49.35
29 -60.75 67.25
30 -30.15 -60.75
31 -7.55 -30.15
32 -97.15 -7.55
33 -35.55 -97.15
34 6.45 -35.55
35 -26.75 6.45
36 -24.15 -26.75
37 -2.35 -24.15
38 -10.95 -2.35
39 10.65 -10.95
40 -29.75 10.65
41 -60.75 -29.75
42 -24.15 -60.75
43 5.45 -24.15
44 -12.15 5.45
45 101.45 -12.15
46 -1.55 101.45
47 -50.75 -1.55
48 -39.40 -50.75
49 -86.60 -39.40
50 -72.20 -86.60
51 13.40 -72.20
52 -91.00 13.40
53 66.00 -91.00
54 56.60 66.00
55 -39.80 56.60
56 54.60 -39.80
57 19.20 54.60
58 -0.80 19.20
59 120.00 -0.80
60 NA 120.00
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 50.65 -39.15
[2,] 96.05 50.65
[3,] 33.65 96.05
[4,] -5.75 33.65
[5,] -6.75 -5.75
[6,] -4.15 -6.75
[7,] 13.45 -4.15
[8,] 34.85 13.45
[9,] -21.55 34.85
[10,] 45.45 -21.55
[11,] -38.75 45.45
[12,] 28.85 -38.75
[13,] -7.35 28.85
[14,] 33.05 -7.35
[15,] -8.35 33.05
[16,] 59.25 -8.35
[17,] 62.25 59.25
[18,] 1.85 62.25
[19,] 28.45 1.85
[20,] 19.85 28.45
[21,] -63.55 19.85
[22,] -49.55 -63.55
[23,] -3.75 -49.55
[24,] 73.85 -3.75
[25,] 45.65 73.85
[26,] -45.95 45.65
[27,] -49.35 -45.95
[28,] 67.25 -49.35
[29,] -60.75 67.25
[30,] -30.15 -60.75
[31,] -7.55 -30.15
[32,] -97.15 -7.55
[33,] -35.55 -97.15
[34,] 6.45 -35.55
[35,] -26.75 6.45
[36,] -24.15 -26.75
[37,] -2.35 -24.15
[38,] -10.95 -2.35
[39,] 10.65 -10.95
[40,] -29.75 10.65
[41,] -60.75 -29.75
[42,] -24.15 -60.75
[43,] 5.45 -24.15
[44,] -12.15 5.45
[45,] 101.45 -12.15
[46,] -1.55 101.45
[47,] -50.75 -1.55
[48,] -39.40 -50.75
[49,] -86.60 -39.40
[50,] -72.20 -86.60
[51,] 13.40 -72.20
[52,] -91.00 13.40
[53,] 66.00 -91.00
[54,] 56.60 66.00
[55,] -39.80 56.60
[56,] 54.60 -39.80
[57,] 19.20 54.60
[58,] -0.80 19.20
[59,] 120.00 -0.80
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 50.65 -39.15
2 96.05 50.65
3 33.65 96.05
4 -5.75 33.65
5 -6.75 -5.75
6 -4.15 -6.75
7 13.45 -4.15
8 34.85 13.45
9 -21.55 34.85
10 45.45 -21.55
11 -38.75 45.45
12 28.85 -38.75
13 -7.35 28.85
14 33.05 -7.35
15 -8.35 33.05
16 59.25 -8.35
17 62.25 59.25
18 1.85 62.25
19 28.45 1.85
20 19.85 28.45
21 -63.55 19.85
22 -49.55 -63.55
23 -3.75 -49.55
24 73.85 -3.75
25 45.65 73.85
26 -45.95 45.65
27 -49.35 -45.95
28 67.25 -49.35
29 -60.75 67.25
30 -30.15 -60.75
31 -7.55 -30.15
32 -97.15 -7.55
33 -35.55 -97.15
34 6.45 -35.55
35 -26.75 6.45
36 -24.15 -26.75
37 -2.35 -24.15
38 -10.95 -2.35
39 10.65 -10.95
40 -29.75 10.65
41 -60.75 -29.75
42 -24.15 -60.75
43 5.45 -24.15
44 -12.15 5.45
45 101.45 -12.15
46 -1.55 101.45
47 -50.75 -1.55
48 -39.40 -50.75
49 -86.60 -39.40
50 -72.20 -86.60
51 13.40 -72.20
52 -91.00 13.40
53 66.00 -91.00
54 56.60 66.00
55 -39.80 56.60
56 54.60 -39.80
57 19.20 54.60
58 -0.80 19.20
59 120.00 -0.80
> 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/71g3t1259319500.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/8nrs51259319500.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/91trj1259319500.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/10u7kh1259319500.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/1112ph1259319500.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/12ercu1259319500.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/13a0m21259319500.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/1443sj1259319500.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/15rqh11259319500.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/16ll0t1259319500.tab")
+ }
>
> system("convert tmp/1zbi21259319500.ps tmp/1zbi21259319500.png")
> system("convert tmp/2r72v1259319500.ps tmp/2r72v1259319500.png")
> system("convert tmp/36idi1259319500.ps tmp/36idi1259319500.png")
> system("convert tmp/4sqqv1259319500.ps tmp/4sqqv1259319500.png")
> system("convert tmp/5urfn1259319500.ps tmp/5urfn1259319500.png")
> system("convert tmp/6psrs1259319500.ps tmp/6psrs1259319500.png")
> system("convert tmp/71g3t1259319500.ps tmp/71g3t1259319500.png")
> system("convert tmp/8nrs51259319500.ps tmp/8nrs51259319500.png")
> system("convert tmp/91trj1259319500.ps tmp/91trj1259319500.png")
> system("convert tmp/10u7kh1259319500.ps tmp/10u7kh1259319500.png")
>
>
> proc.time()
user system elapsed
2.368 1.547 2.850