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(1.0137
+ ,89.97
+ ,0.9834
+ ,99.8
+ ,0.9643
+ ,112.99
+ ,0.947
+ ,93.69
+ ,0.906
+ ,108.02
+ ,0.9492
+ ,99.11
+ ,0.9397
+ ,94.33
+ ,0.9041
+ ,83.75
+ ,0.8721
+ ,106.37
+ ,0.8552
+ ,109.63
+ ,0.8564
+ ,105.5
+ ,0.8973
+ ,96.13
+ ,0.9383
+ ,102.48
+ ,0.9217
+ ,101.37
+ ,0.9095
+ ,112.76
+ ,0.892
+ ,95.57
+ ,0.8742
+ ,102.81
+ ,0.8532
+ ,104.13
+ ,0.8607
+ ,97.52
+ ,0.9005
+ ,85.29
+ ,0.9111
+ ,101.01
+ ,0.9059
+ ,108.48
+ ,0.8883
+ ,101.33
+ ,0.8924
+ ,87.57
+ ,0.8833
+ ,97.44
+ ,0.87
+ ,96.06
+ ,0.8758
+ ,106.67
+ ,0.8858
+ ,102.67
+ ,0.917
+ ,104.54
+ ,0.9554
+ ,102.46
+ ,0.9922
+ ,103.35
+ ,0.9778
+ ,83.27
+ ,0.9808
+ ,108.22
+ ,0.9811
+ ,115.23
+ ,1.0014
+ ,103.7
+ ,1.0183
+ ,93.61
+ ,1.0622
+ ,100.25
+ ,1.0773
+ ,100.56
+ ,1.0807
+ ,108.86
+ ,1.0848
+ ,105.43
+ ,1.1582
+ ,104.77
+ ,1.1663
+ ,109.13
+ ,1.1372
+ ,106.13
+ ,1.1139
+ ,82.27
+ ,1.1222
+ ,113.6
+ ,1.1692
+ ,117.73
+ ,1.1702
+ ,104.83
+ ,1.2286
+ ,104.61
+ ,1.2613
+ ,102.93
+ ,1.2646
+ ,106.95
+ ,1.2262
+ ,123.45
+ ,1.1985
+ ,111.99
+ ,1.2007
+ ,103.95
+ ,1.2138
+ ,122.05
+ ,1.2266
+ ,108.04
+ ,1.2176
+ ,93.72
+ ,1.2218
+ ,119.61
+ ,1.249
+ ,118.29
+ ,1.2991
+ ,117.14
+ ,1.3408
+ ,112.76
+ ,1.3119
+ ,105.97
+ ,1.3014
+ ,107.96
+ ,1.3201
+ ,122.27
+ ,1.2938
+ ,114.54
+ ,1.2694
+ ,110.15
+ ,1.2165
+ ,120.02
+ ,1.2037
+ ,103.94
+ ,1.2292
+ ,96.18
+ ,1.2256
+ ,121.01
+ ,1.2015
+ ,110.55
+ ,1.1786
+ ,120.04
+ ,1.1856
+ ,114.19)
+ ,dim=c(2
+ ,72)
+ ,dimnames=list(c('wk'
+ ,'uit')
+ ,1:72))
> y <- array(NA,dim=c(2,72),dimnames=list(c('wk','uit'),1:72))
> 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 = '2'
> #'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
uit wk M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 89.97 1.0137 1 0 0 0 0 0 0 0 0 0 0 1
2 99.80 0.9834 0 1 0 0 0 0 0 0 0 0 0 2
3 112.99 0.9643 0 0 1 0 0 0 0 0 0 0 0 3
4 93.69 0.9470 0 0 0 1 0 0 0 0 0 0 0 4
5 108.02 0.9060 0 0 0 0 1 0 0 0 0 0 0 5
6 99.11 0.9492 0 0 0 0 0 1 0 0 0 0 0 6
7 94.33 0.9397 0 0 0 0 0 0 1 0 0 0 0 7
8 83.75 0.9041 0 0 0 0 0 0 0 1 0 0 0 8
9 106.37 0.8721 0 0 0 0 0 0 0 0 1 0 0 9
10 109.63 0.8552 0 0 0 0 0 0 0 0 0 1 0 10
11 105.50 0.8564 0 0 0 0 0 0 0 0 0 0 1 11
12 96.13 0.8973 0 0 0 0 0 0 0 0 0 0 0 12
13 102.48 0.9383 1 0 0 0 0 0 0 0 0 0 0 13
14 101.37 0.9217 0 1 0 0 0 0 0 0 0 0 0 14
15 112.76 0.9095 0 0 1 0 0 0 0 0 0 0 0 15
16 95.57 0.8920 0 0 0 1 0 0 0 0 0 0 0 16
17 102.81 0.8742 0 0 0 0 1 0 0 0 0 0 0 17
18 104.13 0.8532 0 0 0 0 0 1 0 0 0 0 0 18
19 97.52 0.8607 0 0 0 0 0 0 1 0 0 0 0 19
20 85.29 0.9005 0 0 0 0 0 0 0 1 0 0 0 20
21 101.01 0.9111 0 0 0 0 0 0 0 0 1 0 0 21
22 108.48 0.9059 0 0 0 0 0 0 0 0 0 1 0 22
23 101.33 0.8883 0 0 0 0 0 0 0 0 0 0 1 23
24 87.57 0.8924 0 0 0 0 0 0 0 0 0 0 0 24
25 97.44 0.8833 1 0 0 0 0 0 0 0 0 0 0 25
26 96.06 0.8700 0 1 0 0 0 0 0 0 0 0 0 26
27 106.67 0.8758 0 0 1 0 0 0 0 0 0 0 0 27
28 102.67 0.8858 0 0 0 1 0 0 0 0 0 0 0 28
29 104.54 0.9170 0 0 0 0 1 0 0 0 0 0 0 29
30 102.46 0.9554 0 0 0 0 0 1 0 0 0 0 0 30
31 103.35 0.9922 0 0 0 0 0 0 1 0 0 0 0 31
32 83.27 0.9778 0 0 0 0 0 0 0 1 0 0 0 32
33 108.22 0.9808 0 0 0 0 0 0 0 0 1 0 0 33
34 115.23 0.9811 0 0 0 0 0 0 0 0 0 1 0 34
35 103.70 1.0014 0 0 0 0 0 0 0 0 0 0 1 35
36 93.61 1.0183 0 0 0 0 0 0 0 0 0 0 0 36
37 100.25 1.0622 1 0 0 0 0 0 0 0 0 0 0 37
38 100.56 1.0773 0 1 0 0 0 0 0 0 0 0 0 38
39 108.86 1.0807 0 0 1 0 0 0 0 0 0 0 0 39
40 105.43 1.0848 0 0 0 1 0 0 0 0 0 0 0 40
41 104.77 1.1582 0 0 0 0 1 0 0 0 0 0 0 41
42 109.13 1.1663 0 0 0 0 0 1 0 0 0 0 0 42
43 106.13 1.1372 0 0 0 0 0 0 1 0 0 0 0 43
44 82.27 1.1139 0 0 0 0 0 0 0 1 0 0 0 44
45 113.60 1.1222 0 0 0 0 0 0 0 0 1 0 0 45
46 117.73 1.1692 0 0 0 0 0 0 0 0 0 1 0 46
47 104.83 1.1702 0 0 0 0 0 0 0 0 0 0 1 47
48 104.61 1.2286 0 0 0 0 0 0 0 0 0 0 0 48
49 102.93 1.2613 1 0 0 0 0 0 0 0 0 0 0 49
50 106.95 1.2646 0 1 0 0 0 0 0 0 0 0 0 50
51 123.45 1.2262 0 0 1 0 0 0 0 0 0 0 0 51
52 111.99 1.1985 0 0 0 1 0 0 0 0 0 0 0 52
53 103.95 1.2007 0 0 0 0 1 0 0 0 0 0 0 53
54 122.05 1.2138 0 0 0 0 0 1 0 0 0 0 0 54
55 108.04 1.2266 0 0 0 0 0 0 1 0 0 0 0 55
56 93.72 1.2176 0 0 0 0 0 0 0 1 0 0 0 56
57 119.61 1.2218 0 0 0 0 0 0 0 0 1 0 0 57
58 118.29 1.2490 0 0 0 0 0 0 0 0 0 1 0 58
59 117.14 1.2991 0 0 0 0 0 0 0 0 0 0 1 59
60 112.76 1.3408 0 0 0 0 0 0 0 0 0 0 0 60
61 105.97 1.3119 1 0 0 0 0 0 0 0 0 0 0 61
62 107.96 1.3014 0 1 0 0 0 0 0 0 0 0 0 62
63 122.27 1.3201 0 0 1 0 0 0 0 0 0 0 0 63
64 114.54 1.2938 0 0 0 1 0 0 0 0 0 0 0 64
65 110.15 1.2694 0 0 0 0 1 0 0 0 0 0 0 65
66 120.02 1.2165 0 0 0 0 0 1 0 0 0 0 0 66
67 103.94 1.2037 0 0 0 0 0 0 1 0 0 0 0 67
68 96.18 1.2292 0 0 0 0 0 0 0 1 0 0 0 68
69 121.01 1.2256 0 0 0 0 0 0 0 0 1 0 0 69
70 110.55 1.2015 0 0 0 0 0 0 0 0 0 1 0 70
71 120.04 1.1786 0 0 0 0 0 0 0 0 0 0 1 71
72 114.19 1.1856 0 0 0 0 0 0 0 0 0 0 0 72
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) wk M1 M2 M3 M4
76.94489 17.92728 -0.07294 2.24276 14.63375 4.22137
M5 M6 M7 M8 M9 M10
5.75862 9.33170 1.93243 -12.93901 11.19547 12.67534
M11 t
7.90052 0.11724
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-8.8165 -2.9429 0.2871 2.7990 8.4882
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 76.94489 6.51314 11.814 < 2e-16 ***
wk 17.92728 7.60951 2.356 0.021879 *
M1 -0.07294 2.60061 -0.028 0.977722
M2 2.24276 2.58035 0.869 0.388339
M3 14.63375 2.56672 5.701 4.21e-07 ***
M4 4.22137 2.55589 1.652 0.104016
M5 5.75862 2.55343 2.255 0.027907 *
M6 9.33170 2.55150 3.657 0.000551 ***
M7 1.93243 2.54974 0.758 0.451584
M8 -12.93901 2.54967 -5.075 4.28e-06 ***
M9 11.19547 2.55140 4.388 4.90e-05 ***
M10 12.67534 2.55165 4.968 6.32e-06 ***
M11 7.90052 2.55192 3.096 0.003020 **
t 0.11724 0.05725 2.048 0.045111 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.411 on 58 degrees of freedom
Multiple R-Squared: 0.8283, Adjusted R-squared: 0.7898
F-statistic: 21.53 on 13 and 58 DF, p-value: < 2.2e-16
> postscript(file="/var/www/html/rcomp/tmp/1l5rp1199880393.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/2sttj1199880393.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/3vbt41199880393.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/4wr1v1199880393.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/5hhwm1199880393.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 = 72
Frequency = 1
1 2 3 4 5 6
-5.192077714 2.748186060 3.772370379 -4.922348984 8.488183423 -4.886591973
7 8 9 10 11 12
-2.214251906 2.598165271 1.540120010 3.505981360 4.012046234 1.692105548
13 14 15 16 17 18
7.262786742 4.017446793 3.117932886 -3.463201021 2.441418511 0.447574433
19 20 21 22 23 24
0.985150755 2.795851090 -5.925896260 0.040215924 -2.136686354 -8.186903171
25 26 27 28 29 30
1.801934706 -1.772565265 -3.774770195 2.341095723 1.997278580 -4.461445876
31 32 33 34 35 36
3.050861169 -2.016779969 -1.372279998 4.035232151 -3.201114005 -5.810799994
37 38 39 40 41 42
-0.002107908 -2.395742605 -6.664922065 0.126714800 -3.503633520 -2.979161420
43 44 45 46 47 48
1.824553317 -6.863535038 0.065950353 1.756258570 -6.504091100 0.012240829
49 50 51 52 53 54
-2.298281559 -0.770374363 3.909806443 3.241530782 -6.492395267 7.682440438
55 56 57 58 59 60
0.725002181 1.320553735 2.883540971 -0.521190687 2.088230241 4.743947730
61 62 63 64 65 66
-1.572254267 -1.826950619 -0.360417449 2.676208700 -2.930851726 4.197184398
67 68 69 70 71 72
-4.371315515 2.165744911 2.808564924 -8.816497317 5.741614984 7.549409057
> postscript(file="/var/www/html/rcomp/tmp/68hcv1199880393.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 = 72
Frequency = 1
lag(myerror, k = 1) myerror
0 -5.192077714 NA
1 2.748186060 -5.192077714
2 3.772370379 2.748186060
3 -4.922348984 3.772370379
4 8.488183423 -4.922348984
5 -4.886591973 8.488183423
6 -2.214251906 -4.886591973
7 2.598165271 -2.214251906
8 1.540120010 2.598165271
9 3.505981360 1.540120010
10 4.012046234 3.505981360
11 1.692105548 4.012046234
12 7.262786742 1.692105548
13 4.017446793 7.262786742
14 3.117932886 4.017446793
15 -3.463201021 3.117932886
16 2.441418511 -3.463201021
17 0.447574433 2.441418511
18 0.985150755 0.447574433
19 2.795851090 0.985150755
20 -5.925896260 2.795851090
21 0.040215924 -5.925896260
22 -2.136686354 0.040215924
23 -8.186903171 -2.136686354
24 1.801934706 -8.186903171
25 -1.772565265 1.801934706
26 -3.774770195 -1.772565265
27 2.341095723 -3.774770195
28 1.997278580 2.341095723
29 -4.461445876 1.997278580
30 3.050861169 -4.461445876
31 -2.016779969 3.050861169
32 -1.372279998 -2.016779969
33 4.035232151 -1.372279998
34 -3.201114005 4.035232151
35 -5.810799994 -3.201114005
36 -0.002107908 -5.810799994
37 -2.395742605 -0.002107908
38 -6.664922065 -2.395742605
39 0.126714800 -6.664922065
40 -3.503633520 0.126714800
41 -2.979161420 -3.503633520
42 1.824553317 -2.979161420
43 -6.863535038 1.824553317
44 0.065950353 -6.863535038
45 1.756258570 0.065950353
46 -6.504091100 1.756258570
47 0.012240829 -6.504091100
48 -2.298281559 0.012240829
49 -0.770374363 -2.298281559
50 3.909806443 -0.770374363
51 3.241530782 3.909806443
52 -6.492395267 3.241530782
53 7.682440438 -6.492395267
54 0.725002181 7.682440438
55 1.320553735 0.725002181
56 2.883540971 1.320553735
57 -0.521190687 2.883540971
58 2.088230241 -0.521190687
59 4.743947730 2.088230241
60 -1.572254267 4.743947730
61 -1.826950619 -1.572254267
62 -0.360417449 -1.826950619
63 2.676208700 -0.360417449
64 -2.930851726 2.676208700
65 4.197184398 -2.930851726
66 -4.371315515 4.197184398
67 2.165744911 -4.371315515
68 2.808564924 2.165744911
69 -8.816497317 2.808564924
70 5.741614984 -8.816497317
71 7.549409057 5.741614984
72 NA 7.549409057
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2.748186060 -5.192077714
[2,] 3.772370379 2.748186060
[3,] -4.922348984 3.772370379
[4,] 8.488183423 -4.922348984
[5,] -4.886591973 8.488183423
[6,] -2.214251906 -4.886591973
[7,] 2.598165271 -2.214251906
[8,] 1.540120010 2.598165271
[9,] 3.505981360 1.540120010
[10,] 4.012046234 3.505981360
[11,] 1.692105548 4.012046234
[12,] 7.262786742 1.692105548
[13,] 4.017446793 7.262786742
[14,] 3.117932886 4.017446793
[15,] -3.463201021 3.117932886
[16,] 2.441418511 -3.463201021
[17,] 0.447574433 2.441418511
[18,] 0.985150755 0.447574433
[19,] 2.795851090 0.985150755
[20,] -5.925896260 2.795851090
[21,] 0.040215924 -5.925896260
[22,] -2.136686354 0.040215924
[23,] -8.186903171 -2.136686354
[24,] 1.801934706 -8.186903171
[25,] -1.772565265 1.801934706
[26,] -3.774770195 -1.772565265
[27,] 2.341095723 -3.774770195
[28,] 1.997278580 2.341095723
[29,] -4.461445876 1.997278580
[30,] 3.050861169 -4.461445876
[31,] -2.016779969 3.050861169
[32,] -1.372279998 -2.016779969
[33,] 4.035232151 -1.372279998
[34,] -3.201114005 4.035232151
[35,] -5.810799994 -3.201114005
[36,] -0.002107908 -5.810799994
[37,] -2.395742605 -0.002107908
[38,] -6.664922065 -2.395742605
[39,] 0.126714800 -6.664922065
[40,] -3.503633520 0.126714800
[41,] -2.979161420 -3.503633520
[42,] 1.824553317 -2.979161420
[43,] -6.863535038 1.824553317
[44,] 0.065950353 -6.863535038
[45,] 1.756258570 0.065950353
[46,] -6.504091100 1.756258570
[47,] 0.012240829 -6.504091100
[48,] -2.298281559 0.012240829
[49,] -0.770374363 -2.298281559
[50,] 3.909806443 -0.770374363
[51,] 3.241530782 3.909806443
[52,] -6.492395267 3.241530782
[53,] 7.682440438 -6.492395267
[54,] 0.725002181 7.682440438
[55,] 1.320553735 0.725002181
[56,] 2.883540971 1.320553735
[57,] -0.521190687 2.883540971
[58,] 2.088230241 -0.521190687
[59,] 4.743947730 2.088230241
[60,] -1.572254267 4.743947730
[61,] -1.826950619 -1.572254267
[62,] -0.360417449 -1.826950619
[63,] 2.676208700 -0.360417449
[64,] -2.930851726 2.676208700
[65,] 4.197184398 -2.930851726
[66,] -4.371315515 4.197184398
[67,] 2.165744911 -4.371315515
[68,] 2.808564924 2.165744911
[69,] -8.816497317 2.808564924
[70,] 5.741614984 -8.816497317
[71,] 7.549409057 5.741614984
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2.748186060 -5.192077714
2 3.772370379 2.748186060
3 -4.922348984 3.772370379
4 8.488183423 -4.922348984
5 -4.886591973 8.488183423
6 -2.214251906 -4.886591973
7 2.598165271 -2.214251906
8 1.540120010 2.598165271
9 3.505981360 1.540120010
10 4.012046234 3.505981360
11 1.692105548 4.012046234
12 7.262786742 1.692105548
13 4.017446793 7.262786742
14 3.117932886 4.017446793
15 -3.463201021 3.117932886
16 2.441418511 -3.463201021
17 0.447574433 2.441418511
18 0.985150755 0.447574433
19 2.795851090 0.985150755
20 -5.925896260 2.795851090
21 0.040215924 -5.925896260
22 -2.136686354 0.040215924
23 -8.186903171 -2.136686354
24 1.801934706 -8.186903171
25 -1.772565265 1.801934706
26 -3.774770195 -1.772565265
27 2.341095723 -3.774770195
28 1.997278580 2.341095723
29 -4.461445876 1.997278580
30 3.050861169 -4.461445876
31 -2.016779969 3.050861169
32 -1.372279998 -2.016779969
33 4.035232151 -1.372279998
34 -3.201114005 4.035232151
35 -5.810799994 -3.201114005
36 -0.002107908 -5.810799994
37 -2.395742605 -0.002107908
38 -6.664922065 -2.395742605
39 0.126714800 -6.664922065
40 -3.503633520 0.126714800
41 -2.979161420 -3.503633520
42 1.824553317 -2.979161420
43 -6.863535038 1.824553317
44 0.065950353 -6.863535038
45 1.756258570 0.065950353
46 -6.504091100 1.756258570
47 0.012240829 -6.504091100
48 -2.298281559 0.012240829
49 -0.770374363 -2.298281559
50 3.909806443 -0.770374363
51 3.241530782 3.909806443
52 -6.492395267 3.241530782
53 7.682440438 -6.492395267
54 0.725002181 7.682440438
55 1.320553735 0.725002181
56 2.883540971 1.320553735
57 -0.521190687 2.883540971
58 2.088230241 -0.521190687
59 4.743947730 2.088230241
60 -1.572254267 4.743947730
61 -1.826950619 -1.572254267
62 -0.360417449 -1.826950619
63 2.676208700 -0.360417449
64 -2.930851726 2.676208700
65 4.197184398 -2.930851726
66 -4.371315515 4.197184398
67 2.165744911 -4.371315515
68 2.808564924 2.165744911
69 -8.816497317 2.808564924
70 5.741614984 -8.816497317
71 7.549409057 5.741614984
> 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/7kxu51199880393.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/88al31199880393.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/9gwdp1199880393.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/10dhcq1199880393.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/11qp8p1199880393.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/12a40c1199880393.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/13swt61199880393.tab")
>
> system("convert tmp/1l5rp1199880393.ps tmp/1l5rp1199880393.png")
> system("convert tmp/2sttj1199880393.ps tmp/2sttj1199880393.png")
> system("convert tmp/3vbt41199880393.ps tmp/3vbt41199880393.png")
> system("convert tmp/4wr1v1199880393.ps tmp/4wr1v1199880393.png")
> system("convert tmp/5hhwm1199880393.ps tmp/5hhwm1199880393.png")
> system("convert tmp/68hcv1199880393.ps tmp/68hcv1199880393.png")
> system("convert tmp/7kxu51199880393.ps tmp/7kxu51199880393.png")
> system("convert tmp/88al31199880393.ps tmp/88al31199880393.png")
> system("convert tmp/9gwdp1199880393.ps tmp/9gwdp1199880393.png")
>
>
> proc.time()
user system elapsed
2.279 1.438 2.979