Learn R Programming

douconca (version 1.2.3)

coef.dcca: Coefficients of double-constrained correspondence analysis (dc-CA)

Description

Fourth-corner coefficients and regression coefficients (of full or reduced rank) to predict traits from environment, environment from traits and response from trait and environment data.

Usage

# S3 method for dcca
coef(
  object,
  ...,
  type = c("fourth_corner", "all_reg", "env2traits_reg", "traits2env_reg"),
  rank = "full",
  normed = TRUE
)

Value

a matrix with coefficients. The exact content of the matrix depends on the type of coefficient that is asked for.

Regression coefficients for a response variable are usually column-vectors. With X the matrix of units-by-predictors and B the matrix of predictors-by-response-variables, predictions or fits are of the form Y = XB. Analogously, type = "trait2env" gives a trait-by-environment matrix and type = "env2traits" gives an environment-by-trait matrix.

Arguments

object

return value of dc_CA.

...

Other arguments passed to the function (currently ignored).

type

type of coefficients, c("fourth_corner", "all_reg", "env2traits_reg", "traits2env_reg") for fourth-corner coefficients and regression coefficients for all trait x environmental predictors, environmental predictors only and trait predictors only for prediction of the (transformed) response, traits and environmental values, respectively.

rank

rank (number of axes to use). Default "full" for all axes (no rank-reduction).

normed

logical (default TRUE) giving standardized regression coefficients and biplot scores. When FALSE, (regular) regression coefficients and (unstandardized) biplot scores.

Details

Regression coefficients are for standardized traits and environmental variables.

With covariates, coef() gives partialfourth-corner correlations. With rank = 2, coef() gives the two-dimensional approximation of the full-rank fourth-corner correlations in the biplot that displays the traits and environmental variables at arrow heads or points at scores(mod, display = c("bp", "bp_traits")).

Examples

Run this code
data("dune_trait_env")

# rownames are carried forward in results
rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites

mod <- dc_CA(formulaEnv = ~ A1 + Moist + Mag + Use + Condition(Manure),
             formulaTraits = ~ SLA + Height + LDMC + Condition(Seedmass) + Lifespan,
             response = dune_trait_env$comm[, -1],  # must delete "Sites"
             dataEnv = dune_trait_env$envir,
             dataTraits = dune_trait_env$traits,
             verbose = FALSE)

# regression coefficients
coef(mod, type = "env2traits")
coef(mod, type = "traits2env")
coef(mod, type = "fourth")
coef(mod, type = "all_reg")

Run the code above in your browser using DataLab