FS.dcca | R Documentation |
Forward selection of traits or environmental variables using dc-CA.
## S3 method for class 'dcca'
FS(
mod,
...,
select = c("traits", "env"),
consider,
permutations = 999,
n_axes = "all",
initial_model = "1",
factor2categories = TRUE,
test = TRUE,
threshold_P = 0.1,
PvalAdjustMethod = "holm",
max_step = 10,
verbose = FALSE
)
mod |
dc-CA model. |
... |
unused. |
select |
Character, the default |
consider |
character vector of names considered for addition, either
trait names in |
permutations |
a list of control values for the permutations as
returned by the function |
n_axes |
number of eigenvalues to select upon.
The sum of |
initial_model |
character specifying what should be inside
|
factor2categories |
logical, default |
test |
logical; default: |
threshold_P |
significance level, after adjustment for testing multiplicity, for addition of a variable to the model. |
PvalAdjustMethod |
method for correction for multiple testing
in |
max_step |
maximal number of variables selected. |
verbose |
show progress, default: |
The selection is on the basis of the additional fit (inertia) of a variable given the variables already in the model.
The function FS
does not implement the max test and may thus
be liberal. It is recommended to test the final model (element
model_ final
of the returned object) by anova
.
list with three elements: final...
with selected variables,
model_final
, and process
with account of the selection process
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 <- dc_CA(formulaEnv = abun ~ Moist + Mag,
formulaTraits = ~ F + R + N + L,
dataEnv = dune_trait_env$envir,
dataTraits = dune_trait_env$traits,
verbose = FALSE)
# selection of traits with environmental model of mod (~ Moist+Mag)
out1 <- FS(mod, consider = c("F", "R", "N", "L"),
select = "traits", verbose = FALSE)
names(out1)
out1$finalWithOneExtra
out1$model_final
# selection of environmental variables with trait model of mod (~ F + R + N + L)
out2 <- FS(mod, consider = c("A1", "Moist", "Mag", "Use", "Manure"),
select= "env", verbose = FALSE)
names(out2)
out2$finalWithOneExtra
out2$model_final
# selection of environmental variables without a trait model
# i.e. with a single constraint
mod3 <- cca0(mod$data$Y ~ Moist, data = mod$data$dataEnv)
out3 <- FS(mod3, consider = c("A1", "Moist", "Mag", "Use", "Manure"),
threshold_P = 0.05)
out3$finalWithOneExtra
out3$model_final
# selection of traits without an environmental model
# i.e. with a single constraint
tY <- t(mod$data$Y)
mod4 <- cca0(tY ~ L, data = mod$data$dataTraits)
names(mod$data$dataTraits)
out4 <- FS(mod4,
consider = c("SLA", "Height", "LDMC", "Seedmass", "Lifespan",
"F", "R", "N", "L"))
out4$finalWithOneExtra
out4$model_final
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.