similar_pairs {ERPM} | R Documentation |
Similar pairs of individuals in a partition
Description
This function computes the total number, the average number having the close values of a numerical variable and the number of individuals a partition.
Usage
similar_pairs(partition, attribute, stat, threshold)
Arguments
partition |
A partition (vector) |
attribute |
A vector containing the values of the attribute |
stat |
The statistic to compute : 'avg_pergroup' for the average, 'sum_pergroup' for the sum, 'sum_perind' and 'avg_perind' for individuals |
threshold |
Threshold to determine if 2 individuals attributes values are close |
Value
The statisic chosen in stat
Examples
p <- c(1,2,2,3,3,4,4,4,5)
at <- c(3,5,23,2,1,0,3,9,2)
similar_pairs(p,at,1,'avg_pergroup')
[Package ERPM version 0.2.0 Index]