cov2pcov {biotools} | R Documentation |
Partial Covariance Matrix
Description
Compute a matrix of partial (co)variances for a group of variables with respect to another.
Take as the covariance matrix of dimension p. Now consider dividing
into two groups
of variables. The partial covariance matrices are calculate by:
Usage
cov2pcov(m, vars1, vars2 = seq(1, ncol(m))[-vars1])
Arguments
m |
a square numeric matrix. |
vars1 |
a numeric vector indicating the position (rows or columns in |
vars2 |
a numeric vector indicating the position (rows or columns in |
Value
A square numeric matrix.
Author(s)
Anderson Rodrigo da Silva <anderson.agro at hotmail.com>
See Also
Examples
(Cl <- cov(longley))
cov2pcov(Cl, 1:2)
# End (Not run)
[Package biotools version 4.2 Index]