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(8.4,1.8,8.4,1.6,8.4,1.9,8.6,1.7,8.9,1.6,8.8,1.3,8.3,1.1,7.5,1.9,7.2,2.6,7.4,2.3,8.8,2.4,9.3,2.2,9.3,2,8.7,2.9,8.2,2.6,8.3,2.3,8.5,2.3,8.6,2.6,8.5,3.1,8.2,2.8,8.1,2.5,7.9,2.9,8.6,3.1,8.7,3.1,8.7,3.2,8.5,2.5,8.4,2.6,8.5,2.9,8.7,2.6,8.7,2.4,8.6,1.7,8.5,2,8.3,2.2,8,1.9,8.2,1.6,8.1,1.6,8.1,1.2,8,1.2,7.9,1.5,7.9,1.6,8,1.7,8,1.8,7.9,1.8,8,1.8,7.7,1.3,7.2,1.3,7.5,1.4,7.3,1.1,7,1.5,7,2.2,7,2.9,7.2,3.1,7.3,3.5,7.1,3.6,6.8,4.4,6.4,4.2,6.1,5.2,6.5,5.8,7.7,5.9,7.9,5.4,7.5,5.5),dim=c(2,61),dimnames=list(c('Wkz','Ncp'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Wkz','Ncp'),1:61))
> 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
Wkz Ncp
1 8.4 1.8
2 8.4 1.6
3 8.4 1.9
4 8.6 1.7
5 8.9 1.6
6 8.8 1.3
7 8.3 1.1
8 7.5 1.9
9 7.2 2.6
10 7.4 2.3
11 8.8 2.4
12 9.3 2.2
13 9.3 2.0
14 8.7 2.9
15 8.2 2.6
16 8.3 2.3
17 8.5 2.3
18 8.6 2.6
19 8.5 3.1
20 8.2 2.8
21 8.1 2.5
22 7.9 2.9
23 8.6 3.1
24 8.7 3.1
25 8.7 3.2
26 8.5 2.5
27 8.4 2.6
28 8.5 2.9
29 8.7 2.6
30 8.7 2.4
31 8.6 1.7
32 8.5 2.0
33 8.3 2.2
34 8.0 1.9
35 8.2 1.6
36 8.1 1.6
37 8.1 1.2
38 8.0 1.2
39 7.9 1.5
40 7.9 1.6
41 8.0 1.7
42 8.0 1.8
43 7.9 1.8
44 8.0 1.8
45 7.7 1.3
46 7.2 1.3
47 7.5 1.4
48 7.3 1.1
49 7.0 1.5
50 7.0 2.2
51 7.0 2.9
52 7.2 3.1
53 7.3 3.5
54 7.1 3.6
55 6.8 4.4
56 6.4 4.2
57 6.1 5.2
58 6.5 5.8
59 7.7 5.9
60 7.9 5.4
61 7.5 5.5
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Ncp
8.5847 -0.2349
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.2633 -0.5793 0.1025 0.5025 1.2320
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.58467 0.19695 43.589 < 2e-16 ***
Ncp -0.23487 0.07129 -3.295 0.00167 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.6507 on 59 degrees of freedom
Multiple R-squared: 0.1554, Adjusted R-squared: 0.1411
F-statistic: 10.85 on 1 and 59 DF, p-value: 0.00167
> 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.03947394 0.07894788 0.9605261
[2,] 0.01082727 0.02165455 0.9891727
[3,] 0.01746337 0.03492674 0.9825366
[4,] 0.12119566 0.24239132 0.8788043
[5,] 0.09457883 0.18915766 0.9054212
[6,] 0.06294382 0.12588764 0.9370562
[7,] 0.22513907 0.45027815 0.7748609
[8,] 0.49284582 0.98569164 0.5071542
[9,] 0.63861726 0.72276548 0.3613827
[10,] 0.64279106 0.71441789 0.3572089
[11,] 0.55990812 0.88018376 0.4400919
[12,] 0.47739056 0.95478111 0.5226094
[13,] 0.41174120 0.82348241 0.5882588
[14,] 0.37293028 0.74586057 0.6270697
[15,] 0.33432645 0.66865289 0.6656736
[16,] 0.27255598 0.54511196 0.7274440
[17,] 0.21935663 0.43871327 0.7806434
[18,] 0.17769006 0.35538011 0.8223099
[19,] 0.17515279 0.35030558 0.8248472
[20,] 0.19088265 0.38176530 0.8091173
[21,] 0.21551852 0.43103704 0.7844815
[22,] 0.19600418 0.39200836 0.8039958
[23,] 0.17385695 0.34771390 0.8261431
[24,] 0.17434375 0.34868749 0.8256563
[25,] 0.21161242 0.42322483 0.7883876
[26,] 0.26288504 0.52577009 0.7371150
[27,] 0.27984316 0.55968631 0.7201568
[28,] 0.30274683 0.60549366 0.6972532
[29,] 0.30931978 0.61863956 0.6906802
[30,] 0.29265083 0.58530166 0.7073492
[31,] 0.27964845 0.55929690 0.7203516
[32,] 0.26358170 0.52716339 0.7364183
[33,] 0.24197437 0.48394873 0.7580256
[34,] 0.21851037 0.43702073 0.7814896
[35,] 0.20019502 0.40039004 0.7998050
[36,] 0.18528645 0.37057291 0.8147135
[37,] 0.18342847 0.36685694 0.8165715
[38,] 0.19396727 0.38793454 0.8060327
[39,] 0.20466140 0.40932281 0.7953386
[40,] 0.25486624 0.50973249 0.7451338
[41,] 0.26470240 0.52940480 0.7352976
[42,] 0.27385132 0.54770263 0.7261487
[43,] 0.26693279 0.53386557 0.7330672
[44,] 0.24846263 0.49692525 0.7515374
[45,] 0.24778211 0.49556422 0.7522179
[46,] 0.25737517 0.51475035 0.7426248
[47,] 0.26790783 0.53581565 0.7320922
[48,] 0.24984634 0.49969269 0.7501537
[49,] 0.24591338 0.49182676 0.7540866
[50,] 0.26140559 0.52281118 0.7385944
[51,] 0.20681815 0.41363631 0.7931818
[52,] 0.14568540 0.29137079 0.8543146
> postscript(file="/var/www/html/rcomp/tmp/1layp1258477353.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/2nwqs1258477353.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/31wbh1258477353.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/43jzj1258477353.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/5f1a61258477353.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 = 61
Frequency = 1
1 2 3 4 5 6
0.238098527 0.191124215 0.261585683 0.414611371 0.691124215 0.520662747
7 8 9 10 11 12
-0.026311564 -0.638414317 -0.774004226 -0.644465694 0.779021462 1.232047150
13 14 15 16 17 18
1.185072838 0.796457241 0.225995774 0.255534306 0.455534306 0.625995774
19 20 21 22 23 24
0.643431553 0.272970085 0.102508618 -0.003542759 0.743431553 0.843431553
25 26 27 28 29 30
0.866918709 0.502508618 0.425995774 0.596457241 0.725995774 0.679021462
31 32 33 34 35 36
0.414611371 0.385072838 0.232047150 -0.138414317 -0.008875785 -0.108875785
37 38 39 40 41 42
-0.202824409 -0.302824409 -0.332362941 -0.308875785 -0.185388629 -0.161901473
43 44 45 46 47 48
-0.261901473 -0.161901473 -0.579337253 -1.079337253 -0.755850097 -1.026311564
49 50 51 52 53 54
-1.232362941 -1.067952850 -0.903542759 -0.656568447 -0.462619823 -0.639132668
55 56 57 58 59 60
-0.751235421 -1.198209732 -1.263338173 -0.722415238 0.501071918 0.583636138
61
0.207123294
> postscript(file="/var/www/html/rcomp/tmp/6avgt1258477353.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 = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 0.238098527 NA
1 0.191124215 0.238098527
2 0.261585683 0.191124215
3 0.414611371 0.261585683
4 0.691124215 0.414611371
5 0.520662747 0.691124215
6 -0.026311564 0.520662747
7 -0.638414317 -0.026311564
8 -0.774004226 -0.638414317
9 -0.644465694 -0.774004226
10 0.779021462 -0.644465694
11 1.232047150 0.779021462
12 1.185072838 1.232047150
13 0.796457241 1.185072838
14 0.225995774 0.796457241
15 0.255534306 0.225995774
16 0.455534306 0.255534306
17 0.625995774 0.455534306
18 0.643431553 0.625995774
19 0.272970085 0.643431553
20 0.102508618 0.272970085
21 -0.003542759 0.102508618
22 0.743431553 -0.003542759
23 0.843431553 0.743431553
24 0.866918709 0.843431553
25 0.502508618 0.866918709
26 0.425995774 0.502508618
27 0.596457241 0.425995774
28 0.725995774 0.596457241
29 0.679021462 0.725995774
30 0.414611371 0.679021462
31 0.385072838 0.414611371
32 0.232047150 0.385072838
33 -0.138414317 0.232047150
34 -0.008875785 -0.138414317
35 -0.108875785 -0.008875785
36 -0.202824409 -0.108875785
37 -0.302824409 -0.202824409
38 -0.332362941 -0.302824409
39 -0.308875785 -0.332362941
40 -0.185388629 -0.308875785
41 -0.161901473 -0.185388629
42 -0.261901473 -0.161901473
43 -0.161901473 -0.261901473
44 -0.579337253 -0.161901473
45 -1.079337253 -0.579337253
46 -0.755850097 -1.079337253
47 -1.026311564 -0.755850097
48 -1.232362941 -1.026311564
49 -1.067952850 -1.232362941
50 -0.903542759 -1.067952850
51 -0.656568447 -0.903542759
52 -0.462619823 -0.656568447
53 -0.639132668 -0.462619823
54 -0.751235421 -0.639132668
55 -1.198209732 -0.751235421
56 -1.263338173 -1.198209732
57 -0.722415238 -1.263338173
58 0.501071918 -0.722415238
59 0.583636138 0.501071918
60 0.207123294 0.583636138
61 NA 0.207123294
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.191124215 0.238098527
[2,] 0.261585683 0.191124215
[3,] 0.414611371 0.261585683
[4,] 0.691124215 0.414611371
[5,] 0.520662747 0.691124215
[6,] -0.026311564 0.520662747
[7,] -0.638414317 -0.026311564
[8,] -0.774004226 -0.638414317
[9,] -0.644465694 -0.774004226
[10,] 0.779021462 -0.644465694
[11,] 1.232047150 0.779021462
[12,] 1.185072838 1.232047150
[13,] 0.796457241 1.185072838
[14,] 0.225995774 0.796457241
[15,] 0.255534306 0.225995774
[16,] 0.455534306 0.255534306
[17,] 0.625995774 0.455534306
[18,] 0.643431553 0.625995774
[19,] 0.272970085 0.643431553
[20,] 0.102508618 0.272970085
[21,] -0.003542759 0.102508618
[22,] 0.743431553 -0.003542759
[23,] 0.843431553 0.743431553
[24,] 0.866918709 0.843431553
[25,] 0.502508618 0.866918709
[26,] 0.425995774 0.502508618
[27,] 0.596457241 0.425995774
[28,] 0.725995774 0.596457241
[29,] 0.679021462 0.725995774
[30,] 0.414611371 0.679021462
[31,] 0.385072838 0.414611371
[32,] 0.232047150 0.385072838
[33,] -0.138414317 0.232047150
[34,] -0.008875785 -0.138414317
[35,] -0.108875785 -0.008875785
[36,] -0.202824409 -0.108875785
[37,] -0.302824409 -0.202824409
[38,] -0.332362941 -0.302824409
[39,] -0.308875785 -0.332362941
[40,] -0.185388629 -0.308875785
[41,] -0.161901473 -0.185388629
[42,] -0.261901473 -0.161901473
[43,] -0.161901473 -0.261901473
[44,] -0.579337253 -0.161901473
[45,] -1.079337253 -0.579337253
[46,] -0.755850097 -1.079337253
[47,] -1.026311564 -0.755850097
[48,] -1.232362941 -1.026311564
[49,] -1.067952850 -1.232362941
[50,] -0.903542759 -1.067952850
[51,] -0.656568447 -0.903542759
[52,] -0.462619823 -0.656568447
[53,] -0.639132668 -0.462619823
[54,] -0.751235421 -0.639132668
[55,] -1.198209732 -0.751235421
[56,] -1.263338173 -1.198209732
[57,] -0.722415238 -1.263338173
[58,] 0.501071918 -0.722415238
[59,] 0.583636138 0.501071918
[60,] 0.207123294 0.583636138
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.191124215 0.238098527
2 0.261585683 0.191124215
3 0.414611371 0.261585683
4 0.691124215 0.414611371
5 0.520662747 0.691124215
6 -0.026311564 0.520662747
7 -0.638414317 -0.026311564
8 -0.774004226 -0.638414317
9 -0.644465694 -0.774004226
10 0.779021462 -0.644465694
11 1.232047150 0.779021462
12 1.185072838 1.232047150
13 0.796457241 1.185072838
14 0.225995774 0.796457241
15 0.255534306 0.225995774
16 0.455534306 0.255534306
17 0.625995774 0.455534306
18 0.643431553 0.625995774
19 0.272970085 0.643431553
20 0.102508618 0.272970085
21 -0.003542759 0.102508618
22 0.743431553 -0.003542759
23 0.843431553 0.743431553
24 0.866918709 0.843431553
25 0.502508618 0.866918709
26 0.425995774 0.502508618
27 0.596457241 0.425995774
28 0.725995774 0.596457241
29 0.679021462 0.725995774
30 0.414611371 0.679021462
31 0.385072838 0.414611371
32 0.232047150 0.385072838
33 -0.138414317 0.232047150
34 -0.008875785 -0.138414317
35 -0.108875785 -0.008875785
36 -0.202824409 -0.108875785
37 -0.302824409 -0.202824409
38 -0.332362941 -0.302824409
39 -0.308875785 -0.332362941
40 -0.185388629 -0.308875785
41 -0.161901473 -0.185388629
42 -0.261901473 -0.161901473
43 -0.161901473 -0.261901473
44 -0.579337253 -0.161901473
45 -1.079337253 -0.579337253
46 -0.755850097 -1.079337253
47 -1.026311564 -0.755850097
48 -1.232362941 -1.026311564
49 -1.067952850 -1.232362941
50 -0.903542759 -1.067952850
51 -0.656568447 -0.903542759
52 -0.462619823 -0.656568447
53 -0.639132668 -0.462619823
54 -0.751235421 -0.639132668
55 -1.198209732 -0.751235421
56 -1.263338173 -1.198209732
57 -0.722415238 -1.263338173
58 0.501071918 -0.722415238
59 0.583636138 0.501071918
60 0.207123294 0.583636138
> 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/7kzot1258477353.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/8ifcq1258477353.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/9tn0y1258477353.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/10fs9z1258477353.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/11331j1258477353.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/121yhf1258477353.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/136xoz1258477353.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/14spvt1258477353.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/15yklu1258477353.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/16qpfa1258477353.tab")
+ }
>
> system("convert tmp/1layp1258477353.ps tmp/1layp1258477353.png")
> system("convert tmp/2nwqs1258477353.ps tmp/2nwqs1258477353.png")
> system("convert tmp/31wbh1258477353.ps tmp/31wbh1258477353.png")
> system("convert tmp/43jzj1258477353.ps tmp/43jzj1258477353.png")
> system("convert tmp/5f1a61258477353.ps tmp/5f1a61258477353.png")
> system("convert tmp/6avgt1258477353.ps tmp/6avgt1258477353.png")
> system("convert tmp/7kzot1258477353.ps tmp/7kzot1258477353.png")
> system("convert tmp/8ifcq1258477353.ps tmp/8ifcq1258477353.png")
> system("convert tmp/9tn0y1258477353.ps tmp/9tn0y1258477353.png")
> system("convert tmp/10fs9z1258477353.ps tmp/10fs9z1258477353.png")
>
>
> proc.time()
user system elapsed
2.504 1.597 3.125