Interactive demo · Statistical Learning: Theory and Methods · Chapter 6

Local logistic regression: prevalence of heart disease

For each target value x0 of a risk factor, the subjects get tri-cube weights Ki from a nearest-neighbour window, and a logistic model with logit β0 + β1(x − x0) is fitted by maximising the weighted log-likelihood ∑ Ki [yiηi − log(1 + eηi)]; the fitted prevalence at x0 is 1/(1 + e−β̂0). Dropping the slope gives the local constant fit, which is just the kernel-weighted proportion of cases. Move x0 to see the local model that produces each point of the curve, on the probability scale (top) and on the logit scale (bottom).

Risk factor

Local model

Span (fraction of the 462 subjects in the window)

Target x0

Try these

The band is η̂(x) ± one standard error mapped to the probability scale; the standard error is the sandwich A−1BA−1 of the weighted likelihood. The kernel density classifier uses Gaussian kernels with Silverman's bandwidth in each class and the class proportions as priors. Ticks at the top are cases (CHD), at the bottom controls.

In the lecture notes