R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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.
Natural language support but running in an English locale
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(0.301029995663981
+ ,1.623249290397900
+ ,3
+ ,0.255272505103306
+ ,2.795184589682420
+ ,4
+ ,-0.154901959985743
+ ,2.255272505103310
+ ,4
+ ,0.591064607026499
+ ,1.544068044350280
+ ,1
+ ,0.000000000000000
+ ,2.593286067020460
+ ,4
+ ,0.556302500767287
+ ,1.799340549453580
+ ,1
+ ,0.146128035678238
+ ,2.361727836017590
+ ,1
+ ,0.176091259055681
+ ,2.049218022670180
+ ,4
+ ,-0.154901959985743
+ ,2.448706319905080
+ ,5
+ ,0.322219294733919
+ ,1.623249290397900
+ ,1
+ ,0.612783856719735
+ ,1.623249290397900
+ ,2
+ ,0.079181246047625
+ ,2.079181246047620
+ ,2
+ ,-0.301029995663981
+ ,2.170261715394960
+ ,5
+ ,0.531478917042255
+ ,1.204119982655920
+ ,2
+ ,0.176091259055681
+ ,2.491361693834270
+ ,1
+ ,0.531478917042255
+ ,1.447158031342220
+ ,3
+ ,-0.096910013008056
+ ,1.832508912706240
+ ,4
+ ,-0.096910013008056
+ ,2.526339277389840
+ ,5
+ ,0.301029995663981
+ ,1.698970004336020
+ ,1
+ ,0.278753600952829
+ ,2.426511261364580
+ ,1
+ ,0.113943352306837
+ ,1.278753600952830
+ ,3
+ ,0.748188027006200
+ ,1.079181246047620
+ ,1
+ ,0.491361693834273
+ ,2.079181246047620
+ ,1
+ ,0.255272505103306
+ ,2.146128035678240
+ ,2
+ ,-0.045757490560675
+ ,2.230448921378270
+ ,4
+ ,0.255272505103306
+ ,1.230448921378270
+ ,2
+ ,0.278753600952829
+ ,2.060697840353610
+ ,4
+ ,-0.045757490560675
+ ,1.491361693834270
+ ,5
+ ,0.414973347970818
+ ,1.322219294733920
+ ,3
+ ,0.380211241711606
+ ,1.716003343634800
+ ,1
+ ,0.079181246047625
+ ,2.214843848047700
+ ,2
+ ,-0.045757490560675
+ ,2.352182518111360
+ ,2
+ ,-0.301029995663981
+ ,2.352182518111360
+ ,3
+ ,-0.221848749616356
+ ,2.178976947293170
+ ,5
+ ,0.361727836017593
+ ,1.778151250383640
+ ,2
+ ,-0.301029995663981
+ ,2.301029995663980
+ ,3
+ ,0.414973347970818
+ ,1.662757831681570
+ ,2
+ ,-0.221848749616356
+ ,2.322219294733920
+ ,4
+ ,0.819543935541869
+ ,1.146128035678240
+ ,1)
+ ,dim=c(3
+ ,39)
+ ,dimnames=list(c('logPS'
+ ,'logGT'
+ ,'D')
+ ,1:39))
> y <- array(NA,dim=c(3,39),dimnames=list(c('logPS','logGT','D'),1:39))
> 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
logPS logGT D
1 0.30103000 1.623249 3
2 0.25527251 2.795185 4
3 -0.15490196 2.255273 4
4 0.59106461 1.544068 1
5 0.00000000 2.593286 4
6 0.55630250 1.799341 1
7 0.14612804 2.361728 1
8 0.17609126 2.049218 4
9 -0.15490196 2.448706 5
10 0.32221929 1.623249 1
11 0.61278386 1.623249 2
12 0.07918125 2.079181 2
13 -0.30103000 2.170262 5
14 0.53147892 1.204120 2
15 0.17609126 2.491362 1
16 0.53147892 1.447158 3
17 -0.09691001 1.832509 4
18 -0.09691001 2.526339 5
19 0.30103000 1.698970 1
20 0.27875360 2.426511 1
21 0.11394335 1.278754 3
22 0.74818803 1.079181 1
23 0.49136169 2.079181 1
24 0.25527251 2.146128 2
25 -0.04575749 2.230449 4
26 0.25527251 1.230449 2
27 0.27875360 2.060698 4
28 -0.04575749 1.491362 5
29 0.41497335 1.322219 3
30 0.38021124 1.716003 1
31 0.07918125 2.214844 2
32 -0.04575749 2.352183 2
33 -0.30103000 2.352183 3
34 -0.22184875 2.178977 5
35 0.36172784 1.778151 2
36 -0.30103000 2.301030 3
37 0.41497335 1.662758 2
38 -0.22184875 2.322219 4
39 0.81954394 1.146128 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) logGT D
1.0745 -0.3035 -0.1105
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.34555 -0.14523 0.04349 0.12512 0.47125
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.07451 0.12875 8.346 6.16e-10 ***
logGT -0.30354 0.06890 -4.405 9.09e-05 ***
D -0.11051 0.02219 -4.980 1.60e-05 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.1818 on 36 degrees of freedom
Multiple R-squared: 0.6546, Adjusted R-squared: 0.6354
F-statistic: 34.12 on 2 and 36 DF, p-value: 4.888e-09
> 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.5979290 0.80414206 0.40207103
[2,] 0.8058150 0.38837004 0.19418502
[3,] 0.7209818 0.55803636 0.27901818
[4,] 0.6497648 0.70047041 0.35023521
[5,] 0.6130048 0.77399039 0.38699519
[6,] 0.6901072 0.61978562 0.30989281
[7,] 0.6911997 0.61760069 0.30880034
[8,] 0.7378984 0.52420315 0.26210158
[9,] 0.6517731 0.69645381 0.34822690
[10,] 0.5666430 0.86671405 0.43335703
[11,] 0.5946891 0.81062186 0.40531093
[12,] 0.6108801 0.77823971 0.38911985
[13,] 0.6134411 0.77311783 0.38655892
[14,] 0.5892054 0.82158927 0.41079464
[15,] 0.5034278 0.99314435 0.49657218
[16,] 0.5914000 0.81719994 0.40859997
[17,] 0.5262809 0.94743822 0.47371911
[18,] 0.5343516 0.93129677 0.46564839
[19,] 0.4829137 0.96582748 0.51708626
[20,] 0.4143011 0.82860226 0.58569887
[21,] 0.6028548 0.79429032 0.39714516
[22,] 0.9605582 0.07888351 0.03944176
[23,] 0.9705527 0.05889463 0.02944732
[24,] 0.9617218 0.07655637 0.03827818
[25,] 0.9327455 0.13450903 0.06725451
[26,] 0.9136053 0.17278945 0.08639473
[27,] 0.9363536 0.12729272 0.06364636
[28,] 0.8803570 0.23928601 0.11964301
> postscript(file="/var/www/html/freestat/rcomp/tmp/1wq461292269223.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/2wq461292269223.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/3ozm91292269223.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/4ozm91292269223.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/5ozm91292269223.ps",horizontal=F,onefile=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 = 39
Frequency = 1
1 2 3 4 5 6
0.05077341 0.47125433 -0.10280444 0.09575243 0.15469778 0.13847545
7 8 9 10 11 12
-0.10099261 0.16564324 0.06642074 -0.14905829 0.25201677 -0.14319277
13 14 15 16 17 18
-0.16422605 0.04348979 -0.03168047 0.22777179 -0.17313767 0.14797731
19 20 21 22 23 24
-0.14726341 0.05129724 -0.24088107 0.11176464 0.15847718 0.05321944
25 26 27 28 29 30
-0.00119489 -0.22472476 0.27179015 -0.11502609 0.07334246 -0.06291189
31 32 33 34 35 36
-0.10201390 -0.18526501 -0.33002702 -0.08239939 0.04797951 -0.34555380
37 38 39
0.06619864 -0.14943027 0.20344150
> postscript(file="/var/www/html/freestat/rcomp/tmp/6hrlu1292269223.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 39
Frequency = 1
lag(myerror, k = 1) myerror
0 0.05077341 NA
1 0.47125433 0.05077341
2 -0.10280444 0.47125433
3 0.09575243 -0.10280444
4 0.15469778 0.09575243
5 0.13847545 0.15469778
6 -0.10099261 0.13847545
7 0.16564324 -0.10099261
8 0.06642074 0.16564324
9 -0.14905829 0.06642074
10 0.25201677 -0.14905829
11 -0.14319277 0.25201677
12 -0.16422605 -0.14319277
13 0.04348979 -0.16422605
14 -0.03168047 0.04348979
15 0.22777179 -0.03168047
16 -0.17313767 0.22777179
17 0.14797731 -0.17313767
18 -0.14726341 0.14797731
19 0.05129724 -0.14726341
20 -0.24088107 0.05129724
21 0.11176464 -0.24088107
22 0.15847718 0.11176464
23 0.05321944 0.15847718
24 -0.00119489 0.05321944
25 -0.22472476 -0.00119489
26 0.27179015 -0.22472476
27 -0.11502609 0.27179015
28 0.07334246 -0.11502609
29 -0.06291189 0.07334246
30 -0.10201390 -0.06291189
31 -0.18526501 -0.10201390
32 -0.33002702 -0.18526501
33 -0.08239939 -0.33002702
34 0.04797951 -0.08239939
35 -0.34555380 0.04797951
36 0.06619864 -0.34555380
37 -0.14943027 0.06619864
38 0.20344150 -0.14943027
39 NA 0.20344150
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.47125433 0.05077341
[2,] -0.10280444 0.47125433
[3,] 0.09575243 -0.10280444
[4,] 0.15469778 0.09575243
[5,] 0.13847545 0.15469778
[6,] -0.10099261 0.13847545
[7,] 0.16564324 -0.10099261
[8,] 0.06642074 0.16564324
[9,] -0.14905829 0.06642074
[10,] 0.25201677 -0.14905829
[11,] -0.14319277 0.25201677
[12,] -0.16422605 -0.14319277
[13,] 0.04348979 -0.16422605
[14,] -0.03168047 0.04348979
[15,] 0.22777179 -0.03168047
[16,] -0.17313767 0.22777179
[17,] 0.14797731 -0.17313767
[18,] -0.14726341 0.14797731
[19,] 0.05129724 -0.14726341
[20,] -0.24088107 0.05129724
[21,] 0.11176464 -0.24088107
[22,] 0.15847718 0.11176464
[23,] 0.05321944 0.15847718
[24,] -0.00119489 0.05321944
[25,] -0.22472476 -0.00119489
[26,] 0.27179015 -0.22472476
[27,] -0.11502609 0.27179015
[28,] 0.07334246 -0.11502609
[29,] -0.06291189 0.07334246
[30,] -0.10201390 -0.06291189
[31,] -0.18526501 -0.10201390
[32,] -0.33002702 -0.18526501
[33,] -0.08239939 -0.33002702
[34,] 0.04797951 -0.08239939
[35,] -0.34555380 0.04797951
[36,] 0.06619864 -0.34555380
[37,] -0.14943027 0.06619864
[38,] 0.20344150 -0.14943027
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.47125433 0.05077341
2 -0.10280444 0.47125433
3 0.09575243 -0.10280444
4 0.15469778 0.09575243
5 0.13847545 0.15469778
6 -0.10099261 0.13847545
7 0.16564324 -0.10099261
8 0.06642074 0.16564324
9 -0.14905829 0.06642074
10 0.25201677 -0.14905829
11 -0.14319277 0.25201677
12 -0.16422605 -0.14319277
13 0.04348979 -0.16422605
14 -0.03168047 0.04348979
15 0.22777179 -0.03168047
16 -0.17313767 0.22777179
17 0.14797731 -0.17313767
18 -0.14726341 0.14797731
19 0.05129724 -0.14726341
20 -0.24088107 0.05129724
21 0.11176464 -0.24088107
22 0.15847718 0.11176464
23 0.05321944 0.15847718
24 -0.00119489 0.05321944
25 -0.22472476 -0.00119489
26 0.27179015 -0.22472476
27 -0.11502609 0.27179015
28 0.07334246 -0.11502609
29 -0.06291189 0.07334246
30 -0.10201390 -0.06291189
31 -0.18526501 -0.10201390
32 -0.33002702 -0.18526501
33 -0.08239939 -0.33002702
34 0.04797951 -0.08239939
35 -0.34555380 0.04797951
36 0.06619864 -0.34555380
37 -0.14943027 0.06619864
38 0.20344150 -0.14943027
> 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/freestat/rcomp/tmp/7a02x1292269223.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/8a02x1292269223.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/9a02x1292269223.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/10k9ji1292269223.ps",horizontal=F,onefile=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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11oa061292269223.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/freestat/rcomp/tmp/129sgc1292269223.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/freestat/rcomp/tmp/13ytdn1292269223.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/freestat/rcomp/tmp/14rkv81292269223.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/freestat/rcomp/tmp/15ulte1292269223.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/freestat/rcomp/tmp/168drn1292269223.tab")
+ }
>
> try(system("convert tmp/1wq461292269223.ps tmp/1wq461292269223.png",intern=TRUE))
character(0)
> try(system("convert tmp/2wq461292269223.ps tmp/2wq461292269223.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ozm91292269223.ps tmp/3ozm91292269223.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ozm91292269223.ps tmp/4ozm91292269223.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ozm91292269223.ps tmp/5ozm91292269223.png",intern=TRUE))
character(0)
> try(system("convert tmp/6hrlu1292269223.ps tmp/6hrlu1292269223.png",intern=TRUE))
character(0)
> try(system("convert tmp/7a02x1292269223.ps tmp/7a02x1292269223.png",intern=TRUE))
character(0)
> try(system("convert tmp/8a02x1292269223.ps tmp/8a02x1292269223.png",intern=TRUE))
character(0)
> try(system("convert tmp/9a02x1292269223.ps tmp/9a02x1292269223.png",intern=TRUE))
character(0)
> try(system("convert tmp/10k9ji1292269223.ps tmp/10k9ji1292269223.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.566 2.404 3.934