R version 2.7.0 (2008-04-22)
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(41,0,35,0,34,0,36,0,39,0,40,0,30,0,33,0,30,0,32,0,41,0,40,0,41,0,40,0,39,0,34,0,34,0,46,0,45,0,44,0,40,0,39,0,37,0,39,0,35,0,26,0,26,0,33,0,27,0,30,0,26,0,27,0,18,0,19,0,13,0,14,0,41,0,21,0,16,0,17,0,9,0,14,0,14,0,16,0,11,0,10,0,6,0,9,0,5,0,7,0,2,0,0,0,8,0,13,0,11,0,19,1,23,1,23,1,43,1,59,1),dim=c(2,60),dimnames=list(c('Wer','Val'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Wer','Val'),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 = '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
Wer Val
1 41 0
2 35 0
3 34 0
4 36 0
5 39 0
6 40 0
7 30 0
8 33 0
9 30 0
10 32 0
11 41 0
12 40 0
13 41 0
14 40 0
15 39 0
16 34 0
17 34 0
18 46 0
19 45 0
20 44 0
21 40 0
22 39 0
23 37 0
24 39 0
25 35 0
26 26 0
27 26 0
28 33 0
29 27 0
30 30 0
31 26 0
32 27 0
33 18 0
34 19 0
35 13 0
36 14 0
37 41 0
38 21 0
39 16 0
40 17 0
41 9 0
42 14 0
43 14 0
44 16 0
45 11 0
46 10 0
47 6 0
48 9 0
49 5 0
50 7 0
51 2 0
52 0 0
53 8 0
54 13 0
55 11 0
56 19 1
57 23 1
58 23 1
59 43 1
60 59 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Val
26.055 7.345
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-26.055 -12.055 2.445 12.945 25.600
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 26.055 1.825 14.276 <2e-16 ***
Val 7.345 6.322 1.162 0.25
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 13.54 on 58 degrees of freedom
Multiple R-squared: 0.02274, Adjusted R-squared: 0.005894
F-statistic: 1.35 on 1 and 58 DF, p-value: 0.2501
> 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.968272e-02 3.936544e-02 0.9803173
[2,] 5.932075e-03 1.186415e-02 0.9940679
[3,] 7.320425e-03 1.464085e-02 0.9926796
[4,] 2.663126e-03 5.326251e-03 0.9973369
[5,] 1.703992e-03 3.407984e-03 0.9982960
[6,] 6.281054e-04 1.256211e-03 0.9993719
[7,] 4.507480e-04 9.014961e-04 0.9995493
[8,] 2.301638e-04 4.603277e-04 0.9997698
[9,] 1.410480e-04 2.820959e-04 0.9998590
[10,] 6.801253e-05 1.360251e-04 0.9999320
[11,] 2.788549e-05 5.577098e-05 0.9999721
[12,] 1.081263e-05 2.162526e-05 0.9999892
[13,] 4.117474e-06 8.234948e-06 0.9999959
[14,] 1.709202e-05 3.418404e-05 0.9999829
[15,] 3.508683e-05 7.017365e-05 0.9999649
[16,] 5.193370e-05 1.038674e-04 0.9999481
[17,] 3.765249e-05 7.530498e-05 0.9999623
[18,] 2.711441e-05 5.422882e-05 0.9999729
[19,] 1.910148e-05 3.820296e-05 0.9999809
[20,] 1.829600e-05 3.659201e-05 0.9999817
[21,] 1.708120e-05 3.416240e-05 0.9999829
[22,] 8.202422e-05 1.640484e-04 0.9999180
[23,] 2.338589e-04 4.677179e-04 0.9997661
[24,] 2.744786e-04 5.489571e-04 0.9997255
[25,] 5.289465e-04 1.057893e-03 0.9994711
[26,] 7.657911e-04 1.531582e-03 0.9992342
[27,] 1.504413e-03 3.008826e-03 0.9984956
[28,] 2.593092e-03 5.186185e-03 0.9974069
[29,] 1.031771e-02 2.063543e-02 0.9896823
[30,] 2.171490e-02 4.342979e-02 0.9782851
[31,] 5.983051e-02 1.196610e-01 0.9401695
[32,] 9.845862e-02 1.969172e-01 0.9015414
[33,] 3.711482e-01 7.422965e-01 0.6288518
[34,] 4.250361e-01 8.500721e-01 0.5749639
[35,] 4.749159e-01 9.498317e-01 0.5250841
[36,] 5.118380e-01 9.763239e-01 0.4881620
[37,] 5.782338e-01 8.435325e-01 0.4217662
[38,] 5.863942e-01 8.272116e-01 0.4136058
[39,] 5.855920e-01 8.288161e-01 0.4144080
[40,] 5.855969e-01 8.288062e-01 0.4144031
[41,] 5.740281e-01 8.519438e-01 0.4259719
[42,] 5.534845e-01 8.930311e-01 0.4465155
[43,] 5.394033e-01 9.211934e-01 0.4605967
[44,] 4.959372e-01 9.918744e-01 0.5040628
[45,] 4.601663e-01 9.203326e-01 0.5398337
[46,] 4.006736e-01 8.013473e-01 0.5993264
[47,] 3.675363e-01 7.350726e-01 0.6324637
[48,] 3.559460e-01 7.118919e-01 0.6440540
[49,] 2.691889e-01 5.383779e-01 0.7308111
[50,] 1.756178e-01 3.512356e-01 0.8243822
[51,] 1.002032e-01 2.004064e-01 0.8997968
> postscript(file="/var/www/html/rcomp/tmp/10bsa1228669875.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/2d5ok1228669875.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/3gc161228669876.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/47c1g1228669876.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/5c2ta1228669876.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
14.94545455 8.94545455 7.94545455 9.94545455 12.94545455 13.94545455
7 8 9 10 11 12
3.94545455 6.94545455 3.94545455 5.94545455 14.94545455 13.94545455
13 14 15 16 17 18
14.94545455 13.94545455 12.94545455 7.94545455 7.94545455 19.94545455
19 20 21 22 23 24
18.94545455 17.94545455 13.94545455 12.94545455 10.94545455 12.94545455
25 26 27 28 29 30
8.94545455 -0.05454545 -0.05454545 6.94545455 0.94545455 3.94545455
31 32 33 34 35 36
-0.05454545 0.94545455 -8.05454545 -7.05454545 -13.05454545 -12.05454545
37 38 39 40 41 42
14.94545455 -5.05454545 -10.05454545 -9.05454545 -17.05454545 -12.05454545
43 44 45 46 47 48
-12.05454545 -10.05454545 -15.05454545 -16.05454545 -20.05454545 -17.05454545
49 50 51 52 53 54
-21.05454545 -19.05454545 -24.05454545 -26.05454545 -18.05454545 -13.05454545
55 56 57 58 59 60
-15.05454545 -14.40000000 -10.40000000 -10.40000000 9.60000000 25.60000000
> postscript(file="/var/www/html/rcomp/tmp/6ysnj1228669876.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 14.94545455 NA
1 8.94545455 14.94545455
2 7.94545455 8.94545455
3 9.94545455 7.94545455
4 12.94545455 9.94545455
5 13.94545455 12.94545455
6 3.94545455 13.94545455
7 6.94545455 3.94545455
8 3.94545455 6.94545455
9 5.94545455 3.94545455
10 14.94545455 5.94545455
11 13.94545455 14.94545455
12 14.94545455 13.94545455
13 13.94545455 14.94545455
14 12.94545455 13.94545455
15 7.94545455 12.94545455
16 7.94545455 7.94545455
17 19.94545455 7.94545455
18 18.94545455 19.94545455
19 17.94545455 18.94545455
20 13.94545455 17.94545455
21 12.94545455 13.94545455
22 10.94545455 12.94545455
23 12.94545455 10.94545455
24 8.94545455 12.94545455
25 -0.05454545 8.94545455
26 -0.05454545 -0.05454545
27 6.94545455 -0.05454545
28 0.94545455 6.94545455
29 3.94545455 0.94545455
30 -0.05454545 3.94545455
31 0.94545455 -0.05454545
32 -8.05454545 0.94545455
33 -7.05454545 -8.05454545
34 -13.05454545 -7.05454545
35 -12.05454545 -13.05454545
36 14.94545455 -12.05454545
37 -5.05454545 14.94545455
38 -10.05454545 -5.05454545
39 -9.05454545 -10.05454545
40 -17.05454545 -9.05454545
41 -12.05454545 -17.05454545
42 -12.05454545 -12.05454545
43 -10.05454545 -12.05454545
44 -15.05454545 -10.05454545
45 -16.05454545 -15.05454545
46 -20.05454545 -16.05454545
47 -17.05454545 -20.05454545
48 -21.05454545 -17.05454545
49 -19.05454545 -21.05454545
50 -24.05454545 -19.05454545
51 -26.05454545 -24.05454545
52 -18.05454545 -26.05454545
53 -13.05454545 -18.05454545
54 -15.05454545 -13.05454545
55 -14.40000000 -15.05454545
56 -10.40000000 -14.40000000
57 -10.40000000 -10.40000000
58 9.60000000 -10.40000000
59 25.60000000 9.60000000
60 NA 25.60000000
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 8.94545455 14.94545455
[2,] 7.94545455 8.94545455
[3,] 9.94545455 7.94545455
[4,] 12.94545455 9.94545455
[5,] 13.94545455 12.94545455
[6,] 3.94545455 13.94545455
[7,] 6.94545455 3.94545455
[8,] 3.94545455 6.94545455
[9,] 5.94545455 3.94545455
[10,] 14.94545455 5.94545455
[11,] 13.94545455 14.94545455
[12,] 14.94545455 13.94545455
[13,] 13.94545455 14.94545455
[14,] 12.94545455 13.94545455
[15,] 7.94545455 12.94545455
[16,] 7.94545455 7.94545455
[17,] 19.94545455 7.94545455
[18,] 18.94545455 19.94545455
[19,] 17.94545455 18.94545455
[20,] 13.94545455 17.94545455
[21,] 12.94545455 13.94545455
[22,] 10.94545455 12.94545455
[23,] 12.94545455 10.94545455
[24,] 8.94545455 12.94545455
[25,] -0.05454545 8.94545455
[26,] -0.05454545 -0.05454545
[27,] 6.94545455 -0.05454545
[28,] 0.94545455 6.94545455
[29,] 3.94545455 0.94545455
[30,] -0.05454545 3.94545455
[31,] 0.94545455 -0.05454545
[32,] -8.05454545 0.94545455
[33,] -7.05454545 -8.05454545
[34,] -13.05454545 -7.05454545
[35,] -12.05454545 -13.05454545
[36,] 14.94545455 -12.05454545
[37,] -5.05454545 14.94545455
[38,] -10.05454545 -5.05454545
[39,] -9.05454545 -10.05454545
[40,] -17.05454545 -9.05454545
[41,] -12.05454545 -17.05454545
[42,] -12.05454545 -12.05454545
[43,] -10.05454545 -12.05454545
[44,] -15.05454545 -10.05454545
[45,] -16.05454545 -15.05454545
[46,] -20.05454545 -16.05454545
[47,] -17.05454545 -20.05454545
[48,] -21.05454545 -17.05454545
[49,] -19.05454545 -21.05454545
[50,] -24.05454545 -19.05454545
[51,] -26.05454545 -24.05454545
[52,] -18.05454545 -26.05454545
[53,] -13.05454545 -18.05454545
[54,] -15.05454545 -13.05454545
[55,] -14.40000000 -15.05454545
[56,] -10.40000000 -14.40000000
[57,] -10.40000000 -10.40000000
[58,] 9.60000000 -10.40000000
[59,] 25.60000000 9.60000000
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 8.94545455 14.94545455
2 7.94545455 8.94545455
3 9.94545455 7.94545455
4 12.94545455 9.94545455
5 13.94545455 12.94545455
6 3.94545455 13.94545455
7 6.94545455 3.94545455
8 3.94545455 6.94545455
9 5.94545455 3.94545455
10 14.94545455 5.94545455
11 13.94545455 14.94545455
12 14.94545455 13.94545455
13 13.94545455 14.94545455
14 12.94545455 13.94545455
15 7.94545455 12.94545455
16 7.94545455 7.94545455
17 19.94545455 7.94545455
18 18.94545455 19.94545455
19 17.94545455 18.94545455
20 13.94545455 17.94545455
21 12.94545455 13.94545455
22 10.94545455 12.94545455
23 12.94545455 10.94545455
24 8.94545455 12.94545455
25 -0.05454545 8.94545455
26 -0.05454545 -0.05454545
27 6.94545455 -0.05454545
28 0.94545455 6.94545455
29 3.94545455 0.94545455
30 -0.05454545 3.94545455
31 0.94545455 -0.05454545
32 -8.05454545 0.94545455
33 -7.05454545 -8.05454545
34 -13.05454545 -7.05454545
35 -12.05454545 -13.05454545
36 14.94545455 -12.05454545
37 -5.05454545 14.94545455
38 -10.05454545 -5.05454545
39 -9.05454545 -10.05454545
40 -17.05454545 -9.05454545
41 -12.05454545 -17.05454545
42 -12.05454545 -12.05454545
43 -10.05454545 -12.05454545
44 -15.05454545 -10.05454545
45 -16.05454545 -15.05454545
46 -20.05454545 -16.05454545
47 -17.05454545 -20.05454545
48 -21.05454545 -17.05454545
49 -19.05454545 -21.05454545
50 -24.05454545 -19.05454545
51 -26.05454545 -24.05454545
52 -18.05454545 -26.05454545
53 -13.05454545 -18.05454545
54 -15.05454545 -13.05454545
55 -14.40000000 -15.05454545
56 -10.40000000 -14.40000000
57 -10.40000000 -10.40000000
58 9.60000000 -10.40000000
59 25.60000000 9.60000000
> 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/7ups11228669876.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/8veba1228669876.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/9a2r91228669876.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/10w4ij1228669876.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/112uds1228669876.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/12ybbf1228669876.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/131oem1228669876.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/142nly1228669876.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/15zhmz1228669876.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/16i7df1228669876.tab")
+ }
>
> system("convert tmp/10bsa1228669875.ps tmp/10bsa1228669875.png")
> system("convert tmp/2d5ok1228669875.ps tmp/2d5ok1228669875.png")
> system("convert tmp/3gc161228669876.ps tmp/3gc161228669876.png")
> system("convert tmp/47c1g1228669876.ps tmp/47c1g1228669876.png")
> system("convert tmp/5c2ta1228669876.ps tmp/5c2ta1228669876.png")
> system("convert tmp/6ysnj1228669876.ps tmp/6ysnj1228669876.png")
> system("convert tmp/7ups11228669876.ps tmp/7ups11228669876.png")
> system("convert tmp/8veba1228669876.ps tmp/8veba1228669876.png")
> system("convert tmp/9a2r91228669876.ps tmp/9a2r91228669876.png")
> system("convert tmp/10w4ij1228669876.ps tmp/10w4ij1228669876.png")
>
>
> proc.time()
user system elapsed
5.017 2.714 5.394