DiscriMiner (version 0.1-29)

getWithin: Within-class Covariance Matrix

Description

Calculates the estimated within-class covariance matrix

Usage

getWithin(variables, group)

Arguments

variables
matrix or data frame with explanatory variables (No missing values are allowed)
group
vector or factor with group memberships (No missing values are allowed)

Details

The obtained matrix is the estimated within-class covariance matrix (i.e. within-class covariance matrix divided by its degrees of freedom n-k, where n is the number of observations and k is the number of groups)

See Also

withinCov

Examples

Run this code
## Not run: 
#   # load iris dataset
#   data(iris)
# 
#   # estimated within-class covariance matrix (dividing by n-k)
#   getWithin(iris[,1:4], iris[,5])
# 
#   # compared to the within-class covariance matrix (dividing by n-1)
#   withinCov(iris[,1:4], iris[,5])
#   ## End(Not run)

Run the code above in your browser using DataCamp Workspace