R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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(9097,0,12639,0,13040,0,11687,0,11191,0,11391,0,11793,0,13933,0,12778,0,11810,0,13698,0,11956,0,10723,0,13938,0,13979,0,13807,0,12973,0,12509,0,12934,0,14908,0,13772,0,13012,0,14049,0,11816,0,11593,0,14466,0,13615,0,14733,0,13880,0,13527,0,13584,0,16170,0,13260,0,14741,0,15486,0,13154,0,12621,0,15031,0,15452,0,15428,0,13105,0,14716,0,14180,0,16202,0,14392,0,15140,0,15960,0,14351,0,13230,0,15202,0,17157,1,16159,1,13405,1,17224,1,17338,1,17370,1,18817,1,16593,1,17979,1,17015,1),dim=c(2,60),dimnames=list(c('Uitvoer','x'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Uitvoer','x'),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
Uitvoer x
1 9097 0
2 12639 0
3 13040 0
4 11687 0
5 11191 0
6 11391 0
7 11793 0
8 13933 0
9 12778 0
10 11810 0
11 13698 0
12 11956 0
13 10723 0
14 13938 0
15 13979 0
16 13807 0
17 12973 0
18 12509 0
19 12934 0
20 14908 0
21 13772 0
22 13012 0
23 14049 0
24 11816 0
25 11593 0
26 14466 0
27 13615 0
28 14733 0
29 13880 0
30 13527 0
31 13584 0
32 16170 0
33 13260 0
34 14741 0
35 15486 0
36 13154 0
37 12621 0
38 15031 0
39 15452 0
40 15428 0
41 13105 0
42 14716 0
43 14180 0
44 16202 0
45 14392 0
46 15140 0
47 15960 0
48 14351 0
49 13230 0
50 15202 0
51 17157 1
52 16159 1
53 13405 1
54 17224 1
55 17338 1
56 17370 1
57 18817 1
58 16593 1
59 17979 1
60 17015 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) x
13533 3373
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-4436.0 -748.8 202.0 968.0 2669.0
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 13533.0 210.2 64.389 < 2e-16 ***
x 3372.7 514.8 6.551 1.66e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1486 on 58 degrees of freedom
Multiple R-squared: 0.4253, Adjusted R-squared: 0.4154
F-statistic: 42.92 on 1 and 58 DF, p-value: 1.657e-08
> 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.8332118 0.3335764 0.16678822
[2,] 0.7450393 0.5099214 0.25496069
[3,] 0.6485095 0.7029809 0.35149047
[4,] 0.7711674 0.4576651 0.22883256
[5,] 0.7131598 0.5736804 0.28684020
[6,] 0.6484878 0.7030243 0.35151216
[7,] 0.6703203 0.6593595 0.32967973
[8,] 0.6141400 0.7717200 0.38586001
[9,] 0.7117545 0.5764910 0.28824549
[10,] 0.7542211 0.4915578 0.24577888
[11,] 0.7751445 0.4497110 0.22485548
[12,] 0.7676186 0.4647628 0.23238138
[13,] 0.7234328 0.5531344 0.27656721
[14,] 0.6863160 0.6273680 0.31368398
[15,] 0.6419887 0.7160226 0.35801131
[16,] 0.7350494 0.5299012 0.26495059
[17,] 0.7033966 0.5932069 0.29660344
[18,] 0.6589599 0.6820801 0.34104006
[19,] 0.6347044 0.7305912 0.36529561
[20,] 0.6868110 0.6263781 0.31318904
[21,] 0.7864976 0.4270048 0.21350240
[22,] 0.7899446 0.4201107 0.21005536
[23,] 0.7609245 0.4781510 0.23907551
[24,] 0.7704982 0.4590035 0.22950176
[25,] 0.7370061 0.5259877 0.26299387
[26,] 0.7026416 0.5947169 0.29735845
[27,] 0.6673353 0.6653294 0.33266472
[28,] 0.8142427 0.3715146 0.18575732
[29,] 0.7946330 0.4107340 0.20536700
[30,] 0.7734385 0.4531231 0.22656153
[31,] 0.7970023 0.4059954 0.20299768
[32,] 0.7834238 0.4331524 0.21657620
[33,] 0.8266485 0.3467031 0.17335154
[34,] 0.8064054 0.3871892 0.19359458
[35,] 0.8053697 0.3892607 0.19463035
[36,] 0.7984858 0.4030283 0.20151417
[37,] 0.8035408 0.3929183 0.19645917
[38,] 0.7560791 0.4878418 0.24392092
[39,] 0.7043416 0.5913169 0.29565845
[40,] 0.7519104 0.4961792 0.24808959
[41,] 0.6851989 0.6296021 0.31480106
[42,] 0.6267517 0.7464966 0.37324831
[43,] 0.6575431 0.6849139 0.34245694
[44,] 0.5660301 0.8679398 0.43396989
[45,] 0.5386336 0.9227327 0.46136635
[46,] 0.4487423 0.8974847 0.55125767
[47,] 0.3417680 0.6835360 0.65823201
[48,] 0.2603130 0.5206260 0.73968701
[49,] 0.9260081 0.1479837 0.07399186
[50,] 0.8542015 0.2915970 0.14579850
[51,] 0.7239653 0.5520694 0.27603472
> postscript(file="/var/www/html/rcomp/tmp/1kr611227532964.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/2d6i51227532964.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/31rkf1227532964.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/4exhc1227532964.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/5dgh01227532964.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 7 8
-4436.04 -894.04 -493.04 -1846.04 -2342.04 -2142.04 -1740.04 399.96
9 10 11 12 13 14 15 16
-755.04 -1723.04 164.96 -1577.04 -2810.04 404.96 445.96 273.96
17 18 19 20 21 22 23 24
-560.04 -1024.04 -599.04 1374.96 238.96 -521.04 515.96 -1717.04
25 26 27 28 29 30 31 32
-1940.04 932.96 81.96 1199.96 346.96 -6.04 50.96 2636.96
33 34 35 36 37 38 39 40
-273.04 1207.96 1952.96 -379.04 -912.04 1497.96 1918.96 1894.96
41 42 43 44 45 46 47 48
-428.04 1182.96 646.96 2668.96 858.96 1606.96 2426.96 817.96
49 50 51 52 53 54 55 56
-303.04 1668.96 251.30 -746.70 -3500.70 318.30 432.30 464.30
57 58 59 60
1911.30 -312.70 1073.30 109.30
> postscript(file="/var/www/html/rcomp/tmp/6tuk51227532964.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 -4436.04 NA
1 -894.04 -4436.04
2 -493.04 -894.04
3 -1846.04 -493.04
4 -2342.04 -1846.04
5 -2142.04 -2342.04
6 -1740.04 -2142.04
7 399.96 -1740.04
8 -755.04 399.96
9 -1723.04 -755.04
10 164.96 -1723.04
11 -1577.04 164.96
12 -2810.04 -1577.04
13 404.96 -2810.04
14 445.96 404.96
15 273.96 445.96
16 -560.04 273.96
17 -1024.04 -560.04
18 -599.04 -1024.04
19 1374.96 -599.04
20 238.96 1374.96
21 -521.04 238.96
22 515.96 -521.04
23 -1717.04 515.96
24 -1940.04 -1717.04
25 932.96 -1940.04
26 81.96 932.96
27 1199.96 81.96
28 346.96 1199.96
29 -6.04 346.96
30 50.96 -6.04
31 2636.96 50.96
32 -273.04 2636.96
33 1207.96 -273.04
34 1952.96 1207.96
35 -379.04 1952.96
36 -912.04 -379.04
37 1497.96 -912.04
38 1918.96 1497.96
39 1894.96 1918.96
40 -428.04 1894.96
41 1182.96 -428.04
42 646.96 1182.96
43 2668.96 646.96
44 858.96 2668.96
45 1606.96 858.96
46 2426.96 1606.96
47 817.96 2426.96
48 -303.04 817.96
49 1668.96 -303.04
50 251.30 1668.96
51 -746.70 251.30
52 -3500.70 -746.70
53 318.30 -3500.70
54 432.30 318.30
55 464.30 432.30
56 1911.30 464.30
57 -312.70 1911.30
58 1073.30 -312.70
59 109.30 1073.30
60 NA 109.30
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -894.04 -4436.04
[2,] -493.04 -894.04
[3,] -1846.04 -493.04
[4,] -2342.04 -1846.04
[5,] -2142.04 -2342.04
[6,] -1740.04 -2142.04
[7,] 399.96 -1740.04
[8,] -755.04 399.96
[9,] -1723.04 -755.04
[10,] 164.96 -1723.04
[11,] -1577.04 164.96
[12,] -2810.04 -1577.04
[13,] 404.96 -2810.04
[14,] 445.96 404.96
[15,] 273.96 445.96
[16,] -560.04 273.96
[17,] -1024.04 -560.04
[18,] -599.04 -1024.04
[19,] 1374.96 -599.04
[20,] 238.96 1374.96
[21,] -521.04 238.96
[22,] 515.96 -521.04
[23,] -1717.04 515.96
[24,] -1940.04 -1717.04
[25,] 932.96 -1940.04
[26,] 81.96 932.96
[27,] 1199.96 81.96
[28,] 346.96 1199.96
[29,] -6.04 346.96
[30,] 50.96 -6.04
[31,] 2636.96 50.96
[32,] -273.04 2636.96
[33,] 1207.96 -273.04
[34,] 1952.96 1207.96
[35,] -379.04 1952.96
[36,] -912.04 -379.04
[37,] 1497.96 -912.04
[38,] 1918.96 1497.96
[39,] 1894.96 1918.96
[40,] -428.04 1894.96
[41,] 1182.96 -428.04
[42,] 646.96 1182.96
[43,] 2668.96 646.96
[44,] 858.96 2668.96
[45,] 1606.96 858.96
[46,] 2426.96 1606.96
[47,] 817.96 2426.96
[48,] -303.04 817.96
[49,] 1668.96 -303.04
[50,] 251.30 1668.96
[51,] -746.70 251.30
[52,] -3500.70 -746.70
[53,] 318.30 -3500.70
[54,] 432.30 318.30
[55,] 464.30 432.30
[56,] 1911.30 464.30
[57,] -312.70 1911.30
[58,] 1073.30 -312.70
[59,] 109.30 1073.30
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -894.04 -4436.04
2 -493.04 -894.04
3 -1846.04 -493.04
4 -2342.04 -1846.04
5 -2142.04 -2342.04
6 -1740.04 -2142.04
7 399.96 -1740.04
8 -755.04 399.96
9 -1723.04 -755.04
10 164.96 -1723.04
11 -1577.04 164.96
12 -2810.04 -1577.04
13 404.96 -2810.04
14 445.96 404.96
15 273.96 445.96
16 -560.04 273.96
17 -1024.04 -560.04
18 -599.04 -1024.04
19 1374.96 -599.04
20 238.96 1374.96
21 -521.04 238.96
22 515.96 -521.04
23 -1717.04 515.96
24 -1940.04 -1717.04
25 932.96 -1940.04
26 81.96 932.96
27 1199.96 81.96
28 346.96 1199.96
29 -6.04 346.96
30 50.96 -6.04
31 2636.96 50.96
32 -273.04 2636.96
33 1207.96 -273.04
34 1952.96 1207.96
35 -379.04 1952.96
36 -912.04 -379.04
37 1497.96 -912.04
38 1918.96 1497.96
39 1894.96 1918.96
40 -428.04 1894.96
41 1182.96 -428.04
42 646.96 1182.96
43 2668.96 646.96
44 858.96 2668.96
45 1606.96 858.96
46 2426.96 1606.96
47 817.96 2426.96
48 -303.04 817.96
49 1668.96 -303.04
50 251.30 1668.96
51 -746.70 251.30
52 -3500.70 -746.70
53 318.30 -3500.70
54 432.30 318.30
55 464.30 432.30
56 1911.30 464.30
57 -312.70 1911.30
58 1073.30 -312.70
59 109.30 1073.30
> 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/765kq1227532964.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/8u1c11227532964.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/94xbe1227532964.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/10upqm1227532964.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/11mkcu1227532964.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/1245qd1227532964.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/13t45y1227532964.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/144b1c1227532964.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/15by0i1227532964.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/1662uo1227532964.tab")
+ }
>
> system("convert tmp/1kr611227532964.ps tmp/1kr611227532964.png")
> system("convert tmp/2d6i51227532964.ps tmp/2d6i51227532964.png")
> system("convert tmp/31rkf1227532964.ps tmp/31rkf1227532964.png")
> system("convert tmp/4exhc1227532964.ps tmp/4exhc1227532964.png")
> system("convert tmp/5dgh01227532964.ps tmp/5dgh01227532964.png")
> system("convert tmp/6tuk51227532964.ps tmp/6tuk51227532964.png")
> system("convert tmp/765kq1227532964.ps tmp/765kq1227532964.png")
> system("convert tmp/8u1c11227532964.ps tmp/8u1c11227532964.png")
> system("convert tmp/94xbe1227532964.ps tmp/94xbe1227532964.png")
> system("convert tmp/10upqm1227532964.ps tmp/10upqm1227532964.png")
>
>
> proc.time()
user system elapsed
2.442 1.537 2.940