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(2756.76
+ ,10001.60
+ ,2849.27
+ ,10411.75
+ ,2921.44
+ ,10673.38
+ ,2981.85
+ ,10539.51
+ ,3080.58
+ ,10723.78
+ ,3106.22
+ ,10682.06
+ ,3119.31
+ ,10283.19
+ ,3061.26
+ ,10377.18
+ ,3097.31
+ ,10486.64
+ ,3161.69
+ ,10545.38
+ ,3257.16
+ ,10554.27
+ ,3277.01
+ ,10532.54
+ ,3295.32
+ ,10324.31
+ ,3363.99
+ ,10695.25
+ ,3494.17
+ ,10827.81
+ ,3667.03
+ ,10872.48
+ ,3813.06
+ ,10971.19
+ ,3917.96
+ ,11145.65
+ ,3895.51
+ ,11234.68
+ ,3801.06
+ ,11333.88
+ ,3570.12
+ ,10997.97
+ ,3701.61
+ ,11036.89
+ ,3862.27
+ ,11257.35
+ ,3970.10
+ ,11533.59
+ ,4138.52
+ ,11963.12
+ ,4199.75
+ ,12185.15
+ ,4290.89
+ ,12377.62
+ ,4443.91
+ ,12512.89
+ ,4502.64
+ ,12631.48
+ ,4356.98
+ ,12268.53
+ ,4591.27
+ ,12754.80
+ ,4696.96
+ ,13407.75
+ ,4621.40
+ ,13480.21
+ ,4562.84
+ ,13673.28
+ ,4202.52
+ ,13239.71
+ ,4296.49
+ ,13557.69
+ ,4435.23
+ ,13901.28
+ ,4105.18
+ ,13200.58
+ ,4116.68
+ ,13406.97
+ ,3844.49
+ ,12538.12
+ ,3720.98
+ ,12419.57
+ ,3674.40
+ ,12193.88
+ ,3857.62
+ ,12656.63
+ ,3801.06
+ ,12812.48
+ ,3504.37
+ ,12056.67
+ ,3032.60
+ ,11322.38
+ ,3047.03
+ ,11530.75
+ ,2962.34
+ ,11114.08
+ ,2197.82
+ ,9181.73
+ ,2014.45
+ ,8614.55
+ ,1862.83
+ ,8595.56
+ ,1905.41
+ ,8396.20
+ ,1810.99
+ ,7690.50
+ ,1670.07
+ ,7235.47
+ ,1864.44
+ ,7992.12
+ ,2052.02
+ ,8398.37
+ ,2029.60
+ ,8593.01
+ ,2070.83
+ ,8679.75
+ ,2293.41
+ ,9374.63
+ ,2443.27
+ ,9634.97)
+ ,dim=c(2
+ ,60)
+ ,dimnames=list(c('Bel20'
+ ,'Dow
')
+ ,1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Bel20','Dow
'),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
Dow\r Bel20
1 10001.60 2756.76
2 10411.75 2849.27
3 10673.38 2921.44
4 10539.51 2981.85
5 10723.78 3080.58
6 10682.06 3106.22
7 10283.19 3119.31
8 10377.18 3061.26
9 10486.64 3097.31
10 10545.38 3161.69
11 10554.27 3257.16
12 10532.54 3277.01
13 10324.31 3295.32
14 10695.25 3363.99
15 10827.81 3494.17
16 10872.48 3667.03
17 10971.19 3813.06
18 11145.65 3917.96
19 11234.68 3895.51
20 11333.88 3801.06
21 10997.97 3570.12
22 11036.89 3701.61
23 11257.35 3862.27
24 11533.59 3970.10
25 11963.12 4138.52
26 12185.15 4199.75
27 12377.62 4290.89
28 12512.89 4443.91
29 12631.48 4502.64
30 12268.53 4356.98
31 12754.80 4591.27
32 13407.75 4696.96
33 13480.21 4621.40
34 13673.28 4562.84
35 13239.71 4202.52
36 13557.69 4296.49
37 13901.28 4435.23
38 13200.58 4105.18
39 13406.97 4116.68
40 12538.12 3844.49
41 12419.57 3720.98
42 12193.88 3674.40
43 12656.63 3857.62
44 12812.48 3801.06
45 12056.67 3504.37
46 11322.38 3032.60
47 11530.75 3047.03
48 11114.08 2962.34
49 9181.73 2197.82
50 8614.55 2014.45
51 8595.56 1862.83
52 8396.20 1905.41
53 7690.50 1810.99
54 7235.47 1670.07
55 7992.12 1864.44
56 8398.37 2052.02
57 8593.01 2029.60
58 8679.75 2070.83
59 9374.63 2293.41
60 9634.97 2443.27
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Bel20
4917.933 1.822
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-912.19 -493.05 -46.64 433.72 1060.05
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.918e+03 2.994e+02 16.43 <2e-16 ***
Bel20 1.822e+00 8.618e-02 21.15 <2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 562.2 on 58 degrees of freedom
Multiple R-squared: 0.8852, Adjusted R-squared: 0.8832
F-statistic: 447.2 on 1 and 58 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,] 2.596183e-02 5.192365e-02 0.9740381727
[2,] 8.351266e-03 1.670253e-02 0.9916487344
[3,] 2.294908e-02 4.589816e-02 0.9770509223
[4,] 1.025664e-02 2.051329e-02 0.9897433564
[5,] 3.568412e-03 7.136824e-03 0.9964315878
[6,] 1.150611e-03 2.301222e-03 0.9988493889
[7,] 3.906490e-04 7.812981e-04 0.9996093510
[8,] 1.305929e-04 2.611859e-04 0.9998694071
[9,] 1.047528e-04 2.095055e-04 0.9998952472
[10,] 3.482559e-05 6.965117e-05 0.9999651744
[11,] 1.285629e-05 2.571258e-05 0.9999871437
[12,] 4.431920e-06 8.863840e-06 0.9999955681
[13,] 1.758765e-06 3.517531e-06 0.9999982412
[14,] 9.122409e-07 1.824482e-06 0.9999990878
[15,] 6.035987e-07 1.207197e-06 0.9999993964
[16,] 7.793644e-07 1.558729e-06 0.9999992206
[17,] 3.278235e-07 6.556470e-07 0.9999996722
[18,] 1.463700e-07 2.927400e-07 0.9999998536
[19,] 9.534285e-08 1.906857e-07 0.9999999047
[20,] 1.571052e-07 3.142104e-07 0.9999998429
[21,] 1.480339e-06 2.960678e-06 0.9999985197
[22,] 1.248886e-05 2.497771e-05 0.9999875111
[23,] 6.148645e-05 1.229729e-04 0.9999385135
[24,] 1.736042e-04 3.472084e-04 0.9998263958
[25,] 5.443295e-04 1.088659e-03 0.9994556705
[26,] 1.881183e-03 3.762366e-03 0.9981188170
[27,] 1.789230e-02 3.578461e-02 0.9821076973
[28,] 1.748260e-01 3.496520e-01 0.8251739782
[29,] 5.904795e-01 8.190410e-01 0.4095205014
[30,] 8.925625e-01 2.148750e-01 0.1074374914
[31,] 9.620087e-01 7.598251e-02 0.0379912574
[32,] 9.860293e-01 2.794150e-02 0.0139707498
[33,] 9.942357e-01 1.152867e-02 0.0057643342
[34,] 9.960290e-01 7.941988e-03 0.0039709938
[35,] 9.969352e-01 6.129597e-03 0.0030647984
[36,] 9.973719e-01 5.256261e-03 0.0026281304
[37,] 9.970721e-01 5.855869e-03 0.0029279345
[38,] 9.975837e-01 4.832699e-03 0.0024163493
[39,] 9.989032e-01 2.193693e-03 0.0010968464
[40,] 9.992459e-01 1.508245e-03 0.0007541224
[41,] 9.998325e-01 3.350722e-04 0.0001675361
[42,] 9.996658e-01 6.684182e-04 0.0003342091
[43,] 9.993448e-01 1.310323e-03 0.0006551617
[44,] 9.986020e-01 2.796014e-03 0.0013980070
[45,] 9.966156e-01 6.768796e-03 0.0033843978
[46,] 9.919349e-01 1.613014e-02 0.0080650721
[47,] 9.992133e-01 1.573309e-03 0.0007866544
[48,] 9.996824e-01 6.351145e-04 0.0003175573
[49,] 9.986972e-01 2.605509e-03 0.0013027545
[50,] 9.966912e-01 6.617621e-03 0.0033088104
[51,] 9.830406e-01 3.391873e-02 0.0169593629
> postscript(file="/var/www/html/rcomp/tmp/1sbg51259618000.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/2ai5r1259618000.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/34ifc1259618000.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/4wzst1259618000.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/54ydq1259618000.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
59.876453 301.440544 431.551303 187.592937 191.941991 103.496851
7 8 9 10 11 12
-319.227755 -119.450143 -75.685981 -134.269090 -299.359164 -357.262878
13 14 15 16 17 18
-598.860168 -353.061173 -457.735132 -728.077132 -895.485392 -912.190259
19 20 21 22 23 24
-782.248426 -510.927152 -425.982869 -626.684111 -699.003401 -619.267763
25 26 27 28 29 30
-496.658514 -386.211210 -359.830494 -503.417004 -491.853817 -589.359827
31 32 33 34 35 36
-530.048994 -69.703520 140.453499 440.240512 663.300871 810.034327
37 38 39 40 41 42
900.791023 801.558747 986.991683 614.168042 720.696904 579.892123
43 44 45 46 47 48
708.750542 967.672848 752.536864 877.978504 1060.051946 797.717051
49 50 51 52 53 54
258.592635 25.577569 282.892785 5.936979 -527.696418 -725.920383
55 56 57 58 59 60
-323.481204 -259.068246 -23.571084 -11.966713 277.293878 264.536005
> postscript(file="/var/www/html/rcomp/tmp/654dj1259618000.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 59.876453 NA
1 301.440544 59.876453
2 431.551303 301.440544
3 187.592937 431.551303
4 191.941991 187.592937
5 103.496851 191.941991
6 -319.227755 103.496851
7 -119.450143 -319.227755
8 -75.685981 -119.450143
9 -134.269090 -75.685981
10 -299.359164 -134.269090
11 -357.262878 -299.359164
12 -598.860168 -357.262878
13 -353.061173 -598.860168
14 -457.735132 -353.061173
15 -728.077132 -457.735132
16 -895.485392 -728.077132
17 -912.190259 -895.485392
18 -782.248426 -912.190259
19 -510.927152 -782.248426
20 -425.982869 -510.927152
21 -626.684111 -425.982869
22 -699.003401 -626.684111
23 -619.267763 -699.003401
24 -496.658514 -619.267763
25 -386.211210 -496.658514
26 -359.830494 -386.211210
27 -503.417004 -359.830494
28 -491.853817 -503.417004
29 -589.359827 -491.853817
30 -530.048994 -589.359827
31 -69.703520 -530.048994
32 140.453499 -69.703520
33 440.240512 140.453499
34 663.300871 440.240512
35 810.034327 663.300871
36 900.791023 810.034327
37 801.558747 900.791023
38 986.991683 801.558747
39 614.168042 986.991683
40 720.696904 614.168042
41 579.892123 720.696904
42 708.750542 579.892123
43 967.672848 708.750542
44 752.536864 967.672848
45 877.978504 752.536864
46 1060.051946 877.978504
47 797.717051 1060.051946
48 258.592635 797.717051
49 25.577569 258.592635
50 282.892785 25.577569
51 5.936979 282.892785
52 -527.696418 5.936979
53 -725.920383 -527.696418
54 -323.481204 -725.920383
55 -259.068246 -323.481204
56 -23.571084 -259.068246
57 -11.966713 -23.571084
58 277.293878 -11.966713
59 264.536005 277.293878
60 NA 264.536005
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 301.440544 59.876453
[2,] 431.551303 301.440544
[3,] 187.592937 431.551303
[4,] 191.941991 187.592937
[5,] 103.496851 191.941991
[6,] -319.227755 103.496851
[7,] -119.450143 -319.227755
[8,] -75.685981 -119.450143
[9,] -134.269090 -75.685981
[10,] -299.359164 -134.269090
[11,] -357.262878 -299.359164
[12,] -598.860168 -357.262878
[13,] -353.061173 -598.860168
[14,] -457.735132 -353.061173
[15,] -728.077132 -457.735132
[16,] -895.485392 -728.077132
[17,] -912.190259 -895.485392
[18,] -782.248426 -912.190259
[19,] -510.927152 -782.248426
[20,] -425.982869 -510.927152
[21,] -626.684111 -425.982869
[22,] -699.003401 -626.684111
[23,] -619.267763 -699.003401
[24,] -496.658514 -619.267763
[25,] -386.211210 -496.658514
[26,] -359.830494 -386.211210
[27,] -503.417004 -359.830494
[28,] -491.853817 -503.417004
[29,] -589.359827 -491.853817
[30,] -530.048994 -589.359827
[31,] -69.703520 -530.048994
[32,] 140.453499 -69.703520
[33,] 440.240512 140.453499
[34,] 663.300871 440.240512
[35,] 810.034327 663.300871
[36,] 900.791023 810.034327
[37,] 801.558747 900.791023
[38,] 986.991683 801.558747
[39,] 614.168042 986.991683
[40,] 720.696904 614.168042
[41,] 579.892123 720.696904
[42,] 708.750542 579.892123
[43,] 967.672848 708.750542
[44,] 752.536864 967.672848
[45,] 877.978504 752.536864
[46,] 1060.051946 877.978504
[47,] 797.717051 1060.051946
[48,] 258.592635 797.717051
[49,] 25.577569 258.592635
[50,] 282.892785 25.577569
[51,] 5.936979 282.892785
[52,] -527.696418 5.936979
[53,] -725.920383 -527.696418
[54,] -323.481204 -725.920383
[55,] -259.068246 -323.481204
[56,] -23.571084 -259.068246
[57,] -11.966713 -23.571084
[58,] 277.293878 -11.966713
[59,] 264.536005 277.293878
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 301.440544 59.876453
2 431.551303 301.440544
3 187.592937 431.551303
4 191.941991 187.592937
5 103.496851 191.941991
6 -319.227755 103.496851
7 -119.450143 -319.227755
8 -75.685981 -119.450143
9 -134.269090 -75.685981
10 -299.359164 -134.269090
11 -357.262878 -299.359164
12 -598.860168 -357.262878
13 -353.061173 -598.860168
14 -457.735132 -353.061173
15 -728.077132 -457.735132
16 -895.485392 -728.077132
17 -912.190259 -895.485392
18 -782.248426 -912.190259
19 -510.927152 -782.248426
20 -425.982869 -510.927152
21 -626.684111 -425.982869
22 -699.003401 -626.684111
23 -619.267763 -699.003401
24 -496.658514 -619.267763
25 -386.211210 -496.658514
26 -359.830494 -386.211210
27 -503.417004 -359.830494
28 -491.853817 -503.417004
29 -589.359827 -491.853817
30 -530.048994 -589.359827
31 -69.703520 -530.048994
32 140.453499 -69.703520
33 440.240512 140.453499
34 663.300871 440.240512
35 810.034327 663.300871
36 900.791023 810.034327
37 801.558747 900.791023
38 986.991683 801.558747
39 614.168042 986.991683
40 720.696904 614.168042
41 579.892123 720.696904
42 708.750542 579.892123
43 967.672848 708.750542
44 752.536864 967.672848
45 877.978504 752.536864
46 1060.051946 877.978504
47 797.717051 1060.051946
48 258.592635 797.717051
49 25.577569 258.592635
50 282.892785 25.577569
51 5.936979 282.892785
52 -527.696418 5.936979
53 -725.920383 -527.696418
54 -323.481204 -725.920383
55 -259.068246 -323.481204
56 -23.571084 -259.068246
57 -11.966713 -23.571084
58 277.293878 -11.966713
59 264.536005 277.293878
> 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/7vfdn1259618000.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/8del71259618000.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/9jfoi1259618000.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/10ng1s1259618000.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/114y9b1259618000.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/12p7fe1259618000.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/13ewvm1259618000.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/14kloy1259618001.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/15edwi1259618001.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/1646ip1259618001.tab")
+ }
>
> system("convert tmp/1sbg51259618000.ps tmp/1sbg51259618000.png")
> system("convert tmp/2ai5r1259618000.ps tmp/2ai5r1259618000.png")
> system("convert tmp/34ifc1259618000.ps tmp/34ifc1259618000.png")
> system("convert tmp/4wzst1259618000.ps tmp/4wzst1259618000.png")
> system("convert tmp/54ydq1259618000.ps tmp/54ydq1259618000.png")
> system("convert tmp/654dj1259618000.ps tmp/654dj1259618000.png")
> system("convert tmp/7vfdn1259618000.ps tmp/7vfdn1259618000.png")
> system("convert tmp/8del71259618000.ps tmp/8del71259618000.png")
> system("convert tmp/9jfoi1259618000.ps tmp/9jfoi1259618000.png")
> system("convert tmp/10ng1s1259618000.ps tmp/10ng1s1259618000.png")
>
>
> proc.time()
user system elapsed
2.486 1.562 4.175