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(282965,1,276610,1,277838,1,277051,1,277026,1,274960,1,270073,1,267063,1,264916,1,287182,1,291109,1,292223,1,288109,1,281400,1,282579,1,280113,1,280331,1,276759,1,275139,1,274275,1,271234,1,289725,1,290649,1,292223,1,278429,0,269749,0,265784,0,268957,0,264099,0,255121,0,253276,0,245980,0,235295,0,258479,0,260916,0,254586,0,250566,0,243345,0,247028,0,248464,0,244962,0,237003,0,237008,0,225477,0,226762,0,247857,0,248256,0,246892,0,245021,0,246186,0,255688,0,264242,0,268270,0,272969,0,273886,0,267353,0,271916,0,292633,0,295804,0,293222,0),dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Y X
1 282965 1
2 276610 1
3 277838 1
4 277051 1
5 277026 1
6 274960 1
7 270073 1
8 267063 1
9 264916 1
10 287182 1
11 291109 1
12 292223 1
13 288109 1
14 281400 1
15 282579 1
16 280113 1
17 280331 1
18 276759 1
19 275139 1
20 274275 1
21 271234 1
22 289725 1
23 290649 1
24 292223 1
25 278429 0
26 269749 0
27 265784 0
28 268957 0
29 264099 0
30 255121 0
31 253276 0
32 245980 0
33 235295 0
34 258479 0
35 260916 0
36 254586 0
37 250566 0
38 243345 0
39 247028 0
40 248464 0
41 244962 0
42 237003 0
43 237008 0
44 225477 0
45 226762 0
46 247857 0
47 248256 0
48 246892 0
49 245021 0
50 246186 0
51 255688 0
52 264242 0
53 268270 0
54 272969 0
55 273886 0
56 267353 0
57 271916 0
58 292633 0
59 295804 0
60 293222 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
257263 22801
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-31786 -9553 -2185 9768 38541
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 257263 2387 107.771 < 2e-16 ***
X 22801 3774 6.041 1.17e-07 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 14320 on 58 degrees of freedom
Multiple R-squared: 0.3862, Adjusted R-squared: 0.3756
F-statistic: 36.49 on 1 and 58 DF, p-value: 1.166e-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,] 1.149781e-02 2.299562e-02 0.9885022
[2,] 3.297607e-03 6.595213e-03 0.9967024
[3,] 4.456351e-03 8.912702e-03 0.9955436
[4,] 6.791044e-03 1.358209e-02 0.9932090
[5,] 9.453115e-03 1.890623e-02 0.9905469
[6,] 1.528037e-02 3.056074e-02 0.9847196
[7,] 2.889739e-02 5.779477e-02 0.9711026
[8,] 4.088416e-02 8.176832e-02 0.9591158
[9,] 3.213646e-02 6.427291e-02 0.9678635
[10,] 1.743322e-02 3.486643e-02 0.9825668
[11,] 9.332250e-03 1.866450e-02 0.9906677
[12,] 4.571376e-03 9.142752e-03 0.9954286
[13,] 2.150272e-03 4.300544e-03 0.9978497
[14,] 1.024760e-03 2.049519e-03 0.9989752
[15,] 5.152858e-04 1.030572e-03 0.9994847
[16,] 2.724232e-04 5.448463e-04 0.9997276
[17,] 2.033754e-04 4.067509e-04 0.9997966
[18,] 1.896835e-04 3.793670e-04 0.9998103
[19,] 1.797354e-04 3.594707e-04 0.9998203
[20,] 1.876387e-04 3.752773e-04 0.9998124
[21,] 1.184320e-04 2.368639e-04 0.9998816
[22,] 7.377164e-05 1.475433e-04 0.9999262
[23,] 4.459232e-05 8.918464e-05 0.9999554
[24,] 2.252833e-05 4.505667e-05 0.9999775
[25,] 1.230845e-05 2.461690e-05 0.9999877
[26,] 1.372104e-05 2.744209e-05 0.9999863
[27,] 1.378835e-05 2.757669e-05 0.9999862
[28,] 3.026407e-05 6.052814e-05 0.9999697
[29,] 2.663618e-04 5.327236e-04 0.9997336
[30,] 1.277352e-04 2.554703e-04 0.9998723
[31,] 6.044182e-05 1.208836e-04 0.9999396
[32,] 2.926744e-05 5.853488e-05 0.9999707
[33,] 1.690728e-05 3.381455e-05 0.9999831
[34,] 1.926910e-05 3.853821e-05 0.9999807
[35,] 1.324549e-05 2.649099e-05 0.9999868
[36,] 7.700930e-06 1.540186e-05 0.9999923
[37,] 6.028057e-06 1.205611e-05 0.9999940
[38,] 1.405027e-05 2.810054e-05 0.9999859
[39,] 3.056346e-05 6.112692e-05 0.9999694
[40,] 5.987140e-04 1.197428e-03 0.9994013
[41,] 7.645261e-03 1.529052e-02 0.9923547
[42,] 7.578291e-03 1.515658e-02 0.9924217
[43,] 8.245795e-03 1.649159e-02 0.9917542
[44,] 1.211836e-02 2.423672e-02 0.9878816
[45,] 2.968697e-02 5.937393e-02 0.9703130
[46,] 9.809740e-02 1.961948e-01 0.9019026
[47,] 1.727093e-01 3.454186e-01 0.8272907
[48,] 2.013206e-01 4.026413e-01 0.7986794
[49,] 2.088242e-01 4.176484e-01 0.7911758
[50,] 1.838666e-01 3.677331e-01 0.8161334
[51,] 1.528439e-01 3.056878e-01 0.8471561
> postscript(file="/var/www/html/rcomp/tmp/1s6qa1259329007.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/2dhg41259329007.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/32my31259329007.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/41kme1259329007.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/555ak1259329007.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
2900.33333 -3454.66667 -2226.66667 -3013.66667 -3038.66667 -5104.66667
7 8 9 10 11 12
-9991.66667 -13001.66667 -15148.66667 7117.33333 11044.33333 12158.33333
13 14 15 16 17 18
8044.33333 1335.33333 2514.33333 48.33333 266.33333 -3305.66667
19 20 21 22 23 24
-4925.66667 -5789.66667 -8830.66667 9660.33333 10584.33333 12158.33333
25 26 27 28 29 30
21165.63889 12485.63889 8520.63889 11693.63889 6835.63889 -2142.36111
31 32 33 34 35 36
-3987.36111 -11283.36111 -21968.36111 1215.63889 3652.63889 -2677.36111
37 38 39 40 41 42
-6697.36111 -13918.36111 -10235.36111 -8799.36111 -12301.36111 -20260.36111
43 44 45 46 47 48
-20255.36111 -31786.36111 -30501.36111 -9406.36111 -9007.36111 -10371.36111
49 50 51 52 53 54
-12242.36111 -11077.36111 -1575.36111 6978.63889 11006.63889 15705.63889
55 56 57 58 59 60
16622.63889 10089.63889 14652.63889 35369.63889 38540.63889 35958.63889
> postscript(file="/var/www/html/rcomp/tmp/6uosa1259329007.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 2900.33333 NA
1 -3454.66667 2900.33333
2 -2226.66667 -3454.66667
3 -3013.66667 -2226.66667
4 -3038.66667 -3013.66667
5 -5104.66667 -3038.66667
6 -9991.66667 -5104.66667
7 -13001.66667 -9991.66667
8 -15148.66667 -13001.66667
9 7117.33333 -15148.66667
10 11044.33333 7117.33333
11 12158.33333 11044.33333
12 8044.33333 12158.33333
13 1335.33333 8044.33333
14 2514.33333 1335.33333
15 48.33333 2514.33333
16 266.33333 48.33333
17 -3305.66667 266.33333
18 -4925.66667 -3305.66667
19 -5789.66667 -4925.66667
20 -8830.66667 -5789.66667
21 9660.33333 -8830.66667
22 10584.33333 9660.33333
23 12158.33333 10584.33333
24 21165.63889 12158.33333
25 12485.63889 21165.63889
26 8520.63889 12485.63889
27 11693.63889 8520.63889
28 6835.63889 11693.63889
29 -2142.36111 6835.63889
30 -3987.36111 -2142.36111
31 -11283.36111 -3987.36111
32 -21968.36111 -11283.36111
33 1215.63889 -21968.36111
34 3652.63889 1215.63889
35 -2677.36111 3652.63889
36 -6697.36111 -2677.36111
37 -13918.36111 -6697.36111
38 -10235.36111 -13918.36111
39 -8799.36111 -10235.36111
40 -12301.36111 -8799.36111
41 -20260.36111 -12301.36111
42 -20255.36111 -20260.36111
43 -31786.36111 -20255.36111
44 -30501.36111 -31786.36111
45 -9406.36111 -30501.36111
46 -9007.36111 -9406.36111
47 -10371.36111 -9007.36111
48 -12242.36111 -10371.36111
49 -11077.36111 -12242.36111
50 -1575.36111 -11077.36111
51 6978.63889 -1575.36111
52 11006.63889 6978.63889
53 15705.63889 11006.63889
54 16622.63889 15705.63889
55 10089.63889 16622.63889
56 14652.63889 10089.63889
57 35369.63889 14652.63889
58 38540.63889 35369.63889
59 35958.63889 38540.63889
60 NA 35958.63889
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -3454.66667 2900.33333
[2,] -2226.66667 -3454.66667
[3,] -3013.66667 -2226.66667
[4,] -3038.66667 -3013.66667
[5,] -5104.66667 -3038.66667
[6,] -9991.66667 -5104.66667
[7,] -13001.66667 -9991.66667
[8,] -15148.66667 -13001.66667
[9,] 7117.33333 -15148.66667
[10,] 11044.33333 7117.33333
[11,] 12158.33333 11044.33333
[12,] 8044.33333 12158.33333
[13,] 1335.33333 8044.33333
[14,] 2514.33333 1335.33333
[15,] 48.33333 2514.33333
[16,] 266.33333 48.33333
[17,] -3305.66667 266.33333
[18,] -4925.66667 -3305.66667
[19,] -5789.66667 -4925.66667
[20,] -8830.66667 -5789.66667
[21,] 9660.33333 -8830.66667
[22,] 10584.33333 9660.33333
[23,] 12158.33333 10584.33333
[24,] 21165.63889 12158.33333
[25,] 12485.63889 21165.63889
[26,] 8520.63889 12485.63889
[27,] 11693.63889 8520.63889
[28,] 6835.63889 11693.63889
[29,] -2142.36111 6835.63889
[30,] -3987.36111 -2142.36111
[31,] -11283.36111 -3987.36111
[32,] -21968.36111 -11283.36111
[33,] 1215.63889 -21968.36111
[34,] 3652.63889 1215.63889
[35,] -2677.36111 3652.63889
[36,] -6697.36111 -2677.36111
[37,] -13918.36111 -6697.36111
[38,] -10235.36111 -13918.36111
[39,] -8799.36111 -10235.36111
[40,] -12301.36111 -8799.36111
[41,] -20260.36111 -12301.36111
[42,] -20255.36111 -20260.36111
[43,] -31786.36111 -20255.36111
[44,] -30501.36111 -31786.36111
[45,] -9406.36111 -30501.36111
[46,] -9007.36111 -9406.36111
[47,] -10371.36111 -9007.36111
[48,] -12242.36111 -10371.36111
[49,] -11077.36111 -12242.36111
[50,] -1575.36111 -11077.36111
[51,] 6978.63889 -1575.36111
[52,] 11006.63889 6978.63889
[53,] 15705.63889 11006.63889
[54,] 16622.63889 15705.63889
[55,] 10089.63889 16622.63889
[56,] 14652.63889 10089.63889
[57,] 35369.63889 14652.63889
[58,] 38540.63889 35369.63889
[59,] 35958.63889 38540.63889
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -3454.66667 2900.33333
2 -2226.66667 -3454.66667
3 -3013.66667 -2226.66667
4 -3038.66667 -3013.66667
5 -5104.66667 -3038.66667
6 -9991.66667 -5104.66667
7 -13001.66667 -9991.66667
8 -15148.66667 -13001.66667
9 7117.33333 -15148.66667
10 11044.33333 7117.33333
11 12158.33333 11044.33333
12 8044.33333 12158.33333
13 1335.33333 8044.33333
14 2514.33333 1335.33333
15 48.33333 2514.33333
16 266.33333 48.33333
17 -3305.66667 266.33333
18 -4925.66667 -3305.66667
19 -5789.66667 -4925.66667
20 -8830.66667 -5789.66667
21 9660.33333 -8830.66667
22 10584.33333 9660.33333
23 12158.33333 10584.33333
24 21165.63889 12158.33333
25 12485.63889 21165.63889
26 8520.63889 12485.63889
27 11693.63889 8520.63889
28 6835.63889 11693.63889
29 -2142.36111 6835.63889
30 -3987.36111 -2142.36111
31 -11283.36111 -3987.36111
32 -21968.36111 -11283.36111
33 1215.63889 -21968.36111
34 3652.63889 1215.63889
35 -2677.36111 3652.63889
36 -6697.36111 -2677.36111
37 -13918.36111 -6697.36111
38 -10235.36111 -13918.36111
39 -8799.36111 -10235.36111
40 -12301.36111 -8799.36111
41 -20260.36111 -12301.36111
42 -20255.36111 -20260.36111
43 -31786.36111 -20255.36111
44 -30501.36111 -31786.36111
45 -9406.36111 -30501.36111
46 -9007.36111 -9406.36111
47 -10371.36111 -9007.36111
48 -12242.36111 -10371.36111
49 -11077.36111 -12242.36111
50 -1575.36111 -11077.36111
51 6978.63889 -1575.36111
52 11006.63889 6978.63889
53 15705.63889 11006.63889
54 16622.63889 15705.63889
55 10089.63889 16622.63889
56 14652.63889 10089.63889
57 35369.63889 14652.63889
58 38540.63889 35369.63889
59 35958.63889 38540.63889
> 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/7oe4v1259329007.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/86htz1259329007.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/924om1259329007.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/10r7l51259329007.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/11fafe1259329007.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/12r7r01259329007.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/1304a71259329008.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/14xdj41259329008.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/15qu441259329008.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/1673lv1259329008.tab")
+ }
> system("convert tmp/1s6qa1259329007.ps tmp/1s6qa1259329007.png")
> system("convert tmp/2dhg41259329007.ps tmp/2dhg41259329007.png")
> system("convert tmp/32my31259329007.ps tmp/32my31259329007.png")
> system("convert tmp/41kme1259329007.ps tmp/41kme1259329007.png")
> system("convert tmp/555ak1259329007.ps tmp/555ak1259329007.png")
> system("convert tmp/6uosa1259329007.ps tmp/6uosa1259329007.png")
> system("convert tmp/7oe4v1259329007.ps tmp/7oe4v1259329007.png")
> system("convert tmp/86htz1259329007.ps tmp/86htz1259329007.png")
> system("convert tmp/924om1259329007.ps tmp/924om1259329007.png")
> system("convert tmp/10r7l51259329007.ps tmp/10r7l51259329007.png")
>
>
> proc.time()
user system elapsed
2.461 1.585 2.907