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(5219,4429,4143,0,4929,5219,4429,0,5761,4929,5219,0,5592,5761,4929,0,4163,5592,5761,0,4962,4163,5592,0,5208,4962,4163,0,4755,5208,4962,0,4491,4755,5208,0,5732,4491,4755,0,5731,5732,4491,0,5040,5731,5732,0,6102,5040,5731,0,4904,6102,5040,0,5369,4904,6102,0,5578,5369,4904,0,4619,5578,5369,0,4731,4619,5578,0,5011,4731,4619,0,5299,5011,4731,0,4146,5299,5011,0,4625,4146,5299,0,4736,4625,4146,0,4219,4736,4625,0,5116,4219,4736,0,4205,5116,4219,1,4121,4205,5116,1,5103,4121,4205,1,4300,5103,4121,1,4578,4300,5103,1,3809,4578,4300,1,5526,3809,4578,1,4248,5526,3809,1,3830,4248,5526,1,4428,3830,4248,1,4834,4428,3830,1,4406,4834,4428,1,4565,4406,4834,1,4104,4565,4406,1,4798,4104,4565,1,3935,4798,4104,1,3792,3935,4798,1,4387,3792,3935,1,4006,4387,3792,1,4078,4006,4387,1,4724,4078,4006,1),dim=c(4,46),dimnames=list(c('y','y(t-1)','y(t-2)','x'),1:46))
> y <- array(NA,dim=c(4,46),dimnames=list(c('y','y(t-1)','y(t-2)','x'),1:46))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Include Monthly 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 y(t-1) y(t-2) x M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 5219 4429 4143 0 1 0 0 0 0 0 0 0 0 0 0 1
2 4929 5219 4429 0 0 1 0 0 0 0 0 0 0 0 0 2
3 5761 4929 5219 0 0 0 1 0 0 0 0 0 0 0 0 3
4 5592 5761 4929 0 0 0 0 1 0 0 0 0 0 0 0 4
5 4163 5592 5761 0 0 0 0 0 1 0 0 0 0 0 0 5
6 4962 4163 5592 0 0 0 0 0 0 1 0 0 0 0 0 6
7 5208 4962 4163 0 0 0 0 0 0 0 1 0 0 0 0 7
8 4755 5208 4962 0 0 0 0 0 0 0 0 1 0 0 0 8
9 4491 4755 5208 0 0 0 0 0 0 0 0 0 1 0 0 9
10 5732 4491 4755 0 0 0 0 0 0 0 0 0 0 1 0 10
11 5731 5732 4491 0 0 0 0 0 0 0 0 0 0 0 1 11
12 5040 5731 5732 0 0 0 0 0 0 0 0 0 0 0 0 12
13 6102 5040 5731 0 1 0 0 0 0 0 0 0 0 0 0 13
14 4904 6102 5040 0 0 1 0 0 0 0 0 0 0 0 0 14
15 5369 4904 6102 0 0 0 1 0 0 0 0 0 0 0 0 15
16 5578 5369 4904 0 0 0 0 1 0 0 0 0 0 0 0 16
17 4619 5578 5369 0 0 0 0 0 1 0 0 0 0 0 0 17
18 4731 4619 5578 0 0 0 0 0 0 1 0 0 0 0 0 18
19 5011 4731 4619 0 0 0 0 0 0 0 1 0 0 0 0 19
20 5299 5011 4731 0 0 0 0 0 0 0 0 1 0 0 0 20
21 4146 5299 5011 0 0 0 0 0 0 0 0 0 1 0 0 21
22 4625 4146 5299 0 0 0 0 0 0 0 0 0 0 1 0 22
23 4736 4625 4146 0 0 0 0 0 0 0 0 0 0 0 1 23
24 4219 4736 4625 0 0 0 0 0 0 0 0 0 0 0 0 24
25 5116 4219 4736 0 1 0 0 0 0 0 0 0 0 0 0 25
26 4205 5116 4219 1 0 1 0 0 0 0 0 0 0 0 0 26
27 4121 4205 5116 1 0 0 1 0 0 0 0 0 0 0 0 27
28 5103 4121 4205 1 0 0 0 1 0 0 0 0 0 0 0 28
29 4300 5103 4121 1 0 0 0 0 1 0 0 0 0 0 0 29
30 4578 4300 5103 1 0 0 0 0 0 1 0 0 0 0 0 30
31 3809 4578 4300 1 0 0 0 0 0 0 1 0 0 0 0 31
32 5526 3809 4578 1 0 0 0 0 0 0 0 1 0 0 0 32
33 4248 5526 3809 1 0 0 0 0 0 0 0 0 1 0 0 33
34 3830 4248 5526 1 0 0 0 0 0 0 0 0 0 1 0 34
35 4428 3830 4248 1 0 0 0 0 0 0 0 0 0 0 1 35
36 4834 4428 3830 1 0 0 0 0 0 0 0 0 0 0 0 36
37 4406 4834 4428 1 1 0 0 0 0 0 0 0 0 0 0 37
38 4565 4406 4834 1 0 1 0 0 0 0 0 0 0 0 0 38
39 4104 4565 4406 1 0 0 1 0 0 0 0 0 0 0 0 39
40 4798 4104 4565 1 0 0 0 1 0 0 0 0 0 0 0 40
41 3935 4798 4104 1 0 0 0 0 1 0 0 0 0 0 0 41
42 3792 3935 4798 1 0 0 0 0 0 1 0 0 0 0 0 42
43 4387 3792 3935 1 0 0 0 0 0 0 1 0 0 0 0 43
44 4006 4387 3792 1 0 0 0 0 0 0 0 1 0 0 0 44
45 4078 4006 4387 1 0 0 0 0 0 0 0 0 1 0 0 45
46 4724 4078 4006 1 0 0 0 0 0 0 0 0 0 1 0 46
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `y(t-1)` `y(t-2)` x M1 M2
5484.11078 -0.00781 -0.05003 -268.10725 401.80106 -75.52350
M3 M4 M5 M6 M7 M8
154.70418 574.72548 -408.44719 -115.82887 -58.92286 265.16842
M9 M10 M11 t
-366.32160 147.77411 226.20564 -17.57067
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-626.72 -308.63 26.33 239.01 865.88
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5484.11078 1294.08596 4.238 0.000198 ***
`y(t-1)` -0.00781 0.17979 -0.043 0.965637
`y(t-2)` -0.05003 0.17075 -0.293 0.771525
x -268.10725 306.97556 -0.873 0.389392
M1 401.80106 356.50965 1.127 0.268659
M2 -75.52350 359.84536 -0.210 0.835182
M3 154.70418 373.00512 0.415 0.681275
M4 574.72548 353.22621 1.627 0.114181
M5 -408.44719 357.62816 -1.142 0.262446
M6 -115.82887 386.73022 -0.300 0.766618
M7 -58.92286 360.07692 -0.164 0.871112
M8 265.16842 351.56777 0.754 0.456582
M9 -366.32160 347.16409 -1.055 0.299766
M10 147.77411 368.08299 0.401 0.690920
M11 226.20564 379.88094 0.595 0.555999
t -17.57067 11.07622 -1.586 0.123147
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 453.3 on 30 degrees of freedom
Multiple R-squared: 0.6096, Adjusted R-squared: 0.4144
F-statistic: 3.123 on 15 and 30 DF, p-value: 0.003854
> 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.5781996 0.8436008 0.4218004
[2,] 0.5806366 0.8387268 0.4193634
[3,] 0.4653810 0.9307620 0.5346190
[4,] 0.5799126 0.8401748 0.4200874
[5,] 0.4992052 0.9984104 0.5007948
[6,] 0.3511465 0.7022929 0.6488535
[7,] 0.2148350 0.4296699 0.7851650
[8,] 0.1812013 0.3624026 0.8187987
[9,] 0.1405148 0.2810296 0.8594852
> postscript(file="/var/www/html/rcomp/tmp/1wsb11258738318.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/2i4au1258738318.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/3rrm61258738318.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/4ql5n1258738318.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/5qu0o1258738318.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 = 46
Frequency = 1
1 2 3 4 5 6
-407.467234 -182.092646 474.510332 -104.951155 -492.901429 11.434365
7 8 9 10 11 12
152.844343 -564.779570 -170.949241 548.799394 483.423004 98.280816
13 14 15 16 17 18
770.603339 41.221429 337.341095 87.584390 154.224856 -5.856442
19 20 21 22 23 24
187.702616 176.972495 -310.708522 -322.829942 -326.636094 -575.027647
25 26 27 28 29 30
-60.742550 -227.600432 -486.494381 46.820044 248.030631 293.842260
31 32 33 34 35 36
-552.497198 865.884730 211.881678 -626.720782 -156.786909 476.746832
37 38 39 40 41 42
-302.393555 368.471650 -325.357046 -29.453279 90.645942 -299.420183
43 44 45 46
211.950239 -478.077654 269.776086 400.751330
> postscript(file="/var/www/html/rcomp/tmp/6awjm1258738318.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 = 46
Frequency = 1
lag(myerror, k = 1) myerror
0 -407.467234 NA
1 -182.092646 -407.467234
2 474.510332 -182.092646
3 -104.951155 474.510332
4 -492.901429 -104.951155
5 11.434365 -492.901429
6 152.844343 11.434365
7 -564.779570 152.844343
8 -170.949241 -564.779570
9 548.799394 -170.949241
10 483.423004 548.799394
11 98.280816 483.423004
12 770.603339 98.280816
13 41.221429 770.603339
14 337.341095 41.221429
15 87.584390 337.341095
16 154.224856 87.584390
17 -5.856442 154.224856
18 187.702616 -5.856442
19 176.972495 187.702616
20 -310.708522 176.972495
21 -322.829942 -310.708522
22 -326.636094 -322.829942
23 -575.027647 -326.636094
24 -60.742550 -575.027647
25 -227.600432 -60.742550
26 -486.494381 -227.600432
27 46.820044 -486.494381
28 248.030631 46.820044
29 293.842260 248.030631
30 -552.497198 293.842260
31 865.884730 -552.497198
32 211.881678 865.884730
33 -626.720782 211.881678
34 -156.786909 -626.720782
35 476.746832 -156.786909
36 -302.393555 476.746832
37 368.471650 -302.393555
38 -325.357046 368.471650
39 -29.453279 -325.357046
40 90.645942 -29.453279
41 -299.420183 90.645942
42 211.950239 -299.420183
43 -478.077654 211.950239
44 269.776086 -478.077654
45 400.751330 269.776086
46 NA 400.751330
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -182.092646 -407.467234
[2,] 474.510332 -182.092646
[3,] -104.951155 474.510332
[4,] -492.901429 -104.951155
[5,] 11.434365 -492.901429
[6,] 152.844343 11.434365
[7,] -564.779570 152.844343
[8,] -170.949241 -564.779570
[9,] 548.799394 -170.949241
[10,] 483.423004 548.799394
[11,] 98.280816 483.423004
[12,] 770.603339 98.280816
[13,] 41.221429 770.603339
[14,] 337.341095 41.221429
[15,] 87.584390 337.341095
[16,] 154.224856 87.584390
[17,] -5.856442 154.224856
[18,] 187.702616 -5.856442
[19,] 176.972495 187.702616
[20,] -310.708522 176.972495
[21,] -322.829942 -310.708522
[22,] -326.636094 -322.829942
[23,] -575.027647 -326.636094
[24,] -60.742550 -575.027647
[25,] -227.600432 -60.742550
[26,] -486.494381 -227.600432
[27,] 46.820044 -486.494381
[28,] 248.030631 46.820044
[29,] 293.842260 248.030631
[30,] -552.497198 293.842260
[31,] 865.884730 -552.497198
[32,] 211.881678 865.884730
[33,] -626.720782 211.881678
[34,] -156.786909 -626.720782
[35,] 476.746832 -156.786909
[36,] -302.393555 476.746832
[37,] 368.471650 -302.393555
[38,] -325.357046 368.471650
[39,] -29.453279 -325.357046
[40,] 90.645942 -29.453279
[41,] -299.420183 90.645942
[42,] 211.950239 -299.420183
[43,] -478.077654 211.950239
[44,] 269.776086 -478.077654
[45,] 400.751330 269.776086
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -182.092646 -407.467234
2 474.510332 -182.092646
3 -104.951155 474.510332
4 -492.901429 -104.951155
5 11.434365 -492.901429
6 152.844343 11.434365
7 -564.779570 152.844343
8 -170.949241 -564.779570
9 548.799394 -170.949241
10 483.423004 548.799394
11 98.280816 483.423004
12 770.603339 98.280816
13 41.221429 770.603339
14 337.341095 41.221429
15 87.584390 337.341095
16 154.224856 87.584390
17 -5.856442 154.224856
18 187.702616 -5.856442
19 176.972495 187.702616
20 -310.708522 176.972495
21 -322.829942 -310.708522
22 -326.636094 -322.829942
23 -575.027647 -326.636094
24 -60.742550 -575.027647
25 -227.600432 -60.742550
26 -486.494381 -227.600432
27 46.820044 -486.494381
28 248.030631 46.820044
29 293.842260 248.030631
30 -552.497198 293.842260
31 865.884730 -552.497198
32 211.881678 865.884730
33 -626.720782 211.881678
34 -156.786909 -626.720782
35 476.746832 -156.786909
36 -302.393555 476.746832
37 368.471650 -302.393555
38 -325.357046 368.471650
39 -29.453279 -325.357046
40 90.645942 -29.453279
41 -299.420183 90.645942
42 211.950239 -299.420183
43 -478.077654 211.950239
44 269.776086 -478.077654
45 400.751330 269.776086
> 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/7cdpm1258738318.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/8vjfl1258738318.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/9uqi91258738318.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/10hhca1258738318.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/1134iu1258738318.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/12ea861258738318.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/13yxo61258738318.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/14uz1u1258738318.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/152gez1258738318.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/16p58o1258738318.tab")
+ }
>
> system("convert tmp/1wsb11258738318.ps tmp/1wsb11258738318.png")
> system("convert tmp/2i4au1258738318.ps tmp/2i4au1258738318.png")
> system("convert tmp/3rrm61258738318.ps tmp/3rrm61258738318.png")
> system("convert tmp/4ql5n1258738318.ps tmp/4ql5n1258738318.png")
> system("convert tmp/5qu0o1258738318.ps tmp/5qu0o1258738318.png")
> system("convert tmp/6awjm1258738318.ps tmp/6awjm1258738318.png")
> system("convert tmp/7cdpm1258738318.ps tmp/7cdpm1258738318.png")
> system("convert tmp/8vjfl1258738318.ps tmp/8vjfl1258738318.png")
> system("convert tmp/9uqi91258738318.ps tmp/9uqi91258738318.png")
> system("convert tmp/10hhca1258738318.ps tmp/10hhca1258738318.png")
>
>
> proc.time()
user system elapsed
2.223 1.502 2.631