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(24,33,22,34,25,36,24,36,29,38,26,42,26,35,21,25,23,24,22,22,21,27,16,17,19,30,16,30,25,34,27,37,23,36,22,33,23,33,20,33,24,37,23,40,20,35,21,37,22,43,17,42,21,33,19,39,23,40,22,37,15,44,23,42,21,43,18,40,18,30,18,30,18,31,10,18,13,24,10,22,9,26,9,28,6,23,11,17,9,12,10,9,9,19,16,21,10,18,7,18,7,15,14,24,11,18,10,19,6,30,8,33,13,35,12,36,15,47,16,46,16,43),dim=c(2,61),dimnames=list(c('S.','E.S.'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('S.','E.S.'),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
S. E.S.
1 24 33
2 22 34
3 25 36
4 24 36
5 29 38
6 26 42
7 26 35
8 21 25
9 23 24
10 22 22
11 21 27
12 16 17
13 19 30
14 16 30
15 25 34
16 27 37
17 23 36
18 22 33
19 23 33
20 20 33
21 24 37
22 23 40
23 20 35
24 21 37
25 22 43
26 17 42
27 21 33
28 19 39
29 23 40
30 22 37
31 15 44
32 23 42
33 21 43
34 18 40
35 18 30
36 18 30
37 18 31
38 10 18
39 13 24
40 10 22
41 9 26
42 9 28
43 6 23
44 11 17
45 9 12
46 10 9
47 9 19
48 16 21
49 10 18
50 7 18
51 7 15
52 14 24
53 11 18
54 10 19
55 6 30
56 8 33
57 13 35
58 12 36
59 15 47
60 16 46
61 16 43
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) E.S.
5.1075 0.3951
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-10.961 -3.615 1.039 3.853 8.878
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.10747 2.25601 2.264 0.0273 *
E.S. 0.39513 0.07018 5.630 5.27e-07 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 5.038 on 59 degrees of freedom
Multiple R-squared: 0.3495, Adjusted R-squared: 0.3385
F-statistic: 31.7 on 1 and 59 DF, p-value: 5.267e-07
> 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.055761208 0.111522416 0.94423879
[2,] 0.054654579 0.109309159 0.94534542
[3,] 0.028305336 0.056610671 0.97169466
[4,] 0.011059141 0.022118283 0.98894086
[5,] 0.007492463 0.014984927 0.99250754
[6,] 0.003728164 0.007456327 0.99627184
[7,] 0.002250452 0.004500905 0.99774955
[8,] 0.002775095 0.005550191 0.99722490
[9,] 0.005388649 0.010777297 0.99461135
[10,] 0.033098216 0.066196432 0.96690178
[11,] 0.026769304 0.053538608 0.97323070
[12,] 0.027902079 0.055804159 0.97209792
[13,] 0.022166764 0.044333528 0.97783324
[14,] 0.017645217 0.035290435 0.98235478
[15,] 0.014832312 0.029664624 0.98516769
[16,] 0.016699905 0.033399811 0.98330009
[17,] 0.015431290 0.030862580 0.98456871
[18,] 0.016288053 0.032576105 0.98371195
[19,] 0.020604665 0.041209330 0.97939533
[20,] 0.023218379 0.046436758 0.97678162
[21,] 0.027686827 0.055373655 0.97231317
[22,] 0.090632376 0.181264751 0.90936762
[23,] 0.095948497 0.191896993 0.90405150
[24,] 0.106165501 0.212331002 0.89383450
[25,] 0.119664760 0.239329520 0.88033524
[26,] 0.148861194 0.297722387 0.85113881
[27,] 0.311495139 0.622990278 0.68850486
[28,] 0.380204652 0.760409303 0.61979535
[29,] 0.416412014 0.832824027 0.58358799
[30,] 0.449993225 0.899986449 0.55000678
[31,] 0.548827208 0.902345585 0.45117279
[32,] 0.673225148 0.653549703 0.32677485
[33,] 0.808762330 0.382475340 0.19123767
[34,] 0.875969153 0.248061693 0.12403085
[35,] 0.891621735 0.216756530 0.10837827
[36,] 0.905100320 0.189799361 0.09489968
[37,] 0.931850000 0.136300000 0.06815000
[38,] 0.949943028 0.100113944 0.05005697
[39,] 0.978876502 0.042246997 0.02112350
[40,] 0.967030186 0.065939627 0.03296981
[41,] 0.946364326 0.107271349 0.05363567
[42,] 0.923479745 0.153040510 0.07652026
[43,] 0.891988286 0.216023427 0.10801171
[44,] 0.956055576 0.087888849 0.04394442
[45,] 0.931767812 0.136464377 0.06823219
[46,] 0.907762702 0.184474597 0.09223730
[47,] 0.865745864 0.268508272 0.13425414
[48,] 0.875461435 0.249077130 0.12453856
[49,] 0.872021504 0.255956992 0.12797850
[50,] 0.960087331 0.079825338 0.03991267
[51,] 0.958708136 0.082583727 0.04129186
[52,] 0.984896404 0.030207192 0.01510360
> postscript(file="/var/www/html/rcomp/tmp/1sjb91260359714.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/24np91260359714.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/3pnn41260359714.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/423c41260359714.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/5vios1260359714.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
5.85332663 3.45819920 5.66794435 4.66794435 8.87768949 4.29717977
7 8 9 10 11 12
7.06307177 6.01434606 8.40947349 8.19972835 5.22409120 4.17536549
13 14 15 16 17 18
2.03870892 -0.96129108 6.45819920 7.27281692 3.66794435 3.85332663
19 20 21 22 23 24
4.85332663 1.85332663 4.27281692 2.08743463 1.06307177 1.27281692
25 26 27 28 29 30
-0.09794765 -4.70282023 2.85332663 -1.51743794 2.08743463 2.27281692
31 32 33 34 35 36
-7.49307508 1.29717977 -1.09794765 -2.91256537 1.03870892 1.03870892
37 38 39 40 41 42
0.64358149 -2.21976194 -1.59052651 -3.80027165 -6.38078137 -7.17103622
43 44 45 46 47 48
-8.19539908 -0.82463451 -0.84899737 1.33638492 -3.61488937 2.59485578
49 50 51 52 53 54
-2.21976194 -5.21976194 -4.03437965 -0.59052651 -1.21976194 -2.61488937
55 56 57 58 59 60
-10.96129108 -10.14667337 -5.93692823 -7.33205565 -8.67845737 -7.28332994
61
-6.09794765
> postscript(file="/var/www/html/rcomp/tmp/6484i1260359714.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 5.85332663 NA
1 3.45819920 5.85332663
2 5.66794435 3.45819920
3 4.66794435 5.66794435
4 8.87768949 4.66794435
5 4.29717977 8.87768949
6 7.06307177 4.29717977
7 6.01434606 7.06307177
8 8.40947349 6.01434606
9 8.19972835 8.40947349
10 5.22409120 8.19972835
11 4.17536549 5.22409120
12 2.03870892 4.17536549
13 -0.96129108 2.03870892
14 6.45819920 -0.96129108
15 7.27281692 6.45819920
16 3.66794435 7.27281692
17 3.85332663 3.66794435
18 4.85332663 3.85332663
19 1.85332663 4.85332663
20 4.27281692 1.85332663
21 2.08743463 4.27281692
22 1.06307177 2.08743463
23 1.27281692 1.06307177
24 -0.09794765 1.27281692
25 -4.70282023 -0.09794765
26 2.85332663 -4.70282023
27 -1.51743794 2.85332663
28 2.08743463 -1.51743794
29 2.27281692 2.08743463
30 -7.49307508 2.27281692
31 1.29717977 -7.49307508
32 -1.09794765 1.29717977
33 -2.91256537 -1.09794765
34 1.03870892 -2.91256537
35 1.03870892 1.03870892
36 0.64358149 1.03870892
37 -2.21976194 0.64358149
38 -1.59052651 -2.21976194
39 -3.80027165 -1.59052651
40 -6.38078137 -3.80027165
41 -7.17103622 -6.38078137
42 -8.19539908 -7.17103622
43 -0.82463451 -8.19539908
44 -0.84899737 -0.82463451
45 1.33638492 -0.84899737
46 -3.61488937 1.33638492
47 2.59485578 -3.61488937
48 -2.21976194 2.59485578
49 -5.21976194 -2.21976194
50 -4.03437965 -5.21976194
51 -0.59052651 -4.03437965
52 -1.21976194 -0.59052651
53 -2.61488937 -1.21976194
54 -10.96129108 -2.61488937
55 -10.14667337 -10.96129108
56 -5.93692823 -10.14667337
57 -7.33205565 -5.93692823
58 -8.67845737 -7.33205565
59 -7.28332994 -8.67845737
60 -6.09794765 -7.28332994
61 NA -6.09794765
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.45819920 5.85332663
[2,] 5.66794435 3.45819920
[3,] 4.66794435 5.66794435
[4,] 8.87768949 4.66794435
[5,] 4.29717977 8.87768949
[6,] 7.06307177 4.29717977
[7,] 6.01434606 7.06307177
[8,] 8.40947349 6.01434606
[9,] 8.19972835 8.40947349
[10,] 5.22409120 8.19972835
[11,] 4.17536549 5.22409120
[12,] 2.03870892 4.17536549
[13,] -0.96129108 2.03870892
[14,] 6.45819920 -0.96129108
[15,] 7.27281692 6.45819920
[16,] 3.66794435 7.27281692
[17,] 3.85332663 3.66794435
[18,] 4.85332663 3.85332663
[19,] 1.85332663 4.85332663
[20,] 4.27281692 1.85332663
[21,] 2.08743463 4.27281692
[22,] 1.06307177 2.08743463
[23,] 1.27281692 1.06307177
[24,] -0.09794765 1.27281692
[25,] -4.70282023 -0.09794765
[26,] 2.85332663 -4.70282023
[27,] -1.51743794 2.85332663
[28,] 2.08743463 -1.51743794
[29,] 2.27281692 2.08743463
[30,] -7.49307508 2.27281692
[31,] 1.29717977 -7.49307508
[32,] -1.09794765 1.29717977
[33,] -2.91256537 -1.09794765
[34,] 1.03870892 -2.91256537
[35,] 1.03870892 1.03870892
[36,] 0.64358149 1.03870892
[37,] -2.21976194 0.64358149
[38,] -1.59052651 -2.21976194
[39,] -3.80027165 -1.59052651
[40,] -6.38078137 -3.80027165
[41,] -7.17103622 -6.38078137
[42,] -8.19539908 -7.17103622
[43,] -0.82463451 -8.19539908
[44,] -0.84899737 -0.82463451
[45,] 1.33638492 -0.84899737
[46,] -3.61488937 1.33638492
[47,] 2.59485578 -3.61488937
[48,] -2.21976194 2.59485578
[49,] -5.21976194 -2.21976194
[50,] -4.03437965 -5.21976194
[51,] -0.59052651 -4.03437965
[52,] -1.21976194 -0.59052651
[53,] -2.61488937 -1.21976194
[54,] -10.96129108 -2.61488937
[55,] -10.14667337 -10.96129108
[56,] -5.93692823 -10.14667337
[57,] -7.33205565 -5.93692823
[58,] -8.67845737 -7.33205565
[59,] -7.28332994 -8.67845737
[60,] -6.09794765 -7.28332994
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.45819920 5.85332663
2 5.66794435 3.45819920
3 4.66794435 5.66794435
4 8.87768949 4.66794435
5 4.29717977 8.87768949
6 7.06307177 4.29717977
7 6.01434606 7.06307177
8 8.40947349 6.01434606
9 8.19972835 8.40947349
10 5.22409120 8.19972835
11 4.17536549 5.22409120
12 2.03870892 4.17536549
13 -0.96129108 2.03870892
14 6.45819920 -0.96129108
15 7.27281692 6.45819920
16 3.66794435 7.27281692
17 3.85332663 3.66794435
18 4.85332663 3.85332663
19 1.85332663 4.85332663
20 4.27281692 1.85332663
21 2.08743463 4.27281692
22 1.06307177 2.08743463
23 1.27281692 1.06307177
24 -0.09794765 1.27281692
25 -4.70282023 -0.09794765
26 2.85332663 -4.70282023
27 -1.51743794 2.85332663
28 2.08743463 -1.51743794
29 2.27281692 2.08743463
30 -7.49307508 2.27281692
31 1.29717977 -7.49307508
32 -1.09794765 1.29717977
33 -2.91256537 -1.09794765
34 1.03870892 -2.91256537
35 1.03870892 1.03870892
36 0.64358149 1.03870892
37 -2.21976194 0.64358149
38 -1.59052651 -2.21976194
39 -3.80027165 -1.59052651
40 -6.38078137 -3.80027165
41 -7.17103622 -6.38078137
42 -8.19539908 -7.17103622
43 -0.82463451 -8.19539908
44 -0.84899737 -0.82463451
45 1.33638492 -0.84899737
46 -3.61488937 1.33638492
47 2.59485578 -3.61488937
48 -2.21976194 2.59485578
49 -5.21976194 -2.21976194
50 -4.03437965 -5.21976194
51 -0.59052651 -4.03437965
52 -1.21976194 -0.59052651
53 -2.61488937 -1.21976194
54 -10.96129108 -2.61488937
55 -10.14667337 -10.96129108
56 -5.93692823 -10.14667337
57 -7.33205565 -5.93692823
58 -8.67845737 -7.33205565
59 -7.28332994 -8.67845737
60 -6.09794765 -7.28332994
> 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/7u1a61260359714.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/85zs71260359714.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/9hm5y1260359714.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/10fhcl1260359714.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/11szy01260359714.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/12i4ht1260359714.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/13h1is1260359714.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/14fh7g1260359714.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/15sbzp1260359714.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/169uwk1260359714.tab")
+ }
>
> system("convert tmp/1sjb91260359714.ps tmp/1sjb91260359714.png")
> system("convert tmp/24np91260359714.ps tmp/24np91260359714.png")
> system("convert tmp/3pnn41260359714.ps tmp/3pnn41260359714.png")
> system("convert tmp/423c41260359714.ps tmp/423c41260359714.png")
> system("convert tmp/5vios1260359714.ps tmp/5vios1260359714.png")
> system("convert tmp/6484i1260359714.ps tmp/6484i1260359714.png")
> system("convert tmp/7u1a61260359714.ps tmp/7u1a61260359714.png")
> system("convert tmp/85zs71260359714.ps tmp/85zs71260359714.png")
> system("convert tmp/9hm5y1260359714.ps tmp/9hm5y1260359714.png")
> system("convert tmp/10fhcl1260359714.ps tmp/10fhcl1260359714.png")
>
>
> proc.time()
user system elapsed
2.461 1.560 5.552