R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
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(277,5,82,98,232,4,84,100,256,3,85,103,242,4,87,100,302,4,91,100,282,4,94,101,288,5,96,100,321,6,97,100,316,5,99,100,396,5,100,102,362,4,102,103,392,3,104,106,414,2,105,108,417,2,107,105,476,2,108,110,488,1,109,110,489,0,110,110,467,0,110,113,460,1,109,111,482,0,109,111,510,1,109,111,493,0,110,111,476,0,110,107,448,1,110,110,410,2,110,104,466,2,107,105,417,3,108,104,387,3,109,106,370,1,109,105,344,2,110,104,396,3,109,104,349,2,110,104,326,4,110,103,303,4,110,104,300,3,110,98,329,3,110,100,304,3,110,103,286,3,109,100,281,5,110,100,377,5,110,101,344,4,112,100,369,3,112,100,390,2,112,100,406,-1,111,102,426,-4,112,103,467,-5,112,106,437,-4,113,108,410,-2,113,105,390,2,113,110,418,2,112,110,398,2,112,110,422,2,111,113,439,3,112,111,419,1,112,111,484,1,113,111,491,-1,113,111),dim=c(4,56),dimnames=list(c('werkeloosheid','bbp','cpi','prijsbouw'),1:56))
> y <- array(NA,dim=c(4,56),dimnames=list(c('werkeloosheid','bbp','cpi','prijsbouw'),1:56))
> 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'
> 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, 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
werkeloosheid bbp cpi prijsbouw
1 277 5 82 98
2 232 4 84 100
3 256 3 85 103
4 242 4 87 100
5 302 4 91 100
6 282 4 94 101
7 288 5 96 100
8 321 6 97 100
9 316 5 99 100
10 396 5 100 102
11 362 4 102 103
12 392 3 104 106
13 414 2 105 108
14 417 2 107 105
15 476 2 108 110
16 488 1 109 110
17 489 0 110 110
18 467 0 110 113
19 460 1 109 111
20 482 0 109 111
21 510 1 109 111
22 493 0 110 111
23 476 0 110 107
24 448 1 110 110
25 410 2 110 104
26 466 2 107 105
27 417 3 108 104
28 387 3 109 106
29 370 1 109 105
30 344 2 110 104
31 396 3 109 104
32 349 2 110 104
33 326 4 110 103
34 303 4 110 104
35 300 3 110 98
36 329 3 110 100
37 304 3 110 103
38 286 3 109 100
39 281 5 110 100
40 377 5 110 101
41 344 4 112 100
42 369 3 112 100
43 390 2 112 100
44 406 -1 111 102
45 426 -4 112 103
46 467 -5 112 106
47 437 -4 113 108
48 410 -2 113 105
49 390 2 113 110
50 418 2 112 110
51 398 2 112 110
52 422 2 111 113
53 439 3 112 111
54 419 1 112 111
55 484 1 113 111
56 491 -1 113 111
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) bbp cpi prijsbouw
-821.809 -7.732 2.192 9.422
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-65.286 -33.336 4.141 26.671 79.405
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -821.809 148.260 -5.543 1.00e-06 ***
bbp -7.732 2.716 -2.847 0.00630 **
cpi 2.192 0.776 2.825 0.00668 **
prijsbouw 9.422 1.392 6.770 1.15e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 37.41 on 52 degrees of freedom
Multiple R-squared: 0.7595, Adjusted R-squared: 0.7456
F-statistic: 54.73 on 3 and 52 DF, p-value: 4.164e-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.40187552 0.80375105 0.59812448
[2,] 0.25650366 0.51300732 0.74349634
[3,] 0.15373270 0.30746539 0.84626730
[4,] 0.46134612 0.92269224 0.53865388
[5,] 0.36803276 0.73606551 0.63196724
[6,] 0.28700835 0.57401671 0.71299165
[7,] 0.23425276 0.46850553 0.76574724
[8,] 0.23489908 0.46979816 0.76510092
[9,] 0.19636515 0.39273030 0.80363485
[10,] 0.18395716 0.36791432 0.81604284
[11,] 0.15431529 0.30863059 0.84568471
[12,] 0.14509429 0.29018857 0.85490571
[13,] 0.10188910 0.20377819 0.89811090
[14,] 0.07066360 0.14132720 0.92933640
[15,] 0.08902485 0.17804971 0.91097515
[16,] 0.06745928 0.13491857 0.93254072
[17,] 0.06729906 0.13459812 0.93270094
[18,] 0.05730403 0.11460805 0.94269597
[19,] 0.04877388 0.09754775 0.95122612
[20,] 0.16385499 0.32770998 0.83614501
[21,] 0.25978598 0.51957196 0.74021402
[22,] 0.34865515 0.69731029 0.65134485
[23,] 0.44252692 0.88505384 0.55747308
[24,] 0.55549251 0.88901498 0.44450749
[25,] 0.70037634 0.59924731 0.29962366
[26,] 0.70951061 0.58097879 0.29048939
[27,] 0.74086335 0.51827330 0.25913665
[28,] 0.85327070 0.29345860 0.14672930
[29,] 0.80606213 0.38787574 0.19393787
[30,] 0.73989819 0.52020363 0.26010181
[31,] 0.80613305 0.38773389 0.19386695
[32,] 0.82777016 0.34445968 0.17222984
[33,] 0.92628476 0.14743049 0.07371524
[34,] 0.92090548 0.15818904 0.07909452
[35,] 0.88697395 0.22605211 0.11302605
[36,] 0.83953211 0.32093579 0.16046789
[37,] 0.82206836 0.35586328 0.17793164
[38,] 0.80048163 0.39903675 0.19951837
[39,] 0.73910068 0.52179863 0.26089932
[40,] 0.75338545 0.49322910 0.24661455
[41,] 0.73019238 0.53961524 0.26980762
[42,] 0.60699987 0.78600026 0.39300013
[43,] 0.96186467 0.07627065 0.03813533
> postscript(file="/var/fisher/rcomp/tmp/1cmd81355143820.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/2ilv11355143820.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/3biew1355143820.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/4oloa1355143820.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/5d91h1355143820.ps",horizontal=F,onefile=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 = 56
Frequency = 1
1 2 3 4 5 6
34.36503052 -41.59559784 -55.78546139 -38.17294378 13.05726163 -22.94176816
7 8 9 10 11 12
-4.17261823 34.36729649 17.25003582 76.21421948 20.67527497 10.29296277
13 14 15 16 17 18
3.52478305 30.40493730 40.10406942 42.17925740 33.25444538 -17.01060616
19 20 21 22 23 24
4.75757355 19.02521018 54.75757355 27.83276153 48.51949692 -0.01319125
25 26 27 28 29 30
26.24927520 79.40493730 45.36653587 -5.66928047 -28.71232337 -39.75072480
31 32 33 34 35 36
22.17408722 -34.75072480 -32.86431421 -65.28599806 -19.48825835 -9.33162604
37 38 39 40 41 42
-62.59667758 -50.13917739 -41.86689930 44.71141685 9.01584003 26.28347666
43 44 45 46 47 48
39.55111329 15.70310413 0.89188152 5.89446661 -37.40898636 -20.67920807
49 50 51 52 53 54
-56.85817382 -26.66572517 -46.66572517 -48.73832806 -7.35504565 -42.81977239
55 56
19.98777896 11.52305222
> postscript(file="/var/fisher/rcomp/tmp/64e6z1355143820.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 56
Frequency = 1
lag(myerror, k = 1) myerror
0 34.36503052 NA
1 -41.59559784 34.36503052
2 -55.78546139 -41.59559784
3 -38.17294378 -55.78546139
4 13.05726163 -38.17294378
5 -22.94176816 13.05726163
6 -4.17261823 -22.94176816
7 34.36729649 -4.17261823
8 17.25003582 34.36729649
9 76.21421948 17.25003582
10 20.67527497 76.21421948
11 10.29296277 20.67527497
12 3.52478305 10.29296277
13 30.40493730 3.52478305
14 40.10406942 30.40493730
15 42.17925740 40.10406942
16 33.25444538 42.17925740
17 -17.01060616 33.25444538
18 4.75757355 -17.01060616
19 19.02521018 4.75757355
20 54.75757355 19.02521018
21 27.83276153 54.75757355
22 48.51949692 27.83276153
23 -0.01319125 48.51949692
24 26.24927520 -0.01319125
25 79.40493730 26.24927520
26 45.36653587 79.40493730
27 -5.66928047 45.36653587
28 -28.71232337 -5.66928047
29 -39.75072480 -28.71232337
30 22.17408722 -39.75072480
31 -34.75072480 22.17408722
32 -32.86431421 -34.75072480
33 -65.28599806 -32.86431421
34 -19.48825835 -65.28599806
35 -9.33162604 -19.48825835
36 -62.59667758 -9.33162604
37 -50.13917739 -62.59667758
38 -41.86689930 -50.13917739
39 44.71141685 -41.86689930
40 9.01584003 44.71141685
41 26.28347666 9.01584003
42 39.55111329 26.28347666
43 15.70310413 39.55111329
44 0.89188152 15.70310413
45 5.89446661 0.89188152
46 -37.40898636 5.89446661
47 -20.67920807 -37.40898636
48 -56.85817382 -20.67920807
49 -26.66572517 -56.85817382
50 -46.66572517 -26.66572517
51 -48.73832806 -46.66572517
52 -7.35504565 -48.73832806
53 -42.81977239 -7.35504565
54 19.98777896 -42.81977239
55 11.52305222 19.98777896
56 NA 11.52305222
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -41.59559784 34.36503052
[2,] -55.78546139 -41.59559784
[3,] -38.17294378 -55.78546139
[4,] 13.05726163 -38.17294378
[5,] -22.94176816 13.05726163
[6,] -4.17261823 -22.94176816
[7,] 34.36729649 -4.17261823
[8,] 17.25003582 34.36729649
[9,] 76.21421948 17.25003582
[10,] 20.67527497 76.21421948
[11,] 10.29296277 20.67527497
[12,] 3.52478305 10.29296277
[13,] 30.40493730 3.52478305
[14,] 40.10406942 30.40493730
[15,] 42.17925740 40.10406942
[16,] 33.25444538 42.17925740
[17,] -17.01060616 33.25444538
[18,] 4.75757355 -17.01060616
[19,] 19.02521018 4.75757355
[20,] 54.75757355 19.02521018
[21,] 27.83276153 54.75757355
[22,] 48.51949692 27.83276153
[23,] -0.01319125 48.51949692
[24,] 26.24927520 -0.01319125
[25,] 79.40493730 26.24927520
[26,] 45.36653587 79.40493730
[27,] -5.66928047 45.36653587
[28,] -28.71232337 -5.66928047
[29,] -39.75072480 -28.71232337
[30,] 22.17408722 -39.75072480
[31,] -34.75072480 22.17408722
[32,] -32.86431421 -34.75072480
[33,] -65.28599806 -32.86431421
[34,] -19.48825835 -65.28599806
[35,] -9.33162604 -19.48825835
[36,] -62.59667758 -9.33162604
[37,] -50.13917739 -62.59667758
[38,] -41.86689930 -50.13917739
[39,] 44.71141685 -41.86689930
[40,] 9.01584003 44.71141685
[41,] 26.28347666 9.01584003
[42,] 39.55111329 26.28347666
[43,] 15.70310413 39.55111329
[44,] 0.89188152 15.70310413
[45,] 5.89446661 0.89188152
[46,] -37.40898636 5.89446661
[47,] -20.67920807 -37.40898636
[48,] -56.85817382 -20.67920807
[49,] -26.66572517 -56.85817382
[50,] -46.66572517 -26.66572517
[51,] -48.73832806 -46.66572517
[52,] -7.35504565 -48.73832806
[53,] -42.81977239 -7.35504565
[54,] 19.98777896 -42.81977239
[55,] 11.52305222 19.98777896
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -41.59559784 34.36503052
2 -55.78546139 -41.59559784
3 -38.17294378 -55.78546139
4 13.05726163 -38.17294378
5 -22.94176816 13.05726163
6 -4.17261823 -22.94176816
7 34.36729649 -4.17261823
8 17.25003582 34.36729649
9 76.21421948 17.25003582
10 20.67527497 76.21421948
11 10.29296277 20.67527497
12 3.52478305 10.29296277
13 30.40493730 3.52478305
14 40.10406942 30.40493730
15 42.17925740 40.10406942
16 33.25444538 42.17925740
17 -17.01060616 33.25444538
18 4.75757355 -17.01060616
19 19.02521018 4.75757355
20 54.75757355 19.02521018
21 27.83276153 54.75757355
22 48.51949692 27.83276153
23 -0.01319125 48.51949692
24 26.24927520 -0.01319125
25 79.40493730 26.24927520
26 45.36653587 79.40493730
27 -5.66928047 45.36653587
28 -28.71232337 -5.66928047
29 -39.75072480 -28.71232337
30 22.17408722 -39.75072480
31 -34.75072480 22.17408722
32 -32.86431421 -34.75072480
33 -65.28599806 -32.86431421
34 -19.48825835 -65.28599806
35 -9.33162604 -19.48825835
36 -62.59667758 -9.33162604
37 -50.13917739 -62.59667758
38 -41.86689930 -50.13917739
39 44.71141685 -41.86689930
40 9.01584003 44.71141685
41 26.28347666 9.01584003
42 39.55111329 26.28347666
43 15.70310413 39.55111329
44 0.89188152 15.70310413
45 5.89446661 0.89188152
46 -37.40898636 5.89446661
47 -20.67920807 -37.40898636
48 -56.85817382 -20.67920807
49 -26.66572517 -56.85817382
50 -46.66572517 -26.66572517
51 -48.73832806 -46.66572517
52 -7.35504565 -48.73832806
53 -42.81977239 -7.35504565
54 19.98777896 -42.81977239
55 11.52305222 19.98777896
> 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/fisher/rcomp/tmp/7o2411355143820.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/8ngvl1355143820.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/94xmf1355143820.ps",horizontal=F,onefile=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/fisher/rcomp/tmp/10la2v1355143820.ps",horizontal=F,onefile=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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/fisher/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/fisher/rcomp/tmp/11z4bz1355143820.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/fisher/rcomp/tmp/122ajn1355143820.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/fisher/rcomp/tmp/13khqh1355143820.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/fisher/rcomp/tmp/141s0m1355143820.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/fisher/rcomp/tmp/156rju1355143820.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/fisher/rcomp/tmp/163g431355143821.tab")
+ }
>
> try(system("convert tmp/1cmd81355143820.ps tmp/1cmd81355143820.png",intern=TRUE))
character(0)
> try(system("convert tmp/2ilv11355143820.ps tmp/2ilv11355143820.png",intern=TRUE))
character(0)
> try(system("convert tmp/3biew1355143820.ps tmp/3biew1355143820.png",intern=TRUE))
character(0)
> try(system("convert tmp/4oloa1355143820.ps tmp/4oloa1355143820.png",intern=TRUE))
character(0)
> try(system("convert tmp/5d91h1355143820.ps tmp/5d91h1355143820.png",intern=TRUE))
character(0)
> try(system("convert tmp/64e6z1355143820.ps tmp/64e6z1355143820.png",intern=TRUE))
character(0)
> try(system("convert tmp/7o2411355143820.ps tmp/7o2411355143820.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ngvl1355143820.ps tmp/8ngvl1355143820.png",intern=TRUE))
character(0)
> try(system("convert tmp/94xmf1355143820.ps tmp/94xmf1355143820.png",intern=TRUE))
character(0)
> try(system("convert tmp/10la2v1355143820.ps tmp/10la2v1355143820.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
6.085 1.598 7.690