R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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(467,0,460,0,448,0,443,0,436,0,431,0,484,0,510,0,513,1,503,1,471,1,471,1,476,1,475,1,470,1,461,1,455,1,456,1,517,1,525,1,523,1,519,1,509,1,512,1,519,1,517,1,510,1,509,1,501,1,507,1,569,1,580,1,578,1,565,1,547,1,555,1,562,1,561,1,555,1,544,1,537,1,543,1,594,1,611,1,613,1,611,1,594,1,595,1,591,1,589,1,584,1,573,1,567,1,569,1,621,1,629,1,628,1,612,1,595,1,597,1),dim=c(2,60),dimnames=list(c('Werkloosheid','Dummy'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Werkloosheid','Dummy'),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'
> #'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
Werkloosheid Dummy M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 467 0 1 0 0 0 0 0 0 0 0 0 0 1
2 460 0 0 1 0 0 0 0 0 0 0 0 0 2
3 448 0 0 0 1 0 0 0 0 0 0 0 0 3
4 443 0 0 0 0 1 0 0 0 0 0 0 0 4
5 436 0 0 0 0 0 1 0 0 0 0 0 0 5
6 431 0 0 0 0 0 0 1 0 0 0 0 0 6
7 484 0 0 0 0 0 0 0 1 0 0 0 0 7
8 510 0 0 0 0 0 0 0 0 1 0 0 0 8
9 513 1 0 0 0 0 0 0 0 0 1 0 0 9
10 503 1 0 0 0 0 0 0 0 0 0 1 0 10
11 471 1 0 0 0 0 0 0 0 0 0 0 1 11
12 471 1 0 0 0 0 0 0 0 0 0 0 0 12
13 476 1 1 0 0 0 0 0 0 0 0 0 0 13
14 475 1 0 1 0 0 0 0 0 0 0 0 0 14
15 470 1 0 0 1 0 0 0 0 0 0 0 0 15
16 461 1 0 0 0 1 0 0 0 0 0 0 0 16
17 455 1 0 0 0 0 1 0 0 0 0 0 0 17
18 456 1 0 0 0 0 0 1 0 0 0 0 0 18
19 517 1 0 0 0 0 0 0 1 0 0 0 0 19
20 525 1 0 0 0 0 0 0 0 1 0 0 0 20
21 523 1 0 0 0 0 0 0 0 0 1 0 0 21
22 519 1 0 0 0 0 0 0 0 0 0 1 0 22
23 509 1 0 0 0 0 0 0 0 0 0 0 1 23
24 512 1 0 0 0 0 0 0 0 0 0 0 0 24
25 519 1 1 0 0 0 0 0 0 0 0 0 0 25
26 517 1 0 1 0 0 0 0 0 0 0 0 0 26
27 510 1 0 0 1 0 0 0 0 0 0 0 0 27
28 509 1 0 0 0 1 0 0 0 0 0 0 0 28
29 501 1 0 0 0 0 1 0 0 0 0 0 0 29
30 507 1 0 0 0 0 0 1 0 0 0 0 0 30
31 569 1 0 0 0 0 0 0 1 0 0 0 0 31
32 580 1 0 0 0 0 0 0 0 1 0 0 0 32
33 578 1 0 0 0 0 0 0 0 0 1 0 0 33
34 565 1 0 0 0 0 0 0 0 0 0 1 0 34
35 547 1 0 0 0 0 0 0 0 0 0 0 1 35
36 555 1 0 0 0 0 0 0 0 0 0 0 0 36
37 562 1 1 0 0 0 0 0 0 0 0 0 0 37
38 561 1 0 1 0 0 0 0 0 0 0 0 0 38
39 555 1 0 0 1 0 0 0 0 0 0 0 0 39
40 544 1 0 0 0 1 0 0 0 0 0 0 0 40
41 537 1 0 0 0 0 1 0 0 0 0 0 0 41
42 543 1 0 0 0 0 0 1 0 0 0 0 0 42
43 594 1 0 0 0 0 0 0 1 0 0 0 0 43
44 611 1 0 0 0 0 0 0 0 1 0 0 0 44
45 613 1 0 0 0 0 0 0 0 0 1 0 0 45
46 611 1 0 0 0 0 0 0 0 0 0 1 0 46
47 594 1 0 0 0 0 0 0 0 0 0 0 1 47
48 595 1 0 0 0 0 0 0 0 0 0 0 0 48
49 591 1 1 0 0 0 0 0 0 0 0 0 0 49
50 589 1 0 1 0 0 0 0 0 0 0 0 0 50
51 584 1 0 0 1 0 0 0 0 0 0 0 0 51
52 573 1 0 0 0 1 0 0 0 0 0 0 0 52
53 567 1 0 0 0 0 1 0 0 0 0 0 0 53
54 569 1 0 0 0 0 0 1 0 0 0 0 0 54
55 621 1 0 0 0 0 0 0 1 0 0 0 0 55
56 629 1 0 0 0 0 0 0 0 1 0 0 0 56
57 628 1 0 0 0 0 0 0 0 0 1 0 0 57
58 612 1 0 0 0 0 0 0 0 0 0 1 0 58
59 595 1 0 0 0 0 0 0 0 0 0 0 1 59
60 597 1 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) Dummy M1 M2 M3 M4
448.60937 -6.76562 7.47240 1.97917 -7.91406 -18.20729
M5 M6 M7 M8 M9 M10
-27.90052 -28.79375 24.11302 35.21979 33.67969 21.78646
M11 t
0.09323 2.89323
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-19.4375 -6.4633 0.6187 6.7258 16.0813
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 448.60937 5.74284 78.116 < 2e-16 ***
Dummy -6.76562 4.63776 -1.459 0.151412
M1 7.47240 6.12218 1.221 0.228479
M2 1.97917 6.11632 0.324 0.747717
M3 -7.91406 6.11176 -1.295 0.201820
M4 -18.20729 6.10850 -2.981 0.004585 **
M5 -27.90052 6.10655 -4.569 3.67e-05 ***
M6 -28.79375 6.10590 -4.716 2.27e-05 ***
M7 24.11302 6.10655 3.949 0.000267 ***
M8 35.21979 6.10850 5.766 6.49e-07 ***
M9 33.67969 6.06466 5.553 1.34e-06 ***
M10 21.78646 6.06137 3.594 0.000790 ***
M11 0.09323 6.05940 0.015 0.987791
t 2.89323 0.08925 32.416 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 9.58 on 46 degrees of freedom
Multiple R-squared: 0.9768, Adjusted R-squared: 0.9703
F-statistic: 149 on 13 and 46 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.07230541 0.14461081 0.9276946
[2,] 0.05821675 0.11643350 0.9417832
[3,] 0.11595006 0.23190013 0.8840499
[4,] 0.07737569 0.15475138 0.9226243
[5,] 0.05140367 0.10280734 0.9485963
[6,] 0.03555454 0.07110909 0.9644455
[7,] 0.15492965 0.30985931 0.8450703
[8,] 0.23571913 0.47143827 0.7642809
[9,] 0.24898086 0.49796171 0.7510191
[10,] 0.27083509 0.54167017 0.7291649
[11,] 0.32791696 0.65583391 0.6720830
[12,] 0.36525735 0.73051470 0.6347426
[13,] 0.37802152 0.75604305 0.6219785
[14,] 0.46660096 0.93320192 0.5333990
[15,] 0.52463578 0.95072845 0.4753642
[16,] 0.47613122 0.95226243 0.5238688
[17,] 0.39116913 0.78233826 0.6088309
[18,] 0.36296876 0.72593751 0.6370312
[19,] 0.37229776 0.74459552 0.6277022
[20,] 0.33883090 0.67766179 0.6611691
[21,] 0.28239109 0.56478218 0.7176089
[22,] 0.23162525 0.46325050 0.7683747
[23,] 0.20527301 0.41054602 0.7947270
[24,] 0.19150973 0.38301947 0.8084903
[25,] 0.22478071 0.44956143 0.7752193
[26,] 0.24695327 0.49390654 0.7530467
[27,] 0.44229873 0.88459745 0.5577013
> postscript(file="/var/www/html/rcomp/tmp/1ixjw1229783303.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/2ztcp1229783303.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/3l2521229783303.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/4ga3f1229783303.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/5pple1229783304.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 7
8.025000 3.625000 -1.375000 1.025000 0.825000 -6.175000 -8.975000
8 9 10 11 12 13 14
3.025000 11.437500 10.437500 -2.762500 -5.562500 -10.928125 -9.328125
15 16 17 18 19 20 21
-7.328125 -8.928125 -8.128125 -9.128125 -3.928125 -9.928125 -13.281250
22 23 24 25 26 27 28
-8.281250 0.518750 0.718750 -2.646875 -2.046875 -2.046875 4.353125
29 30 31 32 33 34 35
3.153125 7.153125 13.353125 10.353125 7.000000 3.000000 3.800000
36 37 38 39 40 41 42
9.000000 5.634375 7.234375 8.234375 4.634375 4.434375 8.434375
43 44 45 46 47 48 49
3.634375 6.634375 7.281250 14.281250 16.081250 14.281250 -0.084375
50 51 52 53 54 55 56
0.515625 2.515625 -1.084375 -0.284375 -0.284375 -4.084375 -10.084375
57 58 59 60
-12.437500 -19.437500 -17.637500 -18.437500
> postscript(file="/var/www/html/rcomp/tmp/6lz1l1229783304.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 8.025000 NA
1 3.625000 8.025000
2 -1.375000 3.625000
3 1.025000 -1.375000
4 0.825000 1.025000
5 -6.175000 0.825000
6 -8.975000 -6.175000
7 3.025000 -8.975000
8 11.437500 3.025000
9 10.437500 11.437500
10 -2.762500 10.437500
11 -5.562500 -2.762500
12 -10.928125 -5.562500
13 -9.328125 -10.928125
14 -7.328125 -9.328125
15 -8.928125 -7.328125
16 -8.128125 -8.928125
17 -9.128125 -8.128125
18 -3.928125 -9.128125
19 -9.928125 -3.928125
20 -13.281250 -9.928125
21 -8.281250 -13.281250
22 0.518750 -8.281250
23 0.718750 0.518750
24 -2.646875 0.718750
25 -2.046875 -2.646875
26 -2.046875 -2.046875
27 4.353125 -2.046875
28 3.153125 4.353125
29 7.153125 3.153125
30 13.353125 7.153125
31 10.353125 13.353125
32 7.000000 10.353125
33 3.000000 7.000000
34 3.800000 3.000000
35 9.000000 3.800000
36 5.634375 9.000000
37 7.234375 5.634375
38 8.234375 7.234375
39 4.634375 8.234375
40 4.434375 4.634375
41 8.434375 4.434375
42 3.634375 8.434375
43 6.634375 3.634375
44 7.281250 6.634375
45 14.281250 7.281250
46 16.081250 14.281250
47 14.281250 16.081250
48 -0.084375 14.281250
49 0.515625 -0.084375
50 2.515625 0.515625
51 -1.084375 2.515625
52 -0.284375 -1.084375
53 -0.284375 -0.284375
54 -4.084375 -0.284375
55 -10.084375 -4.084375
56 -12.437500 -10.084375
57 -19.437500 -12.437500
58 -17.637500 -19.437500
59 -18.437500 -17.637500
60 NA -18.437500
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.625000 8.025000
[2,] -1.375000 3.625000
[3,] 1.025000 -1.375000
[4,] 0.825000 1.025000
[5,] -6.175000 0.825000
[6,] -8.975000 -6.175000
[7,] 3.025000 -8.975000
[8,] 11.437500 3.025000
[9,] 10.437500 11.437500
[10,] -2.762500 10.437500
[11,] -5.562500 -2.762500
[12,] -10.928125 -5.562500
[13,] -9.328125 -10.928125
[14,] -7.328125 -9.328125
[15,] -8.928125 -7.328125
[16,] -8.128125 -8.928125
[17,] -9.128125 -8.128125
[18,] -3.928125 -9.128125
[19,] -9.928125 -3.928125
[20,] -13.281250 -9.928125
[21,] -8.281250 -13.281250
[22,] 0.518750 -8.281250
[23,] 0.718750 0.518750
[24,] -2.646875 0.718750
[25,] -2.046875 -2.646875
[26,] -2.046875 -2.046875
[27,] 4.353125 -2.046875
[28,] 3.153125 4.353125
[29,] 7.153125 3.153125
[30,] 13.353125 7.153125
[31,] 10.353125 13.353125
[32,] 7.000000 10.353125
[33,] 3.000000 7.000000
[34,] 3.800000 3.000000
[35,] 9.000000 3.800000
[36,] 5.634375 9.000000
[37,] 7.234375 5.634375
[38,] 8.234375 7.234375
[39,] 4.634375 8.234375
[40,] 4.434375 4.634375
[41,] 8.434375 4.434375
[42,] 3.634375 8.434375
[43,] 6.634375 3.634375
[44,] 7.281250 6.634375
[45,] 14.281250 7.281250
[46,] 16.081250 14.281250
[47,] 14.281250 16.081250
[48,] -0.084375 14.281250
[49,] 0.515625 -0.084375
[50,] 2.515625 0.515625
[51,] -1.084375 2.515625
[52,] -0.284375 -1.084375
[53,] -0.284375 -0.284375
[54,] -4.084375 -0.284375
[55,] -10.084375 -4.084375
[56,] -12.437500 -10.084375
[57,] -19.437500 -12.437500
[58,] -17.637500 -19.437500
[59,] -18.437500 -17.637500
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.625000 8.025000
2 -1.375000 3.625000
3 1.025000 -1.375000
4 0.825000 1.025000
5 -6.175000 0.825000
6 -8.975000 -6.175000
7 3.025000 -8.975000
8 11.437500 3.025000
9 10.437500 11.437500
10 -2.762500 10.437500
11 -5.562500 -2.762500
12 -10.928125 -5.562500
13 -9.328125 -10.928125
14 -7.328125 -9.328125
15 -8.928125 -7.328125
16 -8.128125 -8.928125
17 -9.128125 -8.128125
18 -3.928125 -9.128125
19 -9.928125 -3.928125
20 -13.281250 -9.928125
21 -8.281250 -13.281250
22 0.518750 -8.281250
23 0.718750 0.518750
24 -2.646875 0.718750
25 -2.046875 -2.646875
26 -2.046875 -2.046875
27 4.353125 -2.046875
28 3.153125 4.353125
29 7.153125 3.153125
30 13.353125 7.153125
31 10.353125 13.353125
32 7.000000 10.353125
33 3.000000 7.000000
34 3.800000 3.000000
35 9.000000 3.800000
36 5.634375 9.000000
37 7.234375 5.634375
38 8.234375 7.234375
39 4.634375 8.234375
40 4.434375 4.634375
41 8.434375 4.434375
42 3.634375 8.434375
43 6.634375 3.634375
44 7.281250 6.634375
45 14.281250 7.281250
46 16.081250 14.281250
47 14.281250 16.081250
48 -0.084375 14.281250
49 0.515625 -0.084375
50 2.515625 0.515625
51 -1.084375 2.515625
52 -0.284375 -1.084375
53 -0.284375 -0.284375
54 -4.084375 -0.284375
55 -10.084375 -4.084375
56 -12.437500 -10.084375
57 -19.437500 -12.437500
58 -17.637500 -19.437500
59 -18.437500 -17.637500
> 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/76s8o1229783304.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/8vfzw1229783304.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/9q9ay1229783304.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/10s6yv1229783304.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/11yt001229783304.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/12ftvw1229783304.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/1314is1229783304.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/14krce1229783304.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/15l61k1229783304.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/16jrq81229783304.tab")
+ }
>
> system("convert tmp/1ixjw1229783303.ps tmp/1ixjw1229783303.png")
> system("convert tmp/2ztcp1229783303.ps tmp/2ztcp1229783303.png")
> system("convert tmp/3l2521229783303.ps tmp/3l2521229783303.png")
> system("convert tmp/4ga3f1229783303.ps tmp/4ga3f1229783303.png")
> system("convert tmp/5pple1229783304.ps tmp/5pple1229783304.png")
> system("convert tmp/6lz1l1229783304.ps tmp/6lz1l1229783304.png")
> system("convert tmp/76s8o1229783304.ps tmp/76s8o1229783304.png")
> system("convert tmp/8vfzw1229783304.ps tmp/8vfzw1229783304.png")
> system("convert tmp/9q9ay1229783304.ps tmp/9q9ay1229783304.png")
> system("convert tmp/10s6yv1229783304.ps tmp/10s6yv1229783304.png")
>
>
> proc.time()
user system elapsed
2.478 1.615 3.269