[R] Cook-distance-type plot (vertical bars)

Thomas Lumley tlumley at u.washington.edu
Thu Aug 28 19:16:18 CEST 2003


On Thu, 28 Aug 2003, Frank Gibbons wrote:

> Hi,
>
> Figure 13 of Emmanuel Paradis's "R for Beginners" was produced by termplot
> working on an aov object.

No, it was produced by plot() working on a aov object, as its caption
indicates.  The termplot() is Figure 14.

>		 The lower right-hand plot is labelled "Cook's
> distance plot", and I'd really like to produce a similar type of figure,
> but in a totally different context. (I'm not even sure what this kind of
> figure is called, perhaps an "impulse plot", where instead of a point at
> (x,y), there's a vertical bar running from the x-axis up to where the point
> would be).

It's called a high-density plot, and you get it by specifying type="h" in
a plot() command.  It's mentioned on page 31 of `R for beginners'

It is in the code for plot.lm, where you say you also looked: the cook's
distance plot is created with
    plot(cook, type = "h", ylim = c(0, ymx), main = main,
         xlab = "Obs. number", ylab = "Cook's distance", ...)


	-thomas




More information about the R-help mailing list