withinCov(variables, group, div_by_n = FALSE)
div_by_n=TRUE
the covariance matrices are
divided by n (number of observations), otherwise they are
divided by n-1
withinSS
, betweenCov
,
totalCov
## Not run:
# # load iris dataset
# data(iris)
#
# # within-class covariance matrix (dividing by n-1)
# withinCov(iris[,1:4], iris[,5])
#
# # within-class covariance matrix (dividing by n)
# withinCov(iris[,1:4], iris[,5], div_by_n=TRUE)
# ## End(Not run)
Run the code above in your browser using DataLab