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(20366,0,22782,0,19169,0,13807,0,29743,0,25591,0,29096,0,26482,0,22405,0,27044,0,17970,0,18730,0,19684,0,19785,0,18479,0,10698,0,31956,0,29506,0,34506,0,27165,0,26736,0,23691,0,18157,0,17328,0,18205,0,20995,0,17382,0,9367,0,31124,0,26551,0,30651,0,25859,0,25100,0,25778,0,20418,0,18688,0,20424,0,24776,0,19814,0,12738,0,31566,0,30111,0,30019,0,31934,1,25826,1,26835,1,20205,1,17789,1,20520,1,22518,1,15572,1,11509,1,25447,1,24090,1,27786,1,26195,1,20516,1,22759,1,19028,1,16971,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 = '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 X
1 20366 0
2 22782 0
3 19169 0
4 13807 0
5 29743 0
6 25591 0
7 29096 0
8 26482 0
9 22405 0
10 27044 0
11 17970 0
12 18730 0
13 19684 0
14 19785 0
15 18479 0
16 10698 0
17 31956 0
18 29506 0
19 34506 0
20 27165 0
21 26736 0
22 23691 0
23 18157 0
24 17328 0
25 18205 0
26 20995 0
27 17382 0
28 9367 0
29 31124 0
30 26551 0
31 30651 0
32 25859 0
33 25100 0
34 25778 0
35 20418 0
36 18688 0
37 20424 0
38 24776 0
39 19814 0
40 12738 0
41 31566 0
42 30111 0
43 30019 0
44 31934 1
45 25826 1
46 26835 1
47 20205 1
48 17789 1
49 20520 1
50 22518 1
51 15572 1
52 11509 1
53 25447 1
54 24090 1
55 27786 1
56 26195 1
57 20516 1
58 22759 1
59 19028 1
60 16971 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
23033.5 -945.3
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-13666.53 -4300.31 89.11 4034.54 11472.47
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 23033.5 883.0 26.09 <2e-16 ***
X -945.3 1658.8 -0.57 0.571
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 5790 on 58 degrees of freedom
Multiple R-squared: 0.005568, Adjusted R-squared: -0.01158
F-statistic: 0.3247 on 1 and 58 DF, p-value: 0.571
> 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.7262421 0.5475157 0.2737579
[2,] 0.6343191 0.7313618 0.3656809
[3,] 0.6485591 0.7028818 0.3514409
[4,] 0.5582514 0.8834972 0.4417486
[5,] 0.4369431 0.8738862 0.5630569
[6,] 0.3678635 0.7357270 0.6321365
[7,] 0.3545431 0.7090863 0.6454569
[8,] 0.3106107 0.6212214 0.6893893
[9,] 0.2490582 0.4981163 0.7509418
[10,] 0.1934687 0.3869373 0.8065313
[11,] 0.1625340 0.3250680 0.8374660
[12,] 0.3977399 0.7954797 0.6022601
[13,] 0.5537754 0.8924493 0.4462246
[14,] 0.5829376 0.8341249 0.4170624
[15,] 0.7781473 0.4437055 0.2218527
[16,] 0.7434519 0.5130963 0.2565481
[17,] 0.7000773 0.5998454 0.2999227
[18,] 0.6281386 0.7437228 0.3718614
[19,] 0.6036576 0.7926848 0.3963424
[20,] 0.5966874 0.8066251 0.4033126
[21,] 0.5701657 0.8596686 0.4298343
[22,] 0.5025054 0.9949891 0.4974946
[23,] 0.4973887 0.9947774 0.5026113
[24,] 0.8131208 0.3737583 0.1868792
[25,] 0.8475433 0.3049134 0.1524567
[26,] 0.8130740 0.3738520 0.1869260
[27,] 0.8385953 0.3228095 0.1614047
[28,] 0.7973573 0.4052854 0.2026427
[29,] 0.7446580 0.5106839 0.2553420
[30,] 0.6919592 0.6160817 0.3080408
[31,] 0.6365844 0.7268311 0.3634156
[32,] 0.6116392 0.7767217 0.3883608
[33,] 0.5625330 0.8749340 0.4374670
[34,] 0.4863787 0.9727574 0.5136213
[35,] 0.4600476 0.9200952 0.5399524
[36,] 0.8312564 0.3374872 0.1687436
[37,] 0.8125576 0.3748848 0.1874424
[38,] 0.7744646 0.4510707 0.2255354
[39,] 0.7278944 0.5442113 0.2721056
[40,] 0.8385991 0.3228019 0.1614009
[41,] 0.8197399 0.3605202 0.1802601
[42,] 0.8215278 0.3569444 0.1784722
[43,] 0.7676148 0.4647704 0.2323852
[44,] 0.7292385 0.5415230 0.2707615
[45,] 0.6400976 0.7198049 0.3599024
[46,] 0.5387047 0.9225906 0.4612953
[47,] 0.5424849 0.9150302 0.4575151
[48,] 0.8439271 0.3121458 0.1560729
[49,] 0.7749164 0.4501672 0.2250836
[50,] 0.6543295 0.6913409 0.3456705
[51,] 0.7032303 0.5935393 0.2967697
> postscript(file="/var/www/html/rcomp/tmp/1y7c61260971907.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/24cuh1260971907.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/3rocn1260971907.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/4d99h1260971907.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/5dtgm1260971907.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
-2667.5349 -251.5349 -3864.5349 -9226.5349 6709.4651 2557.4651
7 8 9 10 11 12
6062.4651 3448.4651 -628.5349 4010.4651 -5063.5349 -4303.5349
13 14 15 16 17 18
-3349.5349 -3248.5349 -4554.5349 -12335.5349 8922.4651 6472.4651
19 20 21 22 23 24
11472.4651 4131.4651 3702.4651 657.4651 -4876.5349 -5705.5349
25 26 27 28 29 30
-4828.5349 -2038.5349 -5651.5349 -13666.5349 8090.4651 3517.4651
31 32 33 34 35 36
7617.4651 2825.4651 2066.4651 2744.4651 -2615.5349 -4345.5349
37 38 39 40 41 42
-2609.5349 1742.4651 -3219.5349 -10295.5349 8532.4651 7077.4651
43 44 45 46 47 48
6985.4651 9845.7647 3737.7647 4746.7647 -1883.2353 -4299.2353
49 50 51 52 53 54
-1568.2353 429.7647 -6516.2353 -10579.2353 3358.7647 2001.7647
55 56 57 58 59 60
5697.7647 4106.7647 -1572.2353 670.7647 -3060.2353 -5117.2353
> postscript(file="/var/www/html/rcomp/tmp/6wdiv1260971907.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 -2667.5349 NA
1 -251.5349 -2667.5349
2 -3864.5349 -251.5349
3 -9226.5349 -3864.5349
4 6709.4651 -9226.5349
5 2557.4651 6709.4651
6 6062.4651 2557.4651
7 3448.4651 6062.4651
8 -628.5349 3448.4651
9 4010.4651 -628.5349
10 -5063.5349 4010.4651
11 -4303.5349 -5063.5349
12 -3349.5349 -4303.5349
13 -3248.5349 -3349.5349
14 -4554.5349 -3248.5349
15 -12335.5349 -4554.5349
16 8922.4651 -12335.5349
17 6472.4651 8922.4651
18 11472.4651 6472.4651
19 4131.4651 11472.4651
20 3702.4651 4131.4651
21 657.4651 3702.4651
22 -4876.5349 657.4651
23 -5705.5349 -4876.5349
24 -4828.5349 -5705.5349
25 -2038.5349 -4828.5349
26 -5651.5349 -2038.5349
27 -13666.5349 -5651.5349
28 8090.4651 -13666.5349
29 3517.4651 8090.4651
30 7617.4651 3517.4651
31 2825.4651 7617.4651
32 2066.4651 2825.4651
33 2744.4651 2066.4651
34 -2615.5349 2744.4651
35 -4345.5349 -2615.5349
36 -2609.5349 -4345.5349
37 1742.4651 -2609.5349
38 -3219.5349 1742.4651
39 -10295.5349 -3219.5349
40 8532.4651 -10295.5349
41 7077.4651 8532.4651
42 6985.4651 7077.4651
43 9845.7647 6985.4651
44 3737.7647 9845.7647
45 4746.7647 3737.7647
46 -1883.2353 4746.7647
47 -4299.2353 -1883.2353
48 -1568.2353 -4299.2353
49 429.7647 -1568.2353
50 -6516.2353 429.7647
51 -10579.2353 -6516.2353
52 3358.7647 -10579.2353
53 2001.7647 3358.7647
54 5697.7647 2001.7647
55 4106.7647 5697.7647
56 -1572.2353 4106.7647
57 670.7647 -1572.2353
58 -3060.2353 670.7647
59 -5117.2353 -3060.2353
60 NA -5117.2353
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -251.5349 -2667.5349
[2,] -3864.5349 -251.5349
[3,] -9226.5349 -3864.5349
[4,] 6709.4651 -9226.5349
[5,] 2557.4651 6709.4651
[6,] 6062.4651 2557.4651
[7,] 3448.4651 6062.4651
[8,] -628.5349 3448.4651
[9,] 4010.4651 -628.5349
[10,] -5063.5349 4010.4651
[11,] -4303.5349 -5063.5349
[12,] -3349.5349 -4303.5349
[13,] -3248.5349 -3349.5349
[14,] -4554.5349 -3248.5349
[15,] -12335.5349 -4554.5349
[16,] 8922.4651 -12335.5349
[17,] 6472.4651 8922.4651
[18,] 11472.4651 6472.4651
[19,] 4131.4651 11472.4651
[20,] 3702.4651 4131.4651
[21,] 657.4651 3702.4651
[22,] -4876.5349 657.4651
[23,] -5705.5349 -4876.5349
[24,] -4828.5349 -5705.5349
[25,] -2038.5349 -4828.5349
[26,] -5651.5349 -2038.5349
[27,] -13666.5349 -5651.5349
[28,] 8090.4651 -13666.5349
[29,] 3517.4651 8090.4651
[30,] 7617.4651 3517.4651
[31,] 2825.4651 7617.4651
[32,] 2066.4651 2825.4651
[33,] 2744.4651 2066.4651
[34,] -2615.5349 2744.4651
[35,] -4345.5349 -2615.5349
[36,] -2609.5349 -4345.5349
[37,] 1742.4651 -2609.5349
[38,] -3219.5349 1742.4651
[39,] -10295.5349 -3219.5349
[40,] 8532.4651 -10295.5349
[41,] 7077.4651 8532.4651
[42,] 6985.4651 7077.4651
[43,] 9845.7647 6985.4651
[44,] 3737.7647 9845.7647
[45,] 4746.7647 3737.7647
[46,] -1883.2353 4746.7647
[47,] -4299.2353 -1883.2353
[48,] -1568.2353 -4299.2353
[49,] 429.7647 -1568.2353
[50,] -6516.2353 429.7647
[51,] -10579.2353 -6516.2353
[52,] 3358.7647 -10579.2353
[53,] 2001.7647 3358.7647
[54,] 5697.7647 2001.7647
[55,] 4106.7647 5697.7647
[56,] -1572.2353 4106.7647
[57,] 670.7647 -1572.2353
[58,] -3060.2353 670.7647
[59,] -5117.2353 -3060.2353
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -251.5349 -2667.5349
2 -3864.5349 -251.5349
3 -9226.5349 -3864.5349
4 6709.4651 -9226.5349
5 2557.4651 6709.4651
6 6062.4651 2557.4651
7 3448.4651 6062.4651
8 -628.5349 3448.4651
9 4010.4651 -628.5349
10 -5063.5349 4010.4651
11 -4303.5349 -5063.5349
12 -3349.5349 -4303.5349
13 -3248.5349 -3349.5349
14 -4554.5349 -3248.5349
15 -12335.5349 -4554.5349
16 8922.4651 -12335.5349
17 6472.4651 8922.4651
18 11472.4651 6472.4651
19 4131.4651 11472.4651
20 3702.4651 4131.4651
21 657.4651 3702.4651
22 -4876.5349 657.4651
23 -5705.5349 -4876.5349
24 -4828.5349 -5705.5349
25 -2038.5349 -4828.5349
26 -5651.5349 -2038.5349
27 -13666.5349 -5651.5349
28 8090.4651 -13666.5349
29 3517.4651 8090.4651
30 7617.4651 3517.4651
31 2825.4651 7617.4651
32 2066.4651 2825.4651
33 2744.4651 2066.4651
34 -2615.5349 2744.4651
35 -4345.5349 -2615.5349
36 -2609.5349 -4345.5349
37 1742.4651 -2609.5349
38 -3219.5349 1742.4651
39 -10295.5349 -3219.5349
40 8532.4651 -10295.5349
41 7077.4651 8532.4651
42 6985.4651 7077.4651
43 9845.7647 6985.4651
44 3737.7647 9845.7647
45 4746.7647 3737.7647
46 -1883.2353 4746.7647
47 -4299.2353 -1883.2353
48 -1568.2353 -4299.2353
49 429.7647 -1568.2353
50 -6516.2353 429.7647
51 -10579.2353 -6516.2353
52 3358.7647 -10579.2353
53 2001.7647 3358.7647
54 5697.7647 2001.7647
55 4106.7647 5697.7647
56 -1572.2353 4106.7647
57 670.7647 -1572.2353
58 -3060.2353 670.7647
59 -5117.2353 -3060.2353
> 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/7qbo91260971907.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/8d6wu1260971907.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/92wud1260971907.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/10sbuo1260971907.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/11yyam1260971907.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/12g4rz1260971907.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/13x5sh1260971907.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/14jkjd1260971907.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/15mfrk1260971907.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/16wnr01260971907.tab")
+ }
>
> try(system("convert tmp/1y7c61260971907.ps tmp/1y7c61260971907.png",intern=TRUE))
character(0)
> try(system("convert tmp/24cuh1260971907.ps tmp/24cuh1260971907.png",intern=TRUE))
character(0)
> try(system("convert tmp/3rocn1260971907.ps tmp/3rocn1260971907.png",intern=TRUE))
character(0)
> try(system("convert tmp/4d99h1260971907.ps tmp/4d99h1260971907.png",intern=TRUE))
character(0)
> try(system("convert tmp/5dtgm1260971907.ps tmp/5dtgm1260971907.png",intern=TRUE))
character(0)
> try(system("convert tmp/6wdiv1260971907.ps tmp/6wdiv1260971907.png",intern=TRUE))
character(0)
> try(system("convert tmp/7qbo91260971907.ps tmp/7qbo91260971907.png",intern=TRUE))
character(0)
> try(system("convert tmp/8d6wu1260971907.ps tmp/8d6wu1260971907.png",intern=TRUE))
character(0)
> try(system("convert tmp/92wud1260971907.ps tmp/92wud1260971907.png",intern=TRUE))
character(0)
> try(system("convert tmp/10sbuo1260971907.ps tmp/10sbuo1260971907.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.463 1.560 3.588