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,106.3,113.8,107.2,113.6,107.8,113.7,109.2,114.2,109.7,114.8,108.7,115.2,109.3,115.3,110.4,114.9,111.1,115.1,110.1,116,109.5,116,109,116,108.5,115.9,108.8,115.6,109.8,116.6,110.7,116.9,110.6,117.9,111.2,117.9,112,117.7,111.1,117.4,111.6,117.3,110.2,119,111.5,119.1,110.6,119,110.6,118.5,110.3,117,111.7,117.5,113.8,118.2,113.9,118.2,114.3,118.3,113.8,118.2,114.3,117.9,116.4,117.8,115.6,118.6,115.2,118.9,113.6,120.8,115.5,121.8,115.6,121.3,115.3,121.9,117.3,122,118.7,121.9,118.3,122,120.6,122.2,119.3,123,121.8,123.1,120.8,124.9,121.6,125.4,121.6,124.7,121.1,124.4,122.4,124,121.9,125,125.1,125.1,124.5,125.4,123.5,125.7,124.9,126.4,125.2,125.7,125.7,125.4,124.5,126.4,124.7,126.2,122.9),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 106.3
2 113.8 107.2
3 113.6 107.8
4 113.7 109.2
5 114.2 109.7
6 114.8 108.7
7 115.2 109.3
8 115.3 110.4
9 114.9 111.1
10 115.1 110.1
11 116.0 109.5
12 116.0 109.0
13 116.0 108.5
14 115.9 108.8
15 115.6 109.8
16 116.6 110.7
17 116.9 110.6
18 117.9 111.2
19 117.9 112.0
20 117.7 111.1
21 117.4 111.6
22 117.3 110.2
23 119.0 111.5
24 119.1 110.6
25 119.0 110.6
26 118.5 110.3
27 117.0 111.7
28 117.5 113.8
29 118.2 113.9
30 118.2 114.3
31 118.3 113.8
32 118.2 114.3
33 117.9 116.4
34 117.8 115.6
35 118.6 115.2
36 118.9 113.6
37 120.8 115.5
38 121.8 115.6
39 121.3 115.3
40 121.9 117.3
41 122.0 118.7
42 121.9 118.3
43 122.0 120.6
44 122.2 119.3
45 123.0 121.8
46 123.1 120.8
47 124.9 121.6
48 125.4 121.6
49 124.7 121.1
50 124.4 122.4
51 124.0 121.9
52 125.0 125.1
53 125.1 124.5
54 125.4 123.5
55 125.7 124.9
56 126.4 125.2
57 125.7 125.7
58 125.4 124.5
59 126.4 124.7
60 126.2 122.9
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) CPIlandbouw
43.8313 0.6579
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.509908 -0.828309 0.007215 0.779546 2.505863
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 43.83133 2.97045 14.76 <2e-16 ***
CPIlandbouw 0.65789 0.02576 25.54 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.144 on 58 degrees of freedom
Multiple R-squared: 0.9184, Adjusted R-squared: 0.917
F-statistic: 652.4 on 1 and 58 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.01953626 0.03907253 0.980463736
[2,] 0.05173656 0.10347312 0.948263438
[3,] 0.07809539 0.15619078 0.921904610
[4,] 0.05432493 0.10864987 0.945675066
[5,] 0.03279261 0.06558523 0.967207385
[6,] 0.02001154 0.04002309 0.979988456
[7,] 0.06138362 0.12276724 0.938616382
[8,] 0.11298396 0.22596792 0.887016038
[9,] 0.16868743 0.33737486 0.831312568
[10,] 0.17474668 0.34949336 0.825253318
[11,] 0.13687535 0.27375070 0.863124648
[12,] 0.13969349 0.27938698 0.860306510
[13,] 0.15264219 0.30528438 0.847357811
[14,] 0.22250634 0.44501268 0.777493661
[15,] 0.19993017 0.39986034 0.800069830
[16,] 0.19326634 0.38653269 0.806733657
[17,] 0.14809791 0.29619581 0.851902093
[18,] 0.14824785 0.29649571 0.851752146
[19,] 0.22531897 0.45063794 0.774681031
[20,] 0.46287847 0.92575693 0.537121533
[21,] 0.67316908 0.65366183 0.326830916
[22,] 0.81145881 0.37708238 0.188541192
[23,] 0.77021640 0.45956720 0.229783601
[24,] 0.80174515 0.39650970 0.198254849
[25,] 0.76352131 0.47295738 0.236478689
[26,] 0.73461120 0.53077759 0.265388796
[27,] 0.67613241 0.64773517 0.323867587
[28,] 0.64196365 0.71607270 0.358036352
[29,] 0.85864447 0.28271105 0.141355526
[30,] 0.96132278 0.07735443 0.038677215
[31,] 0.98151982 0.03696036 0.018480180
[32,] 0.98121266 0.03757468 0.018787342
[33,] 0.97781360 0.04437281 0.022186404
[34,] 0.98456819 0.03086363 0.015431815
[35,] 0.98486446 0.03027107 0.015135536
[36,] 0.97811501 0.04376998 0.021884989
[37,] 0.96488780 0.07022439 0.035112195
[38,] 0.94494911 0.11010178 0.055050892
[39,] 0.96838396 0.06323209 0.031616043
[40,] 0.96666462 0.06667075 0.033335375
[41,] 0.98533401 0.02933197 0.014665986
[42,] 0.99335840 0.01328320 0.006641601
[43,] 0.98764045 0.02471910 0.012359550
[44,] 0.98544762 0.02910475 0.014552375
[45,] 0.97383128 0.05233744 0.026168720
[46,] 0.95624744 0.08750511 0.043752556
[47,] 0.97810989 0.04378022 0.021890109
[48,] 0.97599285 0.04801431 0.024007153
[49,] 0.97447385 0.05105231 0.025526153
[50,] 0.96046927 0.07906146 0.039530732
[51,] 0.90203848 0.19592304 0.097961518
> postscript(file="/var/www/html/rcomp/tmp/1b4ki1258731548.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/2u2k51258731548.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/3uyzs1258731548.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/4qowa1258731548.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/54ifv1258731548.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
0.23479628 -0.55730612 -1.15204105 -1.97308923 -1.80203500 -0.54414345
7 8 9 10 11 12
-0.53887838 -1.16255909 -2.02308318 -1.16519162 0.12954331 0.45848909
13 14 15 16 17 18
0.78743486 0.49006740 -0.46782416 -0.05992656 0.30586260 0.91112767
19 20 21 22 23 24
0.38481442 0.77691682 0.14797104 0.96901922 1.81376020 2.50586260
25 26 27 28 29 30
2.40586260 2.10323006 -0.31781811 -1.19939038 -0.56517953 -0.82833615
31 32 33 34 35 36
-0.39939038 -0.82833615 -2.50990842 -2.08359518 -1.02043855 0.33218793
37 38 39 40 41 42
0.98219398 1.91640482 1.61377229 0.89798918 0.07694100 0.24009763
43 44 45 46 47 48
-1.17305295 -0.11779393 -0.96252282 -0.20463126 1.06905550 1.56905550
49 50 51 52 53 54
1.19800127 0.04274225 -0.02831197 -1.13356495 -0.63883001 0.31906154
55 56 57 58 59 60
-0.30198664 0.20064590 -0.82829988 -0.33883001 0.52959168 1.51379647
> postscript(file="/var/www/html/rcomp/tmp/6m7pt1258731548.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 0.23479628 NA
1 -0.55730612 0.23479628
2 -1.15204105 -0.55730612
3 -1.97308923 -1.15204105
4 -1.80203500 -1.97308923
5 -0.54414345 -1.80203500
6 -0.53887838 -0.54414345
7 -1.16255909 -0.53887838
8 -2.02308318 -1.16255909
9 -1.16519162 -2.02308318
10 0.12954331 -1.16519162
11 0.45848909 0.12954331
12 0.78743486 0.45848909
13 0.49006740 0.78743486
14 -0.46782416 0.49006740
15 -0.05992656 -0.46782416
16 0.30586260 -0.05992656
17 0.91112767 0.30586260
18 0.38481442 0.91112767
19 0.77691682 0.38481442
20 0.14797104 0.77691682
21 0.96901922 0.14797104
22 1.81376020 0.96901922
23 2.50586260 1.81376020
24 2.40586260 2.50586260
25 2.10323006 2.40586260
26 -0.31781811 2.10323006
27 -1.19939038 -0.31781811
28 -0.56517953 -1.19939038
29 -0.82833615 -0.56517953
30 -0.39939038 -0.82833615
31 -0.82833615 -0.39939038
32 -2.50990842 -0.82833615
33 -2.08359518 -2.50990842
34 -1.02043855 -2.08359518
35 0.33218793 -1.02043855
36 0.98219398 0.33218793
37 1.91640482 0.98219398
38 1.61377229 1.91640482
39 0.89798918 1.61377229
40 0.07694100 0.89798918
41 0.24009763 0.07694100
42 -1.17305295 0.24009763
43 -0.11779393 -1.17305295
44 -0.96252282 -0.11779393
45 -0.20463126 -0.96252282
46 1.06905550 -0.20463126
47 1.56905550 1.06905550
48 1.19800127 1.56905550
49 0.04274225 1.19800127
50 -0.02831197 0.04274225
51 -1.13356495 -0.02831197
52 -0.63883001 -1.13356495
53 0.31906154 -0.63883001
54 -0.30198664 0.31906154
55 0.20064590 -0.30198664
56 -0.82829988 0.20064590
57 -0.33883001 -0.82829988
58 0.52959168 -0.33883001
59 1.51379647 0.52959168
60 NA 1.51379647
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.55730612 0.23479628
[2,] -1.15204105 -0.55730612
[3,] -1.97308923 -1.15204105
[4,] -1.80203500 -1.97308923
[5,] -0.54414345 -1.80203500
[6,] -0.53887838 -0.54414345
[7,] -1.16255909 -0.53887838
[8,] -2.02308318 -1.16255909
[9,] -1.16519162 -2.02308318
[10,] 0.12954331 -1.16519162
[11,] 0.45848909 0.12954331
[12,] 0.78743486 0.45848909
[13,] 0.49006740 0.78743486
[14,] -0.46782416 0.49006740
[15,] -0.05992656 -0.46782416
[16,] 0.30586260 -0.05992656
[17,] 0.91112767 0.30586260
[18,] 0.38481442 0.91112767
[19,] 0.77691682 0.38481442
[20,] 0.14797104 0.77691682
[21,] 0.96901922 0.14797104
[22,] 1.81376020 0.96901922
[23,] 2.50586260 1.81376020
[24,] 2.40586260 2.50586260
[25,] 2.10323006 2.40586260
[26,] -0.31781811 2.10323006
[27,] -1.19939038 -0.31781811
[28,] -0.56517953 -1.19939038
[29,] -0.82833615 -0.56517953
[30,] -0.39939038 -0.82833615
[31,] -0.82833615 -0.39939038
[32,] -2.50990842 -0.82833615
[33,] -2.08359518 -2.50990842
[34,] -1.02043855 -2.08359518
[35,] 0.33218793 -1.02043855
[36,] 0.98219398 0.33218793
[37,] 1.91640482 0.98219398
[38,] 1.61377229 1.91640482
[39,] 0.89798918 1.61377229
[40,] 0.07694100 0.89798918
[41,] 0.24009763 0.07694100
[42,] -1.17305295 0.24009763
[43,] -0.11779393 -1.17305295
[44,] -0.96252282 -0.11779393
[45,] -0.20463126 -0.96252282
[46,] 1.06905550 -0.20463126
[47,] 1.56905550 1.06905550
[48,] 1.19800127 1.56905550
[49,] 0.04274225 1.19800127
[50,] -0.02831197 0.04274225
[51,] -1.13356495 -0.02831197
[52,] -0.63883001 -1.13356495
[53,] 0.31906154 -0.63883001
[54,] -0.30198664 0.31906154
[55,] 0.20064590 -0.30198664
[56,] -0.82829988 0.20064590
[57,] -0.33883001 -0.82829988
[58,] 0.52959168 -0.33883001
[59,] 1.51379647 0.52959168
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.55730612 0.23479628
2 -1.15204105 -0.55730612
3 -1.97308923 -1.15204105
4 -1.80203500 -1.97308923
5 -0.54414345 -1.80203500
6 -0.53887838 -0.54414345
7 -1.16255909 -0.53887838
8 -2.02308318 -1.16255909
9 -1.16519162 -2.02308318
10 0.12954331 -1.16519162
11 0.45848909 0.12954331
12 0.78743486 0.45848909
13 0.49006740 0.78743486
14 -0.46782416 0.49006740
15 -0.05992656 -0.46782416
16 0.30586260 -0.05992656
17 0.91112767 0.30586260
18 0.38481442 0.91112767
19 0.77691682 0.38481442
20 0.14797104 0.77691682
21 0.96901922 0.14797104
22 1.81376020 0.96901922
23 2.50586260 1.81376020
24 2.40586260 2.50586260
25 2.10323006 2.40586260
26 -0.31781811 2.10323006
27 -1.19939038 -0.31781811
28 -0.56517953 -1.19939038
29 -0.82833615 -0.56517953
30 -0.39939038 -0.82833615
31 -0.82833615 -0.39939038
32 -2.50990842 -0.82833615
33 -2.08359518 -2.50990842
34 -1.02043855 -2.08359518
35 0.33218793 -1.02043855
36 0.98219398 0.33218793
37 1.91640482 0.98219398
38 1.61377229 1.91640482
39 0.89798918 1.61377229
40 0.07694100 0.89798918
41 0.24009763 0.07694100
42 -1.17305295 0.24009763
43 -0.11779393 -1.17305295
44 -0.96252282 -0.11779393
45 -0.20463126 -0.96252282
46 1.06905550 -0.20463126
47 1.56905550 1.06905550
48 1.19800127 1.56905550
49 0.04274225 1.19800127
50 -0.02831197 0.04274225
51 -1.13356495 -0.02831197
52 -0.63883001 -1.13356495
53 0.31906154 -0.63883001
54 -0.30198664 0.31906154
55 0.20064590 -0.30198664
56 -0.82829988 0.20064590
57 -0.33883001 -0.82829988
58 0.52959168 -0.33883001
59 1.51379647 0.52959168
> 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/7yik81258731548.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/8xmrw1258731548.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/9n2791258731548.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/10lr4x1258731548.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/11mpnh1258731548.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/12qd1t1258731548.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/1322wz1258731548.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/14swyu1258731548.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/15xb351258731548.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/16f6p01258731548.tab")
+ }
>
> system("convert tmp/1b4ki1258731548.ps tmp/1b4ki1258731548.png")
> system("convert tmp/2u2k51258731548.ps tmp/2u2k51258731548.png")
> system("convert tmp/3uyzs1258731548.ps tmp/3uyzs1258731548.png")
> system("convert tmp/4qowa1258731548.ps tmp/4qowa1258731548.png")
> system("convert tmp/54ifv1258731548.ps tmp/54ifv1258731548.png")
> system("convert tmp/6m7pt1258731548.ps tmp/6m7pt1258731548.png")
> system("convert tmp/7yik81258731548.ps tmp/7yik81258731548.png")
> system("convert tmp/8xmrw1258731548.ps tmp/8xmrw1258731548.png")
> system("convert tmp/9n2791258731548.ps tmp/9n2791258731548.png")
> system("convert tmp/10lr4x1258731548.ps tmp/10lr4x1258731548.png")
>
>
> proc.time()
user system elapsed
2.449 1.575 2.858