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(1.4,2,1.2,2,1,2,1.7,2,2.4,2,2,2,2.1,2,2,2,1.8,2,2.7,2,2.3,2,1.9,2,2,2,2.3,2,2.8,2,2.4,2,2.3,2,2.7,2,2.7,2,2.9,2,3,2,2.2,2,2.3,2,2.8,2.21,2.8,2.25,2.8,2.25,2.2,2.45,2.6,2.5,2.8,2.5,2.5,2.64,2.4,2.75,2.3,2.93,1.9,3,1.7,3.17,2,3.25,2.1,3.39,1.7,3.5,1.8,3.5,1.8,3.65,1.8,3.75,1.3,3.75,1.3,3.9,1.3,4,1.2,4,1.4,4,2.2,4,2.9,4,3.1,4,3.5,4,3.6,4,4.4,4,4.1,4,5.1,4,5.8,4,5.9,4.18,5.4,4.25,5.5,4.25,4.8,3.97,3.2,3.42,2.7,2.75),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 1.4 2.00
2 1.2 2.00
3 1.0 2.00
4 1.7 2.00
5 2.4 2.00
6 2.0 2.00
7 2.1 2.00
8 2.0 2.00
9 1.8 2.00
10 2.7 2.00
11 2.3 2.00
12 1.9 2.00
13 2.0 2.00
14 2.3 2.00
15 2.8 2.00
16 2.4 2.00
17 2.3 2.00
18 2.7 2.00
19 2.7 2.00
20 2.9 2.00
21 3.0 2.00
22 2.2 2.00
23 2.3 2.00
24 2.8 2.21
25 2.8 2.25
26 2.8 2.25
27 2.2 2.45
28 2.6 2.50
29 2.8 2.50
30 2.5 2.64
31 2.4 2.75
32 2.3 2.93
33 1.9 3.00
34 1.7 3.17
35 2.0 3.25
36 2.1 3.39
37 1.7 3.50
38 1.8 3.50
39 1.8 3.65
40 1.8 3.75
41 1.3 3.75
42 1.3 3.90
43 1.3 4.00
44 1.2 4.00
45 1.4 4.00
46 2.2 4.00
47 2.9 4.00
48 3.1 4.00
49 3.5 4.00
50 3.6 4.00
51 4.4 4.00
52 4.1 4.00
53 5.1 4.00
54 5.8 4.00
55 5.9 4.18
56 5.4 4.25
57 5.5 4.25
58 4.8 3.97
59 3.2 3.42
60 2.7 2.75
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
0.9900 0.5593
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.02703 -0.77230 0.06253 0.55727 2.57297
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.9900 0.4768 2.076 0.042325 *
X 0.5593 0.1573 3.556 0.000758 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.066 on 58 degrees of freedom
Multiple R-squared: 0.179, Adjusted R-squared: 0.1648
F-statistic: 12.64 on 1 and 58 DF, p-value: 0.000758
> 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.000730e-01 4.001459e-01 0.79992703
[2,] 1.125562e-01 2.251124e-01 0.88744378
[3,] 6.462513e-02 1.292503e-01 0.93537487
[4,] 3.141419e-02 6.282839e-02 0.96858581
[5,] 1.293039e-02 2.586078e-02 0.98706961
[6,] 1.915669e-02 3.831338e-02 0.98084331
[7,] 1.096835e-02 2.193671e-02 0.98903165
[8,] 4.702965e-03 9.405931e-03 0.99529703
[9,] 1.953237e-03 3.906473e-03 0.99804676
[10,] 9.992124e-04 1.998425e-03 0.99900079
[11,] 1.288140e-03 2.576281e-03 0.99871186
[12,] 6.746254e-04 1.349251e-03 0.99932537
[13,] 3.044961e-04 6.089922e-04 0.99969550
[14,] 2.397022e-04 4.794045e-04 0.99976030
[15,] 1.738433e-04 3.476866e-04 0.99982616
[16,] 1.770614e-04 3.541228e-04 0.99982294
[17,] 2.033383e-04 4.066766e-04 0.99979666
[18,] 8.490203e-05 1.698041e-04 0.99991510
[19,] 3.540329e-05 7.080658e-05 0.99996460
[20,] 1.521463e-05 3.042927e-05 0.99998479
[21,] 6.635759e-06 1.327152e-05 0.99999336
[22,] 3.001147e-06 6.002294e-06 0.99999700
[23,] 2.799220e-06 5.598441e-06 0.99999720
[24,] 1.217156e-06 2.434311e-06 0.99999878
[25,] 6.205585e-07 1.241117e-06 0.99999938
[26,] 3.282081e-07 6.564162e-07 0.99999967
[27,] 1.836527e-07 3.673054e-07 0.99999982
[28,] 1.009924e-07 2.019848e-07 0.99999990
[29,] 7.367037e-08 1.473407e-07 0.99999993
[30,] 5.093880e-08 1.018776e-07 0.99999995
[31,] 1.831974e-08 3.663947e-08 0.99999998
[32,] 5.860178e-09 1.172036e-08 0.99999999
[33,] 2.769403e-09 5.538807e-09 1.00000000
[34,] 1.051476e-09 2.102952e-09 1.00000000
[35,] 4.499735e-10 8.999470e-10 1.00000000
[36,] 2.259355e-10 4.518710e-10 1.00000000
[37,] 3.942657e-10 7.885314e-10 1.00000000
[38,] 1.099703e-09 2.199407e-09 1.00000000
[39,] 6.633954e-09 1.326791e-08 0.99999999
[40,] 1.681620e-07 3.363240e-07 0.99999983
[41,] 1.097233e-05 2.194467e-05 0.99998903
[42,] 3.191937e-04 6.383874e-04 0.99968081
[43,] 5.012392e-03 1.002478e-02 0.99498761
[44,] 4.978339e-02 9.956678e-02 0.95021661
[45,] 2.103801e-01 4.207603e-01 0.78961987
[46,] 5.595634e-01 8.808731e-01 0.44043657
[47,] 6.864974e-01 6.270052e-01 0.31350259
[48,] 8.641453e-01 2.717093e-01 0.13585467
[49,] 8.456837e-01 3.086326e-01 0.15431630
[50,] 9.222687e-01 1.554627e-01 0.07773133
[51,] 9.425033e-01 1.149934e-01 0.05749668
> postscript(file="/var/www/html/rcomp/tmp/1w7l91258718786.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/2ci5b1258718786.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/3z45x1258718786.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/4er8d1258718786.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/5wcbh1258718786.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.708507942 -0.908507942 -1.108507942 -0.408507942 0.291492058 -0.108507942
7 8 9 10 11 12
-0.008507942 -0.108507942 -0.308507942 0.591492058 0.191492058 -0.208507942
13 14 15 16 17 18
-0.108507942 0.191492058 0.691492058 0.291492058 0.191492058 0.591492058
19 20 21 22 23 24
0.591492058 0.791492058 0.891492058 0.091492058 0.191492058 0.574047451
25 26 27 28 29 30
0.551677049 0.551677049 -0.160174958 0.211862041 0.411862041 0.033565636
31 32 33 34 35 36
-0.127952968 -0.328619774 -0.767767977 -1.062842183 -0.807582985 -0.785879390
37 38 39 40 41 42
-1.247397994 -1.147397994 -1.231286999 -1.287213003 -1.787213003 -1.871102008
43 44 45 46 47 48
-1.927028011 -2.027028011 -1.827028011 -1.027028011 -0.327028011 -0.127028011
49 50 51 52 53 54
0.272971989 0.372971989 1.172971989 0.872971989 1.872971989 2.572971989
55 56 57 58 59 60
2.572305182 2.033156980 2.133156980 1.589749790 0.297342809 0.172047032
> postscript(file="/var/www/html/rcomp/tmp/6ahof1258718786.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.708507942 NA
1 -0.908507942 -0.708507942
2 -1.108507942 -0.908507942
3 -0.408507942 -1.108507942
4 0.291492058 -0.408507942
5 -0.108507942 0.291492058
6 -0.008507942 -0.108507942
7 -0.108507942 -0.008507942
8 -0.308507942 -0.108507942
9 0.591492058 -0.308507942
10 0.191492058 0.591492058
11 -0.208507942 0.191492058
12 -0.108507942 -0.208507942
13 0.191492058 -0.108507942
14 0.691492058 0.191492058
15 0.291492058 0.691492058
16 0.191492058 0.291492058
17 0.591492058 0.191492058
18 0.591492058 0.591492058
19 0.791492058 0.591492058
20 0.891492058 0.791492058
21 0.091492058 0.891492058
22 0.191492058 0.091492058
23 0.574047451 0.191492058
24 0.551677049 0.574047451
25 0.551677049 0.551677049
26 -0.160174958 0.551677049
27 0.211862041 -0.160174958
28 0.411862041 0.211862041
29 0.033565636 0.411862041
30 -0.127952968 0.033565636
31 -0.328619774 -0.127952968
32 -0.767767977 -0.328619774
33 -1.062842183 -0.767767977
34 -0.807582985 -1.062842183
35 -0.785879390 -0.807582985
36 -1.247397994 -0.785879390
37 -1.147397994 -1.247397994
38 -1.231286999 -1.147397994
39 -1.287213003 -1.231286999
40 -1.787213003 -1.287213003
41 -1.871102008 -1.787213003
42 -1.927028011 -1.871102008
43 -2.027028011 -1.927028011
44 -1.827028011 -2.027028011
45 -1.027028011 -1.827028011
46 -0.327028011 -1.027028011
47 -0.127028011 -0.327028011
48 0.272971989 -0.127028011
49 0.372971989 0.272971989
50 1.172971989 0.372971989
51 0.872971989 1.172971989
52 1.872971989 0.872971989
53 2.572971989 1.872971989
54 2.572305182 2.572971989
55 2.033156980 2.572305182
56 2.133156980 2.033156980
57 1.589749790 2.133156980
58 0.297342809 1.589749790
59 0.172047032 0.297342809
60 NA 0.172047032
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.908507942 -0.708507942
[2,] -1.108507942 -0.908507942
[3,] -0.408507942 -1.108507942
[4,] 0.291492058 -0.408507942
[5,] -0.108507942 0.291492058
[6,] -0.008507942 -0.108507942
[7,] -0.108507942 -0.008507942
[8,] -0.308507942 -0.108507942
[9,] 0.591492058 -0.308507942
[10,] 0.191492058 0.591492058
[11,] -0.208507942 0.191492058
[12,] -0.108507942 -0.208507942
[13,] 0.191492058 -0.108507942
[14,] 0.691492058 0.191492058
[15,] 0.291492058 0.691492058
[16,] 0.191492058 0.291492058
[17,] 0.591492058 0.191492058
[18,] 0.591492058 0.591492058
[19,] 0.791492058 0.591492058
[20,] 0.891492058 0.791492058
[21,] 0.091492058 0.891492058
[22,] 0.191492058 0.091492058
[23,] 0.574047451 0.191492058
[24,] 0.551677049 0.574047451
[25,] 0.551677049 0.551677049
[26,] -0.160174958 0.551677049
[27,] 0.211862041 -0.160174958
[28,] 0.411862041 0.211862041
[29,] 0.033565636 0.411862041
[30,] -0.127952968 0.033565636
[31,] -0.328619774 -0.127952968
[32,] -0.767767977 -0.328619774
[33,] -1.062842183 -0.767767977
[34,] -0.807582985 -1.062842183
[35,] -0.785879390 -0.807582985
[36,] -1.247397994 -0.785879390
[37,] -1.147397994 -1.247397994
[38,] -1.231286999 -1.147397994
[39,] -1.287213003 -1.231286999
[40,] -1.787213003 -1.287213003
[41,] -1.871102008 -1.787213003
[42,] -1.927028011 -1.871102008
[43,] -2.027028011 -1.927028011
[44,] -1.827028011 -2.027028011
[45,] -1.027028011 -1.827028011
[46,] -0.327028011 -1.027028011
[47,] -0.127028011 -0.327028011
[48,] 0.272971989 -0.127028011
[49,] 0.372971989 0.272971989
[50,] 1.172971989 0.372971989
[51,] 0.872971989 1.172971989
[52,] 1.872971989 0.872971989
[53,] 2.572971989 1.872971989
[54,] 2.572305182 2.572971989
[55,] 2.033156980 2.572305182
[56,] 2.133156980 2.033156980
[57,] 1.589749790 2.133156980
[58,] 0.297342809 1.589749790
[59,] 0.172047032 0.297342809
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.908507942 -0.708507942
2 -1.108507942 -0.908507942
3 -0.408507942 -1.108507942
4 0.291492058 -0.408507942
5 -0.108507942 0.291492058
6 -0.008507942 -0.108507942
7 -0.108507942 -0.008507942
8 -0.308507942 -0.108507942
9 0.591492058 -0.308507942
10 0.191492058 0.591492058
11 -0.208507942 0.191492058
12 -0.108507942 -0.208507942
13 0.191492058 -0.108507942
14 0.691492058 0.191492058
15 0.291492058 0.691492058
16 0.191492058 0.291492058
17 0.591492058 0.191492058
18 0.591492058 0.591492058
19 0.791492058 0.591492058
20 0.891492058 0.791492058
21 0.091492058 0.891492058
22 0.191492058 0.091492058
23 0.574047451 0.191492058
24 0.551677049 0.574047451
25 0.551677049 0.551677049
26 -0.160174958 0.551677049
27 0.211862041 -0.160174958
28 0.411862041 0.211862041
29 0.033565636 0.411862041
30 -0.127952968 0.033565636
31 -0.328619774 -0.127952968
32 -0.767767977 -0.328619774
33 -1.062842183 -0.767767977
34 -0.807582985 -1.062842183
35 -0.785879390 -0.807582985
36 -1.247397994 -0.785879390
37 -1.147397994 -1.247397994
38 -1.231286999 -1.147397994
39 -1.287213003 -1.231286999
40 -1.787213003 -1.287213003
41 -1.871102008 -1.787213003
42 -1.927028011 -1.871102008
43 -2.027028011 -1.927028011
44 -1.827028011 -2.027028011
45 -1.027028011 -1.827028011
46 -0.327028011 -1.027028011
47 -0.127028011 -0.327028011
48 0.272971989 -0.127028011
49 0.372971989 0.272971989
50 1.172971989 0.372971989
51 0.872971989 1.172971989
52 1.872971989 0.872971989
53 2.572971989 1.872971989
54 2.572305182 2.572971989
55 2.033156980 2.572305182
56 2.133156980 2.033156980
57 1.589749790 2.133156980
58 0.297342809 1.589749790
59 0.172047032 0.297342809
> 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/7aiyl1258718786.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/890oq1258718786.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/9390i1258718786.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/107pkv1258718786.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/11fr1b1258718786.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/125hkx1258718786.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/13sx721258718786.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/14tc6k1258718786.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/15lq801258718786.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/16btpo1258718786.tab")
+ }
>
> system("convert tmp/1w7l91258718786.ps tmp/1w7l91258718786.png")
> system("convert tmp/2ci5b1258718786.ps tmp/2ci5b1258718786.png")
> system("convert tmp/3z45x1258718786.ps tmp/3z45x1258718786.png")
> system("convert tmp/4er8d1258718786.ps tmp/4er8d1258718786.png")
> system("convert tmp/5wcbh1258718786.ps tmp/5wcbh1258718786.png")
> system("convert tmp/6ahof1258718786.ps tmp/6ahof1258718786.png")
> system("convert tmp/7aiyl1258718786.ps tmp/7aiyl1258718786.png")
> system("convert tmp/890oq1258718786.ps tmp/890oq1258718786.png")
> system("convert tmp/9390i1258718786.ps tmp/9390i1258718786.png")
> system("convert tmp/107pkv1258718786.ps tmp/107pkv1258718786.png")
>
>
> proc.time()
user system elapsed
2.428 1.526 2.833