R version 2.7.0 (2008-04-22)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(3258.1,0,3140.1,0,3627.4,0,3279.4,0,3204,0,3515.6,0,3146.6,0,2271.7,0,3627.9,0,3553.4,0,3018.3,0,3355.4,0,3242,0,3311.1,0,4125.2,1,3423,0,3120.3,0,3863,0,3240.8,0,2837.4,0,3945,0,3684.1,0,3659.6,0,3769.6,0,3592.7,0,3754,0,4507.8,1,3853.2,0,3817.2,0,3958.4,0,3428.9,0,3125.7,0,3977,0,3983.3,0,4299.6,0,4306.9,0,4259.5,0,3986,0,4755.6,1,3925.6,0,4206.5,0,4323.4,0,3816.1,0,3410.7,0,4227.4,0,4296.9,0,4351.7,0,3800,0,4277,0,4100.2,0,4672.5,0,4189.9,0,4231.9,0,4654.9,0,4298.5,0,3635.9,0,4505.1,0,4891.9,0,4894.2,0,4093.2,0),dim=c(2,60),dimnames=list(c('France','Dummy'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('France','Dummy'),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 = '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
France Dummy M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 3258.1 0 1 0 0 0 0 0 0 0 0 0 0 1
2 3140.1 0 0 1 0 0 0 0 0 0 0 0 0 2
3 3627.4 0 0 0 1 0 0 0 0 0 0 0 0 3
4 3279.4 0 0 0 0 1 0 0 0 0 0 0 0 4
5 3204.0 0 0 0 0 0 1 0 0 0 0 0 0 5
6 3515.6 0 0 0 0 0 0 1 0 0 0 0 0 6
7 3146.6 0 0 0 0 0 0 0 1 0 0 0 0 7
8 2271.7 0 0 0 0 0 0 0 0 1 0 0 0 8
9 3627.9 0 0 0 0 0 0 0 0 0 1 0 0 9
10 3553.4 0 0 0 0 0 0 0 0 0 0 1 0 10
11 3018.3 0 0 0 0 0 0 0 0 0 0 0 1 11
12 3355.4 0 0 0 0 0 0 0 0 0 0 0 0 12
13 3242.0 0 1 0 0 0 0 0 0 0 0 0 0 13
14 3311.1 0 0 1 0 0 0 0 0 0 0 0 0 14
15 4125.2 1 0 0 1 0 0 0 0 0 0 0 0 15
16 3423.0 0 0 0 0 1 0 0 0 0 0 0 0 16
17 3120.3 0 0 0 0 0 1 0 0 0 0 0 0 17
18 3863.0 0 0 0 0 0 0 1 0 0 0 0 0 18
19 3240.8 0 0 0 0 0 0 0 1 0 0 0 0 19
20 2837.4 0 0 0 0 0 0 0 0 1 0 0 0 20
21 3945.0 0 0 0 0 0 0 0 0 0 1 0 0 21
22 3684.1 0 0 0 0 0 0 0 0 0 0 1 0 22
23 3659.6 0 0 0 0 0 0 0 0 0 0 0 1 23
24 3769.6 0 0 0 0 0 0 0 0 0 0 0 0 24
25 3592.7 0 1 0 0 0 0 0 0 0 0 0 0 25
26 3754.0 0 0 1 0 0 0 0 0 0 0 0 0 26
27 4507.8 1 0 0 1 0 0 0 0 0 0 0 0 27
28 3853.2 0 0 0 0 1 0 0 0 0 0 0 0 28
29 3817.2 0 0 0 0 0 1 0 0 0 0 0 0 29
30 3958.4 0 0 0 0 0 0 1 0 0 0 0 0 30
31 3428.9 0 0 0 0 0 0 0 1 0 0 0 0 31
32 3125.7 0 0 0 0 0 0 0 0 1 0 0 0 32
33 3977.0 0 0 0 0 0 0 0 0 0 1 0 0 33
34 3983.3 0 0 0 0 0 0 0 0 0 0 1 0 34
35 4299.6 0 0 0 0 0 0 0 0 0 0 0 1 35
36 4306.9 0 0 0 0 0 0 0 0 0 0 0 0 36
37 4259.5 0 1 0 0 0 0 0 0 0 0 0 0 37
38 3986.0 0 0 1 0 0 0 0 0 0 0 0 0 38
39 4755.6 1 0 0 1 0 0 0 0 0 0 0 0 39
40 3925.6 0 0 0 0 1 0 0 0 0 0 0 0 40
41 4206.5 0 0 0 0 0 1 0 0 0 0 0 0 41
42 4323.4 0 0 0 0 0 0 1 0 0 0 0 0 42
43 3816.1 0 0 0 0 0 0 0 1 0 0 0 0 43
44 3410.7 0 0 0 0 0 0 0 0 1 0 0 0 44
45 4227.4 0 0 0 0 0 0 0 0 0 1 0 0 45
46 4296.9 0 0 0 0 0 0 0 0 0 0 1 0 46
47 4351.7 0 0 0 0 0 0 0 0 0 0 0 1 47
48 3800.0 0 0 0 0 0 0 0 0 0 0 0 0 48
49 4277.0 0 1 0 0 0 0 0 0 0 0 0 0 49
50 4100.2 0 0 1 0 0 0 0 0 0 0 0 0 50
51 4672.5 0 0 0 1 0 0 0 0 0 0 0 0 51
52 4189.9 0 0 0 0 1 0 0 0 0 0 0 0 52
53 4231.9 0 0 0 0 0 1 0 0 0 0 0 0 53
54 4654.9 0 0 0 0 0 0 1 0 0 0 0 0 54
55 4298.5 0 0 0 0 0 0 0 1 0 0 0 0 55
56 3635.9 0 0 0 0 0 0 0 0 1 0 0 0 56
57 4505.1 0 0 0 0 0 0 0 0 0 1 0 0 57
58 4891.9 0 0 0 0 0 0 0 0 0 0 1 0 58
59 4894.2 0 0 0 0 0 0 0 0 0 0 0 1 59
60 4093.2 0 0 0 0 0 0 0 0 0 0 0 0 60
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Dummy M1 M2 M3 M4
3014.20 312.92 120.81 29.60 497.64 58.27
M5 M6 M7 M8 M9 M10
16.40 339.84 -160.67 -714.20 262.36 264.17
M11 t
203.29 23.63
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-459.16 -99.33 16.08 96.65 441.88
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3014.197 95.756 31.478 < 2e-16 ***
Dummy 312.917 166.689 1.877 0.06683 .
M1 120.814 116.492 1.037 0.30511
M2 29.600 116.318 0.254 0.80027
M3 497.636 153.284 3.247 0.00218 **
M4 58.272 116.019 0.502 0.61788
M5 16.398 115.894 0.141 0.88810
M6 339.844 115.786 2.935 0.00519 **
M7 -160.670 115.694 -1.389 0.17160
M8 -714.204 115.619 -6.177 1.57e-07 ***
M9 262.362 115.561 2.270 0.02792 *
M10 264.168 115.519 2.287 0.02686 *
M11 203.294 115.494 1.760 0.08502 .
t 23.634 1.389 17.014 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 182.6 on 46 degrees of freedom
Multiple R-squared: 0.9112, Adjusted R-squared: 0.8861
F-statistic: 36.32 on 13 and 46 DF, p-value: < 2.2e-16
> 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.12919808 0.2583962 0.8708019
[2,] 0.21502934 0.4300587 0.7849707
[3,] 0.11273852 0.2254770 0.8872615
[4,] 0.33809390 0.6761878 0.6619061
[5,] 0.27375471 0.5475094 0.7262453
[6,] 0.19187862 0.3837572 0.8081214
[7,] 0.40582564 0.8116513 0.5941744
[8,] 0.36332926 0.7266585 0.6366707
[9,] 0.31730253 0.6346051 0.6826975
[10,] 0.26118091 0.5223618 0.7388191
[11,] 0.19375318 0.3875064 0.8062468
[12,] 0.14987895 0.2997579 0.8501210
[13,] 0.13609723 0.2721945 0.8639028
[14,] 0.11449744 0.2289949 0.8855026
[15,] 0.11851459 0.2370292 0.8814854
[16,] 0.08878366 0.1775673 0.9112163
[17,] 0.07556991 0.1511398 0.9244301
[18,] 0.07219330 0.1443866 0.9278067
[19,] 0.16630255 0.3326051 0.8336974
[20,] 0.78240448 0.4351910 0.2175955
[21,] 0.84250417 0.3149917 0.1574958
[22,] 0.83025627 0.3394875 0.1697437
[23,] 0.73672194 0.5265561 0.2632781
[24,] 0.65533900 0.6893220 0.3446610
[25,] 0.82265714 0.3546857 0.1773429
[26,] 0.71028068 0.5794386 0.2897193
[27,] 0.56559469 0.8688106 0.4344053
> postscript(file="/var/www/html/rcomp/tmp/1egb81229331790.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/2cimu1229331790.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/34e3p1229331790.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/4wboq1229331790.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/5to9h1229331790.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
99.455000 49.035000 44.665000 112.395000 55.235000 19.755000
7 8 9 10 11 12
127.635000 -217.365000 138.635000 38.695000 -459.165000 57.595000
13 14 15 16 17 18
-200.252500 -63.572500 -54.059167 -27.612500 -312.072500 83.547500
19 20 21 22 23 24
-61.772500 64.727500 172.127500 -114.212500 -101.472500 188.187500
25 26 27 28 29 30
-133.160000 95.720000 44.933333 118.980000 101.220000 -104.660000
31 32 33 34 35 36
-157.280000 69.420000 -79.480000 -98.620000 254.920000 441.880000
37 38 39 40 41 42
250.032500 44.112500 9.125833 -92.227500 206.912500 -23.267500
43 44 45 46 47 48
-53.687500 70.812500 -112.687500 -68.627500 23.412500 -348.627500
49 50 51 52 53 54
-16.075000 -125.295000 -44.665000 -111.535000 -51.295000 24.625000
55 56 57 58 59 60
145.105000 12.405000 -118.595000 242.765000 282.305000 -339.035000
> postscript(file="/var/www/html/rcomp/tmp/61ffp1229331790.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 99.455000 NA
1 49.035000 99.455000
2 44.665000 49.035000
3 112.395000 44.665000
4 55.235000 112.395000
5 19.755000 55.235000
6 127.635000 19.755000
7 -217.365000 127.635000
8 138.635000 -217.365000
9 38.695000 138.635000
10 -459.165000 38.695000
11 57.595000 -459.165000
12 -200.252500 57.595000
13 -63.572500 -200.252500
14 -54.059167 -63.572500
15 -27.612500 -54.059167
16 -312.072500 -27.612500
17 83.547500 -312.072500
18 -61.772500 83.547500
19 64.727500 -61.772500
20 172.127500 64.727500
21 -114.212500 172.127500
22 -101.472500 -114.212500
23 188.187500 -101.472500
24 -133.160000 188.187500
25 95.720000 -133.160000
26 44.933333 95.720000
27 118.980000 44.933333
28 101.220000 118.980000
29 -104.660000 101.220000
30 -157.280000 -104.660000
31 69.420000 -157.280000
32 -79.480000 69.420000
33 -98.620000 -79.480000
34 254.920000 -98.620000
35 441.880000 254.920000
36 250.032500 441.880000
37 44.112500 250.032500
38 9.125833 44.112500
39 -92.227500 9.125833
40 206.912500 -92.227500
41 -23.267500 206.912500
42 -53.687500 -23.267500
43 70.812500 -53.687500
44 -112.687500 70.812500
45 -68.627500 -112.687500
46 23.412500 -68.627500
47 -348.627500 23.412500
48 -16.075000 -348.627500
49 -125.295000 -16.075000
50 -44.665000 -125.295000
51 -111.535000 -44.665000
52 -51.295000 -111.535000
53 24.625000 -51.295000
54 145.105000 24.625000
55 12.405000 145.105000
56 -118.595000 12.405000
57 242.765000 -118.595000
58 282.305000 242.765000
59 -339.035000 282.305000
60 NA -339.035000
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 49.035000 99.455000
[2,] 44.665000 49.035000
[3,] 112.395000 44.665000
[4,] 55.235000 112.395000
[5,] 19.755000 55.235000
[6,] 127.635000 19.755000
[7,] -217.365000 127.635000
[8,] 138.635000 -217.365000
[9,] 38.695000 138.635000
[10,] -459.165000 38.695000
[11,] 57.595000 -459.165000
[12,] -200.252500 57.595000
[13,] -63.572500 -200.252500
[14,] -54.059167 -63.572500
[15,] -27.612500 -54.059167
[16,] -312.072500 -27.612500
[17,] 83.547500 -312.072500
[18,] -61.772500 83.547500
[19,] 64.727500 -61.772500
[20,] 172.127500 64.727500
[21,] -114.212500 172.127500
[22,] -101.472500 -114.212500
[23,] 188.187500 -101.472500
[24,] -133.160000 188.187500
[25,] 95.720000 -133.160000
[26,] 44.933333 95.720000
[27,] 118.980000 44.933333
[28,] 101.220000 118.980000
[29,] -104.660000 101.220000
[30,] -157.280000 -104.660000
[31,] 69.420000 -157.280000
[32,] -79.480000 69.420000
[33,] -98.620000 -79.480000
[34,] 254.920000 -98.620000
[35,] 441.880000 254.920000
[36,] 250.032500 441.880000
[37,] 44.112500 250.032500
[38,] 9.125833 44.112500
[39,] -92.227500 9.125833
[40,] 206.912500 -92.227500
[41,] -23.267500 206.912500
[42,] -53.687500 -23.267500
[43,] 70.812500 -53.687500
[44,] -112.687500 70.812500
[45,] -68.627500 -112.687500
[46,] 23.412500 -68.627500
[47,] -348.627500 23.412500
[48,] -16.075000 -348.627500
[49,] -125.295000 -16.075000
[50,] -44.665000 -125.295000
[51,] -111.535000 -44.665000
[52,] -51.295000 -111.535000
[53,] 24.625000 -51.295000
[54,] 145.105000 24.625000
[55,] 12.405000 145.105000
[56,] -118.595000 12.405000
[57,] 242.765000 -118.595000
[58,] 282.305000 242.765000
[59,] -339.035000 282.305000
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 49.035000 99.455000
2 44.665000 49.035000
3 112.395000 44.665000
4 55.235000 112.395000
5 19.755000 55.235000
6 127.635000 19.755000
7 -217.365000 127.635000
8 138.635000 -217.365000
9 38.695000 138.635000
10 -459.165000 38.695000
11 57.595000 -459.165000
12 -200.252500 57.595000
13 -63.572500 -200.252500
14 -54.059167 -63.572500
15 -27.612500 -54.059167
16 -312.072500 -27.612500
17 83.547500 -312.072500
18 -61.772500 83.547500
19 64.727500 -61.772500
20 172.127500 64.727500
21 -114.212500 172.127500
22 -101.472500 -114.212500
23 188.187500 -101.472500
24 -133.160000 188.187500
25 95.720000 -133.160000
26 44.933333 95.720000
27 118.980000 44.933333
28 101.220000 118.980000
29 -104.660000 101.220000
30 -157.280000 -104.660000
31 69.420000 -157.280000
32 -79.480000 69.420000
33 -98.620000 -79.480000
34 254.920000 -98.620000
35 441.880000 254.920000
36 250.032500 441.880000
37 44.112500 250.032500
38 9.125833 44.112500
39 -92.227500 9.125833
40 206.912500 -92.227500
41 -23.267500 206.912500
42 -53.687500 -23.267500
43 70.812500 -53.687500
44 -112.687500 70.812500
45 -68.627500 -112.687500
46 23.412500 -68.627500
47 -348.627500 23.412500
48 -16.075000 -348.627500
49 -125.295000 -16.075000
50 -44.665000 -125.295000
51 -111.535000 -44.665000
52 -51.295000 -111.535000
53 24.625000 -51.295000
54 145.105000 24.625000
55 12.405000 145.105000
56 -118.595000 12.405000
57 242.765000 -118.595000
58 282.305000 242.765000
59 -339.035000 282.305000
> 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/75wno1229331790.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/86jnr1229331790.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/9bal31229331790.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/10m5d71229331790.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/11atdu1229331790.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/12g76w1229331791.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/138f0i1229331791.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/147gcc1229331791.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/15wu1g1229331791.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/16lahy1229331791.tab")
+ }
>
> system("convert tmp/1egb81229331790.ps tmp/1egb81229331790.png")
> system("convert tmp/2cimu1229331790.ps tmp/2cimu1229331790.png")
> system("convert tmp/34e3p1229331790.ps tmp/34e3p1229331790.png")
> system("convert tmp/4wboq1229331790.ps tmp/4wboq1229331790.png")
> system("convert tmp/5to9h1229331790.ps tmp/5to9h1229331790.png")
> system("convert tmp/61ffp1229331790.ps tmp/61ffp1229331790.png")
> system("convert tmp/75wno1229331790.ps tmp/75wno1229331790.png")
> system("convert tmp/86jnr1229331790.ps tmp/86jnr1229331790.png")
> system("convert tmp/9bal31229331790.ps tmp/9bal31229331790.png")
> system("convert tmp/10m5d71229331790.ps tmp/10m5d71229331790.png")
>
>
> proc.time()
user system elapsed
4.941 2.737 5.302