R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
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(116.24
+ ,112.42
+ ,120.58
+ ,116.03
+ ,112
+ ,120.17
+ ,115.94
+ ,111.72
+ ,120.02
+ ,114.19
+ ,111.67
+ ,120.49
+ ,115.74
+ ,111.55
+ ,120.38
+ ,115.4
+ ,111.33
+ ,120.09
+ ,115.2
+ ,111.06
+ ,119.62
+ ,114.82
+ ,110.97
+ ,118.93
+ ,114.33
+ ,110.81
+ ,119.09
+ ,111.84
+ ,110.62
+ ,118.59
+ ,113.16
+ ,110.71
+ ,117.87
+ ,112.52
+ ,110.51
+ ,117.74
+ ,112.39
+ ,110.5
+ ,117.61
+ ,112.24
+ ,110.37
+ ,117.55
+ ,112.1
+ ,110.38
+ ,117.06
+ ,109.85
+ ,110.26
+ ,117.08
+ ,111.89
+ ,110.28
+ ,117.21
+ ,111.88
+ ,110.25
+ ,117.58
+ ,111.48
+ ,110.09
+ ,117.27
+ ,110.98
+ ,110.01
+ ,117.14
+ ,110.42
+ ,109.75
+ ,116.52
+ ,107.9
+ ,109.57
+ ,116.16
+ ,109.46
+ ,109.59
+ ,114.79
+ ,109.23
+ ,109.45
+ ,114.97
+ ,109.02
+ ,109.21
+ ,114.66
+ ,109.04
+ ,109
+ ,114.3
+ ,109.49
+ ,108.83
+ ,114.48
+ ,107.23
+ ,108.62
+ ,114.96
+ ,109
+ ,108.56
+ ,115.44
+ ,109.12
+ ,108.41
+ ,116.38
+ ,109.24
+ ,108.27
+ ,116.5
+ ,108.92
+ ,108.03
+ ,116.2
+ ,109.53
+ ,107.67
+ ,116.37
+ ,107.06
+ ,107.31
+ ,116.46
+ ,109.11
+ ,107.14
+ ,115.07
+ ,109.26
+ ,107.02
+ ,115.03
+ ,109.99
+ ,106.79
+ ,115.15
+ ,110.17
+ ,106.49
+ ,114.71
+ ,110.28
+ ,106.14
+ ,114.67
+ ,109.13
+ ,105.94
+ ,115.49
+ ,110.15
+ ,105.87
+ ,114.65
+ ,109.39
+ ,105.71
+ ,114.92
+ ,108.45
+ ,105.48
+ ,114.17
+ ,108.23
+ ,105.31
+ ,112.8
+ ,107.44
+ ,105.09
+ ,112.28
+ ,104.86
+ ,104.88
+ ,112.05
+ ,106.23
+ ,104.76
+ ,111.03
+ ,105.85
+ ,104.62
+ ,110.4
+ ,104.95
+ ,104.49
+ ,109.08
+ ,104.46
+ ,104.29
+ ,107.89)
+ ,dim=c(3
+ ,50)
+ ,dimnames=list(c('prijsindex'
+ ,'gezondheid'
+ ,'tabak')
+ ,1:50))
> y <- array(NA,dim=c(3,50),dimnames=list(c('prijsindex','gezondheid','tabak'),1:50))
> 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 = '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
> 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
prijsindex gezondheid tabak t
1 116.24 112.42 120.58 1
2 116.03 112.00 120.17 2
3 115.94 111.72 120.02 3
4 114.19 111.67 120.49 4
5 115.74 111.55 120.38 5
6 115.40 111.33 120.09 6
7 115.20 111.06 119.62 7
8 114.82 110.97 118.93 8
9 114.33 110.81 119.09 9
10 111.84 110.62 118.59 10
11 113.16 110.71 117.87 11
12 112.52 110.51 117.74 12
13 112.39 110.50 117.61 13
14 112.24 110.37 117.55 14
15 112.10 110.38 117.06 15
16 109.85 110.26 117.08 16
17 111.89 110.28 117.21 17
18 111.88 110.25 117.58 18
19 111.48 110.09 117.27 19
20 110.98 110.01 117.14 20
21 110.42 109.75 116.52 21
22 107.90 109.57 116.16 22
23 109.46 109.59 114.79 23
24 109.23 109.45 114.97 24
25 109.02 109.21 114.66 25
26 109.04 109.00 114.30 26
27 109.49 108.83 114.48 27
28 107.23 108.62 114.96 28
29 109.00 108.56 115.44 29
30 109.12 108.41 116.38 30
31 109.24 108.27 116.50 31
32 108.92 108.03 116.20 32
33 109.53 107.67 116.37 33
34 107.06 107.31 116.46 34
35 109.11 107.14 115.07 35
36 109.26 107.02 115.03 36
37 109.99 106.79 115.15 37
38 110.17 106.49 114.71 38
39 110.28 106.14 114.67 39
40 109.13 105.94 115.49 40
41 110.15 105.87 114.65 41
42 109.39 105.71 114.92 42
43 108.45 105.48 114.17 43
44 108.23 105.31 112.80 44
45 107.44 105.09 112.28 45
46 104.86 104.88 112.05 46
47 106.23 104.76 111.03 47
48 105.85 104.62 110.40 48
49 104.95 104.49 109.08 49
50 104.46 104.29 107.89 50
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) gezondheid tabak t
228.7335 -1.6485 0.5989 -0.3436
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.8357 -0.1469 0.1918 0.5300 1.3696
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 228.73352 43.50757 5.257 3.69e-06 ***
gezondheid -1.64855 0.36186 -4.556 3.84e-05 ***
tabak 0.59892 0.11606 5.160 5.12e-06 ***
t -0.34360 0.06287 -5.465 1.82e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.9682 on 46 degrees of freedom
Multiple R-squared: 0.9046, Adjusted R-squared: 0.8984
F-statistic: 145.4 on 3 and 46 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,] 0.25227937 0.50455873 0.74772063
[2,] 0.25753592 0.51507183 0.74246408
[3,] 0.16525008 0.33050016 0.83474992
[4,] 0.59713709 0.80572582 0.40286291
[5,] 0.49017737 0.98035474 0.50982263
[6,] 0.37387671 0.74775341 0.62612329
[7,] 0.27141315 0.54282630 0.72858685
[8,] 0.18913333 0.37826665 0.81086667
[9,] 0.13440448 0.26880896 0.86559552
[10,] 0.24157240 0.48314480 0.75842760
[11,] 0.23623427 0.47246853 0.76376573
[12,] 0.19110068 0.38220136 0.80889932
[13,] 0.14239892 0.28479785 0.85760108
[14,] 0.09901708 0.19803416 0.90098292
[15,] 0.06526724 0.13053448 0.93473276
[16,] 0.24091755 0.48183510 0.75908245
[17,] 0.19802646 0.39605293 0.80197354
[18,] 0.14790033 0.29580066 0.85209967
[19,] 0.11038923 0.22077847 0.88961077
[20,] 0.09338472 0.18676945 0.90661528
[21,] 0.13290138 0.26580275 0.86709862
[22,] 0.13821035 0.27642070 0.86178965
[23,] 0.11763852 0.23527704 0.88236148
[24,] 0.08573861 0.17147722 0.91426139
[25,] 0.05934855 0.11869709 0.94065145
[26,] 0.03870964 0.07741928 0.96129036
[27,] 0.02764897 0.05529794 0.97235103
[28,] 0.42340153 0.84680306 0.57659847
[29,] 0.53061631 0.93876738 0.46938369
[30,] 0.66954304 0.66091391 0.33045696
[31,] 0.82332317 0.35335366 0.17667683
[32,] 0.96874432 0.06251136 0.03125568
[33,] 0.94349248 0.11301505 0.05650752
[34,] 0.91820745 0.16358510 0.08179255
[35,] 0.86648671 0.26702658 0.13351329
[36,] 0.78437270 0.43125460 0.21562730
[37,] 0.65912532 0.68174935 0.34087468
> postscript(file="/var/wessaorg/rcomp/tmp/16wn11321947824.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/wessaorg/rcomp/tmp/214551321947824.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/wessaorg/rcomp/tmp/3qxsm1321947824.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/wessaorg/rcomp/tmp/4xai91321947824.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/wessaorg/rcomp/tmp/5cufc1321947824.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 = 50
Frequency = 1
1 2 3 4 5 6
0.962022207 0.648788561 0.530632435 -1.239687937 0.521966665 0.336572070
7 8 9 10 11 12
0.316555623 0.545039887 0.039044372 -2.121120741 0.122069547 -0.426181215
13 14 15 16 17 18
-0.151208067 -0.135984905 0.377570168 -1.738634754 0.600075756 0.662618263
19 20 21 22 23 24
0.528114869 0.317689735 0.043996668 -2.213531693 0.543557926 0.318554961
25 26 27 28 29 30
0.242167816 0.475183049 0.880723677 -1.669353392 0.057851574 -0.288815609
31 32 33 34 35 36
-0.127883409 -0.320259748 -0.061953835 -2.835734371 0.110109726 0.429839969
37 38 39 40 41 42
1.052402948 1.344962512 1.245526969 -0.381697230 1.369595883 0.527719234
43 44 45 46 47 48
0.001342097 0.665207805 0.167564674 -2.277279617 -0.150608356 -0.040486601
49 50
-0.020624987 0.215978821
> postscript(file="/var/wessaorg/rcomp/tmp/65agm1321947824.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 = 50
Frequency = 1
lag(myerror, k = 1) myerror
0 0.962022207 NA
1 0.648788561 0.962022207
2 0.530632435 0.648788561
3 -1.239687937 0.530632435
4 0.521966665 -1.239687937
5 0.336572070 0.521966665
6 0.316555623 0.336572070
7 0.545039887 0.316555623
8 0.039044372 0.545039887
9 -2.121120741 0.039044372
10 0.122069547 -2.121120741
11 -0.426181215 0.122069547
12 -0.151208067 -0.426181215
13 -0.135984905 -0.151208067
14 0.377570168 -0.135984905
15 -1.738634754 0.377570168
16 0.600075756 -1.738634754
17 0.662618263 0.600075756
18 0.528114869 0.662618263
19 0.317689735 0.528114869
20 0.043996668 0.317689735
21 -2.213531693 0.043996668
22 0.543557926 -2.213531693
23 0.318554961 0.543557926
24 0.242167816 0.318554961
25 0.475183049 0.242167816
26 0.880723677 0.475183049
27 -1.669353392 0.880723677
28 0.057851574 -1.669353392
29 -0.288815609 0.057851574
30 -0.127883409 -0.288815609
31 -0.320259748 -0.127883409
32 -0.061953835 -0.320259748
33 -2.835734371 -0.061953835
34 0.110109726 -2.835734371
35 0.429839969 0.110109726
36 1.052402948 0.429839969
37 1.344962512 1.052402948
38 1.245526969 1.344962512
39 -0.381697230 1.245526969
40 1.369595883 -0.381697230
41 0.527719234 1.369595883
42 0.001342097 0.527719234
43 0.665207805 0.001342097
44 0.167564674 0.665207805
45 -2.277279617 0.167564674
46 -0.150608356 -2.277279617
47 -0.040486601 -0.150608356
48 -0.020624987 -0.040486601
49 0.215978821 -0.020624987
50 NA 0.215978821
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.648788561 0.962022207
[2,] 0.530632435 0.648788561
[3,] -1.239687937 0.530632435
[4,] 0.521966665 -1.239687937
[5,] 0.336572070 0.521966665
[6,] 0.316555623 0.336572070
[7,] 0.545039887 0.316555623
[8,] 0.039044372 0.545039887
[9,] -2.121120741 0.039044372
[10,] 0.122069547 -2.121120741
[11,] -0.426181215 0.122069547
[12,] -0.151208067 -0.426181215
[13,] -0.135984905 -0.151208067
[14,] 0.377570168 -0.135984905
[15,] -1.738634754 0.377570168
[16,] 0.600075756 -1.738634754
[17,] 0.662618263 0.600075756
[18,] 0.528114869 0.662618263
[19,] 0.317689735 0.528114869
[20,] 0.043996668 0.317689735
[21,] -2.213531693 0.043996668
[22,] 0.543557926 -2.213531693
[23,] 0.318554961 0.543557926
[24,] 0.242167816 0.318554961
[25,] 0.475183049 0.242167816
[26,] 0.880723677 0.475183049
[27,] -1.669353392 0.880723677
[28,] 0.057851574 -1.669353392
[29,] -0.288815609 0.057851574
[30,] -0.127883409 -0.288815609
[31,] -0.320259748 -0.127883409
[32,] -0.061953835 -0.320259748
[33,] -2.835734371 -0.061953835
[34,] 0.110109726 -2.835734371
[35,] 0.429839969 0.110109726
[36,] 1.052402948 0.429839969
[37,] 1.344962512 1.052402948
[38,] 1.245526969 1.344962512
[39,] -0.381697230 1.245526969
[40,] 1.369595883 -0.381697230
[41,] 0.527719234 1.369595883
[42,] 0.001342097 0.527719234
[43,] 0.665207805 0.001342097
[44,] 0.167564674 0.665207805
[45,] -2.277279617 0.167564674
[46,] -0.150608356 -2.277279617
[47,] -0.040486601 -0.150608356
[48,] -0.020624987 -0.040486601
[49,] 0.215978821 -0.020624987
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.648788561 0.962022207
2 0.530632435 0.648788561
3 -1.239687937 0.530632435
4 0.521966665 -1.239687937
5 0.336572070 0.521966665
6 0.316555623 0.336572070
7 0.545039887 0.316555623
8 0.039044372 0.545039887
9 -2.121120741 0.039044372
10 0.122069547 -2.121120741
11 -0.426181215 0.122069547
12 -0.151208067 -0.426181215
13 -0.135984905 -0.151208067
14 0.377570168 -0.135984905
15 -1.738634754 0.377570168
16 0.600075756 -1.738634754
17 0.662618263 0.600075756
18 0.528114869 0.662618263
19 0.317689735 0.528114869
20 0.043996668 0.317689735
21 -2.213531693 0.043996668
22 0.543557926 -2.213531693
23 0.318554961 0.543557926
24 0.242167816 0.318554961
25 0.475183049 0.242167816
26 0.880723677 0.475183049
27 -1.669353392 0.880723677
28 0.057851574 -1.669353392
29 -0.288815609 0.057851574
30 -0.127883409 -0.288815609
31 -0.320259748 -0.127883409
32 -0.061953835 -0.320259748
33 -2.835734371 -0.061953835
34 0.110109726 -2.835734371
35 0.429839969 0.110109726
36 1.052402948 0.429839969
37 1.344962512 1.052402948
38 1.245526969 1.344962512
39 -0.381697230 1.245526969
40 1.369595883 -0.381697230
41 0.527719234 1.369595883
42 0.001342097 0.527719234
43 0.665207805 0.001342097
44 0.167564674 0.665207805
45 -2.277279617 0.167564674
46 -0.150608356 -2.277279617
47 -0.040486601 -0.150608356
48 -0.020624987 -0.040486601
49 0.215978821 -0.020624987
> 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/wessaorg/rcomp/tmp/7gtd11321947824.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/wessaorg/rcomp/tmp/8od5v1321947824.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/wessaorg/rcomp/tmp/9atxc1321947824.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/wessaorg/rcomp/tmp/10y2ho1321947824.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11z9bx1321947824.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/wessaorg/rcomp/tmp/12kt7w1321947824.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/wessaorg/rcomp/tmp/13om8u1321947824.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/wessaorg/rcomp/tmp/14wogd1321947824.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/wessaorg/rcomp/tmp/15ite61321947824.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/wessaorg/rcomp/tmp/167k2h1321947824.tab")
+ }
>
> try(system("convert tmp/16wn11321947824.ps tmp/16wn11321947824.png",intern=TRUE))
character(0)
> try(system("convert tmp/214551321947824.ps tmp/214551321947824.png",intern=TRUE))
character(0)
> try(system("convert tmp/3qxsm1321947824.ps tmp/3qxsm1321947824.png",intern=TRUE))
character(0)
> try(system("convert tmp/4xai91321947824.ps tmp/4xai91321947824.png",intern=TRUE))
character(0)
> try(system("convert tmp/5cufc1321947824.ps tmp/5cufc1321947824.png",intern=TRUE))
character(0)
> try(system("convert tmp/65agm1321947824.ps tmp/65agm1321947824.png",intern=TRUE))
character(0)
> try(system("convert tmp/7gtd11321947824.ps tmp/7gtd11321947824.png",intern=TRUE))
character(0)
> try(system("convert tmp/8od5v1321947824.ps tmp/8od5v1321947824.png",intern=TRUE))
character(0)
> try(system("convert tmp/9atxc1321947824.ps tmp/9atxc1321947824.png",intern=TRUE))
character(0)
> try(system("convert tmp/10y2ho1321947824.ps tmp/10y2ho1321947824.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.155 0.534 3.709