1. We tested how strongly aquatic macroinvertebrate taxa richness and composition were associated with natural variation in both flow regime and stream temperatures across streams of the western United States.
2. We used long‐term flow records from 543 minimally impacted gauged streams to quantify 12 streamflow variables thought to be ecologically important. A principal component analysis reduced the dimensionality of the data from 12 variables to seven principal component (PC) factors that characterised statistically independent aspects of streamflow: (1) zero flow days, (2) flow magnitude, (3) predictability, (4) flood duration, (5) seasonality, (6) flashiness and (7) base flow. K‐means clustering was used to group streams into 4–8 hydrologically different classes based on these seven factors.
3. We also used empirical models to estimate mean annual, mean summer and mean winter stream temperatures at each stream site. We then used invertebrate data from 63 sites to develop Random Forest models to predict taxa richness and taxon‐specific probabilities of capture at a site from flow and temperature. We used the predicted taxon‐specific probabilities of capture to estimate how well predicted assemblages matched observed assemblages as measured by RIVPACS‐type observed/expected (O/E) indices and Bray–Curtis dissimilarities.
4. Macroinvertebrate taxon richness was only weakly associated with streamflow and temperature variables, implying that other factors more strongly influenced taxa richness.
5. In contrast to taxa richness, taxa composition was strongly associated with streamflow and temperature. Predictions of taxa composition (O/E and Bray–Curtis) were most precise when both temperature and streamflow PC factors were used, although predictions based on either streamflow PC factors or temperature alone were also better than null model predictions. Of the seven aspects of the streamflow regime we examined, variation in baseflow conditions appeared to be most directly associated with invertebrate biotic composition. We were also able to predict assemblage composition from the conditional probabilities of hydrological class membership nearly as well as Random Forests models that were based directly on continuous PC factors.
6. Our results have direct implication for understanding the relative importance of streamflow and temperature in regulating the structure and composition of stream assemblages and for improving the accuracy and precision of biological assessments.