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(114,1,113.8,1,113.6,1,113.7,1,114.2,1,114.8,0,115.2,1,115.3,1,114.9,1,115.1,0,116,0,116,0,116,0,115.9,1,115.6,1,116.6,1,116.9,0,117.9,1,117.9,1,117.7,0,117.4,1,117.3,0,119,1,119.1,0,119,0,118.5,0,117,1,117.5,1,118.2,1,118.2,1,118.3,0,118.2,1,117.9,1,117.8,0,118.6,0,118.9,0,120.8,1,121.8,1,121.3,0,121.9,1,122,1,121.9,0,122,1,122.2,0,123,1,123.1,0,124.9,1,125.4,0,124.7,0,124.4,1,124,0,125,1,125.1,0,125.4,0,125.7,1,126.4,1,125.7,1,125.4,0,126.4,1,126.2,0),dim=c(2,60),dimnames=list(c('CPItot','CPIlandbouw'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('CPItot','CPIlandbouw'),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
CPItot CPIlandbouw
1 114.0 1
2 113.8 1
3 113.6 1
4 113.7 1
5 114.2 1
6 114.8 0
7 115.2 1
8 115.3 1
9 114.9 1
10 115.1 0
11 116.0 0
12 116.0 0
13 116.0 0
14 115.9 1
15 115.6 1
16 116.6 1
17 116.9 0
18 117.9 1
19 117.9 1
20 117.7 0
21 117.4 1
22 117.3 0
23 119.0 1
24 119.1 0
25 119.0 0
26 118.5 0
27 117.0 1
28 117.5 1
29 118.2 1
30 118.2 1
31 118.3 0
32 118.2 1
33 117.9 1
34 117.8 0
35 118.6 0
36 118.9 0
37 120.8 1
38 121.8 1
39 121.3 0
40 121.9 1
41 122.0 1
42 121.9 0
43 122.0 1
44 122.2 0
45 123.0 1
46 123.1 0
47 124.9 1
48 125.4 0
49 124.7 0
50 124.4 1
51 124.0 0
52 125.0 1
53 125.1 0
54 125.4 0
55 125.7 1
56 126.4 1
57 125.7 1
58 125.4 0
59 126.4 1
60 126.2 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) CPIlandbouw
120.181 -1.004
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.576 -3.278 -1.229 3.144 7.224
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 120.1808 0.7791 154.25 <2e-16 ***
CPIlandbouw -1.0043 1.0350 -0.97 0.336
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.973 on 58 degrees of freedom
Multiple R-squared: 0.01597, Adjusted R-squared: -0.0009913
F-statistic: 0.9416 on 1 and 58 DF, p-value: 0.3359
> 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,] 5.638389e-04 1.127678e-03 9.994362e-01
[2,] 3.629038e-05 7.258075e-05 9.999637e-01
[3,] 3.120080e-04 6.240160e-04 9.996880e-01
[4,] 2.395485e-04 4.790971e-04 9.997605e-01
[5,] 7.057318e-05 1.411464e-04 9.999294e-01
[6,] 1.524204e-05 3.048407e-05 9.999848e-01
[7,] 6.934216e-06 1.386843e-05 9.999931e-01
[8,] 2.236350e-06 4.472701e-06 9.999978e-01
[9,] 6.545878e-07 1.309176e-06 9.999993e-01
[10,] 1.297563e-06 2.595126e-06 9.999987e-01
[11,] 9.205680e-07 1.841136e-06 9.999991e-01
[12,] 2.956056e-06 5.912111e-06 9.999970e-01
[13,] 2.297816e-06 4.595633e-06 9.999977e-01
[14,] 2.866862e-05 5.733724e-05 9.999713e-01
[15,] 9.538828e-05 1.907766e-04 9.999046e-01
[16,] 9.665460e-05 1.933092e-04 9.999033e-01
[17,] 1.311689e-04 2.623377e-04 9.998688e-01
[18,] 1.056555e-04 2.113110e-04 9.998943e-01
[19,] 4.281539e-04 8.563078e-04 9.995718e-01
[20,] 6.674198e-04 1.334840e-03 9.993326e-01
[21,] 7.971028e-04 1.594206e-03 9.992029e-01
[22,] 7.687569e-04 1.537514e-03 9.992312e-01
[23,] 8.926936e-04 1.785387e-03 9.991073e-01
[24,] 1.208962e-03 2.417925e-03 9.987910e-01
[25,] 1.972498e-03 3.944996e-03 9.980275e-01
[26,] 3.395177e-03 6.790354e-03 9.966048e-01
[27,] 4.255799e-03 8.511598e-03 9.957442e-01
[28,] 8.851484e-03 1.770297e-02 9.911485e-01
[29,] 2.391335e-02 4.782669e-02 9.760867e-01
[30,] 5.126153e-02 1.025231e-01 9.487385e-01
[31,] 1.119282e-01 2.238563e-01 8.880718e-01
[32,] 2.726041e-01 5.452082e-01 7.273959e-01
[33,] 5.199437e-01 9.601127e-01 4.800563e-01
[34,] 7.296700e-01 5.406600e-01 2.703300e-01
[35,] 8.436049e-01 3.127901e-01 1.563951e-01
[36,] 9.269747e-01 1.460506e-01 7.302528e-02
[37,] 9.705894e-01 5.882129e-02 2.941064e-02
[38,] 9.867749e-01 2.645023e-02 1.322511e-02
[39,] 9.974660e-01 5.067966e-03 2.533983e-03
[40,] 9.994440e-01 1.112063e-03 5.560313e-04
[41,] 9.999298e-01 1.404611e-04 7.023053e-05
[42,] 9.999885e-01 2.308038e-05 1.154019e-05
[43,] 9.999857e-01 2.869902e-05 1.434951e-05
[44,] 9.999684e-01 6.321245e-05 3.160622e-05
[45,] 9.999215e-01 1.570367e-04 7.851837e-05
[46,] 9.999428e-01 1.143994e-04 5.719968e-05
[47,] 9.999739e-01 5.224083e-05 2.612042e-05
[48,] 9.999759e-01 4.817955e-05 2.408978e-05
[49,] 9.999054e-01 1.892420e-04 9.462099e-05
[50,] 9.994370e-01 1.125986e-03 5.629930e-04
[51,] 9.970325e-01 5.935099e-03 2.967550e-03
> postscript(file="/var/www/html/rcomp/tmp/1m9vu1258800613.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/2efld1258800613.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/3uhgx1258800613.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/4gzn61258800613.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/5a03z1258800613.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
-5.1764706 -5.3764706 -5.5764706 -5.4764706 -4.9764706 -5.3807692 -3.9764706
8 9 10 11 12 13 14
-3.8764706 -4.2764706 -5.0807692 -4.1807692 -4.1807692 -4.1807692 -3.2764706
15 16 17 18 19 20 21
-3.5764706 -2.5764706 -3.2807692 -1.2764706 -1.2764706 -2.4807692 -1.7764706
22 23 24 25 26 27 28
-2.8807692 -0.1764706 -1.0807692 -1.1807692 -1.6807692 -2.1764706 -1.6764706
29 30 31 32 33 34 35
-0.9764706 -0.9764706 -1.8807692 -0.9764706 -1.2764706 -2.3807692 -1.5807692
36 37 38 39 40 41 42
-1.2807692 1.6235294 2.6235294 1.1192308 2.7235294 2.8235294 1.7192308
43 44 45 46 47 48 49
2.8235294 2.0192308 3.8235294 2.9192308 5.7235294 5.2192308 4.5192308
50 51 52 53 54 55 56
5.2235294 3.8192308 5.8235294 4.9192308 5.2192308 6.5235294 7.2235294
57 58 59 60
6.5235294 5.2192308 7.2235294 6.0192308
> postscript(file="/var/www/html/rcomp/tmp/6xwoi1258800613.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 -5.1764706 NA
1 -5.3764706 -5.1764706
2 -5.5764706 -5.3764706
3 -5.4764706 -5.5764706
4 -4.9764706 -5.4764706
5 -5.3807692 -4.9764706
6 -3.9764706 -5.3807692
7 -3.8764706 -3.9764706
8 -4.2764706 -3.8764706
9 -5.0807692 -4.2764706
10 -4.1807692 -5.0807692
11 -4.1807692 -4.1807692
12 -4.1807692 -4.1807692
13 -3.2764706 -4.1807692
14 -3.5764706 -3.2764706
15 -2.5764706 -3.5764706
16 -3.2807692 -2.5764706
17 -1.2764706 -3.2807692
18 -1.2764706 -1.2764706
19 -2.4807692 -1.2764706
20 -1.7764706 -2.4807692
21 -2.8807692 -1.7764706
22 -0.1764706 -2.8807692
23 -1.0807692 -0.1764706
24 -1.1807692 -1.0807692
25 -1.6807692 -1.1807692
26 -2.1764706 -1.6807692
27 -1.6764706 -2.1764706
28 -0.9764706 -1.6764706
29 -0.9764706 -0.9764706
30 -1.8807692 -0.9764706
31 -0.9764706 -1.8807692
32 -1.2764706 -0.9764706
33 -2.3807692 -1.2764706
34 -1.5807692 -2.3807692
35 -1.2807692 -1.5807692
36 1.6235294 -1.2807692
37 2.6235294 1.6235294
38 1.1192308 2.6235294
39 2.7235294 1.1192308
40 2.8235294 2.7235294
41 1.7192308 2.8235294
42 2.8235294 1.7192308
43 2.0192308 2.8235294
44 3.8235294 2.0192308
45 2.9192308 3.8235294
46 5.7235294 2.9192308
47 5.2192308 5.7235294
48 4.5192308 5.2192308
49 5.2235294 4.5192308
50 3.8192308 5.2235294
51 5.8235294 3.8192308
52 4.9192308 5.8235294
53 5.2192308 4.9192308
54 6.5235294 5.2192308
55 7.2235294 6.5235294
56 6.5235294 7.2235294
57 5.2192308 6.5235294
58 7.2235294 5.2192308
59 6.0192308 7.2235294
60 NA 6.0192308
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -5.3764706 -5.1764706
[2,] -5.5764706 -5.3764706
[3,] -5.4764706 -5.5764706
[4,] -4.9764706 -5.4764706
[5,] -5.3807692 -4.9764706
[6,] -3.9764706 -5.3807692
[7,] -3.8764706 -3.9764706
[8,] -4.2764706 -3.8764706
[9,] -5.0807692 -4.2764706
[10,] -4.1807692 -5.0807692
[11,] -4.1807692 -4.1807692
[12,] -4.1807692 -4.1807692
[13,] -3.2764706 -4.1807692
[14,] -3.5764706 -3.2764706
[15,] -2.5764706 -3.5764706
[16,] -3.2807692 -2.5764706
[17,] -1.2764706 -3.2807692
[18,] -1.2764706 -1.2764706
[19,] -2.4807692 -1.2764706
[20,] -1.7764706 -2.4807692
[21,] -2.8807692 -1.7764706
[22,] -0.1764706 -2.8807692
[23,] -1.0807692 -0.1764706
[24,] -1.1807692 -1.0807692
[25,] -1.6807692 -1.1807692
[26,] -2.1764706 -1.6807692
[27,] -1.6764706 -2.1764706
[28,] -0.9764706 -1.6764706
[29,] -0.9764706 -0.9764706
[30,] -1.8807692 -0.9764706
[31,] -0.9764706 -1.8807692
[32,] -1.2764706 -0.9764706
[33,] -2.3807692 -1.2764706
[34,] -1.5807692 -2.3807692
[35,] -1.2807692 -1.5807692
[36,] 1.6235294 -1.2807692
[37,] 2.6235294 1.6235294
[38,] 1.1192308 2.6235294
[39,] 2.7235294 1.1192308
[40,] 2.8235294 2.7235294
[41,] 1.7192308 2.8235294
[42,] 2.8235294 1.7192308
[43,] 2.0192308 2.8235294
[44,] 3.8235294 2.0192308
[45,] 2.9192308 3.8235294
[46,] 5.7235294 2.9192308
[47,] 5.2192308 5.7235294
[48,] 4.5192308 5.2192308
[49,] 5.2235294 4.5192308
[50,] 3.8192308 5.2235294
[51,] 5.8235294 3.8192308
[52,] 4.9192308 5.8235294
[53,] 5.2192308 4.9192308
[54,] 6.5235294 5.2192308
[55,] 7.2235294 6.5235294
[56,] 6.5235294 7.2235294
[57,] 5.2192308 6.5235294
[58,] 7.2235294 5.2192308
[59,] 6.0192308 7.2235294
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -5.3764706 -5.1764706
2 -5.5764706 -5.3764706
3 -5.4764706 -5.5764706
4 -4.9764706 -5.4764706
5 -5.3807692 -4.9764706
6 -3.9764706 -5.3807692
7 -3.8764706 -3.9764706
8 -4.2764706 -3.8764706
9 -5.0807692 -4.2764706
10 -4.1807692 -5.0807692
11 -4.1807692 -4.1807692
12 -4.1807692 -4.1807692
13 -3.2764706 -4.1807692
14 -3.5764706 -3.2764706
15 -2.5764706 -3.5764706
16 -3.2807692 -2.5764706
17 -1.2764706 -3.2807692
18 -1.2764706 -1.2764706
19 -2.4807692 -1.2764706
20 -1.7764706 -2.4807692
21 -2.8807692 -1.7764706
22 -0.1764706 -2.8807692
23 -1.0807692 -0.1764706
24 -1.1807692 -1.0807692
25 -1.6807692 -1.1807692
26 -2.1764706 -1.6807692
27 -1.6764706 -2.1764706
28 -0.9764706 -1.6764706
29 -0.9764706 -0.9764706
30 -1.8807692 -0.9764706
31 -0.9764706 -1.8807692
32 -1.2764706 -0.9764706
33 -2.3807692 -1.2764706
34 -1.5807692 -2.3807692
35 -1.2807692 -1.5807692
36 1.6235294 -1.2807692
37 2.6235294 1.6235294
38 1.1192308 2.6235294
39 2.7235294 1.1192308
40 2.8235294 2.7235294
41 1.7192308 2.8235294
42 2.8235294 1.7192308
43 2.0192308 2.8235294
44 3.8235294 2.0192308
45 2.9192308 3.8235294
46 5.7235294 2.9192308
47 5.2192308 5.7235294
48 4.5192308 5.2192308
49 5.2235294 4.5192308
50 3.8192308 5.2235294
51 5.8235294 3.8192308
52 4.9192308 5.8235294
53 5.2192308 4.9192308
54 6.5235294 5.2192308
55 7.2235294 6.5235294
56 6.5235294 7.2235294
57 5.2192308 6.5235294
58 7.2235294 5.2192308
59 6.0192308 7.2235294
> 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/7jn101258800613.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/830kj1258800613.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/9ehrd1258800613.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/10uias1258800613.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/118pvw1258800613.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/12gip61258800613.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/134rgf1258800613.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/144t8o1258800613.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/15xz2b1258800613.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/16ux551258800613.tab")
+ }
>
> system("convert tmp/1m9vu1258800613.ps tmp/1m9vu1258800613.png")
> system("convert tmp/2efld1258800613.ps tmp/2efld1258800613.png")
> system("convert tmp/3uhgx1258800613.ps tmp/3uhgx1258800613.png")
> system("convert tmp/4gzn61258800613.ps tmp/4gzn61258800613.png")
> system("convert tmp/5a03z1258800613.ps tmp/5a03z1258800613.png")
> system("convert tmp/6xwoi1258800613.ps tmp/6xwoi1258800613.png")
> system("convert tmp/7jn101258800613.ps tmp/7jn101258800613.png")
> system("convert tmp/830kj1258800613.ps tmp/830kj1258800613.png")
> system("convert tmp/9ehrd1258800613.ps tmp/9ehrd1258800613.png")
> system("convert tmp/10uias1258800613.ps tmp/10uias1258800613.png")
>
>
> proc.time()
user system elapsed
2.387 1.504 3.050