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(90398,562000,90269,561000,90390,555000,88219,544000,87032,537000,87175,543000,92603,594000,93571,611000,94118,613000,92159,611000,89528,594000,89955,595000,89587,591000,89488,589000,88521,584000,86587,573000,85159,567000,84915,569000,91378,621000,92729,629000,92194,628000,89664,612000,86285,595000,86858,597000,87184,593000,86629,590000,85220,580000,84816,574000,84831,573000,84957,573000,90951,620000,92134,626000,91790,620000,86625,588000,83324,566000,82719,557000,83614,561000,81640,549000,78665,532000,77828,526000,75728,511000,72187,499000,79357,555000,81329,565000,77304,542000,75576,527000,72932,510000,74291,514000,74988,517000,73302,508000,70483,493000,69848,490000,66466,469000,67610,478000,75091,528000,76207,534000,73454,518000,72008,506000,71362,502000,74250,516000),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 = '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 t
1 90398 562000 1
2 90269 561000 2
3 90390 555000 3
4 88219 544000 4
5 87032 537000 5
6 87175 543000 6
7 92603 594000 7
8 93571 611000 8
9 94118 613000 9
10 92159 611000 10
11 89528 594000 11
12 89955 595000 12
13 89587 591000 13
14 89488 589000 14
15 88521 584000 15
16 86587 573000 16
17 85159 567000 17
18 84915 569000 18
19 91378 621000 19
20 92729 629000 20
21 92194 628000 21
22 89664 612000 22
23 86285 595000 23
24 86858 597000 24
25 87184 593000 25
26 86629 590000 26
27 85220 580000 27
28 84816 574000 28
29 84831 573000 29
30 84957 573000 30
31 90951 620000 31
32 92134 626000 32
33 91790 620000 33
34 86625 588000 34
35 83324 566000 35
36 82719 557000 36
37 83614 561000 37
38 81640 549000 38
39 78665 532000 39
40 77828 526000 40
41 75728 511000 41
42 72187 499000 42
43 79357 555000 43
44 81329 565000 44
45 77304 542000 45
46 75576 527000 46
47 72932 510000 47
48 74291 514000 48
49 74988 517000 49
50 73302 508000 50
51 70483 493000 51
52 69848 490000 52
53 66466 469000 53
54 67610 478000 54
55 75091 528000 55
56 76207 534000 56
57 73454 518000 57
58 72008 506000 58
59 71362 502000 59
60 74250 516000 60
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X t
25551.4147 0.1139 -203.0551
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2342.84 -892.41 12.33 884.08 2346.21
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.555e+04 2.932e+03 8.715 4.52e-12 ***
X 1.139e-01 4.793e-03 23.756 < 2e-16 ***
t -2.031e+02 1.152e+01 -17.629 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1155 on 57 degrees of freedom
Multiple R-squared: 0.9783, Adjusted R-squared: 0.9775
F-statistic: 1282 on 2 and 57 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,] 0.25342961 0.5068592278 0.7465703861
[2,] 0.15041136 0.3008227272 0.8495886364
[3,] 0.09334810 0.1866961978 0.9066519011
[4,] 0.06341807 0.1268361447 0.9365819276
[5,] 0.13299458 0.2659891679 0.8670054160
[6,] 0.22014896 0.4402979132 0.7798510434
[7,] 0.14670009 0.2934001726 0.8532999137
[8,] 0.10471885 0.2094376998 0.8952811501
[9,] 0.10317628 0.2063525608 0.8968237196
[10,] 0.08260531 0.1652106153 0.9173946924
[11,] 0.05792550 0.1158510074 0.9420744963
[12,] 0.04499664 0.0899932750 0.9550033625
[13,] 0.03126669 0.0625333852 0.9687333074
[14,] 0.04310927 0.0862185313 0.9568907343
[15,] 0.11184076 0.2236815265 0.8881592368
[16,] 0.14527730 0.2905546014 0.8547226993
[17,] 0.13518044 0.2703608740 0.8648195630
[18,] 0.19837222 0.3967444495 0.8016277752
[19,] 0.25615856 0.5123171233 0.7438414384
[20,] 0.34822298 0.6964459505 0.6517770248
[21,] 0.43495756 0.8699151242 0.5650424379
[22,] 0.48977200 0.9795439986 0.5102280007
[23,] 0.54227465 0.9154506972 0.4577253486
[24,] 0.59393277 0.8121344584 0.4060672292
[25,] 0.64503904 0.7099219280 0.3549609640
[26,] 0.88054659 0.2389068265 0.1194534133
[27,] 0.96627680 0.0674464057 0.0337232028
[28,] 0.98753258 0.0249348308 0.0124674154
[29,] 0.98448564 0.0310287111 0.0155143556
[30,] 0.97625648 0.0474870365 0.0237435183
[31,] 0.96876249 0.0624750136 0.0312375068
[32,] 0.97562798 0.0487440379 0.0243720190
[33,] 0.98190097 0.0361980552 0.0180990276
[34,] 0.98357039 0.0328592217 0.0164296109
[35,] 0.99218580 0.0156284093 0.0078142047
[36,] 0.99971095 0.0005780942 0.0002890471
[37,] 0.99975004 0.0004999193 0.0002499597
[38,] 0.99961239 0.0007752259 0.0003876129
[39,] 0.99904359 0.0019128297 0.0009564148
[40,] 0.99935214 0.0012957203 0.0006478602
[41,] 0.99895456 0.0020908718 0.0010454359
[42,] 0.99870237 0.0025952577 0.0012976289
[43,] 0.99663840 0.0067232062 0.0033616031
[44,] 0.99633505 0.0073298984 0.0036649492
[45,] 0.99771925 0.0045614978 0.0022807489
[46,] 0.99671694 0.0065661265 0.0032830632
[47,] 0.99517558 0.0096488463 0.0048244231
[48,] 0.98853300 0.0229340021 0.0114670011
[49,] 0.99205439 0.0158912251 0.0079456126
> postscript(file="/var/www/html/rcomp/tmp/1v3ig1258571048.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/2gfqa1258571048.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/366in1258571048.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/4af2u1258571048.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/529xz1258571048.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
1060.32269 1248.23779 2255.45287 1539.96793 1353.04301 1015.93814
7 8 9 10 11 12
840.13346 75.56864 597.90376 -930.32115 -1422.64611 -906.45100
13 14 15 16 17 18
-615.95591 -284.18081 -478.82572 -957.31066 -1499.09558 -1767.76046
19 20 21 22 23 24
-1022.42514 -379.25000 -597.33490 -1102.51986 -2342.84482 -1794.50971
25 26 27 28 29 30
-810.01462 -820.37952 -887.72446 -405.50937 -73.59427 255.46083
31 32 33 34 35 36
1101.09614 1803.99127 2346.20635 1027.78132 434.75634 1057.55141
37 38 39 40 41 42
1700.16653 1295.54159 459.21663 508.43171 319.38675 -1652.23819
43 44 45 46 47 48
-655.34285 381.11230 -822.05269 -639.09765 -1144.42261 -37.80749
49 50 51 52 53 54
520.66763 62.46270 -845.58225 -935.94716 -1723.83214 -1401.51699
55 56 57 58 59 60
589.53832 1225.43345 497.24849 620.62355 633.11864 2130.13381
> postscript(file="/var/www/html/rcomp/tmp/6g3xu1258571048.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 1060.32269 NA
1 1248.23779 1060.32269
2 2255.45287 1248.23779
3 1539.96793 2255.45287
4 1353.04301 1539.96793
5 1015.93814 1353.04301
6 840.13346 1015.93814
7 75.56864 840.13346
8 597.90376 75.56864
9 -930.32115 597.90376
10 -1422.64611 -930.32115
11 -906.45100 -1422.64611
12 -615.95591 -906.45100
13 -284.18081 -615.95591
14 -478.82572 -284.18081
15 -957.31066 -478.82572
16 -1499.09558 -957.31066
17 -1767.76046 -1499.09558
18 -1022.42514 -1767.76046
19 -379.25000 -1022.42514
20 -597.33490 -379.25000
21 -1102.51986 -597.33490
22 -2342.84482 -1102.51986
23 -1794.50971 -2342.84482
24 -810.01462 -1794.50971
25 -820.37952 -810.01462
26 -887.72446 -820.37952
27 -405.50937 -887.72446
28 -73.59427 -405.50937
29 255.46083 -73.59427
30 1101.09614 255.46083
31 1803.99127 1101.09614
32 2346.20635 1803.99127
33 1027.78132 2346.20635
34 434.75634 1027.78132
35 1057.55141 434.75634
36 1700.16653 1057.55141
37 1295.54159 1700.16653
38 459.21663 1295.54159
39 508.43171 459.21663
40 319.38675 508.43171
41 -1652.23819 319.38675
42 -655.34285 -1652.23819
43 381.11230 -655.34285
44 -822.05269 381.11230
45 -639.09765 -822.05269
46 -1144.42261 -639.09765
47 -37.80749 -1144.42261
48 520.66763 -37.80749
49 62.46270 520.66763
50 -845.58225 62.46270
51 -935.94716 -845.58225
52 -1723.83214 -935.94716
53 -1401.51699 -1723.83214
54 589.53832 -1401.51699
55 1225.43345 589.53832
56 497.24849 1225.43345
57 620.62355 497.24849
58 633.11864 620.62355
59 2130.13381 633.11864
60 NA 2130.13381
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1248.23779 1060.32269
[2,] 2255.45287 1248.23779
[3,] 1539.96793 2255.45287
[4,] 1353.04301 1539.96793
[5,] 1015.93814 1353.04301
[6,] 840.13346 1015.93814
[7,] 75.56864 840.13346
[8,] 597.90376 75.56864
[9,] -930.32115 597.90376
[10,] -1422.64611 -930.32115
[11,] -906.45100 -1422.64611
[12,] -615.95591 -906.45100
[13,] -284.18081 -615.95591
[14,] -478.82572 -284.18081
[15,] -957.31066 -478.82572
[16,] -1499.09558 -957.31066
[17,] -1767.76046 -1499.09558
[18,] -1022.42514 -1767.76046
[19,] -379.25000 -1022.42514
[20,] -597.33490 -379.25000
[21,] -1102.51986 -597.33490
[22,] -2342.84482 -1102.51986
[23,] -1794.50971 -2342.84482
[24,] -810.01462 -1794.50971
[25,] -820.37952 -810.01462
[26,] -887.72446 -820.37952
[27,] -405.50937 -887.72446
[28,] -73.59427 -405.50937
[29,] 255.46083 -73.59427
[30,] 1101.09614 255.46083
[31,] 1803.99127 1101.09614
[32,] 2346.20635 1803.99127
[33,] 1027.78132 2346.20635
[34,] 434.75634 1027.78132
[35,] 1057.55141 434.75634
[36,] 1700.16653 1057.55141
[37,] 1295.54159 1700.16653
[38,] 459.21663 1295.54159
[39,] 508.43171 459.21663
[40,] 319.38675 508.43171
[41,] -1652.23819 319.38675
[42,] -655.34285 -1652.23819
[43,] 381.11230 -655.34285
[44,] -822.05269 381.11230
[45,] -639.09765 -822.05269
[46,] -1144.42261 -639.09765
[47,] -37.80749 -1144.42261
[48,] 520.66763 -37.80749
[49,] 62.46270 520.66763
[50,] -845.58225 62.46270
[51,] -935.94716 -845.58225
[52,] -1723.83214 -935.94716
[53,] -1401.51699 -1723.83214
[54,] 589.53832 -1401.51699
[55,] 1225.43345 589.53832
[56,] 497.24849 1225.43345
[57,] 620.62355 497.24849
[58,] 633.11864 620.62355
[59,] 2130.13381 633.11864
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1248.23779 1060.32269
2 2255.45287 1248.23779
3 1539.96793 2255.45287
4 1353.04301 1539.96793
5 1015.93814 1353.04301
6 840.13346 1015.93814
7 75.56864 840.13346
8 597.90376 75.56864
9 -930.32115 597.90376
10 -1422.64611 -930.32115
11 -906.45100 -1422.64611
12 -615.95591 -906.45100
13 -284.18081 -615.95591
14 -478.82572 -284.18081
15 -957.31066 -478.82572
16 -1499.09558 -957.31066
17 -1767.76046 -1499.09558
18 -1022.42514 -1767.76046
19 -379.25000 -1022.42514
20 -597.33490 -379.25000
21 -1102.51986 -597.33490
22 -2342.84482 -1102.51986
23 -1794.50971 -2342.84482
24 -810.01462 -1794.50971
25 -820.37952 -810.01462
26 -887.72446 -820.37952
27 -405.50937 -887.72446
28 -73.59427 -405.50937
29 255.46083 -73.59427
30 1101.09614 255.46083
31 1803.99127 1101.09614
32 2346.20635 1803.99127
33 1027.78132 2346.20635
34 434.75634 1027.78132
35 1057.55141 434.75634
36 1700.16653 1057.55141
37 1295.54159 1700.16653
38 459.21663 1295.54159
39 508.43171 459.21663
40 319.38675 508.43171
41 -1652.23819 319.38675
42 -655.34285 -1652.23819
43 381.11230 -655.34285
44 -822.05269 381.11230
45 -639.09765 -822.05269
46 -1144.42261 -639.09765
47 -37.80749 -1144.42261
48 520.66763 -37.80749
49 62.46270 520.66763
50 -845.58225 62.46270
51 -935.94716 -845.58225
52 -1723.83214 -935.94716
53 -1401.51699 -1723.83214
54 589.53832 -1401.51699
55 1225.43345 589.53832
56 497.24849 1225.43345
57 620.62355 497.24849
58 633.11864 620.62355
59 2130.13381 633.11864
> 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/7xin91258571048.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/82all1258571048.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/963sf1258571048.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/10z54t1258571048.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/11azfm1258571048.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/1295dr1258571048.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/13l8hp1258571049.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/14go2s1258571049.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/15ud211258571049.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/16mfkl1258571049.tab")
+ }
>
> system("convert tmp/1v3ig1258571048.ps tmp/1v3ig1258571048.png")
> system("convert tmp/2gfqa1258571048.ps tmp/2gfqa1258571048.png")
> system("convert tmp/366in1258571048.ps tmp/366in1258571048.png")
> system("convert tmp/4af2u1258571048.ps tmp/4af2u1258571048.png")
> system("convert tmp/529xz1258571048.ps tmp/529xz1258571048.png")
> system("convert tmp/6g3xu1258571048.ps tmp/6g3xu1258571048.png")
> system("convert tmp/7xin91258571048.ps tmp/7xin91258571048.png")
> system("convert tmp/82all1258571048.ps tmp/82all1258571048.png")
> system("convert tmp/963sf1258571048.ps tmp/963sf1258571048.png")
> system("convert tmp/10z54t1258571048.ps tmp/10z54t1258571048.png")
>
>
> proc.time()
user system elapsed
2.531 1.626 5.956