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(111.4,0,87.4,0,96.8,0,114.1,0,110.3,0,103.9,0,101.6,0,94.6,0,95.9,0,104.7,0,102.8,0,98.1,0,113.9,0,80.9,0,95.7,0,113.2,0,105.9,0,108.8,0,102.3,0,99,0,100.7,0,115.5,0,100.7,0,109.9,0,114.6,0,85.4,0,100.5,0,114.8,0,116.5,0,112.9,0,102,0,106,0,105.3,0,118.8,0,106.1,0,109.3,0,117.2,0,92.5,0,104.2,0,112.5,0,122.4,0,113.3,0,100,0,110.7,0,112.8,0,109.8,0,117.3,0,109.1,0,115.9,0,96,0,99.8,0,116.8,1,115.7,1,99.4,1,94.3,1,91,1,93.2,1,103.1,1,94.1,1,91.8,1,102.7,1),dim=c(2,61),dimnames=list(c('Y','X'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Y','X'),1:61))
> 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 111.4 0
2 87.4 0
3 96.8 0
4 114.1 0
5 110.3 0
6 103.9 0
7 101.6 0
8 94.6 0
9 95.9 0
10 104.7 0
11 102.8 0
12 98.1 0
13 113.9 0
14 80.9 0
15 95.7 0
16 113.2 0
17 105.9 0
18 108.8 0
19 102.3 0
20 99.0 0
21 100.7 0
22 115.5 0
23 100.7 0
24 109.9 0
25 114.6 0
26 85.4 0
27 100.5 0
28 114.8 0
29 116.5 0
30 112.9 0
31 102.0 0
32 106.0 0
33 105.3 0
34 118.8 0
35 106.1 0
36 109.3 0
37 117.2 0
38 92.5 0
39 104.2 0
40 112.5 0
41 122.4 0
42 113.3 0
43 100.0 0
44 110.7 0
45 112.8 0
46 109.8 0
47 117.3 0
48 109.1 0
49 115.9 0
50 96.0 0
51 99.8 0
52 116.8 1
53 115.7 1
54 99.4 1
55 94.3 1
56 91.0 1
57 93.2 1
58 103.1 1
59 94.1 1
60 91.8 1
61 102.7 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
105.761 -5.551
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-24.8608 -5.9608 0.1392 7.1392 16.6392
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 105.761 1.274 83.014 <2e-16 ***
X -5.551 3.147 -1.764 0.0829 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 9.098 on 59 degrees of freedom
Multiple R-squared: 0.0501, Adjusted R-squared: 0.034
F-statistic: 3.112 on 1 and 59 DF, p-value: 0.0829
> 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.8979859 0.2040282 0.10201408
[2,] 0.8120322 0.3759356 0.18796778
[3,] 0.7104696 0.5790609 0.28953043
[4,] 0.6883084 0.6233832 0.31169159
[5,] 0.6351450 0.7297100 0.36485499
[6,] 0.5327743 0.9344513 0.46722566
[7,] 0.4267872 0.8535744 0.57321282
[8,] 0.3553548 0.7107097 0.64464515
[9,] 0.4063748 0.8127496 0.59362521
[10,] 0.8146791 0.3706418 0.18532091
[11,] 0.7959057 0.4081887 0.20409433
[12,] 0.8122106 0.3755787 0.18778937
[13,] 0.7592832 0.4814337 0.24071683
[14,] 0.7158944 0.5682112 0.28410558
[15,] 0.6505611 0.6988778 0.34943892
[16,] 0.6045080 0.7909840 0.39549199
[17,] 0.5453817 0.9092365 0.45461825
[18,] 0.5944058 0.8111885 0.40559424
[19,] 0.5392265 0.9215470 0.46077348
[20,] 0.4933204 0.9866407 0.50667964
[21,] 0.5075920 0.9848160 0.49240798
[22,] 0.7888810 0.4222379 0.21111896
[23,] 0.7608865 0.4782269 0.23911345
[24,] 0.7668347 0.4663305 0.23316526
[25,] 0.7896878 0.4206244 0.21031221
[26,] 0.7667379 0.4665242 0.23326208
[27,] 0.7262534 0.5474932 0.27374662
[28,] 0.6658151 0.6683698 0.33418490
[29,] 0.6026582 0.7946835 0.39734177
[30,] 0.6595659 0.6808682 0.34043409
[31,] 0.5917897 0.8164207 0.40821034
[32,] 0.5243412 0.9513176 0.47565881
[33,] 0.5443761 0.9112477 0.45562387
[34,] 0.6747178 0.6505644 0.32528220
[35,] 0.6195896 0.7608209 0.38041044
[36,] 0.5649430 0.8701141 0.43505703
[37,] 0.6885106 0.6229789 0.31148943
[38,] 0.6458581 0.7082837 0.35414185
[39,] 0.6230568 0.7538864 0.37694320
[40,] 0.5488728 0.9022544 0.45112721
[41,] 0.4900398 0.9800796 0.50996021
[42,] 0.4086889 0.8173777 0.59131115
[43,] 0.4404878 0.8809756 0.55951219
[44,] 0.3670417 0.7340834 0.63295829
[45,] 0.4802907 0.9605813 0.51970933
[46,] 0.4046727 0.8093454 0.59532732
[47,] 0.3113509 0.6227018 0.68864909
[48,] 0.5299336 0.9401327 0.47006635
[49,] 0.9119236 0.1761528 0.08807638
[50,] 0.8668365 0.2663269 0.13316346
[51,] 0.7768454 0.4463091 0.22315456
[52,] 0.7100314 0.5799372 0.28996859
> postscript(file="/var/www/html/rcomp/tmp/1z3cq1258733837.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/2mwpu1258733837.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/3tsxb1258733837.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/49u2r1258733837.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/5wvff1258733837.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 = 61
Frequency = 1
1 2 3 4 5 6
5.6392157 -18.3607843 -8.9607843 8.3392157 4.5392157 -1.8607843
7 8 9 10 11 12
-4.1607843 -11.1607843 -9.8607843 -1.0607843 -2.9607843 -7.6607843
13 14 15 16 17 18
8.1392157 -24.8607843 -10.0607843 7.4392157 0.1392157 3.0392157
19 20 21 22 23 24
-3.4607843 -6.7607843 -5.0607843 9.7392157 -5.0607843 4.1392157
25 26 27 28 29 30
8.8392157 -20.3607843 -5.2607843 9.0392157 10.7392157 7.1392157
31 32 33 34 35 36
-3.7607843 0.2392157 -0.4607843 13.0392157 0.3392157 3.5392157
37 38 39 40 41 42
11.4392157 -13.2607843 -1.5607843 6.7392157 16.6392157 7.5392157
43 44 45 46 47 48
-5.7607843 4.9392157 7.0392157 4.0392157 11.5392157 3.3392157
49 50 51 52 53 54
10.1392157 -9.7607843 -5.9607843 16.5900000 15.4900000 -0.8100000
55 56 57 58 59 60
-5.9100000 -9.2100000 -7.0100000 2.8900000 -6.1100000 -8.4100000
61
2.4900000
> postscript(file="/var/www/html/rcomp/tmp/6ewig1258733837.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 = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 5.6392157 NA
1 -18.3607843 5.6392157
2 -8.9607843 -18.3607843
3 8.3392157 -8.9607843
4 4.5392157 8.3392157
5 -1.8607843 4.5392157
6 -4.1607843 -1.8607843
7 -11.1607843 -4.1607843
8 -9.8607843 -11.1607843
9 -1.0607843 -9.8607843
10 -2.9607843 -1.0607843
11 -7.6607843 -2.9607843
12 8.1392157 -7.6607843
13 -24.8607843 8.1392157
14 -10.0607843 -24.8607843
15 7.4392157 -10.0607843
16 0.1392157 7.4392157
17 3.0392157 0.1392157
18 -3.4607843 3.0392157
19 -6.7607843 -3.4607843
20 -5.0607843 -6.7607843
21 9.7392157 -5.0607843
22 -5.0607843 9.7392157
23 4.1392157 -5.0607843
24 8.8392157 4.1392157
25 -20.3607843 8.8392157
26 -5.2607843 -20.3607843
27 9.0392157 -5.2607843
28 10.7392157 9.0392157
29 7.1392157 10.7392157
30 -3.7607843 7.1392157
31 0.2392157 -3.7607843
32 -0.4607843 0.2392157
33 13.0392157 -0.4607843
34 0.3392157 13.0392157
35 3.5392157 0.3392157
36 11.4392157 3.5392157
37 -13.2607843 11.4392157
38 -1.5607843 -13.2607843
39 6.7392157 -1.5607843
40 16.6392157 6.7392157
41 7.5392157 16.6392157
42 -5.7607843 7.5392157
43 4.9392157 -5.7607843
44 7.0392157 4.9392157
45 4.0392157 7.0392157
46 11.5392157 4.0392157
47 3.3392157 11.5392157
48 10.1392157 3.3392157
49 -9.7607843 10.1392157
50 -5.9607843 -9.7607843
51 16.5900000 -5.9607843
52 15.4900000 16.5900000
53 -0.8100000 15.4900000
54 -5.9100000 -0.8100000
55 -9.2100000 -5.9100000
56 -7.0100000 -9.2100000
57 2.8900000 -7.0100000
58 -6.1100000 2.8900000
59 -8.4100000 -6.1100000
60 2.4900000 -8.4100000
61 NA 2.4900000
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -18.3607843 5.6392157
[2,] -8.9607843 -18.3607843
[3,] 8.3392157 -8.9607843
[4,] 4.5392157 8.3392157
[5,] -1.8607843 4.5392157
[6,] -4.1607843 -1.8607843
[7,] -11.1607843 -4.1607843
[8,] -9.8607843 -11.1607843
[9,] -1.0607843 -9.8607843
[10,] -2.9607843 -1.0607843
[11,] -7.6607843 -2.9607843
[12,] 8.1392157 -7.6607843
[13,] -24.8607843 8.1392157
[14,] -10.0607843 -24.8607843
[15,] 7.4392157 -10.0607843
[16,] 0.1392157 7.4392157
[17,] 3.0392157 0.1392157
[18,] -3.4607843 3.0392157
[19,] -6.7607843 -3.4607843
[20,] -5.0607843 -6.7607843
[21,] 9.7392157 -5.0607843
[22,] -5.0607843 9.7392157
[23,] 4.1392157 -5.0607843
[24,] 8.8392157 4.1392157
[25,] -20.3607843 8.8392157
[26,] -5.2607843 -20.3607843
[27,] 9.0392157 -5.2607843
[28,] 10.7392157 9.0392157
[29,] 7.1392157 10.7392157
[30,] -3.7607843 7.1392157
[31,] 0.2392157 -3.7607843
[32,] -0.4607843 0.2392157
[33,] 13.0392157 -0.4607843
[34,] 0.3392157 13.0392157
[35,] 3.5392157 0.3392157
[36,] 11.4392157 3.5392157
[37,] -13.2607843 11.4392157
[38,] -1.5607843 -13.2607843
[39,] 6.7392157 -1.5607843
[40,] 16.6392157 6.7392157
[41,] 7.5392157 16.6392157
[42,] -5.7607843 7.5392157
[43,] 4.9392157 -5.7607843
[44,] 7.0392157 4.9392157
[45,] 4.0392157 7.0392157
[46,] 11.5392157 4.0392157
[47,] 3.3392157 11.5392157
[48,] 10.1392157 3.3392157
[49,] -9.7607843 10.1392157
[50,] -5.9607843 -9.7607843
[51,] 16.5900000 -5.9607843
[52,] 15.4900000 16.5900000
[53,] -0.8100000 15.4900000
[54,] -5.9100000 -0.8100000
[55,] -9.2100000 -5.9100000
[56,] -7.0100000 -9.2100000
[57,] 2.8900000 -7.0100000
[58,] -6.1100000 2.8900000
[59,] -8.4100000 -6.1100000
[60,] 2.4900000 -8.4100000
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -18.3607843 5.6392157
2 -8.9607843 -18.3607843
3 8.3392157 -8.9607843
4 4.5392157 8.3392157
5 -1.8607843 4.5392157
6 -4.1607843 -1.8607843
7 -11.1607843 -4.1607843
8 -9.8607843 -11.1607843
9 -1.0607843 -9.8607843
10 -2.9607843 -1.0607843
11 -7.6607843 -2.9607843
12 8.1392157 -7.6607843
13 -24.8607843 8.1392157
14 -10.0607843 -24.8607843
15 7.4392157 -10.0607843
16 0.1392157 7.4392157
17 3.0392157 0.1392157
18 -3.4607843 3.0392157
19 -6.7607843 -3.4607843
20 -5.0607843 -6.7607843
21 9.7392157 -5.0607843
22 -5.0607843 9.7392157
23 4.1392157 -5.0607843
24 8.8392157 4.1392157
25 -20.3607843 8.8392157
26 -5.2607843 -20.3607843
27 9.0392157 -5.2607843
28 10.7392157 9.0392157
29 7.1392157 10.7392157
30 -3.7607843 7.1392157
31 0.2392157 -3.7607843
32 -0.4607843 0.2392157
33 13.0392157 -0.4607843
34 0.3392157 13.0392157
35 3.5392157 0.3392157
36 11.4392157 3.5392157
37 -13.2607843 11.4392157
38 -1.5607843 -13.2607843
39 6.7392157 -1.5607843
40 16.6392157 6.7392157
41 7.5392157 16.6392157
42 -5.7607843 7.5392157
43 4.9392157 -5.7607843
44 7.0392157 4.9392157
45 4.0392157 7.0392157
46 11.5392157 4.0392157
47 3.3392157 11.5392157
48 10.1392157 3.3392157
49 -9.7607843 10.1392157
50 -5.9607843 -9.7607843
51 16.5900000 -5.9607843
52 15.4900000 16.5900000
53 -0.8100000 15.4900000
54 -5.9100000 -0.8100000
55 -9.2100000 -5.9100000
56 -7.0100000 -9.2100000
57 2.8900000 -7.0100000
58 -6.1100000 2.8900000
59 -8.4100000 -6.1100000
60 2.4900000 -8.4100000
> 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/72wij1258733837.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/8cuxs1258733837.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/9htmw1258733837.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/108da51258733837.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/11u79j1258733837.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/120r8q1258733837.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/1366b01258733837.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/147e7a1258733837.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/15b3xj1258733837.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/168h0f1258733837.tab")
+ }
>
> system("convert tmp/1z3cq1258733837.ps tmp/1z3cq1258733837.png")
> system("convert tmp/2mwpu1258733837.ps tmp/2mwpu1258733837.png")
> system("convert tmp/3tsxb1258733837.ps tmp/3tsxb1258733837.png")
> system("convert tmp/49u2r1258733837.ps tmp/49u2r1258733837.png")
> system("convert tmp/5wvff1258733837.ps tmp/5wvff1258733837.png")
> system("convert tmp/6ewig1258733837.ps tmp/6ewig1258733837.png")
> system("convert tmp/72wij1258733837.ps tmp/72wij1258733837.png")
> system("convert tmp/8cuxs1258733837.ps tmp/8cuxs1258733837.png")
> system("convert tmp/9htmw1258733837.ps tmp/9htmw1258733837.png")
> system("convert tmp/108da51258733837.ps tmp/108da51258733837.png")
>
>
> proc.time()
user system elapsed
2.485 1.556 5.694