R version 2.12.1 (2010-12-16)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-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(15,40,0,16,42,0,15,38,0,14,34,0,13,32,0,16,40,0,18,50,0,14,25,0,11,16,0,10,12,0,9,4,0,11,7,0,13,16,0,18,50,0,21,60,1,15,35,0,14,32,0,15,33,0,16,39,0,15,33,0,16,35,0,17,40,0,14,25,0,13,19,0,12,12,0,15,19,0,16,25,0,18,29,0,19,41,0,17,50,1,18,70,1,18,65,1,18,50,1,19,45,0,20,62,1,22,82,1,21,62,1,20,42,0,18,39,0,17,35,0,16,30,0,19,40,0,21,45,0,20,42,0,20,41,0,21,45,0,20,43,0,19,30,0,16,20,0,18,25,0,19,27,0,21,38,1,22,40,1,25,60,1,24,61,1,23,55,1,22,43,1,21,34,1,20,20,0,22,38,1),dim=c(3,60),dimnames=list(c('Gem_Graden','Gem_Fietsers','Geslacht
'),1:60))
> y <- array(NA,dim=c(3,60),dimnames=list(c('Gem_Graden','Gem_Fietsers','Geslacht
'),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
> 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
Gem_Graden Gem_Fietsers Geslacht\r
1 15 40 0
2 16 42 0
3 15 38 0
4 14 34 0
5 13 32 0
6 16 40 0
7 18 50 0
8 14 25 0
9 11 16 0
10 10 12 0
11 9 4 0
12 11 7 0
13 13 16 0
14 18 50 0
15 21 60 1
16 15 35 0
17 14 32 0
18 15 33 0
19 16 39 0
20 15 33 0
21 16 35 0
22 17 40 0
23 14 25 0
24 13 19 0
25 12 12 0
26 15 19 0
27 16 25 0
28 18 29 0
29 19 41 0
30 17 50 1
31 18 70 1
32 18 65 1
33 18 50 1
34 19 45 0
35 20 62 1
36 22 82 1
37 21 62 1
38 20 42 0
39 18 39 0
40 17 35 0
41 16 30 0
42 19 40 0
43 21 45 0
44 20 42 0
45 20 41 0
46 21 45 0
47 20 43 0
48 19 30 0
49 16 20 0
50 18 25 0
51 19 27 0
52 21 38 1
53 22 40 1
54 25 60 1
55 24 61 1
56 23 55 1
57 22 43 1
58 21 34 1
59 20 20 0
60 22 38 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Gem_Fietsers `Geslacht\r`
12.1343 0.1272 1.8856
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-4.9253 -1.7226 -0.4953 2.2635 5.3213
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 12.1343 0.9150 13.261 < 2e-16 ***
Gem_Fietsers 0.1272 0.0265 4.800 1.18e-05 ***
`Geslacht\r` 1.8856 0.9309 2.025 0.0475 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.43 on 57 degrees of freedom
Multiple R-squared: 0.5454, Adjusted R-squared: 0.5295
F-statistic: 34.2 on 2 and 57 DF, p-value: 1.743e-10
> 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,] 8.423263e-03 1.684653e-02 0.991576737
[2,] 1.437000e-03 2.874000e-03 0.998563000
[3,] 1.327082e-02 2.654164e-02 0.986729180
[4,] 4.470226e-03 8.940451e-03 0.995529774
[5,] 1.625542e-03 3.251084e-03 0.998374458
[6,] 6.622335e-04 1.324467e-03 0.999337766
[7,] 1.219720e-03 2.439441e-03 0.998780280
[8,] 1.984885e-03 3.969770e-03 0.998015115
[9,] 9.343251e-04 1.868650e-03 0.999065675
[10,] 3.326380e-04 6.652760e-04 0.999667362
[11,] 1.340260e-04 2.680520e-04 0.999865974
[12,] 6.442103e-05 1.288421e-04 0.999935579
[13,] 3.094998e-05 6.189996e-05 0.999969050
[14,] 1.334958e-05 2.669915e-05 0.999986650
[15,] 6.505809e-06 1.301162e-05 0.999993494
[16,] 5.661548e-06 1.132310e-05 0.999994338
[17,] 4.817571e-06 9.635141e-06 0.999995182
[18,] 3.826895e-06 7.653790e-06 0.999996173
[19,] 4.534304e-06 9.068608e-06 0.999995466
[20,] 1.400727e-05 2.801455e-05 0.999985993
[21,] 2.692762e-04 5.385525e-04 0.999730724
[22,] 1.396293e-03 2.792585e-03 0.998603707
[23,] 1.325032e-02 2.650064e-02 0.986749678
[24,] 2.028670e-02 4.057340e-02 0.979713300
[25,] 4.192603e-02 8.385206e-02 0.958073972
[26,] 1.321450e-01 2.642901e-01 0.867854961
[27,] 2.646862e-01 5.293725e-01 0.735313774
[28,] 4.571945e-01 9.143890e-01 0.542805514
[29,] 4.392743e-01 8.785485e-01 0.560725727
[30,] 5.434928e-01 9.130144e-01 0.456507222
[31,] 6.534362e-01 6.931275e-01 0.346563762
[32,] 8.462475e-01 3.075049e-01 0.153752474
[33,] 8.739235e-01 2.521530e-01 0.126076483
[34,] 8.836725e-01 2.326550e-01 0.116327506
[35,] 9.300687e-01 1.398626e-01 0.069931289
[36,] 9.889929e-01 2.201425e-02 0.011007124
[37,] 9.906357e-01 1.872852e-02 0.009364262
[38,] 9.899534e-01 2.009313e-02 0.010046564
[39,] 9.862485e-01 2.750297e-02 0.013751484
[40,] 9.805731e-01 3.885387e-02 0.019426936
[41,] 9.724850e-01 5.503003e-02 0.027515015
[42,] 9.587359e-01 8.252822e-02 0.041264112
[43,] 9.452601e-01 1.094798e-01 0.054739885
[44,] 9.877727e-01 2.445455e-02 0.012227276
[45,] 9.938603e-01 1.227935e-02 0.006139674
[46,] 9.979978e-01 4.004340e-03 0.002002170
[47,] 9.969653e-01 6.069482e-03 0.003034741
[48,] 9.904869e-01 1.902628e-02 0.009513140
[49,] 9.960411e-01 7.917717e-03 0.003958858
> postscript(file="/var/www/rcomp/tmp/1u5b61321889189.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/www/rcomp/tmp/2gf5o1321889189.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/www/rcomp/tmp/3qv8b1321889189.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/www/rcomp/tmp/474731321889189.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/www/rcomp/tmp/54vt21321889189.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 = 60
Frequency = 1
1 2 3 4 5 6
-2.22312161 -1.47756373 -1.96867948 -2.45979524 -3.20535311 -1.22312161
7 8 9 10 11 12
-0.49533222 -1.31480568 -3.16981613 -3.66093188 -3.64316339 -2.02482657
13 14 15 16 17 18
-1.16981613 -0.49533222 -0.65311847 -1.58701630 -2.20535311 -1.33257418
19 20 21 22 23 24
-1.09590055 -1.33257418 -0.58701630 -0.22312161 -1.31480568 -1.55147931
25 26 27 28 29 30
-1.66093188 0.44852069 0.68519432 2.17631007 1.64965733 -3.38090786
31 32 33 34 35 36
-4.92532909 -4.28922378 -2.38090786 1.14077308 -1.90756060 -2.45198183
37 38 39 40 41 42
-0.90756060 2.52243627 0.90409945 0.41298370 0.04908901 1.77687839
43 44 45 46 47 48
3.14077308 2.52243627 2.64965733 3.14077308 2.39521521 3.04908901
49 50 51 52 53 54
1.32129963 2.68519432 3.43075220 2.14574488 2.89130276 3.34688153
55 56 57 58 59 60
2.21966047 1.98298684 2.50963958 2.65462913 5.32129963 3.14574488
> postscript(file="/var/www/rcomp/tmp/6ea2z1321889189.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 -2.22312161 NA
1 -1.47756373 -2.22312161
2 -1.96867948 -1.47756373
3 -2.45979524 -1.96867948
4 -3.20535311 -2.45979524
5 -1.22312161 -3.20535311
6 -0.49533222 -1.22312161
7 -1.31480568 -0.49533222
8 -3.16981613 -1.31480568
9 -3.66093188 -3.16981613
10 -3.64316339 -3.66093188
11 -2.02482657 -3.64316339
12 -1.16981613 -2.02482657
13 -0.49533222 -1.16981613
14 -0.65311847 -0.49533222
15 -1.58701630 -0.65311847
16 -2.20535311 -1.58701630
17 -1.33257418 -2.20535311
18 -1.09590055 -1.33257418
19 -1.33257418 -1.09590055
20 -0.58701630 -1.33257418
21 -0.22312161 -0.58701630
22 -1.31480568 -0.22312161
23 -1.55147931 -1.31480568
24 -1.66093188 -1.55147931
25 0.44852069 -1.66093188
26 0.68519432 0.44852069
27 2.17631007 0.68519432
28 1.64965733 2.17631007
29 -3.38090786 1.64965733
30 -4.92532909 -3.38090786
31 -4.28922378 -4.92532909
32 -2.38090786 -4.28922378
33 1.14077308 -2.38090786
34 -1.90756060 1.14077308
35 -2.45198183 -1.90756060
36 -0.90756060 -2.45198183
37 2.52243627 -0.90756060
38 0.90409945 2.52243627
39 0.41298370 0.90409945
40 0.04908901 0.41298370
41 1.77687839 0.04908901
42 3.14077308 1.77687839
43 2.52243627 3.14077308
44 2.64965733 2.52243627
45 3.14077308 2.64965733
46 2.39521521 3.14077308
47 3.04908901 2.39521521
48 1.32129963 3.04908901
49 2.68519432 1.32129963
50 3.43075220 2.68519432
51 2.14574488 3.43075220
52 2.89130276 2.14574488
53 3.34688153 2.89130276
54 2.21966047 3.34688153
55 1.98298684 2.21966047
56 2.50963958 1.98298684
57 2.65462913 2.50963958
58 5.32129963 2.65462913
59 3.14574488 5.32129963
60 NA 3.14574488
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.47756373 -2.22312161
[2,] -1.96867948 -1.47756373
[3,] -2.45979524 -1.96867948
[4,] -3.20535311 -2.45979524
[5,] -1.22312161 -3.20535311
[6,] -0.49533222 -1.22312161
[7,] -1.31480568 -0.49533222
[8,] -3.16981613 -1.31480568
[9,] -3.66093188 -3.16981613
[10,] -3.64316339 -3.66093188
[11,] -2.02482657 -3.64316339
[12,] -1.16981613 -2.02482657
[13,] -0.49533222 -1.16981613
[14,] -0.65311847 -0.49533222
[15,] -1.58701630 -0.65311847
[16,] -2.20535311 -1.58701630
[17,] -1.33257418 -2.20535311
[18,] -1.09590055 -1.33257418
[19,] -1.33257418 -1.09590055
[20,] -0.58701630 -1.33257418
[21,] -0.22312161 -0.58701630
[22,] -1.31480568 -0.22312161
[23,] -1.55147931 -1.31480568
[24,] -1.66093188 -1.55147931
[25,] 0.44852069 -1.66093188
[26,] 0.68519432 0.44852069
[27,] 2.17631007 0.68519432
[28,] 1.64965733 2.17631007
[29,] -3.38090786 1.64965733
[30,] -4.92532909 -3.38090786
[31,] -4.28922378 -4.92532909
[32,] -2.38090786 -4.28922378
[33,] 1.14077308 -2.38090786
[34,] -1.90756060 1.14077308
[35,] -2.45198183 -1.90756060
[36,] -0.90756060 -2.45198183
[37,] 2.52243627 -0.90756060
[38,] 0.90409945 2.52243627
[39,] 0.41298370 0.90409945
[40,] 0.04908901 0.41298370
[41,] 1.77687839 0.04908901
[42,] 3.14077308 1.77687839
[43,] 2.52243627 3.14077308
[44,] 2.64965733 2.52243627
[45,] 3.14077308 2.64965733
[46,] 2.39521521 3.14077308
[47,] 3.04908901 2.39521521
[48,] 1.32129963 3.04908901
[49,] 2.68519432 1.32129963
[50,] 3.43075220 2.68519432
[51,] 2.14574488 3.43075220
[52,] 2.89130276 2.14574488
[53,] 3.34688153 2.89130276
[54,] 2.21966047 3.34688153
[55,] 1.98298684 2.21966047
[56,] 2.50963958 1.98298684
[57,] 2.65462913 2.50963958
[58,] 5.32129963 2.65462913
[59,] 3.14574488 5.32129963
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.47756373 -2.22312161
2 -1.96867948 -1.47756373
3 -2.45979524 -1.96867948
4 -3.20535311 -2.45979524
5 -1.22312161 -3.20535311
6 -0.49533222 -1.22312161
7 -1.31480568 -0.49533222
8 -3.16981613 -1.31480568
9 -3.66093188 -3.16981613
10 -3.64316339 -3.66093188
11 -2.02482657 -3.64316339
12 -1.16981613 -2.02482657
13 -0.49533222 -1.16981613
14 -0.65311847 -0.49533222
15 -1.58701630 -0.65311847
16 -2.20535311 -1.58701630
17 -1.33257418 -2.20535311
18 -1.09590055 -1.33257418
19 -1.33257418 -1.09590055
20 -0.58701630 -1.33257418
21 -0.22312161 -0.58701630
22 -1.31480568 -0.22312161
23 -1.55147931 -1.31480568
24 -1.66093188 -1.55147931
25 0.44852069 -1.66093188
26 0.68519432 0.44852069
27 2.17631007 0.68519432
28 1.64965733 2.17631007
29 -3.38090786 1.64965733
30 -4.92532909 -3.38090786
31 -4.28922378 -4.92532909
32 -2.38090786 -4.28922378
33 1.14077308 -2.38090786
34 -1.90756060 1.14077308
35 -2.45198183 -1.90756060
36 -0.90756060 -2.45198183
37 2.52243627 -0.90756060
38 0.90409945 2.52243627
39 0.41298370 0.90409945
40 0.04908901 0.41298370
41 1.77687839 0.04908901
42 3.14077308 1.77687839
43 2.52243627 3.14077308
44 2.64965733 2.52243627
45 3.14077308 2.64965733
46 2.39521521 3.14077308
47 3.04908901 2.39521521
48 1.32129963 3.04908901
49 2.68519432 1.32129963
50 3.43075220 2.68519432
51 2.14574488 3.43075220
52 2.89130276 2.14574488
53 3.34688153 2.89130276
54 2.21966047 3.34688153
55 1.98298684 2.21966047
56 2.50963958 1.98298684
57 2.65462913 2.50963958
58 5.32129963 2.65462913
59 3.14574488 5.32129963
> 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/rcomp/tmp/755c21321889189.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/www/rcomp/tmp/88it21321889189.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/www/rcomp/tmp/9o5951321889189.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/www/rcomp/tmp/10keta1321889189.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/1192lg1321889189.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/rcomp/tmp/126skb1321889189.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/rcomp/tmp/13ode21321889189.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/rcomp/tmp/14og2t1321889190.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/rcomp/tmp/15mfwv1321889190.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/rcomp/tmp/16xqxm1321889190.tab")
+ }
>
> try(system("convert tmp/1u5b61321889189.ps tmp/1u5b61321889189.png",intern=TRUE))
character(0)
> try(system("convert tmp/2gf5o1321889189.ps tmp/2gf5o1321889189.png",intern=TRUE))
character(0)
> try(system("convert tmp/3qv8b1321889189.ps tmp/3qv8b1321889189.png",intern=TRUE))
character(0)
> try(system("convert tmp/474731321889189.ps tmp/474731321889189.png",intern=TRUE))
character(0)
> try(system("convert tmp/54vt21321889189.ps tmp/54vt21321889189.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ea2z1321889189.ps tmp/6ea2z1321889189.png",intern=TRUE))
character(0)
> try(system("convert tmp/755c21321889189.ps tmp/755c21321889189.png",intern=TRUE))
character(0)
> try(system("convert tmp/88it21321889189.ps tmp/88it21321889189.png",intern=TRUE))
character(0)
> try(system("convert tmp/9o5951321889189.ps tmp/9o5951321889189.png",intern=TRUE))
character(0)
> try(system("convert tmp/10keta1321889189.ps tmp/10keta1321889189.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.148 0.620 4.756