number_ties: Same pairs of individuals in a partition

View source: R/functions_statistics.R

number_tiesR Documentation

Same pairs of individuals in a partition

Description

This function computes the number of ties.

Usage

number_ties(partition, dyadic_attribute, stat)

Arguments

partition

A partition (vector)

dyadic_attribute

A matrix containing the values of the attribute

stat

The statistic to compute : 'avg_pergroup' for the average per group , 'sum_pergroup' for the sum, 'sum_perind' and 'avg_perind' for the number of ties per individuals each individual has in its group.

Value

The statisic chosen in stat

Examples

p <- c(1,2,2,3,3,4)
v <- c(0,0,0,0,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0)
at <- matrix(v,6,6, byrow = TRUE)
number_ties(p,at,'avg_pergroup')

ERPM documentation built on May 29, 2024, 10:05 a.m.