0
$\begingroup$

I have a setup where I have a directed graph $G = (V,E)$ and a node attributes vector $\overrightarrow{x}$ with $|\overrightarrow{x}| = |V|$ and $\forall x_i \in \overrightarrow{x}$, it holds $x_i \in [-1, +1]$.

I would like to measure the homophily in the network with respect to the opinion values of each node, that is, measuring if nodes are likely to be connected with other nodes with the same/close opinion value.

I think that a measure that could help me is the assortativity implemented in networkx, where you can find a numeric version and an attribute version. The numeric version can't be used because it requests integers and not floats, the attribute one doesn't throw any error, but I think it treats each value like a category without considering the real distance, therefore it is not proper for me.

I have found a similar thread, but it seems like a different problem.

Can you suggest me some other network homophily measures for my case?

$\endgroup$
  • $\begingroup$ Even though the question you mention is different, its answers contain some information which is relevant to your own question. In particular, the igraph package can compute the assortativity for scalar attributes, did you try it? igraph.org/r/doc/assortativity.html $\endgroup$ – Vincent Labatut Apr 6 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.