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(17015,1,17979,1,16593,1,18817,1,17370,1,17338,1,17224,1,13405,1,16159,1,17157,1,15202,0,13230,0,14351,0,15960,0,15140,0,14392,0,16202,0,14180,0,14716,0,13105,0,15428,0,15452,0,15031,0,12621,0,13154,0,15486,0,14741,0,13260,0,16170,0,13584,0,13527,0,13880,0,14733,0,13615,0,14466,0,11593,0,11816,0,14049,0,13012,0,13772,0,14908,0,12934,0,12509,0,12973,0,13807,0,13979,0,13938,0,10723,0,11956,0,13698,0,11810,0,12778,0,13933,0,11793,0,11391,0,11191,0,11687,0,13040,0,12639,0,9097,0),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 17015 1
2 17979 1
3 16593 1
4 18817 1
5 17370 1
6 17338 1
7 17224 1
8 13405 1
9 16159 1
10 17157 1
11 15202 0
12 13230 0
13 14351 0
14 15960 0
15 15140 0
16 14392 0
17 16202 0
18 14180 0
19 14716 0
20 13105 0
21 15428 0
22 15452 0
23 15031 0
24 12621 0
25 13154 0
26 15486 0
27 14741 0
28 13260 0
29 16170 0
30 13584 0
31 13527 0
32 13880 0
33 14733 0
34 13615 0
35 14466 0
36 11593 0
37 11816 0
38 14049 0
39 13012 0
40 13772 0
41 14908 0
42 12934 0
43 12509 0
44 12973 0
45 13807 0
46 13979 0
47 13938 0
48 10723 0
49 11956 0
50 13698 0
51 11810 0
52 12778 0
53 13933 0
54 11793 0
55 11391 0
56 11191 0
57 11687 0
58 13040 0
59 12639 0
60 9097 0
> 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.27603472 0.5520694 0.7239653
[2,] 0.14579850 0.2915970 0.8542015
[3,] 0.07399186 0.1479837 0.9260081
[4,] 0.73968701 0.5206260 0.2603130
[5,] 0.65823201 0.6835360 0.3417680
[6,] 0.55125767 0.8974847 0.4487423
[7,] 0.46136635 0.9227327 0.5386336
[8,] 0.43396989 0.8679398 0.5660301
[9,] 0.34245694 0.6849139 0.6575431
[10,] 0.37324831 0.7464966 0.6267517
[11,] 0.31480106 0.6296021 0.6851989
[12,] 0.24808959 0.4961792 0.7519104
[13,] 0.29565845 0.5913169 0.7043416
[14,] 0.24392092 0.4878418 0.7560791
[15,] 0.19645917 0.3929183 0.8035408
[16,] 0.20151417 0.4030283 0.7984858
[17,] 0.19463035 0.3892607 0.8053697
[18,] 0.19359458 0.3871892 0.8064054
[19,] 0.17335154 0.3467031 0.8266485
[20,] 0.21657620 0.4331524 0.7834238
[21,] 0.20299768 0.4059954 0.7970023
[22,] 0.22656153 0.4531231 0.7734385
[23,] 0.20536700 0.4107340 0.7946330
[24,] 0.18575732 0.3715146 0.8142427
[25,] 0.33266472 0.6653294 0.6673353
[26,] 0.29735845 0.5947169 0.7026416
[27,] 0.26299387 0.5259877 0.7370061
[28,] 0.22950176 0.4590035 0.7704982
[29,] 0.23907551 0.4781510 0.7609245
[30,] 0.21005536 0.4201107 0.7899446
[31,] 0.21350240 0.4270048 0.7864976
[32,] 0.31318904 0.6263781 0.6868110
[33,] 0.36529561 0.7305912 0.6347044
[34,] 0.34104006 0.6820801 0.6589599
[35,] 0.29660344 0.5932069 0.7033966
[36,] 0.26495059 0.5299012 0.7350494
[37,] 0.35801131 0.7160226 0.6419887
[38,] 0.31368398 0.6273680 0.6863160
[39,] 0.27656721 0.5531344 0.7234328
[40,] 0.23238138 0.4647628 0.7676186
[41,] 0.22485548 0.4497110 0.7751445
[42,] 0.24577888 0.4915578 0.7542211
[43,] 0.28824549 0.5764910 0.7117545
[44,] 0.38586001 0.7717200 0.6141400
[45,] 0.32967973 0.6593595 0.6703203
[46,] 0.35151216 0.7030243 0.6484878
[47,] 0.28684020 0.5736804 0.7131598
[48,] 0.22883256 0.4576651 0.7711674
[49,] 0.35149047 0.7029809 0.6485095
[50,] 0.25496069 0.5099214 0.7450393
[51,] 0.16678822 0.3335764 0.8332118
> postscript(file="/var/www/html/rcomp/tmp/1sf391227532060.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/2ec8k1227532060.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/3ab511227532060.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/4to101227532060.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/57z2g1227532060.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
109.30 1073.30 -312.70 1911.30 464.30 432.30 318.30 -3500.70
9 10 11 12 13 14 15 16
-746.70 251.30 1668.96 -303.04 817.96 2426.96 1606.96 858.96
17 18 19 20 21 22 23 24
2668.96 646.96 1182.96 -428.04 1894.96 1918.96 1497.96 -912.04
25 26 27 28 29 30 31 32
-379.04 1952.96 1207.96 -273.04 2636.96 50.96 -6.04 346.96
33 34 35 36 37 38 39 40
1199.96 81.96 932.96 -1940.04 -1717.04 515.96 -521.04 238.96
41 42 43 44 45 46 47 48
1374.96 -599.04 -1024.04 -560.04 273.96 445.96 404.96 -2810.04
49 50 51 52 53 54 55 56
-1577.04 164.96 -1723.04 -755.04 399.96 -1740.04 -2142.04 -2342.04
57 58 59 60
-1846.04 -493.04 -894.04 -4436.04
> postscript(file="/var/www/html/rcomp/tmp/6y8w61227532060.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 109.30 NA
1 1073.30 109.30
2 -312.70 1073.30
3 1911.30 -312.70
4 464.30 1911.30
5 432.30 464.30
6 318.30 432.30
7 -3500.70 318.30
8 -746.70 -3500.70
9 251.30 -746.70
10 1668.96 251.30
11 -303.04 1668.96
12 817.96 -303.04
13 2426.96 817.96
14 1606.96 2426.96
15 858.96 1606.96
16 2668.96 858.96
17 646.96 2668.96
18 1182.96 646.96
19 -428.04 1182.96
20 1894.96 -428.04
21 1918.96 1894.96
22 1497.96 1918.96
23 -912.04 1497.96
24 -379.04 -912.04
25 1952.96 -379.04
26 1207.96 1952.96
27 -273.04 1207.96
28 2636.96 -273.04
29 50.96 2636.96
30 -6.04 50.96
31 346.96 -6.04
32 1199.96 346.96
33 81.96 1199.96
34 932.96 81.96
35 -1940.04 932.96
36 -1717.04 -1940.04
37 515.96 -1717.04
38 -521.04 515.96
39 238.96 -521.04
40 1374.96 238.96
41 -599.04 1374.96
42 -1024.04 -599.04
43 -560.04 -1024.04
44 273.96 -560.04
45 445.96 273.96
46 404.96 445.96
47 -2810.04 404.96
48 -1577.04 -2810.04
49 164.96 -1577.04
50 -1723.04 164.96
51 -755.04 -1723.04
52 399.96 -755.04
53 -1740.04 399.96
54 -2142.04 -1740.04
55 -2342.04 -2142.04
56 -1846.04 -2342.04
57 -493.04 -1846.04
58 -894.04 -493.04
59 -4436.04 -894.04
60 NA -4436.04
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1073.30 109.30
[2,] -312.70 1073.30
[3,] 1911.30 -312.70
[4,] 464.30 1911.30
[5,] 432.30 464.30
[6,] 318.30 432.30
[7,] -3500.70 318.30
[8,] -746.70 -3500.70
[9,] 251.30 -746.70
[10,] 1668.96 251.30
[11,] -303.04 1668.96
[12,] 817.96 -303.04
[13,] 2426.96 817.96
[14,] 1606.96 2426.96
[15,] 858.96 1606.96
[16,] 2668.96 858.96
[17,] 646.96 2668.96
[18,] 1182.96 646.96
[19,] -428.04 1182.96
[20,] 1894.96 -428.04
[21,] 1918.96 1894.96
[22,] 1497.96 1918.96
[23,] -912.04 1497.96
[24,] -379.04 -912.04
[25,] 1952.96 -379.04
[26,] 1207.96 1952.96
[27,] -273.04 1207.96
[28,] 2636.96 -273.04
[29,] 50.96 2636.96
[30,] -6.04 50.96
[31,] 346.96 -6.04
[32,] 1199.96 346.96
[33,] 81.96 1199.96
[34,] 932.96 81.96
[35,] -1940.04 932.96
[36,] -1717.04 -1940.04
[37,] 515.96 -1717.04
[38,] -521.04 515.96
[39,] 238.96 -521.04
[40,] 1374.96 238.96
[41,] -599.04 1374.96
[42,] -1024.04 -599.04
[43,] -560.04 -1024.04
[44,] 273.96 -560.04
[45,] 445.96 273.96
[46,] 404.96 445.96
[47,] -2810.04 404.96
[48,] -1577.04 -2810.04
[49,] 164.96 -1577.04
[50,] -1723.04 164.96
[51,] -755.04 -1723.04
[52,] 399.96 -755.04
[53,] -1740.04 399.96
[54,] -2142.04 -1740.04
[55,] -2342.04 -2142.04
[56,] -1846.04 -2342.04
[57,] -493.04 -1846.04
[58,] -894.04 -493.04
[59,] -4436.04 -894.04
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1073.30 109.30
2 -312.70 1073.30
3 1911.30 -312.70
4 464.30 1911.30
5 432.30 464.30
6 318.30 432.30
7 -3500.70 318.30
8 -746.70 -3500.70
9 251.30 -746.70
10 1668.96 251.30
11 -303.04 1668.96
12 817.96 -303.04
13 2426.96 817.96
14 1606.96 2426.96
15 858.96 1606.96
16 2668.96 858.96
17 646.96 2668.96
18 1182.96 646.96
19 -428.04 1182.96
20 1894.96 -428.04
21 1918.96 1894.96
22 1497.96 1918.96
23 -912.04 1497.96
24 -379.04 -912.04
25 1952.96 -379.04
26 1207.96 1952.96
27 -273.04 1207.96
28 2636.96 -273.04
29 50.96 2636.96
30 -6.04 50.96
31 346.96 -6.04
32 1199.96 346.96
33 81.96 1199.96
34 932.96 81.96
35 -1940.04 932.96
36 -1717.04 -1940.04
37 515.96 -1717.04
38 -521.04 515.96
39 238.96 -521.04
40 1374.96 238.96
41 -599.04 1374.96
42 -1024.04 -599.04
43 -560.04 -1024.04
44 273.96 -560.04
45 445.96 273.96
46 404.96 445.96
47 -2810.04 404.96
48 -1577.04 -2810.04
49 164.96 -1577.04
50 -1723.04 164.96
51 -755.04 -1723.04
52 399.96 -755.04
53 -1740.04 399.96
54 -2142.04 -1740.04
55 -2342.04 -2142.04
56 -1846.04 -2342.04
57 -493.04 -1846.04
58 -894.04 -493.04
59 -4436.04 -894.04
> 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/7gwov1227532060.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/8esm71227532060.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/9somh1227532060.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/10g0ic1227532060.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/11i8cj1227532060.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/12sfh61227532060.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/13l9bu1227532060.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/14yunb1227532060.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/153l1b1227532060.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/16hkhp1227532060.tab")
+ }
>
> system("convert tmp/1sf391227532060.ps tmp/1sf391227532060.png")
> system("convert tmp/2ec8k1227532060.ps tmp/2ec8k1227532060.png")
> system("convert tmp/3ab511227532060.ps tmp/3ab511227532060.png")
> system("convert tmp/4to101227532060.ps tmp/4to101227532060.png")
> system("convert tmp/57z2g1227532060.ps tmp/57z2g1227532060.png")
> system("convert tmp/6y8w61227532060.ps tmp/6y8w61227532060.png")
> system("convert tmp/7gwov1227532060.ps tmp/7gwov1227532060.png")
> system("convert tmp/8esm71227532060.ps tmp/8esm71227532060.png")
> system("convert tmp/9somh1227532060.ps tmp/9somh1227532060.png")
> system("convert tmp/10g0ic1227532060.ps tmp/10g0ic1227532060.png")
>
>
> proc.time()
user system elapsed
2.439 1.535 2.922