Learn R Programming

VGAM (version 0.8-3)

predict.qrrvglm: Predict Method for a CQO fit

Description

Predicted values based on a constrained quadratic ordination (CQO) object.

Usage

predict.qrrvglm(object, newdata=NULL,
                type=c("link", "response", "lv", "terms"),
                se.fit=FALSE, deriv=0, dispersion=NULL,
                extra=object@extra, varlvI = FALSE, reference = NULL, ...)

Arguments

object
Object of class inheriting from "qrrvglm".
newdata
An optional data frame in which to look for variables with which to predict. If omitted, the fitted linear predictors are used.
type, se.fit, dispersion, extra
deriv
Derivative. Currently only 0 is handled.
varlvI, reference
Arguments passed into Coef.qrrvglm.
...
Currently undocumented.

Value

Details

Obtains predictions from a fitted CQO object. Currently there are lots of limitations of this function; it is unfinished.

References

Yee, T. W. (2004) A new technique for maximum-likelihood canonical Gaussian ordination. Ecological Monographs, 74, 685--701.

See Also

cqo.

Examples

Run this code
hspider[,1:6]=scale(hspider[,1:6]) # Standardize the environmental variables
set.seed(1234)
# vvv p1 = cqo(cbind(Alopacce, Alopcune, Alopfabr, Arctlute, Arctperi, Auloalbi,
# vvv                Pardlugu, Pardmont, Pardnigr, Pardpull, Trocterr, Zoraspin) ~
# vvv          WaterCon + BareSand + FallTwig + CoveMoss + CoveHerb + ReflLux,
# vvv          fam=poissonff, data=hspider, Crow1positive=FALSE, ITol=TRUE)
# vvv sort(p1@misc$deviance.Bestof) # A history of all the iterations

# vvv head(predict(p1))

# The following should be all zeros
# vvv max(abs(predict(p1, new=head(hspider)) - head(predict(p1))))
# vvv max(abs(predict(p1, new=head(hspider), type="res") - head(fitted(p1))))

Run the code above in your browser using DataLab