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(0.7461,0.527,0.7775,0.472,0.7790,0,0.7744,0.052,0.7905,0.313,0.7719,0.364,0.7811,0.363,0.7557,-0.155,0.7637,0.052,0.7595,0.568,0.7471,0.668,0.7615,1.378,0.7487,0.252,0.7389,-0.402,0.7337,-0.05,0.7510,0.555,0.7382,0.05,0.7159,0.15,0.7542,0.45,0.7636,0.299,0.7433,0.199,0.7658,0.496,0.7627,0.444,0.7480,-0.393,0.7692,-0.444,0.7850,0.198,0.7913,0.494,0.7720,0.133,0.7880,0.388,0.8070,0.484,0.8268,0.278,0.8244,0.369,0.8487,0.165,0.8572,0.155,0.8214,0.087,0.8827,0.414,0.9216,0.36,0.8865,0.975,0.8816,0.27,0.8884,0.359,0.9466,0.169,0.9180,0.381,0.9337,0.154,0.9559,0.486,0.9626,0.925,0.9434,0.728,0.8639,-0.014,0.7996,0.046,0.6680,-0.819,0.6572,-1.674,0.6928,-0.788,0.6438,0.279,0.6454,0.396,0.6873,-0.141,0.7265,-0.019,0.7912,0.099,0.8114,0.742,0.8281,0.005,0.8393,0.448),dim=c(2,59),dimnames=list(c('USDOLLAR','Amerikaanse_inflatie'),1:59))
> y <- array(NA,dim=c(2,59),dimnames=list(c('USDOLLAR','Amerikaanse_inflatie'),1:59))
> 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 = '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
USDOLLAR Amerikaanse_inflatie t
1 0.7461 0.527 1
2 0.7775 0.472 2
3 0.7790 0.000 3
4 0.7744 0.052 4
5 0.7905 0.313 5
6 0.7719 0.364 6
7 0.7811 0.363 7
8 0.7557 -0.155 8
9 0.7637 0.052 9
10 0.7595 0.568 10
11 0.7471 0.668 11
12 0.7615 1.378 12
13 0.7487 0.252 13
14 0.7389 -0.402 14
15 0.7337 -0.050 15
16 0.7510 0.555 16
17 0.7382 0.050 17
18 0.7159 0.150 18
19 0.7542 0.450 19
20 0.7636 0.299 20
21 0.7433 0.199 21
22 0.7658 0.496 22
23 0.7627 0.444 23
24 0.7480 -0.393 24
25 0.7692 -0.444 25
26 0.7850 0.198 26
27 0.7913 0.494 27
28 0.7720 0.133 28
29 0.7880 0.388 29
30 0.8070 0.484 30
31 0.8268 0.278 31
32 0.8244 0.369 32
33 0.8487 0.165 33
34 0.8572 0.155 34
35 0.8214 0.087 35
36 0.8827 0.414 36
37 0.9216 0.360 37
38 0.8865 0.975 38
39 0.8816 0.270 39
40 0.8884 0.359 40
41 0.9466 0.169 41
42 0.9180 0.381 42
43 0.9337 0.154 43
44 0.9559 0.486 44
45 0.9626 0.925 45
46 0.9434 0.728 46
47 0.8639 -0.014 47
48 0.7996 0.046 48
49 0.6680 -0.819 49
50 0.6572 -1.674 50
51 0.6928 -0.788 51
52 0.6438 0.279 52
53 0.6454 0.396 53
54 0.6873 -0.141 54
55 0.7265 -0.019 55
56 0.7912 0.099 56
57 0.8114 0.742 57
58 0.8281 0.005 58
59 0.8393 0.448 59
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Amerikaanse_inflatie t
0.735199 0.082594 0.001361
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.194656 -0.036574 -0.001947 0.034005 0.141629
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.7351986 0.0191246 38.443 < 2e-16 ***
Amerikaanse_inflatie 0.0825944 0.0198961 4.151 0.000114 ***
t 0.0013613 0.0005234 2.601 0.011863 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.06738 on 56 degrees of freedom
Multiple R-squared: 0.2712, Adjusted R-squared: 0.2451
F-statistic: 10.42 on 2 and 56 DF, p-value: 0.0001425
> 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,] 1.125619e-02 2.251239e-02 0.98874381
[2,] 1.878646e-03 3.757292e-03 0.99812135
[3,] 1.923306e-03 3.846611e-03 0.99807669
[4,] 4.705594e-04 9.411187e-04 0.99952944
[5,] 1.134457e-04 2.268913e-04 0.99988655
[6,] 3.190121e-05 6.380242e-05 0.99996810
[7,] 9.165927e-06 1.833185e-05 0.99999083
[8,] 2.145444e-06 4.290888e-06 0.99999785
[9,] 5.750161e-07 1.150032e-06 0.99999942
[10,] 1.395960e-07 2.791920e-07 0.99999986
[11,] 3.042739e-08 6.085477e-08 0.99999997
[12,] 5.260103e-09 1.052021e-08 0.99999999
[13,] 3.182413e-09 6.364825e-09 1.00000000
[14,] 1.762046e-09 3.524091e-09 1.00000000
[15,] 2.014032e-09 4.028064e-09 1.00000000
[16,] 5.164923e-10 1.032985e-09 1.00000000
[17,] 5.459534e-10 1.091907e-09 1.00000000
[18,] 3.816985e-10 7.633971e-10 1.00000000
[19,] 1.043394e-10 2.086788e-10 1.00000000
[20,] 9.707730e-11 1.941546e-10 1.00000000
[21,] 2.286301e-10 4.572602e-10 1.00000000
[22,] 5.450657e-10 1.090131e-09 1.00000000
[23,] 2.883347e-10 5.766694e-10 1.00000000
[24,] 3.815647e-10 7.631294e-10 1.00000000
[25,] 1.448638e-09 2.897276e-09 1.00000000
[26,] 1.103907e-08 2.207814e-08 0.99999999
[27,] 3.373808e-08 6.747616e-08 0.99999997
[28,] 2.022659e-07 4.045318e-07 0.99999980
[29,] 7.064104e-07 1.412821e-06 0.99999929
[30,] 6.071906e-07 1.214381e-06 0.99999939
[31,] 2.670946e-06 5.341892e-06 0.99999733
[32,] 2.453512e-05 4.907024e-05 0.99997546
[33,] 4.896550e-05 9.793101e-05 0.99995103
[34,] 4.287925e-05 8.575850e-05 0.99995712
[35,] 3.591107e-05 7.182215e-05 0.99996409
[36,] 1.173764e-04 2.347528e-04 0.99988262
[37,] 8.106756e-05 1.621351e-04 0.99991893
[38,] 9.999243e-05 1.999849e-04 0.99990001
[39,] 1.565435e-04 3.130871e-04 0.99984346
[40,] 1.666747e-04 3.333494e-04 0.99983333
[41,] 5.436885e-04 1.087377e-03 0.99945631
[42,] 1.181180e-02 2.362361e-02 0.98818820
[43,] 7.441041e-01 5.117918e-01 0.25589589
[44,] 9.346007e-01 1.307986e-01 0.06539929
[45,] 8.918783e-01 2.162434e-01 0.10812170
[46,] 9.702839e-01 5.943218e-02 0.02971609
[47,] 9.667515e-01 6.649704e-02 0.03324852
[48,] 9.566202e-01 8.675951e-02 0.04337976
> postscript(file="/var/www/html/rcomp/tmp/16kb21260705875.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/2ply01260705875.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/3bfyy1260705876.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/4htfq1260705876.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/5oafd1260705876.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 = 59
Frequency = 1
1 2 3 4 5
-0.0339871070 0.0005942657 0.0397174939 0.0294612681 0.0226428174
6 7 8 9 10
-0.0015308140 0.0063904622 0.0224130319 0.0119546775 -0.0362253396
11 12 13 14 15
-0.0582460955 -0.1038494219 -0.0250094705 0.0178459345 -0.0177886046
16 17 18 19 20
-0.0518195214 -0.0242706787 -0.0561914346 -0.0440310661 -0.0235206331
21 22 23 24 25
-0.0369225135 -0.0403143618 -0.0404807723 0.0125894039 0.0366403990
26 27 28 29 30
-0.0019465097 -0.0214557637 -0.0123005114 -0.0187233959 -0.0090137742
31 32 33 34 35
0.0264393495 0.0151619430 0.0549498779 0.0629145036 0.0313696032
36 37 38 39 40
0.0642999235 0.1062987018 0.0190418412 0.0710095595 0.0690973418
41 42 43 44 45
0.1416289555 0.0941576292 0.1272452349 0.1206625833 0.0897423333
46 47 48 49 50
0.0854521076 0.0658758179 -0.0047411629 -0.0662583442 -0.0078014692
51 52 53 54 55
-0.0467414061 -0.1852309254 -0.1946557858 -0.1097639230 -0.0820017552
56 57 58 59
-0.0284092099 -0.0626787130 0.0135320254 -0.0132186021
> postscript(file="/var/www/html/rcomp/tmp/64i4d1260705876.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 = 59
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.0339871070 NA
1 0.0005942657 -0.0339871070
2 0.0397174939 0.0005942657
3 0.0294612681 0.0397174939
4 0.0226428174 0.0294612681
5 -0.0015308140 0.0226428174
6 0.0063904622 -0.0015308140
7 0.0224130319 0.0063904622
8 0.0119546775 0.0224130319
9 -0.0362253396 0.0119546775
10 -0.0582460955 -0.0362253396
11 -0.1038494219 -0.0582460955
12 -0.0250094705 -0.1038494219
13 0.0178459345 -0.0250094705
14 -0.0177886046 0.0178459345
15 -0.0518195214 -0.0177886046
16 -0.0242706787 -0.0518195214
17 -0.0561914346 -0.0242706787
18 -0.0440310661 -0.0561914346
19 -0.0235206331 -0.0440310661
20 -0.0369225135 -0.0235206331
21 -0.0403143618 -0.0369225135
22 -0.0404807723 -0.0403143618
23 0.0125894039 -0.0404807723
24 0.0366403990 0.0125894039
25 -0.0019465097 0.0366403990
26 -0.0214557637 -0.0019465097
27 -0.0123005114 -0.0214557637
28 -0.0187233959 -0.0123005114
29 -0.0090137742 -0.0187233959
30 0.0264393495 -0.0090137742
31 0.0151619430 0.0264393495
32 0.0549498779 0.0151619430
33 0.0629145036 0.0549498779
34 0.0313696032 0.0629145036
35 0.0642999235 0.0313696032
36 0.1062987018 0.0642999235
37 0.0190418412 0.1062987018
38 0.0710095595 0.0190418412
39 0.0690973418 0.0710095595
40 0.1416289555 0.0690973418
41 0.0941576292 0.1416289555
42 0.1272452349 0.0941576292
43 0.1206625833 0.1272452349
44 0.0897423333 0.1206625833
45 0.0854521076 0.0897423333
46 0.0658758179 0.0854521076
47 -0.0047411629 0.0658758179
48 -0.0662583442 -0.0047411629
49 -0.0078014692 -0.0662583442
50 -0.0467414061 -0.0078014692
51 -0.1852309254 -0.0467414061
52 -0.1946557858 -0.1852309254
53 -0.1097639230 -0.1946557858
54 -0.0820017552 -0.1097639230
55 -0.0284092099 -0.0820017552
56 -0.0626787130 -0.0284092099
57 0.0135320254 -0.0626787130
58 -0.0132186021 0.0135320254
59 NA -0.0132186021
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.0005942657 -0.0339871070
[2,] 0.0397174939 0.0005942657
[3,] 0.0294612681 0.0397174939
[4,] 0.0226428174 0.0294612681
[5,] -0.0015308140 0.0226428174
[6,] 0.0063904622 -0.0015308140
[7,] 0.0224130319 0.0063904622
[8,] 0.0119546775 0.0224130319
[9,] -0.0362253396 0.0119546775
[10,] -0.0582460955 -0.0362253396
[11,] -0.1038494219 -0.0582460955
[12,] -0.0250094705 -0.1038494219
[13,] 0.0178459345 -0.0250094705
[14,] -0.0177886046 0.0178459345
[15,] -0.0518195214 -0.0177886046
[16,] -0.0242706787 -0.0518195214
[17,] -0.0561914346 -0.0242706787
[18,] -0.0440310661 -0.0561914346
[19,] -0.0235206331 -0.0440310661
[20,] -0.0369225135 -0.0235206331
[21,] -0.0403143618 -0.0369225135
[22,] -0.0404807723 -0.0403143618
[23,] 0.0125894039 -0.0404807723
[24,] 0.0366403990 0.0125894039
[25,] -0.0019465097 0.0366403990
[26,] -0.0214557637 -0.0019465097
[27,] -0.0123005114 -0.0214557637
[28,] -0.0187233959 -0.0123005114
[29,] -0.0090137742 -0.0187233959
[30,] 0.0264393495 -0.0090137742
[31,] 0.0151619430 0.0264393495
[32,] 0.0549498779 0.0151619430
[33,] 0.0629145036 0.0549498779
[34,] 0.0313696032 0.0629145036
[35,] 0.0642999235 0.0313696032
[36,] 0.1062987018 0.0642999235
[37,] 0.0190418412 0.1062987018
[38,] 0.0710095595 0.0190418412
[39,] 0.0690973418 0.0710095595
[40,] 0.1416289555 0.0690973418
[41,] 0.0941576292 0.1416289555
[42,] 0.1272452349 0.0941576292
[43,] 0.1206625833 0.1272452349
[44,] 0.0897423333 0.1206625833
[45,] 0.0854521076 0.0897423333
[46,] 0.0658758179 0.0854521076
[47,] -0.0047411629 0.0658758179
[48,] -0.0662583442 -0.0047411629
[49,] -0.0078014692 -0.0662583442
[50,] -0.0467414061 -0.0078014692
[51,] -0.1852309254 -0.0467414061
[52,] -0.1946557858 -0.1852309254
[53,] -0.1097639230 -0.1946557858
[54,] -0.0820017552 -0.1097639230
[55,] -0.0284092099 -0.0820017552
[56,] -0.0626787130 -0.0284092099
[57,] 0.0135320254 -0.0626787130
[58,] -0.0132186021 0.0135320254
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.0005942657 -0.0339871070
2 0.0397174939 0.0005942657
3 0.0294612681 0.0397174939
4 0.0226428174 0.0294612681
5 -0.0015308140 0.0226428174
6 0.0063904622 -0.0015308140
7 0.0224130319 0.0063904622
8 0.0119546775 0.0224130319
9 -0.0362253396 0.0119546775
10 -0.0582460955 -0.0362253396
11 -0.1038494219 -0.0582460955
12 -0.0250094705 -0.1038494219
13 0.0178459345 -0.0250094705
14 -0.0177886046 0.0178459345
15 -0.0518195214 -0.0177886046
16 -0.0242706787 -0.0518195214
17 -0.0561914346 -0.0242706787
18 -0.0440310661 -0.0561914346
19 -0.0235206331 -0.0440310661
20 -0.0369225135 -0.0235206331
21 -0.0403143618 -0.0369225135
22 -0.0404807723 -0.0403143618
23 0.0125894039 -0.0404807723
24 0.0366403990 0.0125894039
25 -0.0019465097 0.0366403990
26 -0.0214557637 -0.0019465097
27 -0.0123005114 -0.0214557637
28 -0.0187233959 -0.0123005114
29 -0.0090137742 -0.0187233959
30 0.0264393495 -0.0090137742
31 0.0151619430 0.0264393495
32 0.0549498779 0.0151619430
33 0.0629145036 0.0549498779
34 0.0313696032 0.0629145036
35 0.0642999235 0.0313696032
36 0.1062987018 0.0642999235
37 0.0190418412 0.1062987018
38 0.0710095595 0.0190418412
39 0.0690973418 0.0710095595
40 0.1416289555 0.0690973418
41 0.0941576292 0.1416289555
42 0.1272452349 0.0941576292
43 0.1206625833 0.1272452349
44 0.0897423333 0.1206625833
45 0.0854521076 0.0897423333
46 0.0658758179 0.0854521076
47 -0.0047411629 0.0658758179
48 -0.0662583442 -0.0047411629
49 -0.0078014692 -0.0662583442
50 -0.0467414061 -0.0078014692
51 -0.1852309254 -0.0467414061
52 -0.1946557858 -0.1852309254
53 -0.1097639230 -0.1946557858
54 -0.0820017552 -0.1097639230
55 -0.0284092099 -0.0820017552
56 -0.0626787130 -0.0284092099
57 0.0135320254 -0.0626787130
58 -0.0132186021 0.0135320254
> 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/72pd71260705876.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/8k6451260705876.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/93nxm1260705876.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/10c6l41260705876.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/11zoya1260705876.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/12djsl1260705876.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/1314ru1260705876.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/14bnvp1260705876.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/15yubs1260705876.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/16rofv1260705876.tab")
+ }
>
> try(system("convert tmp/16kb21260705875.ps tmp/16kb21260705875.png",intern=TRUE))
character(0)
> try(system("convert tmp/2ply01260705875.ps tmp/2ply01260705875.png",intern=TRUE))
character(0)
> try(system("convert tmp/3bfyy1260705876.ps tmp/3bfyy1260705876.png",intern=TRUE))
character(0)
> try(system("convert tmp/4htfq1260705876.ps tmp/4htfq1260705876.png",intern=TRUE))
character(0)
> try(system("convert tmp/5oafd1260705876.ps tmp/5oafd1260705876.png",intern=TRUE))
character(0)
> try(system("convert tmp/64i4d1260705876.ps tmp/64i4d1260705876.png",intern=TRUE))
character(0)
> try(system("convert tmp/72pd71260705876.ps tmp/72pd71260705876.png",intern=TRUE))
character(0)
> try(system("convert tmp/8k6451260705876.ps tmp/8k6451260705876.png",intern=TRUE))
character(0)
> try(system("convert tmp/93nxm1260705876.ps tmp/93nxm1260705876.png",intern=TRUE))
character(0)
> try(system("convert tmp/10c6l41260705876.ps tmp/10c6l41260705876.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.463 1.567 2.903