correlation_with_size {ERPM}R Documentation

Correlation with size

Description

This function computes the correlation between an attribute and the size of the groups.

Usage

correlation_with_size(partition, attribute, categorical)

Arguments

partition

A partition (vector)

attribute

A vector containing the values of the attribute

categorical

A Boolean (True or False) indicating if the attribute is categorical

Value

A number corresponding to the correlation coefficient if the attribute is numerical or the correlation ratio if the attribute is categorical.

Examples

p <- c(1,2,2,3,3,4,4,4,5)
at <- c(3,5,23,2,1,0,3,9,2)
correlation_with_size(p,at,categorical=FALSE)

[Package ERPM version 0.2.0 Index]