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(8.9,95.05,8.8,96.84,8.3,96.92,7.5,97.44,7.2,97.78,7.4,97.69,8.8,96.67,9.3,98.29,9.3,98.2,8.7,98.71,8.2,98.54,8.3,98.2,8.5,96.92,8.6,99.06,8.5,99.65,8.2,99.82,8.1,99.99,7.9,100.33,8.6,99.31,8.7,101.1,8.7,101.1,8.5,100.93,8.4,100.85,8.5,100.93,8.7,99.6,8.7,101.88,8.6,101.81,8.5,102.38,8.3,102.74,8,102.82,8.2,101.72,8.1,103.47,8.1,102.98,8,102.68,7.9,102.9,7.9,103.03,8,101.29,8,103.69,7.9,103.68,8,104.2,7.7,104.08,7.2,104.16,7.5,103.05,7.3,104.66,7,104.46,7,104.95,7,105.85,7.2,106.23,7.3,104.86,7.1,107.44,6.8,108.23,6.4,108.45,6.1,109.39,6.5,110.15,7.7,109.13,7.9,110.28,7.5,110.17,6.9,109.99,6.6,109.26,6.9,109.11),dim=c(2,60),dimnames=list(c('Werkloosheidsgraad','Consumptiepris'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Werkloosheidsgraad','Consumptiepris'),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
Werkloosheidsgraad Consumptiepris
1 8.9 95.05
2 8.8 96.84
3 8.3 96.92
4 7.5 97.44
5 7.2 97.78
6 7.4 97.69
7 8.8 96.67
8 9.3 98.29
9 9.3 98.20
10 8.7 98.71
11 8.2 98.54
12 8.3 98.20
13 8.5 96.92
14 8.6 99.06
15 8.5 99.65
16 8.2 99.82
17 8.1 99.99
18 7.9 100.33
19 8.6 99.31
20 8.7 101.10
21 8.7 101.10
22 8.5 100.93
23 8.4 100.85
24 8.5 100.93
25 8.7 99.60
26 8.7 101.88
27 8.6 101.81
28 8.5 102.38
29 8.3 102.74
30 8.0 102.82
31 8.2 101.72
32 8.1 103.47
33 8.1 102.98
34 8.0 102.68
35 7.9 102.90
36 7.9 103.03
37 8.0 101.29
38 8.0 103.69
39 7.9 103.68
40 8.0 104.20
41 7.7 104.08
42 7.2 104.16
43 7.5 103.05
44 7.3 104.66
45 7.0 104.46
46 7.0 104.95
47 7.0 105.85
48 7.2 106.23
49 7.3 104.86
50 7.1 107.44
51 6.8 108.23
52 6.4 108.45
53 6.1 109.39
54 6.5 110.15
55 7.7 109.13
56 7.9 110.28
57 7.5 110.17
58 6.9 109.99
59 6.6 109.26
60 6.9 109.11
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Consumptiepris
21.8543 -0.1360
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.35994 -0.31606 0.04502 0.31312 1.03958
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 21.85426 1.64605 13.28 < 2e-16 ***
Consumptiepris -0.13596 0.01603 -8.48 9.66e-12 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.5009 on 58 degrees of freedom
Multiple R-squared: 0.5535, Adjusted R-squared: 0.5458
F-statistic: 71.91 on 1 and 58 DF, p-value: 9.66e-12
> 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.7124045 0.575191032 0.2875955159
[2,] 0.6764026 0.647194740 0.3235973698
[3,] 0.7199120 0.560175968 0.2800879838
[4,] 0.9967736 0.006452769 0.0032263844
[5,] 0.9994191 0.001161745 0.0005808724
[6,] 0.9989703 0.002059321 0.0010296603
[7,] 0.9981608 0.003678456 0.0018392280
[8,] 0.9967674 0.006465193 0.0032325967
[9,] 0.9948038 0.010392339 0.0051961693
[10,] 0.9912703 0.017459371 0.0087296857
[11,] 0.9850139 0.029972159 0.0149860793
[12,] 0.9770111 0.045977838 0.0229889192
[13,] 0.9680455 0.063908923 0.0319544616
[14,] 0.9638216 0.072356872 0.0361784362
[15,] 0.9493786 0.101242858 0.0506214292
[16,] 0.9429770 0.114045925 0.0570229625
[17,] 0.9326865 0.134627006 0.0673135030
[18,] 0.9062481 0.187503890 0.0937519452
[19,] 0.8696707 0.260658558 0.1303292792
[20,] 0.8292455 0.341509027 0.1707545134
[21,] 0.7902002 0.419599585 0.2097997923
[22,] 0.7864425 0.427114999 0.2135574997
[23,] 0.7696005 0.460798919 0.2303994593
[24,] 0.7568954 0.486209271 0.2431046356
[25,] 0.7328376 0.534324899 0.2671624495
[26,] 0.7007599 0.598480108 0.2992400538
[27,] 0.6507225 0.698554933 0.3492774665
[28,] 0.6230726 0.753854745 0.3769273723
[29,] 0.5883573 0.823285322 0.4116426612
[30,] 0.5447990 0.910402006 0.4552010032
[31,] 0.5013539 0.997292181 0.4986460907
[32,] 0.4580014 0.916002818 0.5419985910
[33,] 0.4054263 0.810852538 0.5945737311
[34,] 0.3942715 0.788543081 0.6057284595
[35,] 0.3812701 0.762540223 0.6187298885
[36,] 0.4266178 0.853235512 0.5733822441
[37,] 0.4270732 0.854146435 0.5729267826
[38,] 0.4293442 0.858688451 0.5706557744
[39,] 0.4092247 0.818449366 0.5907753168
[40,] 0.3774426 0.754885137 0.6225574317
[41,] 0.3629550 0.725909921 0.6370450394
[42,] 0.3262388 0.652477676 0.6737611620
[43,] 0.2711148 0.542229519 0.7288852406
[44,] 0.2079904 0.415980747 0.7920096263
[45,] 0.1963713 0.392742651 0.8036286747
[46,] 0.1892608 0.378521674 0.8107391630
[47,] 0.1443259 0.288651796 0.8556741022
[48,] 0.1038492 0.207698413 0.8961507934
[49,] 0.2020328 0.404065521 0.7979672394
[50,] 0.3306417 0.661283315 0.6693583424
[51,] 0.6516805 0.696639039 0.3483195193
> postscript(file="/var/www/html/rcomp/tmp/11s9f1258552978.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/2xhdy1258552978.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/3mk7b1258552978.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/4bdhr1258552978.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/5ik6m1258552978.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
-0.0311141851 0.1122569655 -0.3768661115 -1.1061661125 -1.3599391900
6 7 8 9 10
-1.1721757283 0.0891435043 0.8094011937 0.7971646554 0.2665050391
11 12 13 14 15
-0.2566084222 -0.2028353446 -0.1768661115 0.2140915769 0.1943088835
16 17 18 19 20
-0.0825776553 -0.1594641940 -0.3132372716 0.2480819611 0.5914531117
21 22 23 24 25
0.5914531117 0.3683396504 0.2574627275 0.3683396504 0.3875108067
26 27 28 29 30
0.6975031103 0.5879858027 0.5654838786 0.4144300318 0.1253069547
31 32 33 34 35
0.1757492644 0.3136819535 0.2470608006 0.1062723396 0.0361838776
36 37 38 39 40
0.0538588774 -0.0827141964 0.2435934916 0.1422338762 0.3129338753
41 42 43 44 45
-0.0033815091 -0.4925045862 -0.3434218919 -0.3245238179 -0.6517161252
46 47 48 49 50
-0.5850949722 -0.4627295892 -0.2110642053 -0.2973315105 -0.1465507460
51 52 53 54 55
-0.3391411320 -0.7092295940 -0.8814257495 -0.3780949816 0.6832242510
56 57 58 59 60
1.0395800181 0.6246242491 0.0001511725 -0.3991007493 -0.1194949798
> postscript(file="/var/www/html/rcomp/tmp/63woo1258552978.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 -0.0311141851 NA
1 0.1122569655 -0.0311141851
2 -0.3768661115 0.1122569655
3 -1.1061661125 -0.3768661115
4 -1.3599391900 -1.1061661125
5 -1.1721757283 -1.3599391900
6 0.0891435043 -1.1721757283
7 0.8094011937 0.0891435043
8 0.7971646554 0.8094011937
9 0.2665050391 0.7971646554
10 -0.2566084222 0.2665050391
11 -0.2028353446 -0.2566084222
12 -0.1768661115 -0.2028353446
13 0.2140915769 -0.1768661115
14 0.1943088835 0.2140915769
15 -0.0825776553 0.1943088835
16 -0.1594641940 -0.0825776553
17 -0.3132372716 -0.1594641940
18 0.2480819611 -0.3132372716
19 0.5914531117 0.2480819611
20 0.5914531117 0.5914531117
21 0.3683396504 0.5914531117
22 0.2574627275 0.3683396504
23 0.3683396504 0.2574627275
24 0.3875108067 0.3683396504
25 0.6975031103 0.3875108067
26 0.5879858027 0.6975031103
27 0.5654838786 0.5879858027
28 0.4144300318 0.5654838786
29 0.1253069547 0.4144300318
30 0.1757492644 0.1253069547
31 0.3136819535 0.1757492644
32 0.2470608006 0.3136819535
33 0.1062723396 0.2470608006
34 0.0361838776 0.1062723396
35 0.0538588774 0.0361838776
36 -0.0827141964 0.0538588774
37 0.2435934916 -0.0827141964
38 0.1422338762 0.2435934916
39 0.3129338753 0.1422338762
40 -0.0033815091 0.3129338753
41 -0.4925045862 -0.0033815091
42 -0.3434218919 -0.4925045862
43 -0.3245238179 -0.3434218919
44 -0.6517161252 -0.3245238179
45 -0.5850949722 -0.6517161252
46 -0.4627295892 -0.5850949722
47 -0.2110642053 -0.4627295892
48 -0.2973315105 -0.2110642053
49 -0.1465507460 -0.2973315105
50 -0.3391411320 -0.1465507460
51 -0.7092295940 -0.3391411320
52 -0.8814257495 -0.7092295940
53 -0.3780949816 -0.8814257495
54 0.6832242510 -0.3780949816
55 1.0395800181 0.6832242510
56 0.6246242491 1.0395800181
57 0.0001511725 0.6246242491
58 -0.3991007493 0.0001511725
59 -0.1194949798 -0.3991007493
60 NA -0.1194949798
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.1122569655 -0.0311141851
[2,] -0.3768661115 0.1122569655
[3,] -1.1061661125 -0.3768661115
[4,] -1.3599391900 -1.1061661125
[5,] -1.1721757283 -1.3599391900
[6,] 0.0891435043 -1.1721757283
[7,] 0.8094011937 0.0891435043
[8,] 0.7971646554 0.8094011937
[9,] 0.2665050391 0.7971646554
[10,] -0.2566084222 0.2665050391
[11,] -0.2028353446 -0.2566084222
[12,] -0.1768661115 -0.2028353446
[13,] 0.2140915769 -0.1768661115
[14,] 0.1943088835 0.2140915769
[15,] -0.0825776553 0.1943088835
[16,] -0.1594641940 -0.0825776553
[17,] -0.3132372716 -0.1594641940
[18,] 0.2480819611 -0.3132372716
[19,] 0.5914531117 0.2480819611
[20,] 0.5914531117 0.5914531117
[21,] 0.3683396504 0.5914531117
[22,] 0.2574627275 0.3683396504
[23,] 0.3683396504 0.2574627275
[24,] 0.3875108067 0.3683396504
[25,] 0.6975031103 0.3875108067
[26,] 0.5879858027 0.6975031103
[27,] 0.5654838786 0.5879858027
[28,] 0.4144300318 0.5654838786
[29,] 0.1253069547 0.4144300318
[30,] 0.1757492644 0.1253069547
[31,] 0.3136819535 0.1757492644
[32,] 0.2470608006 0.3136819535
[33,] 0.1062723396 0.2470608006
[34,] 0.0361838776 0.1062723396
[35,] 0.0538588774 0.0361838776
[36,] -0.0827141964 0.0538588774
[37,] 0.2435934916 -0.0827141964
[38,] 0.1422338762 0.2435934916
[39,] 0.3129338753 0.1422338762
[40,] -0.0033815091 0.3129338753
[41,] -0.4925045862 -0.0033815091
[42,] -0.3434218919 -0.4925045862
[43,] -0.3245238179 -0.3434218919
[44,] -0.6517161252 -0.3245238179
[45,] -0.5850949722 -0.6517161252
[46,] -0.4627295892 -0.5850949722
[47,] -0.2110642053 -0.4627295892
[48,] -0.2973315105 -0.2110642053
[49,] -0.1465507460 -0.2973315105
[50,] -0.3391411320 -0.1465507460
[51,] -0.7092295940 -0.3391411320
[52,] -0.8814257495 -0.7092295940
[53,] -0.3780949816 -0.8814257495
[54,] 0.6832242510 -0.3780949816
[55,] 1.0395800181 0.6832242510
[56,] 0.6246242491 1.0395800181
[57,] 0.0001511725 0.6246242491
[58,] -0.3991007493 0.0001511725
[59,] -0.1194949798 -0.3991007493
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.1122569655 -0.0311141851
2 -0.3768661115 0.1122569655
3 -1.1061661125 -0.3768661115
4 -1.3599391900 -1.1061661125
5 -1.1721757283 -1.3599391900
6 0.0891435043 -1.1721757283
7 0.8094011937 0.0891435043
8 0.7971646554 0.8094011937
9 0.2665050391 0.7971646554
10 -0.2566084222 0.2665050391
11 -0.2028353446 -0.2566084222
12 -0.1768661115 -0.2028353446
13 0.2140915769 -0.1768661115
14 0.1943088835 0.2140915769
15 -0.0825776553 0.1943088835
16 -0.1594641940 -0.0825776553
17 -0.3132372716 -0.1594641940
18 0.2480819611 -0.3132372716
19 0.5914531117 0.2480819611
20 0.5914531117 0.5914531117
21 0.3683396504 0.5914531117
22 0.2574627275 0.3683396504
23 0.3683396504 0.2574627275
24 0.3875108067 0.3683396504
25 0.6975031103 0.3875108067
26 0.5879858027 0.6975031103
27 0.5654838786 0.5879858027
28 0.4144300318 0.5654838786
29 0.1253069547 0.4144300318
30 0.1757492644 0.1253069547
31 0.3136819535 0.1757492644
32 0.2470608006 0.3136819535
33 0.1062723396 0.2470608006
34 0.0361838776 0.1062723396
35 0.0538588774 0.0361838776
36 -0.0827141964 0.0538588774
37 0.2435934916 -0.0827141964
38 0.1422338762 0.2435934916
39 0.3129338753 0.1422338762
40 -0.0033815091 0.3129338753
41 -0.4925045862 -0.0033815091
42 -0.3434218919 -0.4925045862
43 -0.3245238179 -0.3434218919
44 -0.6517161252 -0.3245238179
45 -0.5850949722 -0.6517161252
46 -0.4627295892 -0.5850949722
47 -0.2110642053 -0.4627295892
48 -0.2973315105 -0.2110642053
49 -0.1465507460 -0.2973315105
50 -0.3391411320 -0.1465507460
51 -0.7092295940 -0.3391411320
52 -0.8814257495 -0.7092295940
53 -0.3780949816 -0.8814257495
54 0.6832242510 -0.3780949816
55 1.0395800181 0.6832242510
56 0.6246242491 1.0395800181
57 0.0001511725 0.6246242491
58 -0.3991007493 0.0001511725
59 -0.1194949798 -0.3991007493
> 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/7f6wy1258552978.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/8l8xz1258552978.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/93c831258552978.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/10af6a1258552978.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/11p5qw1258552978.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/1206ya1258552978.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/13lml31258552978.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/149zhz1258552978.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/15r1zd1258552978.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/16vxaa1258552978.tab")
+ }
>
> system("convert tmp/11s9f1258552978.ps tmp/11s9f1258552978.png")
> system("convert tmp/2xhdy1258552978.ps tmp/2xhdy1258552978.png")
> system("convert tmp/3mk7b1258552978.ps tmp/3mk7b1258552978.png")
> system("convert tmp/4bdhr1258552978.ps tmp/4bdhr1258552978.png")
> system("convert tmp/5ik6m1258552978.ps tmp/5ik6m1258552978.png")
> system("convert tmp/63woo1258552978.ps tmp/63woo1258552978.png")
> system("convert tmp/7f6wy1258552978.ps tmp/7f6wy1258552978.png")
> system("convert tmp/8l8xz1258552978.ps tmp/8l8xz1258552978.png")
> system("convert tmp/93c831258552978.ps tmp/93c831258552978.png")
> system("convert tmp/10af6a1258552978.ps tmp/10af6a1258552978.png")
>
>
> proc.time()
user system elapsed
2.533 1.633 6.317