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(612613,1,611324,1,594167,1,595454,1,590865,1,589379,1,584428,1,573100,1,567456,1,569028,1,620735,1,628884,1,628232,1,612117,1,595404,1,597141,1,593408,1,590072,1,579799,1,574205,1,572775,1,572942,1,619567,1,625809,1,619916,1,587625,0,565742,0,557274,0,560576,0,548854,0,531673,0,525919,0,511038,0,498662,0,555362,0,564591,0,541657,0,527070,0,509846,0,514258,0,516922,0,507561,0,492622,0,490243,0,469357,0,477580,0,528379,0,533590,0,517945,0,506174,0,501866,0,516141,0,528222,0,532638,0,536322,0,536535,0,523597,0,536214,0,586570,0,596594,0),dim=c(2,60),dimnames=list(c('wlh','dummies'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('wlh','dummies'),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
wlh dummies
1 612613 1
2 611324 1
3 594167 1
4 595454 1
5 590865 1
6 589379 1
7 584428 1
8 573100 1
9 567456 1
10 569028 1
11 620735 1
12 628884 1
13 628232 1
14 612117 1
15 595404 1
16 597141 1
17 593408 1
18 590072 1
19 579799 1
20 574205 1
21 572775 1
22 572942 1
23 619567 1
24 625809 1
25 619916 1
26 587625 0
27 565742 0
28 557274 0
29 560576 0
30 548854 0
31 531673 0
32 525919 0
33 511038 0
34 498662 0
35 555362 0
36 564591 0
37 541657 0
38 527070 0
39 509846 0
40 514258 0
41 516922 0
42 507561 0
43 492622 0
44 490243 0
45 469357 0
46 477580 0
47 528379 0
48 533590 0
49 517945 0
50 506174 0
51 501866 0
52 516141 0
53 528222 0
54 532638 0
55 536322 0
56 536535 0
57 523597 0
58 536214 0
59 586570 0
60 596594 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) dummies
529578 67175
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-60221 -18838 -1932 16714 67016
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 529578 4431 119.521 < 2e-16 ***
dummies 67175 6864 9.786 6.87e-14 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 26210 on 58 degrees of freedom
Multiple R-squared: 0.6228, Adjusted R-squared: 0.6163
F-statistic: 95.77 on 1 and 58 DF, p-value: 6.87e-14
> 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.09682461 0.19364921 0.9031754
[2,] 0.05023695 0.10047389 0.9497631
[3,] 0.03331038 0.06662075 0.9666896
[4,] 0.04769837 0.09539674 0.9523016
[5,] 0.06911014 0.13822028 0.9308899
[6,] 0.06966195 0.13932389 0.9303381
[7,] 0.10690202 0.21380404 0.8930980
[8,] 0.17930890 0.35861780 0.8206911
[9,] 0.22743473 0.45486947 0.7725653
[10,] 0.18048426 0.36096851 0.8195157
[11,] 0.12393882 0.24787765 0.8760612
[12,] 0.08159769 0.16319538 0.9184023
[13,] 0.05240789 0.10481578 0.9475921
[14,] 0.03354008 0.06708016 0.9664599
[15,] 0.02627995 0.05255990 0.9737200
[16,] 0.02495407 0.04990815 0.9750459
[17,] 0.02558101 0.05116202 0.9744190
[18,] 0.02864900 0.05729800 0.9713510
[19,] 0.02760934 0.05521869 0.9723907
[20,] 0.03096334 0.06192667 0.9690367
[21,] 0.02691420 0.05382840 0.9730858
[22,] 0.03324398 0.06648797 0.9667560
[23,] 0.03331641 0.06663281 0.9666836
[24,] 0.03057823 0.06115646 0.9694218
[25,] 0.02752332 0.05504663 0.9724767
[26,] 0.02409444 0.04818887 0.9759056
[27,] 0.02506478 0.05012957 0.9749352
[28,] 0.02546893 0.05093786 0.9745311
[29,] 0.03538614 0.07077228 0.9646139
[30,] 0.06245074 0.12490148 0.9375493
[31,] 0.05641314 0.11282628 0.9435869
[32,] 0.06835488 0.13670977 0.9316451
[33,] 0.05228746 0.10457492 0.9477125
[34,] 0.03894267 0.07788534 0.9610573
[35,] 0.03774454 0.07548909 0.9622555
[36,] 0.03088351 0.06176702 0.9691165
[37,] 0.02293546 0.04587092 0.9770645
[38,] 0.02021172 0.04042345 0.9797883
[39,] 0.02925974 0.05851947 0.9707403
[40,] 0.04381121 0.08762241 0.9561888
[41,] 0.16788385 0.33576770 0.8321161
[42,] 0.36271240 0.72542480 0.6372876
[43,] 0.28166830 0.56333660 0.7183317
[44,] 0.20728356 0.41456713 0.7927164
[45,] 0.16208488 0.32416975 0.8379151
[46,] 0.16587042 0.33174083 0.8341296
[47,] 0.21816888 0.43633776 0.7818311
[48,] 0.21067217 0.42134434 0.7893278
[49,] 0.16248271 0.32496541 0.8375173
[50,] 0.11399088 0.22798177 0.8860091
[51,] 0.07135881 0.14271763 0.9286412
> postscript(file="/var/www/html/rcomp/tmp/195wm1261768798.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/217qd1261768798.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/3um7k1261768798.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/4gfy61261768798.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/5a51b1261768798.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
15860.200 14571.200 -2585.800 -1298.800 -5887.800 -7373.800 -12324.800
8 9 10 11 12 13 14
-23652.800 -29296.800 -27724.800 23982.200 32131.200 31479.200 15364.200
15 16 17 18 19 20 21
-1348.800 388.200 -3344.800 -6680.800 -16953.800 -22547.800 -23977.800
22 23 24 25 26 27 28
-23810.800 22814.200 29056.200 23163.200 58047.314 36164.314 27696.314
29 30 31 32 33 34 35
30998.314 19276.314 2095.314 -3658.686 -18539.686 -30915.686 25784.314
36 37 38 39 40 41 42
35013.314 12079.314 -2507.686 -19731.686 -15319.686 -12655.686 -22016.686
43 44 45 46 47 48 49
-36955.686 -39334.686 -60220.686 -51997.686 -1198.686 4012.314 -11632.686
50 51 52 53 54 55 56
-23403.686 -27711.686 -13436.686 -1355.686 3060.314 6744.314 6957.314
57 58 59 60
-5980.686 6636.314 56992.314 67016.314
> postscript(file="/var/www/html/rcomp/tmp/6ev8w1261768798.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 15860.200 NA
1 14571.200 15860.200
2 -2585.800 14571.200
3 -1298.800 -2585.800
4 -5887.800 -1298.800
5 -7373.800 -5887.800
6 -12324.800 -7373.800
7 -23652.800 -12324.800
8 -29296.800 -23652.800
9 -27724.800 -29296.800
10 23982.200 -27724.800
11 32131.200 23982.200
12 31479.200 32131.200
13 15364.200 31479.200
14 -1348.800 15364.200
15 388.200 -1348.800
16 -3344.800 388.200
17 -6680.800 -3344.800
18 -16953.800 -6680.800
19 -22547.800 -16953.800
20 -23977.800 -22547.800
21 -23810.800 -23977.800
22 22814.200 -23810.800
23 29056.200 22814.200
24 23163.200 29056.200
25 58047.314 23163.200
26 36164.314 58047.314
27 27696.314 36164.314
28 30998.314 27696.314
29 19276.314 30998.314
30 2095.314 19276.314
31 -3658.686 2095.314
32 -18539.686 -3658.686
33 -30915.686 -18539.686
34 25784.314 -30915.686
35 35013.314 25784.314
36 12079.314 35013.314
37 -2507.686 12079.314
38 -19731.686 -2507.686
39 -15319.686 -19731.686
40 -12655.686 -15319.686
41 -22016.686 -12655.686
42 -36955.686 -22016.686
43 -39334.686 -36955.686
44 -60220.686 -39334.686
45 -51997.686 -60220.686
46 -1198.686 -51997.686
47 4012.314 -1198.686
48 -11632.686 4012.314
49 -23403.686 -11632.686
50 -27711.686 -23403.686
51 -13436.686 -27711.686
52 -1355.686 -13436.686
53 3060.314 -1355.686
54 6744.314 3060.314
55 6957.314 6744.314
56 -5980.686 6957.314
57 6636.314 -5980.686
58 56992.314 6636.314
59 67016.314 56992.314
60 NA 67016.314
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 14571.200 15860.200
[2,] -2585.800 14571.200
[3,] -1298.800 -2585.800
[4,] -5887.800 -1298.800
[5,] -7373.800 -5887.800
[6,] -12324.800 -7373.800
[7,] -23652.800 -12324.800
[8,] -29296.800 -23652.800
[9,] -27724.800 -29296.800
[10,] 23982.200 -27724.800
[11,] 32131.200 23982.200
[12,] 31479.200 32131.200
[13,] 15364.200 31479.200
[14,] -1348.800 15364.200
[15,] 388.200 -1348.800
[16,] -3344.800 388.200
[17,] -6680.800 -3344.800
[18,] -16953.800 -6680.800
[19,] -22547.800 -16953.800
[20,] -23977.800 -22547.800
[21,] -23810.800 -23977.800
[22,] 22814.200 -23810.800
[23,] 29056.200 22814.200
[24,] 23163.200 29056.200
[25,] 58047.314 23163.200
[26,] 36164.314 58047.314
[27,] 27696.314 36164.314
[28,] 30998.314 27696.314
[29,] 19276.314 30998.314
[30,] 2095.314 19276.314
[31,] -3658.686 2095.314
[32,] -18539.686 -3658.686
[33,] -30915.686 -18539.686
[34,] 25784.314 -30915.686
[35,] 35013.314 25784.314
[36,] 12079.314 35013.314
[37,] -2507.686 12079.314
[38,] -19731.686 -2507.686
[39,] -15319.686 -19731.686
[40,] -12655.686 -15319.686
[41,] -22016.686 -12655.686
[42,] -36955.686 -22016.686
[43,] -39334.686 -36955.686
[44,] -60220.686 -39334.686
[45,] -51997.686 -60220.686
[46,] -1198.686 -51997.686
[47,] 4012.314 -1198.686
[48,] -11632.686 4012.314
[49,] -23403.686 -11632.686
[50,] -27711.686 -23403.686
[51,] -13436.686 -27711.686
[52,] -1355.686 -13436.686
[53,] 3060.314 -1355.686
[54,] 6744.314 3060.314
[55,] 6957.314 6744.314
[56,] -5980.686 6957.314
[57,] 6636.314 -5980.686
[58,] 56992.314 6636.314
[59,] 67016.314 56992.314
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 14571.200 15860.200
2 -2585.800 14571.200
3 -1298.800 -2585.800
4 -5887.800 -1298.800
5 -7373.800 -5887.800
6 -12324.800 -7373.800
7 -23652.800 -12324.800
8 -29296.800 -23652.800
9 -27724.800 -29296.800
10 23982.200 -27724.800
11 32131.200 23982.200
12 31479.200 32131.200
13 15364.200 31479.200
14 -1348.800 15364.200
15 388.200 -1348.800
16 -3344.800 388.200
17 -6680.800 -3344.800
18 -16953.800 -6680.800
19 -22547.800 -16953.800
20 -23977.800 -22547.800
21 -23810.800 -23977.800
22 22814.200 -23810.800
23 29056.200 22814.200
24 23163.200 29056.200
25 58047.314 23163.200
26 36164.314 58047.314
27 27696.314 36164.314
28 30998.314 27696.314
29 19276.314 30998.314
30 2095.314 19276.314
31 -3658.686 2095.314
32 -18539.686 -3658.686
33 -30915.686 -18539.686
34 25784.314 -30915.686
35 35013.314 25784.314
36 12079.314 35013.314
37 -2507.686 12079.314
38 -19731.686 -2507.686
39 -15319.686 -19731.686
40 -12655.686 -15319.686
41 -22016.686 -12655.686
42 -36955.686 -22016.686
43 -39334.686 -36955.686
44 -60220.686 -39334.686
45 -51997.686 -60220.686
46 -1198.686 -51997.686
47 4012.314 -1198.686
48 -11632.686 4012.314
49 -23403.686 -11632.686
50 -27711.686 -23403.686
51 -13436.686 -27711.686
52 -1355.686 -13436.686
53 3060.314 -1355.686
54 6744.314 3060.314
55 6957.314 6744.314
56 -5980.686 6957.314
57 6636.314 -5980.686
58 56992.314 6636.314
59 67016.314 56992.314
> 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/72t641261768798.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/8fi0c1261768798.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/9qz0d1261768798.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/10u0td1261768798.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/11j7av1261768798.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/125ofn1261768798.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/139u9r1261768798.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/14irmc1261768798.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/15nqmo1261768798.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/16qsxt1261768798.tab")
+ }
>
> try(system("convert tmp/195wm1261768798.ps tmp/195wm1261768798.png",intern=TRUE))
character(0)
> try(system("convert tmp/217qd1261768798.ps tmp/217qd1261768798.png",intern=TRUE))
character(0)
> try(system("convert tmp/3um7k1261768798.ps tmp/3um7k1261768798.png",intern=TRUE))
character(0)
> try(system("convert tmp/4gfy61261768798.ps tmp/4gfy61261768798.png",intern=TRUE))
character(0)
> try(system("convert tmp/5a51b1261768798.ps tmp/5a51b1261768798.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ev8w1261768798.ps tmp/6ev8w1261768798.png",intern=TRUE))
character(0)
> try(system("convert tmp/72t641261768798.ps tmp/72t641261768798.png",intern=TRUE))
character(0)
> try(system("convert tmp/8fi0c1261768798.ps tmp/8fi0c1261768798.png",intern=TRUE))
character(0)
> try(system("convert tmp/9qz0d1261768798.ps tmp/9qz0d1261768798.png",intern=TRUE))
character(0)
> try(system("convert tmp/10u0td1261768798.ps tmp/10u0td1261768798.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.504 1.638 3.443