我想知道如何在线性回归残差图表上绘制的点上添加更多行数。例如,有没有办法将点数添加到前5%的先例中?或者我可以使用图形位置标记特定行? 我添加了一个玩具数据框并制作了一个模型(如何在回归诊断图表(蓝线形状)中绘制行数到点或图表的区域?:
df <- read.table(text = "userid target birds wolfs
222 1 9 7
444 1 8 4
234 0 2 8
543 1 2 3
678 1 8 3
987 0 1 2
294 1 7 16
608 0 1 5
123 1 17 7
321 1 8 7
226 0 2 7
556 0 20 3
334 1 6 3
225 0 1 1
999 0 3 11
987 0 30 1 ",header = TRUE)
lm<-lm(target~birds+wolfs,data=df)
par(mfrow=c(2,2))
plot(lm)