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.4,8.2,1.2,8.0,1.0,7.5,1.7,6.8,2.4,6.5,2.0,6.6,2.1,7.6,2.0,8.0,1.8,8.1,2.7,7.7,2.3,7.5,1.9,7.6,2.0,7.8,2.3,7.8,2.8,7.8,2.4,7.5,2.3,7.5,2.7,7.1,2.7,7.5,2.9,7.5,3.0,7.6,2.2,7.7,2.3,7.7,2.8,7.9,2.8,8.1,2.8,8.2,2.2,8.2,2.6,8.2,2.8,7.9,2.5,7.3,2.4,6.9,2.3,6.6,1.9,6.7,1.7,6.9,2.0,7.0,2.1,7.1,1.7,7.2,1.8,7.1,1.8,6.9,1.8,7.0,1.3,6.8,1.3,6.4,1.3,6.7,1.2,6.6,1.4,6.4,2.2,6.3,2.9,6.2,3.1,6.5,3.5,6.8,3.6,6.8,4.4,6.4,4.1,6.1,5.1,5.8,5.8,6.1,5.9,7.2,5.4,7.3,5.5,6.9,4.8,6.1,3.2,5.8,2.7,6.2,2.1,7.1,1.9,7.7,0.6,7.9,0.7,7.7),dim=c(2,64),dimnames=list(c('Y','X'),1:64))
> y <- array(NA,dim=c(2,64),dimnames=list(c('Y','X'),1:64))
> 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
Y X
1 1.4 8.2
2 1.2 8.0
3 1.0 7.5
4 1.7 6.8
5 2.4 6.5
6 2.0 6.6
7 2.1 7.6
8 2.0 8.0
9 1.8 8.1
10 2.7 7.7
11 2.3 7.5
12 1.9 7.6
13 2.0 7.8
14 2.3 7.8
15 2.8 7.8
16 2.4 7.5
17 2.3 7.5
18 2.7 7.1
19 2.7 7.5
20 2.9 7.5
21 3.0 7.6
22 2.2 7.7
23 2.3 7.7
24 2.8 7.9
25 2.8 8.1
26 2.8 8.2
27 2.2 8.2
28 2.6 8.2
29 2.8 7.9
30 2.5 7.3
31 2.4 6.9
32 2.3 6.6
33 1.9 6.7
34 1.7 6.9
35 2.0 7.0
36 2.1 7.1
37 1.7 7.2
38 1.8 7.1
39 1.8 6.9
40 1.8 7.0
41 1.3 6.8
42 1.3 6.4
43 1.3 6.7
44 1.2 6.6
45 1.4 6.4
46 2.2 6.3
47 2.9 6.2
48 3.1 6.5
49 3.5 6.8
50 3.6 6.8
51 4.4 6.4
52 4.1 6.1
53 5.1 5.8
54 5.8 6.1
55 5.9 7.2
56 5.4 7.3
57 5.5 6.9
58 4.8 6.1
59 3.2 5.8
60 2.7 6.2
61 2.1 7.1
62 1.9 7.7
63 0.6 7.9
64 0.7 7.7
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
6.7993 -0.5954
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.6887 -0.8171 -0.1505 0.6544 3.3877
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.7993 1.5418 4.410 4.19e-05 ***
X -0.5954 0.2143 -2.779 0.00721 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.126 on 62 degrees of freedom
Multiple R-squared: 0.1108, Adjusted R-squared: 0.09641
F-statistic: 7.722 on 1 and 62 DF, p-value: 0.00721
> 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,] 5.487476e-02 1.097495e-01 0.94512524
[2,] 1.570449e-02 3.140897e-02 0.98429551
[3,] 1.497703e-02 2.995406e-02 0.98502297
[4,] 1.104065e-02 2.208130e-02 0.98895935
[5,] 4.634312e-03 9.268623e-03 0.99536569
[6,] 1.033831e-02 2.067662e-02 0.98966169
[7,] 5.665461e-03 1.133092e-02 0.99433454
[8,] 2.255093e-03 4.510186e-03 0.99774491
[9,] 9.032319e-04 1.806464e-03 0.99909677
[10,] 4.899150e-04 9.798299e-04 0.99951009
[11,] 7.437636e-04 1.487527e-03 0.99925624
[12,] 3.716200e-04 7.432401e-04 0.99962838
[13,] 1.601998e-04 3.203997e-04 0.99983980
[14,] 1.021289e-04 2.042577e-04 0.99989787
[15,] 7.074884e-05 1.414977e-04 0.99992925
[16,] 6.852763e-05 1.370553e-04 0.99993147
[17,] 7.724611e-05 1.544922e-04 0.99992275
[18,] 3.041083e-05 6.082167e-05 0.99996959
[19,] 1.191349e-05 2.382698e-05 0.99998809
[20,] 8.939293e-06 1.787859e-05 0.99999106
[21,] 6.561214e-06 1.312243e-05 0.99999344
[22,] 4.537307e-06 9.074614e-06 0.99999546
[23,] 1.746666e-06 3.493332e-06 0.99999825
[24,] 8.915858e-07 1.783172e-06 0.99999911
[25,] 5.935236e-07 1.187047e-06 0.99999941
[26,] 2.294587e-07 4.589175e-07 0.99999977
[27,] 8.029442e-08 1.605888e-07 0.99999992
[28,] 2.842386e-08 5.684772e-08 0.99999997
[29,] 1.333034e-08 2.666068e-08 0.99999999
[30,] 7.903318e-09 1.580664e-08 0.99999999
[31,] 2.818847e-09 5.637694e-09 1.00000000
[32,] 8.956972e-10 1.791394e-09 1.00000000
[33,] 4.581764e-10 9.163529e-10 1.00000000
[34,] 1.926310e-10 3.852621e-10 1.00000000
[35,] 8.347243e-11 1.669449e-10 1.00000000
[36,] 3.490477e-11 6.980955e-11 1.00000000
[37,] 5.552399e-11 1.110480e-10 1.00000000
[38,] 1.052845e-10 2.105690e-10 1.00000000
[39,] 1.850883e-10 3.701767e-10 1.00000000
[40,] 5.743459e-10 1.148692e-09 1.00000000
[41,] 1.722098e-09 3.444196e-09 1.00000000
[42,] 3.056923e-09 6.113845e-09 1.00000000
[43,] 1.277281e-08 2.554561e-08 0.99999999
[44,] 2.924617e-08 5.849235e-08 0.99999997
[45,] 7.994981e-08 1.598996e-07 0.99999992
[46,] 1.812800e-07 3.625599e-07 0.99999982
[47,] 1.858206e-06 3.716411e-06 0.99999814
[48,] 3.851877e-06 7.703754e-06 0.99999615
[49,] 1.912282e-05 3.824565e-05 0.99998088
[50,] 1.931126e-04 3.862252e-04 0.99980689
[51,] 9.351063e-03 1.870213e-02 0.99064894
[52,] 1.215079e-01 2.430158e-01 0.87849212
[53,] 7.409953e-01 5.180094e-01 0.25900471
[54,] 9.453391e-01 1.093217e-01 0.05466087
[55,] 8.611295e-01 2.777409e-01 0.13887046
> postscript(file="/var/www/html/rcomp/tmp/19emu1258655896.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/202rk1258655896.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/3lre31258655896.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/4lg2q1258655896.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/5oud61258655896.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 = 64
Frequency = 1
1 2 3 4 5 6
-0.51693590 -0.83601778 -1.33372248 -1.05050906 -0.52913188 -0.86959094
7 8 9 10 11 12
-0.17418154 -0.03601778 -0.17647684 0.48535940 -0.03372248 -0.37418154
13 14 15 16 17 18
-0.15509966 0.14490034 0.64490034 0.06627752 -0.03372248 0.12811376
19 20 21 22 23 24
0.36627752 0.56627752 0.72581846 -0.01464060 0.08535940 0.70444128
25 26 27 28 29 30
0.82352316 0.88306410 0.28306410 0.68306410 0.70444128 0.04719564
31 32 33 34 35 36
-0.29096812 -0.56959094 -0.91005000 -0.99096812 -0.63142718 -0.47188624
37 38 39 40 41 42
-0.81234530 -0.77188624 -0.89096812 -0.83142718 -1.45050906 -1.68867282
43 44 45 46 47 48
-1.51005000 -1.66959094 -1.58867282 -0.84821376 -0.20775470 0.17086812
49 50 51 52 53 54
0.74949094 0.84949094 1.41132718 0.93270436 1.75408154 2.63270436
55 56 57 58 59 60
3.38765470 2.94719564 2.80903188 1.63270436 -0.14591846 -0.40775470
61 62 63 64
-0.47188624 -0.31464060 -1.49555872 -1.51464060
> postscript(file="/var/www/html/rcomp/tmp/6k5yb1258655896.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 = 64
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.51693590 NA
1 -0.83601778 -0.51693590
2 -1.33372248 -0.83601778
3 -1.05050906 -1.33372248
4 -0.52913188 -1.05050906
5 -0.86959094 -0.52913188
6 -0.17418154 -0.86959094
7 -0.03601778 -0.17418154
8 -0.17647684 -0.03601778
9 0.48535940 -0.17647684
10 -0.03372248 0.48535940
11 -0.37418154 -0.03372248
12 -0.15509966 -0.37418154
13 0.14490034 -0.15509966
14 0.64490034 0.14490034
15 0.06627752 0.64490034
16 -0.03372248 0.06627752
17 0.12811376 -0.03372248
18 0.36627752 0.12811376
19 0.56627752 0.36627752
20 0.72581846 0.56627752
21 -0.01464060 0.72581846
22 0.08535940 -0.01464060
23 0.70444128 0.08535940
24 0.82352316 0.70444128
25 0.88306410 0.82352316
26 0.28306410 0.88306410
27 0.68306410 0.28306410
28 0.70444128 0.68306410
29 0.04719564 0.70444128
30 -0.29096812 0.04719564
31 -0.56959094 -0.29096812
32 -0.91005000 -0.56959094
33 -0.99096812 -0.91005000
34 -0.63142718 -0.99096812
35 -0.47188624 -0.63142718
36 -0.81234530 -0.47188624
37 -0.77188624 -0.81234530
38 -0.89096812 -0.77188624
39 -0.83142718 -0.89096812
40 -1.45050906 -0.83142718
41 -1.68867282 -1.45050906
42 -1.51005000 -1.68867282
43 -1.66959094 -1.51005000
44 -1.58867282 -1.66959094
45 -0.84821376 -1.58867282
46 -0.20775470 -0.84821376
47 0.17086812 -0.20775470
48 0.74949094 0.17086812
49 0.84949094 0.74949094
50 1.41132718 0.84949094
51 0.93270436 1.41132718
52 1.75408154 0.93270436
53 2.63270436 1.75408154
54 3.38765470 2.63270436
55 2.94719564 3.38765470
56 2.80903188 2.94719564
57 1.63270436 2.80903188
58 -0.14591846 1.63270436
59 -0.40775470 -0.14591846
60 -0.47188624 -0.40775470
61 -0.31464060 -0.47188624
62 -1.49555872 -0.31464060
63 -1.51464060 -1.49555872
64 NA -1.51464060
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.83601778 -0.51693590
[2,] -1.33372248 -0.83601778
[3,] -1.05050906 -1.33372248
[4,] -0.52913188 -1.05050906
[5,] -0.86959094 -0.52913188
[6,] -0.17418154 -0.86959094
[7,] -0.03601778 -0.17418154
[8,] -0.17647684 -0.03601778
[9,] 0.48535940 -0.17647684
[10,] -0.03372248 0.48535940
[11,] -0.37418154 -0.03372248
[12,] -0.15509966 -0.37418154
[13,] 0.14490034 -0.15509966
[14,] 0.64490034 0.14490034
[15,] 0.06627752 0.64490034
[16,] -0.03372248 0.06627752
[17,] 0.12811376 -0.03372248
[18,] 0.36627752 0.12811376
[19,] 0.56627752 0.36627752
[20,] 0.72581846 0.56627752
[21,] -0.01464060 0.72581846
[22,] 0.08535940 -0.01464060
[23,] 0.70444128 0.08535940
[24,] 0.82352316 0.70444128
[25,] 0.88306410 0.82352316
[26,] 0.28306410 0.88306410
[27,] 0.68306410 0.28306410
[28,] 0.70444128 0.68306410
[29,] 0.04719564 0.70444128
[30,] -0.29096812 0.04719564
[31,] -0.56959094 -0.29096812
[32,] -0.91005000 -0.56959094
[33,] -0.99096812 -0.91005000
[34,] -0.63142718 -0.99096812
[35,] -0.47188624 -0.63142718
[36,] -0.81234530 -0.47188624
[37,] -0.77188624 -0.81234530
[38,] -0.89096812 -0.77188624
[39,] -0.83142718 -0.89096812
[40,] -1.45050906 -0.83142718
[41,] -1.68867282 -1.45050906
[42,] -1.51005000 -1.68867282
[43,] -1.66959094 -1.51005000
[44,] -1.58867282 -1.66959094
[45,] -0.84821376 -1.58867282
[46,] -0.20775470 -0.84821376
[47,] 0.17086812 -0.20775470
[48,] 0.74949094 0.17086812
[49,] 0.84949094 0.74949094
[50,] 1.41132718 0.84949094
[51,] 0.93270436 1.41132718
[52,] 1.75408154 0.93270436
[53,] 2.63270436 1.75408154
[54,] 3.38765470 2.63270436
[55,] 2.94719564 3.38765470
[56,] 2.80903188 2.94719564
[57,] 1.63270436 2.80903188
[58,] -0.14591846 1.63270436
[59,] -0.40775470 -0.14591846
[60,] -0.47188624 -0.40775470
[61,] -0.31464060 -0.47188624
[62,] -1.49555872 -0.31464060
[63,] -1.51464060 -1.49555872
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.83601778 -0.51693590
2 -1.33372248 -0.83601778
3 -1.05050906 -1.33372248
4 -0.52913188 -1.05050906
5 -0.86959094 -0.52913188
6 -0.17418154 -0.86959094
7 -0.03601778 -0.17418154
8 -0.17647684 -0.03601778
9 0.48535940 -0.17647684
10 -0.03372248 0.48535940
11 -0.37418154 -0.03372248
12 -0.15509966 -0.37418154
13 0.14490034 -0.15509966
14 0.64490034 0.14490034
15 0.06627752 0.64490034
16 -0.03372248 0.06627752
17 0.12811376 -0.03372248
18 0.36627752 0.12811376
19 0.56627752 0.36627752
20 0.72581846 0.56627752
21 -0.01464060 0.72581846
22 0.08535940 -0.01464060
23 0.70444128 0.08535940
24 0.82352316 0.70444128
25 0.88306410 0.82352316
26 0.28306410 0.88306410
27 0.68306410 0.28306410
28 0.70444128 0.68306410
29 0.04719564 0.70444128
30 -0.29096812 0.04719564
31 -0.56959094 -0.29096812
32 -0.91005000 -0.56959094
33 -0.99096812 -0.91005000
34 -0.63142718 -0.99096812
35 -0.47188624 -0.63142718
36 -0.81234530 -0.47188624
37 -0.77188624 -0.81234530
38 -0.89096812 -0.77188624
39 -0.83142718 -0.89096812
40 -1.45050906 -0.83142718
41 -1.68867282 -1.45050906
42 -1.51005000 -1.68867282
43 -1.66959094 -1.51005000
44 -1.58867282 -1.66959094
45 -0.84821376 -1.58867282
46 -0.20775470 -0.84821376
47 0.17086812 -0.20775470
48 0.74949094 0.17086812
49 0.84949094 0.74949094
50 1.41132718 0.84949094
51 0.93270436 1.41132718
52 1.75408154 0.93270436
53 2.63270436 1.75408154
54 3.38765470 2.63270436
55 2.94719564 3.38765470
56 2.80903188 2.94719564
57 1.63270436 2.80903188
58 -0.14591846 1.63270436
59 -0.40775470 -0.14591846
60 -0.47188624 -0.40775470
61 -0.31464060 -0.47188624
62 -1.49555872 -0.31464060
63 -1.51464060 -1.49555872
> 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/72to01258655896.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/8pg1p1258655896.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/9tzli1258655896.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/10s5pw1258655896.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/11roe41258655896.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/12si9v1258655897.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/13gtn01258655897.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/14uce81258655897.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/1516ad1258655897.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/16l16q1258655897.tab")
+ }
>
> system("convert tmp/19emu1258655896.ps tmp/19emu1258655896.png")
> system("convert tmp/202rk1258655896.ps tmp/202rk1258655896.png")
> system("convert tmp/3lre31258655896.ps tmp/3lre31258655896.png")
> system("convert tmp/4lg2q1258655896.ps tmp/4lg2q1258655896.png")
> system("convert tmp/5oud61258655896.ps tmp/5oud61258655896.png")
> system("convert tmp/6k5yb1258655896.ps tmp/6k5yb1258655896.png")
> system("convert tmp/72to01258655896.ps tmp/72to01258655896.png")
> system("convert tmp/8pg1p1258655896.ps tmp/8pg1p1258655896.png")
> system("convert tmp/9tzli1258655896.ps tmp/9tzli1258655896.png")
> system("convert tmp/10s5pw1258655896.ps tmp/10s5pw1258655896.png")
>
>
> proc.time()
user system elapsed
2.505 1.557 2.877