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(8.9,8.6,8.9,8.5,8.9,8.3,8.9,7.8,9,7.8,9,8,9,8.6,9,8.9,9,8.9,9,8.6,9,8.3,9.1,8.3,9,8.3,9.1,8.4,9.1,8.5,9,8.4,9,8.6,9,8.5,9,8.5,8.9,8.4,8.9,8.5,8.9,8.5,8.9,8.5,8.8,8.5,8.8,8.5,8.7,8.5,8.7,8.5,8.5,8.5,8.5,8.6,8.4,8.4,8.2,8.1,8.2,8,8.1,8,8.1,8,8,8,7.9,7.9,7.8,7.8,7.7,7.8,7.6,7.9,7.5,8.1,7.5,8,7.5,7.6,7.5,7.3,7.5,7,7.4,6.8,7.4,7,7.3,7.1,7.3,7.2,7.3,7.1,7.2,6.9,7.2,6.7,7.3,6.7,7.4,6.6,7.4,6.9,7.5,7.3,7.6,7.5,7.7,7.3,7.9,7.1,8,6.9,8.2,7.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 8.9 8.6
2 8.9 8.5
3 8.9 8.3
4 8.9 7.8
5 9.0 7.8
6 9.0 8.0
7 9.0 8.6
8 9.0 8.9
9 9.0 8.9
10 9.0 8.6
11 9.0 8.3
12 9.1 8.3
13 9.0 8.3
14 9.1 8.4
15 9.1 8.5
16 9.0 8.4
17 9.0 8.6
18 9.0 8.5
19 9.0 8.5
20 8.9 8.4
21 8.9 8.5
22 8.9 8.5
23 8.9 8.5
24 8.8 8.5
25 8.8 8.5
26 8.7 8.5
27 8.7 8.5
28 8.5 8.5
29 8.5 8.6
30 8.4 8.4
31 8.2 8.1
32 8.2 8.0
33 8.1 8.0
34 8.1 8.0
35 8.0 8.0
36 7.9 7.9
37 7.8 7.8
38 7.7 7.8
39 7.6 7.9
40 7.5 8.1
41 7.5 8.0
42 7.5 7.6
43 7.5 7.3
44 7.5 7.0
45 7.4 6.8
46 7.4 7.0
47 7.3 7.1
48 7.3 7.2
49 7.3 7.1
50 7.2 6.9
51 7.2 6.7
52 7.3 6.7
53 7.4 6.6
54 7.4 6.9
55 7.5 7.3
56 7.6 7.5
57 7.7 7.3
58 7.9 7.1
59 8.0 6.9
60 8.2 7.1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
1.2767 0.8833
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.93175 -0.24467 0.01491 0.21491 0.83325
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.27667 0.57852 2.207 0.0313 *
X 0.88334 0.07285 12.126 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.3668 on 58 degrees of freedom
Multiple R-squared: 0.7171, Adjusted R-squared: 0.7123
F-statistic: 147 on 1 and 58 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,] 2.405397e-03 4.810794e-03 0.99759460
[2,] 7.391472e-04 1.478294e-03 0.99926085
[3,] 3.941112e-04 7.882223e-04 0.99960589
[4,] 1.073355e-04 2.146710e-04 0.99989266
[5,] 2.069052e-05 4.138105e-05 0.99997931
[6,] 3.856052e-06 7.712105e-06 0.99999614
[7,] 8.497357e-07 1.699471e-06 0.99999915
[8,] 2.133937e-06 4.267873e-06 0.99999787
[9,] 5.174077e-07 1.034815e-06 0.99999948
[10,] 6.255134e-07 1.251027e-06 0.99999937
[11,] 5.104849e-07 1.020970e-06 0.99999949
[12,] 1.466773e-07 2.933545e-07 0.99999985
[13,] 3.563362e-08 7.126724e-08 0.99999996
[14,] 9.866011e-09 1.973202e-08 0.99999999
[15,] 2.927999e-09 5.855998e-09 1.00000000
[16,] 2.433781e-09 4.867562e-09 1.00000000
[17,] 1.827794e-09 3.655589e-09 1.00000000
[18,] 1.416113e-09 2.832226e-09 1.00000000
[19,] 1.219518e-09 2.439036e-09 1.00000000
[20,] 7.448403e-09 1.489681e-08 0.99999999
[21,] 3.063418e-08 6.126836e-08 0.99999997
[22,] 6.047009e-07 1.209402e-06 0.99999940
[23,] 5.340978e-06 1.068196e-05 0.99999466
[24,] 3.260318e-04 6.520636e-04 0.99967397
[25,] 2.651493e-03 5.302985e-03 0.99734851
[26,] 2.266595e-02 4.533190e-02 0.97733405
[27,] 1.617999e-01 3.235997e-01 0.83820015
[28,] 3.638352e-01 7.276703e-01 0.63616483
[29,] 5.613458e-01 8.773084e-01 0.43865418
[30,] 7.017726e-01 5.964548e-01 0.29822738
[31,] 8.008679e-01 3.982641e-01 0.19913207
[32,] 8.541204e-01 2.917591e-01 0.14587956
[33,] 8.751691e-01 2.496619e-01 0.12483094
[34,] 8.838331e-01 2.323337e-01 0.11616687
[35,] 8.982923e-01 2.034154e-01 0.10170771
[36,] 9.348029e-01 1.303942e-01 0.06519712
[37,] 9.463410e-01 1.073181e-01 0.05365903
[38,] 9.300806e-01 1.398387e-01 0.06991936
[39,] 8.976866e-01 2.046269e-01 0.10231343
[40,] 8.577618e-01 2.844764e-01 0.14223822
[41,] 8.082695e-01 3.834609e-01 0.19173047
[42,] 7.425870e-01 5.148260e-01 0.25741302
[43,] 6.985772e-01 6.028456e-01 0.30142280
[44,] 6.785866e-01 6.428268e-01 0.32141339
[45,] 6.502419e-01 6.995162e-01 0.34975810
[46,] 6.398444e-01 7.203112e-01 0.36015559
[47,] 6.178508e-01 7.642984e-01 0.38214918
[48,] 5.910670e-01 8.178661e-01 0.40893304
[49,] 6.171291e-01 7.657419e-01 0.38287093
[50,] 8.830258e-01 2.339483e-01 0.11697417
[51,] 8.766018e-01 2.467963e-01 0.12339817
> postscript(file="/var/www/html/rcomp/tmp/1s27u1258705833.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/27nv91258705833.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/3v2ij1258705833.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/4o7a01258705833.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/5cnre1258705833.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
0.026576355 0.114910707 0.291579411 0.733251172 0.833251172 0.656582467
7 8 9 10 11 12
0.126576355 -0.138426702 -0.138426702 0.126576355 0.391579411 0.491579411
13 14 15 16 17 18
0.391579411 0.403245059 0.314910707 0.303245059 0.126576355 0.214910707
19 20 21 22 23 24
0.214910707 0.203245059 0.114910707 0.114910707 0.114910707 0.014910707
25 26 27 28 29 30
0.014910707 -0.085089293 -0.085089293 -0.285089293 -0.373423645 -0.296754941
31 32 33 34 35 36
-0.231751885 -0.143417533 -0.243417533 -0.243417533 -0.343417533 -0.355083181
37 38 39 40 41 42
-0.366748828 -0.466748828 -0.655083181 -0.931751885 -0.843417533 -0.490080124
43 44 45 46 47 48
-0.225077068 0.039925989 0.116594693 -0.060074011 -0.248408363 -0.336742716
49 50 51 52 53 54
-0.248408363 -0.171739659 0.004929045 0.104929045 0.293263397 0.028260341
55 56 57 58 59 60
-0.225077068 -0.301745772 -0.025077068 0.351591637 0.628260341 0.651591637
> postscript(file="/var/www/html/rcomp/tmp/6jvtr1258705833.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 0.026576355 NA
1 0.114910707 0.026576355
2 0.291579411 0.114910707
3 0.733251172 0.291579411
4 0.833251172 0.733251172
5 0.656582467 0.833251172
6 0.126576355 0.656582467
7 -0.138426702 0.126576355
8 -0.138426702 -0.138426702
9 0.126576355 -0.138426702
10 0.391579411 0.126576355
11 0.491579411 0.391579411
12 0.391579411 0.491579411
13 0.403245059 0.391579411
14 0.314910707 0.403245059
15 0.303245059 0.314910707
16 0.126576355 0.303245059
17 0.214910707 0.126576355
18 0.214910707 0.214910707
19 0.203245059 0.214910707
20 0.114910707 0.203245059
21 0.114910707 0.114910707
22 0.114910707 0.114910707
23 0.014910707 0.114910707
24 0.014910707 0.014910707
25 -0.085089293 0.014910707
26 -0.085089293 -0.085089293
27 -0.285089293 -0.085089293
28 -0.373423645 -0.285089293
29 -0.296754941 -0.373423645
30 -0.231751885 -0.296754941
31 -0.143417533 -0.231751885
32 -0.243417533 -0.143417533
33 -0.243417533 -0.243417533
34 -0.343417533 -0.243417533
35 -0.355083181 -0.343417533
36 -0.366748828 -0.355083181
37 -0.466748828 -0.366748828
38 -0.655083181 -0.466748828
39 -0.931751885 -0.655083181
40 -0.843417533 -0.931751885
41 -0.490080124 -0.843417533
42 -0.225077068 -0.490080124
43 0.039925989 -0.225077068
44 0.116594693 0.039925989
45 -0.060074011 0.116594693
46 -0.248408363 -0.060074011
47 -0.336742716 -0.248408363
48 -0.248408363 -0.336742716
49 -0.171739659 -0.248408363
50 0.004929045 -0.171739659
51 0.104929045 0.004929045
52 0.293263397 0.104929045
53 0.028260341 0.293263397
54 -0.225077068 0.028260341
55 -0.301745772 -0.225077068
56 -0.025077068 -0.301745772
57 0.351591637 -0.025077068
58 0.628260341 0.351591637
59 0.651591637 0.628260341
60 NA 0.651591637
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.114910707 0.026576355
[2,] 0.291579411 0.114910707
[3,] 0.733251172 0.291579411
[4,] 0.833251172 0.733251172
[5,] 0.656582467 0.833251172
[6,] 0.126576355 0.656582467
[7,] -0.138426702 0.126576355
[8,] -0.138426702 -0.138426702
[9,] 0.126576355 -0.138426702
[10,] 0.391579411 0.126576355
[11,] 0.491579411 0.391579411
[12,] 0.391579411 0.491579411
[13,] 0.403245059 0.391579411
[14,] 0.314910707 0.403245059
[15,] 0.303245059 0.314910707
[16,] 0.126576355 0.303245059
[17,] 0.214910707 0.126576355
[18,] 0.214910707 0.214910707
[19,] 0.203245059 0.214910707
[20,] 0.114910707 0.203245059
[21,] 0.114910707 0.114910707
[22,] 0.114910707 0.114910707
[23,] 0.014910707 0.114910707
[24,] 0.014910707 0.014910707
[25,] -0.085089293 0.014910707
[26,] -0.085089293 -0.085089293
[27,] -0.285089293 -0.085089293
[28,] -0.373423645 -0.285089293
[29,] -0.296754941 -0.373423645
[30,] -0.231751885 -0.296754941
[31,] -0.143417533 -0.231751885
[32,] -0.243417533 -0.143417533
[33,] -0.243417533 -0.243417533
[34,] -0.343417533 -0.243417533
[35,] -0.355083181 -0.343417533
[36,] -0.366748828 -0.355083181
[37,] -0.466748828 -0.366748828
[38,] -0.655083181 -0.466748828
[39,] -0.931751885 -0.655083181
[40,] -0.843417533 -0.931751885
[41,] -0.490080124 -0.843417533
[42,] -0.225077068 -0.490080124
[43,] 0.039925989 -0.225077068
[44,] 0.116594693 0.039925989
[45,] -0.060074011 0.116594693
[46,] -0.248408363 -0.060074011
[47,] -0.336742716 -0.248408363
[48,] -0.248408363 -0.336742716
[49,] -0.171739659 -0.248408363
[50,] 0.004929045 -0.171739659
[51,] 0.104929045 0.004929045
[52,] 0.293263397 0.104929045
[53,] 0.028260341 0.293263397
[54,] -0.225077068 0.028260341
[55,] -0.301745772 -0.225077068
[56,] -0.025077068 -0.301745772
[57,] 0.351591637 -0.025077068
[58,] 0.628260341 0.351591637
[59,] 0.651591637 0.628260341
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.114910707 0.026576355
2 0.291579411 0.114910707
3 0.733251172 0.291579411
4 0.833251172 0.733251172
5 0.656582467 0.833251172
6 0.126576355 0.656582467
7 -0.138426702 0.126576355
8 -0.138426702 -0.138426702
9 0.126576355 -0.138426702
10 0.391579411 0.126576355
11 0.491579411 0.391579411
12 0.391579411 0.491579411
13 0.403245059 0.391579411
14 0.314910707 0.403245059
15 0.303245059 0.314910707
16 0.126576355 0.303245059
17 0.214910707 0.126576355
18 0.214910707 0.214910707
19 0.203245059 0.214910707
20 0.114910707 0.203245059
21 0.114910707 0.114910707
22 0.114910707 0.114910707
23 0.014910707 0.114910707
24 0.014910707 0.014910707
25 -0.085089293 0.014910707
26 -0.085089293 -0.085089293
27 -0.285089293 -0.085089293
28 -0.373423645 -0.285089293
29 -0.296754941 -0.373423645
30 -0.231751885 -0.296754941
31 -0.143417533 -0.231751885
32 -0.243417533 -0.143417533
33 -0.243417533 -0.243417533
34 -0.343417533 -0.243417533
35 -0.355083181 -0.343417533
36 -0.366748828 -0.355083181
37 -0.466748828 -0.366748828
38 -0.655083181 -0.466748828
39 -0.931751885 -0.655083181
40 -0.843417533 -0.931751885
41 -0.490080124 -0.843417533
42 -0.225077068 -0.490080124
43 0.039925989 -0.225077068
44 0.116594693 0.039925989
45 -0.060074011 0.116594693
46 -0.248408363 -0.060074011
47 -0.336742716 -0.248408363
48 -0.248408363 -0.336742716
49 -0.171739659 -0.248408363
50 0.004929045 -0.171739659
51 0.104929045 0.004929045
52 0.293263397 0.104929045
53 0.028260341 0.293263397
54 -0.225077068 0.028260341
55 -0.301745772 -0.225077068
56 -0.025077068 -0.301745772
57 0.351591637 -0.025077068
58 0.628260341 0.351591637
59 0.651591637 0.628260341
> 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/7vpux1258705833.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/8x3mv1258705833.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/9jkk51258705833.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/10nfj31258705833.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/11qwkc1258705833.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/12bf2q1258705833.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/13bmfc1258705833.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/14rksj1258705833.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/15zh7g1258705833.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/16qctd1258705833.tab")
+ }
>
> system("convert tmp/1s27u1258705833.ps tmp/1s27u1258705833.png")
> system("convert tmp/27nv91258705833.ps tmp/27nv91258705833.png")
> system("convert tmp/3v2ij1258705833.ps tmp/3v2ij1258705833.png")
> system("convert tmp/4o7a01258705833.ps tmp/4o7a01258705833.png")
> system("convert tmp/5cnre1258705833.ps tmp/5cnre1258705833.png")
> system("convert tmp/6jvtr1258705833.ps tmp/6jvtr1258705833.png")
> system("convert tmp/7vpux1258705833.ps tmp/7vpux1258705833.png")
> system("convert tmp/8x3mv1258705833.ps tmp/8x3mv1258705833.png")
> system("convert tmp/9jkk51258705833.ps tmp/9jkk51258705833.png")
> system("convert tmp/10nfj31258705833.ps tmp/10nfj31258705833.png")
>
>
> proc.time()
user system elapsed
2.421 1.526 2.932