Toni Toni - 11 months ago 50
R Question

Overlapping numerical values on Cook's distance plot in R

I want to identify a couple of points with high leverage on the plot below, but unfortunately, their row number is illegible, because there must be a couple of such points, and their id is printed out one on top of the other. They are all the way to the right of the plot:

enter image description here

How can the print out of these labels on the plot be resized and spread out so that they can be legible?

Answer Source

The easiest way to find the cooks distance is the built in function:

LM = lm(speed ~ dist, cars)

You can pick out whatever values you want:

> which(cooks.distance(LM) > 0.05)
 1  2 23 35 39 49 
 1  2 23 35 39 49