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(115.6,0,111.3,0,114.6,0,137.5,0,83.7,0,106.0,0,123.4,0,126.5,0,120.0,0,141.6,0,90.5,0,96.5,0,113.5,0,120.1,0,123.9,0,144.4,0,90.8,0,114.2,0,138.1,0,135.0,0,131.3,0,144.6,0,101.7,0,108.7,0,135.3,0,124.3,0,138.3,0,158.2,0,93.5,0,124.8,0,154.4,0,152.8,0,148.9,0,170.3,0,124.8,0,134.4,0,154.0,0,147.9,0,168.1,0,175.7,0,116.7,0,140.8,0,164.2,0,173.8,0,167.8,0,166.6,0,135.1,1,158.1,1,151.8,1,166.7,1,165.3,1,187.0,1,125.2,1,144.4,1,181.7,1,175.9,1,166.3,1,181.5,1,121.8,1,134.8,1,162.9,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 = 'Include Monthly 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 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 115.6 0 1 0 0 0 0 0 0 0 0 0 0
2 111.3 0 0 1 0 0 0 0 0 0 0 0 0
3 114.6 0 0 0 1 0 0 0 0 0 0 0 0
4 137.5 0 0 0 0 1 0 0 0 0 0 0 0
5 83.7 0 0 0 0 0 1 0 0 0 0 0 0
6 106.0 0 0 0 0 0 0 1 0 0 0 0 0
7 123.4 0 0 0 0 0 0 0 1 0 0 0 0
8 126.5 0 0 0 0 0 0 0 0 1 0 0 0
9 120.0 0 0 0 0 0 0 0 0 0 1 0 0
10 141.6 0 0 0 0 0 0 0 0 0 0 1 0
11 90.5 0 0 0 0 0 0 0 0 0 0 0 1
12 96.5 0 0 0 0 0 0 0 0 0 0 0 0
13 113.5 0 1 0 0 0 0 0 0 0 0 0 0
14 120.1 0 0 1 0 0 0 0 0 0 0 0 0
15 123.9 0 0 0 1 0 0 0 0 0 0 0 0
16 144.4 0 0 0 0 1 0 0 0 0 0 0 0
17 90.8 0 0 0 0 0 1 0 0 0 0 0 0
18 114.2 0 0 0 0 0 0 1 0 0 0 0 0
19 138.1 0 0 0 0 0 0 0 1 0 0 0 0
20 135.0 0 0 0 0 0 0 0 0 1 0 0 0
21 131.3 0 0 0 0 0 0 0 0 0 1 0 0
22 144.6 0 0 0 0 0 0 0 0 0 0 1 0
23 101.7 0 0 0 0 0 0 0 0 0 0 0 1
24 108.7 0 0 0 0 0 0 0 0 0 0 0 0
25 135.3 0 1 0 0 0 0 0 0 0 0 0 0
26 124.3 0 0 1 0 0 0 0 0 0 0 0 0
27 138.3 0 0 0 1 0 0 0 0 0 0 0 0
28 158.2 0 0 0 0 1 0 0 0 0 0 0 0
29 93.5 0 0 0 0 0 1 0 0 0 0 0 0
30 124.8 0 0 0 0 0 0 1 0 0 0 0 0
31 154.4 0 0 0 0 0 0 0 1 0 0 0 0
32 152.8 0 0 0 0 0 0 0 0 1 0 0 0
33 148.9 0 0 0 0 0 0 0 0 0 1 0 0
34 170.3 0 0 0 0 0 0 0 0 0 0 1 0
35 124.8 0 0 0 0 0 0 0 0 0 0 0 1
36 134.4 0 0 0 0 0 0 0 0 0 0 0 0
37 154.0 0 1 0 0 0 0 0 0 0 0 0 0
38 147.9 0 0 1 0 0 0 0 0 0 0 0 0
39 168.1 0 0 0 1 0 0 0 0 0 0 0 0
40 175.7 0 0 0 0 1 0 0 0 0 0 0 0
41 116.7 0 0 0 0 0 1 0 0 0 0 0 0
42 140.8 0 0 0 0 0 0 1 0 0 0 0 0
43 164.2 0 0 0 0 0 0 0 1 0 0 0 0
44 173.8 0 0 0 0 0 0 0 0 1 0 0 0
45 167.8 0 0 0 0 0 0 0 0 0 1 0 0
46 166.6 0 0 0 0 0 0 0 0 0 0 1 0
47 135.1 1 0 0 0 0 0 0 0 0 0 0 1
48 158.1 1 0 0 0 0 0 0 0 0 0 0 0
49 151.8 1 1 0 0 0 0 0 0 0 0 0 0
50 166.7 1 0 1 0 0 0 0 0 0 0 0 0
51 165.3 1 0 0 1 0 0 0 0 0 0 0 0
52 187.0 1 0 0 0 1 0 0 0 0 0 0 0
53 125.2 1 0 0 0 0 1 0 0 0 0 0 0
54 144.4 1 0 0 0 0 0 1 0 0 0 0 0
55 181.7 1 0 0 0 0 0 0 1 0 0 0 0
56 175.9 1 0 0 0 0 0 0 0 1 0 0 0
57 166.3 1 0 0 0 0 0 0 0 0 1 0 0
58 181.5 1 0 0 0 0 0 0 0 0 0 1 0
59 121.8 1 0 0 0 0 0 0 0 0 0 0 1
60 134.8 1 0 0 0 0 0 0 0 0 0 0 0
61 162.9 1 1 0 0 0 0 0 0 0 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X M1 M2 M3 M4
114.770 29.325 14.305 13.425 21.405 39.925
M5 M6 M7 M8 M9 M10
-18.655 5.405 31.725 32.165 26.225 40.285
M11
-11.720
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-23.095 -10.575 -2.615 7.905 31.925
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 114.770 7.304 15.714 < 2e-16 ***
X 29.325 4.768 6.151 1.48e-07 ***
M1 14.305 9.552 1.498 0.140773
M2 13.425 10.016 1.340 0.186455
M3 21.405 10.016 2.137 0.037721 *
M4 39.925 10.016 3.986 0.000228 ***
M5 -18.655 10.016 -1.862 0.068666 .
M6 5.405 10.016 0.540 0.591956
M7 31.725 10.016 3.167 0.002675 **
M8 32.165 10.016 3.211 0.002360 **
M9 26.225 10.016 2.618 0.011791 *
M10 40.285 10.016 4.022 0.000203 ***
M11 -11.720 9.971 -1.175 0.245622
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 15.77 on 48 degrees of freedom
Multiple R-squared: 0.6998, Adjusted R-squared: 0.6248
F-statistic: 9.326 on 12 and 48 DF, p-value: 6.233e-09
> 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,] 0.11627045 0.23254090 0.88372955
[2,] 0.06378979 0.12757958 0.93621021
[3,] 0.04077750 0.08155500 0.95922250
[4,] 0.06282883 0.12565765 0.93717117
[5,] 0.05455889 0.10911778 0.94544111
[6,] 0.06083601 0.12167201 0.93916399
[7,] 0.04504060 0.09008121 0.95495940
[8,] 0.04501050 0.09002099 0.95498950
[9,] 0.06582928 0.13165857 0.93417072
[10,] 0.17191628 0.34383255 0.82808372
[11,] 0.23038960 0.46077921 0.76961040
[12,] 0.42837046 0.85674092 0.57162954
[13,] 0.55677650 0.88644700 0.44322350
[14,] 0.65325694 0.69348612 0.34674306
[15,] 0.70635163 0.58729675 0.29364837
[16,] 0.83949563 0.32100873 0.16050437
[17,] 0.93342002 0.13315995 0.06657998
[18,] 0.96904673 0.06190654 0.03095327
[19,] 0.97336397 0.05327206 0.02663603
[20,] 0.97654844 0.04690311 0.02345156
[21,] 0.97900454 0.04199091 0.02099546
[22,] 0.97998933 0.04002134 0.02001067
[23,] 0.98172388 0.03655224 0.01827612
[24,] 0.98617693 0.02764613 0.01382307
[25,] 0.97722583 0.04554835 0.02277417
[26,] 0.95931320 0.08137360 0.04068680
[27,] 0.92851203 0.14297594 0.07148797
[28,] 0.89522121 0.20955759 0.10477879
[29,] 0.82641733 0.34716533 0.17358267
[30,] 0.74925149 0.50149702 0.25074851
> postscript(file="/var/www/html/rcomp/tmp/1tvml1258576540.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/21j5g1258576540.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/3zocv1258576540.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/4vq6p1258576540.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/5kygc1258576540.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 6 7 8 9 10
-13.475 -16.895 -21.575 -17.195 -12.415 -14.175 -23.095 -20.435 -20.995 -13.455
11 12 13 14 15 16 17 18 19 20
-12.550 -18.270 -15.575 -8.095 -12.275 -10.295 -5.315 -5.975 -8.395 -11.935
21 22 23 24 25 26 27 28 29 30
-9.695 -10.455 -1.350 -6.070 6.225 -3.895 2.125 3.505 -2.615 4.625
31 32 33 34 35 36 37 38 39 40
7.905 5.865 7.905 15.245 21.750 19.630 24.925 19.705 31.925 21.005
41 42 43 44 45 46 47 48 49 50
20.585 20.625 17.705 26.865 26.805 11.545 2.725 14.005 -6.600 9.180
51 52 53 54 55 56 57 58 59 60
-0.200 2.980 -0.240 -5.100 5.880 -0.360 -4.020 -2.880 -10.575 -9.295
61
4.500
> postscript(file="/var/www/html/rcomp/tmp/6d0mi1258576540.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 -13.475 NA
1 -16.895 -13.475
2 -21.575 -16.895
3 -17.195 -21.575
4 -12.415 -17.195
5 -14.175 -12.415
6 -23.095 -14.175
7 -20.435 -23.095
8 -20.995 -20.435
9 -13.455 -20.995
10 -12.550 -13.455
11 -18.270 -12.550
12 -15.575 -18.270
13 -8.095 -15.575
14 -12.275 -8.095
15 -10.295 -12.275
16 -5.315 -10.295
17 -5.975 -5.315
18 -8.395 -5.975
19 -11.935 -8.395
20 -9.695 -11.935
21 -10.455 -9.695
22 -1.350 -10.455
23 -6.070 -1.350
24 6.225 -6.070
25 -3.895 6.225
26 2.125 -3.895
27 3.505 2.125
28 -2.615 3.505
29 4.625 -2.615
30 7.905 4.625
31 5.865 7.905
32 7.905 5.865
33 15.245 7.905
34 21.750 15.245
35 19.630 21.750
36 24.925 19.630
37 19.705 24.925
38 31.925 19.705
39 21.005 31.925
40 20.585 21.005
41 20.625 20.585
42 17.705 20.625
43 26.865 17.705
44 26.805 26.865
45 11.545 26.805
46 2.725 11.545
47 14.005 2.725
48 -6.600 14.005
49 9.180 -6.600
50 -0.200 9.180
51 2.980 -0.200
52 -0.240 2.980
53 -5.100 -0.240
54 5.880 -5.100
55 -0.360 5.880
56 -4.020 -0.360
57 -2.880 -4.020
58 -10.575 -2.880
59 -9.295 -10.575
60 4.500 -9.295
61 NA 4.500
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -16.895 -13.475
[2,] -21.575 -16.895
[3,] -17.195 -21.575
[4,] -12.415 -17.195
[5,] -14.175 -12.415
[6,] -23.095 -14.175
[7,] -20.435 -23.095
[8,] -20.995 -20.435
[9,] -13.455 -20.995
[10,] -12.550 -13.455
[11,] -18.270 -12.550
[12,] -15.575 -18.270
[13,] -8.095 -15.575
[14,] -12.275 -8.095
[15,] -10.295 -12.275
[16,] -5.315 -10.295
[17,] -5.975 -5.315
[18,] -8.395 -5.975
[19,] -11.935 -8.395
[20,] -9.695 -11.935
[21,] -10.455 -9.695
[22,] -1.350 -10.455
[23,] -6.070 -1.350
[24,] 6.225 -6.070
[25,] -3.895 6.225
[26,] 2.125 -3.895
[27,] 3.505 2.125
[28,] -2.615 3.505
[29,] 4.625 -2.615
[30,] 7.905 4.625
[31,] 5.865 7.905
[32,] 7.905 5.865
[33,] 15.245 7.905
[34,] 21.750 15.245
[35,] 19.630 21.750
[36,] 24.925 19.630
[37,] 19.705 24.925
[38,] 31.925 19.705
[39,] 21.005 31.925
[40,] 20.585 21.005
[41,] 20.625 20.585
[42,] 17.705 20.625
[43,] 26.865 17.705
[44,] 26.805 26.865
[45,] 11.545 26.805
[46,] 2.725 11.545
[47,] 14.005 2.725
[48,] -6.600 14.005
[49,] 9.180 -6.600
[50,] -0.200 9.180
[51,] 2.980 -0.200
[52,] -0.240 2.980
[53,] -5.100 -0.240
[54,] 5.880 -5.100
[55,] -0.360 5.880
[56,] -4.020 -0.360
[57,] -2.880 -4.020
[58,] -10.575 -2.880
[59,] -9.295 -10.575
[60,] 4.500 -9.295
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -16.895 -13.475
2 -21.575 -16.895
3 -17.195 -21.575
4 -12.415 -17.195
5 -14.175 -12.415
6 -23.095 -14.175
7 -20.435 -23.095
8 -20.995 -20.435
9 -13.455 -20.995
10 -12.550 -13.455
11 -18.270 -12.550
12 -15.575 -18.270
13 -8.095 -15.575
14 -12.275 -8.095
15 -10.295 -12.275
16 -5.315 -10.295
17 -5.975 -5.315
18 -8.395 -5.975
19 -11.935 -8.395
20 -9.695 -11.935
21 -10.455 -9.695
22 -1.350 -10.455
23 -6.070 -1.350
24 6.225 -6.070
25 -3.895 6.225
26 2.125 -3.895
27 3.505 2.125
28 -2.615 3.505
29 4.625 -2.615
30 7.905 4.625
31 5.865 7.905
32 7.905 5.865
33 15.245 7.905
34 21.750 15.245
35 19.630 21.750
36 24.925 19.630
37 19.705 24.925
38 31.925 19.705
39 21.005 31.925
40 20.585 21.005
41 20.625 20.585
42 17.705 20.625
43 26.865 17.705
44 26.805 26.865
45 11.545 26.805
46 2.725 11.545
47 14.005 2.725
48 -6.600 14.005
49 9.180 -6.600
50 -0.200 9.180
51 2.980 -0.200
52 -0.240 2.980
53 -5.100 -0.240
54 5.880 -5.100
55 -0.360 5.880
56 -4.020 -0.360
57 -2.880 -4.020
58 -10.575 -2.880
59 -9.295 -10.575
60 4.500 -9.295
> 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/7qlpw1258576540.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/8f0xv1258576540.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/9monz1258576540.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/10btuk1258576540.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/11ptb01258576540.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/127atm1258576540.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/131vgb1258576540.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/14zfxp1258576540.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/157by71258576540.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/16hbp71258576540.tab")
+ }
> system("convert tmp/1tvml1258576540.ps tmp/1tvml1258576540.png")
> system("convert tmp/21j5g1258576540.ps tmp/21j5g1258576540.png")
> system("convert tmp/3zocv1258576540.ps tmp/3zocv1258576540.png")
> system("convert tmp/4vq6p1258576540.ps tmp/4vq6p1258576540.png")
> system("convert tmp/5kygc1258576540.ps tmp/5kygc1258576540.png")
> system("convert tmp/6d0mi1258576540.ps tmp/6d0mi1258576540.png")
> system("convert tmp/7qlpw1258576540.ps tmp/7qlpw1258576540.png")
> system("convert tmp/8f0xv1258576540.ps tmp/8f0xv1258576540.png")
> system("convert tmp/9monz1258576540.ps tmp/9monz1258576540.png")
> system("convert tmp/10btuk1258576540.ps tmp/10btuk1258576540.png")
>
>
> proc.time()
user system elapsed
2.437 1.583 3.598