# sharedPartner_stat

0th

Percentile

##### Calculate (un-)weighted shared partner change statistics for multi-edge graphs.

The function calculates the change statistic for shared partners for each dyad in the graph. Shared partner statistics count for each dyad involving nodes i and j in the graph, how many nodes k these two nodes have in common (or share). The shared partner $k$ counts are weighted by their interactions with the focal nodes $i$ and $j$. This is neccessary in dense multi-edge graphs to ensure that meaningful triadic closure is detected. The statistic can be calculated in 3 different forms: undirected, incoming shared partners (where shared partner k: k->i and k->j) and outgoing shared partners (where shared partner k: k<-i and k<-j).

##### Usage
sharedPartner_stat(
graph,
directed,
weighted = TRUE,
nodes = NULL,
zero_values = NULL
)
##### Arguments
graph

A graph adjacency matrix or an edgelist. The edgelist needs to have 3 columns: a sender vector, a target vector and an edgecount vector.

directed

boolean. Is the graph directed? If zero_values is not specified, the 0.1 is used instead.

weighted

set to TRUE.

set to undirected. Can be set to incoming or outgoing instead. This then corresponds to directd triadic closure in the multi-edge graph.

nodes

optional character/factor vector. If an edgelist is provied, you have to provide a list of unique identifiers of your nodes in the graph. This is because in the edgelist, isolates are usually not recorded. If you do not specify isolates in your nodes object, they are excluded from the analysis (falsifies data).

zero_values

optional numeric value. Use this to substitute zero-values in your shared partner change statistic matrix. Zero values in the predictors are recognized in the gHypEG regression as structural zeros. To ensure this does not happen, please recode your zero-values in all your predictors.

##### Value

Shared partner change statistic matrix.

reciprocity_stat or homophily_stat