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.05,1.00,2.11,1.00,2.09,1.00,2.05,1.00,2.08,1.00,2.06,1.00,2.06,1.00,2.08,1.00,2.07,1.00,2.06,1.00,2.07,1.00,2.06,1.00,2.09,1.00,2.07,1.00,2.09,1.00,2.28,1.25,2.33,1.25,2.35,1.25,2.52,1.50,2.63,1.50,2.58,1.50,2.70,1.75,2.81,1.75,2.97,2.00,3.04,2.00,3.28,2.25,3.33,2.25,3.50,2.50,3.56,2.50,3.57,2.50,3.69,2.75,3.82,2.75,3.79,2.75,3.96,3.00,4.06,3.00,4.05,3.00,4.03,3.00,3.94,3.00,4.02,3.00,3.88,3.00,4.02,3.00,4.03,3.00,4.09,3.00,3.99,3.00,4.01,3.00,4.01,3.00,4.19,3.25,4.30,3.25,4.27,3.25,3.82,3.25,3.15,2.75,2.49,2.00,1.81,1.00,1.26,1.00,1.06,0.50,0.84,0.25,0.78,0.25,0.70,0.25,0.36,0.25,0.35,0.25),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.05 1.00
2 2.11 1.00
3 2.09 1.00
4 2.05 1.00
5 2.08 1.00
6 2.06 1.00
7 2.06 1.00
8 2.08 1.00
9 2.07 1.00
10 2.06 1.00
11 2.07 1.00
12 2.06 1.00
13 2.09 1.00
14 2.07 1.00
15 2.09 1.00
16 2.28 1.25
17 2.33 1.25
18 2.35 1.25
19 2.52 1.50
20 2.63 1.50
21 2.58 1.50
22 2.70 1.75
23 2.81 1.75
24 2.97 2.00
25 3.04 2.00
26 3.28 2.25
27 3.33 2.25
28 3.50 2.50
29 3.56 2.50
30 3.57 2.50
31 3.69 2.75
32 3.82 2.75
33 3.79 2.75
34 3.96 3.00
35 4.06 3.00
36 4.05 3.00
37 4.03 3.00
38 3.94 3.00
39 4.02 3.00
40 3.88 3.00
41 4.02 3.00
42 4.03 3.00
43 4.09 3.00
44 3.99 3.00
45 4.01 3.00
46 4.01 3.00
47 4.19 3.25
48 4.30 3.25
49 4.27 3.25
50 3.82 3.25
51 3.15 2.75
52 2.49 2.00
53 1.81 1.00
54 1.26 1.00
55 1.06 0.50
56 0.84 0.25
57 0.78 0.25
58 0.70 0.25
59 0.36 0.25
60 0.35 0.25
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
0.7864 1.0774
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.70570 -0.05494 0.04116 0.19626 0.24626
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.78635 0.06706 11.73 <2e-16 ***
X 1.07739 0.03188 33.80 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.2434 on 58 degrees of freedom
Multiple R-squared: 0.9517, Adjusted R-squared: 0.9508
F-statistic: 1142 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.578797e-03 5.157594e-03 0.9974212
[2,] 3.061430e-04 6.122860e-04 0.9996939
[3,] 3.377753e-05 6.755507e-05 0.9999662
[4,] 3.387001e-06 6.774003e-06 0.9999966
[5,] 3.077536e-07 6.155073e-07 0.9999997
[6,] 3.144215e-08 6.288429e-08 1.0000000
[7,] 2.739404e-09 5.478808e-09 1.0000000
[8,] 2.747840e-10 5.495681e-10 1.0000000
[9,] 4.382311e-11 8.764622e-11 1.0000000
[10,] 4.203785e-12 8.407569e-12 1.0000000
[11,] 7.468550e-13 1.493710e-12 1.0000000
[12,] 7.068832e-14 1.413766e-13 1.0000000
[13,] 5.691994e-14 1.138399e-13 1.0000000
[14,] 5.056932e-14 1.011386e-13 1.0000000
[15,] 1.936186e-14 3.872371e-14 1.0000000
[16,] 4.058993e-13 8.117985e-13 1.0000000
[17,] 1.148513e-13 2.297025e-13 1.0000000
[18,] 4.356235e-12 8.712469e-12 1.0000000
[19,] 2.043652e-12 4.087305e-12 1.0000000
[20,] 9.649201e-13 1.929840e-12 1.0000000
[21,] 4.247371e-13 8.494743e-13 1.0000000
[22,] 1.423980e-13 2.847960e-13 1.0000000
[23,] 2.534182e-13 5.068364e-13 1.0000000
[24,] 5.767683e-14 1.153537e-13 1.0000000
[25,] 3.461233e-14 6.922467e-14 1.0000000
[26,] 2.420419e-14 4.840839e-14 1.0000000
[27,] 3.051187e-14 6.102374e-14 1.0000000
[28,] 2.677447e-14 5.354893e-14 1.0000000
[29,] 8.243094e-15 1.648619e-14 1.0000000
[30,] 3.196907e-15 6.393814e-15 1.0000000
[31,] 1.798717e-15 3.597435e-15 1.0000000
[32,] 6.422310e-16 1.284462e-15 1.0000000
[33,] 1.522243e-16 3.044486e-16 1.0000000
[34,] 1.438689e-16 2.877378e-16 1.0000000
[35,] 3.316996e-17 6.633992e-17 1.0000000
[36,] 3.972042e-16 7.944084e-16 1.0000000
[37,] 1.075247e-16 2.150494e-16 1.0000000
[38,] 3.567362e-17 7.134723e-17 1.0000000
[39,] 9.830097e-17 1.966019e-16 1.0000000
[40,] 3.107469e-17 6.214938e-17 1.0000000
[41,] 1.260211e-17 2.520423e-17 1.0000000
[42,] 7.186053e-18 1.437211e-17 1.0000000
[43,] 4.612493e-18 9.224987e-18 1.0000000
[44,] 2.607135e-17 5.214270e-17 1.0000000
[45,] 1.879970e-15 3.759941e-15 1.0000000
[46,] 4.901844e-08 9.803689e-08 1.0000000
[47,] 3.996792e-04 7.993585e-04 0.9996003
[48,] 4.364210e-03 8.728419e-03 0.9956358
[49,] 2.372139e-02 4.744278e-02 0.9762786
[50,] 1.349381e-01 2.698762e-01 0.8650619
[51,] 9.810655e-02 1.962131e-01 0.9018935
> postscript(file="/var/www/html/rcomp/tmp/1sr671258735827.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/2yol41258735827.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/3foej1258735827.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/4dbz01258735827.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/5qxyw1258735827.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.186258309 0.246258309 0.226258309 0.186258309 0.216258309 0.196258309
7 8 9 10 11 12
0.196258309 0.216258309 0.206258309 0.196258309 0.206258309 0.196258309
13 14 15 16 17 18
0.226258309 0.206258309 0.226258309 0.146911229 0.196911229 0.216911229
19 20 21 22 23 24
0.117564148 0.227564148 0.177564148 0.028217068 0.138217068 0.028869988
25 26 27 28 29 30
0.098869988 0.069522908 0.119522908 0.020175827 0.080175827 0.090175827
31 32 33 34 35 36
-0.059171253 0.070828747 0.040828747 -0.058518333 0.041481667 0.031481667
37 38 39 40 41 42
0.011481667 -0.078518333 0.001481667 -0.138518333 0.001481667 0.011481667
43 44 45 46 47 48
0.071481667 -0.028518333 -0.008518333 -0.008518333 -0.097865413 0.012134587
49 50 51 52 53 54
-0.017865413 -0.467865413 -0.599171253 -0.451130012 -0.053741691 -0.603741691
55 56 57 58 59 60
-0.265047531 -0.215700450 -0.275700450 -0.355700450 -0.695700450 -0.705700450
> postscript(file="/var/www/html/rcomp/tmp/654pj1258735827.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.186258309 NA
1 0.246258309 0.186258309
2 0.226258309 0.246258309
3 0.186258309 0.226258309
4 0.216258309 0.186258309
5 0.196258309 0.216258309
6 0.196258309 0.196258309
7 0.216258309 0.196258309
8 0.206258309 0.216258309
9 0.196258309 0.206258309
10 0.206258309 0.196258309
11 0.196258309 0.206258309
12 0.226258309 0.196258309
13 0.206258309 0.226258309
14 0.226258309 0.206258309
15 0.146911229 0.226258309
16 0.196911229 0.146911229
17 0.216911229 0.196911229
18 0.117564148 0.216911229
19 0.227564148 0.117564148
20 0.177564148 0.227564148
21 0.028217068 0.177564148
22 0.138217068 0.028217068
23 0.028869988 0.138217068
24 0.098869988 0.028869988
25 0.069522908 0.098869988
26 0.119522908 0.069522908
27 0.020175827 0.119522908
28 0.080175827 0.020175827
29 0.090175827 0.080175827
30 -0.059171253 0.090175827
31 0.070828747 -0.059171253
32 0.040828747 0.070828747
33 -0.058518333 0.040828747
34 0.041481667 -0.058518333
35 0.031481667 0.041481667
36 0.011481667 0.031481667
37 -0.078518333 0.011481667
38 0.001481667 -0.078518333
39 -0.138518333 0.001481667
40 0.001481667 -0.138518333
41 0.011481667 0.001481667
42 0.071481667 0.011481667
43 -0.028518333 0.071481667
44 -0.008518333 -0.028518333
45 -0.008518333 -0.008518333
46 -0.097865413 -0.008518333
47 0.012134587 -0.097865413
48 -0.017865413 0.012134587
49 -0.467865413 -0.017865413
50 -0.599171253 -0.467865413
51 -0.451130012 -0.599171253
52 -0.053741691 -0.451130012
53 -0.603741691 -0.053741691
54 -0.265047531 -0.603741691
55 -0.215700450 -0.265047531
56 -0.275700450 -0.215700450
57 -0.355700450 -0.275700450
58 -0.695700450 -0.355700450
59 -0.705700450 -0.695700450
60 NA -0.705700450
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.246258309 0.186258309
[2,] 0.226258309 0.246258309
[3,] 0.186258309 0.226258309
[4,] 0.216258309 0.186258309
[5,] 0.196258309 0.216258309
[6,] 0.196258309 0.196258309
[7,] 0.216258309 0.196258309
[8,] 0.206258309 0.216258309
[9,] 0.196258309 0.206258309
[10,] 0.206258309 0.196258309
[11,] 0.196258309 0.206258309
[12,] 0.226258309 0.196258309
[13,] 0.206258309 0.226258309
[14,] 0.226258309 0.206258309
[15,] 0.146911229 0.226258309
[16,] 0.196911229 0.146911229
[17,] 0.216911229 0.196911229
[18,] 0.117564148 0.216911229
[19,] 0.227564148 0.117564148
[20,] 0.177564148 0.227564148
[21,] 0.028217068 0.177564148
[22,] 0.138217068 0.028217068
[23,] 0.028869988 0.138217068
[24,] 0.098869988 0.028869988
[25,] 0.069522908 0.098869988
[26,] 0.119522908 0.069522908
[27,] 0.020175827 0.119522908
[28,] 0.080175827 0.020175827
[29,] 0.090175827 0.080175827
[30,] -0.059171253 0.090175827
[31,] 0.070828747 -0.059171253
[32,] 0.040828747 0.070828747
[33,] -0.058518333 0.040828747
[34,] 0.041481667 -0.058518333
[35,] 0.031481667 0.041481667
[36,] 0.011481667 0.031481667
[37,] -0.078518333 0.011481667
[38,] 0.001481667 -0.078518333
[39,] -0.138518333 0.001481667
[40,] 0.001481667 -0.138518333
[41,] 0.011481667 0.001481667
[42,] 0.071481667 0.011481667
[43,] -0.028518333 0.071481667
[44,] -0.008518333 -0.028518333
[45,] -0.008518333 -0.008518333
[46,] -0.097865413 -0.008518333
[47,] 0.012134587 -0.097865413
[48,] -0.017865413 0.012134587
[49,] -0.467865413 -0.017865413
[50,] -0.599171253 -0.467865413
[51,] -0.451130012 -0.599171253
[52,] -0.053741691 -0.451130012
[53,] -0.603741691 -0.053741691
[54,] -0.265047531 -0.603741691
[55,] -0.215700450 -0.265047531
[56,] -0.275700450 -0.215700450
[57,] -0.355700450 -0.275700450
[58,] -0.695700450 -0.355700450
[59,] -0.705700450 -0.695700450
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.246258309 0.186258309
2 0.226258309 0.246258309
3 0.186258309 0.226258309
4 0.216258309 0.186258309
5 0.196258309 0.216258309
6 0.196258309 0.196258309
7 0.216258309 0.196258309
8 0.206258309 0.216258309
9 0.196258309 0.206258309
10 0.206258309 0.196258309
11 0.196258309 0.206258309
12 0.226258309 0.196258309
13 0.206258309 0.226258309
14 0.226258309 0.206258309
15 0.146911229 0.226258309
16 0.196911229 0.146911229
17 0.216911229 0.196911229
18 0.117564148 0.216911229
19 0.227564148 0.117564148
20 0.177564148 0.227564148
21 0.028217068 0.177564148
22 0.138217068 0.028217068
23 0.028869988 0.138217068
24 0.098869988 0.028869988
25 0.069522908 0.098869988
26 0.119522908 0.069522908
27 0.020175827 0.119522908
28 0.080175827 0.020175827
29 0.090175827 0.080175827
30 -0.059171253 0.090175827
31 0.070828747 -0.059171253
32 0.040828747 0.070828747
33 -0.058518333 0.040828747
34 0.041481667 -0.058518333
35 0.031481667 0.041481667
36 0.011481667 0.031481667
37 -0.078518333 0.011481667
38 0.001481667 -0.078518333
39 -0.138518333 0.001481667
40 0.001481667 -0.138518333
41 0.011481667 0.001481667
42 0.071481667 0.011481667
43 -0.028518333 0.071481667
44 -0.008518333 -0.028518333
45 -0.008518333 -0.008518333
46 -0.097865413 -0.008518333
47 0.012134587 -0.097865413
48 -0.017865413 0.012134587
49 -0.467865413 -0.017865413
50 -0.599171253 -0.467865413
51 -0.451130012 -0.599171253
52 -0.053741691 -0.451130012
53 -0.603741691 -0.053741691
54 -0.265047531 -0.603741691
55 -0.215700450 -0.265047531
56 -0.275700450 -0.215700450
57 -0.355700450 -0.275700450
58 -0.695700450 -0.355700450
59 -0.705700450 -0.695700450
> 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/71j9d1258735827.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/8nsdc1258735827.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/9mzvf1258735827.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/10b4ag1258735827.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/11wtvt1258735827.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/12gnze1258735827.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/1359yl1258735827.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/14e8rj1258735827.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/15yv3t1258735827.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/16a3ls1258735827.tab")
+ }
>
> system("convert tmp/1sr671258735827.ps tmp/1sr671258735827.png")
> system("convert tmp/2yol41258735827.ps tmp/2yol41258735827.png")
> system("convert tmp/3foej1258735827.ps tmp/3foej1258735827.png")
> system("convert tmp/4dbz01258735827.ps tmp/4dbz01258735827.png")
> system("convert tmp/5qxyw1258735827.ps tmp/5qxyw1258735827.png")
> system("convert tmp/654pj1258735827.ps tmp/654pj1258735827.png")
> system("convert tmp/71j9d1258735827.ps tmp/71j9d1258735827.png")
> system("convert tmp/8nsdc1258735827.ps tmp/8nsdc1258735827.png")
> system("convert tmp/9mzvf1258735827.ps tmp/9mzvf1258735827.png")
> system("convert tmp/10b4ag1258735827.ps tmp/10b4ag1258735827.png")
>
>
> proc.time()
user system elapsed
2.417 1.540 2.852