| predict.wrda | R Documentation |
Prediction of response and lc scores from environment data
using cca0 and wrda models.
## S3 method for class 'wrda'
predict(
object,
...,
type = c("response", "lc"),
rank = "full",
newdata = NULL,
weights = NULL,
scaling = "symmetric"
)
object |
return value of |
... |
Other arguments passed to the function (currently ignored). |
type |
type of prediction, |
rank |
rank (number of axes to use). Default "full" for all axes (no rank-reduction). |
newdata |
Data in which to look for variables with which to predict. |
weights |
list of weights of species and of sites in |
scaling |
numeric (1,2 or 3) or character |
Variables that are in the model but not in newdata are set to their
weighted means in the training data. Predictions are thus at the (weighted)
mean of the quantitative variables not included. Predictions with
not-included factors are at the reference level (the first level of the
factor).
In a cca0 model with type = "response",
many of the predicted values may be negative,
indicating expected absences (0) or small expected response values.
a matrix with the predictions. The exact content of the matrix
depends on the type of predictions that are being made.
data("dune_trait_env")
# rownames are carried forward in results
rownames(dune_trait_env$comm) <- dune_trait_env$comm$Sites
abun <- dune_trait_env$comm[, -1] # must delete "Sites"
mod <- cca0(formula = abun ~ A1 + Moist + Mag + Use + Manure,
data = dune_trait_env$envir)
mod # Proportions equal to those Canoco 5.15
scores(mod, which_cor = c("A1", "X_lot"), display = "cor")
set.seed(123)
anova(mod)
anova(mod, by = "axis")
mod2 <- vegan::cca(abun ~ A1 + Moist + Mag + Use + Manure,
data = dune_trait_env$envir)
anova(mod2, by = "axis")
dat <- dune_trait_env$envir
dat$Mag <- "SF"
predict(mod, type = "lc", newdata = dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.