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(105.29,0,101.23,0,102.33,0,100.26,0,104.13,0,103.54,0,100.02,0,98.66,0,108.64,0,105.67,0,102.66,0,100.3,0,95.13,0,93.2,0,102.84,0,101.36,0,102.55,0,103.12,0,96.3,0,99.13,0,102.23,0,104.3,0,99.58,0,98.45,0,96.23,0,97.62,0,102.32,0,105.23,0,100.05,0,102.66,0,100.98,0,99.2,0,98.36,0,102.56,0,97.33,0,96.22,0,99.22,0,102.32,0,104.22,0,100.06,0,107.23,0,99.62,0,98.32,1,101.23,1,102.33,1,100.6,1,95.63,1,94.63,1,95.66,1,100.78,1,90.36,1,95.45,1,103.65,1,99.89,1,97.68,1,99.62,1,98.33,1,96.23,1,102.65,1,99.35,1,92.65,1,100.6,1,97.67,1),dim=c(2,63),dimnames=list(c('Y','X'),1:63))
> y <- array(NA,dim=c(2,63),dimnames=list(c('Y','X'),1:63))
> 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 105.29 0
2 101.23 0
3 102.33 0
4 100.26 0
5 104.13 0
6 103.54 0
7 100.02 0
8 98.66 0
9 108.64 0
10 105.67 0
11 102.66 0
12 100.30 0
13 95.13 0
14 93.20 0
15 102.84 0
16 101.36 0
17 102.55 0
18 103.12 0
19 96.30 0
20 99.13 0
21 102.23 0
22 104.30 0
23 99.58 0
24 98.45 0
25 96.23 0
26 97.62 0
27 102.32 0
28 105.23 0
29 100.05 0
30 102.66 0
31 100.98 0
32 99.20 0
33 98.36 0
34 102.56 0
35 97.33 0
36 96.22 0
37 99.22 0
38 102.32 0
39 104.22 0
40 100.06 0
41 107.23 0
42 99.62 0
43 98.32 1
44 101.23 1
45 102.33 1
46 100.60 1
47 95.63 1
48 94.63 1
49 95.66 1
50 100.78 1
51 90.36 1
52 95.45 1
53 103.65 1
54 99.89 1
55 97.68 1
56 99.62 1
57 98.33 1
58 96.23 1
59 102.65 1
60 99.35 1
61 92.65 1
62 100.60 1
63 97.67 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
101.008 -2.755
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.89286 -2.18560 0.07714 2.22940 7.63167
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 101.0083 0.5124 197.143 < 2e-16 ***
X -2.7555 0.8874 -3.105 0.00289 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.32 on 61 degrees of freedom
Multiple R-squared: 0.1365, Adjusted R-squared: 0.1223
F-statistic: 9.641 on 1 and 61 DF, p-value: 0.002885
> 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.3130086 0.6260171 0.68699143
[2,] 0.1806926 0.3613853 0.81930736
[3,] 0.1634280 0.3268561 0.83657195
[4,] 0.2047326 0.4094652 0.79526741
[5,] 0.5629700 0.8740601 0.43703004
[6,] 0.5549047 0.8901906 0.44509531
[7,] 0.4543358 0.9086716 0.54566422
[8,] 0.4059929 0.8119859 0.59400706
[9,] 0.7180363 0.5639273 0.28196367
[10,] 0.9422407 0.1155186 0.05775928
[11,] 0.9189761 0.1620479 0.08102394
[12,] 0.8823669 0.2352662 0.11763311
[13,] 0.8429439 0.3141122 0.15705611
[14,] 0.8052321 0.3895357 0.19476786
[15,] 0.8559124 0.2881752 0.14408761
[16,] 0.8232387 0.3535226 0.17676131
[17,] 0.7740602 0.4518795 0.22593977
[18,] 0.7667205 0.4665590 0.23327948
[19,] 0.7169184 0.5661631 0.28308156
[20,] 0.6887214 0.6225572 0.31127861
[21,] 0.7484102 0.5031796 0.25158980
[22,] 0.7465398 0.5069204 0.25346020
[23,] 0.6922531 0.6154939 0.30774694
[24,] 0.7271033 0.5457935 0.27289673
[25,] 0.6664392 0.6671216 0.33356078
[26,] 0.6151317 0.7697366 0.38486832
[27,] 0.5427620 0.9144761 0.45723803
[28,] 0.4869279 0.9738558 0.51307211
[29,] 0.4553786 0.9107571 0.54462143
[30,] 0.3982509 0.7965018 0.60174909
[31,] 0.4098711 0.8197422 0.59012890
[32,] 0.5039065 0.9921869 0.49609347
[33,] 0.4738582 0.9477163 0.52614183
[34,] 0.4056410 0.8112821 0.59435895
[35,] 0.3713089 0.7426177 0.62869113
[36,] 0.3293335 0.6586670 0.67066651
[37,] 0.4641697 0.9283393 0.53583034
[38,] 0.3909183 0.7818365 0.60908173
[39,] 0.3166174 0.6332349 0.68338257
[40,] 0.2906097 0.5812194 0.70939031
[41,] 0.3046012 0.6092024 0.69539878
[42,] 0.2666868 0.5333736 0.73331322
[43,] 0.2495612 0.4991224 0.75043879
[44,] 0.2566879 0.5133757 0.74331214
[45,] 0.2237577 0.4475154 0.77624229
[46,] 0.1918122 0.3836245 0.80818776
[47,] 0.5564389 0.8871223 0.44356114
[48,] 0.5469476 0.9061048 0.45305239
[49,] 0.6914817 0.6170367 0.30851834
[50,] 0.6053652 0.7892696 0.39463480
[51,] 0.4860976 0.9721951 0.51390243
[52,] 0.3743463 0.7486927 0.62565366
[53,] 0.2485879 0.4971757 0.75141214
[54,] 0.1696302 0.3392605 0.83036977
> postscript(file="/var/www/html/rcomp/tmp/1qilg1258989416.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/23lk41258989416.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/3xxv41258989416.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/4vzi21258989416.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/5tgh21258989416.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 = 63
Frequency = 1
1 2 3 4 5 6
4.28166667 0.22166667 1.32166667 -0.74833333 3.12166667 2.53166667
7 8 9 10 11 12
-0.98833333 -2.34833333 7.63166667 4.66166667 1.65166667 -0.70833333
13 14 15 16 17 18
-5.87833333 -7.80833333 1.83166667 0.35166667 1.54166667 2.11166667
19 20 21 22 23 24
-4.70833333 -1.87833333 1.22166667 3.29166667 -1.42833333 -2.55833333
25 26 27 28 29 30
-4.77833333 -3.38833333 1.31166667 4.22166667 -0.95833333 1.65166667
31 32 33 34 35 36
-0.02833333 -1.80833333 -2.64833333 1.55166667 -3.67833333 -4.78833333
37 38 39 40 41 42
-1.78833333 1.31166667 3.21166667 -0.94833333 6.22166667 -1.38833333
43 44 45 46 47 48
0.06714286 2.97714286 4.07714286 2.34714286 -2.62285714 -3.62285714
49 50 51 52 53 54
-2.59285714 2.52714286 -7.89285714 -2.80285714 5.39714286 1.63714286
55 56 57 58 59 60
-0.57285714 1.36714286 0.07714286 -2.02285714 4.39714286 1.09714286
61 62 63
-5.60285714 2.34714286 -0.58285714
> postscript(file="/var/www/html/rcomp/tmp/6be551258989416.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 = 63
Frequency = 1
lag(myerror, k = 1) myerror
0 4.28166667 NA
1 0.22166667 4.28166667
2 1.32166667 0.22166667
3 -0.74833333 1.32166667
4 3.12166667 -0.74833333
5 2.53166667 3.12166667
6 -0.98833333 2.53166667
7 -2.34833333 -0.98833333
8 7.63166667 -2.34833333
9 4.66166667 7.63166667
10 1.65166667 4.66166667
11 -0.70833333 1.65166667
12 -5.87833333 -0.70833333
13 -7.80833333 -5.87833333
14 1.83166667 -7.80833333
15 0.35166667 1.83166667
16 1.54166667 0.35166667
17 2.11166667 1.54166667
18 -4.70833333 2.11166667
19 -1.87833333 -4.70833333
20 1.22166667 -1.87833333
21 3.29166667 1.22166667
22 -1.42833333 3.29166667
23 -2.55833333 -1.42833333
24 -4.77833333 -2.55833333
25 -3.38833333 -4.77833333
26 1.31166667 -3.38833333
27 4.22166667 1.31166667
28 -0.95833333 4.22166667
29 1.65166667 -0.95833333
30 -0.02833333 1.65166667
31 -1.80833333 -0.02833333
32 -2.64833333 -1.80833333
33 1.55166667 -2.64833333
34 -3.67833333 1.55166667
35 -4.78833333 -3.67833333
36 -1.78833333 -4.78833333
37 1.31166667 -1.78833333
38 3.21166667 1.31166667
39 -0.94833333 3.21166667
40 6.22166667 -0.94833333
41 -1.38833333 6.22166667
42 0.06714286 -1.38833333
43 2.97714286 0.06714286
44 4.07714286 2.97714286
45 2.34714286 4.07714286
46 -2.62285714 2.34714286
47 -3.62285714 -2.62285714
48 -2.59285714 -3.62285714
49 2.52714286 -2.59285714
50 -7.89285714 2.52714286
51 -2.80285714 -7.89285714
52 5.39714286 -2.80285714
53 1.63714286 5.39714286
54 -0.57285714 1.63714286
55 1.36714286 -0.57285714
56 0.07714286 1.36714286
57 -2.02285714 0.07714286
58 4.39714286 -2.02285714
59 1.09714286 4.39714286
60 -5.60285714 1.09714286
61 2.34714286 -5.60285714
62 -0.58285714 2.34714286
63 NA -0.58285714
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.22166667 4.28166667
[2,] 1.32166667 0.22166667
[3,] -0.74833333 1.32166667
[4,] 3.12166667 -0.74833333
[5,] 2.53166667 3.12166667
[6,] -0.98833333 2.53166667
[7,] -2.34833333 -0.98833333
[8,] 7.63166667 -2.34833333
[9,] 4.66166667 7.63166667
[10,] 1.65166667 4.66166667
[11,] -0.70833333 1.65166667
[12,] -5.87833333 -0.70833333
[13,] -7.80833333 -5.87833333
[14,] 1.83166667 -7.80833333
[15,] 0.35166667 1.83166667
[16,] 1.54166667 0.35166667
[17,] 2.11166667 1.54166667
[18,] -4.70833333 2.11166667
[19,] -1.87833333 -4.70833333
[20,] 1.22166667 -1.87833333
[21,] 3.29166667 1.22166667
[22,] -1.42833333 3.29166667
[23,] -2.55833333 -1.42833333
[24,] -4.77833333 -2.55833333
[25,] -3.38833333 -4.77833333
[26,] 1.31166667 -3.38833333
[27,] 4.22166667 1.31166667
[28,] -0.95833333 4.22166667
[29,] 1.65166667 -0.95833333
[30,] -0.02833333 1.65166667
[31,] -1.80833333 -0.02833333
[32,] -2.64833333 -1.80833333
[33,] 1.55166667 -2.64833333
[34,] -3.67833333 1.55166667
[35,] -4.78833333 -3.67833333
[36,] -1.78833333 -4.78833333
[37,] 1.31166667 -1.78833333
[38,] 3.21166667 1.31166667
[39,] -0.94833333 3.21166667
[40,] 6.22166667 -0.94833333
[41,] -1.38833333 6.22166667
[42,] 0.06714286 -1.38833333
[43,] 2.97714286 0.06714286
[44,] 4.07714286 2.97714286
[45,] 2.34714286 4.07714286
[46,] -2.62285714 2.34714286
[47,] -3.62285714 -2.62285714
[48,] -2.59285714 -3.62285714
[49,] 2.52714286 -2.59285714
[50,] -7.89285714 2.52714286
[51,] -2.80285714 -7.89285714
[52,] 5.39714286 -2.80285714
[53,] 1.63714286 5.39714286
[54,] -0.57285714 1.63714286
[55,] 1.36714286 -0.57285714
[56,] 0.07714286 1.36714286
[57,] -2.02285714 0.07714286
[58,] 4.39714286 -2.02285714
[59,] 1.09714286 4.39714286
[60,] -5.60285714 1.09714286
[61,] 2.34714286 -5.60285714
[62,] -0.58285714 2.34714286
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.22166667 4.28166667
2 1.32166667 0.22166667
3 -0.74833333 1.32166667
4 3.12166667 -0.74833333
5 2.53166667 3.12166667
6 -0.98833333 2.53166667
7 -2.34833333 -0.98833333
8 7.63166667 -2.34833333
9 4.66166667 7.63166667
10 1.65166667 4.66166667
11 -0.70833333 1.65166667
12 -5.87833333 -0.70833333
13 -7.80833333 -5.87833333
14 1.83166667 -7.80833333
15 0.35166667 1.83166667
16 1.54166667 0.35166667
17 2.11166667 1.54166667
18 -4.70833333 2.11166667
19 -1.87833333 -4.70833333
20 1.22166667 -1.87833333
21 3.29166667 1.22166667
22 -1.42833333 3.29166667
23 -2.55833333 -1.42833333
24 -4.77833333 -2.55833333
25 -3.38833333 -4.77833333
26 1.31166667 -3.38833333
27 4.22166667 1.31166667
28 -0.95833333 4.22166667
29 1.65166667 -0.95833333
30 -0.02833333 1.65166667
31 -1.80833333 -0.02833333
32 -2.64833333 -1.80833333
33 1.55166667 -2.64833333
34 -3.67833333 1.55166667
35 -4.78833333 -3.67833333
36 -1.78833333 -4.78833333
37 1.31166667 -1.78833333
38 3.21166667 1.31166667
39 -0.94833333 3.21166667
40 6.22166667 -0.94833333
41 -1.38833333 6.22166667
42 0.06714286 -1.38833333
43 2.97714286 0.06714286
44 4.07714286 2.97714286
45 2.34714286 4.07714286
46 -2.62285714 2.34714286
47 -3.62285714 -2.62285714
48 -2.59285714 -3.62285714
49 2.52714286 -2.59285714
50 -7.89285714 2.52714286
51 -2.80285714 -7.89285714
52 5.39714286 -2.80285714
53 1.63714286 5.39714286
54 -0.57285714 1.63714286
55 1.36714286 -0.57285714
56 0.07714286 1.36714286
57 -2.02285714 0.07714286
58 4.39714286 -2.02285714
59 1.09714286 4.39714286
60 -5.60285714 1.09714286
61 2.34714286 -5.60285714
62 -0.58285714 2.34714286
> 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/7mw5y1258989416.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/8x8py1258989416.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/9rnqw1258989416.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/10nyda1258989416.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/1132j51258989416.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/12aufj1258989416.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/132lv01258989416.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/14dlje1258989416.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/15a5wa1258989416.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/16919l1258989416.tab")
+ }
>
> system("convert tmp/1qilg1258989416.ps tmp/1qilg1258989416.png")
> system("convert tmp/23lk41258989416.ps tmp/23lk41258989416.png")
> system("convert tmp/3xxv41258989416.ps tmp/3xxv41258989416.png")
> system("convert tmp/4vzi21258989416.ps tmp/4vzi21258989416.png")
> system("convert tmp/5tgh21258989416.ps tmp/5tgh21258989416.png")
> system("convert tmp/6be551258989416.ps tmp/6be551258989416.png")
> system("convert tmp/7mw5y1258989416.ps tmp/7mw5y1258989416.png")
> system("convert tmp/8x8py1258989416.ps tmp/8x8py1258989416.png")
> system("convert tmp/9rnqw1258989416.ps tmp/9rnqw1258989416.png")
> system("convert tmp/10nyda1258989416.ps tmp/10nyda1258989416.png")
>
>
> proc.time()
user system elapsed
2.557 1.578 3.567