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.9,6.3,8.2,6.2,7.6,6.1,7.7,6.3,8.1,6.5,8.3,6.6,8.3,6.5,7.9,6.2,7.8,6.2,8,5.9,8.5,6.1,8.6,6.1,8.5,6.1,8,6.1,7.8,6.1,8,6.4,8.2,6.7,8.3,6.9,8.2,7,8.1,7,8,6.8,7.8,6.4,7.8,5.9,7.7,5.5,7.6,5.5,7.6,5.6,7.6,5.8,7.8,5.9,8,6.1,8,6.1,7.9,6,7.7,6,7.4,5.9,6.9,5.5,6.7,5.6,6.5,5.4,6.4,5.2,6.7,5.2,6.8,5.2,6.9,5.5,6.9,5.8,6.7,5.8,6.4,5.5,6.2,5.3,5.9,5.1,6.1,5.2,6.7,5.8,6.8,5.8,6.6,5.5,6.4,5,6.4,4.9,6.7,5.3,7.1,6.1,7.1,6.5,6.9,6.8,6.4,6.6,6,6.4,6,6.4),dim=c(2,58),dimnames=list(c('wv','wm'),1:58))
> y <- array(NA,dim=c(2,58),dimnames=list(c('wv','wm'),1:58))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '2'
> #'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
wm wv
1 6.3 8.9
2 6.2 8.2
3 6.1 7.6
4 6.3 7.7
5 6.5 8.1
6 6.6 8.3
7 6.5 8.3
8 6.2 7.9
9 6.2 7.8
10 5.9 8.0
11 6.1 8.5
12 6.1 8.6
13 6.1 8.5
14 6.1 8.0
15 6.1 7.8
16 6.4 8.0
17 6.7 8.2
18 6.9 8.3
19 7.0 8.2
20 7.0 8.1
21 6.8 8.0
22 6.4 7.8
23 5.9 7.8
24 5.5 7.7
25 5.5 7.6
26 5.6 7.6
27 5.8 7.6
28 5.9 7.8
29 6.1 8.0
30 6.1 8.0
31 6.0 7.9
32 6.0 7.7
33 5.9 7.4
34 5.5 6.9
35 5.6 6.7
36 5.4 6.5
37 5.2 6.4
38 5.2 6.7
39 5.2 6.8
40 5.5 6.9
41 5.8 6.9
42 5.8 6.7
43 5.5 6.4
44 5.3 6.2
45 5.1 5.9
46 5.2 6.1
47 5.8 6.7
48 5.8 6.8
49 5.5 6.6
50 5.0 6.4
51 4.9 6.4
52 5.3 6.7
53 6.1 7.1
54 6.5 7.1
55 6.8 6.9
56 6.6 6.4
57 6.4 6.0
58 6.4 6.0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) wv
3.0328 0.3978
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.67871 -0.27761 -0.09695 0.19931 1.02239
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.03277 0.53755 5.642 5.77e-07 ***
wv 0.39780 0.07242 5.493 1.00e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.431 on 56 degrees of freedom
Multiple R-squared: 0.3501, Adjusted R-squared: 0.3385
F-statistic: 30.17 on 1 and 56 DF, p-value: 1.000e-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,] 6.051380e-02 1.210276e-01 0.9394862
[2,] 5.774008e-02 1.154802e-01 0.9422599
[3,] 2.643042e-02 5.286084e-02 0.9735696
[4,] 1.090750e-02 2.181501e-02 0.9890925
[5,] 3.961708e-03 7.923417e-03 0.9960383
[6,] 9.416427e-03 1.883285e-02 0.9905836
[7,] 6.985192e-03 1.397038e-02 0.9930148
[8,] 4.558698e-03 9.117395e-03 0.9954413
[9,] 2.572036e-03 5.144071e-03 0.9974280
[10,] 1.211281e-03 2.422562e-03 0.9987887
[11,] 5.191110e-04 1.038222e-03 0.9994809
[12,] 2.857922e-04 5.715845e-04 0.9997142
[13,] 8.104415e-04 1.620883e-03 0.9991896
[14,] 4.539141e-03 9.078282e-03 0.9954609
[15,] 2.147048e-02 4.294097e-02 0.9785295
[16,] 6.312464e-02 1.262493e-01 0.9368754
[17,] 8.751499e-02 1.750300e-01 0.9124850
[18,] 6.805738e-02 1.361148e-01 0.9319426
[19,] 6.622695e-02 1.324539e-01 0.9337730
[20,] 1.269567e-01 2.539134e-01 0.8730433
[21,] 1.673207e-01 3.346414e-01 0.8326793
[22,] 1.671481e-01 3.342961e-01 0.8328519
[23,] 1.316633e-01 2.633266e-01 0.8683367
[24,] 1.006881e-01 2.013763e-01 0.8993119
[25,] 7.148464e-02 1.429693e-01 0.9285154
[26,] 4.923785e-02 9.847570e-02 0.9507621
[27,] 3.359099e-02 6.718198e-02 0.9664090
[28,] 2.140665e-02 4.281331e-02 0.9785933
[29,] 1.317132e-02 2.634263e-02 0.9868287
[30,] 8.583824e-03 1.716765e-02 0.9914162
[31,] 5.169700e-03 1.033940e-02 0.9948303
[32,] 3.106033e-03 6.212066e-03 0.9968940
[33,] 2.191335e-03 4.382670e-03 0.9978087
[34,] 2.046243e-03 4.092486e-03 0.9979538
[35,] 2.293453e-03 4.586905e-03 0.9977065
[36,] 1.603625e-03 3.207250e-03 0.9983964
[37,] 9.928642e-04 1.985728e-03 0.9990071
[38,] 6.495575e-04 1.299115e-03 0.9993504
[39,] 3.673840e-04 7.347681e-04 0.9996326
[40,] 2.121808e-04 4.243615e-04 0.9997878
[41,] 1.473160e-04 2.946321e-04 0.9998527
[42,] 1.271042e-04 2.542083e-04 0.9998729
[43,] 6.664970e-05 1.332994e-04 0.9999334
[44,] 3.126184e-05 6.252368e-05 0.9999687
[45,] 1.974757e-05 3.949514e-05 0.9999803
[46,] 1.617914e-04 3.235829e-04 0.9998382
[47,] 1.846901e-02 3.693803e-02 0.9815310
[48,] 5.730639e-01 8.538722e-01 0.4269361
[49,] 8.690643e-01 2.618715e-01 0.1309357
> postscript(file="/var/www/html/rcomp/tmp/1wj781258735601.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/26k1h1258735601.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/38a8h1258735601.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/4qpav1258735601.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/5j6e81258735601.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 = 58
Frequency = 1
1 2 3 4 5 6
-0.27321459 -0.09475247 0.04392934 0.20414904 0.24502783 0.26546722
7 8 9 10 11 12
0.16546722 0.02458843 0.06436873 -0.31519187 -0.31409338 -0.35387368
13 14 15 16 17 18
-0.31409338 -0.11519187 -0.03563127 0.18480813 0.40524753 0.56546722
19 20 21 22 23 24
0.70524753 0.74502783 0.58480813 0.26436873 -0.23563127 -0.59585096
25 26 27 28 29 30
-0.55607066 -0.45607066 -0.25607066 -0.23563127 -0.11519187 -0.11519187
31 32 33 34 35 36
-0.17541157 -0.09585096 -0.07651006 -0.27760855 -0.09804794 -0.21848734
37 38 39 40 41 42
-0.37870704 -0.49804794 -0.53782824 -0.27760855 0.02239145 0.10195206
43 44 45 46 47 48
-0.07870704 -0.19914643 -0.27980552 -0.25936613 0.10195206 0.06217176
49 50 51 52 53 54
-0.15826764 -0.57870704 -0.67870704 -0.39804794 0.24283085 0.64283085
55 56 57 58
1.02239145 1.02129296 0.98041417 0.98041417
> postscript(file="/var/www/html/rcomp/tmp/6ghag1258735601.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 = 58
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.27321459 NA
1 -0.09475247 -0.27321459
2 0.04392934 -0.09475247
3 0.20414904 0.04392934
4 0.24502783 0.20414904
5 0.26546722 0.24502783
6 0.16546722 0.26546722
7 0.02458843 0.16546722
8 0.06436873 0.02458843
9 -0.31519187 0.06436873
10 -0.31409338 -0.31519187
11 -0.35387368 -0.31409338
12 -0.31409338 -0.35387368
13 -0.11519187 -0.31409338
14 -0.03563127 -0.11519187
15 0.18480813 -0.03563127
16 0.40524753 0.18480813
17 0.56546722 0.40524753
18 0.70524753 0.56546722
19 0.74502783 0.70524753
20 0.58480813 0.74502783
21 0.26436873 0.58480813
22 -0.23563127 0.26436873
23 -0.59585096 -0.23563127
24 -0.55607066 -0.59585096
25 -0.45607066 -0.55607066
26 -0.25607066 -0.45607066
27 -0.23563127 -0.25607066
28 -0.11519187 -0.23563127
29 -0.11519187 -0.11519187
30 -0.17541157 -0.11519187
31 -0.09585096 -0.17541157
32 -0.07651006 -0.09585096
33 -0.27760855 -0.07651006
34 -0.09804794 -0.27760855
35 -0.21848734 -0.09804794
36 -0.37870704 -0.21848734
37 -0.49804794 -0.37870704
38 -0.53782824 -0.49804794
39 -0.27760855 -0.53782824
40 0.02239145 -0.27760855
41 0.10195206 0.02239145
42 -0.07870704 0.10195206
43 -0.19914643 -0.07870704
44 -0.27980552 -0.19914643
45 -0.25936613 -0.27980552
46 0.10195206 -0.25936613
47 0.06217176 0.10195206
48 -0.15826764 0.06217176
49 -0.57870704 -0.15826764
50 -0.67870704 -0.57870704
51 -0.39804794 -0.67870704
52 0.24283085 -0.39804794
53 0.64283085 0.24283085
54 1.02239145 0.64283085
55 1.02129296 1.02239145
56 0.98041417 1.02129296
57 0.98041417 0.98041417
58 NA 0.98041417
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.09475247 -0.27321459
[2,] 0.04392934 -0.09475247
[3,] 0.20414904 0.04392934
[4,] 0.24502783 0.20414904
[5,] 0.26546722 0.24502783
[6,] 0.16546722 0.26546722
[7,] 0.02458843 0.16546722
[8,] 0.06436873 0.02458843
[9,] -0.31519187 0.06436873
[10,] -0.31409338 -0.31519187
[11,] -0.35387368 -0.31409338
[12,] -0.31409338 -0.35387368
[13,] -0.11519187 -0.31409338
[14,] -0.03563127 -0.11519187
[15,] 0.18480813 -0.03563127
[16,] 0.40524753 0.18480813
[17,] 0.56546722 0.40524753
[18,] 0.70524753 0.56546722
[19,] 0.74502783 0.70524753
[20,] 0.58480813 0.74502783
[21,] 0.26436873 0.58480813
[22,] -0.23563127 0.26436873
[23,] -0.59585096 -0.23563127
[24,] -0.55607066 -0.59585096
[25,] -0.45607066 -0.55607066
[26,] -0.25607066 -0.45607066
[27,] -0.23563127 -0.25607066
[28,] -0.11519187 -0.23563127
[29,] -0.11519187 -0.11519187
[30,] -0.17541157 -0.11519187
[31,] -0.09585096 -0.17541157
[32,] -0.07651006 -0.09585096
[33,] -0.27760855 -0.07651006
[34,] -0.09804794 -0.27760855
[35,] -0.21848734 -0.09804794
[36,] -0.37870704 -0.21848734
[37,] -0.49804794 -0.37870704
[38,] -0.53782824 -0.49804794
[39,] -0.27760855 -0.53782824
[40,] 0.02239145 -0.27760855
[41,] 0.10195206 0.02239145
[42,] -0.07870704 0.10195206
[43,] -0.19914643 -0.07870704
[44,] -0.27980552 -0.19914643
[45,] -0.25936613 -0.27980552
[46,] 0.10195206 -0.25936613
[47,] 0.06217176 0.10195206
[48,] -0.15826764 0.06217176
[49,] -0.57870704 -0.15826764
[50,] -0.67870704 -0.57870704
[51,] -0.39804794 -0.67870704
[52,] 0.24283085 -0.39804794
[53,] 0.64283085 0.24283085
[54,] 1.02239145 0.64283085
[55,] 1.02129296 1.02239145
[56,] 0.98041417 1.02129296
[57,] 0.98041417 0.98041417
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.09475247 -0.27321459
2 0.04392934 -0.09475247
3 0.20414904 0.04392934
4 0.24502783 0.20414904
5 0.26546722 0.24502783
6 0.16546722 0.26546722
7 0.02458843 0.16546722
8 0.06436873 0.02458843
9 -0.31519187 0.06436873
10 -0.31409338 -0.31519187
11 -0.35387368 -0.31409338
12 -0.31409338 -0.35387368
13 -0.11519187 -0.31409338
14 -0.03563127 -0.11519187
15 0.18480813 -0.03563127
16 0.40524753 0.18480813
17 0.56546722 0.40524753
18 0.70524753 0.56546722
19 0.74502783 0.70524753
20 0.58480813 0.74502783
21 0.26436873 0.58480813
22 -0.23563127 0.26436873
23 -0.59585096 -0.23563127
24 -0.55607066 -0.59585096
25 -0.45607066 -0.55607066
26 -0.25607066 -0.45607066
27 -0.23563127 -0.25607066
28 -0.11519187 -0.23563127
29 -0.11519187 -0.11519187
30 -0.17541157 -0.11519187
31 -0.09585096 -0.17541157
32 -0.07651006 -0.09585096
33 -0.27760855 -0.07651006
34 -0.09804794 -0.27760855
35 -0.21848734 -0.09804794
36 -0.37870704 -0.21848734
37 -0.49804794 -0.37870704
38 -0.53782824 -0.49804794
39 -0.27760855 -0.53782824
40 0.02239145 -0.27760855
41 0.10195206 0.02239145
42 -0.07870704 0.10195206
43 -0.19914643 -0.07870704
44 -0.27980552 -0.19914643
45 -0.25936613 -0.27980552
46 0.10195206 -0.25936613
47 0.06217176 0.10195206
48 -0.15826764 0.06217176
49 -0.57870704 -0.15826764
50 -0.67870704 -0.57870704
51 -0.39804794 -0.67870704
52 0.24283085 -0.39804794
53 0.64283085 0.24283085
54 1.02239145 0.64283085
55 1.02129296 1.02239145
56 0.98041417 1.02129296
57 0.98041417 0.98041417
> 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/7obn51258735601.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/8pab01258735601.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/9xkye1258735601.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/10jzby1258735601.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/11ntdb1258735601.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/123lwr1258735601.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/13uljf1258735601.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/14if4y1258735601.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/15wybp1258735601.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/16p6351258735601.tab")
+ }
>
> system("convert tmp/1wj781258735601.ps tmp/1wj781258735601.png")
> system("convert tmp/26k1h1258735601.ps tmp/26k1h1258735601.png")
> system("convert tmp/38a8h1258735601.ps tmp/38a8h1258735601.png")
> system("convert tmp/4qpav1258735601.ps tmp/4qpav1258735601.png")
> system("convert tmp/5j6e81258735601.ps tmp/5j6e81258735601.png")
> system("convert tmp/6ghag1258735601.ps tmp/6ghag1258735601.png")
> system("convert tmp/7obn51258735601.ps tmp/7obn51258735601.png")
> system("convert tmp/8pab01258735601.ps tmp/8pab01258735601.png")
> system("convert tmp/9xkye1258735601.ps tmp/9xkye1258735601.png")
> system("convert tmp/10jzby1258735601.ps tmp/10jzby1258735601.png")
>
>
> proc.time()
user system elapsed
2.457 1.592 5.851