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
+ ,0
+ ,111.4
+ ,0
+ ,0
+ ,108.2
+ ,0
+ ,0
+ ,108.8
+ ,0
+ ,0
+ ,110.2
+ ,0
+ ,0
+ ,109.5
+ ,1
+ ,0
+ ,109.5
+ ,1
+ ,0
+ ,116.0
+ ,1
+ ,0
+ ,111.2
+ ,1
+ ,0
+ ,112.1
+ ,1
+ ,0
+ ,114.0
+ ,1
+ ,0
+ ,119.1
+ ,1
+ ,0
+ ,114.1
+ ,1
+ ,2
+ ,115.1
+ ,1
+ ,2
+ ,115.4
+ ,1
+ ,2
+ ,110.8
+ ,1
+ ,2
+ ,116.0
+ ,1
+ ,2
+ ,119.2
+ ,2
+ ,2
+ ,126.5
+ ,2
+ ,2
+ ,127.8
+ ,2
+ ,2
+ ,131.3
+ ,2
+ ,2
+ ,140.3
+ ,2
+ ,2
+ ,137.3
+ ,2
+ ,2
+ ,143.0
+ ,2
+ ,2
+ ,134.5
+ ,2
+ ,0
+ ,139.9
+ ,2
+ ,0
+ ,159.3
+ ,2
+ ,0
+ ,170.4
+ ,2
+ ,0
+ ,175.0
+ ,2
+ ,0
+ ,175.8
+ ,2
+ ,0
+ ,180.9
+ ,2
+ ,0
+ ,180.3
+ ,2
+ ,0
+ ,169.6
+ ,2
+ ,0
+ ,172.3
+ ,2
+ ,0
+ ,184.8
+ ,2
+ ,0
+ ,177.7
+ ,2
+ ,0
+ ,184.6
+ ,2
+ ,0
+ ,211.4
+ ,2
+ ,0
+ ,215.3
+ ,2
+ ,0
+ ,215.9
+ ,2
+ ,0)
+ ,dim=c(3
+ ,95)
+ ,dimnames=list(c('graanprijs'
+ ,'ontkoppelde_bedrijfstoeslag'
+ ,'oogstomvang')
+ ,1:95))
> y <- array(NA,dim=c(3,95),dimnames=list(c('graanprijs','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
graanprijs 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 0 56
57 111.4 0 0 57
58 108.2 0 0 58
59 108.8 0 0 59
60 110.2 0 0 60
61 109.5 1 0 61
62 109.5 1 0 62
63 116.0 1 0 63
64 111.2 1 0 64
65 112.1 1 0 65
66 114.0 1 0 66
67 119.1 1 0 67
68 114.1 1 2 68
69 115.1 1 2 69
70 115.4 1 2 70
71 110.8 1 2 71
72 116.0 1 2 72
73 119.2 2 2 73
74 126.5 2 2 74
75 127.8 2 2 75
76 131.3 2 2 76
77 140.3 2 2 77
78 137.3 2 2 78
79 143.0 2 2 79
80 134.5 2 0 80
81 139.9 2 0 81
82 159.3 2 0 82
83 170.4 2 0 83
84 175.0 2 0 84
85 175.8 2 0 85
86 180.9 2 0 86
87 180.3 2 0 87
88 169.6 2 0 88
89 172.3 2 0 89
90 184.8 2 0 90
91 177.7 2 0 91
92 184.6 2 0 92
93 211.4 2 0 93
94 215.3 2 0 94
95 215.9 2 0 95
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) ontkoppelde_bedrijfstoeslag
90.6785 11.1582
oogstomvang t
-11.2396 0.6255
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-31.121 -7.869 -1.026 9.546 43.504
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 90.6785 4.0290 22.506 < 2e-16 ***
ontkoppelde_bedrijfstoeslag 11.1582 3.6069 3.094 0.00263 **
oogstomvang -11.2396 2.4756 -4.540 1.72e-05 ***
t 0.6255 0.1142 5.477 3.81e-07 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 15.81 on 91 degrees of freedom
Multiple R-Squared: 0.71, Adjusted R-squared: 0.7004
F-statistic: 74.27 on 3 and 91 DF, p-value: < 2.2e-16
> postscript(file="/var/www/html/rcomp/tmp/184ks1197628469.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/2rjwn1197628469.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/3zlaz1197628469.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/4y07v1197628469.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/57wdh1197628469.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 7
11.395929 11.270383 13.044837 10.719292 13.393746 6.268200 -2.957345
8 9 10 11 12 13 14
-5.382891 -2.908437 1.566018 3.240472 4.114926 5.889381 1.663835
15 16 17 18 19 20 21
1.338289 -1.187256 -2.912802 -5.638347 -1.863893 -1.989439 -3.514984
22 23 24 25 26 27 28
-6.640530 -7.666076 -7.091621 -6.617167 -7.942713 -9.468258 -11.193804
29 30 31 32 33 34 35
-10.319350 -5.644895 4.329559 13.804013 22.878468 19.852922 13.027377
36 37 38 39 40 41 42
6.701831 1.076285 1.050740 -2.574806 -4.300352 -1.025897 -6.151443
43 44 45 46 47 48 49
-13.876989 4.137077 5.411531 2.985986 8.760440 12.234894 17.209349
50 51 52 53 54 55 56
19.083803 25.758257 29.432712 24.807166 17.481620 3.356075 -14.909082
57 58 59 60 61 62 63
-14.934628 -18.760173 -18.785719 -18.011265 -30.495050 -31.120596 -25.246141
64 65 66 67 68 69 70
-30.671687 -30.397233 -29.122778 -24.648324 -7.794647 -7.420193 -7.745738
71 72 73 74 75 76 77
-12.971284 -8.396830 -16.980615 -10.306161 -9.631706 -6.757252 1.617203
78 79 80 81 82 83 84
-2.008343 3.066111 -28.538657 -23.764202 -4.989748 5.484706 9.459161
85 86 87 88 89 90 91
9.633615 14.108069 12.882524 1.556978 3.631432 15.505887 7.780341
92 93 94 95
14.054795 40.229250 43.503704 43.478158
> postscript(file="/var/www/html/rcomp/tmp/6uncu1197628469.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 11.395929 NA
1 11.270383 11.395929
2 13.044837 11.270383
3 10.719292 13.044837
4 13.393746 10.719292
5 6.268200 13.393746
6 -2.957345 6.268200
7 -5.382891 -2.957345
8 -2.908437 -5.382891
9 1.566018 -2.908437
10 3.240472 1.566018
11 4.114926 3.240472
12 5.889381 4.114926
13 1.663835 5.889381
14 1.338289 1.663835
15 -1.187256 1.338289
16 -2.912802 -1.187256
17 -5.638347 -2.912802
18 -1.863893 -5.638347
19 -1.989439 -1.863893
20 -3.514984 -1.989439
21 -6.640530 -3.514984
22 -7.666076 -6.640530
23 -7.091621 -7.666076
24 -6.617167 -7.091621
25 -7.942713 -6.617167
26 -9.468258 -7.942713
27 -11.193804 -9.468258
28 -10.319350 -11.193804
29 -5.644895 -10.319350
30 4.329559 -5.644895
31 13.804013 4.329559
32 22.878468 13.804013
33 19.852922 22.878468
34 13.027377 19.852922
35 6.701831 13.027377
36 1.076285 6.701831
37 1.050740 1.076285
38 -2.574806 1.050740
39 -4.300352 -2.574806
40 -1.025897 -4.300352
41 -6.151443 -1.025897
42 -13.876989 -6.151443
43 4.137077 -13.876989
44 5.411531 4.137077
45 2.985986 5.411531
46 8.760440 2.985986
47 12.234894 8.760440
48 17.209349 12.234894
49 19.083803 17.209349
50 25.758257 19.083803
51 29.432712 25.758257
52 24.807166 29.432712
53 17.481620 24.807166
54 3.356075 17.481620
55 -14.909082 3.356075
56 -14.934628 -14.909082
57 -18.760173 -14.934628
58 -18.785719 -18.760173
59 -18.011265 -18.785719
60 -30.495050 -18.011265
61 -31.120596 -30.495050
62 -25.246141 -31.120596
63 -30.671687 -25.246141
64 -30.397233 -30.671687
65 -29.122778 -30.397233
66 -24.648324 -29.122778
67 -7.794647 -24.648324
68 -7.420193 -7.794647
69 -7.745738 -7.420193
70 -12.971284 -7.745738
71 -8.396830 -12.971284
72 -16.980615 -8.396830
73 -10.306161 -16.980615
74 -9.631706 -10.306161
75 -6.757252 -9.631706
76 1.617203 -6.757252
77 -2.008343 1.617203
78 3.066111 -2.008343
79 -28.538657 3.066111
80 -23.764202 -28.538657
81 -4.989748 -23.764202
82 5.484706 -4.989748
83 9.459161 5.484706
84 9.633615 9.459161
85 14.108069 9.633615
86 12.882524 14.108069
87 1.556978 12.882524
88 3.631432 1.556978
89 15.505887 3.631432
90 7.780341 15.505887
91 14.054795 7.780341
92 40.229250 14.054795
93 43.503704 40.229250
94 43.478158 43.503704
95 NA 43.478158
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 11.270383 11.395929
[2,] 13.044837 11.270383
[3,] 10.719292 13.044837
[4,] 13.393746 10.719292
[5,] 6.268200 13.393746
[6,] -2.957345 6.268200
[7,] -5.382891 -2.957345
[8,] -2.908437 -5.382891
[9,] 1.566018 -2.908437
[10,] 3.240472 1.566018
[11,] 4.114926 3.240472
[12,] 5.889381 4.114926
[13,] 1.663835 5.889381
[14,] 1.338289 1.663835
[15,] -1.187256 1.338289
[16,] -2.912802 -1.187256
[17,] -5.638347 -2.912802
[18,] -1.863893 -5.638347
[19,] -1.989439 -1.863893
[20,] -3.514984 -1.989439
[21,] -6.640530 -3.514984
[22,] -7.666076 -6.640530
[23,] -7.091621 -7.666076
[24,] -6.617167 -7.091621
[25,] -7.942713 -6.617167
[26,] -9.468258 -7.942713
[27,] -11.193804 -9.468258
[28,] -10.319350 -11.193804
[29,] -5.644895 -10.319350
[30,] 4.329559 -5.644895
[31,] 13.804013 4.329559
[32,] 22.878468 13.804013
[33,] 19.852922 22.878468
[34,] 13.027377 19.852922
[35,] 6.701831 13.027377
[36,] 1.076285 6.701831
[37,] 1.050740 1.076285
[38,] -2.574806 1.050740
[39,] -4.300352 -2.574806
[40,] -1.025897 -4.300352
[41,] -6.151443 -1.025897
[42,] -13.876989 -6.151443
[43,] 4.137077 -13.876989
[44,] 5.411531 4.137077
[45,] 2.985986 5.411531
[46,] 8.760440 2.985986
[47,] 12.234894 8.760440
[48,] 17.209349 12.234894
[49,] 19.083803 17.209349
[50,] 25.758257 19.083803
[51,] 29.432712 25.758257
[52,] 24.807166 29.432712
[53,] 17.481620 24.807166
[54,] 3.356075 17.481620
[55,] -14.909082 3.356075
[56,] -14.934628 -14.909082
[57,] -18.760173 -14.934628
[58,] -18.785719 -18.760173
[59,] -18.011265 -18.785719
[60,] -30.495050 -18.011265
[61,] -31.120596 -30.495050
[62,] -25.246141 -31.120596
[63,] -30.671687 -25.246141
[64,] -30.397233 -30.671687
[65,] -29.122778 -30.397233
[66,] -24.648324 -29.122778
[67,] -7.794647 -24.648324
[68,] -7.420193 -7.794647
[69,] -7.745738 -7.420193
[70,] -12.971284 -7.745738
[71,] -8.396830 -12.971284
[72,] -16.980615 -8.396830
[73,] -10.306161 -16.980615
[74,] -9.631706 -10.306161
[75,] -6.757252 -9.631706
[76,] 1.617203 -6.757252
[77,] -2.008343 1.617203
[78,] 3.066111 -2.008343
[79,] -28.538657 3.066111
[80,] -23.764202 -28.538657
[81,] -4.989748 -23.764202
[82,] 5.484706 -4.989748
[83,] 9.459161 5.484706
[84,] 9.633615 9.459161
[85,] 14.108069 9.633615
[86,] 12.882524 14.108069
[87,] 1.556978 12.882524
[88,] 3.631432 1.556978
[89,] 15.505887 3.631432
[90,] 7.780341 15.505887
[91,] 14.054795 7.780341
[92,] 40.229250 14.054795
[93,] 43.503704 40.229250
[94,] 43.478158 43.503704
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 11.270383 11.395929
2 13.044837 11.270383
3 10.719292 13.044837
4 13.393746 10.719292
5 6.268200 13.393746
6 -2.957345 6.268200
7 -5.382891 -2.957345
8 -2.908437 -5.382891
9 1.566018 -2.908437
10 3.240472 1.566018
11 4.114926 3.240472
12 5.889381 4.114926
13 1.663835 5.889381
14 1.338289 1.663835
15 -1.187256 1.338289
16 -2.912802 -1.187256
17 -5.638347 -2.912802
18 -1.863893 -5.638347
19 -1.989439 -1.863893
20 -3.514984 -1.989439
21 -6.640530 -3.514984
22 -7.666076 -6.640530
23 -7.091621 -7.666076
24 -6.617167 -7.091621
25 -7.942713 -6.617167
26 -9.468258 -7.942713
27 -11.193804 -9.468258
28 -10.319350 -11.193804
29 -5.644895 -10.319350
30 4.329559 -5.644895
31 13.804013 4.329559
32 22.878468 13.804013
33 19.852922 22.878468
34 13.027377 19.852922
35 6.701831 13.027377
36 1.076285 6.701831
37 1.050740 1.076285
38 -2.574806 1.050740
39 -4.300352 -2.574806
40 -1.025897 -4.300352
41 -6.151443 -1.025897
42 -13.876989 -6.151443
43 4.137077 -13.876989
44 5.411531 4.137077
45 2.985986 5.411531
46 8.760440 2.985986
47 12.234894 8.760440
48 17.209349 12.234894
49 19.083803 17.209349
50 25.758257 19.083803
51 29.432712 25.758257
52 24.807166 29.432712
53 17.481620 24.807166
54 3.356075 17.481620
55 -14.909082 3.356075
56 -14.934628 -14.909082
57 -18.760173 -14.934628
58 -18.785719 -18.760173
59 -18.011265 -18.785719
60 -30.495050 -18.011265
61 -31.120596 -30.495050
62 -25.246141 -31.120596
63 -30.671687 -25.246141
64 -30.397233 -30.671687
65 -29.122778 -30.397233
66 -24.648324 -29.122778
67 -7.794647 -24.648324
68 -7.420193 -7.794647
69 -7.745738 -7.420193
70 -12.971284 -7.745738
71 -8.396830 -12.971284
72 -16.980615 -8.396830
73 -10.306161 -16.980615
74 -9.631706 -10.306161
75 -6.757252 -9.631706
76 1.617203 -6.757252
77 -2.008343 1.617203
78 3.066111 -2.008343
79 -28.538657 3.066111
80 -23.764202 -28.538657
81 -4.989748 -23.764202
82 5.484706 -4.989748
83 9.459161 5.484706
84 9.633615 9.459161
85 14.108069 9.633615
86 12.882524 14.108069
87 1.556978 12.882524
88 3.631432 1.556978
89 15.505887 3.631432
90 7.780341 15.505887
91 14.054795 7.780341
92 40.229250 14.054795
93 43.503704 40.229250
94 43.478158 43.503704
> 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/7sn4i1197628469.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/84cli1197628469.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/9wmf31197628469.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/10lwrn1197628470.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/11rxv51197628470.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/12fnne1197628470.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/138v5u1197628470.tab")
>
> system("convert tmp/184ks1197628469.ps tmp/184ks1197628469.png")
> system("convert tmp/2rjwn1197628469.ps tmp/2rjwn1197628469.png")
> system("convert tmp/3zlaz1197628469.ps tmp/3zlaz1197628469.png")
> system("convert tmp/4y07v1197628469.ps tmp/4y07v1197628469.png")
> system("convert tmp/57wdh1197628469.ps tmp/57wdh1197628469.png")
> system("convert tmp/6uncu1197628469.ps tmp/6uncu1197628469.png")
> system("convert tmp/7sn4i1197628469.ps tmp/7sn4i1197628469.png")
> system("convert tmp/84cli1197628469.ps tmp/84cli1197628469.png")
> system("convert tmp/9wmf31197628469.ps tmp/9wmf31197628469.png")
>
>
> proc.time()
user system elapsed
2.356 1.485 2.791