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(161,0,149,0,139,0,135,0,130,0,127,0,122,0,117,0,112,0,113,0,149,0,157,0,157,0,147,0,137,0,132,0,125,0,123,0,117,0,114,0,111,0,112,0,144,0,150,0,149,0,134,0,123,0,116,0,117,0,111,0,105,0,102,0,95,0,93,0,124,0,130,0,124,0,115,0,106,0,105,0,105,0,101,0,95,0,93,0,84,0,87,0,116,0,120,0,117,0,109,0,105,0,107,0,109,1,109,1,108,1,107,1,99,1,103,1,131,1,137,1),dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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
Y X
1 161 0
2 149 0
3 139 0
4 135 0
5 130 0
6 127 0
7 122 0
8 117 0
9 112 0
10 113 0
11 149 0
12 157 0
13 157 0
14 147 0
15 137 0
16 132 0
17 125 0
18 123 0
19 117 0
20 114 0
21 111 0
22 112 0
23 144 0
24 150 0
25 149 0
26 134 0
27 123 0
28 116 0
29 117 0
30 111 0
31 105 0
32 102 0
33 95 0
34 93 0
35 124 0
36 130 0
37 124 0
38 115 0
39 106 0
40 105 0
41 105 0
42 101 0
43 95 0
44 93 0
45 84 0
46 87 0
47 116 0
48 120 0
49 117 0
50 109 0
51 105 0
52 107 0
53 109 1
54 109 1
55 108 1
56 107 1
57 99 1
58 103 1
59 131 1
60 137 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
120.538 -7.663
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-36.538 -12.038 -3.707 11.962 40.462
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 120.538 2.549 47.289 <2e-16 ***
X -7.663 6.981 -1.098 0.277
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 18.38 on 58 degrees of freedom
Multiple R-squared: 0.02036, Adjusted R-squared: 0.003466
F-statistic: 1.205 on 1 and 58 DF, p-value: 0.2768
> 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,] 0.4209370 0.84187393 0.57906303
[2,] 0.3752785 0.75055694 0.62472153
[3,] 0.3700910 0.74018194 0.62990903
[4,] 0.3942407 0.78848149 0.60575926
[5,] 0.4424741 0.88494828 0.55752586
[6,] 0.4362083 0.87241664 0.56379168
[7,] 0.4633737 0.92674744 0.53662628
[8,] 0.5996138 0.80077230 0.40038615
[9,] 0.7206945 0.55861092 0.27930546
[10,] 0.7317570 0.53648592 0.26824296
[11,] 0.6919638 0.61607231 0.30803615
[12,] 0.6435438 0.71291241 0.35645620
[13,] 0.6016872 0.79662550 0.39831275
[14,] 0.5636259 0.87274816 0.43637408
[15,] 0.5522918 0.89541635 0.44770817
[16,] 0.5523775 0.89524502 0.44762251
[17,] 0.5639490 0.87210207 0.43605104
[18,] 0.5551854 0.88962914 0.44481457
[19,] 0.6143501 0.77129986 0.38564993
[20,] 0.7681114 0.46377713 0.23188857
[21,] 0.9013440 0.19731197 0.09865599
[22,] 0.9227412 0.15451767 0.07725883
[23,] 0.9194408 0.16111845 0.08055923
[24,] 0.9133504 0.17329913 0.08664957
[25,] 0.9057597 0.18848050 0.09424025
[26,] 0.9006043 0.19879150 0.09939575
[27,] 0.9053217 0.18935669 0.09467834
[28,] 0.9136751 0.17264978 0.08632489
[29,] 0.9401906 0.11961878 0.05980939
[30,] 0.9612994 0.07740124 0.03870062
[31,] 0.9585954 0.08280923 0.04140462
[32,] 0.9719231 0.05615390 0.02807695
[33,] 0.9760112 0.04797761 0.02398881
[34,] 0.9709213 0.05815739 0.02907870
[35,] 0.9616209 0.07675825 0.03837912
[36,] 0.9493683 0.10126347 0.05063173
[37,] 0.9327986 0.13440272 0.06720136
[38,] 0.9153019 0.16939621 0.08469811
[39,] 0.9096702 0.18065952 0.09032976
[40,] 0.9110465 0.17790703 0.08895352
[41,] 0.9590536 0.08189286 0.04094643
[42,] 0.9848231 0.03035379 0.01517689
[43,] 0.9723456 0.05530886 0.02765443
[44,] 0.9588821 0.08223590 0.04111795
[45,] 0.9378155 0.12436907 0.06218453
[46,] 0.8950084 0.20998329 0.10499164
[47,] 0.8314743 0.33705140 0.16852570
[48,] 0.7392610 0.52147798 0.26073899
[49,] 0.6197286 0.76054283 0.38027141
[50,] 0.4784099 0.95681985 0.52159007
[51,] 0.3332991 0.66659830 0.66670085
> postscript(file="/var/www/html/rcomp/tmp/1cb9g1258647070.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/22nil1258647070.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/37eam1258647070.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/4n8k91258647070.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/5hqee1258647070.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
40.4615385 28.4615385 18.4615385 14.4615385 9.4615385 6.4615385
7 8 9 10 11 12
1.4615385 -3.5384615 -8.5384615 -7.5384615 28.4615385 36.4615385
13 14 15 16 17 18
36.4615385 26.4615385 16.4615385 11.4615385 4.4615385 2.4615385
19 20 21 22 23 24
-3.5384615 -6.5384615 -9.5384615 -8.5384615 23.4615385 29.4615385
25 26 27 28 29 30
28.4615385 13.4615385 2.4615385 -4.5384615 -3.5384615 -9.5384615
31 32 33 34 35 36
-15.5384615 -18.5384615 -25.5384615 -27.5384615 3.4615385 9.4615385
37 38 39 40 41 42
3.4615385 -5.5384615 -14.5384615 -15.5384615 -15.5384615 -19.5384615
43 44 45 46 47 48
-25.5384615 -27.5384615 -36.5384615 -33.5384615 -4.5384615 -0.5384615
49 50 51 52 53 54
-3.5384615 -11.5384615 -15.5384615 -13.5384615 -3.8750000 -3.8750000
55 56 57 58 59 60
-4.8750000 -5.8750000 -13.8750000 -9.8750000 18.1250000 24.1250000
> postscript(file="/var/www/html/rcomp/tmp/6s7l11258647070.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 40.4615385 NA
1 28.4615385 40.4615385
2 18.4615385 28.4615385
3 14.4615385 18.4615385
4 9.4615385 14.4615385
5 6.4615385 9.4615385
6 1.4615385 6.4615385
7 -3.5384615 1.4615385
8 -8.5384615 -3.5384615
9 -7.5384615 -8.5384615
10 28.4615385 -7.5384615
11 36.4615385 28.4615385
12 36.4615385 36.4615385
13 26.4615385 36.4615385
14 16.4615385 26.4615385
15 11.4615385 16.4615385
16 4.4615385 11.4615385
17 2.4615385 4.4615385
18 -3.5384615 2.4615385
19 -6.5384615 -3.5384615
20 -9.5384615 -6.5384615
21 -8.5384615 -9.5384615
22 23.4615385 -8.5384615
23 29.4615385 23.4615385
24 28.4615385 29.4615385
25 13.4615385 28.4615385
26 2.4615385 13.4615385
27 -4.5384615 2.4615385
28 -3.5384615 -4.5384615
29 -9.5384615 -3.5384615
30 -15.5384615 -9.5384615
31 -18.5384615 -15.5384615
32 -25.5384615 -18.5384615
33 -27.5384615 -25.5384615
34 3.4615385 -27.5384615
35 9.4615385 3.4615385
36 3.4615385 9.4615385
37 -5.5384615 3.4615385
38 -14.5384615 -5.5384615
39 -15.5384615 -14.5384615
40 -15.5384615 -15.5384615
41 -19.5384615 -15.5384615
42 -25.5384615 -19.5384615
43 -27.5384615 -25.5384615
44 -36.5384615 -27.5384615
45 -33.5384615 -36.5384615
46 -4.5384615 -33.5384615
47 -0.5384615 -4.5384615
48 -3.5384615 -0.5384615
49 -11.5384615 -3.5384615
50 -15.5384615 -11.5384615
51 -13.5384615 -15.5384615
52 -3.8750000 -13.5384615
53 -3.8750000 -3.8750000
54 -4.8750000 -3.8750000
55 -5.8750000 -4.8750000
56 -13.8750000 -5.8750000
57 -9.8750000 -13.8750000
58 18.1250000 -9.8750000
59 24.1250000 18.1250000
60 NA 24.1250000
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 28.4615385 40.4615385
[2,] 18.4615385 28.4615385
[3,] 14.4615385 18.4615385
[4,] 9.4615385 14.4615385
[5,] 6.4615385 9.4615385
[6,] 1.4615385 6.4615385
[7,] -3.5384615 1.4615385
[8,] -8.5384615 -3.5384615
[9,] -7.5384615 -8.5384615
[10,] 28.4615385 -7.5384615
[11,] 36.4615385 28.4615385
[12,] 36.4615385 36.4615385
[13,] 26.4615385 36.4615385
[14,] 16.4615385 26.4615385
[15,] 11.4615385 16.4615385
[16,] 4.4615385 11.4615385
[17,] 2.4615385 4.4615385
[18,] -3.5384615 2.4615385
[19,] -6.5384615 -3.5384615
[20,] -9.5384615 -6.5384615
[21,] -8.5384615 -9.5384615
[22,] 23.4615385 -8.5384615
[23,] 29.4615385 23.4615385
[24,] 28.4615385 29.4615385
[25,] 13.4615385 28.4615385
[26,] 2.4615385 13.4615385
[27,] -4.5384615 2.4615385
[28,] -3.5384615 -4.5384615
[29,] -9.5384615 -3.5384615
[30,] -15.5384615 -9.5384615
[31,] -18.5384615 -15.5384615
[32,] -25.5384615 -18.5384615
[33,] -27.5384615 -25.5384615
[34,] 3.4615385 -27.5384615
[35,] 9.4615385 3.4615385
[36,] 3.4615385 9.4615385
[37,] -5.5384615 3.4615385
[38,] -14.5384615 -5.5384615
[39,] -15.5384615 -14.5384615
[40,] -15.5384615 -15.5384615
[41,] -19.5384615 -15.5384615
[42,] -25.5384615 -19.5384615
[43,] -27.5384615 -25.5384615
[44,] -36.5384615 -27.5384615
[45,] -33.5384615 -36.5384615
[46,] -4.5384615 -33.5384615
[47,] -0.5384615 -4.5384615
[48,] -3.5384615 -0.5384615
[49,] -11.5384615 -3.5384615
[50,] -15.5384615 -11.5384615
[51,] -13.5384615 -15.5384615
[52,] -3.8750000 -13.5384615
[53,] -3.8750000 -3.8750000
[54,] -4.8750000 -3.8750000
[55,] -5.8750000 -4.8750000
[56,] -13.8750000 -5.8750000
[57,] -9.8750000 -13.8750000
[58,] 18.1250000 -9.8750000
[59,] 24.1250000 18.1250000
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 28.4615385 40.4615385
2 18.4615385 28.4615385
3 14.4615385 18.4615385
4 9.4615385 14.4615385
5 6.4615385 9.4615385
6 1.4615385 6.4615385
7 -3.5384615 1.4615385
8 -8.5384615 -3.5384615
9 -7.5384615 -8.5384615
10 28.4615385 -7.5384615
11 36.4615385 28.4615385
12 36.4615385 36.4615385
13 26.4615385 36.4615385
14 16.4615385 26.4615385
15 11.4615385 16.4615385
16 4.4615385 11.4615385
17 2.4615385 4.4615385
18 -3.5384615 2.4615385
19 -6.5384615 -3.5384615
20 -9.5384615 -6.5384615
21 -8.5384615 -9.5384615
22 23.4615385 -8.5384615
23 29.4615385 23.4615385
24 28.4615385 29.4615385
25 13.4615385 28.4615385
26 2.4615385 13.4615385
27 -4.5384615 2.4615385
28 -3.5384615 -4.5384615
29 -9.5384615 -3.5384615
30 -15.5384615 -9.5384615
31 -18.5384615 -15.5384615
32 -25.5384615 -18.5384615
33 -27.5384615 -25.5384615
34 3.4615385 -27.5384615
35 9.4615385 3.4615385
36 3.4615385 9.4615385
37 -5.5384615 3.4615385
38 -14.5384615 -5.5384615
39 -15.5384615 -14.5384615
40 -15.5384615 -15.5384615
41 -19.5384615 -15.5384615
42 -25.5384615 -19.5384615
43 -27.5384615 -25.5384615
44 -36.5384615 -27.5384615
45 -33.5384615 -36.5384615
46 -4.5384615 -33.5384615
47 -0.5384615 -4.5384615
48 -3.5384615 -0.5384615
49 -11.5384615 -3.5384615
50 -15.5384615 -11.5384615
51 -13.5384615 -15.5384615
52 -3.8750000 -13.5384615
53 -3.8750000 -3.8750000
54 -4.8750000 -3.8750000
55 -5.8750000 -4.8750000
56 -13.8750000 -5.8750000
57 -9.8750000 -13.8750000
58 18.1250000 -9.8750000
59 24.1250000 18.1250000
> 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/7payw1258647070.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/8d4so1258647070.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/9yxty1258647070.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/1065l41258647070.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/11ppzc1258647070.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/12uyaa1258647070.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/13sr7t1258647070.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/14xnl01258647070.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/15kw691258647070.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/16bgf21258647070.tab")
+ }
>
> system("convert tmp/1cb9g1258647070.ps tmp/1cb9g1258647070.png")
> system("convert tmp/22nil1258647070.ps tmp/22nil1258647070.png")
> system("convert tmp/37eam1258647070.ps tmp/37eam1258647070.png")
> system("convert tmp/4n8k91258647070.ps tmp/4n8k91258647070.png")
> system("convert tmp/5hqee1258647070.ps tmp/5hqee1258647070.png")
> system("convert tmp/6s7l11258647070.ps tmp/6s7l11258647070.png")
> system("convert tmp/7payw1258647070.ps tmp/7payw1258647070.png")
> system("convert tmp/8d4so1258647070.ps tmp/8d4so1258647070.png")
> system("convert tmp/9yxty1258647070.ps tmp/9yxty1258647070.png")
> system("convert tmp/1065l41258647070.ps tmp/1065l41258647070.png")
>
>
> proc.time()
user system elapsed
2.467 1.535 2.860