Understanding how ecological communities function is a central problem in the science of ecology. A first step to understanding how communities function is explaining why they contain the species that they do. The two principle forces determining the composition of communities are the environment and the interactions among species. Environmental conditions often limit the composition of communities to only those species that can tolerate the environment. For example, lakes with low pH contain only fish species that can tolerate acidic conditions. Interactions among species affect community composition, because some species exclude other species from communities. For example, the presence of a predatory fish might exclude another fish species that is particularly vulnerable to predation. The proposed research will investigate the composition of communities using statistical methods that incorporate information about the evolutionary (= phylogenetic) relatedness among species. The reason for using phylogenetic information is that ecologists often do not know what environmental factors or what interactions with other species drive community composition. Because closely related species share many of the same characteristics that determine their environmental tolerances and vulnerability to interactions with other species, phylogenetic information can be used to identify which environmental factors and which interactions among species are most important in structuring communities. The broader impacts of this work include training undergraduate and graduate students at the interface between mathematics and biology to develop and apply new statistical techniques, and to develop user-friendly statistical tools and a network of collaborators to investigate the composition and function of ecosystems.