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(432
+ ,342
+ ,189
+ ,67
+ ,517
+ ,432
+ ,342
+ ,189
+ ,623
+ ,517
+ ,432
+ ,342
+ ,605
+ ,623
+ ,517
+ ,432
+ ,716
+ ,605
+ ,623
+ ,517
+ ,677
+ ,716
+ ,605
+ ,623
+ ,710
+ ,677
+ ,716
+ ,605
+ ,839
+ ,710
+ ,677
+ ,716
+ ,886
+ ,839
+ ,710
+ ,677
+ ,891
+ ,886
+ ,839
+ ,710
+ ,917
+ ,891
+ ,886
+ ,839
+ ,820
+ ,917
+ ,891
+ ,886
+ ,793
+ ,820
+ ,917
+ ,891
+ ,932
+ ,793
+ ,820
+ ,917
+ ,906
+ ,932
+ ,793
+ ,820
+ ,844
+ ,906
+ ,932
+ ,793
+ ,801
+ ,844
+ ,906
+ ,932
+ ,957
+ ,801
+ ,844
+ ,906
+ ,1159
+ ,957
+ ,801
+ ,844
+ ,1264
+ ,1159
+ ,957
+ ,801
+ ,1097
+ ,1264
+ ,1159
+ ,957
+ ,1240
+ ,1097
+ ,1264
+ ,1159
+ ,1411
+ ,1240
+ ,1097
+ ,1264
+ ,1535
+ ,1411
+ ,1240
+ ,1097
+ ,1862
+ ,1535
+ ,1411
+ ,1240
+ ,1894
+ ,1862
+ ,1535
+ ,1411
+ ,2239
+ ,1894
+ ,1862
+ ,1535
+ ,2465
+ ,2239
+ ,1894
+ ,1862
+ ,2423
+ ,2465
+ ,2239
+ ,1894
+ ,2692
+ ,2423
+ ,2465
+ ,2239
+ ,2856
+ ,2692
+ ,2423
+ ,2465
+ ,3450
+ ,2856
+ ,2692
+ ,2423
+ ,4162
+ ,3450
+ ,2856
+ ,2692
+ ,4260
+ ,4162
+ ,3450
+ ,2856
+ ,4225
+ ,4260
+ ,4162
+ ,3450
+ ,4092
+ ,4225
+ ,4260
+ ,4162
+ ,4160
+ ,4092
+ ,4225
+ ,4260
+ ,3896
+ ,4160
+ ,4092
+ ,4225
+ ,3628
+ ,3896
+ ,4160
+ ,4092
+ ,3754
+ ,3628
+ ,3896
+ ,4160
+ ,3749
+ ,3754
+ ,3628
+ ,3896
+ ,3907
+ ,3749
+ ,3754
+ ,3628
+ ,4449
+ ,3907
+ ,3749
+ ,3754
+ ,5272
+ ,4449
+ ,3907
+ ,3749
+ ,6197
+ ,5272
+ ,4449
+ ,3907
+ ,6446
+ ,6197
+ ,5272
+ ,4449
+ ,7157
+ ,6446
+ ,6197
+ ,5272
+ ,7559
+ ,7157
+ ,6446
+ ,6197
+ ,7674
+ ,7559
+ ,7157
+ ,6446
+ ,6929
+ ,7674
+ ,7559
+ ,7157
+ ,7156
+ ,6929
+ ,7674
+ ,7559
+ ,6805
+ ,7156
+ ,6929
+ ,7674
+ ,7095
+ ,6805
+ ,7156
+ ,6929
+ ,7222
+ ,7095
+ ,6805
+ ,7156
+ ,7593
+ ,7222
+ ,7095
+ ,6805
+ ,7910
+ ,7593
+ ,7222
+ ,7095)
+ ,dim=c(4
+ ,56)
+ ,dimnames=list(c('Faillissementen'
+ ,'Y1'
+ ,'Y2'
+ ,'Y3')
+ ,1:56))
> y <- array(NA,dim=c(4,56),dimnames=list(c('Faillissementen','Y1','Y2','Y3'),1:56))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = '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
Faillissementen Y1 Y2 Y3 t
1 432 342 189 67 1
2 517 432 342 189 2
3 623 517 432 342 3
4 605 623 517 432 4
5 716 605 623 517 5
6 677 716 605 623 6
7 710 677 716 605 7
8 839 710 677 716 8
9 886 839 710 677 9
10 891 886 839 710 10
11 917 891 886 839 11
12 820 917 891 886 12
13 793 820 917 891 13
14 932 793 820 917 14
15 906 932 793 820 15
16 844 906 932 793 16
17 801 844 906 932 17
18 957 801 844 906 18
19 1159 957 801 844 19
20 1264 1159 957 801 20
21 1097 1264 1159 957 21
22 1240 1097 1264 1159 22
23 1411 1240 1097 1264 23
24 1535 1411 1240 1097 24
25 1862 1535 1411 1240 25
26 1894 1862 1535 1411 26
27 2239 1894 1862 1535 27
28 2465 2239 1894 1862 28
29 2423 2465 2239 1894 29
30 2692 2423 2465 2239 30
31 2856 2692 2423 2465 31
32 3450 2856 2692 2423 32
33 4162 3450 2856 2692 33
34 4260 4162 3450 2856 34
35 4225 4260 4162 3450 35
36 4092 4225 4260 4162 36
37 4160 4092 4225 4260 37
38 3896 4160 4092 4225 38
39 3628 3896 4160 4092 39
40 3754 3628 3896 4160 40
41 3749 3754 3628 3896 41
42 3907 3749 3754 3628 42
43 4449 3907 3749 3754 43
44 5272 4449 3907 3749 44
45 6197 5272 4449 3907 45
46 6446 6197 5272 4449 46
47 7157 6446 6197 5272 47
48 7559 7157 6446 6197 48
49 7674 7559 7157 6446 49
50 6929 7674 7559 7157 50
51 7156 6929 7674 7559 51
52 6805 7156 6929 7674 52
53 7095 6805 7156 6929 53
54 7222 7095 6805 7156 54
55 7593 7222 7095 6805 55
56 7910 7593 7222 7095 56
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Y1 Y2 Y3 t
-101.29691 1.19212 -0.03035 -0.26981 17.14739
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-814.91 -120.70 23.55 132.40 445.19
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -101.29691 79.37234 -1.276 0.20766
Y1 1.19212 0.13417 8.885 6.19e-12 ***
Y2 -0.03035 0.21399 -0.142 0.88776
Y3 -0.26981 0.13322 -2.025 0.04809 *
t 17.14739 6.24796 2.744 0.00835 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 246.1 on 51 degrees of freedom
Multiple R-squared: 0.9908, Adjusted R-squared: 0.9901
F-statistic: 1377 on 4 and 51 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 2.441444e-03 4.882888e-03 0.9975586
[2,] 4.351856e-03 8.703712e-03 0.9956481
[3,] 8.220259e-04 1.644052e-03 0.9991780
[4,] 1.796335e-04 3.592670e-04 0.9998204
[5,] 4.338452e-04 8.676905e-04 0.9995662
[6,] 1.649574e-04 3.299148e-04 0.9998350
[7,] 1.004370e-04 2.008740e-04 0.9998996
[8,] 2.607511e-05 5.215022e-05 0.9999739
[9,] 6.666356e-06 1.333271e-05 0.9999933
[10,] 2.814310e-06 5.628620e-06 0.9999972
[11,] 2.381754e-06 4.763508e-06 0.9999976
[12,] 6.769322e-06 1.353864e-05 0.9999932
[13,] 3.829320e-06 7.658639e-06 0.9999962
[14,] 2.524641e-06 5.049282e-06 0.9999975
[15,] 4.458920e-06 8.917841e-06 0.9999955
[16,] 2.779373e-06 5.558745e-06 0.9999972
[17,] 2.380058e-06 4.760116e-06 0.9999976
[18,] 3.363628e-05 6.727255e-05 0.9999664
[19,] 1.393837e-05 2.787674e-05 0.9999861
[20,] 3.826550e-05 7.653100e-05 0.9999617
[21,] 1.615591e-05 3.231182e-05 0.9999838
[22,] 2.233941e-05 4.467881e-05 0.9999777
[23,] 1.317791e-05 2.635583e-05 0.9999868
[24,] 4.966970e-06 9.933939e-06 0.9999950
[25,] 5.965563e-05 1.193113e-04 0.9999403
[26,] 8.243122e-04 1.648624e-03 0.9991757
[27,] 1.648037e-03 3.296074e-03 0.9983520
[28,] 1.923464e-03 3.846929e-03 0.9980765
[29,] 2.516052e-03 5.032105e-03 0.9974839
[30,] 2.520034e-03 5.040068e-03 0.9974800
[31,] 3.132050e-03 6.264100e-03 0.9968679
[32,] 3.035506e-03 6.071012e-03 0.9969645
[33,] 2.014606e-03 4.029211e-03 0.9979854
[34,] 1.469215e-03 2.938430e-03 0.9985308
[35,] 4.089014e-03 8.178028e-03 0.9959110
[36,] 9.555814e-03 1.911163e-02 0.9904442
[37,] 1.489247e-02 2.978494e-02 0.9851075
[38,] 1.164258e-02 2.328516e-02 0.9883574
[39,] 8.734854e-02 1.746971e-01 0.9126515
[40,] 1.447950e-01 2.895900e-01 0.8552050
[41,] 1.037005e-01 2.074011e-01 0.8962995
> postscript(file="/var/www/html/rcomp/tmp/1ym0r1292700777.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/rcomp/tmp/2reid1292700777.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/rcomp/tmp/3reid1292700777.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/rcomp/tmp/4reid1292700777.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/rcomp/tmp/5jnhf1292700777.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 = 56
Frequency = 1
1 2 3 4 5 6
132.259056 130.382044 161.917657 27.268809 168.730951 8.312273
7 8 9 10 11 12
69.169921 170.448143 36.996402 -18.361324 20.763106 -111.546391
13 14 15 16 17 18
-37.920096 120.190708 -115.652482 -166.870834 -116.392040 64.824699
19 20 21 22 23 24
45.673322 -114.149020 -375.246921 7.378609 14.019900 -123.698159
25 26 27 28 29 30
82.105215 -242.963194 90.123511 -23.104577 -332.565275 69.301307
31 32 33 34 35 36
-44.822945 333.354785 397.646547 -308.010690 -295.106209 -208.448137
37 38 39 40 41 42
26.335555 -349.356135 -353.605501 85.069182 -166.650046 -88.322384
43 44 45 46 47 48
282.020214 445.191260 431.011719 -268.626818 378.519931 172.911079
49 50 51 52 53 54
-119.704221 -814.906723 395.029277 -235.312636 261.852699 76.585038
55 56
193.136325 132.813512
> postscript(file="/var/www/html/rcomp/tmp/6jnhf1292700777.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 = 56
Frequency = 1
lag(myerror, k = 1) myerror
0 132.259056 NA
1 130.382044 132.259056
2 161.917657 130.382044
3 27.268809 161.917657
4 168.730951 27.268809
5 8.312273 168.730951
6 69.169921 8.312273
7 170.448143 69.169921
8 36.996402 170.448143
9 -18.361324 36.996402
10 20.763106 -18.361324
11 -111.546391 20.763106
12 -37.920096 -111.546391
13 120.190708 -37.920096
14 -115.652482 120.190708
15 -166.870834 -115.652482
16 -116.392040 -166.870834
17 64.824699 -116.392040
18 45.673322 64.824699
19 -114.149020 45.673322
20 -375.246921 -114.149020
21 7.378609 -375.246921
22 14.019900 7.378609
23 -123.698159 14.019900
24 82.105215 -123.698159
25 -242.963194 82.105215
26 90.123511 -242.963194
27 -23.104577 90.123511
28 -332.565275 -23.104577
29 69.301307 -332.565275
30 -44.822945 69.301307
31 333.354785 -44.822945
32 397.646547 333.354785
33 -308.010690 397.646547
34 -295.106209 -308.010690
35 -208.448137 -295.106209
36 26.335555 -208.448137
37 -349.356135 26.335555
38 -353.605501 -349.356135
39 85.069182 -353.605501
40 -166.650046 85.069182
41 -88.322384 -166.650046
42 282.020214 -88.322384
43 445.191260 282.020214
44 431.011719 445.191260
45 -268.626818 431.011719
46 378.519931 -268.626818
47 172.911079 378.519931
48 -119.704221 172.911079
49 -814.906723 -119.704221
50 395.029277 -814.906723
51 -235.312636 395.029277
52 261.852699 -235.312636
53 76.585038 261.852699
54 193.136325 76.585038
55 132.813512 193.136325
56 NA 132.813512
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 130.382044 132.259056
[2,] 161.917657 130.382044
[3,] 27.268809 161.917657
[4,] 168.730951 27.268809
[5,] 8.312273 168.730951
[6,] 69.169921 8.312273
[7,] 170.448143 69.169921
[8,] 36.996402 170.448143
[9,] -18.361324 36.996402
[10,] 20.763106 -18.361324
[11,] -111.546391 20.763106
[12,] -37.920096 -111.546391
[13,] 120.190708 -37.920096
[14,] -115.652482 120.190708
[15,] -166.870834 -115.652482
[16,] -116.392040 -166.870834
[17,] 64.824699 -116.392040
[18,] 45.673322 64.824699
[19,] -114.149020 45.673322
[20,] -375.246921 -114.149020
[21,] 7.378609 -375.246921
[22,] 14.019900 7.378609
[23,] -123.698159 14.019900
[24,] 82.105215 -123.698159
[25,] -242.963194 82.105215
[26,] 90.123511 -242.963194
[27,] -23.104577 90.123511
[28,] -332.565275 -23.104577
[29,] 69.301307 -332.565275
[30,] -44.822945 69.301307
[31,] 333.354785 -44.822945
[32,] 397.646547 333.354785
[33,] -308.010690 397.646547
[34,] -295.106209 -308.010690
[35,] -208.448137 -295.106209
[36,] 26.335555 -208.448137
[37,] -349.356135 26.335555
[38,] -353.605501 -349.356135
[39,] 85.069182 -353.605501
[40,] -166.650046 85.069182
[41,] -88.322384 -166.650046
[42,] 282.020214 -88.322384
[43,] 445.191260 282.020214
[44,] 431.011719 445.191260
[45,] -268.626818 431.011719
[46,] 378.519931 -268.626818
[47,] 172.911079 378.519931
[48,] -119.704221 172.911079
[49,] -814.906723 -119.704221
[50,] 395.029277 -814.906723
[51,] -235.312636 395.029277
[52,] 261.852699 -235.312636
[53,] 76.585038 261.852699
[54,] 193.136325 76.585038
[55,] 132.813512 193.136325
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 130.382044 132.259056
2 161.917657 130.382044
3 27.268809 161.917657
4 168.730951 27.268809
5 8.312273 168.730951
6 69.169921 8.312273
7 170.448143 69.169921
8 36.996402 170.448143
9 -18.361324 36.996402
10 20.763106 -18.361324
11 -111.546391 20.763106
12 -37.920096 -111.546391
13 120.190708 -37.920096
14 -115.652482 120.190708
15 -166.870834 -115.652482
16 -116.392040 -166.870834
17 64.824699 -116.392040
18 45.673322 64.824699
19 -114.149020 45.673322
20 -375.246921 -114.149020
21 7.378609 -375.246921
22 14.019900 7.378609
23 -123.698159 14.019900
24 82.105215 -123.698159
25 -242.963194 82.105215
26 90.123511 -242.963194
27 -23.104577 90.123511
28 -332.565275 -23.104577
29 69.301307 -332.565275
30 -44.822945 69.301307
31 333.354785 -44.822945
32 397.646547 333.354785
33 -308.010690 397.646547
34 -295.106209 -308.010690
35 -208.448137 -295.106209
36 26.335555 -208.448137
37 -349.356135 26.335555
38 -353.605501 -349.356135
39 85.069182 -353.605501
40 -166.650046 85.069182
41 -88.322384 -166.650046
42 282.020214 -88.322384
43 445.191260 282.020214
44 431.011719 445.191260
45 -268.626818 431.011719
46 378.519931 -268.626818
47 172.911079 378.519931
48 -119.704221 172.911079
49 -814.906723 -119.704221
50 395.029277 -814.906723
51 -235.312636 395.029277
52 261.852699 -235.312636
53 76.585038 261.852699
54 193.136325 76.585038
55 132.813512 193.136325
> 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/7ueg01292700777.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/rcomp/tmp/8ueg01292700777.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/rcomp/tmp/95nx31292700777.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/html/rcomp/tmp/105nx31292700777.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/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/11q6wr1292700777.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/12b6cf1292700777.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/13i8r91292700777.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/14tz9c1292700777.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/15ehph1292700777.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/16sr5q1292700777.tab")
+ }
>
> try(system("convert tmp/1ym0r1292700777.ps tmp/1ym0r1292700777.png",intern=TRUE))
character(0)
> try(system("convert tmp/2reid1292700777.ps tmp/2reid1292700777.png",intern=TRUE))
character(0)
> try(system("convert tmp/3reid1292700777.ps tmp/3reid1292700777.png",intern=TRUE))
character(0)
> try(system("convert tmp/4reid1292700777.ps tmp/4reid1292700777.png",intern=TRUE))
character(0)
> try(system("convert tmp/5jnhf1292700777.ps tmp/5jnhf1292700777.png",intern=TRUE))
character(0)
> try(system("convert tmp/6jnhf1292700777.ps tmp/6jnhf1292700777.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ueg01292700777.ps tmp/7ueg01292700777.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ueg01292700777.ps tmp/8ueg01292700777.png",intern=TRUE))
character(0)
> try(system("convert tmp/95nx31292700777.ps tmp/95nx31292700777.png",intern=TRUE))
character(0)
> try(system("convert tmp/105nx31292700777.ps tmp/105nx31292700777.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.503 1.641 5.599