fourthcorner(tabR, tabL, tabQ, modeltype = 6, nrepet = 999, tr01 =
FALSE, p.adjust.method.G = p.adjust.methods, p.adjust.method.D =
p.adjust.methods, p.adjust.D = c("global", "levels"))
fourthcorner2(tabR, tabL, tabQ, modeltype = 6, nrepet = 999, tr01 =
FALSE, p.adjust.method.G = p.adjust.methods)
## S3 method for class '4thcorner':
print(x, varQ = 1:length(x$varnames.Q), varR =
1:length(x$varnames.R), stat = c("D", "D2"), ...)
## S3 method for class '4thcorner':
summary(object,...)
## S3 method for class '4thcorner':
plot(x, stat = c("D", "D2", "G"), type = c("table",
"biplot"), xax = 1, yax = 2, x.rlq = NULL, alpha = 0.05, col =
c("lightgrey", "red", "deepskyblue", "purple"), ...)
fourthcorner.rlq(xtest, nrepet = 999, modeltype = 6, typetest =
c("axes", "Q.axes", "R.axes"), p.adjust.method.G = p.adjust.methods,
p.adjust.method.D = p.adjust.methods, p.adjust.D = c("global",
"levels"), ...)
tabL
must be transformed to presence-absence data (FALSE by default)tabR
tabQ
p.adjust.methods
for possible choicesp.adjust.methods
for possible choicesrlq
function. Used to
represent results on a biplot (type should be "biplot" and object
created by the fourthcorner
functions)rlq
functionfourthcorner
function returns a a list where:
tabD
is a krandtest
object giving the results of tests
for cells of the fourth-corner (homogeneity for quant./qual.).
tabD2
is a krandtest
object giving the results of tests
for cells of the fourth-corner (Pearson r for quant./qual.).
tabG
is a krandtest
object giving the results of tests
for variables (Pearson's Chi2 for qual./qual.).
The fourthcorner2
function returns a list where:
tabG
is a krandtest
object giving the results of tests for
variables.
trRLQ
is a krandtest
object giving the results of tests for
the multivariate statistic (i.e. equivalent to randtest.rlq
function).fourthcorner
function, the link is measured by a Pearson correlation coefficient for two quantitative variables (trait and environmental variable), by a Pearson Chi2 and G statistic for two qualitative variables and by a Pseudo-F and Pearson r for one quantitative variable and one qualitative variable. The fourthcorner2 function offers a multivariate statistic (equal to the sum of eigenvalues of RLQ analysis) and measures the link between two variables by a square correlation coefficient (quant/quant), a Chi2/sum(L) (qual/qual) and a correlation ratio (quant/qual). The significance is tested by a permutation procedure. Different models are available:
modeltype
=1): Permute values for each species independently (i.e., permute within each column of table L)modeltype
=2): Permute values of sites (i.e., permute entire rows of table L)modeltype
=3): Permute values for each site independently (i.e., permute within each row of table L)modeltype
=4): Permute values of species (i.e., permute entire columns of table L)modeltype
=5): Permute values of species and after
(or before) permute values of sites (i.e., permute entire columns and
after (or before) entire rows of table L)modeltype
=6): combination of the outputs of models
2 and 4. Dray and Legendre (2008) and ter Braak et al. (20012) showed
that all models (except model 6) have inflated type I error.The function summary
returns results for variables (G). The
function print
returns results for cells (D and D2). In the case
of qualitative variables, Holm's corrected pvalues are also provided.
The function plot
produces a graphical representation of the
results (white for non significant, light grey for negative significant
and dark grey for positive significant relationships). Results can be
plotted for variables (G) or for cells (D and D2). In the case of
qualitative / quantitative association, homogeneity (D) or correlation
(D2) are plotted.
Legendre, P., R. Galzin, and M. L. Harmelin-Vivien. (1997) Relating behavior to habitat: solutions to the fourth-corner problem. Ecology, 78, 547--562.
Dray, S. and Legendre, P. (2008) Testing the species traits-environment relationships: the fourth-corner problem revisited. Ecology, 89, 3400--3412.
ter Braak, C., Cormont, A., and Dray, S. (2012) Improved testing of species traits-environment relationships in the fourth corner problem. Ecology, 93, 1525--1526.
Dray, S., Choler, P., Doledec, S., Peres-Neto, P.R., Thuiller, W., Pavoine, S. and ter Braak, C.J.F (2013) Combining the fourth-corner and the RLQ methods for assessing trait responses to environmental variation. Ecology, in press.
rlq
, combine.4thcorner
, p.adjust.methods
data(aviurba)
## Version using the sequential test (ter Braak et al 2012)
## as recommended in Dray et al (2013),
## using Holm correction of P-values (only 99 permutations here)
four.comb.default <- fourthcorner(aviurba$mil,aviurba$fau,aviurba$traits,nrepet=99)
summary(four.comb.default)
plot(four.comb.default, stat = "G")
## using fdr correction of P-values
four.comb.fdr <- fourthcorner(aviurba$mil, aviurba$fau, aviurba$traits,
nrepet = 99, p.adjust.method.G = 'fdr', p.adjust.method.D = 'fdr')
summary(four.comb.fdr)
plot(four.comb.fdr, stat = "G")
## Explicit procedure to combine the results of two models
## proposed in Dray and Legendre (2008);the above does this implicitly
four2 <- fourthcorner(aviurba$mil,aviurba$fau,aviurba$traits,nrepet=99,modeltype=2)
four4 <- fourthcorner(aviurba$mil,aviurba$fau,aviurba$traits,nrepet=99,modeltype=4)
four.comb <- combine.4thcorner(four2, four4)
summary(four.comb)
plot(four.comb, stat = "G")
Run the code above in your browser using DataLab