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.11,0,2.09,0,2.05,0,2.08,0,2.06,0,2.06,0,2.08,0,2.07,0,2.06,0,2.07,0,2.06,0,2.09,0,2.07,0,2.09,0,2.28,0,2.33,0,2.35,0,2.52,0,2.63,0,2.58,0,2.70,0,2.81,0,2.97,0,3.04,0,3.28,0,3.33,0,3.50,0,3.56,0,3.57,0,3.69,0,3.82,0,3.79,0,3.96,0,4.06,0,4.05,0,4.03,0,3.94,0,4.02,0,3.88,0,4.02,0,4.03,0,4.09,0,3.99,0,4.01,0,4.01,0,4.19,0,4.30,0,4.27,0,3.82,0,3.15,1,2.49,1,1.81,1,1.26,1,1.06,1,0.84,1,0.78,1,0.70,1,0.36,1,0.35,1,0.36,1),dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> 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 2.11 0
2 2.09 0
3 2.05 0
4 2.08 0
5 2.06 0
6 2.06 0
7 2.08 0
8 2.07 0
9 2.06 0
10 2.07 0
11 2.06 0
12 2.09 0
13 2.07 0
14 2.09 0
15 2.28 0
16 2.33 0
17 2.35 0
18 2.52 0
19 2.63 0
20 2.58 0
21 2.70 0
22 2.81 0
23 2.97 0
24 3.04 0
25 3.28 0
26 3.33 0
27 3.50 0
28 3.56 0
29 3.57 0
30 3.69 0
31 3.82 0
32 3.79 0
33 3.96 0
34 4.06 0
35 4.05 0
36 4.03 0
37 3.94 0
38 4.02 0
39 3.88 0
40 4.02 0
41 4.03 0
42 4.09 0
43 3.99 0
44 4.01 0
45 4.01 0
46 4.19 0
47 4.30 0
48 4.27 0
49 3.82 0
50 3.15 1
51 2.49 1
52 1.81 1
53 1.26 1
54 1.06 1
55 0.84 1
56 0.78 1
57 0.70 1
58 0.36 1
59 0.35 1
60 0.36 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
3.111 -1.915
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.0614 -0.8389 -0.1039 0.8561 1.9536
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.1114 0.1237 25.160 < 2e-16 ***
X -1.9151 0.2888 -6.631 1.22e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.8657 on 58 degrees of freedom
Multiple R-squared: 0.4312, Adjusted R-squared: 0.4214
F-statistic: 43.97 on 1 and 58 DF, p-value: 1.219e-08
> 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,] 4.925832e-05 9.851664e-05 0.99995074
[2,] 1.747545e-06 3.495089e-06 0.99999825
[3,] 5.010578e-08 1.002116e-07 0.99999995
[4,] 1.403865e-09 2.807729e-09 1.00000000
[5,] 4.867850e-11 9.735700e-11 1.00000000
[6,] 1.364095e-12 2.728190e-12 1.00000000
[7,] 4.895551e-14 9.791102e-14 1.00000000
[8,] 2.364643e-15 4.729286e-15 1.00000000
[9,] 8.045002e-17 1.609000e-16 1.00000000
[10,] 4.646204e-18 9.292409e-18 1.00000000
[11,] 1.795914e-12 3.591828e-12 1.00000000
[12,] 7.020736e-11 1.404147e-10 1.00000000
[13,] 4.524155e-10 9.048310e-10 1.00000000
[14,] 2.272048e-08 4.544096e-08 0.99999998
[15,] 6.268340e-07 1.253668e-06 0.99999937
[16,] 2.876661e-06 5.753322e-06 0.99999712
[17,] 2.068191e-05 4.136382e-05 0.99997932
[18,] 1.591190e-04 3.182381e-04 0.99984088
[19,] 1.334113e-03 2.668227e-03 0.99866589
[20,] 6.714864e-03 1.342973e-02 0.99328514
[21,] 3.399403e-02 6.798805e-02 0.96600597
[22,] 9.341394e-02 1.868279e-01 0.90658606
[23,] 2.043766e-01 4.087533e-01 0.79562336
[24,] 3.305126e-01 6.610252e-01 0.66948738
[25,] 4.385916e-01 8.771833e-01 0.56140837
[26,] 5.410440e-01 9.179119e-01 0.45895596
[27,] 6.322101e-01 7.355798e-01 0.36778991
[28,] 6.854113e-01 6.291774e-01 0.31458871
[29,] 7.375710e-01 5.248579e-01 0.26242896
[30,] 7.786587e-01 4.426826e-01 0.22134130
[31,] 7.989625e-01 4.020749e-01 0.20103747
[32,] 8.047130e-01 3.905740e-01 0.19528700
[33,] 7.952143e-01 4.095714e-01 0.20478569
[34,] 7.840546e-01 4.318909e-01 0.21594544
[35,] 7.588369e-01 4.823262e-01 0.24116312
[36,] 7.341247e-01 5.317507e-01 0.26587533
[37,] 7.028583e-01 5.942835e-01 0.29714174
[38,] 6.681394e-01 6.637211e-01 0.33186057
[39,] 6.203336e-01 7.593328e-01 0.37966640
[40,] 5.669042e-01 8.661915e-01 0.43309577
[41,] 5.078377e-01 9.843246e-01 0.49216228
[42,] 4.531084e-01 9.062169e-01 0.54689155
[43,] 4.035274e-01 8.070548e-01 0.59647259
[44,] 3.523278e-01 7.046555e-01 0.64767224
[45,] 2.732228e-01 5.464455e-01 0.72677725
[46,] 6.490567e-01 7.018867e-01 0.35094334
[47,] 9.116438e-01 1.767124e-01 0.08835622
[48,] 9.779266e-01 4.414675e-02 0.02207337
[49,] 9.841417e-01 3.171663e-02 0.01585831
[50,] 9.843671e-01 3.126580e-02 0.01563290
[51,] 9.698400e-01 6.031992e-02 0.03015996
> postscript(file="/var/www/html/rcomp/tmp/1pqh41258648428.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/228zd1258648428.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/39gxd1258648428.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/4ui2i1258648428.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/5uy701258648428.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 = 60
Frequency = 1
1 2 3 4 5 6
-1.00142857 -1.02142857 -1.06142857 -1.03142857 -1.05142857 -1.05142857
7 8 9 10 11 12
-1.03142857 -1.04142857 -1.05142857 -1.04142857 -1.05142857 -1.02142857
13 14 15 16 17 18
-1.04142857 -1.02142857 -0.83142857 -0.78142857 -0.76142857 -0.59142857
19 20 21 22 23 24
-0.48142857 -0.53142857 -0.41142857 -0.30142857 -0.14142857 -0.07142857
25 26 27 28 29 30
0.16857143 0.21857143 0.38857143 0.44857143 0.45857143 0.57857143
31 32 33 34 35 36
0.70857143 0.67857143 0.84857143 0.94857143 0.93857143 0.91857143
37 38 39 40 41 42
0.82857143 0.90857143 0.76857143 0.90857143 0.91857143 0.97857143
43 44 45 46 47 48
0.87857143 0.89857143 0.89857143 1.07857143 1.18857143 1.15857143
49 50 51 52 53 54
0.70857143 1.95363636 1.29363636 0.61363636 0.06363636 -0.13636364
55 56 57 58 59 60
-0.35636364 -0.41636364 -0.49636364 -0.83636364 -0.84636364 -0.83636364
> postscript(file="/var/www/html/rcomp/tmp/698aj1258648428.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 -1.00142857 NA
1 -1.02142857 -1.00142857
2 -1.06142857 -1.02142857
3 -1.03142857 -1.06142857
4 -1.05142857 -1.03142857
5 -1.05142857 -1.05142857
6 -1.03142857 -1.05142857
7 -1.04142857 -1.03142857
8 -1.05142857 -1.04142857
9 -1.04142857 -1.05142857
10 -1.05142857 -1.04142857
11 -1.02142857 -1.05142857
12 -1.04142857 -1.02142857
13 -1.02142857 -1.04142857
14 -0.83142857 -1.02142857
15 -0.78142857 -0.83142857
16 -0.76142857 -0.78142857
17 -0.59142857 -0.76142857
18 -0.48142857 -0.59142857
19 -0.53142857 -0.48142857
20 -0.41142857 -0.53142857
21 -0.30142857 -0.41142857
22 -0.14142857 -0.30142857
23 -0.07142857 -0.14142857
24 0.16857143 -0.07142857
25 0.21857143 0.16857143
26 0.38857143 0.21857143
27 0.44857143 0.38857143
28 0.45857143 0.44857143
29 0.57857143 0.45857143
30 0.70857143 0.57857143
31 0.67857143 0.70857143
32 0.84857143 0.67857143
33 0.94857143 0.84857143
34 0.93857143 0.94857143
35 0.91857143 0.93857143
36 0.82857143 0.91857143
37 0.90857143 0.82857143
38 0.76857143 0.90857143
39 0.90857143 0.76857143
40 0.91857143 0.90857143
41 0.97857143 0.91857143
42 0.87857143 0.97857143
43 0.89857143 0.87857143
44 0.89857143 0.89857143
45 1.07857143 0.89857143
46 1.18857143 1.07857143
47 1.15857143 1.18857143
48 0.70857143 1.15857143
49 1.95363636 0.70857143
50 1.29363636 1.95363636
51 0.61363636 1.29363636
52 0.06363636 0.61363636
53 -0.13636364 0.06363636
54 -0.35636364 -0.13636364
55 -0.41636364 -0.35636364
56 -0.49636364 -0.41636364
57 -0.83636364 -0.49636364
58 -0.84636364 -0.83636364
59 -0.83636364 -0.84636364
60 NA -0.83636364
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.02142857 -1.00142857
[2,] -1.06142857 -1.02142857
[3,] -1.03142857 -1.06142857
[4,] -1.05142857 -1.03142857
[5,] -1.05142857 -1.05142857
[6,] -1.03142857 -1.05142857
[7,] -1.04142857 -1.03142857
[8,] -1.05142857 -1.04142857
[9,] -1.04142857 -1.05142857
[10,] -1.05142857 -1.04142857
[11,] -1.02142857 -1.05142857
[12,] -1.04142857 -1.02142857
[13,] -1.02142857 -1.04142857
[14,] -0.83142857 -1.02142857
[15,] -0.78142857 -0.83142857
[16,] -0.76142857 -0.78142857
[17,] -0.59142857 -0.76142857
[18,] -0.48142857 -0.59142857
[19,] -0.53142857 -0.48142857
[20,] -0.41142857 -0.53142857
[21,] -0.30142857 -0.41142857
[22,] -0.14142857 -0.30142857
[23,] -0.07142857 -0.14142857
[24,] 0.16857143 -0.07142857
[25,] 0.21857143 0.16857143
[26,] 0.38857143 0.21857143
[27,] 0.44857143 0.38857143
[28,] 0.45857143 0.44857143
[29,] 0.57857143 0.45857143
[30,] 0.70857143 0.57857143
[31,] 0.67857143 0.70857143
[32,] 0.84857143 0.67857143
[33,] 0.94857143 0.84857143
[34,] 0.93857143 0.94857143
[35,] 0.91857143 0.93857143
[36,] 0.82857143 0.91857143
[37,] 0.90857143 0.82857143
[38,] 0.76857143 0.90857143
[39,] 0.90857143 0.76857143
[40,] 0.91857143 0.90857143
[41,] 0.97857143 0.91857143
[42,] 0.87857143 0.97857143
[43,] 0.89857143 0.87857143
[44,] 0.89857143 0.89857143
[45,] 1.07857143 0.89857143
[46,] 1.18857143 1.07857143
[47,] 1.15857143 1.18857143
[48,] 0.70857143 1.15857143
[49,] 1.95363636 0.70857143
[50,] 1.29363636 1.95363636
[51,] 0.61363636 1.29363636
[52,] 0.06363636 0.61363636
[53,] -0.13636364 0.06363636
[54,] -0.35636364 -0.13636364
[55,] -0.41636364 -0.35636364
[56,] -0.49636364 -0.41636364
[57,] -0.83636364 -0.49636364
[58,] -0.84636364 -0.83636364
[59,] -0.83636364 -0.84636364
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.02142857 -1.00142857
2 -1.06142857 -1.02142857
3 -1.03142857 -1.06142857
4 -1.05142857 -1.03142857
5 -1.05142857 -1.05142857
6 -1.03142857 -1.05142857
7 -1.04142857 -1.03142857
8 -1.05142857 -1.04142857
9 -1.04142857 -1.05142857
10 -1.05142857 -1.04142857
11 -1.02142857 -1.05142857
12 -1.04142857 -1.02142857
13 -1.02142857 -1.04142857
14 -0.83142857 -1.02142857
15 -0.78142857 -0.83142857
16 -0.76142857 -0.78142857
17 -0.59142857 -0.76142857
18 -0.48142857 -0.59142857
19 -0.53142857 -0.48142857
20 -0.41142857 -0.53142857
21 -0.30142857 -0.41142857
22 -0.14142857 -0.30142857
23 -0.07142857 -0.14142857
24 0.16857143 -0.07142857
25 0.21857143 0.16857143
26 0.38857143 0.21857143
27 0.44857143 0.38857143
28 0.45857143 0.44857143
29 0.57857143 0.45857143
30 0.70857143 0.57857143
31 0.67857143 0.70857143
32 0.84857143 0.67857143
33 0.94857143 0.84857143
34 0.93857143 0.94857143
35 0.91857143 0.93857143
36 0.82857143 0.91857143
37 0.90857143 0.82857143
38 0.76857143 0.90857143
39 0.90857143 0.76857143
40 0.91857143 0.90857143
41 0.97857143 0.91857143
42 0.87857143 0.97857143
43 0.89857143 0.87857143
44 0.89857143 0.89857143
45 1.07857143 0.89857143
46 1.18857143 1.07857143
47 1.15857143 1.18857143
48 0.70857143 1.15857143
49 1.95363636 0.70857143
50 1.29363636 1.95363636
51 0.61363636 1.29363636
52 0.06363636 0.61363636
53 -0.13636364 0.06363636
54 -0.35636364 -0.13636364
55 -0.41636364 -0.35636364
56 -0.49636364 -0.41636364
57 -0.83636364 -0.49636364
58 -0.84636364 -0.83636364
59 -0.83636364 -0.84636364
> 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/77j591258648428.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/8dza11258648428.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/9vdpo1258648428.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/10kcb71258648428.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/11eytw1258648428.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/12e5911258648428.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/13qh851258648428.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/14kho91258648428.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/152dgi1258648428.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/16t1yr1258648428.tab")
+ }
>
> system("convert tmp/1pqh41258648428.ps tmp/1pqh41258648428.png")
> system("convert tmp/228zd1258648428.ps tmp/228zd1258648428.png")
> system("convert tmp/39gxd1258648428.ps tmp/39gxd1258648428.png")
> system("convert tmp/4ui2i1258648428.ps tmp/4ui2i1258648428.png")
> system("convert tmp/5uy701258648428.ps tmp/5uy701258648428.png")
> system("convert tmp/698aj1258648428.ps tmp/698aj1258648428.png")
> system("convert tmp/77j591258648428.ps tmp/77j591258648428.png")
> system("convert tmp/8dza11258648428.ps tmp/8dza11258648428.png")
> system("convert tmp/9vdpo1258648428.ps tmp/9vdpo1258648428.png")
> system("convert tmp/10kcb71258648428.ps tmp/10kcb71258648428.png")
>
>
> proc.time()
user system elapsed
2.465 1.554 2.917