R version 2.12.1 (2010-12-16)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(22,78.1,1.8,21.8,74.5,1.8,21.5,74.6,1.8,21.3,75.5,1.8,21.1,76.9,1.8,21.2,76.3,1.8,21,73.8,1.8,20.8,73.4,1.8,20.5,75.8,1.8,20.4,76.9,1.8,20.1,73.2,1.8,19.9,72.1,1.8,19.6,74.3,1.8,19.4,73.1,1.8,19.2,72.2,1.8,19.1,69.4,1.8,19.1,70.8,1.8,18.9,71.1,1.8,18.7,71.2,1.8,18.7,70.6,1.8,18.7,71.1,1.8,18.4,70.3,1.8,18.4,68.3,1.8,18.3,68.9,412.3,18.4,71.9,420.3,18.3,73.3,395.5,18.3,70.9,392.1,18,70,378.6,17.7,65.5,338.7,17.7,70.1,285.8,17.9,66.6,255.3,17.6,67.4,256.4,17.7,67.8,287.1,17.4,69.4,353.9,17.1,69.4,406.4,16.8,66.7,406.7,16.5,65,400.7,16.2,63.1,390.1,15.8,65,399.7,15.5,63.9,370.3,15.2,63,301.9,14.9,62.2,285.6,14.6,61.4,330.6,14.4,61,362.3,14.5,58.8,379.1,14.2,61,390.4),dim=c(3,46),dimnames=list(c('sterfte','huwelijk','Unemployment'),1:46))
> y <- array(NA,dim=c(3,46),dimnames=list(c('sterfte','huwelijk','Unemployment'),1:46))
> 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 = '2'
> #'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
> 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
huwelijk sterfte Unemployment M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 78.1 22.0 1.8 1 0 0 0 0 0 0 0 0 0 0
2 74.5 21.8 1.8 0 1 0 0 0 0 0 0 0 0 0
3 74.6 21.5 1.8 0 0 1 0 0 0 0 0 0 0 0
4 75.5 21.3 1.8 0 0 0 1 0 0 0 0 0 0 0
5 76.9 21.1 1.8 0 0 0 0 1 0 0 0 0 0 0
6 76.3 21.2 1.8 0 0 0 0 0 1 0 0 0 0 0
7 73.8 21.0 1.8 0 0 0 0 0 0 1 0 0 0 0
8 73.4 20.8 1.8 0 0 0 0 0 0 0 1 0 0 0
9 75.8 20.5 1.8 0 0 0 0 0 0 0 0 1 0 0
10 76.9 20.4 1.8 0 0 0 0 0 0 0 0 0 1 0
11 73.2 20.1 1.8 0 0 0 0 0 0 0 0 0 0 1
12 72.1 19.9 1.8 0 0 0 0 0 0 0 0 0 0 0
13 74.3 19.6 1.8 1 0 0 0 0 0 0 0 0 0 0
14 73.1 19.4 1.8 0 1 0 0 0 0 0 0 0 0 0
15 72.2 19.2 1.8 0 0 1 0 0 0 0 0 0 0 0
16 69.4 19.1 1.8 0 0 0 1 0 0 0 0 0 0 0
17 70.8 19.1 1.8 0 0 0 0 1 0 0 0 0 0 0
18 71.1 18.9 1.8 0 0 0 0 0 1 0 0 0 0 0
19 71.2 18.7 1.8 0 0 0 0 0 0 1 0 0 0 0
20 70.6 18.7 1.8 0 0 0 0 0 0 0 1 0 0 0
21 71.1 18.7 1.8 0 0 0 0 0 0 0 0 1 0 0
22 70.3 18.4 1.8 0 0 0 0 0 0 0 0 0 1 0
23 68.3 18.4 1.8 0 0 0 0 0 0 0 0 0 0 1
24 68.9 18.3 412.3 0 0 0 0 0 0 0 0 0 0 0
25 71.9 18.4 420.3 1 0 0 0 0 0 0 0 0 0 0
26 73.3 18.3 395.5 0 1 0 0 0 0 0 0 0 0 0
27 70.9 18.3 392.1 0 0 1 0 0 0 0 0 0 0 0
28 70.0 18.0 378.6 0 0 0 1 0 0 0 0 0 0 0
29 65.5 17.7 338.7 0 0 0 0 1 0 0 0 0 0 0
30 70.1 17.7 285.8 0 0 0 0 0 1 0 0 0 0 0
31 66.6 17.9 255.3 0 0 0 0 0 0 1 0 0 0 0
32 67.4 17.6 256.4 0 0 0 0 0 0 0 1 0 0 0
33 67.8 17.7 287.1 0 0 0 0 0 0 0 0 1 0 0
34 69.4 17.4 353.9 0 0 0 0 0 0 0 0 0 1 0
35 69.4 17.1 406.4 0 0 0 0 0 0 0 0 0 0 1
36 66.7 16.8 406.7 0 0 0 0 0 0 0 0 0 0 0
37 65.0 16.5 400.7 1 0 0 0 0 0 0 0 0 0 0
38 63.1 16.2 390.1 0 1 0 0 0 0 0 0 0 0 0
39 65.0 15.8 399.7 0 0 1 0 0 0 0 0 0 0 0
40 63.9 15.5 370.3 0 0 0 1 0 0 0 0 0 0 0
41 63.0 15.2 301.9 0 0 0 0 1 0 0 0 0 0 0
42 62.2 14.9 285.6 0 0 0 0 0 1 0 0 0 0 0
43 61.4 14.6 330.6 0 0 0 0 0 0 1 0 0 0 0
44 61.0 14.4 362.3 0 0 0 0 0 0 0 1 0 0 0
45 58.8 14.5 379.1 0 0 0 0 0 0 0 0 1 0 0
46 61.0 14.2 390.4 0 0 0 0 0 0 0 0 0 1 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) sterfte Unemployment M1 M2
25.812383 2.331032 0.002505 1.415228 0.578603
M3 M4 M5 M6 M7
0.774203 0.350551 0.234580 1.386019 -0.006682
M8 M9 M10 M11
0.230707 0.534237 2.093085 0.943477
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.7120 -0.8722 -0.0282 0.9081 3.2604
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 25.812383 4.198349 6.148 7.07e-07 ***
sterfte 2.331032 0.195096 11.948 2.46e-13 ***
Unemployment 0.002505 0.002264 1.106 0.277
M1 1.415228 1.204476 1.175 0.249
M2 0.578603 1.205288 0.480 0.634
M3 0.774203 1.206702 0.642 0.526
M4 0.350551 1.213113 0.289 0.774
M5 0.234580 1.229633 0.191 0.850
M6 1.386019 1.242755 1.115 0.273
M7 -0.006682 1.246101 -0.005 0.996
M8 0.230707 1.249274 0.185 0.855
M9 0.534237 1.243349 0.430 0.670
M10 2.093085 1.243794 1.683 0.102
M11 0.943477 1.313800 0.718 0.478
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.572 on 32 degrees of freedom
Multiple R-squared: 0.9254, Adjusted R-squared: 0.8951
F-statistic: 30.55 on 13 and 32 DF, p-value: 2.427e-14
> 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.7114530 0.5770939 0.2885470
[2,] 0.5756632 0.8486735 0.4243368
[3,] 0.4822482 0.9644964 0.5177518
[4,] 0.3466297 0.6932594 0.6533703
[5,] 0.3513857 0.7027713 0.6486143
[6,] 0.3959042 0.7918084 0.6040958
[7,] 0.3062834 0.6125668 0.6937166
[8,] 0.2152612 0.4305224 0.7847388
[9,] 0.1527772 0.3055543 0.8472228
[10,] 0.5680662 0.8638677 0.4319338
[11,] 0.4217836 0.8435672 0.5782164
[12,] 0.2944101 0.5888203 0.7055899
[13,] 0.6241157 0.7517687 0.3758843
> postscript(file="/var/www/rcomp/tmp/1kjc81322014100.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/rcomp/tmp/26mzi1322014100.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/rcomp/tmp/390z31322014100.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/rcomp/tmp/4kc191322014100.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/rcomp/tmp/5a3cm1322014100.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 = 46
Frequency = 1
1 2 3 4 5 6
-0.41482273 -2.71199187 -2.10828175 -0.31842353 1.66375394 -0.32078874
7 8 9 10 11 12
-0.96188076 -1.13306407 1.66271645 1.43697153 -0.41411079 -0.10442786
13 14 15 16 17 18
1.37965398 1.48248484 0.85309177 -1.29015321 0.22581786 -0.15941522
19 20 21 22 23 24
1.79949275 0.96210306 1.15857398 -0.50096454 -1.35135645 -0.60307401
25 26 27 28 29 30
0.72855514 3.26040649 0.67332399 0.93010272 -2.65466762 0.92640673
31 32 33 34 35 36
-1.57069596 -0.31153156 -0.52506694 0.04806138 1.76546723 0.70750186
37 38 39 40 41 42
-1.69338638 -2.03089946 0.58186599 0.67847402 0.76509582 -0.44620277
43 44 45 46
0.73308397 0.48249257 -2.29622349 -0.98406837
> postscript(file="/var/www/rcomp/tmp/6xfj61322014100.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 = 46
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.41482273 NA
1 -2.71199187 -0.41482273
2 -2.10828175 -2.71199187
3 -0.31842353 -2.10828175
4 1.66375394 -0.31842353
5 -0.32078874 1.66375394
6 -0.96188076 -0.32078874
7 -1.13306407 -0.96188076
8 1.66271645 -1.13306407
9 1.43697153 1.66271645
10 -0.41411079 1.43697153
11 -0.10442786 -0.41411079
12 1.37965398 -0.10442786
13 1.48248484 1.37965398
14 0.85309177 1.48248484
15 -1.29015321 0.85309177
16 0.22581786 -1.29015321
17 -0.15941522 0.22581786
18 1.79949275 -0.15941522
19 0.96210306 1.79949275
20 1.15857398 0.96210306
21 -0.50096454 1.15857398
22 -1.35135645 -0.50096454
23 -0.60307401 -1.35135645
24 0.72855514 -0.60307401
25 3.26040649 0.72855514
26 0.67332399 3.26040649
27 0.93010272 0.67332399
28 -2.65466762 0.93010272
29 0.92640673 -2.65466762
30 -1.57069596 0.92640673
31 -0.31153156 -1.57069596
32 -0.52506694 -0.31153156
33 0.04806138 -0.52506694
34 1.76546723 0.04806138
35 0.70750186 1.76546723
36 -1.69338638 0.70750186
37 -2.03089946 -1.69338638
38 0.58186599 -2.03089946
39 0.67847402 0.58186599
40 0.76509582 0.67847402
41 -0.44620277 0.76509582
42 0.73308397 -0.44620277
43 0.48249257 0.73308397
44 -2.29622349 0.48249257
45 -0.98406837 -2.29622349
46 NA -0.98406837
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.71199187 -0.41482273
[2,] -2.10828175 -2.71199187
[3,] -0.31842353 -2.10828175
[4,] 1.66375394 -0.31842353
[5,] -0.32078874 1.66375394
[6,] -0.96188076 -0.32078874
[7,] -1.13306407 -0.96188076
[8,] 1.66271645 -1.13306407
[9,] 1.43697153 1.66271645
[10,] -0.41411079 1.43697153
[11,] -0.10442786 -0.41411079
[12,] 1.37965398 -0.10442786
[13,] 1.48248484 1.37965398
[14,] 0.85309177 1.48248484
[15,] -1.29015321 0.85309177
[16,] 0.22581786 -1.29015321
[17,] -0.15941522 0.22581786
[18,] 1.79949275 -0.15941522
[19,] 0.96210306 1.79949275
[20,] 1.15857398 0.96210306
[21,] -0.50096454 1.15857398
[22,] -1.35135645 -0.50096454
[23,] -0.60307401 -1.35135645
[24,] 0.72855514 -0.60307401
[25,] 3.26040649 0.72855514
[26,] 0.67332399 3.26040649
[27,] 0.93010272 0.67332399
[28,] -2.65466762 0.93010272
[29,] 0.92640673 -2.65466762
[30,] -1.57069596 0.92640673
[31,] -0.31153156 -1.57069596
[32,] -0.52506694 -0.31153156
[33,] 0.04806138 -0.52506694
[34,] 1.76546723 0.04806138
[35,] 0.70750186 1.76546723
[36,] -1.69338638 0.70750186
[37,] -2.03089946 -1.69338638
[38,] 0.58186599 -2.03089946
[39,] 0.67847402 0.58186599
[40,] 0.76509582 0.67847402
[41,] -0.44620277 0.76509582
[42,] 0.73308397 -0.44620277
[43,] 0.48249257 0.73308397
[44,] -2.29622349 0.48249257
[45,] -0.98406837 -2.29622349
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.71199187 -0.41482273
2 -2.10828175 -2.71199187
3 -0.31842353 -2.10828175
4 1.66375394 -0.31842353
5 -0.32078874 1.66375394
6 -0.96188076 -0.32078874
7 -1.13306407 -0.96188076
8 1.66271645 -1.13306407
9 1.43697153 1.66271645
10 -0.41411079 1.43697153
11 -0.10442786 -0.41411079
12 1.37965398 -0.10442786
13 1.48248484 1.37965398
14 0.85309177 1.48248484
15 -1.29015321 0.85309177
16 0.22581786 -1.29015321
17 -0.15941522 0.22581786
18 1.79949275 -0.15941522
19 0.96210306 1.79949275
20 1.15857398 0.96210306
21 -0.50096454 1.15857398
22 -1.35135645 -0.50096454
23 -0.60307401 -1.35135645
24 0.72855514 -0.60307401
25 3.26040649 0.72855514
26 0.67332399 3.26040649
27 0.93010272 0.67332399
28 -2.65466762 0.93010272
29 0.92640673 -2.65466762
30 -1.57069596 0.92640673
31 -0.31153156 -1.57069596
32 -0.52506694 -0.31153156
33 0.04806138 -0.52506694
34 1.76546723 0.04806138
35 0.70750186 1.76546723
36 -1.69338638 0.70750186
37 -2.03089946 -1.69338638
38 0.58186599 -2.03089946
39 0.67847402 0.58186599
40 0.76509582 0.67847402
41 -0.44620277 0.76509582
42 0.73308397 -0.44620277
43 0.48249257 0.73308397
44 -2.29622349 0.48249257
45 -0.98406837 -2.29622349
> 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/rcomp/tmp/70fed1322014101.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/rcomp/tmp/8l1b61322014101.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/rcomp/tmp/9koer1322014101.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/rcomp/tmp/10beak1322014101.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/11f9o01322014101.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/rcomp/tmp/12lpaw1322014101.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/rcomp/tmp/13tnjr1322014101.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/rcomp/tmp/1422x21322014101.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/rcomp/tmp/15ibf31322014101.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/rcomp/tmp/16dray1322014101.tab")
+ }
>
> try(system("convert tmp/1kjc81322014100.ps tmp/1kjc81322014100.png",intern=TRUE))
character(0)
> try(system("convert tmp/26mzi1322014100.ps tmp/26mzi1322014100.png",intern=TRUE))
character(0)
> try(system("convert tmp/390z31322014100.ps tmp/390z31322014100.png",intern=TRUE))
character(0)
> try(system("convert tmp/4kc191322014100.ps tmp/4kc191322014100.png",intern=TRUE))
character(0)
> try(system("convert tmp/5a3cm1322014100.ps tmp/5a3cm1322014100.png",intern=TRUE))
character(0)
> try(system("convert tmp/6xfj61322014100.ps tmp/6xfj61322014100.png",intern=TRUE))
character(0)
> try(system("convert tmp/70fed1322014101.ps tmp/70fed1322014101.png",intern=TRUE))
character(0)
> try(system("convert tmp/8l1b61322014101.ps tmp/8l1b61322014101.png",intern=TRUE))
character(0)
> try(system("convert tmp/9koer1322014101.ps tmp/9koer1322014101.png",intern=TRUE))
character(0)
> try(system("convert tmp/10beak1322014101.ps tmp/10beak1322014101.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.028 0.660 4.672