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.
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(99.29,0,98.69,0,107.92,0,101.03,0,97.55,0,103.02,0,94.08,0,94.12,0,115.08,0,116.48,0,103.42,0,112.51,0,95.55,0,97.53,0,119.26,0,100.94,0,97.73,0,115.25,0,92.8,0,99.2,0,118.69,0,110.12,0,110.26,0,112.9,0,102.17,1,99.38,1,116.1,1,103.77,1,101.81,1,113.74,1,89.67,1,99.5,1,122.89,1,108.61,1,114.37,1,110.5,1,104.08,1,103.64,1,121.61,1,101.14,1,115.97,1,120.12,1,95.97,1,105.01,1,124.68,1,123.89,1,123.61,1,114.76,1,108.75,1,106.09,1,123.17,1,106.16,1,115.18,1,120.6,1,109.48,1,114.44,1,121.44,1,129.48,1,124.32,1,112.59,1),dim=c(2,60),dimnames=list(c('omzet','dummievariabele'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('omzet','dummievariabele'),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
omzet dummievariabele
1 99.29 0
2 98.69 0
3 107.92 0
4 101.03 0
5 97.55 0
6 103.02 0
7 94.08 0
8 94.12 0
9 115.08 0
10 116.48 0
11 103.42 0
12 112.51 0
13 95.55 0
14 97.53 0
15 119.26 0
16 100.94 0
17 97.73 0
18 115.25 0
19 92.80 0
20 99.20 0
21 118.69 0
22 110.12 0
23 110.26 0
24 112.90 0
25 102.17 1
26 99.38 1
27 116.10 1
28 103.77 1
29 101.81 1
30 113.74 1
31 89.67 1
32 99.50 1
33 122.89 1
34 108.61 1
35 114.37 1
36 110.50 1
37 104.08 1
38 103.64 1
39 121.61 1
40 101.14 1
41 115.97 1
42 120.12 1
43 95.97 1
44 105.01 1
45 124.68 1
46 123.89 1
47 123.61 1
48 114.76 1
49 108.75 1
50 106.09 1
51 123.17 1
52 106.16 1
53 115.18 1
54 120.60 1
55 109.48 1
56 114.44 1
57 121.44 1
58 129.48 1
59 124.32 1
60 112.59 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) dummievariabele
104.726 7.182
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-22.238 -7.181 -1.357 8.332 17.572
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 104.726 1.887 55.504 <2e-16 ***
dummievariabele 7.182 2.436 2.949 0.0046 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 9.243 on 58 degrees of freedom
Multiple R-squared: 0.1304, Adjusted R-squared: 0.1154
F-statistic: 8.694 on 1 and 58 DF, p-value: 0.004596
> 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.13939169 0.2787834 0.8606083
[2,] 0.05999833 0.1199967 0.9400017
[3,] 0.06444990 0.1288998 0.9355501
[4,] 0.05456836 0.1091367 0.9454316
[5,] 0.23095417 0.4619083 0.7690458
[6,] 0.39514454 0.7902891 0.6048555
[7,] 0.29346094 0.5869219 0.7065391
[8,] 0.29400034 0.5880007 0.7059997
[9,] 0.27978778 0.5595756 0.7202122
[10,] 0.23765773 0.4753155 0.7623423
[11,] 0.39700662 0.7940132 0.6029934
[12,] 0.32387551 0.6477510 0.6761245
[13,] 0.28886541 0.5777308 0.7111346
[14,] 0.32041034 0.6408207 0.6795897
[15,] 0.38216082 0.7643216 0.6178392
[16,] 0.35416774 0.7083355 0.6458323
[17,] 0.43889192 0.8777838 0.5611081
[18,] 0.38366535 0.7673307 0.6163346
[19,] 0.33069200 0.6613840 0.6693080
[20,] 0.29740756 0.5948151 0.7025924
[21,] 0.25690655 0.5138131 0.7430934
[22,] 0.24070098 0.4814020 0.7592990
[23,] 0.25404885 0.5080977 0.7459512
[24,] 0.21687338 0.4337468 0.7831266
[25,] 0.19768982 0.3953796 0.8023102
[26,] 0.17159874 0.3431975 0.8284013
[27,] 0.40213683 0.8042737 0.5978632
[28,] 0.43858143 0.8771629 0.5614186
[29,] 0.55273495 0.8945301 0.4472650
[30,] 0.49609735 0.9921947 0.5039026
[31,] 0.44580664 0.8916133 0.5541934
[32,] 0.38314712 0.7662942 0.6168529
[33,] 0.37085852 0.7417170 0.6291415
[34,] 0.37361203 0.7472241 0.6263880
[35,] 0.39655846 0.7931169 0.6034415
[36,] 0.46235629 0.9247126 0.5376437
[37,] 0.40554880 0.8110976 0.5944512
[38,] 0.38359905 0.7671981 0.6164009
[39,] 0.65739098 0.6852180 0.3426090
[40,] 0.70605916 0.5878817 0.2939408
[41,] 0.73727527 0.5254495 0.2627247
[42,] 0.74740332 0.5051934 0.2525967
[43,] 0.75104513 0.4979097 0.2489549
[44,] 0.66843374 0.6631325 0.3315663
[45,] 0.63168651 0.7366270 0.3683135
[46,] 0.67668384 0.6466323 0.3233162
[47,] 0.63602341 0.7279532 0.3639766
[48,] 0.71581794 0.5683641 0.2841821
[49,] 0.61065298 0.7786940 0.3893470
[50,] 0.47834992 0.9566998 0.5216501
[51,] 0.50153123 0.9969375 0.4984688
> postscript(file="/var/www/html/rcomp/tmp/1ma1t1227269073.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/2rhhd1227269073.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/3spsp1227269073.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/4huob1227269073.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/5zupx1227269073.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
-5.4358333 -6.0358333 3.1941667 -3.6958333 -7.1758333 -1.7058333
7 8 9 10 11 12
-10.6458333 -10.6058333 10.3541667 11.7541667 -1.3058333 7.7841667
13 14 15 16 17 18
-9.1758333 -7.1958333 14.5341667 -3.7858333 -6.9958333 10.5241667
19 20 21 22 23 24
-11.9258333 -5.5258333 13.9641667 5.3941667 5.5341667 8.1741667
25 26 27 28 29 30
-9.7380556 -12.5280556 4.1919444 -8.1380556 -10.0980556 1.8319444
31 32 33 34 35 36
-22.2380556 -12.4080556 10.9819444 -3.2980556 2.4619444 -1.4080556
37 38 39 40 41 42
-7.8280556 -8.2680556 9.7019444 -10.7680556 4.0619444 8.2119444
43 44 45 46 47 48
-15.9380556 -6.8980556 12.7719444 11.9819444 11.7019444 2.8519444
49 50 51 52 53 54
-3.1580556 -5.8180556 11.2619444 -5.7480556 3.2719444 8.6919444
55 56 57 58 59 60
-2.4280556 2.5319444 9.5319444 17.5719444 12.4119444 0.6819444
> postscript(file="/var/www/html/rcomp/tmp/6y06k1227269073.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 -5.4358333 NA
1 -6.0358333 -5.4358333
2 3.1941667 -6.0358333
3 -3.6958333 3.1941667
4 -7.1758333 -3.6958333
5 -1.7058333 -7.1758333
6 -10.6458333 -1.7058333
7 -10.6058333 -10.6458333
8 10.3541667 -10.6058333
9 11.7541667 10.3541667
10 -1.3058333 11.7541667
11 7.7841667 -1.3058333
12 -9.1758333 7.7841667
13 -7.1958333 -9.1758333
14 14.5341667 -7.1958333
15 -3.7858333 14.5341667
16 -6.9958333 -3.7858333
17 10.5241667 -6.9958333
18 -11.9258333 10.5241667
19 -5.5258333 -11.9258333
20 13.9641667 -5.5258333
21 5.3941667 13.9641667
22 5.5341667 5.3941667
23 8.1741667 5.5341667
24 -9.7380556 8.1741667
25 -12.5280556 -9.7380556
26 4.1919444 -12.5280556
27 -8.1380556 4.1919444
28 -10.0980556 -8.1380556
29 1.8319444 -10.0980556
30 -22.2380556 1.8319444
31 -12.4080556 -22.2380556
32 10.9819444 -12.4080556
33 -3.2980556 10.9819444
34 2.4619444 -3.2980556
35 -1.4080556 2.4619444
36 -7.8280556 -1.4080556
37 -8.2680556 -7.8280556
38 9.7019444 -8.2680556
39 -10.7680556 9.7019444
40 4.0619444 -10.7680556
41 8.2119444 4.0619444
42 -15.9380556 8.2119444
43 -6.8980556 -15.9380556
44 12.7719444 -6.8980556
45 11.9819444 12.7719444
46 11.7019444 11.9819444
47 2.8519444 11.7019444
48 -3.1580556 2.8519444
49 -5.8180556 -3.1580556
50 11.2619444 -5.8180556
51 -5.7480556 11.2619444
52 3.2719444 -5.7480556
53 8.6919444 3.2719444
54 -2.4280556 8.6919444
55 2.5319444 -2.4280556
56 9.5319444 2.5319444
57 17.5719444 9.5319444
58 12.4119444 17.5719444
59 0.6819444 12.4119444
60 NA 0.6819444
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -6.0358333 -5.435833
[2,] 3.1941667 -6.035833
[3,] -3.6958333 3.194167
[4,] -7.1758333 -3.695833
[5,] -1.7058333 -7.175833
[6,] -10.6458333 -1.705833
[7,] -10.6058333 -10.645833
[8,] 10.3541667 -10.605833
[9,] 11.7541667 10.354167
[10,] -1.3058333 11.754167
[11,] 7.7841667 -1.305833
[12,] -9.1758333 7.784167
[13,] -7.1958333 -9.175833
[14,] 14.5341667 -7.195833
[15,] -3.7858333 14.534167
[16,] -6.9958333 -3.785833
[17,] 10.5241667 -6.995833
[18,] -11.9258333 10.524167
[19,] -5.5258333 -11.925833
[20,] 13.9641667 -5.525833
[21,] 5.3941667 13.964167
[22,] 5.5341667 5.394167
[23,] 8.1741667 5.534167
[24,] -9.7380556 8.174167
[25,] -12.5280556 -9.738056
[26,] 4.1919444 -12.528056
[27,] -8.1380556 4.191944
[28,] -10.0980556 -8.138056
[29,] 1.8319444 -10.098056
[30,] -22.2380556 1.831944
[31,] -12.4080556 -22.238056
[32,] 10.9819444 -12.408056
[33,] -3.2980556 10.981944
[34,] 2.4619444 -3.298056
[35,] -1.4080556 2.461944
[36,] -7.8280556 -1.408056
[37,] -8.2680556 -7.828056
[38,] 9.7019444 -8.268056
[39,] -10.7680556 9.701944
[40,] 4.0619444 -10.768056
[41,] 8.2119444 4.061944
[42,] -15.9380556 8.211944
[43,] -6.8980556 -15.938056
[44,] 12.7719444 -6.898056
[45,] 11.9819444 12.771944
[46,] 11.7019444 11.981944
[47,] 2.8519444 11.701944
[48,] -3.1580556 2.851944
[49,] -5.8180556 -3.158056
[50,] 11.2619444 -5.818056
[51,] -5.7480556 11.261944
[52,] 3.2719444 -5.748056
[53,] 8.6919444 3.271944
[54,] -2.4280556 8.691944
[55,] 2.5319444 -2.428056
[56,] 9.5319444 2.531944
[57,] 17.5719444 9.531944
[58,] 12.4119444 17.571944
[59,] 0.6819444 12.411944
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -6.0358333 -5.435833
2 3.1941667 -6.035833
3 -3.6958333 3.194167
4 -7.1758333 -3.695833
5 -1.7058333 -7.175833
6 -10.6458333 -1.705833
7 -10.6058333 -10.645833
8 10.3541667 -10.605833
9 11.7541667 10.354167
10 -1.3058333 11.754167
11 7.7841667 -1.305833
12 -9.1758333 7.784167
13 -7.1958333 -9.175833
14 14.5341667 -7.195833
15 -3.7858333 14.534167
16 -6.9958333 -3.785833
17 10.5241667 -6.995833
18 -11.9258333 10.524167
19 -5.5258333 -11.925833
20 13.9641667 -5.525833
21 5.3941667 13.964167
22 5.5341667 5.394167
23 8.1741667 5.534167
24 -9.7380556 8.174167
25 -12.5280556 -9.738056
26 4.1919444 -12.528056
27 -8.1380556 4.191944
28 -10.0980556 -8.138056
29 1.8319444 -10.098056
30 -22.2380556 1.831944
31 -12.4080556 -22.238056
32 10.9819444 -12.408056
33 -3.2980556 10.981944
34 2.4619444 -3.298056
35 -1.4080556 2.461944
36 -7.8280556 -1.408056
37 -8.2680556 -7.828056
38 9.7019444 -8.268056
39 -10.7680556 9.701944
40 4.0619444 -10.768056
41 8.2119444 4.061944
42 -15.9380556 8.211944
43 -6.8980556 -15.938056
44 12.7719444 -6.898056
45 11.9819444 12.771944
46 11.7019444 11.981944
47 2.8519444 11.701944
48 -3.1580556 2.851944
49 -5.8180556 -3.158056
50 11.2619444 -5.818056
51 -5.7480556 11.261944
52 3.2719444 -5.748056
53 8.6919444 3.271944
54 -2.4280556 8.691944
55 2.5319444 -2.428056
56 9.5319444 2.531944
57 17.5719444 9.531944
58 12.4119444 17.571944
59 0.6819444 12.411944
> 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/7v41j1227269073.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/8dclj1227269073.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/9szay1227269073.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/10tj5u1227269073.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/11injt1227269073.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/12iqlb1227269073.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/130ap11227269073.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/14mcwu1227269073.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/154gvp1227269073.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/165jot1227269073.tab")
+ }
>
> system("convert tmp/1ma1t1227269073.ps tmp/1ma1t1227269073.png")
> system("convert tmp/2rhhd1227269073.ps tmp/2rhhd1227269073.png")
> system("convert tmp/3spsp1227269073.ps tmp/3spsp1227269073.png")
> system("convert tmp/4huob1227269073.ps tmp/4huob1227269073.png")
> system("convert tmp/5zupx1227269073.ps tmp/5zupx1227269073.png")
> system("convert tmp/6y06k1227269073.ps tmp/6y06k1227269073.png")
> system("convert tmp/7v41j1227269073.ps tmp/7v41j1227269073.png")
> system("convert tmp/8dclj1227269073.ps tmp/8dclj1227269073.png")
> system("convert tmp/9szay1227269073.ps tmp/9szay1227269073.png")
> system("convert tmp/10tj5u1227269073.ps tmp/10tj5u1227269073.png")
>
>
> proc.time()
user system elapsed
2.487 1.566 2.958