Description Usage Arguments Details Value Author(s) References See Also Examples
Function predict
can be used to find site and species scores or
estimates of the response data with new data sets, Function
calibrate
estimates values of constraints with new data set.
Functions fitted
and residuals
return estimates of
response data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23  ## S3 method for class 'cca'
fitted(object, model = c("CCA", "CA", "pCCA"),
type = c("response", "working"), ...)
## S3 method for class 'capscale'
fitted(object, model = c("CCA", "CA", "pCCA", "Imaginary"),
type = c("response", "working"), ...)
## S3 method for class 'cca'
residuals(object, ...)
## S3 method for class 'cca'
predict(object, newdata, type = c("response", "wa", "sp", "lc", "working"),
rank = "full", model = c("CCA", "CA"), scaling = "none",
hill = FALSE, ...)
## S3 method for class 'rda'
predict(object, newdata, type = c("response", "wa", "sp", "lc", "working"),
rank = "full", model = c("CCA", "CA"), scaling = "none",
correlation = FALSE, ...)
## S3 method for class 'cca'
calibrate(object, newdata, rank = "full", ...)
## S3 method for class 'cca'
coef(object, ...)
## S3 method for class 'decorana'
predict(object, newdata, type = c("response", "sites", "species"),
rank = 4, ...)

object 
A result object from 
model 
Show constrained ( 
newdata 
New data frame to be used in prediction or in
calibration. Usually this a new community data frame, but with

type 
The type of prediction, fitted values or residuals:

rank 
The rank or the number of axes used in the approximation.
The default is to use all axes (full rank) of the 
scaling 
logical, character, or numeric; Scaling or predicted
scores with the same meaning as in 
correlation, hill 
logical; correlationlike scores or Hill's
scaling as appropriate for RDA/ 
... 
Other parameters to the functions. 
Function fitted
gives the approximation of the original data
matrix or dissimilarities from the ordination result either in the
scale of the response or as scaled internally by the function.
Function residuals
gives the approximation of the original
data from the unconstrained ordination. With argument type =
"response"
the fitted.cca
and residuals.cca
function
both give the same marginal totals as the original data matrix, and
fitted and residuals do not add up to the original data. Functions
fitted.capscale
and residuals.capscale
give the
dissimilarities with type = "response"
, but these are not
additive, but the "working"
scores are additive. All
variants of fitted
and residuals
are defined so that
for model mod < cca(y ~ x)
, cca(fitted(mod))
is equal
to constrained ordination, and cca(residuals(mod))
is equal
to unconstrained part of the ordination.
Function predict
can find the estimate of the original data
matrix or dissimilarities (type = "response"
) with any rank.
With rank = "full"
it is identical to fitted
. In
addition, the function can find the species scores or site scores from
the community data matrix for cca
or rda
.
The function can be used with new data, and it can be used to add new
species or site scores to existing ordinations. The function returns
(weighted) orthonormal scores by default, and you must specify
explicit scaling
to add those scores to ordination
diagrams. With type = "wa"
the function finds the site scores
from species scores. In that case, the new data can contain new sites,
but species must match in the original and new data. With type="sp"
the function finds species scores from site constraints
(linear combination scores). In that case the new data can contain new
species, but sites must match in the original and new data. With
type = "lc"
the function finds the linear combination scores
for sites from environmental data. In that case the new data frame
must contain all constraining and conditioning environmental variables
of the model formula. With type = "response"
or
type = "working"
the new data must contain environmental variables
if constrained component is desired, and community data matrix if
residual or unconstrained component is desired. With these types, the
function uses newdata
to find new "lc"
(constrained) or
"wa"
scores (unconstrained) and then finds the response or
working data from these new row scores and species scores. The
original site (row) and species (column) weights are used for
type = "response"
and type = "working"
in correspondence
analysis (cca
) and therefore the number of rows must
match in the original data and newdata
.
If a completely new data frame is created, extreme care is needed
defining variables similarly as in the original model, in particular
with (ordered) factors. If ordination was performed with the formula
interface, the newdata
can be a data frame or matrix, but
extreme care is needed that the columns match in the original and
newdata
.
Function calibrate.cca
finds estimates of constraints from
community ordination or "wa"
scores from cca
,
rda
and capscale
. This is often known as
calibration, bioindication or environmental reconstruction.
Basically, the method is similar to projecting site scores onto biplot
arrows, but it uses regression coefficients. The function can be called
with newdata
so that crossvalidation is possible. The
newdata
may contain new sites, but species must match in the
original and new data. The function
does not work with ‘partial’ models with Condition
term,
and it cannot be used with newdata
for capscale
results. The results may only be interpretable for continuous variables.
Function coef
will give the regression coefficients from centred
environmental variables (constraints and conditions) to linear
combination scores. The coefficients are for unstandardized environmental
variables. The coefficients will be NA
for aliased effects.
Function predict.decorana
is similar to predict.cca
.
However, type = "species"
is not available in detrended
correspondence analysis (DCA), because detrending destroys the mutual
reciprocal averaging (except for the first axis when rescaling is not
used). Detrended CA does not attempt to approximate the original data
matrix, so type = "response"
has no meaning in detrended
analysis (except with rank = 1
).
The functions return matrices, vectors or dissimilarities as is appropriate.
Jari Oksanen.
Greenacre, M. J. (1984). Theory and applications of correspondence analysis. Academic Press, London.
cca
, rda
, capscale
,
decorana
, vif
, goodness.cca
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21  data(dune)
data(dune.env)
mod < cca(dune ~ A1 + Management + Condition(Moisture), data=dune.env)
# Definition of the concepts 'fitted' and 'residuals'
mod
cca(fitted(mod))
cca(residuals(mod))
# Remove rare species (freq==1) from 'cca' and find their scores
# 'passively'.
freq < specnumber(dune, MARGIN=2)
freq
mod < cca(dune[, freq>1] ~ A1 + Management + Condition(Moisture), dune.env)
predict(mod, type="sp", newdata=dune[, freq==1], scaling=2)
# New sites
predict(mod, type="lc", new=data.frame(A1 = 3, Management="NM", Moisture="2"), scal=2)
# Calibration and residual plot
mod < cca(dune ~ A1 + Moisture, dune.env)
pred < calibrate(mod)
pred
with(dune.env, plot(A1, pred[,"A1"]  A1, ylab="Prediction Error"))
abline(h=0)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.