correlation_with_size function

Correlation with size

Correlation with size

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

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

Returns

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)
  • Maintainer: Marion Hoffman
  • License: GPL (>= 3)
  • Last published: 2024-05-10