R version 2.8.0 (2008-10-20)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(727
+ ,0
+ ,817
+ ,0
+ ,918
+ ,0
+ ,786
+ ,0
+ ,803
+ ,0
+ ,756
+ ,0
+ ,725
+ ,0
+ ,523
+ ,0
+ ,538
+ ,0
+ ,587
+ ,0
+ ,505
+ ,0
+ ,521
+ ,0
+ ,498
+ ,0
+ ,550
+ ,0
+ ,637
+ ,0
+ ,622
+ ,0
+ ,668
+ ,0
+ ,669
+ ,0
+ ,670
+ ,0
+ ,499
+ ,0
+ ,539
+ ,0
+ ,593
+ ,0
+ ,429
+ ,0
+ ,622
+ ,0
+ ,533
+ ,0
+ ,655
+ ,0
+ ,835
+ ,0
+ ,686
+ ,0
+ ,706
+ ,0
+ ,869
+ ,0
+ ,777
+ ,0
+ ,739
+ ,0
+ ,637
+ ,0
+ ,597
+ ,0
+ ,629
+ ,0
+ ,940
+ ,0
+ ,444
+ ,0
+ ,496
+ ,0
+ ,801
+ ,0
+ ,659
+ ,0
+ ,767
+ ,0
+ ,876
+ ,0
+ ,601
+ ,0
+ ,697
+ ,0
+ ,745
+ ,0
+ ,655
+ ,0
+ ,572
+ ,0
+ ,628
+ ,0
+ ,650
+ ,0
+ ,677
+ ,0
+ ,900
+ ,0
+ ,780
+ ,0
+ ,896
+ ,0
+ ,1092
+ ,0
+ ,823
+ ,0
+ ,735
+ ,0
+ ,770
+ ,0
+ ,915
+ ,0
+ ,645
+ ,0
+ ,566
+ ,0
+ ,707
+ ,0
+ ,785
+ ,0
+ ,762
+ ,0
+ ,712
+ ,0
+ ,714
+ ,0
+ ,823
+ ,0
+ ,609
+ ,0
+ ,620
+ ,0
+ ,619
+ ,0
+ ,638
+ ,0
+ ,483
+ ,0
+ ,535
+ ,0
+ ,617
+ ,0
+ ,698
+ ,0
+ ,804
+ ,0
+ ,824
+ ,0
+ ,878
+ ,0
+ ,1019
+ ,0
+ ,974
+ ,0
+ ,773
+ ,0
+ ,734
+ ,0
+ ,827
+ ,0
+ ,804
+ ,0
+ ,721
+ ,0
+ ,659
+ ,0
+ ,732
+ ,0
+ ,839
+ ,0
+ ,994
+ ,0
+ ,828
+ ,0
+ ,1039
+ ,0
+ ,1072
+ ,0
+ ,803
+ ,0
+ ,1035
+ ,0
+ ,922
+ ,0
+ ,834
+ ,0
+ ,1739
+ ,0
+ ,359
+ ,1
+ ,513
+ ,1
+ ,699
+ ,1
+ ,741
+ ,1
+ ,793
+ ,1
+ ,877
+ ,1
+ ,750
+ ,1
+ ,752
+ ,1
+ ,675
+ ,1
+ ,682
+ ,1
+ ,583
+ ,1
+ ,632
+ ,1
+ ,606
+ ,1
+ ,645
+ ,1
+ ,980
+ ,1
+ ,847
+ ,1
+ ,941
+ ,1
+ ,1066
+ ,1
+ ,936
+ ,1
+ ,880
+ ,1
+ ,808
+ ,1
+ ,741
+ ,1
+ ,780
+ ,1
+ ,675
+ ,1
+ ,782
+ ,1
+ ,795
+ ,1
+ ,873
+ ,1
+ ,727
+ ,1
+ ,998
+ ,1
+ ,768
+ ,1
+ ,714
+ ,1
+ ,782
+ ,1
+ ,578
+ ,1
+ ,664
+ ,1
+ ,560
+ ,1
+ ,516
+ ,1
+ ,752
+ ,1
+ ,597
+ ,1
+ ,716
+ ,1
+ ,691
+ ,1
+ ,752
+ ,1
+ ,718
+ ,1
+ ,737
+ ,1
+ ,621
+ ,1
+ ,472
+ ,1
+ ,719
+ ,1
+ ,497
+ ,1
+ ,536
+ ,1
+ ,653
+ ,1
+ ,605
+ ,1
+ ,637
+ ,1
+ ,743
+ ,1
+ ,719
+ ,1
+ ,653
+ ,1
+ ,675
+ ,1
+ ,590
+ ,1
+ ,527
+ ,1
+ ,534
+ ,1
+ ,463
+ ,1
+ ,542
+ ,1
+ ,568
+ ,1
+ ,501
+ ,1
+ ,678
+ ,1
+ ,774
+ ,1
+ ,665
+ ,1
+ ,742
+ ,1
+ ,715
+ ,1
+ ,638
+ ,1
+ ,656
+ ,1
+ ,606
+ ,1
+ ,498
+ ,1
+ ,587
+ ,1
+ ,677
+ ,1
+ ,547
+ ,1
+ ,871
+ ,1
+ ,731
+ ,1
+ ,752
+ ,1
+ ,862
+ ,1
+ ,619
+ ,1
+ ,700
+ ,1
+ ,667
+ ,1
+ ,667
+ ,1
+ ,650
+ ,1
+ ,547
+ ,1
+ ,637
+ ,1
+ ,655
+ ,1
+ ,703
+ ,1
+ ,886
+ ,1
+ ,896
+ ,1
+ ,831
+ ,1
+ ,741
+ ,1
+ ,833
+ ,1
+ ,750
+ ,1
+ ,779
+ ,1
+ ,655
+ ,1
+ ,739
+ ,1
+ ,845
+ ,1
+ ,795
+ ,1
+ ,1021
+ ,1
+ ,726
+ ,1
+ ,1045
+ ,1
+ ,915
+ ,1
+ ,852
+ ,1
+ ,772
+ ,1
+ ,729
+ ,1
+ ,755
+ ,1
+ ,691
+ ,1
+ ,729
+ ,1
+ ,702
+ ,1
+ ,702
+ ,1
+ ,894
+ ,1
+ ,765
+ ,1
+ ,753
+ ,1
+ ,876
+ ,1
+ ,781
+ ,1
+ ,776
+ ,1
+ ,606
+ ,1
+ ,775
+ ,1
+ ,663
+ ,1
+ ,649
+ ,1
+ ,821
+ ,1
+ ,771
+ ,1
+ ,635
+ ,1
+ ,1070
+ ,1
+ ,693
+ ,1
+ ,779
+ ,1)
+ ,dim=c(2
+ ,222)
+ ,dimnames=list(c('y'
+ ,'x')
+ ,1:222))
> y <- array(NA,dim=c(2,222),dimnames=list(c('y','x'),1:222))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Include Monthly Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> 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
y x M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 727 0 1 0 0 0 0 0 0 0 0 0 0 1
2 817 0 0 1 0 0 0 0 0 0 0 0 0 2
3 918 0 0 0 1 0 0 0 0 0 0 0 0 3
4 786 0 0 0 0 1 0 0 0 0 0 0 0 4
5 803 0 0 0 0 0 1 0 0 0 0 0 0 5
6 756 0 0 0 0 0 0 1 0 0 0 0 0 6
7 725 0 0 0 0 0 0 0 1 0 0 0 0 7
8 523 0 0 0 0 0 0 0 0 1 0 0 0 8
9 538 0 0 0 0 0 0 0 0 0 1 0 0 9
10 587 0 0 0 0 0 0 0 0 0 0 1 0 10
11 505 0 0 0 0 0 0 0 0 0 0 0 1 11
12 521 0 0 0 0 0 0 0 0 0 0 0 0 12
13 498 0 1 0 0 0 0 0 0 0 0 0 0 13
14 550 0 0 1 0 0 0 0 0 0 0 0 0 14
15 637 0 0 0 1 0 0 0 0 0 0 0 0 15
16 622 0 0 0 0 1 0 0 0 0 0 0 0 16
17 668 0 0 0 0 0 1 0 0 0 0 0 0 17
18 669 0 0 0 0 0 0 1 0 0 0 0 0 18
19 670 0 0 0 0 0 0 0 1 0 0 0 0 19
20 499 0 0 0 0 0 0 0 0 1 0 0 0 20
21 539 0 0 0 0 0 0 0 0 0 1 0 0 21
22 593 0 0 0 0 0 0 0 0 0 0 1 0 22
23 429 0 0 0 0 0 0 0 0 0 0 0 1 23
24 622 0 0 0 0 0 0 0 0 0 0 0 0 24
25 533 0 1 0 0 0 0 0 0 0 0 0 0 25
26 655 0 0 1 0 0 0 0 0 0 0 0 0 26
27 835 0 0 0 1 0 0 0 0 0 0 0 0 27
28 686 0 0 0 0 1 0 0 0 0 0 0 0 28
29 706 0 0 0 0 0 1 0 0 0 0 0 0 29
30 869 0 0 0 0 0 0 1 0 0 0 0 0 30
31 777 0 0 0 0 0 0 0 1 0 0 0 0 31
32 739 0 0 0 0 0 0 0 0 1 0 0 0 32
33 637 0 0 0 0 0 0 0 0 0 1 0 0 33
34 597 0 0 0 0 0 0 0 0 0 0 1 0 34
35 629 0 0 0 0 0 0 0 0 0 0 0 1 35
36 940 0 0 0 0 0 0 0 0 0 0 0 0 36
37 444 0 1 0 0 0 0 0 0 0 0 0 0 37
38 496 0 0 1 0 0 0 0 0 0 0 0 0 38
39 801 0 0 0 1 0 0 0 0 0 0 0 0 39
40 659 0 0 0 0 1 0 0 0 0 0 0 0 40
41 767 0 0 0 0 0 1 0 0 0 0 0 0 41
42 876 0 0 0 0 0 0 1 0 0 0 0 0 42
43 601 0 0 0 0 0 0 0 1 0 0 0 0 43
44 697 0 0 0 0 0 0 0 0 1 0 0 0 44
45 745 0 0 0 0 0 0 0 0 0 1 0 0 45
46 655 0 0 0 0 0 0 0 0 0 0 1 0 46
47 572 0 0 0 0 0 0 0 0 0 0 0 1 47
48 628 0 0 0 0 0 0 0 0 0 0 0 0 48
49 650 0 1 0 0 0 0 0 0 0 0 0 0 49
50 677 0 0 1 0 0 0 0 0 0 0 0 0 50
51 900 0 0 0 1 0 0 0 0 0 0 0 0 51
52 780 0 0 0 0 1 0 0 0 0 0 0 0 52
53 896 0 0 0 0 0 1 0 0 0 0 0 0 53
54 1092 0 0 0 0 0 0 1 0 0 0 0 0 54
55 823 0 0 0 0 0 0 0 1 0 0 0 0 55
56 735 0 0 0 0 0 0 0 0 1 0 0 0 56
57 770 0 0 0 0 0 0 0 0 0 1 0 0 57
58 915 0 0 0 0 0 0 0 0 0 0 1 0 58
59 645 0 0 0 0 0 0 0 0 0 0 0 1 59
60 566 0 0 0 0 0 0 0 0 0 0 0 0 60
61 707 0 1 0 0 0 0 0 0 0 0 0 0 61
62 785 0 0 1 0 0 0 0 0 0 0 0 0 62
63 762 0 0 0 1 0 0 0 0 0 0 0 0 63
64 712 0 0 0 0 1 0 0 0 0 0 0 0 64
65 714 0 0 0 0 0 1 0 0 0 0 0 0 65
66 823 0 0 0 0 0 0 1 0 0 0 0 0 66
67 609 0 0 0 0 0 0 0 1 0 0 0 0 67
68 620 0 0 0 0 0 0 0 0 1 0 0 0 68
69 619 0 0 0 0 0 0 0 0 0 1 0 0 69
70 638 0 0 0 0 0 0 0 0 0 0 1 0 70
71 483 0 0 0 0 0 0 0 0 0 0 0 1 71
72 535 0 0 0 0 0 0 0 0 0 0 0 0 72
73 617 0 1 0 0 0 0 0 0 0 0 0 0 73
74 698 0 0 1 0 0 0 0 0 0 0 0 0 74
75 804 0 0 0 1 0 0 0 0 0 0 0 0 75
76 824 0 0 0 0 1 0 0 0 0 0 0 0 76
77 878 0 0 0 0 0 1 0 0 0 0 0 0 77
78 1019 0 0 0 0 0 0 1 0 0 0 0 0 78
79 974 0 0 0 0 0 0 0 1 0 0 0 0 79
80 773 0 0 0 0 0 0 0 0 1 0 0 0 80
81 734 0 0 0 0 0 0 0 0 0 1 0 0 81
82 827 0 0 0 0 0 0 0 0 0 0 1 0 82
83 804 0 0 0 0 0 0 0 0 0 0 0 1 83
84 721 0 0 0 0 0 0 0 0 0 0 0 0 84
85 659 0 1 0 0 0 0 0 0 0 0 0 0 85
86 732 0 0 1 0 0 0 0 0 0 0 0 0 86
87 839 0 0 0 1 0 0 0 0 0 0 0 0 87
88 994 0 0 0 0 1 0 0 0 0 0 0 0 88
89 828 0 0 0 0 0 1 0 0 0 0 0 0 89
90 1039 0 0 0 0 0 0 1 0 0 0 0 0 90
91 1072 0 0 0 0 0 0 0 1 0 0 0 0 91
92 803 0 0 0 0 0 0 0 0 1 0 0 0 92
93 1035 0 0 0 0 0 0 0 0 0 1 0 0 93
94 922 0 0 0 0 0 0 0 0 0 0 1 0 94
95 834 0 0 0 0 0 0 0 0 0 0 0 1 95
96 1739 0 0 0 0 0 0 0 0 0 0 0 0 96
97 359 1 1 0 0 0 0 0 0 0 0 0 0 97
98 513 1 0 1 0 0 0 0 0 0 0 0 0 98
99 699 1 0 0 1 0 0 0 0 0 0 0 0 99
100 741 1 0 0 0 1 0 0 0 0 0 0 0 100
101 793 1 0 0 0 0 1 0 0 0 0 0 0 101
102 877 1 0 0 0 0 0 1 0 0 0 0 0 102
103 750 1 0 0 0 0 0 0 1 0 0 0 0 103
104 752 1 0 0 0 0 0 0 0 1 0 0 0 104
105 675 1 0 0 0 0 0 0 0 0 1 0 0 105
106 682 1 0 0 0 0 0 0 0 0 0 1 0 106
107 583 1 0 0 0 0 0 0 0 0 0 0 1 107
108 632 1 0 0 0 0 0 0 0 0 0 0 0 108
109 606 1 1 0 0 0 0 0 0 0 0 0 0 109
110 645 1 0 1 0 0 0 0 0 0 0 0 0 110
111 980 1 0 0 1 0 0 0 0 0 0 0 0 111
112 847 1 0 0 0 1 0 0 0 0 0 0 0 112
113 941 1 0 0 0 0 1 0 0 0 0 0 0 113
114 1066 1 0 0 0 0 0 1 0 0 0 0 0 114
115 936 1 0 0 0 0 0 0 1 0 0 0 0 115
116 880 1 0 0 0 0 0 0 0 1 0 0 0 116
117 808 1 0 0 0 0 0 0 0 0 1 0 0 117
118 741 1 0 0 0 0 0 0 0 0 0 1 0 118
119 780 1 0 0 0 0 0 0 0 0 0 0 1 119
120 675 1 0 0 0 0 0 0 0 0 0 0 0 120
121 782 1 1 0 0 0 0 0 0 0 0 0 0 121
122 795 1 0 1 0 0 0 0 0 0 0 0 0 122
123 873 1 0 0 1 0 0 0 0 0 0 0 0 123
124 727 1 0 0 0 1 0 0 0 0 0 0 0 124
125 998 1 0 0 0 0 1 0 0 0 0 0 0 125
126 768 1 0 0 0 0 0 1 0 0 0 0 0 126
127 714 1 0 0 0 0 0 0 1 0 0 0 0 127
128 782 1 0 0 0 0 0 0 0 1 0 0 0 128
129 578 1 0 0 0 0 0 0 0 0 1 0 0 129
130 664 1 0 0 0 0 0 0 0 0 0 1 0 130
131 560 1 0 0 0 0 0 0 0 0 0 0 1 131
132 516 1 0 0 0 0 0 0 0 0 0 0 0 132
133 752 1 1 0 0 0 0 0 0 0 0 0 0 133
134 597 1 0 1 0 0 0 0 0 0 0 0 0 134
135 716 1 0 0 1 0 0 0 0 0 0 0 0 135
136 691 1 0 0 0 1 0 0 0 0 0 0 0 136
137 752 1 0 0 0 0 1 0 0 0 0 0 0 137
138 718 1 0 0 0 0 0 1 0 0 0 0 0 138
139 737 1 0 0 0 0 0 0 1 0 0 0 0 139
140 621 1 0 0 0 0 0 0 0 1 0 0 0 140
141 472 1 0 0 0 0 0 0 0 0 1 0 0 141
142 719 1 0 0 0 0 0 0 0 0 0 1 0 142
143 497 1 0 0 0 0 0 0 0 0 0 0 1 143
144 536 1 0 0 0 0 0 0 0 0 0 0 0 144
145 653 1 1 0 0 0 0 0 0 0 0 0 0 145
146 605 1 0 1 0 0 0 0 0 0 0 0 0 146
147 637 1 0 0 1 0 0 0 0 0 0 0 0 147
148 743 1 0 0 0 1 0 0 0 0 0 0 0 148
149 719 1 0 0 0 0 1 0 0 0 0 0 0 149
150 653 1 0 0 0 0 0 1 0 0 0 0 0 150
151 675 1 0 0 0 0 0 0 1 0 0 0 0 151
152 590 1 0 0 0 0 0 0 0 1 0 0 0 152
153 527 1 0 0 0 0 0 0 0 0 1 0 0 153
154 534 1 0 0 0 0 0 0 0 0 0 1 0 154
155 463 1 0 0 0 0 0 0 0 0 0 0 1 155
156 542 1 0 0 0 0 0 0 0 0 0 0 0 156
157 568 1 1 0 0 0 0 0 0 0 0 0 0 157
158 501 1 0 1 0 0 0 0 0 0 0 0 0 158
159 678 1 0 0 1 0 0 0 0 0 0 0 0 159
160 774 1 0 0 0 1 0 0 0 0 0 0 0 160
161 665 1 0 0 0 0 1 0 0 0 0 0 0 161
162 742 1 0 0 0 0 0 1 0 0 0 0 0 162
163 715 1 0 0 0 0 0 0 1 0 0 0 0 163
164 638 1 0 0 0 0 0 0 0 1 0 0 0 164
165 656 1 0 0 0 0 0 0 0 0 1 0 0 165
166 606 1 0 0 0 0 0 0 0 0 0 1 0 166
167 498 1 0 0 0 0 0 0 0 0 0 0 1 167
168 587 1 0 0 0 0 0 0 0 0 0 0 0 168
169 677 1 1 0 0 0 0 0 0 0 0 0 0 169
170 547 1 0 1 0 0 0 0 0 0 0 0 0 170
171 871 1 0 0 1 0 0 0 0 0 0 0 0 171
172 731 1 0 0 0 1 0 0 0 0 0 0 0 172
173 752 1 0 0 0 0 1 0 0 0 0 0 0 173
174 862 1 0 0 0 0 0 1 0 0 0 0 0 174
175 619 1 0 0 0 0 0 0 1 0 0 0 0 175
176 700 1 0 0 0 0 0 0 0 1 0 0 0 176
177 667 1 0 0 0 0 0 0 0 0 1 0 0 177
178 667 1 0 0 0 0 0 0 0 0 0 1 0 178
179 650 1 0 0 0 0 0 0 0 0 0 0 1 179
180 547 1 0 0 0 0 0 0 0 0 0 0 0 180
181 637 1 1 0 0 0 0 0 0 0 0 0 0 181
182 655 1 0 1 0 0 0 0 0 0 0 0 0 182
183 703 1 0 0 1 0 0 0 0 0 0 0 0 183
184 886 1 0 0 0 1 0 0 0 0 0 0 0 184
185 896 1 0 0 0 0 1 0 0 0 0 0 0 185
186 831 1 0 0 0 0 0 1 0 0 0 0 0 186
187 741 1 0 0 0 0 0 0 1 0 0 0 0 187
188 833 1 0 0 0 0 0 0 0 1 0 0 0 188
189 750 1 0 0 0 0 0 0 0 0 1 0 0 189
190 779 1 0 0 0 0 0 0 0 0 0 1 0 190
191 655 1 0 0 0 0 0 0 0 0 0 0 1 191
192 739 1 0 0 0 0 0 0 0 0 0 0 0 192
193 845 1 1 0 0 0 0 0 0 0 0 0 0 193
194 795 1 0 1 0 0 0 0 0 0 0 0 0 194
195 1021 1 0 0 1 0 0 0 0 0 0 0 0 195
196 726 1 0 0 0 1 0 0 0 0 0 0 0 196
197 1045 1 0 0 0 0 1 0 0 0 0 0 0 197
198 915 1 0 0 0 0 0 1 0 0 0 0 0 198
199 852 1 0 0 0 0 0 0 1 0 0 0 0 199
200 772 1 0 0 0 0 0 0 0 1 0 0 0 200
201 729 1 0 0 0 0 0 0 0 0 1 0 0 201
202 755 1 0 0 0 0 0 0 0 0 0 1 0 202
203 691 1 0 0 0 0 0 0 0 0 0 0 1 203
204 729 1 0 0 0 0 0 0 0 0 0 0 0 204
205 702 1 1 0 0 0 0 0 0 0 0 0 0 205
206 702 1 0 1 0 0 0 0 0 0 0 0 0 206
207 894 1 0 0 1 0 0 0 0 0 0 0 0 207
208 765 1 0 0 0 1 0 0 0 0 0 0 0 208
209 753 1 0 0 0 0 1 0 0 0 0 0 0 209
210 876 1 0 0 0 0 0 1 0 0 0 0 0 210
211 781 1 0 0 0 0 0 0 1 0 0 0 0 211
212 776 1 0 0 0 0 0 0 0 1 0 0 0 212
213 606 1 0 0 0 0 0 0 0 0 1 0 0 213
214 775 1 0 0 0 0 0 0 0 0 0 1 0 214
215 663 1 0 0 0 0 0 0 0 0 0 0 1 215
216 649 1 0 0 0 0 0 0 0 0 0 0 0 216
217 821 1 1 0 0 0 0 0 0 0 0 0 0 217
218 771 1 0 1 0 0 0 0 0 0 0 0 0 218
219 635 1 0 0 1 0 0 0 0 0 0 0 0 219
220 1070 1 0 0 0 1 0 0 0 0 0 0 0 220
221 693 1 0 0 0 0 1 0 0 0 0 0 0 221
222 779 1 0 0 0 0 0 1 0 0 0 0 0 222
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) x M1 M2 M3 M4
633.392 -156.736 -36.192 -21.717 117.389 93.021
M5 M6 M7 M8 M9 M10
118.233 167.655 81.145 22.216 -15.046 15.414
M11 t
-81.127 1.262
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-235.50 -85.73 -10.55 50.94 984.42
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 633.3924 35.6740 17.755 < 2e-16 ***
x -156.7362 34.9900 -4.479 1.23e-05 ***
M1 -36.1916 43.5841 -0.830 0.407273
M2 -21.7171 43.5722 -0.498 0.618717
M3 117.3890 43.5620 2.695 0.007620 **
M4 93.0214 43.5534 2.136 0.033864 *
M5 118.2328 43.5465 2.715 0.007182 **
M6 167.6546 43.5413 3.850 0.000157 ***
M7 81.1450 44.1387 1.838 0.067428 .
M8 22.2160 44.1312 0.503 0.615211
M9 -15.0463 44.1254 -0.341 0.733455
M10 15.4135 44.1213 0.349 0.727184
M11 -81.1266 44.1188 -1.839 0.067367 .
t 1.2623 0.2705 4.666 5.48e-06 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 132.4 on 208 degrees of freedom
Multiple R-squared: 0.2996, Adjusted R-squared: 0.2558
F-statistic: 6.844 on 13 and 208 DF, p-value: 6.322e-11
> postscript(file="/var/www/html/rcomp/tmp/1wuhb1229178400.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/21cun1229178400.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/30rie1229178400.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/4rzl01229178400.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/5rpxt1229178400.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 = 222
Frequency = 1
1 2 3 4 5 6
128.5368557 202.8000136 163.4315926 54.5368557 45.0631715 -52.6210390
7 8 9 10 11 12
1.6263037 -142.7070297 -91.7070297 -74.4292519 -61.1514741 -127.5403630
13 14 15 16 17 18
-115.6110873 -79.3479294 -132.7163504 -124.6110873 -105.0847715 -154.7689820
19 20 21 22 23 24
-68.5216393 -181.8549727 -105.8549727 -83.5771949 -152.2994171 -41.6883060
25 26 27 28 29 30
-95.7590303 10.5041276 50.1357066 -75.7590303 -82.2327145 30.0830750
31 32 33 34 35 36
23.3304177 42.9970844 -23.0029156 -94.7251379 32.5526399 261.1637510
37 38 39 40 41 42
-199.9069732 -163.6438153 0.9877636 -117.9069732 -36.3806575 21.9351320
43 44 45 46 47 48
-167.8175253 -14.1508586 69.8491414 -51.8730808 -39.5953031 -65.9841920
49 50 51 52 53 54
-9.0549162 2.2082417 84.8398206 -12.0549162 77.4713996 222.7871890
55 56 57 58 59 60
39.0345317 8.7011984 79.7011984 192.9789762 18.2567539 -143.1321349
61 62 63 64 65 66
32.7971408 95.0602987 -68.3081224 -95.2028592 -119.6765434 -61.3607539
67 68 69 70 71 72
-190.1134113 -121.4467446 -86.4467446 -99.1689668 -158.8911890 -189.2800779
73 74 75 76 77 78
-72.3508022 -7.0876443 -41.4560654 1.6491978 29.1755136 119.4913031
79 80 81 82 83 84
159.7386458 16.4053124 13.4053124 74.6830902 146.9608680 -18.4280209
85 86 87 88 89 90
-45.4987452 11.7644127 -21.6040083 156.5012548 -35.9724294 124.3433601
91 92 93 94 95 96
242.5907028 31.2573694 299.2573694 154.5351472 161.8129250 984.4240361
97 98 99 100 101 102
-203.9105071 -65.6473492 -20.0157702 45.0894929 70.6158087 103.9315982
103 104 105 106 107 108
62.1789409 121.8456075 80.8456075 56.1233853 52.4011631 19.0122742
109 110 111 112 113 114
27.9415499 51.2047078 245.8362868 135.9415499 203.4678657 277.7836552
115 116 117 118 119 120
233.0309979 234.6976645 198.6976645 99.9754423 234.2532201 46.8643312
121 122 123 124 125 126
188.7936069 186.0567648 123.6883438 0.7936069 245.3199227 -35.3642878
127 128 129 130 131 132
-4.1169451 121.5497216 -46.4502784 7.8274993 -0.8947229 -127.2836118
133 134 135 136 137 138
143.6456640 -27.0911781 -48.4595992 -50.3543360 -15.8280203 -100.5122308
139 140 141 142 143 144
3.7351119 -54.5982214 -167.5982214 47.6795563 -79.0426659 -122.4315548
145 146 147 148 149 150
29.4977210 -34.2391211 -142.6075422 -13.5022790 -63.9759632 -180.6601738
151 152 153 154 155 156
-73.4128311 -100.7461644 -127.7461644 -152.4683866 -128.1906089 -131.5794977
157 158 159 160 161 162
-70.6502220 -153.3870641 -116.7554852 2.3497780 -133.1239062 -106.8081167
163 164 165 166 167 168
-48.5607741 -67.8941074 -13.8941074 -95.6163296 -108.3385518 -101.7274407
169 170 171 172 173 174
23.2018350 -122.5350071 61.0965718 -55.7981650 -61.2718492 -1.9560597
175 176 177 178 179 180
-159.7087170 -21.0420504 -18.0420504 -49.7642726 28.5135052 -156.8753837
181 182 183 184 185 186
-31.9461080 -29.6829501 -122.0513711 84.0538920 67.5802078 -48.1040027
187 188 189 190 191 192
-52.8566600 96.8100066 49.8100066 47.0877844 18.3655622 19.9766733
193 194 195 196 197 198
160.9059490 95.1691069 180.8006859 -91.0940510 201.4322648 20.7480543
199 200 201 202 203 204
42.9953970 20.6620637 13.6620637 7.9398414 39.2176192 -5.1712697
205 206 207 208 209 210
2.7580061 -12.9788361 38.6527429 -67.2419939 -105.7156782 -33.3998887
211 212 213 214 215 216
-43.1525460 9.5141207 -124.4858793 12.7918984 -3.9303238 -100.3192127
217 218 219 220 221 222
106.6100631 40.8732210 -235.4952001 222.6100631 -180.8636211 -145.5478317
> postscript(file="/var/www/html/rcomp/tmp/62fij1229178400.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 = 222
Frequency = 1
lag(myerror, k = 1) myerror
0 128.5368557 NA
1 202.8000136 128.5368557
2 163.4315926 202.8000136
3 54.5368557 163.4315926
4 45.0631715 54.5368557
5 -52.6210390 45.0631715
6 1.6263037 -52.6210390
7 -142.7070297 1.6263037
8 -91.7070297 -142.7070297
9 -74.4292519 -91.7070297
10 -61.1514741 -74.4292519
11 -127.5403630 -61.1514741
12 -115.6110873 -127.5403630
13 -79.3479294 -115.6110873
14 -132.7163504 -79.3479294
15 -124.6110873 -132.7163504
16 -105.0847715 -124.6110873
17 -154.7689820 -105.0847715
18 -68.5216393 -154.7689820
19 -181.8549727 -68.5216393
20 -105.8549727 -181.8549727
21 -83.5771949 -105.8549727
22 -152.2994171 -83.5771949
23 -41.6883060 -152.2994171
24 -95.7590303 -41.6883060
25 10.5041276 -95.7590303
26 50.1357066 10.5041276
27 -75.7590303 50.1357066
28 -82.2327145 -75.7590303
29 30.0830750 -82.2327145
30 23.3304177 30.0830750
31 42.9970844 23.3304177
32 -23.0029156 42.9970844
33 -94.7251379 -23.0029156
34 32.5526399 -94.7251379
35 261.1637510 32.5526399
36 -199.9069732 261.1637510
37 -163.6438153 -199.9069732
38 0.9877636 -163.6438153
39 -117.9069732 0.9877636
40 -36.3806575 -117.9069732
41 21.9351320 -36.3806575
42 -167.8175253 21.9351320
43 -14.1508586 -167.8175253
44 69.8491414 -14.1508586
45 -51.8730808 69.8491414
46 -39.5953031 -51.8730808
47 -65.9841920 -39.5953031
48 -9.0549162 -65.9841920
49 2.2082417 -9.0549162
50 84.8398206 2.2082417
51 -12.0549162 84.8398206
52 77.4713996 -12.0549162
53 222.7871890 77.4713996
54 39.0345317 222.7871890
55 8.7011984 39.0345317
56 79.7011984 8.7011984
57 192.9789762 79.7011984
58 18.2567539 192.9789762
59 -143.1321349 18.2567539
60 32.7971408 -143.1321349
61 95.0602987 32.7971408
62 -68.3081224 95.0602987
63 -95.2028592 -68.3081224
64 -119.6765434 -95.2028592
65 -61.3607539 -119.6765434
66 -190.1134113 -61.3607539
67 -121.4467446 -190.1134113
68 -86.4467446 -121.4467446
69 -99.1689668 -86.4467446
70 -158.8911890 -99.1689668
71 -189.2800779 -158.8911890
72 -72.3508022 -189.2800779
73 -7.0876443 -72.3508022
74 -41.4560654 -7.0876443
75 1.6491978 -41.4560654
76 29.1755136 1.6491978
77 119.4913031 29.1755136
78 159.7386458 119.4913031
79 16.4053124 159.7386458
80 13.4053124 16.4053124
81 74.6830902 13.4053124
82 146.9608680 74.6830902
83 -18.4280209 146.9608680
84 -45.4987452 -18.4280209
85 11.7644127 -45.4987452
86 -21.6040083 11.7644127
87 156.5012548 -21.6040083
88 -35.9724294 156.5012548
89 124.3433601 -35.9724294
90 242.5907028 124.3433601
91 31.2573694 242.5907028
92 299.2573694 31.2573694
93 154.5351472 299.2573694
94 161.8129250 154.5351472
95 984.4240361 161.8129250
96 -203.9105071 984.4240361
97 -65.6473492 -203.9105071
98 -20.0157702 -65.6473492
99 45.0894929 -20.0157702
100 70.6158087 45.0894929
101 103.9315982 70.6158087
102 62.1789409 103.9315982
103 121.8456075 62.1789409
104 80.8456075 121.8456075
105 56.1233853 80.8456075
106 52.4011631 56.1233853
107 19.0122742 52.4011631
108 27.9415499 19.0122742
109 51.2047078 27.9415499
110 245.8362868 51.2047078
111 135.9415499 245.8362868
112 203.4678657 135.9415499
113 277.7836552 203.4678657
114 233.0309979 277.7836552
115 234.6976645 233.0309979
116 198.6976645 234.6976645
117 99.9754423 198.6976645
118 234.2532201 99.9754423
119 46.8643312 234.2532201
120 188.7936069 46.8643312
121 186.0567648 188.7936069
122 123.6883438 186.0567648
123 0.7936069 123.6883438
124 245.3199227 0.7936069
125 -35.3642878 245.3199227
126 -4.1169451 -35.3642878
127 121.5497216 -4.1169451
128 -46.4502784 121.5497216
129 7.8274993 -46.4502784
130 -0.8947229 7.8274993
131 -127.2836118 -0.8947229
132 143.6456640 -127.2836118
133 -27.0911781 143.6456640
134 -48.4595992 -27.0911781
135 -50.3543360 -48.4595992
136 -15.8280203 -50.3543360
137 -100.5122308 -15.8280203
138 3.7351119 -100.5122308
139 -54.5982214 3.7351119
140 -167.5982214 -54.5982214
141 47.6795563 -167.5982214
142 -79.0426659 47.6795563
143 -122.4315548 -79.0426659
144 29.4977210 -122.4315548
145 -34.2391211 29.4977210
146 -142.6075422 -34.2391211
147 -13.5022790 -142.6075422
148 -63.9759632 -13.5022790
149 -180.6601738 -63.9759632
150 -73.4128311 -180.6601738
151 -100.7461644 -73.4128311
152 -127.7461644 -100.7461644
153 -152.4683866 -127.7461644
154 -128.1906089 -152.4683866
155 -131.5794977 -128.1906089
156 -70.6502220 -131.5794977
157 -153.3870641 -70.6502220
158 -116.7554852 -153.3870641
159 2.3497780 -116.7554852
160 -133.1239062 2.3497780
161 -106.8081167 -133.1239062
162 -48.5607741 -106.8081167
163 -67.8941074 -48.5607741
164 -13.8941074 -67.8941074
165 -95.6163296 -13.8941074
166 -108.3385518 -95.6163296
167 -101.7274407 -108.3385518
168 23.2018350 -101.7274407
169 -122.5350071 23.2018350
170 61.0965718 -122.5350071
171 -55.7981650 61.0965718
172 -61.2718492 -55.7981650
173 -1.9560597 -61.2718492
174 -159.7087170 -1.9560597
175 -21.0420504 -159.7087170
176 -18.0420504 -21.0420504
177 -49.7642726 -18.0420504
178 28.5135052 -49.7642726
179 -156.8753837 28.5135052
180 -31.9461080 -156.8753837
181 -29.6829501 -31.9461080
182 -122.0513711 -29.6829501
183 84.0538920 -122.0513711
184 67.5802078 84.0538920
185 -48.1040027 67.5802078
186 -52.8566600 -48.1040027
187 96.8100066 -52.8566600
188 49.8100066 96.8100066
189 47.0877844 49.8100066
190 18.3655622 47.0877844
191 19.9766733 18.3655622
192 160.9059490 19.9766733
193 95.1691069 160.9059490
194 180.8006859 95.1691069
195 -91.0940510 180.8006859
196 201.4322648 -91.0940510
197 20.7480543 201.4322648
198 42.9953970 20.7480543
199 20.6620637 42.9953970
200 13.6620637 20.6620637
201 7.9398414 13.6620637
202 39.2176192 7.9398414
203 -5.1712697 39.2176192
204 2.7580061 -5.1712697
205 -12.9788361 2.7580061
206 38.6527429 -12.9788361
207 -67.2419939 38.6527429
208 -105.7156782 -67.2419939
209 -33.3998887 -105.7156782
210 -43.1525460 -33.3998887
211 9.5141207 -43.1525460
212 -124.4858793 9.5141207
213 12.7918984 -124.4858793
214 -3.9303238 12.7918984
215 -100.3192127 -3.9303238
216 106.6100631 -100.3192127
217 40.8732210 106.6100631
218 -235.4952001 40.8732210
219 222.6100631 -235.4952001
220 -180.8636211 222.6100631
221 -145.5478317 -180.8636211
222 NA -145.5478317
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 202.8000136 128.5368557
[2,] 163.4315926 202.8000136
[3,] 54.5368557 163.4315926
[4,] 45.0631715 54.5368557
[5,] -52.6210390 45.0631715
[6,] 1.6263037 -52.6210390
[7,] -142.7070297 1.6263037
[8,] -91.7070297 -142.7070297
[9,] -74.4292519 -91.7070297
[10,] -61.1514741 -74.4292519
[11,] -127.5403630 -61.1514741
[12,] -115.6110873 -127.5403630
[13,] -79.3479294 -115.6110873
[14,] -132.7163504 -79.3479294
[15,] -124.6110873 -132.7163504
[16,] -105.0847715 -124.6110873
[17,] -154.7689820 -105.0847715
[18,] -68.5216393 -154.7689820
[19,] -181.8549727 -68.5216393
[20,] -105.8549727 -181.8549727
[21,] -83.5771949 -105.8549727
[22,] -152.2994171 -83.5771949
[23,] -41.6883060 -152.2994171
[24,] -95.7590303 -41.6883060
[25,] 10.5041276 -95.7590303
[26,] 50.1357066 10.5041276
[27,] -75.7590303 50.1357066
[28,] -82.2327145 -75.7590303
[29,] 30.0830750 -82.2327145
[30,] 23.3304177 30.0830750
[31,] 42.9970844 23.3304177
[32,] -23.0029156 42.9970844
[33,] -94.7251379 -23.0029156
[34,] 32.5526399 -94.7251379
[35,] 261.1637510 32.5526399
[36,] -199.9069732 261.1637510
[37,] -163.6438153 -199.9069732
[38,] 0.9877636 -163.6438153
[39,] -117.9069732 0.9877636
[40,] -36.3806575 -117.9069732
[41,] 21.9351320 -36.3806575
[42,] -167.8175253 21.9351320
[43,] -14.1508586 -167.8175253
[44,] 69.8491414 -14.1508586
[45,] -51.8730808 69.8491414
[46,] -39.5953031 -51.8730808
[47,] -65.9841920 -39.5953031
[48,] -9.0549162 -65.9841920
[49,] 2.2082417 -9.0549162
[50,] 84.8398206 2.2082417
[51,] -12.0549162 84.8398206
[52,] 77.4713996 -12.0549162
[53,] 222.7871890 77.4713996
[54,] 39.0345317 222.7871890
[55,] 8.7011984 39.0345317
[56,] 79.7011984 8.7011984
[57,] 192.9789762 79.7011984
[58,] 18.2567539 192.9789762
[59,] -143.1321349 18.2567539
[60,] 32.7971408 -143.1321349
[61,] 95.0602987 32.7971408
[62,] -68.3081224 95.0602987
[63,] -95.2028592 -68.3081224
[64,] -119.6765434 -95.2028592
[65,] -61.3607539 -119.6765434
[66,] -190.1134113 -61.3607539
[67,] -121.4467446 -190.1134113
[68,] -86.4467446 -121.4467446
[69,] -99.1689668 -86.4467446
[70,] -158.8911890 -99.1689668
[71,] -189.2800779 -158.8911890
[72,] -72.3508022 -189.2800779
[73,] -7.0876443 -72.3508022
[74,] -41.4560654 -7.0876443
[75,] 1.6491978 -41.4560654
[76,] 29.1755136 1.6491978
[77,] 119.4913031 29.1755136
[78,] 159.7386458 119.4913031
[79,] 16.4053124 159.7386458
[80,] 13.4053124 16.4053124
[81,] 74.6830902 13.4053124
[82,] 146.9608680 74.6830902
[83,] -18.4280209 146.9608680
[84,] -45.4987452 -18.4280209
[85,] 11.7644127 -45.4987452
[86,] -21.6040083 11.7644127
[87,] 156.5012548 -21.6040083
[88,] -35.9724294 156.5012548
[89,] 124.3433601 -35.9724294
[90,] 242.5907028 124.3433601
[91,] 31.2573694 242.5907028
[92,] 299.2573694 31.2573694
[93,] 154.5351472 299.2573694
[94,] 161.8129250 154.5351472
[95,] 984.4240361 161.8129250
[96,] -203.9105071 984.4240361
[97,] -65.6473492 -203.9105071
[98,] -20.0157702 -65.6473492
[99,] 45.0894929 -20.0157702
[100,] 70.6158087 45.0894929
[101,] 103.9315982 70.6158087
[102,] 62.1789409 103.9315982
[103,] 121.8456075 62.1789409
[104,] 80.8456075 121.8456075
[105,] 56.1233853 80.8456075
[106,] 52.4011631 56.1233853
[107,] 19.0122742 52.4011631
[108,] 27.9415499 19.0122742
[109,] 51.2047078 27.9415499
[110,] 245.8362868 51.2047078
[111,] 135.9415499 245.8362868
[112,] 203.4678657 135.9415499
[113,] 277.7836552 203.4678657
[114,] 233.0309979 277.7836552
[115,] 234.6976645 233.0309979
[116,] 198.6976645 234.6976645
[117,] 99.9754423 198.6976645
[118,] 234.2532201 99.9754423
[119,] 46.8643312 234.2532201
[120,] 188.7936069 46.8643312
[121,] 186.0567648 188.7936069
[122,] 123.6883438 186.0567648
[123,] 0.7936069 123.6883438
[124,] 245.3199227 0.7936069
[125,] -35.3642878 245.3199227
[126,] -4.1169451 -35.3642878
[127,] 121.5497216 -4.1169451
[128,] -46.4502784 121.5497216
[129,] 7.8274993 -46.4502784
[130,] -0.8947229 7.8274993
[131,] -127.2836118 -0.8947229
[132,] 143.6456640 -127.2836118
[133,] -27.0911781 143.6456640
[134,] -48.4595992 -27.0911781
[135,] -50.3543360 -48.4595992
[136,] -15.8280203 -50.3543360
[137,] -100.5122308 -15.8280203
[138,] 3.7351119 -100.5122308
[139,] -54.5982214 3.7351119
[140,] -167.5982214 -54.5982214
[141,] 47.6795563 -167.5982214
[142,] -79.0426659 47.6795563
[143,] -122.4315548 -79.0426659
[144,] 29.4977210 -122.4315548
[145,] -34.2391211 29.4977210
[146,] -142.6075422 -34.2391211
[147,] -13.5022790 -142.6075422
[148,] -63.9759632 -13.5022790
[149,] -180.6601738 -63.9759632
[150,] -73.4128311 -180.6601738
[151,] -100.7461644 -73.4128311
[152,] -127.7461644 -100.7461644
[153,] -152.4683866 -127.7461644
[154,] -128.1906089 -152.4683866
[155,] -131.5794977 -128.1906089
[156,] -70.6502220 -131.5794977
[157,] -153.3870641 -70.6502220
[158,] -116.7554852 -153.3870641
[159,] 2.3497780 -116.7554852
[160,] -133.1239062 2.3497780
[161,] -106.8081167 -133.1239062
[162,] -48.5607741 -106.8081167
[163,] -67.8941074 -48.5607741
[164,] -13.8941074 -67.8941074
[165,] -95.6163296 -13.8941074
[166,] -108.3385518 -95.6163296
[167,] -101.7274407 -108.3385518
[168,] 23.2018350 -101.7274407
[169,] -122.5350071 23.2018350
[170,] 61.0965718 -122.5350071
[171,] -55.7981650 61.0965718
[172,] -61.2718492 -55.7981650
[173,] -1.9560597 -61.2718492
[174,] -159.7087170 -1.9560597
[175,] -21.0420504 -159.7087170
[176,] -18.0420504 -21.0420504
[177,] -49.7642726 -18.0420504
[178,] 28.5135052 -49.7642726
[179,] -156.8753837 28.5135052
[180,] -31.9461080 -156.8753837
[181,] -29.6829501 -31.9461080
[182,] -122.0513711 -29.6829501
[183,] 84.0538920 -122.0513711
[184,] 67.5802078 84.0538920
[185,] -48.1040027 67.5802078
[186,] -52.8566600 -48.1040027
[187,] 96.8100066 -52.8566600
[188,] 49.8100066 96.8100066
[189,] 47.0877844 49.8100066
[190,] 18.3655622 47.0877844
[191,] 19.9766733 18.3655622
[192,] 160.9059490 19.9766733
[193,] 95.1691069 160.9059490
[194,] 180.8006859 95.1691069
[195,] -91.0940510 180.8006859
[196,] 201.4322648 -91.0940510
[197,] 20.7480543 201.4322648
[198,] 42.9953970 20.7480543
[199,] 20.6620637 42.9953970
[200,] 13.6620637 20.6620637
[201,] 7.9398414 13.6620637
[202,] 39.2176192 7.9398414
[203,] -5.1712697 39.2176192
[204,] 2.7580061 -5.1712697
[205,] -12.9788361 2.7580061
[206,] 38.6527429 -12.9788361
[207,] -67.2419939 38.6527429
[208,] -105.7156782 -67.2419939
[209,] -33.3998887 -105.7156782
[210,] -43.1525460 -33.3998887
[211,] 9.5141207 -43.1525460
[212,] -124.4858793 9.5141207
[213,] 12.7918984 -124.4858793
[214,] -3.9303238 12.7918984
[215,] -100.3192127 -3.9303238
[216,] 106.6100631 -100.3192127
[217,] 40.8732210 106.6100631
[218,] -235.4952001 40.8732210
[219,] 222.6100631 -235.4952001
[220,] -180.8636211 222.6100631
[221,] -145.5478317 -180.8636211
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 202.8000136 128.5368557
2 163.4315926 202.8000136
3 54.5368557 163.4315926
4 45.0631715 54.5368557
5 -52.6210390 45.0631715
6 1.6263037 -52.6210390
7 -142.7070297 1.6263037
8 -91.7070297 -142.7070297
9 -74.4292519 -91.7070297
10 -61.1514741 -74.4292519
11 -127.5403630 -61.1514741
12 -115.6110873 -127.5403630
13 -79.3479294 -115.6110873
14 -132.7163504 -79.3479294
15 -124.6110873 -132.7163504
16 -105.0847715 -124.6110873
17 -154.7689820 -105.0847715
18 -68.5216393 -154.7689820
19 -181.8549727 -68.5216393
20 -105.8549727 -181.8549727
21 -83.5771949 -105.8549727
22 -152.2994171 -83.5771949
23 -41.6883060 -152.2994171
24 -95.7590303 -41.6883060
25 10.5041276 -95.7590303
26 50.1357066 10.5041276
27 -75.7590303 50.1357066
28 -82.2327145 -75.7590303
29 30.0830750 -82.2327145
30 23.3304177 30.0830750
31 42.9970844 23.3304177
32 -23.0029156 42.9970844
33 -94.7251379 -23.0029156
34 32.5526399 -94.7251379
35 261.1637510 32.5526399
36 -199.9069732 261.1637510
37 -163.6438153 -199.9069732
38 0.9877636 -163.6438153
39 -117.9069732 0.9877636
40 -36.3806575 -117.9069732
41 21.9351320 -36.3806575
42 -167.8175253 21.9351320
43 -14.1508586 -167.8175253
44 69.8491414 -14.1508586
45 -51.8730808 69.8491414
46 -39.5953031 -51.8730808
47 -65.9841920 -39.5953031
48 -9.0549162 -65.9841920
49 2.2082417 -9.0549162
50 84.8398206 2.2082417
51 -12.0549162 84.8398206
52 77.4713996 -12.0549162
53 222.7871890 77.4713996
54 39.0345317 222.7871890
55 8.7011984 39.0345317
56 79.7011984 8.7011984
57 192.9789762 79.7011984
58 18.2567539 192.9789762
59 -143.1321349 18.2567539
60 32.7971408 -143.1321349
61 95.0602987 32.7971408
62 -68.3081224 95.0602987
63 -95.2028592 -68.3081224
64 -119.6765434 -95.2028592
65 -61.3607539 -119.6765434
66 -190.1134113 -61.3607539
67 -121.4467446 -190.1134113
68 -86.4467446 -121.4467446
69 -99.1689668 -86.4467446
70 -158.8911890 -99.1689668
71 -189.2800779 -158.8911890
72 -72.3508022 -189.2800779
73 -7.0876443 -72.3508022
74 -41.4560654 -7.0876443
75 1.6491978 -41.4560654
76 29.1755136 1.6491978
77 119.4913031 29.1755136
78 159.7386458 119.4913031
79 16.4053124 159.7386458
80 13.4053124 16.4053124
81 74.6830902 13.4053124
82 146.9608680 74.6830902
83 -18.4280209 146.9608680
84 -45.4987452 -18.4280209
85 11.7644127 -45.4987452
86 -21.6040083 11.7644127
87 156.5012548 -21.6040083
88 -35.9724294 156.5012548
89 124.3433601 -35.9724294
90 242.5907028 124.3433601
91 31.2573694 242.5907028
92 299.2573694 31.2573694
93 154.5351472 299.2573694
94 161.8129250 154.5351472
95 984.4240361 161.8129250
96 -203.9105071 984.4240361
97 -65.6473492 -203.9105071
98 -20.0157702 -65.6473492
99 45.0894929 -20.0157702
100 70.6158087 45.0894929
101 103.9315982 70.6158087
102 62.1789409 103.9315982
103 121.8456075 62.1789409
104 80.8456075 121.8456075
105 56.1233853 80.8456075
106 52.4011631 56.1233853
107 19.0122742 52.4011631
108 27.9415499 19.0122742
109 51.2047078 27.9415499
110 245.8362868 51.2047078
111 135.9415499 245.8362868
112 203.4678657 135.9415499
113 277.7836552 203.4678657
114 233.0309979 277.7836552
115 234.6976645 233.0309979
116 198.6976645 234.6976645
117 99.9754423 198.6976645
118 234.2532201 99.9754423
119 46.8643312 234.2532201
120 188.7936069 46.8643312
121 186.0567648 188.7936069
122 123.6883438 186.0567648
123 0.7936069 123.6883438
124 245.3199227 0.7936069
125 -35.3642878 245.3199227
126 -4.1169451 -35.3642878
127 121.5497216 -4.1169451
128 -46.4502784 121.5497216
129 7.8274993 -46.4502784
130 -0.8947229 7.8274993
131 -127.2836118 -0.8947229
132 143.6456640 -127.2836118
133 -27.0911781 143.6456640
134 -48.4595992 -27.0911781
135 -50.3543360 -48.4595992
136 -15.8280203 -50.3543360
137 -100.5122308 -15.8280203
138 3.7351119 -100.5122308
139 -54.5982214 3.7351119
140 -167.5982214 -54.5982214
141 47.6795563 -167.5982214
142 -79.0426659 47.6795563
143 -122.4315548 -79.0426659
144 29.4977210 -122.4315548
145 -34.2391211 29.4977210
146 -142.6075422 -34.2391211
147 -13.5022790 -142.6075422
148 -63.9759632 -13.5022790
149 -180.6601738 -63.9759632
150 -73.4128311 -180.6601738
151 -100.7461644 -73.4128311
152 -127.7461644 -100.7461644
153 -152.4683866 -127.7461644
154 -128.1906089 -152.4683866
155 -131.5794977 -128.1906089
156 -70.6502220 -131.5794977
157 -153.3870641 -70.6502220
158 -116.7554852 -153.3870641
159 2.3497780 -116.7554852
160 -133.1239062 2.3497780
161 -106.8081167 -133.1239062
162 -48.5607741 -106.8081167
163 -67.8941074 -48.5607741
164 -13.8941074 -67.8941074
165 -95.6163296 -13.8941074
166 -108.3385518 -95.6163296
167 -101.7274407 -108.3385518
168 23.2018350 -101.7274407
169 -122.5350071 23.2018350
170 61.0965718 -122.5350071
171 -55.7981650 61.0965718
172 -61.2718492 -55.7981650
173 -1.9560597 -61.2718492
174 -159.7087170 -1.9560597
175 -21.0420504 -159.7087170
176 -18.0420504 -21.0420504
177 -49.7642726 -18.0420504
178 28.5135052 -49.7642726
179 -156.8753837 28.5135052
180 -31.9461080 -156.8753837
181 -29.6829501 -31.9461080
182 -122.0513711 -29.6829501
183 84.0538920 -122.0513711
184 67.5802078 84.0538920
185 -48.1040027 67.5802078
186 -52.8566600 -48.1040027
187 96.8100066 -52.8566600
188 49.8100066 96.8100066
189 47.0877844 49.8100066
190 18.3655622 47.0877844
191 19.9766733 18.3655622
192 160.9059490 19.9766733
193 95.1691069 160.9059490
194 180.8006859 95.1691069
195 -91.0940510 180.8006859
196 201.4322648 -91.0940510
197 20.7480543 201.4322648
198 42.9953970 20.7480543
199 20.6620637 42.9953970
200 13.6620637 20.6620637
201 7.9398414 13.6620637
202 39.2176192 7.9398414
203 -5.1712697 39.2176192
204 2.7580061 -5.1712697
205 -12.9788361 2.7580061
206 38.6527429 -12.9788361
207 -67.2419939 38.6527429
208 -105.7156782 -67.2419939
209 -33.3998887 -105.7156782
210 -43.1525460 -33.3998887
211 9.5141207 -43.1525460
212 -124.4858793 9.5141207
213 12.7918984 -124.4858793
214 -3.9303238 12.7918984
215 -100.3192127 -3.9303238
216 106.6100631 -100.3192127
217 40.8732210 106.6100631
218 -235.4952001 40.8732210
219 222.6100631 -235.4952001
220 -180.8636211 222.6100631
221 -145.5478317 -180.8636211
> 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/7gqpq1229178400.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/83qb41229178400.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/9mtnz1229178400.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
>
> #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/101v8k1229178400.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/11bymd1229178400.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/12u6c61229178400.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/13vpz01229178400.tab")
>
> system("convert tmp/1wuhb1229178400.ps tmp/1wuhb1229178400.png")
> system("convert tmp/21cun1229178400.ps tmp/21cun1229178400.png")
> system("convert tmp/30rie1229178400.ps tmp/30rie1229178400.png")
> system("convert tmp/4rzl01229178400.ps tmp/4rzl01229178400.png")
> system("convert tmp/5rpxt1229178400.ps tmp/5rpxt1229178400.png")
> system("convert tmp/62fij1229178400.ps tmp/62fij1229178400.png")
> system("convert tmp/7gqpq1229178400.ps tmp/7gqpq1229178400.png")
> system("convert tmp/83qb41229178400.ps tmp/83qb41229178400.png")
> system("convert tmp/9mtnz1229178400.ps tmp/9mtnz1229178400.png")
>
>
> proc.time()
user system elapsed
2.850 1.684 3.350