R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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(2120.88,0,2174.56,0,2196.72,0,2350.44,0,2440.25,0,2408.64,0,2472.81,0,2407.6,0,2454.62,0,2448.05,0,2497.84,0,2645.64,0,2756.76,0,2849.27,0,2921.44,0,2981.85,0,3080.58,0,3106.22,0,3119.31,0,3061.26,0,3097.31,0,3161.69,0,3257.16,0,3277.01,0,3295.32,0,3363.99,0,3494.17,0,3667.03,0,3813.06,0,3917.96,0,3895.51,0,3801.06,0,3570.12,0,3701.61,0,3862.27,0,3970.1,0,4138.52,0,4199.75,0,4290.89,0,4443.91,0,4502.64,1,4356.98,1,4591.27,1,4696.96,1,4621.4,1,4562.84,1,4202.52,1,4296.49,1,4435.23,1,4105.18,1,4116.68,1,3844.49,1,3720.98,1,3674.4,1,3857.62,1,3801.06,1,3504.37,1,3032.6,1,3047.03,1,2962.34,1,2197.82,1),dim=c(2,61),dimnames=list(c('Bel20','dummy'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Bel20','dummy'),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
Bel20 dummy
1 2120.88 0
2 2174.56 0
3 2196.72 0
4 2350.44 0
5 2440.25 0
6 2408.64 0
7 2472.81 0
8 2407.60 0
9 2454.62 0
10 2448.05 0
11 2497.84 0
12 2645.64 0
13 2756.76 0
14 2849.27 0
15 2921.44 0
16 2981.85 0
17 3080.58 0
18 3106.22 0
19 3119.31 0
20 3061.26 0
21 3097.31 0
22 3161.69 0
23 3257.16 0
24 3277.01 0
25 3295.32 0
26 3363.99 0
27 3494.17 0
28 3667.03 0
29 3813.06 0
30 3917.96 0
31 3895.51 0
32 3801.06 0
33 3570.12 0
34 3701.61 0
35 3862.27 0
36 3970.10 0
37 4138.52 0
38 4199.75 0
39 4290.89 0
40 4443.91 0
41 4502.64 1
42 4356.98 1
43 4591.27 1
44 4696.96 1
45 4621.40 1
46 4562.84 1
47 4202.52 1
48 4296.49 1
49 4435.23 1
50 4105.18 1
51 4116.68 1
52 3844.49 1
53 3720.98 1
54 3674.40 1
55 3857.62 1
56 3801.06 1
57 3504.37 1
58 3032.60 1
59 3047.03 1
60 2962.34 1
61 2197.82 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) dummy
3167.8 743.2
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1713.18 -522.19 -48.52 533.78 1276.08
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3167.8 104.1 30.421 < 2e-16 ***
dummy 743.2 177.5 4.187 9.54e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 658.6 on 59 degrees of freedom
Multiple R-squared: 0.2291, Adjusted R-squared: 0.216
F-statistic: 17.53 on 1 and 59 DF, p-value: 9.543e-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.028204e-02 0.0405640803 0.9797180
[2,] 6.882119e-03 0.0137642382 0.9931179
[3,] 3.131060e-03 0.0062621200 0.9968689
[4,] 9.605792e-04 0.0019211584 0.9990394
[5,] 3.566711e-04 0.0007133421 0.9996433
[6,] 1.273082e-04 0.0002546164 0.9998727
[7,] 5.967132e-05 0.0001193426 0.9999403
[8,] 8.484647e-05 0.0001696929 0.9999152
[9,] 2.068474e-04 0.0004136948 0.9997932
[10,] 5.558665e-04 0.0011117330 0.9994441
[11,] 1.332066e-03 0.0026641329 0.9986679
[12,] 2.775811e-03 0.0055516223 0.9972242
[13,] 6.070153e-03 0.0121403061 0.9939298
[14,] 1.038281e-02 0.0207656131 0.9896172
[15,] 1.497005e-02 0.0299400974 0.9850300
[16,] 1.723294e-02 0.0344658809 0.9827671
[17,] 2.016332e-02 0.0403266375 0.9798367
[18,] 2.489685e-02 0.0497936920 0.9751032
[19,] 3.335313e-02 0.0667062507 0.9666469
[20,] 4.250095e-02 0.0850019036 0.9574990
[21,] 5.234998e-02 0.1046999554 0.9476500
[22,] 6.600124e-02 0.1320024754 0.9339988
[23,] 8.908125e-02 0.1781624984 0.9109188
[24,] 1.302798e-01 0.2605596772 0.8697202
[25,] 1.908959e-01 0.3817918596 0.8091041
[26,] 2.626496e-01 0.5252991941 0.7373504
[27,] 3.125873e-01 0.6251746044 0.6874127
[28,] 3.312572e-01 0.6625143621 0.6687428
[29,] 3.252757e-01 0.6505514775 0.6747243
[30,] 3.262683e-01 0.6525366624 0.6737317
[31,] 3.365406e-01 0.6730812434 0.6634594
[32,] 3.510794e-01 0.7021588896 0.6489206
[33,] 3.759418e-01 0.7518835797 0.6240582
[34,] 3.958041e-01 0.7916081379 0.6041959
[35,] 4.145359e-01 0.8290717697 0.5854641
[36,] 4.395624e-01 0.8791247975 0.5604376
[37,] 4.019703e-01 0.8039405644 0.5980297
[38,] 3.515612e-01 0.7031224742 0.6484388
[39,] 3.407486e-01 0.6814972342 0.6592514
[40,] 3.655575e-01 0.7311149195 0.6344425
[41,] 3.920041e-01 0.7840082285 0.6079959
[42,] 4.272330e-01 0.8544659639 0.5727670
[43,] 3.979206e-01 0.7958411314 0.6020794
[44,] 3.977441e-01 0.7954881316 0.6022559
[45,] 4.690423e-01 0.9380846015 0.5309577
[46,] 4.674867e-01 0.9349733808 0.5325133
[47,] 4.944524e-01 0.9889048978 0.5055476
[48,] 4.623455e-01 0.9246909131 0.5376545
[49,] 4.097011e-01 0.8194022972 0.5902989
[50,] 3.530291e-01 0.7060582774 0.6469709
[51,] 3.788262e-01 0.7576523891 0.6211738
[52,] 4.677342e-01 0.9354683967 0.5322658
> postscript(file="/var/www/html/rcomp/tmp/1nqcy1227825613.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/2cqu31227825613.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/33j8h1227825613.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/4pshi1227825613.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/51b7p1227825613.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
-1046.94950 -993.26950 -971.10950 -817.38950 -727.57950 -759.18950
7 8 9 10 11 12
-695.01950 -760.22950 -713.20950 -719.77950 -669.98950 -522.18950
13 14 15 16 17 18
-411.06950 -318.55950 -246.38950 -185.97950 -87.24950 -61.60950
19 20 21 22 23 24
-48.51950 -106.56950 -70.51950 -6.13950 89.33050 109.18050
25 26 27 28 29 30
127.49050 196.16050 326.34050 499.20050 645.23050 750.13050
31 32 33 34 35 36
727.68050 633.23050 402.29050 533.78050 694.44050 802.27050
37 38 39 40 41 42
970.69050 1031.92050 1123.06050 1276.08050 591.64476 445.98476
43 44 45 46 47 48
680.27476 785.96476 710.40476 651.84476 291.52476 385.49476
49 50 51 52 53 54
524.23476 194.18476 205.68476 -66.50524 -190.01524 -236.59524
55 56 57 58 59 60
-53.37524 -109.93524 -406.62524 -878.39524 -863.96524 -948.65524
61
-1713.17524
> postscript(file="/var/www/html/rcomp/tmp/6rbqs1227825614.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 -1046.94950 NA
1 -993.26950 -1046.94950
2 -971.10950 -993.26950
3 -817.38950 -971.10950
4 -727.57950 -817.38950
5 -759.18950 -727.57950
6 -695.01950 -759.18950
7 -760.22950 -695.01950
8 -713.20950 -760.22950
9 -719.77950 -713.20950
10 -669.98950 -719.77950
11 -522.18950 -669.98950
12 -411.06950 -522.18950
13 -318.55950 -411.06950
14 -246.38950 -318.55950
15 -185.97950 -246.38950
16 -87.24950 -185.97950
17 -61.60950 -87.24950
18 -48.51950 -61.60950
19 -106.56950 -48.51950
20 -70.51950 -106.56950
21 -6.13950 -70.51950
22 89.33050 -6.13950
23 109.18050 89.33050
24 127.49050 109.18050
25 196.16050 127.49050
26 326.34050 196.16050
27 499.20050 326.34050
28 645.23050 499.20050
29 750.13050 645.23050
30 727.68050 750.13050
31 633.23050 727.68050
32 402.29050 633.23050
33 533.78050 402.29050
34 694.44050 533.78050
35 802.27050 694.44050
36 970.69050 802.27050
37 1031.92050 970.69050
38 1123.06050 1031.92050
39 1276.08050 1123.06050
40 591.64476 1276.08050
41 445.98476 591.64476
42 680.27476 445.98476
43 785.96476 680.27476
44 710.40476 785.96476
45 651.84476 710.40476
46 291.52476 651.84476
47 385.49476 291.52476
48 524.23476 385.49476
49 194.18476 524.23476
50 205.68476 194.18476
51 -66.50524 205.68476
52 -190.01524 -66.50524
53 -236.59524 -190.01524
54 -53.37524 -236.59524
55 -109.93524 -53.37524
56 -406.62524 -109.93524
57 -878.39524 -406.62524
58 -863.96524 -878.39524
59 -948.65524 -863.96524
60 -1713.17524 -948.65524
61 NA -1713.17524
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -993.26950 -1046.94950
[2,] -971.10950 -993.26950
[3,] -817.38950 -971.10950
[4,] -727.57950 -817.38950
[5,] -759.18950 -727.57950
[6,] -695.01950 -759.18950
[7,] -760.22950 -695.01950
[8,] -713.20950 -760.22950
[9,] -719.77950 -713.20950
[10,] -669.98950 -719.77950
[11,] -522.18950 -669.98950
[12,] -411.06950 -522.18950
[13,] -318.55950 -411.06950
[14,] -246.38950 -318.55950
[15,] -185.97950 -246.38950
[16,] -87.24950 -185.97950
[17,] -61.60950 -87.24950
[18,] -48.51950 -61.60950
[19,] -106.56950 -48.51950
[20,] -70.51950 -106.56950
[21,] -6.13950 -70.51950
[22,] 89.33050 -6.13950
[23,] 109.18050 89.33050
[24,] 127.49050 109.18050
[25,] 196.16050 127.49050
[26,] 326.34050 196.16050
[27,] 499.20050 326.34050
[28,] 645.23050 499.20050
[29,] 750.13050 645.23050
[30,] 727.68050 750.13050
[31,] 633.23050 727.68050
[32,] 402.29050 633.23050
[33,] 533.78050 402.29050
[34,] 694.44050 533.78050
[35,] 802.27050 694.44050
[36,] 970.69050 802.27050
[37,] 1031.92050 970.69050
[38,] 1123.06050 1031.92050
[39,] 1276.08050 1123.06050
[40,] 591.64476 1276.08050
[41,] 445.98476 591.64476
[42,] 680.27476 445.98476
[43,] 785.96476 680.27476
[44,] 710.40476 785.96476
[45,] 651.84476 710.40476
[46,] 291.52476 651.84476
[47,] 385.49476 291.52476
[48,] 524.23476 385.49476
[49,] 194.18476 524.23476
[50,] 205.68476 194.18476
[51,] -66.50524 205.68476
[52,] -190.01524 -66.50524
[53,] -236.59524 -190.01524
[54,] -53.37524 -236.59524
[55,] -109.93524 -53.37524
[56,] -406.62524 -109.93524
[57,] -878.39524 -406.62524
[58,] -863.96524 -878.39524
[59,] -948.65524 -863.96524
[60,] -1713.17524 -948.65524
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -993.26950 -1046.94950
2 -971.10950 -993.26950
3 -817.38950 -971.10950
4 -727.57950 -817.38950
5 -759.18950 -727.57950
6 -695.01950 -759.18950
7 -760.22950 -695.01950
8 -713.20950 -760.22950
9 -719.77950 -713.20950
10 -669.98950 -719.77950
11 -522.18950 -669.98950
12 -411.06950 -522.18950
13 -318.55950 -411.06950
14 -246.38950 -318.55950
15 -185.97950 -246.38950
16 -87.24950 -185.97950
17 -61.60950 -87.24950
18 -48.51950 -61.60950
19 -106.56950 -48.51950
20 -70.51950 -106.56950
21 -6.13950 -70.51950
22 89.33050 -6.13950
23 109.18050 89.33050
24 127.49050 109.18050
25 196.16050 127.49050
26 326.34050 196.16050
27 499.20050 326.34050
28 645.23050 499.20050
29 750.13050 645.23050
30 727.68050 750.13050
31 633.23050 727.68050
32 402.29050 633.23050
33 533.78050 402.29050
34 694.44050 533.78050
35 802.27050 694.44050
36 970.69050 802.27050
37 1031.92050 970.69050
38 1123.06050 1031.92050
39 1276.08050 1123.06050
40 591.64476 1276.08050
41 445.98476 591.64476
42 680.27476 445.98476
43 785.96476 680.27476
44 710.40476 785.96476
45 651.84476 710.40476
46 291.52476 651.84476
47 385.49476 291.52476
48 524.23476 385.49476
49 194.18476 524.23476
50 205.68476 194.18476
51 -66.50524 205.68476
52 -190.01524 -66.50524
53 -236.59524 -190.01524
54 -53.37524 -236.59524
55 -109.93524 -53.37524
56 -406.62524 -109.93524
57 -878.39524 -406.62524
58 -863.96524 -878.39524
59 -948.65524 -863.96524
60 -1713.17524 -948.65524
> 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/7y1px1227825614.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/8ke0g1227825614.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/9ljx31227825614.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/109ru61227825614.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/11s53k1227825614.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/12r8bl1227825614.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/13193k1227825614.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/148hej1227825614.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/154y7k1227825614.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/16seet1227825614.tab")
+ }
>
> system("convert tmp/1nqcy1227825613.ps tmp/1nqcy1227825613.png")
> system("convert tmp/2cqu31227825613.ps tmp/2cqu31227825613.png")
> system("convert tmp/33j8h1227825613.ps tmp/33j8h1227825613.png")
> system("convert tmp/4pshi1227825613.ps tmp/4pshi1227825613.png")
> system("convert tmp/51b7p1227825613.ps tmp/51b7p1227825613.png")
> system("convert tmp/6rbqs1227825614.ps tmp/6rbqs1227825614.png")
> system("convert tmp/7y1px1227825614.ps tmp/7y1px1227825614.png")
> system("convert tmp/8ke0g1227825614.ps tmp/8ke0g1227825614.png")
> system("convert tmp/9ljx31227825614.ps tmp/9ljx31227825614.png")
> system("convert tmp/109ru61227825614.ps tmp/109ru61227825614.png")
>
>
> proc.time()
user system elapsed
2.478 1.541 2.878