Null model tests for niche conservatism, phylogenetic assortment and habitat filtering


Correspondence author. E-mail:


1. Phylogenetic and trait analyses are powerful tools for disentangling the mechanisms underlying the structure of plant and animal communities, and their use has become prominent in the last decade. However, few studies have simultaneously incorporated data on species traits or phylogeny, environment, and species co-occurrences. Therefore, the relative importance of these factors as drivers of community assembly is largely unknown.

2. We introduce new and conceptually simple null model tests and appropriate metrics to disentangle the relationships between species co-occurrence, traits or phylogeny and environmental factors not covered by available packages for phylogenetic analysis. We illustrate the methods with an extensive data set on understory plant assemblages sampled in three Polish forests.

3. Benchmark testing indicates that the proposed methods have good error behaviour when tested against a variety of artificial matrix sets covering a wide range of observed patterns. Test results are largely independent of matrix size and matrix fill and have adequate power to detect even weak patterns of non-randomness. The different metrics used are uncorrelated with one another and capture different, and often divergent, patterns expressed within the same matrix.

4. Our case study revealed three distinct patterns in forest understory plant assemblages: (i) multiple patterns of species associations within meta-communities might mask the influence of phylogeny and environmental variables on species occurrences, (ii) the strength of environmental and phylogenetic signals depend on the co-occurrence pattern (segregated, aggregated, clumped) and might vary within a single meta-community, and (iii) a random association of phylogeny and species co-occurrence coupled with significant correlations between environmental factors and phylogeny might reveal species with traits that have passed through environmental filtering.


Although Darwin (1859) suggested early on that closely related species may be stronger competitors because of similarities in morphology and resource use, phylogenetic analyses of community structure have become prominent only in the last decade (Webb et al. 2002; Emerson & Gillespie 2008; Cavender-Bares et al. 2009; Pillar & Duarte 2010; Alexandrou et al. 2011). The phylogenetic framework emphasizes the importance of evolutionary and biogeographic constraints, including niche conservatism (reviewed in Wiens & Graham 2005; Losos 2008; Wiens et al. 2010), in controlling the structure of contemporary ecological communities (Emerson & Gillespie 2008; Cavender-Bares et al. 2009). Statistical tests have been developed to identify phylogenetic overdispersion (segregation, evenness), that is, the tendency for related species to co-occur less often than expected by chance, and phylogenetic underdispersion (clustering, aggregation), that is, a trend for related species to co-occur more often than expected by chance (Pausas & Verdú 2010).

The environment (habitat) may serve as a filter for species that possess appropriate physiological, ecological or behavioural adaptations to successfully colonize a particular habitat (Wiens & Graham 2005; Losos 2008). In contrast to traditional ecological models of limiting similarity and niche overlap, habitat filtering in combination with niche conservatism predicts that closely related species should co-occur more often than expected by chance in similar environments (Losos 2008; but see Mayfield & Levine 2010). As noted long ago by Williams (1947), the relative strengths of competitive segregation and habitat filtering will determine whether closely related species co-occur more or less often than expected by chance.

Statistical tests for the detection of niche conservatism rely on parametric least-squares models (Blomberg, Garland & Ives 2003; Cattin et al. 2004), fourth corner statistics (Dray & Legendre 2008), eigenvector analysis (Pavoine et al. 2011; Diniz-Filho et al. 2012), or variance partitioning combined with phylogenetic or trait distance metrics (Webb et al. 2002; Freckleton & Jetz 2009; Kooyman et al. 2011). Recent mechanistic simulation models (Gotelli et al. 2009) and null model randomizations (Hardy 2008; Pillar & Duarte 2010) have also been proposed to test for phylogenetic patterns. However, despite the ‘jungle of methods’ available for community phylogenetics (Pausas & Verdú 2010), few studies have simultaneously incorporated data on phylogeny, environment and species co-occurrences when assessing patterns of community assembly (cf. Ives & Helmus 2011; Baraloto et al. 2012).

Cavender-Bares et al. (2004) correlated phylogenetic distances between species pairs with trait similarity and pairwise values of niche overlap to show that Quercus species were phylogenetically overdispersed along a moisture gradient. Helmus et al. (2007) extended the method of Ives, Midford & Garland (2007) to show how the error terms of logistic regression models of species occurrence can be used to identify phylogenetic effects and to link phylogeny and environmental variables. Recently, Ives & Helmus (2011) used phylogenetic generalized linear mixed models to partition patterns of species occurrences into phylogenetic and environmental signals. These and previous methods use metrics (such as the average phylogenetic distance) that summarize patterns measured for a presence–absence matrix as a whole. However, recent analyses (Gotelli & Ulrich 2012; Ulrich & Gotelli 2012) have demonstrated that such matrices may exhibit very different and even contrasting internal patterns. For example, in the analysis of species co-occurrences, certain species pairs may be aggregated, others may be segregated, and still others may be random within the same matrix (Ulrich & Gotelli, 2010). These pairwise patterns cannot be easily teased apart with metrics that describe average patterns across all species pairs. Thus, an approach that dissects the matrix to focus on specific internal structures might be more suited to infer phylogenetic and environmental signals than approaches based on averaged matrix structures.

In this article, we introduce a general methodology to simultaneously link different patterns of species co-occurrence (within ecological species × sites matrices) to phylogeny and environmental factors. We provide new and conceptually simple null model tests and appropriate metrics to disentangle the relationships among three primary data structures: an × m matrix of pairwise phylogenetic distances among a set of m species, a × n matrix of k environmental variables measured at n sampled sites and an × n matrix of the presence or absence of each of the m species recorded in each of the n samples. We illustrate the methods with an extensive data set on understory plant assemblages gathered in Polish forests (M. Piwczyński et al., unpublished), which allows us to demonstrate how the proposed methods can (i) tease apart different types of co-occurrence patterns and (ii) relate them to phylogeny and environmental conditions.


Species Occurrences as a Link Between Phylogeny and Environment

The phylogenetic input matrix for our analyses is a symmetric × m matrix (Cphyl) that contains estimates of phylogenetic distance or other measures of genetic or phenotypic distance between all possible pairs of species in the meta-community (Pausas & Verdú 2010; de Vienne, Aquileta & Ollier 2011). We then relate phylogeny directly to patterns of pair-wise species co-occurrences and use randomizations of species occurrences among different sites to compare observed and expected phylogenetic distances across co-occurring species within a meta-community.

To relate phylogeny to species occurrences and environmental conditions, we need two additional input matrices: a × n matrix containing measures of k environmental variables at each of n sampled sites (Venv) and a standard × n presence–absence matrix of the occurrences of the m species at the n sites (Mocc). Recent studies have tried to identify the influences of phylogeny and environment on community structure by analysing separately traces of phylogenetic history and the effects of environmental conditions (Kluge & Kessler 2011) or by using approaches that quantify the impact of environmental variables on species presences as an input in the phylogenetic analysis (Helmus et al. 2007, 2010). In such analyses, species occurrences are potentially linked to phylogenetic distances of other species (contained in Cphyl) or environmental variables associated to each site (contained in Venv). However, we might also interpret observed occurrences as a direct link between phylogeny and environment (Fig. 1). If phylogenetic history explains part of the way species interact and environmental forces influence species assembly, patterns in the Cphyl and Venv matrices should be correlated when filtered according to certain predefined substructures in the Mocc matrix. In the simplest case, we focus on joint species co-occurrences to link these matrices (Fig. 1).

Figure 1.

 A graphical representation of the relationships between species co-occurrence patterns, phylogenetic distance and environment. Phylogenetic distance (associated pairs in bold) and environmental distance are linked through three different types of co-occurrences (checkerboard, togetherness and clumping), each of which is represented by a distinct 2 × 2 submatrix structure. Phylogenetic assortment and habitat filtering link phylogenetic history to species co-occurrence. Niche conservatism is revealed when phylogenetically closely related species tend to have similar habitat requirements and thus occur in similar habitats.

For a presence–absence matrix with m rows and n columns, there are a total of mn(− 1)(− 1)/4 unique submatrices that can be constructed. Our approach takes advantage of the fact that even a moderately sized presence–absence matrix potentially contains thousands or even millions of 2 × 2 submatrices that can be organized into simple binary patterns. Multiple occurrences of these binary patterns can then be related to phylogenetic differences between pairs of species and environmental differences between pairs of sites for a more powerful set of tests. Although the submatrices are not necessarily independent of one another, the same dependence structure is present in the simulated null matrices, which should safeguard against the detection of spurious patterns in the real data. As in previous frameworks (cf. Wiens & Graham 2005; Emerson & Gillespie 2008; Losos 2008; Pillar & Duarte 2010), large and small phylogenetic distances of co-occurring species (Δphyl) indicate phylogenetic overdispersion and underdispersion, respectively, regardless of environmental conditions (Fig. 2). Similarly, large and small differences between two sites in a certain environmental variable (Δenv) indicate environmental overdispersion and underdispersion (habitat filtering), respectively, irrespective of phylogenetic relatedness (Fig. 2).

Figure 2.

 Guidelines to interpret the relationships between environmental conditions, phylogeny and patterns of co-occurrence according to the methodology introduced. The metrics CΔenv, CΔphyl (clumping), HΔenv, HΔphyl (checkerboard) and TΔenv, TΔphyl (togetherness) are defined as the average Euclidean difference of all pairwise distances between species (Δphyl) and differences in habitat properties (Δenv). RCΔenvΔphyl (clumping), RHΔenvΔphyl (checkerboard) and RTΔenvΔphyl (togetherness) are defined as the Pearson coefficient of the correlation between all the clumped, checkerboard and togetherness submatrices present in the species × sites matrix (Mocc), and Δenv and Δphyl (see main text for details). Positive and negative effects refer to comparisons of the observed scores to respective null model expectations and provide evidence of the following processes: EO, environmental overdispersion; EU, environmental underdispersion; NC, niche conservatism, ND, niche divergence; PO, phylogenetic overdispersion; PU, phylogenetic underdispersion.

Our approach quantifies these patterns for multiple units of 2 × 2 submatrices within a single presence–absence matrix and allows us to link Δenv and Δphyl directly. First, we use clumped 2 × 2 submatrices of the form {{1,1},{1,1}} as a metric of species aggregation across sites (Ulrich & Gotelli 2012). Each clumped submatrix represents one pair of species that co-occurs at one pair of sites. This structure can be used to link the phylogenetic distances between the species (contained in Cphyl) with the environmental distances between the sites (calculated from Venv). A positive correlation between Δenv and Δphyl (RΔenvΔphyl) indicates joint occurrences of phylogenetically closely related species in similar habitats and joint occurrences of phylogenetically distant species in dissimilar habitats. If this joint occurrence is caused by similar ecological requirements, it would suggest the existence of niche conservatism (Fig. 2). In contrast, a negative correlation between environmental differences among sites and phylogenetic distances between species of clumped occurrence would show that phylogenetically distant species co-occur in ecologically similar habitats.

Complementary to a clumped submatrix is a checkerboard pattern (Fig. 1) formed by submatrices of the form {{1,0},{0,1}}. As with clumping, we can use the checkerboard pattern to link phylogeny and habitat properties across multiple submatrices. Complementary to the interpretation of clumped submatrices, a small phylogenetic distance between the two species in a checkerboard submatrix indicates phylogenetic overdispersion (Fig. 2), and a large phylogenetic distance indicates phylogenetic underdispersion. For a checkerboard submatrix, large differences in environmental characteristics would indicate that species pairs that do not co-occur are found in sites that differ environmentally. This result would point to habitat filtering, because co-occurring species would presumably be found on sites with similar environmental characteristics. Alternatively, if environmental differences between sites in a checkerboard submatrix are small, then the pair of species is spatially segregated between a pair of environmentally similar sites. For checkerboard submatrices, a positive correlation between environmental and phylogenetic distances implies that phylogenetically distant species pairs are segregated across environmentally different sites (Fig. 2).

In addition to clumped and checkerboard submatrices, a third submatrix structure is togetherness. Stone & Roberts (1992) used togetherness submatrices of the form {{1,0},{1,0}as a measure of species pairs with similar habitat requirements, because the two focal species co-occur at one site and jointly avoid another site (Fig. 1). For togetherness submatrices, positive RΔenvΔphyl (togetherness) correlations indicate that phylogenetically related species have identical patterns of occurrences in environmentally similar and dissimilar sites. Negative RΔenvΔphyl (togetherness) correlations indicate that phylogenetically related species have identical patterns of occurrences in environmentally dissimilar sites. Two other possible submatrix structures are {{0,0},{0,0}} and {{1,1},{0,0}}, but we do not use this in our analyses because they lack occurrence information of at least one species.

Correlations between Cphyl and Venv for clumped, checkerboard and togetherness submatrices in a Mocc matrix jointly describe evolutionary and environmental influences on patterns of species aggregation and segregation, and potentially allow us to tease apart the interactions of these factors. Although the clumping, checkerboard and togetherness submatrices are linked by the internal structure of Mocc (Stone & Roberts 1990), each of these structures defines a somewhat different aspect of community assembly (Ulrich & Gotelli 2012).

Metric Definition and Statistical Inference

We define the metrics CΔenv, CΔphyl (clumping), HΔenv, HΔphyl (checkerboard) and TΔenv, TΔphyl (togetherness) as the average Euclidean distance in phylogeny between all species pairs k and l, and environmental characteristics between all pairs of sites i and j, calculated for all of the unique submatrices of each type (clumped, checkerboard or togetherness) within Mocc

image(eqn 1)
image(eqn 2)
image(eqn 3)
image(eqn 4)
image(eqn 5)
image(eqn 6)

where N is the number of clumped submatrices in Mocc, M is the number of checkerboard submatrices, and L is the number of togetherness submatrices.

We further define for each of the Mocc matrix patterns (checkerboard, clumping and togetherness) the metrics RCΔenvΔphyl (clumping), RHΔenvΔphyl (checkerboard) and RTΔenvΔphyl (togetherness) as the Pearson coefficient of correlation between all N, M and L Δenv and Δphyl that occur in Mocc. These nine metrics (six averages and three correlations) encompass the major patterns of association between phylogeny, environment and species co-occurrences. The electronic Appendix S1 contains a worked example of all the necessary calculations.

We tested for the statistical significance of these metrics using a null model approach. Observed scores of each metric were compared to the distribution of scores obtained from a randomization of the Mocc matrix. We used the fixed–fixed (FF) null model (10 × n × m swaps for each randomized matrix), in which the row and column totals of the original presence–absence matrix are maintained. This model preserves observed heterogeneity in species occurrences and site species richness and performed well in benchmark tests of null model performance (Gotelli 2000; Gotelli & Ulrich 2012).

Statistical significances came from the respective tail distributions of 1000 randomized matrices at the two-sided 5% and 1% error level. Additionally, we calculated standardized effect sizes (SES) as Z-transformed scores (Z = Obs − Exp)/StDevExp; where Obs and Exp are observed and expected scores and StDevExp is the standard deviation of expectation. SES scores should have values below −1·96 and above +1·96 at the two-sided 5% error level under the assumption that the respective null distribution is approximately normal.

Artificial Data for Benchmark Testing

In line with the theory of benchmark testing of ecological null and simulation model testing (Hartig et al. 2011; Gotelli & Ulrich 2012), we constructed four sets of 200 artificial matrices each to infer type I and II error rates of our different metric – null model combinations (Table 1).

Table 1.   Species × sites (Mocc), phylogenetic distance (Cphyl) and environmental (Venv) matrix sets used in the present benchmark testing
Matrix type M occ C phyl V env
Random (R)RandomRandomRandom
Segregated occurrences (S)SegregatedRandomRandom
S + exponential phylogenetic distance matrix (E)SegregatedNon-randomRandom
E + exponential environmental variables (V)SegregatedNon-randomNon-random

In the first set of artificial matrices (prefix R), the RMocc matrices were created by assigning individuals randomly to matrix cells, as described in Ulrich & Gotelli (2010). The numbers of columns (=sites) and rows (species) in each matrix were determined by sampling from two random uniform distributions (10 ≤  100 sites and 10 ≤  100 species). Individuals of each species were placed into the cells according to random draws from the two marginal total distributions, a uniform random distribution for sites and a log-normal species – abundances distribution for species (Ulrich & Gotelli 2010) according to:

image(eqn 7)

where xi ∼ N(0,1) and a is a shape-generating parameter for the log-normal distribution of each matrix that is sampled from a continuous uniform distribution (0·03 ≤  0·3). This algorithm generated a wide range of relative abundance distributions with an approximately log-normal shape that are qualitatively similar to empirical relative abundance distributions (Ulrich, Ollik & Ugland 2010). The phylogenetic distance matrix (RCphyl) was simulated from a Brownian motion branching algorithm that generates a random phylogeny for the m species of RMocc evolving by genetic drift or variable selection (Felsenstein 2004). The environmental matrix (RVenv) contained a single environmental variable generated from a uniform random distribution.

In the second set of artificial matrices (prefix S), the SMocc, SCphyl and SVenv matrices were constructed as before. Next, between 1 and 10% (values drawn from a uniform random distribution) of the clumped {{1,1},{1,1}}submatrices of SMocc were transformed into checkerboard submatrices {{1,0},{0,1}}. The SMocc matrices were thus more segregated than expected by chance while the SCphyl and SVenv matrices still were random (Table 1).

In the third set of artificial matrices (prefix E), we linked a non-random phylogenetic structure with a segregated matrix pattern while leaving the environmental matrix uniform random. The EMocc matrices were segregated by the same procedure as were the SMocc matrices. The SCphyl matrices were constructed from a non-random exponential branching process, in which more recently evolved species had lower abundance. In these matrices, phylogenetic distance was negatively correlated with species abundance, but not with the pattern of species co-occurrences.

In the fourth set of artificial matrices (prefix V), we added checkerboard submatrices to the lower right quarter of the ordered occurrence matrices (VMocc) to increase the pattern of species segregation. We also modified the environmental variable matrix (VVenv) in such a way that the values of this variable increased exponentially with site number (as for V2 in Fig. 1). Thus, similar environmental variable expressions were weakly correlated with larger phylogenetic distance in this data set, and both the environmental variable and the phylogenetic distance were weakly to moderately associated with segregated species co-occurrences.

Empirical Case Study

We used phytosociological data from three forest sites within the Cedynia Landscape Park (Poland) to construct three Mocc presence–absence matrices (M. Piwczyński et al., unpublished data). These matrices included 96 plots: 45 plots sampled in a semi-natural oak forest dominated by Quercus petraea (Matt.) Liebl., 21 plots surveyed in a planted Scots pine (Pinus sylvestris L.) forest and 30 plots sampled in a mixed hardwood-deciduous forest. In each plot, the presence and absence of all understory vascular plants was recorded (see M. Piwczyński et al., unpublished data). The oak, pine and mixed forests contained 66, 69 and 115 species, respectively. We constructed the respective Venv matrices for each site using average raw Ellenberg indicator values (Ellenberg et al. 1991) of three important environmental variables (air temperature, soil pH and soil nitrogen) for all species present in each plot. We constructed the phylogenetic trees and the respective Cphyl matrices of phylogenetic distances for all species using the Phylomatic phylogenetic database and toolkit for the assembly of phylogenetic trees (Webb & Donoghue 2005), and the R package ape (Paradis, Claude & Strimmer 2004). Trees generated by this software were based on the APG III (Angiosperm Phylogeny Group, 2009). We used other published molecular phylogenies to resolve the majority of polytomies contained in APG III. Because DNA sequence data were not available for all taxonomic levels of resolution, we assigned branch lengths to the tree with the Branch Length Adjustment (BLADJ) option in Phylocom (Webb, Ackerly & Kembel 2008), using minimum ages for genera and families and higher taxa from the molecular dating of Wikström, Savolainen & Chase (2001). We spaced undated nodes evenly between dated ones. Because Wikström’s dating does not include ferns, we used ages generated by Schuettpelz & Pryer (2009) to assign them to nodes in the phylogeny.

To test for patterns in the Mocc matrices of the oak, pine and mixed forests, we used the C-score (Stone & Roberts 1990), the togetherness index (Stone & Roberts 1992) and the clumping score (Ulrich & Gotelli 2012) to assess matrix wide patterns of segregation (C-score), aggregation (clumping) and habitat similarity (togetherness). Statistical inference was based on the null distributions obtained from 1000 random matrices generated by the FF null model.


All the calculations were made with the Niche software, which is freely available at Niche provides all the above-defined metrics (based on presence–absence and abundance matrices), together with the respective null model options, and allows for the analysis of multiple data sets.


Benchmark Testing

The metrics CΔenv, CΔphyl, HΔenv, HΔphyl, TΔenv, TΔphyl all had low type I error probabilities (around or below 5%) when tested with the random R matrices and the two-sided 95% tail distributions of the FF null model (Table 2). Similar results were obtained for the S and E matrices, which were segregated, but had random associations with phylogeny and environmental characteristics. The correlation-based metrics (RCΔenvΔphyl, RHΔenvΔphyl and RTΔenvΔphyl) had similar good performance with the R, S, and E matrices (Table 2). Matrix size and fill had only weak influence on metric performance and explained at most 2·5% of the variation in test results (Table 3). For the least structured R matrices, the SES of RCΔenvΔphyl and RTΔenvΔphyl were weakly correlated with matrix size. This weak positive correlation was mainly caused by positive values of very large random matrices (species × sites > 5000).

Table 2.   Benchmark testing for statistical error rates of the Δphyl, Δenv and RΔenvΔphyl metrics applied to clumped, checkerboard and togetherness submatrices using 200 random R, S and E matrices and 200 non-random V matrices. Entries are the percentages of significant scores below the lower (LCL) and above the upper (UCL) two-sided 95% confidence limits of the null distribution (obtained from 1000 randomizations each of the species × sites presence–absence matrices according to the fixed–fixed null model). The parametric significance gives the percentage of significant RΔenvΔphyl correlations, according to the two-tailed t-distribution for all submatrix patterns. For comparison, we also present results of standard parametric F-tests for the correlations
 ClumpingC-scoreTogethernessParametric significance
Table 3.   Pearson correlation coefficients between metric scores and both matrix size (species × sites) and matrix fill for the least structured artificial R matrix set (Table 2). *P < 0·05; **P < 0·01
MetricMatrix sizeMatrix fill

The V matrix set was designed to test for Type II error rates and contained weak non-random phylogenetic, environmental and species co-occurrence signals. The phylogeny metrics CΔphyl, HΔphyl and TΔphyl correctly identified between 54% and 80% of the V matrices as being phylogenetically overdispersed (Table 2). The metrics CΔenv, HΔenv and TΔenv correctly identified between 25% (CΔenv) and 74% (TΔenv) of the V matrices as being environmentally underdispersed (Table 2).

Under- and overdispersion with respect to phylogeny and environment resulted in opposite patterns of correlation coefficients in the V matrices (Table 2). RTΔenvΔphyl pointed in 21% of the V matrices to overdispersion of species with similar habitat requirements, while RCΔenvΔphyl indicated that over 10% of matrix sets were underdispersed when considering joint species occurrences. The SES scores of RCΔenvΔphyl, RHΔenvΔphyl and RTΔenvΔphyl were only weakly correlated with one another (Fig. 3), suggesting that they are quantifying different aspects of pattern in the focal Mocc matrix.

Figure 3.

 Relationships between the standardized effects sizes (fixed–fixed null model) of RCΔenvΔphyl (clumping), RHΔenvΔphyl (checkerboard) and RTΔenvΔphyl (togetherness). a: R2 = 0·14; b: R2 = 0·23; c: R2 = 0·10 (all P < 0·01).

Case Study

The plant communities in the oak, pine and mixed forests showed clear evidence of phylogenetic assortment and habitat filtering (Table 4). Irrespective of the forest type and environmental variable considered, the SES scores of CΔenv were significantly negative. Therefore, species pairs co-occurred more often in plots with similar levels of temperature, pH and nitrogen than expected from the FF null model. This signal of positive habitat filtering was slightly weaker in the case of TΔenv. The pattern expressed by HΔenv was complementary to that of CΔenv: in all forest types, there were significantly greater differences than predicted by the null model in temperature, pH and nitrogen levels among sites in which species did not co-occur.

Table 4.   Standardized effects sizes (SES) of test metrics for all vascular plant species in phytosociological plots within oak, pine and mixed forests. *P < 0·05; **P < 0·01. Significance levels refer to the respective confidence limits of the null model distribution (causing two times values of SES <|1·96| to be significant). Null distributions were obtained from 1000 randomizations of the Mocc matrices using the fixed–fixed null model. Temperature (T), soil pH and nitrogen content (N) are entered as averaged Ellenberg values
Δphyl −1·27  1·16  −3·22** 
Δphyl −0·10  1·80  −2·08* 
 Mixed forest
Δphyl 0·63  −0·52  −0·29 

The phylogenetic signal was weaker than the environmental signal (Table 4). In the oak and pine forests, the SES scores of TΔphyl that are based on the togetherness pattern as a metric of similarity in habitat requirements were significantly negative. Thus, species with identical patterns of presences–absences were phylogenetically closer than expected by chance (underdispersed). Consistent with this pattern, the SES scores of HΔphyl were positive (although statistically not significant), indicating more distant phylogenetic relationships of segregated submatrices and therefore negative phylogenetic assortment (underdispersion). In the mixed-forest matrix, the phylogenetic signal was not different from random (Table 4).

In the oak forest, phylogenetic relatedness for co-occurring species (clumping, togetherness) was significantly and negatively correlated with similarity in pH requirement (Table 4). Seven of the nine RCΔenvΔphyl correlations evaluated were negative, pointing to a weak tendency towards divergent niches of co-occurring species (Table 1). The respective RHΔenvΔphyl scores obtained in the oak and pine forests were mainly insignificant and suggest a diffuse pattern of niche evolution. In the mixed forest, the patterns were not significant (Table 4). In eight of nine tests, the correlation between environmental and phylogenetic differences (RTΔenvΔphyl) yielded a pattern of dissimilar habitat requirements of phylogenetically related species (Tables 1, 4). Thus, our tests indicate a general tendency against niche conservatism, but indicate trait- and habitat-specific patterns. Based on the average metric score, this tendency was the weakest in the pine forest.


General Framework and Metric Performance

The aim of this work was threefold: first, to provide a general framework for the study of phylogenetic assortment, habitat filtering and niche conservatism; secondly, to develop appropriate metrics to characterize and test each of these patterns; and thirdly, to clarify how different patterns of species co-occurrence might influence inference about evolutionary and environmental signals. We demonstrated that our metrics have a good error behaviour when tested against a variety of artificial matrix sets covering a wide range of observed patterns (Table 2). Previous studies have shown that results of phylogenetic analysis of community structure are potentially sensitive to both spatial scale and meta-community size and abundance (Swenson et al. 2006; Kraft et al. 2007; Hardy 2008). When tested against three different sets of random matrices (R, S and E), our metrics proved to be largely independent of matrix size and matrix fill (Table 3).

Our benchmark testing (Table 2) and the case study (Table 4) also indicate that our method has adequate power to detect even weak patterns of non-randomness (as expressed in the V matrices). Although the nine metrics we used are based on small differences in submatrix structure, and are compared with the same null models, they are surprisingly uncorrelated with one another and capture different, and often divergent, patterns expressed within the same matrix. Our construction of the artificial V matrices introduced a weak segregated pattern within the respective Mocc matrices. Therefore, the entire matrix is transformed from being random to being segregated, random and even aggregated for different subsets of species and sites (Ulrich & Gotelli 2012). Many real empirical matrices have such multiple substructures (Gotelli & Ulrich 2012; Ulrich & Gotelli 2012), which makes any simple matrix classification challenging. Our method is able to disentangle these divergent patterns, and thus may provide more precise insights into the phylogenetic structure of communities than previous approaches that use metrics based only on the average degree of species co-occurrence (Kembel et al. 2010; Ives & Helmus 2011).

Our approach can be adapted to test for species differences other than phylogenetic distance. Instead of a matrix containing phylogenetic information, we could use a matrix with morphological, physiological or molecular traits, or even information on species habitat requirements. Then our metrics quantify the degree to which species-specific traits are linked to patterns of species co-occurrence and habitat characteristics. Our approach could be also extended to deal with metrics other than distance. For example, Helmus et al. (2010) showed that disturbed sites may contain more closely related species. In our analysis, disturbance frequency or intensity could be measured at each site and then tested for its influence on patterns of species co-occurrence and phylogenetic relatedness.

A possible shortcoming of our method is that it might fail to detect non-randomness if the probability of species occurrence is a uni-modal or multi-modal function of environmental variables (Pausas & Verdú 2010). The easiest way to address this problem is to graphically inspect the scatter plot of occurrence vs. environmental variables for evidence of nonlinearity. In such cases, the use of quadratic or even nonlinear regression instead of simple correlation might be warranted (Huisman, Olff & Fresco 1993). Our case study does not incorporate species life history and morphological traits (Helmus et al. 2010; Pausas & Verdú 2010; Pavoine et al. 2011), but these factors can also be accommodated as a species difference matrix.

The question of how sample size might affect the identification of meta-community patterns has been somewhat neglected in phylogenetic and species co-occurrence analysis (Hardy 2008; Gotelli et al. 2011; Gotelli & Ulrich 2012). The problem here is that any large-scale distribution of species across sites has a certain internal structure quantified by the degree of spatial autocorrelation. The same holds for artificial presence–absence matrices that are generated by certain algorithms to obtain some non-random structure. Random samples from such autocorrelated data sets will only identify the underlying pattern if the spatial grain of the sample matches the respective grain of the original data sets. To explore this problem, we constructed 100 data sets similar to the V set (Table 1) but with 20 species and 1000 sites each. In each of these data sets, we took 100 samples, each consisting of 10–100 randomly selected sites, and compared the RCΔenvΔphyl, RHΔenvΔphyl and RTΔenvΔphyl correlations of the sample matrices with the correlations in the full data set. Our results (Table 5) show that subsampling is only partly able to recover the original matrix structure. Thus, tests based on subsamples of a large meta-community might have a reduced power to detect patterns. However, this is true of virtually all statistical tests (including parametric, Bayesian, and null model): as sampling effort decreases, power inevitably diminishes. Nevertheless our results exemplify that sample size effects deserve more attention when comparing the phylogenetic structure of meta-communities of different taxa and habitats.

Table 5.   Percentage of significant correlations between Δenv and Δphyl in 100 matrix sets of the V type with 20 species and 1000 sites (V1000) each, and in 100 random samples of 10–100 sites from each of these matrices. r < |CL| gives the percentage of correlations where the two-sided 95% confidence limits (CL) of the sample enclosed the respective correlation in the original V1000 data. Direction gives the percentage where the mean direction of the samples matched the direction of the respective V1000 data
 % Significant correlations
V 1000 33782
 % correlations
r < |CL|606889

Case Study

For three forest understory assemblages, temperature, pH and nitrogen content were frequently correlated with patterns of species occurrence, but were not necessarily related to phylogenetic structure (Table 4). The most striking example is the mixed forest, in which none of the co-occurrence metrics were correlated with phylogeny, but clumping and checkerboard patterns were related to environmental variables. This result is most parsimoniously explained by random species distributions across the phylogeny after sampling from a regional species pool. According to the random sampling hypothesis (Prinzing et al. 2008), species are able to coexist and interact irrespective of the amount of shared evolutionary history. Source-sink dynamics (mass effects; Shmida & Ellner 1984; Prinzing et al. 2008) can also create temporary assemblages from phylogenetically diverse lineages. Both processes can counteract phylogenetic clustering, particularly at smaller spatial scales.

The three submatrix structures (clumping, checkerboards and togetherness) revealed various dependencies of species co-occurrence on environment and phylogeny within the same forest type (Table 4). This result is especially exemplified by the togetherness index, which was correlated to phylogeny in the oak and pine forests and was the only index showing a strong correlation with a single environmental variable. This pattern may reflect constraints imposed by environmental stress. For example, the oak forest of our study area occurs on severely nutrient-deficient sandy soils and is depauperate in species (Puchałka, pers. comm.). This kind of habitat requires special adaptations, such as mycorrhizal or bacterial symbionts that fix nitrogen, sclerophyllous or highly pubescent leaves that resist desiccation and slow growth rates (because of limited nutrients and water); these traits are typically correlated with tolerance to mineral nutrient deficiencies (Grime 2001). These traits are found in many species, but are phylogenetically clustered in only a few plant families (e.g. Ericaceae, Asteraceae, Poaceae). Small scale differences in soil quality within the oak forest may allow more generalist species (e.g. ruderal) to successfully colonize high nitrogen patches and possibly displace specialists. As a result, species jointly avoid nitrogen-poor sites and colonize nitrogen-rich sites irrespective of phylogeny (Table 4).

In the oak forest, we found strong correlations between pH and both clumping and phylogeny, although there was no relationship between phylogeny and co-occurrence (Table 4). Differences in pH between two sites were negatively correlated with the phylogenetic distance of the species involved. This pattern implicates at least two mechanisms: (i) competition as a factor limiting co-occurrences of species with similar requirements (Webb et al. 2002) or (ii) convergent trait evolution in unrelated lineages (Cavender-Bares, Keen & Miles 2006).

Concluding remarks

We distinguished between three different types of species co-occurrences structures (checkerboards, togetherness, clumping) that capture different patterns of community assembly (Fig. 2). The presence of all three structures within a single data matrix is a challenge for teasing apart the links between phylogeny, environment and community assembly. In particular, clumping (a pattern of joint occurrences of species irrespective of site differences) and togetherness (joint occurrences conditional on site differences) have not been clearly distinguished before (Ulrich & Gotelli 2012). Our proposed methodology highlights that the separate analysis of these metrics might provide new insights when studying patterns of community assembly.


W.U. was in part supported by a grant from the Polish Science Ministry (N 304 372839). M.P. acknowledges funding by grants from the National Science Centre (N304 306740 and N N303 069335). F.T.M. was supported by the European Research Council under the European Community’s Seventh Framework Programme (FP7/2007-2013)/ERC Grant agreement no 242658 (BIOCOM). N.J.G. was supported by the U.S. National Science Foundation (NSF DEB-0541936) and the U.S. Department of Energy (022821).