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.
Natural language support but running in an English locale
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(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,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,516,1,528,1,533,1,536,1,537,1,524,1,536,1,587,1,597,1,581,1,564,1,558,1,575,1),dim=c(2,60),dimnames=list(c('Werk','Crisis'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Werk','Crisis'),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 = '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
Werk Crisis
1 591 0
2 589 0
3 584 0
4 573 0
5 567 0
6 569 0
7 621 0
8 629 0
9 628 0
10 612 0
11 595 0
12 597 0
13 593 0
14 590 0
15 580 0
16 574 0
17 573 0
18 573 0
19 620 0
20 626 0
21 620 0
22 588 0
23 566 0
24 557 0
25 561 0
26 549 0
27 532 0
28 526 0
29 511 0
30 499 0
31 555 1
32 565 1
33 542 1
34 527 1
35 510 1
36 514 1
37 517 1
38 508 1
39 493 1
40 490 1
41 469 1
42 478 1
43 528 1
44 534 1
45 518 1
46 506 1
47 502 1
48 516 1
49 528 1
50 533 1
51 536 1
52 537 1
53 524 1
54 536 1
55 587 1
56 597 1
57 581 1
58 564 1
59 558 1
60 575 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Crisis
579.77 -48.83
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-80.77 -17.39 -1.35 18.94 66.07
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 579.767 5.956 97.341 < 2e-16 ***
Crisis -48.833 8.423 -5.798 2.93e-07 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 32.62 on 58 degrees of freedom
Multiple R-squared: 0.3669, Adjusted R-squared: 0.356
F-statistic: 33.61 on 1 and 58 DF, p-value: 2.932e-07
> 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.05493840 0.10987679 0.9450616
[2,] 0.02395418 0.04790836 0.9760458
[3,] 0.12388461 0.24776923 0.8761154
[4,] 0.23628454 0.47256909 0.7637155
[5,] 0.29101868 0.58203736 0.7089813
[6,] 0.23426493 0.46852985 0.7657351
[7,] 0.15935142 0.31870285 0.8406486
[8,] 0.10518150 0.21036300 0.8948185
[9,] 0.06687669 0.13375337 0.9331233
[10,] 0.04159181 0.08318363 0.9584082
[11,] 0.02829582 0.05659165 0.9717042
[12,] 0.02138788 0.04277576 0.9786121
[13,] 0.01591907 0.03183814 0.9840809
[14,] 0.01138756 0.02277511 0.9886124
[15,] 0.01648718 0.03297436 0.9835128
[16,] 0.03402155 0.06804310 0.9659785
[17,] 0.05792559 0.11585119 0.9420744
[18,] 0.05267860 0.10535720 0.9473214
[19,] 0.05872182 0.11744365 0.9412782
[20,] 0.07610165 0.15220329 0.9238984
[21,] 0.08913064 0.17826128 0.9108694
[22,] 0.12408011 0.24816022 0.8759199
[23,] 0.21011565 0.42023129 0.7898844
[24,] 0.31579719 0.63159437 0.6842028
[25,] 0.47107844 0.94215688 0.5289216
[26,] 0.63243163 0.73513674 0.3675684
[27,] 0.57974545 0.84050910 0.4202545
[28,] 0.55261703 0.89476595 0.4473830
[29,] 0.48963249 0.97926498 0.5103675
[30,] 0.42997835 0.85995671 0.5700216
[31,] 0.40057122 0.80114244 0.5994288
[32,] 0.35103219 0.70206438 0.6489678
[33,] 0.29437957 0.58875914 0.7056204
[34,] 0.25861274 0.51722549 0.7413873
[35,] 0.27248898 0.54497796 0.7275110
[36,] 0.30248273 0.60496546 0.6975173
[37,] 0.50506122 0.98987756 0.4949388
[38,] 0.68248766 0.63502469 0.3175123
[39,] 0.61864355 0.76271289 0.3813564
[40,] 0.54445017 0.91109966 0.4555498
[41,] 0.50217193 0.99565614 0.4978281
[42,] 0.53326316 0.93347369 0.4667368
[43,] 0.63156054 0.73687892 0.3684395
[44,] 0.66337540 0.67324920 0.3366246
[45,] 0.64518498 0.70963004 0.3548150
[46,] 0.61370437 0.77259125 0.3862956
[47,] 0.57776364 0.84447271 0.4222364
[48,] 0.55116515 0.89766969 0.4488348
[49,] 0.72158822 0.55682356 0.2784118
[50,] 0.87335163 0.25329673 0.1266484
[51,] 0.80055397 0.39889207 0.1994460
> postscript(file="/var/www/html/freestat/rcomp/tmp/17ntt1292483558.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/www/html/freestat/rcomp/tmp/2zwte1292483558.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/www/html/freestat/rcomp/tmp/3zwte1292483558.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/www/html/freestat/rcomp/tmp/4zwte1292483558.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/www/html/freestat/rcomp/tmp/5zwte1292483558.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
11.2333333 9.2333333 4.2333333 -6.7666667 -12.7666667 -10.7666667
7 8 9 10 11 12
41.2333333 49.2333333 48.2333333 32.2333333 15.2333333 17.2333333
13 14 15 16 17 18
13.2333333 10.2333333 0.2333333 -5.7666667 -6.7666667 -6.7666667
19 20 21 22 23 24
40.2333333 46.2333333 40.2333333 8.2333333 -13.7666667 -22.7666667
25 26 27 28 29 30
-18.7666667 -30.7666667 -47.7666667 -53.7666667 -68.7666667 -80.7666667
31 32 33 34 35 36
24.0666667 34.0666667 11.0666667 -3.9333333 -20.9333333 -16.9333333
37 38 39 40 41 42
-13.9333333 -22.9333333 -37.9333333 -40.9333333 -61.9333333 -52.9333333
43 44 45 46 47 48
-2.9333333 3.0666667 -12.9333333 -24.9333333 -28.9333333 -14.9333333
49 50 51 52 53 54
-2.9333333 2.0666667 5.0666667 6.0666667 -6.9333333 5.0666667
55 56 57 58 59 60
56.0666667 66.0666667 50.0666667 33.0666667 27.0666667 44.0666667
> postscript(file="/var/www/html/freestat/rcomp/tmp/6snsz1292483558.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 11.2333333 NA
1 9.2333333 11.2333333
2 4.2333333 9.2333333
3 -6.7666667 4.2333333
4 -12.7666667 -6.7666667
5 -10.7666667 -12.7666667
6 41.2333333 -10.7666667
7 49.2333333 41.2333333
8 48.2333333 49.2333333
9 32.2333333 48.2333333
10 15.2333333 32.2333333
11 17.2333333 15.2333333
12 13.2333333 17.2333333
13 10.2333333 13.2333333
14 0.2333333 10.2333333
15 -5.7666667 0.2333333
16 -6.7666667 -5.7666667
17 -6.7666667 -6.7666667
18 40.2333333 -6.7666667
19 46.2333333 40.2333333
20 40.2333333 46.2333333
21 8.2333333 40.2333333
22 -13.7666667 8.2333333
23 -22.7666667 -13.7666667
24 -18.7666667 -22.7666667
25 -30.7666667 -18.7666667
26 -47.7666667 -30.7666667
27 -53.7666667 -47.7666667
28 -68.7666667 -53.7666667
29 -80.7666667 -68.7666667
30 24.0666667 -80.7666667
31 34.0666667 24.0666667
32 11.0666667 34.0666667
33 -3.9333333 11.0666667
34 -20.9333333 -3.9333333
35 -16.9333333 -20.9333333
36 -13.9333333 -16.9333333
37 -22.9333333 -13.9333333
38 -37.9333333 -22.9333333
39 -40.9333333 -37.9333333
40 -61.9333333 -40.9333333
41 -52.9333333 -61.9333333
42 -2.9333333 -52.9333333
43 3.0666667 -2.9333333
44 -12.9333333 3.0666667
45 -24.9333333 -12.9333333
46 -28.9333333 -24.9333333
47 -14.9333333 -28.9333333
48 -2.9333333 -14.9333333
49 2.0666667 -2.9333333
50 5.0666667 2.0666667
51 6.0666667 5.0666667
52 -6.9333333 6.0666667
53 5.0666667 -6.9333333
54 56.0666667 5.0666667
55 66.0666667 56.0666667
56 50.0666667 66.0666667
57 33.0666667 50.0666667
58 27.0666667 33.0666667
59 44.0666667 27.0666667
60 NA 44.0666667
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 9.2333333 11.2333333
[2,] 4.2333333 9.2333333
[3,] -6.7666667 4.2333333
[4,] -12.7666667 -6.7666667
[5,] -10.7666667 -12.7666667
[6,] 41.2333333 -10.7666667
[7,] 49.2333333 41.2333333
[8,] 48.2333333 49.2333333
[9,] 32.2333333 48.2333333
[10,] 15.2333333 32.2333333
[11,] 17.2333333 15.2333333
[12,] 13.2333333 17.2333333
[13,] 10.2333333 13.2333333
[14,] 0.2333333 10.2333333
[15,] -5.7666667 0.2333333
[16,] -6.7666667 -5.7666667
[17,] -6.7666667 -6.7666667
[18,] 40.2333333 -6.7666667
[19,] 46.2333333 40.2333333
[20,] 40.2333333 46.2333333
[21,] 8.2333333 40.2333333
[22,] -13.7666667 8.2333333
[23,] -22.7666667 -13.7666667
[24,] -18.7666667 -22.7666667
[25,] -30.7666667 -18.7666667
[26,] -47.7666667 -30.7666667
[27,] -53.7666667 -47.7666667
[28,] -68.7666667 -53.7666667
[29,] -80.7666667 -68.7666667
[30,] 24.0666667 -80.7666667
[31,] 34.0666667 24.0666667
[32,] 11.0666667 34.0666667
[33,] -3.9333333 11.0666667
[34,] -20.9333333 -3.9333333
[35,] -16.9333333 -20.9333333
[36,] -13.9333333 -16.9333333
[37,] -22.9333333 -13.9333333
[38,] -37.9333333 -22.9333333
[39,] -40.9333333 -37.9333333
[40,] -61.9333333 -40.9333333
[41,] -52.9333333 -61.9333333
[42,] -2.9333333 -52.9333333
[43,] 3.0666667 -2.9333333
[44,] -12.9333333 3.0666667
[45,] -24.9333333 -12.9333333
[46,] -28.9333333 -24.9333333
[47,] -14.9333333 -28.9333333
[48,] -2.9333333 -14.9333333
[49,] 2.0666667 -2.9333333
[50,] 5.0666667 2.0666667
[51,] 6.0666667 5.0666667
[52,] -6.9333333 6.0666667
[53,] 5.0666667 -6.9333333
[54,] 56.0666667 5.0666667
[55,] 66.0666667 56.0666667
[56,] 50.0666667 66.0666667
[57,] 33.0666667 50.0666667
[58,] 27.0666667 33.0666667
[59,] 44.0666667 27.0666667
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 9.2333333 11.2333333
2 4.2333333 9.2333333
3 -6.7666667 4.2333333
4 -12.7666667 -6.7666667
5 -10.7666667 -12.7666667
6 41.2333333 -10.7666667
7 49.2333333 41.2333333
8 48.2333333 49.2333333
9 32.2333333 48.2333333
10 15.2333333 32.2333333
11 17.2333333 15.2333333
12 13.2333333 17.2333333
13 10.2333333 13.2333333
14 0.2333333 10.2333333
15 -5.7666667 0.2333333
16 -6.7666667 -5.7666667
17 -6.7666667 -6.7666667
18 40.2333333 -6.7666667
19 46.2333333 40.2333333
20 40.2333333 46.2333333
21 8.2333333 40.2333333
22 -13.7666667 8.2333333
23 -22.7666667 -13.7666667
24 -18.7666667 -22.7666667
25 -30.7666667 -18.7666667
26 -47.7666667 -30.7666667
27 -53.7666667 -47.7666667
28 -68.7666667 -53.7666667
29 -80.7666667 -68.7666667
30 24.0666667 -80.7666667
31 34.0666667 24.0666667
32 11.0666667 34.0666667
33 -3.9333333 11.0666667
34 -20.9333333 -3.9333333
35 -16.9333333 -20.9333333
36 -13.9333333 -16.9333333
37 -22.9333333 -13.9333333
38 -37.9333333 -22.9333333
39 -40.9333333 -37.9333333
40 -61.9333333 -40.9333333
41 -52.9333333 -61.9333333
42 -2.9333333 -52.9333333
43 3.0666667 -2.9333333
44 -12.9333333 3.0666667
45 -24.9333333 -12.9333333
46 -28.9333333 -24.9333333
47 -14.9333333 -28.9333333
48 -2.9333333 -14.9333333
49 2.0666667 -2.9333333
50 5.0666667 2.0666667
51 6.0666667 5.0666667
52 -6.9333333 6.0666667
53 5.0666667 -6.9333333
54 56.0666667 5.0666667
55 66.0666667 56.0666667
56 50.0666667 66.0666667
57 33.0666667 50.0666667
58 27.0666667 33.0666667
59 44.0666667 27.0666667
> 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/freestat/rcomp/tmp/7le9k1292483558.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/www/html/freestat/rcomp/tmp/8le9k1292483558.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/www/html/freestat/rcomp/tmp/9le9k1292483558.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')
hat values (leverages) are all = 0.03333333
and there are no factor predictors; no plot no. 5
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/freestat/rcomp/tmp/10v6q51292483558.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/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11h67b1292483558.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/freestat/rcomp/tmp/12276h1292483558.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/freestat/rcomp/tmp/13gz3p1292483558.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/freestat/rcomp/tmp/14khkd1292483558.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/freestat/rcomp/tmp/15niij1292483558.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/freestat/rcomp/tmp/16qiz71292483558.tab")
+ }
>
> try(system("convert tmp/17ntt1292483558.ps tmp/17ntt1292483558.png",intern=TRUE))
character(0)
> try(system("convert tmp/2zwte1292483558.ps tmp/2zwte1292483558.png",intern=TRUE))
character(0)
> try(system("convert tmp/3zwte1292483558.ps tmp/3zwte1292483558.png",intern=TRUE))
character(0)
> try(system("convert tmp/4zwte1292483558.ps tmp/4zwte1292483558.png",intern=TRUE))
character(0)
> try(system("convert tmp/5zwte1292483558.ps tmp/5zwte1292483558.png",intern=TRUE))
character(0)
> try(system("convert tmp/6snsz1292483558.ps tmp/6snsz1292483558.png",intern=TRUE))
character(0)
> try(system("convert tmp/7le9k1292483558.ps tmp/7le9k1292483558.png",intern=TRUE))
character(0)
> try(system("convert tmp/8le9k1292483558.ps tmp/8le9k1292483558.png",intern=TRUE))
character(0)
> try(system("convert tmp/9le9k1292483558.ps tmp/9le9k1292483558.png",intern=TRUE))
character(0)
> try(system("convert tmp/10v6q51292483558.ps tmp/10v6q51292483558.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.731 2.391 4.052