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(27,0,29,0,27,0,26,0,24,0,30,0,26,0,28,0,28,0,24,0,23,0,24,0,24,0,27,0,28,0,25,0,19,0,19,0,19,0,20,0,16,0,22,0,21,0,25,0,29,0,28,0,25,0,26,0,24,0,28,0,28,0,28,0,28,0,32,0,31,0,22,0,29,0,31,0,29,0,32,0,32,0,31,0,29,0,28,0,28,0,29,0,22,0,26,0,24,0,27,0,27,0,23,0,21,0,19,0,17,0,19,0,21,1,13,1,8,1,5,1,10,1,6,1,6,1,8,1,11,1,12,1,13,1,19,1,19,1,18,1,20,1),dim=c(2,71),dimnames=list(c('Y','X'),1:71))
> y <- array(NA,dim=c(2,71),dimnames=list(c('Y','X'),1:71))
> 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
Y X
1 27 0
2 29 0
3 27 0
4 26 0
5 24 0
6 30 0
7 26 0
8 28 0
9 28 0
10 24 0
11 23 0
12 24 0
13 24 0
14 27 0
15 28 0
16 25 0
17 19 0
18 19 0
19 19 0
20 20 0
21 16 0
22 22 0
23 21 0
24 25 0
25 29 0
26 28 0
27 25 0
28 26 0
29 24 0
30 28 0
31 28 0
32 28 0
33 28 0
34 32 0
35 31 0
36 22 0
37 29 0
38 31 0
39 29 0
40 32 0
41 32 0
42 31 0
43 29 0
44 28 0
45 28 0
46 29 0
47 22 0
48 26 0
49 24 0
50 27 0
51 27 0
52 23 0
53 21 0
54 19 0
55 17 0
56 19 0
57 21 1
58 13 1
59 8 1
60 5 1
61 10 1
62 6 1
63 6 1
64 8 1
65 11 1
66 12 1
67 13 1
68 19 1
69 19 1
70 18 1
71 20 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
25.59 -12.99
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-9.5893 -3.0946 0.4107 2.9107 8.4000
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 25.5893 0.5861 43.66 < 2e-16 ***
X -12.9893 1.2750 -10.19 2.16e-15 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.386 on 69 degrees of freedom
Multiple R-squared: 0.6007, Adjusted R-squared: 0.5949
F-statistic: 103.8 on 1 and 69 DF, p-value: 2.159e-15
> 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.1145106806 0.229021361 0.8854893
[2,] 0.1096853919 0.219370784 0.8903146
[3,] 0.0525339357 0.105067871 0.9474661
[4,] 0.0237047721 0.047409544 0.9762952
[5,] 0.0100622069 0.020124414 0.9899378
[6,] 0.0106515205 0.021303041 0.9893485
[7,] 0.0146708178 0.029341636 0.9853292
[8,] 0.0103307710 0.020661542 0.9896692
[9,] 0.0067941869 0.013588374 0.9932058
[10,] 0.0032179695 0.006435939 0.9967820
[11,] 0.0018192711 0.003638542 0.9981807
[12,] 0.0008864352 0.001772870 0.9991136
[13,] 0.0103512508 0.020702502 0.9896487
[14,] 0.0339681783 0.067936357 0.9660318
[15,] 0.0689590600 0.137918120 0.9310409
[16,] 0.0873300114 0.174660023 0.9126700
[17,] 0.2635482983 0.527096597 0.7364517
[18,] 0.2312849779 0.462569956 0.7687150
[19,] 0.2229717260 0.445943452 0.7770283
[20,] 0.1731161779 0.346232356 0.8268838
[21,] 0.1736098432 0.347219686 0.8263902
[22,] 0.1524465897 0.304893179 0.8475534
[23,] 0.1143473711 0.228694742 0.8856526
[24,] 0.0850034501 0.170006900 0.9149965
[25,] 0.0626383531 0.125276706 0.9373616
[26,] 0.0520710472 0.104142094 0.9479290
[27,] 0.0424644182 0.084928836 0.9575356
[28,] 0.0339839914 0.067967983 0.9660160
[29,] 0.0266964638 0.053392928 0.9733035
[30,] 0.0452343456 0.090468691 0.9547657
[31,] 0.0558542618 0.111708524 0.9441457
[32,] 0.0498156877 0.099631375 0.9501843
[33,] 0.0431309217 0.086261843 0.9568691
[34,] 0.0517731061 0.103546212 0.9482269
[35,] 0.0446098656 0.089219731 0.9553901
[36,] 0.0661225379 0.132245076 0.9338775
[37,] 0.0970939758 0.194187952 0.9029060
[38,] 0.1196690677 0.239338135 0.8803309
[39,] 0.1140343117 0.228068623 0.8859657
[40,] 0.1000162011 0.200032402 0.8999838
[41,] 0.0900620563 0.180124113 0.9099379
[42,] 0.0976531598 0.195306320 0.9023468
[43,] 0.0806373036 0.161274607 0.9193627
[44,] 0.0649957813 0.129991563 0.9350042
[45,] 0.0485881988 0.097176398 0.9514118
[46,] 0.0469905884 0.093981177 0.9530094
[47,] 0.0536227550 0.107245510 0.9463772
[48,] 0.0458882547 0.091776509 0.9541117
[49,] 0.0399695918 0.079939184 0.9600304
[50,] 0.0381080411 0.076216082 0.9618920
[51,] 0.0434164310 0.086832862 0.9565836
[52,] 0.0369045303 0.073809061 0.9630955
[53,] 0.0645562908 0.129112582 0.9354437
[54,] 0.0501326358 0.100265272 0.9498674
[55,] 0.0526888931 0.105377786 0.9473111
[56,] 0.0976140443 0.195228089 0.9023860
[57,] 0.0713831231 0.142766246 0.9286169
[58,] 0.1179159251 0.235831850 0.8820841
[59,] 0.2493080322 0.498616064 0.7506920
[60,] 0.4233018956 0.846603791 0.5766981
[61,] 0.4984699372 0.996939874 0.5015301
[62,] 0.6168055907 0.766388819 0.3831944
> postscript(file="/var/www/html/rcomp/tmp/1eu3h1260887600.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/24jaj1260887600.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/3c6cb1260887600.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/4z5yn1260887600.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/5d6cy1260887600.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 = 71
Frequency = 1
1 2 3 4 5 6 7
1.4107143 3.4107143 1.4107143 0.4107143 -1.5892857 4.4107143 0.4107143
8 9 10 11 12 13 14
2.4107143 2.4107143 -1.5892857 -2.5892857 -1.5892857 -1.5892857 1.4107143
15 16 17 18 19 20 21
2.4107143 -0.5892857 -6.5892857 -6.5892857 -6.5892857 -5.5892857 -9.5892857
22 23 24 25 26 27 28
-3.5892857 -4.5892857 -0.5892857 3.4107143 2.4107143 -0.5892857 0.4107143
29 30 31 32 33 34 35
-1.5892857 2.4107143 2.4107143 2.4107143 2.4107143 6.4107143 5.4107143
36 37 38 39 40 41 42
-3.5892857 3.4107143 5.4107143 3.4107143 6.4107143 6.4107143 5.4107143
43 44 45 46 47 48 49
3.4107143 2.4107143 2.4107143 3.4107143 -3.5892857 0.4107143 -1.5892857
50 51 52 53 54 55 56
1.4107143 1.4107143 -2.5892857 -4.5892857 -6.5892857 -8.5892857 -6.5892857
57 58 59 60 61 62 63
8.4000000 0.4000000 -4.6000000 -7.6000000 -2.6000000 -6.6000000 -6.6000000
64 65 66 67 68 69 70
-4.6000000 -1.6000000 -0.6000000 0.4000000 6.4000000 6.4000000 5.4000000
71
7.4000000
> postscript(file="/var/www/html/rcomp/tmp/6d8zl1260887600.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 = 71
Frequency = 1
lag(myerror, k = 1) myerror
0 1.4107143 NA
1 3.4107143 1.4107143
2 1.4107143 3.4107143
3 0.4107143 1.4107143
4 -1.5892857 0.4107143
5 4.4107143 -1.5892857
6 0.4107143 4.4107143
7 2.4107143 0.4107143
8 2.4107143 2.4107143
9 -1.5892857 2.4107143
10 -2.5892857 -1.5892857
11 -1.5892857 -2.5892857
12 -1.5892857 -1.5892857
13 1.4107143 -1.5892857
14 2.4107143 1.4107143
15 -0.5892857 2.4107143
16 -6.5892857 -0.5892857
17 -6.5892857 -6.5892857
18 -6.5892857 -6.5892857
19 -5.5892857 -6.5892857
20 -9.5892857 -5.5892857
21 -3.5892857 -9.5892857
22 -4.5892857 -3.5892857
23 -0.5892857 -4.5892857
24 3.4107143 -0.5892857
25 2.4107143 3.4107143
26 -0.5892857 2.4107143
27 0.4107143 -0.5892857
28 -1.5892857 0.4107143
29 2.4107143 -1.5892857
30 2.4107143 2.4107143
31 2.4107143 2.4107143
32 2.4107143 2.4107143
33 6.4107143 2.4107143
34 5.4107143 6.4107143
35 -3.5892857 5.4107143
36 3.4107143 -3.5892857
37 5.4107143 3.4107143
38 3.4107143 5.4107143
39 6.4107143 3.4107143
40 6.4107143 6.4107143
41 5.4107143 6.4107143
42 3.4107143 5.4107143
43 2.4107143 3.4107143
44 2.4107143 2.4107143
45 3.4107143 2.4107143
46 -3.5892857 3.4107143
47 0.4107143 -3.5892857
48 -1.5892857 0.4107143
49 1.4107143 -1.5892857
50 1.4107143 1.4107143
51 -2.5892857 1.4107143
52 -4.5892857 -2.5892857
53 -6.5892857 -4.5892857
54 -8.5892857 -6.5892857
55 -6.5892857 -8.5892857
56 8.4000000 -6.5892857
57 0.4000000 8.4000000
58 -4.6000000 0.4000000
59 -7.6000000 -4.6000000
60 -2.6000000 -7.6000000
61 -6.6000000 -2.6000000
62 -6.6000000 -6.6000000
63 -4.6000000 -6.6000000
64 -1.6000000 -4.6000000
65 -0.6000000 -1.6000000
66 0.4000000 -0.6000000
67 6.4000000 0.4000000
68 6.4000000 6.4000000
69 5.4000000 6.4000000
70 7.4000000 5.4000000
71 NA 7.4000000
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.4107143 1.4107143
[2,] 1.4107143 3.4107143
[3,] 0.4107143 1.4107143
[4,] -1.5892857 0.4107143
[5,] 4.4107143 -1.5892857
[6,] 0.4107143 4.4107143
[7,] 2.4107143 0.4107143
[8,] 2.4107143 2.4107143
[9,] -1.5892857 2.4107143
[10,] -2.5892857 -1.5892857
[11,] -1.5892857 -2.5892857
[12,] -1.5892857 -1.5892857
[13,] 1.4107143 -1.5892857
[14,] 2.4107143 1.4107143
[15,] -0.5892857 2.4107143
[16,] -6.5892857 -0.5892857
[17,] -6.5892857 -6.5892857
[18,] -6.5892857 -6.5892857
[19,] -5.5892857 -6.5892857
[20,] -9.5892857 -5.5892857
[21,] -3.5892857 -9.5892857
[22,] -4.5892857 -3.5892857
[23,] -0.5892857 -4.5892857
[24,] 3.4107143 -0.5892857
[25,] 2.4107143 3.4107143
[26,] -0.5892857 2.4107143
[27,] 0.4107143 -0.5892857
[28,] -1.5892857 0.4107143
[29,] 2.4107143 -1.5892857
[30,] 2.4107143 2.4107143
[31,] 2.4107143 2.4107143
[32,] 2.4107143 2.4107143
[33,] 6.4107143 2.4107143
[34,] 5.4107143 6.4107143
[35,] -3.5892857 5.4107143
[36,] 3.4107143 -3.5892857
[37,] 5.4107143 3.4107143
[38,] 3.4107143 5.4107143
[39,] 6.4107143 3.4107143
[40,] 6.4107143 6.4107143
[41,] 5.4107143 6.4107143
[42,] 3.4107143 5.4107143
[43,] 2.4107143 3.4107143
[44,] 2.4107143 2.4107143
[45,] 3.4107143 2.4107143
[46,] -3.5892857 3.4107143
[47,] 0.4107143 -3.5892857
[48,] -1.5892857 0.4107143
[49,] 1.4107143 -1.5892857
[50,] 1.4107143 1.4107143
[51,] -2.5892857 1.4107143
[52,] -4.5892857 -2.5892857
[53,] -6.5892857 -4.5892857
[54,] -8.5892857 -6.5892857
[55,] -6.5892857 -8.5892857
[56,] 8.4000000 -6.5892857
[57,] 0.4000000 8.4000000
[58,] -4.6000000 0.4000000
[59,] -7.6000000 -4.6000000
[60,] -2.6000000 -7.6000000
[61,] -6.6000000 -2.6000000
[62,] -6.6000000 -6.6000000
[63,] -4.6000000 -6.6000000
[64,] -1.6000000 -4.6000000
[65,] -0.6000000 -1.6000000
[66,] 0.4000000 -0.6000000
[67,] 6.4000000 0.4000000
[68,] 6.4000000 6.4000000
[69,] 5.4000000 6.4000000
[70,] 7.4000000 5.4000000
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.4107143 1.4107143
2 1.4107143 3.4107143
3 0.4107143 1.4107143
4 -1.5892857 0.4107143
5 4.4107143 -1.5892857
6 0.4107143 4.4107143
7 2.4107143 0.4107143
8 2.4107143 2.4107143
9 -1.5892857 2.4107143
10 -2.5892857 -1.5892857
11 -1.5892857 -2.5892857
12 -1.5892857 -1.5892857
13 1.4107143 -1.5892857
14 2.4107143 1.4107143
15 -0.5892857 2.4107143
16 -6.5892857 -0.5892857
17 -6.5892857 -6.5892857
18 -6.5892857 -6.5892857
19 -5.5892857 -6.5892857
20 -9.5892857 -5.5892857
21 -3.5892857 -9.5892857
22 -4.5892857 -3.5892857
23 -0.5892857 -4.5892857
24 3.4107143 -0.5892857
25 2.4107143 3.4107143
26 -0.5892857 2.4107143
27 0.4107143 -0.5892857
28 -1.5892857 0.4107143
29 2.4107143 -1.5892857
30 2.4107143 2.4107143
31 2.4107143 2.4107143
32 2.4107143 2.4107143
33 6.4107143 2.4107143
34 5.4107143 6.4107143
35 -3.5892857 5.4107143
36 3.4107143 -3.5892857
37 5.4107143 3.4107143
38 3.4107143 5.4107143
39 6.4107143 3.4107143
40 6.4107143 6.4107143
41 5.4107143 6.4107143
42 3.4107143 5.4107143
43 2.4107143 3.4107143
44 2.4107143 2.4107143
45 3.4107143 2.4107143
46 -3.5892857 3.4107143
47 0.4107143 -3.5892857
48 -1.5892857 0.4107143
49 1.4107143 -1.5892857
50 1.4107143 1.4107143
51 -2.5892857 1.4107143
52 -4.5892857 -2.5892857
53 -6.5892857 -4.5892857
54 -8.5892857 -6.5892857
55 -6.5892857 -8.5892857
56 8.4000000 -6.5892857
57 0.4000000 8.4000000
58 -4.6000000 0.4000000
59 -7.6000000 -4.6000000
60 -2.6000000 -7.6000000
61 -6.6000000 -2.6000000
62 -6.6000000 -6.6000000
63 -4.6000000 -6.6000000
64 -1.6000000 -4.6000000
65 -0.6000000 -1.6000000
66 0.4000000 -0.6000000
67 6.4000000 0.4000000
68 6.4000000 6.4000000
69 5.4000000 6.4000000
70 7.4000000 5.4000000
> 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/7m43a1260887600.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/8hwqx1260887600.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/99c661260887600.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/10w3v81260887600.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/11oz7d1260887600.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/126pso1260887600.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/13sieb1260887600.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/14maap1260887600.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/15r8t01260887600.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/162til1260887600.tab")
+ }
>
> try(system("convert tmp/1eu3h1260887600.ps tmp/1eu3h1260887600.png",intern=TRUE))
character(0)
> try(system("convert tmp/24jaj1260887600.ps tmp/24jaj1260887600.png",intern=TRUE))
character(0)
> try(system("convert tmp/3c6cb1260887600.ps tmp/3c6cb1260887600.png",intern=TRUE))
character(0)
> try(system("convert tmp/4z5yn1260887600.ps tmp/4z5yn1260887600.png",intern=TRUE))
character(0)
> try(system("convert tmp/5d6cy1260887600.ps tmp/5d6cy1260887600.png",intern=TRUE))
character(0)
> try(system("convert tmp/6d8zl1260887600.ps tmp/6d8zl1260887600.png",intern=TRUE))
character(0)
> try(system("convert tmp/7m43a1260887600.ps tmp/7m43a1260887600.png",intern=TRUE))
character(0)
> try(system("convert tmp/8hwqx1260887600.ps tmp/8hwqx1260887600.png",intern=TRUE))
character(0)
> try(system("convert tmp/99c661260887600.ps tmp/99c661260887600.png",intern=TRUE))
character(0)
> try(system("convert tmp/10w3v81260887600.ps tmp/10w3v81260887600.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.544 1.560 3.111