Learn R Programming

DiscriMiner (version 0.1-29)

totalCov: Total Covariance Matrix

Description

Calculates total covariance matrix

Usage

totalCov(variables, div_by_n = FALSE)

Arguments

variables
matrix or data frame with explanatory variables (No missing values are allowed)
div_by_n
logical indicating division by number of observations

Details

When div_by_n=TRUE the covariance matrices are divided by n (number of observations), otherwise they are divided by n-1

See Also

totalSS, betweenCov, withinCov

Examples

Run this code
## Not run: 
#   # load iris dataset
#   data(iris)
# 
#   # total covariance matrix (dividing by n-1)
#   totalCov(iris[,1:4])
# 
#   # total covariance matrix (dividing by n)
#   totalCov(iris[,1:4], div_by_n=TRUE)
#   ## End(Not run)

Run the code above in your browser using DataLab