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(2.09,0,2.11,2.05,0,2.09,2.08,0,2.05,2.06,0,2.08,2.06,0,2.06,2.08,0,2.06,2.07,0,2.08,2.06,0,2.07,2.07,0,2.06,2.06,0,2.07,2.09,0,2.06,2.07,0,2.09,2.09,0,2.07,2.28,0,2.09,2.33,0,2.28,2.35,0,2.33,2.52,0,2.35,2.63,0,2.52,2.58,0,2.63,2.70,0,2.58,2.81,0,2.70,2.97,0,2.81,3.04,0,2.97,3.28,0,3.04,3.33,0,3.28,3.50,0,3.33,3.56,0,3.50,3.57,0,3.56,3.69,0,3.57,3.82,0,3.69,3.79,0,3.82,3.96,0,3.79,4.06,0,3.96,4.05,0,4.06,4.03,0,4.05,3.94,0,4.03,4.02,0,3.94,3.88,0,4.02,4.02,0,3.88,4.03,0,4.02,4.09,0,4.03,3.99,0,4.09,4.01,0,3.99,4.01,0,4.01,4.19,0,4.01,4.30,0,4.19,4.27,0,4.30,3.82,1,4.27,3.15,1,3.82,2.49,1,3.15,1.81,1,2.49,1.26,1,1.81,1.06,1,1.26,0.84,1,1.06,0.78,1,0.84,0.70,1,0.78,0.36,1,0.70,0.35,1,0.36,0.36,1,0.35),dim=c(3,59),dimnames=list(c('Y','X','Y1'),1:59))
> y <- array(NA,dim=c(3,59),dimnames=list(c('Y','X','Y1'),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 = '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 Y1 t
1 2.09 0 2.11 1
2 2.05 0 2.09 2
3 2.08 0 2.05 3
4 2.06 0 2.08 4
5 2.06 0 2.06 5
6 2.08 0 2.06 6
7 2.07 0 2.08 7
8 2.06 0 2.07 8
9 2.07 0 2.06 9
10 2.06 0 2.07 10
11 2.09 0 2.06 11
12 2.07 0 2.09 12
13 2.09 0 2.07 13
14 2.28 0 2.09 14
15 2.33 0 2.28 15
16 2.35 0 2.33 16
17 2.52 0 2.35 17
18 2.63 0 2.52 18
19 2.58 0 2.63 19
20 2.70 0 2.58 20
21 2.81 0 2.70 21
22 2.97 0 2.81 22
23 3.04 0 2.97 23
24 3.28 0 3.04 24
25 3.33 0 3.28 25
26 3.50 0 3.33 26
27 3.56 0 3.50 27
28 3.57 0 3.56 28
29 3.69 0 3.57 29
30 3.82 0 3.69 30
31 3.79 0 3.82 31
32 3.96 0 3.79 32
33 4.06 0 3.96 33
34 4.05 0 4.06 34
35 4.03 0 4.05 35
36 3.94 0 4.03 36
37 4.02 0 3.94 37
38 3.88 0 4.02 38
39 4.02 0 3.88 39
40 4.03 0 4.02 40
41 4.09 0 4.03 41
42 3.99 0 4.09 42
43 4.01 0 3.99 43
44 4.01 0 4.01 44
45 4.19 0 4.01 45
46 4.30 0 4.19 46
47 4.27 0 4.30 47
48 3.82 1 4.27 48
49 3.15 1 3.82 49
50 2.49 1 3.15 50
51 1.81 1 2.49 51
52 1.26 1 1.81 52
53 1.06 1 1.26 53
54 0.84 1 1.06 54
55 0.78 1 0.84 55
56 0.70 1 0.78 56
57 0.36 1 0.70 57
58 0.35 1 0.36 58
59 0.36 1 0.35 59
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X Y1 t
0.25273 -0.80414 0.86556 0.00859
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.231973 -0.055059 -0.004674 0.076815 0.263099
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.252735 0.045219 5.589 7.34e-07 ***
X -0.804136 0.070863 -11.348 4.97e-16 ***
Y1 0.865562 0.018757 46.147 < 2e-16 ***
t 0.008591 0.001465 5.865 2.66e-07 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.1015 on 55 degrees of freedom
Multiple R-squared: 0.9925, Adjusted R-squared: 0.9921
F-statistic: 2441 on 3 and 55 DF, p-value: < 2.2e-16
> 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.457046e-03 1.691409e-02 0.9915430
[2,] 1.320417e-03 2.640835e-03 0.9986796
[3,] 1.915966e-04 3.831932e-04 0.9998084
[4,] 2.564534e-05 5.129068e-05 0.9999744
[5,] 1.047638e-05 2.095275e-05 0.9999895
[6,] 1.563335e-06 3.126669e-06 0.9999984
[7,] 4.052461e-07 8.104923e-07 0.9999996
[8,] 8.875198e-03 1.775040e-02 0.9911248
[9,] 4.162325e-03 8.324650e-03 0.9958377
[10,] 2.238197e-03 4.476395e-03 0.9977618
[11,] 4.119872e-03 8.239744e-03 0.9958801
[12,] 1.862755e-03 3.725510e-03 0.9981372
[13,] 7.906862e-03 1.581372e-02 0.9920931
[14,] 5.556464e-03 1.111293e-02 0.9944435
[15,] 3.257680e-03 6.515359e-03 0.9967423
[16,] 2.377396e-03 4.754792e-03 0.9976226
[17,] 1.424306e-03 2.848612e-03 0.9985757
[18,] 2.773193e-03 5.546386e-03 0.9972268
[19,] 2.564289e-03 5.128577e-03 0.9974357
[20,] 1.595576e-03 3.191152e-03 0.9984044
[21,] 1.149316e-03 2.298632e-03 0.9988507
[22,] 1.296827e-03 2.593655e-03 0.9987032
[23,] 6.706629e-04 1.341326e-03 0.9993293
[24,] 3.813978e-04 7.627957e-04 0.9996186
[25,] 6.700405e-04 1.340081e-03 0.9993300
[26,] 7.019020e-04 1.403804e-03 0.9992981
[27,] 5.159118e-04 1.031824e-03 0.9994841
[28,] 5.565673e-04 1.113135e-03 0.9994434
[29,] 5.993111e-04 1.198622e-03 0.9994007
[30,] 1.568671e-03 3.137343e-03 0.9984313
[31,] 1.093683e-03 2.187365e-03 0.9989063
[32,] 5.410649e-03 1.082130e-02 0.9945894
[33,] 5.015799e-03 1.003160e-02 0.9949842
[34,] 3.564850e-03 7.129700e-03 0.9964352
[35,] 2.693417e-03 5.386833e-03 0.9973066
[36,] 4.122410e-03 8.244820e-03 0.9958776
[37,] 2.394643e-03 4.789285e-03 0.9976054
[38,] 1.478673e-03 2.957346e-03 0.9985213
[39,] 1.556701e-03 3.113401e-03 0.9984433
[40,] 1.202258e-03 2.404515e-03 0.9987977
[41,] 7.210547e-04 1.442109e-03 0.9992789
[42,] 1.441396e-02 2.882792e-02 0.9855860
[43,] 4.576657e-02 9.153314e-02 0.9542334
[44,] 1.432222e-01 2.864444e-01 0.8567778
[45,] 2.126444e-01 4.252888e-01 0.7873556
[46,] 1.447951e-01 2.895902e-01 0.8552049
> postscript(file="/var/www/html/rcomp/tmp/15usw1258724958.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/2d7mv1258724958.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/3yqm01258724958.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/4ih6b1258724958.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/508441258724958.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.002339086 -0.028940377 0.027091396 -0.027466156 -0.018745619 -0.007336317
7 8 9 10 11 12
-0.043238251 -0.053173331 -0.043108412 -0.070354728 -0.040289809 -0.094847360
13 14 15 16 17 18
-0.066126823 0.097971243 -0.025076192 -0.056944979 0.087153087 0.041416887
19 20 21 22 23 24
-0.112385606 0.042301784 0.039843673 0.096041180 0.018960598 0.189780575
25 26 27 28 29 30
0.023455052 0.141586265 0.045850065 -0.004674340 0.098079344 0.115621233
31 32 33 34 35 36
-0.035492496 0.151883659 0.096147459 -0.008999416 -0.028934497 -0.110213960
37 38 39 40 41 42
0.039095901 -0.178739739 0.073848211 -0.045921136 -0.003167452 -0.163691856
43 44 45 46 47 48
-0.065726378 -0.091628311 0.079780990 0.025389173 -0.108413321 0.263098857
49 50 51 52 53 54
-0.025989043 -0.114653354 -0.231973282 -0.201981975 0.065486302 0.010007958
55 56 57 58 59
0.131840849 0.095183857 -0.184161899 0.091538405 0.101603325
> postscript(file="/var/www/html/rcomp/tmp/6ey8q1258724958.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.002339086 NA
1 -0.028940377 0.002339086
2 0.027091396 -0.028940377
3 -0.027466156 0.027091396
4 -0.018745619 -0.027466156
5 -0.007336317 -0.018745619
6 -0.043238251 -0.007336317
7 -0.053173331 -0.043238251
8 -0.043108412 -0.053173331
9 -0.070354728 -0.043108412
10 -0.040289809 -0.070354728
11 -0.094847360 -0.040289809
12 -0.066126823 -0.094847360
13 0.097971243 -0.066126823
14 -0.025076192 0.097971243
15 -0.056944979 -0.025076192
16 0.087153087 -0.056944979
17 0.041416887 0.087153087
18 -0.112385606 0.041416887
19 0.042301784 -0.112385606
20 0.039843673 0.042301784
21 0.096041180 0.039843673
22 0.018960598 0.096041180
23 0.189780575 0.018960598
24 0.023455052 0.189780575
25 0.141586265 0.023455052
26 0.045850065 0.141586265
27 -0.004674340 0.045850065
28 0.098079344 -0.004674340
29 0.115621233 0.098079344
30 -0.035492496 0.115621233
31 0.151883659 -0.035492496
32 0.096147459 0.151883659
33 -0.008999416 0.096147459
34 -0.028934497 -0.008999416
35 -0.110213960 -0.028934497
36 0.039095901 -0.110213960
37 -0.178739739 0.039095901
38 0.073848211 -0.178739739
39 -0.045921136 0.073848211
40 -0.003167452 -0.045921136
41 -0.163691856 -0.003167452
42 -0.065726378 -0.163691856
43 -0.091628311 -0.065726378
44 0.079780990 -0.091628311
45 0.025389173 0.079780990
46 -0.108413321 0.025389173
47 0.263098857 -0.108413321
48 -0.025989043 0.263098857
49 -0.114653354 -0.025989043
50 -0.231973282 -0.114653354
51 -0.201981975 -0.231973282
52 0.065486302 -0.201981975
53 0.010007958 0.065486302
54 0.131840849 0.010007958
55 0.095183857 0.131840849
56 -0.184161899 0.095183857
57 0.091538405 -0.184161899
58 0.101603325 0.091538405
59 NA 0.101603325
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.028940377 0.002339086
[2,] 0.027091396 -0.028940377
[3,] -0.027466156 0.027091396
[4,] -0.018745619 -0.027466156
[5,] -0.007336317 -0.018745619
[6,] -0.043238251 -0.007336317
[7,] -0.053173331 -0.043238251
[8,] -0.043108412 -0.053173331
[9,] -0.070354728 -0.043108412
[10,] -0.040289809 -0.070354728
[11,] -0.094847360 -0.040289809
[12,] -0.066126823 -0.094847360
[13,] 0.097971243 -0.066126823
[14,] -0.025076192 0.097971243
[15,] -0.056944979 -0.025076192
[16,] 0.087153087 -0.056944979
[17,] 0.041416887 0.087153087
[18,] -0.112385606 0.041416887
[19,] 0.042301784 -0.112385606
[20,] 0.039843673 0.042301784
[21,] 0.096041180 0.039843673
[22,] 0.018960598 0.096041180
[23,] 0.189780575 0.018960598
[24,] 0.023455052 0.189780575
[25,] 0.141586265 0.023455052
[26,] 0.045850065 0.141586265
[27,] -0.004674340 0.045850065
[28,] 0.098079344 -0.004674340
[29,] 0.115621233 0.098079344
[30,] -0.035492496 0.115621233
[31,] 0.151883659 -0.035492496
[32,] 0.096147459 0.151883659
[33,] -0.008999416 0.096147459
[34,] -0.028934497 -0.008999416
[35,] -0.110213960 -0.028934497
[36,] 0.039095901 -0.110213960
[37,] -0.178739739 0.039095901
[38,] 0.073848211 -0.178739739
[39,] -0.045921136 0.073848211
[40,] -0.003167452 -0.045921136
[41,] -0.163691856 -0.003167452
[42,] -0.065726378 -0.163691856
[43,] -0.091628311 -0.065726378
[44,] 0.079780990 -0.091628311
[45,] 0.025389173 0.079780990
[46,] -0.108413321 0.025389173
[47,] 0.263098857 -0.108413321
[48,] -0.025989043 0.263098857
[49,] -0.114653354 -0.025989043
[50,] -0.231973282 -0.114653354
[51,] -0.201981975 -0.231973282
[52,] 0.065486302 -0.201981975
[53,] 0.010007958 0.065486302
[54,] 0.131840849 0.010007958
[55,] 0.095183857 0.131840849
[56,] -0.184161899 0.095183857
[57,] 0.091538405 -0.184161899
[58,] 0.101603325 0.091538405
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.028940377 0.002339086
2 0.027091396 -0.028940377
3 -0.027466156 0.027091396
4 -0.018745619 -0.027466156
5 -0.007336317 -0.018745619
6 -0.043238251 -0.007336317
7 -0.053173331 -0.043238251
8 -0.043108412 -0.053173331
9 -0.070354728 -0.043108412
10 -0.040289809 -0.070354728
11 -0.094847360 -0.040289809
12 -0.066126823 -0.094847360
13 0.097971243 -0.066126823
14 -0.025076192 0.097971243
15 -0.056944979 -0.025076192
16 0.087153087 -0.056944979
17 0.041416887 0.087153087
18 -0.112385606 0.041416887
19 0.042301784 -0.112385606
20 0.039843673 0.042301784
21 0.096041180 0.039843673
22 0.018960598 0.096041180
23 0.189780575 0.018960598
24 0.023455052 0.189780575
25 0.141586265 0.023455052
26 0.045850065 0.141586265
27 -0.004674340 0.045850065
28 0.098079344 -0.004674340
29 0.115621233 0.098079344
30 -0.035492496 0.115621233
31 0.151883659 -0.035492496
32 0.096147459 0.151883659
33 -0.008999416 0.096147459
34 -0.028934497 -0.008999416
35 -0.110213960 -0.028934497
36 0.039095901 -0.110213960
37 -0.178739739 0.039095901
38 0.073848211 -0.178739739
39 -0.045921136 0.073848211
40 -0.003167452 -0.045921136
41 -0.163691856 -0.003167452
42 -0.065726378 -0.163691856
43 -0.091628311 -0.065726378
44 0.079780990 -0.091628311
45 0.025389173 0.079780990
46 -0.108413321 0.025389173
47 0.263098857 -0.108413321
48 -0.025989043 0.263098857
49 -0.114653354 -0.025989043
50 -0.231973282 -0.114653354
51 -0.201981975 -0.231973282
52 0.065486302 -0.201981975
53 0.010007958 0.065486302
54 0.131840849 0.010007958
55 0.095183857 0.131840849
56 -0.184161899 0.095183857
57 0.091538405 -0.184161899
58 0.101603325 0.091538405
> 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/74fnc1258724958.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/800721258724958.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/9zvtk1258724958.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/10gm4x1258724958.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/11xe0o1258724958.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/1225f21258724958.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/13gau71258724958.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/146ne41258724958.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/15nyj01258724958.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/16t75l1258724958.tab")
+ }
>
> system("convert tmp/15usw1258724958.ps tmp/15usw1258724958.png")
> system("convert tmp/2d7mv1258724958.ps tmp/2d7mv1258724958.png")
> system("convert tmp/3yqm01258724958.ps tmp/3yqm01258724958.png")
> system("convert tmp/4ih6b1258724958.ps tmp/4ih6b1258724958.png")
> system("convert tmp/508441258724958.ps tmp/508441258724958.png")
> system("convert tmp/6ey8q1258724958.ps tmp/6ey8q1258724958.png")
> system("convert tmp/74fnc1258724958.ps tmp/74fnc1258724958.png")
> system("convert tmp/800721258724958.ps tmp/800721258724958.png")
> system("convert tmp/9zvtk1258724958.ps tmp/9zvtk1258724958.png")
> system("convert tmp/10gm4x1258724958.ps tmp/10gm4x1258724958.png")
>
>
> proc.time()
user system elapsed
2.461 1.557 2.813