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(8.1,1.3,7.7,1.3,7.5,1.2,7.6,1.1,7.8,1.4,7.8,1.2,7.8,1.5,7.5,1.1,7.5,1.3,7.1,1.5,7.5,1.1,7.5,1.4,7.6,1.3,7.7,1.5,7.7,1.6,7.9,1.7,8.1,1.1,8.2,1.6,8.2,1.3,8.2,1.7,7.9,1.6,7.3,1.7,6.9,1.9,6.6,1.8,6.7,1.9,6.9,1.6,7.0,1.5,7.1,1.6,7.2,1.6,7.1,1.7,6.9,2.0,7.0,2.0,6.8,1.9,6.4,1.7,6.7,1.8,6.6,1.9,6.4,1.7,6.3,2.0,6.2,2.1,6.5,2.4,6.8,2.5,6.8,2.5,6.4,2.6,6.1,2.2,5.8,2.5,6.1,2.8,7.2,2.8,7.3,2.9,6.9,3.0,6.1,3.1,5.8,2.9,6.2,2.7,7.1,2.2,7.7,2.5,7.9,2.3,7.7,2.6,7.4,2.3,7.5,2.2,8.0,1.8,8.1,1.8),dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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
Y X
1 8.1 1.3
2 7.7 1.3
3 7.5 1.2
4 7.6 1.1
5 7.8 1.4
6 7.8 1.2
7 7.8 1.5
8 7.5 1.1
9 7.5 1.3
10 7.1 1.5
11 7.5 1.1
12 7.5 1.4
13 7.6 1.3
14 7.7 1.5
15 7.7 1.6
16 7.9 1.7
17 8.1 1.1
18 8.2 1.6
19 8.2 1.3
20 8.2 1.7
21 7.9 1.6
22 7.3 1.7
23 6.9 1.9
24 6.6 1.8
25 6.7 1.9
26 6.9 1.6
27 7.0 1.5
28 7.1 1.6
29 7.2 1.6
30 7.1 1.7
31 6.9 2.0
32 7.0 2.0
33 6.8 1.9
34 6.4 1.7
35 6.7 1.8
36 6.6 1.9
37 6.4 1.7
38 6.3 2.0
39 6.2 2.1
40 6.5 2.4
41 6.8 2.5
42 6.8 2.5
43 6.4 2.6
44 6.1 2.2
45 5.8 2.5
46 6.1 2.8
47 7.2 2.8
48 7.3 2.9
49 6.9 3.0
50 6.1 3.1
51 5.8 2.9
52 6.2 2.7
53 7.1 2.2
54 7.7 2.5
55 7.9 2.3
56 7.7 2.6
57 7.4 2.3
58 7.5 2.2
59 8.0 1.8
60 8.1 1.8
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
8.4683 -0.6828
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.96140 -0.38450 -0.09175 0.48550 1.00688
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.4683 0.2588 32.718 < 2e-16 ***
X -0.6828 0.1312 -5.203 2.69e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.5496 on 58 degrees of freedom
Multiple R-squared: 0.3182, Adjusted R-squared: 0.3064
F-statistic: 27.07 on 1 and 58 DF, p-value: 2.686e-06
> 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.0721586444 0.1443172888 0.92784136
[2,] 0.0259612520 0.0519225039 0.97403875
[3,] 0.0097206973 0.0194413946 0.99027930
[4,] 0.0033821086 0.0067642172 0.99661789
[5,] 0.0020968410 0.0041936820 0.99790316
[6,] 0.0162812190 0.0325624380 0.98371878
[7,] 0.0078303079 0.0156606159 0.99216969
[8,] 0.0034603601 0.0069207202 0.99653964
[9,] 0.0013476280 0.0026952561 0.99865237
[10,] 0.0005404543 0.0010809085 0.99945955
[11,] 0.0002074384 0.0004148768 0.99979256
[12,] 0.0001181515 0.0002363029 0.99988185
[13,] 0.0002395649 0.0004791298 0.99976044
[14,] 0.0005207660 0.0010415320 0.99947923
[15,] 0.0010207408 0.0020414817 0.99897926
[16,] 0.0014461791 0.0028923582 0.99855382
[17,] 0.0009916629 0.0019833258 0.99900834
[18,] 0.0016007521 0.0032015041 0.99839925
[19,] 0.0060185391 0.0120370783 0.99398146
[20,] 0.0224167640 0.0448335280 0.97758324
[21,] 0.0275621947 0.0551243893 0.97243781
[22,] 0.0284145739 0.0568291478 0.97158543
[23,] 0.0263921869 0.0527843738 0.97360781
[24,] 0.0192126424 0.0384252849 0.98078736
[25,] 0.0127026817 0.0254053634 0.98729732
[26,] 0.0081732674 0.0163465347 0.99182673
[27,] 0.0048803131 0.0097606262 0.99511969
[28,] 0.0027435765 0.0054871530 0.99725642
[29,] 0.0017724787 0.0035449575 0.99822752
[30,] 0.0041546785 0.0083093571 0.99584532
[31,] 0.0033724344 0.0067448687 0.99662757
[32,] 0.0027937281 0.0055874563 0.99720627
[33,] 0.0067544114 0.0135088229 0.99324559
[34,] 0.0108815346 0.0217630693 0.98911847
[35,] 0.0212378999 0.0424757999 0.97876210
[36,] 0.0183514888 0.0367029776 0.98164851
[37,] 0.0159939192 0.0319878384 0.98400608
[38,] 0.0122308481 0.0244616962 0.98776915
[39,] 0.0089425132 0.0178850265 0.99105749
[40,] 0.0378139875 0.0756279751 0.96218601
[41,] 0.1651870247 0.3303740495 0.83481298
[42,] 0.1958103762 0.3916207523 0.80418962
[43,] 0.2601512998 0.5203025996 0.73984870
[44,] 0.4067820299 0.8135640598 0.59321797
[45,] 0.4472878320 0.8945756640 0.55271217
[46,] 0.3438308777 0.6876617554 0.65616912
[47,] 0.4615556334 0.9231112668 0.53844437
[48,] 0.8431165846 0.3137668307 0.15688342
[49,] 0.9553846439 0.0892307123 0.04461536
[50,] 0.9167344537 0.1665310926 0.08326555
[51,] 0.8776236176 0.2447527647 0.12237638
> postscript(file="/var/www/html/rcomp/tmp/1e7211259250830.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/2vw571259250830.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/3s2lm1259250830.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/4ju5n1259250830.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/5e57r1259250830.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.519280474 0.119280474 -0.148996541 -0.117273557 0.287557490 0.151003459
7 8 9 10 11 12
0.355834505 -0.217273557 -0.080719526 -0.344165495 -0.217273557 -0.012442510
13 14 15 16 17 18
0.019280474 0.255834505 0.324111521 0.592388536 0.382726443 0.824111521
19 20 21 22 23 24
0.619280474 0.892388536 0.524111521 -0.007611464 -0.271057433 -0.639334448
25 26 27 28 29 30
-0.471057433 -0.475888479 -0.444165495 -0.275888479 -0.175888479 -0.207611464
31 32 33 34 35 36
-0.202780417 -0.102780417 -0.371057433 -0.907611464 -0.539334448 -0.571057433
37 38 39 40 41 42
-0.907611464 -0.802780417 -0.834503402 -0.329672355 0.038604660 0.038604660
43 44 45 46 47 48
-0.293118325 -0.866226386 -0.961395340 -0.456564294 0.643435706 0.811712722
49 50 51 52 53 54
0.479989737 -0.251733247 -0.688287278 -0.424841309 0.133773614 0.938604660
55 56 57 58 59 60
1.002050629 1.006881675 0.502050629 0.533773614 0.760665552 0.860665552
> postscript(file="/var/www/html/rcomp/tmp/6rqpr1259250830.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.519280474 NA
1 0.119280474 0.519280474
2 -0.148996541 0.119280474
3 -0.117273557 -0.148996541
4 0.287557490 -0.117273557
5 0.151003459 0.287557490
6 0.355834505 0.151003459
7 -0.217273557 0.355834505
8 -0.080719526 -0.217273557
9 -0.344165495 -0.080719526
10 -0.217273557 -0.344165495
11 -0.012442510 -0.217273557
12 0.019280474 -0.012442510
13 0.255834505 0.019280474
14 0.324111521 0.255834505
15 0.592388536 0.324111521
16 0.382726443 0.592388536
17 0.824111521 0.382726443
18 0.619280474 0.824111521
19 0.892388536 0.619280474
20 0.524111521 0.892388536
21 -0.007611464 0.524111521
22 -0.271057433 -0.007611464
23 -0.639334448 -0.271057433
24 -0.471057433 -0.639334448
25 -0.475888479 -0.471057433
26 -0.444165495 -0.475888479
27 -0.275888479 -0.444165495
28 -0.175888479 -0.275888479
29 -0.207611464 -0.175888479
30 -0.202780417 -0.207611464
31 -0.102780417 -0.202780417
32 -0.371057433 -0.102780417
33 -0.907611464 -0.371057433
34 -0.539334448 -0.907611464
35 -0.571057433 -0.539334448
36 -0.907611464 -0.571057433
37 -0.802780417 -0.907611464
38 -0.834503402 -0.802780417
39 -0.329672355 -0.834503402
40 0.038604660 -0.329672355
41 0.038604660 0.038604660
42 -0.293118325 0.038604660
43 -0.866226386 -0.293118325
44 -0.961395340 -0.866226386
45 -0.456564294 -0.961395340
46 0.643435706 -0.456564294
47 0.811712722 0.643435706
48 0.479989737 0.811712722
49 -0.251733247 0.479989737
50 -0.688287278 -0.251733247
51 -0.424841309 -0.688287278
52 0.133773614 -0.424841309
53 0.938604660 0.133773614
54 1.002050629 0.938604660
55 1.006881675 1.002050629
56 0.502050629 1.006881675
57 0.533773614 0.502050629
58 0.760665552 0.533773614
59 0.860665552 0.760665552
60 NA 0.860665552
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.119280474 0.519280474
[2,] -0.148996541 0.119280474
[3,] -0.117273557 -0.148996541
[4,] 0.287557490 -0.117273557
[5,] 0.151003459 0.287557490
[6,] 0.355834505 0.151003459
[7,] -0.217273557 0.355834505
[8,] -0.080719526 -0.217273557
[9,] -0.344165495 -0.080719526
[10,] -0.217273557 -0.344165495
[11,] -0.012442510 -0.217273557
[12,] 0.019280474 -0.012442510
[13,] 0.255834505 0.019280474
[14,] 0.324111521 0.255834505
[15,] 0.592388536 0.324111521
[16,] 0.382726443 0.592388536
[17,] 0.824111521 0.382726443
[18,] 0.619280474 0.824111521
[19,] 0.892388536 0.619280474
[20,] 0.524111521 0.892388536
[21,] -0.007611464 0.524111521
[22,] -0.271057433 -0.007611464
[23,] -0.639334448 -0.271057433
[24,] -0.471057433 -0.639334448
[25,] -0.475888479 -0.471057433
[26,] -0.444165495 -0.475888479
[27,] -0.275888479 -0.444165495
[28,] -0.175888479 -0.275888479
[29,] -0.207611464 -0.175888479
[30,] -0.202780417 -0.207611464
[31,] -0.102780417 -0.202780417
[32,] -0.371057433 -0.102780417
[33,] -0.907611464 -0.371057433
[34,] -0.539334448 -0.907611464
[35,] -0.571057433 -0.539334448
[36,] -0.907611464 -0.571057433
[37,] -0.802780417 -0.907611464
[38,] -0.834503402 -0.802780417
[39,] -0.329672355 -0.834503402
[40,] 0.038604660 -0.329672355
[41,] 0.038604660 0.038604660
[42,] -0.293118325 0.038604660
[43,] -0.866226386 -0.293118325
[44,] -0.961395340 -0.866226386
[45,] -0.456564294 -0.961395340
[46,] 0.643435706 -0.456564294
[47,] 0.811712722 0.643435706
[48,] 0.479989737 0.811712722
[49,] -0.251733247 0.479989737
[50,] -0.688287278 -0.251733247
[51,] -0.424841309 -0.688287278
[52,] 0.133773614 -0.424841309
[53,] 0.938604660 0.133773614
[54,] 1.002050629 0.938604660
[55,] 1.006881675 1.002050629
[56,] 0.502050629 1.006881675
[57,] 0.533773614 0.502050629
[58,] 0.760665552 0.533773614
[59,] 0.860665552 0.760665552
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.119280474 0.519280474
2 -0.148996541 0.119280474
3 -0.117273557 -0.148996541
4 0.287557490 -0.117273557
5 0.151003459 0.287557490
6 0.355834505 0.151003459
7 -0.217273557 0.355834505
8 -0.080719526 -0.217273557
9 -0.344165495 -0.080719526
10 -0.217273557 -0.344165495
11 -0.012442510 -0.217273557
12 0.019280474 -0.012442510
13 0.255834505 0.019280474
14 0.324111521 0.255834505
15 0.592388536 0.324111521
16 0.382726443 0.592388536
17 0.824111521 0.382726443
18 0.619280474 0.824111521
19 0.892388536 0.619280474
20 0.524111521 0.892388536
21 -0.007611464 0.524111521
22 -0.271057433 -0.007611464
23 -0.639334448 -0.271057433
24 -0.471057433 -0.639334448
25 -0.475888479 -0.471057433
26 -0.444165495 -0.475888479
27 -0.275888479 -0.444165495
28 -0.175888479 -0.275888479
29 -0.207611464 -0.175888479
30 -0.202780417 -0.207611464
31 -0.102780417 -0.202780417
32 -0.371057433 -0.102780417
33 -0.907611464 -0.371057433
34 -0.539334448 -0.907611464
35 -0.571057433 -0.539334448
36 -0.907611464 -0.571057433
37 -0.802780417 -0.907611464
38 -0.834503402 -0.802780417
39 -0.329672355 -0.834503402
40 0.038604660 -0.329672355
41 0.038604660 0.038604660
42 -0.293118325 0.038604660
43 -0.866226386 -0.293118325
44 -0.961395340 -0.866226386
45 -0.456564294 -0.961395340
46 0.643435706 -0.456564294
47 0.811712722 0.643435706
48 0.479989737 0.811712722
49 -0.251733247 0.479989737
50 -0.688287278 -0.251733247
51 -0.424841309 -0.688287278
52 0.133773614 -0.424841309
53 0.938604660 0.133773614
54 1.002050629 0.938604660
55 1.006881675 1.002050629
56 0.502050629 1.006881675
57 0.533773614 0.502050629
58 0.760665552 0.533773614
59 0.860665552 0.760665552
> 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/7h21q1259250830.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/88yz01259250830.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/9ixui1259250830.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/10b3yo1259250830.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/11rh4w1259250830.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/12lal91259250830.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/13qmvb1259250830.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/14xmmr1259250830.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/15gay51259250831.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/16qo7v1259250831.tab")
+ }
>
> system("convert tmp/1e7211259250830.ps tmp/1e7211259250830.png")
> system("convert tmp/2vw571259250830.ps tmp/2vw571259250830.png")
> system("convert tmp/3s2lm1259250830.ps tmp/3s2lm1259250830.png")
> system("convert tmp/4ju5n1259250830.ps tmp/4ju5n1259250830.png")
> system("convert tmp/5e57r1259250830.ps tmp/5e57r1259250830.png")
> system("convert tmp/6rqpr1259250830.ps tmp/6rqpr1259250830.png")
> system("convert tmp/7h21q1259250830.ps tmp/7h21q1259250830.png")
> system("convert tmp/88yz01259250830.ps tmp/88yz01259250830.png")
> system("convert tmp/9ixui1259250830.ps tmp/9ixui1259250830.png")
> system("convert tmp/10b3yo1259250830.ps tmp/10b3yo1259250830.png")
>
>
> proc.time()
user system elapsed
2.429 1.559 3.070