Graphical Tests of the Fit of the Logistic to Data
The logistic plots above are all well and good, but it is very difficult to know how good the fit of the model is when the data are shown only as 0s or 1s. Some people have argued for putting histograms instead of rugs on the top and bottom axes, but there are issues here about the arbitrary location of the bins (see p. 162). Rugs are a one-dimensional addition to the bottom (or top) of the plot showing the locations of the data points along the x axis. The idea is to indicate the extent to which the values are clustered at certain values of the explanatory variable, rather than evenly spaced out along it. If there are many values at the same value of x, it will be useful to use the jitter function to spread them out (by randomly selected small distances from x).
A different tack is to cut the data into a number of sectors and plot empirical probabilities (ideally with their standard errors) as a guide to the fit of the logistic curve, but this, too, can be criticized on the arbitrariness of the boundaries to do the cutting, coupled with the fact that there are often too few data points to give acceptable precision to the empirical probabilities and standard errors in any given group.
For what it is worth, here is an example of this approach: the response is occupation of territories and the explanatory variable is resource availability in each territory:
occupy<-read.table("c:\\temp\\occupation.txt",header=T) attach(occupy)
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