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','kostenbouwsector'),1:56))
> y <- array(NA,dim=c(4,56),dimnames=list(c('werkeloosheid','bbp','cpi','kostenbouwsector'),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 = 'Linear Trend'
> par2 = 'Include Quarterly Dummies'
> par1 = '1'
> par3 <- 'Linear Trend'
> par2 <- 'Include Quarterly 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 kostenbouwsector Q1 Q2 Q3 t
1 277 5 82 98 1 0 0 1
2 232 4 84 100 0 1 0 2
3 256 3 85 103 0 0 1 3
4 242 4 87 100 0 0 0 4
5 302 4 91 100 1 0 0 5
6 282 4 94 101 0 1 0 6
7 288 5 96 100 0 0 1 7
8 321 6 97 100 0 0 0 8
9 316 5 99 100 1 0 0 9
10 396 5 100 102 0 1 0 10
11 362 4 102 103 0 0 1 11
12 392 3 104 106 0 0 0 12
13 414 2 105 108 1 0 0 13
14 417 2 107 105 0 1 0 14
15 476 2 108 110 0 0 1 15
16 488 1 109 110 0 0 0 16
17 489 0 110 110 1 0 0 17
18 467 0 110 113 0 1 0 18
19 460 1 109 111 0 0 1 19
20 482 0 109 111 0 0 0 20
21 510 1 109 111 1 0 0 21
22 493 0 110 111 0 1 0 22
23 476 0 110 107 0 0 1 23
24 448 1 110 110 0 0 0 24
25 410 2 110 104 1 0 0 25
26 466 2 107 105 0 1 0 26
27 417 3 108 104 0 0 1 27
28 387 3 109 106 0 0 0 28
29 370 1 109 105 1 0 0 29
30 344 2 110 104 0 1 0 30
31 396 3 109 104 0 0 1 31
32 349 2 110 104 0 0 0 32
33 326 4 110 103 1 0 0 33
34 303 4 110 104 0 1 0 34
35 300 3 110 98 0 0 1 35
36 329 3 110 100 0 0 0 36
37 304 3 110 103 1 0 0 37
38 286 3 109 100 0 1 0 38
39 281 5 110 100 0 0 1 39
40 377 5 110 101 0 0 0 40
41 344 4 112 100 1 0 0 41
42 369 3 112 100 0 1 0 42
43 390 2 112 100 0 0 1 43
44 406 -1 111 102 0 0 0 44
45 426 -4 112 103 1 0 0 45
46 467 -5 112 106 0 1 0 46
47 437 -4 113 108 0 0 1 47
48 410 -2 113 105 0 0 0 48
49 390 2 113 110 1 0 0 49
50 418 2 112 110 0 1 0 50
51 398 2 112 110 0 0 1 51
52 422 2 111 113 0 0 0 52
53 439 3 112 111 1 0 0 53
54 419 1 112 111 0 1 0 54
55 484 1 113 111 0 0 1 55
56 491 -1 113 111 0 0 0 56
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) bbp cpi kostenbouwsector
-975.3833 -9.0230 5.0010 8.5440
Q1 Q2 Q3 t
-2.7633 -6.7213 0.3262 -1.7123
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-59.27 -23.27 -0.01 18.41 78.44
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -975.3833 143.6124 -6.792 1.53e-08 ***
bbp -9.0230 2.5197 -3.581 0.000796 ***
cpi 5.0010 1.0531 4.749 1.89e-05 ***
kostenbouwsector 8.5440 1.3018 6.563 3.44e-08 ***
Q1 -2.7633 13.0375 -0.212 0.833046
Q2 -6.7213 13.0072 -0.517 0.607714
Q3 0.3262 13.0118 0.025 0.980105
t -1.7123 0.4687 -3.654 0.000639 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 34.36 on 48 degrees of freedom
Multiple R-squared: 0.8128, Adjusted R-squared: 0.7855
F-statistic: 29.77 on 7 and 48 DF, p-value: 2.118e-15
> 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.43564574 0.8712915 0.56435426
[2,] 0.29087671 0.5817534 0.70912329
[3,] 0.25000634 0.5000127 0.74999366
[4,] 0.20212468 0.4042494 0.79787532
[5,] 0.13866554 0.2773311 0.86133446
[6,] 0.11155743 0.2231149 0.88844257
[7,] 0.07046366 0.1409273 0.92953634
[8,] 0.19640776 0.3928155 0.80359224
[9,] 0.16374246 0.3274849 0.83625754
[10,] 0.10783136 0.2156627 0.89216864
[11,] 0.08066598 0.1613320 0.91933402
[12,] 0.05159059 0.1031812 0.94840941
[13,] 0.03908475 0.0781695 0.96091525
[14,] 0.05403732 0.1080746 0.94596268
[15,] 0.07325578 0.1465116 0.92674422
[16,] 0.20992533 0.4198507 0.79007467
[17,] 0.29743534 0.5948707 0.70256466
[18,] 0.37952792 0.7590558 0.62047208
[19,] 0.51109991 0.9778002 0.48890009
[20,] 0.58160597 0.8367881 0.41839403
[21,] 0.84213250 0.3157350 0.15786750
[22,] 0.82114171 0.3577166 0.17885829
[23,] 0.87727480 0.2454504 0.12272520
[24,] 0.88196714 0.2360657 0.11803286
[25,] 0.82836510 0.3432698 0.17163490
[26,] 0.76739691 0.4652062 0.23260309
[27,] 0.70979022 0.5804196 0.29020978
[28,] 0.70173750 0.5965250 0.29826250
[29,] 0.83818205 0.3236359 0.16181795
[30,] 0.91293881 0.1741224 0.08706119
[31,] 0.85529450 0.2894110 0.14470550
[32,] 0.80045642 0.3990872 0.19954358
[33,] 0.76007619 0.4798476 0.23992381
[34,] 0.70243926 0.5951215 0.29756074
[35,] 0.53990532 0.9201894 0.46009468
> postscript(file="/var/wessaorg/rcomp/tmp/11zgl1355475842.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/wessaorg/rcomp/tmp/2no1h1355475842.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/wessaorg/rcomp/tmp/3bx021355475842.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/wessaorg/rcomp/tmp/4d4o71355475842.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/wessaorg/rcomp/tmp/5spdq1355475842.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 7
54.577483 -20.865240 -41.856485 -29.165010 15.306523 -22.570211 -14.340432
8 9 10 11 12 13 14
24.719966 5.170532 68.751767 1.847574 -10.771021 -15.407508 8.892854
15 16 17 18 19 20 21
14.836520 14.850996 6.302558 -35.659235 -16.882440 -1.866968 39.631514
22 23 24 25 26 27 28
14.277837 26.118723 -16.451957 10.310673 78.439920 36.670696 -13.379916
29 30 31 32 33 34 35
-35.406294 -43.170023 17.518721 -41.466803 -33.401336 -59.275079 -25.369105
36 37 38 39 40 41 42
-11.418720 -57.575274 -39.271922 -36.562210 52.932199 13.926789 35.574110
43 44 45 46 47 48 49
42.215936 21.098434 4.960049 16.975295 -31.426003 -12.709573 -34.862332
50 51 52 53 54 55 56
3.808946 -21.526267 -16.118911 26.466623 -5.909018 48.754772 39.747284
> postscript(file="/var/wessaorg/rcomp/tmp/6slle1355475842.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 54.577483 NA
1 -20.865240 54.577483
2 -41.856485 -20.865240
3 -29.165010 -41.856485
4 15.306523 -29.165010
5 -22.570211 15.306523
6 -14.340432 -22.570211
7 24.719966 -14.340432
8 5.170532 24.719966
9 68.751767 5.170532
10 1.847574 68.751767
11 -10.771021 1.847574
12 -15.407508 -10.771021
13 8.892854 -15.407508
14 14.836520 8.892854
15 14.850996 14.836520
16 6.302558 14.850996
17 -35.659235 6.302558
18 -16.882440 -35.659235
19 -1.866968 -16.882440
20 39.631514 -1.866968
21 14.277837 39.631514
22 26.118723 14.277837
23 -16.451957 26.118723
24 10.310673 -16.451957
25 78.439920 10.310673
26 36.670696 78.439920
27 -13.379916 36.670696
28 -35.406294 -13.379916
29 -43.170023 -35.406294
30 17.518721 -43.170023
31 -41.466803 17.518721
32 -33.401336 -41.466803
33 -59.275079 -33.401336
34 -25.369105 -59.275079
35 -11.418720 -25.369105
36 -57.575274 -11.418720
37 -39.271922 -57.575274
38 -36.562210 -39.271922
39 52.932199 -36.562210
40 13.926789 52.932199
41 35.574110 13.926789
42 42.215936 35.574110
43 21.098434 42.215936
44 4.960049 21.098434
45 16.975295 4.960049
46 -31.426003 16.975295
47 -12.709573 -31.426003
48 -34.862332 -12.709573
49 3.808946 -34.862332
50 -21.526267 3.808946
51 -16.118911 -21.526267
52 26.466623 -16.118911
53 -5.909018 26.466623
54 48.754772 -5.909018
55 39.747284 48.754772
56 NA 39.747284
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -20.865240 54.577483
[2,] -41.856485 -20.865240
[3,] -29.165010 -41.856485
[4,] 15.306523 -29.165010
[5,] -22.570211 15.306523
[6,] -14.340432 -22.570211
[7,] 24.719966 -14.340432
[8,] 5.170532 24.719966
[9,] 68.751767 5.170532
[10,] 1.847574 68.751767
[11,] -10.771021 1.847574
[12,] -15.407508 -10.771021
[13,] 8.892854 -15.407508
[14,] 14.836520 8.892854
[15,] 14.850996 14.836520
[16,] 6.302558 14.850996
[17,] -35.659235 6.302558
[18,] -16.882440 -35.659235
[19,] -1.866968 -16.882440
[20,] 39.631514 -1.866968
[21,] 14.277837 39.631514
[22,] 26.118723 14.277837
[23,] -16.451957 26.118723
[24,] 10.310673 -16.451957
[25,] 78.439920 10.310673
[26,] 36.670696 78.439920
[27,] -13.379916 36.670696
[28,] -35.406294 -13.379916
[29,] -43.170023 -35.406294
[30,] 17.518721 -43.170023
[31,] -41.466803 17.518721
[32,] -33.401336 -41.466803
[33,] -59.275079 -33.401336
[34,] -25.369105 -59.275079
[35,] -11.418720 -25.369105
[36,] -57.575274 -11.418720
[37,] -39.271922 -57.575274
[38,] -36.562210 -39.271922
[39,] 52.932199 -36.562210
[40,] 13.926789 52.932199
[41,] 35.574110 13.926789
[42,] 42.215936 35.574110
[43,] 21.098434 42.215936
[44,] 4.960049 21.098434
[45,] 16.975295 4.960049
[46,] -31.426003 16.975295
[47,] -12.709573 -31.426003
[48,] -34.862332 -12.709573
[49,] 3.808946 -34.862332
[50,] -21.526267 3.808946
[51,] -16.118911 -21.526267
[52,] 26.466623 -16.118911
[53,] -5.909018 26.466623
[54,] 48.754772 -5.909018
[55,] 39.747284 48.754772
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -20.865240 54.577483
2 -41.856485 -20.865240
3 -29.165010 -41.856485
4 15.306523 -29.165010
5 -22.570211 15.306523
6 -14.340432 -22.570211
7 24.719966 -14.340432
8 5.170532 24.719966
9 68.751767 5.170532
10 1.847574 68.751767
11 -10.771021 1.847574
12 -15.407508 -10.771021
13 8.892854 -15.407508
14 14.836520 8.892854
15 14.850996 14.836520
16 6.302558 14.850996
17 -35.659235 6.302558
18 -16.882440 -35.659235
19 -1.866968 -16.882440
20 39.631514 -1.866968
21 14.277837 39.631514
22 26.118723 14.277837
23 -16.451957 26.118723
24 10.310673 -16.451957
25 78.439920 10.310673
26 36.670696 78.439920
27 -13.379916 36.670696
28 -35.406294 -13.379916
29 -43.170023 -35.406294
30 17.518721 -43.170023
31 -41.466803 17.518721
32 -33.401336 -41.466803
33 -59.275079 -33.401336
34 -25.369105 -59.275079
35 -11.418720 -25.369105
36 -57.575274 -11.418720
37 -39.271922 -57.575274
38 -36.562210 -39.271922
39 52.932199 -36.562210
40 13.926789 52.932199
41 35.574110 13.926789
42 42.215936 35.574110
43 21.098434 42.215936
44 4.960049 21.098434
45 16.975295 4.960049
46 -31.426003 16.975295
47 -12.709573 -31.426003
48 -34.862332 -12.709573
49 3.808946 -34.862332
50 -21.526267 3.808946
51 -16.118911 -21.526267
52 26.466623 -16.118911
53 -5.909018 26.466623
54 48.754772 -5.909018
55 39.747284 48.754772
> 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/wessaorg/rcomp/tmp/77h0y1355475842.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/wessaorg/rcomp/tmp/8uer91355475842.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/wessaorg/rcomp/tmp/9o64q1355475843.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/wessaorg/rcomp/tmp/10wnjy1355475843.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11e1x81355475843.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/wessaorg/rcomp/tmp/12yrje1355475843.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/wessaorg/rcomp/tmp/13jgok1355475843.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/wessaorg/rcomp/tmp/14df9f1355475843.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/wessaorg/rcomp/tmp/156d7v1355475843.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/wessaorg/rcomp/tmp/16l7m91355475843.tab")
+ }
>
> try(system("convert tmp/11zgl1355475842.ps tmp/11zgl1355475842.png",intern=TRUE))
character(0)
> try(system("convert tmp/2no1h1355475842.ps tmp/2no1h1355475842.png",intern=TRUE))
character(0)
> try(system("convert tmp/3bx021355475842.ps tmp/3bx021355475842.png",intern=TRUE))
character(0)
> try(system("convert tmp/4d4o71355475842.ps tmp/4d4o71355475842.png",intern=TRUE))
character(0)
> try(system("convert tmp/5spdq1355475842.ps tmp/5spdq1355475842.png",intern=TRUE))
character(0)
> try(system("convert tmp/6slle1355475842.ps tmp/6slle1355475842.png",intern=TRUE))
character(0)
> try(system("convert tmp/77h0y1355475842.ps tmp/77h0y1355475842.png",intern=TRUE))
character(0)
> try(system("convert tmp/8uer91355475842.ps tmp/8uer91355475842.png",intern=TRUE))
character(0)
> try(system("convert tmp/9o64q1355475843.ps tmp/9o64q1355475843.png",intern=TRUE))
character(0)
> try(system("convert tmp/10wnjy1355475843.ps tmp/10wnjy1355475843.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.517 1.296 9.809