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(562325,0,560854,0,555332,0,543599,0,536662,0,542722,0,593530,0,610763,0,612613,0,611324,0,594167,0,595454,0,590865,0,589379,0,584428,0,573100,0,567456,0,569028,0,620735,0,628884,0,628232,0,612117,0,595404,0,597141,0,593408,0,590072,0,579799,0,574205,0,572775,0,572942,0,619567,0,625809,0,619916,0,587625,0,565742,0,557274,0,560576,0,548854,0,531673,0,525919,0,511038,0,498662,1,555362,1,564591,1,541657,1,527070,1,509846,1,514258,1,516922,1,507561,1,492622,1,490243,1,469357,1,477580,1,528379,1,533590,1,517945,1,506174,1,501866,1,516141,1,528222,1,532638,1,536322,1,536535,1,523597,1,536214,1,586570,1,596594,1,580523,1),dim=c(2,69),dimnames=list(c('Y','X'),1:69))
> y <- array(NA,dim=c(2,69),dimnames=list(c('Y','X'),1:69))
> 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 562325 0
2 560854 0
3 555332 0
4 543599 0
5 536662 0
6 542722 0
7 593530 0
8 610763 0
9 612613 0
10 611324 0
11 594167 0
12 595454 0
13 590865 0
14 589379 0
15 584428 0
16 573100 0
17 567456 0
18 569028 0
19 620735 0
20 628884 0
21 628232 0
22 612117 0
23 595404 0
24 597141 0
25 593408 0
26 590072 0
27 579799 0
28 574205 0
29 572775 0
30 572942 0
31 619567 0
32 625809 0
33 619916 0
34 587625 0
35 565742 0
36 557274 0
37 560576 0
38 548854 0
39 531673 0
40 525919 0
41 511038 0
42 498662 1
43 555362 1
44 564591 1
45 541657 1
46 527070 1
47 509846 1
48 514258 1
49 516922 1
50 507561 1
51 492622 1
52 490243 1
53 469357 1
54 477580 1
55 528379 1
56 533590 1
57 517945 1
58 506174 1
59 501866 1
60 516141 1
61 528222 1
62 532638 1
63 536322 1
64 536535 1
65 523597 1
66 536214 1
67 586570 1
68 596594 1
69 580523 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
580812 -54847
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-69774 -19792 1104 14642 70628
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 580812 4716 123.167 < 2e-16 ***
X -54847 7403 -7.409 2.79e-10 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 30190 on 67 degrees of freedom
Multiple R-squared: 0.4503, Adjusted R-squared: 0.4421
F-statistic: 54.89 on 1 and 67 DF, p-value: 2.794e-10
> 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.09437545 0.18875091 0.9056245
[2,] 0.04277807 0.08555615 0.9572219
[3,] 0.21341266 0.42682532 0.7865873
[4,] 0.48374935 0.96749870 0.5162506
[5,] 0.62072523 0.75854954 0.3792748
[6,] 0.67258702 0.65482596 0.3274130
[7,] 0.60936926 0.78126148 0.3906307
[8,] 0.54543315 0.90913371 0.4545669
[9,] 0.46472666 0.92945333 0.5352733
[10,] 0.38277389 0.76554778 0.6172261
[11,] 0.30003636 0.60007272 0.6999636
[12,] 0.22898779 0.45797557 0.7710122
[13,] 0.17611087 0.35222174 0.8238891
[14,] 0.13043721 0.26087441 0.8695628
[15,] 0.18430105 0.36860210 0.8156989
[16,] 0.28588441 0.57176883 0.7141156
[17,] 0.38311727 0.76623455 0.6168827
[18,] 0.38026826 0.76053652 0.6197317
[19,] 0.32315495 0.64630989 0.6768451
[20,] 0.27478334 0.54956669 0.7252167
[21,] 0.22565041 0.45130081 0.7743496
[22,] 0.17963442 0.35926884 0.8203656
[23,] 0.13786632 0.27573263 0.8621337
[24,] 0.10544546 0.21089093 0.8945545
[25,] 0.07956176 0.15912352 0.9204382
[26,] 0.05865208 0.11730416 0.9413479
[27,] 0.08303442 0.16606885 0.9169656
[28,] 0.15271936 0.30543872 0.8472806
[29,] 0.25123067 0.50246134 0.7487693
[30,] 0.24886645 0.49773289 0.7511336
[31,] 0.23342258 0.46684516 0.7665774
[32,] 0.22719998 0.45439996 0.7728000
[33,] 0.22409045 0.44818090 0.7759095
[34,] 0.23593052 0.47186105 0.7640695
[35,] 0.28080988 0.56161975 0.7191901
[36,] 0.33386833 0.66773666 0.6661317
[37,] 0.42477411 0.84954821 0.5752259
[38,] 0.38773506 0.77547013 0.6122649
[39,] 0.40085033 0.80170066 0.5991497
[40,] 0.42780189 0.85560379 0.5721981
[41,] 0.37087694 0.74175388 0.6291231
[42,] 0.30632132 0.61264263 0.6936787
[43,] 0.26506023 0.53012047 0.7349398
[44,] 0.21575912 0.43151823 0.7842409
[45,] 0.16797906 0.33595811 0.8320209
[46,] 0.13725324 0.27450648 0.8627468
[47,] 0.14040356 0.28080712 0.8595964
[48,] 0.15289637 0.30579275 0.8471036
[49,] 0.30300230 0.60600459 0.6969977
[50,] 0.47706331 0.95412662 0.5229367
[51,] 0.39894772 0.79789544 0.6010523
[52,] 0.32022056 0.64044112 0.6797794
[53,] 0.26898582 0.53797164 0.7310142
[54,] 0.27495964 0.54991928 0.7250404
[55,] 0.34031135 0.68062270 0.6596886
[56,] 0.34342751 0.68685502 0.6565725
[57,] 0.29800778 0.59601555 0.7019922
[58,] 0.24535712 0.49071424 0.7546429
[59,] 0.19068434 0.38136868 0.8093157
[60,] 0.14921520 0.29843041 0.8507848
> postscript(file="/var/www/html/rcomp/tmp/1smwt1258661246.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/2bwbj1258661246.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/3pj5o1258661246.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/45zb31258661246.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/5i60x1258661246.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 = 69
Frequency = 1
1 2 3 4 5 6 7
-18487.390 -19958.390 -25480.390 -37213.390 -44150.390 -38090.390 12717.610
8 9 10 11 12 13 14
29950.610 31800.610 30511.610 13354.610 14641.610 10052.610 8566.610
15 16 17 18 19 20 21
3615.610 -7712.390 -13356.390 -11784.390 39922.610 48071.610 47419.610
22 23 24 25 26 27 28
31304.610 14591.610 16328.610 12595.610 9259.610 -1013.390 -6607.390
29 30 31 32 33 34 35
-8037.390 -7870.390 38754.610 44996.610 39103.610 6812.610 -15070.390
36 37 38 39 40 41 42
-23538.390 -20236.390 -31958.390 -49139.390 -54893.390 -69774.390 -27303.750
43 44 45 46 47 48 49
29396.250 38625.250 15691.250 1104.250 -16119.750 -11707.750 -9043.750
50 51 52 53 54 55 56
-18404.750 -33343.750 -35722.750 -56608.750 -48385.750 2413.250 7624.250
57 58 59 60 61 62 63
-8020.750 -19791.750 -24099.750 -9824.750 2256.250 6672.250 10356.250
64 65 66 67 68 69
10569.250 -2368.750 10248.250 60604.250 70628.250 54557.250
> postscript(file="/var/www/html/rcomp/tmp/6o67z1258661246.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 = 69
Frequency = 1
lag(myerror, k = 1) myerror
0 -18487.390 NA
1 -19958.390 -18487.390
2 -25480.390 -19958.390
3 -37213.390 -25480.390
4 -44150.390 -37213.390
5 -38090.390 -44150.390
6 12717.610 -38090.390
7 29950.610 12717.610
8 31800.610 29950.610
9 30511.610 31800.610
10 13354.610 30511.610
11 14641.610 13354.610
12 10052.610 14641.610
13 8566.610 10052.610
14 3615.610 8566.610
15 -7712.390 3615.610
16 -13356.390 -7712.390
17 -11784.390 -13356.390
18 39922.610 -11784.390
19 48071.610 39922.610
20 47419.610 48071.610
21 31304.610 47419.610
22 14591.610 31304.610
23 16328.610 14591.610
24 12595.610 16328.610
25 9259.610 12595.610
26 -1013.390 9259.610
27 -6607.390 -1013.390
28 -8037.390 -6607.390
29 -7870.390 -8037.390
30 38754.610 -7870.390
31 44996.610 38754.610
32 39103.610 44996.610
33 6812.610 39103.610
34 -15070.390 6812.610
35 -23538.390 -15070.390
36 -20236.390 -23538.390
37 -31958.390 -20236.390
38 -49139.390 -31958.390
39 -54893.390 -49139.390
40 -69774.390 -54893.390
41 -27303.750 -69774.390
42 29396.250 -27303.750
43 38625.250 29396.250
44 15691.250 38625.250
45 1104.250 15691.250
46 -16119.750 1104.250
47 -11707.750 -16119.750
48 -9043.750 -11707.750
49 -18404.750 -9043.750
50 -33343.750 -18404.750
51 -35722.750 -33343.750
52 -56608.750 -35722.750
53 -48385.750 -56608.750
54 2413.250 -48385.750
55 7624.250 2413.250
56 -8020.750 7624.250
57 -19791.750 -8020.750
58 -24099.750 -19791.750
59 -9824.750 -24099.750
60 2256.250 -9824.750
61 6672.250 2256.250
62 10356.250 6672.250
63 10569.250 10356.250
64 -2368.750 10569.250
65 10248.250 -2368.750
66 60604.250 10248.250
67 70628.250 60604.250
68 54557.250 70628.250
69 NA 54557.250
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -19958.390 -18487.390
[2,] -25480.390 -19958.390
[3,] -37213.390 -25480.390
[4,] -44150.390 -37213.390
[5,] -38090.390 -44150.390
[6,] 12717.610 -38090.390
[7,] 29950.610 12717.610
[8,] 31800.610 29950.610
[9,] 30511.610 31800.610
[10,] 13354.610 30511.610
[11,] 14641.610 13354.610
[12,] 10052.610 14641.610
[13,] 8566.610 10052.610
[14,] 3615.610 8566.610
[15,] -7712.390 3615.610
[16,] -13356.390 -7712.390
[17,] -11784.390 -13356.390
[18,] 39922.610 -11784.390
[19,] 48071.610 39922.610
[20,] 47419.610 48071.610
[21,] 31304.610 47419.610
[22,] 14591.610 31304.610
[23,] 16328.610 14591.610
[24,] 12595.610 16328.610
[25,] 9259.610 12595.610
[26,] -1013.390 9259.610
[27,] -6607.390 -1013.390
[28,] -8037.390 -6607.390
[29,] -7870.390 -8037.390
[30,] 38754.610 -7870.390
[31,] 44996.610 38754.610
[32,] 39103.610 44996.610
[33,] 6812.610 39103.610
[34,] -15070.390 6812.610
[35,] -23538.390 -15070.390
[36,] -20236.390 -23538.390
[37,] -31958.390 -20236.390
[38,] -49139.390 -31958.390
[39,] -54893.390 -49139.390
[40,] -69774.390 -54893.390
[41,] -27303.750 -69774.390
[42,] 29396.250 -27303.750
[43,] 38625.250 29396.250
[44,] 15691.250 38625.250
[45,] 1104.250 15691.250
[46,] -16119.750 1104.250
[47,] -11707.750 -16119.750
[48,] -9043.750 -11707.750
[49,] -18404.750 -9043.750
[50,] -33343.750 -18404.750
[51,] -35722.750 -33343.750
[52,] -56608.750 -35722.750
[53,] -48385.750 -56608.750
[54,] 2413.250 -48385.750
[55,] 7624.250 2413.250
[56,] -8020.750 7624.250
[57,] -19791.750 -8020.750
[58,] -24099.750 -19791.750
[59,] -9824.750 -24099.750
[60,] 2256.250 -9824.750
[61,] 6672.250 2256.250
[62,] 10356.250 6672.250
[63,] 10569.250 10356.250
[64,] -2368.750 10569.250
[65,] 10248.250 -2368.750
[66,] 60604.250 10248.250
[67,] 70628.250 60604.250
[68,] 54557.250 70628.250
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -19958.390 -18487.390
2 -25480.390 -19958.390
3 -37213.390 -25480.390
4 -44150.390 -37213.390
5 -38090.390 -44150.390
6 12717.610 -38090.390
7 29950.610 12717.610
8 31800.610 29950.610
9 30511.610 31800.610
10 13354.610 30511.610
11 14641.610 13354.610
12 10052.610 14641.610
13 8566.610 10052.610
14 3615.610 8566.610
15 -7712.390 3615.610
16 -13356.390 -7712.390
17 -11784.390 -13356.390
18 39922.610 -11784.390
19 48071.610 39922.610
20 47419.610 48071.610
21 31304.610 47419.610
22 14591.610 31304.610
23 16328.610 14591.610
24 12595.610 16328.610
25 9259.610 12595.610
26 -1013.390 9259.610
27 -6607.390 -1013.390
28 -8037.390 -6607.390
29 -7870.390 -8037.390
30 38754.610 -7870.390
31 44996.610 38754.610
32 39103.610 44996.610
33 6812.610 39103.610
34 -15070.390 6812.610
35 -23538.390 -15070.390
36 -20236.390 -23538.390
37 -31958.390 -20236.390
38 -49139.390 -31958.390
39 -54893.390 -49139.390
40 -69774.390 -54893.390
41 -27303.750 -69774.390
42 29396.250 -27303.750
43 38625.250 29396.250
44 15691.250 38625.250
45 1104.250 15691.250
46 -16119.750 1104.250
47 -11707.750 -16119.750
48 -9043.750 -11707.750
49 -18404.750 -9043.750
50 -33343.750 -18404.750
51 -35722.750 -33343.750
52 -56608.750 -35722.750
53 -48385.750 -56608.750
54 2413.250 -48385.750
55 7624.250 2413.250
56 -8020.750 7624.250
57 -19791.750 -8020.750
58 -24099.750 -19791.750
59 -9824.750 -24099.750
60 2256.250 -9824.750
61 6672.250 2256.250
62 10356.250 6672.250
63 10569.250 10356.250
64 -2368.750 10569.250
65 10248.250 -2368.750
66 60604.250 10248.250
67 70628.250 60604.250
68 54557.250 70628.250
> 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/7cvlj1258661246.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/83re91258661246.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/91dhn1258661246.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/10jnpn1258661246.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/111wjp1258661246.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/12ubbj1258661246.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/13vpm01258661246.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/14y3gs1258661246.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/157fse1258661246.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/16mcfd1258661246.tab")
+ }
> system("convert tmp/1smwt1258661246.ps tmp/1smwt1258661246.png")
> system("convert tmp/2bwbj1258661246.ps tmp/2bwbj1258661246.png")
> system("convert tmp/3pj5o1258661246.ps tmp/3pj5o1258661246.png")
> system("convert tmp/45zb31258661246.ps tmp/45zb31258661246.png")
> system("convert tmp/5i60x1258661246.ps tmp/5i60x1258661246.png")
> system("convert tmp/6o67z1258661246.ps tmp/6o67z1258661246.png")
> system("convert tmp/7cvlj1258661246.ps tmp/7cvlj1258661246.png")
> system("convert tmp/83re91258661246.ps tmp/83re91258661246.png")
> system("convert tmp/91dhn1258661246.ps tmp/91dhn1258661246.png")
> system("convert tmp/10jnpn1258661246.ps tmp/10jnpn1258661246.png")
>
>
> proc.time()
user system elapsed
2.604 1.600 6.492