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(2756.76,0,2849.27,0,2921.44,0,2981.85,0,3080.58,0,3106.22,0,3119.31,0,3061.26,0,3097.31,0,3161.69,0,3257.16,0,3277.01,0,3295.32,0,3363.99,0,3494.17,0,3667.03,1,3813.06,1,3917.96,1,3895.51,1,3801.06,1,3570.12,0,3701.61,1,3862.27,1,3970.1,1,4138.52,1,4199.75,1,4290.89,1,4443.91,1,4502.64,1,4356.98,1,4591.27,1,4696.96,1,4621.4,1,4562.84,1,4202.52,1,4296.49,1,4435.23,1,4105.18,1,4116.68,1,3844.49,1,3720.98,1,3674.4,1,3857.62,1,3801.06,1,3504.37,1,3032.6,1,3047.03,0,2962.34,1,2197.82,1,2014.45,1,1862.83,0,1905.41,0,1810.99,0,1670.07,0,1864.44,0,2052.02,0,2029.6,0,2070.83,0,2293.41,0,2443.27,0),dim=c(2,60),dimnames=list(c('bel20','rent'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('bel20','rent'),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 = 'Include Monthly 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
bel20 rent M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11
1 2756.76 0 1 0 0 0 0 0 0 0 0 0 0
2 2849.27 0 0 1 0 0 0 0 0 0 0 0 0
3 2921.44 0 0 0 1 0 0 0 0 0 0 0 0
4 2981.85 0 0 0 0 1 0 0 0 0 0 0 0
5 3080.58 0 0 0 0 0 1 0 0 0 0 0 0
6 3106.22 0 0 0 0 0 0 1 0 0 0 0 0
7 3119.31 0 0 0 0 0 0 0 1 0 0 0 0
8 3061.26 0 0 0 0 0 0 0 0 1 0 0 0
9 3097.31 0 0 0 0 0 0 0 0 0 1 0 0
10 3161.69 0 0 0 0 0 0 0 0 0 0 1 0
11 3257.16 0 0 0 0 0 0 0 0 0 0 0 1
12 3277.01 0 0 0 0 0 0 0 0 0 0 0 0
13 3295.32 0 1 0 0 0 0 0 0 0 0 0 0
14 3363.99 0 0 1 0 0 0 0 0 0 0 0 0
15 3494.17 0 0 0 1 0 0 0 0 0 0 0 0
16 3667.03 1 0 0 0 1 0 0 0 0 0 0 0
17 3813.06 1 0 0 0 0 1 0 0 0 0 0 0
18 3917.96 1 0 0 0 0 0 1 0 0 0 0 0
19 3895.51 1 0 0 0 0 0 0 1 0 0 0 0
20 3801.06 1 0 0 0 0 0 0 0 1 0 0 0
21 3570.12 0 0 0 0 0 0 0 0 0 1 0 0
22 3701.61 1 0 0 0 0 0 0 0 0 0 1 0
23 3862.27 1 0 0 0 0 0 0 0 0 0 0 1
24 3970.10 1 0 0 0 0 0 0 0 0 0 0 0
25 4138.52 1 1 0 0 0 0 0 0 0 0 0 0
26 4199.75 1 0 1 0 0 0 0 0 0 0 0 0
27 4290.89 1 0 0 1 0 0 0 0 0 0 0 0
28 4443.91 1 0 0 0 1 0 0 0 0 0 0 0
29 4502.64 1 0 0 0 0 1 0 0 0 0 0 0
30 4356.98 1 0 0 0 0 0 1 0 0 0 0 0
31 4591.27 1 0 0 0 0 0 0 1 0 0 0 0
32 4696.96 1 0 0 0 0 0 0 0 1 0 0 0
33 4621.40 1 0 0 0 0 0 0 0 0 1 0 0
34 4562.84 1 0 0 0 0 0 0 0 0 0 1 0
35 4202.52 1 0 0 0 0 0 0 0 0 0 0 1
36 4296.49 1 0 0 0 0 0 0 0 0 0 0 0
37 4435.23 1 1 0 0 0 0 0 0 0 0 0 0
38 4105.18 1 0 1 0 0 0 0 0 0 0 0 0
39 4116.68 1 0 0 1 0 0 0 0 0 0 0 0
40 3844.49 1 0 0 0 1 0 0 0 0 0 0 0
41 3720.98 1 0 0 0 0 1 0 0 0 0 0 0
42 3674.40 1 0 0 0 0 0 1 0 0 0 0 0
43 3857.62 1 0 0 0 0 0 0 1 0 0 0 0
44 3801.06 1 0 0 0 0 0 0 0 1 0 0 0
45 3504.37 1 0 0 0 0 0 0 0 0 1 0 0
46 3032.60 1 0 0 0 0 0 0 0 0 0 1 0
47 3047.03 0 0 0 0 0 0 0 0 0 0 0 1
48 2962.34 1 0 0 0 0 0 0 0 0 0 0 0
49 2197.82 1 1 0 0 0 0 0 0 0 0 0 0
50 2014.45 1 0 1 0 0 0 0 0 0 0 0 0
51 1862.83 0 0 0 1 0 0 0 0 0 0 0 0
52 1905.41 0 0 0 0 1 0 0 0 0 0 0 0
53 1810.99 0 0 0 0 0 1 0 0 0 0 0 0
54 1670.07 0 0 0 0 0 0 1 0 0 0 0 0
55 1864.44 0 0 0 0 0 0 0 1 0 0 0 0
56 2052.02 0 0 0 0 0 0 0 0 1 0 0 0
57 2029.60 0 0 0 0 0 0 0 0 0 1 0 0
58 2070.83 0 0 0 0 0 0 0 0 0 0 1 0
59 2293.41 0 0 0 0 0 0 0 0 0 0 0 1
60 2443.27 0 0 0 0 0 0 0 0 0 0 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) rent M1 M2 M3 M4
2661.166 1214.460 -25.112 -83.314 190.252 -21.304
M5 M6 M7 M8 M9 M10
-4.192 -44.716 75.788 92.630 217.610 -83.928
M11
185.528
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1777.9 -203.6 107.6 440.1 786.1
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2661.166 318.175 8.364 7.33e-11 ***
rent 1214.460 176.764 6.871 1.28e-08 ***
M1 -25.112 424.233 -0.059 0.953
M2 -83.314 424.233 -0.196 0.845
M3 190.252 425.704 0.447 0.657
M4 -21.304 424.233 -0.050 0.960
M5 -4.192 424.233 -0.010 0.992
M6 -44.716 424.233 -0.105 0.917
M7 75.788 424.233 0.179 0.859
M8 92.630 424.233 0.218 0.828
M9 217.610 425.704 0.511 0.612
M10 -83.928 424.233 -0.198 0.844
M11 185.528 425.704 0.436 0.665
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 670.8 on 47 degrees of freedom
Multiple R-squared: 0.5031, Adjusted R-squared: 0.3762
F-statistic: 3.965 on 12 and 47 DF, p-value: 0.0003144
> 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,] 2.025477e-01 0.4050953265 0.7974523
[2,] 9.046560e-02 0.1809311902 0.9095344
[3,] 3.687741e-02 0.0737548221 0.9631226
[4,] 1.358641e-02 0.0271728211 0.9864136
[5,] 4.667408e-03 0.0093348162 0.9953326
[6,] 4.982412e-03 0.0099648250 0.9950176
[7,] 1.960383e-03 0.0039207667 0.9980396
[8,] 7.523950e-04 0.0015047900 0.9992476
[9,] 2.352750e-04 0.0004705500 0.9997647
[10,] 1.929000e-04 0.0003858001 0.9998071
[11,] 1.555635e-04 0.0003111269 0.9998444
[12,] 7.267967e-05 0.0001453593 0.9999273
[13,] 2.097057e-04 0.0004194115 0.9997903
[14,] 3.311381e-04 0.0006622763 0.9996689
[15,] 2.452609e-04 0.0004905218 0.9997547
[16,] 3.530917e-04 0.0007061834 0.9996469
[17,] 8.088302e-04 0.0016176604 0.9991912
[18,] 6.594880e-04 0.0013189760 0.9993405
[19,] 1.290806e-03 0.0025816112 0.9987092
[20,] 5.688112e-04 0.0011376224 0.9994312
[21,] 3.616675e-04 0.0007233350 0.9996383
[22,] 5.329801e-03 0.0106596026 0.9946702
[23,] 1.400463e-01 0.2800925620 0.8599537
[24,] 1.418159e-01 0.2836318216 0.8581841
[25,] 1.096708e-01 0.2193415414 0.8903292
[26,] 9.588401e-02 0.1917680221 0.9041160
[27,] 1.078569e-01 0.2157137892 0.8921431
[28,] 1.474879e-01 0.2949757101 0.8525121
[29,] 1.854019e-01 0.3708037049 0.8145981
> postscript(file="/var/www/html/rcomp/tmp/17l4p1259182382.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/2mgix1259182382.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/3amwp1259182382.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/4sitv1259182382.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/57n8y1259182382.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
120.705833 271.417833 70.021889 341.987833 423.605833 489.769833
7 8 9 10 11 12
382.355833 307.463833 218.533889 584.451833 410.465889 615.843833
13 14 15 16 17 18
659.265833 786.137833 642.751889 -187.291889 -58.373889 87.050111
19 20 21 22 23 24
-55.903889 -167.195889 691.343889 -90.087889 -198.883833 94.474111
25 26 27 28 29 30
288.006111 407.438111 225.012167 589.588111 631.206111 526.070111
31 32 33 34 35 36
639.856111 728.704111 528.164167 771.142111 141.366167 420.864111
37 38 39 40 41 42
584.716111 312.868111 50.802167 -9.831889 -150.453889 -156.509889
43 44 45 46 47 48
-93.793889 -167.195889 -588.865833 -759.097889 200.335889 -913.285889
49 50 51 52 53 54
-1652.693889 -1777.861889 -988.588111 -734.452167 -845.984167 -946.380167
55 56 57 58 59 60
-872.514167 -701.776167 -849.176111 -506.408167 -553.284111 -217.896167
> postscript(file="/var/www/html/rcomp/tmp/6ej2t1259182382.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 120.705833 NA
1 271.417833 120.705833
2 70.021889 271.417833
3 341.987833 70.021889
4 423.605833 341.987833
5 489.769833 423.605833
6 382.355833 489.769833
7 307.463833 382.355833
8 218.533889 307.463833
9 584.451833 218.533889
10 410.465889 584.451833
11 615.843833 410.465889
12 659.265833 615.843833
13 786.137833 659.265833
14 642.751889 786.137833
15 -187.291889 642.751889
16 -58.373889 -187.291889
17 87.050111 -58.373889
18 -55.903889 87.050111
19 -167.195889 -55.903889
20 691.343889 -167.195889
21 -90.087889 691.343889
22 -198.883833 -90.087889
23 94.474111 -198.883833
24 288.006111 94.474111
25 407.438111 288.006111
26 225.012167 407.438111
27 589.588111 225.012167
28 631.206111 589.588111
29 526.070111 631.206111
30 639.856111 526.070111
31 728.704111 639.856111
32 528.164167 728.704111
33 771.142111 528.164167
34 141.366167 771.142111
35 420.864111 141.366167
36 584.716111 420.864111
37 312.868111 584.716111
38 50.802167 312.868111
39 -9.831889 50.802167
40 -150.453889 -9.831889
41 -156.509889 -150.453889
42 -93.793889 -156.509889
43 -167.195889 -93.793889
44 -588.865833 -167.195889
45 -759.097889 -588.865833
46 200.335889 -759.097889
47 -913.285889 200.335889
48 -1652.693889 -913.285889
49 -1777.861889 -1652.693889
50 -988.588111 -1777.861889
51 -734.452167 -988.588111
52 -845.984167 -734.452167
53 -946.380167 -845.984167
54 -872.514167 -946.380167
55 -701.776167 -872.514167
56 -849.176111 -701.776167
57 -506.408167 -849.176111
58 -553.284111 -506.408167
59 -217.896167 -553.284111
60 NA -217.896167
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 271.417833 120.705833
[2,] 70.021889 271.417833
[3,] 341.987833 70.021889
[4,] 423.605833 341.987833
[5,] 489.769833 423.605833
[6,] 382.355833 489.769833
[7,] 307.463833 382.355833
[8,] 218.533889 307.463833
[9,] 584.451833 218.533889
[10,] 410.465889 584.451833
[11,] 615.843833 410.465889
[12,] 659.265833 615.843833
[13,] 786.137833 659.265833
[14,] 642.751889 786.137833
[15,] -187.291889 642.751889
[16,] -58.373889 -187.291889
[17,] 87.050111 -58.373889
[18,] -55.903889 87.050111
[19,] -167.195889 -55.903889
[20,] 691.343889 -167.195889
[21,] -90.087889 691.343889
[22,] -198.883833 -90.087889
[23,] 94.474111 -198.883833
[24,] 288.006111 94.474111
[25,] 407.438111 288.006111
[26,] 225.012167 407.438111
[27,] 589.588111 225.012167
[28,] 631.206111 589.588111
[29,] 526.070111 631.206111
[30,] 639.856111 526.070111
[31,] 728.704111 639.856111
[32,] 528.164167 728.704111
[33,] 771.142111 528.164167
[34,] 141.366167 771.142111
[35,] 420.864111 141.366167
[36,] 584.716111 420.864111
[37,] 312.868111 584.716111
[38,] 50.802167 312.868111
[39,] -9.831889 50.802167
[40,] -150.453889 -9.831889
[41,] -156.509889 -150.453889
[42,] -93.793889 -156.509889
[43,] -167.195889 -93.793889
[44,] -588.865833 -167.195889
[45,] -759.097889 -588.865833
[46,] 200.335889 -759.097889
[47,] -913.285889 200.335889
[48,] -1652.693889 -913.285889
[49,] -1777.861889 -1652.693889
[50,] -988.588111 -1777.861889
[51,] -734.452167 -988.588111
[52,] -845.984167 -734.452167
[53,] -946.380167 -845.984167
[54,] -872.514167 -946.380167
[55,] -701.776167 -872.514167
[56,] -849.176111 -701.776167
[57,] -506.408167 -849.176111
[58,] -553.284111 -506.408167
[59,] -217.896167 -553.284111
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 271.417833 120.705833
2 70.021889 271.417833
3 341.987833 70.021889
4 423.605833 341.987833
5 489.769833 423.605833
6 382.355833 489.769833
7 307.463833 382.355833
8 218.533889 307.463833
9 584.451833 218.533889
10 410.465889 584.451833
11 615.843833 410.465889
12 659.265833 615.843833
13 786.137833 659.265833
14 642.751889 786.137833
15 -187.291889 642.751889
16 -58.373889 -187.291889
17 87.050111 -58.373889
18 -55.903889 87.050111
19 -167.195889 -55.903889
20 691.343889 -167.195889
21 -90.087889 691.343889
22 -198.883833 -90.087889
23 94.474111 -198.883833
24 288.006111 94.474111
25 407.438111 288.006111
26 225.012167 407.438111
27 589.588111 225.012167
28 631.206111 589.588111
29 526.070111 631.206111
30 639.856111 526.070111
31 728.704111 639.856111
32 528.164167 728.704111
33 771.142111 528.164167
34 141.366167 771.142111
35 420.864111 141.366167
36 584.716111 420.864111
37 312.868111 584.716111
38 50.802167 312.868111
39 -9.831889 50.802167
40 -150.453889 -9.831889
41 -156.509889 -150.453889
42 -93.793889 -156.509889
43 -167.195889 -93.793889
44 -588.865833 -167.195889
45 -759.097889 -588.865833
46 200.335889 -759.097889
47 -913.285889 200.335889
48 -1652.693889 -913.285889
49 -1777.861889 -1652.693889
50 -988.588111 -1777.861889
51 -734.452167 -988.588111
52 -845.984167 -734.452167
53 -946.380167 -845.984167
54 -872.514167 -946.380167
55 -701.776167 -872.514167
56 -849.176111 -701.776167
57 -506.408167 -849.176111
58 -553.284111 -506.408167
59 -217.896167 -553.284111
> 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/7lna01259182382.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/848m51259182382.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/9fo561259182382.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/10r8d61259182382.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/11pmm61259182382.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/124lqc1259182382.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/13lixt1259182382.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/14hz1x1259182382.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/15i9161259182382.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/16zjis1259182382.tab")
+ }
>
> system("convert tmp/17l4p1259182382.ps tmp/17l4p1259182382.png")
> system("convert tmp/2mgix1259182382.ps tmp/2mgix1259182382.png")
> system("convert tmp/3amwp1259182382.ps tmp/3amwp1259182382.png")
> system("convert tmp/4sitv1259182382.ps tmp/4sitv1259182382.png")
> system("convert tmp/57n8y1259182382.ps tmp/57n8y1259182382.png")
> system("convert tmp/6ej2t1259182382.ps tmp/6ej2t1259182382.png")
> system("convert tmp/7lna01259182382.ps tmp/7lna01259182382.png")
> system("convert tmp/848m51259182382.ps tmp/848m51259182382.png")
> system("convert tmp/9fo561259182382.ps tmp/9fo561259182382.png")
> system("convert tmp/10r8d61259182382.ps tmp/10r8d61259182382.png")
>
>
> proc.time()
user system elapsed
2.330 1.495 2.972