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(117.1,95.1,118.7,97,126.5,112.7,127.5,102.9,134.6,97.4,131.8,111.4,135.9,87.4,142.7,96.8,141.7,114.1,153.4,110.3,145,103.9,137.7,101.6,148.3,94.6,152.2,95.9,169.4,104.7,168.6,102.8,161.1,98.1,174.1,113.9,179,80.9,190.6,95.7,190,113.2,181.6,105.9,174.8,108.8,180.5,102.3,196.8,99,193.8,100.7,197,115.5,216.3,100.7,221.4,109.9,217.9,114.6,229.7,85.4,227.4,100.5,204.2,114.8,196.6,116.5,198.8,112.9,207.5,102,190.7,106,201.6,105.3,210.5,118.8,223.5,106.1,223.8,109.3,231.2,117.2,244,92.5,234.7,104.2,250.2,112.5,265.7,122.4,287.6,113.3,283.3,100,295.4,110.7,312.3,112.8,333.8,109.8,347.7,117.3,383.2,109.1,407.1,115.9,413.6,96,362.7,99.8,321.9,116.8,239.4,115.7,191,99.4,159.7,94.3,163.4,91),dim=c(2,61),dimnames=list(c('Energieprijsindex','totindusprodindex'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Energieprijsindex','totindusprodindex'),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 = 'Linear Trend'
> par2 = 'Include Quarterly 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
Energieprijsindex totindusprodindex Q1 Q2 Q3 t
1 117.1 95.1 1 0 0 1
2 118.7 97.0 0 1 0 2
3 126.5 112.7 0 0 1 3
4 127.5 102.9 0 0 0 4
5 134.6 97.4 1 0 0 5
6 131.8 111.4 0 1 0 6
7 135.9 87.4 0 0 1 7
8 142.7 96.8 0 0 0 8
9 141.7 114.1 1 0 0 9
10 153.4 110.3 0 1 0 10
11 145.0 103.9 0 0 1 11
12 137.7 101.6 0 0 0 12
13 148.3 94.6 1 0 0 13
14 152.2 95.9 0 1 0 14
15 169.4 104.7 0 0 1 15
16 168.6 102.8 0 0 0 16
17 161.1 98.1 1 0 0 17
18 174.1 113.9 0 1 0 18
19 179.0 80.9 0 0 1 19
20 190.6 95.7 0 0 0 20
21 190.0 113.2 1 0 0 21
22 181.6 105.9 0 1 0 22
23 174.8 108.8 0 0 1 23
24 180.5 102.3 0 0 0 24
25 196.8 99.0 1 0 0 25
26 193.8 100.7 0 1 0 26
27 197.0 115.5 0 0 1 27
28 216.3 100.7 0 0 0 28
29 221.4 109.9 1 0 0 29
30 217.9 114.6 0 1 0 30
31 229.7 85.4 0 0 1 31
32 227.4 100.5 0 0 0 32
33 204.2 114.8 1 0 0 33
34 196.6 116.5 0 1 0 34
35 198.8 112.9 0 0 1 35
36 207.5 102.0 0 0 0 36
37 190.7 106.0 1 0 0 37
38 201.6 105.3 0 1 0 38
39 210.5 118.8 0 0 1 39
40 223.5 106.1 0 0 0 40
41 223.8 109.3 1 0 0 41
42 231.2 117.2 0 1 0 42
43 244.0 92.5 0 0 1 43
44 234.7 104.2 0 0 0 44
45 250.2 112.5 1 0 0 45
46 265.7 122.4 0 1 0 46
47 287.6 113.3 0 0 1 47
48 283.3 100.0 0 0 0 48
49 295.4 110.7 1 0 0 49
50 312.3 112.8 0 1 0 50
51 333.8 109.8 0 0 1 51
52 347.7 117.3 0 0 0 52
53 383.2 109.1 1 0 0 53
54 407.1 115.9 0 1 0 54
55 413.6 96.0 0 0 1 55
56 362.7 99.8 0 0 0 56
57 321.9 116.8 1 0 0 57
58 239.4 115.7 0 1 0 58
59 191.0 99.4 0 0 1 59
60 159.7 94.3 0 0 0 60
61 163.4 91.0 1 0 0 61
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) totindusprodindex Q1 Q2
8.004 1.072 -6.222 -5.335
Q3 t
3.701 3.026
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-131.023 -18.847 1.924 13.988 132.485
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.0042 73.6273 0.109 0.914
totindusprodindex 1.0725 0.7365 1.456 0.151
Q1 -6.2222 16.9737 -0.367 0.715
Q2 -5.3346 18.1890 -0.293 0.770
Q3 3.7006 16.9963 0.218 0.828
t 3.0264 0.3522 8.592 9.54e-12 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 46.48 on 55 degrees of freedom
Multiple R-squared: 0.6209, Adjusted R-squared: 0.5864
F-statistic: 18.02 on 5 and 55 DF, p-value: 1.525e-10
> 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,] 2.855112e-04 5.710223e-04 0.9997145
[2,] 8.917969e-05 1.783594e-04 0.9999108
[3,] 1.492985e-05 2.985970e-05 0.9999851
[4,] 1.855910e-05 3.711819e-05 0.9999814
[5,] 2.234957e-06 4.469914e-06 0.9999978
[6,] 2.360160e-07 4.720320e-07 0.9999998
[7,] 1.004564e-07 2.009129e-07 0.9999999
[8,] 2.303649e-08 4.607299e-08 1.0000000
[9,] 2.817952e-09 5.635904e-09 1.0000000
[10,] 3.362794e-10 6.725587e-10 1.0000000
[11,] 6.813017e-11 1.362603e-10 1.0000000
[12,] 6.045542e-11 1.209108e-10 1.0000000
[13,] 1.165564e-11 2.331128e-11 1.0000000
[14,] 1.618392e-12 3.236784e-12 1.0000000
[15,] 1.620873e-12 3.241745e-12 1.0000000
[16,] 4.266880e-13 8.533761e-13 1.0000000
[17,] 6.274787e-14 1.254957e-13 1.0000000
[18,] 7.624014e-15 1.524803e-14 1.0000000
[19,] 9.494914e-16 1.898983e-15 1.0000000
[20,] 5.297117e-16 1.059423e-15 1.0000000
[21,] 2.391609e-16 4.783218e-16 1.0000000
[22,] 3.652465e-17 7.304930e-17 1.0000000
[23,] 3.020312e-17 6.040623e-17 1.0000000
[24,] 5.415228e-18 1.083046e-17 1.0000000
[25,] 7.530720e-18 1.506144e-17 1.0000000
[26,] 3.537816e-17 7.075633e-17 1.0000000
[27,] 8.744128e-17 1.748826e-16 1.0000000
[28,] 6.894454e-17 1.378891e-16 1.0000000
[29,] 6.477007e-16 1.295401e-15 1.0000000
[30,] 4.753824e-16 9.507647e-16 1.0000000
[31,] 5.774001e-16 1.154800e-15 1.0000000
[32,] 1.274565e-16 2.549130e-16 1.0000000
[33,] 2.680940e-17 5.361881e-17 1.0000000
[34,] 7.779131e-18 1.555826e-17 1.0000000
[35,] 1.202340e-18 2.404680e-18 1.0000000
[36,] 3.516609e-19 7.033218e-19 1.0000000
[37,] 2.249902e-19 4.499803e-19 1.0000000
[38,] 1.826832e-18 3.653664e-18 1.0000000
[39,] 1.588831e-16 3.177662e-16 1.0000000
[40,] 3.697221e-16 7.394441e-16 1.0000000
[41,] 3.475835e-14 6.951671e-14 1.0000000
[42,] 2.311993e-10 4.623987e-10 1.0000000
[43,] 1.741591e-06 3.483182e-06 0.9999983
[44,] 4.918066e-04 9.836132e-04 0.9995082
> postscript(file="/var/www/html/rcomp/tmp/1q8x21258573653.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/2931i1258573653.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/3bru61258573653.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/4cjj41258573653.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/50ssc1258573653.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
10.30018984 5.94851184 -15.15082075 -2.96646955 13.22782120
6 7 8 9 10
-8.50067304 9.27682119 6.66986068 -9.68803124 2.17333643
11 12 13 14 15
-11.42453841 -15.58366835 5.71931863 4.31111912 0.01178917
16 17 18 19 20
1.92367357 2.65999300 -5.19893671 23.03073488 19.43246795
21 22 23 24 25
3.26008321 -1.22492459 -23.19671605 -9.85149655 13.18337307
26 27 28 29 30
4.44618790 -20.28792696 15.55874500 13.98781271 1.53323509
31 32 33 34 35
32.58754291 14.76753673 -20.57296273 -33.91014790 -39.91092236
36 37 38 39 40
-18.84686059 -36.74097929 -29.00425049 -46.64416196 -19.34966471
41 42 43 44 45
-19.28581209 -24.27227500 2.95594414 -18.21768392 -8.42339847
46 47 48 49 50
-7.45478968 12.14298868 22.78096442 26.60133591 37.33516508
51 52 53 54 55
49.99091212 56.52163349 104.01157745 116.70482511 132.48521631
56 57 58 59 60
78.18405505 22.34790239 -62.88638316 -105.86686290 -131.02309321
61
-120.58822359
> postscript(file="/var/www/html/rcomp/tmp/6f9sh1258573653.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 10.30018984 NA
1 5.94851184 10.30018984
2 -15.15082075 5.94851184
3 -2.96646955 -15.15082075
4 13.22782120 -2.96646955
5 -8.50067304 13.22782120
6 9.27682119 -8.50067304
7 6.66986068 9.27682119
8 -9.68803124 6.66986068
9 2.17333643 -9.68803124
10 -11.42453841 2.17333643
11 -15.58366835 -11.42453841
12 5.71931863 -15.58366835
13 4.31111912 5.71931863
14 0.01178917 4.31111912
15 1.92367357 0.01178917
16 2.65999300 1.92367357
17 -5.19893671 2.65999300
18 23.03073488 -5.19893671
19 19.43246795 23.03073488
20 3.26008321 19.43246795
21 -1.22492459 3.26008321
22 -23.19671605 -1.22492459
23 -9.85149655 -23.19671605
24 13.18337307 -9.85149655
25 4.44618790 13.18337307
26 -20.28792696 4.44618790
27 15.55874500 -20.28792696
28 13.98781271 15.55874500
29 1.53323509 13.98781271
30 32.58754291 1.53323509
31 14.76753673 32.58754291
32 -20.57296273 14.76753673
33 -33.91014790 -20.57296273
34 -39.91092236 -33.91014790
35 -18.84686059 -39.91092236
36 -36.74097929 -18.84686059
37 -29.00425049 -36.74097929
38 -46.64416196 -29.00425049
39 -19.34966471 -46.64416196
40 -19.28581209 -19.34966471
41 -24.27227500 -19.28581209
42 2.95594414 -24.27227500
43 -18.21768392 2.95594414
44 -8.42339847 -18.21768392
45 -7.45478968 -8.42339847
46 12.14298868 -7.45478968
47 22.78096442 12.14298868
48 26.60133591 22.78096442
49 37.33516508 26.60133591
50 49.99091212 37.33516508
51 56.52163349 49.99091212
52 104.01157745 56.52163349
53 116.70482511 104.01157745
54 132.48521631 116.70482511
55 78.18405505 132.48521631
56 22.34790239 78.18405505
57 -62.88638316 22.34790239
58 -105.86686290 -62.88638316
59 -131.02309321 -105.86686290
60 -120.58822359 -131.02309321
61 NA -120.58822359
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 5.94851184 10.30018984
[2,] -15.15082075 5.94851184
[3,] -2.96646955 -15.15082075
[4,] 13.22782120 -2.96646955
[5,] -8.50067304 13.22782120
[6,] 9.27682119 -8.50067304
[7,] 6.66986068 9.27682119
[8,] -9.68803124 6.66986068
[9,] 2.17333643 -9.68803124
[10,] -11.42453841 2.17333643
[11,] -15.58366835 -11.42453841
[12,] 5.71931863 -15.58366835
[13,] 4.31111912 5.71931863
[14,] 0.01178917 4.31111912
[15,] 1.92367357 0.01178917
[16,] 2.65999300 1.92367357
[17,] -5.19893671 2.65999300
[18,] 23.03073488 -5.19893671
[19,] 19.43246795 23.03073488
[20,] 3.26008321 19.43246795
[21,] -1.22492459 3.26008321
[22,] -23.19671605 -1.22492459
[23,] -9.85149655 -23.19671605
[24,] 13.18337307 -9.85149655
[25,] 4.44618790 13.18337307
[26,] -20.28792696 4.44618790
[27,] 15.55874500 -20.28792696
[28,] 13.98781271 15.55874500
[29,] 1.53323509 13.98781271
[30,] 32.58754291 1.53323509
[31,] 14.76753673 32.58754291
[32,] -20.57296273 14.76753673
[33,] -33.91014790 -20.57296273
[34,] -39.91092236 -33.91014790
[35,] -18.84686059 -39.91092236
[36,] -36.74097929 -18.84686059
[37,] -29.00425049 -36.74097929
[38,] -46.64416196 -29.00425049
[39,] -19.34966471 -46.64416196
[40,] -19.28581209 -19.34966471
[41,] -24.27227500 -19.28581209
[42,] 2.95594414 -24.27227500
[43,] -18.21768392 2.95594414
[44,] -8.42339847 -18.21768392
[45,] -7.45478968 -8.42339847
[46,] 12.14298868 -7.45478968
[47,] 22.78096442 12.14298868
[48,] 26.60133591 22.78096442
[49,] 37.33516508 26.60133591
[50,] 49.99091212 37.33516508
[51,] 56.52163349 49.99091212
[52,] 104.01157745 56.52163349
[53,] 116.70482511 104.01157745
[54,] 132.48521631 116.70482511
[55,] 78.18405505 132.48521631
[56,] 22.34790239 78.18405505
[57,] -62.88638316 22.34790239
[58,] -105.86686290 -62.88638316
[59,] -131.02309321 -105.86686290
[60,] -120.58822359 -131.02309321
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 5.94851184 10.30018984
2 -15.15082075 5.94851184
3 -2.96646955 -15.15082075
4 13.22782120 -2.96646955
5 -8.50067304 13.22782120
6 9.27682119 -8.50067304
7 6.66986068 9.27682119
8 -9.68803124 6.66986068
9 2.17333643 -9.68803124
10 -11.42453841 2.17333643
11 -15.58366835 -11.42453841
12 5.71931863 -15.58366835
13 4.31111912 5.71931863
14 0.01178917 4.31111912
15 1.92367357 0.01178917
16 2.65999300 1.92367357
17 -5.19893671 2.65999300
18 23.03073488 -5.19893671
19 19.43246795 23.03073488
20 3.26008321 19.43246795
21 -1.22492459 3.26008321
22 -23.19671605 -1.22492459
23 -9.85149655 -23.19671605
24 13.18337307 -9.85149655
25 4.44618790 13.18337307
26 -20.28792696 4.44618790
27 15.55874500 -20.28792696
28 13.98781271 15.55874500
29 1.53323509 13.98781271
30 32.58754291 1.53323509
31 14.76753673 32.58754291
32 -20.57296273 14.76753673
33 -33.91014790 -20.57296273
34 -39.91092236 -33.91014790
35 -18.84686059 -39.91092236
36 -36.74097929 -18.84686059
37 -29.00425049 -36.74097929
38 -46.64416196 -29.00425049
39 -19.34966471 -46.64416196
40 -19.28581209 -19.34966471
41 -24.27227500 -19.28581209
42 2.95594414 -24.27227500
43 -18.21768392 2.95594414
44 -8.42339847 -18.21768392
45 -7.45478968 -8.42339847
46 12.14298868 -7.45478968
47 22.78096442 12.14298868
48 26.60133591 22.78096442
49 37.33516508 26.60133591
50 49.99091212 37.33516508
51 56.52163349 49.99091212
52 104.01157745 56.52163349
53 116.70482511 104.01157745
54 132.48521631 116.70482511
55 78.18405505 132.48521631
56 22.34790239 78.18405505
57 -62.88638316 22.34790239
58 -105.86686290 -62.88638316
59 -131.02309321 -105.86686290
60 -120.58822359 -131.02309321
> 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/7cjze1258573653.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/8q8ho1258573653.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/9dogv1258573653.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/10f69z1258573653.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/111rps1258573653.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/12iw6y1258573653.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/138mzm1258573653.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/14k9tg1258573653.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/15u1bl1258573653.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/163dpd1258573654.tab")
+ }
>
> system("convert tmp/1q8x21258573653.ps tmp/1q8x21258573653.png")
> system("convert tmp/2931i1258573653.ps tmp/2931i1258573653.png")
> system("convert tmp/3bru61258573653.ps tmp/3bru61258573653.png")
> system("convert tmp/4cjj41258573653.ps tmp/4cjj41258573653.png")
> system("convert tmp/50ssc1258573653.ps tmp/50ssc1258573653.png")
> system("convert tmp/6f9sh1258573653.ps tmp/6f9sh1258573653.png")
> system("convert tmp/7cjze1258573653.ps tmp/7cjze1258573653.png")
> system("convert tmp/8q8ho1258573653.ps tmp/8q8ho1258573653.png")
> system("convert tmp/9dogv1258573653.ps tmp/9dogv1258573653.png")
> system("convert tmp/10f69z1258573653.ps tmp/10f69z1258573653.png")
>
>
> proc.time()
user system elapsed
2.432 1.562 2.846