Convert Code 6.6 into an S-PLUS function that makes an array of plots (like
that of Figure 6.17) of the input returns series, overlays the LS and robust
regression lines, and places the legend and annotations automatically. Then
run the function on a few of the stock returns in each of the time series data
sets microcap.ts, smallcap.ts, midcap.ts, largecap.ts.
You might want to do this with a for loop as in Problem 1, in which case
you can do it for all twenty stock returns in each of the market-cap groups.
(Alternatively, the Trellis graphics functions in S-Plus, if you are familiar
with them, provide a clean way to do this.) For which stock returns do the
least squares and robust betas differ significantly because of the presence of
outliers?