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(4143,0,4429,0,5219,0,4929,0,5761,0,5592,0,4163,0,4962,0,5208,0,4755,0,4491,0,5732,0,5731,0,5040,0,6102,0,4904,0,5369,0,5578,0,4619,0,4731,0,5011,0,5299,0,4146,0,4625,0,4736,0,4219,0,5116,0,4205,1,4121,1,5103,1,4300,1,4578,1,3809,1,5526,1,4248,1,3830,1,4428,1,4834,1,4406,1,4565,1,4104,1,4798,1,3935,1,3792,1,4387,1,4006,1,4078,1,4724,1),dim=c(2,48),dimnames=list(c('y','x
'),1:48))
> y <- array(NA,dim=c(2,48),dimnames=list(c('y','x
'),1:48))
> 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 = 'Include Monthly 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\r M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 4143 0 1 0 0 0 0 0 0 0 0 0 0
2 4429 0 0 1 0 0 0 0 0 0 0 0 0
3 5219 0 0 0 1 0 0 0 0 0 0 0 0
4 4929 0 0 0 0 1 0 0 0 0 0 0 0
5 5761 0 0 0 0 0 1 0 0 0 0 0 0
6 5592 0 0 0 0 0 0 1 0 0 0 0 0
7 4163 0 0 0 0 0 0 0 1 0 0 0 0
8 4962 0 0 0 0 0 0 0 0 1 0 0 0
9 5208 0 0 0 0 0 0 0 0 0 1 0 0
10 4755 0 0 0 0 0 0 0 0 0 0 1 0
11 4491 0 0 0 0 0 0 0 0 0 0 0 1
12 5732 0 0 0 0 0 0 0 0 0 0 0 0
13 5731 0 1 0 0 0 0 0 0 0 0 0 0
14 5040 0 0 1 0 0 0 0 0 0 0 0 0
15 6102 0 0 0 1 0 0 0 0 0 0 0 0
16 4904 0 0 0 0 1 0 0 0 0 0 0 0
17 5369 0 0 0 0 0 1 0 0 0 0 0 0
18 5578 0 0 0 0 0 0 1 0 0 0 0 0
19 4619 0 0 0 0 0 0 0 1 0 0 0 0
20 4731 0 0 0 0 0 0 0 0 1 0 0 0
21 5011 0 0 0 0 0 0 0 0 0 1 0 0
22 5299 0 0 0 0 0 0 0 0 0 0 1 0
23 4146 0 0 0 0 0 0 0 0 0 0 0 1
24 4625 0 0 0 0 0 0 0 0 0 0 0 0
25 4736 0 1 0 0 0 0 0 0 0 0 0 0
26 4219 0 0 1 0 0 0 0 0 0 0 0 0
27 5116 0 0 0 1 0 0 0 0 0 0 0 0
28 4205 1 0 0 0 1 0 0 0 0 0 0 0
29 4121 1 0 0 0 0 1 0 0 0 0 0 0
30 5103 1 0 0 0 0 0 1 0 0 0 0 0
31 4300 1 0 0 0 0 0 0 1 0 0 0 0
32 4578 1 0 0 0 0 0 0 0 1 0 0 0
33 3809 1 0 0 0 0 0 0 0 0 1 0 0
34 5526 1 0 0 0 0 0 0 0 0 0 1 0
35 4248 1 0 0 0 0 0 0 0 0 0 0 1
36 3830 1 0 0 0 0 0 0 0 0 0 0 0
37 4428 1 1 0 0 0 0 0 0 0 0 0 0
38 4834 1 0 1 0 0 0 0 0 0 0 0 0
39 4406 1 0 0 1 0 0 0 0 0 0 0 0
40 4565 1 0 0 0 1 0 0 0 0 0 0 0
41 4104 1 0 0 0 0 1 0 0 0 0 0 0
42 4798 1 0 0 0 0 0 1 0 0 0 0 0
43 3935 1 0 0 0 0 0 0 1 0 0 0 0
44 3792 1 0 0 0 0 0 0 0 1 0 0 0
45 4387 1 0 0 0 0 0 0 0 0 1 0 0
46 4006 1 0 0 0 0 0 0 0 0 0 1 0
47 4078 1 0 0 0 0 0 0 0 0 0 0 1
48 4724 1 0 0 0 0 0 0 0 0 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `x\r` M1 M2 M3 M4
5030.7 -605.8 -119.7 -248.7 331.5 -77.0
M5 M6 M7 M8 M9 M10
111.0 540.0 -473.5 -212.0 -124.0 168.7
M11
-487.0
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-768.0 -363.3 -4.5 235.0 932.4
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5030.7 244.4 20.582 < 2e-16 ***
`x\r` -605.8 139.7 -4.338 0.000116 ***
M1 -119.7 333.1 -0.359 0.721461
M2 -248.7 333.1 -0.747 0.460248
M3 331.5 333.1 0.995 0.326405
M4 -77.0 331.3 -0.232 0.817544
M5 111.0 331.3 0.335 0.739560
M6 540.0 331.3 1.630 0.112038
M7 -473.5 331.3 -1.429 0.161755
M8 -212.0 331.3 -0.640 0.526350
M9 -124.0 331.3 -0.374 0.710416
M10 168.8 331.3 0.509 0.613653
M11 -487.0 331.3 -1.470 0.150453
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 468.5 on 35 degrees of freedom
Multiple R-squared: 0.5264, Adjusted R-squared: 0.364
F-statistic: 3.242 on 12 and 35 DF, p-value: 0.003255
> 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.95512694 0.08974612 0.04487306
[2,] 0.93861966 0.12276067 0.06138034
[3,] 0.88328068 0.23343865 0.11671932
[4,] 0.82307652 0.35384697 0.17692348
[5,] 0.73344761 0.53310478 0.26655239
[6,] 0.67500822 0.64998357 0.32499178
[7,] 0.61405739 0.77188521 0.38594261
[8,] 0.51231732 0.97536537 0.48768268
[9,] 0.54637339 0.90725322 0.45362661
[10,] 0.43314077 0.86628154 0.56685923
[11,] 0.46031855 0.92063710 0.53968145
[12,] 0.37352640 0.74705280 0.62647360
[13,] 0.27280450 0.54560900 0.72719550
[14,] 0.19486150 0.38972299 0.80513850
[15,] 0.13322352 0.26644705 0.86677648
[16,] 0.09422450 0.18844900 0.90577550
[17,] 0.07240279 0.14480558 0.92759721
> postscript(file="/var/www/html/rcomp/tmp/1n8a21258729135.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/2o6ap1258729135.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/3wavg1258729135.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/4lid91258729135.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/5z2rm1258729135.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 = 48
Frequency = 1
1 2 3 4 5 6
-767.961111 -352.961111 -143.211111 -24.672222 619.327778 21.327778
7 8 9 10 11 12
-394.172222 143.327778 301.327778 -444.422222 -52.672222 701.327778
13 14 15 16 17 18
820.038889 258.038889 739.788889 -49.672222 227.327778 7.327778
19 20 21 22 23 24
61.827778 -87.672222 104.327778 99.577778 -397.672222 -405.672222
25 26 27 28 29 30
-174.961111 -562.961111 -246.211111 -142.827778 -414.827778 138.172222
31 32 33 34 35 36
348.672222 365.172222 -491.827778 932.422222 310.172222 -594.827778
37 38 39 40 41 42
122.883333 657.883333 -350.366667 217.172222 -431.827778 -166.827778
43 44 45 46 47 48
-16.327778 -420.827778 86.172222 -587.577778 140.172222 299.172222
> postscript(file="/var/www/html/rcomp/tmp/6gu2i1258729135.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 = 48
Frequency = 1
lag(myerror, k = 1) myerror
0 -767.961111 NA
1 -352.961111 -767.961111
2 -143.211111 -352.961111
3 -24.672222 -143.211111
4 619.327778 -24.672222
5 21.327778 619.327778
6 -394.172222 21.327778
7 143.327778 -394.172222
8 301.327778 143.327778
9 -444.422222 301.327778
10 -52.672222 -444.422222
11 701.327778 -52.672222
12 820.038889 701.327778
13 258.038889 820.038889
14 739.788889 258.038889
15 -49.672222 739.788889
16 227.327778 -49.672222
17 7.327778 227.327778
18 61.827778 7.327778
19 -87.672222 61.827778
20 104.327778 -87.672222
21 99.577778 104.327778
22 -397.672222 99.577778
23 -405.672222 -397.672222
24 -174.961111 -405.672222
25 -562.961111 -174.961111
26 -246.211111 -562.961111
27 -142.827778 -246.211111
28 -414.827778 -142.827778
29 138.172222 -414.827778
30 348.672222 138.172222
31 365.172222 348.672222
32 -491.827778 365.172222
33 932.422222 -491.827778
34 310.172222 932.422222
35 -594.827778 310.172222
36 122.883333 -594.827778
37 657.883333 122.883333
38 -350.366667 657.883333
39 217.172222 -350.366667
40 -431.827778 217.172222
41 -166.827778 -431.827778
42 -16.327778 -166.827778
43 -420.827778 -16.327778
44 86.172222 -420.827778
45 -587.577778 86.172222
46 140.172222 -587.577778
47 299.172222 140.172222
48 NA 299.172222
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -352.961111 -767.961111
[2,] -143.211111 -352.961111
[3,] -24.672222 -143.211111
[4,] 619.327778 -24.672222
[5,] 21.327778 619.327778
[6,] -394.172222 21.327778
[7,] 143.327778 -394.172222
[8,] 301.327778 143.327778
[9,] -444.422222 301.327778
[10,] -52.672222 -444.422222
[11,] 701.327778 -52.672222
[12,] 820.038889 701.327778
[13,] 258.038889 820.038889
[14,] 739.788889 258.038889
[15,] -49.672222 739.788889
[16,] 227.327778 -49.672222
[17,] 7.327778 227.327778
[18,] 61.827778 7.327778
[19,] -87.672222 61.827778
[20,] 104.327778 -87.672222
[21,] 99.577778 104.327778
[22,] -397.672222 99.577778
[23,] -405.672222 -397.672222
[24,] -174.961111 -405.672222
[25,] -562.961111 -174.961111
[26,] -246.211111 -562.961111
[27,] -142.827778 -246.211111
[28,] -414.827778 -142.827778
[29,] 138.172222 -414.827778
[30,] 348.672222 138.172222
[31,] 365.172222 348.672222
[32,] -491.827778 365.172222
[33,] 932.422222 -491.827778
[34,] 310.172222 932.422222
[35,] -594.827778 310.172222
[36,] 122.883333 -594.827778
[37,] 657.883333 122.883333
[38,] -350.366667 657.883333
[39,] 217.172222 -350.366667
[40,] -431.827778 217.172222
[41,] -166.827778 -431.827778
[42,] -16.327778 -166.827778
[43,] -420.827778 -16.327778
[44,] 86.172222 -420.827778
[45,] -587.577778 86.172222
[46,] 140.172222 -587.577778
[47,] 299.172222 140.172222
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -352.961111 -767.961111
2 -143.211111 -352.961111
3 -24.672222 -143.211111
4 619.327778 -24.672222
5 21.327778 619.327778
6 -394.172222 21.327778
7 143.327778 -394.172222
8 301.327778 143.327778
9 -444.422222 301.327778
10 -52.672222 -444.422222
11 701.327778 -52.672222
12 820.038889 701.327778
13 258.038889 820.038889
14 739.788889 258.038889
15 -49.672222 739.788889
16 227.327778 -49.672222
17 7.327778 227.327778
18 61.827778 7.327778
19 -87.672222 61.827778
20 104.327778 -87.672222
21 99.577778 104.327778
22 -397.672222 99.577778
23 -405.672222 -397.672222
24 -174.961111 -405.672222
25 -562.961111 -174.961111
26 -246.211111 -562.961111
27 -142.827778 -246.211111
28 -414.827778 -142.827778
29 138.172222 -414.827778
30 348.672222 138.172222
31 365.172222 348.672222
32 -491.827778 365.172222
33 932.422222 -491.827778
34 310.172222 932.422222
35 -594.827778 310.172222
36 122.883333 -594.827778
37 657.883333 122.883333
38 -350.366667 657.883333
39 217.172222 -350.366667
40 -431.827778 217.172222
41 -166.827778 -431.827778
42 -16.327778 -166.827778
43 -420.827778 -16.327778
44 86.172222 -420.827778
45 -587.577778 86.172222
46 140.172222 -587.577778
47 299.172222 140.172222
> 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/7c7kx1258729135.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/8arrm1258729135.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/966r11258729135.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/10p7js1258729135.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/11g3kq1258729135.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/12py861258729135.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/13ll5a1258729135.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/14mkjz1258729135.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/159t251258729135.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/16kfi81258729135.tab")
+ }
>
> system("convert tmp/1n8a21258729135.ps tmp/1n8a21258729135.png")
> system("convert tmp/2o6ap1258729135.ps tmp/2o6ap1258729135.png")
> system("convert tmp/3wavg1258729135.ps tmp/3wavg1258729135.png")
> system("convert tmp/4lid91258729135.ps tmp/4lid91258729135.png")
> system("convert tmp/5z2rm1258729135.ps tmp/5z2rm1258729135.png")
> system("convert tmp/6gu2i1258729135.ps tmp/6gu2i1258729135.png")
> system("convert tmp/7c7kx1258729135.ps tmp/7c7kx1258729135.png")
> system("convert tmp/8arrm1258729135.ps tmp/8arrm1258729135.png")
> system("convert tmp/966r11258729135.ps tmp/966r11258729135.png")
> system("convert tmp/10p7js1258729135.ps tmp/10p7js1258729135.png")
>
>
> proc.time()
user system elapsed
2.316 1.553 4.499