I am trying to model the formation of ties in a directed network. For context, the tie I am analyzing is people nominating others as talented. I am executing Exponential Random Graph Models to ask what predicts a nomination.
Among other things, I want to test whether being friends (I have network data about that too) affects the odds of nominating them as smart.
I am therefore using edgecov(graph) as a variable, which gives us this code:
model <- ergm(
graph ~ edges + mutual + gwidegree(decay = 0.5, fixed = TRUE) +
gwodegree(decay = 0.5, fixed = TRUE) + nodematch("class") +
nodeifactor("gender") + nodeifactor("race") + nodeifactor("edu") +
nodeofactor("gender") + nodeofactor("race") + nodeofactor("edu") +
edgecov(friends)
)
My problem is that I get thuis error message:
> Error in if (any(low.drop.theta)) message(paste("Observed statistic(s)", :
> missing value where TRUE/FALSE needed
I am fairly confident that this comes from the fact that my friendship network has missing edges (I ran a test, and the exact same code does work if I change the friendship graph by recoding the missing edges as 0 - but that option would not be not quite satisfactory).
Any ideas as to what is going on / how to fix this?