matW | R Documentation |
Calculation of within (matW
) and between (matB
) covariance matrices for classes of observations.
matW(X, y)
matB(X, y)
X |
Data ( |
y |
Class membership ( |
The denominator in the variance calculations is n
.
Covariance matrices and other information.
n <- 8 ; p <- 3
X <- matrix(rnorm(n * p), ncol = p)
y <- sample(1:2, size = n, replace = TRUE)
X
y
matW(X, y)
matB(X, y)
matW(X, y)$W + matB(X, y)$B
(n - 1) / n * cov(X)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.