[第四組] M074020010 陳韻卉 M074020036 張哲瑋 M074020043 巢正修 B046060005陳雅靜 B046060016 戴婉錡 B046060037 陳柏愷
股票動態
股票市場是買賣雙方交易公司股票的地方,也是個人和公司投資的最受歡迎的方式之一。現在估計世界股票市場規模達到數兆。紐約證券交易所位於紐約市,是世界上最大的股票市場。 紐約證券交易所約有2,800家上市公司。在這個問題上,我們將看看其中五家公司的每月股價:IB、通用電氣(GE)、寶潔、可口可樂和波音。此問題中使用的數據來自Infochimps。
使用read.csv()下載並讀取以下文件:
data/IBMStock.csvdata/GEStock.csvdata/ProcterGambleStock.csvdata/CocaColaStock.csvdata/BoeingStock.csvIBM = read.csv("data/IBMStock.csv", stringsAsFactors=F)
GE = read.csv("data/GEStock.csv", stringsAsFactors=F)
ProcterGamble = read.csv("data/ProcterGambleStock.csv", stringsAsFactors=F)
CocaCola = read.csv("data/CocaColaStock.csv", stringsAsFactors=F)
Boeing = read.csv("data/BoeingStock.csv", stringsAsFactors=F)
Sys.setlocale('LC_ALL','C') #更改R預設語系[1] "C"
分別存入資料框IBM、GE、ProcterGamble、CocaCola和Boeing, 每個資料框都有兩個變量,描述如下:
Date:日期StockPrice:給定月份公司的平均股價IBM Date StockPrice
1 1/1/70 360.32
2 2/1/70 346.72
3 3/1/70 327.35
4 4/1/70 319.85
5 5/1/70 270.38
6 6/1/70 267.20
7 7/1/70 252.60
8 8/1/70 247.36
9 9/1/70 274.86
10 10/1/70 294.47
11 11/1/70 296.43
12 12/1/70 314.53
13 1/1/71 316.45
14 2/1/71 333.87
15 3/1/71 351.91
16 4/1/71 357.05
17 5/1/71 343.32
18 6/1/71 319.03
19 7/1/71 304.65
20 8/1/71 302.40
21 9/1/71 304.24
22 10/1/71 305.41
23 11/1/71 296.88
24 12/1/71 327.18
25 1/1/72 350.69
26 2/1/72 369.93
27 3/1/72 378.08
28 4/1/72 389.02
29 5/1/72 389.92
30 6/1/72 394.85
31 7/1/72 396.01
32 8/1/72 413.72
33 9/1/72 400.14
34 10/1/72 388.62
35 11/1/72 384.24
36 12/1/72 395.76
37 1/1/73 424.51
38 2/1/73 438.90
39 3/1/73 437.40
40 4/1/73 423.73
41 5/1/73 393.88
42 6/1/73 317.53
43 7/1/73 312.35
44 8/1/73 303.85
45 9/1/73 278.49
46 10/1/73 274.51
47 11/1/73 277.21
48 12/1/73 252.01
49 1/1/74 241.11
50 2/1/74 234.93
51 3/1/74 244.17
52 4/1/74 231.04
53 5/1/74 221.71
54 6/1/74 220.02
55 7/1/74 210.94
56 8/1/74 199.63
57 9/1/74 169.39
58 10/1/74 175.58
59 11/1/74 181.57
60 12/1/74 168.42
61 1/1/75 168.15
62 2/1/75 206.47
63 3/1/75 213.93
64 4/1/75 206.36
65 5/1/75 214.70
66 6/1/75 211.13
67 7/1/75 201.60
68 8/1/75 182.29
69 9/1/75 184.57
70 10/1/75 205.93
71 11/1/75 219.62
72 12/1/75 219.29
73 1/1/76 241.00
74 2/1/76 257.95
75 3/1/76 259.71
76 4/1/76 261.89
77 5/1/76 252.93
78 6/1/76 262.77
79 7/1/76 274.91
80 8/1/76 274.76
81 9/1/76 281.00
82 10/1/76 269.94
83 11/1/76 267.15
84 12/1/76 271.80
85 1/1/77 272.37
86 2/1/77 272.38
87 3/1/77 280.86
88 4/1/77 270.15
89 5/1/77 253.55
90 6/1/77 256.48
91 7/1/77 266.63
92 8/1/77 268.03
93 9/1/77 261.95
94 10/1/77 258.16
95 11/1/77 258.56
96 12/1/77 265.26
97 1/1/78 267.11
98 2/1/78 258.22
99 3/1/78 242.55
100 4/1/78 247.68
101 5/1/78 263.25
102 6/1/78 265.01
103 7/1/78 265.38
104 8/1/78 291.15
105 9/1/78 290.28
106 10/1/78 278.43
107 11/1/78 265.12
108 12/1/78 281.50
109 1/1/79 308.82
110 2/1/79 304.76
111 3/1/79 309.68
112 4/1/79 313.61
113 5/1/79 309.34
114 6/1/79 75.24
115 7/1/79 70.62
116 8/1/79 70.16
117 9/1/79 68.17
118 10/1/79 65.16
119 11/1/79 62.82
120 12/1/79 65.23
121 1/1/80 67.77
122 2/1/80 67.09
123 3/1/80 59.28
124 4/1/80 53.66
125 5/1/80 53.88
126 6/1/80 58.13
127 7/1/80 63.36
128 8/1/80 66.28
129 9/1/80 66.17
130 10/1/80 67.54
131 11/1/80 69.46
132 12/1/80 66.59
133 1/1/81 66.75
134 2/1/81 62.95
135 3/1/81 63.06
136 4/1/81 60.68
137 5/1/81 57.05
138 6/1/81 58.74
139 7/1/81 56.16
140 8/1/81 56.95
141 9/1/81 54.68
142 10/1/81 52.74
143 11/1/81 51.83
144 12/1/81 54.96
145 1/1/82 59.86
146 2/1/82 62.04
147 3/1/82 59.15
148 4/1/82 63.35
149 5/1/82 63.49
150 6/1/82 60.03
151 7/1/82 64.61
152 8/1/82 66.09
153 9/1/82 73.85
154 10/1/82 80.27
155 11/1/82 83.31
156 12/1/82 93.28
157 1/1/83 97.14
158 2/1/83 97.83
159 3/1/83 101.42
160 4/1/83 109.85
161 5/1/83 114.58
162 6/1/83 118.13
163 7/1/83 122.19
164 8/1/83 119.51
165 9/1/83 123.58
166 10/1/83 130.13
167 11/1/83 123.74
168 12/1/83 121.30
169 1/1/84 119.84
170 2/1/84 110.55
171 3/1/84 111.82
172 4/1/84 111.26
173 5/1/84 111.18
174 6/1/84 104.74
175 7/1/84 106.67
176 8/1/84 121.72
177 9/1/84 124.35
178 10/1/84 123.30
179 11/1/84 123.68
180 12/1/84 120.69
181 1/1/85 126.29
182 2/1/85 134.07
183 3/1/85 130.05
184 4/1/85 127.59
185 5/1/85 128.87
186 6/1/85 123.86
187 7/1/85 126.82
188 8/1/85 128.26
189 9/1/85 127.36
190 10/1/85 127.08
191 11/1/85 135.85
192 12/1/85 148.72
193 1/1/86 151.01
194 2/1/86 156.28
195 3/1/86 149.61
196 4/1/86 153.42
197 5/1/86 149.45
198 6/1/86 148.50
199 7/1/86 138.33
200 8/1/86 134.87
201 9/1/86 138.39
202 10/1/86 124.62
203 11/1/86 123.25
204 12/1/86 125.64
205 1/1/87 123.37
206 2/1/87 136.47
207 3/1/87 145.35
208 4/1/87 150.79
209 5/1/87 162.21
210 6/1/87 161.69
211 7/1/87 164.50
212 8/1/87 168.12
213 9/1/87 157.97
214 10/1/87 136.60
215 11/1/87 119.06
216 12/1/87 113.87
217 1/1/88 115.89
218 2/1/88 112.02
219 3/1/88 113.56
220 4/1/88 112.27
221 5/1/88 110.52
222 6/1/88 118.85
223 7/1/88 124.99
224 8/1/88 117.85
225 9/1/88 113.21
226 10/1/88 119.31
227 11/1/88 118.62
228 12/1/88 121.35
229 1/1/89 123.58
230 2/1/89 125.80
231 3/1/89 115.38
232 4/1/89 111.21
233 5/1/89 110.68
234 6/1/89 110.31
235 7/1/89 113.50
236 8/1/89 115.69
237 9/1/89 115.49
238 10/1/89 104.58
239 11/1/89 98.49
240 12/1/89 96.22
241 1/1/90 98.24
242 2/1/90 102.13
243 3/1/90 106.20
244 4/1/90 107.94
245 5/1/90 114.12
246 6/1/90 119.32
247 7/1/90 117.60
248 8/1/90 103.49
249 9/1/90 105.39
250 10/1/90 105.69
251 11/1/90 111.07
252 12/1/90 113.18
253 1/1/91 114.97
254 2/1/91 132.03
255 3/1/91 123.69
256 4/1/91 110.27
257 5/1/91 104.01
258 6/1/91 101.16
259 7/1/91 99.60
260 8/1/91 97.62
261 9/1/91 102.35
262 10/1/91 99.82
263 11/1/91 97.45
264 12/1/91 88.36
265 1/1/92 92.87
266 2/1/92 89.99
267 3/1/92 86.64
268 4/1/92 86.72
269 5/1/92 92.15
270 6/1/92 93.19
271 7/1/92 95.82
272 8/1/92 88.54
273 9/1/92 84.91
274 10/1/92 73.57
275 11/1/92 65.49
276 12/1/92 58.20
277 1/1/93 48.92
278 2/1/93 51.72
279 3/1/93 54.09
280 4/1/93 50.11
281 5/1/93 49.18
282 6/1/93 51.23
283 7/1/93 45.91
284 8/1/93 43.40
285 9/1/93 43.57
286 10/1/93 44.25
287 11/1/93 51.61
288 12/1/93 56.42
289 1/1/94 57.90
290 2/1/94 54.14
291 3/1/94 55.26
292 4/1/94 54.60
293 5/1/94 59.66
294 6/1/94 62.04
295 7/1/94 58.62
296 8/1/94 65.42
297 9/1/94 68.74
298 10/1/94 72.41
299 11/1/94 72.44
300 12/1/94 71.56
301 1/1/95 74.85
302 2/1/95 74.59
303 3/1/95 81.32
304 4/1/95 87.90
305 5/1/95 94.25
306 6/1/95 94.00
307 7/1/95 103.44
308 8/1/95 108.25
309 9/1/95 96.57
310 10/1/95 95.16
311 11/1/95 96.97
312 12/1/95 93.39
313 1/1/96 94.42
314 2/1/96 116.91
315 3/1/96 116.31
316 4/1/96 112.21
317 5/1/96 108.35
318 6/1/96 101.96
319 7/1/96 97.75
320 8/1/96 111.30
321 9/1/96 120.32
322 10/1/96 127.33
323 11/1/96 142.13
324 12/1/96 156.53
325 1/1/97 159.49
326 2/1/97 146.56
327 3/1/97 141.68
328 4/1/97 139.34
329 5/1/97 157.76
330 6/1/97 88.29
331 7/1/97 99.11
332 8/1/97 104.72
333 9/1/97 101.51
334 10/1/97 101.92
335 11/1/97 102.25
336 12/1/97 105.40
337 1/1/98 101.61
338 2/1/98 101.53
339 3/1/98 101.47
340 4/1/98 109.85
341 5/1/98 120.75
342 6/1/98 114.00
343 7/1/98 121.33
344 8/1/98 128.21
345 9/1/98 126.17
346 10/1/98 133.76
347 11/1/98 156.86
348 12/1/98 172.43
349 1/1/99 186.34
350 2/1/99 173.21
351 3/1/99 175.42
352 4/1/99 187.62
353 5/1/99 213.96
354 6/1/99 119.05
355 7/1/99 131.03
356 8/1/99 123.41
357 9/1/99 128.48
358 10/1/99 107.39
359 11/1/99 98.30
360 12/1/99 110.18
361 1/1/00 117.51
362 2/1/00 113.89
363 3/1/00 111.41
364 4/1/00 114.25
365 5/1/00 107.55
366 6/1/00 114.27
367 7/1/00 107.61
368 8/1/00 120.91
369 9/1/00 125.45
370 10/1/00 104.20
371 11/1/00 99.28
372 12/1/00 91.65
373 1/1/01 100.77
374 2/1/01 111.19
375 3/1/01 97.37
376 4/1/01 103.99
377 5/1/01 115.78
378 6/1/01 114.69
379 7/1/01 106.72
380 8/1/01 105.09
381 9/1/01 95.14
382 10/1/01 101.40
383 11/1/01 113.45
384 12/1/01 120.65
385 1/1/02 116.48
386 2/1/02 103.19
387 3/1/02 105.25
388 4/1/02 90.54
389 5/1/02 82.62
390 6/1/02 74.72
391 7/1/02 69.93
392 8/1/02 74.62
393 9/1/02 68.95
394 10/1/02 67.20
395 11/1/02 81.23
396 12/1/02 80.75
397 1/1/03 82.56
398 2/1/03 77.99
399 3/1/03 79.26
400 4/1/03 82.24
401 5/1/03 87.07
402 6/1/03 83.94
403 7/1/03 83.82
404 8/1/03 81.69
405 9/1/03 88.89
406 10/1/03 90.32
407 11/1/03 89.50
408 12/1/03 92.12
409 1/1/04 94.96
410 2/1/04 98.47
411 3/1/04 93.59
412 4/1/04 92.04
413 5/1/04 87.55
414 6/1/04 89.42
415 7/1/04 85.64
416 8/1/04 84.58
417 9/1/04 85.19
418 10/1/04 87.29
419 11/1/04 93.59
420 12/1/04 96.88
421 1/1/05 94.56
422 2/1/05 93.35
423 3/1/05 91.31
424 4/1/05 81.76
425 5/1/05 75.62
426 6/1/05 75.61
427 7/1/05 80.87
428 8/1/05 82.13
429 9/1/05 79.59
430 10/1/05 82.06
431 11/1/05 85.24
432 12/1/05 85.14
433 1/1/06 82.50
434 2/1/06 80.53
435 3/1/06 81.98
436 4/1/06 82.47
437 5/1/06 81.55
438 6/1/06 78.03
439 7/1/06 75.91
440 8/1/06 77.83
441 9/1/06 81.59
442 10/1/06 86.80
443 11/1/06 92.33
444 12/1/06 94.79
445 1/1/07 98.06
446 2/1/07 98.52
447 3/1/07 93.61
448 4/1/07 96.55
449 5/1/07 104.72
450 6/1/07 104.77
451 7/1/07 111.27
452 8/1/07 111.97
453 9/1/07 116.53
454 10/1/07 115.98
455 11/1/07 106.67
456 12/1/07 108.36
457 1/1/08 102.89
458 2/1/08 107.48
459 3/1/08 115.70
460 4/1/08 119.55
461 5/1/08 125.09
462 6/1/08 124.92
463 7/1/08 124.45
464 8/1/08 125.52
465 9/1/08 117.00
466 10/1/08 92.74
467 11/1/08 82.73
468 12/1/08 81.86
469 1/1/09 87.60
470 2/1/09 91.11
471 3/1/09 91.44
472 4/1/09 100.25
473 5/1/09 103.46
474 6/1/09 106.80
475 7/1/09 109.44
476 8/1/09 118.43
477 9/1/09 119.06
478 10/1/09 122.24
479 11/1/09 125.27
480 12/1/09 128.90
GE Date StockPrice
1 1/1/70 74.253
2 2/1/70 69.977
3 3/1/70 72.159
4 4/1/70 74.253
5 5/1/70 66.665
6 6/1/70 67.593
7 7/1/70 72.696
8 8/1/70 76.147
9 9/1/70 80.463
10 10/1/70 84.692
11 11/1/70 86.329
12 12/1/70 89.958
13 1/1/71 96.691
14 2/1/71 104.150
15 3/1/71 109.943
16 4/1/71 118.480
17 5/1/71 120.598
18 6/1/71 73.683
19 7/1/71 57.967
20 8/1/71 58.155
21 9/1/71 62.644
22 10/1/71 61.228
23 11/1/71 57.151
24 12/1/71 62.530
25 1/1/72 63.198
26 2/1/72 60.508
27 3/1/72 63.352
28 4/1/72 68.016
29 5/1/72 67.691
30 6/1/72 67.129
31 7/1/72 64.687
32 8/1/72 66.580
33 9/1/72 65.593
34 10/1/72 63.983
35 11/1/72 66.254
36 12/1/72 69.202
37 1/1/73 71.974
38 2/1/73 68.668
39 3/1/73 66.209
40 4/1/73 62.819
41 5/1/73 59.309
42 6/1/73 58.491
43 7/1/73 59.882
44 8/1/73 60.122
45 9/1/73 60.303
46 10/1/73 65.949
47 11/1/73 64.060
48 12/1/73 60.258
49 1/1/74 62.395
50 2/1/74 56.753
51 3/1/74 54.966
52 4/1/74 54.025
53 5/1/74 49.764
54 6/1/74 49.121
55 7/1/74 47.059
56 8/1/74 41.435
57 9/1/74 34.645
58 10/1/74 35.638
59 11/1/74 36.889
60 12/1/74 33.438
61 1/1/75 35.321
62 2/1/75 41.469
63 3/1/75 46.196
64 4/1/75 45.940
65 5/1/75 46.539
66 6/1/75 47.497
67 7/1/75 50.145
68 8/1/75 44.574
69 9/1/75 44.275
70 10/1/75 47.176
71 11/1/75 48.332
72 12/1/75 46.388
73 1/1/76 51.776
74 2/1/76 53.457
75 3/1/76 52.166
76 4/1/76 53.133
77 5/1/76 51.614
78 6/1/76 54.456
79 7/1/76 56.990
80 8/1/76 54.832
81 9/1/76 54.710
82 10/1/76 51.948
83 11/1/76 51.533
84 12/1/76 52.628
85 1/1/77 53.602
86 2/1/77 51.134
87 3/1/77 50.791
88 4/1/77 51.565
89 5/1/77 54.616
90 6/1/77 55.878
91 7/1/77 55.358
92 8/1/77 54.170
93 9/1/77 53.026
94 10/1/77 50.467
95 11/1/77 51.039
96 12/1/77 49.002
97 1/1/78 46.688
98 2/1/78 46.114
99 3/1/78 46.258
100 4/1/78 48.797
101 5/1/78 52.423
102 6/1/78 51.860
103 7/1/78 52.133
104 8/1/78 55.611
105 9/1/78 53.384
106 10/1/78 51.337
107 11/1/78 48.698
108 12/1/78 47.696
109 1/1/79 49.173
110 2/1/79 46.968
111 3/1/79 47.485
112 4/1/79 48.252
113 5/1/79 49.418
114 6/1/79 49.544
115 7/1/79 50.472
116 8/1/79 53.286
117 9/1/79 51.476
118 10/1/79 48.872
119 11/1/79 47.020
120 12/1/79 48.359
121 1/1/80 53.475
122 2/1/80 53.170
123 3/1/80 47.615
124 4/1/80 46.877
125 5/1/80 47.527
126 6/1/80 50.275
127 7/1/80 54.053
128 8/1/80 56.305
129 9/1/80 54.062
130 10/1/80 53.427
131 11/1/80 58.218
132 12/1/80 59.013
133 1/1/81 61.806
134 2/1/81 62.830
135 3/1/81 66.560
136 4/1/81 66.831
137 5/1/81 64.642
138 6/1/81 65.351
139 7/1/81 61.150
140 8/1/81 58.496
141 9/1/81 54.234
142 10/1/81 55.401
143 11/1/81 56.659
144 12/1/81 58.798
145 1/1/82 58.102
146 2/1/82 61.543
147 3/1/82 61.123
148 4/1/82 64.356
149 5/1/82 63.350
150 6/1/82 61.707
151 7/1/82 66.611
152 8/1/82 67.890
153 9/1/82 76.099
154 10/1/82 82.147
155 11/1/82 89.705
156 12/1/82 95.038
157 1/1/83 95.754
158 2/1/83 103.378
159 3/1/83 104.911
160 4/1/83 108.154
161 5/1/83 108.135
162 6/1/83 57.582
163 7/1/83 52.961
164 8/1/83 48.530
165 9/1/83 51.168
166 10/1/83 53.441
167 11/1/83 54.544
168 12/1/83 57.370
169 1/1/84 56.764
170 2/1/84 53.302
171 3/1/84 52.133
172 4/1/84 53.916
173 5/1/84 53.985
174 6/1/84 53.146
175 7/1/84 50.693
176 8/1/84 57.040
177 9/1/84 56.647
178 10/1/84 55.953
179 11/1/84 57.240
180 12/1/84 55.553
181 1/1/85 60.047
182 2/1/85 63.344
183 3/1/85 62.050
184 4/1/85 59.687
185 5/1/85 59.798
186 6/1/85 60.915
187 7/1/85 62.298
188 8/1/85 61.724
189 9/1/85 59.489
190 10/1/85 58.714
191 11/1/85 63.269
192 12/1/85 68.931
193 1/1/86 69.952
194 2/1/86 74.544
195 3/1/86 76.841
196 4/1/86 77.628
197 5/1/86 77.694
198 6/1/86 80.920
199 7/1/86 76.197
200 8/1/86 75.307
201 9/1/86 74.325
202 10/1/86 74.769
203 11/1/86 78.300
204 12/1/86 86.406
205 1/1/87 94.158
206 2/1/87 100.839
207 3/1/87 106.645
208 4/1/87 105.295
209 5/1/87 93.260
210 6/1/87 54.082
211 7/1/87 56.140
212 8/1/87 62.637
213 9/1/87 60.895
214 10/1/87 53.081
215 11/1/87 44.996
216 12/1/87 43.826
217 1/1/88 44.877
218 2/1/88 43.416
219 3/1/88 43.253
220 4/1/88 40.797
221 5/1/88 39.919
222 6/1/88 43.161
223 7/1/88 42.883
224 8/1/88 40.611
225 9/1/88 42.294
226 10/1/88 43.770
227 11/1/88 44.032
228 12/1/88 45.223
229 1/1/89 45.407
230 2/1/89 46.838
231 3/1/89 45.037
232 4/1/89 46.477
233 5/1/89 51.030
234 6/1/89 54.053
235 7/1/89 54.752
236 8/1/89 57.611
237 9/1/89 56.646
238 10/1/89 56.674
239 11/1/89 57.032
240 12/1/89 63.421
241 1/1/90 63.915
242 2/1/90 61.758
243 3/1/90 63.218
244 4/1/90 65.005
245 5/1/90 67.288
246 6/1/90 69.564
247 7/1/90 72.468
248 8/1/90 65.168
249 9/1/90 58.233
250 10/1/90 53.230
251 11/1/90 53.578
252 12/1/90 56.614
253 1/1/91 56.804
254 2/1/91 67.176
255 3/1/91 68.055
256 4/1/91 72.429
257 5/1/91 72.509
258 6/1/91 74.880
259 7/1/91 73.673
260 8/1/91 73.139
261 9/1/91 70.304
262 10/1/91 69.498
263 11/1/91 67.980
264 12/1/91 68.040
265 1/1/92 76.941
266 2/1/92 78.004
267 3/1/92 77.765
268 4/1/92 76.100
269 5/1/92 77.246
270 6/1/92 76.612
271 7/1/92 76.861
272 8/1/92 75.320
273 9/1/92 76.610
274 10/1/92 76.106
275 11/1/92 79.203
276 12/1/92 84.458
277 1/1/93 84.985
278 2/1/93 84.873
279 3/1/93 87.443
280 4/1/93 92.164
281 5/1/93 92.511
282 6/1/93 94.355
283 7/1/93 97.617
284 8/1/93 98.454
285 9/1/93 96.861
286 10/1/93 96.682
287 11/1/93 96.235
288 12/1/93 102.850
289 1/1/94 106.242
290 2/1/94 107.564
291 3/1/94 104.111
292 4/1/94 97.268
293 5/1/94 70.630
294 6/1/94 47.894
295 7/1/94 48.034
296 8/1/94 48.992
297 9/1/94 49.663
298 10/1/94 48.544
299 11/1/94 48.133
300 12/1/94 48.575
301 1/1/95 51.062
302 2/1/95 52.990
303 3/1/95 54.122
304 4/1/95 54.989
305 5/1/95 57.263
306 6/1/95 57.155
307 7/1/95 58.841
308 8/1/95 58.203
309 9/1/95 61.283
310 10/1/95 63.228
311 11/1/95 65.297
312 12/1/95 70.892
313 1/1/96 72.840
314 2/1/96 78.180
315 3/1/96 77.070
316 4/1/96 78.409
317 5/1/96 79.976
318 6/1/96 85.785
319 7/1/96 83.151
320 8/1/96 85.032
321 9/1/96 87.210
322 10/1/96 94.356
323 11/1/96 101.654
324 12/1/96 99.915
325 1/1/97 102.480
326 2/1/97 105.517
327 3/1/97 103.641
328 4/1/97 102.902
329 5/1/97 78.680
330 6/1/97 64.421
331 7/1/97 70.737
332 8/1/97 66.370
333 9/1/97 67.630
334 10/1/97 68.542
335 11/1/97 69.565
336 12/1/97 73.553
337 1/1/98 74.528
338 2/1/98 77.512
339 3/1/98 79.763
340 4/1/98 85.844
341 5/1/98 84.058
342 6/1/98 85.917
343 7/1/98 92.829
344 8/1/98 88.595
345 9/1/98 80.261
346 10/1/98 79.993
347 11/1/98 90.198
348 12/1/98 93.950
349 1/1/99 100.580
350 2/1/99 100.296
351 3/1/99 106.790
352 4/1/99 112.224
353 5/1/99 106.522
354 6/1/99 104.508
355 7/1/99 115.362
356 8/1/99 110.674
357 9/1/99 117.984
358 10/1/99 122.195
359 11/1/99 135.243
360 12/1/99 147.885
361 1/1/00 146.463
362 2/1/00 133.807
363 3/1/00 141.703
364 4/1/00 156.844
365 5/1/00 75.754
366 6/1/00 50.722
367 7/1/00 52.673
368 8/1/00 55.923
369 9/1/00 58.202
370 10/1/00 55.746
371 11/1/00 52.042
372 12/1/00 51.045
373 1/1/01 46.370
374 2/1/01 47.058
375 3/1/01 42.326
376 4/1/01 44.876
377 5/1/01 50.261
378 6/1/01 49.021
379 7/1/01 46.246
380 8/1/01 41.739
381 9/1/01 36.297
382 10/1/01 37.644
383 11/1/01 39.999
384 12/1/01 38.926
385 1/1/02 38.752
386 2/1/02 37.468
387 3/1/02 39.583
388 4/1/02 34.595
389 5/1/02 31.809
390 6/1/02 29.767
391 7/1/02 27.990
392 8/1/02 31.417
393 9/1/02 27.533
394 10/1/02 25.307
395 11/1/02 25.388
396 12/1/02 25.847
397 1/1/03 24.648
398 2/1/03 23.066
399 3/1/03 25.172
400 4/1/03 28.060
401 5/1/03 28.437
402 6/1/03 30.026
403 7/1/03 28.183
404 8/1/03 28.916
405 9/1/03 31.065
406 10/1/03 29.407
407 11/1/03 28.594
408 12/1/03 30.180
409 1/1/04 32.674
410 2/1/04 33.106
411 3/1/04 31.034
412 4/1/04 30.927
413 5/1/04 30.382
414 6/1/04 31.960
415 7/1/04 32.672
416 8/1/04 32.375
417 9/1/04 33.522
418 10/1/04 33.706
419 11/1/04 35.492
420 12/1/04 36.445
421 1/1/05 35.799
422 2/1/05 35.944
423 3/1/05 35.786
424 4/1/05 35.865
425 5/1/05 36.384
426 6/1/05 36.144
427 7/1/05 34.978
428 8/1/05 33.941
429 9/1/05 33.790
430 10/1/05 33.832
431 11/1/05 34.830
432 12/1/05 35.592
433 1/1/06 34.445
434 2/1/06 33.097
435 3/1/06 33.746
436 4/1/06 34.167
437 5/1/06 34.453
438 6/1/06 33.825
439 7/1/06 32.851
440 8/1/06 33.290
441 9/1/06 34.566
442 10/1/06 35.681
443 11/1/06 35.466
444 12/1/06 36.492
445 1/1/07 37.206
446 2/1/07 35.848
447 3/1/07 34.908
448 4/1/07 35.331
449 5/1/07 37.163
450 6/1/07 37.900
451 7/1/07 39.398
452 8/1/07 38.567
453 9/1/07 40.217
454 10/1/07 41.034
455 11/1/07 38.768
456 12/1/07 37.151
457 1/1/08 35.184
458 2/1/08 34.376
459 3/1/08 34.801
460 4/1/08 34.350
461 5/1/08 32.075
462 6/1/08 29.005
463 7/1/08 27.885
464 8/1/08 28.925
465 9/1/08 26.360
466 10/1/08 20.361
467 11/1/08 17.075
468 12/1/08 16.885
469 1/1/09 14.472
470 2/1/09 10.790
471 3/1/09 9.294
472 4/1/09 11.557
473 5/1/09 13.473
474 6/1/09 12.833
475 7/1/09 11.762
476 8/1/09 14.023
477 9/1/09 15.592
478 10/1/09 15.798
479 11/1/09 15.508
480 12/1/09 15.755
ProcterGamble Date StockPrice
1 1/1/70 111.87
2 2/1/70 111.45
3 3/1/70 108.45
4 4/1/70 106.29
5 5/1/70 73.33
6 6/1/70 48.32
7 7/1/70 51.32
8 8/1/70 51.59
9 9/1/70 52.92
10 10/1/70 54.05
11 11/1/70 57.26
12 12/1/70 59.05
13 1/1/71 57.42
14 2/1/71 58.34
15 3/1/71 60.46
16 4/1/71 61.18
17 5/1/71 59.98
18 6/1/71 63.37
19 7/1/71 68.52
20 8/1/71 68.78
21 9/1/71 72.46
22 10/1/71 71.18
23 11/1/71 73.33
24 12/1/71 76.60
25 1/1/72 78.04
26 2/1/72 85.11
27 3/1/72 86.33
28 4/1/72 90.20
29 5/1/72 94.97
30 6/1/72 97.11
31 7/1/72 96.39
32 8/1/72 97.93
33 9/1/72 97.28
34 10/1/72 98.66
35 11/1/72 108.99
36 12/1/72 108.98
37 1/1/73 114.54
38 2/1/73 108.52
39 3/1/73 108.13
40 4/1/73 99.69
41 5/1/73 100.23
42 6/1/73 102.23
43 7/1/73 106.02
44 8/1/73 103.68
45 9/1/73 97.52
46 10/1/73 99.61
47 11/1/73 99.42
48 12/1/73 93.15
49 1/1/74 89.30
50 2/1/74 85.39
51 3/1/74 91.24
52 4/1/74 88.83
53 5/1/74 97.05
54 6/1/74 101.49
55 7/1/74 98.51
56 8/1/74 87.44
57 9/1/74 78.99
58 10/1/74 78.52
59 11/1/74 85.84
60 12/1/74 80.30
61 1/1/75 83.65
62 2/1/75 93.01
63 3/1/75 95.06
64 4/1/75 94.67
65 5/1/75 96.04
66 6/1/75 95.67
67 7/1/75 94.88
68 8/1/75 86.56
69 9/1/75 83.51
70 10/1/75 87.60
71 11/1/75 92.20
72 12/1/75 90.77
73 1/1/76 93.25
74 2/1/76 88.29
75 3/1/76 85.80
76 4/1/76 89.51
77 5/1/76 88.55
78 6/1/76 90.21
79 7/1/76 97.42
80 8/1/76 94.53
81 9/1/76 95.20
82 10/1/76 92.76
83 11/1/76 93.30
84 12/1/76 92.44
85 1/1/77 89.53
86 2/1/77 83.85
87 3/1/77 82.33
88 4/1/77 77.48
89 5/1/77 75.66
90 6/1/77 79.20
91 7/1/77 80.73
92 8/1/77 82.38
93 9/1/77 85.28
94 10/1/77 82.55
95 11/1/77 83.19
96 12/1/77 84.05
97 1/1/78 81.84
98 2/1/78 78.55
99 3/1/78 76.17
100 4/1/78 78.43
101 5/1/78 84.66
102 6/1/78 86.42
103 7/1/78 88.23
104 8/1/78 88.79
105 9/1/78 88.77
106 10/1/78 86.17
107 11/1/78 84.72
108 12/1/78 87.28
109 1/1/79 87.44
110 2/1/79 82.93
111 3/1/79 80.94
112 4/1/79 80.02
113 5/1/79 79.45
114 6/1/79 78.62
115 7/1/79 75.30
116 8/1/79 77.98
117 9/1/79 77.84
118 10/1/79 76.60
119 11/1/79 73.30
120 12/1/79 73.99
121 1/1/80 73.49
122 2/1/80 71.87
123 3/1/80 65.74
124 4/1/80 68.72
125 5/1/80 76.49
126 6/1/80 75.81
127 7/1/80 75.50
128 8/1/80 80.00
129 9/1/80 76.84
130 10/1/80 71.68
131 11/1/80 70.45
132 12/1/80 66.67
133 1/1/81 69.24
134 2/1/81 67.29
135 3/1/81 71.66
136 4/1/81 71.29
137 5/1/81 69.75
138 6/1/81 74.49
139 7/1/81 73.86
140 8/1/81 70.22
141 9/1/81 69.99
142 10/1/81 74.35
143 11/1/81 77.86
144 12/1/81 79.12
145 1/1/82 81.25
146 2/1/82 83.61
147 3/1/82 81.29
148 4/1/82 85.67
149 5/1/82 85.19
150 6/1/82 83.66
151 7/1/82 85.15
152 8/1/82 88.25
153 9/1/82 97.66
154 10/1/82 108.27
155 11/1/82 111.91
156 12/1/82 117.42
157 1/1/83 111.44
158 2/1/83 97.26
159 3/1/83 58.32
160 4/1/83 61.36
161 5/1/83 56.99
162 6/1/83 54.42
163 7/1/83 54.29
164 8/1/83 52.54
165 9/1/83 55.79
166 10/1/83 57.94
167 11/1/83 56.88
168 12/1/83 57.20
169 1/1/84 54.13
170 2/1/84 48.36
171 3/1/84 47.30
172 4/1/84 47.91
173 5/1/84 48.18
174 6/1/84 51.39
175 7/1/84 52.87
176 8/1/84 55.37
177 9/1/84 55.44
178 10/1/84 55.69
179 11/1/84 58.19
180 12/1/84 57.88
181 1/1/85 56.29
182 2/1/85 56.29
183 3/1/85 56.29
184 4/1/85 53.05
185 5/1/85 52.27
186 6/1/85 54.22
187 7/1/85 57.66
188 8/1/85 57.72
189 9/1/85 57.25
190 10/1/85 58.29
191 11/1/85 66.00
192 12/1/85 69.15
193 1/1/86 66.73
194 2/1/86 66.48
195 3/1/86 71.91
196 4/1/86 74.89
197 5/1/86 74.13
198 6/1/86 76.77
199 7/1/86 76.46
200 8/1/86 77.90
201 9/1/86 72.44
202 10/1/86 71.42
203 11/1/86 75.85
204 12/1/86 78.64
205 1/1/87 83.15
206 2/1/87 86.75
207 3/1/87 91.33
208 4/1/87 90.13
209 5/1/87 89.45
210 6/1/87 96.11
211 7/1/87 94.01
212 8/1/87 98.70
213 9/1/87 98.42
214 10/1/87 89.60
215 11/1/87 85.66
216 12/1/87 84.22
217 1/1/88 84.92
218 2/1/88 82.92
219 3/1/88 80.63
220 4/1/88 78.84
221 5/1/88 74.33
222 6/1/88 77.25
223 7/1/88 74.73
224 8/1/88 73.84
225 9/1/88 78.25
226 10/1/88 81.58
227 11/1/88 81.41
228 12/1/88 84.54
229 1/1/89 87.78
230 2/1/89 90.37
231 3/1/89 89.90
232 4/1/89 93.03
233 5/1/89 99.22
234 6/1/89 108.43
235 7/1/89 114.57
236 8/1/89 123.67
237 9/1/89 122.60
238 10/1/89 127.28
239 11/1/89 103.80
240 12/1/89 67.07
241 1/1/90 67.57
242 2/1/90 64.76
243 3/1/90 65.69
244 4/1/90 69.48
245 5/1/90 75.83
246 6/1/90 83.00
247 7/1/90 88.24
248 8/1/90 78.42
249 9/1/90 75.43
250 10/1/90 77.51
251 11/1/90 80.94
252 12/1/90 85.55
253 1/1/91 80.96
254 2/1/91 82.43
255 3/1/91 84.21
256 4/1/91 85.55
257 5/1/91 82.92
258 6/1/91 81.94
259 7/1/91 79.54
260 8/1/91 82.06
261 9/1/91 83.53
262 10/1/91 82.94
263 11/1/91 82.38
264 12/1/91 85.05
265 1/1/92 94.92
266 2/1/92 100.90
267 3/1/92 100.03
268 4/1/92 101.13
269 5/1/92 103.25
270 6/1/92 71.94
271 7/1/92 49.31
272 8/1/92 48.76
273 9/1/92 48.13
274 10/1/92 50.77
275 11/1/92 53.63
276 12/1/92 53.70
277 1/1/93 50.70
278 2/1/93 50.74
279 3/1/93 52.18
280 4/1/93 47.98
281 5/1/93 49.28
282 6/1/93 49.07
283 7/1/93 50.79
284 8/1/93 47.71
285 9/1/93 47.88
286 10/1/93 50.93
287 11/1/93 55.03
288 12/1/93 56.91
289 1/1/94 57.91
290 2/1/94 58.24
291 3/1/94 55.96
292 4/1/94 54.62
293 5/1/94 55.29
294 6/1/94 55.92
295 7/1/94 54.25
296 8/1/94 56.29
297 9/1/94 59.50
298 10/1/94 61.71
299 11/1/94 62.74
300 12/1/94 62.03
301 1/1/95 62.28
302 2/1/95 65.62
303 3/1/95 67.65
304 4/1/95 68.12
305 5/1/95 69.79
306 6/1/95 71.88
307 7/1/95 69.41
308 8/1/95 68.54
309 9/1/95 73.52
310 10/1/95 80.29
311 11/1/95 84.74
312 12/1/95 85.05
313 1/1/96 86.19
314 2/1/96 84.46
315 3/1/96 85.87
316 4/1/96 84.62
317 5/1/96 86.52
318 6/1/96 90.12
319 7/1/96 87.04
320 8/1/96 89.78
321 9/1/96 91.84
322 10/1/96 96.89
323 11/1/96 105.77
324 12/1/96 106.47
325 1/1/97 110.22
326 2/1/97 122.35
327 3/1/97 122.02
328 4/1/97 120.51
329 5/1/97 132.15
330 6/1/97 138.03
331 7/1/97 149.62
332 8/1/97 142.00
333 9/1/97 114.06
334 10/1/97 70.85
335 11/1/97 73.40
336 12/1/97 79.53
337 1/1/98 80.18
338 2/1/98 82.48
339 3/1/98 84.15
340 4/1/98 84.97
341 5/1/98 82.87
342 6/1/98 87.60
343 7/1/98 90.03
344 8/1/98 79.64
345 9/1/98 72.52
346 10/1/98 80.36
347 11/1/98 89.80
348 12/1/98 88.86
349 1/1/99 87.48
350 2/1/99 88.94
351 3/1/99 93.64
352 4/1/99 97.20
353 5/1/99 93.08
354 6/1/99 89.36
355 7/1/99 87.87
356 8/1/99 95.03
357 9/1/99 99.71
358 10/1/99 97.60
359 11/1/99 108.25
360 12/1/99 110.04
361 1/1/00 108.80
362 2/1/00 93.78
363 3/1/00 62.88
364 4/1/00 64.64
365 5/1/00 63.40
366 6/1/00 57.81
367 7/1/00 57.26
368 8/1/00 60.34
369 9/1/00 62.61
370 10/1/00 72.40
371 11/1/00 71.78
372 12/1/00 73.27
373 1/1/01 72.13
374 2/1/01 74.22
375 3/1/01 65.90
376 4/1/01 59.30
377 5/1/01 65.03
378 6/1/01 63.82
379 7/1/01 67.77
380 8/1/01 73.17
381 9/1/01 73.01
382 10/1/01 71.97
383 11/1/01 77.24
384 12/1/01 78.91
385 1/1/02 78.62
386 2/1/02 83.60
387 3/1/02 86.89
388 4/1/02 89.99
389 5/1/02 91.52
390 6/1/02 91.38
391 7/1/02 84.48
392 8/1/02 89.53
393 9/1/02 90.29
394 10/1/02 89.83
395 11/1/02 86.67
396 12/1/02 86.53
397 1/1/03 85.82
398 2/1/03 83.97
399 3/1/03 84.35
400 4/1/03 89.53
401 5/1/03 89.71
402 6/1/03 91.20
403 7/1/03 89.01
404 8/1/03 88.14
405 9/1/03 91.34
406 10/1/03 95.48
407 11/1/03 96.38
408 12/1/03 97.58
409 1/1/04 99.20
410 2/1/04 102.41
411 3/1/04 103.46
412 4/1/04 105.66
413 5/1/04 106.44
414 6/1/04 88.96
415 7/1/04 54.27
416 8/1/04 54.37
417 9/1/04 55.40
418 10/1/04 53.32
419 11/1/04 53.53
420 12/1/04 55.44
421 1/1/05 55.36
422 2/1/05 52.99
423 3/1/05 53.08
424 4/1/05 54.24
425 5/1/05 55.37
426 6/1/05 54.47
427 7/1/05 54.21
428 8/1/05 54.62
429 9/1/05 56.29
430 10/1/05 56.09
431 11/1/05 56.51
432 12/1/05 57.96
433 1/1/06 58.59
434 2/1/06 60.16
435 3/1/06 59.47
436 4/1/06 56.98
437 5/1/06 55.68
438 6/1/06 54.90
439 7/1/06 56.38
440 8/1/06 59.99
441 9/1/06 61.58
442 10/1/06 62.54
443 11/1/06 63.38
444 12/1/06 63.80
445 1/1/07 64.69
446 2/1/07 64.61
447 3/1/07 62.66
448 4/1/07 63.35
449 5/1/07 62.70
450 6/1/07 62.27
451 7/1/07 62.14
452 8/1/07 64.35
453 9/1/07 67.70
454 10/1/07 70.89
455 11/1/07 71.68
456 12/1/07 73.91
457 1/1/08 68.90
458 2/1/08 66.28
459 3/1/08 67.63
460 4/1/08 68.97
461 5/1/08 65.95
462 6/1/08 64.94
463 7/1/08 63.73
464 8/1/08 69.24
465 9/1/08 70.40
466 10/1/08 63.48
467 11/1/08 63.53
468 12/1/08 60.72
469 1/1/09 58.87
470 2/1/09 51.47
471 3/1/09 46.88
472 4/1/09 49.45
473 5/1/09 51.68
474 6/1/09 51.90
475 7/1/09 54.05
476 8/1/09 53.10
477 9/1/09 55.76
478 10/1/09 57.52
479 11/1/09 61.30
480 12/1/09 62.05
CocaCola Date StockPrice
1 1/1/70 83.37
2 2/1/70 81.59
3 3/1/70 81.34
4 4/1/70 76.81
5 5/1/70 69.28
6 6/1/70 72.02
7 7/1/70 71.71
8 8/1/70 69.84
9 9/1/70 72.74
10 10/1/70 78.04
11 11/1/70 81.01
12 12/1/70 84.57
13 1/1/71 85.14
14 2/1/71 86.57
15 3/1/71 91.61
16 4/1/71 97.85
17 5/1/71 99.27
18 6/1/71 102.14
19 7/1/71 101.94
20 8/1/71 103.37
21 9/1/71 107.64
22 10/1/71 109.51
23 11/1/71 108.40
24 12/1/71 115.95
25 1/1/72 117.14
26 2/1/72 123.99
27 3/1/72 127.54
28 4/1/72 128.76
29 5/1/72 129.13
30 6/1/72 131.09
31 7/1/72 137.39
32 8/1/72 143.63
33 9/1/72 136.69
34 10/1/72 139.32
35 11/1/72 142.74
36 12/1/72 146.26
37 1/1/73 146.58
38 2/1/73 143.77
39 3/1/73 144.31
40 4/1/73 140.65
41 5/1/73 136.09
42 6/1/73 141.36
43 7/1/73 142.51
44 8/1/73 142.44
45 9/1/73 143.26
46 10/1/73 143.16
47 11/1/73 138.54
48 12/1/73 122.99
49 1/1/74 120.54
50 2/1/74 113.28
51 3/1/74 115.45
52 4/1/74 108.86
53 5/1/74 103.73
54 6/1/74 112.94
55 7/1/74 98.40
56 8/1/74 78.96
57 9/1/74 65.86
58 10/1/74 56.09
59 11/1/74 56.98
60 12/1/74 49.96
61 1/1/75 59.24
62 2/1/75 72.22
63 3/1/75 77.24
64 4/1/75 77.56
65 5/1/75 88.53
66 6/1/75 90.11
67 7/1/75 86.87
68 8/1/75 76.53
69 9/1/75 72.77
70 10/1/75 79.21
71 11/1/75 86.02
72 12/1/75 83.82
73 1/1/76 88.97
74 2/1/76 89.07
75 3/1/76 86.55
76 4/1/76 85.45
77 5/1/76 82.10
78 6/1/76 80.54
79 7/1/76 85.47
80 8/1/76 86.63
81 9/1/76 86.99
82 10/1/76 82.80
83 11/1/76 79.31
84 12/1/76 77.19
85 1/1/77 76.05
86 2/1/77 75.94
87 3/1/77 77.48
88 4/1/77 76.62
89 5/1/77 74.02
90 6/1/77 37.26
91 7/1/77 38.77
92 8/1/77 39.19
93 9/1/77 39.74
94 10/1/77 38.62
95 11/1/77 38.01
96 12/1/77 37.00
97 1/1/78 36.01
98 2/1/78 36.31
99 3/1/78 37.53
100 4/1/78 39.98
101 5/1/78 42.49
102 6/1/78 42.33
103 7/1/78 41.44
104 8/1/78 45.09
105 9/1/78 44.66
106 10/1/78 43.46
107 11/1/78 41.50
108 12/1/78 43.20
109 1/1/79 44.94
110 2/1/79 42.81
111 3/1/79 41.42
112 4/1/79 40.23
113 5/1/79 38.29
114 6/1/79 39.06
115 7/1/79 37.99
116 8/1/79 39.95
117 9/1/79 38.48
118 10/1/79 35.26
119 11/1/79 33.61
120 12/1/79 34.60
121 1/1/80 34.25
122 2/1/80 33.75
123 3/1/80 30.06
124 4/1/80 31.28
125 5/1/80 34.16
126 6/1/80 33.52
127 7/1/80 34.44
128 8/1/80 36.64
129 9/1/80 34.28
130 10/1/80 31.94
131 11/1/80 30.92
132 12/1/80 31.33
133 1/1/81 34.35
134 2/1/81 33.84
135 3/1/81 36.71
136 4/1/81 36.27
137 5/1/81 35.49
138 6/1/81 36.93
139 7/1/81 33.75
140 8/1/81 33.39
141 9/1/81 32.00
142 10/1/81 34.92
143 11/1/81 35.22
144 12/1/81 35.06
145 1/1/82 33.48
146 2/1/82 31.59
147 3/1/82 31.82
148 4/1/82 34.05
149 5/1/82 33.75
150 6/1/82 33.67
151 7/1/82 36.22
152 8/1/82 37.12
153 9/1/82 40.63
154 10/1/82 44.04
155 11/1/82 46.95
156 12/1/82 51.01
157 1/1/83 49.42
158 2/1/83 48.60
159 3/1/83 51.00
160 4/1/83 55.38
161 5/1/83 53.52
162 6/1/83 51.56
163 7/1/83 48.94
164 8/1/83 49.88
165 9/1/83 50.26
166 10/1/83 53.60
167 11/1/83 54.41
168 12/1/83 55.47
169 1/1/84 52.51
170 2/1/84 50.49
171 3/1/84 53.88
172 4/1/84 54.43
173 5/1/84 56.01
174 6/1/84 57.07
175 7/1/84 58.35
176 8/1/84 61.51
177 9/1/84 61.79
178 10/1/84 63.15
179 11/1/84 63.86
180 12/1/84 61.91
181 1/1/85 62.77
182 2/1/85 61.59
183 3/1/85 65.83
184 4/1/85 69.27
185 5/1/85 67.50
186 6/1/85 69.39
187 7/1/85 71.41
188 8/1/85 71.79
189 9/1/85 69.52
190 10/1/85 70.63
191 11/1/85 77.81
192 12/1/85 84.75
193 1/1/86 81.23
194 2/1/86 87.73
195 3/1/86 102.19
196 4/1/86 108.33
197 5/1/86 109.77
198 6/1/86 116.70
199 7/1/86 41.12
200 8/1/86 38.56
201 9/1/86 35.01
202 10/1/86 36.50
203 11/1/86 36.44
204 12/1/86 38.30
205 1/1/87 40.25
206 2/1/87 43.63
207 3/1/87 46.53
208 4/1/87 44.35
209 5/1/87 40.99
210 6/1/87 44.28
211 7/1/87 45.35
212 8/1/87 49.92
213 9/1/87 49.27
214 10/1/87 42.81
215 11/1/87 39.23
216 12/1/87 38.59
217 1/1/88 38.08
218 2/1/88 36.97
219 3/1/88 38.69
220 4/1/88 38.28
221 5/1/88 36.79
222 6/1/88 38.31
223 7/1/88 37.57
224 8/1/88 38.52
225 9/1/88 42.17
226 10/1/88 43.11
227 11/1/88 42.42
228 12/1/88 44.14
229 1/1/89 44.95
230 2/1/89 47.36
231 3/1/89 49.84
232 4/1/89 52.68
233 5/1/89 56.34
234 6/1/89 57.51
235 7/1/89 59.85
236 8/1/89 66.63
237 9/1/89 63.94
238 10/1/89 69.75
239 11/1/89 74.58
240 12/1/89 77.85
241 1/1/90 73.18
242 2/1/90 68.70
243 3/1/90 72.85
244 4/1/90 77.86
245 5/1/90 57.76
246 6/1/90 44.66
247 7/1/90 45.53
248 8/1/90 42.66
249 9/1/90 40.67
250 10/1/90 42.78
251 11/1/90 45.24
252 12/1/90 47.43
253 1/1/91 46.20
254 2/1/91 51.28
255 3/1/91 53.15
256 4/1/91 54.13
257 5/1/91 55.11
258 6/1/91 55.43
259 7/1/91 57.38
260 8/1/91 63.54
261 9/1/91 64.64
262 10/1/91 63.89
263 11/1/91 67.12
264 12/1/91 74.47
265 1/1/92 77.19
266 2/1/92 78.64
267 3/1/92 81.33
268 4/1/92 81.67
269 5/1/92 57.71
270 6/1/92 41.86
271 7/1/92 41.39
272 8/1/92 42.93
273 9/1/92 43.24
274 10/1/92 39.59
275 11/1/92 40.86
276 12/1/92 41.25
277 1/1/93 41.70
278 2/1/93 41.44
279 3/1/93 42.58
280 4/1/93 39.75
281 5/1/93 40.13
282 6/1/93 41.69
283 7/1/93 43.70
284 8/1/93 43.07
285 9/1/93 43.12
286 10/1/93 42.68
287 11/1/93 41.89
288 12/1/93 43.50
289 1/1/94 42.22
290 2/1/94 41.36
291 3/1/94 41.63
292 4/1/94 40.32
293 5/1/94 40.55
294 6/1/94 40.65
295 7/1/94 42.28
296 8/1/94 45.21
297 9/1/94 47.49
298 10/1/94 49.83
299 11/1/94 51.29
300 12/1/94 51.29
301 1/1/95 50.70
302 2/1/95 53.25
303 3/1/95 56.76
304 4/1/95 58.03
305 5/1/95 59.12
306 6/1/95 62.29
307 7/1/95 64.72
308 8/1/95 65.00
309 9/1/95 66.67
310 10/1/95 71.28
311 11/1/95 73.56
312 12/1/95 76.79
313 1/1/96 74.13
314 2/1/96 79.75
315 3/1/96 82.80
316 4/1/96 81.37
317 5/1/96 58.66
318 6/1/96 47.08
319 7/1/96 47.26
320 8/1/96 50.22
321 9/1/96 51.52
322 10/1/96 49.75
323 11/1/96 51.59
324 12/1/96 50.51
325 1/1/97 55.82
326 2/1/97 60.28
327 3/1/97 59.98
328 4/1/97 58.08
329 5/1/97 66.40
330 6/1/97 69.58
331 7/1/97 69.74
332 8/1/97 62.49
333 9/1/97 59.31
334 10/1/97 59.80
335 11/1/97 59.40
336 12/1/97 65.06
337 1/1/98 65.21
338 2/1/98 68.10
339 3/1/98 72.88
340 4/1/98 76.72
341 5/1/98 77.42
342 6/1/98 81.29
343 7/1/98 85.33
344 8/1/98 78.93
345 9/1/98 60.98
346 10/1/98 65.05
347 11/1/98 71.62
348 12/1/98 67.29
349 1/1/99 65.18
350 2/1/99 63.86
351 3/1/99 65.23
352 4/1/99 64.09
353 5/1/99 67.79
354 6/1/99 64.95
355 7/1/99 63.04
356 8/1/99 59.95
357 9/1/99 54.28
358 10/1/99 52.28
359 11/1/99 60.49
360 12/1/99 61.45
361 1/1/00 61.14
362 2/1/00 54.08
363 3/1/00 47.54
364 4/1/00 48.22
365 5/1/00 50.21
366 6/1/00 54.64
367 7/1/00 58.81
368 8/1/00 59.95
369 9/1/00 53.25
370 10/1/00 57.45
371 11/1/00 60.25
372 12/1/00 59.16
373 1/1/01 57.94
374 2/1/01 57.33
375 3/1/01 48.40
376 4/1/01 45.80
377 5/1/01 47.23
378 6/1/01 45.30
379 7/1/01 45.41
380 8/1/01 46.76
381 9/1/01 48.53
382 10/1/01 46.54
383 11/1/01 48.73
384 12/1/01 46.84
385 1/1/02 45.18
386 2/1/02 46.05
387 3/1/02 48.93
388 4/1/02 53.40
389 5/1/02 56.24
390 6/1/02 54.85
391 7/1/02 51.17
392 8/1/02 50.93
393 9/1/02 49.18
394 10/1/02 48.99
395 11/1/02 45.62
396 12/1/02 44.91
397 1/1/03 43.91
398 2/1/03 40.20
399 3/1/03 39.66
400 4/1/03 41.01
401 5/1/03 43.44
402 6/1/03 46.67
403 7/1/03 44.91
404 8/1/03 44.37
405 9/1/03 43.66
406 10/1/03 44.83
407 11/1/03 46.53
408 12/1/03 48.82
409 1/1/04 49.81
410 2/1/04 50.49
411 3/1/04 49.03
412 4/1/04 51.05
413 5/1/04 50.17
414 6/1/04 51.35
415 7/1/04 48.79
416 8/1/04 44.12
417 9/1/04 41.95
418 10/1/04 39.87
419 11/1/04 40.50
420 12/1/04 40.90
421 1/1/05 41.20
422 2/1/05 42.61
423 3/1/05 42.37
424 4/1/05 42.17
425 5/1/05 44.39
426 6/1/05 43.64
427 7/1/05 43.11
428 8/1/05 43.87
429 9/1/05 43.35
430 10/1/05 42.33
431 11/1/05 42.53
432 12/1/05 41.54
433 1/1/06 41.15
434 2/1/06 41.50
435 3/1/06 42.33
436 4/1/06 41.65
437 5/1/06 43.31
438 6/1/06 43.17
439 7/1/06 43.67
440 8/1/06 44.26
441 9/1/06 44.56
442 10/1/06 45.23
443 11/1/06 46.70
444 12/1/06 48.42
445 1/1/07 48.27
446 2/1/07 47.83
447 3/1/07 47.31
448 4/1/07 50.62
449 5/1/07 52.49
450 6/1/07 51.88
451 7/1/07 53.03
452 8/1/07 54.02
453 9/1/07 55.70
454 10/1/07 58.90
455 11/1/07 61.72
456 12/1/07 62.89
457 1/1/08 61.42
458 2/1/08 58.91
459 3/1/08 59.56
460 4/1/08 60.38
461 5/1/08 57.53
462 6/1/08 55.10
463 7/1/08 51.23
464 8/1/08 54.17
465 9/1/08 52.61
466 10/1/08 46.46
467 11/1/08 44.59
468 12/1/08 45.02
469 1/1/09 43.92
470 2/1/09 42.65
471 3/1/09 41.52
472 4/1/09 44.14
473 5/1/09 44.82
474 6/1/09 48.65
475 7/1/09 49.36
476 8/1/09 49.15
477 9/1/09 51.59
478 10/1/09 54.09
479 11/1/09 55.91
480 12/1/09 57.79
Boeing Date StockPrice
1 1/1/70 27.85
2 2/1/70 22.38
3 3/1/70 23.11
4 4/1/70 21.57
5 5/1/70 18.93
6 6/1/70 15.44
7 7/1/70 13.66
8 8/1/70 13.34
9 9/1/70 17.39
10 10/1/70 15.91
11 11/1/70 13.97
12 12/1/70 14.35
13 1/1/71 17.34
14 2/1/71 21.86
15 3/1/71 22.06
16 4/1/71 22.32
17 5/1/71 23.52
18 6/1/71 21.23
19 7/1/71 18.22
20 8/1/71 16.16
21 9/1/71 15.52
22 10/1/71 16.26
23 11/1/71 14.80
24 12/1/71 18.00
25 1/1/72 23.13
26 2/1/72 25.27
27 3/1/72 23.28
28 4/1/72 23.74
29 5/1/72 21.64
30 6/1/72 21.48
31 7/1/72 22.12
32 8/1/72 22.52
33 9/1/72 22.42
34 10/1/72 22.10
35 11/1/72 23.29
36 12/1/72 25.42
37 1/1/73 24.81
38 2/1/73 22.70
39 3/1/73 21.44
40 4/1/73 19.43
41 5/1/73 19.03
42 6/1/73 17.36
43 7/1/73 18.49
44 8/1/73 18.05
45 9/1/73 18.27
46 10/1/73 19.21
47 11/1/73 17.15
48 12/1/73 13.09
49 1/1/74 12.74
50 2/1/74 13.73
51 3/1/74 14.82
52 4/1/74 14.56
53 5/1/74 16.46
54 6/1/74 17.72
55 7/1/74 16.69
56 8/1/74 18.45
57 9/1/74 17.40
58 10/1/74 16.69
59 11/1/74 18.60
60 12/1/74 16.36
61 1/1/75 16.35
62 2/1/75 17.26
63 3/1/75 20.56
64 4/1/75 22.25
65 5/1/75 27.89
66 6/1/75 30.00
67 7/1/75 29.27
68 8/1/75 25.76
69 9/1/75 26.33
70 10/1/75 28.15
71 11/1/75 24.93
72 12/1/75 23.73
73 1/1/76 27.18
74 2/1/76 26.95
75 3/1/76 26.54
76 4/1/76 27.68
77 5/1/76 34.01
78 6/1/76 36.59
79 7/1/76 40.02
80 8/1/76 41.47
81 9/1/76 42.95
82 10/1/76 42.36
83 11/1/76 42.51
84 12/1/76 44.47
85 1/1/77 41.46
86 2/1/77 40.59
87 3/1/77 43.73
88 4/1/77 44.64
89 5/1/77 51.78
90 6/1/77 56.08
91 7/1/77 57.32
92 8/1/77 57.60
93 9/1/77 36.24
94 10/1/77 25.35
95 11/1/77 27.34
96 12/1/77 28.03
97 1/1/78 26.15
98 2/1/78 29.33
99 3/1/78 33.68
100 4/1/78 36.89
101 5/1/78 47.27
102 6/1/78 51.47
103 7/1/78 57.53
104 8/1/78 70.19
105 9/1/78 68.33
106 10/1/78 63.12
107 11/1/78 62.66
108 12/1/78 71.56
109 1/1/79 76.10
110 2/1/79 69.95
111 3/1/79 65.82
112 4/1/79 53.02
113 5/1/79 39.86
114 6/1/79 41.77
115 7/1/79 41.01
116 8/1/79 46.21
117 9/1/79 48.21
118 10/1/79 45.02
119 11/1/79 44.07
120 12/1/79 48.78
121 1/1/80 60.27
122 2/1/80 63.69
123 3/1/80 57.23
124 4/1/80 44.60
125 5/1/80 33.94
126 6/1/80 35.61
127 7/1/80 38.16
128 8/1/80 38.10
129 9/1/80 39.29
130 10/1/80 37.93
131 11/1/80 38.54
132 12/1/80 39.16
133 1/1/81 41.48
134 2/1/81 36.20
135 3/1/81 34.93
136 4/1/81 34.68
137 5/1/81 32.57
138 6/1/81 31.22
139 7/1/81 29.15
140 8/1/81 26.53
141 9/1/81 24.33
142 10/1/81 25.45
143 11/1/81 23.90
144 12/1/81 23.12
145 1/1/82 21.52
146 2/1/82 19.85
147 3/1/82 18.38
148 4/1/82 18.87
149 5/1/82 19.08
150 6/1/82 16.02
151 7/1/82 16.59
152 8/1/82 18.93
153 9/1/82 23.17
154 10/1/82 24.12
155 11/1/82 29.01
156 12/1/82 33.20
157 1/1/83 35.06
158 2/1/83 36.51
159 3/1/83 38.02
160 4/1/83 40.58
161 5/1/83 37.92
162 6/1/83 44.96
163 7/1/83 45.02
164 8/1/83 39.48
165 9/1/83 41.10
166 10/1/83 39.57
167 11/1/83 41.28
168 12/1/83 45.41
169 1/1/84 47.03
170 2/1/84 42.78
171 3/1/84 39.47
172 4/1/84 37.91
173 5/1/84 38.40
174 6/1/84 42.04
175 7/1/84 44.60
176 8/1/84 51.74
177 9/1/84 54.40
178 10/1/84 54.92
179 11/1/84 56.62
180 12/1/84 54.56
181 1/1/85 58.16
182 2/1/85 63.94
183 3/1/85 63.27
184 4/1/85 61.33
185 5/1/85 61.62
186 6/1/85 50.04
187 7/1/85 47.22
188 8/1/85 48.43
189 9/1/85 46.94
190 10/1/85 45.26
191 11/1/85 47.26
192 12/1/85 50.63
193 1/1/86 49.20
194 2/1/86 49.46
195 3/1/86 54.48
196 4/1/86 56.86
197 5/1/86 56.49
198 6/1/86 60.91
199 7/1/86 60.98
200 8/1/86 59.94
201 9/1/86 56.78
202 10/1/86 53.88
203 11/1/86 51.04
204 12/1/86 52.31
205 1/1/87 51.40
206 2/1/87 51.30
207 3/1/87 52.44
208 4/1/87 49.83
209 5/1/87 44.60
210 6/1/87 46.89
211 7/1/87 48.43
212 8/1/87 52.23
213 9/1/87 50.72
214 10/1/87 44.69
215 11/1/87 36.30
216 12/1/87 36.68
217 1/1/88 42.06
218 2/1/88 46.90
219 3/1/88 47.49
220 4/1/88 46.45
221 5/1/88 50.16
222 6/1/88 56.03
223 7/1/88 58.64
224 8/1/88 59.80
225 9/1/88 60.95
226 10/1/88 65.33
227 11/1/88 62.70
228 12/1/88 61.38
229 1/1/89 60.76
230 2/1/89 62.75
231 3/1/89 65.81
232 4/1/89 71.13
233 5/1/89 78.66
234 6/1/89 59.44
235 7/1/89 50.71
236 8/1/89 52.93
237 9/1/89 56.64
238 10/1/89 58.01
239 11/1/89 56.87
240 12/1/89 59.02
241 1/1/90 60.22
242 2/1/90 61.94
243 3/1/90 68.71
244 4/1/90 71.62
245 5/1/90 76.99
246 6/1/90 66.11
247 7/1/90 59.34
248 8/1/90 50.43
249 9/1/90 45.11
250 10/1/90 45.22
251 11/1/90 44.92
252 12/1/90 45.48
253 1/1/91 46.20
254 2/1/91 49.08
255 3/1/91 48.40
256 4/1/91 47.26
257 5/1/91 46.63
258 6/1/91 47.75
259 7/1/91 44.88
260 8/1/91 47.14
261 9/1/91 50.25
262 10/1/91 49.26
263 11/1/91 47.13
264 12/1/91 43.76
265 1/1/92 50.39
266 2/1/92 47.73
267 3/1/92 45.12
268 4/1/92 45.22
269 5/1/92 43.77
270 6/1/92 42.88
271 7/1/92 40.04
272 8/1/92 39.20
273 9/1/92 36.35
274 10/1/92 36.64
275 11/1/92 35.30
276 12/1/92 35.98
277 1/1/93 37.65
278 2/1/93 34.80
279 3/1/93 34.77
280 4/1/93 36.70
281 5/1/93 39.47
282 6/1/93 38.81
283 7/1/93 37.61
284 8/1/93 38.89
285 9/1/93 39.66
286 10/1/93 37.84
287 11/1/93 37.72
288 12/1/93 41.63
289 1/1/94 43.47
290 2/1/94 44.84
291 3/1/94 46.53
292 4/1/94 44.94
293 5/1/94 44.59
294 6/1/94 47.96
295 7/1/94 46.52
296 8/1/94 45.03
297 9/1/94 44.89
298 10/1/94 43.79
299 11/1/94 44.26
300 12/1/94 47.12
301 1/1/95 47.44
302 2/1/95 46.58
303 3/1/95 48.44
304 4/1/95 54.56
305 5/1/95 55.76
306 6/1/95 62.89
307 7/1/95 64.44
308 8/1/95 64.77
309 9/1/95 68.91
310 10/1/95 66.25
311 11/1/95 71.59
312 12/1/95 75.20
313 1/1/96 77.94
314 2/1/96 81.16
315 3/1/96 83.90
316 4/1/96 82.21
317 5/1/96 81.41
318 6/1/96 85.85
319 7/1/96 87.98
320 8/1/96 91.00
321 9/1/96 92.01
322 10/1/96 96.80
323 11/1/96 94.51
324 12/1/96 99.98
325 1/1/97 107.07
326 2/1/97 107.28
327 3/1/97 104.62
328 4/1/97 99.55
329 5/1/97 100.10
330 6/1/97 67.99
331 7/1/97 56.83
332 8/1/97 57.13
333 9/1/97 54.10
334 10/1/97 51.65
335 11/1/97 48.34
336 12/1/97 50.31
337 1/1/98 45.93
338 2/1/98 49.53
339 3/1/98 52.13
340 4/1/98 52.99
341 5/1/98 49.28
342 6/1/98 44.91
343 7/1/98 45.71
344 8/1/98 36.90
345 9/1/98 34.37
346 10/1/98 34.07
347 11/1/98 41.85
348 12/1/98 33.27
349 1/1/99 34.53
350 2/1/99 35.78
351 3/1/99 34.77
352 4/1/99 37.72
353 5/1/99 43.38
354 6/1/99 42.97
355 7/1/99 45.21
356 8/1/99 45.69
357 9/1/99 43.88
358 10/1/99 43.30
359 11/1/99 42.39
360 12/1/99 39.57
361 1/1/00 44.08
362 2/1/00 39.72
363 3/1/00 35.67
364 4/1/00 37.15
365 5/1/00 37.96
366 6/1/00 39.50
367 7/1/00 45.19
368 8/1/00 49.39
369 9/1/00 59.30
370 10/1/00 60.64
371 11/1/00 65.89
372 12/1/00 66.58
373 1/1/01 59.10
374 2/1/01 59.57
375 3/1/01 58.12
376 4/1/01 58.92
377 5/1/01 65.43
378 6/1/01 62.43
379 7/1/01 55.86
380 8/1/01 54.98
381 9/1/01 38.18
382 10/1/01 34.97
383 11/1/01 34.68
384 12/1/01 37.25
385 1/1/02 39.69
386 2/1/02 43.17
387 3/1/02 48.02
388 4/1/02 46.45
389 5/1/02 44.37
390 6/1/02 42.91
391 7/1/02 42.01
392 8/1/02 38.55
393 9/1/02 36.20
394 10/1/02 31.32
395 11/1/02 32.19
396 12/1/02 32.66
397 1/1/03 32.83
398 2/1/03 29.74
399 3/1/03 26.61
400 4/1/03 27.01
401 5/1/03 29.03
402 6/1/03 34.40
403 7/1/03 33.52
404 8/1/03 33.58
405 9/1/03 35.85
406 10/1/03 36.58
407 11/1/03 38.84
408 12/1/03 39.98
409 1/1/04 42.64
410 2/1/04 43.75
411 3/1/04 40.70
412 4/1/04 42.15
413 5/1/04 43.59
414 6/1/04 48.85
415 7/1/04 49.13
416 8/1/04 50.54
417 9/1/04 53.36
418 10/1/04 50.40
419 11/1/04 52.95
420 12/1/04 53.34
421 1/1/05 50.67
422 2/1/05 53.22
423 3/1/05 57.21
424 4/1/05 58.56
425 5/1/05 61.01
426 6/1/05 63.79
427 7/1/05 65.41
428 8/1/05 66.73
429 9/1/05 64.88
430 10/1/05 66.89
431 11/1/05 66.82
432 12/1/05 70.47
433 1/1/06 68.88
434 2/1/06 72.30
435 3/1/06 76.00
436 4/1/06 82.43
437 5/1/06 85.46
438 6/1/06 82.86
439 7/1/06 80.30
440 8/1/06 77.13
441 9/1/06 75.90
442 10/1/06 82.01
443 11/1/06 86.01
444 12/1/06 89.87
445 1/1/07 87.86
446 2/1/07 90.05
447 3/1/07 89.50
448 4/1/07 91.83
449 5/1/07 95.41
450 6/1/07 97.58
451 7/1/07 101.85
452 8/1/07 99.26
453 9/1/07 99.32
454 10/1/07 98.91
455 11/1/07 93.35
456 12/1/07 89.67
457 1/1/08 80.82
458 2/1/08 83.08
459 3/1/08 76.26
460 4/1/08 78.72
461 5/1/08 84.42
462 6/1/08 74.70
463 7/1/08 65.04
464 8/1/08 64.33
465 9/1/08 60.94
466 10/1/08 47.60
467 11/1/08 43.69
468 12/1/08 40.47
469 1/1/09 42.99
470 2/1/09 38.95
471 3/1/09 33.24
472 4/1/09 37.53
473 5/1/09 43.56
474 6/1/09 47.97
475 7/1/09 41.48
476 8/1/09 45.99
477 9/1/09 51.36
478 10/1/09 51.16
479 11/1/09 50.70
480 12/1/09 55.03
在這個案例,我們將看看這些公司的股票動態如何隨著時間的推移而發生變化。
§ 1.1 Our five datasets all have the same number of observations. How many observations are there in each data set?
#用nrow顯示資料有幾列
nrow(IBM) [1] 480
nrow(GE)[1] 480
nrow(ProcterGamble)[1] 480
nrow(CocaCola)[1] 480
nrow(Boeing)[1] 480
#ANS:480§ 1.2 What is the earliest year in our datasets?
#整理時間格式
IBM$Date = as.Date(IBM$Date, format = "%m/%d/%y")
GE$Date = as.Date(GE$Date, format = "%m/%d/%y")
ProcterGamble$Date = as.Date(ProcterGamble$Date, format = "%m/%d/%y")
CocaCola$Date = as.Date(CocaCola$Date, format = "%m/%d/%y")
Boeing$Date = as.Date(Boeing$Date, format = "%m/%d/%y")
#查看每個資料框的最早時間(在已知資料按時間排序的情況下)
IBM$Date[1][1] "1970-01-01"
GE$Date[1][1] "1970-01-01"
ProcterGamble$Date[1][1] "1970-01-01"
CocaCola$Date[1][1] "1970-01-01"
Boeing$Date[1][1] "1970-01-01"
#ANS:1970§ 1.3 What is the latest year in our datasets?
#查看每個資料框的最晚時間(在已知資料按時間排序的情況下)
IBM$Date[480][1] "2009-12-01"
GE$Date[480][1] "2009-12-01"
ProcterGamble$Date[480][1] "2009-12-01"
CocaCola$Date[480][1] "2009-12-01"
Boeing$Date[480][1] "2009-12-01"
#ANS:2009§ 1.4 What is the mean stock price of IBM over this time period?
#計算IBM1997年到2009年的平均股價
mean(IBM$StockPrice)[1] 144.4
#ANS:144.4§ 1.5 What is the minimum stock price of General Electric (GE) over this time period?
#計算GE1997年到2009年的最低股價
min(GE$StockPrice)[1] 9.294
#ANS:9.294§ 1.6 What is the maximum stock price of Coca-Cola over this time period?
#計算CocaCola1997年到2009年的最高股價
max(CocaCola$StockPrice)[1] 146.6
#ANS:146.6§ 1.7 What is the median stock price of Boeing over this time period?
#計算Boeing1997年到2009年的股價中位數
median(Boeing$StockPrice)[1] 44.88
#ANS:44.88§ 1.8 What is the standard deviation of the stock price of Procter & Gamble over this time period?
#計算P&G1997年到2009年的股價標準差
sd(ProcterGamble$StockPrice)[1] 18.19
#ANS:18.19§ 2.1 Around what year did Coca-Cola has its highest stock price in this time period? Around what year did Coca-Cola has its lowest stock price in this time period?
#找出CocaCola股價最高及最低的日期
CocaCola$Date[which.max(CocaCola$StockPrice)][1] "1973-01-01"
#1973/01/01最高
CocaCola$Date[which.min(CocaCola$StockPrice)][1] "1980-03-01"
#1980/03/01最低
#ANS:擁有最高股價年分:1973 / 擁有最低股價年分:1980§ 2.2 In March of 2000, the technology bubble burst, and a stock market crash occurred. According to this plot, which company’s stock dropped more?
#以plot繪製CocaCola折線圖
plot(CocaCola$Date, CocaCola$StockPrice, xlab="Year", ylab="Stock price", type="l", col="Blue")
#用lines加入P&G共同比較
lines(ProcterGamble$Date, ProcterGamble$StockPrice, col="Red")
#加入直線標示時間點
abline(v=as.Date(c("2000-03-01")), lwd=1)#ANS:ProcterGamble dropped more § 2.3 (a) Around 1983, the stock for one of these companies (Coca-Cola or Procter and Gamble) was going up, while the other was going down. Which one was going up?
#以plot繪製CocaCola折線圖
plot(CocaCola$Date, CocaCola$StockPrice, xlab = "Year", ylab = "Stock price", type = "l", col = "Blue")
#用lines加入P&G共同比較
lines(ProcterGamble$Date, ProcterGamble$StockPrice, col="Red")
#加入直線標示時間點
abline(v=as.Date(c("1983-01-01")), lwd=2)#也可直接透過數值計算
CocaCola$Date[168][1] "1983-12-01"
CocaCola$Date[157][1] "1983-01-01"
ProcterGamble$Date[168][1] "1983-12-01"
ProcterGamble$Date[157][1] "1983-01-01"
CocaCola$StockPrice[168]-CocaCola$StockPrice[157][1] 6.048
ProcterGamble$StockPrice[168]-ProcterGamble$StockPrice[157][1] -54.23
#ANS:Going up:CocaCola / Going down:ProcterGamble#
#
#根據上兩題的折線圖所示,P&G明顯高於CocaCola
#運用平均數證實
mean(ProcterGamble$StockPrice)>mean(CocaCola$StockPrice)[1] TRUE
#ANS:P&G§ 3.1 Which stock fell the most right after the technology bubble burst in March 2000?
#以plot繪製IBM折線圖
plot(IBM$Date, IBM$StockPrice, xlab="Year", ylab="Stock price", type="l", col="Red")
#用lines加入其他幾支股票共同比較
lines(GE$Date, GE$StockPrice, col="Orange")
lines(CocaCola$Date, CocaCola$StockPrice, col="Blue")
lines(ProcterGamble$Date, ProcterGamble$StockPrice, col="Green")
lines(Boeing$Date, Boeing$StockPrice, col="Yellow")
#用abline標示時間點
abline(v=as.Date(c("2000-03-01")), lwd=1)#ANS:GE§ 3.2 Which stock reaches the highest value in the time period 1995-2005?
#依據3.1的折線圖所示,紅線達到最高值
#ANS:IBM§ 3.3 In October of 1997, there was a global stock market crash that was caused by an economic crisis in Asia. Comparing September 1997 to November 1997, which companies saw a decreasing trend in their stock price? (Select all that apply.)
#以plot繪製IBM折線圖
#1997/09/01為第333個觀察值,1997/11/01為第335個觀察值
plot(IBM$Date[333:335], IBM$StockPrice[333:335], xlab="Year", ylab="Stock price", type="l", col="Red", ylim = c(0,200))
#用lines加入其他幾支股票共同比較
lines(GE$Date[333:335], GE$StockPrice[333:335], col="Orange")
lines(CocaCola$Date[333:335], CocaCola$StockPrice[333:335], col="Blue")
lines(ProcterGamble$Date[333:335], ProcterGamble$StockPrice[333:335], col="Green")
lines(Boeing$Date[333:335], Boeing$StockPrice[333:335], col="Yellow")#或是用減法
Boeing$StockPrice[335]>Boeing$StockPrice[333][1] FALSE
CocaCola$StockPrice[335]>CocaCola$StockPrice[333][1] TRUE
GE$StockPrice[335]>GE$StockPrice[333][1] TRUE
IBM$StockPrice[335]>IBM$StockPrice[333][1] TRUE
ProcterGamble$StockPrice[335]>ProcterGamble$StockPrice[333][1] FALSE
#ANS:P&G, Boeing§ 3.4 In the last two years of this time period (2004 and 2005) which stock seems to be performing the best, in terms of increasing stock price?
#以plot繪製IBM折線圖
#2004/01/01為第409個觀察值,2005/12/01為第432個觀察值
plot(IBM$Date[409:432], IBM$StockPrice[409:432], xlab="Year", ylab="Stock price", type="l", col="Red", ylim = c(0,200))
#用lines加入其他幾支股票共同比較
lines(GE$Date[409:432], GE$StockPrice[409:432], col="Orange")
lines(CocaCola$Date[409:432], CocaCola$StockPrice[409:432], col="Blue")
lines(ProcterGamble$Date[409:432], ProcterGamble$StockPrice[409:432], col="Green")
lines(Boeing$Date[409:432], Boeing$StockPrice[409:432], col="Yellow")#或是用減法
IBM$StockPrice[432]-IBM$StockPrice[409][1] -9.825
GE$StockPrice[432]-GE$StockPrice[409][1] 2.918
CocaCola$StockPrice[432]-CocaCola$StockPrice[409][1] -8.263
ProcterGamble$StockPrice[432]-ProcterGamble$StockPrice[409][1] -41.24
Boeing$StockPrice[432]-Boeing$StockPrice[409][1] 27.84
#ANS:Boeing§ 4.1 For IBM, compare the monthly averages to the overall average stock price. In which months has IBM historically had a higher stock price (on average)? Select all that apply.
#比較IBM單月平均股價與總平均股價,哪個比較高
tapply(IBM$StockPrice,months(IBM$Date),mean) %>%sort(decreasing = TRUE)>mean(IBM$StockPrice) February March April May January December August June September
TRUE TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE
July November October
FALSE FALSE FALSE
tapply(IBM$StockPrice,months(IBM$Date),mean) %>%sort(decreasing = TRUE) February March April May January December August June September
152.7 152.4 152.1 151.5 150.2 140.8 140.1 139.1 139.1
July November October
139.1 138.0 137.3
#February,March,April,May,January的平均股價皆大於總平均股價,而February的平均股價是12個月裡最高的§ 4.2 General Electric and Coca-Cola both have their highest average stock price in the same month. Which month is this?
#
tapply(GE$StockPrice,months(GE$Date),mean) %>%sort(decreasing = TRUE) April March February January May December November July August
64.48 63.15 62.52 62.05 60.87 59.10 57.29 56.73 56.50
June September October
56.47 56.24 56.24
tapply(CocaCola$StockPrice,months(CocaCola$Date),mean) %>%sort(decreasing = TRUE) April March May June February January December November July
62.69 62.07 61.44 60.81 60.73 60.37 59.73 59.10 58.98
August October September
58.88 57.94 57.60
#從表上顯示,四月皆為他們平均股價最高的月份§ 4.3 For the months of December and January, every company’s average stock is higher in one month and lower in the other. In which month are the stock prices lower?
#每個公司的股價在1月及12月哪個月份的股價較低
plot(tapply(Boeing$StockPrice, months(Boeing$Date), mean),xlab = "month",ylab = "stock price")plot(tapply(CocaCola$StockPrice, months(CocaCola$Date), mean),xlab = "month",ylab = "stock price")plot(tapply(GE$StockPrice, months(GE$Date), mean),xlab = "month",ylab = "stock price")plot(tapply(IBM$StockPrice, months(IBM$Date), mean),xlab = "month",ylab = "stock price")plot(tapply(ProcterGamble$StockPrice, months(ProcterGamble$Date), mean),xlab = "month",ylab = "stock price")#12月的股價皆較1月低