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,1.9,9,1.6,9,1.7,9,2,9,2.5,9,2.4,9,2.3,9,2.3,9,2.1,9,2.4,9,2.2,9.1,2.4,9,1.9,9,2.1,9.1,2.1,9,2.1,9,2,9,2.1,9,2.2,8.9,2.2,8.9,2.6,8.9,2.5,8.9,2.3,8.8,2.2,8.8,2.4,8.7,2.3,8.7,2.2,8.5,2.5,8.5,2.5,8.4,2.5,8.2,2.4,8.2,2.3,8.1,1.7,8.1,1.6,8,1.9,7.9,1.9,7.8,1.8,7.7,1.8,7.6,1.9,7.5,1.9,7.5,1.9,7.5,1.9,7.5,1.8,7.5,1.7,7.4,2.1,7.4,2.6,7.3,3.1,7.3,3.1,7.3,3.2,7.2,3.3,7.2,3.6,7.3,3.3,7.4,3.7,7.4,4,7.5,4,7.6,3.8,7.7,3.6,7.9,3.2,8,2.1,8.2,1.6),dim=c(2,60),dimnames=list(c('werkl','infl
'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('werkl','infl
'),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 = '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
werkl infl\r t
1 8.9 1.9 1
2 9.0 1.6 2
3 9.0 1.7 3
4 9.0 2.0 4
5 9.0 2.5 5
6 9.0 2.4 6
7 9.0 2.3 7
8 9.0 2.3 8
9 9.0 2.1 9
10 9.0 2.4 10
11 9.0 2.2 11
12 9.1 2.4 12
13 9.0 1.9 13
14 9.0 2.1 14
15 9.1 2.1 15
16 9.0 2.1 16
17 9.0 2.0 17
18 9.0 2.1 18
19 9.0 2.2 19
20 8.9 2.2 20
21 8.9 2.6 21
22 8.9 2.5 22
23 8.9 2.3 23
24 8.8 2.2 24
25 8.8 2.4 25
26 8.7 2.3 26
27 8.7 2.2 27
28 8.5 2.5 28
29 8.5 2.5 29
30 8.4 2.5 30
31 8.2 2.4 31
32 8.2 2.3 32
33 8.1 1.7 33
34 8.1 1.6 34
35 8.0 1.9 35
36 7.9 1.9 36
37 7.8 1.8 37
38 7.7 1.8 38
39 7.6 1.9 39
40 7.5 1.9 40
41 7.5 1.9 41
42 7.5 1.9 42
43 7.5 1.8 43
44 7.5 1.7 44
45 7.4 2.1 45
46 7.4 2.6 46
47 7.3 3.1 47
48 7.3 3.1 48
49 7.3 3.2 49
50 7.2 3.3 50
51 7.2 3.6 51
52 7.3 3.3 52
53 7.4 3.7 53
54 7.4 4.0 54
55 7.5 4.0 55
56 7.6 3.8 56
57 7.7 3.6 57
58 7.9 3.2 58
59 8.0 2.1 59
60 8.2 1.6 60
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `infl\r` t
9.30898 0.01808 -0.03543
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.42629 -0.27054 -0.04379 0.25777 0.98766
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 9.308982 0.161280 57.72 <2e-16 ***
`infl\r` 0.018081 0.075323 0.24 0.811
t -0.035426 0.002712 -13.06 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.3152 on 57 degrees of freedom
Multiple R-squared: 0.7966, Adjusted R-squared: 0.7894
F-statistic: 111.6 on 2 and 57 DF, p-value: < 2.2e-16
> 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,] 5.100785e-04 1.020157e-03 9.994899e-01
[2,] 1.505111e-04 3.010222e-04 9.998495e-01
[3,] 2.666224e-05 5.332448e-05 9.999733e-01
[4,] 4.361288e-06 8.722576e-06 9.999956e-01
[5,] 4.710562e-07 9.421124e-07 9.999995e-01
[6,] 5.133966e-08 1.026793e-07 9.999999e-01
[7,] 4.166276e-08 8.332552e-08 1.000000e+00
[8,] 8.506876e-09 1.701375e-08 1.000000e+00
[9,] 1.263669e-09 2.527337e-09 1.000000e+00
[10,] 4.634975e-10 9.269950e-10 1.000000e+00
[11,] 1.081812e-10 2.163624e-10 1.000000e+00
[12,] 1.920978e-11 3.841957e-11 1.000000e+00
[13,] 3.234849e-12 6.469697e-12 1.000000e+00
[14,] 5.486816e-13 1.097363e-12 1.000000e+00
[15,] 3.115205e-12 6.230410e-12 1.000000e+00
[16,] 4.158476e-12 8.316952e-12 1.000000e+00
[17,] 2.281614e-12 4.563227e-12 1.000000e+00
[18,] 1.044081e-12 2.088162e-12 1.000000e+00
[19,] 4.842556e-12 9.685112e-12 1.000000e+00
[20,] 8.719165e-12 1.743833e-11 1.000000e+00
[21,] 9.805462e-11 1.961092e-10 1.000000e+00
[22,] 3.755093e-10 7.510185e-10 1.000000e+00
[23,] 5.172379e-08 1.034476e-07 9.999999e-01
[24,] 8.575668e-07 1.715134e-06 9.999991e-01
[25,] 2.451492e-05 4.902985e-05 9.999755e-01
[26,] 1.277935e-03 2.555871e-03 9.987221e-01
[27,] 1.679832e-02 3.359665e-02 9.832017e-01
[28,] 5.472375e-02 1.094475e-01 9.452763e-01
[29,] 1.183581e-01 2.367163e-01 8.816419e-01
[30,] 3.438872e-01 6.877745e-01 6.561128e-01
[31,] 6.913077e-01 6.173846e-01 3.086923e-01
[32,] 9.004710e-01 1.990580e-01 9.952902e-02
[33,] 9.752888e-01 4.942239e-02 2.471119e-02
[34,] 9.950732e-01 9.853680e-03 4.926840e-03
[35,] 9.978173e-01 4.365380e-03 2.182690e-03
[36,] 9.987510e-01 2.498083e-03 1.249041e-03
[37,] 9.991564e-01 1.687118e-03 8.435592e-04
[38,] 9.990607e-01 1.878671e-03 9.393355e-04
[39,] 9.984634e-01 3.073126e-03 1.536563e-03
[40,] 9.975912e-01 4.817632e-03 2.408816e-03
[41,] 9.989575e-01 2.084907e-03 1.042453e-03
[42,] 9.996748e-01 6.503352e-04 3.251676e-04
[43,] 9.998869e-01 2.262513e-04 1.131256e-04
[44,] 9.999972e-01 5.550754e-06 2.775377e-06
[45,] 9.999922e-01 1.557905e-05 7.789527e-06
[46,] 9.999450e-01 1.100449e-04 5.502243e-05
[47,] 9.996593e-01 6.813862e-04 3.406931e-04
[48,] 9.990583e-01 1.883370e-03 9.416850e-04
[49,] 9.939167e-01 1.216665e-02 6.083327e-03
> postscript(file="/var/www/html/rcomp/tmp/1y6l61259252424.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/2nn5c1259252424.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/38exh1259252424.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/4zm4c1259252424.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/5yblo1259252424.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
-0.407910381 -0.267059731 -0.233441655 -0.203439865 -0.177054362 -0.139819999
7 8 9 10 11 12
-0.102585636 -0.067159417 -0.028116910 0.001884879 0.040927386 0.172737319
13 14 15 16 17 18
0.117204255 0.149014188 0.284440408 0.219866628 0.257100991 0.290719067
19 20 21 22 23 24
0.324337144 0.259763363 0.287957009 0.325191372 0.364233879 0.301468242
25 26 27 28 29 30
0.333278175 0.270512538 0.307746901 0.137748691 0.173174910 0.108601130
31 32 33 34 35 36
-0.054164507 -0.016930144 -0.070655064 -0.033420701 -0.103418911 -0.167992692
37 38 39 40 41 42
-0.230758328 -0.295332109 -0.361714032 -0.426287813 -0.390861593 -0.355435373
43 44 45 46 47 48
-0.318201010 -0.280966647 -0.352773001 -0.326387498 -0.400001995 -0.364575776
49 50 51 52 53 54
-0.330957699 -0.397339623 -0.367337833 -0.226487184 -0.098293537 -0.068291748
55 56 57 58 59 60
0.067134472 0.206176978 0.345219485 0.587878278 0.743194075 0.987661011
> postscript(file="/var/www/html/rcomp/tmp/6lmaj1259252424.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.407910381 NA
1 -0.267059731 -0.407910381
2 -0.233441655 -0.267059731
3 -0.203439865 -0.233441655
4 -0.177054362 -0.203439865
5 -0.139819999 -0.177054362
6 -0.102585636 -0.139819999
7 -0.067159417 -0.102585636
8 -0.028116910 -0.067159417
9 0.001884879 -0.028116910
10 0.040927386 0.001884879
11 0.172737319 0.040927386
12 0.117204255 0.172737319
13 0.149014188 0.117204255
14 0.284440408 0.149014188
15 0.219866628 0.284440408
16 0.257100991 0.219866628
17 0.290719067 0.257100991
18 0.324337144 0.290719067
19 0.259763363 0.324337144
20 0.287957009 0.259763363
21 0.325191372 0.287957009
22 0.364233879 0.325191372
23 0.301468242 0.364233879
24 0.333278175 0.301468242
25 0.270512538 0.333278175
26 0.307746901 0.270512538
27 0.137748691 0.307746901
28 0.173174910 0.137748691
29 0.108601130 0.173174910
30 -0.054164507 0.108601130
31 -0.016930144 -0.054164507
32 -0.070655064 -0.016930144
33 -0.033420701 -0.070655064
34 -0.103418911 -0.033420701
35 -0.167992692 -0.103418911
36 -0.230758328 -0.167992692
37 -0.295332109 -0.230758328
38 -0.361714032 -0.295332109
39 -0.426287813 -0.361714032
40 -0.390861593 -0.426287813
41 -0.355435373 -0.390861593
42 -0.318201010 -0.355435373
43 -0.280966647 -0.318201010
44 -0.352773001 -0.280966647
45 -0.326387498 -0.352773001
46 -0.400001995 -0.326387498
47 -0.364575776 -0.400001995
48 -0.330957699 -0.364575776
49 -0.397339623 -0.330957699
50 -0.367337833 -0.397339623
51 -0.226487184 -0.367337833
52 -0.098293537 -0.226487184
53 -0.068291748 -0.098293537
54 0.067134472 -0.068291748
55 0.206176978 0.067134472
56 0.345219485 0.206176978
57 0.587878278 0.345219485
58 0.743194075 0.587878278
59 0.987661011 0.743194075
60 NA 0.987661011
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.267059731 -0.407910381
[2,] -0.233441655 -0.267059731
[3,] -0.203439865 -0.233441655
[4,] -0.177054362 -0.203439865
[5,] -0.139819999 -0.177054362
[6,] -0.102585636 -0.139819999
[7,] -0.067159417 -0.102585636
[8,] -0.028116910 -0.067159417
[9,] 0.001884879 -0.028116910
[10,] 0.040927386 0.001884879
[11,] 0.172737319 0.040927386
[12,] 0.117204255 0.172737319
[13,] 0.149014188 0.117204255
[14,] 0.284440408 0.149014188
[15,] 0.219866628 0.284440408
[16,] 0.257100991 0.219866628
[17,] 0.290719067 0.257100991
[18,] 0.324337144 0.290719067
[19,] 0.259763363 0.324337144
[20,] 0.287957009 0.259763363
[21,] 0.325191372 0.287957009
[22,] 0.364233879 0.325191372
[23,] 0.301468242 0.364233879
[24,] 0.333278175 0.301468242
[25,] 0.270512538 0.333278175
[26,] 0.307746901 0.270512538
[27,] 0.137748691 0.307746901
[28,] 0.173174910 0.137748691
[29,] 0.108601130 0.173174910
[30,] -0.054164507 0.108601130
[31,] -0.016930144 -0.054164507
[32,] -0.070655064 -0.016930144
[33,] -0.033420701 -0.070655064
[34,] -0.103418911 -0.033420701
[35,] -0.167992692 -0.103418911
[36,] -0.230758328 -0.167992692
[37,] -0.295332109 -0.230758328
[38,] -0.361714032 -0.295332109
[39,] -0.426287813 -0.361714032
[40,] -0.390861593 -0.426287813
[41,] -0.355435373 -0.390861593
[42,] -0.318201010 -0.355435373
[43,] -0.280966647 -0.318201010
[44,] -0.352773001 -0.280966647
[45,] -0.326387498 -0.352773001
[46,] -0.400001995 -0.326387498
[47,] -0.364575776 -0.400001995
[48,] -0.330957699 -0.364575776
[49,] -0.397339623 -0.330957699
[50,] -0.367337833 -0.397339623
[51,] -0.226487184 -0.367337833
[52,] -0.098293537 -0.226487184
[53,] -0.068291748 -0.098293537
[54,] 0.067134472 -0.068291748
[55,] 0.206176978 0.067134472
[56,] 0.345219485 0.206176978
[57,] 0.587878278 0.345219485
[58,] 0.743194075 0.587878278
[59,] 0.987661011 0.743194075
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.267059731 -0.407910381
2 -0.233441655 -0.267059731
3 -0.203439865 -0.233441655
4 -0.177054362 -0.203439865
5 -0.139819999 -0.177054362
6 -0.102585636 -0.139819999
7 -0.067159417 -0.102585636
8 -0.028116910 -0.067159417
9 0.001884879 -0.028116910
10 0.040927386 0.001884879
11 0.172737319 0.040927386
12 0.117204255 0.172737319
13 0.149014188 0.117204255
14 0.284440408 0.149014188
15 0.219866628 0.284440408
16 0.257100991 0.219866628
17 0.290719067 0.257100991
18 0.324337144 0.290719067
19 0.259763363 0.324337144
20 0.287957009 0.259763363
21 0.325191372 0.287957009
22 0.364233879 0.325191372
23 0.301468242 0.364233879
24 0.333278175 0.301468242
25 0.270512538 0.333278175
26 0.307746901 0.270512538
27 0.137748691 0.307746901
28 0.173174910 0.137748691
29 0.108601130 0.173174910
30 -0.054164507 0.108601130
31 -0.016930144 -0.054164507
32 -0.070655064 -0.016930144
33 -0.033420701 -0.070655064
34 -0.103418911 -0.033420701
35 -0.167992692 -0.103418911
36 -0.230758328 -0.167992692
37 -0.295332109 -0.230758328
38 -0.361714032 -0.295332109
39 -0.426287813 -0.361714032
40 -0.390861593 -0.426287813
41 -0.355435373 -0.390861593
42 -0.318201010 -0.355435373
43 -0.280966647 -0.318201010
44 -0.352773001 -0.280966647
45 -0.326387498 -0.352773001
46 -0.400001995 -0.326387498
47 -0.364575776 -0.400001995
48 -0.330957699 -0.364575776
49 -0.397339623 -0.330957699
50 -0.367337833 -0.397339623
51 -0.226487184 -0.367337833
52 -0.098293537 -0.226487184
53 -0.068291748 -0.098293537
54 0.067134472 -0.068291748
55 0.206176978 0.067134472
56 0.345219485 0.206176978
57 0.587878278 0.345219485
58 0.743194075 0.587878278
59 0.987661011 0.743194075
> 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/7c9cz1259252424.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/8aa1p1259252424.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/9lyw01259252424.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/10jr9q1259252424.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/11gv6s1259252424.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/12e6sg1259252424.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/13egse1259252424.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/145evv1259252424.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/15r3is1259252424.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/16hqe51259252424.tab")
+ }
>
> system("convert tmp/1y6l61259252424.ps tmp/1y6l61259252424.png")
> system("convert tmp/2nn5c1259252424.ps tmp/2nn5c1259252424.png")
> system("convert tmp/38exh1259252424.ps tmp/38exh1259252424.png")
> system("convert tmp/4zm4c1259252424.ps tmp/4zm4c1259252424.png")
> system("convert tmp/5yblo1259252424.ps tmp/5yblo1259252424.png")
> system("convert tmp/6lmaj1259252424.ps tmp/6lmaj1259252424.png")
> system("convert tmp/7c9cz1259252424.ps tmp/7c9cz1259252424.png")
> system("convert tmp/8aa1p1259252424.ps tmp/8aa1p1259252424.png")
> system("convert tmp/9lyw01259252424.ps tmp/9lyw01259252424.png")
> system("convert tmp/10jr9q1259252424.ps tmp/10jr9q1259252424.png")
>
>
> proc.time()
user system elapsed
2.469 1.601 2.888