Benthic macroinvertebrates have been used widely as bioindicators to assess the condition of riverine ecosystems. However, understanding and modelling the spatial distribution of benthic macroinvertebrates within these ecosystems remain significant challenges for research and management. Statistical analyses of multivariate data sets offer opportunities to explore the ecological systems controlling the distribution of biota. This article reports a novel statistical analysis of a national-scale data set from England and Wales using the structural equation modelling (SEM) framework. Relationships between water quality, physical habitat structure and indices reflecting benthic macroinvertebrate community structure were analysed using SEM. On the basis of data from 219 monitoring sites, structural equation models were built. These models explained 87% of the spatial variation in the average score per taxon index and 76% of the spatial variation in the Lotic Invertebrate Index for Flow Evaluation. Significant direct and indirect effects on these indices were exerted by water quality variables, particularly the concentrations of dissolved oxygen, biochemical oxygen demand and orthophosphate. Independent of water quality conditions, both biotic indices were directly affected by variables describing the structure and the degradation of physical habitat. The strengths of the SEM framework include (i) direct evaluation of a priori models against observed data, thereby supporting confirmatory analysis of theoretical models of ecological systems; (ii) specification of latent variables representing unmeasured constructs; and (iii) simultaneous assessment of multiple direct and indirect paths between variables within a model. These strengths define a framework with the potential to be applied widely in the development and testing of hypotheses regarding the processes operating within riverine ecosystems.