Learn R Programming

Morpho (version 2.12)

covW: calculate the pooled within groups covariance matrix

Description

calculate the pooled within groups covariance matrix

Usage

covW(data, groups, robust = c("classical", "mve", "mcd"), ...)

Value

Returns the pooled within group covariance matrix. The attributes contain the entry means, containing the respective group means.

Arguments

data

a matrix containing data

groups

grouping variables

robust

character: determines covariance estimation methods in case sep=TRUE, when covariance matrices and group means can be estimated robustly using MASS::cov.rob. Default is the standard product-moment covariance matrix.

...

additional parameters passed to MASS::cov.rob for robust covariance and mean estimations.

Author

Stefan Schlager

See Also

cov, typprobClass

Examples

Run this code
data(iris)
poolCov <- covW(iris[,1:4],iris[,5])

Run the code above in your browser using DataLab