Performs a co-inertia of the triplets \((Q_1,K_1,R_0)\) and \((Q_2,K_2,R_0)\).

coinertia(y, ...)

# S3 method for default
coinertia(y, x, n.axes = NULL, weights = NULL,
          symmetric = FALSE, ...)

Arguments

y, x

matrices or data frames of the two data sets for which axes of covariance are sought.

n.axes

numeric; the number of coinertia axes to retain.

weights

a vector of weights for the samples. If NULL, weights are chosen from the row sums of y (symmetric = FALSE) or the average of the row sums of y and x (symmetric = TRUE).

symmetric

logical; should a symmetric set of weights be used. See Details.

...

arguments passed to other functions. Currently ignored.

Value

An object of class "coinertia", which is a list with the following components:

scores

a list of ordination scores, with components species and sites, each of which is a list with components Y and X that refer to the scores for the input matrices y and x respectively.

weights

numeric vector of row weights used in the analysis.

lambda

numeric vector of Eigenvalues.

n.axes

numeric; the number of coinertia axes extracted

symmetric

logical; was a symmetric analysis performed?

call

the matched call.

References

Ter Braak, C.J.F and Schaffers, A.P. (2004) Co-Correspondence Analysis: a new ordination method to relate two community compositions. Ecology 85(3), 834--846

Doledec, S and Chessel, D. (1994) Co-inertia analysis: a method for studying species-environment relationships. Freshwater Biology 31, 277--294

Author

Gavin L. Simpson, based on original Matlab code by C.J.F. ter Braak and A.P. Schaffers.

See also

symcoca for the function that calls fitCoinertia and coinertiaI for co-inertia analysis using identity matrices for \(K_1\), \(K_2\), and \(R_0\).

Examples

od <- options(digits = 4)
data(beetles, plants)
coin <- coinertia(beetles, plants)
#> some species contain no data and were removed from data matrix y
#> some species contain no data and were removed from data matrix x
coin
#> 
#> Coinertia Analysis
#> 
#> Call: coinertia.default(y = beetles, x = plants)
#> 
#> Eigenvalues:
#>  COIN1    COIN2    COIN3    COIN4    COIN5    COIN6    COIN7    COIN8   
#>  0.591    0.316    0.203    0.104    0.067    0.061    0.053    0.044   
#>  COIN9   COIN10   COIN11   COIN12   COIN13   COIN14   COIN15   COIN16   
#>  0.035    0.023    0.022    0.014    0.013    0.011    0.010    0.008   
#> COIN17   COIN18   COIN19   COIN20   COIN21   COIN22   COIN23   COIN24   
#>  0.007    0.005    0.004    0.003    0.003    0.002    0.002    0.002   
#> COIN25   COIN26   COIN27   COIN28   COIN29   
#>  0.001    0.001    0.001    0.000    0.000   
options(od)