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(101.3,0,106.3,0,94,0,102.8,0,102,0,105.1,1,92.4,0,81.4,0,105.8,0,120.3,1,100.7,0,88.8,0,94.3,0,99.9,0,103.4,0,103.3,0,98.8,0,104.2,0,91.2,0,74.7,0,108.5,0,114.5,0,96.9,0,89.6,0,97.1,0,100.3,0,122.6,0,115.4,1,109,0,129.1,1,102.8,1,96.2,0,127.7,1,128.9,1,126.5,1,119.8,1,113.2,1,114.1,1,134.1,1,130,1,121.8,1,132.1,1,105.3,1,103,1,117.1,1,126.3,1,138.1,1,119.5,1,138,1,135.5,1,178.6,1,162.2,1,176.9,1,204.9,1,132.2,1,142.5,1,164.3,1,174.9,1,175.4,1,143,1),dim=c(2,60),dimnames=list(c('Omzet','Uitvoer'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Omzet','Uitvoer'),1:60))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par20 = ''
> par19 = ''
> par18 = ''
> par17 = ''
> par16 = ''
> par15 = ''
> par14 = ''
> par13 = ''
> par12 = ''
> par11 = ''
> par10 = ''
> par9 = ''
> par8 = ''
> par7 = ''
> par6 = ''
> par5 = ''
> par4 = ''
> par3 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> ylab = ''
> xlab = ''
> main = ''
> #'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
Omzet Uitvoer t
1 101.3 0 1
2 106.3 0 2
3 94.0 0 3
4 102.8 0 4
5 102.0 0 5
6 105.1 1 6
7 92.4 0 7
8 81.4 0 8
9 105.8 0 9
10 120.3 1 10
11 100.7 0 11
12 88.8 0 12
13 94.3 0 13
14 99.9 0 14
15 103.4 0 15
16 103.3 0 16
17 98.8 0 17
18 104.2 0 18
19 91.2 0 19
20 74.7 0 20
21 108.5 0 21
22 114.5 0 22
23 96.9 0 23
24 89.6 0 24
25 97.1 0 25
26 100.3 0 26
27 122.6 0 27
28 115.4 1 28
29 109.0 0 29
30 129.1 1 30
31 102.8 1 31
32 96.2 0 32
33 127.7 1 33
34 128.9 1 34
35 126.5 1 35
36 119.8 1 36
37 113.2 1 37
38 114.1 1 38
39 134.1 1 39
40 130.0 1 40
41 121.8 1 41
42 132.1 1 42
43 105.3 1 43
44 103.0 1 44
45 117.1 1 45
46 126.3 1 46
47 138.1 1 47
48 119.5 1 48
49 138.0 1 49
50 135.5 1 50
51 178.6 1 51
52 162.2 1 52
53 176.9 1 53
54 204.9 1 54
55 132.2 1 55
56 142.5 1 56
57 164.3 1 57
58 174.9 1 58
59 175.4 1 59
60 143.0 1 60
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Uitvoer t
84.5369 10.5057 0.9397
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-33.391 -10.724 -1.573 7.305 59.112
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 84.5369 4.5007 18.783 < 2e-16 ***
Uitvoer 10.5057 6.9248 1.517 0.135
t 0.9397 0.1989 4.724 1.55e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 16.87 on 57 degrees of freedom
Multiple R-squared: 0.6106, Adjusted R-squared: 0.5969
F-statistic: 44.68 on 2 and 57 DF, p-value: 2.127e-12
> 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,] 3.691879e-02 7.383757e-02 0.9630812
[2,] 1.456787e-02 2.913573e-02 0.9854321
[3,] 1.355094e-02 2.710189e-02 0.9864491
[4,] 4.068027e-02 8.136054e-02 0.9593197
[5,] 5.273574e-02 1.054715e-01 0.9472643
[6,] 2.944439e-02 5.888878e-02 0.9705556
[7,] 1.752343e-02 3.504685e-02 0.9824766
[8,] 8.064091e-03 1.612818e-02 0.9919359
[9,] 4.449411e-03 8.898822e-03 0.9955506
[10,] 2.939034e-03 5.878068e-03 0.9970610
[11,] 1.675591e-03 3.351181e-03 0.9983244
[12,] 7.222052e-04 1.444410e-03 0.9992778
[13,] 3.883523e-04 7.767045e-04 0.9996116
[14,] 2.372564e-04 4.745127e-04 0.9997627
[15,] 1.626379e-03 3.252757e-03 0.9983736
[16,] 1.941375e-03 3.882749e-03 0.9980586
[17,] 3.553779e-03 7.107558e-03 0.9964462
[18,] 1.823884e-03 3.647768e-03 0.9981761
[19,] 1.215973e-03 2.431946e-03 0.9987840
[20,] 5.873758e-04 1.174752e-03 0.9994126
[21,] 2.826820e-04 5.653641e-04 0.9997173
[22,] 1.309707e-03 2.619415e-03 0.9986903
[23,] 7.060938e-04 1.412188e-03 0.9992939
[24,] 4.631170e-04 9.262340e-04 0.9995369
[25,] 4.840558e-04 9.681116e-04 0.9995159
[26,] 5.249105e-04 1.049821e-03 0.9994751
[27,] 2.853287e-04 5.706574e-04 0.9997147
[28,] 2.474771e-04 4.949543e-04 0.9997525
[29,] 2.184011e-04 4.368021e-04 0.9997816
[30,] 1.534551e-04 3.069102e-04 0.9998465
[31,] 8.076973e-05 1.615395e-04 0.9999192
[32,] 4.504718e-05 9.009436e-05 0.9999550
[33,] 2.246597e-05 4.493193e-05 0.9999775
[34,] 2.766718e-05 5.533437e-05 0.9999723
[35,] 2.031504e-05 4.063007e-05 0.9999797
[36,] 9.186718e-06 1.837344e-05 0.9999908
[37,] 7.299527e-06 1.459905e-05 0.9999927
[38,] 1.038770e-05 2.077540e-05 0.9999896
[39,] 2.416905e-05 4.833810e-05 0.9999758
[40,] 1.475228e-05 2.950456e-05 0.9999852
[41,] 7.806384e-06 1.561277e-05 0.9999922
[42,] 5.775823e-06 1.155165e-05 0.9999942
[43,] 1.312565e-05 2.625129e-05 0.9999869
[44,] 2.076773e-05 4.153546e-05 0.9999792
[45,] 1.400460e-04 2.800921e-04 0.9998600
[46,] 1.943101e-03 3.886202e-03 0.9980569
[47,] 2.345610e-03 4.691220e-03 0.9976544
[48,] 3.215171e-03 6.430343e-03 0.9967848
[49,] 2.021064e-01 4.042128e-01 0.7978936
> postscript(file="/var/www/html/rcomp/tmp/1ifd21258567555.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/2gc781258567555.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/3lfn21258567555.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/4rajp1258567555.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/5mllt1258567555.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
15.823379 19.883654 6.643928 14.504203 12.764478 4.419029 1.285027
8 9 10 11 12 13 14
-10.654698 12.805576 15.860127 5.826126 -7.013600 -2.453325 2.206950
15 16 17 18 19 20 21
4.767224 3.727499 -1.712226 2.748048 -11.191677 -28.631402 4.228872
22 23 24 25 26 27 28
9.289147 -9.250578 -17.490304 -10.930029 -8.669755 12.690520 -5.954929
29 30 31 32 33 34 35
-2.788931 5.865620 -21.374105 -18.408107 1.646444 1.906719 -1.433006
36 37 38 39 40 41 42
-9.072732 -16.612457 -16.652182 2.408092 -2.631633 -11.771359 -2.411084
43 44 45 46 47 48 49
-30.150809 -33.390535 -20.230260 -11.969985 -1.109711 -20.649436 -3.089161
50 51 52 53 54 55 56
-6.528887 35.631388 18.291663 32.051937 59.112212 -14.527513 -5.167239
57 58 59 60
15.693036 25.353311 24.913585 -8.426140
> postscript(file="/var/www/html/rcomp/tmp/6cm921258567555.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 15.823379 NA
1 19.883654 15.823379
2 6.643928 19.883654
3 14.504203 6.643928
4 12.764478 14.504203
5 4.419029 12.764478
6 1.285027 4.419029
7 -10.654698 1.285027
8 12.805576 -10.654698
9 15.860127 12.805576
10 5.826126 15.860127
11 -7.013600 5.826126
12 -2.453325 -7.013600
13 2.206950 -2.453325
14 4.767224 2.206950
15 3.727499 4.767224
16 -1.712226 3.727499
17 2.748048 -1.712226
18 -11.191677 2.748048
19 -28.631402 -11.191677
20 4.228872 -28.631402
21 9.289147 4.228872
22 -9.250578 9.289147
23 -17.490304 -9.250578
24 -10.930029 -17.490304
25 -8.669755 -10.930029
26 12.690520 -8.669755
27 -5.954929 12.690520
28 -2.788931 -5.954929
29 5.865620 -2.788931
30 -21.374105 5.865620
31 -18.408107 -21.374105
32 1.646444 -18.408107
33 1.906719 1.646444
34 -1.433006 1.906719
35 -9.072732 -1.433006
36 -16.612457 -9.072732
37 -16.652182 -16.612457
38 2.408092 -16.652182
39 -2.631633 2.408092
40 -11.771359 -2.631633
41 -2.411084 -11.771359
42 -30.150809 -2.411084
43 -33.390535 -30.150809
44 -20.230260 -33.390535
45 -11.969985 -20.230260
46 -1.109711 -11.969985
47 -20.649436 -1.109711
48 -3.089161 -20.649436
49 -6.528887 -3.089161
50 35.631388 -6.528887
51 18.291663 35.631388
52 32.051937 18.291663
53 59.112212 32.051937
54 -14.527513 59.112212
55 -5.167239 -14.527513
56 15.693036 -5.167239
57 25.353311 15.693036
58 24.913585 25.353311
59 -8.426140 24.913585
60 NA -8.426140
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 19.883654 15.823379
[2,] 6.643928 19.883654
[3,] 14.504203 6.643928
[4,] 12.764478 14.504203
[5,] 4.419029 12.764478
[6,] 1.285027 4.419029
[7,] -10.654698 1.285027
[8,] 12.805576 -10.654698
[9,] 15.860127 12.805576
[10,] 5.826126 15.860127
[11,] -7.013600 5.826126
[12,] -2.453325 -7.013600
[13,] 2.206950 -2.453325
[14,] 4.767224 2.206950
[15,] 3.727499 4.767224
[16,] -1.712226 3.727499
[17,] 2.748048 -1.712226
[18,] -11.191677 2.748048
[19,] -28.631402 -11.191677
[20,] 4.228872 -28.631402
[21,] 9.289147 4.228872
[22,] -9.250578 9.289147
[23,] -17.490304 -9.250578
[24,] -10.930029 -17.490304
[25,] -8.669755 -10.930029
[26,] 12.690520 -8.669755
[27,] -5.954929 12.690520
[28,] -2.788931 -5.954929
[29,] 5.865620 -2.788931
[30,] -21.374105 5.865620
[31,] -18.408107 -21.374105
[32,] 1.646444 -18.408107
[33,] 1.906719 1.646444
[34,] -1.433006 1.906719
[35,] -9.072732 -1.433006
[36,] -16.612457 -9.072732
[37,] -16.652182 -16.612457
[38,] 2.408092 -16.652182
[39,] -2.631633 2.408092
[40,] -11.771359 -2.631633
[41,] -2.411084 -11.771359
[42,] -30.150809 -2.411084
[43,] -33.390535 -30.150809
[44,] -20.230260 -33.390535
[45,] -11.969985 -20.230260
[46,] -1.109711 -11.969985
[47,] -20.649436 -1.109711
[48,] -3.089161 -20.649436
[49,] -6.528887 -3.089161
[50,] 35.631388 -6.528887
[51,] 18.291663 35.631388
[52,] 32.051937 18.291663
[53,] 59.112212 32.051937
[54,] -14.527513 59.112212
[55,] -5.167239 -14.527513
[56,] 15.693036 -5.167239
[57,] 25.353311 15.693036
[58,] 24.913585 25.353311
[59,] -8.426140 24.913585
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 19.883654 15.823379
2 6.643928 19.883654
3 14.504203 6.643928
4 12.764478 14.504203
5 4.419029 12.764478
6 1.285027 4.419029
7 -10.654698 1.285027
8 12.805576 -10.654698
9 15.860127 12.805576
10 5.826126 15.860127
11 -7.013600 5.826126
12 -2.453325 -7.013600
13 2.206950 -2.453325
14 4.767224 2.206950
15 3.727499 4.767224
16 -1.712226 3.727499
17 2.748048 -1.712226
18 -11.191677 2.748048
19 -28.631402 -11.191677
20 4.228872 -28.631402
21 9.289147 4.228872
22 -9.250578 9.289147
23 -17.490304 -9.250578
24 -10.930029 -17.490304
25 -8.669755 -10.930029
26 12.690520 -8.669755
27 -5.954929 12.690520
28 -2.788931 -5.954929
29 5.865620 -2.788931
30 -21.374105 5.865620
31 -18.408107 -21.374105
32 1.646444 -18.408107
33 1.906719 1.646444
34 -1.433006 1.906719
35 -9.072732 -1.433006
36 -16.612457 -9.072732
37 -16.652182 -16.612457
38 2.408092 -16.652182
39 -2.631633 2.408092
40 -11.771359 -2.631633
41 -2.411084 -11.771359
42 -30.150809 -2.411084
43 -33.390535 -30.150809
44 -20.230260 -33.390535
45 -11.969985 -20.230260
46 -1.109711 -11.969985
47 -20.649436 -1.109711
48 -3.089161 -20.649436
49 -6.528887 -3.089161
50 35.631388 -6.528887
51 18.291663 35.631388
52 32.051937 18.291663
53 59.112212 32.051937
54 -14.527513 59.112212
55 -5.167239 -14.527513
56 15.693036 -5.167239
57 25.353311 15.693036
58 24.913585 25.353311
59 -8.426140 24.913585
> 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/7x9q41258567555.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/8j9uy1258567555.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/9gqhx1258567555.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/10ienq1258567555.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/11149q1258567555.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/12bi6s1258567555.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/13nd3i1258567555.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/14zf7x1258567555.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/15s5ow1258567555.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/16gfau1258567555.tab")
+ }
>
> system("convert tmp/1ifd21258567555.ps tmp/1ifd21258567555.png")
> system("convert tmp/2gc781258567555.ps tmp/2gc781258567555.png")
> system("convert tmp/3lfn21258567555.ps tmp/3lfn21258567555.png")
> system("convert tmp/4rajp1258567555.ps tmp/4rajp1258567555.png")
> system("convert tmp/5mllt1258567555.ps tmp/5mllt1258567555.png")
> system("convert tmp/6cm921258567555.ps tmp/6cm921258567555.png")
> system("convert tmp/7x9q41258567555.ps tmp/7x9q41258567555.png")
> system("convert tmp/8j9uy1258567555.ps tmp/8j9uy1258567555.png")
> system("convert tmp/9gqhx1258567555.ps tmp/9gqhx1258567555.png")
> system("convert tmp/10ienq1258567555.ps tmp/10ienq1258567555.png")
>
>
> proc.time()
user system elapsed
2.497 1.567 2.943