문제

I've plot this graphic to identify graphically high-leverage points in my linear model. enter image description here

Given the variable "NOMBRES" of the data set which my model uses, I've tried to plot all the points of my graphic but it gets illegible. Here's the code I ran:

> plot(hatvalues(tmodel),residuals(tmodel))
> text(hatvalues(tmodel),residuals(tmodel),labels=DSET$NOMBRES)

So I would like to plot just the points with leverage(hat value) above 0.05 using the label "DSET$NOMBRES".

도움이 되었습니까?

해결책

Identify high-leverage points according to your definition:

hlev <- which(hatvalues(tmodel)>0.05)

Add numeric labels to the graph:

text(hatvalues(tmodel)[hlev], residuals(tmodel)[hlev], 
   labels=DSET$NOMBRES[hlev])
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top