R version 2.6.0 (2007-10-03)
Copyright (C) 2007 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(102.7
+ ,0
+ ,0
+ ,103.2
+ ,0
+ ,0
+ ,105.6
+ ,0
+ ,0
+ ,103.9
+ ,0
+ ,0
+ ,107.2
+ ,0
+ ,0
+ ,100.7
+ ,0
+ ,0
+ ,92.1
+ ,0
+ ,0
+ ,90.3
+ ,0
+ ,0
+ ,93.4
+ ,0
+ ,0
+ ,98.5
+ ,0
+ ,0
+ ,100.8
+ ,0
+ ,0
+ ,102.3
+ ,0
+ ,0
+ ,104.7
+ ,0
+ ,0
+ ,101.1
+ ,0
+ ,0
+ ,101.4
+ ,0
+ ,0
+ ,99.5
+ ,0
+ ,0
+ ,98.4
+ ,0
+ ,0
+ ,96.3
+ ,0
+ ,0
+ ,100.7
+ ,0
+ ,0
+ ,101.2
+ ,0
+ ,0
+ ,100.3
+ ,0
+ ,0
+ ,97.8
+ ,0
+ ,0
+ ,97.4
+ ,0
+ ,0
+ ,98.6
+ ,0
+ ,0
+ ,99.7
+ ,0
+ ,0
+ ,99.0
+ ,0
+ ,0
+ ,98.1
+ ,0
+ ,0
+ ,97.0
+ ,0
+ ,0
+ ,98.5
+ ,0
+ ,0
+ ,103.8
+ ,0
+ ,0
+ ,114.4
+ ,0
+ ,0
+ ,124.5
+ ,0
+ ,0
+ ,134.2
+ ,0
+ ,0
+ ,131.8
+ ,0
+ ,0
+ ,125.6
+ ,0
+ ,0
+ ,119.9
+ ,0
+ ,0
+ ,114.9
+ ,0
+ ,0
+ ,115.5
+ ,0
+ ,0
+ ,112.5
+ ,0
+ ,0
+ ,111.4
+ ,0
+ ,0
+ ,115.3
+ ,0
+ ,0
+ ,110.8
+ ,0
+ ,0
+ ,103.7
+ ,0
+ ,0
+ ,111.1
+ ,0
+ ,1
+ ,113.0
+ ,0
+ ,1
+ ,111.2
+ ,0
+ ,1
+ ,117.6
+ ,0
+ ,1
+ ,121.7
+ ,0
+ ,1
+ ,127.3
+ ,0
+ ,1
+ ,129.8
+ ,0
+ ,1
+ ,137.1
+ ,0
+ ,1
+ ,141.4
+ ,0
+ ,1
+ ,137.4
+ ,0
+ ,1
+ ,130.7
+ ,0
+ ,1
+ ,117.2
+ ,0
+ ,1
+ ,110.8
+ ,0
+ ,-1
+ ,111.4
+ ,0
+ ,-1
+ ,108.2
+ ,0
+ ,-1
+ ,108.8
+ ,0
+ ,-1
+ ,110.2
+ ,0
+ ,-1
+ ,109.5
+ ,0
+ ,-1
+ ,109.5
+ ,0
+ ,-1
+ ,116.0
+ ,0
+ ,-1
+ ,111.2
+ ,0
+ ,-1
+ ,112.1
+ ,0
+ ,-1
+ ,114.0
+ ,0
+ ,-1
+ ,119.1
+ ,0
+ ,-1
+ ,114.1
+ ,1
+ ,-1
+ ,115.1
+ ,1
+ ,-1
+ ,115.4
+ ,1
+ ,-1
+ ,110.8
+ ,1
+ ,0
+ ,116.0
+ ,1
+ ,0
+ ,119.2
+ ,1
+ ,0
+ ,126.5
+ ,1
+ ,0
+ ,127.8
+ ,1
+ ,0
+ ,131.3
+ ,1
+ ,0
+ ,140.3
+ ,1
+ ,0
+ ,137.3
+ ,1
+ ,0
+ ,143.0
+ ,1
+ ,0
+ ,134.5
+ ,1
+ ,0
+ ,139.9
+ ,1
+ ,0
+ ,159.3
+ ,1
+ ,0
+ ,170.4
+ ,1
+ ,0
+ ,175.0
+ ,1
+ ,0
+ ,175.8
+ ,1
+ ,0
+ ,180.9
+ ,1
+ ,0
+ ,180.3
+ ,1
+ ,0
+ ,169.6
+ ,1
+ ,0
+ ,172.3
+ ,1
+ ,0
+ ,184.8
+ ,1
+ ,0
+ ,177.7
+ ,1
+ ,0
+ ,184.6
+ ,1
+ ,0
+ ,211.4
+ ,1
+ ,0
+ ,215.3
+ ,1
+ ,0
+ ,215.9
+ ,1
+ ,0)
+ ,dim=c(3
+ ,95)
+ ,dimnames=list(c('prijsindex'
+ ,'ontkoppelde_bedrijfstoeslag'
+ ,'oogstomvang')
+ ,1:95))
> y <- array(NA,dim=c(3,95),dimnames=list(c('prijsindex','ontkoppelde_bedrijfstoeslag','oogstomvang'),1:95))
> 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)
> 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
prijsindex ontkoppelde_bedrijfstoeslag oogstomvang t
1 102.7 0 0 1
2 103.2 0 0 2
3 105.6 0 0 3
4 103.9 0 0 4
5 107.2 0 0 5
6 100.7 0 0 6
7 92.1 0 0 7
8 90.3 0 0 8
9 93.4 0 0 9
10 98.5 0 0 10
11 100.8 0 0 11
12 102.3 0 0 12
13 104.7 0 0 13
14 101.1 0 0 14
15 101.4 0 0 15
16 99.5 0 0 16
17 98.4 0 0 17
18 96.3 0 0 18
19 100.7 0 0 19
20 101.2 0 0 20
21 100.3 0 0 21
22 97.8 0 0 22
23 97.4 0 0 23
24 98.6 0 0 24
25 99.7 0 0 25
26 99.0 0 0 26
27 98.1 0 0 27
28 97.0 0 0 28
29 98.5 0 0 29
30 103.8 0 0 30
31 114.4 0 0 31
32 124.5 0 0 32
33 134.2 0 0 33
34 131.8 0 0 34
35 125.6 0 0 35
36 119.9 0 0 36
37 114.9 0 0 37
38 115.5 0 0 38
39 112.5 0 0 39
40 111.4 0 0 40
41 115.3 0 0 41
42 110.8 0 0 42
43 103.7 0 0 43
44 111.1 0 1 44
45 113.0 0 1 45
46 111.2 0 1 46
47 117.6 0 1 47
48 121.7 0 1 48
49 127.3 0 1 49
50 129.8 0 1 50
51 137.1 0 1 51
52 141.4 0 1 52
53 137.4 0 1 53
54 130.7 0 1 54
55 117.2 0 1 55
56 110.8 0 -1 56
57 111.4 0 -1 57
58 108.2 0 -1 58
59 108.8 0 -1 59
60 110.2 0 -1 60
61 109.5 0 -1 61
62 109.5 0 -1 62
63 116.0 0 -1 63
64 111.2 0 -1 64
65 112.1 0 -1 65
66 114.0 0 -1 66
67 119.1 0 -1 67
68 114.1 1 -1 68
69 115.1 1 -1 69
70 115.4 1 -1 70
71 110.8 1 0 71
72 116.0 1 0 72
73 119.2 1 0 73
74 126.5 1 0 74
75 127.8 1 0 75
76 131.3 1 0 76
77 140.3 1 0 77
78 137.3 1 0 78
79 143.0 1 0 79
80 134.5 1 0 80
81 139.9 1 0 81
82 159.3 1 0 82
83 170.4 1 0 83
84 175.0 1 0 84
85 175.8 1 0 85
86 180.9 1 0 86
87 180.3 1 0 87
88 169.6 1 0 88
89 172.3 1 0 89
90 184.8 1 0 90
91 177.7 1 0 91
92 184.6 1 0 92
93 211.4 1 0 93
94 215.3 1 0 94
95 215.9 1 0 95
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) ontkoppelde_bedrijfstoeslag
87.7821 15.6852
oogstomvang t
12.9296 0.6513
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-38.908 -6.499 -0.575 8.562 50.613
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 87.78212 3.92844 22.345 < 2e-16 ***
ontkoppelde_bedrijfstoeslag 15.68523 5.95775 2.633 0.00995 **
oogstomvang 12.92958 3.16664 4.083 9.54e-05 ***
t 0.65127 0.09975 6.529 3.70e-09 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 16.23 on 91 degrees of freedom
Multiple R-Squared: 0.6945, Adjusted R-squared: 0.6845
F-statistic: 68.97 on 3 and 91 DF, p-value: < 2.2e-16
> postscript(file="/var/www/html/rcomp/tmp/18yjt1198060147.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/299l11198060147.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/3rt6i1198060147.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/4phhh1198060147.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/5r29z1198060147.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 95
Frequency = 1
1 2 3 4 5 6
14.2666055 14.1153334 15.8640613 13.5127892 16.1615172 9.0102451
7 8 9 10 11 12
-0.2410270 -2.6922991 -0.2435712 4.2051568 5.8538847 6.7026126
13 14 15 16 17 18
8.4513405 4.2000685 3.8487964 1.2975243 -0.4537478 -3.2050199
19 20 21 22 23 24
0.5437081 0.3924360 -1.1588361 -4.3101082 -5.3613803 -4.8126523
25 26 27 28 29 30
-4.3639244 -5.7151965 -7.2664686 -9.0177407 -8.1690127 -3.5202848
31 32 33 34 35 36
6.4284431 15.8771710 24.9258989 21.8746269 15.0233548 8.6720827
37 38 39 40 41 42
3.0208106 2.9695385 -0.6817335 -2.4330056 0.8157223 -4.3355498
43 44 45 46 47 48
-12.0868218 -18.2676700 -17.0189421 -19.4702142 -13.7214863 -10.2727583
49 50 51 52 53 54
-5.3240304 -3.4753025 3.1734254 6.8221533 2.1708813 -5.1803908
55 56 57 58 59 60
-19.3316629 -0.5237828 -0.5750549 -4.4263269 -4.4775990 -3.7288711
61 62 63 64 65 66
-5.0801432 -5.7314153 0.1173127 -5.3339594 -5.0852315 -3.8365036
67 68 69 70 71 72
0.6122243 -20.7242768 -20.3755489 -20.7268210 -38.9076692 -34.3589413
73 74 75 76 77 78
-31.8102133 -25.1614854 -24.5127575 -21.6640296 -13.3153017 -16.9665737
79 80 81 82 83 84
-11.9178458 -21.0691179 -16.3203900 2.4283380 12.8770659 16.8257938
85 86 87 88 89 90
16.9745217 21.4232496 20.1719776 8.8207055 10.8694334 22.7181613
91 92 93 94 95
14.9668892 21.2156172 47.3643451 50.6130730 50.5618009
> postscript(file="/var/www/html/rcomp/tmp/6fkw01198060147.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 = 95
Frequency = 1
lag(myerror, k = 1) myerror
0 14.2666055 NA
1 14.1153334 14.2666055
2 15.8640613 14.1153334
3 13.5127892 15.8640613
4 16.1615172 13.5127892
5 9.0102451 16.1615172
6 -0.2410270 9.0102451
7 -2.6922991 -0.2410270
8 -0.2435712 -2.6922991
9 4.2051568 -0.2435712
10 5.8538847 4.2051568
11 6.7026126 5.8538847
12 8.4513405 6.7026126
13 4.2000685 8.4513405
14 3.8487964 4.2000685
15 1.2975243 3.8487964
16 -0.4537478 1.2975243
17 -3.2050199 -0.4537478
18 0.5437081 -3.2050199
19 0.3924360 0.5437081
20 -1.1588361 0.3924360
21 -4.3101082 -1.1588361
22 -5.3613803 -4.3101082
23 -4.8126523 -5.3613803
24 -4.3639244 -4.8126523
25 -5.7151965 -4.3639244
26 -7.2664686 -5.7151965
27 -9.0177407 -7.2664686
28 -8.1690127 -9.0177407
29 -3.5202848 -8.1690127
30 6.4284431 -3.5202848
31 15.8771710 6.4284431
32 24.9258989 15.8771710
33 21.8746269 24.9258989
34 15.0233548 21.8746269
35 8.6720827 15.0233548
36 3.0208106 8.6720827
37 2.9695385 3.0208106
38 -0.6817335 2.9695385
39 -2.4330056 -0.6817335
40 0.8157223 -2.4330056
41 -4.3355498 0.8157223
42 -12.0868218 -4.3355498
43 -18.2676700 -12.0868218
44 -17.0189421 -18.2676700
45 -19.4702142 -17.0189421
46 -13.7214863 -19.4702142
47 -10.2727583 -13.7214863
48 -5.3240304 -10.2727583
49 -3.4753025 -5.3240304
50 3.1734254 -3.4753025
51 6.8221533 3.1734254
52 2.1708813 6.8221533
53 -5.1803908 2.1708813
54 -19.3316629 -5.1803908
55 -0.5237828 -19.3316629
56 -0.5750549 -0.5237828
57 -4.4263269 -0.5750549
58 -4.4775990 -4.4263269
59 -3.7288711 -4.4775990
60 -5.0801432 -3.7288711
61 -5.7314153 -5.0801432
62 0.1173127 -5.7314153
63 -5.3339594 0.1173127
64 -5.0852315 -5.3339594
65 -3.8365036 -5.0852315
66 0.6122243 -3.8365036
67 -20.7242768 0.6122243
68 -20.3755489 -20.7242768
69 -20.7268210 -20.3755489
70 -38.9076692 -20.7268210
71 -34.3589413 -38.9076692
72 -31.8102133 -34.3589413
73 -25.1614854 -31.8102133
74 -24.5127575 -25.1614854
75 -21.6640296 -24.5127575
76 -13.3153017 -21.6640296
77 -16.9665737 -13.3153017
78 -11.9178458 -16.9665737
79 -21.0691179 -11.9178458
80 -16.3203900 -21.0691179
81 2.4283380 -16.3203900
82 12.8770659 2.4283380
83 16.8257938 12.8770659
84 16.9745217 16.8257938
85 21.4232496 16.9745217
86 20.1719776 21.4232496
87 8.8207055 20.1719776
88 10.8694334 8.8207055
89 22.7181613 10.8694334
90 14.9668892 22.7181613
91 21.2156172 14.9668892
92 47.3643451 21.2156172
93 50.6130730 47.3643451
94 50.5618009 50.6130730
95 NA 50.5618009
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 14.1153334 14.2666055
[2,] 15.8640613 14.1153334
[3,] 13.5127892 15.8640613
[4,] 16.1615172 13.5127892
[5,] 9.0102451 16.1615172
[6,] -0.2410270 9.0102451
[7,] -2.6922991 -0.2410270
[8,] -0.2435712 -2.6922991
[9,] 4.2051568 -0.2435712
[10,] 5.8538847 4.2051568
[11,] 6.7026126 5.8538847
[12,] 8.4513405 6.7026126
[13,] 4.2000685 8.4513405
[14,] 3.8487964 4.2000685
[15,] 1.2975243 3.8487964
[16,] -0.4537478 1.2975243
[17,] -3.2050199 -0.4537478
[18,] 0.5437081 -3.2050199
[19,] 0.3924360 0.5437081
[20,] -1.1588361 0.3924360
[21,] -4.3101082 -1.1588361
[22,] -5.3613803 -4.3101082
[23,] -4.8126523 -5.3613803
[24,] -4.3639244 -4.8126523
[25,] -5.7151965 -4.3639244
[26,] -7.2664686 -5.7151965
[27,] -9.0177407 -7.2664686
[28,] -8.1690127 -9.0177407
[29,] -3.5202848 -8.1690127
[30,] 6.4284431 -3.5202848
[31,] 15.8771710 6.4284431
[32,] 24.9258989 15.8771710
[33,] 21.8746269 24.9258989
[34,] 15.0233548 21.8746269
[35,] 8.6720827 15.0233548
[36,] 3.0208106 8.6720827
[37,] 2.9695385 3.0208106
[38,] -0.6817335 2.9695385
[39,] -2.4330056 -0.6817335
[40,] 0.8157223 -2.4330056
[41,] -4.3355498 0.8157223
[42,] -12.0868218 -4.3355498
[43,] -18.2676700 -12.0868218
[44,] -17.0189421 -18.2676700
[45,] -19.4702142 -17.0189421
[46,] -13.7214863 -19.4702142
[47,] -10.2727583 -13.7214863
[48,] -5.3240304 -10.2727583
[49,] -3.4753025 -5.3240304
[50,] 3.1734254 -3.4753025
[51,] 6.8221533 3.1734254
[52,] 2.1708813 6.8221533
[53,] -5.1803908 2.1708813
[54,] -19.3316629 -5.1803908
[55,] -0.5237828 -19.3316629
[56,] -0.5750549 -0.5237828
[57,] -4.4263269 -0.5750549
[58,] -4.4775990 -4.4263269
[59,] -3.7288711 -4.4775990
[60,] -5.0801432 -3.7288711
[61,] -5.7314153 -5.0801432
[62,] 0.1173127 -5.7314153
[63,] -5.3339594 0.1173127
[64,] -5.0852315 -5.3339594
[65,] -3.8365036 -5.0852315
[66,] 0.6122243 -3.8365036
[67,] -20.7242768 0.6122243
[68,] -20.3755489 -20.7242768
[69,] -20.7268210 -20.3755489
[70,] -38.9076692 -20.7268210
[71,] -34.3589413 -38.9076692
[72,] -31.8102133 -34.3589413
[73,] -25.1614854 -31.8102133
[74,] -24.5127575 -25.1614854
[75,] -21.6640296 -24.5127575
[76,] -13.3153017 -21.6640296
[77,] -16.9665737 -13.3153017
[78,] -11.9178458 -16.9665737
[79,] -21.0691179 -11.9178458
[80,] -16.3203900 -21.0691179
[81,] 2.4283380 -16.3203900
[82,] 12.8770659 2.4283380
[83,] 16.8257938 12.8770659
[84,] 16.9745217 16.8257938
[85,] 21.4232496 16.9745217
[86,] 20.1719776 21.4232496
[87,] 8.8207055 20.1719776
[88,] 10.8694334 8.8207055
[89,] 22.7181613 10.8694334
[90,] 14.9668892 22.7181613
[91,] 21.2156172 14.9668892
[92,] 47.3643451 21.2156172
[93,] 50.6130730 47.3643451
[94,] 50.5618009 50.6130730
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 14.1153334 14.2666055
2 15.8640613 14.1153334
3 13.5127892 15.8640613
4 16.1615172 13.5127892
5 9.0102451 16.1615172
6 -0.2410270 9.0102451
7 -2.6922991 -0.2410270
8 -0.2435712 -2.6922991
9 4.2051568 -0.2435712
10 5.8538847 4.2051568
11 6.7026126 5.8538847
12 8.4513405 6.7026126
13 4.2000685 8.4513405
14 3.8487964 4.2000685
15 1.2975243 3.8487964
16 -0.4537478 1.2975243
17 -3.2050199 -0.4537478
18 0.5437081 -3.2050199
19 0.3924360 0.5437081
20 -1.1588361 0.3924360
21 -4.3101082 -1.1588361
22 -5.3613803 -4.3101082
23 -4.8126523 -5.3613803
24 -4.3639244 -4.8126523
25 -5.7151965 -4.3639244
26 -7.2664686 -5.7151965
27 -9.0177407 -7.2664686
28 -8.1690127 -9.0177407
29 -3.5202848 -8.1690127
30 6.4284431 -3.5202848
31 15.8771710 6.4284431
32 24.9258989 15.8771710
33 21.8746269 24.9258989
34 15.0233548 21.8746269
35 8.6720827 15.0233548
36 3.0208106 8.6720827
37 2.9695385 3.0208106
38 -0.6817335 2.9695385
39 -2.4330056 -0.6817335
40 0.8157223 -2.4330056
41 -4.3355498 0.8157223
42 -12.0868218 -4.3355498
43 -18.2676700 -12.0868218
44 -17.0189421 -18.2676700
45 -19.4702142 -17.0189421
46 -13.7214863 -19.4702142
47 -10.2727583 -13.7214863
48 -5.3240304 -10.2727583
49 -3.4753025 -5.3240304
50 3.1734254 -3.4753025
51 6.8221533 3.1734254
52 2.1708813 6.8221533
53 -5.1803908 2.1708813
54 -19.3316629 -5.1803908
55 -0.5237828 -19.3316629
56 -0.5750549 -0.5237828
57 -4.4263269 -0.5750549
58 -4.4775990 -4.4263269
59 -3.7288711 -4.4775990
60 -5.0801432 -3.7288711
61 -5.7314153 -5.0801432
62 0.1173127 -5.7314153
63 -5.3339594 0.1173127
64 -5.0852315 -5.3339594
65 -3.8365036 -5.0852315
66 0.6122243 -3.8365036
67 -20.7242768 0.6122243
68 -20.3755489 -20.7242768
69 -20.7268210 -20.3755489
70 -38.9076692 -20.7268210
71 -34.3589413 -38.9076692
72 -31.8102133 -34.3589413
73 -25.1614854 -31.8102133
74 -24.5127575 -25.1614854
75 -21.6640296 -24.5127575
76 -13.3153017 -21.6640296
77 -16.9665737 -13.3153017
78 -11.9178458 -16.9665737
79 -21.0691179 -11.9178458
80 -16.3203900 -21.0691179
81 2.4283380 -16.3203900
82 12.8770659 2.4283380
83 16.8257938 12.8770659
84 16.9745217 16.8257938
85 21.4232496 16.9745217
86 20.1719776 21.4232496
87 8.8207055 20.1719776
88 10.8694334 8.8207055
89 22.7181613 10.8694334
90 14.9668892 22.7181613
91 21.2156172 14.9668892
92 47.3643451 21.2156172
93 50.6130730 47.3643451
94 50.5618009 50.6130730
> 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/7pg301198060147.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/8m75g1198060147.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/9nf8t1198060147.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
> 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/107szh1198060148.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/11moyj1198060148.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/1254as1198060148.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/13e5j11198060148.tab")
>
> system("convert tmp/18yjt1198060147.ps tmp/18yjt1198060147.png")
> system("convert tmp/299l11198060147.ps tmp/299l11198060147.png")
> system("convert tmp/3rt6i1198060147.ps tmp/3rt6i1198060147.png")
> system("convert tmp/4phhh1198060147.ps tmp/4phhh1198060147.png")
> system("convert tmp/5r29z1198060147.ps tmp/5r29z1198060147.png")
> system("convert tmp/6fkw01198060147.ps tmp/6fkw01198060147.png")
> system("convert tmp/7pg301198060147.ps tmp/7pg301198060147.png")
> system("convert tmp/8m75g1198060147.ps tmp/8m75g1198060147.png")
> system("convert tmp/9nf8t1198060147.ps tmp/9nf8t1198060147.png")
>
>
> proc.time()
user system elapsed
2.482 1.558 3.710