Signals of species interactions can be inferred from survey data by asking if some species occur more or less often together than what would be expected by random, or more generally, if any structural aspect of the community deviates from that expected from a set of independent species. However, a positive (or negative) association between two species does not necessarily signify a direct or indirect interaction, as it can result simply from the species having similar (or dissimilar) habitat requirements. We show how these two factors can be separated by multivariate logistic regression, with the regression part accounting for species-specific habitat requirements, and a correlation matrix for the positive or negative residual associations. We parameterize the model using Bayesian inference with data on 22 species of wood-decaying fungi acquired in 14 dissimilar forest sites. Our analyses reveal that some of the species commonly found to occur together in the same logs are likely to do so merely by similar habitat requirements, whereas other species combinations are systematically either over- or underrepresented also or only after accounting for the habitat requirements. We use our results to derive hypotheses on species interactions that can be tested in future experimental work.