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(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,0,101,0,95,0,93,0,84,0,87,0,116,0,120,0,117,1,109,1,105,1,107,1,109,1,109,1,108,1,107,1,99,1,103,1,131,1,137,1,135,1),dim=c(2,60),dimnames=list(c('WLH','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('WLH','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
WLH X
1 149 0
2 139 0
3 135 0
4 130 0
5 127 0
6 122 0
7 117 0
8 112 0
9 113 0
10 149 0
11 157 0
12 157 0
13 147 0
14 137 0
15 132 0
16 125 0
17 123 0
18 117 0
19 114 0
20 111 0
21 112 0
22 144 0
23 150 0
24 149 0
25 134 0
26 123 0
27 116 0
28 117 0
29 111 0
30 105 0
31 102 0
32 95 0
33 93 0
34 124 0
35 130 0
36 124 0
37 115 0
38 106 0
39 105 0
40 105 0
41 101 0
42 95 0
43 93 0
44 84 0
45 87 0
46 116 0
47 120 0
48 117 1
49 109 1
50 105 1
51 107 1
52 109 1
53 109 1
54 108 1
55 107 1
56 99 1
57 103 1
58 131 1
59 137 1
60 135 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
120.617 -7.079
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-36.617 -9.617 -4.078 11.883 36.383
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 120.617 2.570 46.939 <2e-16 ***
X -7.079 5.521 -1.282 0.205
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 17.62 on 58 degrees of freedom
Multiple R-squared: 0.02757, Adjusted R-squared: 0.0108
F-statistic: 1.644 on 1 and 58 DF, p-value: 0.2049
> 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.1886005 0.37720100 0.81139950
[2,] 0.1674184 0.33483685 0.83258158
[3,] 0.1777056 0.35541115 0.82229442
[4,] 0.2113481 0.42269615 0.78865192
[5,] 0.1970394 0.39407885 0.80296057
[6,] 0.2725845 0.54516891 0.72741555
[7,] 0.4650073 0.93001451 0.53499275
[8,] 0.6285625 0.74287503 0.37143752
[9,] 0.6432911 0.71341780 0.35670890
[10,] 0.5905470 0.81890591 0.40945296
[11,] 0.5275166 0.94496689 0.47248344
[12,] 0.4735730 0.94714603 0.52642698
[13,] 0.4263515 0.85270296 0.57364852
[14,] 0.4101455 0.82029098 0.58985451
[15,] 0.4074965 0.81499303 0.59250349
[16,] 0.4182553 0.83651068 0.58174466
[17,] 0.4080591 0.81611816 0.59194092
[18,] 0.4672866 0.93457324 0.53271338
[19,] 0.6394280 0.72114407 0.36057204
[20,] 0.8136281 0.37274388 0.18637194
[21,] 0.8414888 0.31702230 0.15851115
[22,] 0.8332369 0.33352619 0.16676310
[23,] 0.8233218 0.35335650 0.17667825
[24,] 0.8111955 0.37760891 0.18880445
[25,] 0.8055425 0.38891498 0.19445749
[26,] 0.8169513 0.36609743 0.18304871
[27,] 0.8338153 0.33236946 0.16618473
[28,] 0.8800580 0.23988399 0.11994199
[29,] 0.9181761 0.16364778 0.08182389
[30,] 0.9132094 0.17358129 0.08679064
[31,] 0.9382069 0.12358619 0.06179309
[32,] 0.9486334 0.10273328 0.05136664
[33,] 0.9433833 0.11323332 0.05661666
[34,] 0.9310630 0.13787396 0.06893698
[35,] 0.9158021 0.16839584 0.08419792
[36,] 0.8968924 0.20621530 0.10310765
[37,] 0.8757308 0.24853842 0.12426921
[38,] 0.8633165 0.27336695 0.13668348
[39,] 0.8556038 0.28879239 0.14439620
[40,] 0.9119960 0.17600791 0.08800396
[41,] 0.9647239 0.07055225 0.03527612
[42,] 0.9411840 0.11763191 0.05881595
[43,] 0.9039903 0.19201931 0.09600966
[44,] 0.8529110 0.29417797 0.14708898
[45,] 0.7864050 0.42719010 0.21359505
[46,] 0.7211945 0.55761102 0.27880551
[47,] 0.6346190 0.73076206 0.36538103
[48,] 0.5273992 0.94520166 0.47260083
[49,] 0.4148119 0.82962386 0.58518807
[50,] 0.3121450 0.62428998 0.68785501
[51,] 0.2293734 0.45874671 0.77062664
> postscript(file="/var/www/html/rcomp/tmp/1ilpd1258619733.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/28sup1258619733.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/3wytr1258619733.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/4cvnp1258619733.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/5q2wb1258619733.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
28.3829787 18.3829787 14.3829787 9.3829787 6.3829787 1.3829787
7 8 9 10 11 12
-3.6170213 -8.6170213 -7.6170213 28.3829787 36.3829787 36.3829787
13 14 15 16 17 18
26.3829787 16.3829787 11.3829787 4.3829787 2.3829787 -3.6170213
19 20 21 22 23 24
-6.6170213 -9.6170213 -8.6170213 23.3829787 29.3829787 28.3829787
25 26 27 28 29 30
13.3829787 2.3829787 -4.6170213 -3.6170213 -9.6170213 -15.6170213
31 32 33 34 35 36
-18.6170213 -25.6170213 -27.6170213 3.3829787 9.3829787 3.3829787
37 38 39 40 41 42
-5.6170213 -14.6170213 -15.6170213 -15.6170213 -19.6170213 -25.6170213
43 44 45 46 47 48
-27.6170213 -36.6170213 -33.6170213 -4.6170213 -0.6170213 3.4615385
49 50 51 52 53 54
-4.5384615 -8.5384615 -6.5384615 -4.5384615 -4.5384615 -5.5384615
55 56 57 58 59 60
-6.5384615 -14.5384615 -10.5384615 17.4615385 23.4615385 21.4615385
> postscript(file="/var/www/html/rcomp/tmp/6tuz31258619733.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 28.3829787 NA
1 18.3829787 28.3829787
2 14.3829787 18.3829787
3 9.3829787 14.3829787
4 6.3829787 9.3829787
5 1.3829787 6.3829787
6 -3.6170213 1.3829787
7 -8.6170213 -3.6170213
8 -7.6170213 -8.6170213
9 28.3829787 -7.6170213
10 36.3829787 28.3829787
11 36.3829787 36.3829787
12 26.3829787 36.3829787
13 16.3829787 26.3829787
14 11.3829787 16.3829787
15 4.3829787 11.3829787
16 2.3829787 4.3829787
17 -3.6170213 2.3829787
18 -6.6170213 -3.6170213
19 -9.6170213 -6.6170213
20 -8.6170213 -9.6170213
21 23.3829787 -8.6170213
22 29.3829787 23.3829787
23 28.3829787 29.3829787
24 13.3829787 28.3829787
25 2.3829787 13.3829787
26 -4.6170213 2.3829787
27 -3.6170213 -4.6170213
28 -9.6170213 -3.6170213
29 -15.6170213 -9.6170213
30 -18.6170213 -15.6170213
31 -25.6170213 -18.6170213
32 -27.6170213 -25.6170213
33 3.3829787 -27.6170213
34 9.3829787 3.3829787
35 3.3829787 9.3829787
36 -5.6170213 3.3829787
37 -14.6170213 -5.6170213
38 -15.6170213 -14.6170213
39 -15.6170213 -15.6170213
40 -19.6170213 -15.6170213
41 -25.6170213 -19.6170213
42 -27.6170213 -25.6170213
43 -36.6170213 -27.6170213
44 -33.6170213 -36.6170213
45 -4.6170213 -33.6170213
46 -0.6170213 -4.6170213
47 3.4615385 -0.6170213
48 -4.5384615 3.4615385
49 -8.5384615 -4.5384615
50 -6.5384615 -8.5384615
51 -4.5384615 -6.5384615
52 -4.5384615 -4.5384615
53 -5.5384615 -4.5384615
54 -6.5384615 -5.5384615
55 -14.5384615 -6.5384615
56 -10.5384615 -14.5384615
57 17.4615385 -10.5384615
58 23.4615385 17.4615385
59 21.4615385 23.4615385
60 NA 21.4615385
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 18.3829787 28.3829787
[2,] 14.3829787 18.3829787
[3,] 9.3829787 14.3829787
[4,] 6.3829787 9.3829787
[5,] 1.3829787 6.3829787
[6,] -3.6170213 1.3829787
[7,] -8.6170213 -3.6170213
[8,] -7.6170213 -8.6170213
[9,] 28.3829787 -7.6170213
[10,] 36.3829787 28.3829787
[11,] 36.3829787 36.3829787
[12,] 26.3829787 36.3829787
[13,] 16.3829787 26.3829787
[14,] 11.3829787 16.3829787
[15,] 4.3829787 11.3829787
[16,] 2.3829787 4.3829787
[17,] -3.6170213 2.3829787
[18,] -6.6170213 -3.6170213
[19,] -9.6170213 -6.6170213
[20,] -8.6170213 -9.6170213
[21,] 23.3829787 -8.6170213
[22,] 29.3829787 23.3829787
[23,] 28.3829787 29.3829787
[24,] 13.3829787 28.3829787
[25,] 2.3829787 13.3829787
[26,] -4.6170213 2.3829787
[27,] -3.6170213 -4.6170213
[28,] -9.6170213 -3.6170213
[29,] -15.6170213 -9.6170213
[30,] -18.6170213 -15.6170213
[31,] -25.6170213 -18.6170213
[32,] -27.6170213 -25.6170213
[33,] 3.3829787 -27.6170213
[34,] 9.3829787 3.3829787
[35,] 3.3829787 9.3829787
[36,] -5.6170213 3.3829787
[37,] -14.6170213 -5.6170213
[38,] -15.6170213 -14.6170213
[39,] -15.6170213 -15.6170213
[40,] -19.6170213 -15.6170213
[41,] -25.6170213 -19.6170213
[42,] -27.6170213 -25.6170213
[43,] -36.6170213 -27.6170213
[44,] -33.6170213 -36.6170213
[45,] -4.6170213 -33.6170213
[46,] -0.6170213 -4.6170213
[47,] 3.4615385 -0.6170213
[48,] -4.5384615 3.4615385
[49,] -8.5384615 -4.5384615
[50,] -6.5384615 -8.5384615
[51,] -4.5384615 -6.5384615
[52,] -4.5384615 -4.5384615
[53,] -5.5384615 -4.5384615
[54,] -6.5384615 -5.5384615
[55,] -14.5384615 -6.5384615
[56,] -10.5384615 -14.5384615
[57,] 17.4615385 -10.5384615
[58,] 23.4615385 17.4615385
[59,] 21.4615385 23.4615385
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 18.3829787 28.3829787
2 14.3829787 18.3829787
3 9.3829787 14.3829787
4 6.3829787 9.3829787
5 1.3829787 6.3829787
6 -3.6170213 1.3829787
7 -8.6170213 -3.6170213
8 -7.6170213 -8.6170213
9 28.3829787 -7.6170213
10 36.3829787 28.3829787
11 36.3829787 36.3829787
12 26.3829787 36.3829787
13 16.3829787 26.3829787
14 11.3829787 16.3829787
15 4.3829787 11.3829787
16 2.3829787 4.3829787
17 -3.6170213 2.3829787
18 -6.6170213 -3.6170213
19 -9.6170213 -6.6170213
20 -8.6170213 -9.6170213
21 23.3829787 -8.6170213
22 29.3829787 23.3829787
23 28.3829787 29.3829787
24 13.3829787 28.3829787
25 2.3829787 13.3829787
26 -4.6170213 2.3829787
27 -3.6170213 -4.6170213
28 -9.6170213 -3.6170213
29 -15.6170213 -9.6170213
30 -18.6170213 -15.6170213
31 -25.6170213 -18.6170213
32 -27.6170213 -25.6170213
33 3.3829787 -27.6170213
34 9.3829787 3.3829787
35 3.3829787 9.3829787
36 -5.6170213 3.3829787
37 -14.6170213 -5.6170213
38 -15.6170213 -14.6170213
39 -15.6170213 -15.6170213
40 -19.6170213 -15.6170213
41 -25.6170213 -19.6170213
42 -27.6170213 -25.6170213
43 -36.6170213 -27.6170213
44 -33.6170213 -36.6170213
45 -4.6170213 -33.6170213
46 -0.6170213 -4.6170213
47 3.4615385 -0.6170213
48 -4.5384615 3.4615385
49 -8.5384615 -4.5384615
50 -6.5384615 -8.5384615
51 -4.5384615 -6.5384615
52 -4.5384615 -4.5384615
53 -5.5384615 -4.5384615
54 -6.5384615 -5.5384615
55 -14.5384615 -6.5384615
56 -10.5384615 -14.5384615
57 17.4615385 -10.5384615
58 23.4615385 17.4615385
59 21.4615385 23.4615385
> 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/7ul8m1258619733.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/8lvt51258619733.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/9uz1g1258619733.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/10ato81258619733.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/11mmat1258619733.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/120axy1258619733.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/13rrgf1258619733.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/14lm291258619733.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/15xw2z1258619733.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/165ef01258619733.tab")
+ }
>
> system("convert tmp/1ilpd1258619733.ps tmp/1ilpd1258619733.png")
> system("convert tmp/28sup1258619733.ps tmp/28sup1258619733.png")
> system("convert tmp/3wytr1258619733.ps tmp/3wytr1258619733.png")
> system("convert tmp/4cvnp1258619733.ps tmp/4cvnp1258619733.png")
> system("convert tmp/5q2wb1258619733.ps tmp/5q2wb1258619733.png")
> system("convert tmp/6tuz31258619733.ps tmp/6tuz31258619733.png")
> system("convert tmp/7ul8m1258619733.ps tmp/7ul8m1258619733.png")
> system("convert tmp/8lvt51258619733.ps tmp/8lvt51258619733.png")
> system("convert tmp/9uz1g1258619733.ps tmp/9uz1g1258619733.png")
> system("convert tmp/10ato81258619733.ps tmp/10ato81258619733.png")
>
>
> proc.time()
user system elapsed
2.440 1.526 3.706