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(423,114,427,116,441,153,449,162,452,161,462,149,455,139,461,135,461,130,463,127,462,122,456,117,455,112,456,113,472,149,472,157,471,157,465,147,459,137,465,132,468,125,467,123,463,117,460,114,462,111,461,112,476,144,476,150,471,149,453,134,443,123,442,116,444,117,438,111,427,105,424,102,416,95,406,93,431,124,434,130,418,124,412,115,404,106,409,105,412,105,406,101,398,95,397,93,385,84,390,87,413,116,413,120,401,117,397,109,397,105,409,107,419,109,424,109,428,108,430,107),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 423 114
2 427 116
3 441 153
4 449 162
5 452 161
6 462 149
7 455 139
8 461 135
9 461 130
10 463 127
11 462 122
12 456 117
13 455 112
14 456 113
15 472 149
16 472 157
17 471 157
18 465 147
19 459 137
20 465 132
21 468 125
22 467 123
23 463 117
24 460 114
25 462 111
26 461 112
27 476 144
28 476 150
29 471 149
30 453 134
31 443 123
32 442 116
33 444 117
34 438 111
35 427 105
36 424 102
37 416 95
38 406 93
39 431 124
40 434 130
41 418 124
42 412 115
43 404 106
44 409 105
45 412 105
46 406 101
47 398 95
48 397 93
49 385 84
50 390 87
51 413 116
52 413 120
53 401 117
54 397 109
55 397 105
56 409 107
57 419 109
58 424 109
59 428 108
60 430 107
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
315.015 1.014
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-32.69587 -12.97821 -0.06949 10.32568 34.39035
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 315.015 14.797 21.289 < 2e-16 ***
X 1.014 0.121 8.381 1.41e-11 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 17.85 on 58 degrees of freedom
Multiple R-squared: 0.5477, Adjusted R-squared: 0.5399
F-statistic: 70.24 on 1 and 58 DF, p-value: 1.412e-11
> 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.008028074 0.01605615 0.99197193
[2,] 0.119833317 0.23966663 0.88016668
[3,] 0.125488890 0.25097778 0.87451111
[4,] 0.195345815 0.39069163 0.80465418
[5,] 0.240031784 0.48006357 0.75996822
[6,] 0.280432836 0.56086567 0.71956716
[7,] 0.294261365 0.58852273 0.70573864
[8,] 0.252034447 0.50406889 0.74796555
[9,] 0.220615860 0.44123172 0.77938414
[10,] 0.195854060 0.39170812 0.80414594
[11,] 0.203888788 0.40777758 0.79611121
[12,] 0.187735542 0.37547108 0.81226446
[13,] 0.161421872 0.32284374 0.83857813
[14,] 0.121769348 0.24353870 0.87823065
[15,] 0.083976285 0.16795257 0.91602372
[16,] 0.068145415 0.13629083 0.93185459
[17,] 0.077139794 0.15427959 0.92286021
[18,] 0.088477137 0.17695427 0.91152286
[19,] 0.105915730 0.21183146 0.89408427
[20,] 0.132657788 0.26531558 0.86734221
[21,] 0.235048300 0.47009660 0.76495170
[22,] 0.412792763 0.82558553 0.58720724
[23,] 0.461978761 0.92395752 0.53802124
[24,] 0.468829811 0.93765962 0.53117019
[25,] 0.440008970 0.88001794 0.55999103
[26,] 0.408237650 0.81647530 0.59176235
[27,] 0.428545585 0.85709117 0.57145442
[28,] 0.500250645 0.99949871 0.49974936
[29,] 0.603552523 0.79289495 0.39644748
[30,] 0.733849608 0.53230078 0.26615039
[31,] 0.827712997 0.34457401 0.17228700
[32,] 0.895890004 0.20821999 0.10411000
[33,] 0.940150382 0.11969924 0.05984962
[34,] 0.958078171 0.08384366 0.04192183
[35,] 0.956410090 0.08717982 0.04358991
[36,] 0.952896576 0.09420685 0.04710342
[37,] 0.958421363 0.08315727 0.04157864
[38,] 0.959464678 0.08107064 0.04053532
[39,] 0.959537013 0.08092597 0.04046299
[40,] 0.947501094 0.10499781 0.05249891
[41,] 0.929307562 0.14138488 0.07069244
[42,] 0.903805850 0.19238830 0.09619415
[43,] 0.871771025 0.25645795 0.12822898
[44,] 0.825253828 0.34949234 0.17474617
[45,] 0.791912192 0.41617562 0.20808781
[46,] 0.807984006 0.38403199 0.19201599
[47,] 0.733180510 0.53363898 0.26681949
[48,] 0.656010066 0.68797987 0.34398993
[49,] 0.663439317 0.67312137 0.33656068
[50,] 0.869769150 0.26046170 0.13023085
[51,] 0.846435187 0.30712963 0.15356481
> postscript(file="/var/www/html/rcomp/tmp/1cx7p1258732239.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/21giy1258732239.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/34oso1258732239.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/4kabc1258732239.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/55dq11258732239.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
-7.6527632 -5.6815031 -29.2131922 -30.3425219 -26.3281520 -4.1557123
7 8 9 10 11 12
-1.0120125 9.0454674 14.1173172 19.1604272 23.2322770 22.3041269
13 14 15 16 17 18
26.3759768 26.3616068 5.8442877 -2.2706721 -3.2706721 0.8730277
19 20 21 22 23 24
5.0167274 16.0885773 26.1891671 27.2179071 29.3041269 29.3472368
25 26 27 28 29 30
34.3903467 32.3759768 14.9161376 8.8299178 4.8442877 2.0598373
31 32 33 34 35 36
3.2179071 9.3184969 10.3041269 10.3903467 5.4765666 5.5196765
37 38 39 40 41 42
4.6202663 -3.3509937 -9.7964629 -12.8826828 -22.7964629 -19.6671331
43 44 45 46 47 48
-18.5378034 -12.5234334 -9.5234334 -11.4659535 -13.3797337 -12.3509937
49 50 51 52 53 54
-15.2216639 -13.2647739 -19.6815031 -23.7389830 -32.6958731 -28.5809133
55 56 57 58 59 60
-24.5234334 -14.5521734 -6.5809133 -1.5809133 3.4334567 6.4478266
> postscript(file="/var/www/html/rcomp/tmp/6r9ul1258732239.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 -7.6527632 NA
1 -5.6815031 -7.6527632
2 -29.2131922 -5.6815031
3 -30.3425219 -29.2131922
4 -26.3281520 -30.3425219
5 -4.1557123 -26.3281520
6 -1.0120125 -4.1557123
7 9.0454674 -1.0120125
8 14.1173172 9.0454674
9 19.1604272 14.1173172
10 23.2322770 19.1604272
11 22.3041269 23.2322770
12 26.3759768 22.3041269
13 26.3616068 26.3759768
14 5.8442877 26.3616068
15 -2.2706721 5.8442877
16 -3.2706721 -2.2706721
17 0.8730277 -3.2706721
18 5.0167274 0.8730277
19 16.0885773 5.0167274
20 26.1891671 16.0885773
21 27.2179071 26.1891671
22 29.3041269 27.2179071
23 29.3472368 29.3041269
24 34.3903467 29.3472368
25 32.3759768 34.3903467
26 14.9161376 32.3759768
27 8.8299178 14.9161376
28 4.8442877 8.8299178
29 2.0598373 4.8442877
30 3.2179071 2.0598373
31 9.3184969 3.2179071
32 10.3041269 9.3184969
33 10.3903467 10.3041269
34 5.4765666 10.3903467
35 5.5196765 5.4765666
36 4.6202663 5.5196765
37 -3.3509937 4.6202663
38 -9.7964629 -3.3509937
39 -12.8826828 -9.7964629
40 -22.7964629 -12.8826828
41 -19.6671331 -22.7964629
42 -18.5378034 -19.6671331
43 -12.5234334 -18.5378034
44 -9.5234334 -12.5234334
45 -11.4659535 -9.5234334
46 -13.3797337 -11.4659535
47 -12.3509937 -13.3797337
48 -15.2216639 -12.3509937
49 -13.2647739 -15.2216639
50 -19.6815031 -13.2647739
51 -23.7389830 -19.6815031
52 -32.6958731 -23.7389830
53 -28.5809133 -32.6958731
54 -24.5234334 -28.5809133
55 -14.5521734 -24.5234334
56 -6.5809133 -14.5521734
57 -1.5809133 -6.5809133
58 3.4334567 -1.5809133
59 6.4478266 3.4334567
60 NA 6.4478266
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -5.6815031 -7.6527632
[2,] -29.2131922 -5.6815031
[3,] -30.3425219 -29.2131922
[4,] -26.3281520 -30.3425219
[5,] -4.1557123 -26.3281520
[6,] -1.0120125 -4.1557123
[7,] 9.0454674 -1.0120125
[8,] 14.1173172 9.0454674
[9,] 19.1604272 14.1173172
[10,] 23.2322770 19.1604272
[11,] 22.3041269 23.2322770
[12,] 26.3759768 22.3041269
[13,] 26.3616068 26.3759768
[14,] 5.8442877 26.3616068
[15,] -2.2706721 5.8442877
[16,] -3.2706721 -2.2706721
[17,] 0.8730277 -3.2706721
[18,] 5.0167274 0.8730277
[19,] 16.0885773 5.0167274
[20,] 26.1891671 16.0885773
[21,] 27.2179071 26.1891671
[22,] 29.3041269 27.2179071
[23,] 29.3472368 29.3041269
[24,] 34.3903467 29.3472368
[25,] 32.3759768 34.3903467
[26,] 14.9161376 32.3759768
[27,] 8.8299178 14.9161376
[28,] 4.8442877 8.8299178
[29,] 2.0598373 4.8442877
[30,] 3.2179071 2.0598373
[31,] 9.3184969 3.2179071
[32,] 10.3041269 9.3184969
[33,] 10.3903467 10.3041269
[34,] 5.4765666 10.3903467
[35,] 5.5196765 5.4765666
[36,] 4.6202663 5.5196765
[37,] -3.3509937 4.6202663
[38,] -9.7964629 -3.3509937
[39,] -12.8826828 -9.7964629
[40,] -22.7964629 -12.8826828
[41,] -19.6671331 -22.7964629
[42,] -18.5378034 -19.6671331
[43,] -12.5234334 -18.5378034
[44,] -9.5234334 -12.5234334
[45,] -11.4659535 -9.5234334
[46,] -13.3797337 -11.4659535
[47,] -12.3509937 -13.3797337
[48,] -15.2216639 -12.3509937
[49,] -13.2647739 -15.2216639
[50,] -19.6815031 -13.2647739
[51,] -23.7389830 -19.6815031
[52,] -32.6958731 -23.7389830
[53,] -28.5809133 -32.6958731
[54,] -24.5234334 -28.5809133
[55,] -14.5521734 -24.5234334
[56,] -6.5809133 -14.5521734
[57,] -1.5809133 -6.5809133
[58,] 3.4334567 -1.5809133
[59,] 6.4478266 3.4334567
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -5.6815031 -7.6527632
2 -29.2131922 -5.6815031
3 -30.3425219 -29.2131922
4 -26.3281520 -30.3425219
5 -4.1557123 -26.3281520
6 -1.0120125 -4.1557123
7 9.0454674 -1.0120125
8 14.1173172 9.0454674
9 19.1604272 14.1173172
10 23.2322770 19.1604272
11 22.3041269 23.2322770
12 26.3759768 22.3041269
13 26.3616068 26.3759768
14 5.8442877 26.3616068
15 -2.2706721 5.8442877
16 -3.2706721 -2.2706721
17 0.8730277 -3.2706721
18 5.0167274 0.8730277
19 16.0885773 5.0167274
20 26.1891671 16.0885773
21 27.2179071 26.1891671
22 29.3041269 27.2179071
23 29.3472368 29.3041269
24 34.3903467 29.3472368
25 32.3759768 34.3903467
26 14.9161376 32.3759768
27 8.8299178 14.9161376
28 4.8442877 8.8299178
29 2.0598373 4.8442877
30 3.2179071 2.0598373
31 9.3184969 3.2179071
32 10.3041269 9.3184969
33 10.3903467 10.3041269
34 5.4765666 10.3903467
35 5.5196765 5.4765666
36 4.6202663 5.5196765
37 -3.3509937 4.6202663
38 -9.7964629 -3.3509937
39 -12.8826828 -9.7964629
40 -22.7964629 -12.8826828
41 -19.6671331 -22.7964629
42 -18.5378034 -19.6671331
43 -12.5234334 -18.5378034
44 -9.5234334 -12.5234334
45 -11.4659535 -9.5234334
46 -13.3797337 -11.4659535
47 -12.3509937 -13.3797337
48 -15.2216639 -12.3509937
49 -13.2647739 -15.2216639
50 -19.6815031 -13.2647739
51 -23.7389830 -19.6815031
52 -32.6958731 -23.7389830
53 -28.5809133 -32.6958731
54 -24.5234334 -28.5809133
55 -14.5521734 -24.5234334
56 -6.5809133 -14.5521734
57 -1.5809133 -6.5809133
58 3.4334567 -1.5809133
59 6.4478266 3.4334567
> 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/7om8k1258732239.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/8qttc1258732239.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/9y9pl1258732239.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/10mwww1258732239.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/11jc8z1258732239.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/12bh7q1258732239.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/13026x1258732239.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/14y89n1258732239.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/152vq31258732239.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/16q1y41258732239.tab")
+ }
>
> system("convert tmp/1cx7p1258732239.ps tmp/1cx7p1258732239.png")
> system("convert tmp/21giy1258732239.ps tmp/21giy1258732239.png")
> system("convert tmp/34oso1258732239.ps tmp/34oso1258732239.png")
> system("convert tmp/4kabc1258732239.ps tmp/4kabc1258732239.png")
> system("convert tmp/55dq11258732239.ps tmp/55dq11258732239.png")
> system("convert tmp/6r9ul1258732239.ps tmp/6r9ul1258732239.png")
> system("convert tmp/7om8k1258732239.ps tmp/7om8k1258732239.png")
> system("convert tmp/8qttc1258732239.ps tmp/8qttc1258732239.png")
> system("convert tmp/9y9pl1258732239.ps tmp/9y9pl1258732239.png")
> system("convert tmp/10mwww1258732239.ps tmp/10mwww1258732239.png")
>
>
> proc.time()
user system elapsed
2.502 1.573 2.918