rcqo(n, p, S, Rank = 1,
family = c("poisson", "negbinomial", "binomial-poisson",
"Binomial-negbinomial", "ordinal-poisson",
"Ordinal-negbinomial", "gamma2"),
EqualMaxima = FALSE, EqualTolerances = TRUE, ESOptima = FALSE,
loabundance = if (EqualMaxima) hiabundance else 10,
hiabundance = 100, sdlv = head(1.5/2^(0:3), Rank),
sdOptima = ifelse(ESOptima, 1.5/Rank, 1) * ifelse(scalelv, sdlv, 1),
sdTolerances = 0.25, Kvector = 1, Shape = 1,
sqrt = FALSE, Log = FALSE, rhox = 0.5, breaks = 4,
seed = NULL, Crow1positive=TRUE, xmat = NULL, scalelv = TRUE)breaks argument is passed into
the breaks argument of loabundance and hiabundance.TRUE then the common value is 1 along
every latent variable, i.e., all species' tolerance matrices are the
order-$R$ identity matrix.TRUE then the quantity
$S^{1/R}$ must be an
integer with value 2 or more. That is, there has to be an
appropriate number of species in total. This is so that a grid
ofloabundance and hiabundance. That is,
at their optimal environment, the mean abundance of each
species is between the two cESOptima=FALSE then,
for the $r$th latent variable axis,
the optima of the species are generated from a
normal distribution centered about 0.
If ESOptima=TRUEEqualTolerances=FALSE then, for the
$r$th latent variable, the
species' tolerances are
chosen from a normal distribution with mean 1 and
standard deviation
sdTolerances[r].
However, the first snegbinomial for details).
Note that a natural default value does not exist, gamma2 for details). Note that a natural default value
does not exist, howsqrt=TRUE when family="negbinomial" means
that the resulting species data can be considered very crudely to be
approximately Poisson distributedLog=TRUE when family="gamma2" means
that the resulting species data can be considered very crudely to be
approximately Gaussian distributed about itsrhox in the off-diagonals.
Note that each environmental variable is family is assigned an ordinal value then this argument
is used to define the cutpoints. It is fed into the
breaks argument of cut.set.seed.
This argument can be used to obtain reproducible results.
If set, the value is saved as the "seed"
attribute of the returned value.qrrvglm.control for details.FALSE the argument
sdlv is ignored and no scaling of the latent variable
values is performed.x1 is not present; it is effectively a vector
of ones since it corresponds to an intercept term when
cqo is applied to the data.family.formula argument of
cqo.log(loabundance) and log(hiabundance).sdlv."break",
"family", "Rank",
"loabundance", "hiabundance",
"EqualTolerances", "EqualMaxima",
"seed" as used.ESOptima = TRUE, EqualMaxima = TRUE,
EqualTolerances = TRUE. At present, the Poisson and negative binomial abundances are
generated first using loabundance and hiabundance,
and if family is binomial or ordinal then it is converted into
these forms.
In CQO theory the $n \times p$ matrix $X$ is partitioned into two parts $X_1$ and $X_2$. The matrix $X_2$ contains the `real' environmental variables whereas the variables in $X_1$ are just for adjustment purposes; they contain the intercept terms and other variables that one wants to adjust for when (primarily) looking at the variables in $X_2$. This function has $X_1$ only being a matrix of ones, i.e., containing an intercept only.
Yee, T. W. (2006) Constrained additive ordination. Ecology, 87, 203--213.
ter Braak, C. J. F. and Prentice, I. C. (1988) A theory of gradient analysis. Advances in Ecological Research, 18, 271--317.
cqo,
qrrvglm.control,
cut,
binomialff,
poissonff,
negbinomial,
gamma2,
gaussianff.# Example 1: Species packing model:
n = 100; p = 5; S = 5
mydata = rcqo(n, p, S, ESOpt=TRUE, EqualMax=TRUE)
names(mydata)
myform = attr(mydata, "formula")Run the code above in your browser using DataLab