1

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?

Michał
  • 2,755
  • 1
  • 17
  • 20
Ben
  • 11
  • 1

1 Answers1

0

As is advisable in general, one should be explicit in dealing with missing data before modeling other things. Next to setting all to 0s, or perhaps some smarter imputations (c.f. https://doi.org/10.1016/j.socnet.2015.12.003), an alternative might be to model their effect with a separate term such that the effect of friendship network on "talented" nominations will be represented with two parameters. You will need two dyadcovs:

  1. Matrix with 1s for friendships and 0s otherwise (including missing)
  2. Matrix with 1s for missing friendhip dyads and 0s otherwise (including friendships)

The interpretation of parameters will be not unlike having a three-category independent variable in regression -- friendship present, absent, and missing -- with "absent" as the reference category.

Michał
  • 2,755
  • 1
  • 17
  • 20