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(3030.29,101.2,2803.47,101.1,2767.63,100.7,2882.6,100.1,2863.36,99.9,2897.06,99.7,3012.61,99.5,3142.95,99.2,3032.93,99,3045.78,99,3110.52,99.3,3013.24,99.5,2987.1,99.7,2995.55,100,2833.18,100.4,2848.96,100.6,2794.83,100.7,2845.26,100.7,2915.02,100.6,2892.63,100.5,2604.42,100.6,2641.65,100.5,2659.81,100.4,2638.53,100.3,2720.25,100.4,2745.88,100.4,2735.7,100.4,2811.7,100.4,2799.43,100.4,2555.28,100.5,2304.98,100.6,2214.95,100.6,2065.81,100.5,1940.49,100.5,2042.00,100.7,1995.37,101.1,1946.81,101.5,1765.9,101.9,1635.25,102.1,1833.42,102.1,1910.43,102.1,1959.67,102.4,1969.6,102.8,2061.41,103.1,2093.48,103.1,2120.88,102.9,2174.56,102.4,2196.72,101.9,2350.44,101.3,2440.25,100.7,2408.64,100.6,2472.81,101,2407.6,101.5,2454.62,101.9,2448.05,102.1,2497.84,102.3,2645.64,102.5,2756.76,102.9,2849.27,103.6,2921.44,104.3),dim=c(2,60),dimnames=list(c('Bel20','G.indx'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Bel20','G.indx'),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'
> #'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
G.indx Bel20
1 101.2 3030.29
2 101.1 2803.47
3 100.7 2767.63
4 100.1 2882.60
5 99.9 2863.36
6 99.7 2897.06
7 99.5 3012.61
8 99.2 3142.95
9 99.0 3032.93
10 99.0 3045.78
11 99.3 3110.52
12 99.5 3013.24
13 99.7 2987.10
14 100.0 2995.55
15 100.4 2833.18
16 100.6 2848.96
17 100.7 2794.83
18 100.7 2845.26
19 100.6 2915.02
20 100.5 2892.63
21 100.6 2604.42
22 100.5 2641.65
23 100.4 2659.81
24 100.3 2638.53
25 100.4 2720.25
26 100.4 2745.88
27 100.4 2735.70
28 100.4 2811.70
29 100.4 2799.43
30 100.5 2555.28
31 100.6 2304.98
32 100.6 2214.95
33 100.5 2065.81
34 100.5 1940.49
35 100.7 2042.00
36 101.1 1995.37
37 101.5 1946.81
38 101.9 1765.90
39 102.1 1635.25
40 102.1 1833.42
41 102.1 1910.43
42 102.4 1959.67
43 102.8 1969.60
44 103.1 2061.41
45 103.1 2093.48
46 102.9 2120.88
47 102.4 2174.56
48 101.9 2196.72
49 101.3 2350.44
50 100.7 2440.25
51 100.6 2408.64
52 101.0 2472.81
53 101.5 2407.60
54 101.9 2454.62
55 102.1 2448.05
56 102.3 2497.84
57 102.5 2645.64
58 102.9 2756.76
59 103.6 2849.27
60 104.3 2921.44
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Bel20
105.024598 -0.001566
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.4865 -0.6433 -0.2837 0.3468 3.8492
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.050e+02 8.475e-01 123.928 < 2e-16 ***
Bel20 -1.566e-03 3.294e-04 -4.753 1.36e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.017 on 58 degrees of freedom
Multiple R-squared: 0.2803, Adjusted R-squared: 0.2679
F-statistic: 22.59 on 1 and 58 DF, p-value: 1.362e-05
> 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,] 2.413719e-01 0.4827438766 0.75862806
[2,] 2.307821e-01 0.4615642705 0.76921786
[3,] 2.118592e-01 0.4237184502 0.78814077
[4,] 1.511111e-01 0.3022221950 0.84888890
[5,] 1.427345e-01 0.2854690972 0.85726545
[6,] 1.185017e-01 0.2370033006 0.88149835
[7,] 7.521968e-02 0.1504393594 0.92478032
[8,] 4.772313e-02 0.0954462612 0.95227687
[9,] 2.866741e-02 0.0573348133 0.97133259
[10,] 1.729998e-02 0.0345999653 0.98270002
[11,] 9.190606e-03 0.0183812129 0.99080939
[12,] 4.960690e-03 0.0099213799 0.99503931
[13,] 2.430793e-03 0.0048615856 0.99756921
[14,] 1.276558e-03 0.0025531150 0.99872344
[15,] 8.112704e-04 0.0016225409 0.99918873
[16,] 4.196280e-04 0.0008392561 0.99958037
[17,] 4.854905e-04 0.0009709811 0.99951451
[18,] 3.630097e-04 0.0007260193 0.99963699
[19,] 2.642641e-04 0.0005285282 0.99973574
[20,] 2.322384e-04 0.0004644768 0.99976776
[21,] 1.432091e-04 0.0002864183 0.99985679
[22,] 9.137739e-05 0.0001827548 0.99990862
[23,] 6.448924e-05 0.0001289785 0.99993551
[24,] 5.375783e-05 0.0001075157 0.99994624
[25,] 5.828566e-05 0.0001165713 0.99994171
[26,] 8.409217e-05 0.0001681843 0.99991591
[27,] 1.687447e-04 0.0003374895 0.99983126
[28,] 2.819205e-04 0.0005638410 0.99971808
[29,] 5.603978e-04 0.0011207955 0.99943960
[30,] 9.571422e-04 0.0019142843 0.99904286
[31,] 1.121535e-03 0.0022430706 0.99887846
[32,] 9.160825e-04 0.0018321651 0.99908392
[33,] 6.887915e-04 0.0013775830 0.99931121
[34,] 4.919069e-04 0.0009838137 0.99950809
[35,] 3.237133e-04 0.0006474266 0.99967629
[36,] 2.477640e-04 0.0004955281 0.99975224
[37,] 1.906795e-04 0.0003813590 0.99980932
[38,] 2.482572e-04 0.0004965143 0.99975174
[39,] 7.992005e-04 0.0015984010 0.99920080
[40,] 6.159137e-03 0.0123182750 0.99384086
[41,] 4.147750e-02 0.0829550066 0.95852250
[42,] 2.066388e-01 0.4132775539 0.79336122
[43,] 5.000164e-01 0.9999672891 0.49998364
[44,] 8.402882e-01 0.3194235027 0.15971175
[45,] 7.967192e-01 0.4065615887 0.20328079
[46,] 8.311795e-01 0.3376409887 0.16882049
[47,] 8.994668e-01 0.2010663531 0.10053318
[48,] 9.846803e-01 0.0306394318 0.01531972
[49,] 9.688264e-01 0.0623471770 0.03117359
[50,] 9.269581e-01 0.1460838770 0.07304194
[51,] 8.641038e-01 0.2717924564 0.13589623
> postscript(file="/var/www/html/rcomp/tmp/1wjlg1258567666.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/2mkft1258567666.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/3izzt1258567666.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/4gcg91258567666.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/5w55b1258567666.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
0.919663320 0.464551014 0.008439449 -0.411562041 -0.641684433 -0.788923280
7 8 9 10 11 12
-0.808016715 -0.903954736 -1.276203462 -1.256085337 -0.854727561 -0.807030379
13 14 15 16 17 18
-0.647955499 -0.334726070 -0.188934628 0.035770742 0.051024119 0.129977975
19 20 21 22 23 24
0.139195127 0.004141055 -0.347084224 -0.388796458 -0.460364928 -0.593681170
25 26 27 28 29 30
-0.365739288 -0.325612630 -0.341550569 -0.222563992 -0.241774062 -0.524018439
31 32 33 34 35 36
-0.815891336 -0.956843461 -1.290338961 -1.486541563 -1.127616203 -0.800620730
37 38 39 40 41 42
-0.476646890 -0.359881911 -0.364429230 -0.054171731 0.066396114 0.443486891
43 44 45 46 47 48
0.859033427 1.302772342 1.352981547 1.195879339 0.779921436 0.314615417
49 50 51 52 53 54
-0.044718576 -0.504110886 -0.653599908 -0.153134531 0.244771855 0.718386971
55 56 57 58 59 60
0.908100895 1.186052759 1.617450338 2.191421238 3.036256082 3.849246362
> postscript(file="/var/www/html/rcomp/tmp/6b14m1258567666.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 0.919663320 NA
1 0.464551014 0.919663320
2 0.008439449 0.464551014
3 -0.411562041 0.008439449
4 -0.641684433 -0.411562041
5 -0.788923280 -0.641684433
6 -0.808016715 -0.788923280
7 -0.903954736 -0.808016715
8 -1.276203462 -0.903954736
9 -1.256085337 -1.276203462
10 -0.854727561 -1.256085337
11 -0.807030379 -0.854727561
12 -0.647955499 -0.807030379
13 -0.334726070 -0.647955499
14 -0.188934628 -0.334726070
15 0.035770742 -0.188934628
16 0.051024119 0.035770742
17 0.129977975 0.051024119
18 0.139195127 0.129977975
19 0.004141055 0.139195127
20 -0.347084224 0.004141055
21 -0.388796458 -0.347084224
22 -0.460364928 -0.388796458
23 -0.593681170 -0.460364928
24 -0.365739288 -0.593681170
25 -0.325612630 -0.365739288
26 -0.341550569 -0.325612630
27 -0.222563992 -0.341550569
28 -0.241774062 -0.222563992
29 -0.524018439 -0.241774062
30 -0.815891336 -0.524018439
31 -0.956843461 -0.815891336
32 -1.290338961 -0.956843461
33 -1.486541563 -1.290338961
34 -1.127616203 -1.486541563
35 -0.800620730 -1.127616203
36 -0.476646890 -0.800620730
37 -0.359881911 -0.476646890
38 -0.364429230 -0.359881911
39 -0.054171731 -0.364429230
40 0.066396114 -0.054171731
41 0.443486891 0.066396114
42 0.859033427 0.443486891
43 1.302772342 0.859033427
44 1.352981547 1.302772342
45 1.195879339 1.352981547
46 0.779921436 1.195879339
47 0.314615417 0.779921436
48 -0.044718576 0.314615417
49 -0.504110886 -0.044718576
50 -0.653599908 -0.504110886
51 -0.153134531 -0.653599908
52 0.244771855 -0.153134531
53 0.718386971 0.244771855
54 0.908100895 0.718386971
55 1.186052759 0.908100895
56 1.617450338 1.186052759
57 2.191421238 1.617450338
58 3.036256082 2.191421238
59 3.849246362 3.036256082
60 NA 3.849246362
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.464551014 0.919663320
[2,] 0.008439449 0.464551014
[3,] -0.411562041 0.008439449
[4,] -0.641684433 -0.411562041
[5,] -0.788923280 -0.641684433
[6,] -0.808016715 -0.788923280
[7,] -0.903954736 -0.808016715
[8,] -1.276203462 -0.903954736
[9,] -1.256085337 -1.276203462
[10,] -0.854727561 -1.256085337
[11,] -0.807030379 -0.854727561
[12,] -0.647955499 -0.807030379
[13,] -0.334726070 -0.647955499
[14,] -0.188934628 -0.334726070
[15,] 0.035770742 -0.188934628
[16,] 0.051024119 0.035770742
[17,] 0.129977975 0.051024119
[18,] 0.139195127 0.129977975
[19,] 0.004141055 0.139195127
[20,] -0.347084224 0.004141055
[21,] -0.388796458 -0.347084224
[22,] -0.460364928 -0.388796458
[23,] -0.593681170 -0.460364928
[24,] -0.365739288 -0.593681170
[25,] -0.325612630 -0.365739288
[26,] -0.341550569 -0.325612630
[27,] -0.222563992 -0.341550569
[28,] -0.241774062 -0.222563992
[29,] -0.524018439 -0.241774062
[30,] -0.815891336 -0.524018439
[31,] -0.956843461 -0.815891336
[32,] -1.290338961 -0.956843461
[33,] -1.486541563 -1.290338961
[34,] -1.127616203 -1.486541563
[35,] -0.800620730 -1.127616203
[36,] -0.476646890 -0.800620730
[37,] -0.359881911 -0.476646890
[38,] -0.364429230 -0.359881911
[39,] -0.054171731 -0.364429230
[40,] 0.066396114 -0.054171731
[41,] 0.443486891 0.066396114
[42,] 0.859033427 0.443486891
[43,] 1.302772342 0.859033427
[44,] 1.352981547 1.302772342
[45,] 1.195879339 1.352981547
[46,] 0.779921436 1.195879339
[47,] 0.314615417 0.779921436
[48,] -0.044718576 0.314615417
[49,] -0.504110886 -0.044718576
[50,] -0.653599908 -0.504110886
[51,] -0.153134531 -0.653599908
[52,] 0.244771855 -0.153134531
[53,] 0.718386971 0.244771855
[54,] 0.908100895 0.718386971
[55,] 1.186052759 0.908100895
[56,] 1.617450338 1.186052759
[57,] 2.191421238 1.617450338
[58,] 3.036256082 2.191421238
[59,] 3.849246362 3.036256082
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.464551014 0.919663320
2 0.008439449 0.464551014
3 -0.411562041 0.008439449
4 -0.641684433 -0.411562041
5 -0.788923280 -0.641684433
6 -0.808016715 -0.788923280
7 -0.903954736 -0.808016715
8 -1.276203462 -0.903954736
9 -1.256085337 -1.276203462
10 -0.854727561 -1.256085337
11 -0.807030379 -0.854727561
12 -0.647955499 -0.807030379
13 -0.334726070 -0.647955499
14 -0.188934628 -0.334726070
15 0.035770742 -0.188934628
16 0.051024119 0.035770742
17 0.129977975 0.051024119
18 0.139195127 0.129977975
19 0.004141055 0.139195127
20 -0.347084224 0.004141055
21 -0.388796458 -0.347084224
22 -0.460364928 -0.388796458
23 -0.593681170 -0.460364928
24 -0.365739288 -0.593681170
25 -0.325612630 -0.365739288
26 -0.341550569 -0.325612630
27 -0.222563992 -0.341550569
28 -0.241774062 -0.222563992
29 -0.524018439 -0.241774062
30 -0.815891336 -0.524018439
31 -0.956843461 -0.815891336
32 -1.290338961 -0.956843461
33 -1.486541563 -1.290338961
34 -1.127616203 -1.486541563
35 -0.800620730 -1.127616203
36 -0.476646890 -0.800620730
37 -0.359881911 -0.476646890
38 -0.364429230 -0.359881911
39 -0.054171731 -0.364429230
40 0.066396114 -0.054171731
41 0.443486891 0.066396114
42 0.859033427 0.443486891
43 1.302772342 0.859033427
44 1.352981547 1.302772342
45 1.195879339 1.352981547
46 0.779921436 1.195879339
47 0.314615417 0.779921436
48 -0.044718576 0.314615417
49 -0.504110886 -0.044718576
50 -0.653599908 -0.504110886
51 -0.153134531 -0.653599908
52 0.244771855 -0.153134531
53 0.718386971 0.244771855
54 0.908100895 0.718386971
55 1.186052759 0.908100895
56 1.617450338 1.186052759
57 2.191421238 1.617450338
58 3.036256082 2.191421238
59 3.849246362 3.036256082
> 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/7wmov1258567666.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/895qn1258567666.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/9k8pp1258567666.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/10wsg41258567666.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/11aujl1258567666.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/12gzpx1258567666.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/13s4wl1258567666.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/14ooay1258567666.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/156ymk1258567666.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/16207n1258567666.tab")
+ }
>
> system("convert tmp/1wjlg1258567666.ps tmp/1wjlg1258567666.png")
> system("convert tmp/2mkft1258567666.ps tmp/2mkft1258567666.png")
> system("convert tmp/3izzt1258567666.ps tmp/3izzt1258567666.png")
> system("convert tmp/4gcg91258567666.ps tmp/4gcg91258567666.png")
> system("convert tmp/5w55b1258567666.ps tmp/5w55b1258567666.png")
> system("convert tmp/6b14m1258567666.ps tmp/6b14m1258567666.png")
> system("convert tmp/7wmov1258567666.ps tmp/7wmov1258567666.png")
> system("convert tmp/895qn1258567666.ps tmp/895qn1258567666.png")
> system("convert tmp/9k8pp1258567666.ps tmp/9k8pp1258567666.png")
> system("convert tmp/10wsg41258567666.ps tmp/10wsg41258567666.png")
>
>
> proc.time()
user system elapsed
2.467 1.567 2.888