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.
Natural language support but running in an English locale
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(103.48,103.93,103.89,104.4,104.79,104.77,105.13,105.26,104.96,104.75,105.01,105.15,105.2,105.77,105.78,106.26,106.13,106.12,106.57,106.44,106.54,107.1,108.1,108.4,108.84,109.62,110.42,110.67,111.66,112.28,112.87,112.18,112.36,112.16,111.49,111.25,111.36,111.74,111.1,111.33,111.25,111.04,110.97,111.31,111.02,111.07,111.36,111.54,112.05,112.52,112.94,113.33,113.78,113.77,113.82,113.89,114.25,114.41),dim=c(1,58),dimnames=list(c('Consumptieindexprijs'),1:58))
> y <- array(NA,dim=c(1,58),dimnames=list(c('Consumptieindexprijs'),1:58))
> 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
Consumptieindexprijs M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 103.48 1 0 0 0 0 0 0 0 0 0 0 1
2 103.93 0 1 0 0 0 0 0 0 0 0 0 2
3 103.89 0 0 1 0 0 0 0 0 0 0 0 3
4 104.40 0 0 0 1 0 0 0 0 0 0 0 4
5 104.79 0 0 0 0 1 0 0 0 0 0 0 5
6 104.77 0 0 0 0 0 1 0 0 0 0 0 6
7 105.13 0 0 0 0 0 0 1 0 0 0 0 7
8 105.26 0 0 0 0 0 0 0 1 0 0 0 8
9 104.96 0 0 0 0 0 0 0 0 1 0 0 9
10 104.75 0 0 0 0 0 0 0 0 0 1 0 10
11 105.01 0 0 0 0 0 0 0 0 0 0 1 11
12 105.15 0 0 0 0 0 0 0 0 0 0 0 12
13 105.20 1 0 0 0 0 0 0 0 0 0 0 13
14 105.77 0 1 0 0 0 0 0 0 0 0 0 14
15 105.78 0 0 1 0 0 0 0 0 0 0 0 15
16 106.26 0 0 0 1 0 0 0 0 0 0 0 16
17 106.13 0 0 0 0 1 0 0 0 0 0 0 17
18 106.12 0 0 0 0 0 1 0 0 0 0 0 18
19 106.57 0 0 0 0 0 0 1 0 0 0 0 19
20 106.44 0 0 0 0 0 0 0 1 0 0 0 20
21 106.54 0 0 0 0 0 0 0 0 1 0 0 21
22 107.10 0 0 0 0 0 0 0 0 0 1 0 22
23 108.10 0 0 0 0 0 0 0 0 0 0 1 23
24 108.40 0 0 0 0 0 0 0 0 0 0 0 24
25 108.84 1 0 0 0 0 0 0 0 0 0 0 25
26 109.62 0 1 0 0 0 0 0 0 0 0 0 26
27 110.42 0 0 1 0 0 0 0 0 0 0 0 27
28 110.67 0 0 0 1 0 0 0 0 0 0 0 28
29 111.66 0 0 0 0 1 0 0 0 0 0 0 29
30 112.28 0 0 0 0 0 1 0 0 0 0 0 30
31 112.87 0 0 0 0 0 0 1 0 0 0 0 31
32 112.18 0 0 0 0 0 0 0 1 0 0 0 32
33 112.36 0 0 0 0 0 0 0 0 1 0 0 33
34 112.16 0 0 0 0 0 0 0 0 0 1 0 34
35 111.49 0 0 0 0 0 0 0 0 0 0 1 35
36 111.25 0 0 0 0 0 0 0 0 0 0 0 36
37 111.36 1 0 0 0 0 0 0 0 0 0 0 37
38 111.74 0 1 0 0 0 0 0 0 0 0 0 38
39 111.10 0 0 1 0 0 0 0 0 0 0 0 39
40 111.33 0 0 0 1 0 0 0 0 0 0 0 40
41 111.25 0 0 0 0 1 0 0 0 0 0 0 41
42 111.04 0 0 0 0 0 1 0 0 0 0 0 42
43 110.97 0 0 0 0 0 0 1 0 0 0 0 43
44 111.31 0 0 0 0 0 0 0 1 0 0 0 44
45 111.02 0 0 0 0 0 0 0 0 1 0 0 45
46 111.07 0 0 0 0 0 0 0 0 0 1 0 46
47 111.36 0 0 0 0 0 0 0 0 0 0 1 47
48 111.54 0 0 0 0 0 0 0 0 0 0 0 48
49 112.05 1 0 0 0 0 0 0 0 0 0 0 49
50 112.52 0 1 0 0 0 0 0 0 0 0 0 50
51 112.94 0 0 1 0 0 0 0 0 0 0 0 51
52 113.33 0 0 0 1 0 0 0 0 0 0 0 52
53 113.78 0 0 0 0 1 0 0 0 0 0 0 53
54 113.77 0 0 0 0 0 1 0 0 0 0 0 54
55 113.82 0 0 0 0 0 0 1 0 0 0 0 55
56 113.89 0 0 0 0 0 0 0 1 0 0 0 56
57 114.25 0 0 0 0 0 0 0 0 1 0 0 57
58 114.41 0 0 0 0 0 0 0 0 0 1 0 58
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
103.37341 0.05293 0.39255 0.31216 0.49377 0.62739
M6 M7 M8 M9 M10 M11
0.51100 0.59661 0.35023 0.16984 0.05145 0.09539
t
0.19039
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.1914 -0.7043 -0.3390 0.4061 2.9980
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.034e+02 6.796e-01 152.119 <2e-16 ***
M1 5.293e-02 8.244e-01 0.064 0.949
M2 3.925e-01 8.239e-01 0.476 0.636
M3 3.122e-01 8.235e-01 0.379 0.706
M4 4.938e-01 8.232e-01 0.600 0.552
M5 6.274e-01 8.230e-01 0.762 0.450
M6 5.110e-01 8.230e-01 0.621 0.538
M7 5.966e-01 8.230e-01 0.725 0.472
M8 3.502e-01 8.232e-01 0.425 0.673
M9 1.698e-01 8.235e-01 0.206 0.838
M10 5.146e-02 8.239e-01 0.062 0.950
M11 9.539e-02 8.676e-01 0.110 0.913
t 1.904e-01 9.748e-03 19.531 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.227 on 45 degrees of freedom
Multiple R-squared: 0.8971, Adjusted R-squared: 0.8697
F-statistic: 32.7 on 12 and 45 DF, p-value: < 2.2e-16
> 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,] 7.301690e-05 1.460338e-04 0.999926983
[2,] 3.740244e-04 7.480487e-04 0.999625976
[3,] 1.419882e-04 2.839764e-04 0.999858012
[4,] 3.224932e-05 6.449864e-05 0.999967751
[5,] 2.458126e-05 4.916251e-05 0.999975419
[6,] 8.112827e-06 1.622565e-05 0.999991887
[7,] 6.127925e-05 1.225585e-04 0.999938721
[8,] 1.637724e-03 3.275449e-03 0.998362276
[9,] 6.825882e-03 1.365176e-02 0.993174118
[10,] 2.557233e-02 5.114466e-02 0.974427671
[11,] 5.051238e-02 1.010248e-01 0.949487619
[12,] 1.189010e-01 2.378020e-01 0.881099019
[13,] 1.323835e-01 2.647671e-01 0.867616465
[14,] 2.051551e-01 4.103102e-01 0.794844918
[15,] 3.495462e-01 6.990924e-01 0.650453809
[16,] 5.587258e-01 8.825484e-01 0.441274192
[17,] 5.961100e-01 8.077801e-01 0.403890028
[18,] 7.027607e-01 5.944786e-01 0.297239278
[19,] 8.069888e-01 3.860224e-01 0.193011189
[20,] 8.745456e-01 2.509089e-01 0.125454448
[21,] 9.260518e-01 1.478964e-01 0.073948207
[22,] 9.631853e-01 7.362942e-02 0.036814709
[23,] 9.953125e-01 9.375007e-03 0.004687503
[24,] 9.969309e-01 6.138287e-03 0.003069143
[25,] 9.985365e-01 2.927091e-03 0.001463545
[26,] 9.966739e-01 6.652166e-03 0.003326083
[27,] 9.878963e-01 2.420734e-02 0.012103671
> postscript(file="/var/www/html/freestat/rcomp/tmp/1pssh1291750214.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/2pssh1291750214.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/301921291750214.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/401921291750214.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/501921291750214.ps",horizontal=F,onefile=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 = 58
Frequency = 1
1 2 3 4 5 6
-0.13672727 -0.21672727 -0.36672727 -0.22872727 -0.16272727 -0.25672727
7 8 9 10 11 12
-0.17272727 0.01327273 -0.29672727 -0.57872727 -0.55304545 -0.50804545
13 14 15 16 17 18
-0.70136364 -0.66136364 -0.76136364 -0.65336364 -1.10736364 -1.19136364
19 20 21 22 23 24
-1.01736364 -1.09136364 -1.00136364 -0.51336364 0.25231818 0.45731818
25 26 27 28 29 30
0.65400000 0.90400000 1.59400000 1.47200000 2.13800000 2.68400000
31 32 33 34 35 36
2.99800000 2.36400000 2.53400000 2.26200000 1.35768182 1.02268182
37 38 39 40 41 42
0.88936364 0.73936364 -0.01063636 -0.15263636 -0.55663636 -0.84063636
43 44 45 46 47 48
-1.18663636 -0.79063636 -1.09063636 -1.11263636 -1.05695455 -0.97195455
49 50 51 52 53 54
-0.70527273 -0.76527273 -0.45527273 -0.43727273 -0.31127273 -0.39527273
55 56 57 58
-0.62127273 -0.49527273 -0.14527273 -0.05727273
> postscript(file="/var/www/html/freestat/rcomp/tmp/6bs8n1291750214.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 58
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.13672727 NA
1 -0.21672727 -0.13672727
2 -0.36672727 -0.21672727
3 -0.22872727 -0.36672727
4 -0.16272727 -0.22872727
5 -0.25672727 -0.16272727
6 -0.17272727 -0.25672727
7 0.01327273 -0.17272727
8 -0.29672727 0.01327273
9 -0.57872727 -0.29672727
10 -0.55304545 -0.57872727
11 -0.50804545 -0.55304545
12 -0.70136364 -0.50804545
13 -0.66136364 -0.70136364
14 -0.76136364 -0.66136364
15 -0.65336364 -0.76136364
16 -1.10736364 -0.65336364
17 -1.19136364 -1.10736364
18 -1.01736364 -1.19136364
19 -1.09136364 -1.01736364
20 -1.00136364 -1.09136364
21 -0.51336364 -1.00136364
22 0.25231818 -0.51336364
23 0.45731818 0.25231818
24 0.65400000 0.45731818
25 0.90400000 0.65400000
26 1.59400000 0.90400000
27 1.47200000 1.59400000
28 2.13800000 1.47200000
29 2.68400000 2.13800000
30 2.99800000 2.68400000
31 2.36400000 2.99800000
32 2.53400000 2.36400000
33 2.26200000 2.53400000
34 1.35768182 2.26200000
35 1.02268182 1.35768182
36 0.88936364 1.02268182
37 0.73936364 0.88936364
38 -0.01063636 0.73936364
39 -0.15263636 -0.01063636
40 -0.55663636 -0.15263636
41 -0.84063636 -0.55663636
42 -1.18663636 -0.84063636
43 -0.79063636 -1.18663636
44 -1.09063636 -0.79063636
45 -1.11263636 -1.09063636
46 -1.05695455 -1.11263636
47 -0.97195455 -1.05695455
48 -0.70527273 -0.97195455
49 -0.76527273 -0.70527273
50 -0.45527273 -0.76527273
51 -0.43727273 -0.45527273
52 -0.31127273 -0.43727273
53 -0.39527273 -0.31127273
54 -0.62127273 -0.39527273
55 -0.49527273 -0.62127273
56 -0.14527273 -0.49527273
57 -0.05727273 -0.14527273
58 NA -0.05727273
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.21672727 -0.13672727
[2,] -0.36672727 -0.21672727
[3,] -0.22872727 -0.36672727
[4,] -0.16272727 -0.22872727
[5,] -0.25672727 -0.16272727
[6,] -0.17272727 -0.25672727
[7,] 0.01327273 -0.17272727
[8,] -0.29672727 0.01327273
[9,] -0.57872727 -0.29672727
[10,] -0.55304545 -0.57872727
[11,] -0.50804545 -0.55304545
[12,] -0.70136364 -0.50804545
[13,] -0.66136364 -0.70136364
[14,] -0.76136364 -0.66136364
[15,] -0.65336364 -0.76136364
[16,] -1.10736364 -0.65336364
[17,] -1.19136364 -1.10736364
[18,] -1.01736364 -1.19136364
[19,] -1.09136364 -1.01736364
[20,] -1.00136364 -1.09136364
[21,] -0.51336364 -1.00136364
[22,] 0.25231818 -0.51336364
[23,] 0.45731818 0.25231818
[24,] 0.65400000 0.45731818
[25,] 0.90400000 0.65400000
[26,] 1.59400000 0.90400000
[27,] 1.47200000 1.59400000
[28,] 2.13800000 1.47200000
[29,] 2.68400000 2.13800000
[30,] 2.99800000 2.68400000
[31,] 2.36400000 2.99800000
[32,] 2.53400000 2.36400000
[33,] 2.26200000 2.53400000
[34,] 1.35768182 2.26200000
[35,] 1.02268182 1.35768182
[36,] 0.88936364 1.02268182
[37,] 0.73936364 0.88936364
[38,] -0.01063636 0.73936364
[39,] -0.15263636 -0.01063636
[40,] -0.55663636 -0.15263636
[41,] -0.84063636 -0.55663636
[42,] -1.18663636 -0.84063636
[43,] -0.79063636 -1.18663636
[44,] -1.09063636 -0.79063636
[45,] -1.11263636 -1.09063636
[46,] -1.05695455 -1.11263636
[47,] -0.97195455 -1.05695455
[48,] -0.70527273 -0.97195455
[49,] -0.76527273 -0.70527273
[50,] -0.45527273 -0.76527273
[51,] -0.43727273 -0.45527273
[52,] -0.31127273 -0.43727273
[53,] -0.39527273 -0.31127273
[54,] -0.62127273 -0.39527273
[55,] -0.49527273 -0.62127273
[56,] -0.14527273 -0.49527273
[57,] -0.05727273 -0.14527273
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.21672727 -0.13672727
2 -0.36672727 -0.21672727
3 -0.22872727 -0.36672727
4 -0.16272727 -0.22872727
5 -0.25672727 -0.16272727
6 -0.17272727 -0.25672727
7 0.01327273 -0.17272727
8 -0.29672727 0.01327273
9 -0.57872727 -0.29672727
10 -0.55304545 -0.57872727
11 -0.50804545 -0.55304545
12 -0.70136364 -0.50804545
13 -0.66136364 -0.70136364
14 -0.76136364 -0.66136364
15 -0.65336364 -0.76136364
16 -1.10736364 -0.65336364
17 -1.19136364 -1.10736364
18 -1.01736364 -1.19136364
19 -1.09136364 -1.01736364
20 -1.00136364 -1.09136364
21 -0.51336364 -1.00136364
22 0.25231818 -0.51336364
23 0.45731818 0.25231818
24 0.65400000 0.45731818
25 0.90400000 0.65400000
26 1.59400000 0.90400000
27 1.47200000 1.59400000
28 2.13800000 1.47200000
29 2.68400000 2.13800000
30 2.99800000 2.68400000
31 2.36400000 2.99800000
32 2.53400000 2.36400000
33 2.26200000 2.53400000
34 1.35768182 2.26200000
35 1.02268182 1.35768182
36 0.88936364 1.02268182
37 0.73936364 0.88936364
38 -0.01063636 0.73936364
39 -0.15263636 -0.01063636
40 -0.55663636 -0.15263636
41 -0.84063636 -0.55663636
42 -1.18663636 -0.84063636
43 -0.79063636 -1.18663636
44 -1.09063636 -0.79063636
45 -1.11263636 -1.09063636
46 -1.05695455 -1.11263636
47 -0.97195455 -1.05695455
48 -0.70527273 -0.97195455
49 -0.76527273 -0.70527273
50 -0.45527273 -0.76527273
51 -0.43727273 -0.45527273
52 -0.31127273 -0.43727273
53 -0.39527273 -0.31127273
54 -0.62127273 -0.39527273
55 -0.49527273 -0.62127273
56 -0.14527273 -0.49527273
57 -0.05727273 -0.14527273
> 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/freestat/rcomp/tmp/74j8q1291750214.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/84j8q1291750214.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/94j8q1291750214.ps",horizontal=F,onefile=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/freestat/rcomp/tmp/10wtpt1291750214.ps",horizontal=F,onefile=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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11it5g1291750214.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/freestat/rcomp/tmp/12au1y1291750214.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/freestat/rcomp/tmp/139ft91291750214.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/freestat/rcomp/tmp/142ptu1291750214.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/freestat/rcomp/tmp/155pr01291750214.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/freestat/rcomp/tmp/16jzpr1291750214.tab")
+ }
>
> try(system("convert tmp/1pssh1291750214.ps tmp/1pssh1291750214.png",intern=TRUE))
character(0)
> try(system("convert tmp/2pssh1291750214.ps tmp/2pssh1291750214.png",intern=TRUE))
character(0)
> try(system("convert tmp/301921291750214.ps tmp/301921291750214.png",intern=TRUE))
character(0)
> try(system("convert tmp/401921291750214.ps tmp/401921291750214.png",intern=TRUE))
character(0)
> try(system("convert tmp/501921291750214.ps tmp/501921291750214.png",intern=TRUE))
character(0)
> try(system("convert tmp/6bs8n1291750214.ps tmp/6bs8n1291750214.png",intern=TRUE))
character(0)
> try(system("convert tmp/74j8q1291750214.ps tmp/74j8q1291750214.png",intern=TRUE))
character(0)
> try(system("convert tmp/84j8q1291750214.ps tmp/84j8q1291750214.png",intern=TRUE))
character(0)
> try(system("convert tmp/94j8q1291750214.ps tmp/94j8q1291750214.png",intern=TRUE))
character(0)
> try(system("convert tmp/10wtpt1291750214.ps tmp/10wtpt1291750214.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.732 2.429 4.141