statnet / ergm.ego

Fit, Simulate and Diagnose Exponential-Family Random Graph Models to Egocentrically Sampled Network Data https://statnet.org
Other
14 stars 4 forks source link

`ergm.ego` fails when there are levels in an alter attribute not present in the ego attribute. #13

Closed krivit closed 6 years ago

krivit commented 6 years ago

What happens is that the pseudopopulation network lacks actors with that level, which means that the ergm model does not have a term for that level; but the EgoStat.* functions can still "see" it, so it generates a statistic for this nonexistent term, causing a name mismatch.

sumich commented 6 years ago

How do you account for dyadic variates then such as as relatedness between the alter and the ego? It isn't individual specific so it can't be attributed to either the alter or the ego.

krivit commented 6 years ago

Terms like mix and nodematch evaluate the dyad-level covariate based on the interaction of the individual attributes.

sumich commented 6 years ago

But as far as adding them to the data frame, should they be added to the ego or alter file? Or both files?

krivit commented 6 years ago

Both, in this case. I would recommend going through the tutorials.

sumich commented 6 years ago

My problem then is if I have more than one alter tied to an ego. Each alter will have a dyadic variate specific to their ego but each ego will have more than one dyadic variate, one for each alter. And if the attributes must be the same then will this cause a problem?

I am currently working through your tutorial (located here https://statnet.org/trac/raw-attachment/wiki/Sunbelt2015/ergmEgo_tutorial.html). It does not seem to address this issue.

krivit commented 6 years ago

I see. Unfortunately, this is a case where egocentric inference may not be possible using existing methodology. Briefly, inference requires that we be able to reconstruct the dyadic covariate for every pair of actors, whether or not they are actually connected in the dataset. This is possible when the dyadic covariate is a function of the ego's and alter's attribute (e.g., whether the two actors are of the same sex can be reconstructed from their individual sexes), but it's not possible when it can't be recovered this way (or the actor attribute is not observed). Then, recovery is impossible.

For a more concrete example,