R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
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(9,1167,333,70,10,669,223,44,11,1053,371,35,10,1939,873,119,10,678,186,30,10,321,111,23,9,2667,1277,46,9,345,102,39,11,1367,580,58,11,1158,420,51,9,1385,521,65,9,1155,358,40,10,1120,435,41,10,1703,690,76,11,1189,393,31,11,3083,1149,82,9,1357,486,36,10,1892,767,62,10,883,338,28,10,1627,485,38,11,1412,465,70,9,1900,816,76,9,777,265,33,9,904,307,40,10,2115,850,126,10,1858,704,56,11,1781,693,63,11,1286,387,46,11,1035,406,35,9,1557,573,108,11,1527,595,34,11,1220,394,54,11,1368,521,35,10,564,172,23,10,1990,835,46,10,1557,669,49,10,2057,749,56,9,1111,368,38,11,686,216,19,9,2011,772,29,9,2232,1084,26,9,1032,445,52,10,1166,451,54,10,1020,300,45,10,1735,836,56,10,3623,1417,596,11,918,330,57,9,1579,477,55,10,2790,1028,99,9,1496,646,51,11,1108,342,21,11,496,218,20,9,1750,591,58,10,744,255,21,10,1101,434,66,11,1612,654,47,9,1805,478,55,10,2460,753,158,10,1653,689,46,11,1234,470,45),dim=c(4,60),dimnames=list(c('Month','TotalNrPV','TotalNrCC','TotalNrPRV'),1:60))
> y <- array(NA,dim=c(4,60),dimnames=list(c('Month','TotalNrPV','TotalNrCC','TotalNrPRV'),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 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '2'
> library(lattice)
> library(lmtest)
Loading required package: zoo
> 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
TotalNrPV Month TotalNrCC TotalNrPRV t
1 1167 9 333 70 1
2 669 10 223 44 2
3 1053 11 371 35 3
4 1939 10 873 119 4
5 678 10 186 30 5
6 321 10 111 23 6
7 2667 9 1277 46 7
8 345 9 102 39 8
9 1367 11 580 58 9
10 1158 11 420 51 10
11 1385 9 521 65 11
12 1155 9 358 40 12
13 1120 10 435 41 13
14 1703 10 690 76 14
15 1189 11 393 31 15
16 3083 11 1149 82 16
17 1357 9 486 36 17
18 1892 10 767 62 18
19 883 10 338 28 19
20 1627 10 485 38 20
21 1412 11 465 70 21
22 1900 9 816 76 22
23 777 9 265 33 23
24 904 9 307 40 24
25 2115 10 850 126 25
26 1858 10 704 56 26
27 1781 11 693 63 27
28 1286 11 387 46 28
29 1035 11 406 35 29
30 1557 9 573 108 30
31 1527 11 595 34 31
32 1220 11 394 54 32
33 1368 11 521 35 33
34 564 10 172 23 34
35 1990 10 835 46 35
36 1557 10 669 49 36
37 2057 10 749 56 37
38 1111 9 368 38 38
39 686 11 216 19 39
40 2011 9 772 29 40
41 2232 9 1084 26 41
42 1032 9 445 52 42
43 1166 10 451 54 43
44 1020 10 300 45 44
45 1735 10 836 56 45
46 3623 10 1417 596 46
47 918 11 330 57 47
48 1579 9 477 55 48
49 2790 10 1028 99 49
50 1496 9 646 51 50
51 1108 11 342 21 51
52 496 11 218 20 52
53 1750 9 591 58 53
54 744 10 255 21 54
55 1101 10 434 66 55
56 1612 11 654 47 56
57 1805 9 478 55 57
58 2460 10 753 158 58
59 1653 10 689 46 59
60 1234 11 470 45 60
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Month TotalNrCC TotalNrPRV t
213.6698 0.3978 2.0558 0.9550 1.7073
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-331.57 -110.87 -18.30 88.14 455.26
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 213.66983 309.41240 0.691 0.4927
Month 0.39781 30.02929 0.013 0.9895
TotalNrCC 2.05576 0.09948 20.665 <2e-16 ***
TotalNrPRV 0.95497 0.36965 2.583 0.0125 *
t 1.70732 1.34873 1.266 0.2109
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 178.9 on 55 degrees of freedom
Multiple R-squared: 0.9286, Adjusted R-squared: 0.9234
F-statistic: 178.9 on 4 and 55 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.238263640 0.47652728 0.7617364
[2,] 0.243756660 0.48751332 0.7562433
[3,] 0.252188223 0.50437645 0.7478118
[4,] 0.232597001 0.46519400 0.7674030
[5,] 0.246618174 0.49323635 0.7533818
[6,] 0.161614355 0.32322871 0.8383856
[7,] 0.102895154 0.20579031 0.8971048
[8,] 0.085150112 0.17030022 0.9148499
[9,] 0.391092811 0.78218562 0.6089072
[10,] 0.301412067 0.60282413 0.6985879
[11,] 0.237436544 0.47487309 0.7625635
[12,] 0.218974499 0.43794900 0.7810255
[13,] 0.319995413 0.63999083 0.6800046
[14,] 0.266536586 0.53307317 0.7334634
[15,] 0.259118957 0.51823791 0.7408810
[16,] 0.214300244 0.42860049 0.7856998
[17,] 0.163178033 0.32635607 0.8368220
[18,] 0.124323597 0.24864719 0.8756764
[19,] 0.090611643 0.18122329 0.9093884
[20,] 0.069058216 0.13811643 0.9309418
[21,] 0.061815451 0.12363090 0.9381845
[22,] 0.064097399 0.12819480 0.9359026
[23,] 0.042178629 0.08435726 0.9578214
[24,] 0.031199807 0.06239961 0.9688002
[25,] 0.025163963 0.05032793 0.9748360
[26,] 0.019996723 0.03999345 0.9800033
[27,] 0.013990457 0.02798091 0.9860095
[28,] 0.009054660 0.01810932 0.9909453
[29,] 0.006743727 0.01348745 0.9932563
[30,] 0.012081674 0.02416335 0.9879183
[31,] 0.007361790 0.01472358 0.9926382
[32,] 0.006497426 0.01299485 0.9935026
[33,] 0.006643144 0.01328629 0.9933569
[34,] 0.010166740 0.02033348 0.9898333
[35,] 0.011851775 0.02370355 0.9881482
[36,] 0.007088094 0.01417619 0.9929119
[37,] 0.005450560 0.01090112 0.9945494
[38,] 0.014547684 0.02909537 0.9854523
[39,] 0.075809182 0.15161836 0.9241908
[40,] 0.052279519 0.10455904 0.9477205
[41,] 0.056333728 0.11266746 0.9436663
[42,] 0.071713281 0.14342656 0.9282867
[43,] 0.106045105 0.21209021 0.8939549
[44,] 0.245326290 0.49065258 0.7546737
[45,] 0.174674487 0.34934897 0.8253255
> postscript(file="/var/wessaorg/rcomp/tmp/1abqh1321899465.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/wessaorg/rcomp/tmp/23gtz1321899465.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/wessaorg/rcomp/tmp/3o3301321899465.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/wessaorg/rcomp/tmp/4zrsn1321899465.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/wessaorg/rcomp/tmp/51x211321899465.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 = 60
Frequency = 1
1 2 3 4 5 6
196.6261751 -52.5159829 33.7209930 -193.7981654 40.7948064 -157.0456376
7 8 9 10 11 12
-231.3368924 -132.8401682 -114.1413446 10.7579016 15.8447252 143.1007379
13 14 15 16 17 18
-53.2529636 -29.6033523 107.8262628 397.2600414 77.2465938 7.6433534
19 20 21 22 23 24
-88.6734498 341.8726385 135.3236499 -104.8900216 -55.8092337 -23.5433200
25 26 27 28 29 30
-13.0542361 95.2275466 32.0509908 180.6410650 -100.6210336 7.4422537
31 32 33 34 35 36
0.3804516 85.7816766 -10.8628464 -87.2520972 -47.8933436 -144.2092439
37 38 39 40 41 42
182.9377494 36.0626804 -60.8201179 110.7153077 -308.5245525 -221.4298101
43 44 45 46 47 48
-103.7794476 67.5278917 -331.5720443 -155.3610412 -113.1243694 246.6769860
49 50 51 52 53 54
280.8287756 -183.3413937 79.7561736 -278.0818061 171.9186977 -110.1167762
55 56 57 58 59 60
-165.7790371 -91.0071446 455.2553209 444.4538574 -125.7279727 -95.6664574
> postscript(file="/var/wessaorg/rcomp/tmp/69jho1321899465.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 196.6261751 NA
1 -52.5159829 196.6261751
2 33.7209930 -52.5159829
3 -193.7981654 33.7209930
4 40.7948064 -193.7981654
5 -157.0456376 40.7948064
6 -231.3368924 -157.0456376
7 -132.8401682 -231.3368924
8 -114.1413446 -132.8401682
9 10.7579016 -114.1413446
10 15.8447252 10.7579016
11 143.1007379 15.8447252
12 -53.2529636 143.1007379
13 -29.6033523 -53.2529636
14 107.8262628 -29.6033523
15 397.2600414 107.8262628
16 77.2465938 397.2600414
17 7.6433534 77.2465938
18 -88.6734498 7.6433534
19 341.8726385 -88.6734498
20 135.3236499 341.8726385
21 -104.8900216 135.3236499
22 -55.8092337 -104.8900216
23 -23.5433200 -55.8092337
24 -13.0542361 -23.5433200
25 95.2275466 -13.0542361
26 32.0509908 95.2275466
27 180.6410650 32.0509908
28 -100.6210336 180.6410650
29 7.4422537 -100.6210336
30 0.3804516 7.4422537
31 85.7816766 0.3804516
32 -10.8628464 85.7816766
33 -87.2520972 -10.8628464
34 -47.8933436 -87.2520972
35 -144.2092439 -47.8933436
36 182.9377494 -144.2092439
37 36.0626804 182.9377494
38 -60.8201179 36.0626804
39 110.7153077 -60.8201179
40 -308.5245525 110.7153077
41 -221.4298101 -308.5245525
42 -103.7794476 -221.4298101
43 67.5278917 -103.7794476
44 -331.5720443 67.5278917
45 -155.3610412 -331.5720443
46 -113.1243694 -155.3610412
47 246.6769860 -113.1243694
48 280.8287756 246.6769860
49 -183.3413937 280.8287756
50 79.7561736 -183.3413937
51 -278.0818061 79.7561736
52 171.9186977 -278.0818061
53 -110.1167762 171.9186977
54 -165.7790371 -110.1167762
55 -91.0071446 -165.7790371
56 455.2553209 -91.0071446
57 444.4538574 455.2553209
58 -125.7279727 444.4538574
59 -95.6664574 -125.7279727
60 NA -95.6664574
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -52.5159829 196.6261751
[2,] 33.7209930 -52.5159829
[3,] -193.7981654 33.7209930
[4,] 40.7948064 -193.7981654
[5,] -157.0456376 40.7948064
[6,] -231.3368924 -157.0456376
[7,] -132.8401682 -231.3368924
[8,] -114.1413446 -132.8401682
[9,] 10.7579016 -114.1413446
[10,] 15.8447252 10.7579016
[11,] 143.1007379 15.8447252
[12,] -53.2529636 143.1007379
[13,] -29.6033523 -53.2529636
[14,] 107.8262628 -29.6033523
[15,] 397.2600414 107.8262628
[16,] 77.2465938 397.2600414
[17,] 7.6433534 77.2465938
[18,] -88.6734498 7.6433534
[19,] 341.8726385 -88.6734498
[20,] 135.3236499 341.8726385
[21,] -104.8900216 135.3236499
[22,] -55.8092337 -104.8900216
[23,] -23.5433200 -55.8092337
[24,] -13.0542361 -23.5433200
[25,] 95.2275466 -13.0542361
[26,] 32.0509908 95.2275466
[27,] 180.6410650 32.0509908
[28,] -100.6210336 180.6410650
[29,] 7.4422537 -100.6210336
[30,] 0.3804516 7.4422537
[31,] 85.7816766 0.3804516
[32,] -10.8628464 85.7816766
[33,] -87.2520972 -10.8628464
[34,] -47.8933436 -87.2520972
[35,] -144.2092439 -47.8933436
[36,] 182.9377494 -144.2092439
[37,] 36.0626804 182.9377494
[38,] -60.8201179 36.0626804
[39,] 110.7153077 -60.8201179
[40,] -308.5245525 110.7153077
[41,] -221.4298101 -308.5245525
[42,] -103.7794476 -221.4298101
[43,] 67.5278917 -103.7794476
[44,] -331.5720443 67.5278917
[45,] -155.3610412 -331.5720443
[46,] -113.1243694 -155.3610412
[47,] 246.6769860 -113.1243694
[48,] 280.8287756 246.6769860
[49,] -183.3413937 280.8287756
[50,] 79.7561736 -183.3413937
[51,] -278.0818061 79.7561736
[52,] 171.9186977 -278.0818061
[53,] -110.1167762 171.9186977
[54,] -165.7790371 -110.1167762
[55,] -91.0071446 -165.7790371
[56,] 455.2553209 -91.0071446
[57,] 444.4538574 455.2553209
[58,] -125.7279727 444.4538574
[59,] -95.6664574 -125.7279727
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -52.5159829 196.6261751
2 33.7209930 -52.5159829
3 -193.7981654 33.7209930
4 40.7948064 -193.7981654
5 -157.0456376 40.7948064
6 -231.3368924 -157.0456376
7 -132.8401682 -231.3368924
8 -114.1413446 -132.8401682
9 10.7579016 -114.1413446
10 15.8447252 10.7579016
11 143.1007379 15.8447252
12 -53.2529636 143.1007379
13 -29.6033523 -53.2529636
14 107.8262628 -29.6033523
15 397.2600414 107.8262628
16 77.2465938 397.2600414
17 7.6433534 77.2465938
18 -88.6734498 7.6433534
19 341.8726385 -88.6734498
20 135.3236499 341.8726385
21 -104.8900216 135.3236499
22 -55.8092337 -104.8900216
23 -23.5433200 -55.8092337
24 -13.0542361 -23.5433200
25 95.2275466 -13.0542361
26 32.0509908 95.2275466
27 180.6410650 32.0509908
28 -100.6210336 180.6410650
29 7.4422537 -100.6210336
30 0.3804516 7.4422537
31 85.7816766 0.3804516
32 -10.8628464 85.7816766
33 -87.2520972 -10.8628464
34 -47.8933436 -87.2520972
35 -144.2092439 -47.8933436
36 182.9377494 -144.2092439
37 36.0626804 182.9377494
38 -60.8201179 36.0626804
39 110.7153077 -60.8201179
40 -308.5245525 110.7153077
41 -221.4298101 -308.5245525
42 -103.7794476 -221.4298101
43 67.5278917 -103.7794476
44 -331.5720443 67.5278917
45 -155.3610412 -331.5720443
46 -113.1243694 -155.3610412
47 246.6769860 -113.1243694
48 280.8287756 246.6769860
49 -183.3413937 280.8287756
50 79.7561736 -183.3413937
51 -278.0818061 79.7561736
52 171.9186977 -278.0818061
53 -110.1167762 171.9186977
54 -165.7790371 -110.1167762
55 -91.0071446 -165.7790371
56 455.2553209 -91.0071446
57 444.4538574 455.2553209
58 -125.7279727 444.4538574
59 -95.6664574 -125.7279727
> 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/wessaorg/rcomp/tmp/78w1x1321899465.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/wessaorg/rcomp/tmp/89nnk1321899465.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/wessaorg/rcomp/tmp/9ze231321899465.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/wessaorg/rcomp/tmp/10vv3j1321899465.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11z6jz1321899465.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/wessaorg/rcomp/tmp/12ycmz1321899465.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/wessaorg/rcomp/tmp/139p1j1321899466.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/wessaorg/rcomp/tmp/149i7h1321899466.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/wessaorg/rcomp/tmp/15f8fo1321899466.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/wessaorg/rcomp/tmp/16w38v1321899466.tab")
+ }
>
> try(system("convert tmp/1abqh1321899465.ps tmp/1abqh1321899465.png",intern=TRUE))
character(0)
> try(system("convert tmp/23gtz1321899465.ps tmp/23gtz1321899465.png",intern=TRUE))
character(0)
> try(system("convert tmp/3o3301321899465.ps tmp/3o3301321899465.png",intern=TRUE))
character(0)
> try(system("convert tmp/4zrsn1321899465.ps tmp/4zrsn1321899465.png",intern=TRUE))
character(0)
> try(system("convert tmp/51x211321899465.ps tmp/51x211321899465.png",intern=TRUE))
character(0)
> try(system("convert tmp/69jho1321899465.ps tmp/69jho1321899465.png",intern=TRUE))
character(0)
> try(system("convert tmp/78w1x1321899465.ps tmp/78w1x1321899465.png",intern=TRUE))
character(0)
> try(system("convert tmp/89nnk1321899465.ps tmp/89nnk1321899465.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ze231321899465.ps tmp/9ze231321899465.png",intern=TRUE))
character(0)
> try(system("convert tmp/10vv3j1321899465.ps tmp/10vv3j1321899465.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.148 0.520 3.691