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(555,0,562,0,561,0,555,0,544,0,537,0,543,0,594,0,611,0,613,0,611,0,594,0,595,0,591,0,589,0,584,0,573,0,567,0,569,0,621,0,629,0,628,0,612,0,595,0,597,0,593,0,590,0,580,0,574,0,573,0,573,0,620,0,626,0,620,0,588,1,566,1,557,1,561,1,549,1,532,1,526,1,511,1,499,1,555,1,565,1,542,1,527,1,510,1,514,1,517,1,508,1,493,1,490,1,469,1,478,1,528,1,534,1,518,1,506,1,502,1),dim=c(2,60),dimnames=list(c('Totale_werkloosheid','Dummyvariabele'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Totale_werkloosheid','Dummyvariabele'),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 = 'No 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
Totale_werkloosheid Dummyvariabele M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 555 0 1 0 0 0 0 0 0 0 0 0 0
2 562 0 0 1 0 0 0 0 0 0 0 0 0
3 561 0 0 0 1 0 0 0 0 0 0 0 0
4 555 0 0 0 0 1 0 0 0 0 0 0 0
5 544 0 0 0 0 0 1 0 0 0 0 0 0
6 537 0 0 0 0 0 0 1 0 0 0 0 0
7 543 0 0 0 0 0 0 0 1 0 0 0 0
8 594 0 0 0 0 0 0 0 0 1 0 0 0
9 611 0 0 0 0 0 0 0 0 0 1 0 0
10 613 0 0 0 0 0 0 0 0 0 0 1 0
11 611 0 0 0 0 0 0 0 0 0 0 0 1
12 594 0 0 0 0 0 0 0 0 0 0 0 0
13 595 0 1 0 0 0 0 0 0 0 0 0 0
14 591 0 0 1 0 0 0 0 0 0 0 0 0
15 589 0 0 0 1 0 0 0 0 0 0 0 0
16 584 0 0 0 0 1 0 0 0 0 0 0 0
17 573 0 0 0 0 0 1 0 0 0 0 0 0
18 567 0 0 0 0 0 0 1 0 0 0 0 0
19 569 0 0 0 0 0 0 0 1 0 0 0 0
20 621 0 0 0 0 0 0 0 0 1 0 0 0
21 629 0 0 0 0 0 0 0 0 0 1 0 0
22 628 0 0 0 0 0 0 0 0 0 0 1 0
23 612 0 0 0 0 0 0 0 0 0 0 0 1
24 595 0 0 0 0 0 0 0 0 0 0 0 0
25 597 0 1 0 0 0 0 0 0 0 0 0 0
26 593 0 0 1 0 0 0 0 0 0 0 0 0
27 590 0 0 0 1 0 0 0 0 0 0 0 0
28 580 0 0 0 0 1 0 0 0 0 0 0 0
29 574 0 0 0 0 0 1 0 0 0 0 0 0
30 573 0 0 0 0 0 0 1 0 0 0 0 0
31 573 0 0 0 0 0 0 0 1 0 0 0 0
32 620 0 0 0 0 0 0 0 0 1 0 0 0
33 626 0 0 0 0 0 0 0 0 0 1 0 0
34 620 0 0 0 0 0 0 0 0 0 0 1 0
35 588 1 0 0 0 0 0 0 0 0 0 0 1
36 566 1 0 0 0 0 0 0 0 0 0 0 0
37 557 1 1 0 0 0 0 0 0 0 0 0 0
38 561 1 0 1 0 0 0 0 0 0 0 0 0
39 549 1 0 0 1 0 0 0 0 0 0 0 0
40 532 1 0 0 0 1 0 0 0 0 0 0 0
41 526 1 0 0 0 0 1 0 0 0 0 0 0
42 511 1 0 0 0 0 0 1 0 0 0 0 0
43 499 1 0 0 0 0 0 0 1 0 0 0 0
44 555 1 0 0 0 0 0 0 0 1 0 0 0
45 565 1 0 0 0 0 0 0 0 0 1 0 0
46 542 1 0 0 0 0 0 0 0 0 0 1 0
47 527 1 0 0 0 0 0 0 0 0 0 0 1
48 510 1 0 0 0 0 0 0 0 0 0 0 0
49 514 1 1 0 0 0 0 0 0 0 0 0 0
50 517 1 0 1 0 0 0 0 0 0 0 0 0
51 508 1 0 0 1 0 0 0 0 0 0 0 0
52 493 1 0 0 0 1 0 0 0 0 0 0 0
53 490 1 0 0 0 0 1 0 0 0 0 0 0
54 469 1 0 0 0 0 0 1 0 0 0 0 0
55 478 1 0 0 0 0 0 0 1 0 0 0 0
56 528 1 0 0 0 0 0 0 0 1 0 0 0
57 534 1 0 0 0 0 0 0 0 0 1 0 0
58 518 1 0 0 0 0 0 0 0 0 0 1 0
59 506 1 0 0 0 0 0 0 0 0 0 0 1
60 502 1 0 0 0 0 0 0 0 0 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummyvariabele M1 M2 M3
592.017 -64.361 -2.672 -1.472 -6.872
M4 M5 M6 M7 M8
-17.472 -24.872 -34.872 -33.872 17.328
M9 M10 M11
26.728 17.928 15.400
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-37.056 -15.851 3.719 10.346 44.944
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 592.017 9.826 60.248 < 2e-16 ***
Dummyvariabele -64.361 5.459 -11.790 1.22e-15 ***
M1 -2.672 13.147 -0.203 0.8398
M2 -1.472 13.147 -0.112 0.9113
M3 -6.872 13.147 -0.523 0.6036
M4 -17.472 13.147 -1.329 0.1903
M5 -24.872 13.147 -1.892 0.0647 .
M6 -34.872 13.147 -2.652 0.0109 *
M7 -33.872 13.147 -2.576 0.0132 *
M8 17.328 13.147 1.318 0.1939
M9 26.728 13.147 2.033 0.0477 *
M10 17.928 13.147 1.364 0.1792
M11 15.400 13.102 1.175 0.2458
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 20.72 on 47 degrees of freedom
Multiple R-squared: 0.8023, Adjusted R-squared: 0.7518
F-statistic: 15.89 on 12 and 47 DF, p-value: 1.084e-12
> 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.776075130 0.44784974 0.2239249
[2,] 0.725807341 0.54838532 0.2741927
[3,] 0.682370758 0.63525848 0.3176292
[4,] 0.619221748 0.76155650 0.3807783
[5,] 0.562006283 0.87598743 0.4379937
[6,] 0.470554101 0.94110820 0.5294459
[7,] 0.389335599 0.77867120 0.6106644
[8,] 0.285588526 0.57117705 0.7144115
[9,] 0.199361060 0.39872212 0.8006389
[10,] 0.168215434 0.33643087 0.8317846
[11,] 0.133447076 0.26689415 0.8665529
[12,] 0.099126426 0.19825285 0.9008736
[13,] 0.066535528 0.13307106 0.9334645
[14,] 0.047458305 0.09491661 0.9525417
[15,] 0.035275829 0.07055166 0.9647242
[16,] 0.023454851 0.04690970 0.9765451
[17,] 0.013963410 0.02792682 0.9860366
[18,] 0.007529885 0.01505977 0.9924701
[19,] 0.003656500 0.00731300 0.9963435
[20,] 0.010830332 0.02166066 0.9891697
[21,] 0.027103103 0.05420621 0.9728969
[22,] 0.029914881 0.05982976 0.9700851
[23,] 0.038190010 0.07638002 0.9618100
[24,] 0.049028426 0.09805685 0.9509716
[25,] 0.069698413 0.13939683 0.9303016
[26,] 0.090050054 0.18010011 0.9099499
[27,] 0.193008356 0.38601671 0.8069916
[28,] 0.197866652 0.39573330 0.8021333
[29,] 0.218573167 0.43714633 0.7814268
> postscript(file="/var/www/html/rcomp/tmp/1kjsn1230125346.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/21wrn1230125346.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/3p0sz1230125346.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/4rhdg1230125346.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/5eukq1230125346.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
-34.3444444 -28.5444444 -24.1444444 -19.5444444 -23.1444444 -20.1444444
7 8 9 10 11 12
-15.1444444 -15.3444444 -7.7444444 3.0555556 3.5833333 1.9833333
13 14 15 16 17 18
5.6555556 0.4555556 3.8555556 9.4555556 5.8555556 9.8555556
19 20 21 22 23 24
10.8555556 11.6555556 10.2555556 18.0555556 4.5833333 2.9833333
25 26 27 28 29 30
7.6555556 2.4555556 4.8555556 5.4555556 6.8555556 15.8555556
31 32 33 34 35 36
14.8555556 10.6555556 7.2555556 10.0555556 44.9444444 38.3444444
37 38 39 40 41 42
32.0166667 34.8166667 28.2166667 21.8166667 23.2166667 18.2166667
43 44 45 46 47 48
5.2166667 10.0166667 10.6166667 -3.5833333 -16.0555556 -17.6555556
49 50 51 52 53 54
-10.9833333 -9.1833333 -12.7833333 -17.1833333 -12.7833333 -23.7833333
55 56 57 58 59 60
-15.7833333 -16.9833333 -20.3833333 -27.5833333 -37.0555556 -25.6555556
> postscript(file="/var/www/html/rcomp/tmp/6qecr1230125346.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 -34.3444444 NA
1 -28.5444444 -34.3444444
2 -24.1444444 -28.5444444
3 -19.5444444 -24.1444444
4 -23.1444444 -19.5444444
5 -20.1444444 -23.1444444
6 -15.1444444 -20.1444444
7 -15.3444444 -15.1444444
8 -7.7444444 -15.3444444
9 3.0555556 -7.7444444
10 3.5833333 3.0555556
11 1.9833333 3.5833333
12 5.6555556 1.9833333
13 0.4555556 5.6555556
14 3.8555556 0.4555556
15 9.4555556 3.8555556
16 5.8555556 9.4555556
17 9.8555556 5.8555556
18 10.8555556 9.8555556
19 11.6555556 10.8555556
20 10.2555556 11.6555556
21 18.0555556 10.2555556
22 4.5833333 18.0555556
23 2.9833333 4.5833333
24 7.6555556 2.9833333
25 2.4555556 7.6555556
26 4.8555556 2.4555556
27 5.4555556 4.8555556
28 6.8555556 5.4555556
29 15.8555556 6.8555556
30 14.8555556 15.8555556
31 10.6555556 14.8555556
32 7.2555556 10.6555556
33 10.0555556 7.2555556
34 44.9444444 10.0555556
35 38.3444444 44.9444444
36 32.0166667 38.3444444
37 34.8166667 32.0166667
38 28.2166667 34.8166667
39 21.8166667 28.2166667
40 23.2166667 21.8166667
41 18.2166667 23.2166667
42 5.2166667 18.2166667
43 10.0166667 5.2166667
44 10.6166667 10.0166667
45 -3.5833333 10.6166667
46 -16.0555556 -3.5833333
47 -17.6555556 -16.0555556
48 -10.9833333 -17.6555556
49 -9.1833333 -10.9833333
50 -12.7833333 -9.1833333
51 -17.1833333 -12.7833333
52 -12.7833333 -17.1833333
53 -23.7833333 -12.7833333
54 -15.7833333 -23.7833333
55 -16.9833333 -15.7833333
56 -20.3833333 -16.9833333
57 -27.5833333 -20.3833333
58 -37.0555556 -27.5833333
59 -25.6555556 -37.0555556
60 NA -25.6555556
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -28.5444444 -34.3444444
[2,] -24.1444444 -28.5444444
[3,] -19.5444444 -24.1444444
[4,] -23.1444444 -19.5444444
[5,] -20.1444444 -23.1444444
[6,] -15.1444444 -20.1444444
[7,] -15.3444444 -15.1444444
[8,] -7.7444444 -15.3444444
[9,] 3.0555556 -7.7444444
[10,] 3.5833333 3.0555556
[11,] 1.9833333 3.5833333
[12,] 5.6555556 1.9833333
[13,] 0.4555556 5.6555556
[14,] 3.8555556 0.4555556
[15,] 9.4555556 3.8555556
[16,] 5.8555556 9.4555556
[17,] 9.8555556 5.8555556
[18,] 10.8555556 9.8555556
[19,] 11.6555556 10.8555556
[20,] 10.2555556 11.6555556
[21,] 18.0555556 10.2555556
[22,] 4.5833333 18.0555556
[23,] 2.9833333 4.5833333
[24,] 7.6555556 2.9833333
[25,] 2.4555556 7.6555556
[26,] 4.8555556 2.4555556
[27,] 5.4555556 4.8555556
[28,] 6.8555556 5.4555556
[29,] 15.8555556 6.8555556
[30,] 14.8555556 15.8555556
[31,] 10.6555556 14.8555556
[32,] 7.2555556 10.6555556
[33,] 10.0555556 7.2555556
[34,] 44.9444444 10.0555556
[35,] 38.3444444 44.9444444
[36,] 32.0166667 38.3444444
[37,] 34.8166667 32.0166667
[38,] 28.2166667 34.8166667
[39,] 21.8166667 28.2166667
[40,] 23.2166667 21.8166667
[41,] 18.2166667 23.2166667
[42,] 5.2166667 18.2166667
[43,] 10.0166667 5.2166667
[44,] 10.6166667 10.0166667
[45,] -3.5833333 10.6166667
[46,] -16.0555556 -3.5833333
[47,] -17.6555556 -16.0555556
[48,] -10.9833333 -17.6555556
[49,] -9.1833333 -10.9833333
[50,] -12.7833333 -9.1833333
[51,] -17.1833333 -12.7833333
[52,] -12.7833333 -17.1833333
[53,] -23.7833333 -12.7833333
[54,] -15.7833333 -23.7833333
[55,] -16.9833333 -15.7833333
[56,] -20.3833333 -16.9833333
[57,] -27.5833333 -20.3833333
[58,] -37.0555556 -27.5833333
[59,] -25.6555556 -37.0555556
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -28.5444444 -34.3444444
2 -24.1444444 -28.5444444
3 -19.5444444 -24.1444444
4 -23.1444444 -19.5444444
5 -20.1444444 -23.1444444
6 -15.1444444 -20.1444444
7 -15.3444444 -15.1444444
8 -7.7444444 -15.3444444
9 3.0555556 -7.7444444
10 3.5833333 3.0555556
11 1.9833333 3.5833333
12 5.6555556 1.9833333
13 0.4555556 5.6555556
14 3.8555556 0.4555556
15 9.4555556 3.8555556
16 5.8555556 9.4555556
17 9.8555556 5.8555556
18 10.8555556 9.8555556
19 11.6555556 10.8555556
20 10.2555556 11.6555556
21 18.0555556 10.2555556
22 4.5833333 18.0555556
23 2.9833333 4.5833333
24 7.6555556 2.9833333
25 2.4555556 7.6555556
26 4.8555556 2.4555556
27 5.4555556 4.8555556
28 6.8555556 5.4555556
29 15.8555556 6.8555556
30 14.8555556 15.8555556
31 10.6555556 14.8555556
32 7.2555556 10.6555556
33 10.0555556 7.2555556
34 44.9444444 10.0555556
35 38.3444444 44.9444444
36 32.0166667 38.3444444
37 34.8166667 32.0166667
38 28.2166667 34.8166667
39 21.8166667 28.2166667
40 23.2166667 21.8166667
41 18.2166667 23.2166667
42 5.2166667 18.2166667
43 10.0166667 5.2166667
44 10.6166667 10.0166667
45 -3.5833333 10.6166667
46 -16.0555556 -3.5833333
47 -17.6555556 -16.0555556
48 -10.9833333 -17.6555556
49 -9.1833333 -10.9833333
50 -12.7833333 -9.1833333
51 -17.1833333 -12.7833333
52 -12.7833333 -17.1833333
53 -23.7833333 -12.7833333
54 -15.7833333 -23.7833333
55 -16.9833333 -15.7833333
56 -20.3833333 -16.9833333
57 -27.5833333 -20.3833333
58 -37.0555556 -27.5833333
59 -25.6555556 -37.0555556
> 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/7lko61230125346.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/821rr1230125346.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/9taxa1230125346.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/10x30k1230125346.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/118nkz1230125346.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/12vi3r1230125346.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/13pitq1230125346.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/14g9v01230125346.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/1594wz1230125346.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/16vlkq1230125347.tab")
+ }
>
> system("convert tmp/1kjsn1230125346.ps tmp/1kjsn1230125346.png")
> system("convert tmp/21wrn1230125346.ps tmp/21wrn1230125346.png")
> system("convert tmp/3p0sz1230125346.ps tmp/3p0sz1230125346.png")
> system("convert tmp/4rhdg1230125346.ps tmp/4rhdg1230125346.png")
> system("convert tmp/5eukq1230125346.ps tmp/5eukq1230125346.png")
> system("convert tmp/6qecr1230125346.ps tmp/6qecr1230125346.png")
> system("convert tmp/7lko61230125346.ps tmp/7lko61230125346.png")
> system("convert tmp/821rr1230125346.ps tmp/821rr1230125346.png")
> system("convert tmp/9taxa1230125346.ps tmp/9taxa1230125346.png")
> system("convert tmp/10x30k1230125346.ps tmp/10x30k1230125346.png")
>
>
> proc.time()
user system elapsed
2.454 1.560 3.411