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(9487,1169,8700,2154,9627,2249,8947,2687,9283,4359,8829,5382,9947,4459,9628,6398,9318,4596,9605,3024,8640,1887,9214,2070,9567,1351,8547,2218,9185,2461,9470,3028,9123,4784,9278,4975,10170,4607,9434,6249,9655,4809,9429,3157,8739,1910,9552,2228,9687,1594,9019,2467,9672,2222,9206,3607,9069,4685,9788,4962,10312,5770,10105,5480,9863,5000,9656,3228,9295,1993,9946,2288,9701,1580,9049,2111,10190,2192,9706,3601,9765,4665,9893,4876,9994,5813,10433,5589,10073,5331,10112,3075,9266,2002,9820,2306,10097,1507,9115,1992,10411,2487,9678,3490,10408,4647,10153,5594,10368,5611,10581,5788,10597,6204,10680,3013,9738,1931,9556,2549),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 9487 1169
2 8700 2154
3 9627 2249
4 8947 2687
5 9283 4359
6 8829 5382
7 9947 4459
8 9628 6398
9 9318 4596
10 9605 3024
11 8640 1887
12 9214 2070
13 9567 1351
14 8547 2218
15 9185 2461
16 9470 3028
17 9123 4784
18 9278 4975
19 10170 4607
20 9434 6249
21 9655 4809
22 9429 3157
23 8739 1910
24 9552 2228
25 9687 1594
26 9019 2467
27 9672 2222
28 9206 3607
29 9069 4685
30 9788 4962
31 10312 5770
32 10105 5480
33 9863 5000
34 9656 3228
35 9295 1993
36 9946 2288
37 9701 1580
38 9049 2111
39 10190 2192
40 9706 3601
41 9765 4665
42 9893 4876
43 9994 5813
44 10433 5589
45 10073 5331
46 10112 3075
47 9266 2002
48 9820 2306
49 10097 1507
50 9115 1992
51 10411 2487
52 9678 3490
53 10408 4647
54 10153 5594
55 10368 5611
56 10581 5788
57 10597 6204
58 10680 3013
59 9738 1931
60 9556 2549
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
9169.3117 0.1322
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1051.8 -390.1 53.0 315.8 1112.4
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.169e+03 1.567e+02 58.502 < 2e-16 ***
X 1.322e-01 4.045e-02 3.268 0.00183 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 480.7 on 58 degrees of freedom
Multiple R-squared: 0.1555, Adjusted R-squared: 0.1409
F-statistic: 10.68 on 1 and 58 DF, p-value: 0.001825
> 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.5200246 0.9599509 0.4799754
[2,] 0.4137240 0.8274480 0.5862760
[3,] 0.6612438 0.6775123 0.3387562
[4,] 0.5870162 0.8259676 0.4129838
[5,] 0.4824646 0.9649293 0.5175354
[6,] 0.4118597 0.8237193 0.5881403
[7,] 0.5024270 0.9951460 0.4975730
[8,] 0.4057847 0.8115694 0.5942153
[9,] 0.3726446 0.7452893 0.6273554
[10,] 0.5365540 0.9268919 0.4634460
[11,] 0.4618618 0.9237235 0.5381382
[12,] 0.3966698 0.7933396 0.6033302
[13,] 0.3954486 0.7908973 0.6045514
[14,] 0.3698809 0.7397618 0.6301191
[15,] 0.5170262 0.9659476 0.4829738
[16,] 0.5164777 0.9670445 0.4835223
[17,] 0.4734137 0.9468273 0.5265863
[18,] 0.4152480 0.8304960 0.5847520
[19,] 0.5085587 0.9828826 0.4914413
[20,] 0.4680846 0.9361691 0.5319154
[21,] 0.4633860 0.9267721 0.5366140
[22,] 0.4879227 0.9758454 0.5120773
[23,] 0.4580608 0.9161216 0.5419392
[24,] 0.4810372 0.9620745 0.5189628
[25,] 0.6668449 0.6663101 0.3331551
[26,] 0.6591098 0.6817804 0.3408902
[27,] 0.7164433 0.5671134 0.2835567
[28,] 0.7051762 0.5896476 0.2948238
[29,] 0.6771805 0.6456389 0.3228195
[30,] 0.6357476 0.7285049 0.3642524
[31,] 0.6119405 0.7761191 0.3880595
[32,] 0.6219327 0.7561345 0.3780673
[33,] 0.5801654 0.8396691 0.4198346
[34,] 0.6712786 0.6574427 0.3287214
[35,] 0.7467065 0.5065869 0.2532935
[36,] 0.7081535 0.5836931 0.2918465
[37,] 0.6906703 0.6186595 0.3093297
[38,] 0.6612629 0.6774742 0.3387371
[39,] 0.6546715 0.6906569 0.3453285
[40,] 0.6318094 0.7363812 0.3681906
[41,] 0.5921330 0.8157340 0.4078670
[42,] 0.5544240 0.8911521 0.4455760
[43,] 0.5740435 0.8519131 0.4259565
[44,] 0.4941359 0.9882718 0.5058641
[45,] 0.5154435 0.9691130 0.4845565
[46,] 0.6712537 0.6574926 0.3287463
[47,] 0.7471682 0.5056637 0.2528318
[48,] 0.7381371 0.5237258 0.2618629
[49,] 0.6483739 0.7032521 0.3516261
[50,] 0.5785320 0.8429360 0.4214680
[51,] 0.4400890 0.8801780 0.5599110
> postscript(file="/var/www/html/rcomp/tmp/155c11258821374.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/2bio41258821374.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/3umns1258821374.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/49jto1258821374.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/5qh6b1258821374.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
163.15882 -754.04782 160.39418 -577.50482 -462.52564 -1051.75548
7 8 9 10 11 12
188.25541 -387.06000 -458.85455 35.94733 -778.75323 -228.94391
13 14 15 16 17 18
219.10033 -915.50795 -309.62999 -99.58143 -678.70617 -548.95436
19 20 21 22 23 24
391.69137 -561.36376 -150.01091 -157.63388 -682.79359 88.17016
25 26 27 28 29 30
306.97829 -476.42313 208.96329 -440.11914 -719.61941 -37.23590
31 32 33 34 35 36
379.95500 211.28995 32.74090 59.98067 -137.76532 474.23879
37 38 39 40 41 42
322.82894 -399.36368 730.92898 60.67399 -20.97562 79.13240
43 44 45 46 47 48
56.27085 524.88130 198.98618 536.20566 -167.95502 345.85938
49 50 51 52 53 54
728.47877 -317.63313 912.93308 47.34702 624.40379 244.22035
55 56 57 58 59 60
456.97313 646.57559 607.58476 1112.40141 313.43043 49.73733
> postscript(file="/var/www/html/rcomp/tmp/6synm1258821374.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 163.15882 NA
1 -754.04782 163.15882
2 160.39418 -754.04782
3 -577.50482 160.39418
4 -462.52564 -577.50482
5 -1051.75548 -462.52564
6 188.25541 -1051.75548
7 -387.06000 188.25541
8 -458.85455 -387.06000
9 35.94733 -458.85455
10 -778.75323 35.94733
11 -228.94391 -778.75323
12 219.10033 -228.94391
13 -915.50795 219.10033
14 -309.62999 -915.50795
15 -99.58143 -309.62999
16 -678.70617 -99.58143
17 -548.95436 -678.70617
18 391.69137 -548.95436
19 -561.36376 391.69137
20 -150.01091 -561.36376
21 -157.63388 -150.01091
22 -682.79359 -157.63388
23 88.17016 -682.79359
24 306.97829 88.17016
25 -476.42313 306.97829
26 208.96329 -476.42313
27 -440.11914 208.96329
28 -719.61941 -440.11914
29 -37.23590 -719.61941
30 379.95500 -37.23590
31 211.28995 379.95500
32 32.74090 211.28995
33 59.98067 32.74090
34 -137.76532 59.98067
35 474.23879 -137.76532
36 322.82894 474.23879
37 -399.36368 322.82894
38 730.92898 -399.36368
39 60.67399 730.92898
40 -20.97562 60.67399
41 79.13240 -20.97562
42 56.27085 79.13240
43 524.88130 56.27085
44 198.98618 524.88130
45 536.20566 198.98618
46 -167.95502 536.20566
47 345.85938 -167.95502
48 728.47877 345.85938
49 -317.63313 728.47877
50 912.93308 -317.63313
51 47.34702 912.93308
52 624.40379 47.34702
53 244.22035 624.40379
54 456.97313 244.22035
55 646.57559 456.97313
56 607.58476 646.57559
57 1112.40141 607.58476
58 313.43043 1112.40141
59 49.73733 313.43043
60 NA 49.73733
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -754.04782 163.15882
[2,] 160.39418 -754.04782
[3,] -577.50482 160.39418
[4,] -462.52564 -577.50482
[5,] -1051.75548 -462.52564
[6,] 188.25541 -1051.75548
[7,] -387.06000 188.25541
[8,] -458.85455 -387.06000
[9,] 35.94733 -458.85455
[10,] -778.75323 35.94733
[11,] -228.94391 -778.75323
[12,] 219.10033 -228.94391
[13,] -915.50795 219.10033
[14,] -309.62999 -915.50795
[15,] -99.58143 -309.62999
[16,] -678.70617 -99.58143
[17,] -548.95436 -678.70617
[18,] 391.69137 -548.95436
[19,] -561.36376 391.69137
[20,] -150.01091 -561.36376
[21,] -157.63388 -150.01091
[22,] -682.79359 -157.63388
[23,] 88.17016 -682.79359
[24,] 306.97829 88.17016
[25,] -476.42313 306.97829
[26,] 208.96329 -476.42313
[27,] -440.11914 208.96329
[28,] -719.61941 -440.11914
[29,] -37.23590 -719.61941
[30,] 379.95500 -37.23590
[31,] 211.28995 379.95500
[32,] 32.74090 211.28995
[33,] 59.98067 32.74090
[34,] -137.76532 59.98067
[35,] 474.23879 -137.76532
[36,] 322.82894 474.23879
[37,] -399.36368 322.82894
[38,] 730.92898 -399.36368
[39,] 60.67399 730.92898
[40,] -20.97562 60.67399
[41,] 79.13240 -20.97562
[42,] 56.27085 79.13240
[43,] 524.88130 56.27085
[44,] 198.98618 524.88130
[45,] 536.20566 198.98618
[46,] -167.95502 536.20566
[47,] 345.85938 -167.95502
[48,] 728.47877 345.85938
[49,] -317.63313 728.47877
[50,] 912.93308 -317.63313
[51,] 47.34702 912.93308
[52,] 624.40379 47.34702
[53,] 244.22035 624.40379
[54,] 456.97313 244.22035
[55,] 646.57559 456.97313
[56,] 607.58476 646.57559
[57,] 1112.40141 607.58476
[58,] 313.43043 1112.40141
[59,] 49.73733 313.43043
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -754.04782 163.15882
2 160.39418 -754.04782
3 -577.50482 160.39418
4 -462.52564 -577.50482
5 -1051.75548 -462.52564
6 188.25541 -1051.75548
7 -387.06000 188.25541
8 -458.85455 -387.06000
9 35.94733 -458.85455
10 -778.75323 35.94733
11 -228.94391 -778.75323
12 219.10033 -228.94391
13 -915.50795 219.10033
14 -309.62999 -915.50795
15 -99.58143 -309.62999
16 -678.70617 -99.58143
17 -548.95436 -678.70617
18 391.69137 -548.95436
19 -561.36376 391.69137
20 -150.01091 -561.36376
21 -157.63388 -150.01091
22 -682.79359 -157.63388
23 88.17016 -682.79359
24 306.97829 88.17016
25 -476.42313 306.97829
26 208.96329 -476.42313
27 -440.11914 208.96329
28 -719.61941 -440.11914
29 -37.23590 -719.61941
30 379.95500 -37.23590
31 211.28995 379.95500
32 32.74090 211.28995
33 59.98067 32.74090
34 -137.76532 59.98067
35 474.23879 -137.76532
36 322.82894 474.23879
37 -399.36368 322.82894
38 730.92898 -399.36368
39 60.67399 730.92898
40 -20.97562 60.67399
41 79.13240 -20.97562
42 56.27085 79.13240
43 524.88130 56.27085
44 198.98618 524.88130
45 536.20566 198.98618
46 -167.95502 536.20566
47 345.85938 -167.95502
48 728.47877 345.85938
49 -317.63313 728.47877
50 912.93308 -317.63313
51 47.34702 912.93308
52 624.40379 47.34702
53 244.22035 624.40379
54 456.97313 244.22035
55 646.57559 456.97313
56 607.58476 646.57559
57 1112.40141 607.58476
58 313.43043 1112.40141
59 49.73733 313.43043
> 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/74ur61258821374.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/8mfyr1258821374.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/91r031258821374.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/10u8gs1258821374.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/1193vz1258821374.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/12ykjb1258821374.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/136md91258821375.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/14cr6s1258821375.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/15zngp1258821375.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/16w8mt1258821375.tab")
+ }
>
> system("convert tmp/155c11258821374.ps tmp/155c11258821374.png")
> system("convert tmp/2bio41258821374.ps tmp/2bio41258821374.png")
> system("convert tmp/3umns1258821374.ps tmp/3umns1258821374.png")
> system("convert tmp/49jto1258821374.ps tmp/49jto1258821374.png")
> system("convert tmp/5qh6b1258821374.ps tmp/5qh6b1258821374.png")
> system("convert tmp/6synm1258821374.ps tmp/6synm1258821374.png")
> system("convert tmp/74ur61258821374.ps tmp/74ur61258821374.png")
> system("convert tmp/8mfyr1258821374.ps tmp/8mfyr1258821374.png")
> system("convert tmp/91r031258821374.ps tmp/91r031258821374.png")
> system("convert tmp/10u8gs1258821374.ps tmp/10u8gs1258821374.png")
>
>
> proc.time()
user system elapsed
2.439 1.535 3.265