fourthcorner(tabR, tabL, tabQ, modeltype = 1, nrepet = 999, tr01 = FALSE)
fourthcorner2(tabR, tabL, tabQ, modeltype = 1, nrepet = 999, tr01 = FALSE)
## S3 method for class '4thcorner':
print(x, varQ = 1:nrow(x$tabG), varR = 1:ncol(x$tabG),...)
## S3 method for class '4thcorner':
summary(object,...)
## S3 method for class '4thcorner':
plot(x, type=c("D","D2","G"), alpha=0.05,...)
combine.4thcorner(four1,four2)
tabL
must be transformed to presence-absence data (FALSE by default)tabR
tabQ
fourthcorner
function, a list where:
tabD, tabDmin, tabDmax, tabDmoy, tabDNEQ, tabDNLT, tabDProb, tabDNperm
are dataframes with observed statistic; minimum, maximum, average statistics obtained by the permutation procedure; number of simulated values equal to the observed statistic; number of simulated values less than the observed statistic; P-values; and number of permutations. Results are given for cells of the fourth-corner (homogeneity for quant./qual.).
tabG, tabGmin, tabGmax, tabGmoy, tabGNEQ, tabGNLT, tabGProb, tabGNperm
are dataframes with observed statistic; minimum, maximum, average statistics obtained by the permutation procedure; number of simulated values equal to the observed statistic; number of simulated values less than the observed statistic; P-values; and number of permutations. Results are given for variables (Pearson's Chi2 for qual./qual.).
tabD2, tabD2min, tabD2max, tabD2moy, tabD2NEQ, tabD2NLT, tabD2Prob, tabD2Nperm
are dataframes with observed statistic; minimum, maximum, average statistics obtained by the permutation procedure; number of simulated values equal to the observed statistic; number of simulated values less than the observed statistic; P-values; and number of permutations. Results are given for cells of the fourth-corner (Pearson r for quant./qual.).
tabG2, tabG2min, tabG2max, tabG2moy, tabG2NEQ, tabG2NLT, tabG2Prob, tabG2Nperm
are dataframes with observed statistic; minimum, maximum, average statistics obtained by the permutation procedure; number of simulated values equal to the observed statistic; number of simulated values less than the observed statistic; P-values; and number of permutations. Results are given for variables (G for qual./qual.) The fourthcorner2
function returns a list where:
tabG, tabGmin, tabGmax, tabGmoy, tabGNEQ, tabGNLT, tabGProb, tabGNperm
are dataframes with observed statistic; minimum, maximum, average statistics obtained by the permutation procedure; number of simulated values equal to the observed statistic; number of simulated values less than the observed statistic; P-values; and number of permutations. Results are given for variables. It returns also the list trRLQ
with results for the multivariate statistic.
fourthcorner
function, the link is measured by a Pearson correlation coefficient for two quantitatives 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)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 siginficant, light grey for negative sgnificant
and dark grey for positive suignficant 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.
The function combine.4thcorner
combines the outputs of two
fourth-corner objects as described in Dray and Legendre (2008). It
returns an object of the class 4thcorner
. The function simply
creates a new 4th.corner
object where pvalues are equal to the
maximum of pvalues of the two arguments.
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.
rlq
data(aviurba)
four1<-fourthcorner(aviurba$mil,aviurba$fau,aviurba$traits,nrepet=99)
print(four1,varR=2,varQ=3)
summary(four1)
plot(four1, type = "G")
## Procedure to combine the results of two models proposed in Dray and Legendre (2008)
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)
plot(four.comb, type = "G")
Run the code above in your browser using DataLab