2

Just starting out with ERGM so apologies if the following question is not logical. I have tried to search on this site, and statnet_help, with no luck.

I was wondering whether the ergm() function in statnet can now cope with missing data on attributes? I have coded it as 'na' in R but running the following ergm model resulted in an error.

    > m2 <- ergm(d1~edges + nodecov('wellbeing')) 

    > Error in ergm.getglobalstats(nw, model, response = response) : 
    > NA/NaN/Inf in foreign function call (arg 13) 

The attribute variable in question is continuous.

Many thanks, S

Evelyn
  • 451
  • 1
  • 4
  • 6

1 Answers1

3

I don't think it is possible to have NAs on edge/node covariates. It is not very clear how should they be treated anyway. Depending on your interests in tracing the importance of nodes with missing data you might try:

  • Imputing NAs with some sensible values (even a mean)
  • Adding a binary covariate equal to 1 for NA and 0 otherwise and using it in nodecov and perhaps some other effects to check whether there is any evidence for these nodes to have some special role in the network structure.
Michał
  • 2,755
  • 1
  • 17
  • 20