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(1
+ ,162556
+ ,1081
+ ,213118
+ ,6282929
+ ,1
+ ,29790
+ ,309
+ ,81767
+ ,4324047
+ ,1
+ ,87550
+ ,458
+ ,153198
+ ,4108272
+ ,0
+ ,84738
+ ,588
+ ,-26007
+ ,-1212617
+ ,1
+ ,54660
+ ,299
+ ,126942
+ ,1485329
+ ,1
+ ,42634
+ ,156
+ ,157214
+ ,1779876
+ ,0
+ ,40949
+ ,481
+ ,129352
+ ,1367203
+ ,1
+ ,42312
+ ,323
+ ,234817
+ ,2519076
+ ,1
+ ,37704
+ ,452
+ ,60448
+ ,912684
+ ,1
+ ,16275
+ ,109
+ ,47818
+ ,1443586
+ ,0
+ ,25830
+ ,115
+ ,245546
+ ,1220017
+ ,0
+ ,12679
+ ,110
+ ,48020
+ ,984885
+ ,1
+ ,18014
+ ,239
+ ,-1710
+ ,1457425
+ ,0
+ ,43556
+ ,247
+ ,32648
+ ,-572920
+ ,1
+ ,24524
+ ,497
+ ,95350
+ ,929144
+ ,0
+ ,6532
+ ,103
+ ,151352
+ ,1151176
+ ,0
+ ,7123
+ ,109
+ ,288170
+ ,790090
+ ,1
+ ,20813
+ ,502
+ ,114337
+ ,774497
+ ,1
+ ,37597
+ ,248
+ ,37884
+ ,990576
+ ,0
+ ,17821
+ ,373
+ ,122844
+ ,454195
+ ,1
+ ,12988
+ ,119
+ ,82340
+ ,876607
+ ,1
+ ,22330
+ ,84
+ ,79801
+ ,711969
+ ,0
+ ,13326
+ ,102
+ ,165548
+ ,702380
+ ,0
+ ,16189
+ ,295
+ ,116384
+ ,264449
+ ,0
+ ,7146
+ ,105
+ ,134028
+ ,450033
+ ,0
+ ,15824
+ ,64
+ ,63838
+ ,541063
+ ,1
+ ,26088
+ ,267
+ ,74996
+ ,588864
+ ,0
+ ,11326
+ ,129
+ ,31080
+ ,-37216
+ ,0
+ ,8568
+ ,37
+ ,32168
+ ,783310
+ ,0
+ ,14416
+ ,361
+ ,49857
+ ,467359
+ ,1
+ ,3369
+ ,28
+ ,87161
+ ,688779
+ ,1
+ ,11819
+ ,85
+ ,106113
+ ,608419
+ ,1
+ ,6620
+ ,44
+ ,80570
+ ,696348
+ ,1
+ ,4519
+ ,49
+ ,102129
+ ,597793
+ ,0
+ ,2220
+ ,22
+ ,301670
+ ,821730
+ ,0
+ ,18562
+ ,155
+ ,102313
+ ,377934
+ ,0
+ ,10327
+ ,91
+ ,88577
+ ,651939
+ ,1
+ ,5336
+ ,81
+ ,112477
+ ,697458
+ ,1
+ ,2365
+ ,79
+ ,191778
+ ,700368
+ ,0
+ ,4069
+ ,145
+ ,79804
+ ,225986
+ ,0
+ ,7710
+ ,816
+ ,128294
+ ,348695
+ ,0
+ ,13718
+ ,61
+ ,96448
+ ,373683
+ ,0
+ ,4525
+ ,226
+ ,93811
+ ,501709
+ ,0
+ ,6869
+ ,105
+ ,117520
+ ,413743
+ ,0
+ ,4628
+ ,62
+ ,69159
+ ,379825
+ ,1
+ ,3653
+ ,24
+ ,101792
+ ,336260
+ ,1
+ ,1265
+ ,26
+ ,210568
+ ,636765
+ ,1
+ ,7489
+ ,322
+ ,136996
+ ,481231
+ ,0
+ ,4901
+ ,84
+ ,121920
+ ,469107)
+ ,dim=c(5
+ ,49)
+ ,dimnames=list(c('Group'
+ ,'Costs'
+ ,'Trades'
+ ,'Dividends'
+ ,'Wealth')
+ ,1:49))
> y <- array(NA,dim=c(5,49),dimnames=list(c('Group','Costs','Trades','Dividends','Wealth'),1:49))
> 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 = '5'
> #'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
Wealth Group Costs Trades Dividends
1 6282929 1 162556 1081 213118
2 4324047 1 29790 309 81767
3 4108272 1 87550 458 153198
4 -1212617 0 84738 588 -26007
5 1485329 1 54660 299 126942
6 1779876 1 42634 156 157214
7 1367203 0 40949 481 129352
8 2519076 1 42312 323 234817
9 912684 1 37704 452 60448
10 1443586 1 16275 109 47818
11 1220017 0 25830 115 245546
12 984885 0 12679 110 48020
13 1457425 1 18014 239 -1710
14 -572920 0 43556 247 32648
15 929144 1 24524 497 95350
16 1151176 0 6532 103 151352
17 790090 0 7123 109 288170
18 774497 1 20813 502 114337
19 990576 1 37597 248 37884
20 454195 0 17821 373 122844
21 876607 1 12988 119 82340
22 711969 1 22330 84 79801
23 702380 0 13326 102 165548
24 264449 0 16189 295 116384
25 450033 0 7146 105 134028
26 541063 0 15824 64 63838
27 588864 1 26088 267 74996
28 -37216 0 11326 129 31080
29 783310 0 8568 37 32168
30 467359 0 14416 361 49857
31 688779 1 3369 28 87161
32 608419 1 11819 85 106113
33 696348 1 6620 44 80570
34 597793 1 4519 49 102129
35 821730 0 2220 22 301670
36 377934 0 18562 155 102313
37 651939 0 10327 91 88577
38 697458 1 5336 81 112477
39 700368 1 2365 79 191778
40 225986 0 4069 145 79804
41 348695 0 7710 816 128294
42 373683 0 13718 61 96448
43 501709 0 4525 226 93811
44 413743 0 6869 105 117520
45 379825 0 4628 62 69159
46 336260 1 3653 24 101792
47 636765 1 1265 26 210568
48 481231 1 7489 322 136996
49 469107 0 4901 84 121920
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Group Costs Trades Dividends
-5.041e+05 6.630e+05 2.456e+01 -4.160e+01 5.321e+00
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2626913 -401845 -34451 319484 3011265
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -5.041e+05 2.690e+05 -1.874 0.067552 .
Group 6.630e+05 2.331e+05 2.844 0.006727 **
Costs 2.456e+01 6.191e+00 3.968 0.000264 ***
Trades -4.160e+01 7.893e+02 -0.053 0.958209
Dividends 5.321e+00 1.690e+00 3.148 0.002950 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 792400 on 44 degrees of freedom
Multiple R-squared: 0.5913, Adjusted R-squared: 0.5541
F-statistic: 15.91 on 4 and 44 DF, p-value: 3.961e-08
> 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.9999978 4.468956e-06 2.234478e-06
[2,] 1.0000000 5.790611e-09 2.895306e-09
[3,] 1.0000000 4.332686e-09 2.166343e-09
[4,] 1.0000000 4.379646e-09 2.189823e-09
[5,] 1.0000000 2.953460e-10 1.476730e-10
[6,] 1.0000000 3.259222e-11 1.629611e-11
[7,] 1.0000000 5.761747e-14 2.880873e-14
[8,] 1.0000000 3.885838e-14 1.942919e-14
[9,] 1.0000000 1.164825e-15 5.824126e-16
[10,] 1.0000000 5.217141e-15 2.608570e-15
[11,] 1.0000000 1.531117e-14 7.655586e-15
[12,] 1.0000000 3.197868e-14 1.598934e-14
[13,] 1.0000000 2.187345e-13 1.093673e-13
[14,] 1.0000000 3.808060e-13 1.904030e-13
[15,] 1.0000000 1.705751e-12 8.528754e-13
[16,] 1.0000000 7.793137e-12 3.896569e-12
[17,] 1.0000000 2.976330e-11 1.488165e-11
[18,] 1.0000000 1.713255e-10 8.566277e-11
[19,] 1.0000000 7.371078e-10 3.685539e-10
[20,] 1.0000000 3.121482e-09 1.560741e-09
[21,] 1.0000000 7.181950e-10 3.590975e-10
[22,] 1.0000000 1.565632e-10 7.828159e-11
[23,] 1.0000000 7.064193e-10 3.532096e-10
[24,] 1.0000000 3.016974e-09 1.508487e-09
[25,] 1.0000000 1.971114e-08 9.855570e-09
[26,] 1.0000000 5.076245e-08 2.538122e-08
[27,] 0.9999999 2.872925e-07 1.436463e-07
[28,] 0.9999990 1.980284e-06 9.901418e-07
[29,] 0.9999947 1.068134e-05 5.340670e-06
[30,] 0.9999920 1.608762e-05 8.043809e-06
[31,] 0.9999938 1.237657e-05 6.188285e-06
[32,] 0.9999601 7.981190e-05 3.990595e-05
[33,] 0.9998951 2.097324e-04 1.048662e-04
[34,] 0.9998089 3.821103e-04 1.910551e-04
> postscript(file="/var/www/html/rcomp/tmp/1ncc51291402695.ps",horizontal=F,onefile=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/2g4t81291402695.ps",horizontal=F,onefile=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/3g4t81291402695.ps",horizontal=F,onefile=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/4g4t81291402695.ps",horizontal=F,onefile=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/5rvbt1291402695.ps",horizontal=F,onefile=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 = 49
Frequency = 1
1 2 3 4 5 6
1042417.703 3011264.829 1002930.921 -2626913.420 -679094.205 -256209.748
7 8 9 10 11 12
197250.801 84896.383 -475081.894 635081.216 -212122.978 926636.029
13 14 15 16 17 18
875169.333 -1302045.221 -318758.529 693752.276 -409649.743 -483086.778
19 20 21 22 23 24
-282977.513 -117568.749 -34451.406 -416484.521 2505.171 -236099.843
25 26 27 28 29 30
69798.181 319483.517 -598709.359 28699.418 907348.622 367112.647
31 32 33 34 35 36
-15465.134 -401845.028 -52006.122 -213472.176 -333042.949 -111845.753
37 38 39 40 41 42
434851.415 -187607.392 -533794.085 211531.906 14694.620 30176.788
43 44 45 46 47 48
404888.802 128155.675 404834.055 -452981.854 -672571.693 -577162.944
49
207568.732
> postscript(file="/var/www/html/rcomp/tmp/6rvbt1291402695.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 49
Frequency = 1
lag(myerror, k = 1) myerror
0 1042417.703 NA
1 3011264.829 1042417.703
2 1002930.921 3011264.829
3 -2626913.420 1002930.921
4 -679094.205 -2626913.420
5 -256209.748 -679094.205
6 197250.801 -256209.748
7 84896.383 197250.801
8 -475081.894 84896.383
9 635081.216 -475081.894
10 -212122.978 635081.216
11 926636.029 -212122.978
12 875169.333 926636.029
13 -1302045.221 875169.333
14 -318758.529 -1302045.221
15 693752.276 -318758.529
16 -409649.743 693752.276
17 -483086.778 -409649.743
18 -282977.513 -483086.778
19 -117568.749 -282977.513
20 -34451.406 -117568.749
21 -416484.521 -34451.406
22 2505.171 -416484.521
23 -236099.843 2505.171
24 69798.181 -236099.843
25 319483.517 69798.181
26 -598709.359 319483.517
27 28699.418 -598709.359
28 907348.622 28699.418
29 367112.647 907348.622
30 -15465.134 367112.647
31 -401845.028 -15465.134
32 -52006.122 -401845.028
33 -213472.176 -52006.122
34 -333042.949 -213472.176
35 -111845.753 -333042.949
36 434851.415 -111845.753
37 -187607.392 434851.415
38 -533794.085 -187607.392
39 211531.906 -533794.085
40 14694.620 211531.906
41 30176.788 14694.620
42 404888.802 30176.788
43 128155.675 404888.802
44 404834.055 128155.675
45 -452981.854 404834.055
46 -672571.693 -452981.854
47 -577162.944 -672571.693
48 207568.732 -577162.944
49 NA 207568.732
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3011264.829 1042417.703
[2,] 1002930.921 3011264.829
[3,] -2626913.420 1002930.921
[4,] -679094.205 -2626913.420
[5,] -256209.748 -679094.205
[6,] 197250.801 -256209.748
[7,] 84896.383 197250.801
[8,] -475081.894 84896.383
[9,] 635081.216 -475081.894
[10,] -212122.978 635081.216
[11,] 926636.029 -212122.978
[12,] 875169.333 926636.029
[13,] -1302045.221 875169.333
[14,] -318758.529 -1302045.221
[15,] 693752.276 -318758.529
[16,] -409649.743 693752.276
[17,] -483086.778 -409649.743
[18,] -282977.513 -483086.778
[19,] -117568.749 -282977.513
[20,] -34451.406 -117568.749
[21,] -416484.521 -34451.406
[22,] 2505.171 -416484.521
[23,] -236099.843 2505.171
[24,] 69798.181 -236099.843
[25,] 319483.517 69798.181
[26,] -598709.359 319483.517
[27,] 28699.418 -598709.359
[28,] 907348.622 28699.418
[29,] 367112.647 907348.622
[30,] -15465.134 367112.647
[31,] -401845.028 -15465.134
[32,] -52006.122 -401845.028
[33,] -213472.176 -52006.122
[34,] -333042.949 -213472.176
[35,] -111845.753 -333042.949
[36,] 434851.415 -111845.753
[37,] -187607.392 434851.415
[38,] -533794.085 -187607.392
[39,] 211531.906 -533794.085
[40,] 14694.620 211531.906
[41,] 30176.788 14694.620
[42,] 404888.802 30176.788
[43,] 128155.675 404888.802
[44,] 404834.055 128155.675
[45,] -452981.854 404834.055
[46,] -672571.693 -452981.854
[47,] -577162.944 -672571.693
[48,] 207568.732 -577162.944
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3011264.829 1042417.703
2 1002930.921 3011264.829
3 -2626913.420 1002930.921
4 -679094.205 -2626913.420
5 -256209.748 -679094.205
6 197250.801 -256209.748
7 84896.383 197250.801
8 -475081.894 84896.383
9 635081.216 -475081.894
10 -212122.978 635081.216
11 926636.029 -212122.978
12 875169.333 926636.029
13 -1302045.221 875169.333
14 -318758.529 -1302045.221
15 693752.276 -318758.529
16 -409649.743 693752.276
17 -483086.778 -409649.743
18 -282977.513 -483086.778
19 -117568.749 -282977.513
20 -34451.406 -117568.749
21 -416484.521 -34451.406
22 2505.171 -416484.521
23 -236099.843 2505.171
24 69798.181 -236099.843
25 319483.517 69798.181
26 -598709.359 319483.517
27 28699.418 -598709.359
28 907348.622 28699.418
29 367112.647 907348.622
30 -15465.134 367112.647
31 -401845.028 -15465.134
32 -52006.122 -401845.028
33 -213472.176 -52006.122
34 -333042.949 -213472.176
35 -111845.753 -333042.949
36 434851.415 -111845.753
37 -187607.392 434851.415
38 -533794.085 -187607.392
39 211531.906 -533794.085
40 14694.620 211531.906
41 30176.788 14694.620
42 404888.802 30176.788
43 128155.675 404888.802
44 404834.055 128155.675
45 -452981.854 404834.055
46 -672571.693 -452981.854
47 -577162.944 -672571.693
48 207568.732 -577162.944
> 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/714sw1291402695.ps",horizontal=F,onefile=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/814sw1291402695.ps",horizontal=F,onefile=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/9ud9h1291402695.ps",horizontal=F,onefile=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/10ud9h1291402695.ps",horizontal=F,onefile=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/11qn781291402695.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/12u6ow1291402695.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/13i7kp1291402695.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/14m71d1291402695.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/157q0j1291402695.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/1630xa1291402695.tab")
+ }
>
> try(system("convert tmp/1ncc51291402695.ps tmp/1ncc51291402695.png",intern=TRUE))
character(0)
> try(system("convert tmp/2g4t81291402695.ps tmp/2g4t81291402695.png",intern=TRUE))
character(0)
> try(system("convert tmp/3g4t81291402695.ps tmp/3g4t81291402695.png",intern=TRUE))
character(0)
> try(system("convert tmp/4g4t81291402695.ps tmp/4g4t81291402695.png",intern=TRUE))
character(0)
> try(system("convert tmp/5rvbt1291402695.ps tmp/5rvbt1291402695.png",intern=TRUE))
character(0)
> try(system("convert tmp/6rvbt1291402695.ps tmp/6rvbt1291402695.png",intern=TRUE))
character(0)
> try(system("convert tmp/714sw1291402695.ps tmp/714sw1291402695.png",intern=TRUE))
character(0)
> try(system("convert tmp/814sw1291402695.ps tmp/814sw1291402695.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ud9h1291402695.ps tmp/9ud9h1291402695.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ud9h1291402695.ps tmp/10ud9h1291402695.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.397 1.601 5.367