[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] help with NA's in assortativity
From: |
Tamás Nepusz |
Subject: |
Re: [igraph] help with NA's in assortativity |
Date: |
Wed, 25 Jul 2012 15:32:18 +0200 |
Hi Vicky,
> Can igraph calculate the assortativity when NA's are present? If not, how do
> I remove these nodes?
I don't think that there is explicit support for NA's in the assortativity
function (although it would be a nice feature to add -- how about that, Gabor?
:)), so there are three options right now:
1) Replace the NAs with a third class and calculate the assortativity. This is
scientifically sound only if you can assume that NAs belong to a class that is
distinct from class 1 or class 2 (i.e. the ones you already have). I will
propose a better approach later, but this could serve as a quick estimate.
2) Remove the nodes with the NAs from the graph and calculate the assortativity.
3) Estimate the probability of each of the classes from the present data (e.g.,
by taking the fraction of 1's and 2's), and then replace the NAs with randomly
generated classes (1 or 2) and calculate the assortativity. This should
probably be repeated, say, ten thousand times, and the results averaged. I
think this is the safest approach if you can assume that nodes with an NA
belong either to class 1 or class 2 but you don't know which.
Best,
Tamas
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [igraph] help with NA's in assortativity,
Tamás Nepusz <=