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(25.6,7.4,1.8,23.7,7.1,2.7,22,6.8,2.3,21.3,6.9,1.9,20.7,7.2,2,20.4,7.4,2.3,20.3,7.3,2.8,20.4,6.9,2.4,19.8,6.9,2.3,19.5,6.8,2.7,23.1,7.1,2.7,23.5,7.2,2.9,23.5,7.1,3,22.9,7,2.2,21.9,6.9,2.3,21.5,7.1,2.8,20.5,7.3,2.8,20.2,7.5,2.8,19.4,7.5,2.2,19.2,7.5,2.6,18.8,7.3,2.8,18.8,7,2.5,22.6,6.7,2.4,23.3,6.5,2.3,23,6.5,1.9,21.4,6.5,1.7,19.9,6.6,2,18.8,6.8,2.1,18.6,6.9,1.7,18.4,6.9,1.8,18.6,6.8,1.8,19.9,6.8,1.8,19.2,6.5,1.3,18.4,6.1,1.3,21.1,6.1,1.3,20.5,5.9,1.2,19.1,5.7,1.4,18.1,5.9,2.2,17,5.9,2.9,17.1,6.1,3.1,17.4,6.3,3.5,16.8,6.2,3.6,15.3,5.9,4.4,14.3,5.7,4.1,13.4,5.4,5.1,15.3,5.6,5.8,22.1,6.2,5.9,23.7,6.3,5.4,22.2,6,5.5,19.5,5.6,4.8,16.6,5.5,3.2,17.3,5.9,2.7,19.8,6.5,2.1,21.2,6.8,1.9,21.5,6.8,0.6,20.6,6.5,0.7,19.1,6.2,-0.2,19.6,6.2,-1,23.5,6.5,-1.7,24,6.7,-0.7),dim=c(3,60),dimnames=list(c('W<25j','W>25j','Inflatie'),1:60))
> y <- array(NA,dim=c(3,60),dimnames=list(c('W<25j','W>25j','Inflatie'),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
W<25j W>25j Inflatie
1 25.6 7.4 1.8
2 23.7 7.1 2.7
3 22.0 6.8 2.3
4 21.3 6.9 1.9
5 20.7 7.2 2.0
6 20.4 7.4 2.3
7 20.3 7.3 2.8
8 20.4 6.9 2.4
9 19.8 6.9 2.3
10 19.5 6.8 2.7
11 23.1 7.1 2.7
12 23.5 7.2 2.9
13 23.5 7.1 3.0
14 22.9 7.0 2.2
15 21.9 6.9 2.3
16 21.5 7.1 2.8
17 20.5 7.3 2.8
18 20.2 7.5 2.8
19 19.4 7.5 2.2
20 19.2 7.5 2.6
21 18.8 7.3 2.8
22 18.8 7.0 2.5
23 22.6 6.7 2.4
24 23.3 6.5 2.3
25 23.0 6.5 1.9
26 21.4 6.5 1.7
27 19.9 6.6 2.0
28 18.8 6.8 2.1
29 18.6 6.9 1.7
30 18.4 6.9 1.8
31 18.6 6.8 1.8
32 19.9 6.8 1.8
33 19.2 6.5 1.3
34 18.4 6.1 1.3
35 21.1 6.1 1.3
36 20.5 5.9 1.2
37 19.1 5.7 1.4
38 18.1 5.9 2.2
39 17.0 5.9 2.9
40 17.1 6.1 3.1
41 17.4 6.3 3.5
42 16.8 6.2 3.6
43 15.3 5.9 4.4
44 14.3 5.7 4.1
45 13.4 5.4 5.1
46 15.3 5.6 5.8
47 22.1 6.2 5.9
48 23.7 6.3 5.4
49 22.2 6.0 5.5
50 19.5 5.6 4.8
51 16.6 5.5 3.2
52 17.3 5.9 2.7
53 19.8 6.5 2.1
54 21.2 6.8 1.9
55 21.5 6.8 0.6
56 20.6 6.5 0.7
57 19.1 6.2 -0.2
58 19.6 6.2 -1.0
59 23.5 6.5 -1.7
60 24.0 6.7 -0.7
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `W>25j` Inflatie
6.4821 2.1763 -0.3027
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3.346 -1.640 -0.617 1.764 5.142
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.4821 3.5365 1.833 0.072 .
`W>25j` 2.1763 0.5124 4.248 8.07e-05 ***
Inflatie -0.3027 0.1955 -1.549 0.127
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.145 on 57 degrees of freedom
Multiple R-squared: 0.3092, Adjusted R-squared: 0.285
F-statistic: 12.76 on 2 and 57 DF, p-value: 2.639e-05
> 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.7385685 0.52286305 0.26143152
[2,] 0.6478085 0.70438304 0.35219152
[3,] 0.5295810 0.94083801 0.47041900
[4,] 0.4486381 0.89727619 0.55136191
[5,] 0.3363092 0.67261850 0.66369075
[6,] 0.3369642 0.67392850 0.66303575
[7,] 0.3243978 0.64879560 0.67560220
[8,] 0.3093553 0.61871053 0.69064474
[9,] 0.2698246 0.53964924 0.73017538
[10,] 0.2051302 0.41026041 0.79486980
[11,] 0.1485955 0.29719090 0.85140455
[12,] 0.1354921 0.27098417 0.86450792
[13,] 0.1329305 0.26586091 0.86706954
[14,] 0.1574129 0.31482575 0.84258712
[15,] 0.1658483 0.33169651 0.83415175
[16,] 0.1897158 0.37943162 0.81028419
[17,] 0.2235132 0.44702646 0.77648677
[18,] 0.1867699 0.37353974 0.81323013
[19,] 0.1839348 0.36786958 0.81606521
[20,] 0.1685692 0.33713831 0.83143085
[21,] 0.1416796 0.28335924 0.85832038
[22,] 0.1318903 0.26378057 0.86810972
[23,] 0.1542824 0.30856483 0.84571759
[24,] 0.1863280 0.37265608 0.81367196
[25,] 0.2372802 0.47456046 0.76271977
[26,] 0.2803329 0.56066580 0.71966710
[27,] 0.2585332 0.51706633 0.74146683
[28,] 0.2306835 0.46136697 0.76931651
[29,] 0.2015358 0.40307156 0.79846422
[30,] 0.1777808 0.35556165 0.82221918
[31,] 0.1668194 0.33363873 0.83318063
[32,] 0.1695132 0.33902642 0.83048679
[33,] 0.1621411 0.32428223 0.83785889
[34,] 0.1677007 0.33540131 0.83229935
[35,] 0.1651795 0.33035907 0.83482046
[36,] 0.1856679 0.37133575 0.81433212
[37,] 0.2240020 0.44800399 0.77599800
[38,] 0.2707009 0.54140178 0.72929911
[39,] 0.3379290 0.67585807 0.66207096
[40,] 0.4076685 0.81533705 0.59233148
[41,] 0.5405201 0.91895975 0.45947988
[42,] 0.6129354 0.77412926 0.38706463
[43,] 0.7382836 0.52343279 0.26171639
[44,] 0.8806113 0.23877733 0.11938866
[45,] 0.9784743 0.04305138 0.02152569
[46,] 0.9790689 0.04186224 0.02093112
[47,] 0.9861592 0.02768151 0.01384076
[48,] 0.9813140 0.03737194 0.01868597
[49,] 0.9471284 0.10574320 0.05287160
> postscript(file="/var/www/html/rcomp/tmp/1tyy31261049123.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/2z7fx1261049123.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/3o8yv1261049123.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/4ejxp1261049123.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/5x3mh1261049123.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 7
3.5581597 2.5834385 1.4152617 0.3765696 -0.8460511 -1.4905112 -1.2215533
8 9 10 11 12 13 14
-0.3721013 -1.0023671 -0.9636750 1.9834385 2.2263413 2.4742359 1.8497382
15 16 17 18 19 20 21
1.0976329 0.4137043 -1.0215533 -1.7568110 -2.7384059 -2.8173426 -2.7215533
22 23 24 25 26 27 28
-2.1594643 2.2631563 3.3681481 2.9470849 1.2865532 -0.3402781 -1.8452700
29 30 31 32 33 34 35
-2.3839620 -2.5536962 -2.1360674 -0.8360674 -1.0345100 -0.9639947 1.7360053
36 37 38 39 40 41 42
1.5409971 0.6367864 -0.5563447 -1.4444840 -1.7192100 -1.7334044 -2.0855098
43 44 45 46 47 48 49
-2.6904967 -3.3460366 -3.2904919 -1.6138888 3.9106041 5.1416462 4.3247984
50 51 52 53 54 55 56
2.2834530 -0.8831713 -1.2050156 -0.1923835 0.4941984 0.4007428 0.1838951
57 58 59 60
-0.9356108 -0.6777374 2.3575154 2.7249160
> postscript(file="/var/www/html/rcomp/tmp/6dtnh1261049123.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 3.5581597 NA
1 2.5834385 3.5581597
2 1.4152617 2.5834385
3 0.3765696 1.4152617
4 -0.8460511 0.3765696
5 -1.4905112 -0.8460511
6 -1.2215533 -1.4905112
7 -0.3721013 -1.2215533
8 -1.0023671 -0.3721013
9 -0.9636750 -1.0023671
10 1.9834385 -0.9636750
11 2.2263413 1.9834385
12 2.4742359 2.2263413
13 1.8497382 2.4742359
14 1.0976329 1.8497382
15 0.4137043 1.0976329
16 -1.0215533 0.4137043
17 -1.7568110 -1.0215533
18 -2.7384059 -1.7568110
19 -2.8173426 -2.7384059
20 -2.7215533 -2.8173426
21 -2.1594643 -2.7215533
22 2.2631563 -2.1594643
23 3.3681481 2.2631563
24 2.9470849 3.3681481
25 1.2865532 2.9470849
26 -0.3402781 1.2865532
27 -1.8452700 -0.3402781
28 -2.3839620 -1.8452700
29 -2.5536962 -2.3839620
30 -2.1360674 -2.5536962
31 -0.8360674 -2.1360674
32 -1.0345100 -0.8360674
33 -0.9639947 -1.0345100
34 1.7360053 -0.9639947
35 1.5409971 1.7360053
36 0.6367864 1.5409971
37 -0.5563447 0.6367864
38 -1.4444840 -0.5563447
39 -1.7192100 -1.4444840
40 -1.7334044 -1.7192100
41 -2.0855098 -1.7334044
42 -2.6904967 -2.0855098
43 -3.3460366 -2.6904967
44 -3.2904919 -3.3460366
45 -1.6138888 -3.2904919
46 3.9106041 -1.6138888
47 5.1416462 3.9106041
48 4.3247984 5.1416462
49 2.2834530 4.3247984
50 -0.8831713 2.2834530
51 -1.2050156 -0.8831713
52 -0.1923835 -1.2050156
53 0.4941984 -0.1923835
54 0.4007428 0.4941984
55 0.1838951 0.4007428
56 -0.9356108 0.1838951
57 -0.6777374 -0.9356108
58 2.3575154 -0.6777374
59 2.7249160 2.3575154
60 NA 2.7249160
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2.5834385 3.5581597
[2,] 1.4152617 2.5834385
[3,] 0.3765696 1.4152617
[4,] -0.8460511 0.3765696
[5,] -1.4905112 -0.8460511
[6,] -1.2215533 -1.4905112
[7,] -0.3721013 -1.2215533
[8,] -1.0023671 -0.3721013
[9,] -0.9636750 -1.0023671
[10,] 1.9834385 -0.9636750
[11,] 2.2263413 1.9834385
[12,] 2.4742359 2.2263413
[13,] 1.8497382 2.4742359
[14,] 1.0976329 1.8497382
[15,] 0.4137043 1.0976329
[16,] -1.0215533 0.4137043
[17,] -1.7568110 -1.0215533
[18,] -2.7384059 -1.7568110
[19,] -2.8173426 -2.7384059
[20,] -2.7215533 -2.8173426
[21,] -2.1594643 -2.7215533
[22,] 2.2631563 -2.1594643
[23,] 3.3681481 2.2631563
[24,] 2.9470849 3.3681481
[25,] 1.2865532 2.9470849
[26,] -0.3402781 1.2865532
[27,] -1.8452700 -0.3402781
[28,] -2.3839620 -1.8452700
[29,] -2.5536962 -2.3839620
[30,] -2.1360674 -2.5536962
[31,] -0.8360674 -2.1360674
[32,] -1.0345100 -0.8360674
[33,] -0.9639947 -1.0345100
[34,] 1.7360053 -0.9639947
[35,] 1.5409971 1.7360053
[36,] 0.6367864 1.5409971
[37,] -0.5563447 0.6367864
[38,] -1.4444840 -0.5563447
[39,] -1.7192100 -1.4444840
[40,] -1.7334044 -1.7192100
[41,] -2.0855098 -1.7334044
[42,] -2.6904967 -2.0855098
[43,] -3.3460366 -2.6904967
[44,] -3.2904919 -3.3460366
[45,] -1.6138888 -3.2904919
[46,] 3.9106041 -1.6138888
[47,] 5.1416462 3.9106041
[48,] 4.3247984 5.1416462
[49,] 2.2834530 4.3247984
[50,] -0.8831713 2.2834530
[51,] -1.2050156 -0.8831713
[52,] -0.1923835 -1.2050156
[53,] 0.4941984 -0.1923835
[54,] 0.4007428 0.4941984
[55,] 0.1838951 0.4007428
[56,] -0.9356108 0.1838951
[57,] -0.6777374 -0.9356108
[58,] 2.3575154 -0.6777374
[59,] 2.7249160 2.3575154
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2.5834385 3.5581597
2 1.4152617 2.5834385
3 0.3765696 1.4152617
4 -0.8460511 0.3765696
5 -1.4905112 -0.8460511
6 -1.2215533 -1.4905112
7 -0.3721013 -1.2215533
8 -1.0023671 -0.3721013
9 -0.9636750 -1.0023671
10 1.9834385 -0.9636750
11 2.2263413 1.9834385
12 2.4742359 2.2263413
13 1.8497382 2.4742359
14 1.0976329 1.8497382
15 0.4137043 1.0976329
16 -1.0215533 0.4137043
17 -1.7568110 -1.0215533
18 -2.7384059 -1.7568110
19 -2.8173426 -2.7384059
20 -2.7215533 -2.8173426
21 -2.1594643 -2.7215533
22 2.2631563 -2.1594643
23 3.3681481 2.2631563
24 2.9470849 3.3681481
25 1.2865532 2.9470849
26 -0.3402781 1.2865532
27 -1.8452700 -0.3402781
28 -2.3839620 -1.8452700
29 -2.5536962 -2.3839620
30 -2.1360674 -2.5536962
31 -0.8360674 -2.1360674
32 -1.0345100 -0.8360674
33 -0.9639947 -1.0345100
34 1.7360053 -0.9639947
35 1.5409971 1.7360053
36 0.6367864 1.5409971
37 -0.5563447 0.6367864
38 -1.4444840 -0.5563447
39 -1.7192100 -1.4444840
40 -1.7334044 -1.7192100
41 -2.0855098 -1.7334044
42 -2.6904967 -2.0855098
43 -3.3460366 -2.6904967
44 -3.2904919 -3.3460366
45 -1.6138888 -3.2904919
46 3.9106041 -1.6138888
47 5.1416462 3.9106041
48 4.3247984 5.1416462
49 2.2834530 4.3247984
50 -0.8831713 2.2834530
51 -1.2050156 -0.8831713
52 -0.1923835 -1.2050156
53 0.4941984 -0.1923835
54 0.4007428 0.4941984
55 0.1838951 0.4007428
56 -0.9356108 0.1838951
57 -0.6777374 -0.9356108
58 2.3575154 -0.6777374
59 2.7249160 2.3575154
> 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/78vys1261049123.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/8izdt1261049123.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/9jeby1261049123.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/10paul1261049123.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/114gbm1261049123.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/12xx7n1261049123.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/13pk5b1261049123.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/14wt1b1261049123.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/15gfn51261049123.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/16v5471261049123.tab")
+ }
>
> try(system("convert tmp/1tyy31261049123.ps tmp/1tyy31261049123.png",intern=TRUE))
character(0)
> try(system("convert tmp/2z7fx1261049123.ps tmp/2z7fx1261049123.png",intern=TRUE))
character(0)
> try(system("convert tmp/3o8yv1261049123.ps tmp/3o8yv1261049123.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ejxp1261049123.ps tmp/4ejxp1261049123.png",intern=TRUE))
character(0)
> try(system("convert tmp/5x3mh1261049123.ps tmp/5x3mh1261049123.png",intern=TRUE))
character(0)
> try(system("convert tmp/6dtnh1261049123.ps tmp/6dtnh1261049123.png",intern=TRUE))
character(0)
> try(system("convert tmp/78vys1261049123.ps tmp/78vys1261049123.png",intern=TRUE))
character(0)
> try(system("convert tmp/8izdt1261049123.ps tmp/8izdt1261049123.png",intern=TRUE))
character(0)
> try(system("convert tmp/9jeby1261049123.ps tmp/9jeby1261049123.png",intern=TRUE))
character(0)
> try(system("convert tmp/10paul1261049123.ps tmp/10paul1261049123.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.448 1.572 3.498