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(4143,0,4429,0,5219,0,4929,0,5761,0,5592,0,4163,0,4962,0,5208,0,4755,0,4491,0,5732,0,5731,0,5040,0,6102,0,4904,0,5369,0,5578,0,4619,0,4731,0,5011,0,5299,0,4146,0,4625,0,4736,0,4219,0,5116,0,4205,0,4121,0,5103,1,4300,1,4578,1,3809,1,5657,1,4248,1,3830,1,4736,1,4839,1,4411,1,4570,1,4104,1,4801,1,3953,1,3828,1,4440,1,4026,1,4109,1,4785,1,3224,1,3552,1,3940,1,3913,1,3681,1,4309,1,3830,1,4143,1,4087,1,3818,1,3380,1,3430,1,3458,1,3970,1,5260,1,5024,1,5634,1,6549,1,4676,1),dim=c(2,67),dimnames=list(c('Y','X'),1:67))
> y <- array(NA,dim=c(2,67),dimnames=list(c('Y','X'),1:67))
> 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
Y X
1 4143 0
2 4429 0
3 5219 0
4 4929 0
5 5761 0
6 5592 0
7 4163 0
8 4962 0
9 5208 0
10 4755 0
11 4491 0
12 5732 0
13 5731 0
14 5040 0
15 6102 0
16 4904 0
17 5369 0
18 5578 0
19 4619 0
20 4731 0
21 5011 0
22 5299 0
23 4146 0
24 4625 0
25 4736 0
26 4219 0
27 5116 0
28 4205 0
29 4121 0
30 5103 1
31 4300 1
32 4578 1
33 3809 1
34 5657 1
35 4248 1
36 3830 1
37 4736 1
38 4839 1
39 4411 1
40 4570 1
41 4104 1
42 4801 1
43 3953 1
44 3828 1
45 4440 1
46 4026 1
47 4109 1
48 4785 1
49 3224 1
50 3552 1
51 3940 1
52 3913 1
53 3681 1
54 4309 1
55 3830 1
56 4143 1
57 4087 1
58 3818 1
59 3380 1
60 3430 1
61 3458 1
62 3970 1
63 5260 1
64 5024 1
65 5634 1
66 6549 1
67 4676 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
4928.8 -612.9
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1091.92 -485.92 -67.92 395.13 2233.08
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4928.8 120.4 40.931 < 2e-16 ***
X -612.9 159.9 -3.833 0.000288 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 648.5 on 65 degrees of freedom
Multiple R-squared: 0.1844, Adjusted R-squared: 0.1718
F-statistic: 14.69 on 1 and 65 DF, p-value: 0.000288
> 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.7091788960 0.5816422080 0.2908211
[2,] 0.6768345859 0.6463308282 0.3231654
[3,] 0.7027027592 0.5945944816 0.2972972
[4,] 0.5823824528 0.8352350945 0.4176175
[5,] 0.4828882435 0.9657764869 0.5171118
[6,] 0.3762075667 0.7524151334 0.6237924
[7,] 0.3161827651 0.6323655303 0.6838172
[8,] 0.3773949452 0.7547898903 0.6226051
[9,] 0.4150405575 0.8300811151 0.5849594
[10,] 0.3252514332 0.6505028664 0.6747486
[11,] 0.4934262382 0.9868524763 0.5065738
[12,] 0.4108743737 0.8217487474 0.5891256
[13,] 0.3575310198 0.7150620395 0.6424690
[14,] 0.3483253805 0.6966507610 0.6516746
[15,] 0.3073752058 0.6147504117 0.6926248
[16,] 0.2550565249 0.5101130498 0.7449435
[17,] 0.2007634602 0.4015269203 0.7992365
[18,] 0.1732752762 0.3465505523 0.8267247
[19,] 0.2110427722 0.4220855445 0.7889572
[20,] 0.1748037560 0.3496075120 0.8251962
[21,] 0.1381012501 0.2762025001 0.8618987
[22,] 0.1438047170 0.2876094339 0.8561953
[23,] 0.1226567387 0.2453134775 0.8773433
[24,] 0.1237944329 0.2475888658 0.8762056
[25,] 0.1283088467 0.2566176935 0.8716912
[26,] 0.1104354286 0.2208708572 0.8895646
[27,] 0.0946072785 0.1892145571 0.9053927
[28,] 0.0694158234 0.1388316467 0.9305842
[29,] 0.0705112266 0.1410224532 0.9294888
[30,] 0.1519768622 0.3039537245 0.8480231
[31,] 0.1213147520 0.2426295040 0.8786852
[32,] 0.1176205478 0.2352410955 0.8823795
[33,] 0.0940438897 0.1880877793 0.9059561
[34,] 0.0788784212 0.1577568423 0.9211216
[35,] 0.0566954311 0.1133908622 0.9433046
[36,] 0.0407157136 0.0814314271 0.9592843
[37,] 0.0300884473 0.0601768946 0.9699116
[38,] 0.0239268686 0.0478537373 0.9760731
[39,] 0.0188121077 0.0376242153 0.9811879
[40,] 0.0160440804 0.0320881608 0.9839559
[41,] 0.0101587471 0.0203174943 0.9898413
[42,] 0.0068585165 0.0137170330 0.9931415
[43,] 0.0042544051 0.0085088102 0.9957456
[44,] 0.0031617526 0.0063235052 0.9968382
[45,] 0.0072269349 0.0144538698 0.9927731
[46,] 0.0078845284 0.0157690568 0.9921155
[47,] 0.0052457397 0.0104914794 0.9947543
[48,] 0.0034968009 0.0069936019 0.9965032
[49,] 0.0031111876 0.0062223752 0.9968888
[50,] 0.0016101657 0.0032203314 0.9983898
[51,] 0.0011443276 0.0022886552 0.9988557
[52,] 0.0005843234 0.0011686468 0.9994157
[53,] 0.0003000413 0.0006000827 0.9997000
[54,] 0.0002233821 0.0004467643 0.9997766
[55,] 0.0006305327 0.0012610654 0.9993695
[56,] 0.0024967078 0.0049934156 0.9975033
[57,] 0.0214894114 0.0429788227 0.9785106
[58,] 0.0899912774 0.1799825548 0.9100087
> postscript(file="/var/www/html/rcomp/tmp/1clhg1290810771.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/25cy11290810771.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/35cy11290810771.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/45cy11290810771.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/55cy11290810771.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 = 67
Frequency = 1
1 2 3 4 5
-785.8275862 -499.8275862 290.1724138 0.1724138 832.1724138
6 7 8 9 10
663.1724138 -765.8275862 33.1724138 279.1724138 -173.8275862
11 12 13 14 15
-437.8275862 803.1724138 802.1724138 111.1724138 1173.1724138
16 17 18 19 20
-24.8275862 440.1724138 649.1724138 -309.8275862 -197.8275862
21 22 23 24 25
82.1724138 370.1724138 -782.8275862 -303.8275862 -192.8275862
26 27 28 29 30
-709.8275862 187.1724138 -723.8275862 -807.8275862 787.0789474
31 32 33 34 35
-15.9210526 262.0789474 -506.9210526 1341.0789474 -67.9210526
36 37 38 39 40
-485.9210526 420.0789474 523.0789474 95.0789474 254.0789474
41 42 43 44 45
-211.9210526 485.0789474 -362.9210526 -487.9210526 124.0789474
46 47 48 49 50
-289.9210526 -206.9210526 469.0789474 -1091.9210526 -763.9210526
51 52 53 54 55
-375.9210526 -402.9210526 -634.9210526 -6.9210526 -485.9210526
56 57 58 59 60
-172.9210526 -228.9210526 -497.9210526 -935.9210526 -885.9210526
61 62 63 64 65
-857.9210526 -345.9210526 944.0789474 708.0789474 1318.0789474
66 67
2233.0789474 360.0789474
> postscript(file="/var/www/html/rcomp/tmp/6ylf41290810771.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 = 67
Frequency = 1
lag(myerror, k = 1) myerror
0 -785.8275862 NA
1 -499.8275862 -785.8275862
2 290.1724138 -499.8275862
3 0.1724138 290.1724138
4 832.1724138 0.1724138
5 663.1724138 832.1724138
6 -765.8275862 663.1724138
7 33.1724138 -765.8275862
8 279.1724138 33.1724138
9 -173.8275862 279.1724138
10 -437.8275862 -173.8275862
11 803.1724138 -437.8275862
12 802.1724138 803.1724138
13 111.1724138 802.1724138
14 1173.1724138 111.1724138
15 -24.8275862 1173.1724138
16 440.1724138 -24.8275862
17 649.1724138 440.1724138
18 -309.8275862 649.1724138
19 -197.8275862 -309.8275862
20 82.1724138 -197.8275862
21 370.1724138 82.1724138
22 -782.8275862 370.1724138
23 -303.8275862 -782.8275862
24 -192.8275862 -303.8275862
25 -709.8275862 -192.8275862
26 187.1724138 -709.8275862
27 -723.8275862 187.1724138
28 -807.8275862 -723.8275862
29 787.0789474 -807.8275862
30 -15.9210526 787.0789474
31 262.0789474 -15.9210526
32 -506.9210526 262.0789474
33 1341.0789474 -506.9210526
34 -67.9210526 1341.0789474
35 -485.9210526 -67.9210526
36 420.0789474 -485.9210526
37 523.0789474 420.0789474
38 95.0789474 523.0789474
39 254.0789474 95.0789474
40 -211.9210526 254.0789474
41 485.0789474 -211.9210526
42 -362.9210526 485.0789474
43 -487.9210526 -362.9210526
44 124.0789474 -487.9210526
45 -289.9210526 124.0789474
46 -206.9210526 -289.9210526
47 469.0789474 -206.9210526
48 -1091.9210526 469.0789474
49 -763.9210526 -1091.9210526
50 -375.9210526 -763.9210526
51 -402.9210526 -375.9210526
52 -634.9210526 -402.9210526
53 -6.9210526 -634.9210526
54 -485.9210526 -6.9210526
55 -172.9210526 -485.9210526
56 -228.9210526 -172.9210526
57 -497.9210526 -228.9210526
58 -935.9210526 -497.9210526
59 -885.9210526 -935.9210526
60 -857.9210526 -885.9210526
61 -345.9210526 -857.9210526
62 944.0789474 -345.9210526
63 708.0789474 944.0789474
64 1318.0789474 708.0789474
65 2233.0789474 1318.0789474
66 360.0789474 2233.0789474
67 NA 360.0789474
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -499.8275862 -785.8275862
[2,] 290.1724138 -499.8275862
[3,] 0.1724138 290.1724138
[4,] 832.1724138 0.1724138
[5,] 663.1724138 832.1724138
[6,] -765.8275862 663.1724138
[7,] 33.1724138 -765.8275862
[8,] 279.1724138 33.1724138
[9,] -173.8275862 279.1724138
[10,] -437.8275862 -173.8275862
[11,] 803.1724138 -437.8275862
[12,] 802.1724138 803.1724138
[13,] 111.1724138 802.1724138
[14,] 1173.1724138 111.1724138
[15,] -24.8275862 1173.1724138
[16,] 440.1724138 -24.8275862
[17,] 649.1724138 440.1724138
[18,] -309.8275862 649.1724138
[19,] -197.8275862 -309.8275862
[20,] 82.1724138 -197.8275862
[21,] 370.1724138 82.1724138
[22,] -782.8275862 370.1724138
[23,] -303.8275862 -782.8275862
[24,] -192.8275862 -303.8275862
[25,] -709.8275862 -192.8275862
[26,] 187.1724138 -709.8275862
[27,] -723.8275862 187.1724138
[28,] -807.8275862 -723.8275862
[29,] 787.0789474 -807.8275862
[30,] -15.9210526 787.0789474
[31,] 262.0789474 -15.9210526
[32,] -506.9210526 262.0789474
[33,] 1341.0789474 -506.9210526
[34,] -67.9210526 1341.0789474
[35,] -485.9210526 -67.9210526
[36,] 420.0789474 -485.9210526
[37,] 523.0789474 420.0789474
[38,] 95.0789474 523.0789474
[39,] 254.0789474 95.0789474
[40,] -211.9210526 254.0789474
[41,] 485.0789474 -211.9210526
[42,] -362.9210526 485.0789474
[43,] -487.9210526 -362.9210526
[44,] 124.0789474 -487.9210526
[45,] -289.9210526 124.0789474
[46,] -206.9210526 -289.9210526
[47,] 469.0789474 -206.9210526
[48,] -1091.9210526 469.0789474
[49,] -763.9210526 -1091.9210526
[50,] -375.9210526 -763.9210526
[51,] -402.9210526 -375.9210526
[52,] -634.9210526 -402.9210526
[53,] -6.9210526 -634.9210526
[54,] -485.9210526 -6.9210526
[55,] -172.9210526 -485.9210526
[56,] -228.9210526 -172.9210526
[57,] -497.9210526 -228.9210526
[58,] -935.9210526 -497.9210526
[59,] -885.9210526 -935.9210526
[60,] -857.9210526 -885.9210526
[61,] -345.9210526 -857.9210526
[62,] 944.0789474 -345.9210526
[63,] 708.0789474 944.0789474
[64,] 1318.0789474 708.0789474
[65,] 2233.0789474 1318.0789474
[66,] 360.0789474 2233.0789474
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -499.8275862 -785.8275862
2 290.1724138 -499.8275862
3 0.1724138 290.1724138
4 832.1724138 0.1724138
5 663.1724138 832.1724138
6 -765.8275862 663.1724138
7 33.1724138 -765.8275862
8 279.1724138 33.1724138
9 -173.8275862 279.1724138
10 -437.8275862 -173.8275862
11 803.1724138 -437.8275862
12 802.1724138 803.1724138
13 111.1724138 802.1724138
14 1173.1724138 111.1724138
15 -24.8275862 1173.1724138
16 440.1724138 -24.8275862
17 649.1724138 440.1724138
18 -309.8275862 649.1724138
19 -197.8275862 -309.8275862
20 82.1724138 -197.8275862
21 370.1724138 82.1724138
22 -782.8275862 370.1724138
23 -303.8275862 -782.8275862
24 -192.8275862 -303.8275862
25 -709.8275862 -192.8275862
26 187.1724138 -709.8275862
27 -723.8275862 187.1724138
28 -807.8275862 -723.8275862
29 787.0789474 -807.8275862
30 -15.9210526 787.0789474
31 262.0789474 -15.9210526
32 -506.9210526 262.0789474
33 1341.0789474 -506.9210526
34 -67.9210526 1341.0789474
35 -485.9210526 -67.9210526
36 420.0789474 -485.9210526
37 523.0789474 420.0789474
38 95.0789474 523.0789474
39 254.0789474 95.0789474
40 -211.9210526 254.0789474
41 485.0789474 -211.9210526
42 -362.9210526 485.0789474
43 -487.9210526 -362.9210526
44 124.0789474 -487.9210526
45 -289.9210526 124.0789474
46 -206.9210526 -289.9210526
47 469.0789474 -206.9210526
48 -1091.9210526 469.0789474
49 -763.9210526 -1091.9210526
50 -375.9210526 -763.9210526
51 -402.9210526 -375.9210526
52 -634.9210526 -402.9210526
53 -6.9210526 -634.9210526
54 -485.9210526 -6.9210526
55 -172.9210526 -485.9210526
56 -228.9210526 -172.9210526
57 -497.9210526 -228.9210526
58 -935.9210526 -497.9210526
59 -885.9210526 -935.9210526
60 -857.9210526 -885.9210526
61 -345.9210526 -857.9210526
62 944.0789474 -345.9210526
63 708.0789474 944.0789474
64 1318.0789474 708.0789474
65 2233.0789474 1318.0789474
66 360.0789474 2233.0789474
> 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/7qdfp1290810771.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/8qdfp1290810771.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/9qdfp1290810771.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/1014wa1290810771.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/11m4uy1290810771.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/128nbl1290810771.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/134f9u1290810771.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/147x7i1290810771.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/150oo31290810771.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/16eg4u1290810771.tab")
+ }
>
> try(system("convert tmp/1clhg1290810771.ps tmp/1clhg1290810771.png",intern=TRUE))
character(0)
> try(system("convert tmp/25cy11290810771.ps tmp/25cy11290810771.png",intern=TRUE))
character(0)
> try(system("convert tmp/35cy11290810771.ps tmp/35cy11290810771.png",intern=TRUE))
character(0)
> try(system("convert tmp/45cy11290810771.ps tmp/45cy11290810771.png",intern=TRUE))
character(0)
> try(system("convert tmp/55cy11290810771.ps tmp/55cy11290810771.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ylf41290810771.ps tmp/6ylf41290810771.png",intern=TRUE))
character(0)
> try(system("convert tmp/7qdfp1290810771.ps tmp/7qdfp1290810771.png",intern=TRUE))
character(0)
> try(system("convert tmp/8qdfp1290810771.ps tmp/8qdfp1290810771.png",intern=TRUE))
character(0)
> try(system("convert tmp/9qdfp1290810771.ps tmp/9qdfp1290810771.png",intern=TRUE))
character(0)
> try(system("convert tmp/1014wa1290810771.ps tmp/1014wa1290810771.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.503 1.561 6.377