varls: Procrustean Correlation, and Variance / Covariance Matrices.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/covls.R

Description

varls, corls compute the procrustean variance / covariance, or correlation matrices between a set of real matrices and dist objects.

Usage

1
2
3
varls(..., nrand = 100, p_adjust_method = "holm")

corls(..., nrand = 100, p_adjust_method = "holm")

Arguments

...

the set of matrices or a procmod_frame object.

nrand

number of randomisation used to estimate the mean covariance observed between two random matrix. If rand is NULL or equal to 0, no correction is estimated and the raw procrustean covariances are estimated.

p_adjust_method

the multiple test correction method used to adjust p values. p_adjust_method belongsone of the folowing values: "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none". The default is,set to "holm".

Details

Procrustean covariance between two matrices X and Y, is defined as the sum of the singular values of the X'Y matrix \insertCiteGower:71:00,Lingoes:74:00ProcMod. Both the X and Y matrices must have the same number of rows.

The variances and covariances and correlations are corrected to avoid over fitting \insertCiteCoissac-Eric:19:00ProcMod.

The inputs must be numeric matrices or dist object. The set of input matrices can be aggregated un a procmod_frame.

Before computing the coefficients, matrices are projected into an orthogonal space using the ortho function.

The denominator n - 1 is used which gives an unbiased estimator of the (co)variance for i.i.d. observations.

Value

a procmod_varls object which corresponds to a numeric matrix annotated by several attributes.

The following attribute is always added:

- nrand an integer value indicating the number of randomisations used to estimate the mean of the random covariance.

When nrand is greater than 0 a couple of attributes is added:

- rcovls a numeric matrix containing the estimation of the mean of the random covariance.

- p.value a numeric matrix containing the estimations of the p.values of tests checking that the observed covariance is larger than the mean of the random covariance. p.values are corrected for multiple tests according to the method specified by the p_adjust_method parameter.

Author(s)

Eric Coissac

Christelle Gonindard-Melodelima

References

\insertRef

Gower:71:00ProcMod

\insertRef

Lingoes:74:00ProcMod

\insertRef

Coissac-Eric:19:00ProcMod

See Also

p.adjust

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# Build Three matrices of 3 rows.
A <- simulate_matrix(10,3)
B <- simulate_matrix(10,5)
C <- simulate_correlation(B,10,r2=0.6)

# Computes the variance covariance matrix
varls(A = A, B = B, C = C)

data = procmod_frame(A = A, B = B, C = C)
varls(data)

# Computes the correlation matrix
corls(data, nrand = 100)

ProcMod documentation built on May 12, 2021, 9:08 a.m.

Related to varls in ProcMod...