Size Ratios
library(EcoSimR)    # load EcoSimR library
set.seed(56)        # for reproducible results


In his seminal paper “Homage To Santa Rosalia or why are there so many kinds of animals?”, Hutchinson (1959) noted that, if the species in an assemblage are ordered from smallest to largest, the average body size ratios of adjacent species varied between 1.1 and 1.4 for several bird and mammal assemblages. Hutchinson speculated that the mean ratio, roughly 1.3, could be “tentatively” interpreted as the amount of separation necessary for species to coexist at the same trophic level. This modest suggestion spawned a vast amount of research, as ecologists sought to confirm or refute this “1.3 rule” for different assemblages.

For animal assemblages, constancy in the ratios of body sizes or feeding appendages might result either from character displacement or colonization extinction dynamics. For plants, similar effects of competition for pollinators might lead to a constant difference in flowering times, rather than a constant ratio. Even if differences or ratios were not unusually constant, there might still be some minimum spacing or ratio that was necessary to permit coexistence. Important null model tests by Poole and Rathcke (1979) for even spacing of plant flowering phenologies, and by Simberloff and Boecklen (1981) for constancy of animal body size ratios found little support for these generalities.

This module of EcoSimR includes metrics and algorithms for constant size ratios or size differences, as well as for critical minimum size ratios or size differences. Although the module is described in terms of animal body size, any morphological trait could be analyzed for constancy in size ratios. Flowering or activity times can also be tested for evidence of regular or minimum spacing. These analyses do not take into account intraspecific variation, and instead summarize body size or other traits as a single number for each species.


The data for a size ratio analysis consists of a vector of species body sizes. Each entry represents the average body size or trait value for a species in an assemblage. These values must be non-negative real or integer values. Negative numbers are NA values are not allowed.

The sample data set for this analysis is dataRodents, the body size in grams of 6 coexisting rodent species in the Sonoran desert (Brown 1975). Brown and his colleagues have studied competitive interactions among desert rodents (and among rodents and ants) for many years at these sites (see Brown 1998 for a summary of this work). Experimental studies have established that, in some locations, rodents compete for seed resources (Brown et al. 1986). We can use EcoSimR to test for any non-randomness in the body size pattern of these species.

Average body sizes of Sonoran desert rodents. Data from Brown (1975)
species Sonoran
Perognathus_flavus 7.2
Reithrodontomys_megalotis 11.4
Perognathus_penicillatus 17.1
Peromyscus_maniculatus 24.3
Dipodomys_merriami 45.3
Dipodomys_spectabilis 120.0


The Size Ratio module of EcoSimR offers four metrics for analysis. Prior to calculation of these metrics, the body sizes (or trait values) are ordered from smallest to largest.


The Size Ratio module of EcoSimR offers four algorithms for randomizing a set of body size or trait values:


The size-ratio module offers two graphic outputs. plot(myModel, type="hist") generates a standard histogram of simulated metric values (blue bars) based on the selected algorithm and metric. The vertical red line indicates the observed metric for the original data, the pair of vertical long-dash lines indicate the 95% one-tailed cutpoints, and the short-dash lines indicate the 95% two-tailed cutpoints. The latter would constitute a proper 95% confidence interval for the null distribution. Note that these intervals are not based on a normal or other parametric distribution. Instead, they are always estimated directly from the histogram, which means they could be asymmetric, and will be sensitive to the number of replicates used.

The second graphic, plot(myModel,type="size"), illustrates graphically the body sizes of one simulated assemblage (blue points) and the observed body sizes (red points). These same data are portrayed as histograms (red and blue) of the ordered size differences between adjacent species pairs. A careful comparison of the observed and simulated data should confirm the behavior of the chosen randomization algorithm.

myModel <- size_null_model(dataRodents,suppressProg=TRUE)


speciesData           # user must supply a data frame; speciesData=dataWiFinches for default run
algo = "size_uniform" # randomize interior species with a uniform distribution
metric = "var_ratio"  # variance of size ratios of adjacent species
nReps = 1000          # number of null assemblage created
rowNames=TRUE         # reads speciesData as a data frame wtih row labels in the first column
saveSeed=FALSE        # if TRUE, saves random number seed
burn_in=500           # number of burn-in iterations for sim9
algoOpts=list()       # list of other specific options for the algorithm (used for size_source_pool)
metricOpts=list()     # list of other specific options for the metric
suppressProg= FALSE   # suppress printing of progress bar (for creating markdown files)


# run default settings and show all output
myModel <- size_null_model(speciesData=dataRodents,suppressProg=TRUE)
## Time Stamp:  Sun Apr  5 22:58:40 2015 
## Reproducible:  FALSE 
## Number of Replications:  1000 
## Elapsed Time:  0.14 secs 
## Metric:  var_ratio 
## Algorithm:  size_uniform 
## Observed Index:  0.25135 
## Mean Of Simulated Index:  3.5785 
## Variance Of Simulated Index:  23.193 
## Lower 95% (1-tail):  0.29999 
## Upper 95% (1-tail):  13.658 
## Lower 95% (2-tail):  0.20587 
## Upper 95% (2-tail):  19.377 
## Lower-tail P =  0.035 
## Upper-tail P =  0.965 
## Observed metric > 35 simulated metrics 
## Observed metric < 965 simulated metrics 
## Observed metric = 0 simulated metrics 
## Standardized Effect Size (SES):  -0.69088
plot(myModel,type = "hist")

plot(myModel,type="size") # throws error in vignette: figure margins too large

# test for minimum size differences with a source pool model

# create a source pool of the rodent body sizes plus 20 other species
mySource <-c(dataRodents$Sonoran,as.double(sample(150,20)))
# create an arbitrary set of probabilty weights
myProbs <- runif(26)

# run the model
myModel <- size_null_model(speciesData=dataRodents,suppressProg=TRUE,

# show the results
## Time Stamp:  Sun Apr  5 22:58:40 2015 
## Reproducible:  FALSE 
## Number of Replications:  1000 
## Elapsed Time:  0.1 secs 
## Metric:  min_diff 
## Algorithm:  size_source_pool 
## Observed Index:  4.2 
## Mean Of Simulated Index:  3.5292 
## Variance Of Simulated Index:  10.226 
## Lower 95% (1-tail):  0.4 
## Upper 95% (1-tail):  10 
## Lower 95% (2-tail):  0.4 
## Upper 95% (2-tail):  11.802 
## Lower-tail P =  0.708 
## Upper-tail P =  0.348 
## Observed metric > 652 simulated metrics 
## Observed metric < 292 simulated metrics 
## Observed metric = 56 simulated metrics 
## Standardized Effect Size (SES):  0.20977



These models carry the usual restrictions on the analysis of body size patterns as they relate to competition and resource use: 1) body size or morphology are related to resource use; 2) the underlying resource spectrum is symmetric; 3) competition occurs primarily among adult organisms; 4) sexual size dimorphism and intraspecific variation in body size are ignored; 5) abundances of all species are approximately equal (Gotelli and Graves 1996). These models also treat each species as an independent data point and do not explicitly incorporate effects of phylogenetic inertia (Losos 1990).


Brown, J.H. 1975. Geographical ecology of desert rodents. p. 314-341 in: Ecology and Evolution of Communities. M.L. Cody and J.M. Diamond (eds.). Harvard University Press, Cambridge.

Brown, J.H. 1998. The desert granivory experiments at Portal. Pages 71-95 in W.J. Resetarits, Jr. and J. Bernardo, eds. Experimental ecology: issues and perspectives. Oxford University Press, New York.

Brown, J.H., D.W. Davidson, J.C. Munger, and R.S. Inouye. 1986. Experimental community ecology: the desert granivore system. Pages 41-61 in J. Diamond and T. J. Case, eds. Community ecology. Harper and Row, New York.

Gotelli, N.J. and G.R. Graves. 1996. Null models in ecology. Smithsonian Institution Press, Washington DC.

Graves, G.R. and N.J. Gotelli. 1983. Neotropical land-bridge avifaunas: new approaches to null hypotheses in biogeography. Oikos 41: 322-333.

Hutchinson, G.E. 1959. Homage to Santa Rosalia or why are there so many kinds of animals? The American Naturalist 93: 145-159.

Losos, J.B. 1990. A phylogenetic analysis of character displacement in Caribbean Anolis lizards. Evolution 44: 558-569.

Poole R.W. and B.J. Rathcke. 1979. Regularity, randomness, and aggregation in flowering phenologies. Science 203: 470-471.

Simberloff, D., and W. Boecklen. 1981. Santa Rosalia reconsidered: size ratios and competition. Evolution 35: 1206-1228.

Tonkyn, D.W., and B.J. Cole. 1986. The statistical analysis of size ratios. The American Naturalist 128: 66-81.