# RDA with all explanatory variables except dfs
spe.rda.all <- rda(spe.hel ~ ., data = env2)
# Global adjusted R^2
(R2a.all <- RsquareAdj(spe.rda.all)$adj.r.squared)
# Forward selection using forward.sel() {adespatial}
forward.sel(spe.hel, env2, adjR2thresh = R2a.all)
The result shows that one can devise an explanatory model of the fish community
that is much more parsimonious than the model involving all explanatory variables.
Three variables (ele, oxy and bod) suffice to obtain an R
2
adj close (0.5401) to that
of the global model (0.5864).
Forward selection with function ordistep()
The working of the ordistep() function of vegan is inspired from the step()
function of stats for model selection. ordistep() accepts quantitative as well
as factor explanatory variables, allows forward, backward and stepwise
(a combination) selection. It can be applied to RDA, CCA (Sect. 6.4) and db-RDA
(Sect. 6.3.3). In this function, one first provides an “empty” model, i.e., a model with
intercept only, and a “scope” model containing all candidate variables. In forward
selection, variables are added in order of decreasing F-values, each addition being
tested by permutation, and stops when the permutational probability exceeds the
predefined α significance level (here argument Pin). In case of equality of the Fstatistic of two variables during selection, the variable that has the lowest value of the
Akaike Information Criterion (AIC) is selected for inclusion in the model.
ordistep() also allows backward selection (variables are removed from the
complete model until only the significant ones remain) and a “stepwise” selection
(argument direction ¼ "both") where variables enter the model if their
permutational probability is smaller than or equal to the predefined Pin value,
and removed if, within the model under construction, their probability (which
changes after each inclusion of a new variable), becomes larger than Pout.
# Forward selection using vegan's ordistep()
# This function allows the use of factors.
mod0 <- rda(spe.hel ~ 1, data = env2)
step.forward
scope = formula(spe.rda.all),
direction = "forward",
permutations = how(nperm = 499)
)
RsquareAdj(step.forward)
228
6 Canonical Ordination
spe.rda.all <- rda(spe.hel ~ ., data = env2)
# Global adjusted R^2
(R2a.all <- RsquareAdj(spe.rda.all)$adj.r.squared)
# Forward selection using forward.sel() {adespatial}
forward.sel(spe.hel, env2, adjR2thresh = R2a.all)
The result shows that one can devise an explanatory model of the fish community
that is much more parsimonious than the model involving all explanatory variables.
Three variables (ele, oxy and bod) suffice to obtain an R
2
adj close (0.5401) to that
of the global model (0.5864).
Forward selection with function ordistep()
The working of the ordistep() function of vegan is inspired from the step()
function of stats for model selection. ordistep() accepts quantitative as well
as factor explanatory variables, allows forward, backward and stepwise
(a combination) selection. It can be applied to RDA, CCA (Sect. 6.4) and db-RDA
(Sect. 6.3.3). In this function, one first provides an “empty” model, i.e., a model with
intercept only, and a “scope” model containing all candidate variables. In forward
selection, variables are added in order of decreasing F-values, each addition being
tested by permutation, and stops when the permutational probability exceeds the
predefined α significance level (here argument Pin). In case of equality of the Fstatistic of two variables during selection, the variable that has the lowest value of the
Akaike Information Criterion (AIC) is selected for inclusion in the model.
ordistep() also allows backward selection (variables are removed from the
complete model until only the significant ones remain) and a “stepwise” selection
(argument direction ¼ "both") where variables enter the model if their
permutational probability is smaller than or equal to the predefined Pin value,
and removed if, within the model under construction, their probability (which
changes after each inclusion of a new variable), becomes larger than Pout.
# Forward selection using vegan's ordistep()
# This function allows the use of factors.
mod0 <- rda(spe.hel ~ 1, data = env2)
step.forward
direction = "forward",
permutations = how(nperm = 499)
)
RsquareAdj(step.forward)
228
6 Canonical Ordination
