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(1.3,2,1.2,2.1,1.1,2.1,1.4,2.5,1.2,2.2,1.5,2.3,1.1,2.3,1.3,2.2,1.5,2.2,1.1,1.6,1.4,1.8,1.3,1.7,1.5,1.9,1.6,1.8,1.7,1.9,1.1,1.5,1.6,1,1.3,0.8,1.7,1.1,1.6,1.5,1.7,1.7,1.9,2.3,1.8,2.4,1.9,3,1.6,3,1.5,3.2,1.6,3.2,1.6,3.2,1.7,3.5,2,4,2,4.3,1.9,4.1,1.7,4,1.8,4.1,1.9,4.2,1.7,4.5,2,5.6,2.1,6.5,2.4,7.6,2.5,8.5,2.5,8.7,2.6,8.3,2.2,8.3,2.5,8.5,2.8,8.7,2.8,8.7,2.9,8.5,3,7.9,3.1,7,2.9,5.8,2.7,4.5,2.2,3.7,2.5,3.1,2.3,2.7,2.6,2.3,2.3,1.8,2.2,1.5,1.8,1.2,1.8,1),dim=c(2,59),dimnames=list(c('inflatie','inflatie_levensmiddelen'),1:59))
> y <- array(NA,dim=c(2,59),dimnames=list(c('inflatie','inflatie_levensmiddelen'),1:59))
> 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
inflatie inflatie_levensmiddelen
1 1.3 2.0
2 1.2 2.1
3 1.1 2.1
4 1.4 2.5
5 1.2 2.2
6 1.5 2.3
7 1.1 2.3
8 1.3 2.2
9 1.5 2.2
10 1.1 1.6
11 1.4 1.8
12 1.3 1.7
13 1.5 1.9
14 1.6 1.8
15 1.7 1.9
16 1.1 1.5
17 1.6 1.0
18 1.3 0.8
19 1.7 1.1
20 1.6 1.5
21 1.7 1.7
22 1.9 2.3
23 1.8 2.4
24 1.9 3.0
25 1.6 3.0
26 1.5 3.2
27 1.6 3.2
28 1.6 3.2
29 1.7 3.5
30 2.0 4.0
31 2.0 4.3
32 1.9 4.1
33 1.7 4.0
34 1.8 4.1
35 1.9 4.2
36 1.7 4.5
37 2.0 5.6
38 2.1 6.5
39 2.4 7.6
40 2.5 8.5
41 2.5 8.7
42 2.6 8.3
43 2.2 8.3
44 2.5 8.5
45 2.8 8.7
46 2.8 8.7
47 2.9 8.5
48 3.0 7.9
49 3.1 7.0
50 2.9 5.8
51 2.7 4.5
52 2.2 3.7
53 2.5 3.1
54 2.3 2.7
55 2.6 2.3
56 2.3 1.8
57 2.2 1.5
58 1.8 1.2
59 1.8 1.0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) inflatie_levensmiddelen
1.2883 0.1647
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.5670 -0.2340 -0.1011 0.1795 0.9330
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.28825 0.08609 14.96 < 2e-16 ***
inflatie_levensmiddelen 0.16468 0.01917 8.59 7.26e-12 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.3624 on 57 degrees of freedom
Multiple R-squared: 0.5642, Adjusted R-squared: 0.5565
F-statistic: 73.79 on 1 and 57 DF, p-value: 7.265e-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,] 0.032628199 0.065256398 0.96737180
[2,] 0.031279113 0.062558226 0.96872089
[3,] 0.033453582 0.066907164 0.96654642
[4,] 0.013917223 0.027834446 0.98608278
[5,] 0.015367303 0.030734606 0.98463270
[6,] 0.007319067 0.014638134 0.99268093
[7,] 0.007168813 0.014337626 0.99283119
[8,] 0.003809057 0.007618115 0.99619094
[9,] 0.004170213 0.008340426 0.99582979
[10,] 0.006868004 0.013736007 0.99313200
[11,] 0.013532750 0.027065501 0.98646725
[12,] 0.016710551 0.033421102 0.98328945
[13,] 0.014688730 0.029377459 0.98531127
[14,] 0.010287673 0.020575346 0.98971233
[15,] 0.011031438 0.022062876 0.98896856
[16,] 0.008389052 0.016778103 0.99161095
[17,] 0.009067648 0.018135295 0.99093235
[18,] 0.027420246 0.054840492 0.97257975
[19,] 0.034185631 0.068371261 0.96581437
[20,] 0.042586889 0.085173778 0.95741311
[21,] 0.033451494 0.066902988 0.96654851
[22,] 0.031649886 0.063299771 0.96835011
[23,] 0.027675743 0.055351486 0.97232426
[24,] 0.025673878 0.051347756 0.97432612
[25,] 0.023528542 0.047057084 0.97647146
[26,] 0.022555998 0.045111996 0.97744400
[27,] 0.018134844 0.036269688 0.98186516
[28,] 0.014476796 0.028953591 0.98552320
[29,] 0.017656695 0.035313391 0.98234330
[30,] 0.018952482 0.037904965 0.98104752
[31,] 0.018621203 0.037242405 0.98137880
[32,] 0.043375185 0.086750370 0.95662482
[33,] 0.054648936 0.109297872 0.94535106
[34,] 0.070643284 0.141286568 0.92935672
[35,] 0.060611112 0.121222224 0.93938889
[36,] 0.050102174 0.100204348 0.94989783
[37,] 0.045596396 0.091192793 0.95440360
[38,] 0.036085868 0.072171736 0.96391413
[39,] 0.166880666 0.333761332 0.83311933
[40,] 0.286818557 0.573637114 0.71318144
[41,] 0.315964687 0.631929374 0.68403531
[42,] 0.404670408 0.809340817 0.59532959
[43,] 0.517770956 0.964458088 0.48222904
[44,] 0.603176054 0.793647893 0.39682395
[45,] 0.641815575 0.716368850 0.35818443
[46,] 0.637247177 0.725505646 0.36275282
[47,] 0.609667216 0.780665567 0.39033278
[48,] 0.813931752 0.372136496 0.18606825
[49,] 0.778995620 0.442008759 0.22100438
[50,] 0.973545263 0.052909474 0.02645474
> postscript(file="/var/www/html/rcomp/tmp/1epl31258718597.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/21wkg1258718597.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/38bur1258718597.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/4fgu91258718597.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/57mjg1258718597.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 = 59
Frequency = 1
1 2 3 4 5 6
-0.317612831 -0.434080826 -0.534080826 -0.299952806 -0.450548821 -0.167016816
7 8 9 10 11 12
-0.567016816 -0.350548821 -0.150548821 -0.451740850 -0.184676840 -0.268208845
13 14 15 16 17 18
-0.101144835 0.015323160 0.098855165 -0.435272855 0.147067121 -0.119996889
19 20 21 22 23 24
0.230599126 0.064727145 0.131791155 0.232983184 0.116515189 0.117707218
25 26 27 28 29 30
-0.182292782 -0.315228773 -0.215228773 -0.215228773 -0.164632758 0.053027266
31 32 33 34 35 36
0.003623281 -0.063440729 -0.246972734 -0.163440729 -0.079908724 -0.329312710
37 38 39 40 41 42
-0.210460657 -0.258672613 -0.139820560 -0.188032517 -0.220968507 -0.055096526
43 44 45 46 47 48
-0.455096526 -0.188032517 0.079031493 0.079031493 0.211967483 0.410775454
49 50 51 52 53 54
0.658987411 0.656603353 0.670687290 0.302431252 0.701239223 0.567111203
55 56 57 58 59
0.932983184 0.715323160 0.664727145 0.314131131 0.347067121
> postscript(file="/var/www/html/rcomp/tmp/6oy901258718597.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 = 59
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.317612831 NA
1 -0.434080826 -0.317612831
2 -0.534080826 -0.434080826
3 -0.299952806 -0.534080826
4 -0.450548821 -0.299952806
5 -0.167016816 -0.450548821
6 -0.567016816 -0.167016816
7 -0.350548821 -0.567016816
8 -0.150548821 -0.350548821
9 -0.451740850 -0.150548821
10 -0.184676840 -0.451740850
11 -0.268208845 -0.184676840
12 -0.101144835 -0.268208845
13 0.015323160 -0.101144835
14 0.098855165 0.015323160
15 -0.435272855 0.098855165
16 0.147067121 -0.435272855
17 -0.119996889 0.147067121
18 0.230599126 -0.119996889
19 0.064727145 0.230599126
20 0.131791155 0.064727145
21 0.232983184 0.131791155
22 0.116515189 0.232983184
23 0.117707218 0.116515189
24 -0.182292782 0.117707218
25 -0.315228773 -0.182292782
26 -0.215228773 -0.315228773
27 -0.215228773 -0.215228773
28 -0.164632758 -0.215228773
29 0.053027266 -0.164632758
30 0.003623281 0.053027266
31 -0.063440729 0.003623281
32 -0.246972734 -0.063440729
33 -0.163440729 -0.246972734
34 -0.079908724 -0.163440729
35 -0.329312710 -0.079908724
36 -0.210460657 -0.329312710
37 -0.258672613 -0.210460657
38 -0.139820560 -0.258672613
39 -0.188032517 -0.139820560
40 -0.220968507 -0.188032517
41 -0.055096526 -0.220968507
42 -0.455096526 -0.055096526
43 -0.188032517 -0.455096526
44 0.079031493 -0.188032517
45 0.079031493 0.079031493
46 0.211967483 0.079031493
47 0.410775454 0.211967483
48 0.658987411 0.410775454
49 0.656603353 0.658987411
50 0.670687290 0.656603353
51 0.302431252 0.670687290
52 0.701239223 0.302431252
53 0.567111203 0.701239223
54 0.932983184 0.567111203
55 0.715323160 0.932983184
56 0.664727145 0.715323160
57 0.314131131 0.664727145
58 0.347067121 0.314131131
59 NA 0.347067121
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.434080826 -0.317612831
[2,] -0.534080826 -0.434080826
[3,] -0.299952806 -0.534080826
[4,] -0.450548821 -0.299952806
[5,] -0.167016816 -0.450548821
[6,] -0.567016816 -0.167016816
[7,] -0.350548821 -0.567016816
[8,] -0.150548821 -0.350548821
[9,] -0.451740850 -0.150548821
[10,] -0.184676840 -0.451740850
[11,] -0.268208845 -0.184676840
[12,] -0.101144835 -0.268208845
[13,] 0.015323160 -0.101144835
[14,] 0.098855165 0.015323160
[15,] -0.435272855 0.098855165
[16,] 0.147067121 -0.435272855
[17,] -0.119996889 0.147067121
[18,] 0.230599126 -0.119996889
[19,] 0.064727145 0.230599126
[20,] 0.131791155 0.064727145
[21,] 0.232983184 0.131791155
[22,] 0.116515189 0.232983184
[23,] 0.117707218 0.116515189
[24,] -0.182292782 0.117707218
[25,] -0.315228773 -0.182292782
[26,] -0.215228773 -0.315228773
[27,] -0.215228773 -0.215228773
[28,] -0.164632758 -0.215228773
[29,] 0.053027266 -0.164632758
[30,] 0.003623281 0.053027266
[31,] -0.063440729 0.003623281
[32,] -0.246972734 -0.063440729
[33,] -0.163440729 -0.246972734
[34,] -0.079908724 -0.163440729
[35,] -0.329312710 -0.079908724
[36,] -0.210460657 -0.329312710
[37,] -0.258672613 -0.210460657
[38,] -0.139820560 -0.258672613
[39,] -0.188032517 -0.139820560
[40,] -0.220968507 -0.188032517
[41,] -0.055096526 -0.220968507
[42,] -0.455096526 -0.055096526
[43,] -0.188032517 -0.455096526
[44,] 0.079031493 -0.188032517
[45,] 0.079031493 0.079031493
[46,] 0.211967483 0.079031493
[47,] 0.410775454 0.211967483
[48,] 0.658987411 0.410775454
[49,] 0.656603353 0.658987411
[50,] 0.670687290 0.656603353
[51,] 0.302431252 0.670687290
[52,] 0.701239223 0.302431252
[53,] 0.567111203 0.701239223
[54,] 0.932983184 0.567111203
[55,] 0.715323160 0.932983184
[56,] 0.664727145 0.715323160
[57,] 0.314131131 0.664727145
[58,] 0.347067121 0.314131131
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.434080826 -0.317612831
2 -0.534080826 -0.434080826
3 -0.299952806 -0.534080826
4 -0.450548821 -0.299952806
5 -0.167016816 -0.450548821
6 -0.567016816 -0.167016816
7 -0.350548821 -0.567016816
8 -0.150548821 -0.350548821
9 -0.451740850 -0.150548821
10 -0.184676840 -0.451740850
11 -0.268208845 -0.184676840
12 -0.101144835 -0.268208845
13 0.015323160 -0.101144835
14 0.098855165 0.015323160
15 -0.435272855 0.098855165
16 0.147067121 -0.435272855
17 -0.119996889 0.147067121
18 0.230599126 -0.119996889
19 0.064727145 0.230599126
20 0.131791155 0.064727145
21 0.232983184 0.131791155
22 0.116515189 0.232983184
23 0.117707218 0.116515189
24 -0.182292782 0.117707218
25 -0.315228773 -0.182292782
26 -0.215228773 -0.315228773
27 -0.215228773 -0.215228773
28 -0.164632758 -0.215228773
29 0.053027266 -0.164632758
30 0.003623281 0.053027266
31 -0.063440729 0.003623281
32 -0.246972734 -0.063440729
33 -0.163440729 -0.246972734
34 -0.079908724 -0.163440729
35 -0.329312710 -0.079908724
36 -0.210460657 -0.329312710
37 -0.258672613 -0.210460657
38 -0.139820560 -0.258672613
39 -0.188032517 -0.139820560
40 -0.220968507 -0.188032517
41 -0.055096526 -0.220968507
42 -0.455096526 -0.055096526
43 -0.188032517 -0.455096526
44 0.079031493 -0.188032517
45 0.079031493 0.079031493
46 0.211967483 0.079031493
47 0.410775454 0.211967483
48 0.658987411 0.410775454
49 0.656603353 0.658987411
50 0.670687290 0.656603353
51 0.302431252 0.670687290
52 0.701239223 0.302431252
53 0.567111203 0.701239223
54 0.932983184 0.567111203
55 0.715323160 0.932983184
56 0.664727145 0.715323160
57 0.314131131 0.664727145
58 0.347067121 0.314131131
> 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/7kb1j1258718597.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/8at7j1258718597.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/9ahv61258718597.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/10unhw1258718597.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/11fne41258718597.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/12m2bv1258718597.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/13wtmx1258718597.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/14a28w1258718597.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/15we0p1258718597.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/16u17g1258718597.tab")
+ }
>
> system("convert tmp/1epl31258718597.ps tmp/1epl31258718597.png")
> system("convert tmp/21wkg1258718597.ps tmp/21wkg1258718597.png")
> system("convert tmp/38bur1258718597.ps tmp/38bur1258718597.png")
> system("convert tmp/4fgu91258718597.ps tmp/4fgu91258718597.png")
> system("convert tmp/57mjg1258718597.ps tmp/57mjg1258718597.png")
> system("convert tmp/6oy901258718597.ps tmp/6oy901258718597.png")
> system("convert tmp/7kb1j1258718597.ps tmp/7kb1j1258718597.png")
> system("convert tmp/8at7j1258718597.ps tmp/8at7j1258718597.png")
> system("convert tmp/9ahv61258718597.ps tmp/9ahv61258718597.png")
> system("convert tmp/10unhw1258718597.ps tmp/10unhw1258718597.png")
>
>
> proc.time()
user system elapsed
2.430 1.536 2.819