**Fig. 1.** *Ground beetles are abundant, important economically and ecologically, but poorly understood. The diversity of trait attributes can be modeled with [GJAM](https://doi.org/10.1111/geb.13670)*.

Fig. 1. Ground beetles are abundant, important economically and ecologically, but poorly understood. The diversity of trait attributes can be modeled with GJAM.


When the goal of an analysis is to understand the attributes of species that help to explain their responses, then traits must be modeled jointly, while accommodating the differences in how they are observed and quantified. GJAM can be applied to diverse combinations of traits.

Resources

Software

source('clarkFunctions2024.r')
library(gjam)

Readings

Clark, J.S. 2016. Why species tell us more about traits than traits tell us about species: Predictive models. Ecology, 97, 1979–1993.

Seyednasrollah, B., and Clark, J. S. 2020. Where resource‐acquisitive species are located: The role of habitat heterogeneity. Geophysical Research Letters, 47, e2020GL087626.

Qiu, T., A. J. Bell, J. J. Swenson, and J. S. Clark. 2023. Habitat-trait interactions that control response to climate change: North American ground beetles (Carabidae). Global Ecology and Biogeography.


Traits rather than species?

Often an analysis of species responses to the environment has the more general goal of understanding how the attributes of species determine their responses. For example, a microbiome study may fit responses of hundreds of taxa (OTUs) about which little is known beyond a few attributes (traits). If the question concerns the roles of these attributes, why not analyze the traits themselves, rather than trying to speculate on their roles through an analysis of species? There are at least two ways to do this, i) the trait response model (TRM), which translates species abundances into a joint distribution of community weighted means/modes (CWMM) and models them jointly, and ii) the predictive trait model (PTM), which models species jointly and translates the fitted model (through prediction) to the joint trait response (Clark et al. 2016). In both cases, the abundances of the species that bear those traits act as weights. Traits must be modeled jointly, because they have built-in covariance: variation in any one species affects all traits, depending on trait values associated with that species.

Here is Shiqi’s thorns with additional traits as CWM values:

*Severl tree traits.

*Severl tree traits.

Sporodic coverage, high diversity, minimal understanding

This example comes from the problem of understanding ground beetle responses to habitat change. The challenges of synthesizing published data is apparent from recent conflicting interpretations of insect abundances (van Klink et al. 2020, Crossley et al. 2020) reflecting over-sensitivity to precisely which sites and species were included in each meta-analysis ; every species is increasing and decreasing somewhere, and geographic and habitat coverage is too sporadic for generalization. Only long time series can provide reliable estimates of trends for noisy data, but the unrepresentative geographic distribution of sites precludes interpretation of overall trends. In fact, the current habitat requirement differences between species remains poorly understood, complicated by all of these factors.

**Fig. 2.** *Species abundance in [NEON pitfall-trap surveys](https://www.battelle.org/government-offerings/lab-operations-research-management/large-research-infrastructure/national-ecological-observatory-network?gclid=Cj0KCQjw38-DBhDpARIsADJ3kjmxNJPtXI7DJy6U5y5n9OKDkq0HbsQpxbHVsd587jkIfwzIkbrZmiIaAmRcEALw_wcB), reports from [iNaturalist](https://www.inaturalist.org/observations), and habitat-suitability prediction from [PBGJAM](https://geocentroid.shinyapps.io/PBGJAM-data-explorer/) based on climate, elevation, and soils*. NEON abundances are scaled by abundance, with grey symbols indicating absense.

Fig. 2. Species abundance in NEON pitfall-trap surveys, reports from iNaturalist, and habitat-suitability prediction from PBGJAM based on climate, elevation, and soils. NEON abundances are scaled by abundance, with grey symbols indicating absense.

Trait information can aid synthesis

Attributes of ground beetles may contribute to their diversity and abundances in ways that might help to understand their current habitats and how they might respond to climate change. The diverse family of ground beetles (Carabidae) has perhap 40,000 species globally, with 2000 occurring in North America. This group was selected for specific monitoring in NEON due to the abundance, diversity, economic importance, and the fact that they can be captured in pitfall traps. They are sufficiently abundant and diverse that they contribute importantly to food webs and control of undesirable crop pests. Due to the diversity of this group that is not readily identified to species by amateurs, little is known about the life history of many species, including basic distribution and abundance with respect to important habitat variables. The trait information available in this study include variables summarized by the terms trophic, diurnal, flight, climb, burrow, run, color, and length. Tong Qiu in our lab is analyzing the NEON ground beetles from 1578 plots and 67 species, shown for several species in the left-hand maps of Figure 2.

Ground beetles are mostly predatory and nocturnal (trait diurnal), but there are also granivores (e.g., Harpalus, Fig. 1e) and omnivores (trophic in our analysis). Some are generalist feeders, while others target specific prey types, such as the caterpillar-specialist Calosoma (Fig. 1b) and snail-eating genus Sphaeroderus (Fig. 1g). Some are active fliers, such as the tiger beetles Cicindella (Fig. 1a), while others have fused elytra (Pasimachus, Fig. 1f) or simply do not appear to engage in flight (flight). Some actively pursue prey in arboreal vegetation (e.g., Calosama, Fig. 1b), while others are slow-moving and primarily fossorial (e.g., Pasimachus, Fig. 1f). These are the traits climb, burrow, and run. Nocturnal habits may contribute to the dark color of most species in this family, but some are brightly iridescent (color) (Fig. 1a, b).

The adaptive significance of traits like those available in this study is the source of wide speculation. Indeed, such ‘trait syndromes’ may provide some guidance on understanding their vulnerability to habitat and climate change.

Community weighted traits

Community weight mean (CWM) trait values are obtained by treating species abundances as weights for species traits,

\[ u_{im} = \sum_{s=1}^S t_{ms}w_{is} = \mathbf{t}'_m \mathbf{w}_i \] for trait \(m\) of species \(s\) at location \(i\), where \(w_{is}\) is the relative abundance of species \(s\). This standard formulation is fine for a trait that is measured on a continuous scale. It is not correct for traits that are discrete.

Predictive trait model for ground beetles

The predictive trait model (PTM) models the joint distribution of traits that arises as community weighted mean traits. CWM traits have built in correlation due to the fact that each trait in the vector \(u_{im}\) depends on the same individuals through the weights \(w_{is}\). The PTM further allows for the fact that each trait can be a different data type, including continuous, presence-absence, ordinal counts, and so on. Joint analysis of traits in trees is demonstrated in this vignette. The example considers foliar, wood, and habitat-preference traits in the FIA data.

The ground beetle example is summarized here. The function gjamSpec2Trait takes a species-by-trait matrix sbyt, and combines it with a plot-by-species matrix pbys to generate several objects, including plotByTrait and specByTrait. Here I load data and view a few lines of these objects:

load( 'groundBeetleTraits.rdata', verbose = T )
## Loading objects:
##   pbys
##   sbyt
##   types
##   xdata
##   edata

The best way to describe these objects is to just use them in the example. First, trim the plot by species matrix pbys to species that occur on at least minObs sites, then trim species by trait matrix sbyt to have the same species:

tmp <- gjamTrimY(pbys, minObs = 20, OTHER = F)   # rare types won't have signal
pbys <- tmp$y                                    # plots by species (n X S)
edata$columns <- 1:ncol(pbys)
sbyt <- sbyt[colnames(pbys),]                    # species by traits (S X M)

Now transform plots by species (pbys) and species by traits (sby) to plots by traits:

tmp         <- gjamSpec2Trait(pbys, sbyt, types) 
tTypes      <- tmp$traitTypes                    # M = 12 values
plotByTrait <- tmp$plotByCWM                     # community-weight means: n X M 
censor      <- tmp$censor                        # (0, 1) censoring, two-level CAT's
specByTrait <- tmp$specByTrait                   # S X M
M           <- ncol(plotByTrait)
n           <- nrow(plotByTrait)

There is a \(S \times M\) trait matrix \(\mathbf{T}\) having species names as rows and trait names as columns. Here are a few lines of this specByTrait matrix:

climb burrow run length diurnal flight trophicother trophicomnivorous trophicpredaceous colorother colorblack colorbrown
agonolConjun 0 0 1 3.75 0 1 0 1 0 0 0 1
agonumCupreu 0 0 1 10.75 0 0 0 0 1 1 0 0
agonumGratio 0 0 1 10.75 0 0 0 0 1 1 0 0
agonumQuinqu 0 0 1 10.75 0 0 0 0 1 1 0 0
agonumRetrac 0 0 1 10.75 0 0 0 0 1 1 0 0

Each entry in specByTrait assigns a value to a trait for a given species. Some of these columns are binary (e.g., climb, burrow), ordinal (run, flight), continuous (length), and categorical (trophic, color). Here are the unique trait values for categorical and ordinal traits:

sapply(sbyt[, types %in% c('CAT','OC','PA')], table) 
## $trophic
## 
## granivorous  omnivorous  predaceous 
##           5          79          82 
## 
## $flight
## 
##  0  1  2 
## 96 16 54 
## 
## $climb
## 
##   0   1 
## 146  20 
## 
## $burrow
## 
##   0   1 
## 129  37 
## 
## $run
## 
##   0   1 
##  43 123 
## 
## $color
## 
##      black      brown iridescent 
##        121         30         15 
## 
## $diurnal
## 
##   0   1 
## 139  27

To summarize trait types, here are their designations in GJAM:

trophic, color - categorical (CAT) with three classes (un-ordered)

flight - ordinal (OC) with three ordered classes

climb, burrow, run, diurnal - binary (PA)

length - continuous, positive (CA)

There is a \(n \times M\) trait response matrix that holds community-weighted mean (numeric) or modal (categorical) trait values for a plot called plotByTrait:

climb burrow run length diurnal flight trophicother trophicomnivorous trophicpredaceous colorother colorblack colorbrown
0.0769 0 1.000 19.4 0.0769 0 0 0.1540 0.846 0.0000 0.769 0.231
0.2860 0 0.857 14.6 0.3810 0 0 0.0952 0.905 0.0952 0.571 0.333
0.0000 0 0.933 15.1 0.1670 0 0 0.1000 0.900 0.0000 0.333 0.667
0.0000 0 0.933 14.5 0.3330 0 0 0.0444 0.956 0.0000 0.400 0.600
0.0000 0 1.000 20.2 0.0000 0 0 0.0000 1.000 0.0000 0.800 0.200

At the plot level, categorical traits become fractional composition (FC), due to the fact that discrete categories translate to fractions of the plot total when combined with the abundances of species bearing those traits (Clark 2016) (see ‘Trait analysis’ in the GJAM vignette). For the trait response model (TRM), the matrix plotByTrait is response ydata in GJAM.

Predictors in a model

The PBGJAM site offers abundance-weighted habitat scores (AWHS) for current conditions and future scenarios for several species groups, including ground beetles. These are not predictions of where a species is now or where a species will be in the future. Rather, they are habitats weighted by current abundance of species, based on variables used in model fitting and other species in the community. They are conditioned on a specific scenario (e.g., ‘current conditions’ or an emissions scenario). AWHS transfer formal predictive distributions from Generalized Joint Attribute Modeling (GJAM), with full uncertainty from parameters, model, and observations to mapped scenarios. For this reason, it is fine to refer to them as “predictive distributions”—again, that’s the formal name for them. Unlike standard predictions, AWHS are based on abundance, incorporating sample effort for observed data. They are not presence-only or presence/absence. GJAM incorporates the joint relationships between species, because there is mutual dependence between species. The units (dimension) of a AWHS is species abundance—the same units used for observations.

The predictors we use here combine climate and the local habitat variables that provide cover and foraging opporunity for ground beetles:

def.JJA - summer deficit (PET minus P summed over June, July, August)

tmmn.DJF - minimum winter temperature (December, January, February)

nrd.15cm.2m - understory cover from LIDAR, 0.15 - 2 m in height

s.roughness - surface roughness

Nitrogen.mean - soil nitrogen

gap.frac.10 - gap fraction from LIDAR

cec30 - cation exchange capacity (a soil fertility index), upper 30 cm

cwd - coarse woody debris volume, sqrt scale

Here is the climate-habitat space represented in the data:

xnames <- c('def.JJA', 'tmmn.DJF', 'nrd.15cm.2m', 's.roughness', 
            'Nitrogen.mean', 'gap.frac.10', 'cec30', 'cwd')
pairs(xdata[,xnames], cex = .1)
**Fig. 3**. *A pairs plot of predictors in the model does not show strong correlations*.

Fig. 3. A pairs plot of predictors in the model does not show strong correlations.

We are also interested in the distributions of species across land-cover types.

i <- rep(xdata$land, ncol(pbys))
j <- rep(colnames(pbys), each = nrow(pbys))
ltab <- tapply( as.vector(unlist(pbys)), list(  species = j, land = i), sum, na.rm=T)
head(ltab)
forest herbAgr shrubScrub wetland
agonolConjun 15 316 12 1
agonumCupreu 1 46 3 3
agonumGratio 2 0 1 66
agonumQuinqu 7 9 98 6
agonumRetrac 99 0 0 20
amaraAlpina 0 311 25 0

From the pairs plot, there is some redundancy in predictors, but it is not extreme. The negative tendency between nrd.15cm.2m and gap.frac.10 results from the understory growth that can proliferate in canopy gaps. There is a range of soc30 at high cec30 (organic soils can be infertile), but both are low together (low CEC begets low productivity and, thus, low OM). Despite these weak tendencies, each predictor brings some additional information.

Implementation

Species as weights become composition data. Modeling can be done as fractional composition (FC), in which case there is no accommodation for the differential effort in terms of total count between observations, or as composition count (CC), which does allow for this difference. Both allow for differential trap nights, which is held in the effMat matrix. IMPLEMENT ONE OR THE OTHER OF THE FOLLOWING TWO BLOCKS.

Here is the fractional composition setup:

eff  <- edata$values                          # obs. effort
pbys <- pbys/eff                              # allow for trap nights
pbys <- sweep( pbys, 1, rowSums(pbys), '/' )  # fraction of total
pbys <- as.matrix( pbys )
pbys[ !is.finite(pbys) ] <- 0
typeNames <- 'FC'

Here is the composition count setup:

eff  <- edata$values
eff  <- eff/max(eff)         # allow for trap nights
pbys <- ceiling( pbys/eff )  # preserve count and trap-night effects on effort
pbys <- as.matrix( pbys )
pbys[ !is.finite(pbys) ] <- 0
typeNames <- 'CC'

Here is model fitting:

tl  <- list(plotByTrait = plotByTrait, traitTypes = tTypes, specByTrait = specByTrait)
rl  <- list(r = 8, N = 25)
ml  <- list(ng = 3000, burnin = 500, typeNames = typeNames, holdoutN = 20,
                  traitList = tl, reductList = rl)
form <- as.formula( ~ def.JJA + gap.frac.10 + tmmn.DJF + s.roughness + Nitrogen.mean + cec30 + nrd.15cm.2m + cwd + land)
out <- gjam(form, xdata = xdata, ydata = pbys, modelList = ml)

Combined results for species and traits

Before plotting I assign colors to traits and to the species that bear those traits:

S  <- ncol(pbys)
sc <- rep('black', S)
wr <- which(specByTrait[,'burrow'] == 1)             # brown
wb <- which(specByTrait[,'run'] == 1)                # blue
wd <- which(specByTrait[,'climb'] == 1)              # blue-green
ws <- which(specByTrait[,'trophicpredaceous'] == 1)  # light blue
sc[ws] <- '#3288bd'; names(sc)[ws] <- 'pred'
sc[wr] <- '#8c510a'; names(sc)[wr] <- 'burrow'
sc[wb] <- '#003c30'; names(sc)[wb] <- 'run'
sc[wd] <- '#80cdc1'; names(sc)[wd] <- 'climb'

M  <- ncol(specByTrait)
tc <- rep('black', M)
names(tc) <- colnames(specByTrait)
tc[ 'burrow' ] <- '#8c510a'
tc[ 'run' ]    <- '#3288bd'
tc[ 'climb' ]  <- '#003c30'
tc[ 'trophicpredaceous' ] <- '#80cdc1'

ncluster <- 5

pl  <- list(GRIDPLOTS=T, specColor = sc, traitColor = tc, ncluster = ncluster,
            PLOTALLY = T) 
fit <- gjamPlot(output = out, pl)
**Fig. 4a.** *Species abundance prediction from the fitted PTM fitted.*

Fig. 4a. Species abundance prediction from the fitted PTM fitted.

In the prediction plots from Figure 4a, accurate predictions follow the 1:1 line, whereas noise (lack of signal) follow the mean (horizontal dashed line). Species predictions fall between these two extremes, with rare species tending more toward noise.

The PTM uses the trait matrix \(\mathbf{T}\) to change variables from species to traits:

**Fig. 4b.** *Trait prediction from the fitted PTM fitted.*

Fig. 4b. Trait prediction from the fitted PTM fitted.

From the above plot it is clear that climate and habitat predict some traits better than others. For example, knowledge of the predictors in this model would not help us to anticipate the importance of black or brown coloration, while it would help us predict iridescence (colorother), examples including Figures 1a, b. It would not help with prediction of climbers, but it would with most of the other behavioral traits in the top row of Figure 4b.

Recall that in the predictive trait model (PTM) (see ‘Trait analysis’ in the GJAM vignette), the trait coefficients are \(\mathbf{A} = \mathbf{B} \mathbf{T}\), where \(\mathbf{T}\) is the \(S \times M\) species by trait matrix (specByTrait), and \(\mathbf{B}\) is the \(Q \times S\) matrix of species coefficients. Here is the trait response with one plot per predictor;

**Fig. 5a.** *Trait response to summer moisture deficit.*

Fig. 5a. Trait response to summer moisture deficit.

**Fig. 5b.** *Trait response to minimum winter temperature.*

Fig. 5b. Trait response to minimum winter temperature.

**Fig. 5c.** *Trait response to canopy gap fraction.*

Fig. 5c. Trait response to canopy gap fraction.

**Fig. 5d.** *Trait response to surface roughness.*

Fig. 5d. Trait response to surface roughness.

**Fig. 5e.** *Trait response to foliar N concentration.*

Fig. 5e. Trait response to foliar N concentration.

**Fig. 5f.** *Trait response to cation exchange capacity (CEC).*

Fig. 5f. Trait response to cation exchange capacity (CEC).

**Fig. 5g.** *Trait response to understory cover from lidar, 0.15 - 2 m in height.*

Fig. 5g. Trait response to understory cover from lidar, 0.15 - 2 m in height.

**Fig. 5h.** *Trait response to coarse woody debris.*

Fig. 5h. Trait response to coarse woody debris.

Here is the full \(\mathbf{A}\) matrix:

**Fig. 5i.** *Trait response matrix to predictors.*

Fig. 5i. Trait response matrix to predictors.

Clustering of predictors (left side) is based on similarity in responses across trait groups (e.g., cec30 tends to elicit similar responses to s.roughness and cwd). Clustering of traits (top) is based on similarity between traits in their responses to predictors (e.g., climbing habit and omnivory trend similarly with climate and habitat).

Sensitivity by species and by traits

The individual fitted coefficients give us the sensitivity to a predictor of a species (\(\mathbf{B}\)) or a trait (\(\mathbf{A}\)). How do we summarize sensitivity across the full community of species?

The sensitivity to predictors across the entire community of species can be determined from the set of all coefficients together with the species covariance,

\[ diag \left( \mathbf{B} \Sigma^{-1} \mathbf{B}'\right) \] Recall that \(\Sigma\) is the residual covariance matrix. Here sensitivities are plotted from the estimates in out$chains$fSensGibbs

**Fig. 6.** *Sensitivity of species abundance to predictors.*

Fig. 6. Sensitivity of species abundance to predictors.

Land cover and one of the habitat variables (gap fraction) comes out at the top, and it is followed by winter temperatures, understory cover, and moisture deficit.

We can also look at sensitivity by trait groups. Let \(\mathcal{T}\) be the set of species in a trait group (e.g., ‘climbers’) and \(-\mathcal{T}\) be species not in that group. Here is a conditional sensitivity for the group,

\[ n_{\mathcal{T}}^{-1} diag \left( \mathbf{B}_{\mathcal{T}} \Sigma^{-1}_{\mathcal{T}|-\mathcal{T}} \mathbf{B}'_{\mathcal{T}}\right) \] where \(n_{\mathcal{T}}^{-1}\) is the number of species in the trait group, and \(\Sigma_{\mathcal{T}|-\mathcal{T}}\) is the conditional covariance of species in the trait group given those that are not.

Here are sensitivities of several groups to predictors:

ynames   <- colnames(pbys)
wc       <- which( specByTrait[ ynames, 'climb'] == 1 )
climbers <- ynames[wc]
cc       <- gjamSensitivity( out, group = climbers ) # sensitivity samples from the posterior

wf     <- which( specByTrait[ ynames, 'flight'] == 1 )
fliers <- ynames[wf]
ff     <- gjamSensitivity( out, group = fliers )

wb     <- which( specByTrait[ ynames, 'burrow'] == 1 )
burrow <- ynames[wb]
bb     <- gjamSensitivity( out, group = burrow )

wr      <- which( specByTrait[ ynames, 'run'] == 1 )
runners <- ynames[wr]
rr      <- gjamSensitivity( out, group = runners )

nt  <- ncol(rr)
ord <- order(colMeans(rr))

ylim <- range(rbind(ff, cc, bb, rr))
ylim[2] <- ylim[2]*3

cols <- c('#01665e','#3288bd','#8c510a','#f46d43')

par(bty='n')
tmp <- boxplot( cc[,ord], boxwex = 0.12,  at = 1:nt - .2, border = cols[1], log='x',
         ylim = ylim, yaxt = 'n', xlab='Sensitivity', horizontal = T, 
         lty=1, outline=F)$stats
boxplot( ff[,ord], boxwex = 0.12, at = 1:nt - .1, border = cols[2], add=T,
         yaxt = 'n', horizontal = T, lty=1, outline=F)
boxplot( bb[,ord], boxwex = 0.12, at = 1:nt + .1, border = cols[3], add=T,
         yaxt = 'n', horizontal = T, lty=1, outline=F)
boxplot( rr[,ord], boxwex = 0.12, at = 1:nt + .2, border = cols[4], add=T,
         yaxt = 'n', horizontal = T, lty=1, outline=F)

pos <- rep(4, nt)
wp  <- which( tmp[5,] > max(tmp)/2 )
yt  <- 1.5*tmp[5,]
pos[ wp ] <- 2
yt[ wp ] <- .9*tmp[1,wp]
text( yt, 1:nt - .3, colnames(cc)[ord], pos = pos)

legend('bottomright',c('climbers','fliers','burrowers','runners'),
       text.col=cols, bty='n')
**Fig. 7**. *Sensitivity to predictors of trait groups*.

Fig. 7. Sensitivity to predictors of trait groups.

Sensitivity to predictors varies by trait. For example, def.JJA explains more of the variation in runners than it does for fliers. Wetlands explain substantial variation in burrowers.

And we can look at the sensitivity to predictors at the level of trait syndromes, evaluated as

\[ diag \left( \mathbf{A} \Omega^{-1} \mathbf{A}'\right) \] where \(\Omega = \mathbf{T}\Sigma\mathbf{T}'\) is the \(M \times M\) covariance for the joint distribution of traits.

par(bty='n')
bt <- out$parameters$betaTraitXWmu
av <- out$parameters$varTraitMu
traitSens <- diag( bt%*%av%*%t(bt) )[-1]
traitSens <- sort( traitSens/sum(traitSens) )
na  <- length(traitSens)
at  <- 1:na
pos <- rep(2, na)
pos[ 1:3 ] <- 4
plot(traitSens, at, log = 'x', yaxt='n', ylim = c(0, length(traitSens)),
     ylab = 'Predictors', xlab = 'Trait sensitivity', pch = 3, lwd=3)
text( traitSens, at, names(traitSens), pos = pos )
**Fig. 8**. *Sensitivity of traits to predictors*,

Fig. 8. Sensitivity of traits to predictors,

Taken across all trait groups, land cover, winter temperature, gap fraction, and CEC emerge as the most important predictors.

For reference, trait coefficients from out$parameters$betaTraitXTable are listed at the end of this vignette.

Trait syndromes

Traits may tend to occur in combinations, where possession of one attribute may only be adaptive if accompanied by others. For example, does flight and activity in the Cicindelids increase the importance of bright coloration, while a fossorial and nocturnal habit selects for dark coloration? Here is the clustering of traits based on the relationship

\[ \mathbf{E}_A = \mathbf{A}' \mathbf{V} \mathbf{A} \] where \(\mathbf{V}\) is the covariance in the design matrix \(\mathbf{X}\). This equation says that large responses of the same sign to environmental variables that vary widely cause traits to respond similarly. Here is a clustering of trait responses:

library(dendextend)

x  <- out$inputs$xStand[,-1]
bt <- out$parameters$betaTraitXWmu[colnames(x),]
cx <- cov(x)
sy <- t(bt)%*%cx%*%bt
dsigma <- as.dist( cov2dist(sy) )

# draw dendrogram
yclust <- hclust(dsigma, method='complete')
dend   <- as.dendrogram(yclust)
dend   <- color_branches(dend, k=3)
dend   <- hang.dendrogram(dend,hang_height=0.1)
dend   <- set(dend, "labels_cex", 0.5)
plot(dend, horiz =  TRUE,  nodePar = list(cex = .007))
**Fig. 9**. *Across the community of species traits cluster into syndromes*.

Fig. 9. Across the community of species traits cluster into syndromes.

The dendrogram is not a measure of trait correlations, but rather the similarities in how traits respond to predictors in the model. The iridescent color (colorother) is similar to flight, running to diurnal habit, and large size (length) to burrowing and black color. Predators and granivores (trophicother) likewise respond similarly. These relationships can be the basis for interpreting trait combinations that could be beneficial in combinations.


Exercise. Current papers on declines in insect abundance speculate on the relative importance of climate change, habitat deterioration, and pesticides (van Klink et al. 2020, Crossley et al. 2020). Our analysis does not include pesticide information, but it does include critical climate and habitat variables. In light of the species sensitivity (Fig. 6), individual trait responses (Fig. 5), trait groups sensitivity (Fig. 7), and full trait sensitivity (Fig. 8), which groups would you expect to be most vulnerable to both types of change?


Coefficient table for out$parameters$betaTraitXTable

Estimate SE CI_025 CI_975 sig95
climb_intercept -0.64800 0.02370 -6.96e-01 -0.60200 *
climb_def.JJA -0.00829 0.01310 -3.36e-02 0.01750
climb_gap.frac.10 -0.00472 0.02680 -5.82e-02 0.04840
climb_tmmn.DJF -0.02600 0.01140 -4.83e-02 -0.00319 *
climb_s.roughness -0.03140 0.01080 -5.34e-02 -0.01060 *
climb_Nitrogen.mean 0.06060 0.01130 3.88e-02 0.08270 *
climb_cec30 -0.05540 0.01210 -7.97e-02 -0.03170 *
climb_nrd.15cm.2m 0.05640 0.01850 1.94e-02 0.09230 *
climb_cwd 0.01610 0.01240 -7.82e-03 0.03970
climb_landherbAgr 0.26700 0.04530 1.80e-01 0.35600 *
climb_landshrubScrub -0.07700 0.05120 -1.77e-01 0.02320
climb_landwetland -0.03510 0.04020 -1.15e-01 0.04450
burrow_intercept -1.38000 0.03840 -1.46e+00 -1.31000 *
burrow_def.JJA -0.11000 0.01970 -1.48e-01 -0.07100 *
burrow_gap.frac.10 -0.03150 0.04090 -1.08e-01 0.04930
burrow_tmmn.DJF 0.17000 0.01800 1.34e-01 0.20500 *
burrow_s.roughness -0.00460 0.01750 -3.95e-02 0.02940
burrow_Nitrogen.mean 0.07950 0.01840 4.35e-02 0.11500 *
burrow_cec30 -0.05220 0.01860 -8.67e-02 -0.01320 *
burrow_nrd.15cm.2m 0.05080 0.02740 -3.28e-03 0.10400
burrow_cwd -0.04320 0.02030 -8.30e-02 -0.00315 *
burrow_landherbAgr 0.05700 0.07620 -9.27e-02 0.20600
burrow_landshrubScrub -0.41300 0.08740 -5.86e-01 -0.24800 *
burrow_landwetland -0.20400 0.06430 -3.28e-01 -0.07960 *
run_intercept -3.81000 0.05590 -3.92e+00 -3.70000 *
run_def.JJA 0.08950 0.03090 2.39e-02 0.14800 *
run_gap.frac.10 -0.17500 0.06300 -2.97e-01 -0.05010 *
run_tmmn.DJF -0.21200 0.02830 -2.69e-01 -0.16000 *
run_s.roughness 0.05010 0.02700 -4.23e-03 0.10400
run_Nitrogen.mean 0.12900 0.02660 7.60e-02 0.18000 *
run_cec30 0.00313 0.03020 -5.60e-02 0.06340
run_nrd.15cm.2m 0.06020 0.04280 -2.03e-02 0.14500
run_cwd 0.12600 0.02820 7.09e-02 0.18400 *
run_landherbAgr 0.25100 0.11100 3.85e-02 0.47700 *
run_landshrubScrub -0.56900 0.12600 -8.10e-01 -0.31600 *
run_landwetland -0.36400 0.09960 -5.61e-01 -0.16900 *
length_intercept -74.60000 1.04000 -7.67e+01 -72.60000 *
length_def.JJA 0.02850 0.54000 -1.11e+00 1.06000
length_gap.frac.10 -1.80000 1.13000 -3.95e+00 0.36200
length_tmmn.DJF 3.22000 0.52100 2.19e+00 4.23000 *
length_s.roughness -0.46300 0.47300 -1.36e+00 0.46000
length_Nitrogen.mean 0.46900 0.48300 -5.18e-01 1.38000
length_cec30 -1.08000 0.53700 -2.13e+00 -0.03320 *
length_nrd.15cm.2m 0.06230 0.76100 -1.39e+00 1.56000
length_cwd 0.41400 0.53100 -6.42e-01 1.45000
length_landherbAgr 3.82000 2.04000 -1.22e-01 7.82000
length_landshrubScrub -8.24000 2.36000 -1.28e+01 -3.77000 *
length_landwetland -8.77000 1.74000 -1.21e+01 -5.39000 *
diurnal_intercept -0.75500 0.02630 -8.06e-01 -0.70400 *
diurnal_def.JJA -0.02710 0.01360 -5.39e-02 -0.00141 *
diurnal_gap.frac.10 -0.04260 0.02830 -9.79e-02 0.01410
diurnal_tmmn.DJF 0.04430 0.01330 1.79e-02 0.06960 *
diurnal_s.roughness 0.03430 0.01210 1.07e-02 0.05780 *
diurnal_Nitrogen.mean 0.01210 0.01270 -1.25e-02 0.03710
diurnal_cec30 -0.02180 0.01310 -4.63e-02 0.00415
diurnal_nrd.15cm.2m 0.07480 0.01930 3.80e-02 0.11300 *
diurnal_cwd 0.04640 0.01240 2.28e-02 0.07150 *
diurnal_landherbAgr 0.09010 0.05220 -9.26e-03 0.19100
diurnal_landshrubScrub -0.01300 0.05840 -1.25e-01 0.10000
diurnal_landwetland -0.00840 0.04680 -9.67e-02 0.08200
flight_intercept -3.94000 0.07610 -4.09e+00 -3.78000 *
flight_def.JJA 0.32900 0.04410 2.41e-01 0.41500 *
flight_gap.frac.10 -0.19200 0.09070 -3.61e-01 -0.01500 *
flight_tmmn.DJF 0.17800 0.04070 9.81e-02 0.25700 *
flight_s.roughness -0.25400 0.03930 -3.36e-01 -0.18000 *
flight_Nitrogen.mean -0.08400 0.03740 -1.58e-01 -0.01340 *
flight_cec30 -0.23700 0.04240 -3.18e-01 -0.15300 *
flight_nrd.15cm.2m 0.01370 0.06520 -1.12e-01 0.14800
flight_cwd -0.10900 0.04080 -1.89e-01 -0.03230 *
flight_landherbAgr 1.04000 0.15100 7.42e-01 1.35000 *
flight_landshrubScrub 0.27400 0.17800 -8.72e-02 0.61800
flight_landwetland -0.02650 0.14200 -3.06e-01 0.25000
trophicother_intercept -0.19600 0.01220 -2.20e-01 -0.17200 *
trophicother_def.JJA 0.03850 0.00703 2.43e-02 0.05190 *
trophicother_gap.frac.10 -0.01980 0.01320 -4.59e-02 0.00692
trophicother_tmmn.DJF -0.04480 0.00633 -5.73e-02 -0.03230 *
trophicother_s.roughness -0.00612 0.00609 -1.79e-02 0.00582
trophicother_Nitrogen.mean -0.02210 0.00617 -3.37e-02 -0.00970 *
trophicother_cec30 -0.01380 0.00634 -2.61e-02 -0.00178 *
trophicother_nrd.15cm.2m 0.03510 0.00993 1.71e-02 0.05420 *
trophicother_cwd -0.01110 0.00682 -2.43e-02 0.00214
trophicother_landherbAgr 0.02290 0.02300 -2.17e-02 0.06980
trophicother_landshrubScrub 0.06660 0.02740 1.56e-02 0.12200 *
trophicother_landwetland 0.07160 0.02010 3.05e-02 0.11000 *
trophicomnivorous_intercept -2.52000 0.04550 -2.61e+00 -2.43000 *
trophicomnivorous_def.JJA 0.02560 0.02540 -2.56e-02 0.07450
trophicomnivorous_gap.frac.10 -0.02940 0.05120 -1.28e-01 0.07350
trophicomnivorous_tmmn.DJF 0.16100 0.02360 1.14e-01 0.20600 *
trophicomnivorous_s.roughness -0.06340 0.02350 -1.10e-01 -0.01740 *
trophicomnivorous_Nitrogen.mean 0.06910 0.02230 2.53e-02 0.11200 *
trophicomnivorous_cec30 -0.13300 0.02440 -1.81e-01 -0.08480 *
trophicomnivorous_nrd.15cm.2m 0.17200 0.03600 1.04e-01 0.24600 *
trophicomnivorous_cwd -0.00739 0.02400 -5.35e-02 0.04030
trophicomnivorous_landherbAgr 0.84800 0.08970 6.67e-01 1.03000 *
trophicomnivorous_landshrubScrub -0.09710 0.10600 -3.02e-01 0.11200
trophicomnivorous_landwetland -0.04600 0.08430 -2.16e-01 0.11200
trophicpredaceous_intercept -2.48000 0.04970 -2.58e+00 -2.39000 *
trophicpredaceous_def.JJA -0.01990 0.02550 -6.90e-02 0.03110
trophicpredaceous_gap.frac.10 -0.07220 0.05390 -1.81e-01 0.03180
trophicpredaceous_tmmn.DJF -0.03160 0.02330 -7.71e-02 0.01560
trophicpredaceous_s.roughness 0.04140 0.02160 5.73e-04 0.08370 *
trophicpredaceous_Nitrogen.mean -0.01090 0.02410 -5.65e-02 0.03440
trophicpredaceous_cec30 0.07390 0.02410 2.55e-02 0.12100 *
trophicpredaceous_nrd.15cm.2m -0.12900 0.03450 -1.96e-01 -0.06300 *
trophicpredaceous_cwd 0.02640 0.02480 -2.19e-02 0.07520
trophicpredaceous_landherbAgr -0.56000 0.09830 -7.53e-01 -0.36400 *
trophicpredaceous_landshrubScrub -0.42900 0.11000 -6.44e-01 -0.20900 *
trophicpredaceous_landwetland -0.51100 0.08330 -6.74e-01 -0.35200 *
colorother_intercept -0.51500 0.02160 -5.59e-01 -0.47500 *
colorother_def.JJA -0.01140 0.01220 -3.52e-02 0.01300
colorother_gap.frac.10 0.02970 0.02490 -1.87e-02 0.07640
colorother_tmmn.DJF -0.00859 0.01130 -3.05e-02 0.01400
colorother_s.roughness -0.02690 0.01040 -4.66e-02 -0.00709 *
colorother_Nitrogen.mean 0.08190 0.01100 6.01e-02 0.10400 *
colorother_cec30 -0.00066 0.01160 -2.41e-02 0.02160
colorother_nrd.15cm.2m 0.05970 0.01710 2.75e-02 0.09510 *
colorother_cwd -0.00796 0.01150 -3.17e-02 0.01370
colorother_landherbAgr 0.09140 0.04280 1.11e-02 0.17800 *
colorother_landshrubScrub -0.06050 0.04960 -1.55e-01 0.03440
colorother_landwetland 0.00928 0.03720 -6.23e-02 0.08480
colorblack_intercept -3.92000 0.05790 -4.03e+00 -3.80000 *
colorblack_def.JJA -0.03670 0.03210 -1.02e-01 0.02560
colorblack_gap.frac.10 -0.12100 0.06360 -2.42e-01 0.00432
colorblack_tmmn.DJF 0.26200 0.02950 2.03e-01 0.31900 *
colorblack_s.roughness -0.05200 0.02850 -1.05e-01 0.00652
colorblack_Nitrogen.mean -0.05560 0.02820 -1.14e-01 -0.00143 *
colorblack_cec30 -0.18600 0.03090 -2.48e-01 -0.12400 *
colorblack_nrd.15cm.2m 0.11400 0.04340 2.74e-02 0.19700 *
colorblack_cwd 0.00464 0.03070 -5.37e-02 0.06530
colorblack_landherbAgr 0.35600 0.11400 1.43e-01 0.58100 *
colorblack_landshrubScrub -0.07410 0.13300 -3.28e-01 0.17900
colorblack_landwetland -0.23200 0.09880 -4.26e-01 -0.04290 *
colorbrown_intercept -0.76400 0.02800 -8.20e-01 -0.71200 *
colorbrown_def.JJA 0.09220 0.01530 6.24e-02 0.12200 *
colorbrown_gap.frac.10 -0.03060 0.03150 -9.18e-02 0.03050
colorbrown_tmmn.DJF -0.16900 0.01310 -1.94e-01 -0.14300 *
colorbrown_s.roughness 0.05080 0.01310 2.55e-02 0.07690 *
colorbrown_Nitrogen.mean 0.00970 0.01350 -1.75e-02 0.03510
colorbrown_cec30 0.11400 0.01380 8.82e-02 0.14300 *
colorbrown_nrd.15cm.2m -0.09560 0.02010 -1.35e-01 -0.05690 *
colorbrown_cwd 0.01120 0.01330 -1.40e-02 0.03700
colorbrown_landherbAgr -0.13600 0.05400 -2.44e-01 -0.03270 *
colorbrown_landshrubScrub -0.32500 0.06230 -4.44e-01 -0.20200 *
colorbrown_landwetland -0.26300 0.04970 -3.60e-01 -0.16800 *