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(161,0,149,0,139,0,135,0,130,0,127,0,122,0,117,0,112,0,113,0,149,0,157,0,157,0,147,0,137,0,132,0,125,0,123,0,117,0,114,0,111,0,112,0,144,0,150,0,149,0,134,0,123,0,116,0,117,0,111,0,105,0,102,0,95,0,93,0,124,0,130,0,124,0,115,0,106,0,105,0,105,1,101,1,95,1,93,1,84,1,87,1,116,1,120,1,117,1,109,1,105,1,107,1,109,1,109,1,108,1,107,1,99,1,103,1,131,1,137,1),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 161 0
2 149 0
3 139 0
4 135 0
5 130 0
6 127 0
7 122 0
8 117 0
9 112 0
10 113 0
11 149 0
12 157 0
13 157 0
14 147 0
15 137 0
16 132 0
17 125 0
18 123 0
19 117 0
20 114 0
21 111 0
22 112 0
23 144 0
24 150 0
25 149 0
26 134 0
27 123 0
28 116 0
29 117 0
30 111 0
31 105 0
32 102 0
33 95 0
34 93 0
35 124 0
36 130 0
37 124 0
38 115 0
39 106 0
40 105 0
41 105 1
42 101 1
43 95 1
44 93 1
45 84 1
46 87 1
47 116 1
48 120 1
49 117 1
50 109 1
51 105 1
52 107 1
53 109 1
54 109 1
55 108 1
56 107 1
57 99 1
58 103 1
59 131 1
60 137 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
125.73 -18.63
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-32.725 -11.819 -1.725 9.431 35.275
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 125.725 2.575 48.834 < 2e-16 ***
X -18.625 4.459 -4.177 0.000101 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 16.28 on 58 degrees of freedom
Multiple R-squared: 0.2312, Adjusted R-squared: 0.218
F-statistic: 17.44 on 1 and 58 DF, p-value: 0.0001007
> 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.5118295 0.97634094 0.48817047
[2,] 0.4762966 0.95259318 0.52370341
[3,] 0.4837293 0.96745867 0.51627066
[4,] 0.5241798 0.95164048 0.47582024
[5,] 0.5916215 0.81675690 0.40837845
[6,] 0.6000545 0.79989102 0.39994551
[7,] 0.6279073 0.74418537 0.37209268
[8,] 0.7528690 0.49426194 0.24713097
[9,] 0.8460373 0.30792545 0.15396273
[10,] 0.8491484 0.30170314 0.15085157
[11,] 0.8131464 0.37370727 0.18685364
[12,] 0.7675252 0.46494961 0.23247480
[13,] 0.7272126 0.54557481 0.27278741
[14,] 0.6890356 0.62192878 0.31096439
[15,] 0.6791383 0.64172332 0.32086166
[16,] 0.6826822 0.63463564 0.31731782
[17,] 0.7003687 0.59926264 0.29963132
[18,] 0.6988824 0.60223516 0.30111758
[19,] 0.7277702 0.54445968 0.27222984
[20,] 0.8312118 0.33757648 0.16878824
[21,] 0.9193542 0.16129158 0.08064579
[22,] 0.9253272 0.14934558 0.07467279
[23,] 0.9135178 0.17296442 0.08648221
[24,] 0.9021168 0.19576644 0.09788322
[25,] 0.8871773 0.22564543 0.11282271
[26,] 0.8790664 0.24186717 0.12093359
[27,] 0.8873038 0.22539242 0.11269621
[28,] 0.9027650 0.19447006 0.09723503
[29,] 0.9437400 0.11252006 0.05626003
[30,] 0.9761995 0.04760094 0.02380047
[31,] 0.9653735 0.06925292 0.03462646
[32,] 0.9623463 0.07530749 0.03765375
[33,] 0.9552874 0.08942513 0.04471256
[34,] 0.9410448 0.11791037 0.05895518
[35,] 0.9248266 0.15034687 0.07517344
[36,] 0.9048022 0.19039567 0.09519784
[37,] 0.8636880 0.27262408 0.13631204
[38,] 0.8180864 0.36382728 0.18191364
[39,] 0.7913683 0.41726350 0.20863175
[40,] 0.7807396 0.43852088 0.21926044
[41,] 0.8733242 0.25335158 0.12667579
[42,] 0.9404767 0.11904668 0.05952334
[43,] 0.9147117 0.17057656 0.08528828
[44,] 0.8917876 0.21642471 0.10821235
[45,] 0.8469916 0.30601671 0.15300836
[46,] 0.7716111 0.45677783 0.22838892
[47,] 0.6899234 0.62015314 0.31007657
[48,] 0.5841356 0.83172872 0.41586436
[49,] 0.4579816 0.91596313 0.54201844
[50,] 0.3283445 0.65668893 0.67165554
[51,] 0.2124515 0.42490298 0.78754851
> postscript(file="/var/www/html/rcomp/tmp/1j5wk1258647642.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/2pkig1258647642.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/3hw9a1258647642.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/45lhw1258647642.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/5hdg81258647642.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 8 9 10
35.275 23.275 13.275 9.275 4.275 1.275 -3.725 -8.725 -13.725 -12.725
11 12 13 14 15 16 17 18 19 20
23.275 31.275 31.275 21.275 11.275 6.275 -0.725 -2.725 -8.725 -11.725
21 22 23 24 25 26 27 28 29 30
-14.725 -13.725 18.275 24.275 23.275 8.275 -2.725 -9.725 -8.725 -14.725
31 32 33 34 35 36 37 38 39 40
-20.725 -23.725 -30.725 -32.725 -1.725 4.275 -1.725 -10.725 -19.725 -20.725
41 42 43 44 45 46 47 48 49 50
-2.100 -6.100 -12.100 -14.100 -23.100 -20.100 8.900 12.900 9.900 1.900
51 52 53 54 55 56 57 58 59 60
-2.100 -0.100 1.900 1.900 0.900 -0.100 -8.100 -4.100 23.900 29.900
> postscript(file="/var/www/html/rcomp/tmp/6dyla1258647642.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 35.275 NA
1 23.275 35.275
2 13.275 23.275
3 9.275 13.275
4 4.275 9.275
5 1.275 4.275
6 -3.725 1.275
7 -8.725 -3.725
8 -13.725 -8.725
9 -12.725 -13.725
10 23.275 -12.725
11 31.275 23.275
12 31.275 31.275
13 21.275 31.275
14 11.275 21.275
15 6.275 11.275
16 -0.725 6.275
17 -2.725 -0.725
18 -8.725 -2.725
19 -11.725 -8.725
20 -14.725 -11.725
21 -13.725 -14.725
22 18.275 -13.725
23 24.275 18.275
24 23.275 24.275
25 8.275 23.275
26 -2.725 8.275
27 -9.725 -2.725
28 -8.725 -9.725
29 -14.725 -8.725
30 -20.725 -14.725
31 -23.725 -20.725
32 -30.725 -23.725
33 -32.725 -30.725
34 -1.725 -32.725
35 4.275 -1.725
36 -1.725 4.275
37 -10.725 -1.725
38 -19.725 -10.725
39 -20.725 -19.725
40 -2.100 -20.725
41 -6.100 -2.100
42 -12.100 -6.100
43 -14.100 -12.100
44 -23.100 -14.100
45 -20.100 -23.100
46 8.900 -20.100
47 12.900 8.900
48 9.900 12.900
49 1.900 9.900
50 -2.100 1.900
51 -0.100 -2.100
52 1.900 -0.100
53 1.900 1.900
54 0.900 1.900
55 -0.100 0.900
56 -8.100 -0.100
57 -4.100 -8.100
58 23.900 -4.100
59 29.900 23.900
60 NA 29.900
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 23.275 35.275
[2,] 13.275 23.275
[3,] 9.275 13.275
[4,] 4.275 9.275
[5,] 1.275 4.275
[6,] -3.725 1.275
[7,] -8.725 -3.725
[8,] -13.725 -8.725
[9,] -12.725 -13.725
[10,] 23.275 -12.725
[11,] 31.275 23.275
[12,] 31.275 31.275
[13,] 21.275 31.275
[14,] 11.275 21.275
[15,] 6.275 11.275
[16,] -0.725 6.275
[17,] -2.725 -0.725
[18,] -8.725 -2.725
[19,] -11.725 -8.725
[20,] -14.725 -11.725
[21,] -13.725 -14.725
[22,] 18.275 -13.725
[23,] 24.275 18.275
[24,] 23.275 24.275
[25,] 8.275 23.275
[26,] -2.725 8.275
[27,] -9.725 -2.725
[28,] -8.725 -9.725
[29,] -14.725 -8.725
[30,] -20.725 -14.725
[31,] -23.725 -20.725
[32,] -30.725 -23.725
[33,] -32.725 -30.725
[34,] -1.725 -32.725
[35,] 4.275 -1.725
[36,] -1.725 4.275
[37,] -10.725 -1.725
[38,] -19.725 -10.725
[39,] -20.725 -19.725
[40,] -2.100 -20.725
[41,] -6.100 -2.100
[42,] -12.100 -6.100
[43,] -14.100 -12.100
[44,] -23.100 -14.100
[45,] -20.100 -23.100
[46,] 8.900 -20.100
[47,] 12.900 8.900
[48,] 9.900 12.900
[49,] 1.900 9.900
[50,] -2.100 1.900
[51,] -0.100 -2.100
[52,] 1.900 -0.100
[53,] 1.900 1.900
[54,] 0.900 1.900
[55,] -0.100 0.900
[56,] -8.100 -0.100
[57,] -4.100 -8.100
[58,] 23.900 -4.100
[59,] 29.900 23.900
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 23.275 35.275
2 13.275 23.275
3 9.275 13.275
4 4.275 9.275
5 1.275 4.275
6 -3.725 1.275
7 -8.725 -3.725
8 -13.725 -8.725
9 -12.725 -13.725
10 23.275 -12.725
11 31.275 23.275
12 31.275 31.275
13 21.275 31.275
14 11.275 21.275
15 6.275 11.275
16 -0.725 6.275
17 -2.725 -0.725
18 -8.725 -2.725
19 -11.725 -8.725
20 -14.725 -11.725
21 -13.725 -14.725
22 18.275 -13.725
23 24.275 18.275
24 23.275 24.275
25 8.275 23.275
26 -2.725 8.275
27 -9.725 -2.725
28 -8.725 -9.725
29 -14.725 -8.725
30 -20.725 -14.725
31 -23.725 -20.725
32 -30.725 -23.725
33 -32.725 -30.725
34 -1.725 -32.725
35 4.275 -1.725
36 -1.725 4.275
37 -10.725 -1.725
38 -19.725 -10.725
39 -20.725 -19.725
40 -2.100 -20.725
41 -6.100 -2.100
42 -12.100 -6.100
43 -14.100 -12.100
44 -23.100 -14.100
45 -20.100 -23.100
46 8.900 -20.100
47 12.900 8.900
48 9.900 12.900
49 1.900 9.900
50 -2.100 1.900
51 -0.100 -2.100
52 1.900 -0.100
53 1.900 1.900
54 0.900 1.900
55 -0.100 0.900
56 -8.100 -0.100
57 -4.100 -8.100
58 23.900 -4.100
59 29.900 23.900
> 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/7q7ui1258647642.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/8drar1258647642.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/9w7331258647642.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/103jmy1258647642.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/11xbsv1258647642.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/120iga1258647642.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/13efll1258647643.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/14w1xk1258647643.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/15tdzt1258647643.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/16pp3q1258647643.tab")
+ }
>
> system("convert tmp/1j5wk1258647642.ps tmp/1j5wk1258647642.png")
> system("convert tmp/2pkig1258647642.ps tmp/2pkig1258647642.png")
> system("convert tmp/3hw9a1258647642.ps tmp/3hw9a1258647642.png")
> system("convert tmp/45lhw1258647642.ps tmp/45lhw1258647642.png")
> system("convert tmp/5hdg81258647642.ps tmp/5hdg81258647642.png")
> system("convert tmp/6dyla1258647642.ps tmp/6dyla1258647642.png")
> system("convert tmp/7q7ui1258647642.ps tmp/7q7ui1258647642.png")
> system("convert tmp/8drar1258647642.ps tmp/8drar1258647642.png")
> system("convert tmp/9w7331258647642.ps tmp/9w7331258647642.png")
> system("convert tmp/103jmy1258647642.ps tmp/103jmy1258647642.png")
>
>
> proc.time()
user system elapsed
2.505 1.580 2.956