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(100.0,100.0,95.3,100.6,90.7,114.2,88.4,91.5,86.0,94.7,86.0,110.6,95.3,71.3,95.3,104.1,88.4,112.3,86.0,110.2,81.4,112.9,83.7,95.1,95.3,103.1,88.4,101.9,86.0,100.4,83.7,106.9,76.7,100.7,79.1,114.3,86.0,73.3,86.0,105.9,79.1,113.9,76.7,112.1,69.8,117.5,69.8,97.5,76.7,112.3,69.8,106.9,67.4,120.9,65.1,92.7,58.1,110.9,60.5,116.5,65.1,77.1,62.8,113.1,55.8,115.9,51.2,123.5,48.8,123.6,48.8,101.5,53.5,121.0,48.8,112.2,46.5,126.0,44.2,101.8,39.5,117.9,41.9,122.2,48.8,82.7,46.5,120.5,41.9,120.3,39.5,134.2,37.2,128.2,37.2,100.5,41.9,126.0,39.5,122.9,39.5,106.1,34.9,130.4,34.9,121.3,34.9,126.1,41.9,88.7,41.9,118.7,39.5,129.3,39.5,136.2,41.9,123.0,46.5,103.5),dim=c(2,60),dimnames=list(c('Werkloosheid','Productie'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Werkloosheid','Productie'),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
Werkloosheid Productie
1 100.0 100.0
2 95.3 100.6
3 90.7 114.2
4 88.4 91.5
5 86.0 94.7
6 86.0 110.6
7 95.3 71.3
8 95.3 104.1
9 88.4 112.3
10 86.0 110.2
11 81.4 112.9
12 83.7 95.1
13 95.3 103.1
14 88.4 101.9
15 86.0 100.4
16 83.7 106.9
17 76.7 100.7
18 79.1 114.3
19 86.0 73.3
20 86.0 105.9
21 79.1 113.9
22 76.7 112.1
23 69.8 117.5
24 69.8 97.5
25 76.7 112.3
26 69.8 106.9
27 67.4 120.9
28 65.1 92.7
29 58.1 110.9
30 60.5 116.5
31 65.1 77.1
32 62.8 113.1
33 55.8 115.9
34 51.2 123.5
35 48.8 123.6
36 48.8 101.5
37 53.5 121.0
38 48.8 112.2
39 46.5 126.0
40 44.2 101.8
41 39.5 117.9
42 41.9 122.2
43 48.8 82.7
44 46.5 120.5
45 41.9 120.3
46 39.5 134.2
47 37.2 128.2
48 37.2 100.5
49 41.9 126.0
50 39.5 122.9
51 39.5 106.1
52 34.9 130.4
53 34.9 121.3
54 34.9 126.1
55 41.9 88.7
56 41.9 118.7
57 39.5 129.3
58 39.5 136.2
59 41.9 123.0
60 46.5 103.5
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Productie
147.453 -0.767
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-37.523 -12.555 -2.818 15.421 30.835
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 147.4528 18.0328 8.177 3.10e-11 ***
Productie -0.7670 0.1626 -4.717 1.55e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 17.94 on 58 degrees of freedom
Multiple R-squared: 0.2773, Adjusted R-squared: 0.2648
F-statistic: 22.25 on 1 and 58 DF, p-value: 1.548e-05
> 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.0601791254 1.203583e-01 9.398209e-01
[2,] 0.0312021200 6.240424e-02 9.687979e-01
[3,] 0.0101345061 2.026901e-02 9.898655e-01
[4,] 0.0044489497 8.897899e-03 9.955511e-01
[5,] 0.0017206790 3.441358e-03 9.982793e-01
[6,] 0.0008372543 1.674509e-03 9.991627e-01
[7,] 0.0007905573 1.581115e-03 9.992094e-01
[8,] 0.0006357938 1.271588e-03 9.993642e-01
[9,] 0.0005413305 1.082661e-03 9.994587e-01
[10,] 0.0002803047 5.606094e-04 9.997197e-01
[11,] 0.0001778803 3.557605e-04 9.998221e-01
[12,] 0.0001493637 2.987275e-04 9.998506e-01
[13,] 0.0005325851 1.065170e-03 9.994674e-01
[14,] 0.0006797885 1.359577e-03 9.993202e-01
[15,] 0.0005837035 1.167407e-03 9.994163e-01
[16,] 0.0007422485 1.484497e-03 9.992578e-01
[17,] 0.0014885345 2.977069e-03 9.985115e-01
[18,] 0.0038883221 7.776644e-03 9.961117e-01
[19,] 0.0160388911 3.207778e-02 9.839611e-01
[20,] 0.0607043187 1.214086e-01 9.392957e-01
[21,] 0.1439986660 2.879973e-01 8.560013e-01
[22,] 0.3137563332 6.275127e-01 6.862437e-01
[23,] 0.5713373247 8.573254e-01 4.286627e-01
[24,] 0.8177959532 3.644081e-01 1.822040e-01
[25,] 0.9340728121 1.318544e-01 6.592719e-02
[26,] 0.9794448604 4.111028e-02 2.055514e-02
[27,] 0.9959491612 8.101678e-03 4.050839e-03
[28,] 0.9997557434 4.885133e-04 2.442566e-04
[29,] 0.9999736195 5.276098e-05 2.638049e-05
[30,] 0.9999940911 1.181788e-05 5.908939e-06
[31,] 0.9999976975 4.604962e-06 2.302481e-06
[32,] 0.9999990780 1.843989e-06 9.219946e-07
[33,] 0.9999999550 8.997807e-08 4.498904e-08
[34,] 0.9999999851 2.974242e-08 1.487121e-08
[35,] 0.9999999934 1.321936e-08 6.609682e-09
[36,] 0.9999999918 1.635950e-08 8.179748e-09
[37,] 0.9999999825 3.508497e-08 1.754248e-08
[38,] 0.9999999528 9.434363e-08 4.717181e-08
[39,] 0.9999999629 7.427613e-08 3.713806e-08
[40,] 0.9999999799 4.011778e-08 2.005889e-08
[41,] 0.9999999367 1.266312e-07 6.331559e-08
[42,] 0.9999997177 5.646125e-07 2.823062e-07
[43,] 0.9999988180 2.363976e-06 1.181988e-06
[44,] 0.9999983843 3.231305e-06 1.615653e-06
[45,] 0.9999946334 1.073327e-05 5.366637e-06
[46,] 0.9999731357 5.372865e-05 2.686433e-05
[47,] 0.9998988302 2.023395e-04 1.011698e-04
[48,] 0.9996605463 6.789073e-04 3.394537e-04
[49,] 0.9994221903 1.155619e-03 5.778097e-04
[50,] 0.9994579981 1.084004e-03 5.420019e-04
[51,] 0.9998753370 2.493261e-04 1.246630e-04
> postscript(file="/var/www/html/rcomp/tmp/175fb1261238451.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/206cu1261238451.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/3y5xc1261238451.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/4odf51261238451.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/52ux91261238451.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
29.243785 25.003965 30.834704 11.124573 11.178865 23.373626 2.531858
8 9 10 11 12 13 14
27.688346 27.077468 23.066840 20.537648 9.185651 26.921380 19.101021
15 16 17 18 19 20 21
15.550572 18.235852 6.480662 19.311401 -5.234210 19.768885 19.004614
22 23 24 25 26 27 28
15.224075 12.465692 -2.873630 15.377468 4.335852 12.673377 -11.255067
29 30 31 32 33 34 35
-4.296284 2.398726 -23.219738 2.091041 -2.761454 -1.532511 -3.855815
36 37 38 39 40 41 42
-20.805765 -1.149926 -12.599228 -4.315096 -25.175676 -17.527521 -11.829567
43 44 45 46 47 48 49
-35.224728 -8.533409 -13.286803 -5.025974 -11.927770 -33.172732 -8.915096
50 51 52 53 54 55 56
-13.692691 -26.577721 -12.540445 -19.519837 -15.838399 -37.522932 -14.513948
57 58 59 60
-8.784108 -3.492042 -11.215994 -21.571833
> postscript(file="/var/www/html/rcomp/tmp/6t3vj1261238451.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 29.243785 NA
1 25.003965 29.243785
2 30.834704 25.003965
3 11.124573 30.834704
4 11.178865 11.124573
5 23.373626 11.178865
6 2.531858 23.373626
7 27.688346 2.531858
8 27.077468 27.688346
9 23.066840 27.077468
10 20.537648 23.066840
11 9.185651 20.537648
12 26.921380 9.185651
13 19.101021 26.921380
14 15.550572 19.101021
15 18.235852 15.550572
16 6.480662 18.235852
17 19.311401 6.480662
18 -5.234210 19.311401
19 19.768885 -5.234210
20 19.004614 19.768885
21 15.224075 19.004614
22 12.465692 15.224075
23 -2.873630 12.465692
24 15.377468 -2.873630
25 4.335852 15.377468
26 12.673377 4.335852
27 -11.255067 12.673377
28 -4.296284 -11.255067
29 2.398726 -4.296284
30 -23.219738 2.398726
31 2.091041 -23.219738
32 -2.761454 2.091041
33 -1.532511 -2.761454
34 -3.855815 -1.532511
35 -20.805765 -3.855815
36 -1.149926 -20.805765
37 -12.599228 -1.149926
38 -4.315096 -12.599228
39 -25.175676 -4.315096
40 -17.527521 -25.175676
41 -11.829567 -17.527521
42 -35.224728 -11.829567
43 -8.533409 -35.224728
44 -13.286803 -8.533409
45 -5.025974 -13.286803
46 -11.927770 -5.025974
47 -33.172732 -11.927770
48 -8.915096 -33.172732
49 -13.692691 -8.915096
50 -26.577721 -13.692691
51 -12.540445 -26.577721
52 -19.519837 -12.540445
53 -15.838399 -19.519837
54 -37.522932 -15.838399
55 -14.513948 -37.522932
56 -8.784108 -14.513948
57 -3.492042 -8.784108
58 -11.215994 -3.492042
59 -21.571833 -11.215994
60 NA -21.571833
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 25.003965 29.243785
[2,] 30.834704 25.003965
[3,] 11.124573 30.834704
[4,] 11.178865 11.124573
[5,] 23.373626 11.178865
[6,] 2.531858 23.373626
[7,] 27.688346 2.531858
[8,] 27.077468 27.688346
[9,] 23.066840 27.077468
[10,] 20.537648 23.066840
[11,] 9.185651 20.537648
[12,] 26.921380 9.185651
[13,] 19.101021 26.921380
[14,] 15.550572 19.101021
[15,] 18.235852 15.550572
[16,] 6.480662 18.235852
[17,] 19.311401 6.480662
[18,] -5.234210 19.311401
[19,] 19.768885 -5.234210
[20,] 19.004614 19.768885
[21,] 15.224075 19.004614
[22,] 12.465692 15.224075
[23,] -2.873630 12.465692
[24,] 15.377468 -2.873630
[25,] 4.335852 15.377468
[26,] 12.673377 4.335852
[27,] -11.255067 12.673377
[28,] -4.296284 -11.255067
[29,] 2.398726 -4.296284
[30,] -23.219738 2.398726
[31,] 2.091041 -23.219738
[32,] -2.761454 2.091041
[33,] -1.532511 -2.761454
[34,] -3.855815 -1.532511
[35,] -20.805765 -3.855815
[36,] -1.149926 -20.805765
[37,] -12.599228 -1.149926
[38,] -4.315096 -12.599228
[39,] -25.175676 -4.315096
[40,] -17.527521 -25.175676
[41,] -11.829567 -17.527521
[42,] -35.224728 -11.829567
[43,] -8.533409 -35.224728
[44,] -13.286803 -8.533409
[45,] -5.025974 -13.286803
[46,] -11.927770 -5.025974
[47,] -33.172732 -11.927770
[48,] -8.915096 -33.172732
[49,] -13.692691 -8.915096
[50,] -26.577721 -13.692691
[51,] -12.540445 -26.577721
[52,] -19.519837 -12.540445
[53,] -15.838399 -19.519837
[54,] -37.522932 -15.838399
[55,] -14.513948 -37.522932
[56,] -8.784108 -14.513948
[57,] -3.492042 -8.784108
[58,] -11.215994 -3.492042
[59,] -21.571833 -11.215994
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 25.003965 29.243785
2 30.834704 25.003965
3 11.124573 30.834704
4 11.178865 11.124573
5 23.373626 11.178865
6 2.531858 23.373626
7 27.688346 2.531858
8 27.077468 27.688346
9 23.066840 27.077468
10 20.537648 23.066840
11 9.185651 20.537648
12 26.921380 9.185651
13 19.101021 26.921380
14 15.550572 19.101021
15 18.235852 15.550572
16 6.480662 18.235852
17 19.311401 6.480662
18 -5.234210 19.311401
19 19.768885 -5.234210
20 19.004614 19.768885
21 15.224075 19.004614
22 12.465692 15.224075
23 -2.873630 12.465692
24 15.377468 -2.873630
25 4.335852 15.377468
26 12.673377 4.335852
27 -11.255067 12.673377
28 -4.296284 -11.255067
29 2.398726 -4.296284
30 -23.219738 2.398726
31 2.091041 -23.219738
32 -2.761454 2.091041
33 -1.532511 -2.761454
34 -3.855815 -1.532511
35 -20.805765 -3.855815
36 -1.149926 -20.805765
37 -12.599228 -1.149926
38 -4.315096 -12.599228
39 -25.175676 -4.315096
40 -17.527521 -25.175676
41 -11.829567 -17.527521
42 -35.224728 -11.829567
43 -8.533409 -35.224728
44 -13.286803 -8.533409
45 -5.025974 -13.286803
46 -11.927770 -5.025974
47 -33.172732 -11.927770
48 -8.915096 -33.172732
49 -13.692691 -8.915096
50 -26.577721 -13.692691
51 -12.540445 -26.577721
52 -19.519837 -12.540445
53 -15.838399 -19.519837
54 -37.522932 -15.838399
55 -14.513948 -37.522932
56 -8.784108 -14.513948
57 -3.492042 -8.784108
58 -11.215994 -3.492042
59 -21.571833 -11.215994
> 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/7catn1261238451.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/8ibey1261238451.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/9uo4i1261238451.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/10dofm1261238451.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/11sfdq1261238451.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/12xkgh1261238451.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/13kk0w1261238451.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/14m5gl1261238451.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/15sg1z1261238451.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/1677kv1261238451.tab")
+ }
>
> try(system("convert tmp/175fb1261238451.ps tmp/175fb1261238451.png",intern=TRUE))
character(0)
> try(system("convert tmp/206cu1261238451.ps tmp/206cu1261238451.png",intern=TRUE))
character(0)
> try(system("convert tmp/3y5xc1261238451.ps tmp/3y5xc1261238451.png",intern=TRUE))
character(0)
> try(system("convert tmp/4odf51261238451.ps tmp/4odf51261238451.png",intern=TRUE))
character(0)
> try(system("convert tmp/52ux91261238451.ps tmp/52ux91261238451.png",intern=TRUE))
character(0)
> try(system("convert tmp/6t3vj1261238451.ps tmp/6t3vj1261238451.png",intern=TRUE))
character(0)
> try(system("convert tmp/7catn1261238451.ps tmp/7catn1261238451.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ibey1261238451.ps tmp/8ibey1261238451.png",intern=TRUE))
character(0)
> try(system("convert tmp/9uo4i1261238451.ps tmp/9uo4i1261238451.png",intern=TRUE))
character(0)
> try(system("convert tmp/10dofm1261238451.ps tmp/10dofm1261238451.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.450 1.571 3.023