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(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,0,566,0,557,0,561,0,549,0,532,0,526,0,511,0,499,0,555,0,565,0,542,0,527,0,510,0,514,0,517,0,508,0,493,0,490,0,469,0,478,0,528,0,534,0,518,1,506,1,502,1,516,1,528,1,533,1,536,1,537,1,524,1,536,1,587,1,597,1,581,1),dim=c(2,61),dimnames=list(c('WlhBe','X'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('WlhBe','X'),1:61))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
WlhBe X
1 613 0
2 611 0
3 594 0
4 595 0
5 591 0
6 589 0
7 584 0
8 573 0
9 567 0
10 569 0
11 621 0
12 629 0
13 628 0
14 612 0
15 595 0
16 597 0
17 593 0
18 590 0
19 580 0
20 574 0
21 573 0
22 573 0
23 620 0
24 626 0
25 620 0
26 588 0
27 566 0
28 557 0
29 561 0
30 549 0
31 532 0
32 526 0
33 511 0
34 499 0
35 555 0
36 565 0
37 542 0
38 527 0
39 510 0
40 514 0
41 517 0
42 508 0
43 493 0
44 490 0
45 469 0
46 478 0
47 528 0
48 534 0
49 518 1
50 506 1
51 502 1
52 516 1
53 528 1
54 533 1
55 536 1
56 537 1
57 524 1
58 536 1
59 587 1
60 597 1
61 581 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
563.25 -24.71
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-94.25 -31.25 1.75 30.75 65.75
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 563.250 5.938 94.861 <2e-16 ***
X -24.712 12.862 -1.921 0.0595 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 41.14 on 59 degrees of freedom
Multiple R-squared: 0.05888, Adjusted R-squared: 0.04293
F-statistic: 3.691 on 1 and 59 DF, p-value: 0.05953
> 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.0316833487 0.063366697 0.96831665
[2,] 0.0117627596 0.023525519 0.98823724
[3,] 0.0056709132 0.011341826 0.99432909
[4,] 0.0059262943 0.011852589 0.99407371
[5,] 0.0065463732 0.013092746 0.99345363
[6,] 0.0045973435 0.009194687 0.99540266
[7,] 0.0073511369 0.014702274 0.99264886
[8,] 0.0146369227 0.029273845 0.98536308
[9,] 0.0211731261 0.042346252 0.97882687
[10,] 0.0156653221 0.031330644 0.98433468
[11,] 0.0091995284 0.018399057 0.99080047
[12,] 0.0054546820 0.010909364 0.99454532
[13,] 0.0032342792 0.006468558 0.99676572
[14,] 0.0019586310 0.003917262 0.99804137
[15,] 0.0013967806 0.002793561 0.99860322
[16,] 0.0011719704 0.002343941 0.99882803
[17,] 0.0009810876 0.001962175 0.99901891
[18,] 0.0007981595 0.001596319 0.99920184
[19,] 0.0018088000 0.003617600 0.99819120
[20,] 0.0072900579 0.014580116 0.99270994
[21,] 0.0246346037 0.049269207 0.97536540
[22,] 0.0334674884 0.066934977 0.96653251
[23,] 0.0498065960 0.099613192 0.95019340
[24,] 0.0804925920 0.160985184 0.91950741
[25,] 0.1159471310 0.231894262 0.88405287
[26,] 0.1765616789 0.353123358 0.82343832
[27,] 0.2911130905 0.582226181 0.70888691
[28,] 0.4134227237 0.826845447 0.58657728
[29,] 0.5753977265 0.849204547 0.42460227
[30,] 0.7359438425 0.528112315 0.26405616
[31,] 0.7553251123 0.489349775 0.24467489
[32,] 0.8196562975 0.360687405 0.18034370
[33,] 0.8407655333 0.318468933 0.15923447
[34,] 0.8522924121 0.295415176 0.14770759
[35,] 0.8664612316 0.267077537 0.13353877
[36,] 0.8681978737 0.263604253 0.13180213
[37,] 0.8642957941 0.271408412 0.13570421
[38,] 0.8588549212 0.282290158 0.14114508
[39,] 0.8626053987 0.274789203 0.13739460
[40,] 0.8630035325 0.273992935 0.13699647
[41,] 0.9122009071 0.175598186 0.08779909
[42,] 0.9443114335 0.111377133 0.05568857
[43,] 0.9150958394 0.169808321 0.08490416
[44,] 0.8715934988 0.256813002 0.12840650
[45,] 0.8272275937 0.345544813 0.17277241
[46,] 0.8123637743 0.375272451 0.18763623
[47,] 0.8299516454 0.340096709 0.17004835
[48,] 0.8104366902 0.379126620 0.18956331
[49,] 0.7539992820 0.492001436 0.24600072
[50,] 0.6744250902 0.651149820 0.32557491
[51,] 0.5752814770 0.849437046 0.42471852
[52,] 0.4683111518 0.936622304 0.53168885
> postscript(file="/var/www/html/rcomp/tmp/1wdcz1258724338.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/2vu541258724338.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/3kkid1258724338.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/4bor61258724338.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/5tc8g1258724338.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 = 61
Frequency = 1
1 2 3 4 5 6 7
49.750000 47.750000 30.750000 31.750000 27.750000 25.750000 20.750000
8 9 10 11 12 13 14
9.750000 3.750000 5.750000 57.750000 65.750000 64.750000 48.750000
15 16 17 18 19 20 21
31.750000 33.750000 29.750000 26.750000 16.750000 10.750000 9.750000
22 23 24 25 26 27 28
9.750000 56.750000 62.750000 56.750000 24.750000 2.750000 -6.250000
29 30 31 32 33 34 35
-2.250000 -14.250000 -31.250000 -37.250000 -52.250000 -64.250000 -8.250000
36 37 38 39 40 41 42
1.750000 -21.250000 -36.250000 -53.250000 -49.250000 -46.250000 -55.250000
43 44 45 46 47 48 49
-70.250000 -73.250000 -94.250000 -85.250000 -35.250000 -29.250000 -20.538462
50 51 52 53 54 55 56
-32.538462 -36.538462 -22.538462 -10.538462 -5.538462 -2.538462 -1.538462
57 58 59 60 61
-14.538462 -2.538462 48.461538 58.461538 42.461538
> postscript(file="/var/www/html/rcomp/tmp/6ak2r1258724338.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 = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 49.750000 NA
1 47.750000 49.750000
2 30.750000 47.750000
3 31.750000 30.750000
4 27.750000 31.750000
5 25.750000 27.750000
6 20.750000 25.750000
7 9.750000 20.750000
8 3.750000 9.750000
9 5.750000 3.750000
10 57.750000 5.750000
11 65.750000 57.750000
12 64.750000 65.750000
13 48.750000 64.750000
14 31.750000 48.750000
15 33.750000 31.750000
16 29.750000 33.750000
17 26.750000 29.750000
18 16.750000 26.750000
19 10.750000 16.750000
20 9.750000 10.750000
21 9.750000 9.750000
22 56.750000 9.750000
23 62.750000 56.750000
24 56.750000 62.750000
25 24.750000 56.750000
26 2.750000 24.750000
27 -6.250000 2.750000
28 -2.250000 -6.250000
29 -14.250000 -2.250000
30 -31.250000 -14.250000
31 -37.250000 -31.250000
32 -52.250000 -37.250000
33 -64.250000 -52.250000
34 -8.250000 -64.250000
35 1.750000 -8.250000
36 -21.250000 1.750000
37 -36.250000 -21.250000
38 -53.250000 -36.250000
39 -49.250000 -53.250000
40 -46.250000 -49.250000
41 -55.250000 -46.250000
42 -70.250000 -55.250000
43 -73.250000 -70.250000
44 -94.250000 -73.250000
45 -85.250000 -94.250000
46 -35.250000 -85.250000
47 -29.250000 -35.250000
48 -20.538462 -29.250000
49 -32.538462 -20.538462
50 -36.538462 -32.538462
51 -22.538462 -36.538462
52 -10.538462 -22.538462
53 -5.538462 -10.538462
54 -2.538462 -5.538462
55 -1.538462 -2.538462
56 -14.538462 -1.538462
57 -2.538462 -14.538462
58 48.461538 -2.538462
59 58.461538 48.461538
60 42.461538 58.461538
61 NA 42.461538
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 47.750000 49.750000
[2,] 30.750000 47.750000
[3,] 31.750000 30.750000
[4,] 27.750000 31.750000
[5,] 25.750000 27.750000
[6,] 20.750000 25.750000
[7,] 9.750000 20.750000
[8,] 3.750000 9.750000
[9,] 5.750000 3.750000
[10,] 57.750000 5.750000
[11,] 65.750000 57.750000
[12,] 64.750000 65.750000
[13,] 48.750000 64.750000
[14,] 31.750000 48.750000
[15,] 33.750000 31.750000
[16,] 29.750000 33.750000
[17,] 26.750000 29.750000
[18,] 16.750000 26.750000
[19,] 10.750000 16.750000
[20,] 9.750000 10.750000
[21,] 9.750000 9.750000
[22,] 56.750000 9.750000
[23,] 62.750000 56.750000
[24,] 56.750000 62.750000
[25,] 24.750000 56.750000
[26,] 2.750000 24.750000
[27,] -6.250000 2.750000
[28,] -2.250000 -6.250000
[29,] -14.250000 -2.250000
[30,] -31.250000 -14.250000
[31,] -37.250000 -31.250000
[32,] -52.250000 -37.250000
[33,] -64.250000 -52.250000
[34,] -8.250000 -64.250000
[35,] 1.750000 -8.250000
[36,] -21.250000 1.750000
[37,] -36.250000 -21.250000
[38,] -53.250000 -36.250000
[39,] -49.250000 -53.250000
[40,] -46.250000 -49.250000
[41,] -55.250000 -46.250000
[42,] -70.250000 -55.250000
[43,] -73.250000 -70.250000
[44,] -94.250000 -73.250000
[45,] -85.250000 -94.250000
[46,] -35.250000 -85.250000
[47,] -29.250000 -35.250000
[48,] -20.538462 -29.250000
[49,] -32.538462 -20.538462
[50,] -36.538462 -32.538462
[51,] -22.538462 -36.538462
[52,] -10.538462 -22.538462
[53,] -5.538462 -10.538462
[54,] -2.538462 -5.538462
[55,] -1.538462 -2.538462
[56,] -14.538462 -1.538462
[57,] -2.538462 -14.538462
[58,] 48.461538 -2.538462
[59,] 58.461538 48.461538
[60,] 42.461538 58.461538
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 47.750000 49.750000
2 30.750000 47.750000
3 31.750000 30.750000
4 27.750000 31.750000
5 25.750000 27.750000
6 20.750000 25.750000
7 9.750000 20.750000
8 3.750000 9.750000
9 5.750000 3.750000
10 57.750000 5.750000
11 65.750000 57.750000
12 64.750000 65.750000
13 48.750000 64.750000
14 31.750000 48.750000
15 33.750000 31.750000
16 29.750000 33.750000
17 26.750000 29.750000
18 16.750000 26.750000
19 10.750000 16.750000
20 9.750000 10.750000
21 9.750000 9.750000
22 56.750000 9.750000
23 62.750000 56.750000
24 56.750000 62.750000
25 24.750000 56.750000
26 2.750000 24.750000
27 -6.250000 2.750000
28 -2.250000 -6.250000
29 -14.250000 -2.250000
30 -31.250000 -14.250000
31 -37.250000 -31.250000
32 -52.250000 -37.250000
33 -64.250000 -52.250000
34 -8.250000 -64.250000
35 1.750000 -8.250000
36 -21.250000 1.750000
37 -36.250000 -21.250000
38 -53.250000 -36.250000
39 -49.250000 -53.250000
40 -46.250000 -49.250000
41 -55.250000 -46.250000
42 -70.250000 -55.250000
43 -73.250000 -70.250000
44 -94.250000 -73.250000
45 -85.250000 -94.250000
46 -35.250000 -85.250000
47 -29.250000 -35.250000
48 -20.538462 -29.250000
49 -32.538462 -20.538462
50 -36.538462 -32.538462
51 -22.538462 -36.538462
52 -10.538462 -22.538462
53 -5.538462 -10.538462
54 -2.538462 -5.538462
55 -1.538462 -2.538462
56 -14.538462 -1.538462
57 -2.538462 -14.538462
58 48.461538 -2.538462
59 58.461538 48.461538
60 42.461538 58.461538
> 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/7m2ig1258724338.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/8ygmo1258724338.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/9jv6a1258724338.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/10rwzl1258724338.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/116d2o1258724338.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/12qvhw1258724338.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/13a9we1258724338.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/143v8a1258724338.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/15g9jq1258724338.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/1635aq1258724338.tab")
+ }
>
> system("convert tmp/1wdcz1258724338.ps tmp/1wdcz1258724338.png")
> system("convert tmp/2vu541258724338.ps tmp/2vu541258724338.png")
> system("convert tmp/3kkid1258724338.ps tmp/3kkid1258724338.png")
> system("convert tmp/4bor61258724338.ps tmp/4bor61258724338.png")
> system("convert tmp/5tc8g1258724338.ps tmp/5tc8g1258724338.png")
> system("convert tmp/6ak2r1258724338.ps tmp/6ak2r1258724338.png")
> system("convert tmp/7m2ig1258724338.ps tmp/7m2ig1258724338.png")
> system("convert tmp/8ygmo1258724338.ps tmp/8ygmo1258724338.png")
> system("convert tmp/9jv6a1258724338.ps tmp/9jv6a1258724338.png")
> system("convert tmp/10rwzl1258724338.ps tmp/10rwzl1258724338.png")
>
>
> proc.time()
user system elapsed
2.521 1.574 2.963