Jackknife with regression
A second alternative to alternating confidence intervals on regression parameters is to jackknife the data. Each point in the data set is left out, one at a time, and the parameter of interest is re-estimated. The regdat dataframe has length(response) data points:
names(regdat) [1] "explanatory" "response" length(response) [1] 35
We create a vector to contain the 35 different estimates of the slope:
jack.reg<-numeric(35)
Now carry out the regression 35 times, leaving out a different x, y pair in each case:
for (i in 1:35) { model<-lm(response[-i]~explanatory[-i]) jack.reg[i]<-coef(model)[2] }
Here is a histogram of the different estimates of the slope of the regression:
hist(jack.reg)

As you can see, the distribution is strongly skew to the left. The jackknife draws attention to one particularly influential point (the extreme left-hand bar) which, when omitted from the dataframe, causes the estimated slope to fall below 1.0. We say the point is influential because it is the only one of the 35 points whose omission causes the estimated slope to fall below 1.0. To see what is going on we should plot the data:
plot(explanatory,response)
We need to find out the identity of this influential point:
which(explanatory>15) [1] 22
Now we can draw regression lines for the full data set (solid line) and for the model with the influential point number 22 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access