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(20.3,3016,20,2155,19.2,2172,21.8,2150,21.3,2533,21.5,2058,19.5,2160,19.5,2260,19.7,2498,18.7,2695,19.7,2799,20,2946,19.7,2930,19.2,2318,19.7,2540,22,2570,21.8,2669,22.8,2450,21,2842,25,3440,23.3,2678,25,2981,26.8,2260,25.3,2844,26.5,2546,27.8,2456,22,2295,22.3,2379,28,2479,25,2057,27.3,2280,25.8,2351,27.3,2276,23.5,2548,24.5,2311,18,2201,21.3,2725,21.8,2408,20.5,2139,22.3,1898,18.7,2537,22.3,2068,17.7,2063,19.7,2520,20.5,2434,18.5,2190,10,2794,14.2,2070,15.5,2615,16.5,2265,20.5,2139,15.7,2428,11.7,2137,7.5,1823,3.5,2063,4.5,1806,2.2,1758,5,2243,2.3,1993,6.1,1932,3.3,2465),dim=c(2,61),dimnames=list(c('Y','X'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Y','X'),1:61))
> 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 20.3 3016
2 20.0 2155
3 19.2 2172
4 21.8 2150
5 21.3 2533
6 21.5 2058
7 19.5 2160
8 19.5 2260
9 19.7 2498
10 18.7 2695
11 19.7 2799
12 20.0 2946
13 19.7 2930
14 19.2 2318
15 19.7 2540
16 22.0 2570
17 21.8 2669
18 22.8 2450
19 21.0 2842
20 25.0 3440
21 23.3 2678
22 25.0 2981
23 26.8 2260
24 25.3 2844
25 26.5 2546
26 27.8 2456
27 22.0 2295
28 22.3 2379
29 28.0 2479
30 25.0 2057
31 27.3 2280
32 25.8 2351
33 27.3 2276
34 23.5 2548
35 24.5 2311
36 18.0 2201
37 21.3 2725
38 21.8 2408
39 20.5 2139
40 22.3 1898
41 18.7 2537
42 22.3 2068
43 17.7 2063
44 19.7 2520
45 20.5 2434
46 18.5 2190
47 10.0 2794
48 14.2 2070
49 15.5 2615
50 16.5 2265
51 20.5 2139
52 15.7 2428
53 11.7 2137
54 7.5 1823
55 3.5 2063
56 4.5 1806
57 2.2 1758
58 5.0 2243
59 2.3 1993
60 6.1 1932
61 3.3 2465
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
-0.914965 0.008296
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-16.236 -2.744 1.200 3.669 9.332
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.914965 5.783698 -0.158 0.87484
X 0.008296 0.002399 3.458 0.00102 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 6.215 on 59 degrees of freedom
Multiple R-squared: 0.1685, Adjusted R-squared: 0.1544
F-statistic: 11.96 on 1 and 59 DF, p-value: 0.001016
> 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,] 8.809283e-03 1.761857e-02 0.99119072
[2,] 1.854738e-03 3.709476e-03 0.99814526
[3,] 4.733910e-04 9.467820e-04 0.99952661
[4,] 1.051324e-04 2.102649e-04 0.99989487
[5,] 1.876071e-05 3.752142e-05 0.99998124
[6,] 6.466140e-06 1.293228e-05 0.99999353
[7,] 9.815360e-07 1.963072e-06 0.99999902
[8,] 1.480549e-07 2.961098e-07 0.99999985
[9,] 2.101022e-08 4.202044e-08 0.99999998
[10,] 4.493729e-09 8.987459e-09 1.00000000
[11,] 5.933468e-10 1.186694e-09 1.00000000
[12,] 6.416914e-10 1.283383e-09 1.00000000
[13,] 3.282543e-10 6.565086e-10 1.00000000
[14,] 5.225396e-10 1.045079e-09 1.00000000
[15,] 1.024166e-10 2.048332e-10 1.00000000
[16,] 1.133413e-09 2.266825e-09 1.00000000
[17,] 7.742248e-10 1.548450e-09 1.00000000
[18,] 1.322397e-09 2.644794e-09 1.00000000
[19,] 6.948166e-08 1.389633e-07 0.99999993
[20,] 6.467696e-08 1.293539e-07 0.99999994
[21,] 1.783026e-07 3.566052e-07 0.99999982
[22,] 1.042423e-06 2.084845e-06 0.99999896
[23,] 4.076070e-07 8.152140e-07 0.99999959
[24,] 1.536772e-07 3.073544e-07 0.99999985
[25,] 6.918254e-07 1.383651e-06 0.99999931
[26,] 9.422576e-07 1.884515e-06 0.99999906
[27,] 2.875696e-06 5.751393e-06 0.99999712
[28,] 3.555780e-06 7.111559e-06 0.99999644
[29,] 1.140651e-05 2.281301e-05 0.99998859
[30,] 6.579353e-06 1.315871e-05 0.99999342
[31,] 7.309042e-06 1.461808e-05 0.99999269
[32,] 8.168049e-06 1.633610e-05 0.99999183
[33,] 3.927402e-06 7.854803e-06 0.99999607
[34,] 2.711553e-06 5.423107e-06 0.99999729
[35,] 2.677266e-06 5.354532e-06 0.99999732
[36,] 8.623047e-06 1.724609e-05 0.99999138
[37,] 6.820277e-06 1.364055e-05 0.99999318
[38,] 2.632166e-05 5.264333e-05 0.99997368
[39,] 6.574052e-05 1.314810e-04 0.99993426
[40,] 6.244369e-05 1.248874e-04 0.99993756
[41,] 1.064973e-04 2.129946e-04 0.99989350
[42,] 3.476508e-04 6.953016e-04 0.99965235
[43,] 4.898717e-03 9.797435e-03 0.99510128
[44,] 1.009337e-02 2.018674e-02 0.98990663
[45,] 8.554153e-03 1.710831e-02 0.99144585
[46,] 1.383235e-02 2.766470e-02 0.98616765
[47,] 2.241539e-01 4.483079e-01 0.77584607
[48,] 6.069899e-01 7.860203e-01 0.39301013
[49,] 9.509203e-01 9.815940e-02 0.04907970
[50,] 9.815612e-01 3.687760e-02 0.01843880
[51,] 9.670204e-01 6.595910e-02 0.03297955
[52,] 9.260267e-01 1.479465e-01 0.07397326
> postscript(file="/var/www/html/rcomp/tmp/1udwe1258725140.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/27r351258725140.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/3sgtg1258725140.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/4pbnf1258725140.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/5g7gv1258725140.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 = 61
Frequency = 1
1 2 3 4 5 6
-3.8068205 3.0363350 2.0952971 4.8778168 1.2003155 5.3410808
7 8 9 10 11 12
2.4948533 1.6652185 -0.1093123 -2.7436928 -2.6065130 -3.5260762
13 14 15 16 17 18
-3.6933346 0.8840303 -0.4577589 1.5933506 0.5720122 3.3889124
19 20 21 22 23 24
-1.6632560 -2.6244721 1.9973451 1.1835516 8.9652185 2.6201513
25 26 27 28 29 30
6.2924630 8.3391343 3.8748463 3.4779531 8.3483183 8.8493771
31 32 33 34 35 36
9.2992915 7.2102508 9.3324769 3.2758703 6.2421048 0.6547030
37 38 39 40 41 42
-0.3925833 2.7373590 3.6690766 7.4684964 -1.4328699 6.0581173
43 44 45 46 47 48
1.4995990 -0.2918320 1.2216540 1.2459629 -12.2650313 -2.0584754
49 50 51 52 53 54
-5.2799850 -1.3762632 3.6690766 -3.5285680 -5.1143307 -6.7092775
55 56 57 58 59 60
-12.7004010 -9.5682395 -11.4700148 -12.6937436 -13.3196566 -9.0135794
61
-16.2355328
> postscript(file="/var/www/html/rcomp/tmp/681vm1258725140.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 = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 -3.8068205 NA
1 3.0363350 -3.8068205
2 2.0952971 3.0363350
3 4.8778168 2.0952971
4 1.2003155 4.8778168
5 5.3410808 1.2003155
6 2.4948533 5.3410808
7 1.6652185 2.4948533
8 -0.1093123 1.6652185
9 -2.7436928 -0.1093123
10 -2.6065130 -2.7436928
11 -3.5260762 -2.6065130
12 -3.6933346 -3.5260762
13 0.8840303 -3.6933346
14 -0.4577589 0.8840303
15 1.5933506 -0.4577589
16 0.5720122 1.5933506
17 3.3889124 0.5720122
18 -1.6632560 3.3889124
19 -2.6244721 -1.6632560
20 1.9973451 -2.6244721
21 1.1835516 1.9973451
22 8.9652185 1.1835516
23 2.6201513 8.9652185
24 6.2924630 2.6201513
25 8.3391343 6.2924630
26 3.8748463 8.3391343
27 3.4779531 3.8748463
28 8.3483183 3.4779531
29 8.8493771 8.3483183
30 9.2992915 8.8493771
31 7.2102508 9.2992915
32 9.3324769 7.2102508
33 3.2758703 9.3324769
34 6.2421048 3.2758703
35 0.6547030 6.2421048
36 -0.3925833 0.6547030
37 2.7373590 -0.3925833
38 3.6690766 2.7373590
39 7.4684964 3.6690766
40 -1.4328699 7.4684964
41 6.0581173 -1.4328699
42 1.4995990 6.0581173
43 -0.2918320 1.4995990
44 1.2216540 -0.2918320
45 1.2459629 1.2216540
46 -12.2650313 1.2459629
47 -2.0584754 -12.2650313
48 -5.2799850 -2.0584754
49 -1.3762632 -5.2799850
50 3.6690766 -1.3762632
51 -3.5285680 3.6690766
52 -5.1143307 -3.5285680
53 -6.7092775 -5.1143307
54 -12.7004010 -6.7092775
55 -9.5682395 -12.7004010
56 -11.4700148 -9.5682395
57 -12.6937436 -11.4700148
58 -13.3196566 -12.6937436
59 -9.0135794 -13.3196566
60 -16.2355328 -9.0135794
61 NA -16.2355328
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.0363350 -3.8068205
[2,] 2.0952971 3.0363350
[3,] 4.8778168 2.0952971
[4,] 1.2003155 4.8778168
[5,] 5.3410808 1.2003155
[6,] 2.4948533 5.3410808
[7,] 1.6652185 2.4948533
[8,] -0.1093123 1.6652185
[9,] -2.7436928 -0.1093123
[10,] -2.6065130 -2.7436928
[11,] -3.5260762 -2.6065130
[12,] -3.6933346 -3.5260762
[13,] 0.8840303 -3.6933346
[14,] -0.4577589 0.8840303
[15,] 1.5933506 -0.4577589
[16,] 0.5720122 1.5933506
[17,] 3.3889124 0.5720122
[18,] -1.6632560 3.3889124
[19,] -2.6244721 -1.6632560
[20,] 1.9973451 -2.6244721
[21,] 1.1835516 1.9973451
[22,] 8.9652185 1.1835516
[23,] 2.6201513 8.9652185
[24,] 6.2924630 2.6201513
[25,] 8.3391343 6.2924630
[26,] 3.8748463 8.3391343
[27,] 3.4779531 3.8748463
[28,] 8.3483183 3.4779531
[29,] 8.8493771 8.3483183
[30,] 9.2992915 8.8493771
[31,] 7.2102508 9.2992915
[32,] 9.3324769 7.2102508
[33,] 3.2758703 9.3324769
[34,] 6.2421048 3.2758703
[35,] 0.6547030 6.2421048
[36,] -0.3925833 0.6547030
[37,] 2.7373590 -0.3925833
[38,] 3.6690766 2.7373590
[39,] 7.4684964 3.6690766
[40,] -1.4328699 7.4684964
[41,] 6.0581173 -1.4328699
[42,] 1.4995990 6.0581173
[43,] -0.2918320 1.4995990
[44,] 1.2216540 -0.2918320
[45,] 1.2459629 1.2216540
[46,] -12.2650313 1.2459629
[47,] -2.0584754 -12.2650313
[48,] -5.2799850 -2.0584754
[49,] -1.3762632 -5.2799850
[50,] 3.6690766 -1.3762632
[51,] -3.5285680 3.6690766
[52,] -5.1143307 -3.5285680
[53,] -6.7092775 -5.1143307
[54,] -12.7004010 -6.7092775
[55,] -9.5682395 -12.7004010
[56,] -11.4700148 -9.5682395
[57,] -12.6937436 -11.4700148
[58,] -13.3196566 -12.6937436
[59,] -9.0135794 -13.3196566
[60,] -16.2355328 -9.0135794
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.0363350 -3.8068205
2 2.0952971 3.0363350
3 4.8778168 2.0952971
4 1.2003155 4.8778168
5 5.3410808 1.2003155
6 2.4948533 5.3410808
7 1.6652185 2.4948533
8 -0.1093123 1.6652185
9 -2.7436928 -0.1093123
10 -2.6065130 -2.7436928
11 -3.5260762 -2.6065130
12 -3.6933346 -3.5260762
13 0.8840303 -3.6933346
14 -0.4577589 0.8840303
15 1.5933506 -0.4577589
16 0.5720122 1.5933506
17 3.3889124 0.5720122
18 -1.6632560 3.3889124
19 -2.6244721 -1.6632560
20 1.9973451 -2.6244721
21 1.1835516 1.9973451
22 8.9652185 1.1835516
23 2.6201513 8.9652185
24 6.2924630 2.6201513
25 8.3391343 6.2924630
26 3.8748463 8.3391343
27 3.4779531 3.8748463
28 8.3483183 3.4779531
29 8.8493771 8.3483183
30 9.2992915 8.8493771
31 7.2102508 9.2992915
32 9.3324769 7.2102508
33 3.2758703 9.3324769
34 6.2421048 3.2758703
35 0.6547030 6.2421048
36 -0.3925833 0.6547030
37 2.7373590 -0.3925833
38 3.6690766 2.7373590
39 7.4684964 3.6690766
40 -1.4328699 7.4684964
41 6.0581173 -1.4328699
42 1.4995990 6.0581173
43 -0.2918320 1.4995990
44 1.2216540 -0.2918320
45 1.2459629 1.2216540
46 -12.2650313 1.2459629
47 -2.0584754 -12.2650313
48 -5.2799850 -2.0584754
49 -1.3762632 -5.2799850
50 3.6690766 -1.3762632
51 -3.5285680 3.6690766
52 -5.1143307 -3.5285680
53 -6.7092775 -5.1143307
54 -12.7004010 -6.7092775
55 -9.5682395 -12.7004010
56 -11.4700148 -9.5682395
57 -12.6937436 -11.4700148
58 -13.3196566 -12.6937436
59 -9.0135794 -13.3196566
60 -16.2355328 -9.0135794
> 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/7l4j91258725140.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/8vlwr1258725140.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/9qa8y1258725140.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/10xj071258725140.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/113ic81258725140.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/12r6qe1258725140.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/13msdl1258725140.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/14zxyq1258725140.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/15mevs1258725140.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/16l5om1258725140.tab")
+ }
>
> system("convert tmp/1udwe1258725140.ps tmp/1udwe1258725140.png")
> system("convert tmp/27r351258725140.ps tmp/27r351258725140.png")
> system("convert tmp/3sgtg1258725140.ps tmp/3sgtg1258725140.png")
> system("convert tmp/4pbnf1258725140.ps tmp/4pbnf1258725140.png")
> system("convert tmp/5g7gv1258725140.ps tmp/5g7gv1258725140.png")
> system("convert tmp/681vm1258725140.ps tmp/681vm1258725140.png")
> system("convert tmp/7l4j91258725140.ps tmp/7l4j91258725140.png")
> system("convert tmp/8vlwr1258725140.ps tmp/8vlwr1258725140.png")
> system("convert tmp/9qa8y1258725140.ps tmp/9qa8y1258725140.png")
> system("convert tmp/10xj071258725140.ps tmp/10xj071258725140.png")
>
>
> proc.time()
user system elapsed
2.445 1.531 2.895