R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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(127.96,0,127.47,0,126.47,0,125.75,0,125.42,0,125.14,0,125.15,0,125.51,0,125.63,0,126.22,0,126.88,0,127.96,0,128.74,0,129.6,0,131.2,0,132.72,0,134.67,0,135.94,0,136.39,0,136.74,0,137.2,0,137.36,0,138.63,0,141.07,0,143.32,0,147.91,0,152.56,0,151.61,0,156.56,0,157.45,0,158.13,0,159.18,0,159.47,0,159.79,0,161.65,0,162.77,0,163.48,0,166.16,0,163.86,0,162.12,0,149.08,0,145.32,0,141.21,0,134.68,0,133.65,0,139.17,0,138.61,0,144.96,1,157.99,1,167.18,1,174.48,1,182.77,1,190.00,1,189.70,1,188.90,1,198.28,1,201.18,1,204.14,1,221.02,1,221.12,1,220.68,1),dim=c(2,61),dimnames=list(c('Gasindex','dumivariable'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Gasindex','dumivariable'),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 = '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
Gasindex dumivariable
1 127.96 0
2 127.47 0
3 126.47 0
4 125.75 0
5 125.42 0
6 125.14 0
7 125.15 0
8 125.51 0
9 125.63 0
10 126.22 0
11 126.88 0
12 127.96 0
13 128.74 0
14 129.60 0
15 131.20 0
16 132.72 0
17 134.67 0
18 135.94 0
19 136.39 0
20 136.74 0
21 137.20 0
22 137.36 0
23 138.63 0
24 141.07 0
25 143.32 0
26 147.91 0
27 152.56 0
28 151.61 0
29 156.56 0
30 157.45 0
31 158.13 0
32 159.18 0
33 159.47 0
34 159.79 0
35 161.65 0
36 162.77 0
37 163.48 0
38 166.16 0
39 163.86 0
40 162.12 0
41 149.08 0
42 145.32 0
43 141.21 0
44 134.68 0
45 133.65 0
46 139.17 0
47 138.61 0
48 144.96 1
49 157.99 1
50 167.18 1
51 174.48 1
52 182.77 1
53 190.00 1
54 189.70 1
55 188.90 1
56 198.28 1
57 201.18 1
58 204.14 1
59 221.02 1
60 221.12 1
61 220.68 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) dumivariable
141.35 48.82
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-45.211 -13.392 -2.722 13.969 30.949
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 141.352 2.375 59.516 < 2e-16 ***
dumivariable 48.819 4.958 9.847 4.56e-14 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 16.28 on 59 degrees of freedom
Multiple R-squared: 0.6217, Adjusted R-squared: 0.6153
F-statistic: 96.97 on 1 and 59 DF, p-value: 4.56e-14
> 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,] 6.334399e-04 1.266880e-03 0.9993666
[2,] 7.798939e-05 1.559788e-04 0.9999220
[3,] 8.494155e-06 1.698831e-05 0.9999915
[4,] 7.092254e-07 1.418451e-06 0.9999993
[5,] 5.406848e-08 1.081370e-07 0.9999999
[6,] 3.713449e-09 7.426899e-09 1.0000000
[7,] 3.300866e-10 6.601731e-10 1.0000000
[8,] 9.047135e-11 1.809427e-10 1.0000000
[9,] 5.191948e-11 1.038390e-10 1.0000000
[10,] 5.255129e-11 1.051026e-10 1.0000000
[11,] 1.667606e-10 3.335211e-10 1.0000000
[12,] 7.304080e-10 1.460816e-09 1.0000000
[13,] 4.577262e-09 9.154524e-09 1.0000000
[14,] 1.922771e-08 3.845541e-08 1.0000000
[15,] 4.382212e-08 8.764424e-08 1.0000000
[16,] 7.088944e-08 1.417789e-07 0.9999999
[17,] 9.798487e-08 1.959697e-07 0.9999999
[18,] 1.129351e-07 2.258701e-07 0.9999999
[19,] 1.555575e-07 3.111149e-07 0.9999998
[20,] 3.395045e-07 6.790090e-07 0.9999997
[21,] 9.649333e-07 1.929867e-06 0.9999990
[22,] 5.865049e-06 1.173010e-05 0.9999941
[23,] 5.034579e-05 1.006916e-04 0.9999497
[24,] 1.491810e-04 2.983620e-04 0.9998508
[25,] 6.295897e-04 1.259179e-03 0.9993704
[26,] 1.716690e-03 3.433380e-03 0.9982833
[27,] 3.500766e-03 7.001532e-03 0.9964992
[28,] 6.133260e-03 1.226652e-02 0.9938667
[29,] 9.093902e-03 1.818780e-02 0.9909061
[30,] 1.207442e-02 2.414885e-02 0.9879256
[31,] 1.654762e-02 3.309525e-02 0.9834524
[32,] 2.236728e-02 4.473456e-02 0.9776327
[33,] 2.957572e-02 5.915145e-02 0.9704243
[34,] 4.462816e-02 8.925632e-02 0.9553718
[35,] 5.706314e-02 1.141263e-01 0.9429369
[36,] 6.811015e-02 1.362203e-01 0.9318898
[37,] 5.071592e-02 1.014318e-01 0.9492841
[38,] 3.475221e-02 6.950442e-02 0.9652478
[39,] 2.220212e-02 4.440425e-02 0.9777979
[40,] 1.400161e-02 2.800323e-02 0.9859984
[41,] 8.699911e-03 1.739982e-02 0.9913001
[42,] 4.857716e-03 9.715433e-03 0.9951423
[43,] 2.587113e-03 5.174227e-03 0.9974129
[44,] 1.786261e-02 3.572521e-02 0.9821374
[45,] 6.232459e-02 1.246492e-01 0.9376754
[46,] 1.456099e-01 2.912198e-01 0.8543901
[47,] 2.582695e-01 5.165391e-01 0.7417305
[48,] 3.386163e-01 6.772325e-01 0.6613837
[49,] 3.580250e-01 7.160501e-01 0.6419750
[50,] 4.034537e-01 8.069073e-01 0.5965463
[51,] 5.542374e-01 8.915253e-01 0.4457626
[52,] 5.765182e-01 8.469637e-01 0.4234818
> postscript(file="/var/www/html/rcomp/tmp/1i85s1229945986.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/2nytb1229945986.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/3rhae1229945986.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/4s9s91229945986.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/580u91229945987.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
-13.3923404 -13.8823404 -14.8823404 -15.6023404 -15.9323404 -16.2123404
7 8 9 10 11 12
-16.2023404 -15.8423404 -15.7223404 -15.1323404 -14.4723404 -13.3923404
13 14 15 16 17 18
-12.6123404 -11.7523404 -10.1523404 -8.6323404 -6.6823404 -5.4123404
19 20 21 22 23 24
-4.9623404 -4.6123404 -4.1523404 -3.9923404 -2.7223404 -0.2823404
25 26 27 28 29 30
1.9676596 6.5576596 11.2076596 10.2576596 15.2076596 16.0976596
31 32 33 34 35 36
16.7776596 17.8276596 18.1176596 18.4376596 20.2976596 21.4176596
37 38 39 40 41 42
22.1276596 24.8076596 22.5076596 20.7676596 7.7276596 3.9676596
43 44 45 46 47 48
-0.1423404 -6.6723404 -7.7023404 -2.1823404 -2.7423404 -45.2114286
49 50 51 52 53 54
-32.1814286 -22.9914286 -15.6914286 -7.4014286 -0.1714286 -0.4714286
55 56 57 58 59 60
-1.2714286 8.1085714 11.0085714 13.9685714 30.8485714 30.9485714
61
30.5085714
> postscript(file="/var/www/html/rcomp/tmp/62xyt1229945987.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.3923404 NA
1 -13.8823404 -13.3923404
2 -14.8823404 -13.8823404
3 -15.6023404 -14.8823404
4 -15.9323404 -15.6023404
5 -16.2123404 -15.9323404
6 -16.2023404 -16.2123404
7 -15.8423404 -16.2023404
8 -15.7223404 -15.8423404
9 -15.1323404 -15.7223404
10 -14.4723404 -15.1323404
11 -13.3923404 -14.4723404
12 -12.6123404 -13.3923404
13 -11.7523404 -12.6123404
14 -10.1523404 -11.7523404
15 -8.6323404 -10.1523404
16 -6.6823404 -8.6323404
17 -5.4123404 -6.6823404
18 -4.9623404 -5.4123404
19 -4.6123404 -4.9623404
20 -4.1523404 -4.6123404
21 -3.9923404 -4.1523404
22 -2.7223404 -3.9923404
23 -0.2823404 -2.7223404
24 1.9676596 -0.2823404
25 6.5576596 1.9676596
26 11.2076596 6.5576596
27 10.2576596 11.2076596
28 15.2076596 10.2576596
29 16.0976596 15.2076596
30 16.7776596 16.0976596
31 17.8276596 16.7776596
32 18.1176596 17.8276596
33 18.4376596 18.1176596
34 20.2976596 18.4376596
35 21.4176596 20.2976596
36 22.1276596 21.4176596
37 24.8076596 22.1276596
38 22.5076596 24.8076596
39 20.7676596 22.5076596
40 7.7276596 20.7676596
41 3.9676596 7.7276596
42 -0.1423404 3.9676596
43 -6.6723404 -0.1423404
44 -7.7023404 -6.6723404
45 -2.1823404 -7.7023404
46 -2.7423404 -2.1823404
47 -45.2114286 -2.7423404
48 -32.1814286 -45.2114286
49 -22.9914286 -32.1814286
50 -15.6914286 -22.9914286
51 -7.4014286 -15.6914286
52 -0.1714286 -7.4014286
53 -0.4714286 -0.1714286
54 -1.2714286 -0.4714286
55 8.1085714 -1.2714286
56 11.0085714 8.1085714
57 13.9685714 11.0085714
58 30.8485714 13.9685714
59 30.9485714 30.8485714
60 30.5085714 30.9485714
61 NA 30.5085714
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -13.8823404 -13.3923404
[2,] -14.8823404 -13.8823404
[3,] -15.6023404 -14.8823404
[4,] -15.9323404 -15.6023404
[5,] -16.2123404 -15.9323404
[6,] -16.2023404 -16.2123404
[7,] -15.8423404 -16.2023404
[8,] -15.7223404 -15.8423404
[9,] -15.1323404 -15.7223404
[10,] -14.4723404 -15.1323404
[11,] -13.3923404 -14.4723404
[12,] -12.6123404 -13.3923404
[13,] -11.7523404 -12.6123404
[14,] -10.1523404 -11.7523404
[15,] -8.6323404 -10.1523404
[16,] -6.6823404 -8.6323404
[17,] -5.4123404 -6.6823404
[18,] -4.9623404 -5.4123404
[19,] -4.6123404 -4.9623404
[20,] -4.1523404 -4.6123404
[21,] -3.9923404 -4.1523404
[22,] -2.7223404 -3.9923404
[23,] -0.2823404 -2.7223404
[24,] 1.9676596 -0.2823404
[25,] 6.5576596 1.9676596
[26,] 11.2076596 6.5576596
[27,] 10.2576596 11.2076596
[28,] 15.2076596 10.2576596
[29,] 16.0976596 15.2076596
[30,] 16.7776596 16.0976596
[31,] 17.8276596 16.7776596
[32,] 18.1176596 17.8276596
[33,] 18.4376596 18.1176596
[34,] 20.2976596 18.4376596
[35,] 21.4176596 20.2976596
[36,] 22.1276596 21.4176596
[37,] 24.8076596 22.1276596
[38,] 22.5076596 24.8076596
[39,] 20.7676596 22.5076596
[40,] 7.7276596 20.7676596
[41,] 3.9676596 7.7276596
[42,] -0.1423404 3.9676596
[43,] -6.6723404 -0.1423404
[44,] -7.7023404 -6.6723404
[45,] -2.1823404 -7.7023404
[46,] -2.7423404 -2.1823404
[47,] -45.2114286 -2.7423404
[48,] -32.1814286 -45.2114286
[49,] -22.9914286 -32.1814286
[50,] -15.6914286 -22.9914286
[51,] -7.4014286 -15.6914286
[52,] -0.1714286 -7.4014286
[53,] -0.4714286 -0.1714286
[54,] -1.2714286 -0.4714286
[55,] 8.1085714 -1.2714286
[56,] 11.0085714 8.1085714
[57,] 13.9685714 11.0085714
[58,] 30.8485714 13.9685714
[59,] 30.9485714 30.8485714
[60,] 30.5085714 30.9485714
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -13.8823404 -13.3923404
2 -14.8823404 -13.8823404
3 -15.6023404 -14.8823404
4 -15.9323404 -15.6023404
5 -16.2123404 -15.9323404
6 -16.2023404 -16.2123404
7 -15.8423404 -16.2023404
8 -15.7223404 -15.8423404
9 -15.1323404 -15.7223404
10 -14.4723404 -15.1323404
11 -13.3923404 -14.4723404
12 -12.6123404 -13.3923404
13 -11.7523404 -12.6123404
14 -10.1523404 -11.7523404
15 -8.6323404 -10.1523404
16 -6.6823404 -8.6323404
17 -5.4123404 -6.6823404
18 -4.9623404 -5.4123404
19 -4.6123404 -4.9623404
20 -4.1523404 -4.6123404
21 -3.9923404 -4.1523404
22 -2.7223404 -3.9923404
23 -0.2823404 -2.7223404
24 1.9676596 -0.2823404
25 6.5576596 1.9676596
26 11.2076596 6.5576596
27 10.2576596 11.2076596
28 15.2076596 10.2576596
29 16.0976596 15.2076596
30 16.7776596 16.0976596
31 17.8276596 16.7776596
32 18.1176596 17.8276596
33 18.4376596 18.1176596
34 20.2976596 18.4376596
35 21.4176596 20.2976596
36 22.1276596 21.4176596
37 24.8076596 22.1276596
38 22.5076596 24.8076596
39 20.7676596 22.5076596
40 7.7276596 20.7676596
41 3.9676596 7.7276596
42 -0.1423404 3.9676596
43 -6.6723404 -0.1423404
44 -7.7023404 -6.6723404
45 -2.1823404 -7.7023404
46 -2.7423404 -2.1823404
47 -45.2114286 -2.7423404
48 -32.1814286 -45.2114286
49 -22.9914286 -32.1814286
50 -15.6914286 -22.9914286
51 -7.4014286 -15.6914286
52 -0.1714286 -7.4014286
53 -0.4714286 -0.1714286
54 -1.2714286 -0.4714286
55 8.1085714 -1.2714286
56 11.0085714 8.1085714
57 13.9685714 11.0085714
58 30.8485714 13.9685714
59 30.9485714 30.8485714
60 30.5085714 30.9485714
> 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/7pz9b1229945987.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/8jvhn1229945987.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/9ogvm1229945987.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/10cyln1229945987.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/11pewk1229945987.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/12n7a71229945987.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/13bq9p1229945987.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/14x7nu1229945987.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/15zz2p1229945987.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/16l46z1229945987.tab")
+ }
>
> system("convert tmp/1i85s1229945986.ps tmp/1i85s1229945986.png")
> system("convert tmp/2nytb1229945986.ps tmp/2nytb1229945986.png")
> system("convert tmp/3rhae1229945986.ps tmp/3rhae1229945986.png")
> system("convert tmp/4s9s91229945986.ps tmp/4s9s91229945986.png")
> system("convert tmp/580u91229945987.ps tmp/580u91229945987.png")
> system("convert tmp/62xyt1229945987.ps tmp/62xyt1229945987.png")
> system("convert tmp/7pz9b1229945987.ps tmp/7pz9b1229945987.png")
> system("convert tmp/8jvhn1229945987.ps tmp/8jvhn1229945987.png")
> system("convert tmp/9ogvm1229945987.ps tmp/9ogvm1229945987.png")
> system("convert tmp/10cyln1229945987.ps tmp/10cyln1229945987.png")
>
>
> proc.time()
user system elapsed
2.497 1.592 2.966