R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
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(579,572,560,551,537,541,588,607,599,578,563,566,561,554,540,526,512,505,554,584,569,540,522,526,527,516,503,489,479,475,524,552,532,511,492,492,493,481,462,457,442,439,488,521,501,485,464,460,467,460,448,443,436,431,484,510,513,503,471,471),dim=c(1,60),dimnames=list(c('werkzoekende_werklozen'),1:60))
> y <- array(NA,dim=c(1,60),dimnames=list(c('werkzoekende_werklozen'),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 = 'Include Monthly Dummies'
> par1 = '1'
> library(lattice)
> library(lmtest)
Loading required package: zoo
> 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
werkzoekende_werklozen M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 579 1 0 0 0 0 0 0 0 0 0 0 1
2 572 0 1 0 0 0 0 0 0 0 0 0 2
3 560 0 0 1 0 0 0 0 0 0 0 0 3
4 551 0 0 0 1 0 0 0 0 0 0 0 4
5 537 0 0 0 0 1 0 0 0 0 0 0 5
6 541 0 0 0 0 0 1 0 0 0 0 0 6
7 588 0 0 0 0 0 0 1 0 0 0 0 7
8 607 0 0 0 0 0 0 0 1 0 0 0 8
9 599 0 0 0 0 0 0 0 0 1 0 0 9
10 578 0 0 0 0 0 0 0 0 0 1 0 10
11 563 0 0 0 0 0 0 0 0 0 0 1 11
12 566 0 0 0 0 0 0 0 0 0 0 0 12
13 561 1 0 0 0 0 0 0 0 0 0 0 13
14 554 0 1 0 0 0 0 0 0 0 0 0 14
15 540 0 0 1 0 0 0 0 0 0 0 0 15
16 526 0 0 0 1 0 0 0 0 0 0 0 16
17 512 0 0 0 0 1 0 0 0 0 0 0 17
18 505 0 0 0 0 0 1 0 0 0 0 0 18
19 554 0 0 0 0 0 0 1 0 0 0 0 19
20 584 0 0 0 0 0 0 0 1 0 0 0 20
21 569 0 0 0 0 0 0 0 0 1 0 0 21
22 540 0 0 0 0 0 0 0 0 0 1 0 22
23 522 0 0 0 0 0 0 0 0 0 0 1 23
24 526 0 0 0 0 0 0 0 0 0 0 0 24
25 527 1 0 0 0 0 0 0 0 0 0 0 25
26 516 0 1 0 0 0 0 0 0 0 0 0 26
27 503 0 0 1 0 0 0 0 0 0 0 0 27
28 489 0 0 0 1 0 0 0 0 0 0 0 28
29 479 0 0 0 0 1 0 0 0 0 0 0 29
30 475 0 0 0 0 0 1 0 0 0 0 0 30
31 524 0 0 0 0 0 0 1 0 0 0 0 31
32 552 0 0 0 0 0 0 0 1 0 0 0 32
33 532 0 0 0 0 0 0 0 0 1 0 0 33
34 511 0 0 0 0 0 0 0 0 0 1 0 34
35 492 0 0 0 0 0 0 0 0 0 0 1 35
36 492 0 0 0 0 0 0 0 0 0 0 0 36
37 493 1 0 0 0 0 0 0 0 0 0 0 37
38 481 0 1 0 0 0 0 0 0 0 0 0 38
39 462 0 0 1 0 0 0 0 0 0 0 0 39
40 457 0 0 0 1 0 0 0 0 0 0 0 40
41 442 0 0 0 0 1 0 0 0 0 0 0 41
42 439 0 0 0 0 0 1 0 0 0 0 0 42
43 488 0 0 0 0 0 0 1 0 0 0 0 43
44 521 0 0 0 0 0 0 0 1 0 0 0 44
45 501 0 0 0 0 0 0 0 0 1 0 0 45
46 485 0 0 0 0 0 0 0 0 0 1 0 46
47 464 0 0 0 0 0 0 0 0 0 0 1 47
48 460 0 0 0 0 0 0 0 0 0 0 0 48
49 467 1 0 0 0 0 0 0 0 0 0 0 49
50 460 0 1 0 0 0 0 0 0 0 0 0 50
51 448 0 0 1 0 0 0 0 0 0 0 0 51
52 443 0 0 0 1 0 0 0 0 0 0 0 52
53 436 0 0 0 0 1 0 0 0 0 0 0 53
54 431 0 0 0 0 0 1 0 0 0 0 0 54
55 484 0 0 0 0 0 0 1 0 0 0 0 55
56 510 0 0 0 0 0 0 0 1 0 0 0 56
57 513 0 0 0 0 0 0 0 0 1 0 0 57
58 503 0 0 0 0 0 0 0 0 0 1 0 58
59 471 0 0 0 0 0 0 0 0 0 0 1 59
60 471 0 0 0 0 0 0 0 0 0 0 0 60
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
583.200 -2.106 -8.678 -20.450 -27.622 -37.394
M6 M7 M8 M9 M10 M11
-38.167 13.461 42.889 33.117 15.944 -2.828
t
-2.228
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-16.267 -7.567 -0.433 6.117 33.067
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 583.20000 5.94019 98.179 < 2e-16 ***
M1 -2.10556 7.22657 -0.291 0.77206
M2 -8.67778 7.21577 -1.203 0.23515
M3 -20.45000 7.20599 -2.838 0.00668 **
M4 -27.62222 7.19723 -3.838 0.00037 ***
M5 -37.39444 7.18948 -5.201 4.25e-06 ***
M6 -38.16667 7.18277 -5.314 2.89e-06 ***
M7 13.46111 7.17708 1.876 0.06693 .
M8 42.88889 7.17242 5.980 2.89e-07 ***
M9 33.11667 7.16880 4.620 3.01e-05 ***
M10 15.94444 7.16621 2.225 0.03092 *
M11 -2.82778 7.16465 -0.395 0.69486
t -2.22778 0.08617 -25.853 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 11.33 on 47 degrees of freedom
Multiple R-squared: 0.9506, Adjusted R-squared: 0.938
F-statistic: 75.36 on 12 and 47 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,] 0.0107063705 0.021412741 0.9892936
[2,] 0.0042729714 0.008545943 0.9957270
[3,] 0.0282573943 0.056514789 0.9717426
[4,] 0.0246707834 0.049341567 0.9753292
[5,] 0.0108978144 0.021795629 0.9891022
[6,] 0.0055375439 0.011075088 0.9944625
[7,] 0.0068903620 0.013780724 0.9931096
[8,] 0.0097266733 0.019453347 0.9902733
[9,] 0.0099683635 0.019936727 0.9900316
[10,] 0.0061080786 0.012216157 0.9938919
[11,] 0.0041564184 0.008312837 0.9958436
[12,] 0.0035880651 0.007176130 0.9964119
[13,] 0.0026075118 0.005215024 0.9973925
[14,] 0.0018554537 0.003710907 0.9981445
[15,] 0.0017048455 0.003409691 0.9982952
[16,] 0.0016943901 0.003388780 0.9983056
[17,] 0.0021621542 0.004324308 0.9978378
[18,] 0.0019105660 0.003821132 0.9980894
[19,] 0.0008985456 0.001797091 0.9991015
[20,] 0.0007561100 0.001512220 0.9992439
[21,] 0.0016584365 0.003316873 0.9983416
[22,] 0.0039060614 0.007812123 0.9960939
[23,] 0.0089072819 0.017814564 0.9910927
[24,] 0.0180500422 0.036100084 0.9819500
[25,] 0.0298319017 0.059663803 0.9701681
[26,] 0.0250948267 0.050189653 0.9749052
[27,] 0.0348415239 0.069683048 0.9651585
[28,] 0.0368615891 0.073723178 0.9631384
[29,] 0.6818750494 0.636249901 0.3181250
> postscript(file="/var/wessaorg/rcomp/tmp/13tfv1322497133.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/2130c1322497133.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/3z1jc1322497133.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/4dbx61322497133.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/5hfq61322497133.ps",horizontal=F,onefile=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.13333333 1.93333333 3.93333333 4.33333333 2.33333333 9.33333333
7 8 9 10 11 12
6.93333333 -1.26666667 2.73333333 1.13333333 7.13333333 9.53333333
13 14 15 16 17 18
8.86666667 10.66666667 10.66666667 6.06666667 4.06666667 0.06666667
19 20 21 22 23 24
-0.33333333 2.46666667 -0.53333333 -10.13333333 -7.13333333 -3.73333333
25 26 27 28 29 30
1.60000000 -0.60000000 0.40000000 -4.20000000 -2.20000000 -3.20000000
31 32 33 34 35 36
-3.60000000 -2.80000000 -10.80000000 -12.40000000 -10.40000000 -11.00000000
37 38 39 40 41 42
-5.66666667 -8.86666667 -13.86666667 -9.46666667 -12.46666667 -12.46666667
43 44 45 46 47 48
-12.86666667 -7.06666667 -15.06666667 -11.66666667 -11.66666667 -16.26666667
49 50 51 52 53 54
-4.93333333 -3.13333333 -1.13333333 3.26666667 8.26666667 6.26666667
55 56 57 58 59 60
9.86666667 8.66666667 23.66666667 33.06666667 22.06666667 21.46666667
> postscript(file="/var/wessaorg/rcomp/tmp/6hmb21322497133.ps",horizontal=F,onefile=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.13333333 NA
1 1.93333333 0.13333333
2 3.93333333 1.93333333
3 4.33333333 3.93333333
4 2.33333333 4.33333333
5 9.33333333 2.33333333
6 6.93333333 9.33333333
7 -1.26666667 6.93333333
8 2.73333333 -1.26666667
9 1.13333333 2.73333333
10 7.13333333 1.13333333
11 9.53333333 7.13333333
12 8.86666667 9.53333333
13 10.66666667 8.86666667
14 10.66666667 10.66666667
15 6.06666667 10.66666667
16 4.06666667 6.06666667
17 0.06666667 4.06666667
18 -0.33333333 0.06666667
19 2.46666667 -0.33333333
20 -0.53333333 2.46666667
21 -10.13333333 -0.53333333
22 -7.13333333 -10.13333333
23 -3.73333333 -7.13333333
24 1.60000000 -3.73333333
25 -0.60000000 1.60000000
26 0.40000000 -0.60000000
27 -4.20000000 0.40000000
28 -2.20000000 -4.20000000
29 -3.20000000 -2.20000000
30 -3.60000000 -3.20000000
31 -2.80000000 -3.60000000
32 -10.80000000 -2.80000000
33 -12.40000000 -10.80000000
34 -10.40000000 -12.40000000
35 -11.00000000 -10.40000000
36 -5.66666667 -11.00000000
37 -8.86666667 -5.66666667
38 -13.86666667 -8.86666667
39 -9.46666667 -13.86666667
40 -12.46666667 -9.46666667
41 -12.46666667 -12.46666667
42 -12.86666667 -12.46666667
43 -7.06666667 -12.86666667
44 -15.06666667 -7.06666667
45 -11.66666667 -15.06666667
46 -11.66666667 -11.66666667
47 -16.26666667 -11.66666667
48 -4.93333333 -16.26666667
49 -3.13333333 -4.93333333
50 -1.13333333 -3.13333333
51 3.26666667 -1.13333333
52 8.26666667 3.26666667
53 6.26666667 8.26666667
54 9.86666667 6.26666667
55 8.66666667 9.86666667
56 23.66666667 8.66666667
57 33.06666667 23.66666667
58 22.06666667 33.06666667
59 21.46666667 22.06666667
60 NA 21.46666667
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.93333333 0.13333333
[2,] 3.93333333 1.93333333
[3,] 4.33333333 3.93333333
[4,] 2.33333333 4.33333333
[5,] 9.33333333 2.33333333
[6,] 6.93333333 9.33333333
[7,] -1.26666667 6.93333333
[8,] 2.73333333 -1.26666667
[9,] 1.13333333 2.73333333
[10,] 7.13333333 1.13333333
[11,] 9.53333333 7.13333333
[12,] 8.86666667 9.53333333
[13,] 10.66666667 8.86666667
[14,] 10.66666667 10.66666667
[15,] 6.06666667 10.66666667
[16,] 4.06666667 6.06666667
[17,] 0.06666667 4.06666667
[18,] -0.33333333 0.06666667
[19,] 2.46666667 -0.33333333
[20,] -0.53333333 2.46666667
[21,] -10.13333333 -0.53333333
[22,] -7.13333333 -10.13333333
[23,] -3.73333333 -7.13333333
[24,] 1.60000000 -3.73333333
[25,] -0.60000000 1.60000000
[26,] 0.40000000 -0.60000000
[27,] -4.20000000 0.40000000
[28,] -2.20000000 -4.20000000
[29,] -3.20000000 -2.20000000
[30,] -3.60000000 -3.20000000
[31,] -2.80000000 -3.60000000
[32,] -10.80000000 -2.80000000
[33,] -12.40000000 -10.80000000
[34,] -10.40000000 -12.40000000
[35,] -11.00000000 -10.40000000
[36,] -5.66666667 -11.00000000
[37,] -8.86666667 -5.66666667
[38,] -13.86666667 -8.86666667
[39,] -9.46666667 -13.86666667
[40,] -12.46666667 -9.46666667
[41,] -12.46666667 -12.46666667
[42,] -12.86666667 -12.46666667
[43,] -7.06666667 -12.86666667
[44,] -15.06666667 -7.06666667
[45,] -11.66666667 -15.06666667
[46,] -11.66666667 -11.66666667
[47,] -16.26666667 -11.66666667
[48,] -4.93333333 -16.26666667
[49,] -3.13333333 -4.93333333
[50,] -1.13333333 -3.13333333
[51,] 3.26666667 -1.13333333
[52,] 8.26666667 3.26666667
[53,] 6.26666667 8.26666667
[54,] 9.86666667 6.26666667
[55,] 8.66666667 9.86666667
[56,] 23.66666667 8.66666667
[57,] 33.06666667 23.66666667
[58,] 22.06666667 33.06666667
[59,] 21.46666667 22.06666667
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.93333333 0.13333333
2 3.93333333 1.93333333
3 4.33333333 3.93333333
4 2.33333333 4.33333333
5 9.33333333 2.33333333
6 6.93333333 9.33333333
7 -1.26666667 6.93333333
8 2.73333333 -1.26666667
9 1.13333333 2.73333333
10 7.13333333 1.13333333
11 9.53333333 7.13333333
12 8.86666667 9.53333333
13 10.66666667 8.86666667
14 10.66666667 10.66666667
15 6.06666667 10.66666667
16 4.06666667 6.06666667
17 0.06666667 4.06666667
18 -0.33333333 0.06666667
19 2.46666667 -0.33333333
20 -0.53333333 2.46666667
21 -10.13333333 -0.53333333
22 -7.13333333 -10.13333333
23 -3.73333333 -7.13333333
24 1.60000000 -3.73333333
25 -0.60000000 1.60000000
26 0.40000000 -0.60000000
27 -4.20000000 0.40000000
28 -2.20000000 -4.20000000
29 -3.20000000 -2.20000000
30 -3.60000000 -3.20000000
31 -2.80000000 -3.60000000
32 -10.80000000 -2.80000000
33 -12.40000000 -10.80000000
34 -10.40000000 -12.40000000
35 -11.00000000 -10.40000000
36 -5.66666667 -11.00000000
37 -8.86666667 -5.66666667
38 -13.86666667 -8.86666667
39 -9.46666667 -13.86666667
40 -12.46666667 -9.46666667
41 -12.46666667 -12.46666667
42 -12.86666667 -12.46666667
43 -7.06666667 -12.86666667
44 -15.06666667 -7.06666667
45 -11.66666667 -15.06666667
46 -11.66666667 -11.66666667
47 -16.26666667 -11.66666667
48 -4.93333333 -16.26666667
49 -3.13333333 -4.93333333
50 -1.13333333 -3.13333333
51 3.26666667 -1.13333333
52 8.26666667 3.26666667
53 6.26666667 8.26666667
54 9.86666667 6.26666667
55 8.66666667 9.86666667
56 23.66666667 8.66666667
57 33.06666667 23.66666667
58 22.06666667 33.06666667
59 21.46666667 22.06666667
> 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/wessaorg/rcomp/tmp/7ykng1322497133.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/89gid1322497133.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/99y9a1322497133.ps",horizontal=F,onefile=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/wessaorg/rcomp/tmp/1029n21322497133.ps",horizontal=F,onefile=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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11b6fp1322497133.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/wessaorg/rcomp/tmp/12hcwz1322497133.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/wessaorg/rcomp/tmp/13sm691322497133.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/wessaorg/rcomp/tmp/149hc71322497133.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/wessaorg/rcomp/tmp/151znb1322497133.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/wessaorg/rcomp/tmp/16g6oq1322497133.tab")
+ }
>
> try(system("convert tmp/13tfv1322497133.ps tmp/13tfv1322497133.png",intern=TRUE))
character(0)
> try(system("convert tmp/2130c1322497133.ps tmp/2130c1322497133.png",intern=TRUE))
character(0)
> try(system("convert tmp/3z1jc1322497133.ps tmp/3z1jc1322497133.png",intern=TRUE))
character(0)
> try(system("convert tmp/4dbx61322497133.ps tmp/4dbx61322497133.png",intern=TRUE))
character(0)
> try(system("convert tmp/5hfq61322497133.ps tmp/5hfq61322497133.png",intern=TRUE))
character(0)
> try(system("convert tmp/6hmb21322497133.ps tmp/6hmb21322497133.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ykng1322497133.ps tmp/7ykng1322497133.png",intern=TRUE))
character(0)
> try(system("convert tmp/89gid1322497133.ps tmp/89gid1322497133.png",intern=TRUE))
character(0)
> try(system("convert tmp/99y9a1322497133.ps tmp/99y9a1322497133.png",intern=TRUE))
character(0)
> try(system("convert tmp/1029n21322497133.ps tmp/1029n21322497133.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.166 0.521 3.721