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,136,97,133,112.7,126,102.9,120,97.4,114,111.4,116,87.4,153,96.8,162,114.1,161,110.3,149,103.9,139,101.6,135,94.6,130,95.9,127,104.7,122,102.8,117,98.1,112,113.9,113,80.9,149,95.7,157,113.2,157,105.9,147,108.8,137,102.3,132,99,125,100.7,123,115.5,117,100.7,114,109.9,111,114.6,112,85.4,144,100.5,150,114.8,149,116.5,134,112.9,123,102,116,106,117,105.3,111,118.8,105,106.1,102,109.3,95,117.2,93,92.5,124,104.2,130,112.5,124,122.4,115,113.3,106,100,105,110.7,105,112.8,101,109.8,95,117.3,93,109.1,84,115.9,87,96,116,99.8,120,116.8,117,115.7,109,99.4,105,94.3,107,91,109),dim=c(2,61),dimnames=list(c('tip','wrk'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('tip','wrk'),1:61))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
tip wrk
1 95.1 136
2 97.0 133
3 112.7 126
4 102.9 120
5 97.4 114
6 111.4 116
7 87.4 153
8 96.8 162
9 114.1 161
10 110.3 149
11 103.9 139
12 101.6 135
13 94.6 130
14 95.9 127
15 104.7 122
16 102.8 117
17 98.1 112
18 113.9 113
19 80.9 149
20 95.7 157
21 113.2 157
22 105.9 147
23 108.8 137
24 102.3 132
25 99.0 125
26 100.7 123
27 115.5 117
28 100.7 114
29 109.9 111
30 114.6 112
31 85.4 144
32 100.5 150
33 114.8 149
34 116.5 134
35 112.9 123
36 102.0 116
37 106.0 117
38 105.3 111
39 118.8 105
40 106.1 102
41 109.3 95
42 117.2 93
43 92.5 124
44 104.2 130
45 112.5 124
46 122.4 115
47 113.3 106
48 100.0 105
49 110.7 105
50 112.8 101
51 109.8 95
52 117.3 93
53 109.1 84
54 115.9 87
55 96.0 116
56 99.8 120
57 116.8 117
58 115.7 109
59 99.4 105
60 94.3 107
61 91.0 109
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) wrk
125.4732 -0.1664
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-19.775 -5.800 -0.362 7.234 16.067
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 125.47316 7.23896 17.333 < 2e-16 ***
wrk -0.16643 0.05868 -2.836 0.00625 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 8.621 on 59 degrees of freedom
Multiple R-squared: 0.12, Adjusted R-squared: 0.1051
F-statistic: 8.044 on 1 and 59 DF, p-value: 0.006246
> 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.5280516 0.9438969 0.4719484
[2,] 0.4668230 0.9336461 0.5331770
[3,] 0.3582404 0.7164807 0.6417596
[4,] 0.3475555 0.6951109 0.6524445
[5,] 0.7144202 0.5711596 0.2855798
[6,] 0.7134574 0.5730852 0.2865426
[7,] 0.6194478 0.7611044 0.3805522
[8,] 0.5198379 0.9603242 0.4801621
[9,] 0.5055913 0.9888174 0.4944087
[10,] 0.4649080 0.9298160 0.5350920
[11,] 0.3807880 0.7615761 0.6192120
[12,] 0.3000658 0.6001315 0.6999342
[13,] 0.2576358 0.5152716 0.7423642
[14,] 0.2965509 0.5931018 0.7034491
[15,] 0.6315535 0.7368930 0.3684465
[16,] 0.5696623 0.8606753 0.4303377
[17,] 0.6750914 0.6498172 0.3249086
[18,] 0.6227194 0.7545612 0.3772806
[19,] 0.5885624 0.8228752 0.4114376
[20,] 0.5122042 0.9755916 0.4877958
[21,] 0.4585986 0.9171973 0.5414014
[22,] 0.3956922 0.7913844 0.6043078
[23,] 0.4361989 0.8723979 0.5638011
[24,] 0.3859250 0.7718501 0.6140750
[25,] 0.3324610 0.6649220 0.6675390
[26,] 0.3292982 0.6585965 0.6707018
[27,] 0.5314900 0.9370200 0.4685100
[28,] 0.4685714 0.9371428 0.5314286
[29,] 0.5440374 0.9119253 0.4559626
[30,] 0.6402861 0.7194279 0.3597139
[31,] 0.6389954 0.7220092 0.3610046
[32,] 0.5761078 0.8477844 0.4238922
[33,] 0.4993183 0.9986365 0.5006817
[34,] 0.4231877 0.8463754 0.5768123
[35,] 0.4652591 0.9305183 0.5347409
[36,] 0.3925521 0.7851043 0.6074479
[37,] 0.3184635 0.6369270 0.6815365
[38,] 0.2874530 0.5749061 0.7125470
[39,] 0.3448402 0.6896804 0.6551598
[40,] 0.2706537 0.5413075 0.7293463
[41,] 0.2538379 0.5076758 0.7461621
[42,] 0.4880480 0.9760961 0.5119520
[43,] 0.4535907 0.9071813 0.5464093
[44,] 0.4143170 0.8286339 0.5856830
[45,] 0.3410820 0.6821640 0.6589180
[46,] 0.2813692 0.5627385 0.7186308
[47,] 0.2006467 0.4012934 0.7993533
[48,] 0.1821079 0.3642158 0.8178921
[49,] 0.1185306 0.2370612 0.8814694
[50,] 0.1327494 0.2654988 0.8672506
[51,] 0.1196804 0.2393608 0.8803196
[52,] 0.1807282 0.3614564 0.8192718
> postscript(file="/var/www/html/rcomp/tmp/1w7d21260969053.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/2xm5b1260969053.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/3bvyz1260969053.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/46lb71260969053.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/5qim81260969053.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 61
Frequency = 1
1 2 3 4 5
-7.738262e+00 -6.337561e+00 8.197407e+00 -2.601191e+00 -9.099790e+00
6 7 8 9 10
5.233076e+00 -1.260890e+01 -1.711001e+00 1.542257e+01 9.625368e+00
11 12 13 14 15
1.561037e+00 -1.404695e+00 -9.236860e+00 -8.436160e+00 -4.683252e-01
16 17 18 19 20
-3.200491e+00 -8.732656e+00 7.233777e+00 -1.977463e+01 -3.643167e+00
21 22 23 24 25
1.385683e+01 4.892502e+00 6.128171e+00 -1.203994e+00 -5.669026e+00
26 27 28 29 30
-4.301892e+00 9.499509e+00 -5.799790e+00 2.900911e+00 7.767344e+00
31 32 33 34 35
-1.610680e+01 -8.198472e-03 1.412537e+01 1.332887e+01 7.898108e+00
36 37 38 39 40
-4.166924e+00 -4.906354e-04 -1.699089e+00 1.080231e+01 -2.396987e+00
41 42 43 44 45
-3.620187e-01 7.205115e+00 -1.233546e+01 3.631396e-01 7.664541e+00
46 47 48 49 50
1.606664e+01 5.468745e+00 -7.997688e+00 2.702312e+00 4.136580e+00
51 52 53 54 55
1.379813e-01 7.305115e+00 -2.392783e+00 4.906516e+00 -1.016692e+01
56 57 58 59 60
-5.701191e+00 1.079951e+01 8.368045e+00 -8.597688e+00 -1.336482e+01
61
-1.633196e+01
> postscript(file="/var/www/html/rcomp/tmp/6x21o1260969053.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 -7.738262e+00 NA
1 -6.337561e+00 -7.738262e+00
2 8.197407e+00 -6.337561e+00
3 -2.601191e+00 8.197407e+00
4 -9.099790e+00 -2.601191e+00
5 5.233076e+00 -9.099790e+00
6 -1.260890e+01 5.233076e+00
7 -1.711001e+00 -1.260890e+01
8 1.542257e+01 -1.711001e+00
9 9.625368e+00 1.542257e+01
10 1.561037e+00 9.625368e+00
11 -1.404695e+00 1.561037e+00
12 -9.236860e+00 -1.404695e+00
13 -8.436160e+00 -9.236860e+00
14 -4.683252e-01 -8.436160e+00
15 -3.200491e+00 -4.683252e-01
16 -8.732656e+00 -3.200491e+00
17 7.233777e+00 -8.732656e+00
18 -1.977463e+01 7.233777e+00
19 -3.643167e+00 -1.977463e+01
20 1.385683e+01 -3.643167e+00
21 4.892502e+00 1.385683e+01
22 6.128171e+00 4.892502e+00
23 -1.203994e+00 6.128171e+00
24 -5.669026e+00 -1.203994e+00
25 -4.301892e+00 -5.669026e+00
26 9.499509e+00 -4.301892e+00
27 -5.799790e+00 9.499509e+00
28 2.900911e+00 -5.799790e+00
29 7.767344e+00 2.900911e+00
30 -1.610680e+01 7.767344e+00
31 -8.198472e-03 -1.610680e+01
32 1.412537e+01 -8.198472e-03
33 1.332887e+01 1.412537e+01
34 7.898108e+00 1.332887e+01
35 -4.166924e+00 7.898108e+00
36 -4.906354e-04 -4.166924e+00
37 -1.699089e+00 -4.906354e-04
38 1.080231e+01 -1.699089e+00
39 -2.396987e+00 1.080231e+01
40 -3.620187e-01 -2.396987e+00
41 7.205115e+00 -3.620187e-01
42 -1.233546e+01 7.205115e+00
43 3.631396e-01 -1.233546e+01
44 7.664541e+00 3.631396e-01
45 1.606664e+01 7.664541e+00
46 5.468745e+00 1.606664e+01
47 -7.997688e+00 5.468745e+00
48 2.702312e+00 -7.997688e+00
49 4.136580e+00 2.702312e+00
50 1.379813e-01 4.136580e+00
51 7.305115e+00 1.379813e-01
52 -2.392783e+00 7.305115e+00
53 4.906516e+00 -2.392783e+00
54 -1.016692e+01 4.906516e+00
55 -5.701191e+00 -1.016692e+01
56 1.079951e+01 -5.701191e+00
57 8.368045e+00 1.079951e+01
58 -8.597688e+00 8.368045e+00
59 -1.336482e+01 -8.597688e+00
60 -1.633196e+01 -1.336482e+01
61 NA -1.633196e+01
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -6.337561e+00 -7.738262e+00
[2,] 8.197407e+00 -6.337561e+00
[3,] -2.601191e+00 8.197407e+00
[4,] -9.099790e+00 -2.601191e+00
[5,] 5.233076e+00 -9.099790e+00
[6,] -1.260890e+01 5.233076e+00
[7,] -1.711001e+00 -1.260890e+01
[8,] 1.542257e+01 -1.711001e+00
[9,] 9.625368e+00 1.542257e+01
[10,] 1.561037e+00 9.625368e+00
[11,] -1.404695e+00 1.561037e+00
[12,] -9.236860e+00 -1.404695e+00
[13,] -8.436160e+00 -9.236860e+00
[14,] -4.683252e-01 -8.436160e+00
[15,] -3.200491e+00 -4.683252e-01
[16,] -8.732656e+00 -3.200491e+00
[17,] 7.233777e+00 -8.732656e+00
[18,] -1.977463e+01 7.233777e+00
[19,] -3.643167e+00 -1.977463e+01
[20,] 1.385683e+01 -3.643167e+00
[21,] 4.892502e+00 1.385683e+01
[22,] 6.128171e+00 4.892502e+00
[23,] -1.203994e+00 6.128171e+00
[24,] -5.669026e+00 -1.203994e+00
[25,] -4.301892e+00 -5.669026e+00
[26,] 9.499509e+00 -4.301892e+00
[27,] -5.799790e+00 9.499509e+00
[28,] 2.900911e+00 -5.799790e+00
[29,] 7.767344e+00 2.900911e+00
[30,] -1.610680e+01 7.767344e+00
[31,] -8.198472e-03 -1.610680e+01
[32,] 1.412537e+01 -8.198472e-03
[33,] 1.332887e+01 1.412537e+01
[34,] 7.898108e+00 1.332887e+01
[35,] -4.166924e+00 7.898108e+00
[36,] -4.906354e-04 -4.166924e+00
[37,] -1.699089e+00 -4.906354e-04
[38,] 1.080231e+01 -1.699089e+00
[39,] -2.396987e+00 1.080231e+01
[40,] -3.620187e-01 -2.396987e+00
[41,] 7.205115e+00 -3.620187e-01
[42,] -1.233546e+01 7.205115e+00
[43,] 3.631396e-01 -1.233546e+01
[44,] 7.664541e+00 3.631396e-01
[45,] 1.606664e+01 7.664541e+00
[46,] 5.468745e+00 1.606664e+01
[47,] -7.997688e+00 5.468745e+00
[48,] 2.702312e+00 -7.997688e+00
[49,] 4.136580e+00 2.702312e+00
[50,] 1.379813e-01 4.136580e+00
[51,] 7.305115e+00 1.379813e-01
[52,] -2.392783e+00 7.305115e+00
[53,] 4.906516e+00 -2.392783e+00
[54,] -1.016692e+01 4.906516e+00
[55,] -5.701191e+00 -1.016692e+01
[56,] 1.079951e+01 -5.701191e+00
[57,] 8.368045e+00 1.079951e+01
[58,] -8.597688e+00 8.368045e+00
[59,] -1.336482e+01 -8.597688e+00
[60,] -1.633196e+01 -1.336482e+01
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -6.337561e+00 -7.738262e+00
2 8.197407e+00 -6.337561e+00
3 -2.601191e+00 8.197407e+00
4 -9.099790e+00 -2.601191e+00
5 5.233076e+00 -9.099790e+00
6 -1.260890e+01 5.233076e+00
7 -1.711001e+00 -1.260890e+01
8 1.542257e+01 -1.711001e+00
9 9.625368e+00 1.542257e+01
10 1.561037e+00 9.625368e+00
11 -1.404695e+00 1.561037e+00
12 -9.236860e+00 -1.404695e+00
13 -8.436160e+00 -9.236860e+00
14 -4.683252e-01 -8.436160e+00
15 -3.200491e+00 -4.683252e-01
16 -8.732656e+00 -3.200491e+00
17 7.233777e+00 -8.732656e+00
18 -1.977463e+01 7.233777e+00
19 -3.643167e+00 -1.977463e+01
20 1.385683e+01 -3.643167e+00
21 4.892502e+00 1.385683e+01
22 6.128171e+00 4.892502e+00
23 -1.203994e+00 6.128171e+00
24 -5.669026e+00 -1.203994e+00
25 -4.301892e+00 -5.669026e+00
26 9.499509e+00 -4.301892e+00
27 -5.799790e+00 9.499509e+00
28 2.900911e+00 -5.799790e+00
29 7.767344e+00 2.900911e+00
30 -1.610680e+01 7.767344e+00
31 -8.198472e-03 -1.610680e+01
32 1.412537e+01 -8.198472e-03
33 1.332887e+01 1.412537e+01
34 7.898108e+00 1.332887e+01
35 -4.166924e+00 7.898108e+00
36 -4.906354e-04 -4.166924e+00
37 -1.699089e+00 -4.906354e-04
38 1.080231e+01 -1.699089e+00
39 -2.396987e+00 1.080231e+01
40 -3.620187e-01 -2.396987e+00
41 7.205115e+00 -3.620187e-01
42 -1.233546e+01 7.205115e+00
43 3.631396e-01 -1.233546e+01
44 7.664541e+00 3.631396e-01
45 1.606664e+01 7.664541e+00
46 5.468745e+00 1.606664e+01
47 -7.997688e+00 5.468745e+00
48 2.702312e+00 -7.997688e+00
49 4.136580e+00 2.702312e+00
50 1.379813e-01 4.136580e+00
51 7.305115e+00 1.379813e-01
52 -2.392783e+00 7.305115e+00
53 4.906516e+00 -2.392783e+00
54 -1.016692e+01 4.906516e+00
55 -5.701191e+00 -1.016692e+01
56 1.079951e+01 -5.701191e+00
57 8.368045e+00 1.079951e+01
58 -8.597688e+00 8.368045e+00
59 -1.336482e+01 -8.597688e+00
60 -1.633196e+01 -1.336482e+01
> 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/7xmg11260969053.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/8ts8w1260969053.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/98cs21260969053.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/10f2w61260969053.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/11tsqw1260969053.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/12ektr1260969054.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/13fzps1260969054.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/1450y81260969054.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/15u6m41260969054.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/16hh9q1260969054.tab")
+ }
> try(system("convert tmp/1w7d21260969053.ps tmp/1w7d21260969053.png",intern=TRUE))
character(0)
> try(system("convert tmp/2xm5b1260969053.ps tmp/2xm5b1260969053.png",intern=TRUE))
character(0)
> try(system("convert tmp/3bvyz1260969053.ps tmp/3bvyz1260969053.png",intern=TRUE))
character(0)
> try(system("convert tmp/46lb71260969053.ps tmp/46lb71260969053.png",intern=TRUE))
character(0)
> try(system("convert tmp/5qim81260969053.ps tmp/5qim81260969053.png",intern=TRUE))
character(0)
> try(system("convert tmp/6x21o1260969053.ps tmp/6x21o1260969053.png",intern=TRUE))
character(0)
> try(system("convert tmp/7xmg11260969053.ps tmp/7xmg11260969053.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ts8w1260969053.ps tmp/8ts8w1260969053.png",intern=TRUE))
character(0)
> try(system("convert tmp/98cs21260969053.ps tmp/98cs21260969053.png",intern=TRUE))
character(0)
> try(system("convert tmp/10f2w61260969053.ps tmp/10f2w61260969053.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.542 1.606 6.371