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(109,102.86,108.6,102.55,108.8,102.28,108.5,102.26,108.3,102.57,108.2,103.08,108,102.76,107.9,102.51,108,102.87,109.3,103.14,109.6,103.12,109,103.16,108.7,102.48,108.3,102.57,108.4,102.88,107.8,102.63,107.8,102.38,107.6,101.69,107.7,101.96,107.6,102.19,107.6,101.87,108.6,101.6,108.6,101.63,108.2,101.22,107.5,101.21,107.1,101.49,107,101.64,106.9,101.66,106.6,101.77,106.3,101.82,106.1,101.78,105.9,101.28,106,101.29,107.2,101.37,107.2,101.12,106.4,101.51,106.1,102.24,105.9,102.94,106.1,103.09,105.9,103.46,105.8,103.64,105.7,104.39,105.6,104.15,105.3,105.21,105.5,105.8,106.5,105.91,106.5,105.39,106.1,105.46,105.9,104.72,105.8,103.14,106.2,102.63,106.5,102.32,106.6,101.93,106.7,100.62,106.6,100.6,106.5,99.63,106.8,98.9,107.8,98.32,107.9,99.22,107.4,98.81),dim=c(2,60),dimnames=list(c('Werk','Infl'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Werk','Infl'),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
Werk Infl
1 109.0 102.86
2 108.6 102.55
3 108.8 102.28
4 108.5 102.26
5 108.3 102.57
6 108.2 103.08
7 108.0 102.76
8 107.9 102.51
9 108.0 102.87
10 109.3 103.14
11 109.6 103.12
12 109.0 103.16
13 108.7 102.48
14 108.3 102.57
15 108.4 102.88
16 107.8 102.63
17 107.8 102.38
18 107.6 101.69
19 107.7 101.96
20 107.6 102.19
21 107.6 101.87
22 108.6 101.60
23 108.6 101.63
24 108.2 101.22
25 107.5 101.21
26 107.1 101.49
27 107.0 101.64
28 106.9 101.66
29 106.6 101.77
30 106.3 101.82
31 106.1 101.78
32 105.9 101.28
33 106.0 101.29
34 107.2 101.37
35 107.2 101.12
36 106.4 101.51
37 106.1 102.24
38 105.9 102.94
39 106.1 103.09
40 105.9 103.46
41 105.8 103.64
42 105.7 104.39
43 105.6 104.15
44 105.3 105.21
45 105.5 105.80
46 106.5 105.91
47 106.5 105.39
48 106.1 105.46
49 105.9 104.72
50 105.8 103.14
51 106.2 102.63
52 106.5 102.32
53 106.6 101.93
54 106.7 100.62
55 106.6 100.60
56 106.5 99.63
57 106.8 98.90
58 107.8 98.32
59 107.9 99.22
60 107.4 98.81
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Infl
123.8344 -0.1626
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.4678 -0.9594 -0.1967 0.8773 2.5314
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 123.8344 9.1581 13.522 <2e-16 ***
Infl -0.1626 0.0895 -1.817 0.0745 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.094 on 58 degrees of freedom
Multiple R-squared: 0.05383, Adjusted R-squared: 0.03752
F-statistic: 3.3 on 1 and 58 DF, p-value: 0.07445
> 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.02773504 0.0554700827 0.9722649586
[2,] 0.01820959 0.0364191747 0.9817904127
[3,] 0.01366296 0.0273259219 0.9863370390
[4,] 0.01283578 0.0256715585 0.9871642207
[5,] 0.00629977 0.0125995393 0.9937002304
[6,] 0.02129156 0.0425831211 0.9787084394
[7,] 0.05922455 0.1184490987 0.9407754507
[8,] 0.05564124 0.1112824742 0.9443587629
[9,] 0.05285984 0.1057196704 0.9471401648
[10,] 0.04485230 0.0897045955 0.9551477023
[11,] 0.04860721 0.0972144105 0.9513927948
[12,] 0.06690501 0.1338100107 0.9330949947
[13,] 0.06826428 0.1365285688 0.9317357156
[14,] 0.04944715 0.0988942998 0.9505528501
[15,] 0.03965282 0.0793056497 0.9603471752
[16,] 0.03853574 0.0770714703 0.9614642648
[17,] 0.03050242 0.0610048437 0.9694975782
[18,] 0.16721812 0.3344362438 0.8327818781
[19,] 0.48856700 0.9771339918 0.5114330041
[20,] 0.71835896 0.5632820852 0.2816410426
[21,] 0.75308726 0.4938254870 0.2469127435
[22,] 0.79690157 0.4061968654 0.2030984327
[23,] 0.84208030 0.3158394024 0.1579197012
[24,] 0.87407242 0.2518551647 0.1259275824
[25,] 0.91688995 0.1662200974 0.0831100487
[26,] 0.95788264 0.0842347248 0.0421173624
[27,] 0.98092905 0.0381419049 0.0190709525
[28,] 0.99068092 0.0186381519 0.0093190760
[29,] 0.99387947 0.0122410599 0.0061205300
[30,] 0.99348155 0.0130368970 0.0065184485
[31,] 0.99326711 0.0134657853 0.0067328926
[32,] 0.99096198 0.0180760340 0.0090380170
[33,] 0.99537731 0.0092453874 0.0046226937
[34,] 0.99896961 0.0020607872 0.0010303936
[35,] 0.99941298 0.0011740328 0.0005870164
[36,] 0.99967522 0.0006495575 0.0003247787
[37,] 0.99976509 0.0004698221 0.0002349110
[38,] 0.99977495 0.0004501009 0.0002250504
[39,] 0.99977870 0.0004426037 0.0002213018
[40,] 0.99982791 0.0003441838 0.0001720919
[41,] 0.99971891 0.0005621747 0.0002810874
[42,] 0.99965315 0.0006936977 0.0003468489
[43,] 0.99969298 0.0006140423 0.0003070211
[44,] 0.99956265 0.0008746951 0.0004373476
[45,] 0.99899944 0.0020011153 0.0010005576
[46,] 0.99766833 0.0046633386 0.0023316693
[47,] 0.99358133 0.0128373494 0.0064186747
[48,] 0.98426867 0.0314626525 0.0157313263
[49,] 0.96993725 0.0601255025 0.0300627512
[50,] 0.92869920 0.1426015930 0.0713007965
[51,] 0.84595079 0.3080984193 0.1540492096
> postscript(file="/var/www/html/rcomp/tmp/1m44y1259777264.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/28q5d1259777264.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/35iad1259777264.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/4mril1259777264.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/5igpg1259777264.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
1.88909680 1.43869533 1.59479727 1.29154556 1.14194704 1.12486559
7 8 9 10 11 12
0.87283826 0.73219191 0.89072266 2.23462072 2.53136901 1.93787243
13 14 15 16 17 18
1.52731435 1.14194704 1.29234851 0.65170216 0.61105581 0.29887188
19 20 21 22 23 24
0.44276994 0.38016458 0.32813725 1.28423919 1.28911675 0.82245674
25 26 27 28 29 30
0.12083088 -0.23364520 -0.30925739 -0.40600569 -0.68812129 -0.97999202
31 32 33 34 35 36
-1.18649544 -1.46778814 -1.36616229 -0.15315545 -0.19380181 -0.93039350
37 38 39 40 41 42
-1.11170615 -1.19789636 -0.97350855 -1.11335195 -1.18408658 -1.16214752
43 44 45 46 47 48
-1.30116802 -1.42882749 -1.13290210 -0.11501771 -0.19956212 -0.58818114
49 50 51 52 53 54
-0.90849434 -1.26537928 -0.94829784 -0.69869932 -0.66210763 -0.77509451
55 56 57 58 59 60
-0.87834622 -1.13605406 -0.95474141 -0.04904094 0.19728592 -0.36937410
> postscript(file="/var/www/html/rcomp/tmp/6fxrc1259777264.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 1.88909680 NA
1 1.43869533 1.88909680
2 1.59479727 1.43869533
3 1.29154556 1.59479727
4 1.14194704 1.29154556
5 1.12486559 1.14194704
6 0.87283826 1.12486559
7 0.73219191 0.87283826
8 0.89072266 0.73219191
9 2.23462072 0.89072266
10 2.53136901 2.23462072
11 1.93787243 2.53136901
12 1.52731435 1.93787243
13 1.14194704 1.52731435
14 1.29234851 1.14194704
15 0.65170216 1.29234851
16 0.61105581 0.65170216
17 0.29887188 0.61105581
18 0.44276994 0.29887188
19 0.38016458 0.44276994
20 0.32813725 0.38016458
21 1.28423919 0.32813725
22 1.28911675 1.28423919
23 0.82245674 1.28911675
24 0.12083088 0.82245674
25 -0.23364520 0.12083088
26 -0.30925739 -0.23364520
27 -0.40600569 -0.30925739
28 -0.68812129 -0.40600569
29 -0.97999202 -0.68812129
30 -1.18649544 -0.97999202
31 -1.46778814 -1.18649544
32 -1.36616229 -1.46778814
33 -0.15315545 -1.36616229
34 -0.19380181 -0.15315545
35 -0.93039350 -0.19380181
36 -1.11170615 -0.93039350
37 -1.19789636 -1.11170615
38 -0.97350855 -1.19789636
39 -1.11335195 -0.97350855
40 -1.18408658 -1.11335195
41 -1.16214752 -1.18408658
42 -1.30116802 -1.16214752
43 -1.42882749 -1.30116802
44 -1.13290210 -1.42882749
45 -0.11501771 -1.13290210
46 -0.19956212 -0.11501771
47 -0.58818114 -0.19956212
48 -0.90849434 -0.58818114
49 -1.26537928 -0.90849434
50 -0.94829784 -1.26537928
51 -0.69869932 -0.94829784
52 -0.66210763 -0.69869932
53 -0.77509451 -0.66210763
54 -0.87834622 -0.77509451
55 -1.13605406 -0.87834622
56 -0.95474141 -1.13605406
57 -0.04904094 -0.95474141
58 0.19728592 -0.04904094
59 -0.36937410 0.19728592
60 NA -0.36937410
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.43869533 1.88909680
[2,] 1.59479727 1.43869533
[3,] 1.29154556 1.59479727
[4,] 1.14194704 1.29154556
[5,] 1.12486559 1.14194704
[6,] 0.87283826 1.12486559
[7,] 0.73219191 0.87283826
[8,] 0.89072266 0.73219191
[9,] 2.23462072 0.89072266
[10,] 2.53136901 2.23462072
[11,] 1.93787243 2.53136901
[12,] 1.52731435 1.93787243
[13,] 1.14194704 1.52731435
[14,] 1.29234851 1.14194704
[15,] 0.65170216 1.29234851
[16,] 0.61105581 0.65170216
[17,] 0.29887188 0.61105581
[18,] 0.44276994 0.29887188
[19,] 0.38016458 0.44276994
[20,] 0.32813725 0.38016458
[21,] 1.28423919 0.32813725
[22,] 1.28911675 1.28423919
[23,] 0.82245674 1.28911675
[24,] 0.12083088 0.82245674
[25,] -0.23364520 0.12083088
[26,] -0.30925739 -0.23364520
[27,] -0.40600569 -0.30925739
[28,] -0.68812129 -0.40600569
[29,] -0.97999202 -0.68812129
[30,] -1.18649544 -0.97999202
[31,] -1.46778814 -1.18649544
[32,] -1.36616229 -1.46778814
[33,] -0.15315545 -1.36616229
[34,] -0.19380181 -0.15315545
[35,] -0.93039350 -0.19380181
[36,] -1.11170615 -0.93039350
[37,] -1.19789636 -1.11170615
[38,] -0.97350855 -1.19789636
[39,] -1.11335195 -0.97350855
[40,] -1.18408658 -1.11335195
[41,] -1.16214752 -1.18408658
[42,] -1.30116802 -1.16214752
[43,] -1.42882749 -1.30116802
[44,] -1.13290210 -1.42882749
[45,] -0.11501771 -1.13290210
[46,] -0.19956212 -0.11501771
[47,] -0.58818114 -0.19956212
[48,] -0.90849434 -0.58818114
[49,] -1.26537928 -0.90849434
[50,] -0.94829784 -1.26537928
[51,] -0.69869932 -0.94829784
[52,] -0.66210763 -0.69869932
[53,] -0.77509451 -0.66210763
[54,] -0.87834622 -0.77509451
[55,] -1.13605406 -0.87834622
[56,] -0.95474141 -1.13605406
[57,] -0.04904094 -0.95474141
[58,] 0.19728592 -0.04904094
[59,] -0.36937410 0.19728592
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.43869533 1.88909680
2 1.59479727 1.43869533
3 1.29154556 1.59479727
4 1.14194704 1.29154556
5 1.12486559 1.14194704
6 0.87283826 1.12486559
7 0.73219191 0.87283826
8 0.89072266 0.73219191
9 2.23462072 0.89072266
10 2.53136901 2.23462072
11 1.93787243 2.53136901
12 1.52731435 1.93787243
13 1.14194704 1.52731435
14 1.29234851 1.14194704
15 0.65170216 1.29234851
16 0.61105581 0.65170216
17 0.29887188 0.61105581
18 0.44276994 0.29887188
19 0.38016458 0.44276994
20 0.32813725 0.38016458
21 1.28423919 0.32813725
22 1.28911675 1.28423919
23 0.82245674 1.28911675
24 0.12083088 0.82245674
25 -0.23364520 0.12083088
26 -0.30925739 -0.23364520
27 -0.40600569 -0.30925739
28 -0.68812129 -0.40600569
29 -0.97999202 -0.68812129
30 -1.18649544 -0.97999202
31 -1.46778814 -1.18649544
32 -1.36616229 -1.46778814
33 -0.15315545 -1.36616229
34 -0.19380181 -0.15315545
35 -0.93039350 -0.19380181
36 -1.11170615 -0.93039350
37 -1.19789636 -1.11170615
38 -0.97350855 -1.19789636
39 -1.11335195 -0.97350855
40 -1.18408658 -1.11335195
41 -1.16214752 -1.18408658
42 -1.30116802 -1.16214752
43 -1.42882749 -1.30116802
44 -1.13290210 -1.42882749
45 -0.11501771 -1.13290210
46 -0.19956212 -0.11501771
47 -0.58818114 -0.19956212
48 -0.90849434 -0.58818114
49 -1.26537928 -0.90849434
50 -0.94829784 -1.26537928
51 -0.69869932 -0.94829784
52 -0.66210763 -0.69869932
53 -0.77509451 -0.66210763
54 -0.87834622 -0.77509451
55 -1.13605406 -0.87834622
56 -0.95474141 -1.13605406
57 -0.04904094 -0.95474141
58 0.19728592 -0.04904094
59 -0.36937410 0.19728592
> 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/7iq2i1259777264.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/8it6b1259777264.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/91ze81259777264.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/100la01259777264.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/1180bp1259777264.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/12vqo01259777264.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/13b9y61259777264.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/144tbt1259777264.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/15nwkn1259777264.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/16ibcf1259777264.tab")
+ }
>
> system("convert tmp/1m44y1259777264.ps tmp/1m44y1259777264.png")
> system("convert tmp/28q5d1259777264.ps tmp/28q5d1259777264.png")
> system("convert tmp/35iad1259777264.ps tmp/35iad1259777264.png")
> system("convert tmp/4mril1259777264.ps tmp/4mril1259777264.png")
> system("convert tmp/5igpg1259777264.ps tmp/5igpg1259777264.png")
> system("convert tmp/6fxrc1259777264.ps tmp/6fxrc1259777264.png")
> system("convert tmp/7iq2i1259777264.ps tmp/7iq2i1259777264.png")
> system("convert tmp/8it6b1259777264.ps tmp/8it6b1259777264.png")
> system("convert tmp/91ze81259777264.ps tmp/91ze81259777264.png")
> system("convert tmp/100la01259777264.ps tmp/100la01259777264.png")
>
>
> proc.time()
user system elapsed
2.457 1.560 2.855