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(10144,112,10751,304,11752,794,13808,901,16203,1232,17432,1240,18014,1032,16956,1145,17982,1588,19435,2264,19990,2209,20154,2917,10327,243,9807,558,10862,1238,13743,1502,16458,2000,18466,2146,18810,2066,17361,2046,17411,1952,18517,2771,18525,3278,17859,4000,9499,410,9490,1107,9255,1622,10758,1986,12375,2036,14617,2400,15427,2736,14136,2901,14308,2883,15293,3747,15679,4075,16319,4996,11196,575,11169,999,12158,1411,14251,1493,16237,1846,19706,2899,18960,2372,18537,2856,19103,3468,19691,4193,19464,4440,17264,4186,8957,655,9703,1453,9166,1989,9519,2209,10535,2667,11526,3005,9630,2195,7061,2236,6021,2489,4728,2651,2657,2636,1264,2819),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 10144 112
2 10751 304
3 11752 794
4 13808 901
5 16203 1232
6 17432 1240
7 18014 1032
8 16956 1145
9 17982 1588
10 19435 2264
11 19990 2209
12 20154 2917
13 10327 243
14 9807 558
15 10862 1238
16 13743 1502
17 16458 2000
18 18466 2146
19 18810 2066
20 17361 2046
21 17411 1952
22 18517 2771
23 18525 3278
24 17859 4000
25 9499 410
26 9490 1107
27 9255 1622
28 10758 1986
29 12375 2036
30 14617 2400
31 15427 2736
32 14136 2901
33 14308 2883
34 15293 3747
35 15679 4075
36 16319 4996
37 11196 575
38 11169 999
39 12158 1411
40 14251 1493
41 16237 1846
42 19706 2899
43 18960 2372
44 18537 2856
45 19103 3468
46 19691 4193
47 19464 4440
48 17264 4186
49 8957 655
50 9703 1453
51 9166 1989
52 9519 2209
53 10535 2667
54 11526 3005
55 9630 2195
56 7061 2236
57 6021 2489
58 4728 2651
59 2657 2636
60 1264 2819
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
10746.145 1.417
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-13477.3 -2050.5 -242.2 3711.9 6113.2
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.075e+04 1.219e+03 8.814 2.69e-12 ***
X 1.417e+00 5.058e-01 2.802 0.0069 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4374 on 58 degrees of freedom
Multiple R-squared: 0.1192, Adjusted R-squared: 0.104
F-statistic: 7.85 on 1 and 58 DF, p-value: 0.006896
> 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.0134212684 0.0268425368 0.98657873
[2,] 0.0079944596 0.0159889193 0.99200554
[3,] 0.0148401487 0.0296802974 0.98515985
[4,] 0.0052972107 0.0105944215 0.99470279
[5,] 0.0022913218 0.0045826436 0.99770868
[6,] 0.0027331076 0.0054662152 0.99726689
[7,] 0.0012165453 0.0024330906 0.99878345
[8,] 0.0018502089 0.0037004179 0.99814979
[9,] 0.0009169526 0.0018339052 0.99908305
[10,] 0.0010721184 0.0021442369 0.99892788
[11,] 0.0032587687 0.0065175374 0.99674123
[12,] 0.0024468684 0.0048937368 0.99755313
[13,] 0.0015042627 0.0030085254 0.99849574
[14,] 0.0008533435 0.0017066871 0.99914666
[15,] 0.0005420014 0.0010840028 0.99945800
[16,] 0.0003192114 0.0006384228 0.99968079
[17,] 0.0001895540 0.0003791080 0.99981045
[18,] 0.0001826599 0.0003653198 0.99981734
[19,] 0.0003092918 0.0006185837 0.99969071
[20,] 0.0011541541 0.0023083082 0.99884585
[21,] 0.0009751296 0.0019502592 0.99902487
[22,] 0.0016279692 0.0032559384 0.99837203
[23,] 0.0047519978 0.0095039956 0.99524800
[24,] 0.0077075936 0.0154151871 0.99229241
[25,] 0.0070441533 0.0140883065 0.99295585
[26,] 0.0051557586 0.0103115172 0.99484424
[27,] 0.0037420534 0.0074841067 0.99625795
[28,] 0.0033132931 0.0066265861 0.99668671
[29,] 0.0025983287 0.0051966574 0.99740167
[30,] 0.0022154781 0.0044309562 0.99778452
[31,] 0.0017217044 0.0034434088 0.99827830
[32,] 0.0013943310 0.0027886621 0.99860567
[33,] 0.0009138378 0.0018276756 0.99908616
[34,] 0.0006035677 0.0012071355 0.99939643
[35,] 0.0003878603 0.0007757205 0.99961214
[36,] 0.0003210510 0.0006421021 0.99967895
[37,] 0.0004266295 0.0008532590 0.99957337
[38,] 0.0008357424 0.0016714847 0.99916426
[39,] 0.0031230551 0.0062461103 0.99687694
[40,] 0.0062793663 0.0125587326 0.99372063
[41,] 0.0095102326 0.0190204652 0.99048977
[42,] 0.0120223062 0.0240446125 0.98797769
[43,] 0.0260269081 0.0520538161 0.97397309
[44,] 0.2128093326 0.4256186651 0.78719067
[45,] 0.1842474398 0.3684948797 0.81575256
[46,] 0.1457037920 0.2914075839 0.85429621
[47,] 0.1254257688 0.2508515376 0.87457423
[48,] 0.1145343029 0.2290686059 0.88546570
[49,] 0.1512303007 0.3024606014 0.84876970
[50,] 0.9669154852 0.0661690296 0.03308451
[51,] 0.9394723351 0.1210553297 0.06052766
> postscript(file="/var/www/html/rcomp/tmp/1e6te1258720412.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/2qaow1258720412.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/3yoz41258720412.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/4gyg91258720412.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/58w5v1258720412.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
-760.8735 -425.9789 -119.4145 1784.9434 3710.8450 4928.5073
7 8 9 10 11 12
5805.2882 4587.1428 4985.3163 5480.2785 6113.2254 5273.8367
13 14 15 16 17 18
-763.5287 -1729.9516 -1638.6582 868.1968 2877.4234 4678.5100
19 20 21 22 23 24
5135.8872 3715.2315 3898.4498 3843.7502 3133.2219 1443.9922
25 26 27 28 29 30
-1828.2037 -2825.0030 -3789.8690 -2802.7355 -1256.5963 469.5372
31 32 33 34 35 36
803.3527 -721.4878 -523.9780 -763.4523 -842.2990 -1507.5546
37 38 39 40 41 42
-365.0443 -992.9437 -587.8366 1388.9518 2874.6747 4851.3466
43 44 45 46 47 48
4852.2192 3743.2869 3441.9509 3002.4696 2425.4173 585.3901
49 50 51 52 53 54
-2717.4215 -3102.3596 -4398.9872 -4357.7746 -3990.8594 -3478.8783
55 56 57 58 59 60
-4226.9336 -6854.0394 -8252.5950 -9775.1839 -11824.9257 -13477.2762
> postscript(file="/var/www/html/rcomp/tmp/6w2ai1258720412.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 -760.8735 NA
1 -425.9789 -760.8735
2 -119.4145 -425.9789
3 1784.9434 -119.4145
4 3710.8450 1784.9434
5 4928.5073 3710.8450
6 5805.2882 4928.5073
7 4587.1428 5805.2882
8 4985.3163 4587.1428
9 5480.2785 4985.3163
10 6113.2254 5480.2785
11 5273.8367 6113.2254
12 -763.5287 5273.8367
13 -1729.9516 -763.5287
14 -1638.6582 -1729.9516
15 868.1968 -1638.6582
16 2877.4234 868.1968
17 4678.5100 2877.4234
18 5135.8872 4678.5100
19 3715.2315 5135.8872
20 3898.4498 3715.2315
21 3843.7502 3898.4498
22 3133.2219 3843.7502
23 1443.9922 3133.2219
24 -1828.2037 1443.9922
25 -2825.0030 -1828.2037
26 -3789.8690 -2825.0030
27 -2802.7355 -3789.8690
28 -1256.5963 -2802.7355
29 469.5372 -1256.5963
30 803.3527 469.5372
31 -721.4878 803.3527
32 -523.9780 -721.4878
33 -763.4523 -523.9780
34 -842.2990 -763.4523
35 -1507.5546 -842.2990
36 -365.0443 -1507.5546
37 -992.9437 -365.0443
38 -587.8366 -992.9437
39 1388.9518 -587.8366
40 2874.6747 1388.9518
41 4851.3466 2874.6747
42 4852.2192 4851.3466
43 3743.2869 4852.2192
44 3441.9509 3743.2869
45 3002.4696 3441.9509
46 2425.4173 3002.4696
47 585.3901 2425.4173
48 -2717.4215 585.3901
49 -3102.3596 -2717.4215
50 -4398.9872 -3102.3596
51 -4357.7746 -4398.9872
52 -3990.8594 -4357.7746
53 -3478.8783 -3990.8594
54 -4226.9336 -3478.8783
55 -6854.0394 -4226.9336
56 -8252.5950 -6854.0394
57 -9775.1839 -8252.5950
58 -11824.9257 -9775.1839
59 -13477.2762 -11824.9257
60 NA -13477.2762
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -425.9789 -760.8735
[2,] -119.4145 -425.9789
[3,] 1784.9434 -119.4145
[4,] 3710.8450 1784.9434
[5,] 4928.5073 3710.8450
[6,] 5805.2882 4928.5073
[7,] 4587.1428 5805.2882
[8,] 4985.3163 4587.1428
[9,] 5480.2785 4985.3163
[10,] 6113.2254 5480.2785
[11,] 5273.8367 6113.2254
[12,] -763.5287 5273.8367
[13,] -1729.9516 -763.5287
[14,] -1638.6582 -1729.9516
[15,] 868.1968 -1638.6582
[16,] 2877.4234 868.1968
[17,] 4678.5100 2877.4234
[18,] 5135.8872 4678.5100
[19,] 3715.2315 5135.8872
[20,] 3898.4498 3715.2315
[21,] 3843.7502 3898.4498
[22,] 3133.2219 3843.7502
[23,] 1443.9922 3133.2219
[24,] -1828.2037 1443.9922
[25,] -2825.0030 -1828.2037
[26,] -3789.8690 -2825.0030
[27,] -2802.7355 -3789.8690
[28,] -1256.5963 -2802.7355
[29,] 469.5372 -1256.5963
[30,] 803.3527 469.5372
[31,] -721.4878 803.3527
[32,] -523.9780 -721.4878
[33,] -763.4523 -523.9780
[34,] -842.2990 -763.4523
[35,] -1507.5546 -842.2990
[36,] -365.0443 -1507.5546
[37,] -992.9437 -365.0443
[38,] -587.8366 -992.9437
[39,] 1388.9518 -587.8366
[40,] 2874.6747 1388.9518
[41,] 4851.3466 2874.6747
[42,] 4852.2192 4851.3466
[43,] 3743.2869 4852.2192
[44,] 3441.9509 3743.2869
[45,] 3002.4696 3441.9509
[46,] 2425.4173 3002.4696
[47,] 585.3901 2425.4173
[48,] -2717.4215 585.3901
[49,] -3102.3596 -2717.4215
[50,] -4398.9872 -3102.3596
[51,] -4357.7746 -4398.9872
[52,] -3990.8594 -4357.7746
[53,] -3478.8783 -3990.8594
[54,] -4226.9336 -3478.8783
[55,] -6854.0394 -4226.9336
[56,] -8252.5950 -6854.0394
[57,] -9775.1839 -8252.5950
[58,] -11824.9257 -9775.1839
[59,] -13477.2762 -11824.9257
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -425.9789 -760.8735
2 -119.4145 -425.9789
3 1784.9434 -119.4145
4 3710.8450 1784.9434
5 4928.5073 3710.8450
6 5805.2882 4928.5073
7 4587.1428 5805.2882
8 4985.3163 4587.1428
9 5480.2785 4985.3163
10 6113.2254 5480.2785
11 5273.8367 6113.2254
12 -763.5287 5273.8367
13 -1729.9516 -763.5287
14 -1638.6582 -1729.9516
15 868.1968 -1638.6582
16 2877.4234 868.1968
17 4678.5100 2877.4234
18 5135.8872 4678.5100
19 3715.2315 5135.8872
20 3898.4498 3715.2315
21 3843.7502 3898.4498
22 3133.2219 3843.7502
23 1443.9922 3133.2219
24 -1828.2037 1443.9922
25 -2825.0030 -1828.2037
26 -3789.8690 -2825.0030
27 -2802.7355 -3789.8690
28 -1256.5963 -2802.7355
29 469.5372 -1256.5963
30 803.3527 469.5372
31 -721.4878 803.3527
32 -523.9780 -721.4878
33 -763.4523 -523.9780
34 -842.2990 -763.4523
35 -1507.5546 -842.2990
36 -365.0443 -1507.5546
37 -992.9437 -365.0443
38 -587.8366 -992.9437
39 1388.9518 -587.8366
40 2874.6747 1388.9518
41 4851.3466 2874.6747
42 4852.2192 4851.3466
43 3743.2869 4852.2192
44 3441.9509 3743.2869
45 3002.4696 3441.9509
46 2425.4173 3002.4696
47 585.3901 2425.4173
48 -2717.4215 585.3901
49 -3102.3596 -2717.4215
50 -4398.9872 -3102.3596
51 -4357.7746 -4398.9872
52 -3990.8594 -4357.7746
53 -3478.8783 -3990.8594
54 -4226.9336 -3478.8783
55 -6854.0394 -4226.9336
56 -8252.5950 -6854.0394
57 -9775.1839 -8252.5950
58 -11824.9257 -9775.1839
59 -13477.2762 -11824.9257
> 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/7kjbs1258720412.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/8ffvo1258720412.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/9ua611258720412.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/107vwv1258720412.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/11xq621258720412.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/12fhgr1258720412.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/13akh01258720412.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/14yd9b1258720413.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/15wnva1258720413.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/16jts21258720413.tab")
+ }
>
> system("convert tmp/1e6te1258720412.ps tmp/1e6te1258720412.png")
> system("convert tmp/2qaow1258720412.ps tmp/2qaow1258720412.png")
> system("convert tmp/3yoz41258720412.ps tmp/3yoz41258720412.png")
> system("convert tmp/4gyg91258720412.ps tmp/4gyg91258720412.png")
> system("convert tmp/58w5v1258720412.ps tmp/58w5v1258720412.png")
> system("convert tmp/6w2ai1258720412.ps tmp/6w2ai1258720412.png")
> system("convert tmp/7kjbs1258720412.ps tmp/7kjbs1258720412.png")
> system("convert tmp/8ffvo1258720412.ps tmp/8ffvo1258720412.png")
> system("convert tmp/9ua611258720412.ps tmp/9ua611258720412.png")
> system("convert tmp/107vwv1258720412.ps tmp/107vwv1258720412.png")
>
>
> proc.time()
user system elapsed
2.454 1.551 2.883