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(10540.05,0,10601.61,0,10323.73,0,10418.4,0,10092.96,0,10364.91,0,10152.09,0,10032.8,0,10204.59,0,10001.6,0,10411.75,0,10673.38,0,10539.51,0,10723.78,0,10682.06,0,10283.19,0,10377.18,0,10486.64,0,10545.38,0,10554.27,0,10532.54,0,10324.31,0,10695.25,0,10827.81,0,10872.48,0,10971.19,0,11145.65,0,11234.68,0,11333.88,0,10997.97,0,11036.89,0,11257.35,0,11533.59,0,11963.12,0,12185.15,0,12377.62,0,12512.89,0,12631.48,1,12268.53,1,12754.8,1,13407.75,1,13480.21,1,13673.28,1,13239.71,1,13557.69,1,13901.28,1,13200.58,1,13406.97,1,12538.12,1,12419.57,1,12193.88,1,12656.63,1,12812.48,1,12056.67,1,11322.38,1,11530.75,1,11114.08,1,9181.73,1,8614.55,1),dim=c(2,59),dimnames=list(c('DowJonesInd','dummy'),1:59))
> y <- array(NA,dim=c(2,59),dimnames=list(c('DowJonesInd','dummy'),1:59))
> 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
DowJonesInd dummy
1 10540.05 0
2 10601.61 0
3 10323.73 0
4 10418.40 0
5 10092.96 0
6 10364.91 0
7 10152.09 0
8 10032.80 0
9 10204.59 0
10 10001.60 0
11 10411.75 0
12 10673.38 0
13 10539.51 0
14 10723.78 0
15 10682.06 0
16 10283.19 0
17 10377.18 0
18 10486.64 0
19 10545.38 0
20 10554.27 0
21 10532.54 0
22 10324.31 0
23 10695.25 0
24 10827.81 0
25 10872.48 0
26 10971.19 0
27 11145.65 0
28 11234.68 0
29 11333.88 0
30 10997.97 0
31 11036.89 0
32 11257.35 0
33 11533.59 0
34 11963.12 0
35 12185.15 0
36 12377.62 0
37 12512.89 0
38 12631.48 1
39 12268.53 1
40 12754.80 1
41 13407.75 1
42 13480.21 1
43 13673.28 1
44 13239.71 1
45 13557.69 1
46 13901.28 1
47 13200.58 1
48 13406.97 1
49 12538.12 1
50 12419.57 1
51 12193.88 1
52 12656.63 1
53 12812.48 1
54 12056.67 1
55 11322.38 1
56 11530.75 1
57 11114.08 1
58 9181.73 1
59 8614.55 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) dummy
10806 1556
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3747.41 -411.27 -93.43 451.07 1707.15
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 10805.7 158.8 68.060 < 2e-16 ***
dummy 1556.2 260.0 5.985 1.52e-07 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 965.7 on 57 degrees of freedom
Multiple R-squared: 0.3859, Adjusted R-squared: 0.3752
F-statistic: 35.83 on 1 and 57 DF, p-value: 1.520e-07
> 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,] 1.648987e-02 3.297974e-02 0.9835101
[2,] 3.101366e-03 6.202733e-03 0.9968986
[3,] 1.005378e-03 2.010756e-03 0.9989946
[4,] 5.223718e-04 1.044744e-03 0.9994776
[5,] 1.184550e-04 2.369099e-04 0.9998815
[6,] 5.767110e-05 1.153422e-04 0.9999423
[7,] 1.404483e-05 2.808965e-05 0.9999860
[8,] 1.065296e-05 2.130593e-05 0.9999893
[9,] 3.418999e-06 6.837999e-06 0.9999966
[10,] 2.355747e-06 4.711494e-06 0.9999976
[11,] 1.093216e-06 2.186432e-06 0.9999989
[12,] 2.842219e-07 5.684438e-07 0.9999997
[13,] 6.600023e-08 1.320005e-07 0.9999999
[14,] 1.615382e-08 3.230765e-08 1.0000000
[15,] 4.371707e-09 8.743413e-09 1.0000000
[16,] 1.183587e-09 2.367174e-09 1.0000000
[17,] 2.990941e-10 5.981882e-10 1.0000000
[18,] 7.493754e-11 1.498751e-10 1.0000000
[19,] 3.570947e-11 7.141894e-11 1.0000000
[20,] 3.436450e-11 6.872901e-11 1.0000000
[21,] 3.580219e-11 7.160438e-11 1.0000000
[22,] 5.590649e-11 1.118130e-10 1.0000000
[23,] 1.962342e-10 3.924685e-10 1.0000000
[24,] 6.812290e-10 1.362458e-09 1.0000000
[25,] 2.399026e-09 4.798052e-09 1.0000000
[26,] 1.567278e-09 3.134556e-09 1.0000000
[27,] 1.136339e-09 2.272677e-09 1.0000000
[28,] 1.621092e-09 3.242183e-09 1.0000000
[29,] 5.790116e-09 1.158023e-08 1.0000000
[30,] 8.061687e-08 1.612337e-07 0.9999999
[31,] 9.321380e-07 1.864276e-06 0.9999991
[32,] 7.494609e-06 1.498922e-05 0.9999925
[33,] 3.781809e-05 7.563618e-05 0.9999622
[34,] 1.662062e-05 3.324123e-05 0.9999834
[35,] 7.250456e-06 1.450091e-05 0.9999927
[36,] 3.193348e-06 6.386696e-06 0.9999968
[37,] 2.821789e-06 5.643577e-06 0.9999972
[38,] 2.480514e-06 4.961028e-06 0.9999975
[39,] 3.060826e-06 6.121651e-06 0.9999969
[40,] 1.961575e-06 3.923150e-06 0.9999980
[41,] 2.282048e-06 4.564096e-06 0.9999977
[42,] 7.718555e-06 1.543711e-05 0.9999923
[43,] 8.285433e-06 1.657087e-05 0.9999917
[44,] 1.829656e-05 3.659312e-05 0.9999817
[45,] 1.756478e-05 3.512956e-05 0.9999824
[46,] 1.735334e-05 3.470668e-05 0.9999826
[47,] 1.680573e-05 3.361146e-05 0.9999832
[48,] 3.304460e-05 6.608921e-05 0.9999670
[49,] 2.438454e-04 4.876909e-04 0.9997562
[50,] 8.887497e-04 1.777499e-03 0.9991113
> postscript(file="/var/www/html/rcomp/tmp/1ssv61229505951.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/2yd8h1229505951.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/3mhxl1229505951.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/4afvr1229505951.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/5gg2t1229505951.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 = 59
Frequency = 1
1 2 3 4 5 6
-265.68649 -204.12649 -482.00649 -387.33649 -712.77649 -440.82649
7 8 9 10 11 12
-653.64649 -772.93649 -601.14649 -804.13649 -393.98649 -132.35649
13 14 15 16 17 18
-266.22649 -81.95649 -123.67649 -522.54649 -428.55649 -319.09649
19 20 21 22 23 24
-260.35649 -251.46649 -273.19649 -481.42649 -110.48649 22.07351
25 26 27 28 29 30
66.74351 165.45351 339.91351 428.94351 528.14351 192.23351
31 32 33 34 35 36
231.15351 451.61351 727.85351 1157.38351 1379.41351 1571.88351
37 38 39 40 41 42
1707.15351 269.52000 -93.43000 392.84000 1045.79000 1118.25000
43 44 45 46 47 48
1311.32000 877.75000 1195.73000 1539.32000 838.62000 1045.01000
49 50 51 52 53 54
176.16000 57.61000 -168.08000 294.67000 450.52000 -305.29000
55 56 57 58 59
-1039.58000 -831.21000 -1247.88000 -3180.23000 -3747.41000
> postscript(file="/var/www/html/rcomp/tmp/6qxnx1229505951.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 = 59
Frequency = 1
lag(myerror, k = 1) myerror
0 -265.68649 NA
1 -204.12649 -265.68649
2 -482.00649 -204.12649
3 -387.33649 -482.00649
4 -712.77649 -387.33649
5 -440.82649 -712.77649
6 -653.64649 -440.82649
7 -772.93649 -653.64649
8 -601.14649 -772.93649
9 -804.13649 -601.14649
10 -393.98649 -804.13649
11 -132.35649 -393.98649
12 -266.22649 -132.35649
13 -81.95649 -266.22649
14 -123.67649 -81.95649
15 -522.54649 -123.67649
16 -428.55649 -522.54649
17 -319.09649 -428.55649
18 -260.35649 -319.09649
19 -251.46649 -260.35649
20 -273.19649 -251.46649
21 -481.42649 -273.19649
22 -110.48649 -481.42649
23 22.07351 -110.48649
24 66.74351 22.07351
25 165.45351 66.74351
26 339.91351 165.45351
27 428.94351 339.91351
28 528.14351 428.94351
29 192.23351 528.14351
30 231.15351 192.23351
31 451.61351 231.15351
32 727.85351 451.61351
33 1157.38351 727.85351
34 1379.41351 1157.38351
35 1571.88351 1379.41351
36 1707.15351 1571.88351
37 269.52000 1707.15351
38 -93.43000 269.52000
39 392.84000 -93.43000
40 1045.79000 392.84000
41 1118.25000 1045.79000
42 1311.32000 1118.25000
43 877.75000 1311.32000
44 1195.73000 877.75000
45 1539.32000 1195.73000
46 838.62000 1539.32000
47 1045.01000 838.62000
48 176.16000 1045.01000
49 57.61000 176.16000
50 -168.08000 57.61000
51 294.67000 -168.08000
52 450.52000 294.67000
53 -305.29000 450.52000
54 -1039.58000 -305.29000
55 -831.21000 -1039.58000
56 -1247.88000 -831.21000
57 -3180.23000 -1247.88000
58 -3747.41000 -3180.23000
59 NA -3747.41000
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -204.12649 -265.68649
[2,] -482.00649 -204.12649
[3,] -387.33649 -482.00649
[4,] -712.77649 -387.33649
[5,] -440.82649 -712.77649
[6,] -653.64649 -440.82649
[7,] -772.93649 -653.64649
[8,] -601.14649 -772.93649
[9,] -804.13649 -601.14649
[10,] -393.98649 -804.13649
[11,] -132.35649 -393.98649
[12,] -266.22649 -132.35649
[13,] -81.95649 -266.22649
[14,] -123.67649 -81.95649
[15,] -522.54649 -123.67649
[16,] -428.55649 -522.54649
[17,] -319.09649 -428.55649
[18,] -260.35649 -319.09649
[19,] -251.46649 -260.35649
[20,] -273.19649 -251.46649
[21,] -481.42649 -273.19649
[22,] -110.48649 -481.42649
[23,] 22.07351 -110.48649
[24,] 66.74351 22.07351
[25,] 165.45351 66.74351
[26,] 339.91351 165.45351
[27,] 428.94351 339.91351
[28,] 528.14351 428.94351
[29,] 192.23351 528.14351
[30,] 231.15351 192.23351
[31,] 451.61351 231.15351
[32,] 727.85351 451.61351
[33,] 1157.38351 727.85351
[34,] 1379.41351 1157.38351
[35,] 1571.88351 1379.41351
[36,] 1707.15351 1571.88351
[37,] 269.52000 1707.15351
[38,] -93.43000 269.52000
[39,] 392.84000 -93.43000
[40,] 1045.79000 392.84000
[41,] 1118.25000 1045.79000
[42,] 1311.32000 1118.25000
[43,] 877.75000 1311.32000
[44,] 1195.73000 877.75000
[45,] 1539.32000 1195.73000
[46,] 838.62000 1539.32000
[47,] 1045.01000 838.62000
[48,] 176.16000 1045.01000
[49,] 57.61000 176.16000
[50,] -168.08000 57.61000
[51,] 294.67000 -168.08000
[52,] 450.52000 294.67000
[53,] -305.29000 450.52000
[54,] -1039.58000 -305.29000
[55,] -831.21000 -1039.58000
[56,] -1247.88000 -831.21000
[57,] -3180.23000 -1247.88000
[58,] -3747.41000 -3180.23000
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -204.12649 -265.68649
2 -482.00649 -204.12649
3 -387.33649 -482.00649
4 -712.77649 -387.33649
5 -440.82649 -712.77649
6 -653.64649 -440.82649
7 -772.93649 -653.64649
8 -601.14649 -772.93649
9 -804.13649 -601.14649
10 -393.98649 -804.13649
11 -132.35649 -393.98649
12 -266.22649 -132.35649
13 -81.95649 -266.22649
14 -123.67649 -81.95649
15 -522.54649 -123.67649
16 -428.55649 -522.54649
17 -319.09649 -428.55649
18 -260.35649 -319.09649
19 -251.46649 -260.35649
20 -273.19649 -251.46649
21 -481.42649 -273.19649
22 -110.48649 -481.42649
23 22.07351 -110.48649
24 66.74351 22.07351
25 165.45351 66.74351
26 339.91351 165.45351
27 428.94351 339.91351
28 528.14351 428.94351
29 192.23351 528.14351
30 231.15351 192.23351
31 451.61351 231.15351
32 727.85351 451.61351
33 1157.38351 727.85351
34 1379.41351 1157.38351
35 1571.88351 1379.41351
36 1707.15351 1571.88351
37 269.52000 1707.15351
38 -93.43000 269.52000
39 392.84000 -93.43000
40 1045.79000 392.84000
41 1118.25000 1045.79000
42 1311.32000 1118.25000
43 877.75000 1311.32000
44 1195.73000 877.75000
45 1539.32000 1195.73000
46 838.62000 1539.32000
47 1045.01000 838.62000
48 176.16000 1045.01000
49 57.61000 176.16000
50 -168.08000 57.61000
51 294.67000 -168.08000
52 450.52000 294.67000
53 -305.29000 450.52000
54 -1039.58000 -305.29000
55 -831.21000 -1039.58000
56 -1247.88000 -831.21000
57 -3180.23000 -1247.88000
58 -3747.41000 -3180.23000
> 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/71fln1229505951.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/8hmqi1229505951.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/9wlge1229505951.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/10tqxa1229505951.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/11r0yp1229505951.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/12u9ct1229505951.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/13bu801229505951.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/14sclj1229505951.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/15xl6u1229505951.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/16uxbo1229505952.tab")
+ }
> system("convert tmp/1ssv61229505951.ps tmp/1ssv61229505951.png")
> system("convert tmp/2yd8h1229505951.ps tmp/2yd8h1229505951.png")
> system("convert tmp/3mhxl1229505951.ps tmp/3mhxl1229505951.png")
> system("convert tmp/4afvr1229505951.ps tmp/4afvr1229505951.png")
> system("convert tmp/5gg2t1229505951.ps tmp/5gg2t1229505951.png")
> system("convert tmp/6qxnx1229505951.ps tmp/6qxnx1229505951.png")
> system("convert tmp/71fln1229505951.ps tmp/71fln1229505951.png")
> system("convert tmp/8hmqi1229505951.ps tmp/8hmqi1229505951.png")
> system("convert tmp/9wlge1229505951.ps tmp/9wlge1229505951.png")
> system("convert tmp/10tqxa1229505951.ps tmp/10tqxa1229505951.png")
>
>
> proc.time()
user system elapsed
2.630 1.628 5.000