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(21,2472.81,19,2407.6,25,2454.62,21,2448.05,23,2497.84,23,2645.64,19,2756.76,18,2849.27,19,2921.44,19,2981.85,22,3080.58,23,3106.22,20,3119.31,14,3061.26,14,3097.31,14,3161.69,15,3257.16,11,3277.01,17,3295.32,16,3363.99,20,3494.17,24,3667.03,23,3813.06,20,3917.96,21,3895.51,19,3801.06,23,3570.12,23,3701.61,23,3862.27,23,3970.1,27,4138.52,26,4199.75,17,4290.89,24,4443.91,26,4502.64,24,4356.98,27,4591.27,27,4696.96,26,4621.4,24,4562.84,23,4202.52,23,4296.49,24,4435.23,17,4105.18,21,4116.68,19,3844.49,22,3720.98,22,3674.4,18,3857.62,16,3801.06,14,3504.37,12,3032.6,14,3047.03,16,2962.34,8,2197.82,3,2014.45,0,1862.83,5,1905.41,1,1810.99,1,1670.07,3,1864.44),dim=c(2,61),dimnames=list(c('Consvertr','Aand'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Consvertr','Aand'),1:61))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
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
Consvertr Aand t
1 21 2472.81 1
2 19 2407.60 2
3 25 2454.62 3
4 21 2448.05 4
5 23 2497.84 5
6 23 2645.64 6
7 19 2756.76 7
8 18 2849.27 8
9 19 2921.44 9
10 19 2981.85 10
11 22 3080.58 11
12 23 3106.22 12
13 20 3119.31 13
14 14 3061.26 14
15 14 3097.31 15
16 14 3161.69 16
17 15 3257.16 17
18 11 3277.01 18
19 17 3295.32 19
20 16 3363.99 20
21 20 3494.17 21
22 24 3667.03 22
23 23 3813.06 23
24 20 3917.96 24
25 21 3895.51 25
26 19 3801.06 26
27 23 3570.12 27
28 23 3701.61 28
29 23 3862.27 29
30 23 3970.10 30
31 27 4138.52 31
32 26 4199.75 32
33 17 4290.89 33
34 24 4443.91 34
35 26 4502.64 35
36 24 4356.98 36
37 27 4591.27 37
38 27 4696.96 38
39 26 4621.40 39
40 24 4562.84 40
41 23 4202.52 41
42 23 4296.49 42
43 24 4435.23 43
44 17 4105.18 44
45 21 4116.68 45
46 19 3844.49 46
47 22 3720.98 47
48 22 3674.40 48
49 18 3857.62 49
50 16 3801.06 50
51 14 3504.37 51
52 12 3032.60 52
53 14 3047.03 53
54 16 2962.34 54
55 8 2197.82 55
56 3 2014.45 56
57 0 1862.83 57
58 5 1905.41 58
59 1 1810.99 59
60 1 1670.07 60
61 3 1864.44 61
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Aand t
2.731703 0.006374 -0.190089
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-9.1976 -1.4550 0.3403 1.9214 7.1929
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.7317030 1.8956304 1.441 0.155
Aand 0.0063740 0.0005129 12.427 < 2e-16 ***
t -0.1900888 0.0235928 -8.057 4.91e-11 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.241 on 58 degrees of freedom
Multiple R-squared: 0.7838, Adjusted R-squared: 0.7763
F-statistic: 105.1 on 2 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.4554788 0.910957558 0.544521221
[2,] 0.4856264 0.971252862 0.514373569
[3,] 0.3764401 0.752880128 0.623559936
[4,] 0.2604171 0.520834238 0.739582881
[5,] 0.1721786 0.344357140 0.827821430
[6,] 0.2613697 0.522739383 0.738630308
[7,] 0.3520080 0.704015974 0.647992013
[8,] 0.3041591 0.608318163 0.695840918
[9,] 0.6027172 0.794565593 0.397282797
[10,] 0.5982896 0.803420891 0.401710446
[11,] 0.5459676 0.908064853 0.454032426
[12,] 0.4714090 0.942817999 0.528591000
[13,] 0.6326020 0.734795992 0.367397996
[14,] 0.6851369 0.629726267 0.314863133
[15,] 0.6983020 0.603396093 0.301698047
[16,] 0.8011922 0.397615630 0.198807815
[17,] 0.9210529 0.157894211 0.078947106
[18,] 0.9085035 0.182992952 0.091496476
[19,] 0.8954959 0.209008236 0.104504118
[20,] 0.8736492 0.252701590 0.126350795
[21,] 0.8857010 0.228597957 0.114298978
[22,] 0.9715162 0.056967676 0.028483838
[23,] 0.9775638 0.044872361 0.022436181
[24,] 0.9746388 0.050722342 0.025361171
[25,] 0.9675824 0.064835266 0.032417633
[26,] 0.9854403 0.029119471 0.014559736
[27,] 0.9915919 0.016816208 0.008408104
[28,] 0.9983721 0.003255848 0.001627924
[29,] 0.9972726 0.005454818 0.002727409
[30,] 0.9957284 0.008543143 0.004271571
[31,] 0.9927730 0.014453966 0.007226983
[32,] 0.9899057 0.020188522 0.010094261
[33,] 0.9842504 0.031499279 0.015749639
[34,] 0.9751774 0.049645106 0.024822553
[35,] 0.9619277 0.076144669 0.038072335
[36,] 0.9444627 0.111074679 0.055537339
[37,] 0.9160741 0.167851798 0.083925899
[38,] 0.8772417 0.245516536 0.122758268
[39,] 0.9294165 0.141167003 0.070583502
[40,] 0.9027503 0.194499317 0.097249659
[41,] 0.8732849 0.253430244 0.126715122
[42,] 0.8617892 0.276421645 0.138210823
[43,] 0.9157732 0.168453698 0.084226849
[44,] 0.8678176 0.264364847 0.132182423
[45,] 0.8724026 0.255194808 0.127597404
[46,] 0.9353120 0.129376084 0.064688042
[47,] 0.9367526 0.126494805 0.063247403
[48,] 0.9320161 0.135967889 0.067983944
[49,] 0.8937891 0.212421879 0.106210939
[50,] 0.8328754 0.334249122 0.167124561
> postscript(file="/var/www/html/rcomp/tmp/1ffx21258646776.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/2m8my1258646776.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/3ougk1258646776.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/4sfs31258646776.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/5gy711258646776.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 = 61
Frequency = 1
1 2 3 4 5 6
2.696810160 1.302544478 7.192930010 3.424895703 5.297625384 4.545643896
7 8 9 10 11 12
0.027459017 -1.372106589 -0.642025985 -0.836987688 1.723800715 2.750461370
13 14 15 16 17 18
-0.142884860 -5.582788048 -5.622480247 -5.842746546 -5.261179054 -9.197613210
19 20 21 22 23 24
-3.124231476 -4.371842035 -1.011514465 2.076772776 0.336073185 -3.142465704
25 26 27 28 29 30
-1.809281632 -3.017172917 2.644916693 1.996894384 1.162943855 0.665729283
31 32 33 34 35 36
3.782316877 2.582128531 -6.808704759 -0.593958284 1.221788254 0.340307121
37 38 39 40 41 42
2.037042406 1.553468094 1.225172829 -0.211479642 1.275272054 0.866400475
43 44 45 46 47 48
1.172167005 -3.534020867 0.582767488 0.507782674 4.485118474 4.972106041
49 50 51 52 53 54
-0.005640876 -1.455041254 -1.373864211 -0.176735412 1.921377260 4.651276190
55 56 57 58 59 60
1.714379837 -1.926739515 -3.770231886 1.148453999 -2.059628505 -0.971322178
61
-0.020138674
> postscript(file="/var/www/html/rcomp/tmp/6fip41258646776.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 = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 2.696810160 NA
1 1.302544478 2.696810160
2 7.192930010 1.302544478
3 3.424895703 7.192930010
4 5.297625384 3.424895703
5 4.545643896 5.297625384
6 0.027459017 4.545643896
7 -1.372106589 0.027459017
8 -0.642025985 -1.372106589
9 -0.836987688 -0.642025985
10 1.723800715 -0.836987688
11 2.750461370 1.723800715
12 -0.142884860 2.750461370
13 -5.582788048 -0.142884860
14 -5.622480247 -5.582788048
15 -5.842746546 -5.622480247
16 -5.261179054 -5.842746546
17 -9.197613210 -5.261179054
18 -3.124231476 -9.197613210
19 -4.371842035 -3.124231476
20 -1.011514465 -4.371842035
21 2.076772776 -1.011514465
22 0.336073185 2.076772776
23 -3.142465704 0.336073185
24 -1.809281632 -3.142465704
25 -3.017172917 -1.809281632
26 2.644916693 -3.017172917
27 1.996894384 2.644916693
28 1.162943855 1.996894384
29 0.665729283 1.162943855
30 3.782316877 0.665729283
31 2.582128531 3.782316877
32 -6.808704759 2.582128531
33 -0.593958284 -6.808704759
34 1.221788254 -0.593958284
35 0.340307121 1.221788254
36 2.037042406 0.340307121
37 1.553468094 2.037042406
38 1.225172829 1.553468094
39 -0.211479642 1.225172829
40 1.275272054 -0.211479642
41 0.866400475 1.275272054
42 1.172167005 0.866400475
43 -3.534020867 1.172167005
44 0.582767488 -3.534020867
45 0.507782674 0.582767488
46 4.485118474 0.507782674
47 4.972106041 4.485118474
48 -0.005640876 4.972106041
49 -1.455041254 -0.005640876
50 -1.373864211 -1.455041254
51 -0.176735412 -1.373864211
52 1.921377260 -0.176735412
53 4.651276190 1.921377260
54 1.714379837 4.651276190
55 -1.926739515 1.714379837
56 -3.770231886 -1.926739515
57 1.148453999 -3.770231886
58 -2.059628505 1.148453999
59 -0.971322178 -2.059628505
60 -0.020138674 -0.971322178
61 NA -0.020138674
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.302544478 2.696810160
[2,] 7.192930010 1.302544478
[3,] 3.424895703 7.192930010
[4,] 5.297625384 3.424895703
[5,] 4.545643896 5.297625384
[6,] 0.027459017 4.545643896
[7,] -1.372106589 0.027459017
[8,] -0.642025985 -1.372106589
[9,] -0.836987688 -0.642025985
[10,] 1.723800715 -0.836987688
[11,] 2.750461370 1.723800715
[12,] -0.142884860 2.750461370
[13,] -5.582788048 -0.142884860
[14,] -5.622480247 -5.582788048
[15,] -5.842746546 -5.622480247
[16,] -5.261179054 -5.842746546
[17,] -9.197613210 -5.261179054
[18,] -3.124231476 -9.197613210
[19,] -4.371842035 -3.124231476
[20,] -1.011514465 -4.371842035
[21,] 2.076772776 -1.011514465
[22,] 0.336073185 2.076772776
[23,] -3.142465704 0.336073185
[24,] -1.809281632 -3.142465704
[25,] -3.017172917 -1.809281632
[26,] 2.644916693 -3.017172917
[27,] 1.996894384 2.644916693
[28,] 1.162943855 1.996894384
[29,] 0.665729283 1.162943855
[30,] 3.782316877 0.665729283
[31,] 2.582128531 3.782316877
[32,] -6.808704759 2.582128531
[33,] -0.593958284 -6.808704759
[34,] 1.221788254 -0.593958284
[35,] 0.340307121 1.221788254
[36,] 2.037042406 0.340307121
[37,] 1.553468094 2.037042406
[38,] 1.225172829 1.553468094
[39,] -0.211479642 1.225172829
[40,] 1.275272054 -0.211479642
[41,] 0.866400475 1.275272054
[42,] 1.172167005 0.866400475
[43,] -3.534020867 1.172167005
[44,] 0.582767488 -3.534020867
[45,] 0.507782674 0.582767488
[46,] 4.485118474 0.507782674
[47,] 4.972106041 4.485118474
[48,] -0.005640876 4.972106041
[49,] -1.455041254 -0.005640876
[50,] -1.373864211 -1.455041254
[51,] -0.176735412 -1.373864211
[52,] 1.921377260 -0.176735412
[53,] 4.651276190 1.921377260
[54,] 1.714379837 4.651276190
[55,] -1.926739515 1.714379837
[56,] -3.770231886 -1.926739515
[57,] 1.148453999 -3.770231886
[58,] -2.059628505 1.148453999
[59,] -0.971322178 -2.059628505
[60,] -0.020138674 -0.971322178
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.302544478 2.696810160
2 7.192930010 1.302544478
3 3.424895703 7.192930010
4 5.297625384 3.424895703
5 4.545643896 5.297625384
6 0.027459017 4.545643896
7 -1.372106589 0.027459017
8 -0.642025985 -1.372106589
9 -0.836987688 -0.642025985
10 1.723800715 -0.836987688
11 2.750461370 1.723800715
12 -0.142884860 2.750461370
13 -5.582788048 -0.142884860
14 -5.622480247 -5.582788048
15 -5.842746546 -5.622480247
16 -5.261179054 -5.842746546
17 -9.197613210 -5.261179054
18 -3.124231476 -9.197613210
19 -4.371842035 -3.124231476
20 -1.011514465 -4.371842035
21 2.076772776 -1.011514465
22 0.336073185 2.076772776
23 -3.142465704 0.336073185
24 -1.809281632 -3.142465704
25 -3.017172917 -1.809281632
26 2.644916693 -3.017172917
27 1.996894384 2.644916693
28 1.162943855 1.996894384
29 0.665729283 1.162943855
30 3.782316877 0.665729283
31 2.582128531 3.782316877
32 -6.808704759 2.582128531
33 -0.593958284 -6.808704759
34 1.221788254 -0.593958284
35 0.340307121 1.221788254
36 2.037042406 0.340307121
37 1.553468094 2.037042406
38 1.225172829 1.553468094
39 -0.211479642 1.225172829
40 1.275272054 -0.211479642
41 0.866400475 1.275272054
42 1.172167005 0.866400475
43 -3.534020867 1.172167005
44 0.582767488 -3.534020867
45 0.507782674 0.582767488
46 4.485118474 0.507782674
47 4.972106041 4.485118474
48 -0.005640876 4.972106041
49 -1.455041254 -0.005640876
50 -1.373864211 -1.455041254
51 -0.176735412 -1.373864211
52 1.921377260 -0.176735412
53 4.651276190 1.921377260
54 1.714379837 4.651276190
55 -1.926739515 1.714379837
56 -3.770231886 -1.926739515
57 1.148453999 -3.770231886
58 -2.059628505 1.148453999
59 -0.971322178 -2.059628505
60 -0.020138674 -0.971322178
> 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/785np1258646776.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/8nhd21258646776.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/9igzz1258646776.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/10iw2b1258646776.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/11r0im1258646776.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/12w8pz1258646776.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/131kee1258646776.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/14pdzu1258646776.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/15qdf91258646776.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/16bjmi1258646776.tab")
+ }
>
> system("convert tmp/1ffx21258646776.ps tmp/1ffx21258646776.png")
> system("convert tmp/2m8my1258646776.ps tmp/2m8my1258646776.png")
> system("convert tmp/3ougk1258646776.ps tmp/3ougk1258646776.png")
> system("convert tmp/4sfs31258646776.ps tmp/4sfs31258646776.png")
> system("convert tmp/5gy711258646776.ps tmp/5gy711258646776.png")
> system("convert tmp/6fip41258646776.ps tmp/6fip41258646776.png")
> system("convert tmp/785np1258646776.ps tmp/785np1258646776.png")
> system("convert tmp/8nhd21258646776.ps tmp/8nhd21258646776.png")
> system("convert tmp/9igzz1258646776.ps tmp/9igzz1258646776.png")
> system("convert tmp/10iw2b1258646776.ps tmp/10iw2b1258646776.png")
>
>
> proc.time()
user system elapsed
2.449 1.511 2.922