getWithin: Within-class Covariance Matrix

Description Usage Arguments Details Author(s) See Also Examples

View source: R/getWithin.R

Description

Calculates the estimated within-class covariance matrix

Usage

1
  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)

Author(s)

Gaston Sanchez

See Also

withinCov

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## 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)

gastonstat/DiscriMiner documentation built on Feb. 27, 2021, 4:58 a.m.