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(95.1,93.8,97,93.8,112.7,107.6,102.9,101,97.4,95.4,111.4,96.5,87.4,89.2,96.8,87.1,114.1,110.5,110.3,110.8,103.9,104.2,101.6,88.9,94.6,89.8,95.9,90,104.7,93.9,102.8,91.3,98.1,87.8,113.9,99.7,80.9,73.5,95.7,79.2,113.2,96.9,105.9,95.2,108.8,95.6,102.3,89.7,99,92.8,100.7,88,115.5,101.1,100.7,92.7,109.9,95.8,114.6,103.8,85.4,81.8,100.5,87.1,114.8,105.9,116.5,108.1,112.9,102.6,102,93.7,106,103.5,105.3,100.6,118.8,113.3,106.1,102.4,109.3,102.1,117.2,106.9,92.5,87.3,104.2,93.1,112.5,109.1,122.4,120.3,113.3,104.9,100,92.6,110.7,109.8,112.8,111.4,109.8,117.9,117.3,121.6,109.1,117.8,115.9,124.2,96,106.8,99.8,102.7,116.8,116.8,115.7,113.6,99.4,96.1,94.3,85),dim=c(2,60),dimnames=list(c('TIA','IAidM'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('TIA','IAidM'),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
TIA IAidM
1 95.1 93.8
2 97.0 93.8
3 112.7 107.6
4 102.9 101.0
5 97.4 95.4
6 111.4 96.5
7 87.4 89.2
8 96.8 87.1
9 114.1 110.5
10 110.3 110.8
11 103.9 104.2
12 101.6 88.9
13 94.6 89.8
14 95.9 90.0
15 104.7 93.9
16 102.8 91.3
17 98.1 87.8
18 113.9 99.7
19 80.9 73.5
20 95.7 79.2
21 113.2 96.9
22 105.9 95.2
23 108.8 95.6
24 102.3 89.7
25 99.0 92.8
26 100.7 88.0
27 115.5 101.1
28 100.7 92.7
29 109.9 95.8
30 114.6 103.8
31 85.4 81.8
32 100.5 87.1
33 114.8 105.9
34 116.5 108.1
35 112.9 102.6
36 102.0 93.7
37 106.0 103.5
38 105.3 100.6
39 118.8 113.3
40 106.1 102.4
41 109.3 102.1
42 117.2 106.9
43 92.5 87.3
44 104.2 93.1
45 112.5 109.1
46 122.4 120.3
47 113.3 104.9
48 100.0 92.6
49 110.7 109.8
50 112.8 111.4
51 109.8 117.9
52 117.3 121.6
53 109.1 117.8
54 115.9 124.2
55 96.0 106.8
56 99.8 102.7
57 116.8 116.8
58 115.7 113.6
59 99.4 96.1
60 94.3 85.0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) IAidM
39.395 0.663
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-14.208 -3.525 0.220 3.395 9.556
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 39.39474 6.22523 6.328 3.90e-08 ***
IAidM 0.66304 0.06214 10.670 2.66e-15 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 5.273 on 58 degrees of freedom
Multiple R-squared: 0.6625, Adjusted R-squared: 0.6567
F-statistic: 113.8 on 1 and 58 DF, p-value: 2.658e-15
> 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.01510666 0.03021332 0.9848933
[2,] 0.67747595 0.64504811 0.3225241
[3,] 0.68080246 0.63839508 0.3191975
[4,] 0.71616243 0.56767514 0.2838376
[5,] 0.61016722 0.77966557 0.3898328
[6,] 0.55382591 0.89234819 0.4461741
[7,] 0.49857376 0.99714752 0.5014262
[8,] 0.55163044 0.89673913 0.4483696
[9,] 0.47384931 0.94769862 0.5261507
[10,] 0.38975035 0.77950069 0.6102497
[11,] 0.38434623 0.76869247 0.6156538
[12,] 0.36668617 0.73337234 0.6333138
[13,] 0.30134107 0.60268214 0.6986589
[14,] 0.45905325 0.91810651 0.5409467
[15,] 0.47100795 0.94201590 0.5289921
[16,] 0.48492456 0.96984912 0.5150754
[17,] 0.66104202 0.67791596 0.3389580
[18,] 0.61504651 0.76990698 0.3849535
[19,] 0.62841276 0.74317447 0.3715872
[20,] 0.58472650 0.83054699 0.4152735
[21,] 0.51849735 0.96300530 0.4815026
[22,] 0.46609525 0.93219050 0.5339047
[23,] 0.58435909 0.83128182 0.4156409
[24,] 0.50847243 0.98305514 0.4915276
[25,] 0.55485571 0.89028858 0.4451443
[26,] 0.57281601 0.85436798 0.4271840
[27,] 0.65493582 0.69012836 0.3450642
[28,] 0.61471401 0.77057198 0.3852860
[29,] 0.60374504 0.79250991 0.3962550
[30,] 0.60610504 0.78778992 0.3938950
[31,] 0.61959174 0.76081652 0.3804083
[32,] 0.54755890 0.90488220 0.4524411
[33,] 0.49519059 0.99038118 0.5048094
[34,] 0.42536245 0.85072491 0.5746375
[35,] 0.42198502 0.84397003 0.5780150
[36,] 0.35652356 0.71304711 0.6434764
[37,] 0.31132100 0.62264200 0.6886790
[38,] 0.42879008 0.85758016 0.5712099
[39,] 0.38810530 0.77621059 0.6118947
[40,] 0.37112256 0.74224513 0.6288774
[41,] 0.32895966 0.65791933 0.6710403
[42,] 0.38002439 0.76004878 0.6199756
[43,] 0.49219514 0.98439027 0.5078049
[44,] 0.42292650 0.84585300 0.5770735
[45,] 0.37432829 0.74865659 0.6256717
[46,] 0.35465479 0.70930957 0.6453452
[47,] 0.35723702 0.71447404 0.6427630
[48,] 0.28834327 0.57668653 0.7116567
[49,] 0.26530440 0.53060880 0.7346956
[50,] 0.18625683 0.37251366 0.8137432
[51,] 0.69581732 0.60836536 0.3041827
> postscript(file="/var/www/html/rcomp/tmp/184de1258743759.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/2t8891258743759.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/3qown1258743759.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/4l10b1258743759.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/55n3a1258743759.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 60
Frequency = 1
1 2 3 4 5 6
-6.48815606 -4.58815606 1.96185323 -3.46206426 -5.24902455 8.02162836
7 8 9 10 11 12
-11.13815916 -0.34576927 1.43902909 -2.55988375 -4.58380124 3.26075368
13 14 15 16 17 18
-4.33598484 -3.16859340 3.04553966 2.86945095 0.49010077 8.39989139
19 20 21 22 23 24
-7.22838712 3.79226889 9.55641124 3.38358401 6.01836689 3.43031944
25 26 27 28 29 30
-1.92511326 2.95749221 9.07163146 -0.15880898 6.98575833 6.38141589
31 32 33 34 35 36
-8.23164240 3.35423073 5.18902600 5.43033182 5.47706725 0.47814822
37 38 39 40 41 42
-2.01967127 -0.79684714 4.28250924 -1.19032419 2.20858866 6.92598319
43 44 45 46 47 48
-4.77837783 3.07597390 0.76728902 3.24120960 4.35206880 -0.79250470
49 50 51 52 53 54
-1.49684094 -0.45770943 -7.76748766 -2.72074604 -8.40118338 -5.84465734
55 56 57 58 59 60
-14.20771253 -7.68923703 -0.03814058 0.98359640 -3.71315451 -1.45337938
> postscript(file="/var/www/html/rcomp/tmp/6tm2r1258743759.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 -6.48815606 NA
1 -4.58815606 -6.48815606
2 1.96185323 -4.58815606
3 -3.46206426 1.96185323
4 -5.24902455 -3.46206426
5 8.02162836 -5.24902455
6 -11.13815916 8.02162836
7 -0.34576927 -11.13815916
8 1.43902909 -0.34576927
9 -2.55988375 1.43902909
10 -4.58380124 -2.55988375
11 3.26075368 -4.58380124
12 -4.33598484 3.26075368
13 -3.16859340 -4.33598484
14 3.04553966 -3.16859340
15 2.86945095 3.04553966
16 0.49010077 2.86945095
17 8.39989139 0.49010077
18 -7.22838712 8.39989139
19 3.79226889 -7.22838712
20 9.55641124 3.79226889
21 3.38358401 9.55641124
22 6.01836689 3.38358401
23 3.43031944 6.01836689
24 -1.92511326 3.43031944
25 2.95749221 -1.92511326
26 9.07163146 2.95749221
27 -0.15880898 9.07163146
28 6.98575833 -0.15880898
29 6.38141589 6.98575833
30 -8.23164240 6.38141589
31 3.35423073 -8.23164240
32 5.18902600 3.35423073
33 5.43033182 5.18902600
34 5.47706725 5.43033182
35 0.47814822 5.47706725
36 -2.01967127 0.47814822
37 -0.79684714 -2.01967127
38 4.28250924 -0.79684714
39 -1.19032419 4.28250924
40 2.20858866 -1.19032419
41 6.92598319 2.20858866
42 -4.77837783 6.92598319
43 3.07597390 -4.77837783
44 0.76728902 3.07597390
45 3.24120960 0.76728902
46 4.35206880 3.24120960
47 -0.79250470 4.35206880
48 -1.49684094 -0.79250470
49 -0.45770943 -1.49684094
50 -7.76748766 -0.45770943
51 -2.72074604 -7.76748766
52 -8.40118338 -2.72074604
53 -5.84465734 -8.40118338
54 -14.20771253 -5.84465734
55 -7.68923703 -14.20771253
56 -0.03814058 -7.68923703
57 0.98359640 -0.03814058
58 -3.71315451 0.98359640
59 -1.45337938 -3.71315451
60 NA -1.45337938
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -4.58815606 -6.48815606
[2,] 1.96185323 -4.58815606
[3,] -3.46206426 1.96185323
[4,] -5.24902455 -3.46206426
[5,] 8.02162836 -5.24902455
[6,] -11.13815916 8.02162836
[7,] -0.34576927 -11.13815916
[8,] 1.43902909 -0.34576927
[9,] -2.55988375 1.43902909
[10,] -4.58380124 -2.55988375
[11,] 3.26075368 -4.58380124
[12,] -4.33598484 3.26075368
[13,] -3.16859340 -4.33598484
[14,] 3.04553966 -3.16859340
[15,] 2.86945095 3.04553966
[16,] 0.49010077 2.86945095
[17,] 8.39989139 0.49010077
[18,] -7.22838712 8.39989139
[19,] 3.79226889 -7.22838712
[20,] 9.55641124 3.79226889
[21,] 3.38358401 9.55641124
[22,] 6.01836689 3.38358401
[23,] 3.43031944 6.01836689
[24,] -1.92511326 3.43031944
[25,] 2.95749221 -1.92511326
[26,] 9.07163146 2.95749221
[27,] -0.15880898 9.07163146
[28,] 6.98575833 -0.15880898
[29,] 6.38141589 6.98575833
[30,] -8.23164240 6.38141589
[31,] 3.35423073 -8.23164240
[32,] 5.18902600 3.35423073
[33,] 5.43033182 5.18902600
[34,] 5.47706725 5.43033182
[35,] 0.47814822 5.47706725
[36,] -2.01967127 0.47814822
[37,] -0.79684714 -2.01967127
[38,] 4.28250924 -0.79684714
[39,] -1.19032419 4.28250924
[40,] 2.20858866 -1.19032419
[41,] 6.92598319 2.20858866
[42,] -4.77837783 6.92598319
[43,] 3.07597390 -4.77837783
[44,] 0.76728902 3.07597390
[45,] 3.24120960 0.76728902
[46,] 4.35206880 3.24120960
[47,] -0.79250470 4.35206880
[48,] -1.49684094 -0.79250470
[49,] -0.45770943 -1.49684094
[50,] -7.76748766 -0.45770943
[51,] -2.72074604 -7.76748766
[52,] -8.40118338 -2.72074604
[53,] -5.84465734 -8.40118338
[54,] -14.20771253 -5.84465734
[55,] -7.68923703 -14.20771253
[56,] -0.03814058 -7.68923703
[57,] 0.98359640 -0.03814058
[58,] -3.71315451 0.98359640
[59,] -1.45337938 -3.71315451
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -4.58815606 -6.48815606
2 1.96185323 -4.58815606
3 -3.46206426 1.96185323
4 -5.24902455 -3.46206426
5 8.02162836 -5.24902455
6 -11.13815916 8.02162836
7 -0.34576927 -11.13815916
8 1.43902909 -0.34576927
9 -2.55988375 1.43902909
10 -4.58380124 -2.55988375
11 3.26075368 -4.58380124
12 -4.33598484 3.26075368
13 -3.16859340 -4.33598484
14 3.04553966 -3.16859340
15 2.86945095 3.04553966
16 0.49010077 2.86945095
17 8.39989139 0.49010077
18 -7.22838712 8.39989139
19 3.79226889 -7.22838712
20 9.55641124 3.79226889
21 3.38358401 9.55641124
22 6.01836689 3.38358401
23 3.43031944 6.01836689
24 -1.92511326 3.43031944
25 2.95749221 -1.92511326
26 9.07163146 2.95749221
27 -0.15880898 9.07163146
28 6.98575833 -0.15880898
29 6.38141589 6.98575833
30 -8.23164240 6.38141589
31 3.35423073 -8.23164240
32 5.18902600 3.35423073
33 5.43033182 5.18902600
34 5.47706725 5.43033182
35 0.47814822 5.47706725
36 -2.01967127 0.47814822
37 -0.79684714 -2.01967127
38 4.28250924 -0.79684714
39 -1.19032419 4.28250924
40 2.20858866 -1.19032419
41 6.92598319 2.20858866
42 -4.77837783 6.92598319
43 3.07597390 -4.77837783
44 0.76728902 3.07597390
45 3.24120960 0.76728902
46 4.35206880 3.24120960
47 -0.79250470 4.35206880
48 -1.49684094 -0.79250470
49 -0.45770943 -1.49684094
50 -7.76748766 -0.45770943
51 -2.72074604 -7.76748766
52 -8.40118338 -2.72074604
53 -5.84465734 -8.40118338
54 -14.20771253 -5.84465734
55 -7.68923703 -14.20771253
56 -0.03814058 -7.68923703
57 0.98359640 -0.03814058
58 -3.71315451 0.98359640
59 -1.45337938 -3.71315451
> 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/7r80x1258743759.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/8ergo1258743759.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/9goxz1258743759.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/10xuab1258743759.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/11d75r1258743759.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/12m12u1258743759.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/13n05h1258743759.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/1417nh1258743759.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/15ukrr1258743759.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/16uwzd1258743759.tab")
+ }
>
> system("convert tmp/184de1258743759.ps tmp/184de1258743759.png")
> system("convert tmp/2t8891258743759.ps tmp/2t8891258743759.png")
> system("convert tmp/3qown1258743759.ps tmp/3qown1258743759.png")
> system("convert tmp/4l10b1258743759.ps tmp/4l10b1258743759.png")
> system("convert tmp/55n3a1258743759.ps tmp/55n3a1258743759.png")
> system("convert tmp/6tm2r1258743759.ps tmp/6tm2r1258743759.png")
> system("convert tmp/7r80x1258743759.ps tmp/7r80x1258743759.png")
> system("convert tmp/8ergo1258743759.ps tmp/8ergo1258743759.png")
> system("convert tmp/9goxz1258743759.ps tmp/9goxz1258743759.png")
> system("convert tmp/10xuab1258743759.ps tmp/10xuab1258743759.png")
>
>
> proc.time()
user system elapsed
2.523 1.599 3.385