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(100.03,2,100.25,1.8,99.6,2.7,100.16,2.3,100.49,1.9,99.72,2,100.14,2.3,98.48,2.8,100.38,2.4,101.45,2.3,98.42,2.7,98.6,2.7,100.06,2.9,98.62,3,100.84,2.2,100.02,2.3,97.95,2.8,98.32,2.8,98.27,2.8,97.22,2.2,99.28,2.6,100.38,2.8,99.02,2.5,100.32,2.4,99.81,2.3,100.6,1.9,101.19,1.7,100.47,2,101.77,2.1,102.32,1.7,102.39,1.8,101.16,1.8,100.63,1.8,101.48,1.3,101.44,1.3,100.09,1.3,100.7,1.2,100.78,1.4,99.81,2.2,98.45,2.9,98.49,3.1,97.48,3.5,97.91,3.6,96.94,4.4,98.53,4.1,96.82,5.1,95.76,5.8,95.27,5.9,97.32,5.4,96.68,5.5,97.87,4.8,97.42,3.2,97.94,2.7,99.52,2.1,100.99,1.9,99.92,0.6,101.97,0.7,101.58,-0.2,99.54,-1,100.83,-1.7),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 100.03 2.0
2 100.25 1.8
3 99.60 2.7
4 100.16 2.3
5 100.49 1.9
6 99.72 2.0
7 100.14 2.3
8 98.48 2.8
9 100.38 2.4
10 101.45 2.3
11 98.42 2.7
12 98.60 2.7
13 100.06 2.9
14 98.62 3.0
15 100.84 2.2
16 100.02 2.3
17 97.95 2.8
18 98.32 2.8
19 98.27 2.8
20 97.22 2.2
21 99.28 2.6
22 100.38 2.8
23 99.02 2.5
24 100.32 2.4
25 99.81 2.3
26 100.60 1.9
27 101.19 1.7
28 100.47 2.0
29 101.77 2.1
30 102.32 1.7
31 102.39 1.8
32 101.16 1.8
33 100.63 1.8
34 101.48 1.3
35 101.44 1.3
36 100.09 1.3
37 100.70 1.2
38 100.78 1.4
39 99.81 2.2
40 98.45 2.9
41 98.49 3.1
42 97.48 3.5
43 97.91 3.6
44 96.94 4.4
45 98.53 4.1
46 96.82 5.1
47 95.76 5.8
48 95.27 5.9
49 97.32 5.4
50 96.68 5.5
51 97.87 4.8
52 97.42 3.2
53 97.94 2.7
54 99.52 2.1
55 100.99 1.9
56 99.92 0.6
57 101.97 0.7
58 101.58 -0.2
59 99.54 -1.0
60 100.83 -1.7
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
101.6564 -0.8785
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.9949 -0.6924 0.1143 0.6526 2.3150
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 101.65635 0.27953 363.673 < 2e-16 ***
X -0.87850 0.09868 -8.903 1.92e-12 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.078 on 58 degrees of freedom
Multiple R-squared: 0.5774, Adjusted R-squared: 0.5702
F-statistic: 79.26 on 1 and 58 DF, p-value: 1.920e-12
> 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.008118698 0.01623740 0.9918813
[2,] 0.007424128 0.01484826 0.9925759
[3,] 0.002058310 0.00411662 0.9979417
[4,] 0.009640839 0.01928168 0.9903592
[5,] 0.009979284 0.01995857 0.9900207
[6,] 0.072861568 0.14572314 0.9271384
[7,] 0.081691955 0.16338391 0.9183080
[8,] 0.061132249 0.12226450 0.9388678
[9,] 0.071983514 0.14396703 0.9280165
[10,] 0.045514735 0.09102947 0.9544853
[11,] 0.040239234 0.08047847 0.9597608
[12,] 0.023471790 0.04694358 0.9765282
[13,] 0.033333106 0.06666621 0.9666669
[14,] 0.026710032 0.05342006 0.9732900
[15,] 0.021189024 0.04237805 0.9788110
[16,] 0.245150992 0.49030198 0.7548490
[17,] 0.184846623 0.36969325 0.8151534
[18,] 0.224154016 0.44830803 0.7758460
[19,] 0.176268521 0.35253704 0.8237315
[20,] 0.151072828 0.30214566 0.8489272
[21,] 0.109517142 0.21903428 0.8904829
[22,] 0.080997537 0.16199507 0.9190025
[23,] 0.066200373 0.13240075 0.9337996
[24,] 0.047196585 0.09439317 0.9528034
[25,] 0.095821342 0.19164268 0.9041787
[26,] 0.177658931 0.35531786 0.8223411
[27,] 0.370149362 0.74029872 0.6298506
[28,] 0.380146934 0.76029387 0.6198531
[29,] 0.354691086 0.70938217 0.6453089
[30,] 0.392272968 0.78454594 0.6077270
[31,] 0.445776619 0.89155324 0.5542234
[32,] 0.474723953 0.94944791 0.5252760
[33,] 0.470748039 0.94149608 0.5292520
[34,] 0.472403933 0.94480787 0.5275961
[35,] 0.431126456 0.86225291 0.5688735
[36,] 0.359627811 0.71925562 0.6403722
[37,] 0.287254450 0.57450890 0.7127455
[38,] 0.240568855 0.48113771 0.7594311
[39,] 0.181356252 0.36271250 0.8186437
[40,] 0.143498230 0.28699646 0.8565018
[41,] 0.150335755 0.30067151 0.8496642
[42,] 0.114311456 0.22862291 0.8856885
[43,] 0.092949702 0.18589940 0.9070503
[44,] 0.113701860 0.22740372 0.8862981
[45,] 0.090470477 0.18094095 0.9095295
[46,] 0.066815488 0.13363098 0.9331845
[47,] 0.043290854 0.08658171 0.9567091
[48,] 0.075205442 0.15041088 0.9247946
[49,] 0.242254566 0.48450913 0.7577454
[50,] 0.308794577 0.61758915 0.6912054
[51,] 0.195241288 0.39048258 0.8047587
> postscript(file="/var/www/html/rcomp/tmp/1sqco1258702555.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/22kb41258702555.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/3krc71258702555.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/4g4151258702555.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/5uiba1258702555.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
0.13065115 0.17495093 0.31560194 0.52420149 0.50280104 -0.17934885
7 8 9 10 11 12
0.50420149 -0.71654795 0.83205160 1.81420149 -0.86439806 -0.68439806
13 14 15 16 17 18
0.95130217 -0.40084772 1.11635138 0.38420149 -1.24654795 -0.87654795
19 20 21 22 23 24
-0.92654795 -2.50364862 -0.09224817 1.18345205 -0.44009828 0.77205160
25 26 27 28 29 30
0.17420149 0.61280104 1.02710081 0.57065115 1.95850127 2.15710081
31 32 33 34 35 36
2.31495093 1.08495093 0.55495093 0.96570036 0.92570036 -0.42429964
37 38 39 40 41 42
0.09785025 0.35355048 0.08635138 -0.65869783 -0.44299761 -1.10159716
43 44 45 46 47 48
-0.58374705 -0.85094615 0.47550352 -0.35599536 -0.80104457 -1.20319446
49 50 51 52 53 54
0.40755498 -0.14459491 0.43045430 -1.42514750 -1.34439806 -0.29149873
55 56 57 58 59 60
1.00280104 -1.20925042 0.92859969 -0.25205132 -2.99485222 -2.31980301
> postscript(file="/var/www/html/rcomp/tmp/6m50f1258702555.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 0.13065115 NA
1 0.17495093 0.13065115
2 0.31560194 0.17495093
3 0.52420149 0.31560194
4 0.50280104 0.52420149
5 -0.17934885 0.50280104
6 0.50420149 -0.17934885
7 -0.71654795 0.50420149
8 0.83205160 -0.71654795
9 1.81420149 0.83205160
10 -0.86439806 1.81420149
11 -0.68439806 -0.86439806
12 0.95130217 -0.68439806
13 -0.40084772 0.95130217
14 1.11635138 -0.40084772
15 0.38420149 1.11635138
16 -1.24654795 0.38420149
17 -0.87654795 -1.24654795
18 -0.92654795 -0.87654795
19 -2.50364862 -0.92654795
20 -0.09224817 -2.50364862
21 1.18345205 -0.09224817
22 -0.44009828 1.18345205
23 0.77205160 -0.44009828
24 0.17420149 0.77205160
25 0.61280104 0.17420149
26 1.02710081 0.61280104
27 0.57065115 1.02710081
28 1.95850127 0.57065115
29 2.15710081 1.95850127
30 2.31495093 2.15710081
31 1.08495093 2.31495093
32 0.55495093 1.08495093
33 0.96570036 0.55495093
34 0.92570036 0.96570036
35 -0.42429964 0.92570036
36 0.09785025 -0.42429964
37 0.35355048 0.09785025
38 0.08635138 0.35355048
39 -0.65869783 0.08635138
40 -0.44299761 -0.65869783
41 -1.10159716 -0.44299761
42 -0.58374705 -1.10159716
43 -0.85094615 -0.58374705
44 0.47550352 -0.85094615
45 -0.35599536 0.47550352
46 -0.80104457 -0.35599536
47 -1.20319446 -0.80104457
48 0.40755498 -1.20319446
49 -0.14459491 0.40755498
50 0.43045430 -0.14459491
51 -1.42514750 0.43045430
52 -1.34439806 -1.42514750
53 -0.29149873 -1.34439806
54 1.00280104 -0.29149873
55 -1.20925042 1.00280104
56 0.92859969 -1.20925042
57 -0.25205132 0.92859969
58 -2.99485222 -0.25205132
59 -2.31980301 -2.99485222
60 NA -2.31980301
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.17495093 0.13065115
[2,] 0.31560194 0.17495093
[3,] 0.52420149 0.31560194
[4,] 0.50280104 0.52420149
[5,] -0.17934885 0.50280104
[6,] 0.50420149 -0.17934885
[7,] -0.71654795 0.50420149
[8,] 0.83205160 -0.71654795
[9,] 1.81420149 0.83205160
[10,] -0.86439806 1.81420149
[11,] -0.68439806 -0.86439806
[12,] 0.95130217 -0.68439806
[13,] -0.40084772 0.95130217
[14,] 1.11635138 -0.40084772
[15,] 0.38420149 1.11635138
[16,] -1.24654795 0.38420149
[17,] -0.87654795 -1.24654795
[18,] -0.92654795 -0.87654795
[19,] -2.50364862 -0.92654795
[20,] -0.09224817 -2.50364862
[21,] 1.18345205 -0.09224817
[22,] -0.44009828 1.18345205
[23,] 0.77205160 -0.44009828
[24,] 0.17420149 0.77205160
[25,] 0.61280104 0.17420149
[26,] 1.02710081 0.61280104
[27,] 0.57065115 1.02710081
[28,] 1.95850127 0.57065115
[29,] 2.15710081 1.95850127
[30,] 2.31495093 2.15710081
[31,] 1.08495093 2.31495093
[32,] 0.55495093 1.08495093
[33,] 0.96570036 0.55495093
[34,] 0.92570036 0.96570036
[35,] -0.42429964 0.92570036
[36,] 0.09785025 -0.42429964
[37,] 0.35355048 0.09785025
[38,] 0.08635138 0.35355048
[39,] -0.65869783 0.08635138
[40,] -0.44299761 -0.65869783
[41,] -1.10159716 -0.44299761
[42,] -0.58374705 -1.10159716
[43,] -0.85094615 -0.58374705
[44,] 0.47550352 -0.85094615
[45,] -0.35599536 0.47550352
[46,] -0.80104457 -0.35599536
[47,] -1.20319446 -0.80104457
[48,] 0.40755498 -1.20319446
[49,] -0.14459491 0.40755498
[50,] 0.43045430 -0.14459491
[51,] -1.42514750 0.43045430
[52,] -1.34439806 -1.42514750
[53,] -0.29149873 -1.34439806
[54,] 1.00280104 -0.29149873
[55,] -1.20925042 1.00280104
[56,] 0.92859969 -1.20925042
[57,] -0.25205132 0.92859969
[58,] -2.99485222 -0.25205132
[59,] -2.31980301 -2.99485222
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.17495093 0.13065115
2 0.31560194 0.17495093
3 0.52420149 0.31560194
4 0.50280104 0.52420149
5 -0.17934885 0.50280104
6 0.50420149 -0.17934885
7 -0.71654795 0.50420149
8 0.83205160 -0.71654795
9 1.81420149 0.83205160
10 -0.86439806 1.81420149
11 -0.68439806 -0.86439806
12 0.95130217 -0.68439806
13 -0.40084772 0.95130217
14 1.11635138 -0.40084772
15 0.38420149 1.11635138
16 -1.24654795 0.38420149
17 -0.87654795 -1.24654795
18 -0.92654795 -0.87654795
19 -2.50364862 -0.92654795
20 -0.09224817 -2.50364862
21 1.18345205 -0.09224817
22 -0.44009828 1.18345205
23 0.77205160 -0.44009828
24 0.17420149 0.77205160
25 0.61280104 0.17420149
26 1.02710081 0.61280104
27 0.57065115 1.02710081
28 1.95850127 0.57065115
29 2.15710081 1.95850127
30 2.31495093 2.15710081
31 1.08495093 2.31495093
32 0.55495093 1.08495093
33 0.96570036 0.55495093
34 0.92570036 0.96570036
35 -0.42429964 0.92570036
36 0.09785025 -0.42429964
37 0.35355048 0.09785025
38 0.08635138 0.35355048
39 -0.65869783 0.08635138
40 -0.44299761 -0.65869783
41 -1.10159716 -0.44299761
42 -0.58374705 -1.10159716
43 -0.85094615 -0.58374705
44 0.47550352 -0.85094615
45 -0.35599536 0.47550352
46 -0.80104457 -0.35599536
47 -1.20319446 -0.80104457
48 0.40755498 -1.20319446
49 -0.14459491 0.40755498
50 0.43045430 -0.14459491
51 -1.42514750 0.43045430
52 -1.34439806 -1.42514750
53 -0.29149873 -1.34439806
54 1.00280104 -0.29149873
55 -1.20925042 1.00280104
56 0.92859969 -1.20925042
57 -0.25205132 0.92859969
58 -2.99485222 -0.25205132
59 -2.31980301 -2.99485222
> 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/7c0wr1258702555.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/8drda1258702555.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/99m2q1258702555.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/10mwh81258702555.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/11ifew1258702555.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/12jyg91258702555.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/13qnep1258702555.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/14noeu1258702555.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/15r59s1258702555.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/16n1661258702555.tab")
+ }
>
> system("convert tmp/1sqco1258702555.ps tmp/1sqco1258702555.png")
> system("convert tmp/22kb41258702555.ps tmp/22kb41258702555.png")
> system("convert tmp/3krc71258702555.ps tmp/3krc71258702555.png")
> system("convert tmp/4g4151258702555.ps tmp/4g4151258702555.png")
> system("convert tmp/5uiba1258702555.ps tmp/5uiba1258702555.png")
> system("convert tmp/6m50f1258702555.ps tmp/6m50f1258702555.png")
> system("convert tmp/7c0wr1258702555.ps tmp/7c0wr1258702555.png")
> system("convert tmp/8drda1258702555.ps tmp/8drda1258702555.png")
> system("convert tmp/99m2q1258702555.ps tmp/99m2q1258702555.png")
> system("convert tmp/10mwh81258702555.ps tmp/10mwh81258702555.png")
>
>
> proc.time()
user system elapsed
2.432 1.595 3.030