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(627,356,696,386,825,444,677,387,656,327,785,448,412,225,352,182,839,460,729,411,696,342,641,361,695,377,638,331,762,428,635,340,721,352,854,461,418,221,367,198,824,422,687,329,601,320,676,375,740,364,691,351,683,380,594,319,729,322,731,386,386,221,331,187,707,344,715,342,657,365,653,313,642,356,643,337,718,389,654,326,632,343,731,357,392,220,344,228,792,391,852,425,649,332,629,298,685,360,617,326,715,325,715,393,629,301,916,426,531,265,357,210,917,429,828,440,708,357,858,431),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 627 356
2 696 386
3 825 444
4 677 387
5 656 327
6 785 448
7 412 225
8 352 182
9 839 460
10 729 411
11 696 342
12 641 361
13 695 377
14 638 331
15 762 428
16 635 340
17 721 352
18 854 461
19 418 221
20 367 198
21 824 422
22 687 329
23 601 320
24 676 375
25 740 364
26 691 351
27 683 380
28 594 319
29 729 322
30 731 386
31 386 221
32 331 187
33 707 344
34 715 342
35 657 365
36 653 313
37 642 356
38 643 337
39 718 389
40 654 326
41 632 343
42 731 357
43 392 220
44 344 228
45 792 391
46 852 425
47 649 332
48 629 298
49 685 360
50 617 326
51 715 325
52 715 393
53 629 301
54 916 426
55 531 265
56 357 210
57 917 429
58 828 440
59 708 357
60 858 431
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
-3.625 1.928
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-92.000 -37.165 -8.807 37.158 111.751
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -3.62513 30.08479 -0.12 0.905
X 1.92818 0.08567 22.51 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 46.81 on 58 degrees of freedom
Multiple R-squared: 0.8973, Adjusted R-squared: 0.8955
F-statistic: 506.6 on 1 and 58 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.45115866 0.90231731 0.5488413
[2,] 0.32190492 0.64380985 0.6780951
[3,] 0.24657143 0.49314285 0.7534286
[4,] 0.14625579 0.29251158 0.8537442
[5,] 0.09322911 0.18645822 0.9067709
[6,] 0.06403244 0.12806487 0.9359676
[7,] 0.18048672 0.36097344 0.8195133
[8,] 0.14670722 0.29341444 0.8532928
[9,] 0.10020921 0.20041843 0.8997908
[10,] 0.07554487 0.15108974 0.9244551
[11,] 0.06505450 0.13010901 0.9349455
[12,] 0.04155602 0.08311204 0.9584440
[13,] 0.10615665 0.21231330 0.8938433
[14,] 0.09304348 0.18608695 0.9069565
[15,] 0.06431474 0.12862948 0.9356853
[16,] 0.04633140 0.09266279 0.9536686
[17,] 0.05458601 0.10917203 0.9454140
[18,] 0.10984358 0.21968717 0.8901564
[19,] 0.07756350 0.15512700 0.9224365
[20,] 0.07305969 0.14611937 0.9269403
[21,] 0.09628951 0.19257903 0.9037105
[22,] 0.07915474 0.15830948 0.9208453
[23,] 0.08350230 0.16700460 0.9164977
[24,] 0.06120005 0.12240010 0.9387999
[25,] 0.37184864 0.74369729 0.6281514
[26,] 0.32434843 0.64869685 0.6756516
[27,] 0.31008140 0.62016280 0.6899186
[28,] 0.27101785 0.54203571 0.7289821
[29,] 0.28470465 0.56940931 0.7152953
[30,] 0.33457058 0.66914116 0.6654294
[31,] 0.35403085 0.70806169 0.6459692
[32,] 0.38381056 0.76762113 0.6161894
[33,] 0.39985027 0.79970054 0.6001497
[34,] 0.33203921 0.66407842 0.6679608
[35,] 0.34456155 0.68912310 0.6554384
[36,] 0.29618218 0.59236436 0.7038178
[37,] 0.27601320 0.55202640 0.7239868
[38,] 0.25838908 0.51677816 0.7416109
[39,] 0.21122260 0.42244520 0.7887774
[40,] 0.43105839 0.86211677 0.5689416
[41,] 0.37981879 0.75963758 0.6201812
[42,] 0.32022274 0.64044547 0.6797773
[43,] 0.24783113 0.49566225 0.7521689
[44,] 0.24762655 0.49525310 0.7523734
[45,] 0.20002913 0.40005826 0.7999709
[46,] 0.15461313 0.30922625 0.8453869
[47,] 0.26586784 0.53173568 0.7341322
[48,] 0.40305630 0.80611260 0.5969437
[49,] 0.37345520 0.74691040 0.6265448
[50,] 0.46532492 0.93064983 0.5346751
[51,] 0.38138297 0.76276594 0.6186170
> postscript(file="/var/www/html/rcomp/tmp/1ivc51258556454.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/27t7j1258556454.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/3edyw1258556454.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/4q7871258556454.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/5rz6i1258556454.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 7
-55.807230 -44.652654 -27.487140 -65.580835 29.110013 -75.199863 -18.215547
8 9 10 11 12 13 14
4.696227 -44.338032 -59.857174 40.187301 -51.448134 -28.299027 3.397290
15 16 17 18 19 20 21
-59.636247 -16.956337 45.905493 -31.266213 -4.502824 -11.154665 13.932838
22 23 24 25 26 27 28
56.253651 -12.392722 -43.442665 41.767324 17.833674 -46.083569 -17.464541
29 30 31 32 33 34 35
111.750917 -9.652654 -36.502824 -25.944677 47.330939 59.187301 -43.160857
36 37 38 39 40 41 42
53.104544 -40.807230 -3.171795 -28.437196 29.038194 -25.740880 46.264589
43 44 45 46 47 48 49
-28.574643 -92.000089 41.706442 36.148295 12.469109 58.027256 -5.519953
50 51 52 53 54 55 56
-7.961806 91.966374 -39.149919 52.242713 98.220115 23.657222 -44.292835
57 58 59 60
93.435572 -16.774416 23.264589 30.579211
> postscript(file="/var/www/html/rcomp/tmp/66vyh1258556454.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 -55.807230 NA
1 -44.652654 -55.807230
2 -27.487140 -44.652654
3 -65.580835 -27.487140
4 29.110013 -65.580835
5 -75.199863 29.110013
6 -18.215547 -75.199863
7 4.696227 -18.215547
8 -44.338032 4.696227
9 -59.857174 -44.338032
10 40.187301 -59.857174
11 -51.448134 40.187301
12 -28.299027 -51.448134
13 3.397290 -28.299027
14 -59.636247 3.397290
15 -16.956337 -59.636247
16 45.905493 -16.956337
17 -31.266213 45.905493
18 -4.502824 -31.266213
19 -11.154665 -4.502824
20 13.932838 -11.154665
21 56.253651 13.932838
22 -12.392722 56.253651
23 -43.442665 -12.392722
24 41.767324 -43.442665
25 17.833674 41.767324
26 -46.083569 17.833674
27 -17.464541 -46.083569
28 111.750917 -17.464541
29 -9.652654 111.750917
30 -36.502824 -9.652654
31 -25.944677 -36.502824
32 47.330939 -25.944677
33 59.187301 47.330939
34 -43.160857 59.187301
35 53.104544 -43.160857
36 -40.807230 53.104544
37 -3.171795 -40.807230
38 -28.437196 -3.171795
39 29.038194 -28.437196
40 -25.740880 29.038194
41 46.264589 -25.740880
42 -28.574643 46.264589
43 -92.000089 -28.574643
44 41.706442 -92.000089
45 36.148295 41.706442
46 12.469109 36.148295
47 58.027256 12.469109
48 -5.519953 58.027256
49 -7.961806 -5.519953
50 91.966374 -7.961806
51 -39.149919 91.966374
52 52.242713 -39.149919
53 98.220115 52.242713
54 23.657222 98.220115
55 -44.292835 23.657222
56 93.435572 -44.292835
57 -16.774416 93.435572
58 23.264589 -16.774416
59 30.579211 23.264589
60 NA 30.579211
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -44.652654 -55.807230
[2,] -27.487140 -44.652654
[3,] -65.580835 -27.487140
[4,] 29.110013 -65.580835
[5,] -75.199863 29.110013
[6,] -18.215547 -75.199863
[7,] 4.696227 -18.215547
[8,] -44.338032 4.696227
[9,] -59.857174 -44.338032
[10,] 40.187301 -59.857174
[11,] -51.448134 40.187301
[12,] -28.299027 -51.448134
[13,] 3.397290 -28.299027
[14,] -59.636247 3.397290
[15,] -16.956337 -59.636247
[16,] 45.905493 -16.956337
[17,] -31.266213 45.905493
[18,] -4.502824 -31.266213
[19,] -11.154665 -4.502824
[20,] 13.932838 -11.154665
[21,] 56.253651 13.932838
[22,] -12.392722 56.253651
[23,] -43.442665 -12.392722
[24,] 41.767324 -43.442665
[25,] 17.833674 41.767324
[26,] -46.083569 17.833674
[27,] -17.464541 -46.083569
[28,] 111.750917 -17.464541
[29,] -9.652654 111.750917
[30,] -36.502824 -9.652654
[31,] -25.944677 -36.502824
[32,] 47.330939 -25.944677
[33,] 59.187301 47.330939
[34,] -43.160857 59.187301
[35,] 53.104544 -43.160857
[36,] -40.807230 53.104544
[37,] -3.171795 -40.807230
[38,] -28.437196 -3.171795
[39,] 29.038194 -28.437196
[40,] -25.740880 29.038194
[41,] 46.264589 -25.740880
[42,] -28.574643 46.264589
[43,] -92.000089 -28.574643
[44,] 41.706442 -92.000089
[45,] 36.148295 41.706442
[46,] 12.469109 36.148295
[47,] 58.027256 12.469109
[48,] -5.519953 58.027256
[49,] -7.961806 -5.519953
[50,] 91.966374 -7.961806
[51,] -39.149919 91.966374
[52,] 52.242713 -39.149919
[53,] 98.220115 52.242713
[54,] 23.657222 98.220115
[55,] -44.292835 23.657222
[56,] 93.435572 -44.292835
[57,] -16.774416 93.435572
[58,] 23.264589 -16.774416
[59,] 30.579211 23.264589
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -44.652654 -55.807230
2 -27.487140 -44.652654
3 -65.580835 -27.487140
4 29.110013 -65.580835
5 -75.199863 29.110013
6 -18.215547 -75.199863
7 4.696227 -18.215547
8 -44.338032 4.696227
9 -59.857174 -44.338032
10 40.187301 -59.857174
11 -51.448134 40.187301
12 -28.299027 -51.448134
13 3.397290 -28.299027
14 -59.636247 3.397290
15 -16.956337 -59.636247
16 45.905493 -16.956337
17 -31.266213 45.905493
18 -4.502824 -31.266213
19 -11.154665 -4.502824
20 13.932838 -11.154665
21 56.253651 13.932838
22 -12.392722 56.253651
23 -43.442665 -12.392722
24 41.767324 -43.442665
25 17.833674 41.767324
26 -46.083569 17.833674
27 -17.464541 -46.083569
28 111.750917 -17.464541
29 -9.652654 111.750917
30 -36.502824 -9.652654
31 -25.944677 -36.502824
32 47.330939 -25.944677
33 59.187301 47.330939
34 -43.160857 59.187301
35 53.104544 -43.160857
36 -40.807230 53.104544
37 -3.171795 -40.807230
38 -28.437196 -3.171795
39 29.038194 -28.437196
40 -25.740880 29.038194
41 46.264589 -25.740880
42 -28.574643 46.264589
43 -92.000089 -28.574643
44 41.706442 -92.000089
45 36.148295 41.706442
46 12.469109 36.148295
47 58.027256 12.469109
48 -5.519953 58.027256
49 -7.961806 -5.519953
50 91.966374 -7.961806
51 -39.149919 91.966374
52 52.242713 -39.149919
53 98.220115 52.242713
54 23.657222 98.220115
55 -44.292835 23.657222
56 93.435572 -44.292835
57 -16.774416 93.435572
58 23.264589 -16.774416
59 30.579211 23.264589
> 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/7f8bk1258556454.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/8n9471258556454.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/9c4l31258556454.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/10770l1258556454.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/11865l1258556454.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/122wr61258556454.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/134enm1258556454.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/1466ic1258556454.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/15pv661258556454.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/16tzvk1258556454.tab")
+ }
>
> system("convert tmp/1ivc51258556454.ps tmp/1ivc51258556454.png")
> system("convert tmp/27t7j1258556454.ps tmp/27t7j1258556454.png")
> system("convert tmp/3edyw1258556454.ps tmp/3edyw1258556454.png")
> system("convert tmp/4q7871258556454.ps tmp/4q7871258556454.png")
> system("convert tmp/5rz6i1258556454.ps tmp/5rz6i1258556454.png")
> system("convert tmp/66vyh1258556454.ps tmp/66vyh1258556454.png")
> system("convert tmp/7f8bk1258556454.ps tmp/7f8bk1258556454.png")
> system("convert tmp/8n9471258556454.ps tmp/8n9471258556454.png")
> system("convert tmp/9c4l31258556454.ps tmp/9c4l31258556454.png")
> system("convert tmp/10770l1258556454.ps tmp/10770l1258556454.png")
>
>
> proc.time()
user system elapsed
2.486 1.560 3.539