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(25,0,23.6,0,22.3,0,21.8,0,20.8,0,19.7,0,18.3,0,17.4,0,17,0,18.1,0,23.9,0,25.6,0,25.3,0,23.6,0,21.9,0,21.4,0,20.6,0,20.5,0,20.2,0,20.6,0,19.7,0,19.3,0,22.8,0,23.5,0,23.8,0,22.6,0,22,0,21.7,0,20.7,0,20.2,0,19.1,0,19.5,0,18.7,0,18.6,0,22.2,0,23.2,0,23.5,0,21.3,0,20,0,18.7,0,18.9,0,18.3,0,18.4,0,19.9,0,19.2,0,18.5,0,20.9,1,20.5,1,19.4,1,18.1,1,17,1,17,1,17.3,1,16.7,1,15.5,1,15.3,1,13.7,1,14.1,1,17.3,1,18.1,1,18.1,1),dim=c(2,61),dimnames=list(c('werklozen','jobtonic'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('werklozen','jobtonic'),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
werklozen jobtonic
1 25.0 0
2 23.6 0
3 22.3 0
4 21.8 0
5 20.8 0
6 19.7 0
7 18.3 0
8 17.4 0
9 17.0 0
10 18.1 0
11 23.9 0
12 25.6 0
13 25.3 0
14 23.6 0
15 21.9 0
16 21.4 0
17 20.6 0
18 20.5 0
19 20.2 0
20 20.6 0
21 19.7 0
22 19.3 0
23 22.8 0
24 23.5 0
25 23.8 0
26 22.6 0
27 22.0 0
28 21.7 0
29 20.7 0
30 20.2 0
31 19.1 0
32 19.5 0
33 18.7 0
34 18.6 0
35 22.2 0
36 23.2 0
37 23.5 0
38 21.3 0
39 20.0 0
40 18.7 0
41 18.9 0
42 18.3 0
43 18.4 0
44 19.9 0
45 19.2 0
46 18.5 0
47 20.9 1
48 20.5 1
49 19.4 1
50 18.1 1
51 17.0 1
52 17.0 1
53 17.3 1
54 16.7 1
55 15.5 1
56 15.3 1
57 13.7 1
58 14.1 1
59 17.3 1
60 18.1 1
61 18.1 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) jobtonic
20.911 -3.644
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3.9109 -1.7667 -0.2667 1.3891 4.6891
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 20.9109 0.3214 65.070 < 2e-16 ***
jobtonic -3.6442 0.6481 -5.623 5.4e-07 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.18 on 59 degrees of freedom
Multiple R-squared: 0.3489, Adjusted R-squared: 0.3379
F-statistic: 31.62 on 1 and 59 DF, p-value: 5.403e-07
> 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.4807576 0.961515185 0.519242408
[2,] 0.5634579 0.873084111 0.436542055
[3,] 0.7326551 0.534689759 0.267344880
[4,] 0.8633193 0.273361345 0.136680672
[5,] 0.9313017 0.137396650 0.068698325
[6,] 0.9323280 0.135343993 0.067671997
[7,] 0.9519315 0.096136981 0.048068491
[8,] 0.9881900 0.023620098 0.011810049
[9,] 0.9965153 0.006969430 0.003484715
[10,] 0.9966660 0.006668062 0.003334031
[11,] 0.9943162 0.011367559 0.005683779
[12,] 0.9902291 0.019541783 0.009770891
[13,] 0.9841649 0.031670252 0.015835126
[14,] 0.9753661 0.049267834 0.024633917
[15,] 0.9640238 0.071952387 0.035976194
[16,] 0.9466338 0.106732346 0.053366173
[17,] 0.9310487 0.137902521 0.068951260
[18,] 0.9184921 0.163015811 0.081507906
[19,] 0.9095758 0.180848352 0.090424176
[20,] 0.9213452 0.157309589 0.078654795
[21,] 0.9433004 0.113399125 0.056699563
[22,] 0.9390739 0.121852110 0.060926055
[23,] 0.9262076 0.147584756 0.073792378
[24,] 0.9082751 0.183449848 0.091724924
[25,] 0.8784355 0.243128915 0.121564457
[26,] 0.8434234 0.313153134 0.156576567
[27,] 0.8232210 0.353558085 0.176779043
[28,] 0.7880031 0.423993774 0.211996887
[29,] 0.7761498 0.447700496 0.223850248
[30,] 0.7674334 0.465133261 0.232566630
[31,] 0.7484423 0.503115404 0.251557702
[32,] 0.8026150 0.394770020 0.197385010
[33,] 0.8948642 0.210271680 0.105135840
[34,] 0.8899964 0.220007127 0.110003563
[35,] 0.8620703 0.275859486 0.137929743
[36,] 0.8333577 0.333284696 0.166642348
[37,] 0.7947502 0.410499563 0.205249781
[38,] 0.7640374 0.471925118 0.235962559
[39,] 0.7259231 0.548153700 0.274076850
[40,] 0.6635229 0.672954259 0.336477130
[41,] 0.5954890 0.809021966 0.404510983
[42,] 0.5297641 0.940471837 0.470235919
[43,] 0.6571233 0.685753438 0.342876719
[44,] 0.7923162 0.415367573 0.207683786
[45,] 0.8504391 0.299121890 0.149560945
[46,] 0.8366752 0.326649613 0.163324806
[47,] 0.7776123 0.444775344 0.222387672
[48,] 0.6999305 0.600138983 0.300069492
[49,] 0.6204406 0.759118830 0.379559415
[50,] 0.5045130 0.990973919 0.495486959
[51,] 0.3830093 0.766018576 0.616990712
[52,] 0.2667721 0.533544248 0.733227876
> postscript(file="/var/www/html/rcomp/tmp/1vb2d1227472272.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/2dyzb1227472272.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/39tg01227472272.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/4v7gb1227472272.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/5yi7a1227472272.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
4.08913043 2.68913043 1.38913043 0.88913043 -0.11086957 -1.21086957
7 8 9 10 11 12
-2.61086957 -3.51086957 -3.91086957 -2.81086957 2.98913043 4.68913043
13 14 15 16 17 18
4.38913043 2.68913043 0.98913043 0.48913043 -0.31086957 -0.41086957
19 20 21 22 23 24
-0.71086957 -0.31086957 -1.21086957 -1.61086957 1.88913043 2.58913043
25 26 27 28 29 30
2.88913043 1.68913043 1.08913043 0.78913043 -0.21086957 -0.71086957
31 32 33 34 35 36
-1.81086957 -1.41086957 -2.21086957 -2.31086957 1.28913043 2.28913043
37 38 39 40 41 42
2.58913043 0.38913043 -0.91086957 -2.21086957 -2.01086957 -2.61086957
43 44 45 46 47 48
-2.51086957 -1.01086957 -1.71086957 -2.41086957 3.63333333 3.23333333
49 50 51 52 53 54
2.13333333 0.83333333 -0.26666667 -0.26666667 0.03333333 -0.56666667
55 56 57 58 59 60
-1.76666667 -1.96666667 -3.56666667 -3.16666667 0.03333333 0.83333333
61
0.83333333
> postscript(file="/var/www/html/rcomp/tmp/6j7gi1227472272.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 4.08913043 NA
1 2.68913043 4.08913043
2 1.38913043 2.68913043
3 0.88913043 1.38913043
4 -0.11086957 0.88913043
5 -1.21086957 -0.11086957
6 -2.61086957 -1.21086957
7 -3.51086957 -2.61086957
8 -3.91086957 -3.51086957
9 -2.81086957 -3.91086957
10 2.98913043 -2.81086957
11 4.68913043 2.98913043
12 4.38913043 4.68913043
13 2.68913043 4.38913043
14 0.98913043 2.68913043
15 0.48913043 0.98913043
16 -0.31086957 0.48913043
17 -0.41086957 -0.31086957
18 -0.71086957 -0.41086957
19 -0.31086957 -0.71086957
20 -1.21086957 -0.31086957
21 -1.61086957 -1.21086957
22 1.88913043 -1.61086957
23 2.58913043 1.88913043
24 2.88913043 2.58913043
25 1.68913043 2.88913043
26 1.08913043 1.68913043
27 0.78913043 1.08913043
28 -0.21086957 0.78913043
29 -0.71086957 -0.21086957
30 -1.81086957 -0.71086957
31 -1.41086957 -1.81086957
32 -2.21086957 -1.41086957
33 -2.31086957 -2.21086957
34 1.28913043 -2.31086957
35 2.28913043 1.28913043
36 2.58913043 2.28913043
37 0.38913043 2.58913043
38 -0.91086957 0.38913043
39 -2.21086957 -0.91086957
40 -2.01086957 -2.21086957
41 -2.61086957 -2.01086957
42 -2.51086957 -2.61086957
43 -1.01086957 -2.51086957
44 -1.71086957 -1.01086957
45 -2.41086957 -1.71086957
46 3.63333333 -2.41086957
47 3.23333333 3.63333333
48 2.13333333 3.23333333
49 0.83333333 2.13333333
50 -0.26666667 0.83333333
51 -0.26666667 -0.26666667
52 0.03333333 -0.26666667
53 -0.56666667 0.03333333
54 -1.76666667 -0.56666667
55 -1.96666667 -1.76666667
56 -3.56666667 -1.96666667
57 -3.16666667 -3.56666667
58 0.03333333 -3.16666667
59 0.83333333 0.03333333
60 0.83333333 0.83333333
61 NA 0.83333333
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2.68913043 4.08913043
[2,] 1.38913043 2.68913043
[3,] 0.88913043 1.38913043
[4,] -0.11086957 0.88913043
[5,] -1.21086957 -0.11086957
[6,] -2.61086957 -1.21086957
[7,] -3.51086957 -2.61086957
[8,] -3.91086957 -3.51086957
[9,] -2.81086957 -3.91086957
[10,] 2.98913043 -2.81086957
[11,] 4.68913043 2.98913043
[12,] 4.38913043 4.68913043
[13,] 2.68913043 4.38913043
[14,] 0.98913043 2.68913043
[15,] 0.48913043 0.98913043
[16,] -0.31086957 0.48913043
[17,] -0.41086957 -0.31086957
[18,] -0.71086957 -0.41086957
[19,] -0.31086957 -0.71086957
[20,] -1.21086957 -0.31086957
[21,] -1.61086957 -1.21086957
[22,] 1.88913043 -1.61086957
[23,] 2.58913043 1.88913043
[24,] 2.88913043 2.58913043
[25,] 1.68913043 2.88913043
[26,] 1.08913043 1.68913043
[27,] 0.78913043 1.08913043
[28,] -0.21086957 0.78913043
[29,] -0.71086957 -0.21086957
[30,] -1.81086957 -0.71086957
[31,] -1.41086957 -1.81086957
[32,] -2.21086957 -1.41086957
[33,] -2.31086957 -2.21086957
[34,] 1.28913043 -2.31086957
[35,] 2.28913043 1.28913043
[36,] 2.58913043 2.28913043
[37,] 0.38913043 2.58913043
[38,] -0.91086957 0.38913043
[39,] -2.21086957 -0.91086957
[40,] -2.01086957 -2.21086957
[41,] -2.61086957 -2.01086957
[42,] -2.51086957 -2.61086957
[43,] -1.01086957 -2.51086957
[44,] -1.71086957 -1.01086957
[45,] -2.41086957 -1.71086957
[46,] 3.63333333 -2.41086957
[47,] 3.23333333 3.63333333
[48,] 2.13333333 3.23333333
[49,] 0.83333333 2.13333333
[50,] -0.26666667 0.83333333
[51,] -0.26666667 -0.26666667
[52,] 0.03333333 -0.26666667
[53,] -0.56666667 0.03333333
[54,] -1.76666667 -0.56666667
[55,] -1.96666667 -1.76666667
[56,] -3.56666667 -1.96666667
[57,] -3.16666667 -3.56666667
[58,] 0.03333333 -3.16666667
[59,] 0.83333333 0.03333333
[60,] 0.83333333 0.83333333
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2.68913043 4.08913043
2 1.38913043 2.68913043
3 0.88913043 1.38913043
4 -0.11086957 0.88913043
5 -1.21086957 -0.11086957
6 -2.61086957 -1.21086957
7 -3.51086957 -2.61086957
8 -3.91086957 -3.51086957
9 -2.81086957 -3.91086957
10 2.98913043 -2.81086957
11 4.68913043 2.98913043
12 4.38913043 4.68913043
13 2.68913043 4.38913043
14 0.98913043 2.68913043
15 0.48913043 0.98913043
16 -0.31086957 0.48913043
17 -0.41086957 -0.31086957
18 -0.71086957 -0.41086957
19 -0.31086957 -0.71086957
20 -1.21086957 -0.31086957
21 -1.61086957 -1.21086957
22 1.88913043 -1.61086957
23 2.58913043 1.88913043
24 2.88913043 2.58913043
25 1.68913043 2.88913043
26 1.08913043 1.68913043
27 0.78913043 1.08913043
28 -0.21086957 0.78913043
29 -0.71086957 -0.21086957
30 -1.81086957 -0.71086957
31 -1.41086957 -1.81086957
32 -2.21086957 -1.41086957
33 -2.31086957 -2.21086957
34 1.28913043 -2.31086957
35 2.28913043 1.28913043
36 2.58913043 2.28913043
37 0.38913043 2.58913043
38 -0.91086957 0.38913043
39 -2.21086957 -0.91086957
40 -2.01086957 -2.21086957
41 -2.61086957 -2.01086957
42 -2.51086957 -2.61086957
43 -1.01086957 -2.51086957
44 -1.71086957 -1.01086957
45 -2.41086957 -1.71086957
46 3.63333333 -2.41086957
47 3.23333333 3.63333333
48 2.13333333 3.23333333
49 0.83333333 2.13333333
50 -0.26666667 0.83333333
51 -0.26666667 -0.26666667
52 0.03333333 -0.26666667
53 -0.56666667 0.03333333
54 -1.76666667 -0.56666667
55 -1.96666667 -1.76666667
56 -3.56666667 -1.96666667
57 -3.16666667 -3.56666667
58 0.03333333 -3.16666667
59 0.83333333 0.03333333
60 0.83333333 0.83333333
> 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/7k9dg1227472272.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/8hkqa1227472272.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/9ybq71227472272.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/10ps0z1227472272.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/11t7e71227472272.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/12am5q1227472272.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/131dk31227472272.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/142zuo1227472272.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/15myp21227472272.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/16bfuh1227472272.tab")
+ }
>
> system("convert tmp/1vb2d1227472272.ps tmp/1vb2d1227472272.png")
> system("convert tmp/2dyzb1227472272.ps tmp/2dyzb1227472272.png")
> system("convert tmp/39tg01227472272.ps tmp/39tg01227472272.png")
> system("convert tmp/4v7gb1227472272.ps tmp/4v7gb1227472272.png")
> system("convert tmp/5yi7a1227472272.ps tmp/5yi7a1227472272.png")
> system("convert tmp/6j7gi1227472272.ps tmp/6j7gi1227472272.png")
> system("convert tmp/7k9dg1227472272.ps tmp/7k9dg1227472272.png")
> system("convert tmp/8hkqa1227472272.ps tmp/8hkqa1227472272.png")
> system("convert tmp/9ybq71227472272.ps tmp/9ybq71227472272.png")
> system("convert tmp/10ps0z1227472272.ps tmp/10ps0z1227472272.png")
>
>
> proc.time()
user system elapsed
2.412 1.541 2.915