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(8.7,0,8.2,0,8.3,0,8.5,0,8.6,0,8.5,0,8.2,0,8.1,0,7.9,0,8.6,0,8.7,0,8.7,0,8.5,0,8.4,0,8.5,0,8.7,0,8.7,0,8.6,0,8.5,0,8.3,0,8,0,8.2,0,8.1,0,8.1,0,8,0,7.9,0,7.9,0,8,0,8,0,7.9,0,8,0,7.7,0,7.2,0,7.5,0,7.3,0,7,0,7,0,7,0,7.2,0,7.3,0,7.1,0,6.8,0,6.4,0,6.1,0,6.5,0,7.7,0,7.9,0,7.5,1,6.9,1,6.6,1,6.9,1,7.7,1,8,1,8,1,7.7,1,7.3,1,7.4,1,8.1,1,8.3,1,8.2,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 8.7 0
2 8.2 0
3 8.3 0
4 8.5 0
5 8.6 0
6 8.5 0
7 8.2 0
8 8.1 0
9 7.9 0
10 8.6 0
11 8.7 0
12 8.7 0
13 8.5 0
14 8.4 0
15 8.5 0
16 8.7 0
17 8.7 0
18 8.6 0
19 8.5 0
20 8.3 0
21 8.0 0
22 8.2 0
23 8.1 0
24 8.1 0
25 8.0 0
26 7.9 0
27 7.9 0
28 8.0 0
29 8.0 0
30 7.9 0
31 8.0 0
32 7.7 0
33 7.2 0
34 7.5 0
35 7.3 0
36 7.0 0
37 7.0 0
38 7.0 0
39 7.2 0
40 7.3 0
41 7.1 0
42 6.8 0
43 6.4 0
44 6.1 0
45 6.5 0
46 7.7 0
47 7.9 0
48 7.5 1
49 6.9 1
50 6.6 1
51 6.9 1
52 7.7 1
53 8.0 1
54 8.0 1
55 7.7 1
56 7.3 1
57 7.4 1
58 8.1 1
59 8.3 1
60 8.2 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
7.894 -0.309
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.7936 -0.4436 0.1064 0.5381 0.8064
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.8936 0.0952 82.918 <2e-16 ***
X -0.3090 0.2045 -1.511 0.136
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.6526 on 58 degrees of freedom
Multiple R-squared: 0.03787, Adjusted R-squared: 0.02128
F-statistic: 2.283 on 1 and 58 DF, p-value: 0.1363
> 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.0604069772 0.1208139544 0.93959302
[2,] 0.0184153622 0.0368307244 0.98158464
[3,] 0.0099469439 0.0198938877 0.99005306
[4,] 0.0071465899 0.0142931798 0.99285341
[5,] 0.0101985166 0.0203970332 0.98980148
[6,] 0.0060714378 0.0121428756 0.99392856
[7,] 0.0048307993 0.0096615986 0.99516920
[8,] 0.0036475081 0.0072950162 0.99635249
[9,] 0.0017219657 0.0034439314 0.99827803
[10,] 0.0007535405 0.0015070809 0.99924646
[11,] 0.0003566255 0.0007132510 0.99964337
[12,] 0.0003086425 0.0006172850 0.99969136
[13,] 0.0002794825 0.0005589650 0.99972052
[14,] 0.0001955440 0.0003910880 0.99980446
[15,] 0.0001216862 0.0002433723 0.99987831
[16,] 0.0000817370 0.0001634740 0.99991826
[17,] 0.0001481285 0.0002962570 0.99985187
[18,] 0.0001223123 0.0002446246 0.99987769
[19,] 0.0001301177 0.0002602355 0.99986988
[20,] 0.0001381372 0.0002762744 0.99986186
[21,] 0.0001901137 0.0003802274 0.99980989
[22,] 0.0003308913 0.0006617826 0.99966911
[23,] 0.0005120680 0.0010241361 0.99948793
[24,] 0.0006340084 0.0012680167 0.99936599
[25,] 0.0008329080 0.0016658160 0.99916709
[26,] 0.0012995061 0.0025990122 0.99870049
[27,] 0.0020451749 0.0040903499 0.99795483
[28,] 0.0045642988 0.0091285977 0.99543570
[29,] 0.0261144496 0.0522288991 0.97388555
[30,] 0.0427094965 0.0854189930 0.95729050
[31,] 0.0750283967 0.1500567934 0.92497160
[32,] 0.1519059458 0.3038118916 0.84809405
[33,] 0.2236489118 0.4472978236 0.77635109
[34,] 0.2785877845 0.5571755691 0.72141222
[35,] 0.2875194215 0.5750388430 0.71248058
[36,] 0.2838831369 0.5677662738 0.71611686
[37,] 0.2870429971 0.5740859942 0.71295700
[38,] 0.3191518845 0.6383037689 0.68084812
[39,] 0.4468967551 0.8937935102 0.55310324
[40,] 0.7247661475 0.5504677050 0.27523385
[41,] 0.8711497351 0.2577005298 0.12885026
[42,] 0.8163858510 0.3672282981 0.18361415
[43,] 0.7424634625 0.5150730749 0.25753654
[44,] 0.6545405904 0.6909188191 0.34545941
[45,] 0.6694483299 0.6611033403 0.33055167
[46,] 0.8488066684 0.3023866632 0.15119333
[47,] 0.9420174938 0.1159650125 0.05798251
[48,] 0.8995440898 0.2009118204 0.10045591
[49,] 0.8311141256 0.3377717488 0.16888587
[50,] 0.7257422666 0.5485154668 0.27425773
[51,] 0.5685782722 0.8628434555 0.43142173
> postscript(file="/var/www/html/rcomp/tmp/1lrxe1261669092.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/2xrdv1261669092.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/3u0vr1261669092.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/473rx1261669092.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/5q4qu1261669092.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
0.806382979 0.306382979 0.406382979 0.606382979 0.706382979 0.606382979
7 8 9 10 11 12
0.306382979 0.206382979 0.006382979 0.706382979 0.806382979 0.806382979
13 14 15 16 17 18
0.606382979 0.506382979 0.606382979 0.806382979 0.806382979 0.706382979
19 20 21 22 23 24
0.606382979 0.406382979 0.106382979 0.306382979 0.206382979 0.206382979
25 26 27 28 29 30
0.106382979 0.006382979 0.006382979 0.106382979 0.106382979 0.006382979
31 32 33 34 35 36
0.106382979 -0.193617021 -0.693617021 -0.393617021 -0.593617021 -0.893617021
37 38 39 40 41 42
-0.893617021 -0.893617021 -0.693617021 -0.593617021 -0.793617021 -1.093617021
43 44 45 46 47 48
-1.493617021 -1.793617021 -1.393617021 -0.193617021 0.006382979 -0.084615385
49 50 51 52 53 54
-0.684615385 -0.984615385 -0.684615385 0.115384615 0.415384615 0.415384615
55 56 57 58 59 60
0.115384615 -0.284615385 -0.184615385 0.515384615 0.715384615 0.615384615
> postscript(file="/var/www/html/rcomp/tmp/694ve1261669092.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 0.806382979 NA
1 0.306382979 0.806382979
2 0.406382979 0.306382979
3 0.606382979 0.406382979
4 0.706382979 0.606382979
5 0.606382979 0.706382979
6 0.306382979 0.606382979
7 0.206382979 0.306382979
8 0.006382979 0.206382979
9 0.706382979 0.006382979
10 0.806382979 0.706382979
11 0.806382979 0.806382979
12 0.606382979 0.806382979
13 0.506382979 0.606382979
14 0.606382979 0.506382979
15 0.806382979 0.606382979
16 0.806382979 0.806382979
17 0.706382979 0.806382979
18 0.606382979 0.706382979
19 0.406382979 0.606382979
20 0.106382979 0.406382979
21 0.306382979 0.106382979
22 0.206382979 0.306382979
23 0.206382979 0.206382979
24 0.106382979 0.206382979
25 0.006382979 0.106382979
26 0.006382979 0.006382979
27 0.106382979 0.006382979
28 0.106382979 0.106382979
29 0.006382979 0.106382979
30 0.106382979 0.006382979
31 -0.193617021 0.106382979
32 -0.693617021 -0.193617021
33 -0.393617021 -0.693617021
34 -0.593617021 -0.393617021
35 -0.893617021 -0.593617021
36 -0.893617021 -0.893617021
37 -0.893617021 -0.893617021
38 -0.693617021 -0.893617021
39 -0.593617021 -0.693617021
40 -0.793617021 -0.593617021
41 -1.093617021 -0.793617021
42 -1.493617021 -1.093617021
43 -1.793617021 -1.493617021
44 -1.393617021 -1.793617021
45 -0.193617021 -1.393617021
46 0.006382979 -0.193617021
47 -0.084615385 0.006382979
48 -0.684615385 -0.084615385
49 -0.984615385 -0.684615385
50 -0.684615385 -0.984615385
51 0.115384615 -0.684615385
52 0.415384615 0.115384615
53 0.415384615 0.415384615
54 0.115384615 0.415384615
55 -0.284615385 0.115384615
56 -0.184615385 -0.284615385
57 0.515384615 -0.184615385
58 0.715384615 0.515384615
59 0.615384615 0.715384615
60 NA 0.615384615
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.306382979 0.806382979
[2,] 0.406382979 0.306382979
[3,] 0.606382979 0.406382979
[4,] 0.706382979 0.606382979
[5,] 0.606382979 0.706382979
[6,] 0.306382979 0.606382979
[7,] 0.206382979 0.306382979
[8,] 0.006382979 0.206382979
[9,] 0.706382979 0.006382979
[10,] 0.806382979 0.706382979
[11,] 0.806382979 0.806382979
[12,] 0.606382979 0.806382979
[13,] 0.506382979 0.606382979
[14,] 0.606382979 0.506382979
[15,] 0.806382979 0.606382979
[16,] 0.806382979 0.806382979
[17,] 0.706382979 0.806382979
[18,] 0.606382979 0.706382979
[19,] 0.406382979 0.606382979
[20,] 0.106382979 0.406382979
[21,] 0.306382979 0.106382979
[22,] 0.206382979 0.306382979
[23,] 0.206382979 0.206382979
[24,] 0.106382979 0.206382979
[25,] 0.006382979 0.106382979
[26,] 0.006382979 0.006382979
[27,] 0.106382979 0.006382979
[28,] 0.106382979 0.106382979
[29,] 0.006382979 0.106382979
[30,] 0.106382979 0.006382979
[31,] -0.193617021 0.106382979
[32,] -0.693617021 -0.193617021
[33,] -0.393617021 -0.693617021
[34,] -0.593617021 -0.393617021
[35,] -0.893617021 -0.593617021
[36,] -0.893617021 -0.893617021
[37,] -0.893617021 -0.893617021
[38,] -0.693617021 -0.893617021
[39,] -0.593617021 -0.693617021
[40,] -0.793617021 -0.593617021
[41,] -1.093617021 -0.793617021
[42,] -1.493617021 -1.093617021
[43,] -1.793617021 -1.493617021
[44,] -1.393617021 -1.793617021
[45,] -0.193617021 -1.393617021
[46,] 0.006382979 -0.193617021
[47,] -0.084615385 0.006382979
[48,] -0.684615385 -0.084615385
[49,] -0.984615385 -0.684615385
[50,] -0.684615385 -0.984615385
[51,] 0.115384615 -0.684615385
[52,] 0.415384615 0.115384615
[53,] 0.415384615 0.415384615
[54,] 0.115384615 0.415384615
[55,] -0.284615385 0.115384615
[56,] -0.184615385 -0.284615385
[57,] 0.515384615 -0.184615385
[58,] 0.715384615 0.515384615
[59,] 0.615384615 0.715384615
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.306382979 0.806382979
2 0.406382979 0.306382979
3 0.606382979 0.406382979
4 0.706382979 0.606382979
5 0.606382979 0.706382979
6 0.306382979 0.606382979
7 0.206382979 0.306382979
8 0.006382979 0.206382979
9 0.706382979 0.006382979
10 0.806382979 0.706382979
11 0.806382979 0.806382979
12 0.606382979 0.806382979
13 0.506382979 0.606382979
14 0.606382979 0.506382979
15 0.806382979 0.606382979
16 0.806382979 0.806382979
17 0.706382979 0.806382979
18 0.606382979 0.706382979
19 0.406382979 0.606382979
20 0.106382979 0.406382979
21 0.306382979 0.106382979
22 0.206382979 0.306382979
23 0.206382979 0.206382979
24 0.106382979 0.206382979
25 0.006382979 0.106382979
26 0.006382979 0.006382979
27 0.106382979 0.006382979
28 0.106382979 0.106382979
29 0.006382979 0.106382979
30 0.106382979 0.006382979
31 -0.193617021 0.106382979
32 -0.693617021 -0.193617021
33 -0.393617021 -0.693617021
34 -0.593617021 -0.393617021
35 -0.893617021 -0.593617021
36 -0.893617021 -0.893617021
37 -0.893617021 -0.893617021
38 -0.693617021 -0.893617021
39 -0.593617021 -0.693617021
40 -0.793617021 -0.593617021
41 -1.093617021 -0.793617021
42 -1.493617021 -1.093617021
43 -1.793617021 -1.493617021
44 -1.393617021 -1.793617021
45 -0.193617021 -1.393617021
46 0.006382979 -0.193617021
47 -0.084615385 0.006382979
48 -0.684615385 -0.084615385
49 -0.984615385 -0.684615385
50 -0.684615385 -0.984615385
51 0.115384615 -0.684615385
52 0.415384615 0.115384615
53 0.415384615 0.415384615
54 0.115384615 0.415384615
55 -0.284615385 0.115384615
56 -0.184615385 -0.284615385
57 0.515384615 -0.184615385
58 0.715384615 0.515384615
59 0.615384615 0.715384615
> 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/7p2zb1261669092.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/87qk61261669092.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/9m0g41261669092.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/10z44f1261669092.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/11ekkf1261669092.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/126hgu1261669092.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/13obhv1261669092.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/147gja1261669092.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/15hugv1261669092.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/16cqbf1261669092.tab")
+ }
>
> try(system("convert tmp/1lrxe1261669092.ps tmp/1lrxe1261669092.png",intern=TRUE))
character(0)
> try(system("convert tmp/2xrdv1261669092.ps tmp/2xrdv1261669092.png",intern=TRUE))
character(0)
> try(system("convert tmp/3u0vr1261669092.ps tmp/3u0vr1261669092.png",intern=TRUE))
character(0)
> try(system("convert tmp/473rx1261669092.ps tmp/473rx1261669092.png",intern=TRUE))
character(0)
> try(system("convert tmp/5q4qu1261669092.ps tmp/5q4qu1261669092.png",intern=TRUE))
character(0)
> try(system("convert tmp/694ve1261669092.ps tmp/694ve1261669092.png",intern=TRUE))
character(0)
> try(system("convert tmp/7p2zb1261669092.ps tmp/7p2zb1261669092.png",intern=TRUE))
character(0)
> try(system("convert tmp/87qk61261669092.ps tmp/87qk61261669092.png",intern=TRUE))
character(0)
> try(system("convert tmp/9m0g41261669092.ps tmp/9m0g41261669092.png",intern=TRUE))
character(0)
> try(system("convert tmp/10z44f1261669092.ps tmp/10z44f1261669092.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.384 1.509 3.799