R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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(0.89,0,0.89,0,0.89,0,0.89,0,0.89,0,0.89,0,0.89,0,0.9,0,0.91,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,0.92,0,1.01,1,1.01,1,1.01,1,1.01,1,1.01,1,1.04,1,1.05,1,1.05,1,1.06,1,1.06,1,1.06,1,1.06,1,1.08,1,1.08,1,1.08,1,1.08,1,1.08,1,1.08,1,1.09,1,1.09,1,1.1,1,1.1,1,1.1,1),dim=c(2,61),dimnames=list(c('y','x'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('y','x'),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
y x
1 0.89 0
2 0.89 0
3 0.89 0
4 0.89 0
5 0.89 0
6 0.89 0
7 0.89 0
8 0.90 0
9 0.91 0
10 0.92 0
11 0.92 0
12 0.92 0
13 0.92 0
14 0.92 0
15 0.92 0
16 0.92 0
17 0.92 0
18 0.92 0
19 0.92 0
20 0.92 0
21 0.92 0
22 0.92 0
23 0.92 0
24 0.92 0
25 0.92 0
26 0.92 0
27 0.92 0
28 0.92 0
29 0.92 0
30 0.92 0
31 0.92 0
32 0.92 0
33 0.92 0
34 0.92 0
35 0.92 0
36 0.92 0
37 0.92 0
38 0.92 0
39 1.01 1
40 1.01 1
41 1.01 1
42 1.01 1
43 1.01 1
44 1.04 1
45 1.05 1
46 1.05 1
47 1.06 1
48 1.06 1
49 1.06 1
50 1.06 1
51 1.08 1
52 1.08 1
53 1.08 1
54 1.08 1
55 1.08 1
56 1.08 1
57 1.09 1
58 1.09 1
59 1.10 1
60 1.10 1
61 1.10 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) x
0.9137 0.1468
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.050435 -0.010435 0.006316 0.006316 0.039565
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.913684 0.003495 261.46 <2e-16 ***
x 0.146751 0.005691 25.79 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.02154 on 59 degrees of freedom
Multiple R-squared: 0.9185, Adjusted R-squared: 0.9171
F-statistic: 664.9 on 1 and 59 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,] 3.121099e-43 6.242198e-43 1.00000000
[2,] 2.050257e-55 4.100515e-55 1.00000000
[3,] 6.923316e-70 1.384663e-69 1.00000000
[4,] 1.745593e-04 3.491185e-04 0.99982544
[5,] 4.277942e-03 8.555884e-03 0.99572206
[6,] 3.329141e-02 6.658281e-02 0.96670859
[7,] 5.968924e-02 1.193785e-01 0.94031076
[8,] 7.303096e-02 1.460619e-01 0.92696904
[9,] 7.529637e-02 1.505927e-01 0.92470363
[10,] 7.031367e-02 1.406273e-01 0.92968633
[11,] 6.136312e-02 1.227262e-01 0.93863688
[12,] 5.083373e-02 1.016675e-01 0.94916627
[13,] 4.031502e-02 8.063003e-02 0.95968498
[14,] 3.076080e-02 6.152160e-02 0.96923920
[15,] 2.264902e-02 4.529803e-02 0.97735098
[16,] 1.612287e-02 3.224573e-02 0.98387713
[17,] 1.110971e-02 2.221942e-02 0.98889029
[18,] 7.416023e-03 1.483205e-02 0.99258398
[19,] 4.798046e-03 9.596093e-03 0.99520195
[20,] 3.009646e-03 6.019293e-03 0.99699035
[21,] 1.830608e-03 3.661216e-03 0.99816939
[22,] 1.079764e-03 2.159529e-03 0.99892024
[23,] 6.175948e-04 1.235190e-03 0.99938241
[24,] 3.425111e-04 6.850222e-04 0.99965749
[25,] 1.841488e-04 3.682977e-04 0.99981585
[26,] 9.595913e-05 1.919183e-04 0.99990404
[27,] 4.845068e-05 9.690136e-05 0.99995155
[28,] 2.369495e-05 4.738990e-05 0.99997631
[29,] 1.121946e-05 2.243892e-05 0.99998878
[30,] 5.140863e-06 1.028173e-05 0.99999486
[31,] 2.278260e-06 4.556519e-06 0.99999772
[32,] 9.758719e-07 1.951744e-06 0.99999902
[33,] 4.037239e-07 8.074477e-07 0.99999960
[34,] 1.611807e-07 3.223614e-07 0.99999984
[35,] 2.995604e-07 5.991208e-07 0.99999970
[36,] 8.656948e-07 1.731390e-06 0.99999913
[37,] 4.686659e-06 9.373318e-06 0.99999531
[38,] 6.436969e-05 1.287394e-04 0.99993563
[39,] 3.655401e-03 7.310803e-03 0.99634460
[40,] 2.755789e-02 5.511578e-02 0.97244211
[41,] 9.973715e-02 1.994743e-01 0.90026285
[42,] 2.551066e-01 5.102132e-01 0.74489339
[43,] 4.093679e-01 8.187358e-01 0.59063210
[44,] 5.739478e-01 8.521044e-01 0.42605221
[45,] 7.578209e-01 4.843582e-01 0.24217908
[46,] 9.373105e-01 1.253789e-01 0.06268947
[47,] 9.397291e-01 1.205419e-01 0.06027094
[48,] 9.344974e-01 1.310053e-01 0.06550265
[49,] 9.248541e-01 1.502918e-01 0.07514592
[50,] 9.145740e-01 1.708520e-01 0.08542601
[51,] 9.133171e-01 1.733659e-01 0.08668294
[52,] 9.523545e-01 9.529097e-02 0.04764549
> postscript(file="/var/www/html/rcomp/tmp/1tk0c1229783619.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/26rc21229783619.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/31eq21229783619.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/4gt361229783619.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/5fsfk1229783619.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
-0.0236842105 -0.0236842105 -0.0236842105 -0.0236842105 -0.0236842105
6 7 8 9 10
-0.0236842105 -0.0236842105 -0.0136842105 -0.0036842105 0.0063157895
11 12 13 14 15
0.0063157895 0.0063157895 0.0063157895 0.0063157895 0.0063157895
16 17 18 19 20
0.0063157895 0.0063157895 0.0063157895 0.0063157895 0.0063157895
21 22 23 24 25
0.0063157895 0.0063157895 0.0063157895 0.0063157895 0.0063157895
26 27 28 29 30
0.0063157895 0.0063157895 0.0063157895 0.0063157895 0.0063157895
31 32 33 34 35
0.0063157895 0.0063157895 0.0063157895 0.0063157895 0.0063157895
36 37 38 39 40
0.0063157895 0.0063157895 0.0063157895 -0.0504347826 -0.0504347826
41 42 43 44 45
-0.0504347826 -0.0504347826 -0.0504347826 -0.0204347826 -0.0104347826
46 47 48 49 50
-0.0104347826 -0.0004347826 -0.0004347826 -0.0004347826 -0.0004347826
51 52 53 54 55
0.0195652174 0.0195652174 0.0195652174 0.0195652174 0.0195652174
56 57 58 59 60
0.0195652174 0.0295652174 0.0295652174 0.0395652174 0.0395652174
61
0.0395652174
> postscript(file="/var/www/html/rcomp/tmp/69euq1229783619.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.0236842105 NA
1 -0.0236842105 -0.0236842105
2 -0.0236842105 -0.0236842105
3 -0.0236842105 -0.0236842105
4 -0.0236842105 -0.0236842105
5 -0.0236842105 -0.0236842105
6 -0.0236842105 -0.0236842105
7 -0.0136842105 -0.0236842105
8 -0.0036842105 -0.0136842105
9 0.0063157895 -0.0036842105
10 0.0063157895 0.0063157895
11 0.0063157895 0.0063157895
12 0.0063157895 0.0063157895
13 0.0063157895 0.0063157895
14 0.0063157895 0.0063157895
15 0.0063157895 0.0063157895
16 0.0063157895 0.0063157895
17 0.0063157895 0.0063157895
18 0.0063157895 0.0063157895
19 0.0063157895 0.0063157895
20 0.0063157895 0.0063157895
21 0.0063157895 0.0063157895
22 0.0063157895 0.0063157895
23 0.0063157895 0.0063157895
24 0.0063157895 0.0063157895
25 0.0063157895 0.0063157895
26 0.0063157895 0.0063157895
27 0.0063157895 0.0063157895
28 0.0063157895 0.0063157895
29 0.0063157895 0.0063157895
30 0.0063157895 0.0063157895
31 0.0063157895 0.0063157895
32 0.0063157895 0.0063157895
33 0.0063157895 0.0063157895
34 0.0063157895 0.0063157895
35 0.0063157895 0.0063157895
36 0.0063157895 0.0063157895
37 0.0063157895 0.0063157895
38 -0.0504347826 0.0063157895
39 -0.0504347826 -0.0504347826
40 -0.0504347826 -0.0504347826
41 -0.0504347826 -0.0504347826
42 -0.0504347826 -0.0504347826
43 -0.0204347826 -0.0504347826
44 -0.0104347826 -0.0204347826
45 -0.0104347826 -0.0104347826
46 -0.0004347826 -0.0104347826
47 -0.0004347826 -0.0004347826
48 -0.0004347826 -0.0004347826
49 -0.0004347826 -0.0004347826
50 0.0195652174 -0.0004347826
51 0.0195652174 0.0195652174
52 0.0195652174 0.0195652174
53 0.0195652174 0.0195652174
54 0.0195652174 0.0195652174
55 0.0195652174 0.0195652174
56 0.0295652174 0.0195652174
57 0.0295652174 0.0295652174
58 0.0395652174 0.0295652174
59 0.0395652174 0.0395652174
60 0.0395652174 0.0395652174
61 NA 0.0395652174
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.0236842105 -0.0236842105
[2,] -0.0236842105 -0.0236842105
[3,] -0.0236842105 -0.0236842105
[4,] -0.0236842105 -0.0236842105
[5,] -0.0236842105 -0.0236842105
[6,] -0.0236842105 -0.0236842105
[7,] -0.0136842105 -0.0236842105
[8,] -0.0036842105 -0.0136842105
[9,] 0.0063157895 -0.0036842105
[10,] 0.0063157895 0.0063157895
[11,] 0.0063157895 0.0063157895
[12,] 0.0063157895 0.0063157895
[13,] 0.0063157895 0.0063157895
[14,] 0.0063157895 0.0063157895
[15,] 0.0063157895 0.0063157895
[16,] 0.0063157895 0.0063157895
[17,] 0.0063157895 0.0063157895
[18,] 0.0063157895 0.0063157895
[19,] 0.0063157895 0.0063157895
[20,] 0.0063157895 0.0063157895
[21,] 0.0063157895 0.0063157895
[22,] 0.0063157895 0.0063157895
[23,] 0.0063157895 0.0063157895
[24,] 0.0063157895 0.0063157895
[25,] 0.0063157895 0.0063157895
[26,] 0.0063157895 0.0063157895
[27,] 0.0063157895 0.0063157895
[28,] 0.0063157895 0.0063157895
[29,] 0.0063157895 0.0063157895
[30,] 0.0063157895 0.0063157895
[31,] 0.0063157895 0.0063157895
[32,] 0.0063157895 0.0063157895
[33,] 0.0063157895 0.0063157895
[34,] 0.0063157895 0.0063157895
[35,] 0.0063157895 0.0063157895
[36,] 0.0063157895 0.0063157895
[37,] 0.0063157895 0.0063157895
[38,] -0.0504347826 0.0063157895
[39,] -0.0504347826 -0.0504347826
[40,] -0.0504347826 -0.0504347826
[41,] -0.0504347826 -0.0504347826
[42,] -0.0504347826 -0.0504347826
[43,] -0.0204347826 -0.0504347826
[44,] -0.0104347826 -0.0204347826
[45,] -0.0104347826 -0.0104347826
[46,] -0.0004347826 -0.0104347826
[47,] -0.0004347826 -0.0004347826
[48,] -0.0004347826 -0.0004347826
[49,] -0.0004347826 -0.0004347826
[50,] 0.0195652174 -0.0004347826
[51,] 0.0195652174 0.0195652174
[52,] 0.0195652174 0.0195652174
[53,] 0.0195652174 0.0195652174
[54,] 0.0195652174 0.0195652174
[55,] 0.0195652174 0.0195652174
[56,] 0.0295652174 0.0195652174
[57,] 0.0295652174 0.0295652174
[58,] 0.0395652174 0.0295652174
[59,] 0.0395652174 0.0395652174
[60,] 0.0395652174 0.0395652174
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.0236842105 -0.0236842105
2 -0.0236842105 -0.0236842105
3 -0.0236842105 -0.0236842105
4 -0.0236842105 -0.0236842105
5 -0.0236842105 -0.0236842105
6 -0.0236842105 -0.0236842105
7 -0.0136842105 -0.0236842105
8 -0.0036842105 -0.0136842105
9 0.0063157895 -0.0036842105
10 0.0063157895 0.0063157895
11 0.0063157895 0.0063157895
12 0.0063157895 0.0063157895
13 0.0063157895 0.0063157895
14 0.0063157895 0.0063157895
15 0.0063157895 0.0063157895
16 0.0063157895 0.0063157895
17 0.0063157895 0.0063157895
18 0.0063157895 0.0063157895
19 0.0063157895 0.0063157895
20 0.0063157895 0.0063157895
21 0.0063157895 0.0063157895
22 0.0063157895 0.0063157895
23 0.0063157895 0.0063157895
24 0.0063157895 0.0063157895
25 0.0063157895 0.0063157895
26 0.0063157895 0.0063157895
27 0.0063157895 0.0063157895
28 0.0063157895 0.0063157895
29 0.0063157895 0.0063157895
30 0.0063157895 0.0063157895
31 0.0063157895 0.0063157895
32 0.0063157895 0.0063157895
33 0.0063157895 0.0063157895
34 0.0063157895 0.0063157895
35 0.0063157895 0.0063157895
36 0.0063157895 0.0063157895
37 0.0063157895 0.0063157895
38 -0.0504347826 0.0063157895
39 -0.0504347826 -0.0504347826
40 -0.0504347826 -0.0504347826
41 -0.0504347826 -0.0504347826
42 -0.0504347826 -0.0504347826
43 -0.0204347826 -0.0504347826
44 -0.0104347826 -0.0204347826
45 -0.0104347826 -0.0104347826
46 -0.0004347826 -0.0104347826
47 -0.0004347826 -0.0004347826
48 -0.0004347826 -0.0004347826
49 -0.0004347826 -0.0004347826
50 0.0195652174 -0.0004347826
51 0.0195652174 0.0195652174
52 0.0195652174 0.0195652174
53 0.0195652174 0.0195652174
54 0.0195652174 0.0195652174
55 0.0195652174 0.0195652174
56 0.0295652174 0.0195652174
57 0.0295652174 0.0295652174
58 0.0395652174 0.0295652174
59 0.0395652174 0.0395652174
60 0.0395652174 0.0395652174
> 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/742w01229783619.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/84m891229783619.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/9st9a1229783619.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/102dv91229783619.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/11j9lw1229783620.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/12lg2n1229783620.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/13i9rq1229783620.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/14vofd1229783620.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/15md191229783620.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/16dd6m1229783620.tab")
+ }
>
> system("convert tmp/1tk0c1229783619.ps tmp/1tk0c1229783619.png")
> system("convert tmp/26rc21229783619.ps tmp/26rc21229783619.png")
> system("convert tmp/31eq21229783619.ps tmp/31eq21229783619.png")
> system("convert tmp/4gt361229783619.ps tmp/4gt361229783619.png")
> system("convert tmp/5fsfk1229783619.ps tmp/5fsfk1229783619.png")
> system("convert tmp/69euq1229783619.ps tmp/69euq1229783619.png")
> system("convert tmp/742w01229783619.ps tmp/742w01229783619.png")
> system("convert tmp/84m891229783619.ps tmp/84m891229783619.png")
> system("convert tmp/9st9a1229783619.ps tmp/9st9a1229783619.png")
> system("convert tmp/102dv91229783619.ps tmp/102dv91229783619.png")
>
>
> proc.time()
user system elapsed
2.596 1.618 3.293