Summary We propose a method to test for significant differences in the levels of clustering between two spatial point processes (cases and controls) while taking into account differences in their first-order intensities. The key advance on earlier methods is that the controls are not assumed to be a Poisson process. Inference and diagnostics are based around the inhomogeneous K-function with confidence envelopes obtained from either resampling events in a nonparametric bootstrap approach, or simulating new events as in a parametric bootstrap. Methods developed are demonstrated using the locations of adult and juvenile trees in a tropical forest. A simulation study briefly examines the accuracy and power of the inferential procedures.