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,9,669,223,44,9,1053,371,35,9,1939,873,119,9,678,186,30,9,321,111,23,10,2667,1277,46,10,345,102,39,10,1367,580,58,10,1158,420,51,11,1385,521,65,11,1155,358,40,9,1120,435,41,9,1703,690,76,9,1189,393,31,10,3083,1149,82,10,1357,486,36,10,1892,767,62,11,883,338,28,11,1627,485,38,11,1412,465,70,11,1900,816,76,9,777,265,33,9,904,307,40,9,2115,850,126,10,1858,704,56,10,1781,693,63,10,1286,387,46,10,1035,406,35,10,1557,573,108,11,1527,595,34,11,1220,394,54,11,1368,521,35,9,564,172,23,9,1990,835,46,9,1557,669,49,10,2057,749,56,10,1111,368,38,11,686,216,19,10,2011,772,29,10,2232,1084,26,9,1032,445,52,9,1166,451,54,9,1020,300,45,10,1735,836,56,10,3623,1417,596,10,918,330,57,10,1579,477,55,11,2790,1028,99,11,1496,646,51,10,1108,342,21,10,496,218,20,10,1750,591,58,10,744,255,21,10,1101,434,66,9,1612,654,47,9,1805,478,55,9,2460,753,158,9,1653,689,46,9,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 = 'No 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
1 1167 9 333 70
2 669 9 223 44
3 1053 9 371 35
4 1939 9 873 119
5 678 9 186 30
6 321 9 111 23
7 2667 10 1277 46
8 345 10 102 39
9 1367 10 580 58
10 1158 10 420 51
11 1385 11 521 65
12 1155 11 358 40
13 1120 9 435 41
14 1703 9 690 76
15 1189 9 393 31
16 3083 10 1149 82
17 1357 10 486 36
18 1892 10 767 62
19 883 11 338 28
20 1627 11 485 38
21 1412 11 465 70
22 1900 11 816 76
23 777 9 265 33
24 904 9 307 40
25 2115 9 850 126
26 1858 10 704 56
27 1781 10 693 63
28 1286 10 387 46
29 1035 10 406 35
30 1557 10 573 108
31 1527 11 595 34
32 1220 11 394 54
33 1368 11 521 35
34 564 9 172 23
35 1990 9 835 46
36 1557 9 669 49
37 2057 10 749 56
38 1111 10 368 38
39 686 11 216 19
40 2011 10 772 29
41 2232 10 1084 26
42 1032 9 445 52
43 1166 9 451 54
44 1020 9 300 45
45 1735 10 836 56
46 3623 10 1417 596
47 918 10 330 57
48 1579 10 477 55
49 2790 11 1028 99
50 1496 11 646 51
51 1108 10 342 21
52 496 10 218 20
53 1750 10 591 58
54 744 10 255 21
55 1101 10 434 66
56 1612 9 654 47
57 1805 9 478 55
58 2460 9 753 158
59 1653 9 689 46
60 1234 9 470 45
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Month TotalNrCC TotalNrPRV
49.245 22.186 2.056 1.001
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-310.57 -108.28 -26.76 87.56 518.49
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 49.24532 307.65188 0.160 0.8734
Month 22.18553 31.49220 0.704 0.4841
TotalNrCC 2.05552 0.09973 20.610 <2e-16 ***
TotalNrPRV 1.00099 0.37046 2.702 0.0091 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 179.1 on 56 degrees of freedom
Multiple R-squared: 0.9272, Adjusted R-squared: 0.9233
F-statistic: 237.7 on 3 and 56 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.5268351579 0.946329684 0.4731648
[2,] 0.4041926860 0.808385372 0.5958073
[3,] 0.2794618093 0.558923619 0.7205382
[4,] 0.2256409225 0.451281845 0.7743591
[5,] 0.1690730090 0.338146018 0.8309270
[6,] 0.1525453412 0.305090682 0.8474547
[7,] 0.0958112690 0.191622538 0.9041887
[8,] 0.0641681820 0.128336364 0.9358318
[9,] 0.0688819492 0.137763898 0.9311181
[10,] 0.4777490630 0.955498126 0.5222509
[11,] 0.3991065005 0.798213001 0.6008935
[12,] 0.3129499094 0.625899819 0.6870501
[13,] 0.2669007150 0.533801430 0.7330993
[14,] 0.4063361995 0.812672399 0.5936638
[15,] 0.3374453180 0.674890636 0.6625547
[16,] 0.3213552542 0.642710508 0.6786447
[17,] 0.2537453712 0.507490742 0.7462546
[18,] 0.1936648237 0.387329647 0.8063352
[19,] 0.1430901779 0.286180356 0.8569098
[20,] 0.1112951503 0.222590301 0.8887048
[21,] 0.0778052229 0.155610446 0.9221948
[22,] 0.0760798257 0.152159651 0.9239202
[23,] 0.0586795442 0.117359088 0.9413205
[24,] 0.0386150757 0.077230151 0.9613849
[25,] 0.0249116441 0.049823288 0.9750884
[26,] 0.0162376668 0.032475334 0.9837623
[27,] 0.0099163429 0.019832686 0.9900837
[28,] 0.0061610116 0.012322023 0.9938390
[29,] 0.0035489603 0.007097921 0.9964510
[30,] 0.0025492895 0.005098579 0.9974507
[31,] 0.0028642179 0.005728436 0.9971358
[32,] 0.0015874242 0.003174848 0.9984126
[33,] 0.0008891170 0.001778234 0.9991109
[34,] 0.0006392358 0.001278472 0.9993608
[35,] 0.0018691848 0.003738370 0.9981308
[36,] 0.0022182739 0.004436548 0.9977817
[37,] 0.0014842304 0.002968461 0.9985158
[38,] 0.0009055463 0.001811093 0.9990945
[39,] 0.0072467154 0.014493431 0.9927533
[40,] 0.0442947983 0.088589597 0.9557052
[41,] 0.0344197392 0.068839478 0.9655803
[42,] 0.0527969539 0.105593908 0.9472030
[43,] 0.0679788724 0.135957745 0.9320211
[44,] 0.0451037526 0.090207505 0.9548962
[45,] 0.0489928237 0.097985647 0.9510072
[46,] 0.0422754292 0.084550858 0.9577246
[47,] 0.1781568015 0.356313603 0.8218432
> postscript(file="/var/wessaorg/rcomp/tmp/1gcy51321959388.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/2fc1r1321959388.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/38rw31321959388.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/4fi4s1321959388.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/5thtv1321959388.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
163.52833381 -82.33902142 6.45328647 -223.49959719 16.72897457
6 7 8 9 10
-179.10028713 -275.04200344 -174.80198494 -154.35815607 -27.46842794
11 12 13 14 15
-44.27507556 85.79900906 -64.10576992 -40.29735813 101.23585729
16 17 18 19 20
368.02863227 50.88225183 -17.74389013 -133.07877113 298.75026128
21 22 23 24 25
92.82896045 -146.66362632 -49.65987741 -15.99853730 -7.22961780
26 27 28 29 30
83.75964873 22.36341780 173.36859600 -105.67535686 -0.01898867
31 32 33 34 35
-23.35271032 62.78653059 -31.24540239 -61.48685630 -21.31772644
36 37 38 39 40
-116.10478420 190.26136000 45.43134186 -70.29673083 124.01116272
41 42 43 44 45
-293.30733853 -183.67182536 -64.00690874 109.38513986 -310.56866489
46 47 48 49 50
-157.35846542 -88.47778510 272.36311657 284.54390842 -176.20091901
51 52 53 54 55
112.89161237 -243.22322512 206.03115113 -72.27836274 -128.26050991
56 57 58 59 60
-28.27004307 518.49312891 505.12393098 -58.21216743 -26.05283981
> postscript(file="/var/wessaorg/rcomp/tmp/6tp7p1321959388.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 163.52833381 NA
1 -82.33902142 163.52833381
2 6.45328647 -82.33902142
3 -223.49959719 6.45328647
4 16.72897457 -223.49959719
5 -179.10028713 16.72897457
6 -275.04200344 -179.10028713
7 -174.80198494 -275.04200344
8 -154.35815607 -174.80198494
9 -27.46842794 -154.35815607
10 -44.27507556 -27.46842794
11 85.79900906 -44.27507556
12 -64.10576992 85.79900906
13 -40.29735813 -64.10576992
14 101.23585729 -40.29735813
15 368.02863227 101.23585729
16 50.88225183 368.02863227
17 -17.74389013 50.88225183
18 -133.07877113 -17.74389013
19 298.75026128 -133.07877113
20 92.82896045 298.75026128
21 -146.66362632 92.82896045
22 -49.65987741 -146.66362632
23 -15.99853730 -49.65987741
24 -7.22961780 -15.99853730
25 83.75964873 -7.22961780
26 22.36341780 83.75964873
27 173.36859600 22.36341780
28 -105.67535686 173.36859600
29 -0.01898867 -105.67535686
30 -23.35271032 -0.01898867
31 62.78653059 -23.35271032
32 -31.24540239 62.78653059
33 -61.48685630 -31.24540239
34 -21.31772644 -61.48685630
35 -116.10478420 -21.31772644
36 190.26136000 -116.10478420
37 45.43134186 190.26136000
38 -70.29673083 45.43134186
39 124.01116272 -70.29673083
40 -293.30733853 124.01116272
41 -183.67182536 -293.30733853
42 -64.00690874 -183.67182536
43 109.38513986 -64.00690874
44 -310.56866489 109.38513986
45 -157.35846542 -310.56866489
46 -88.47778510 -157.35846542
47 272.36311657 -88.47778510
48 284.54390842 272.36311657
49 -176.20091901 284.54390842
50 112.89161237 -176.20091901
51 -243.22322512 112.89161237
52 206.03115113 -243.22322512
53 -72.27836274 206.03115113
54 -128.26050991 -72.27836274
55 -28.27004307 -128.26050991
56 518.49312891 -28.27004307
57 505.12393098 518.49312891
58 -58.21216743 505.12393098
59 -26.05283981 -58.21216743
60 NA -26.05283981
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -82.33902142 163.52833381
[2,] 6.45328647 -82.33902142
[3,] -223.49959719 6.45328647
[4,] 16.72897457 -223.49959719
[5,] -179.10028713 16.72897457
[6,] -275.04200344 -179.10028713
[7,] -174.80198494 -275.04200344
[8,] -154.35815607 -174.80198494
[9,] -27.46842794 -154.35815607
[10,] -44.27507556 -27.46842794
[11,] 85.79900906 -44.27507556
[12,] -64.10576992 85.79900906
[13,] -40.29735813 -64.10576992
[14,] 101.23585729 -40.29735813
[15,] 368.02863227 101.23585729
[16,] 50.88225183 368.02863227
[17,] -17.74389013 50.88225183
[18,] -133.07877113 -17.74389013
[19,] 298.75026128 -133.07877113
[20,] 92.82896045 298.75026128
[21,] -146.66362632 92.82896045
[22,] -49.65987741 -146.66362632
[23,] -15.99853730 -49.65987741
[24,] -7.22961780 -15.99853730
[25,] 83.75964873 -7.22961780
[26,] 22.36341780 83.75964873
[27,] 173.36859600 22.36341780
[28,] -105.67535686 173.36859600
[29,] -0.01898867 -105.67535686
[30,] -23.35271032 -0.01898867
[31,] 62.78653059 -23.35271032
[32,] -31.24540239 62.78653059
[33,] -61.48685630 -31.24540239
[34,] -21.31772644 -61.48685630
[35,] -116.10478420 -21.31772644
[36,] 190.26136000 -116.10478420
[37,] 45.43134186 190.26136000
[38,] -70.29673083 45.43134186
[39,] 124.01116272 -70.29673083
[40,] -293.30733853 124.01116272
[41,] -183.67182536 -293.30733853
[42,] -64.00690874 -183.67182536
[43,] 109.38513986 -64.00690874
[44,] -310.56866489 109.38513986
[45,] -157.35846542 -310.56866489
[46,] -88.47778510 -157.35846542
[47,] 272.36311657 -88.47778510
[48,] 284.54390842 272.36311657
[49,] -176.20091901 284.54390842
[50,] 112.89161237 -176.20091901
[51,] -243.22322512 112.89161237
[52,] 206.03115113 -243.22322512
[53,] -72.27836274 206.03115113
[54,] -128.26050991 -72.27836274
[55,] -28.27004307 -128.26050991
[56,] 518.49312891 -28.27004307
[57,] 505.12393098 518.49312891
[58,] -58.21216743 505.12393098
[59,] -26.05283981 -58.21216743
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -82.33902142 163.52833381
2 6.45328647 -82.33902142
3 -223.49959719 6.45328647
4 16.72897457 -223.49959719
5 -179.10028713 16.72897457
6 -275.04200344 -179.10028713
7 -174.80198494 -275.04200344
8 -154.35815607 -174.80198494
9 -27.46842794 -154.35815607
10 -44.27507556 -27.46842794
11 85.79900906 -44.27507556
12 -64.10576992 85.79900906
13 -40.29735813 -64.10576992
14 101.23585729 -40.29735813
15 368.02863227 101.23585729
16 50.88225183 368.02863227
17 -17.74389013 50.88225183
18 -133.07877113 -17.74389013
19 298.75026128 -133.07877113
20 92.82896045 298.75026128
21 -146.66362632 92.82896045
22 -49.65987741 -146.66362632
23 -15.99853730 -49.65987741
24 -7.22961780 -15.99853730
25 83.75964873 -7.22961780
26 22.36341780 83.75964873
27 173.36859600 22.36341780
28 -105.67535686 173.36859600
29 -0.01898867 -105.67535686
30 -23.35271032 -0.01898867
31 62.78653059 -23.35271032
32 -31.24540239 62.78653059
33 -61.48685630 -31.24540239
34 -21.31772644 -61.48685630
35 -116.10478420 -21.31772644
36 190.26136000 -116.10478420
37 45.43134186 190.26136000
38 -70.29673083 45.43134186
39 124.01116272 -70.29673083
40 -293.30733853 124.01116272
41 -183.67182536 -293.30733853
42 -64.00690874 -183.67182536
43 109.38513986 -64.00690874
44 -310.56866489 109.38513986
45 -157.35846542 -310.56866489
46 -88.47778510 -157.35846542
47 272.36311657 -88.47778510
48 284.54390842 272.36311657
49 -176.20091901 284.54390842
50 112.89161237 -176.20091901
51 -243.22322512 112.89161237
52 206.03115113 -243.22322512
53 -72.27836274 206.03115113
54 -128.26050991 -72.27836274
55 -28.27004307 -128.26050991
56 518.49312891 -28.27004307
57 505.12393098 518.49312891
58 -58.21216743 505.12393098
59 -26.05283981 -58.21216743
> 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/7yei31321959388.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/8ie2z1321959388.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/9q0561321959388.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/10c6xl1321959388.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/11yupe1321959388.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/12du661321959388.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/13b0251321959388.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/14q9uo1321959388.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/15ncs61321959388.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/16ru6i1321959388.tab")
+ }
>
> try(system("convert tmp/1gcy51321959388.ps tmp/1gcy51321959388.png",intern=TRUE))
character(0)
> try(system("convert tmp/2fc1r1321959388.ps tmp/2fc1r1321959388.png",intern=TRUE))
character(0)
> try(system("convert tmp/38rw31321959388.ps tmp/38rw31321959388.png",intern=TRUE))
character(0)
> try(system("convert tmp/4fi4s1321959388.ps tmp/4fi4s1321959388.png",intern=TRUE))
character(0)
> try(system("convert tmp/5thtv1321959388.ps tmp/5thtv1321959388.png",intern=TRUE))
character(0)
> try(system("convert tmp/6tp7p1321959388.ps tmp/6tp7p1321959388.png",intern=TRUE))
character(0)
> try(system("convert tmp/7yei31321959388.ps tmp/7yei31321959388.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ie2z1321959388.ps tmp/8ie2z1321959388.png",intern=TRUE))
character(0)
> try(system("convert tmp/9q0561321959388.ps tmp/9q0561321959388.png",intern=TRUE))
character(0)
> try(system("convert tmp/10c6xl1321959388.ps tmp/10c6xl1321959388.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.097 0.562 3.753